diff --git a/_quarto.yml b/_quarto.yml index 3e98b44..c01b298 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -7,7 +7,7 @@ website: favicon: assets/images/Logo-Mark_Black.png navbar: left: - - href: RIN-data-infrastructure.qmd + - href: index.qmd text: "Rural Innovation Network data" sidebar: style: "docked" diff --git a/assets/.DS_Store b/assets/.DS_Store new file mode 100644 index 0000000..a006698 Binary files /dev/null and b/assets/.DS_Store differ diff --git a/assets/fonts.css b/assets/fonts.css new file mode 100644 index 0000000..7b8ba8c --- /dev/null +++ b/assets/fonts.css @@ -0,0 +1,127 @@ +@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Lato:400,700,400italic,700italic'); +@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;500;600;700&display=swap'); + +@font-face { + font-family: 'TT Hoves'; + font-weight: normal; + font-style: normal; + src: local('TT Hoves'), + url('./fonts/TypeType - TT Hoves Regular.ttf') format('truetype'), + url('./fonts/TTHoves-Regular/font.woff') format("woff"), + url('./fonts/TTHoves-Regular/font.woff2') format("woff2"), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Regular.ttf') format('truetype'), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff') format("woff"), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Regular/font.woff2') format("woff2"); +} + +@font-face { + font-family: 'TT Hoves Bold'; + font-weight: bold; + font-style: normal; + src: local('TT Hoves'), + url('./fonts/TypeType - TT Hoves Bold.ttf') format('truetype'), + url('./fonts/TTHoves-Bold/font.woff') format("woff"), + url('./fonts/TTHoves-Bold/font.woff2') format("woff2"), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Bold.ttf') format('truetype'), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff') format("woff"), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Bold/font.woff2') format("woff2"); +} + +@font-face { + font-family: 'TT Hoves Medium'; + font-weight: 500; + font-style: normal; + src: local('TT Hoves'), + url('./fonts/TypeType - TT Hoves Medium.ttf') format('truetype'), + url('./fonts/TTHoves-Medium/font.woff') format("woff"), + url('./fonts/TTHoves-Medium/font.woff2') format("woff2"), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Medium.ttf') format('truetype'), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff') format("woff"), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Medium/font.woff2') format("woff2"); +} + +@font-face { + font-family: 'TT Hoves Italic'; + font-weight: normal; + font-style: italic; + src: local('TT Hoves'), + url('./fonts/TypeType - TT Hoves Italic.ttf') format('truetype'), + url('./fonts/TTHoves-Italic/font.woff') format("woff"), + url('./fonts/TTHoves-Italic/font.woff2') format("woff2"), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TypeType - TT Hoves Italic.ttf') format('truetype'), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff') format("woff"), + url('https://cori-risi-apps.s3.amazonaws.com/fonts/TTHoves-Italic/font.woff2') format("woff2"); +} + + +/* Typography +–––––––––––––––––––––––––––––––––––––––––––––––––– */ + +/* default */ +html, body { + font-family: "Montserrat", "Bitter", serif; +} + +h1, h2, h3, h4, h5, h6 { + font-weight: 400; + font-family: "Montserrat", "TT Hoves", sans-serif; +} + +h1, h2, h6 { + font-family: "Montserrat", "TT Hoves Bold", "TT Hoves", sans-serif; + font-weight: 700; +} + +h3 { + font-family: "Montserrat", "TT Hoves Medium", "TT Hoves", "Bitter", serif; + font-weight: 400; +} + +h4, h5 { + font-family: "Montserrat", "TT Hoves Medium", "TT Hoves", sans-serif; + font-weight: 500; +} + +h1 { font-size: 3.2em; line-height: 1.16; } +h2 { font-size: 2.4em; line-height: 1.25; } +h3 { font-size: 1.8em; line-height: 1.3; } +h4 { font-size: 1.5em; line-height: 1.3; } +h5 { font-size: 1.2em; line-height: 1.3; } +h6 { font-size: .76em; line-height: 1.35; } + +/* Larger than phablet */ +@media (min-width: 550px) { + h1 { font-size: 2.8em; } + h2 { font-size: 2.3em; } + h3 { font-size: 1.8em; } + h4 { font-size: 1.5em; } + h5 { font-size: 1.2em; } + h6 { font-size: 1.0em; } +} + +p { + font-family: "Bitter", serif; + font-size: 1em; + line-height: 1.7; +} + +a { + font-family: "Bitter", serif; + font-size: 1em; + font-weight: normal; + line-height: 1.7; + text-decoration: underline; +} + +a:hover { + text-decoration: underline; + cursor: pointer; +} + +.nav-item a, .sidebar-item a { + font-family: "Montserrat", "TT Hoves", sans-serif; + font-weight: normal; +} diff --git a/assets/images/standard_cori_prez.png b/assets/images/standard_cori_prez.png new file mode 100644 index 0000000..9a284ca Binary files /dev/null and b/assets/images/standard_cori_prez.png differ diff --git a/assets/index-0b9b7d26.js b/assets/index-0b9b7d26.js deleted file mode 100644 index 7145046..0000000 --- a/assets/index-0b9b7d26.js +++ /dev/null @@ -1,1396 +0,0 @@ -function LP(e,n){for(var l=0;lh[m]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))h(m);new MutationObserver(m=>{for(const v of m)if(v.type==="childList")for(const E of v.addedNodes)E.tagName==="LINK"&&E.rel==="modulepreload"&&h(E)}).observe(document,{childList:!0,subtree:!0});function l(m){const v={};return m.integrity&&(v.integrity=m.integrity),m.referrerPolicy&&(v.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?v.credentials="include":m.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function h(m){if(m.ep)return;m.ep=!0;const v=l(m);fetch(m.href,v)}})();var Go=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function g1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function XT(e){if(e.__esModule)return e;var n=e.default;if(typeof n=="function"){var l=function h(){return this instanceof h?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};l.prototype=n.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(e).forEach(function(h){var m=Object.getOwnPropertyDescriptor(e,h);Object.defineProperty(l,h,m.get?m:{enumerable:!0,get:function(){return e[h]}})}),l}var KT={exports:{}},Yt={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Yp=Symbol.for("react.element"),RP=Symbol.for("react.portal"),DP=Symbol.for("react.fragment"),OP=Symbol.for("react.strict_mode"),BP=Symbol.for("react.profiler"),FP=Symbol.for("react.provider"),NP=Symbol.for("react.context"),UP=Symbol.for("react.forward_ref"),jP=Symbol.for("react.suspense"),VP=Symbol.for("react.memo"),$P=Symbol.for("react.lazy"),v2=Symbol.iterator;function GP(e){return e===null||typeof e!="object"?null:(e=v2&&e[v2]||e["@@iterator"],typeof e=="function"?e:null)}var YT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},JT=Object.assign,QT={};function hh(e,n,l){this.props=e,this.context=n,this.refs=QT,this.updater=l||YT}hh.prototype.isReactComponent={};hh.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")};hh.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function eS(){}eS.prototype=hh.prototype;function _1(e,n,l){this.props=e,this.context=n,this.refs=QT,this.updater=l||YT}var y1=_1.prototype=new eS;y1.constructor=_1;JT(y1,hh.prototype);y1.isPureReactComponent=!0;var x2=Array.isArray,tS=Object.prototype.hasOwnProperty,v1={current:null},nS={key:!0,ref:!0,__self:!0,__source:!0};function rS(e,n,l){var h,m={},v=null,E=null;if(n!=null)for(h in n.ref!==void 0&&(E=n.ref),n.key!==void 0&&(v=""+n.key),n)tS.call(n,h)&&!nS.hasOwnProperty(h)&&(m[h]=n[h]);var s=arguments.length-2;if(s===1)m.children=l;else if(1>>1,dn=Je[Bt];if(0>>1;Btm(ii,xt))arm(br,ii)?(Je[Bt]=br,Je[ar]=xt,Bt=ar):(Je[Bt]=ii,Je[sr]=xt,Bt=sr);else if(arm(br,xt))Je[Bt]=br,Je[ar]=xt,Bt=ar;else break e}}return Tt}function m(Je,Tt){var xt=Je.sortIndex-Tt.sortIndex;return xt!==0?xt:Je.id-Tt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var v=performance;e.unstable_now=function(){return v.now()}}else{var E=Date,s=E.now();e.unstable_now=function(){return E.now()-s}}var k=[],D=[],V=1,G=null,J=3,ve=!1,ae=!1,me=!1,Ce=typeof setTimeout=="function"?setTimeout:null,ie=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function le(Je){for(var Tt=l(D);Tt!==null;){if(Tt.callback===null)h(D);else if(Tt.startTime<=Je)h(D),Tt.sortIndex=Tt.expirationTime,n(k,Tt);else break;Tt=l(D)}}function ze(Je){if(me=!1,le(Je),!ae)if(l(k)!==null)ae=!0,Li(Oe);else{var Tt=l(D);Tt!==null&&Ki(ze,Tt.startTime-Je)}}function Oe(Je,Tt){ae=!1,me&&(me=!1,ie(ht),ht=-1),ve=!0;var xt=J;try{for(le(Tt),G=l(k);G!==null&&(!(G.expirationTime>Tt)||Je&&!wr());){var Bt=G.callback;if(typeof Bt=="function"){G.callback=null,J=G.priorityLevel;var dn=Bt(G.expirationTime<=Tt);Tt=e.unstable_now(),typeof dn=="function"?G.callback=dn:G===l(k)&&h(k),le(Tt)}else h(k);G=l(k)}if(G!==null)var vn=!0;else{var sr=l(D);sr!==null&&Ki(ze,sr.startTime-Tt),vn=!1}return vn}finally{G=null,J=xt,ve=!1}}var Ke=!1,He=null,ht=-1,Ve=5,jt=-1;function wr(){return!(e.unstable_now()-jtJe||125Bt?(Je.sortIndex=xt,n(D,Je),l(k)===null&&Je===l(D)&&(me?(ie(ht),ht=-1):me=!0,Ki(ze,xt-Bt))):(Je.sortIndex=dn,n(k,Je),ae||ve||(ae=!0,Li(Oe))),Je},e.unstable_shouldYield=wr,e.unstable_wrapCallback=function(Je){var Tt=J;return function(){var xt=J;J=Tt;try{return Je.apply(this,arguments)}finally{J=xt}}}})(aS);sS.exports=aS;var XP=sS.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var KP=ut,Zi=XP;function it(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,l=1;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cv=Object.prototype.hasOwnProperty,YP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,b2={},E2={};function JP(e){return cv.call(E2,e)?!0:cv.call(b2,e)?!1:YP.test(e)?E2[e]=!0:(b2[e]=!0,!1)}function QP(e,n,l,h){if(l!==null&&l.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return h?!1:l!==null?!l.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ez(e,n,l,h){if(n===null||typeof n>"u"||QP(e,n,l,h))return!0;if(h)return!1;if(l!==null)switch(l.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function di(e,n,l,h,m,v,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=h,this.attributeNamespace=m,this.mustUseProperty=l,this.propertyName=e,this.type=n,this.sanitizeURL=v,this.removeEmptyString=E}var jr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jr[e]=new di(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];jr[n]=new di(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jr[e]=new di(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jr[e]=new di(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){jr[e]=new di(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jr[e]=new di(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jr[e]=new di(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jr[e]=new di(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jr[e]=new di(e,5,!1,e.toLowerCase(),null,!1,!1)});var w1=/[\-:]([a-z])/g;function b1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jr[e]=new di(e,1,!1,e.toLowerCase(),null,!1,!1)});jr.xlinkHref=new di("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jr[e]=new di(e,1,!1,e.toLowerCase(),null,!0,!0)});function E1(e,n,l,h){var m=jr.hasOwnProperty(n)?jr[n]:null;(m!==null?m.type!==0:h||!(2s||m[E]!==v[s]){var k=` -`+m[E].replace(" at new "," at ");return e.displayName&&k.includes("")&&(k=k.replace("",e.displayName)),k}while(1<=E&&0<=s);break}}}finally{A0=!1,Error.prepareStackTrace=l}return(e=e?e.displayName||e.name:"")?up(e):""}function tz(e){switch(e.tag){case 5:return up(e.type);case 16:return up("Lazy");case 13:return up("Suspense");case 19:return up("SuspenseList");case 0:case 2:case 15:return e=C0(e.type,!1),e;case 11:return e=C0(e.type.render,!1),e;case 1:return e=C0(e.type,!0),e;default:return""}}function pv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Lu:return"Fragment";case zu:return"Portal";case uv:return"Profiler";case T1:return"StrictMode";case hv:return"Suspense";case dv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case uS:return(e.displayName||"Context")+".Consumer";case cS:return(e._context.displayName||"Context")+".Provider";case S1:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A1:return n=e.displayName||null,n!==null?n:pv(e.type)||"Memo";case Ga:n=e._payload,e=e._init;try{return pv(e(n))}catch{}}return null}function nz(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pv(n);case 8:return n===T1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function sl(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dS(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function rz(e){var n=dS(e)?"checked":"value",l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),h=""+e[n];if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var m=l.get,v=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return m.call(this)},set:function(E){h=""+E,v.call(this,E)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return h},setValue:function(E){h=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Dm(e){e._valueTracker||(e._valueTracker=rz(e))}function pS(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),h="";return e&&(h=dS(e)?e.checked?"true":"false":e.value),e=h,e!==l?(n.setValue(e),!0):!1}function Sg(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fv(e,n){var l=n.checked;return Qn({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??e._wrapperState.initialChecked})}function S2(e,n){var l=n.defaultValue==null?"":n.defaultValue,h=n.checked!=null?n.checked:n.defaultChecked;l=sl(n.value!=null?n.value:l),e._wrapperState={initialChecked:h,initialValue:l,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function fS(e,n){n=n.checked,n!=null&&E1(e,"checked",n,!1)}function mv(e,n){fS(e,n);var l=sl(n.value),h=n.type;if(l!=null)h==="number"?(l===0&&e.value===""||e.value!=l)&&(e.value=""+l):e.value!==""+l&&(e.value=""+l);else if(h==="submit"||h==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?gv(e,n.type,l):n.hasOwnProperty("defaultValue")&&gv(e,n.type,sl(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function A2(e,n,l){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var h=n.type;if(!(h!=="submit"&&h!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,l||n===e.value||(e.value=n),e.defaultValue=n}l=e.name,l!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,l!==""&&(e.name=l)}function gv(e,n,l){(n!=="number"||Sg(e.ownerDocument)!==e)&&(l==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+l&&(e.defaultValue=""+l))}var hp=Array.isArray;function qu(e,n,l,h){if(e=e.options,n){n={};for(var m=0;m"+n.valueOf().toString()+"",n=Om.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Ap(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var fp={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},iz=["Webkit","ms","Moz","O"];Object.keys(fp).forEach(function(e){iz.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),fp[n]=fp[e]})});function yS(e,n,l){return n==null||typeof n=="boolean"||n===""?"":l||typeof n!="number"||n===0||fp.hasOwnProperty(e)&&fp[e]?(""+n).trim():n+"px"}function vS(e,n){e=e.style;for(var l in n)if(n.hasOwnProperty(l)){var h=l.indexOf("--")===0,m=yS(l,n[l],h);l==="float"&&(l="cssFloat"),h?e.setProperty(l,m):e[l]=m}}var oz=Qn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vv(e,n){if(n){if(oz[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(it(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(it(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(it(61))}if(n.style!=null&&typeof n.style!="object")throw Error(it(62))}}function xv(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wv=null;function C1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bv=null,Wu=null,Zu=null;function k2(e){if(e=ef(e)){if(typeof bv!="function")throw Error(it(280));var n=e.stateNode;n&&(n=h_(n),bv(e.stateNode,e.type,n))}}function xS(e){Wu?Zu?Zu.push(e):Zu=[e]:Wu=e}function wS(){if(Wu){var e=Wu,n=Zu;if(Zu=Wu=null,k2(e),n)for(e=0;e>>=0,e===0?32:31-(gz(e)/_z|0)|0}var Bm=64,Fm=4194304;function dp(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kg(e,n){var l=e.pendingLanes;if(l===0)return 0;var h=0,m=e.suspendedLanes,v=e.pingedLanes,E=l&268435455;if(E!==0){var s=E&~m;s!==0?h=dp(s):(v&=E,v!==0&&(h=dp(v)))}else E=l&~m,E!==0?h=dp(E):v!==0&&(h=dp(v));if(h===0)return 0;if(n!==0&&n!==h&&!(n&m)&&(m=h&-h,v=n&-n,m>=v||m===16&&(v&4194240)!==0))return n;if(h&4&&(h|=l&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=h;0l;l++)n.push(e);return n}function Jp(e,n,l){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-qo(n),e[n]=l}function wz(e,n){var l=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var h=e.eventTimes;for(e=e.expirationTimes;0=gp),F2=String.fromCharCode(32),N2=!1;function jS(e,n){switch(e){case"keyup":return Xz.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function VS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ru=!1;function Yz(e,n){switch(e){case"compositionend":return VS(n);case"keypress":return n.which!==32?null:(N2=!0,F2);case"textInput":return e=n.data,e===F2&&N2?null:e;default:return null}}function Jz(e,n){if(Ru)return e==="compositionend"||!D1&&jS(e,n)?(e=NS(),ag=z1=Ha=null,Ru=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:l,offset:n-e};e=h}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=$2(l)}}function WS(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?WS(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ZS(){for(var e=window,n=Sg();n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=Sg(e.document)}return n}function O1(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function aL(e){var n=ZS(),l=e.focusedElem,h=e.selectionRange;if(n!==l&&l&&l.ownerDocument&&WS(l.ownerDocument.documentElement,l)){if(h!==null&&O1(l)){if(n=h.start,e=h.end,e===void 0&&(e=n),"selectionStart"in l)l.selectionStart=n,l.selectionEnd=Math.min(e,l.value.length);else if(e=(n=l.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var m=l.textContent.length,v=Math.min(h.start,m);h=h.end===void 0?v:Math.min(h.end,m),!e.extend&&v>h&&(m=h,h=v,v=m),m=G2(l,v);var E=G2(l,h);m&&E&&(e.rangeCount!==1||e.anchorNode!==m.node||e.anchorOffset!==m.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(m.node,m.offset),e.removeAllRanges(),v>h?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=l;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l=document.documentMode,Du=null,Iv=null,yp=null,kv=!1;function q2(e,n,l){var h=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;kv||Du==null||Du!==Sg(h)||(h=Du,"selectionStart"in h&&O1(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),yp&&zp(yp,h)||(yp=h,h=zg(Iv,"onSelect"),0Fu||(e.current=Dv[Fu],Dv[Fu]=null,Fu--)}function Pn(e,n){Fu++,Dv[Fu]=e.current,e.current=n}var al={},ni=hl(al),Ci=hl(!1),mc=al;function nh(e,n){var l=e.type.contextTypes;if(!l)return al;var h=e.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===n)return h.__reactInternalMemoizedMaskedChildContext;var m={},v;for(v in l)m[v]=n[v];return h&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=m),m}function Ii(e){return e=e.childContextTypes,e!=null}function Rg(){On(Ci),On(ni)}function J2(e,n,l){if(ni.current!==al)throw Error(it(168));Pn(ni,n),Pn(Ci,l)}function nA(e,n,l){var h=e.stateNode;if(n=n.childContextTypes,typeof h.getChildContext!="function")return l;h=h.getChildContext();for(var m in h)if(!(m in n))throw Error(it(108,nz(e)||"Unknown",m));return Qn({},l,h)}function Dg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||al,mc=ni.current,Pn(ni,e),Pn(Ci,Ci.current),!0}function Q2(e,n,l){var h=e.stateNode;if(!h)throw Error(it(169));l?(e=nA(e,n,mc),h.__reactInternalMemoizedMergedChildContext=e,On(Ci),On(ni),Pn(ni,e)):On(Ci),Pn(Ci,l)}var Hs=null,d_=!1,j0=!1;function rA(e){Hs===null?Hs=[e]:Hs.push(e)}function vL(e){d_=!0,rA(e)}function dl(){if(!j0&&Hs!==null){j0=!0;var e=0,n=Tn;try{var l=Hs;for(Tn=1;e>=E,m-=E,Ys=1<<32-qo(n)+m|l<ht?(Ve=He,He=null):Ve=He.sibling;var jt=J(ie,He,le[ht],ze);if(jt===null){He===null&&(He=Ve);break}e&&He&&jt.alternate===null&&n(ie,He),te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt,He=Ve}if(ht===le.length)return l(ie,He),jn&&sc(ie,ht),Oe;if(He===null){for(;htht?(Ve=He,He=null):Ve=He.sibling;var wr=J(ie,He,jt.value,ze);if(wr===null){He===null&&(He=Ve);break}e&&He&&wr.alternate===null&&n(ie,He),te=v(wr,te,ht),Ke===null?Oe=wr:Ke.sibling=wr,Ke=wr,He=Ve}if(jt.done)return l(ie,He),jn&&sc(ie,ht),Oe;if(He===null){for(;!jt.done;ht++,jt=le.next())jt=G(ie,jt.value,ze),jt!==null&&(te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt);return jn&&sc(ie,ht),Oe}for(He=h(ie,He);!jt.done;ht++,jt=le.next())jt=ve(He,ie,ht,jt.value,ze),jt!==null&&(e&&jt.alternate!==null&&He.delete(jt.key===null?ht:jt.key),te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt);return e&&He.forEach(function(St){return n(ie,St)}),jn&&sc(ie,ht),Oe}function Ce(ie,te,le,ze){if(typeof le=="object"&&le!==null&&le.type===Lu&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case Rm:e:{for(var Oe=le.key,Ke=te;Ke!==null;){if(Ke.key===Oe){if(Oe=le.type,Oe===Lu){if(Ke.tag===7){l(ie,Ke.sibling),te=m(Ke,le.props.children),te.return=ie,ie=te;break e}}else if(Ke.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===Ga&&nE(Oe)===Ke.type){l(ie,Ke.sibling),te=m(Ke,le.props),te.ref=rp(ie,Ke,le),te.return=ie,ie=te;break e}l(ie,Ke);break}else n(ie,Ke);Ke=Ke.sibling}le.type===Lu?(te=fc(le.props.children,ie.mode,ze,le.key),te.return=ie,ie=te):(ze=mg(le.type,le.key,le.props,null,ie.mode,ze),ze.ref=rp(ie,te,le),ze.return=ie,ie=ze)}return E(ie);case zu:e:{for(Ke=le.key;te!==null;){if(te.key===Ke)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){l(ie,te.sibling),te=m(te,le.children||[]),te.return=ie,ie=te;break e}else{l(ie,te);break}else n(ie,te);te=te.sibling}te=X0(le,ie.mode,ze),te.return=ie,ie=te}return E(ie);case Ga:return Ke=le._init,Ce(ie,te,Ke(le._payload),ze)}if(hp(le))return ae(ie,te,le,ze);if(Jd(le))return me(ie,te,le,ze);qm(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,te!==null&&te.tag===6?(l(ie,te.sibling),te=m(te,le),te.return=ie,ie=te):(l(ie,te),te=H0(le,ie.mode,ze),te.return=ie,ie=te),E(ie)):l(ie,te)}return Ce}var ih=aA(!0),lA=aA(!1),Fg=hl(null),Ng=null,ju=null,U1=null;function j1(){U1=ju=Ng=null}function V1(e){var n=Fg.current;On(Fg),e._currentValue=n}function Fv(e,n,l){for(;e!==null;){var h=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,h!==null&&(h.childLanes|=n)):h!==null&&(h.childLanes&n)!==n&&(h.childLanes|=n),e===l)break;e=e.return}}function Xu(e,n){Ng=e,U1=ju=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&n&&(Ai=!0),e.firstContext=null)}function mo(e){var n=e._currentValue;if(U1!==e)if(e={context:e,memoizedValue:n,next:null},ju===null){if(Ng===null)throw Error(it(308));ju=e,Ng.dependencies={lanes:0,firstContext:e}}else ju=ju.next=e;return n}var uc=null;function $1(e){uc===null?uc=[e]:uc.push(e)}function cA(e,n,l,h){var m=n.interleaved;return m===null?(l.next=l,$1(n)):(l.next=m.next,m.next=l),n.interleaved=l,ra(e,h)}function ra(e,n){e.lanes|=n;var l=e.alternate;for(l!==null&&(l.lanes|=n),l=e,e=e.return;e!==null;)e.childLanes|=n,l=e.alternate,l!==null&&(l.childLanes|=n),l=e,e=e.return;return l.tag===3?l.stateNode:null}var qa=!1;function G1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uA(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qs(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function tl(e,n,l){var h=e.updateQueue;if(h===null)return null;if(h=h.shared,nn&2){var m=h.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),h.pending=n,ra(e,l)}return m=h.interleaved,m===null?(n.next=n,$1(h)):(n.next=m.next,m.next=n),h.interleaved=n,ra(e,l)}function cg(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194240)!==0)){var h=n.lanes;h&=e.pendingLanes,l|=h,n.lanes=l,k1(e,l)}}function rE(e,n){var l=e.updateQueue,h=e.alternate;if(h!==null&&(h=h.updateQueue,l===h)){var m=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var E={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};v===null?m=v=E:v=v.next=E,l=l.next}while(l!==null);v===null?m=v=n:v=v.next=n}else m=v=n;l={baseState:h.baseState,firstBaseUpdate:m,lastBaseUpdate:v,shared:h.shared,effects:h.effects},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}function Ug(e,n,l,h){var m=e.updateQueue;qa=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,s=m.shared.pending;if(s!==null){m.shared.pending=null;var k=s,D=k.next;k.next=null,E===null?v=D:E.next=D,E=k;var V=e.alternate;V!==null&&(V=V.updateQueue,s=V.lastBaseUpdate,s!==E&&(s===null?V.firstBaseUpdate=D:s.next=D,V.lastBaseUpdate=k))}if(v!==null){var G=m.baseState;E=0,V=D=k=null,s=v;do{var J=s.lane,ve=s.eventTime;if((h&J)===J){V!==null&&(V=V.next={eventTime:ve,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var ae=e,me=s;switch(J=n,ve=l,me.tag){case 1:if(ae=me.payload,typeof ae=="function"){G=ae.call(ve,G,J);break e}G=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=me.payload,J=typeof ae=="function"?ae.call(ve,G,J):ae,J==null)break e;G=Qn({},G,J);break e;case 2:qa=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,J=m.effects,J===null?m.effects=[s]:J.push(s))}else ve={eventTime:ve,lane:J,tag:s.tag,payload:s.payload,callback:s.callback,next:null},V===null?(D=V=ve,k=G):V=V.next=ve,E|=J;if(s=s.next,s===null){if(s=m.shared.pending,s===null)break;J=s,s=J.next,J.next=null,m.lastBaseUpdate=J,m.shared.pending=null}}while(1);if(V===null&&(k=G),m.baseState=k,m.firstBaseUpdate=D,m.lastBaseUpdate=V,n=m.shared.interleaved,n!==null){m=n;do E|=m.lane,m=m.next;while(m!==n)}else v===null&&(m.shared.lanes=0);yc|=E,e.lanes=E,e.memoizedState=G}}function iE(e,n,l){if(e=n.effects,n.effects=null,e!==null)for(n=0;nl?l:4,e(!0);var h=$0.transition;$0.transition={};try{e(!1),n()}finally{Tn=l,$0.transition=h}}function CA(){return go().memoizedState}function EL(e,n,l){var h=rl(e);if(l={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null},IA(e))kA(n,l);else if(l=cA(e,n,l,h),l!==null){var m=ui();Wo(l,e,h,m),MA(l,n,h)}}function TL(e,n,l){var h=rl(e),m={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null};if(IA(e))kA(n,m);else{var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var E=n.lastRenderedState,s=v(E,l);if(m.hasEagerState=!0,m.eagerState=s,Xo(s,E)){var k=n.interleaved;k===null?(m.next=m,$1(n)):(m.next=k.next,k.next=m),n.interleaved=m;return}}catch{}finally{}l=cA(e,n,m,h),l!==null&&(m=ui(),Wo(l,e,h,m),MA(l,n,h))}}function IA(e){var n=e.alternate;return e===Jn||n!==null&&n===Jn}function kA(e,n){vp=Vg=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function MA(e,n,l){if(l&4194240){var h=n.lanes;h&=e.pendingLanes,l|=h,n.lanes=l,k1(e,l)}}var $g={readContext:mo,useCallback:Jr,useContext:Jr,useEffect:Jr,useImperativeHandle:Jr,useInsertionEffect:Jr,useLayoutEffect:Jr,useMemo:Jr,useReducer:Jr,useRef:Jr,useState:Jr,useDebugValue:Jr,useDeferredValue:Jr,useTransition:Jr,useMutableSource:Jr,useSyncExternalStore:Jr,useId:Jr,unstable_isNewReconciler:!1},SL={readContext:mo,useCallback:function(e,n){return gs().memoizedState=[e,n===void 0?null:n],e},useContext:mo,useEffect:sE,useImperativeHandle:function(e,n,l){return l=l!=null?l.concat([e]):null,hg(4194308,4,bA.bind(null,n,e),l)},useLayoutEffect:function(e,n){return hg(4194308,4,e,n)},useInsertionEffect:function(e,n){return hg(4,2,e,n)},useMemo:function(e,n){var l=gs();return n=n===void 0?null:n,e=e(),l.memoizedState=[e,n],e},useReducer:function(e,n,l){var h=gs();return n=l!==void 0?l(n):n,h.memoizedState=h.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},h.queue=e,e=e.dispatch=EL.bind(null,Jn,e),[h.memoizedState,e]},useRef:function(e){var n=gs();return e={current:e},n.memoizedState=e},useState:oE,useDebugValue:J1,useDeferredValue:function(e){return gs().memoizedState=e},useTransition:function(){var e=oE(!1),n=e[0];return e=bL.bind(null,e[1]),gs().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,l){var h=Jn,m=gs();if(jn){if(l===void 0)throw Error(it(407));l=l()}else{if(l=n(),Rr===null)throw Error(it(349));_c&30||fA(h,n,l)}m.memoizedState=l;var v={value:l,getSnapshot:n};return m.queue=v,sE(gA.bind(null,h,v,e),[e]),h.flags|=2048,Up(9,mA.bind(null,h,v,l,n),void 0,null),l},useId:function(){var e=gs(),n=Rr.identifierPrefix;if(jn){var l=Js,h=Ys;l=(h&~(1<<32-qo(h)-1)).toString(32)+l,n=":"+n+"R"+l,l=Fp++,0<\/script>",e=e.removeChild(e.firstChild)):typeof h.is=="string"?e=E.createElement(l,{is:h.is}):(e=E.createElement(l),l==="select"&&(E=e,h.multiple?E.multiple=!0:h.size&&(E.size=h.size))):e=E.createElementNS(e,l),e[ys]=n,e[Dp]=h,UA(e,n,!1,!1),n.stateNode=e;e:{switch(E=xv(l,h),l){case"dialog":Dn("cancel",e),Dn("close",e),m=h;break;case"iframe":case"object":case"embed":Dn("load",e),m=h;break;case"video":case"audio":for(m=0;mah&&(n.flags|=128,h=!0,ip(v,!1),n.lanes=4194304)}else{if(!h)if(e=jg(E),e!==null){if(n.flags|=128,h=!0,l=e.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),ip(v,!0),v.tail===null&&v.tailMode==="hidden"&&!E.alternate&&!jn)return Qr(n),null}else 2*lr()-v.renderingStartTime>ah&&l!==1073741824&&(n.flags|=128,h=!0,ip(v,!1),n.lanes=4194304);v.isBackwards?(E.sibling=n.child,n.child=E):(l=v.last,l!==null?l.sibling=E:n.child=E,v.last=E)}return v.tail!==null?(n=v.tail,v.rendering=n,v.tail=n.sibling,v.renderingStartTime=lr(),n.sibling=null,l=Yn.current,Pn(Yn,h?l&1|2:l&1),n):(Qr(n),null);case 22:case 23:return ix(),h=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==h&&(n.flags|=8192),h&&n.mode&1?ji&1073741824&&(Qr(n),n.subtreeFlags&6&&(n.flags|=8192)):Qr(n),null;case 24:return null;case 25:return null}throw Error(it(156,n.tag))}function LL(e,n){switch(F1(n),n.tag){case 1:return Ii(n.type)&&Rg(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return oh(),On(Ci),On(ni),Z1(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return W1(n),null;case 13:if(On(Yn),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(it(340));rh()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return On(Yn),null;case 4:return oh(),null;case 10:return V1(n.type._context),null;case 22:case 23:return ix(),null;case 24:return null;default:return null}}var Zm=!1,ti=!1,RL=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Vu(e,n){var l=e.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(h){or(e,n,h)}else l.current=null}function Zv(e,n,l){try{l()}catch(h){or(e,n,h)}}var _E=!1;function DL(e,n){if(Mv=Mg,e=ZS(),O1(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var h=l.getSelection&&l.getSelection();if(h&&h.rangeCount!==0){l=h.anchorNode;var m=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var E=0,s=-1,k=-1,D=0,V=0,G=e,J=null;t:for(;;){for(var ve;G!==l||m!==0&&G.nodeType!==3||(s=E+m),G!==v||h!==0&&G.nodeType!==3||(k=E+h),G.nodeType===3&&(E+=G.nodeValue.length),(ve=G.firstChild)!==null;)J=G,G=ve;for(;;){if(G===e)break t;if(J===l&&++D===m&&(s=E),J===v&&++V===h&&(k=E),(ve=G.nextSibling)!==null)break;G=J,J=G.parentNode}G=ve}l=s===-1||k===-1?null:{start:s,end:k}}else l=null}l=l||{start:0,end:0}}else l=null;for(Pv={focusedElem:e,selectionRange:l},Mg=!1,yt=n;yt!==null;)if(n=yt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,yt=e;else for(;yt!==null;){n=yt;try{var ae=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ae!==null){var me=ae.memoizedProps,Ce=ae.memoizedState,ie=n.stateNode,te=ie.getSnapshotBeforeUpdate(n.elementType===n.type?me:jo(n.type,me),Ce);ie.__reactInternalSnapshotBeforeUpdate=te}break;case 3:var le=n.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(it(163))}}catch(ze){or(n,n.return,ze)}if(e=n.sibling,e!==null){e.return=n.return,yt=e;break}yt=n.return}return ae=_E,_E=!1,ae}function xp(e,n,l){var h=n.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var m=h=h.next;do{if((m.tag&e)===e){var v=m.destroy;m.destroy=void 0,v!==void 0&&Zv(n,l,v)}m=m.next}while(m!==h)}}function m_(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var l=n=n.next;do{if((l.tag&e)===e){var h=l.create;l.destroy=h()}l=l.next}while(l!==n)}}function Hv(e){var n=e.ref;if(n!==null){var l=e.stateNode;switch(e.tag){case 5:e=l;break;default:e=l}typeof n=="function"?n(e):n.current=e}}function $A(e){var n=e.alternate;n!==null&&(e.alternate=null,$A(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[ys],delete n[Dp],delete n[Rv],delete n[_L],delete n[yL])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function GA(e){return e.tag===5||e.tag===3||e.tag===4}function yE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||GA(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xv(e,n,l){var h=e.tag;if(h===5||h===6)e=e.stateNode,n?l.nodeType===8?l.parentNode.insertBefore(e,n):l.insertBefore(e,n):(l.nodeType===8?(n=l.parentNode,n.insertBefore(e,l)):(n=l,n.appendChild(e)),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Lg));else if(h!==4&&(e=e.child,e!==null))for(Xv(e,n,l),e=e.sibling;e!==null;)Xv(e,n,l),e=e.sibling}function Kv(e,n,l){var h=e.tag;if(h===5||h===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(h!==4&&(e=e.child,e!==null))for(Kv(e,n,l),e=e.sibling;e!==null;)Kv(e,n,l),e=e.sibling}var Fr=null,Vo=!1;function ja(e,n,l){for(l=l.child;l!==null;)qA(e,n,l),l=l.sibling}function qA(e,n,l){if(vs&&typeof vs.onCommitFiberUnmount=="function")try{vs.onCommitFiberUnmount(a_,l)}catch{}switch(l.tag){case 5:ti||Vu(l,n);case 6:var h=Fr,m=Vo;Fr=null,ja(e,n,l),Fr=h,Vo=m,Fr!==null&&(Vo?(e=Fr,l=l.stateNode,e.nodeType===8?e.parentNode.removeChild(l):e.removeChild(l)):Fr.removeChild(l.stateNode));break;case 18:Fr!==null&&(Vo?(e=Fr,l=l.stateNode,e.nodeType===8?U0(e.parentNode,l):e.nodeType===1&&U0(e,l),Mp(e)):U0(Fr,l.stateNode));break;case 4:h=Fr,m=Vo,Fr=l.stateNode.containerInfo,Vo=!0,ja(e,n,l),Fr=h,Vo=m;break;case 0:case 11:case 14:case 15:if(!ti&&(h=l.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){m=h=h.next;do{var v=m,E=v.destroy;v=v.tag,E!==void 0&&(v&2||v&4)&&Zv(l,n,E),m=m.next}while(m!==h)}ja(e,n,l);break;case 1:if(!ti&&(Vu(l,n),h=l.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=l.memoizedProps,h.state=l.memoizedState,h.componentWillUnmount()}catch(s){or(l,n,s)}ja(e,n,l);break;case 21:ja(e,n,l);break;case 22:l.mode&1?(ti=(h=ti)||l.memoizedState!==null,ja(e,n,l),ti=h):ja(e,n,l);break;default:ja(e,n,l)}}function vE(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var l=e.stateNode;l===null&&(l=e.stateNode=new RL),n.forEach(function(h){var m=GL.bind(null,e,h);l.has(h)||(l.add(h),h.then(m,m))})}}function Uo(e,n){var l=n.deletions;if(l!==null)for(var h=0;hm&&(m=E),h&=~v}if(h=m,h=lr()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*BL(h/1960))-h,10e?16:e,Xa===null)var h=!1;else{if(e=Xa,Xa=null,Wg=0,nn&6)throw Error(it(331));var m=nn;for(nn|=4,yt=e.current;yt!==null;){var v=yt,E=v.child;if(yt.flags&16){var s=v.deletions;if(s!==null){for(var k=0;klr()-nx?pc(e,0):tx|=l),ki(e,n)}function QA(e,n){n===0&&(e.mode&1?(n=Fm,Fm<<=1,!(Fm&130023424)&&(Fm=4194304)):n=1);var l=ui();e=ra(e,n),e!==null&&(Jp(e,n,l),ki(e,l))}function $L(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),QA(e,l)}function GL(e,n){var l=0;switch(e.tag){case 13:var h=e.stateNode,m=e.memoizedState;m!==null&&(l=m.retryLane);break;case 19:h=e.stateNode;break;default:throw Error(it(314))}h!==null&&h.delete(n),QA(e,l)}var eC;eC=function(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps||Ci.current)Ai=!0;else{if(!(e.lanes&l)&&!(n.flags&128))return Ai=!1,PL(e,n,l);Ai=!!(e.flags&131072)}else Ai=!1,jn&&n.flags&1048576&&iA(n,Bg,n.index);switch(n.lanes=0,n.tag){case 2:var h=n.type;dg(e,n),e=n.pendingProps;var m=nh(n,ni.current);Xu(n,l),m=X1(null,n,h,e,m,l);var v=K1();return n.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Ii(h)?(v=!0,Dg(n)):v=!1,n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,G1(n),m.updater=f_,n.stateNode=m,m._reactInternals=n,Uv(n,h,e,l),n=$v(null,n,h,!0,v,l)):(n.tag=0,jn&&v&&B1(n),ci(null,n,m,l),n=n.child),n;case 16:h=n.elementType;e:{switch(dg(e,n),e=n.pendingProps,m=h._init,h=m(h._payload),n.type=h,m=n.tag=WL(h),e=jo(h,e),m){case 0:n=Vv(null,n,h,e,l);break e;case 1:n=fE(null,n,h,e,l);break e;case 11:n=dE(null,n,h,e,l);break e;case 14:n=pE(null,n,h,jo(h.type,e),l);break e}throw Error(it(306,h,""))}return n;case 0:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),Vv(e,n,h,m,l);case 1:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),fE(e,n,h,m,l);case 3:e:{if(BA(n),e===null)throw Error(it(387));h=n.pendingProps,v=n.memoizedState,m=v.element,uA(e,n),Ug(n,h,null,l);var E=n.memoizedState;if(h=E.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=v,n.memoizedState=v,n.flags&256){m=sh(Error(it(423)),n),n=mE(e,n,h,l,m);break e}else if(h!==m){m=sh(Error(it(424)),n),n=mE(e,n,h,l,m);break e}else for($i=el(n.stateNode.containerInfo.firstChild),Gi=n,jn=!0,$o=null,l=lA(n,null,h,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(rh(),h===m){n=ia(e,n,l);break e}ci(e,n,h,l)}n=n.child}return n;case 5:return hA(n),e===null&&Bv(n),h=n.type,m=n.pendingProps,v=e!==null?e.memoizedProps:null,E=m.children,zv(h,m)?E=null:v!==null&&zv(h,v)&&(n.flags|=32),OA(e,n),ci(e,n,E,l),n.child;case 6:return e===null&&Bv(n),null;case 13:return FA(e,n,l);case 4:return q1(n,n.stateNode.containerInfo),h=n.pendingProps,e===null?n.child=ih(n,null,h,l):ci(e,n,h,l),n.child;case 11:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),dE(e,n,h,m,l);case 7:return ci(e,n,n.pendingProps,l),n.child;case 8:return ci(e,n,n.pendingProps.children,l),n.child;case 12:return ci(e,n,n.pendingProps.children,l),n.child;case 10:e:{if(h=n.type._context,m=n.pendingProps,v=n.memoizedProps,E=m.value,Pn(Fg,h._currentValue),h._currentValue=E,v!==null)if(Xo(v.value,E)){if(v.children===m.children&&!Ci.current){n=ia(e,n,l);break e}}else for(v=n.child,v!==null&&(v.return=n);v!==null;){var s=v.dependencies;if(s!==null){E=v.child;for(var k=s.firstContext;k!==null;){if(k.context===h){if(v.tag===1){k=Qs(-1,l&-l),k.tag=2;var D=v.updateQueue;if(D!==null){D=D.shared;var V=D.pending;V===null?k.next=k:(k.next=V.next,V.next=k),D.pending=k}}v.lanes|=l,k=v.alternate,k!==null&&(k.lanes|=l),Fv(v.return,l,n),s.lanes|=l;break}k=k.next}}else if(v.tag===10)E=v.type===n.type?null:v.child;else if(v.tag===18){if(E=v.return,E===null)throw Error(it(341));E.lanes|=l,s=E.alternate,s!==null&&(s.lanes|=l),Fv(E,l,n),E=v.sibling}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===n){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}ci(e,n,m.children,l),n=n.child}return n;case 9:return m=n.type,h=n.pendingProps.children,Xu(n,l),m=mo(m),h=h(m),n.flags|=1,ci(e,n,h,l),n.child;case 14:return h=n.type,m=jo(h,n.pendingProps),m=jo(h.type,m),pE(e,n,h,m,l);case 15:return RA(e,n,n.type,n.pendingProps,l);case 17:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),dg(e,n),n.tag=1,Ii(h)?(e=!0,Dg(n)):e=!1,Xu(n,l),PA(n,h,m),Uv(n,h,m,l),$v(null,n,h,!0,e,l);case 19:return NA(e,n,l);case 22:return DA(e,n,l)}throw Error(it(156,n.tag))};function tC(e,n){return IS(e,n)}function qL(e,n,l,h){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function po(e,n,l,h){return new qL(e,n,l,h)}function sx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WL(e){if(typeof e=="function")return sx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===S1)return 11;if(e===A1)return 14}return 2}function il(e,n){var l=e.alternate;return l===null?(l=po(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&14680064,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l}function mg(e,n,l,h,m,v){var E=2;if(h=e,typeof e=="function")sx(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case Lu:return fc(l.children,m,v,n);case T1:E=8,m|=8;break;case uv:return e=po(12,l,n,m|2),e.elementType=uv,e.lanes=v,e;case hv:return e=po(13,l,n,m),e.elementType=hv,e.lanes=v,e;case dv:return e=po(19,l,n,m),e.elementType=dv,e.lanes=v,e;case hS:return __(l,m,v,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cS:E=10;break e;case uS:E=9;break e;case S1:E=11;break e;case A1:E=14;break e;case Ga:E=16,h=null;break e}throw Error(it(130,e==null?e:typeof e,""))}return n=po(E,l,n,m),n.elementType=e,n.type=h,n.lanes=v,n}function fc(e,n,l,h){return e=po(7,e,h,n),e.lanes=l,e}function __(e,n,l,h){return e=po(22,e,h,n),e.elementType=hS,e.lanes=l,e.stateNode={isHidden:!1},e}function H0(e,n,l){return e=po(6,e,null,n),e.lanes=l,e}function X0(e,n,l){return n=po(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function ZL(e,n,l,h,m){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=k0(0),this.expirationTimes=k0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=k0(0),this.identifierPrefix=h,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function ax(e,n,l,h,m,v,E,s,k){return e=new ZL(e,n,l,s,k),n===1?(n=1,v===!0&&(n|=8)):n=0,v=po(3,null,null,n),e.current=v,v.stateNode=e,v.memoizedState={element:h,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},G1(v),e}function HL(e,n,l){var h=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oC)}catch(e){console.error(e)}}oC(),oS.exports=Hi;var hx=oS.exports,sC,CE=hx;sC=CE.createRoot,CE.hydrateRoot;const QL="Logging",eR="NoHubcallbackProvidedException";var Ui;(function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE",e.NONE="NONE"})(Ui||(Ui={}));const IE={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class Zo{constructor(n,l=Ui.WARN){this.name=n,this.level=l,this._pluggables=[]}_padding(n){return n<10?"0"+n:""+n}_ts(){const n=new Date;return[this._padding(n.getMinutes()),this._padding(n.getSeconds())].join(":")+"."+n.getMilliseconds()}configure(n){return n?(this._config=n,this._config):this._config}_log(n,...l){let h=this.level;Zo.LOG_LEVEL&&(h=Zo.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(h=window.LOG_LEVEL);const m=IE[h];if(!(IE[n]>=m))return;let E=console.log.bind(console);n===Ui.ERROR&&console.error&&(E=console.error.bind(console)),n===Ui.WARN&&console.warn&&(E=console.warn.bind(console)),Zo.BIND_ALL_LOG_LEVELS&&(n===Ui.INFO&&console.info&&(E=console.info.bind(console)),n===Ui.DEBUG&&console.debug&&(E=console.debug.bind(console)));const s=`[${n}] ${this._ts()} ${this.name}`;let k="";if(l.length===1&&typeof l[0]=="string")k=`${s} - ${l[0]}`,E(k);else if(l.length===1)k=`${s} ${l[0]}`,E(s,l[0]);else if(typeof l[0]=="string"){let D=l.slice(1);D.length===1&&(D=D[0]),k=`${s} - ${l[0]} ${D}`,E(`${s} - ${l[0]}`,D)}else k=`${s} ${l}`,E(s,l);for(const D of this._pluggables){const V={message:k,timestamp:Date.now()};D.pushLogs([V])}}log(...n){this._log(Ui.INFO,...n)}info(...n){this._log(Ui.INFO,...n)}warn(...n){this._log(Ui.WARN,...n)}error(...n){this._log(Ui.ERROR,...n)}debug(...n){this._log(Ui.DEBUG,...n)}verbose(...n){this._log(Ui.VERBOSE,...n)}addPluggable(n){n&&n.getCategoryName()===QL&&(this._pluggables.push(n),n.configure(this._config))}listPluggables(){return this._pluggables}}Zo.LOG_LEVEL=null;Zo.BIND_ALL_LOG_LEVELS=!1;class bs extends Error{constructor({message:n,name:l,recoverySuggestion:h,underlyingError:m}){super(n),this.name=l,this.underlyingError=m,this.recoverySuggestion=h,this.constructor=bs,Object.setPrototypeOf(this,bs.prototype)}}var Vp;(function(e){e.NoEndpointId="NoEndpointId",e.PlatformNotSupported="PlatformNotSupported",e.Unknown="Unknown",e.NetworkError="NetworkError"})(Vp||(Vp={}));const aC=(e,n=bs)=>(l,h,m)=>{const{message:v,recoverySuggestion:E}=e[h];if(!l)throw new n({name:h,message:m?`${v} ${m}`:v,recoverySuggestion:E})},Xg=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",sp=new Zo("Hub");class tR{constructor(n){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=n}_remove(n,l){const h=this.listeners.get(n);if(!h){sp.warn(`No listeners for ${n}`);return}this.listeners.set(n,[...h.filter(({callback:m})=>m!==l)])}dispatch(n,l,h,m){typeof n=="string"&&this.protectedChannels.indexOf(n)>-1&&(m===Xg||sp.warn(`WARNING: ${n} is protected and dispatching on it can have unintended consequences`));const v={channel:n,payload:{...l},source:h,patternInfo:[]};try{this._toListeners(v)}catch(E){sp.error(E)}}listen(n,l,h="noname"){let m;if(typeof l!="function")throw new bs({name:eR,message:"No callback supplied to Hub"});m=l;let v=this.listeners.get(n);return v||(v=[],this.listeners.set(n,v)),v.push({name:h,callback:m}),()=>{this._remove(n,m)}}_toListeners(n){const{channel:l,payload:h}=n,m=this.listeners.get(l);m&&m.forEach(v=>{sp.debug(`Dispatching to ${l} with `,h);try{v.callback(n)}catch(E){sp.error(E)}})}}const t1=new tR("__default__"),nR=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new bs({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},rR={convert(e){return nR()(e)}};var Xs;(function(e){e.AuthTokenConfigException="AuthTokenConfigException",e.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",e.AuthUserPoolException="AuthUserPoolException",e.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",e.OAuthNotConfigureException="OAuthNotConfigureException"})(Xs||(Xs={}));const iR={[Xs.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[Xs.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[Xs.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[Xs.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[Xs.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},lC=aC(iR);function Ti(e){let n=!0;e?n=!!e.userPoolId&&!!e.userPoolClientId:n=!1,lC(n,Xs.AuthUserPoolException)}function gg(e){const n=!!(e!=null&&e.identityPoolId);lC(n,Xs.InvalidIdentityPoolIdException)}function $p(e){const n=e.split(".");if(n.length!==3)throw new Error("Invalid token");try{const h=n[1].replace(/-/g,"+").replace(/_/g,"/"),m=decodeURIComponent(rR.convert(h).split("").map(E=>`%${`00${E.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),v=JSON.parse(m);return{toString:()=>e,payload:v}}catch{throw new Error("Invalid token payload")}}const cC=e=>{const n=Reflect.ownKeys(e);for(const l of n){const h=e[l];(h&&typeof h=="object"||typeof h=="function")&&cC(h)}return Object.freeze(e)},oR=new Zo("parseAWSExports"),sR={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},aR=(e={})=>{var sr,ii,ar,br,Es,Yi;if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new bs({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});const{aws_appsync_apiKey:n,aws_appsync_authenticationType:l,aws_appsync_graphqlEndpoint:h,aws_appsync_region:m,aws_bots_config:v,aws_cognito_identity_pool_id:E,aws_cognito_sign_up_verification_method:s,aws_cognito_mfa_configuration:k,aws_cognito_mfa_types:D,aws_cognito_password_protection_settings:V,aws_cognito_verification_mechanisms:G,aws_cognito_signup_attributes:J,aws_cognito_social_providers:ve,aws_cognito_username_attributes:ae,aws_mandatory_sign_in:me,aws_mobile_analytics_app_id:Ce,aws_mobile_analytics_app_region:ie,aws_user_files_s3_bucket:te,aws_user_files_s3_bucket_region:le,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:ze,aws_user_pools_id:Oe,aws_user_pools_web_client_id:Ke,geo:He,oauth:ht,predictions:Ve,aws_cloud_logic_custom:jt,Notifications:wr,modelIntrospection:St}=e,Vt={};Ce&&(Vt.Analytics={Pinpoint:{appId:Ce,region:ie}});const{InAppMessaging:Vr,Push:$r}=wr??{};if(Vr!=null&&Vr.AWSPinpoint||$r!=null&&$r.AWSPinpoint){if(Vr!=null&&Vr.AWSPinpoint){const{appId:xn,region:kt}=Vr.AWSPinpoint;Vt.Notifications={InAppMessaging:{Pinpoint:{appId:xn,region:kt}}}}if($r!=null&&$r.AWSPinpoint){const{appId:xn,region:kt}=$r.AWSPinpoint;Vt.Notifications={...Vt.Notifications,PushNotification:{Pinpoint:{appId:xn,region:kt}}}}}if(Array.isArray(v)&&(Vt.Interactions={LexV1:Object.fromEntries(v.map(xn=>[xn.name,xn]))}),h){const xn=sR[l];xn||oR.debug(`Invalid authentication type ${l}. Falling back to IAM.`),Vt.API={GraphQL:{endpoint:h,apiKey:n,region:m,defaultAuthMode:xn??"iam"}},St&&(Vt.API.GraphQL.modelIntrospection=St)}const Li=k?{status:k&&k.toLowerCase(),totpEnabled:(D==null?void 0:D.includes("TOTP"))??!1,smsEnabled:(D==null?void 0:D.includes("SMS"))??!1}:void 0,Ki=V?{minLength:V.passwordPolicyMinLength,requireLowercase:((sr=V.passwordPolicyCharacters)==null?void 0:sr.includes("REQUIRES_LOWERCASE"))??!1,requireUppercase:((ii=V.passwordPolicyCharacters)==null?void 0:ii.includes("REQUIRES_UPPERCASE"))??!1,requireNumbers:((ar=V.passwordPolicyCharacters)==null?void 0:ar.includes("REQUIRES_NUMBERS"))??!1,requireSpecialCharacters:((br=V.passwordPolicyCharacters)==null?void 0:br.includes("REQUIRES_SYMBOLS"))??!1}:void 0,Tt=Array.from(new Set([...G??[],...J??[]])).reduce((xn,kt)=>({...xn,[kt.toLowerCase()]:{required:!0}}),{}),xt=(ae==null?void 0:ae.includes("EMAIL"))??!1,Bt=(ae==null?void 0:ae.includes("PHONE_NUMBER"))??!1;(E||Oe)&&(Vt.Auth={Cognito:{identityPoolId:E,allowGuestAccess:me!=="enable",signUpVerificationMethod:s,userAttributes:Tt,userPoolClientId:Ke,userPoolId:Oe,mfa:Li,passwordFormat:Ki,loginWith:{username:!(xt||Bt),email:xt,phone:Bt}}});const dn=ht?Object.keys(ht).length>0:!1,vn=ve?ve.length>0:!1;if(Vt.Auth&&dn&&(Vt.Auth.Cognito.loginWith={...Vt.Auth.Cognito.loginWith,oauth:{...lR(ht),...vn&&{providers:cR(ve)}}}),te&&(Vt.Storage={S3:{bucket:te,region:le,dangerouslyConnectToHttpEndpointForTesting:ze}}),He){const{amazon_location_service:xn}=He;Vt.Geo={LocationService:{maps:xn.maps,geofenceCollections:xn.geofenceCollections,searchIndices:xn.search_indices,region:xn.region}}}if(jt&&(Vt.API={...Vt.API,REST:jt.reduce((xn,kt)=>{const{name:Yo,endpoint:Dr,region:Jo,service:wn}=kt;return{...xn,[Yo]:{endpoint:Dr,...wn?{service:wn}:void 0,...Jo?{region:Jo}:void 0}}},{})}),Ve){const{VoiceId:xn}=((Yi=(Es=Ve==null?void 0:Ve.convert)==null?void 0:Es.speechGenerator)==null?void 0:Yi.defaults)??{};Vt.Predictions=xn?{...Ve,convert:{...Ve.convert,speechGenerator:{...Ve.convert.speechGenerator,defaults:{voiceId:xn}}}}:Ve}return Vt},kE=e=>(e==null?void 0:e.split(","))??[],lR=({domain:e,scope:n,redirectSignIn:l,redirectSignOut:h,responseType:m})=>({domain:e,scopes:n,redirectSignIn:kE(l),redirectSignOut:kE(h),responseType:m}),cR=e=>e.map(n=>{const l=n.toLowerCase();return l.charAt(0).toUpperCase()+l.slice(1)}),uR=Symbol("oauth-listener");function hR(e){const{version:n}=e;return n?n.startsWith("1"):!1}function dR(e){if(!e)return;const{bucket_name:n,aws_region:l,buckets:h}=e;return{S3:{bucket:n,region:l,buckets:h&&ER(h)}}}function pR(e){if(!e)return;const{user_pool_id:n,user_pool_client_id:l,identity_pool_id:h,password_policy:m,mfa_configuration:v,mfa_methods:E,unauthenticated_identities_enabled:s,oauth:k,username_attributes:D,standard_required_attributes:V}=e,G={Cognito:{userPoolId:n,userPoolClientId:l}};return h&&(G.Cognito={...G.Cognito,identityPoolId:h}),m&&(G.Cognito.passwordFormat={requireLowercase:m.require_lowercase,requireNumbers:m.require_numbers,requireUppercase:m.require_uppercase,requireSpecialCharacters:m.require_symbols,minLength:m.min_length??6}),v&&(G.Cognito.mfa={status:bR(v),smsEnabled:E==null?void 0:E.includes("SMS"),totpEnabled:E==null?void 0:E.includes("TOTP")}),s&&(G.Cognito.allowGuestAccess=s),k&&(G.Cognito.loginWith={oauth:{domain:k.domain,redirectSignIn:k.redirect_sign_in_uri,redirectSignOut:k.redirect_sign_out_uri,responseType:k.response_type==="token"?"token":"code",scopes:k.scopes,providers:wR(k.identity_providers)}}),D&&(G.Cognito.loginWith={...G.Cognito.loginWith,email:D.includes("email"),phone:D.includes("phone_number"),username:D.includes("username")}),V&&(G.Cognito.userAttributes=V.reduce((J,ve)=>({...J,[ve]:{required:!0}}),{})),G}function fR(e){if(!(e!=null&&e.amazon_pinpoint))return;const{amazon_pinpoint:n}=e;return{Pinpoint:{appId:n.app_id,region:n.aws_region}}}function mR(e){if(!e)return;const{aws_region:n,geofence_collections:l,maps:h,search_indices:m}=e;return{LocationService:{region:n,searchIndices:m,geofenceCollections:l,maps:h}}}function gR(e){if(!e)return;const{aws_region:n,default_authorization_type:l,url:h,api_key:m,model_introspection:v}=e;return{GraphQL:{endpoint:h,defaultAuthMode:xR(l),region:n,apiKey:m,modelIntrospection:v}}}function _R(e){if(!e)return;const{aws_region:n,channels:l,amazon_pinpoint_app_id:h}=e,m=l.includes("IN_APP_MESSAGING"),v=l.includes("APNS")||l.includes("FCM");if(!(m||v))return;const E={};return m&&(E.InAppMessaging={Pinpoint:{appId:h,region:n}}),v&&(E.PushNotification={Pinpoint:{appId:h,region:n}}),E}function yR(e){const n={};return e.storage&&(n.Storage=dR(e.storage)),e.auth&&(n.Auth=pR(e.auth)),e.analytics&&(n.Analytics=fR(e.analytics)),e.geo&&(n.Geo=mR(e.geo)),e.data&&(n.API=gR(e.data)),e.notifications&&(n.Notifications=_R(e.notifications)),n}const vR={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function xR(e){return vR[e]}const ME={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function wR(e=[]){return e.reduce((n,l)=>(ME[l]!==void 0&&n.push(ME[l]),n),[])}function bR(e){return e==="OPTIONAL"?"optional":e==="REQUIRED"?"on":"off"}function ER(e){const n={};return e.forEach(({name:l,bucket_name:h,aws_region:m})=>{if(l in n)throw new Error(`Duplicate friendly name found: ${l}. Name must be unique.`);n[l]={bucketName:h,region:m}}),n}const uC=e=>Object.keys(e).some(n=>n.startsWith("aws_"))?aR(e):hR(e)?yR(e):e;function PE({expiresAt:e,clockDrift:n}){return Date.now()+n>e}class TR{configure(n,l){this.authConfig=n,this.authOptions=l}async fetchAuthSession(n={}){var v,E,s,k,D,V;let l,h;const m=await this.getTokens(n);return m?(h=(E=(v=m.accessToken)==null?void 0:v.payload)==null?void 0:E.sub,l=await((k=(s=this.authOptions)==null?void 0:s.credentialsProvider)==null?void 0:k.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:m,authenticated:!0,forceRefresh:n.forceRefresh}))):l=await((V=(D=this.authOptions)==null?void 0:D.credentialsProvider)==null?void 0:V.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:n.forceRefresh})),{tokens:m,credentials:l==null?void 0:l.credentials,identityId:l==null?void 0:l.identityId,userSub:h}}async clearCredentials(){var n,l;await((l=(n=this.authOptions)==null?void 0:n.credentialsProvider)==null?void 0:l.clearCredentialsAndIdentityId())}async getTokens(n){var l,h;return await((h=(l=this.authOptions)==null?void 0:l.tokenProvider)==null?void 0:h.getTokens(n))??void 0}}const SR=e=>new TextEncoder().encode(e);typeof Buffer<"u"&&Buffer.from;for(let e=0;e<256;e++){let n=e.toString(16).toLowerCase();n.length===1&&(n=`0${n}`)}var _r;(function(e){e.WebUnknown="0",e.React="1",e.NextJs="2",e.Angular="3",e.VueJs="4",e.Nuxt="5",e.Svelte="6",e.ServerSideUnknown="100",e.ReactSSR="101",e.NextJsSSR="102",e.AngularSSR="103",e.VueJsSSR="104",e.NuxtSSR="105",e.SvelteSSR="106",e.ReactNative="201",e.Expo="202"})(_r||(_r={}));var zE;(function(e){e.API="api",e.Auth="auth",e.Analytics="analytics",e.DataStore="datastore",e.Geo="geo",e.InAppMessaging="inappmessaging",e.Interactions="interactions",e.Predictions="predictions",e.PubSub="pubsub",e.PushNotification="pushnotification",e.Storage="storage"})(zE||(zE={}));var LE;(function(e){e.Record="1",e.IdentifyUser="2"})(LE||(LE={}));var RE;(function(e){e.GraphQl="1",e.Get="2",e.Post="3",e.Put="4",e.Patch="5",e.Del="6",e.Head="7"})(RE||(RE={}));var DE;(function(e){e.SignUp="1",e.ConfirmSignUp="2",e.ResendSignUpCode="3",e.SignIn="4",e.FetchMFAPreference="6",e.UpdateMFAPreference="7",e.SetUpTOTP="10",e.VerifyTOTPSetup="11",e.ConfirmSignIn="12",e.DeleteUserAttributes="15",e.DeleteUser="16",e.UpdateUserAttributes="17",e.FetchUserAttributes="18",e.ConfirmUserAttribute="22",e.SignOut="26",e.UpdatePassword="27",e.ResetPassword="28",e.ConfirmResetPassword="29",e.FederatedSignIn="30",e.RememberDevice="32",e.ForgetDevice="33",e.FetchDevices="34",e.SendUserAttributeVerificationCode="35",e.SignInWithRedirect="36"})(DE||(DE={}));var OE;(function(e){e.Subscribe="1",e.GraphQl="2"})(OE||(OE={}));var BE;(function(e){e.SearchByText="0",e.SearchByCoordinates="1",e.SearchForSuggestions="2",e.SearchByPlaceId="3",e.SaveGeofences="4",e.GetGeofence="5",e.ListGeofences="6",e.DeleteGeofences="7"})(BE||(BE={}));var FE;(function(e){e.SyncMessages="1",e.IdentifyUser="2",e.NotifyMessageInteraction="3"})(FE||(FE={}));var NE;(function(e){e.None="0"})(NE||(NE={}));var UE;(function(e){e.Convert="1",e.Identify="2",e.Interpret="3"})(UE||(UE={}));var jE;(function(e){e.Subscribe="1"})(jE||(jE={}));var VE;(function(e){e.InitializePushNotifications="1",e.IdentifyUser="2"})(VE||(VE={}));var $E;(function(e){e.UploadData="1",e.DownloadData="2",e.List="3",e.Copy="4",e.Remove="5",e.GetProperties="6",e.GetUrl="7"})($E||($E={}));const b_=()=>typeof global<"u",fh=()=>typeof window<"u",hC=()=>typeof document<"u",dx=()=>typeof process<"u",Gp=(e,n)=>!!Object.keys(e).find(l=>l.startsWith(n));function AR(){const e=h=>h.startsWith("_react")||h.startsWith("__react"),n=h=>Object.keys(h).find(e),l=()=>Array.from(document.querySelectorAll("[id]"));return hC()&&l().some(n)}function CR(){return dx()&&typeof process.env<"u"&&!!Object.keys(process.env).find(e=>e.includes("react"))}function IR(){return fh()&&Gp(window,"__VUE")}function kR(){return b_()&&Gp(global,"__VUE")}function MR(){return fh()&&Gp(window,"__SVELTE")}function PR(){return dx()&&typeof process.env<"u"&&!!Object.keys(process.env).find(e=>e.includes("svelte"))}function zR(){return fh()&&window.next&&typeof window.next=="object"}function LR(){return b_()&&(Gp(global,"__next")||Gp(global,"__NEXT"))}function RR(){return fh()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function DR(){return b_()&&typeof global.__NUXT_PATHS__<"u"}function OR(){const e=!!(hC()&&document.querySelector("[ng-version]")),n=!!(fh()&&typeof window.ng<"u");return e||n}function BR(){var e;return dx()&&typeof process.env=="object"&&((e={}.npm_lifecycle_script)==null?void 0:e.startsWith("ng "))||!1}function FR(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function NR(){return b_()&&typeof global.expo<"u"}function UR(){return fh()}const jR=[{platform:_r.Expo,detectionMethod:NR},{platform:_r.ReactNative,detectionMethod:FR},{platform:_r.NextJs,detectionMethod:zR},{platform:_r.Nuxt,detectionMethod:RR},{platform:_r.Angular,detectionMethod:OR},{platform:_r.React,detectionMethod:AR},{platform:_r.VueJs,detectionMethod:IR},{platform:_r.Svelte,detectionMethod:MR},{platform:_r.WebUnknown,detectionMethod:UR},{platform:_r.NextJsSSR,detectionMethod:LR},{platform:_r.NuxtSSR,detectionMethod:DR},{platform:_r.ReactSSR,detectionMethod:CR},{platform:_r.VueJsSSR,detectionMethod:kR},{platform:_r.AngularSSR,detectionMethod:BR},{platform:_r.SvelteSSR,detectionMethod:PR}];function VR(){var e;return((e=jR.find(n=>n.detectionMethod()))==null?void 0:e.platform)||_r.ServerSideUnknown}const $R=()=>typeof window<"u"&&typeof window.document<"u";class GR{constructor(){this.oAuthListener=void 0,this.resourcesConfig={},this.libraryOptions={},this.Auth=new TR}configure(n,l){const h=uC(n);this.resourcesConfig=h,l&&(this.libraryOptions=l),this.resourcesConfig=cC(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),t1.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",Xg),this.notifyOAuthListener()}getConfig(){return this.resourcesConfig}[uR](n){var l,h,m;(h=(l=this.resourcesConfig.Auth)==null?void 0:l.Cognito.loginWith)!=null&&h.oauth?n((m=this.resourcesConfig.Auth)==null?void 0:m.Cognito):this.oAuthListener=n}notifyOAuthListener(){var n,l,h;!((l=(n=this.resourcesConfig.Auth)==null?void 0:n.Cognito.loginWith)!=null&&l.oauth)||!this.oAuthListener||(this.oAuthListener((h=this.resourcesConfig.Auth)==null?void 0:h.Cognito),this.oAuthListener=void 0)}}const Ws=new GR,E_=e=>{const{headers:n,statusCode:l}=e;return{...qR(e)?e.$metadata:{},httpStatusCode:l,requestId:n["x-amzn-requestid"]??n["x-amzn-request-id"]??n["x-amz-request-id"],extendedRequestId:n["x-amz-id-2"],cfId:n["x-amz-cf-id"]}},qR=e=>typeof(e==null?void 0:e.$metadata)=="object",nf=async e=>{if(!e||e.statusCode<300)return;const n=await T_(e),h=(E=>{const[s]=E.toString().split(/[,:]+/);return s.includes("#")?s.split("#")[1]:s})(e.headers["x-amzn-errortype"]??n.code??n.__type??"UnknownError"),m=n.message??n.Message??"Unknown error",v=new Error(m);return Object.assign(v,{name:h,$metadata:E_(e)})},T_=async e=>{if(!e.body)throw new Error("Missing response payload");const n=await e.body.json();return Object.assign(n,{$metadata:E_(e)})},px=(e,n,l,h)=>async(m,v)=>{const E={...h,...m},s=await E.endpointResolver(E,v),k=await n(v,s),D=await e(k,{...E});return l(D)},dC={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},WR={partitions:[dC,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},pC=e=>{const{partitions:n}=WR;for(const{regions:l,outputs:h,regionRegex:m}of n){const v=new RegExp(m);if(l.includes(e)||v.test(e))return h.dnsSuffix}return dC.outputs.dnsSuffix},ZR=3,HR=({maxAttempts:e=ZR,retryDecider:n,computeDelay:l,abortSignal:h})=>{if(e<1)throw new Error("maxAttempts must be greater than 0");return(m,v)=>async function(s){let k,D=v.attemptsCount??0,V;const G=()=>{if(V)return GE(V,D),V;throw GE(k,D),k};for(;!(h!=null&&h.aborted)&&DD?v.attemptsCount??0:D+1,v.attemptsCount=D,await n(V,k)){if(!(h!=null&&h.aborted)&&D{if(n!=null&&n.aborted)return Promise.resolve();let l,h;const m=new Promise(v=>{h=v,l=setTimeout(v,e)});return n==null||n.addEventListener("abort",function v(E){clearTimeout(l),n==null||n.removeEventListener("abort",v),h()}),m},GE=(e,n)=>{Object.prototype.toString.call(e)==="[object Object]"&&(e.$metadata={...e.$metadata??{},attempts:n})},KR=({userAgentHeader:e="x-amz-user-agent",userAgentValue:n=""})=>l=>async function(m){if(n.trim().length===0)return await l(m);{const v=e.toLowerCase();return m.headers[v]=m.headers[v]?`${m.headers[v]} ${n}`:n,await l(m)}},fx=(e,n)=>(l,h)=>{const m={};let v=E=>e(E,h);for(let E=n.length-1;E>=0;E--){const s=n[E];v=s(h)(v,m)}return v(l)},K0=e=>{let n;return()=>(n||(n=e()),n)},YR=e=>!["HEAD","GET","DELETE"].includes(e.toUpperCase()),JR=async({url:e,method:n,headers:l,body:h},{abortSignal:m,cache:v,withCrossDomainCredentials:E})=>{var G;let s;try{s=await fetch(e,{method:n,headers:l,body:YR(n)?h:void 0,signal:m,cache:v,credentials:E?"include":"same-origin"})}catch(J){throw J instanceof TypeError?new bs({name:Vp.NetworkError,message:"A network error has occurred.",underlyingError:J}):J}const k={};(G=s.headers)==null||G.forEach((J,ve)=>{k[ve.toLowerCase()]=J});const D={statusCode:s.status,headers:k,body:null},V=Object.assign(s.body??{},{text:K0(()=>s.text()),blob:K0(()=>s.blob()),json:K0(()=>s.json())});return{...D,body:V}},fC=fx(JR,[KR,HR]),QR=5*60*1e3;function e3(e=QR){return h=>{const m=2**h*100+100*Math.random();return m>e?!1:m}}const qE=5*60*1e3,mC=e=>{const l=e3(qE)(e);return l===!1?qE:l},t3=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],n3=e=>!!e&&t3.includes(e),gC=e=>async(n,l)=>{const h=l??await e(n)??void 0,m=(h==null?void 0:h.code)||(h==null?void 0:h.name),v=n==null?void 0:n.statusCode;return s3(l)||o3(v,m)||n3(m)||a3(v,m)},r3=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],i3=["TimeoutError","RequestTimeout","RequestTimeoutException"],o3=(e,n)=>e===429||!!n&&r3.includes(n),s3=e=>(e==null?void 0:e.name)==="Network error",a3=(e,n)=>!!e&&[500,502,503,504].includes(e)||!!n&&i3.includes(n),n1=URL,l3="6.6.0";let Ep;const _g=[];let Kg=!1;const c3=10,u3=10,h3=1e3,_C=()=>{var e;if(!Ep){if(Ep=VR(),Kg)for(;_g.length;)(e=_g.pop())==null||e();else _g.forEach(n=>{n()});WE(_r.ServerSideUnknown,c3),WE(_r.WebUnknown,u3)}return Ep},d3=e=>{Kg||_g.push(e)};function p3(){Ep=void 0}function WE(e,n){Ep===e&&!Kg&&setTimeout(()=>{p3(),Kg=!0,setTimeout(_C,h3)},n)}const f3={},m3=(e,n)=>{var l,h;return(h=(l=f3[e])==null?void 0:l[n])==null?void 0:h.additionalDetails},g3="aws-amplify",_3=({category:e,action:n}={})=>{const l=[[g3,l3]];if(e&&l.push([e,n]),l.push(["framework",_C()]),e&&n){const h=m3(e,n);h&&h.forEach(m=>{l.push(m)})}return l},mx=e=>_3(e).map(([h,m])=>h&&m?`${h}/${m}`:h).join(" "),y3="cognito-identity",v3=({region:e})=>({url:new n1(`https://cognito-identity.${e}.${pC(e)}`)}),x3=()=>e=>async function(l){return l.headers["cache-control"]="no-store",e(l)},yC=fx(fC,[x3]),gx={service:y3,endpointResolver:v3,retryDecider:gC(nf),computeDelay:mC,userAgentValue:mx(),cache:"no-store"};d3(()=>{gx.userAgentValue=mx()});const vC=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),xC=({url:e},n,l)=>({headers:n,url:e,body:l,method:"POST"}),w3=(e,n)=>{const l=vC("GetId"),h=JSON.stringify(e);return xC(n,l,h)},b3=async e=>{if(e.statusCode>=300)throw await nf(e);return{IdentityId:(await T_(e)).IdentityId,$metadata:E_(e)}},E3=px(yC,w3,b3,gx),T3=(e,n)=>{const l=vC("GetCredentialsForIdentity"),h=JSON.stringify(e);return xC(n,l,h)},S3=async e=>{if(e.statusCode>=300)throw await nf(e);{const n=await T_(e);return{IdentityId:n.IdentityId,Credentials:A3(n.Credentials),$metadata:E_(e)}}},A3=({AccessKeyId:e,SecretKey:n,SessionToken:l,Expiration:h}={})=>({AccessKeyId:e,SecretKey:n,SessionToken:l,Expiration:h&&new Date(h*1e3)}),ZE=px(yC,T3,S3,gx);class Km extends bs{constructor(){super({name:Vp.PlatformNotSupported,message:"Function not supported on current platform"})}}class wC{constructor(n){this.storage=n}async setItem(n,l){if(!this.storage)throw new Km;this.storage.setItem(n,l)}async getItem(n){if(!this.storage)throw new Km;return this.storage.getItem(n)}async removeItem(n){if(!this.storage)throw new Km;this.storage.removeItem(n)}async clear(){if(!this.storage)throw new Km;this.storage.clear()}}class bC{constructor(){this.storage=new Map}get length(){return this.storage.size}key(n){return n>this.length-1?null:Array.from(this.storage.keys())[n]}setItem(n,l){this.storage.set(n,l)}getItem(n){return this.storage.get(n)??null}removeItem(n){this.storage.delete(n)}clear(){this.storage.clear()}}const C3=()=>typeof window<"u"&&window.localStorage?window.localStorage:new bC,I3=()=>typeof window<"u"&&window.sessionStorage?window.sessionStorage:new bC;class k3 extends wC{constructor(){super(C3())}}class M3 extends wC{constructor(){super(I3())}}/*! js-cookie v3.0.5 | MIT */function Ym(e){for(var n=1;n"u")){E=Ym({},n,E),typeof E.expires=="number"&&(E.expires=new Date(Date.now()+E.expires*864e5)),E.expires&&(E.expires=E.expires.toUTCString()),m=encodeURIComponent(m).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var k in E)E[k]&&(s+="; "+k,E[k]!==!0&&(s+="="+E[k].split(";")[0]));return document.cookie=m+"="+e.write(v,m)+s}}function h(m){if(!(typeof document>"u"||arguments.length&&!m)){for(var v=document.cookie?document.cookie.split("; "):[],E={},s=0;sthis.removeItem(h));await Promise.all(l)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const qp=new k3;new M3;const z3=e=>{let n;return async(...l)=>n||(n=new Promise((h,m)=>{e(...l).then(v=>{h(v)}).catch(v=>{m(v)}).finally(()=>{n=void 0})}),n)};class er extends bs{constructor(n){super(n),this.constructor=er,Object.setPrototypeOf(this,er.prototype)}}function EC(e){if(!e||e.name==="Error"||e instanceof TypeError)throw new er({name:Vp.Unknown,message:"An unknown error has occurred.",underlyingError:e})}const TC="cognito-idp",L3=({region:e})=>{var m;const n=(m=Ws.getConfig().Auth)==null?void 0:m.Cognito,l=n==null?void 0:n.userPoolEndpoint,h=new n1(`https://${TC}.${e}.${pC(e)}`);return{url:l?new n1(l):h}},R3=()=>(e,n)=>async function(h){return h.headers["cache-control"]="no-store",e(h)},D3=fx(fC,[R3]),O3={service:TC,endpointResolver:L3,retryDecider:gC(nf),computeDelay:mC,userAgentValue:mx(),cache:"no-store"},B3=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${e}`}),F3=({url:e},n,l)=>({headers:n,url:e,body:l,method:"POST"}),N3=e=>(n,l)=>{const h=B3(e),m=JSON.stringify(n);return F3(l,h,m)},U3=()=>async e=>{if(e.statusCode>=300){const n=await nf(e);throw EC(n),new er({name:n.name,message:n.message})}else return await T_(e)},j3=px(D3,N3("InitiateAuth"),U3(),O3);function V3(e){const n=e==null?void 0:e.split("_")[0];if(!e||e.indexOf("_")<0||!n||typeof n!="string")throw new er({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return n}function i1(e){if(!e||!e.includes(":"))throw new er({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}const SC="UserUnAuthenticatedException",$3="InvalidRedirectException",G3="InvalidAppSchemeException",q3="InvalidPreferredRedirectUrlException";new er({name:$3,message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new er({name:G3,message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});new er({name:q3,message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."});const W3="InvalidOriginException";new er({name:W3,message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."});const Z3="TokenRefreshException";function H3(e){if(!e||!e.idToken)throw new er({name:SC,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}const X3=new er({name:Z3,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. - Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. - E.g { responseType: 'code' }`}),K3=new er({name:SC,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function Y3(e){if(eD(e))throw X3;if(!Q3(e))throw K3}const J3={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function AC(e){return(e==null?void 0:e.accessToken)||(e==null?void 0:e.idToken)}function Q3(e){return AC(e)&&(e==null?void 0:e.refreshToken)}function eD(e){return AC(e)&&!(e!=null&&e.refreshToken)}function tD({username:e,userPoolId:n,userPoolClientId:l}){if(typeof window>"u")return;const h=window.AmazonCognitoAdvancedSecurityData;if(typeof h>"u")return;const m=h.getData(e,n,l);return m?{EncodedData:m}:{}}const nD=async({tokens:e,authConfig:n,username:l})=>{var J,ve;Ti(n==null?void 0:n.Cognito);const h=V3(n.Cognito.userPoolId);Y3(e);const m=e.refreshToken,v={REFRESH_TOKEN:m};(J=e.deviceMetadata)!=null&&J.deviceKey&&(v.DEVICE_KEY=e.deviceMetadata.deviceKey);const E=tD({username:l,userPoolId:n.Cognito.userPoolId,userPoolClientId:n.Cognito.userPoolClientId}),{AuthenticationResult:s}=await j3({region:h},{ClientId:(ve=n==null?void 0:n.Cognito)==null?void 0:ve.userPoolClientId,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:v,UserContextData:E}),k=$p((s==null?void 0:s.AccessToken)??""),D=s!=null&&s.IdToken?$p(s.IdToken):void 0,{iat:V}=k.payload;if(!V)throw new er({name:"iatNotFoundException",message:"iat not found in access token"});const G=V*1e3-new Date().getTime();return{accessToken:k,idToken:D,clockDrift:G,refreshToken:m,username:l}},rD=z3(nD),iD={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var Yg;(function(e){e.InvalidAuthTokens="InvalidAuthTokens"})(Yg||(Yg={}));const oD={[Yg.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},sD=aC(oD);class aD{constructor(){this.name="CognitoIdentityServiceProvider"}getKeyValueStorage(){if(!this.keyValueStorage)throw new er({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(n){this.keyValueStorage=n}setAuthConfig(n){this.authConfig=n}async loadTokens(){try{const n=await this.getAuthKeys(),l=await this.getKeyValueStorage().getItem(n.accessToken);if(!l)throw new er({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const h=$p(l),m=await this.getKeyValueStorage().getItem(n.idToken),v=m?$p(m):void 0,E=await this.getKeyValueStorage().getItem(n.refreshToken)??void 0,s=await this.getKeyValueStorage().getItem(n.clockDrift)??"0",k=Number.parseInt(s),D=await this.getKeyValueStorage().getItem(n.signInDetails),V={accessToken:h,idToken:v,refreshToken:E,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:k,username:await this.getLastAuthUser()};return D&&(V.signInDetails=JSON.parse(D)),V}catch{return null}}async storeTokens(n){sD(n!==void 0,Yg.InvalidAuthTokens),await this.clearTokens();const l=n.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),l);const h=await this.getAuthKeys();await this.getKeyValueStorage().setItem(h.accessToken,n.accessToken.toString()),n.idToken&&await this.getKeyValueStorage().setItem(h.idToken,n.idToken.toString()),n.refreshToken&&await this.getKeyValueStorage().setItem(h.refreshToken,n.refreshToken),n.deviceMetadata&&(n.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(h.deviceKey,n.deviceMetadata.deviceKey),n.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(h.deviceGroupKey,n.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(h.randomPasswordKey,n.deviceMetadata.randomPassword)),n.signInDetails&&await this.getKeyValueStorage().setItem(h.signInDetails,JSON.stringify(n.signInDetails)),await this.getKeyValueStorage().setItem(h.clockDrift,`${n.clockDrift}`)}async clearTokens(){const n=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(n.accessToken),this.getKeyValueStorage().removeItem(n.idToken),this.getKeyValueStorage().removeItem(n.clockDrift),this.getKeyValueStorage().removeItem(n.refreshToken),this.getKeyValueStorage().removeItem(n.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(n.oauthMetadata)])}async getDeviceMetadata(n){const l=await this.getAuthKeys(n),h=await this.getKeyValueStorage().getItem(l.deviceKey),m=await this.getKeyValueStorage().getItem(l.deviceGroupKey),v=await this.getKeyValueStorage().getItem(l.randomPasswordKey);return v&&m&&h?{deviceKey:h,deviceGroupKey:m,randomPassword:v}:null}async clearDeviceMetadata(n){const l=await this.getAuthKeys(n);await Promise.all([this.getKeyValueStorage().removeItem(l.deviceKey),this.getKeyValueStorage().removeItem(l.deviceGroupKey),this.getKeyValueStorage().removeItem(l.randomPasswordKey)])}async getAuthKeys(n){var h;Ti((h=this.authConfig)==null?void 0:h.Cognito);const l=n??await this.getLastAuthUser();return lD(this.name,`${this.authConfig.Cognito.userPoolClientId}.${l}`)}getLastAuthUserKey(){var l;Ti((l=this.authConfig)==null?void 0:l.Cognito);const n=this.authConfig.Cognito.userPoolClientId;return`${this.name}.${n}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(n){const{oauthMetadata:l}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(l,JSON.stringify(n))}async getOAuthMetadata(){const{oauthMetadata:n}=await this.getAuthKeys(),l=await this.getKeyValueStorage().getItem(n);return l&&JSON.parse(l)}}const lD=(e,n)=>_x(iD)(`${e}`,n);function _x(e){const n=Object.values({...e});return(l,h)=>n.reduce((m,v)=>({...m,[v]:`${l}.${h}.${v}`}),{})}const XE="amplify-signin-with-hostedUI",fs="CognitoIdentityServiceProvider";class cD{constructor(n){this.keyValueStorage=n}async clearOAuthInflightData(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(n.inflightOAuth),this.keyValueStorage.removeItem(n.oauthPKCE),this.keyValueStorage.removeItem(n.oauthState)])}async clearOAuthData(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(XE),this.keyValueStorage.removeItem(n.oauthSignIn)}loadOAuthState(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthState)}storeOAuthState(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(l.oauthState,n)}loadPKCE(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthPKCE)}storePKCE(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(l.oauthPKCE,n)}setAuthConfig(n){this.cognitoConfig=n}async loadOAuthInFlight(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(n.inflightOAuth)==="true"}async storeOAuthInFlight(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(l.inflightOAuth,`${n}`)}async loadOAuthSignIn(){var v;Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId),l=await this.keyValueStorage.getItem(XE),[h,m]=((v=await this.keyValueStorage.getItem(n.oauthSignIn))==null?void 0:v.split(","))??[];return{isOAuthSignIn:h==="true"||l==="true",preferPrivateSession:m==="true"}}async storeOAuthSignIn(n,l=!1){Ti(this.cognitoConfig);const h=ms(fs,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(h.oauthSignIn,`${n},${l}`)}}const ms=(e,n)=>_x(J3)(e,n),KE=new cD(qp),uD=[],hD=e=>{uD.push(e)};class dD{constructor(){this.waitForInflightOAuth=$R()?async()=>{if(await KE.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((n,l)=>{hD(n)}),this.inflightPromise)}:async()=>{}}setAuthConfig(n){KE.setAuthConfig(n.Cognito),this.authConfig=n}setTokenRefresher(n){this.tokenRefresher=n}setAuthTokenStore(n){this.tokenStore=n}getTokenStore(){if(!this.tokenStore)throw new er({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new er({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}async getTokens(n){var E,s,k,D,V;let l;try{Ti((E=this.authConfig)==null?void 0:E.Cognito)}catch{return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,l=await this.getTokenStore().loadTokens();const h=await this.getTokenStore().getLastAuthUser();if(l===null)return null;const m=!!(l!=null&&l.idToken)&&PE({expiresAt:(((k=(s=l.idToken)==null?void 0:s.payload)==null?void 0:k.exp)??0)*1e3,clockDrift:l.clockDrift??0}),v=PE({expiresAt:(((V=(D=l.accessToken)==null?void 0:D.payload)==null?void 0:V.exp)??0)*1e3,clockDrift:l.clockDrift??0});return(n!=null&&n.forceRefresh||m||v)&&(l=await this.refreshTokens({tokens:l,username:h}),l===null)?null:{accessToken:l==null?void 0:l.accessToken,idToken:l==null?void 0:l.idToken,signInDetails:l==null?void 0:l.signInDetails}}async refreshTokens({tokens:n,username:l}){try{const{signInDetails:h}=n,m=await this.getTokenRefresher()({tokens:n,authConfig:this.authConfig,username:l});return m.signInDetails=h,await this.setTokens({tokens:m}),t1.dispatch("auth",{event:"tokenRefresh"},"Auth",Xg),m}catch(h){return this.handleErrors(h)}}handleErrors(n){if(EC(n),n.message!=="Network error"&&this.clearTokens(),t1.dispatch("auth",{event:"tokenRefresh_failure",data:{error:n}},"Auth",Xg),n.name.startsWith("NotAuthorizedException"))return null;throw n}async setTokens({tokens:n}){return this.getTokenStore().storeTokens(n)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(n){return this.getTokenStore().getDeviceMetadata(n)}clearDeviceMetadata(n){return this.getTokenStore().clearDeviceMetadata(n)}setOAuthMetadata(n){return this.getTokenStore().setOAuthMetadata(n)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class pD{constructor(){this.authTokenStore=new aD,this.authTokenStore.setKeyValueStorage(qp),this.tokenOrchestrator=new dD,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(rD)}getTokens({forceRefresh:n}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:n})}setKeyValueStorage(n){this.authTokenStore.setKeyValueStorage(n)}setAuthConfig(n){this.authTokenStore.setAuthConfig(n),this.tokenOrchestrator.setAuthConfig(n)}}const Qm=new pD,fD={identityId:"identityId"},mD=new Zo("DefaultIdentityIdStore");class gD{setAuthConfig(n){gg(n.Cognito),this.authConfig=n,this._authKeys=_D("Cognito",n.Cognito.identityPoolId)}constructor(n){this._authKeys={},this.keyValueStorage=n}async loadIdentityId(){var n;gg((n=this.authConfig)==null?void 0:n.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const l=await this.keyValueStorage.getItem(this._authKeys.identityId);return l?{id:l,type:"guest"}:null}}catch(l){return mD.log("Error getting stored IdentityId.",l),null}}async storeIdentityId(n){var l;gg((l=this.authConfig)==null?void 0:l.Cognito),n.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,n.id),this._primaryIdentityId=void 0):(this._primaryIdentityId=n.id,this.keyValueStorage.removeItem(this._authKeys.identityId))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const _D=(e,n)=>_x(fD)(`com.amplify.${e}`,n);function CC(e){const n=$p(e).payload.iss,l={};if(!n)throw new er({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const h=n.replace(/(^\w+:|^)\/\//,"");return l[h]=e,l}const yD=new Zo("CognitoIdentityIdProvider");async function vD({tokens:e,authConfig:n,identityIdStore:l}){l.setAuthConfig({Cognito:n});let h=await l.loadIdentityId();if(e){if(h&&h.type==="primary")return h.id;{const m=e.idToken?CC(e.idToken.toString()):{},v=await YE(m,n);h&&h.id===v&&yD.debug(`The guest identity ${h.id} has become the primary identity.`),h={id:v,type:"primary"}}}else{if(h&&h.type==="guest")return h.id;h={id:await YE({},n),type:"guest"}}return l.storeIdentityId(h),h.id}async function YE(e,n){const l=n==null?void 0:n.identityPoolId,h=i1(l),m=(await E3({region:h},{IdentityPoolId:l,Logins:e})).IdentityId;if(!m)throw new er({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return m}const eg=new Zo("CognitoCredentialsProvider"),JE=50*60*1e3;class xD{constructor(n){this._nextCredentialsRefresh=0,this._identityIdStore=n}async clearCredentialsAndIdentityId(){eg.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){eg.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(n){const l=n.authenticated,{tokens:h}=n,{authConfig:m}=n;try{gg(m==null?void 0:m.Cognito)}catch{return}if(!l&&!m.Cognito.allowGuestAccess)return;const{forceRefresh:v}=n,E=this.hasTokenChanged(h),s=await vD({tokens:h,authConfig:m.Cognito,identityIdStore:this._identityIdStore});return(v||E)&&this.clearCredentials(),l?(H3(h),this.credsForOIDCTokens(m.Cognito,h,s)):this.getGuestCredentials(s,m.Cognito)}async getGuestCredentials(n,l){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return eg.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const h=i1(l.identityPoolId),m=await ZE({region:h},{IdentityId:n});if(m.Credentials&&m.Credentials.AccessKeyId&&m.Credentials.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+JE;const v={credentials:{accessKeyId:m.Credentials.AccessKeyId,secretAccessKey:m.Credentials.SecretKey,sessionToken:m.Credentials.SessionToken,expiration:m.Credentials.Expiration},identityId:n},E=m.IdentityId;return E&&(v.identityId=E,this._identityIdStore.storeIdentityId({id:E,type:"guest"})),this._credentialsAndIdentityId={...v,isAuthenticatedCreds:!1},v}else throw new er({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(n,l,h){var s;if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return eg.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const m=l.idToken?CC(l.idToken.toString()):{},v=i1(n.identityPoolId),E=await ZE({region:v},{IdentityId:h,Logins:m});if(E.Credentials&&E.Credentials.AccessKeyId&&E.Credentials.SecretKey){const k={credentials:{accessKeyId:E.Credentials.AccessKeyId,secretAccessKey:E.Credentials.SecretKey,sessionToken:E.Credentials.SessionToken,expiration:E.Credentials.Expiration},identityId:h};this._credentialsAndIdentityId={...k,isAuthenticatedCreds:!0,associatedIdToken:(s=l.idToken)==null?void 0:s.toString()},this._nextCredentialsRefresh=new Date().getTime()+JE;const D=E.IdentityId;return D&&(k.identityId=D,this._identityIdStore.storeIdentityId({id:D,type:"primary"})),k}else throw new er({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(n){var l,h;return!!n&&!!((l=this._credentialsAndIdentityId)!=null&&l.associatedIdToken)&&((h=n.idToken)==null?void 0:h.toString())!==this._credentialsAndIdentityId.associatedIdToken}}const wD=new xD(new gD(qp)),bD={configure(e,n){const l=uC(e);if(!l.Auth){Ws.configure(l,n);return}if(n!=null&&n.Auth){Ws.configure(l,n);return}if(!Ws.libraryOptions.Auth){Qm.setAuthConfig(l.Auth),Qm.setKeyValueStorage(n!=null&&n.ssr?new HE({sameSite:"lax"}):qp),Ws.configure(l,{...n,Auth:{tokenProvider:Qm,credentialsProvider:wD}});return}if(n){n.ssr!==void 0&&Qm.setKeyValueStorage(n.ssr?new HE({sameSite:"lax"}):qp),Ws.configure(l,{Auth:Ws.libraryOptions.Auth,...n});return}Ws.configure(l)},getConfig(){return Ws.getConfig()}};/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */var ED={oauth:{domain:"authcori.auth.us-east-1.amazoncognito.com"}},TD="us-east-1",SD="us-east-1_QeA4600FA",AD="5eusi16g0o2q1g1rr5ehgudodm",CD="authcori.auth.us-east-1.amazoncognito.com",ID="us-east-1",kD="us-east-1:2194a76a-fa3d-4c33-999e-e3c4b2b049ee",MD=["EMAIL"],PD=["EMAIL","OPENID"],zD=["EMAIL","OPENID"],LD={passwordPolicyMinLength:8,passwordPolicyCharacters:["REQUIRES_NUMBERS","REQUIRES_LOWERCASE","REQUIRES_UPPERCASE","REQUIRES_SYMBOLS"]},RD="https://bdkxhfgus5dztobic7gvn5ymue.appsync-api.us-east-1.amazonaws.com/graphql",DD="us-east-1",OD="da2-yexc3mow25fc3amaendi4vscuq",BD="API_KEY",FD="AMAZON_COGNITO_USER_POOLS,AWS_IAM",ND={version:1,models:{Todo:{name:"Todo",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},content:{name:"content",isArray:!1,type:"String",isRequired:!1,attributes:[]},owner:{name:"owner",isArray:!1,type:"String",isRequired:!1,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!0,attributes:[]},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!0,attributes:[]}},syncable:!0,pluralName:"Todos",attributes:[{type:"model",properties:{}},{type:"key",properties:{fields:["id"]}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]},{allow:"public",operations:["read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}}},enums:{},nonModels:{}},UD={Auth:ED,aws_project_region:TD,aws_user_pools_id:SD,aws_user_pools_web_client_id:AD,aws_cognito_domain:CD,aws_cognito_region:ID,aws_cognito_identity_pool_id:kD,aws_cognito_signup_attributes:MD,aws_cognito_username_attributes:PD,aws_cognito_verification_mechanisms:zD,aws_cognito_password_protection_settings:LD,aws_appsync_graphqlEndpoint:RD,aws_appsync_region:DD,aws_appsync_apiKey:OD,aws_appsync_authenticationType:BD,aws_appsync_additionalAuthenticationTypes:FD,modelIntrospection:ND};/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */bD.configure(UD);const jD={domain:void 0,region:void 0,identityPoolId:void 0,userPoolId:void 0,userPoolClientId:void 0};ut.createContext(jD);function IC(e,n){return function(){return e.apply(n,arguments)}}const{toString:VD}=Object.prototype,{getPrototypeOf:yx}=Object,S_=(e=>n=>{const l=VD.call(n);return e[l]||(e[l]=l.slice(8,-1).toLowerCase())})(Object.create(null)),Ko=e=>(e=e.toLowerCase(),n=>S_(n)===e),A_=e=>n=>typeof n===e,{isArray:mh}=Array,Wp=A_("undefined");function $D(e){return e!==null&&!Wp(e)&&e.constructor!==null&&!Wp(e.constructor)&&qi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const kC=Ko("ArrayBuffer");function GD(e){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&kC(e.buffer),n}const qD=A_("string"),qi=A_("function"),MC=A_("number"),C_=e=>e!==null&&typeof e=="object",WD=e=>e===!0||e===!1,yg=e=>{if(S_(e)!=="object")return!1;const n=yx(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ZD=Ko("Date"),HD=Ko("File"),XD=Ko("Blob"),KD=Ko("FileList"),YD=e=>C_(e)&&qi(e.pipe),JD=e=>{let n;return e&&(typeof FormData=="function"&&e instanceof FormData||qi(e.append)&&((n=S_(e))==="formdata"||n==="object"&&qi(e.toString)&&e.toString()==="[object FormData]"))},QD=Ko("URLSearchParams"),[e5,t5,n5,r5]=["ReadableStream","Request","Response","Headers"].map(Ko),i5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rf(e,n,{allOwnKeys:l=!1}={}){if(e===null||typeof e>"u")return;let h,m;if(typeof e!="object"&&(e=[e]),mh(e))for(h=0,m=e.length;h0;)if(m=l[h],n===m.toLowerCase())return m;return null}const dc=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),zC=e=>!Wp(e)&&e!==dc;function o1(){const{caseless:e}=zC(this)&&this||{},n={},l=(h,m)=>{const v=e&&PC(n,m)||m;yg(n[v])&&yg(h)?n[v]=o1(n[v],h):yg(h)?n[v]=o1({},h):mh(h)?n[v]=h.slice():n[v]=h};for(let h=0,m=arguments.length;h(rf(n,(m,v)=>{l&&qi(m)?e[v]=IC(m,l):e[v]=m},{allOwnKeys:h}),e),s5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),a5=(e,n,l,h)=>{e.prototype=Object.create(n.prototype,h),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:n.prototype}),l&&Object.assign(e.prototype,l)},l5=(e,n,l,h)=>{let m,v,E;const s={};if(n=n||{},e==null)return n;do{for(m=Object.getOwnPropertyNames(e),v=m.length;v-- >0;)E=m[v],(!h||h(E,e,n))&&!s[E]&&(n[E]=e[E],s[E]=!0);e=l!==!1&&yx(e)}while(e&&(!l||l(e,n))&&e!==Object.prototype);return n},c5=(e,n,l)=>{e=String(e),(l===void 0||l>e.length)&&(l=e.length),l-=n.length;const h=e.indexOf(n,l);return h!==-1&&h===l},u5=e=>{if(!e)return null;if(mh(e))return e;let n=e.length;if(!MC(n))return null;const l=new Array(n);for(;n-- >0;)l[n]=e[n];return l},h5=(e=>n=>e&&n instanceof e)(typeof Uint8Array<"u"&&yx(Uint8Array)),d5=(e,n)=>{const h=(e&&e[Symbol.iterator]).call(e);let m;for(;(m=h.next())&&!m.done;){const v=m.value;n.call(e,v[0],v[1])}},p5=(e,n)=>{let l;const h=[];for(;(l=e.exec(n))!==null;)h.push(l);return h},f5=Ko("HTMLFormElement"),m5=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(l,h,m){return h.toUpperCase()+m}),QE=(({hasOwnProperty:e})=>(n,l)=>e.call(n,l))(Object.prototype),g5=Ko("RegExp"),LC=(e,n)=>{const l=Object.getOwnPropertyDescriptors(e),h={};rf(l,(m,v)=>{let E;(E=n(m,v,e))!==!1&&(h[v]=E||m)}),Object.defineProperties(e,h)},_5=e=>{LC(e,(n,l)=>{if(qi(e)&&["arguments","caller","callee"].indexOf(l)!==-1)return!1;const h=e[l];if(qi(h)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+l+"'")})}})},y5=(e,n)=>{const l={},h=m=>{m.forEach(v=>{l[v]=!0})};return mh(e)?h(e):h(String(e).split(n)),l},v5=()=>{},x5=(e,n)=>e!=null&&Number.isFinite(e=+e)?e:n,Y0="abcdefghijklmnopqrstuvwxyz",eT="0123456789",RC={DIGIT:eT,ALPHA:Y0,ALPHA_DIGIT:Y0+Y0.toUpperCase()+eT},w5=(e=16,n=RC.ALPHA_DIGIT)=>{let l="";const{length:h}=n;for(;e--;)l+=n[Math.random()*h|0];return l};function b5(e){return!!(e&&qi(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const E5=e=>{const n=new Array(10),l=(h,m)=>{if(C_(h)){if(n.indexOf(h)>=0)return;if(!("toJSON"in h)){n[m]=h;const v=mh(h)?[]:{};return rf(h,(E,s)=>{const k=l(E,m+1);!Wp(k)&&(v[s]=k)}),n[m]=void 0,v}}return h};return l(e,0)},T5=Ko("AsyncFunction"),S5=e=>e&&(C_(e)||qi(e))&&qi(e.then)&&qi(e.catch),DC=((e,n)=>e?setImmediate:n?((l,h)=>(dc.addEventListener("message",({source:m,data:v})=>{m===dc&&v===l&&h.length&&h.shift()()},!1),m=>{h.push(m),dc.postMessage(l,"*")}))(`axios@${Math.random()}`,[]):l=>setTimeout(l))(typeof setImmediate=="function",qi(dc.postMessage)),A5=typeof queueMicrotask<"u"?queueMicrotask.bind(dc):typeof process<"u"&&process.nextTick||DC,Ne={isArray:mh,isArrayBuffer:kC,isBuffer:$D,isFormData:JD,isArrayBufferView:GD,isString:qD,isNumber:MC,isBoolean:WD,isObject:C_,isPlainObject:yg,isReadableStream:e5,isRequest:t5,isResponse:n5,isHeaders:r5,isUndefined:Wp,isDate:ZD,isFile:HD,isBlob:XD,isRegExp:g5,isFunction:qi,isStream:YD,isURLSearchParams:QD,isTypedArray:h5,isFileList:KD,forEach:rf,merge:o1,extend:o5,trim:i5,stripBOM:s5,inherits:a5,toFlatObject:l5,kindOf:S_,kindOfTest:Ko,endsWith:c5,toArray:u5,forEachEntry:d5,matchAll:p5,isHTMLForm:f5,hasOwnProperty:QE,hasOwnProp:QE,reduceDescriptors:LC,freezeMethods:_5,toObjectSet:y5,toCamelCase:m5,noop:v5,toFiniteNumber:x5,findKey:PC,global:dc,isContextDefined:zC,ALPHABET:RC,generateString:w5,isSpecCompliantForm:b5,toJSONObject:E5,isAsyncFn:T5,isThenable:S5,setImmediate:DC,asap:A5};function qt(e,n,l,h,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",n&&(this.code=n),l&&(this.config=l),h&&(this.request=h),m&&(this.response=m,this.status=m.status?m.status:null)}Ne.inherits(qt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ne.toJSONObject(this.config),code:this.code,status:this.status}}});const OC=qt.prototype,BC={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{BC[e]={value:e}});Object.defineProperties(qt,BC);Object.defineProperty(OC,"isAxiosError",{value:!0});qt.from=(e,n,l,h,m,v)=>{const E=Object.create(OC);return Ne.toFlatObject(e,E,function(k){return k!==Error.prototype},s=>s!=="isAxiosError"),qt.call(E,e.message,n,l,h,m),E.cause=e,E.name=e.name,v&&Object.assign(E,v),E};const C5=null;function s1(e){return Ne.isPlainObject(e)||Ne.isArray(e)}function FC(e){return Ne.endsWith(e,"[]")?e.slice(0,-2):e}function tT(e,n,l){return e?e.concat(n).map(function(m,v){return m=FC(m),!l&&v?"["+m+"]":m}).join(l?".":""):n}function I5(e){return Ne.isArray(e)&&!e.some(s1)}const k5=Ne.toFlatObject(Ne,{},null,function(n){return/^is[A-Z]/.test(n)});function I_(e,n,l){if(!Ne.isObject(e))throw new TypeError("target must be an object");n=n||new FormData,l=Ne.toFlatObject(l,{metaTokens:!0,dots:!1,indexes:!1},!1,function(me,Ce){return!Ne.isUndefined(Ce[me])});const h=l.metaTokens,m=l.visitor||V,v=l.dots,E=l.indexes,k=(l.Blob||typeof Blob<"u"&&Blob)&&Ne.isSpecCompliantForm(n);if(!Ne.isFunction(m))throw new TypeError("visitor must be a function");function D(ae){if(ae===null)return"";if(Ne.isDate(ae))return ae.toISOString();if(!k&&Ne.isBlob(ae))throw new qt("Blob is not supported. Use a Buffer instead.");return Ne.isArrayBuffer(ae)||Ne.isTypedArray(ae)?k&&typeof Blob=="function"?new Blob([ae]):Buffer.from(ae):ae}function V(ae,me,Ce){let ie=ae;if(ae&&!Ce&&typeof ae=="object"){if(Ne.endsWith(me,"{}"))me=h?me:me.slice(0,-2),ae=JSON.stringify(ae);else if(Ne.isArray(ae)&&I5(ae)||(Ne.isFileList(ae)||Ne.endsWith(me,"[]"))&&(ie=Ne.toArray(ae)))return me=FC(me),ie.forEach(function(le,ze){!(Ne.isUndefined(le)||le===null)&&n.append(E===!0?tT([me],ze,v):E===null?me:me+"[]",D(le))}),!1}return s1(ae)?!0:(n.append(tT(Ce,me,v),D(ae)),!1)}const G=[],J=Object.assign(k5,{defaultVisitor:V,convertValue:D,isVisitable:s1});function ve(ae,me){if(!Ne.isUndefined(ae)){if(G.indexOf(ae)!==-1)throw Error("Circular reference detected in "+me.join("."));G.push(ae),Ne.forEach(ae,function(ie,te){(!(Ne.isUndefined(ie)||ie===null)&&m.call(n,ie,Ne.isString(te)?te.trim():te,me,J))===!0&&ve(ie,me?me.concat(te):[te])}),G.pop()}}if(!Ne.isObject(e))throw new TypeError("data must be an object");return ve(e),n}function nT(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(h){return n[h]})}function vx(e,n){this._pairs=[],e&&I_(e,this,n)}const NC=vx.prototype;NC.append=function(n,l){this._pairs.push([n,l])};NC.toString=function(n){const l=n?function(h){return n.call(this,h,nT)}:nT;return this._pairs.map(function(m){return l(m[0])+"="+l(m[1])},"").join("&")};function M5(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function UC(e,n,l){if(!n)return e;const h=l&&l.encode||M5,m=l&&l.serialize;let v;if(m?v=m(n,l):v=Ne.isURLSearchParams(n)?n.toString():new vx(n,l).toString(h),v){const E=e.indexOf("#");E!==-1&&(e=e.slice(0,E)),e+=(e.indexOf("?")===-1?"?":"&")+v}return e}class P5{constructor(){this.handlers=[]}use(n,l,h){return this.handlers.push({fulfilled:n,rejected:l,synchronous:h?h.synchronous:!1,runWhen:h?h.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){Ne.forEach(this.handlers,function(h){h!==null&&n(h)})}}const rT=P5,jC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},z5=typeof URLSearchParams<"u"?URLSearchParams:vx,L5=typeof FormData<"u"?FormData:null,R5=typeof Blob<"u"?Blob:null,D5={isBrowser:!0,classes:{URLSearchParams:z5,FormData:L5,Blob:R5},protocols:["http","https","file","blob","url","data"]},xx=typeof window<"u"&&typeof document<"u",a1=typeof navigator=="object"&&navigator||void 0,O5=xx&&(!a1||["ReactNative","NativeScript","NS"].indexOf(a1.product)<0),B5=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),F5=xx&&window.location.href||"http://localhost",N5=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xx,hasStandardBrowserEnv:O5,hasStandardBrowserWebWorkerEnv:B5,navigator:a1,origin:F5},Symbol.toStringTag,{value:"Module"})),Mi={...N5,...D5};function U5(e,n){return I_(e,new Mi.classes.URLSearchParams,Object.assign({visitor:function(l,h,m,v){return Mi.isNode&&Ne.isBuffer(l)?(this.append(h,l.toString("base64")),!1):v.defaultVisitor.apply(this,arguments)}},n))}function j5(e){return Ne.matchAll(/\w+|\[(\w*)]/g,e).map(n=>n[0]==="[]"?"":n[1]||n[0])}function V5(e){const n={},l=Object.keys(e);let h;const m=l.length;let v;for(h=0;h=l.length;return E=!E&&Ne.isArray(m)?m.length:E,k?(Ne.hasOwnProp(m,E)?m[E]=[m[E],h]:m[E]=h,!s):((!m[E]||!Ne.isObject(m[E]))&&(m[E]=[]),n(l,h,m[E],v)&&Ne.isArray(m[E])&&(m[E]=V5(m[E])),!s)}if(Ne.isFormData(e)&&Ne.isFunction(e.entries)){const l={};return Ne.forEachEntry(e,(h,m)=>{n(j5(h),m,l,0)}),l}return null}function $5(e,n,l){if(Ne.isString(e))try{return(n||JSON.parse)(e),Ne.trim(e)}catch(h){if(h.name!=="SyntaxError")throw h}return(l||JSON.stringify)(e)}const wx={transitional:jC,adapter:["xhr","http","fetch"],transformRequest:[function(n,l){const h=l.getContentType()||"",m=h.indexOf("application/json")>-1,v=Ne.isObject(n);if(v&&Ne.isHTMLForm(n)&&(n=new FormData(n)),Ne.isFormData(n))return m?JSON.stringify(VC(n)):n;if(Ne.isArrayBuffer(n)||Ne.isBuffer(n)||Ne.isStream(n)||Ne.isFile(n)||Ne.isBlob(n)||Ne.isReadableStream(n))return n;if(Ne.isArrayBufferView(n))return n.buffer;if(Ne.isURLSearchParams(n))return l.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let s;if(v){if(h.indexOf("application/x-www-form-urlencoded")>-1)return U5(n,this.formSerializer).toString();if((s=Ne.isFileList(n))||h.indexOf("multipart/form-data")>-1){const k=this.env&&this.env.FormData;return I_(s?{"files[]":n}:n,k&&new k,this.formSerializer)}}return v||m?(l.setContentType("application/json",!1),$5(n)):n}],transformResponse:[function(n){const l=this.transitional||wx.transitional,h=l&&l.forcedJSONParsing,m=this.responseType==="json";if(Ne.isResponse(n)||Ne.isReadableStream(n))return n;if(n&&Ne.isString(n)&&(h&&!this.responseType||m)){const E=!(l&&l.silentJSONParsing)&&m;try{return JSON.parse(n)}catch(s){if(E)throw s.name==="SyntaxError"?qt.from(s,qt.ERR_BAD_RESPONSE,this,null,this.response):s}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mi.classes.FormData,Blob:Mi.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ne.forEach(["delete","get","head","post","put","patch"],e=>{wx.headers[e]={}});const bx=wx,G5=Ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),q5=e=>{const n={};let l,h,m;return e&&e.split(` -`).forEach(function(E){m=E.indexOf(":"),l=E.substring(0,m).trim().toLowerCase(),h=E.substring(m+1).trim(),!(!l||n[l]&&G5[l])&&(l==="set-cookie"?n[l]?n[l].push(h):n[l]=[h]:n[l]=n[l]?n[l]+", "+h:h)}),n},iT=Symbol("internals");function ap(e){return e&&String(e).trim().toLowerCase()}function vg(e){return e===!1||e==null?e:Ne.isArray(e)?e.map(vg):String(e)}function W5(e){const n=Object.create(null),l=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let h;for(;h=l.exec(e);)n[h[1]]=h[2];return n}const Z5=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function J0(e,n,l,h,m){if(Ne.isFunction(h))return h.call(this,n,l);if(m&&(n=l),!!Ne.isString(n)){if(Ne.isString(h))return n.indexOf(h)!==-1;if(Ne.isRegExp(h))return h.test(n)}}function H5(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,l,h)=>l.toUpperCase()+h)}function X5(e,n){const l=Ne.toCamelCase(" "+n);["get","set","has"].forEach(h=>{Object.defineProperty(e,h+l,{value:function(m,v,E){return this[h].call(this,n,m,v,E)},configurable:!0})})}class k_{constructor(n){n&&this.set(n)}set(n,l,h){const m=this;function v(s,k,D){const V=ap(k);if(!V)throw new Error("header name must be a non-empty string");const G=Ne.findKey(m,V);(!G||m[G]===void 0||D===!0||D===void 0&&m[G]!==!1)&&(m[G||k]=vg(s))}const E=(s,k)=>Ne.forEach(s,(D,V)=>v(D,V,k));if(Ne.isPlainObject(n)||n instanceof this.constructor)E(n,l);else if(Ne.isString(n)&&(n=n.trim())&&!Z5(n))E(q5(n),l);else if(Ne.isHeaders(n))for(const[s,k]of n.entries())v(k,s,h);else n!=null&&v(l,n,h);return this}get(n,l){if(n=ap(n),n){const h=Ne.findKey(this,n);if(h){const m=this[h];if(!l)return m;if(l===!0)return W5(m);if(Ne.isFunction(l))return l.call(this,m,h);if(Ne.isRegExp(l))return l.exec(m);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,l){if(n=ap(n),n){const h=Ne.findKey(this,n);return!!(h&&this[h]!==void 0&&(!l||J0(this,this[h],h,l)))}return!1}delete(n,l){const h=this;let m=!1;function v(E){if(E=ap(E),E){const s=Ne.findKey(h,E);s&&(!l||J0(h,h[s],s,l))&&(delete h[s],m=!0)}}return Ne.isArray(n)?n.forEach(v):v(n),m}clear(n){const l=Object.keys(this);let h=l.length,m=!1;for(;h--;){const v=l[h];(!n||J0(this,this[v],v,n,!0))&&(delete this[v],m=!0)}return m}normalize(n){const l=this,h={};return Ne.forEach(this,(m,v)=>{const E=Ne.findKey(h,v);if(E){l[E]=vg(m),delete l[v];return}const s=n?H5(v):String(v).trim();s!==v&&delete l[v],l[s]=vg(m),h[s]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const l=Object.create(null);return Ne.forEach(this,(h,m)=>{h!=null&&h!==!1&&(l[m]=n&&Ne.isArray(h)?h.join(", "):h)}),l}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,l])=>n+": "+l).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...l){const h=new this(n);return l.forEach(m=>h.set(m)),h}static accessor(n){const h=(this[iT]=this[iT]={accessors:{}}).accessors,m=this.prototype;function v(E){const s=ap(E);h[s]||(X5(m,E),h[s]=!0)}return Ne.isArray(n)?n.forEach(v):v(n),this}}k_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ne.reduceDescriptors(k_.prototype,({value:e},n)=>{let l=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(h){this[l]=h}}});Ne.freezeMethods(k_);const Ho=k_;function Q0(e,n){const l=this||bx,h=n||l,m=Ho.from(h.headers);let v=h.data;return Ne.forEach(e,function(s){v=s.call(l,v,m.normalize(),n?n.status:void 0)}),m.normalize(),v}function $C(e){return!!(e&&e.__CANCEL__)}function gh(e,n,l){qt.call(this,e??"canceled",qt.ERR_CANCELED,n,l),this.name="CanceledError"}Ne.inherits(gh,qt,{__CANCEL__:!0});function GC(e,n,l){const h=l.config.validateStatus;!l.status||!h||h(l.status)?e(l):n(new qt("Request failed with status code "+l.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(l.status/100)-4],l.config,l.request,l))}function K5(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}function Y5(e,n){e=e||10;const l=new Array(e),h=new Array(e);let m=0,v=0,E;return n=n!==void 0?n:1e3,function(k){const D=Date.now(),V=h[v];E||(E=D),l[m]=k,h[m]=D;let G=v,J=0;for(;G!==m;)J+=l[G++],G=G%e;if(m=(m+1)%e,m===v&&(v=(v+1)%e),D-E{l=V,m=null,v&&(clearTimeout(v),v=null),e.apply(null,D)};return[(...D)=>{const V=Date.now(),G=V-l;G>=h?E(D,V):(m=D,v||(v=setTimeout(()=>{v=null,E(m)},h-G)))},()=>m&&E(m)]}const Jg=(e,n,l=3)=>{let h=0;const m=Y5(50,250);return J5(v=>{const E=v.loaded,s=v.lengthComputable?v.total:void 0,k=E-h,D=m(k),V=E<=s;h=E;const G={loaded:E,total:s,progress:s?E/s:void 0,bytes:k,rate:D||void 0,estimated:D&&s&&V?(s-E)/D:void 0,event:v,lengthComputable:s!=null,[n?"download":"upload"]:!0};e(G)},l)},oT=(e,n)=>{const l=e!=null;return[h=>n[0]({lengthComputable:l,total:e,loaded:h}),n[1]]},sT=e=>(...n)=>Ne.asap(()=>e(...n)),Q5=Mi.hasStandardBrowserEnv?function(){const n=Mi.navigator&&/(msie|trident)/i.test(Mi.navigator.userAgent),l=document.createElement("a");let h;function m(v){let E=v;return n&&(l.setAttribute("href",E),E=l.href),l.setAttribute("href",E),{href:l.href,protocol:l.protocol?l.protocol.replace(/:$/,""):"",host:l.host,search:l.search?l.search.replace(/^\?/,""):"",hash:l.hash?l.hash.replace(/^#/,""):"",hostname:l.hostname,port:l.port,pathname:l.pathname.charAt(0)==="/"?l.pathname:"/"+l.pathname}}return h=m(window.location.href),function(E){const s=Ne.isString(E)?m(E):E;return s.protocol===h.protocol&&s.host===h.host}}():function(){return function(){return!0}}(),eO=Mi.hasStandardBrowserEnv?{write(e,n,l,h,m,v){const E=[e+"="+encodeURIComponent(n)];Ne.isNumber(l)&&E.push("expires="+new Date(l).toGMTString()),Ne.isString(h)&&E.push("path="+h),Ne.isString(m)&&E.push("domain="+m),v===!0&&E.push("secure"),document.cookie=E.join("; ")},read(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tO(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function nO(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}function qC(e,n){return e&&!tO(n)?nO(e,n):n}const aT=e=>e instanceof Ho?{...e}:e;function xc(e,n){n=n||{};const l={};function h(D,V,G){return Ne.isPlainObject(D)&&Ne.isPlainObject(V)?Ne.merge.call({caseless:G},D,V):Ne.isPlainObject(V)?Ne.merge({},V):Ne.isArray(V)?V.slice():V}function m(D,V,G){if(Ne.isUndefined(V)){if(!Ne.isUndefined(D))return h(void 0,D,G)}else return h(D,V,G)}function v(D,V){if(!Ne.isUndefined(V))return h(void 0,V)}function E(D,V){if(Ne.isUndefined(V)){if(!Ne.isUndefined(D))return h(void 0,D)}else return h(void 0,V)}function s(D,V,G){if(G in n)return h(D,V);if(G in e)return h(void 0,D)}const k={url:v,method:v,data:v,baseURL:E,transformRequest:E,transformResponse:E,paramsSerializer:E,timeout:E,timeoutMessage:E,withCredentials:E,withXSRFToken:E,adapter:E,responseType:E,xsrfCookieName:E,xsrfHeaderName:E,onUploadProgress:E,onDownloadProgress:E,decompress:E,maxContentLength:E,maxBodyLength:E,beforeRedirect:E,transport:E,httpAgent:E,httpsAgent:E,cancelToken:E,socketPath:E,responseEncoding:E,validateStatus:s,headers:(D,V)=>m(aT(D),aT(V),!0)};return Ne.forEach(Object.keys(Object.assign({},e,n)),function(V){const G=k[V]||m,J=G(e[V],n[V],V);Ne.isUndefined(J)&&G!==s||(l[V]=J)}),l}const WC=e=>{const n=xc({},e);let{data:l,withXSRFToken:h,xsrfHeaderName:m,xsrfCookieName:v,headers:E,auth:s}=n;n.headers=E=Ho.from(E),n.url=UC(qC(n.baseURL,n.url),e.params,e.paramsSerializer),s&&E.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let k;if(Ne.isFormData(l)){if(Mi.hasStandardBrowserEnv||Mi.hasStandardBrowserWebWorkerEnv)E.setContentType(void 0);else if((k=E.getContentType())!==!1){const[D,...V]=k?k.split(";").map(G=>G.trim()).filter(Boolean):[];E.setContentType([D||"multipart/form-data",...V].join("; "))}}if(Mi.hasStandardBrowserEnv&&(h&&Ne.isFunction(h)&&(h=h(n)),h||h!==!1&&Q5(n.url))){const D=m&&v&&eO.read(v);D&&E.set(m,D)}return n},rO=typeof XMLHttpRequest<"u",iO=rO&&function(e){return new Promise(function(l,h){const m=WC(e);let v=m.data;const E=Ho.from(m.headers).normalize();let{responseType:s,onUploadProgress:k,onDownloadProgress:D}=m,V,G,J,ve,ae;function me(){ve&&ve(),ae&&ae(),m.cancelToken&&m.cancelToken.unsubscribe(V),m.signal&&m.signal.removeEventListener("abort",V)}let Ce=new XMLHttpRequest;Ce.open(m.method.toUpperCase(),m.url,!0),Ce.timeout=m.timeout;function ie(){if(!Ce)return;const le=Ho.from("getAllResponseHeaders"in Ce&&Ce.getAllResponseHeaders()),Oe={data:!s||s==="text"||s==="json"?Ce.responseText:Ce.response,status:Ce.status,statusText:Ce.statusText,headers:le,config:e,request:Ce};GC(function(He){l(He),me()},function(He){h(He),me()},Oe),Ce=null}"onloadend"in Ce?Ce.onloadend=ie:Ce.onreadystatechange=function(){!Ce||Ce.readyState!==4||Ce.status===0&&!(Ce.responseURL&&Ce.responseURL.indexOf("file:")===0)||setTimeout(ie)},Ce.onabort=function(){Ce&&(h(new qt("Request aborted",qt.ECONNABORTED,e,Ce)),Ce=null)},Ce.onerror=function(){h(new qt("Network Error",qt.ERR_NETWORK,e,Ce)),Ce=null},Ce.ontimeout=function(){let ze=m.timeout?"timeout of "+m.timeout+"ms exceeded":"timeout exceeded";const Oe=m.transitional||jC;m.timeoutErrorMessage&&(ze=m.timeoutErrorMessage),h(new qt(ze,Oe.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,e,Ce)),Ce=null},v===void 0&&E.setContentType(null),"setRequestHeader"in Ce&&Ne.forEach(E.toJSON(),function(ze,Oe){Ce.setRequestHeader(Oe,ze)}),Ne.isUndefined(m.withCredentials)||(Ce.withCredentials=!!m.withCredentials),s&&s!=="json"&&(Ce.responseType=m.responseType),D&&([J,ae]=Jg(D,!0),Ce.addEventListener("progress",J)),k&&Ce.upload&&([G,ve]=Jg(k),Ce.upload.addEventListener("progress",G),Ce.upload.addEventListener("loadend",ve)),(m.cancelToken||m.signal)&&(V=le=>{Ce&&(h(!le||le.type?new gh(null,e,Ce):le),Ce.abort(),Ce=null)},m.cancelToken&&m.cancelToken.subscribe(V),m.signal&&(m.signal.aborted?V():m.signal.addEventListener("abort",V)));const te=K5(m.url);if(te&&Mi.protocols.indexOf(te)===-1){h(new qt("Unsupported protocol "+te+":",qt.ERR_BAD_REQUEST,e));return}Ce.send(v||null)})},oO=(e,n)=>{const{length:l}=e=e?e.filter(Boolean):[];if(n||l){let h=new AbortController,m;const v=function(D){if(!m){m=!0,s();const V=D instanceof Error?D:this.reason;h.abort(V instanceof qt?V:new gh(V instanceof Error?V.message:V))}};let E=n&&setTimeout(()=>{E=null,v(new qt(`timeout ${n} of ms exceeded`,qt.ETIMEDOUT))},n);const s=()=>{e&&(E&&clearTimeout(E),E=null,e.forEach(D=>{D.unsubscribe?D.unsubscribe(v):D.removeEventListener("abort",v)}),e=null)};e.forEach(D=>D.addEventListener("abort",v));const{signal:k}=h;return k.unsubscribe=()=>Ne.asap(s),k}},sO=oO,aO=function*(e,n){let l=e.byteLength;if(!n||l{const m=lO(e,n);let v=0,E,s=k=>{E||(E=!0,h&&h(k))};return new ReadableStream({async pull(k){try{const{done:D,value:V}=await m.next();if(D){s(),k.close();return}let G=V.byteLength;if(l){let J=v+=G;l(J)}k.enqueue(new Uint8Array(V))}catch(D){throw s(D),D}},cancel(k){return s(k),m.return()}},{highWaterMark:2})},M_=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ZC=M_&&typeof ReadableStream=="function",uO=M_&&(typeof TextEncoder=="function"?(e=>n=>e.encode(n))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),HC=(e,...n)=>{try{return!!e(...n)}catch{return!1}},hO=ZC&&HC(()=>{let e=!1;const n=new Request(Mi.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!n}),cT=64*1024,l1=ZC&&HC(()=>Ne.isReadableStream(new Response("").body)),Qg={stream:l1&&(e=>e.body)};M_&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(n=>{!Qg[n]&&(Qg[n]=Ne.isFunction(e[n])?l=>l[n]():(l,h)=>{throw new qt(`Response type '${n}' is not supported`,qt.ERR_NOT_SUPPORT,h)})})})(new Response);const dO=async e=>{if(e==null)return 0;if(Ne.isBlob(e))return e.size;if(Ne.isSpecCompliantForm(e))return(await new Request(Mi.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Ne.isArrayBufferView(e)||Ne.isArrayBuffer(e))return e.byteLength;if(Ne.isURLSearchParams(e)&&(e=e+""),Ne.isString(e))return(await uO(e)).byteLength},pO=async(e,n)=>{const l=Ne.toFiniteNumber(e.getContentLength());return l??dO(n)},fO=M_&&(async e=>{let{url:n,method:l,data:h,signal:m,cancelToken:v,timeout:E,onDownloadProgress:s,onUploadProgress:k,responseType:D,headers:V,withCredentials:G="same-origin",fetchOptions:J}=WC(e);D=D?(D+"").toLowerCase():"text";let ve=sO([m,v&&v.toAbortSignal()],E),ae;const me=ve&&ve.unsubscribe&&(()=>{ve.unsubscribe()});let Ce;try{if(k&&hO&&l!=="get"&&l!=="head"&&(Ce=await pO(V,h))!==0){let Oe=new Request(n,{method:"POST",body:h,duplex:"half"}),Ke;if(Ne.isFormData(h)&&(Ke=Oe.headers.get("content-type"))&&V.setContentType(Ke),Oe.body){const[He,ht]=oT(Ce,Jg(sT(k)));h=lT(Oe.body,cT,He,ht)}}Ne.isString(G)||(G=G?"include":"omit");const ie="credentials"in Request.prototype;ae=new Request(n,{...J,signal:ve,method:l.toUpperCase(),headers:V.normalize().toJSON(),body:h,duplex:"half",credentials:ie?G:void 0});let te=await fetch(ae);const le=l1&&(D==="stream"||D==="response");if(l1&&(s||le&&me)){const Oe={};["status","statusText","headers"].forEach(Ve=>{Oe[Ve]=te[Ve]});const Ke=Ne.toFiniteNumber(te.headers.get("content-length")),[He,ht]=s&&oT(Ke,Jg(sT(s),!0))||[];te=new Response(lT(te.body,cT,He,()=>{ht&&ht(),me&&me()}),Oe)}D=D||"text";let ze=await Qg[Ne.findKey(Qg,D)||"text"](te,e);return!le&&me&&me(),await new Promise((Oe,Ke)=>{GC(Oe,Ke,{data:ze,headers:Ho.from(te.headers),status:te.status,statusText:te.statusText,config:e,request:ae})})}catch(ie){throw me&&me(),ie&&ie.name==="TypeError"&&/fetch/i.test(ie.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,e,ae),{cause:ie.cause||ie}):qt.from(ie,ie&&ie.code,e,ae)}}),c1={http:C5,xhr:iO,fetch:fO};Ne.forEach(c1,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch{}Object.defineProperty(e,"adapterName",{value:n})}});const uT=e=>`- ${e}`,mO=e=>Ne.isFunction(e)||e===null||e===!1,XC={getAdapter:e=>{e=Ne.isArray(e)?e:[e];const{length:n}=e;let l,h;const m={};for(let v=0;v`adapter ${s} `+(k===!1?"is not supported by the environment":"is not available in the build"));let E=n?v.length>1?`since : -`+v.map(uT).join(` -`):" "+uT(v[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+E,"ERR_NOT_SUPPORT")}return h},adapters:c1};function ev(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gh(null,e)}function hT(e){return ev(e),e.headers=Ho.from(e.headers),e.data=Q0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),XC.getAdapter(e.adapter||bx.adapter)(e).then(function(h){return ev(e),h.data=Q0.call(e,e.transformResponse,h),h.headers=Ho.from(h.headers),h},function(h){return $C(h)||(ev(e),h&&h.response&&(h.response.data=Q0.call(e,e.transformResponse,h.response),h.response.headers=Ho.from(h.response.headers))),Promise.reject(h)})}const KC="1.7.7",Ex={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{Ex[e]=function(h){return typeof h===e||"a"+(n<1?"n ":" ")+e}});const dT={};Ex.transitional=function(n,l,h){function m(v,E){return"[Axios v"+KC+"] Transitional option '"+v+"'"+E+(h?". "+h:"")}return(v,E,s)=>{if(n===!1)throw new qt(m(E," has been removed"+(l?" in "+l:"")),qt.ERR_DEPRECATED);return l&&!dT[E]&&(dT[E]=!0,console.warn(m(E," has been deprecated since v"+l+" and will be removed in the near future"))),n?n(v,E,s):!0}};function gO(e,n,l){if(typeof e!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const h=Object.keys(e);let m=h.length;for(;m-- >0;){const v=h[m],E=n[v];if(E){const s=e[v],k=s===void 0||E(s,v,e);if(k!==!0)throw new qt("option "+v+" must be "+k,qt.ERR_BAD_OPTION_VALUE);continue}if(l!==!0)throw new qt("Unknown option "+v,qt.ERR_BAD_OPTION)}}const u1={assertOptions:gO,validators:Ex},Va=u1.validators;class e_{constructor(n){this.defaults=n,this.interceptors={request:new rT,response:new rT}}async request(n,l){try{return await this._request(n,l)}catch(h){if(h instanceof Error){let m;Error.captureStackTrace?Error.captureStackTrace(m={}):m=new Error;const v=m.stack?m.stack.replace(/^.+\n/,""):"";try{h.stack?v&&!String(h.stack).endsWith(v.replace(/^.+\n.+\n/,""))&&(h.stack+=` -`+v):h.stack=v}catch{}}throw h}}_request(n,l){typeof n=="string"?(l=l||{},l.url=n):l=n||{},l=xc(this.defaults,l);const{transitional:h,paramsSerializer:m,headers:v}=l;h!==void 0&&u1.assertOptions(h,{silentJSONParsing:Va.transitional(Va.boolean),forcedJSONParsing:Va.transitional(Va.boolean),clarifyTimeoutError:Va.transitional(Va.boolean)},!1),m!=null&&(Ne.isFunction(m)?l.paramsSerializer={serialize:m}:u1.assertOptions(m,{encode:Va.function,serialize:Va.function},!0)),l.method=(l.method||this.defaults.method||"get").toLowerCase();let E=v&&Ne.merge(v.common,v[l.method]);v&&Ne.forEach(["delete","get","head","post","put","patch","common"],ae=>{delete v[ae]}),l.headers=Ho.concat(E,v);const s=[];let k=!0;this.interceptors.request.forEach(function(me){typeof me.runWhen=="function"&&me.runWhen(l)===!1||(k=k&&me.synchronous,s.unshift(me.fulfilled,me.rejected))});const D=[];this.interceptors.response.forEach(function(me){D.push(me.fulfilled,me.rejected)});let V,G=0,J;if(!k){const ae=[hT.bind(this),void 0];for(ae.unshift.apply(ae,s),ae.push.apply(ae,D),J=ae.length,V=Promise.resolve(l);G{if(!h._listeners)return;let v=h._listeners.length;for(;v-- >0;)h._listeners[v](m);h._listeners=null}),this.promise.then=m=>{let v;const E=new Promise(s=>{h.subscribe(s),v=s}).then(m);return E.cancel=function(){h.unsubscribe(v)},E},n(function(v,E,s){h.reason||(h.reason=new gh(v,E,s),l(h.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const l=this._listeners.indexOf(n);l!==-1&&this._listeners.splice(l,1)}toAbortSignal(){const n=new AbortController,l=h=>{n.abort(h)};return this.subscribe(l),n.signal.unsubscribe=()=>this.unsubscribe(l),n.signal}static source(){let n;return{token:new Tx(function(m){n=m}),cancel:n}}}const _O=Tx;function yO(e){return function(l){return e.apply(null,l)}}function vO(e){return Ne.isObject(e)&&e.isAxiosError===!0}const h1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(h1).forEach(([e,n])=>{h1[n]=e});const xO=h1;function YC(e){const n=new xg(e),l=IC(xg.prototype.request,n);return Ne.extend(l,xg.prototype,n,{allOwnKeys:!0}),Ne.extend(l,n,null,{allOwnKeys:!0}),l.create=function(m){return YC(xc(e,m))},l}const xr=YC(bx);xr.Axios=xg;xr.CanceledError=gh;xr.CancelToken=_O;xr.isCancel=$C;xr.VERSION=KC;xr.toFormData=I_;xr.AxiosError=qt;xr.Cancel=xr.CanceledError;xr.all=function(n){return Promise.all(n)};xr.spread=yO;xr.isAxiosError=vO;xr.mergeConfig=xc;xr.AxiosHeaders=Ho;xr.formToJSON=e=>VC(Ne.isHTMLForm(e)?new FormData(e):e);xr.getAdapter=XC.getAdapter;xr.HttpStatusCode=xO;xr.default=xr;const wO=xr;/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */const Gu="https://cori-data-api.ruralinnovation.us/",d1=wO.create({baseURL:Gu,headers:{"Content-Type":"application/json"}}),tv={},JC={apiClient:d1,authenticated:!1,authenticated_user:null,autoSignOut:null,baseURL:Gu,token:null,data:{get:()=>tv,set:e=>{for(const n in e)e.hasOwnProperty[n]&&(tv[n]=e)}},setData:e=>{for(const n in e)e.hasOwnProperty[n]&&(tv[n]=e)}},QC=ut.createContext(JC);let tg=!1,pT=!1;function bO(e){const[n,l]=ut.useState(Object.assign(Object.assign({},JC),{baseURL:e.baseURL?e.baseURL:Gu,setData:h}));function h(m){const v=n;l(Object.assign(Object.assign({},v),{data:Object.assign(Object.assign({},v.data),m),setData:h}))}return e.baseURL&&e.baseURL.length>0&&d1.interceptors.request.use(m=>(m.baseURL=e.baseURL,console.log("API baseURL updated:",m.baseURL),m),m=>Promise.reject(m)),ut.useEffect(()=>{if(l(Object.assign(Object.assign({},n),{autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:m}=e;m(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL?e.baseURL:Gu})),e.fetchAuthSession){const{fetchAuthSession:m}=e;m().then(E=>{if(!tg){const s=E.tokens;if(console.log("API tokens:",s),s&&s.hasOwnProperty("idToken")&&(tg=!0,console.log("API Session is authenticated:",tg),console.log("API Session config:",E),console.log("idToken:",s.idToken),d1.interceptors.request.use(k=>{const D=s.idToken;return D&&(k.headers.Authorization=`Bearer ${D}`),e.baseURL&&(k.baseURL=e.baseURL),k},k=>Promise.reject(k)),l(Object.assign(Object.assign({},n),{authenticated:!0,autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:k}=e;k(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL||Gu,token:s.idToken})),e.getCurrentUser)){const{getCurrentUser:k}=e;k().then(V=>{pT||(pT=!0,console.log("API User is authenticated:",tg),console.log("API User:",V),console.log("API User type:",V.constructor.name),l(Object.assign(Object.assign({},n),{authenticated:!0,authenticated_user:V,autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:G}=e;G(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL||Gu,token:s.idToken})))})}}})}},[]),T0.createElement(T0.Fragment,null,T0.createElement(QC.Provider,{value:n},e.children))}const EO="modulepreload",TO=function(e){return"/"+e},fT={},SO=function(n,l,h){if(!l||l.length===0)return n();const m=document.getElementsByTagName("link");return Promise.all(l.map(v=>{if(v=TO(v),v in fT)return;fT[v]=!0;const E=v.endsWith(".css"),s=E?'[rel="stylesheet"]':"";if(!!h)for(let V=m.length-1;V>=0;V--){const G=m[V];if(G.href===v&&(!E||G.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${s}`))return;const D=document.createElement("link");if(D.rel=E?"stylesheet":EO,E||(D.as="script",D.crossOrigin=""),D.href=v,document.head.appendChild(D),E)return new Promise((V,G)=>{D.addEventListener("load",V),D.addEventListener("error",()=>G(new Error(`Unable to preload CSS for ${v}`)))})})).then(()=>n()).catch(v=>{const E=new Event("vite:preloadError",{cancelable:!0});if(E.payload=v,window.dispatchEvent(E),!E.defaultPrevented)throw v})},AO=ut.createContext(null);function CO(e,n){const l=Array.isArray(e)?e[0]:e?e.x:0,h=Array.isArray(e)?e[1]:e?e.y:0,m=Array.isArray(n)?n[0]:n?n.x:0,v=Array.isArray(n)?n[1]:n?n.y:0;return l===m&&h===v}function Ks(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let l=0;l{let m=null;"interactive"in h&&(m=Object.assign({},h),delete m.interactive);const v=n[h.ref];if(v){m=m||Object.assign({},h),delete m.ref;for(const E of kO)E in v&&(m[E]=v[E])}return m||h});return{...e,layers:l}}const vT={version:8,sources:{},layers:[]},xT={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"},nv={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"},wT={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},MO=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],PO=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class lh{constructor(n,l,h){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=m=>{const v=this.props[wT[m.type]];v?v(m):m.type==="error"&&console.error(m.error)},this._onPointerEvent=m=>{(m.type==="mousemove"||m.type==="mouseout")&&this._updateHover(m);const v=this.props[xT[m.type]];v&&(this.props.interactiveLayerIds&&m.type!=="mouseover"&&m.type!=="mouseout"&&(m.features=this._hoveredFeatures||this._queryRenderedFeatures(m.point)),v(m),delete m.features)},this._onCameraEvent=m=>{if(!this._internalUpdate){const v=this.props[nv[m.type]];v&&v(m)}m.type in this._deferredEvents&&(this._deferredEvents[m.type]=!1)},this._MapClass=n,this.props=l,this._initialize(h)}get map(){return this._map}get transform(){return this._renderTransform}setProps(n){const l=this.props;this.props=n;const h=this._updateSettings(n,l);h&&this._createShadowTransform(this._map);const m=this._updateSize(n),v=this._updateViewState(n,!0);this._updateStyle(n,l),this._updateStyleComponents(n,l),this._updateHandlers(n,l),(h||m||v&&!this._map.isMoving())&&this.redraw()}static reuse(n,l){const h=lh.savedMaps.pop();if(!h)return null;const m=h.map,v=m.getContainer();for(l.className=v.className;v.childNodes.length>0;)l.appendChild(v.childNodes[0]);m._container=l;const E=m._resizeObserver;E&&(E.disconnect(),E.observe(l)),h.setProps({...n,styleDiffing:!1}),m.resize();const{initialViewState:s}=n;return s&&(s.bounds?m.fitBounds(s.bounds,{...s.fitBoundsOptions,duration:0}):h._updateViewState(s,!1)),m.isStyleLoaded()?m.fire("load"):m.once("styledata",()=>m.fire("load")),m._update(),h}_initialize(n){const{props:l}=this,{mapStyle:h=vT}=l,m={...l,...l.initialViewState,accessToken:l.mapboxAccessToken||zO()||null,container:n,style:yT(h)},v=m.initialViewState||m.viewState||m;if(Object.assign(m,{center:[v.longitude||0,v.latitude||0],zoom:v.zoom||0,pitch:v.pitch||0,bearing:v.bearing||0}),l.gl){const V=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=V,l.gl)}const E=new this._MapClass(m);v.padding&&E.setPadding(v.padding),l.cursor&&(E.getCanvas().style.cursor=l.cursor),this._createShadowTransform(E);const s=E._render;E._render=V=>{this._inRender=!0,s.call(E,V),this._inRender=!1};const k=E._renderTaskQueue.run;E._renderTaskQueue.run=V=>{k.call(E._renderTaskQueue,V),this._onBeforeRepaint()},E.on("render",()=>this._onAfterRepaint());const D=E.fire;E.fire=this._fireEvent.bind(this,D),E.on("resize",()=>{this._renderTransform.resize(E.transform.width,E.transform.height)}),E.on("styledata",()=>{this._updateStyleComponents(this.props,{}),mT(E.transform,this._renderTransform)}),E.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const V in xT)E.on(V,this._onPointerEvent);for(const V in nv)E.on(V,this._onCameraEvent);for(const V in wT)E.on(V,this._onEvent);this._map=E}recycle(){const l=this.map.getContainer().querySelector("[mapboxgl-children]");l==null||l.remove(),lh.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const n=this._map;!this._inRender&&n.style&&(n._frame&&(n._frame.cancel(),n._frame=null),n._render())}_createShadowTransform(n){const l=IO(n.transform);n.painter.transform=l,this._renderTransform=l}_updateSize(n){const{viewState:l}=n;if(l){const h=this._map;if(l.width!==h.transform.width||l.height!==h.transform.height)return h.resize(),!0}return!1}_updateViewState(n,l){if(this._internalUpdate)return!1;const h=this._map,m=this._renderTransform,{zoom:v,pitch:E,bearing:s}=m,k=h.isMoving();k&&(m.cameraElevationReference="sea");const D=_T(m,{...gT(h.transform),...n});if(k&&(m.cameraElevationReference="ground"),D&&l){const V=this._deferredEvents;V.move=!0,V.zoom||(V.zoom=v!==m.zoom),V.rotate||(V.rotate=s!==m.bearing),V.pitch||(V.pitch=E!==m.pitch)}return k||_T(h.transform,n),D}_updateSettings(n,l){const h=this._map;let m=!1;for(const v of MO)if(v in n&&!Ks(n[v],l[v])){m=!0;const E=h[`set${v[0].toUpperCase()}${v.slice(1)}`];E==null||E.call(h,n[v])}return m}_updateStyle(n,l){if(n.cursor!==l.cursor&&(this._map.getCanvas().style.cursor=n.cursor||""),n.mapStyle!==l.mapStyle){const{mapStyle:h=vT,styleDiffing:m=!0}=n,v={diff:m};return"localIdeographFontFamily"in n&&(v.localIdeographFontFamily=n.localIdeographFontFamily),this._map.setStyle(yT(h),v),!0}return!1}_updateStyleComponents(n,l){const h=this._map;let m=!1;return h.isStyleLoaded()&&("light"in n&&h.setLight&&!Ks(n.light,l.light)&&(m=!0,h.setLight(n.light)),"fog"in n&&h.setFog&&!Ks(n.fog,l.fog)&&(m=!0,h.setFog(n.fog)),"terrain"in n&&h.setTerrain&&!Ks(n.terrain,l.terrain)&&(!n.terrain||h.getSource(n.terrain.source))&&(m=!0,h.setTerrain(n.terrain))),m}_updateHandlers(n,l){var h,m;const v=this._map;let E=!1;for(const s of PO){const k=(h=n[s])!==null&&h!==void 0?h:!0,D=(m=l[s])!==null&&m!==void 0?m:!0;Ks(k,D)||(E=!0,k?v[s].enable(k):v[s].disable())}return E}_queryRenderedFeatures(n){const l=this._map,h=l.transform,{interactiveLayerIds:m=[]}=this.props;try{return l.transform=this._renderTransform,l.queryRenderedFeatures(n,{layers:m.filter(l.getLayer.bind(l))})}catch{return[]}finally{l.transform=h}}_updateHover(n){var l;const{props:h}=this;if(h.interactiveLayerIds&&(h.onMouseMove||h.onMouseEnter||h.onMouseLeave)){const v=n.type,E=((l=this._hoveredFeatures)===null||l===void 0?void 0:l.length)>0,s=this._queryRenderedFeatures(n.point),k=s.length>0;!k&&E&&(n.type="mouseleave",this._onPointerEvent(n)),this._hoveredFeatures=s,k&&!E&&(n.type="mouseenter",this._onPointerEvent(n)),n.type=v}else this._hoveredFeatures=null}_fireEvent(n,l,h){const m=this._map,v=m.transform,E=typeof l=="string"?l:l.type;return E==="move"&&this._updateViewState(this.props,!1),E in nv&&(typeof l=="object"&&(l.viewState=gT(v)),this._map.isMoving())?(m.transform=this._renderTransform,n.call(m,l,h),m.transform=v,m):(n.call(m,l,h),m)}_onBeforeRepaint(){const n=this._map;this._internalUpdate=!0;for(const h in this._deferredEvents)this._deferredEvents[h]&&n.fire(h);this._internalUpdate=!1;const l=this._map.transform;n.transform=this._renderTransform,this._onAfterRepaint=()=>{mT(this._renderTransform,l),n.transform=l}}}lh.savedMaps=[];function zO(){let e=null;if(typeof location<"u"){const n=/access_token=([^&\/]*)/.exec(location.search);e=n&&n[1]}try{e=e||void 0}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const LO=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function RO(e){if(!e)return null;const n=e.map,l={getMap:()=>n,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:h=>{const m=n.transform;n.transform=e.transform;const v=n.project(h);return n.transform=m,v},unproject:h=>{const m=n.transform;n.transform=e.transform;const v=n.unproject(h);return n.transform=m,v},queryTerrainElevation:(h,m)=>{const v=n.transform;n.transform=e.transform;const E=n.queryTerrainElevation(h,m);return n.transform=v,E},queryRenderedFeatures:(h,m)=>{const v=n.transform;n.transform=e.transform;const E=n.queryRenderedFeatures(h,m);return n.transform=v,E}};for(const h of DO(n))!(h in l)&&!LO.includes(h)&&(l[h]=n[h].bind(n));return l}function DO(e){const n=new Set;let l=e;for(;l;){for(const h of Object.getOwnPropertyNames(l))h[0]!=="_"&&typeof e[h]=="function"&&h!=="fire"&&h!=="setEventedParent"&&n.add(h);l=Object.getPrototypeOf(l)}return Array.from(n)}const OO=typeof document<"u"?ut.useLayoutEffect:ut.useEffect,BO=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function FO(e,n){for(const h of BO)h in n&&(e[h]=n[h]);const{RTLTextPlugin:l="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=n;l&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(l,h=>{h&&console.error(h)},!0)}const P_=ut.createContext(null);function NO(e,n,l){const h=ut.useContext(AO),[m,v]=ut.useState(null),E=ut.useRef(),{current:s}=ut.useRef({mapLib:null,map:null});ut.useEffect(()=>{const V=e.mapLib;let G=!0,J;return Promise.resolve(V||l).then(ve=>{if(!G)return;if(!ve)throw new Error("Invalid mapLib");const ae="Map"in ve?ve:ve.default;if(!ae.Map)throw new Error("Invalid mapLib");if(FO(ae,e),!ae.supported||ae.supported(e))e.reuseMaps&&(J=lh.reuse(e,E.current)),J||(J=new lh(ae.Map,e,E.current)),s.map=RO(J),s.mapLib=ae,v(J),h==null||h.onMapMount(s.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(ve=>{const{onError:ae}=e;ae?ae({type:"error",target:null,originalEvent:null,error:ve}):console.error(ve)}),()=>{G=!1,J&&(h==null||h.onMapUnmount(e.id),e.reuseMaps?J.recycle():J.destroy())}},[]),OO(()=>{m&&m.setProps(e)}),ut.useImperativeHandle(n,()=>s.map,[m]);const k=ut.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),D={height:"100%"};return ut.createElement("div",{id:e.id,ref:E,style:k},m&&ut.createElement(P_.Provider,{value:s},ut.createElement("div",{"mapboxgl-children":"",style:D},e.children)))}const UO=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ec(e,n){if(!e||!n)return;const l=e.style;for(const h in n){const m=n[h];Number.isFinite(m)&&!UO.test(h)?l[h]=`${m}px`:l[h]=m}}function jO(e,n){const{map:l,mapLib:h}=ut.useContext(P_),m=ut.useRef({props:e});m.current.props=e;const v=ut.useMemo(()=>{let me=!1;ut.Children.forEach(e.children,te=>{te&&(me=!0)});const Ce={...e,element:me?document.createElement("div"):null},ie=new h.Marker(Ce);return ie.setLngLat([e.longitude,e.latitude]),ie.getElement().addEventListener("click",te=>{var le,ze;(ze=(le=m.current.props).onClick)===null||ze===void 0||ze.call(le,{type:"click",target:ie,originalEvent:te})}),ie.on("dragstart",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDragStart)===null||ze===void 0||ze.call(le,Oe)}),ie.on("drag",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDrag)===null||ze===void 0||ze.call(le,Oe)}),ie.on("dragend",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDragEnd)===null||ze===void 0||ze.call(le,Oe)}),ie},[]);ut.useEffect(()=>(v.addTo(l.getMap()),()=>{v.remove()}),[]);const{longitude:E,latitude:s,offset:k,style:D,draggable:V=!1,popup:G=null,rotation:J=0,rotationAlignment:ve="auto",pitchAlignment:ae="auto"}=e;return ut.useEffect(()=>{Ec(v.getElement(),D)},[D]),ut.useImperativeHandle(n,()=>v,[]),(v.getLngLat().lng!==E||v.getLngLat().lat!==s)&&v.setLngLat([E,s]),k&&!CO(v.getOffset(),k)&&v.setOffset(k),v.isDraggable()!==V&&v.setDraggable(V),v.getRotation()!==J&&v.setRotation(J),v.getRotationAlignment()!==ve&&v.setRotationAlignment(ve),v.getPitchAlignment()!==ae&&v.setPitchAlignment(ae),v.getPopup()!==G&&v.setPopup(G),hx.createPortal(e.children,v.getElement())}const VO=ut.memo(ut.forwardRef(jO));function bT(e){return new Set(e?e.trim().split(/\s+/):[])}function $O(e,n){const{map:l,mapLib:h}=ut.useContext(P_),m=ut.useMemo(()=>document.createElement("div"),[]),v=ut.useRef({props:e});v.current.props=e;const E=ut.useMemo(()=>{const s={...e},k=new h.Popup(s);return k.setLngLat([e.longitude,e.latitude]),k.once("open",D=>{var V,G;(G=(V=v.current.props).onOpen)===null||G===void 0||G.call(V,D)}),k},[]);if(ut.useEffect(()=>{const s=k=>{var D,V;(V=(D=v.current.props).onClose)===null||V===void 0||V.call(D,k)};return E.on("close",s),E.setDOMContent(m).addTo(l.getMap()),()=>{E.off("close",s),E.isOpen()&&E.remove()}},[]),ut.useEffect(()=>{Ec(E.getElement(),e.style)},[e.style]),ut.useImperativeHandle(n,()=>E,[]),E.isOpen()&&((E.getLngLat().lng!==e.longitude||E.getLngLat().lat!==e.latitude)&&E.setLngLat([e.longitude,e.latitude]),e.offset&&!Ks(E.options.offset,e.offset)&&E.setOffset(e.offset),(E.options.anchor!==e.anchor||E.options.maxWidth!==e.maxWidth)&&(E.options.anchor=e.anchor,E.setMaxWidth(e.maxWidth)),E.options.className!==e.className)){const s=bT(E.options.className),k=bT(e.className);for(const D of s)k.has(D)||E.removeClassName(D);for(const D of k)s.has(D)||E.addClassName(D);E.options.className=e.className}return hx.createPortal(e.children,m)}ut.memo(ut.forwardRef($O));function _h(e,n,l,h){const m=ut.useContext(P_),v=ut.useMemo(()=>e(m),[]);return ut.useEffect(()=>{const E=h||l||n,s=typeof n=="function"&&typeof l=="function"?n:null,k=typeof l=="function"?l:typeof n=="function"?n:null,{map:D}=m;return D.hasControl(v)||(D.addControl(v,E==null?void 0:E.position),s&&s(m)),()=>{k&&k(m),D.hasControl(v)&&D.removeControl(v)}},[]),v}function GO(e){const n=_h(({mapLib:l})=>new l.AttributionControl(e),{position:e.position});return ut.useEffect(()=>{Ec(n._container,e.style)},[e.style]),null}ut.memo(GO);function qO(e){const n=_h(({mapLib:l})=>new l.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return ut.useEffect(()=>{Ec(n._controlContainer,e.style)},[e.style]),null}ut.memo(qO);function WO(e,n){const l=ut.useRef({props:e}),h=_h(({mapLib:m})=>{const v=new m.GeolocateControl(e),E=v._setupUI;return v._setupUI=s=>{v._container.hasChildNodes()||E(s)},v.on("geolocate",s=>{var k,D;(D=(k=l.current.props).onGeolocate)===null||D===void 0||D.call(k,s)}),v.on("error",s=>{var k,D;(D=(k=l.current.props).onError)===null||D===void 0||D.call(k,s)}),v.on("outofmaxbounds",s=>{var k,D;(D=(k=l.current.props).onOutOfMaxBounds)===null||D===void 0||D.call(k,s)}),v.on("trackuserlocationstart",s=>{var k,D;(D=(k=l.current.props).onTrackUserLocationStart)===null||D===void 0||D.call(k,s)}),v.on("trackuserlocationend",s=>{var k,D;(D=(k=l.current.props).onTrackUserLocationEnd)===null||D===void 0||D.call(k,s)}),v},{position:e.position});return l.current.props=e,ut.useImperativeHandle(n,()=>h,[]),ut.useEffect(()=>{Ec(h._container,e.style)},[e.style]),null}const ZO=ut.memo(ut.forwardRef(WO));function HO(e){const n=_h(({mapLib:l})=>new l.NavigationControl(e),{position:e.position});return ut.useEffect(()=>{Ec(n._container,e.style)},[e.style]),null}const XO=ut.memo(HO);function KO(e){const n=_h(({mapLib:v})=>new v.ScaleControl(e),{position:e.position}),l=ut.useRef(e),h=l.current;l.current=e;const{style:m}=e;return e.maxWidth!==void 0&&e.maxWidth!==h.maxWidth&&(n.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==h.unit&&n.setUnit(e.unit),ut.useEffect(()=>{Ec(n._container,m)},[m]),null}const YO=ut.memo(KO),JO=SO(()=>Promise.resolve().then(()=>SU),void 0),QO=(()=>ut.forwardRef(function(n,l){return NO(n,l,JO)}))(),eI=VO,e4=XO,t4=ZO,n4=YO;var yh=i4,r4=Object.prototype.hasOwnProperty;function i4(){for(var e={},n=0;n-1};ri.prototype.value=function(e){if(this.selected=e,this.el.value=this.getItemValue(e),document.createEvent){var n=document.createEvent("HTMLEvents");n.initEvent("change",!0,!1),this.el.dispatchEvent(n)}else this.el.fireEvent("onchange")};ri.prototype.getCandidates=function(e){var n={pre:"",post:"",extract:(function(h){return this.getItemValue(h)}).bind(this)},l;this.options.filter?(l=l4.filter(this.query,this.data,n),l=l.map((function(h){return{original:h.original,string:this.render(h.original,h.string)}}).bind(this))):l=this.data.map((function(h){var m=this.render(h);return{original:h,string:m}}).bind(this)),e(l)};ri.prototype.getItemValue=function(e){return e};ri.prototype.render=function(e,n){if(n)return n;for(var l=e.original?this.getItemValue(e.original):this.getItemValue(e),h=this.normalize(l),m=h.lastIndexOf(this.query);m>-1;){var v=m+this.query.length;l=l.slice(0,m)+""+l.slice(m,v)+""+l.slice(v),m=h.slice(0,m).lastIndexOf(this.query)}return l};ri.prototype.renderError=function(e){this.list.drawError(e)};var u4=ri,nI=u4,h4=nI;typeof window<"u"&&(window.Suggestions=nI);var d4="Expected a function",ET=0/0,p4="[object Symbol]",f4=/^\s+|\s+$/g,m4=/^[-+]0x[0-9a-f]+$/i,g4=/^0b[01]+$/i,_4=/^0o[0-7]+$/i,y4=parseInt,v4=typeof Go=="object"&&Go&&Go.Object===Object&&Go,x4=typeof self=="object"&&self&&self.Object===Object&&self,w4=v4||x4||Function("return this")(),b4=Object.prototype,E4=b4.toString,T4=Math.max,S4=Math.min,rv=function(){return w4.Date.now()};function A4(e,n,l){var h,m,v,E,s,k,D=0,V=!1,G=!1,J=!0;if(typeof e!="function")throw new TypeError(d4);n=TT(n)||0,p1(l)&&(V=!!l.leading,G="maxWait"in l,v=G?T4(TT(l.maxWait)||0,n):v,J="trailing"in l?!!l.trailing:J);function ve(Ke){var He=h,ht=m;return h=m=void 0,D=Ke,E=e.apply(ht,He),E}function ae(Ke){return D=Ke,s=setTimeout(ie,n),V?ve(Ke):E}function me(Ke){var He=Ke-k,ht=Ke-D,Ve=n-He;return G?S4(Ve,v-ht):Ve}function Ce(Ke){var He=Ke-k,ht=Ke-D;return k===void 0||He>=n||He<0||G&&ht>=v}function ie(){var Ke=rv();if(Ce(Ke))return te(Ke);s=setTimeout(ie,me(Ke))}function te(Ke){return s=void 0,J&&h?ve(Ke):(h=m=void 0,E)}function le(){s!==void 0&&clearTimeout(s),D=0,h=k=m=s=void 0}function ze(){return s===void 0?E:te(rv())}function Oe(){var Ke=rv(),He=Ce(Ke);if(h=arguments,m=this,k=Ke,He){if(s===void 0)return ae(k);if(G)return s=setTimeout(ie,n),ve(k)}return s===void 0&&(s=setTimeout(ie,n)),E}return Oe.cancel=le,Oe.flush=ze,Oe}function p1(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function C4(e){return!!e&&typeof e=="object"}function I4(e){return typeof e=="symbol"||C4(e)&&E4.call(e)==p4}function TT(e){if(typeof e=="number")return e;if(I4(e))return ET;if(p1(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=p1(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=e.replace(f4,"");var l=g4.test(e);return l||_4.test(e)?y4(e.slice(2),l?2:8):m4.test(e)?ET:+e}var k4=A4,Sx={exports:{}},Yu=typeof Reflect=="object"?Reflect:null,ST=Yu&&typeof Yu.apply=="function"?Yu.apply:function(n,l,h){return Function.prototype.apply.call(n,l,h)},wg;Yu&&typeof Yu.ownKeys=="function"?wg=Yu.ownKeys:Object.getOwnPropertySymbols?wg=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:wg=function(n){return Object.getOwnPropertyNames(n)};function M4(e){console&&console.warn&&console.warn(e)}var rI=Number.isNaN||function(n){return n!==n};function Cn(){Cn.init.call(this)}Sx.exports=Cn;Sx.exports.once=R4;Cn.EventEmitter=Cn;Cn.prototype._events=void 0;Cn.prototype._eventsCount=0;Cn.prototype._maxListeners=void 0;var AT=10;function z_(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Cn,"defaultMaxListeners",{enumerable:!0,get:function(){return AT},set:function(e){if(typeof e!="number"||e<0||rI(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");AT=e}});Cn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Cn.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||rI(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function iI(e){return e._maxListeners===void 0?Cn.defaultMaxListeners:e._maxListeners}Cn.prototype.getMaxListeners=function(){return iI(this)};Cn.prototype.emit=function(n){for(var l=[],h=1;h0&&(E=l[0]),E instanceof Error)throw E;var s=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw s.context=E,s}var k=v[n];if(k===void 0)return!1;if(typeof k=="function")ST(k,this,l);else for(var D=k.length,V=cI(k,D),h=0;h0&&E.length>m&&!E.warned){E.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=n,s.count=E.length,M4(s)}return e}Cn.prototype.addListener=function(n,l){return oI(this,n,l,!1)};Cn.prototype.on=Cn.prototype.addListener;Cn.prototype.prependListener=function(n,l){return oI(this,n,l,!0)};function P4(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function sI(e,n,l){var h={fired:!1,wrapFn:void 0,target:e,type:n,listener:l},m=P4.bind(h);return m.listener=l,h.wrapFn=m,m}Cn.prototype.once=function(n,l){return z_(l),this.on(n,sI(this,n,l)),this};Cn.prototype.prependOnceListener=function(n,l){return z_(l),this.prependListener(n,sI(this,n,l)),this};Cn.prototype.removeListener=function(n,l){var h,m,v,E,s;if(z_(l),m=this._events,m===void 0)return this;if(h=m[n],h===void 0)return this;if(h===l||h.listener===l)--this._eventsCount===0?this._events=Object.create(null):(delete m[n],m.removeListener&&this.emit("removeListener",n,h.listener||l));else if(typeof h!="function"){for(v=-1,E=h.length-1;E>=0;E--)if(h[E]===l||h[E].listener===l){s=h[E].listener,v=E;break}if(v<0)return this;v===0?h.shift():z4(h,v),h.length===1&&(m[n]=h[0]),m.removeListener!==void 0&&this.emit("removeListener",n,s||l)}return this};Cn.prototype.off=Cn.prototype.removeListener;Cn.prototype.removeAllListeners=function(n){var l,h,m;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[n]),this;if(arguments.length===0){var v=Object.keys(h),E;for(m=0;m=0;m--)this.removeListener(n,l[m]);return this};function aI(e,n,l){var h=e._events;if(h===void 0)return[];var m=h[n];return m===void 0?[]:typeof m=="function"?l?[m.listener||m]:[m]:l?L4(m):cI(m,m.length)}Cn.prototype.listeners=function(n){return aI(this,n,!0)};Cn.prototype.rawListeners=function(n){return aI(this,n,!1)};Cn.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):lI.call(e,n)};Cn.prototype.listenerCount=lI;function lI(e){var n=this._events;if(n!==void 0){var l=n[e];if(typeof l=="function")return 1;if(l!==void 0)return l.length}return 0}Cn.prototype.eventNames=function(){return this._eventsCount>0?wg(this._events):[]};function cI(e,n){for(var l=new Array(n),h=0;h]*)>(.*)/);if(!n)return null;var l=n[1],h=n[2].split(";"),m=null,v=h.reduce(function(E,s){var k=F4(s);return k?k.key==="rel"?(m||(m=k.value),E):(E[k.key]=k.value,E):E},{});return m?{url:l,rel:m,params:v}:null}function U4(e){return e?e.split(/,\s*=400){var E=new IT({request:e,body:n.response,statusCode:n.status});h(E);return}l(n)};var v=e.body;typeof v=="string"?n.send(v):v?n.send(JSON.stringify(v)):m?n.send(m):n.send(),t_[e.id]=n}).then(function(l){return J4(e,l)})}function dI(e,n){var l=e.url(n),h=new window.XMLHttpRequest;return h.open(e.method,l),Object.keys(e.headers).forEach(function(m){h.setRequestHeader(m,e.headers[m])}),h}function Q4(e){return Promise.resolve().then(function(){var n=dI(e,e.client.accessToken);return hI(e,n)})}var eB={browserAbort:Y4,sendRequestXhr:hI,browserSend:Q4,createRequestXhr:dI},n_={exports:{}};/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */n_.exports;(function(e,n){(function(l){var h=n,m=e&&e.exports==h&&e,v=typeof Go=="object"&&Go;(v.global===v||v.window===v)&&(l=v);var E=function(ae){this.message=ae};E.prototype=new Error,E.prototype.name="InvalidCharacterError";var s=function(ae){throw new E(ae)},k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=/[\t\n\f\r ]/g,V=function(ae){ae=String(ae).replace(D,"");var me=ae.length;me%4==0&&(ae=ae.replace(/==?$/,""),me=ae.length),(me%4==1||/[^+a-zA-Z0-9/]/.test(ae))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var Ce=0,ie,te,le="",ze=-1;++ze>(-2*Ce&6)));return le},G=function(ae){ae=String(ae),/[^\0-\xFF]/.test(ae)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var me=ae.length%3,Ce="",ie=-1,te,le,ze,Oe,Ke=ae.length-me;++ie>18&63)+k.charAt(Oe>>12&63)+k.charAt(Oe>>6&63)+k.charAt(Oe&63);return me==2?(te=ae.charCodeAt(ie)<<8,le=ae.charCodeAt(++ie),Oe=te+le,Ce+=k.charAt(Oe>>10)+k.charAt(Oe>>4&63)+k.charAt(Oe<<2&63)+"="):me==1&&(Oe=ae.charCodeAt(ie),Ce+=k.charAt(Oe>>2)+k.charAt(Oe<<4&63)+"=="),Ce},J={encode:G,decode:V,version:"0.1.0"};if(h&&!h.nodeType)if(m)m.exports=J;else for(var ve in J)J.hasOwnProperty(ve)&&(h[ve]=J[ve]);else l.base64=J})(Go)})(n_,n_.exports);var tB=n_.exports,nB=tB,ov={};function rB(e){if(ov[e])return ov[e];var n=e.split("."),l=n[0],h=n[1];if(!h)throw new Error("Invalid token");var m=iB(h),v={usage:l,user:m.u};return oc(m,"a")&&(v.authorization=m.a),oc(m,"exp")&&(v.expires=m.exp*1e3),oc(m,"iat")&&(v.created=m.iat*1e3),oc(m,"scopes")&&(v.scopes=m.scopes),oc(m,"client")&&(v.client=m.client),oc(m,"ll")&&(v.lastLogin=m.ll),oc(m,"iu")&&(v.impersonator=m.iu),ov[e]=v,v}function iB(e){try{return JSON.parse(nB.decode(e))}catch{throw new Error("Invalid token")}}function oc(e,n){return Object.prototype.hasOwnProperty.call(e,n)}var pI=rB,fI={exports:{}};(function(e){var n=Object.prototype.hasOwnProperty,l="~";function h(){}Object.create&&(h.prototype=Object.create(null),new h().__proto__||(l=!1));function m(k,D,V){this.fn=k,this.context=D,this.once=V||!1}function v(k,D,V,G,J){if(typeof V!="function")throw new TypeError("The listener must be a function");var ve=new m(V,G||k,J),ae=l?l+D:D;return k._events[ae]?k._events[ae].fn?k._events[ae]=[k._events[ae],ve]:k._events[ae].push(ve):(k._events[ae]=ve,k._eventsCount++),k}function E(k,D){--k._eventsCount===0?k._events=new h:delete k._events[D]}function s(){this._events=new h,this._eventsCount=0}s.prototype.eventNames=function(){var D=[],V,G;if(this._eventsCount===0)return D;for(G in V=this._events)n.call(V,G)&&D.push(l?G.slice(1):G);return Object.getOwnPropertySymbols?D.concat(Object.getOwnPropertySymbols(V)):D},s.prototype.listeners=function(D){var V=l?l+D:D,G=this._events[V];if(!G)return[];if(G.fn)return[G.fn];for(var J=0,ve=G.length,ae=new Array(ve);Jv.length?E:v})}};zn.equal=function(n){return function(h){if(h!==n)return JSON.stringify(n)}};zn.oneOf=function(){var n=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments),l=n.map(function(h){return zn.equal(h)});return zn.oneOfType.apply(this,l)};zn.range=function(n){var l=n[0],h=n[1];return function(v){var E=cl(zn.number,v);if(E||vh)return"number between "+l+" & "+h+" (inclusive)"}};zn.any=function(){};zn.boolean=function(n){if(typeof n!="boolean")return"boolean"};zn.number=function(n){if(typeof n!="number")return"number"};zn.plainArray=function(n){if(!Array.isArray(n))return"array"};zn.plainObject=function(n){if(!EB(n))return"object"};zn.string=function(n){if(typeof n!="string")return"string"};zn.func=function(n){if(typeof n!="function")return"function"};function cl(e,n){if(!(n==null&&!e.hasOwnProperty("__required"))){var l=e(n);if(l)return Array.isArray(l)?l:[l]}}function Ix(e,n){var l=e.length,h=e[l-1],m=e.slice(0,l-1);return m.length===0&&(m=[bI]),n=TB(n,{path:m}),typeof h=="function"?h(n):TI(n,AB(h))}function SB(e){return e.length<2?e[0]:e.length===2?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e.slice(-1)}function AB(e){return"must be "+CB(e)+"."}function CB(e){return/^an? /.test(e)?e:/^[aeiou]/i.test(e)?"an "+e:/^[a-z]/i.test(e)?"a "+e:e}function TI(e,n){var l=SI(e.path),h=e.path.join(".")+" "+n,m=l?"Item at position ":"";return m+h}function SI(e){return typeof e[e.length-1]=="number"||typeof e[0]=="number"}function IB(e){return Object.keys(e||{}).map(function(n){return{key:n,value:e[n]}})}zn.validate=cl;zn.processMessage=Ix;var kB=zn,MB=yh,Ju=kB;function PB(e){if(typeof window<"u")return e instanceof Go.Blob||e instanceof Go.ArrayBuffer?void 0:"Blob or ArrayBuffer";if(!(typeof e=="string"||e.pipe!==void 0))return"Filename or Readable stream"}function zB(e,n){return Ju.assert(Ju.strictShape(e),n)}function LB(e){var n="date";if(typeof e=="boolean")return n;try{var l=new Date(e);if(l.getTime&&isNaN(l.getTime()))return n}catch{return n}}function RB(e){return Ju.tuple(Ju.number,Ju.number)(e)}var DB=MB(Ju,{file:PB,date:LB,coordinates:RB,assertShape:zB});function OB(e,n){var l=function(h,m){return n.indexOf(h)!==-1&&m!==void 0};return typeof n=="function"&&(l=n),Object.keys(e).filter(function(h){return l(h,e[h])}).reduce(function(h,m){return h[m]=e[m],h},{})}var BB=OB;function FB(e,n){return Object.keys(e).reduce(function(l,h){return l[h]=n(h,e[h]),l},{})}var NB=FB,UB=NB;function jB(e){return UB(e,function(n,l){return typeof l=="boolean"?JSON.stringify(l):l})}var VB=jB,$B=yI,GB=wI;function qB(e){return function(n){var l;$B.prototype.isPrototypeOf(n)?l=n:l=GB(n);var h=Object.create(e);return h.client=l,h}}var WB=qB,AI=yh,tn=DB,r_=BB,CI=VB,ZB=WB,kx={},II=["country","region","postcode","district","place","locality","neighborhood","address","poi","poi.landmark"];kx.forwardGeocode=function(e){tn.assertShape({query:tn.required(tn.string),mode:tn.oneOf("mapbox.places","mapbox.places-permanent"),countries:tn.arrayOf(tn.string),proximity:tn.oneOf(tn.coordinates,"ip"),types:tn.arrayOf(tn.oneOf(II)),autocomplete:tn.boolean,bbox:tn.arrayOf(tn.number),limit:tn.number,language:tn.arrayOf(tn.string),routing:tn.boolean,fuzzyMatch:tn.boolean,worldview:tn.string})(e),e.mode=e.mode||"mapbox.places";var n=CI(AI({country:e.countries},r_(e,["proximity","types","autocomplete","bbox","limit","language","routing","fuzzyMatch","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:r_(e,["mode","query"]),query:n})};kx.reverseGeocode=function(e){tn.assertShape({query:tn.required(tn.coordinates),mode:tn.oneOf("mapbox.places","mapbox.places-permanent"),countries:tn.arrayOf(tn.string),types:tn.arrayOf(tn.oneOf(II)),bbox:tn.arrayOf(tn.number),limit:tn.number,language:tn.arrayOf(tn.string),reverseMode:tn.oneOf("distance","score"),routing:tn.boolean,worldview:tn.string})(e),e.mode=e.mode||"mapbox.places";var n=CI(AI({country:e.countries},r_(e,["country","types","bbox","limit","language","reverseMode","routing","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:r_(e,["mode","query"]),query:n})};var HB=ZB(kx),XB=self.crypto||self.msCrypto,Mx="-_",ol=36;for(;ol--;)Mx+=ol.toString(36);ol=36;for(;ol---10;)Mx+=ol.toString(36).toUpperCase();var KB=function(e){var n="",l=XB.getRandomValues(new Uint8Array(e||21));for(ol=e||21;ol--;)n+=Mx[l[ol]&63];return n},YB=KB;function kI(e){this.origin=e.origin||"https://api.mapbox.com",this.endpoint="events/v2",this.access_token=e.accessToken,this.version="0.2.0",this.sessionID=this.generateSessionID(),this.userAgent=this.getUserAgent(),this.options=e,this.send=this.send.bind(this),this.countries=e.countries?e.countries.split(","):null,this.types=e.types?e.types.split(","):null,this.bbox=e.bbox?e.bbox:null,this.language=e.language?e.language.split(","):null,this.limit=e.limit?+e.limit:null,this.locale=navigator.language||null,this.enableEventLogging=this.shouldEnableLogging(e),this.eventQueue=new Array,this.flushInterval=e.flushInterval||1e3,this.maxQueueSize=e.maxQueueSize||100,this.timer=this.flushInterval?setTimeout(this.flush.bind(this),this.flushInterval):null,this.lastSentInput="",this.lastSentIndex=0}kI.prototype={select:function(e,n){var l=this.getSelectedIndex(e,n),h=this.getEventPayload("search.select",n);if(h.resultIndex=l,h.resultPlaceName=e.place_name,h.resultId=e.id,!(l===this.lastSentIndex&&h.queryString===this.lastSentInput||l==-1)&&(this.lastSentIndex=l,this.lastSentInput=h.queryString,!!h.queryString))return this.push(h)},start:function(e){var n=this.getEventPayload("search.start",e);if(n.queryString)return this.push(n)},keyevent:function(e,n){if(e.key&&!(e.metaKey||[9,27,37,39,13,38,40].indexOf(e.keyCode)!==-1)){var l=this.getEventPayload("search.keystroke",n);if(l.lastAction=e.key,!!l.queryString)return this.push(l)}},send:function(e,n){if(!this.enableEventLogging)return n?n():void 0;var l=this.getRequestOptions(e);this.request(l,(function(h){if(h)return this.handleError(h,n);if(n)return n()}).bind(this))},getRequestOptions:function(e){Array.isArray(e)||(e=[e]);var n={method:"POST",host:this.origin,path:this.endpoint+"?access_token="+this.access_token,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)};return n},getEventPayload:function(e,n){var l;n.options.proximity?l=[n.options.proximity.longitude,n.options.proximity.latitude]:l=null;var h=n._map?n._map.getZoom():void 0,m={event:e,created:+new Date,sessionIdentifier:this.sessionID,country:this.countries,userAgent:this.userAgent,language:this.language,bbox:this.bbox,types:this.types,endpoint:"mapbox.places",autocomplete:n.options.autocomplete,fuzzyMatch:n.options.fuzzyMatch,proximity:l,limit:n.options.limit,routing:n.options.routing,worldview:n.options.worldview,mapZoom:h,keyboardLocale:this.locale};return e==="search.select"?m.queryString=n.inputString:e!="search.select"&&n._inputEl?m.queryString=n._inputEl.value:m.queryString=n.inputString,m},request:function(e,n){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(this.readyState==4)return this.status==204?n(null):n(this.statusText)},l.open(e.method,e.host+"/"+e.path,!0);for(var h in e.headers){var m=e.headers[h];l.setRequestHeader(h,m)}l.send(e.body)},handleError:function(e,n){if(n)return n(e)},generateSessionID:function(){return YB()},getUserAgent:function(){return"mapbox-gl-geocoder."+this.version+"."+navigator.userAgent},getSelectedIndex:function(e,n){if(n._typeahead){var l=n._typeahead.data,h=e.id,m=l.map(function(E){return E.id}),v=m.indexOf(h);return v}},shouldEnableLogging:function(e){return!(e.enableEventLogging===!1||e.origin&&e.origin.indexOf("api.mapbox.com")==-1||e.localGeocoder||e.filter)},flush:function(){this.eventQueue.length>0&&(this.send(this.eventQueue),this.eventQueue=new Array),this.timer&&clearTimeout(this.timer),this.flushInterval&&(this.timer=setTimeout(this.flush.bind(this),this.flushInterval))},push:function(e,n){this.eventQueue.push(e),(this.eventQueue.length>=this.maxQueueSize||n)&&this.flush()},remove:function(){this.flush()}};var JB=kI,QB={de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"לחפש",ja:"サーチ",lv:"Meklēt",pt:"Procurar",sr:"Претрага",zh:"搜索",cs:"Vyhledávání",hu:"Keresés",ka:"ძიება",nb:"Søke",sk:"Vyhľadávanie",th:"ค้นหา",fi:"Hae",is:"Leita",ko:"수색",pl:"Szukaj",sl:"Iskanje",fa:"جستجو",ru:"Поиск"},eF={placeholder:QB},MI={exports:{}};(function(e){(function(n,l,h){e.exports?e.exports=h():n[l]=h()})(Go,"subtag",function(){var n="",l=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;function h(k){return k.match(l)||[]}function m(k){return h(k).filter(function(D,V){return D&&V})}function v(k){return k=h(k),{language:k[1]||n,extlang:k[2]||n,script:k[3]||n,region:k[4]||n}}function E(k,D,V){Object.defineProperty(k,D,{value:V,enumerable:!0})}function s(k,D,V){function G(J){return h(J)[k]||n}E(G,"pattern",D),E(v,V,G)}return s(1,/^[a-zA-Z]{2,3}$/,"language"),s(2,/^[a-zA-Z]{3}$/,"extlang"),s(3,/^[a-zA-Z]{4}$/,"script"),s(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,"region"),E(v,"split",m),v})})(MI);var tF=MI.exports,nF=h4,rF=k4,lc=yh,iF=O4.EventEmitter,PT=B4,zT=xB,LT=HB,oF=JB,sF=eF,aF=tF;const $a={FORWARD:0,LOCAL:1,REVERSE:2};function PI(e){this._eventEmitter=new iF,this.options=lc({},this.options,e),this.inputString="",this.fresh=!0,this.lastSelected=null}PI.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,minLength:2,reverseGeocode:!1,limit:5,origin:"https://api.mapbox.com",enableEventLogging:!0,marker:!0,mapboxgl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,getItemValue:function(e){return e.place_name},render:function(e){var n=e.place_name.split(",");return'
'+n[0]+'
'+n.splice(1,n.length).join(",")+"
"}},addTo:function(e){function n(l,h){if(!document.body.contains(h))throw new Error("Element provided to #addTo() exists, but is not in the DOM");const m=l.onAdd();h.appendChild(m)}if(e._controlContainer)e.addControl(this);else if(e instanceof HTMLElement)n(this,e);else if(typeof e=="string"){const l=document.querySelectorAll(e);if(l.length===0)throw new Error("Element ",e,"not found.");if(l.length>1)throw new Error("Geocoder can only be added to a single html element");n(this,l[0])}else throw new Error("Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element")},onAdd:function(e){if(e&&typeof e!="string"&&(this._map=e),this.setLanguage(),this.options.localGeocoderOnly||(this.geocoderService=LT(zT({accessToken:this.options.accessToken,origin:this.options.origin}))),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this.eventManager=new oF(this.options),this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this);var n=this.container=document.createElement("div");n.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl";var l=this.createIcon("search",'');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",rF(this._onKeyDown,200)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton),this._inputEl.addEventListener("keyup",(function(v){this.eventManager.keyevent(v,this)}).bind(this));var h=document.createElement("div");h.classList.add("mapboxgl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button";var m=this.createIcon("close",'');return this._clearEl.appendChild(m),this._loadingEl=this.createIcon("loading",''),h.appendChild(this._clearEl),h.appendChild(this._loadingEl),n.appendChild(l),n.appendChild(this._inputEl),n.appendChild(h),this._typeahead=new nF(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit}),this.setRenderFunction(this.options.render),this._typeahead.getItemValue=this.options.getItemValue,this.mapMarker=null,this._handleMarker=this._handleMarker.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._mapboxgl=this.options.mapboxgl,!this._mapboxgl&&this.options.marker&&(console.error("No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl."),this.options.marker=!1)),n},createIcon:function(e,n){var l=document.createElementNS("http://www.w3.org/2000/svg","svg");if(l.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+e),l.setAttribute("viewBox","0 0 18 18"),l.setAttribute("xml:space","preserve"),l.setAttribute("width",18),l.setAttribute("height",18),"innerHTML"in l)l.innerHTML=n;else{var h=document.createElement("div");h.innerHTML=""+n.valueOf().toString()+"";var m=h.firstChild,v=m.firstChild;l.appendChild(v)}return l},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_onPaste:function(e){var n=(e.clipboardData||window.clipboardData).getData("text");n.length>=this.options.minLength&&this._geocode(n)},_onKeyDown:function(e){var n=27,l=9;if(e.keyCode===n&&this.options.clearAndBlurOnEsc)return this._clear(e),this._inputEl.blur();var h=e.target&&e.target.shadowRoot?e.target.shadowRoot.activeElement:e.target,m=h?h.value:"";if(!m)return this.fresh=!0,e.keyCode!==l&&this.clear(e),this._clearEl.style.display="none";e.metaKey||[l,n,37,39,13,38,40].indexOf(e.keyCode)!==-1||h.value.length>=this.options.minLength&&this._geocode(h.value)},_showButton:function(){this._typeahead.selected&&(this._clearEl.style.display="block")},_hideButton:function(){this._typeahead.selected&&(this._clearEl.style.display="none")},_onBlur:function(e){this.options.clearOnBlur&&this._clearOnBlur(e),this.options.collapsed&&this._collapse()},_onChange:function(){var e=this._typeahead.selected;if(e&&JSON.stringify(e)!==this.lastSelected){if(this._clearEl.style.display="none",this.options.flyTo){var n;if(e.properties&&PT[e.properties.short_code])n=lc({},this.options.flyTo),this._map&&this._map.fitBounds(PT[e.properties.short_code].bbox,n);else if(e.bbox){var l=e.bbox;n=lc({},this.options.flyTo),this._map&&this._map.fitBounds([[l[0],l[1]],[l[2],l[3]]],n)}else{var h={zoom:this.options.zoom};n=lc({},h,this.options.flyTo),e.center?n.center=e.center:e.geometry&&e.geometry.type&&e.geometry.type==="Point"&&e.geometry.coordinates&&(n.center=e.geometry.coordinates),this._map&&this._map.flyTo(n)}}this.options.marker&&this._mapboxgl&&this._handleMarker(e),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(e),this._eventEmitter.emit("result",{result:e}),this.eventManager.select(e,this)}},_requestType:function(e,n){var l;const h=/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)[ ]*$/;return e.localGeocoderOnly?l=$a.LOCAL:e.reverseGeocode&&h.test(n)?l=$a.REVERSE:l=$a.FORWARD,l},_setupConfig:function(e,n){const l=["bbox","limit","proximity","countries","types","language","reverseMode","mode","autocomplete","fuzzyMatch","routing","worldview"],h=/[\s,]+/;var m=this,v=l.reduce(function(s,k){if(m.options[k]===void 0||m.options[k]===null)return s;["countries","types","language"].indexOf(k)>-1?s[k]=m.options[k].split(h):s[k]=m.options[k];const D=typeof m.options[k].longitude=="number"&&typeof m.options[k].latitude=="number";if(k==="proximity"&&D){const V=m.options[k].longitude,G=m.options[k].latitude;s[k]=[V,G]}return s},{});switch(e){case $a.REVERSE:{var E=n.split(h).map(function(s){return parseFloat(s,10)}).reverse();v.types&&v.types[0],v=lc(v,{query:E,limit:1}),["proximity","autocomplete","fuzzyMatch","bbox"].forEach(function(s){s in v&&delete v[s]})}break;case $a.FORWARD:/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)*[ ]*$/.test(n)&&(n=n.replace(/,/g," ")),v=lc(v,{query:n});break}return v},_geocode:function(e){this.inputString=e,this._loadingEl.style.display="block",this._eventEmitter.emit("loading",{query:e});const n=this._requestType(this.options,e),l=this._setupConfig(n,e);var h;switch(n){case $a.LOCAL:h=Promise.resolve();break;case $a.FORWARD:h=this.geocoderService.forwardGeocode(l).send();break;case $a.REVERSE:h=this.geocoderService.reverseGeocode(l).send();break}var m=this.options.localGeocoder?this.options.localGeocoder(e)||[]:[],v=[],E=null;return h.catch((function(s){E=s}).bind(this)).then((function(s){this._loadingEl.style.display="none";var k={};return s?s.statusCode=="200"&&(k=s.body,k.request=s.request,k.headers=s.headers):k={type:"FeatureCollection",features:[]},k.config=l,this.fresh&&(this.eventManager.start(this),this.fresh=!1),k.features=k.features?m.concat(k.features):m,this.options.externalGeocoder?(v=this.options.externalGeocoder(e,k.features)||[],v.then(function(D){return k.features=k.features?D.concat(k.features):D,k},function(){return k})):k}).bind(this)).then((function(s){if(E)throw E;this.options.filter&&s.features.length&&(s.features=s.features.filter(this.options.filter)),s.features.length?(this._clearEl.style.display="block",this._eventEmitter.emit("results",s),this._typeahead.update(s.features)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",s))}).bind(this)).catch((function(s){this._loadingEl.style.display="none",m.length&&this.options.localGeocoder||v.length&&this.options.externalGeocoder?(this._clearEl.style.display="block",this._typeahead.update(m)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:m}),this._eventEmitter.emit("error",{error:s})}).bind(this)),h},_clear:function(e){e&&e.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this._onChange(),this._clearEl.style.display="none",this._removeMarker(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(e){this._clear(e),this._inputEl.focus()},_clearOnBlur:function(e){var n=this;e.relatedTarget&&n._clear(e)},_onQueryResult:function(e){var n=e.body;if(n.features.length){var l=n.features[0];this._typeahead.selected=l,this._inputEl.value=l.place_name,this._onChange()}},_updateProximity:function(){if(this._map)if(this._map.getZoom()>9){var e=this._map.getCenter().wrap();this.setProximity({longitude:e.lng,latitude:e.lat})}else this.setProximity(null)},_collapse:function(){!this._inputEl.value&&this._inputEl!==document.activeElement&&this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed")},query:function(e){return this._geocode(e).then(this._onQueryResult),this},_renderError:function(){var e="
There was an error reaching the server
";this._renderMessage(e)},_renderNoResults:function(){var e="
No results found
";this._renderMessage(e)},_renderMessage:function(e){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(e)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var e=this.options.language.split(",")[0],n=aF.language(e),l=sF.placeholder[n];if(l)return l}return"Search"},setInput:function(e){return this._inputEl.value=e,this._typeahead.selected=null,this._typeahead.clear(),e.length>=this.options.minLength&&this._geocode(e),this},setProximity:function(e){return this.options.proximity=e,this},getProximity:function(){return this.options.proximity},setRenderFunction:function(e){return e&&typeof e=="function"&&(this._typeahead.render=e),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(e){var n=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=e||this.options.language||n,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(e){return this.options.zoom=e,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(e){return this.options.flyTo=e,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(e){return this.placeholder=e||this._getPlaceholderText(),this._inputEl.placeholder=this.placeholder,this._inputEl.setAttribute("aria-label",this.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(e){return this.options.bbox=e,this},getCountries:function(){return this.options.countries},setCountries:function(e){return this.options.countries=e,this},getTypes:function(){return this.options.types},setTypes:function(e){return this.options.types=e,this},getMinLength:function(){return this.options.minLength},setMinLength:function(e){return this.options.minLength=e,this._typeahead&&(this._typeahead.options.minLength=e),this},getLimit:function(){return this.options.limit},setLimit:function(e){return this.options.limit=e,this._typeahead&&(this._typeahead.options.limit=e),this},getFilter:function(){return this.options.filter},setFilter:function(e){return this.options.filter=e,this},setOrigin:function(e){return this.options.origin=e,this.geocoderService=LT(zT({accessToken:this.options.accessToken,origin:this.options.origin})),this},getOrigin:function(){return this.options.origin},setAutocomplete:function(e){return this.options.autocomplete=e,this},getAutocomplete:function(){return this.options.autocomplete},setFuzzyMatch:function(e){return this.options.fuzzyMatch=e,this},getFuzzyMatch:function(){return this.options.fuzzyMatch},setRouting:function(e){return this.options.routing=e,this},getRouting:function(){return this.options.routing},setWorldview:function(e){return this.options.worldview=e,this},getWorldview:function(){return this.options.worldview},_handleMarker:function(e){if(this._map){this._removeMarker();var n={color:"#4668F2"},l=lc({},n,this.options.marker);return this.mapMarker=new this._mapboxgl.Marker(l),e.center?this.mapMarker.setLngLat(e.center).addTo(this._map):e.geometry&&e.geometry.type&&e.geometry.type==="Point"&&e.geometry.coordinates&&this.mapMarker.setLngLat(e.geometry.coordinates).addTo(this._map),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},on:function(e,n){return this._eventEmitter.on(e,n),this},off:function(e,n){return this._eventEmitter.removeListener(e,n),this.eventManager.remove(),this}};var lF=PI;const cF=g1(lF);/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */function uF(e){const[n,l]=ut.useState(null),h=Object.assign({},e),m=_h(()=>{const v=new cF(Object.assign(Object.assign({},h),{marker:n||!1,accessToken:h.mapboxAccessToken}));return h.onLoading&&v.on("loading",h.onLoading),h.onResults&&v.on("results",h.onResults),h.onResult&&v.on("result",E=>{var s;h.onResult!==void 0&&h.onResult(E);const{result:k}=E,D=k&&(k.center||((s=k.geometry)===null||s===void 0?void 0:s.type)==="Point"&&k.geometry.coordinates);if(D&&h.marker){const V=typeof h.marker=="object"?h.marker:{};l(ut.createElement(eI,Object.assign({},V,{longitude:D[0],latitude:D[1]})))}else l(null)}),h.onError&&v.on("error",h.onError),v},{position:h.position});return m.hasOwnProperty("_map")&&m._map&&(m.getProximity()!==h.proximity&&h.proximity!==void 0&&m.setProximity(h.proximity),m.getRenderFunction()!==h.render&&h.render!==void 0&&m.setRenderFunction(h.render),m.getLanguage()!==h.language&&h.language!==void 0&&m.setLanguage(h.language),m.getZoom()!==h.zoom&&h.zoom!==void 0&&m.setZoom(h.zoom),m.getFlyTo()!==h.flyTo&&h.flyTo!==void 0&&m.setFlyTo(h.flyTo),m.getPlaceholder()!==h.placeholder&&h.placeholder!==void 0&&m.setPlaceholder(h.placeholder),m.getCountries()!==h.countries&&h.countries!==void 0&&m.setCountries(h.countries),m.getTypes()!==h.types&&h.types!==void 0&&m.setTypes(h.types),m.getMinLength()!==h.minLength&&h.minLength!==void 0&&m.setMinLength(h.minLength),m.getLimit()!==h.limit&&h.limit!==void 0&&m.setLimit(h.limit),m.getFilter()!==h.filter&&h.filter!==void 0&&m.setFilter(h.filter),m.getOrigin()!==h.origin&&h.origin!==void 0&&m.setOrigin(h.origin),m.getAutocomplete()!==h.autocomplete&&h.autocomplete!==void 0&&m.setAutocomplete(h.autocomplete),m.getFuzzyMatch()!==h.fuzzyMatch&&h.fuzzyMatch!==void 0&&m.setFuzzyMatch(h.fuzzyMatch),m.getRouting()!==h.routing&&h.routing!==void 0&&m.setRouting(h.routing),m.getWorldview()!==h.worldview&&h.worldview!==void 0&&m.setWorldview(h.worldview)),n}/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */var hF=8,dF="LIVE - CORI light basemap - county labels",pF={"mapbox:type":"default","mapbox:origin":"light-v10","mapbox:autocomposite":!0,"mapbox:groups":{"1444855769305.6016":{name:"Tunnels",collapsed:!0},"1444855786460.0557":{name:"Roads",collapsed:!0},"1444855799204.86":{name:"Bridges",collapsed:!0},"1444934295202.7542":{name:"Admin boundaries",collapsed:!1}},"mapbox:sdk-support":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"},"mapbox:uiParadigm":"layers","mapbox:thumb":"data:image/webp;base64,UklGRmAJAABXRUJQVlA4TFQJAAAvO8AOAPX4drZtmWTXts7/wMzUqCCLGZOCMjCzbfx/1jFYYr9m+zeF5Gqx8bj3bozqqoouhWLj6dCYQqn+K1W6Vb1HB+Nn+HqXMatDQowkSVJTM/xwkv+mwu1OF8S2kRxJ7PyjfbMzs6a7+j8Be9jFwDSO7Za6ajtXwy/CHsEeYqSRsWzFQAbkSKlndkzfLGcN0zHLlJYZyNmbaOFmTdM0apq3d+t5Y906dr68rJ16zskdY1kaCWdraPJQE8CKlJazrjk+nrVM2/y0Q8ZpQtFux7BmD3bG8fxnncEJvUfnnPObbeMBsKIKWwJLA5PS8njL3DLP4CPmpnkG4+PxuFaBT22n9wiwUuTNx93WpXE+s4bmwJJyWCFwVAX3SJuMZ8fb5ic/uYKb5qc/HY+XqSvlgEmPIYI91BF5/X6fOW3Hpn0x7BGCGMgOIUVMAPdLSmn8xk/+ddM0zT/NUlqmDDhHT0NSj4pzfDEiNh53M7rOC/ElKUxkESgctcF75jilNBuP35gtU2kUjLo1fQicFbF5v7lCb488VM7WALsaKYd2zVFMDJBTSmn50/F4uY8oH9g2dlja+Pv3HebWDpZz2CAZV8BymTpIaTYb/3SZ9qXU6tvEuVU4hpI2Xye6NVcGNl5gQmAtIFJK47Qcj4/vYUcXT2V/e+hiR0dKjfeJAXNqGGNjZyGHYGhSSrPZcjkbH+83Acwe6dm7BBtfXc6umi7y9rHj4OwwIMkKSw5gmVJqm/FsNhvPlmlc+PcAb+MGLpNvvzvdHEb//8OovHFcQ+Yq/v9FAAPYcsiPFeA6pdTGbLkcz8YpXVyWKaW1nwkYRs7diBfOOr8KN/XMr5rQ0a5ZP9bB2pgIyCgcIBlYpJT6JqXl+HicUjv5Y0rp+jbBBm1ktlJfyo4HjVCu55uvNWTWNgGEcRjHAhvXJeOfjmep/JFd4HvbAxzyF3Odt55noJNjJLBCyEgTLJk6peO0PB7PlmVLsAG10hVYoHr+7tb9Xnc+Gq9LkmUp5EAAOaWOWc5mhcmkYAH+9Y69oGxQ5rm+/blu2ZcnO8ieP+xiF/UnHn5CsSdvpGRwWo4fz5bj8QTIKdUqxA4DhjDSXN3bt/Ha18gPbdnClr2jx9/+C/GJd2vFG1e2C6uWywDw0KQAUNdOEHYNtdW/9Ppr//pCNFKyMNiw+I5lm+I8GpNlnQuACwNyDES2sNDdYzNgTqQqy4CycbYlyn/fGMJR56jXN5Bxl/k8lnLsCjmL/zgc0lfHoSnKIiaEXOZssAXrI0t7EE3HQLYenf4V9p3x7Le+duJxX2Uu4IN6w2A8AvZRYLMfBfv7gOs6f/4Qh9THjV3bkxx+9L5vzc/c983rz+06z4+BKDFWCKySTMgGEOW5ydRzy6pCJj76rcn68b9LrtNns3fqsW0A+cjYLlkRkjH3+nFcfyKbqtCX7v4vzs98Z5ulUMGaHrGvbYdldC/acUDMI+ogY9183D4xWa0atXp1Br1lYw5HKnGOiHB2CO/nHtr6vCTlx0cmz3Gsv3eHObHhVctqJNe877Ab7FbtEc2e1A6XKBS5tkS5X360Y9aVjhVZn9gJGwSNx7N9/c6ZCgLgO3R6exWZUku4tlww9q0U0NLnbVRPI7tw57hOOqLMqjr1TIaJXRYSZIVsii+vgOg4skLzlWTD3c//qfA+yp242/sFnDDP4So+huswWBjmlsucf4/xnfEEj8BG783+2+m1R/Cwpne5evS5sQcLGVuteLpeZ7t/G9xbff0Z2zLAfWyKHbTUtLDN0QHWoN5OvctX2717l9Pva6cXffKx4bCViTpG+tVNnNTa5To8WwdB2UMAAw2Zon5/ALs1zbroWo0Y4X6velAf1fMDOyYxtTE8CTd9B3XbZaOa7TodvmY9vT4jvkIrjFmfqvz74xFhs1bO88CeoLNJpRweGiaO6s0RMyD5SJu+O73drb1VV6tOo9aXe3UGdR4CQ54G9w7T69Pt06SzDDx8Hqf1kXqv+rVsSi2rSZ6bubRsjXZYAOrTBwatmpl3mvaI2tXLv/+bbsw9QFv16qXf50bdXd7OZbV7/XOnV6/3p9ml79Y1ZDzSwgXLPLmji9aluLFNAQ9oAxZdfaknii934lsv8XK2bcAjuF9Pr6/O5W/1a0BhTB523M/AWetlA3tmaFOmXUO5w1i2AQLY0+L3n6c4MEOlxchsfJZ6hhtxcSoAnriA7AlgABsJMGZOcfFHk+sMho1j6TdNfOzUi6rwNkXLqsFl2GDLMjmA36dexbYL3nzu+M2J8ZIFfPpBwZZCtilmwEVh+P79qDeifhpzKNl4Pvdv2mupHWSAAUPx+47wnrFx4b4NBocBs4uqJf0XpTady3fw3Mhy/nZW2/5EGHBYVRgb3IEpWqZ0BlsZA7aFW5fuMyencAAHhvuQ8ye+/fD/fvUw4/vvtso8oiDLYLhPX08oOgYl4u6xhubkBMIc/hqo+UQYYmWxr3MIq5CJN2mq5wDKOdew+XfldefSRoX6NZKV69dHAMXLeD/AddTuqU85SNTfH1s4fAR07k8ekrXJlWXqeDtMNhXYR0F5VQKOHGHxcnyJ79kMC/ousDIHp7Zm2CMaCsbK1psuubIKWlaZrZyzye1oO4cmYwCZty45t7eYTIB/AiMHWlV+U9yrjE3k/E/yv9chv6lqOrXQ2oyrr1lzZ8DyAuNQR28WDBhTqMAR7/7MEACWb5ubKeJ7VUxdW8haAAK7otSADZji39Rd2pUKxPyjO8HTp+AHDmFccMG5BLBsF7xYrOIWzjJtvVtw/sKHF/sLgL9vCYxs4YKHZh8Zm1U1nZqa/PTXBuwdMiLP7OLgrULXSAaBsYRs38GW/rtgyWyMlV9EMSMdAKtGqu7Td3BzPBgxAOrjqKZ0wj16DETYvrZc31VRqj24OoBzp4u7vpT7zvk4OqBEuT4seAG4DFeWbLQ+9ZJclv13AxI8+yvIA/qFKR+AwSIfCVAFYJdAoG99F0uAASJ+7Xi5EzjuZk6s0hOYTLCZqwIsl4NhOjk0QLgQkevcYqaLo5VxjzyzJ/ltOJTB8wgDqICNVX3/cUwBt5OcFdkG/4OAbDbok6v49AOAgnrQJKaTmMi5qmKxcLBaev4vkeePDFjAp+cUg2cm51YN1WMoN56HKE4rgx0vnz19+Fc/ub79ZLILKw5pa4UxHOSSqQE="},fF=[-72.26808525539167,43.37747275058169],mF=10.873762090608595,gF=0,_F=2,yF={composite:{url:"mapbox://mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v8,ruralinno.2pv0vm2z,ruralinno.3v9y79ly,ruralinno.5639ssfg,ruralinno.c504wkuy,ruralinno.7stpbs93,ruralinno.cwz2k5qc,ruralinno.1joudpqe",type:"vector"}},vF="mapbox://sprites/ruralinno/cl010e7b7001p15pe3l0306hv/68n9slz9mfbus83an19oqbf32",xF="mapbox://fonts/ruralinno/{fontstack}/{range}.pbf",wF=[{id:"land",type:"background",layout:{},paint:{"background-color":"hsl(55, 0%, 100%)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",maxzoom:7,layout:{},paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":["interpolate",["exponential",1.5],["zoom"],2,.1,7,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",minzoom:5,filter:["==",["get","class"],"national_park"],layout:{},paint:{"fill-color":"hsla(150, 6%, 93%, 0.63)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.5]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",minzoom:5,filter:["match",["get","class"],["park","airport","glacier","pitch","sand"],!0,!1],layout:{},paint:{"fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,["match",["get","class"],"glacier",.5,1]],"fill-color":"hsl(150, 0%, 100%)"}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",layout:{},paint:{"fill-translate-anchor":"viewport","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-color":"hsl(185, 7%, 73%)"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":"round"},paint:{"line-color":"hsl(187, 9%, 81%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",layout:{},paint:{"fill-color":"#cad2d3","fill-opacity":.5}},{id:"hillshade",type:"fill",source:"composite","source-layer":"hillshade",minzoom:6,layout:{},paint:{"fill-color":["match",["get","class"],"shadow","hsl(0, 0%, 35%)","hsl(0, 0%, 100%)"],"fill-opacity":["interpolate",["linear"],["zoom"],12,["match",["get","level"],[67,56],.02,[89,78],.01,.015],15,0]}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",minzoom:21.1,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","class"],"land"]],layout:{},paint:{"fill-color":"hsl(156, 20%, 95%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"land"]],layout:{"line-cap":"round"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(156, 20%, 95%)"}},{id:"aeroway-polygon",type:"fill",source:"composite","source-layer":"aeroway",minzoom:11,filter:["all",["==",["geometry-type"],"Polygon"],["match",["get","type"],["runway","taxiway","helipad"],!0,!1]],layout:{},paint:{"fill-opacity":["interpolate",["linear"],["zoom"],11,0,11.5,1],"fill-color":"hsl(0, 0%, 97%)"}},{id:"aeroway-line",type:"line",source:"composite","source-layer":"aeroway",minzoom:9,filter:["==",["geometry-type"],"LineString"],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],9,["match",["get","type"],"runway",1,.5],18,["match",["get","type"],"runway",80,20]],"line-color":"hsl(0, 0%, 97%)"}},{id:"building-outline",type:"line",source:"composite","source-layer":"building",minzoom:15,filter:["all",["!=",["get","type"],"building:part"],["==",["get","underground"],"false"]],layout:{},paint:{"line-color":"hsl(55, 3%, 87%)","line-width":["interpolate",["exponential",1.5],["zoom"],15,.75,20,3],"line-opacity":["interpolate",["linear"],["zoom"],15,0,16,1]}},{id:"building",type:"fill",source:"composite","source-layer":"building",minzoom:15,filter:["all",["!=",["get","type"],"building:part"],["==",["get","underground"],"false"]],layout:{},paint:{"fill-outline-color":"hsl(55, 3%, 87%)","fill-opacity":["interpolate",["linear"],["zoom"],15,0,16,1],"fill-color":"hsl(55, 5%, 91%)"}},{id:"tunnel-street-minor-low",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(185, 7%, 88%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"tunnel-street-minor-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-opacity":["step",["zoom"],0,14,1],"line-dasharray":[3,3]}},{id:"tunnel-primary-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,["match",["get","class"],"primary",1,.75],18,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-dasharray":[3,3]}},{id:"tunnel-major-link-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-dasharray":[3,3]}},{id:"tunnel-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-dasharray":[3,3]}},{id:"tunnel-construction",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"construction"],["==",["geometry-type"],"LineString"]],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-color":"hsl(187, 7%, 88%)","line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]]}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"path"],["!=",["get","type"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,18,4],"line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]],"line-color":"hsl(0, 0%, 85%)"}},{id:"tunnel-steps",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 85%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"tunnel-major-link",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(187, 7%, 88%)"}},{id:"tunnel-pedestrian",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(187, 7%, 88%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"tunnel-street-minor",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(187, 7%, 88%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"tunnel-primary-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(187, 7%, 88%)"}},{id:"tunnel-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(187, 7%, 88%)"}},{id:"road-pedestrian-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"pedestrian"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,14.5],"line-color":"hsl(156, 12%, 92%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-minor-low",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"road-street-low",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"road-minor-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-opacity":["step",["zoom"],0,14,1]}},{id:"road-street-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-opacity":["step",["zoom"],0,14,1]}},{id:"road-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9.3,filter:["all",["match",["get","class"],["secondary","tertiary"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,.75,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.1,18,26]}},{id:"road-primary-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9.9,filter:["all",["==",["get","class"],"primary"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32]}},{id:"road-major-link-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:10,filter:["all",["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-opacity":["step",["zoom"],0,11,1]}},{id:"road-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:8.5,filter:["all",["match",["get","class"],["motorway","trunk"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-opacity":["step",["zoom"],["match",["get","class"],"motorway",1,0],6,1]}},{id:"road-construction",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","class"],"construction"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]]}},{id:"road-path",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"path"],["step",["zoom"],["!",["match",["get","type"],["steps","sidewalk","crossing"],!0,!1]],16,["!=",["get","type"],"steps"]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],13,.5,14,1,15,1,18,4],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]]}},{id:"road-steps",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","type"],"steps"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"road-major-link",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:10,filter:["all",["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"road-pedestrian",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"pedestrian"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"road-minor",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-street",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",filter:["all",["match",["get","class"],["secondary","tertiary"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.1,18,22],"line-color":"hsl(0, 0%, 100%)"}},{id:"road-primary",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9,filter:["all",["==",["get","class"],"primary"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"#f6eac1","line-opacity":["interpolate",["linear"],["zoom"],6,0,8,["match",["get","class"],["trunk"],.2,0],16,["match",["get","class"],["trunk"],1,.81]]}},{id:"road-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:8,filter:["all",["match",["get","class"],["motorway","trunk"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.5,18,32],"line-color":["match",["get","class"],["motorway"],"hsl(26, 100%, 68%)","#f2d163"],"line-opacity":["interpolate",["linear"],["zoom"],6,["match",["get","class"],["trunk"],.3,0],8,.4,18,.7]}},{id:"road-rail",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["match",["get","class"],["major_rail","minor_rail"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,20,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-pedestrian-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,14.5],"line-opacity":["step",["zoom"],0,14,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-street-minor-low",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"bridge-street-minor-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-opacity":["step",["zoom"],0,14,1],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-primary-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,["match",["get","class"],"primary",1,.75],18,2],"line-opacity":["step",["zoom"],0,10,1],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-major-link-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway","trunk"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-construction",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"construction"],["==",["geometry-type"],"LineString"]],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]],"line-color":"hsl(156, 0%, 100%)"}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"path"],["!=",["get","type"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,18,4],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]]}},{id:"bridge-steps",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","type"],"steps"],["==",["get","structure"],"bridge"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"bridge-major-link",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-pedestrian",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"bridge-street-minor",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"bridge-primary-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway","trunk"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-rail",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["major_rail","minor_rail"],!0,!1]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,20,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-major-link-2-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18]}},{id:"bridge-motorway-trunk-2-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32]}},{id:"bridge-major-link-2",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-motorway-trunk-2",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(0, 0%, 100%)"}},{id:"admin-1-boundary-bg",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",filter:["all",["==",["get","admin_level"],1],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"bevel"},paint:{"line-blur":["interpolate",["linear"],["zoom"],3,0,8,3],"line-width":["interpolate",["linear"],["zoom"],7,3.75,12,5.5],"line-opacity":["interpolate",["linear"],["zoom"],7,0,8,.75],"line-dasharray":[1,0],"line-translate":[0,0],"line-color":"hsl(0, 0%, 84%)"}},{id:"admin-0-boundary-bg",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,3.5,10,8],"line-color":"hsl(0, 0%, 84%)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-translate":[0,0],"line-blur":["interpolate",["linear"],["zoom"],3,0,10,2]}},{id:"admin-1-boundary",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",filter:["all",["==",["get","admin_level"],1],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["linear"],["zoom"],7,.75,12,1.5],"line-opacity":["interpolate",["linear"],["zoom"],2,0,3,1],"line-color":["interpolate",["linear"],["zoom"],3,"hsl(0, 0%, 80%)",7,"hsl(0, 0%, 70%)"]}},{id:"admin-0-boundary",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 62%)","line-width":["interpolate",["linear"],["zoom"],3,.5,10,2]}},{id:"admin-0-boundary-disputed",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round"},paint:{"line-dasharray":[1.5,1.5],"line-color":"hsl(0, 0%, 62%)","line-width":["interpolate",["linear"],["zoom"],3,.5,10,2]}},{id:"county_border",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"attr_county_labels_pg-155yvu",minzoom:6,maxzoom:12,paint:{"line-width":["interpolate",["linear"],["zoom"],5,.5,9,1.7,18,2],"line-color":"hsl(0, 0%, 59%)","line-opacity":["interpolate",["linear"],["zoom"],5,.2,9,.5,18,1]}},{id:"cousub_border",type:"line",source:"composite","source-layer":"attr_cousub_labels_less_pl-9lemol",minzoom:8,maxzoom:14,layout:{},paint:{"line-color":"hsl(0, 3%, 38%)","line-width":["interpolate",["linear"],["zoom"],0,1,6,1,22,1],"line-opacity":["interpolate",["linear"],["zoom"],7,.1,18,.2]}},{id:"place_border",type:"line",source:"composite","source-layer":"attr_place_labels_less_pl-0n1bxr",minzoom:8,maxzoom:14,paint:{"line-color":"hsla(0, 0%, 58%, 0.62)","line-dasharray":[3,2]}},{id:"road-label",type:"symbol",source:"composite","source-layer":"road",minzoom:10,filter:["step",["zoom"],["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],!0,!1],12,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary","pedestrian","street","street_limited"],!0,!1],15,["match",["get","class"],["ferry","golf","path"],!1,!0]],layout:{"text-size":["interpolate",["linear"],["zoom"],10,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],10,["motorway_link","trunk_link","primary_link","secondary_link","tertiary_link","pedestrian","street","street_limited"],9,6.5],18,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],16,["motorway_link","trunk_link","primary_link","secondary_link","tertiary_link","pedestrian","street","street_limited"],14,13]],"text-max-angle":30,"text-font":["DIN Offc Pro Regular","Arial Unicode MS Regular"],"symbol-placement":"line","text-padding":1,"text-rotation-alignment":"map","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.01},paint:{"text-color":"hsl(0, 0%, 42%)","text-halo-color":["match",["get","class"],["motorway","trunk"],"hsla(0, 0%, 100%, 0.75)","hsl(0, 0%, 100%)"],"text-halo-blur":1,"text-halo-width":.1}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,16],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:4,filter:["all",["match",["get","class"],["glacier","landform"],!0,!1],["==",["geometry-type"],"LineString"],["<=",["get","filterrank"],1]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(0, 0%, 100%)","text-halo-blur":.5,"text-color":"hsl(0, 0%, 42%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland"],!0,!1],["==",["geometry-type"],"Point"],["<=",["get","filterrank"],1]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"text-offset":["literal",[0,0]]},paint:{"text-color":"hsl(0, 0%, 42%)","text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":.5,"text-halo-blur":.5}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],7,["step",["get","sizerank"],24,6,18,12,12],10,["step",["get","sizerank"],18,9,12],18,["step",["get","sizerank"],18,9,16]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water"],!0,!1],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],7,["step",["get","sizerank"],24,6,18,12,12],10,["step",["get","sizerank"],18,9,12]],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"poi-label",type:"symbol",source:"composite","source-layer":"poi_label",minzoom:6,filter:["<=",["get","filterrank"],1],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":.1,"text-halo-blur":.5,"text-color":["step",["zoom"],["step",["get","sizerank"],"hsl(0, 0%, 66%)",5,"hsl(230, 0%, 56%)"],17,["step",["get","sizerank"],"hsl(0, 0%, 66%)",13,"hsl(0, 0%, 56%)"]]}},{id:"airport-label",type:"symbol",source:"composite","source-layer":"airport_label",minzoom:8,layout:{"text-line-height":1.1,"text-size":["step",["get","sizerank"],18,9,12],"icon-image":["step",["get","sizerank"],["concat",["get","maki"],"-15"],9,["concat",["get","maki"],"-11"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],visibility:"none","text-offset":[0,.75],"text-rotation-alignment":"viewport","text-anchor":"top","text-field":["step",["get","sizerank"],["coalesce",["get","name_en"],["get","name"]],15,["get","ref"]],"text-letter-spacing":.01,"text-max-width":9},paint:{"text-color":"hsla(0, 0%, 42%, 0)","text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":1,"text-opacity":0}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",minzoom:10,maxzoom:15,filter:["all",["==",["get","class"],"settlement_subdivision"],["<=",["get","filterrank"],4]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Offc Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.1],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",17,16]],visibility:"none"},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 62%)","text-halo-blur":.5,"text-halo-width":.1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",minzoom:3,maxzoom:9,filter:["==",["get","class"],"state"],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],10,6,9.5,7,9],9,["step",["get","symbolrank"],24,6,18,7,14]],"text-transform":"uppercase","text-font":["DIN Offc Pro Bold","Arial Unicode MS Bold"],"text-field":["step",["zoom"],["step",["get","symbolrank"],["coalesce",["get","name_en"],["get","name"]],5,["coalesce",["get","abbr"],["get","name_en"],["get","name"]]],5,["coalesce",["get","name_en"],["get","name"]]],"text-letter-spacing":.15,"text-max-width":6},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 66%)","text-halo-width":.1}},{id:"county_label",type:"symbol",source:"composite","source-layer":"attr_county_labels-5i5o0f",minzoom:7.5,maxzoom:14,layout:{"text-field":["step",["zoom"],["upcase",["to-string",["get","name"]]],6,["upcase",["to-string",["get","name"]]],10,["upcase",["to-string",["get","namelsad"]]],22,["upcase",["to-string",["get","namelsad"]]]],"text-font":["step",["zoom"],["literal",["Open Sans Regular","Arial Unicode MS Regular"]],6,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],8,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],11,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],22,["literal",["Montserrat Medium","Arial Unicode MS Regular"]]],"text-size":["interpolate",["linear"],["zoom"],0,0,6,6,6.5,10,7.5,14,9,30,11,75,14,85],"text-allow-overlap":["step",["zoom"],!1,5,!1,10,!1,11,!0],"text-max-width":5,"text-ignore-placement":["step",["zoom"],!1,6,!1,9,!0,12,!0,22,!0]},paint:{"text-color":"hsl(0, 0%, 48%)","text-opacity":["interpolate",["linear"],["zoom"],6.49999,1,6.5,.7,8,.3,11,.1,16,.05]}},{id:"cousub_label",type:"symbol",source:"composite","source-layer":"attr_cousub_labels_plus_pt-0kx5lj",minzoom:9,layout:{"text-field":["upcase",["get","display_name"]],"text-size":["interpolate",["linear"],["zoom"],7.9,0,8,8,9,10,14,30],"text-max-width":5,"text-line-height":1.1,visibility:"none"},paint:{"text-color":"hsla(0, 0%, 31%, 0.76)","text-halo-width":10,"text-halo-color":"hsl(0, 0%, 100%)"}},{id:"place-label new",type:"symbol",source:"composite","source-layer":"rural_places-4rf4i9",minzoom:9,filter:["match",["get","census_boundary_year"],[2020],!0,!1],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],15,["step",["get","symbolrank"],28,9,26,10,23,11,21,12,20,13,19,15,17]],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["Montserrat Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","NAME"]],"text-max-width":7},paint:{"text-color":["step",["get","symbolrank"],"hsl(0, 2%, 61%)",11,"hsl(0, 1%, 68%)",16,"hsl(0, 1%, 75%)"],"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1}},{id:"settlement-label",type:"symbol",source:"composite","source-layer":"place_label",maxzoom:10.76,filter:["all",["<=",["get","filterrank"],3],["==",["get","class"],"settlement"],["step",["zoom"],!0,12,[">=",["get","symbolrank"],11],13,[">=",["get","symbolrank"],12]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],15,["step",["get","symbolrank"],28,9,26,10,23,11,21,12,20,13,19,15,17]],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["step",["zoom"],["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]],8,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],11,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],10,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],12,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],11,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],13,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],12,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],15,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],13,["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]]],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],"text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":["step",["get","symbolrank"],"hsl(0, 0%, 42%)",11,"hsl(0, 0%, 55%)",16,"hsl(0, 0%, 62%)"],"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1}},{id:"wwb2s-places_lat_lon",type:"symbol",source:"composite","source-layer":"places_lat_lon-awryh9",minzoom:10.75,maxzoom:20,filter:["all",[">=",["get","pop"],101],[">",["get","pct_rural"],0],["step",["zoom"],!0,13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],13]]],layout:{"text-line-height":1.1,"text-size":["step",["get","symbolrank"],20,9,18,10,16,11,14,12,12],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["step",["zoom"],["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]],8,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],11,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],10,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],12,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],11,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],13,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],12,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],15,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],13,["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]]],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],"text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","NAME"],["get","name"]],"text-max-width":7},paint:{"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1,"text-color":["interpolate",["linear"],["zoom"],0,"hsl(0, 0%, 62%)",22,"#000000"],"text-opacity":["interpolate",["linear"],["zoom"],7,0,9,.97,22,1]}},{id:"custom-pattern",type:"fill",source:"composite","source-layer":"attr_county_labels_pg-155yvu",minzoom:6,layout:{visibility:"none"},paint:{"fill-color":"hsla(303, 73%, 74%, 0.66)","fill-pattern":"stripe-4"}}],bF="2022-02-24T13:16:14.872Z",EF="2024-07-11T16:18:50.102Z",TF="cl010e7b7001p15pe3l0306hv",SF="ruralinno",AF="private",CF=!1,IF={version:hF,name:dF,metadata:pF,center:fF,zoom:mF,bearing:gF,pitch:_F,sources:yF,sprite:vF,glyphs:xF,layers:wF,created:bF,modified:EF,id:TF,owner:SF,visibility:AF,protected:!1,draft:CF};/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */Object.assign({},IF);function Zp(e){let n="https://mui.com/production-error/?code="+e;for(let l=1;l0?Nr(vh,--Pi):0,uh--,yr===10&&(uh=1,D_--),yr}function Wi(){return yr=Pi2||Xp(yr)>3?"":" "}function GF(e,n){for(;--n&&Wi()&&!(yr<48||yr>102||yr>57&&yr<65||yr>70&&yr<97););return of(e,bg()+(n<6&&ws()==32&&Wi()==32))}function m1(e){for(;Wi();)switch(yr){case e:return Pi;case 34:case 39:e!==34&&e!==39&&m1(yr);break;case 40:e===41&&m1(e);break;case 92:Wi();break}return Pi}function qF(e,n){for(;Wi()&&e+yr!==47+10;)if(e+yr===42+42&&ws()===47)break;return"/*"+of(n,Pi-1)+"*"+R_(e===47?e:Wi())}function WF(e){for(;!Xp(ws());)Wi();return of(e,Pi)}function ZF(e){return BI(Tg("",null,null,null,[""],e=OI(e),0,[0],e))}function Tg(e,n,l,h,m,v,E,s,k){for(var D=0,V=0,G=E,J=0,ve=0,ae=0,me=1,Ce=1,ie=1,te=0,le="",ze=m,Oe=v,Ke=h,He=le;Ce;)switch(ae=te,te=Wi()){case 40:if(ae!=108&&Nr(He,G-1)==58){f1(He+=yn(Eg(te),"&","&\f"),"&\f")!=-1&&(ie=-1);break}case 34:case 39:case 91:He+=Eg(te);break;case 9:case 10:case 13:case 32:He+=$F(ae);break;case 92:He+=GF(bg()-1,7);continue;case 47:switch(ws()){case 42:case 47:rg(HF(qF(Wi(),bg()),n,l),k);break;default:He+="/"}break;case 123*me:s[D++]=_s(He)*ie;case 125*me:case 59:case 0:switch(te){case 0:case 125:Ce=0;case 59+V:ie==-1&&(He=yn(He,/\f/g,"")),ve>0&&_s(He)-G&&rg(ve>32?OT(He+";",h,l,G-1):OT(yn(He," ","")+";",h,l,G-2),k);break;case 59:He+=";";default:if(rg(Ke=DT(He,n,l,D,V,m,s,le,ze=[],Oe=[],G),v),te===123)if(V===0)Tg(He,n,Ke,Ke,ze,v,G,s,Oe);else switch(J===99&&Nr(He,3)===110?100:J){case 100:case 108:case 109:case 115:Tg(e,Ke,Ke,h&&rg(DT(e,Ke,Ke,0,0,m,s,le,m,ze=[],G),Oe),m,Oe,G,s,h?ze:Oe);break;default:Tg(He,Ke,Ke,Ke,[""],Oe,0,s,Oe)}}D=V=ve=0,me=ie=1,le=He="",G=E;break;case 58:G=1+_s(He),ve=ae;default:if(me<1){if(te==123)--me;else if(te==125&&me++==0&&VF()==125)continue}switch(He+=R_(te),te*me){case 38:ie=V>0?1:(He+="\f",-1);break;case 44:s[D++]=(_s(He)-1)*ie,ie=1;break;case 64:ws()===45&&(He+=Eg(Wi())),J=ws(),V=G=_s(le=He+=WF(bg())),te++;break;case 45:ae===45&&_s(He)==2&&(me=0)}}return v}function DT(e,n,l,h,m,v,E,s,k,D,V){for(var G=m-1,J=m===0?v:[""],ve=Lx(J),ae=0,me=0,Ce=0;ae0?J[ie]+" "+te:yn(te,/&\f/g,J[ie])))&&(k[Ce++]=le);return O_(e,n,l,m===0?Px:s,k,D,V)}function HF(e,n,l){return O_(e,n,l,zI,R_(jF()),Hp(e,2,-2),0)}function OT(e,n,l,h){return O_(e,n,l,zx,Hp(e,0,h),Hp(e,h+1,-1),h)}function Qu(e,n){for(var l="",h=Lx(e),m=0;m6)switch(Nr(e,n+1)){case 109:if(Nr(e,n+4)!==45)break;case 102:return yn(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+i_+(Nr(e,n+3)==108?"$3":"$2-$3"))+e;case 115:return~f1(e,"stretch")?FI(yn(e,"stretch","fill-available"),n)+e:e}break;case 4949:if(Nr(e,n+1)!==115)break;case 6444:switch(Nr(e,_s(e)-3-(~f1(e,"!important")&&10))){case 107:return yn(e,":",":"+_n)+e;case 101:return yn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Nr(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+ei+"$2box$3")+e}break;case 5936:switch(Nr(e,n+11)){case 114:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+ei+e+e}return e}var r6=function(n,l,h,m){if(n.length>-1&&!n.return)switch(n.type){case zx:n.return=FI(n.value,n.length);break;case LI:return Qu([lp(n,{value:yn(n.value,"@","@"+_n)})],m);case Px:if(n.length)return UF(n.props,function(v){switch(NF(v,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Qu([lp(n,{props:[yn(v,/:(read-\w+)/,":"+i_+"$1")]})],m);case"::placeholder":return Qu([lp(n,{props:[yn(v,/:(plac\w+)/,":"+_n+"input-$1")]}),lp(n,{props:[yn(v,/:(plac\w+)/,":"+i_+"$1")]}),lp(n,{props:[yn(v,/:(plac\w+)/,ei+"input-$1")]})],m)}return""})}},i6=[r6],o6=function(n){var l=n.key;if(l==="css"){var h=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(h,function(me){var Ce=me.getAttribute("data-emotion");Ce.indexOf(" ")!==-1&&(document.head.appendChild(me),me.setAttribute("data-s",""))})}var m=n.stylisPlugins||i6,v={},E,s=[];E=n.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+l+' "]'),function(me){for(var Ce=me.getAttribute("data-emotion").split(" "),ie=1;ie{n[l]=VI(e[l])}),n}function ea(e,n,l={clone:!0}){const h=l.clone?Bn({},e):e;return Pu(e)&&Pu(n)&&Object.keys(n).forEach(m=>{Pu(n[m])&&Object.prototype.hasOwnProperty.call(e,m)&&Pu(e[m])?h[m]=ea(e[m],n[m],l):l.clone?h[m]=Pu(n[m])?VI(n[m]):n[m]:h[m]=n[m]}),h}const p6=["values","unit","step"],f6=e=>{const n=Object.keys(e).map(l=>({key:l,val:e[l]}))||[];return n.sort((l,h)=>l.val-h.val),n.reduce((l,h)=>Bn({},l,{[h.key]:h.val}),{})};function m6(e){const{values:n={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:l="px",step:h=5}=e,m=pl(e,p6),v=f6(n),E=Object.keys(v);function s(J){return`@media (min-width:${typeof n[J]=="number"?n[J]:J}${l})`}function k(J){return`@media (max-width:${(typeof n[J]=="number"?n[J]:J)-h/100}${l})`}function D(J,ve){const ae=E.indexOf(ve);return`@media (min-width:${typeof n[J]=="number"?n[J]:J}${l}) and (max-width:${(ae!==-1&&typeof n[E[ae]]=="number"?n[E[ae]]:ve)-h/100}${l})`}function V(J){return E.indexOf(J)+1`@media (min-width:${Rx[e]}px)`};function oa(e,n,l){const h=e.theme||{};if(Array.isArray(n)){const v=h.breakpoints||FT;return n.reduce((E,s,k)=>(E[v.up(v.keys[k])]=l(n[k]),E),{})}if(typeof n=="object"){const v=h.breakpoints||FT;return Object.keys(n).reduce((E,s)=>{if(Object.keys(v.values||Rx).indexOf(s)!==-1){const k=v.up(s);E[k]=l(n[s],s)}else{const k=s;E[k]=n[k]}return E},{})}return l(n)}function y6(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((h,m)=>{const v=e.up(m);return h[v]={},h},{}))||{}}function v6(e,n){return e.reduce((l,h)=>{const m=l[h];return(!m||Object.keys(m).length===0)&&delete l[h],l},n)}function $I(e){if(typeof e!="string")throw new Error(Zp(7));return e.charAt(0).toUpperCase()+e.slice(1)}function F_(e,n,l=!0){if(!n||typeof n!="string")return null;if(e&&e.vars&&l){const h=`vars.${n}`.split(".").reduce((m,v)=>m&&m[v]?m[v]:null,e);if(h!=null)return h}return n.split(".").reduce((h,m)=>h&&h[m]!=null?h[m]:null,e)}function o_(e,n,l,h=l){let m;return typeof e=="function"?m=e(l):Array.isArray(e)?m=e[l]||h:m=F_(e,l)||h,n&&(m=n(m,h,e)),m}function cr(e){const{prop:n,cssProperty:l=e.prop,themeKey:h,transform:m}=e,v=E=>{if(E[n]==null)return null;const s=E[n],k=E.theme,D=F_(k,h)||{};return oa(E,s,G=>{let J=o_(D,m,G);return G===J&&typeof G=="string"&&(J=o_(D,m,`${n}${G==="default"?"":$I(G)}`,G)),l===!1?J:{[l]:J}})};return v.propTypes={},v.filterProps=[n],v}function x6(e){const n={};return l=>(n[l]===void 0&&(n[l]=e(l)),n[l])}const w6={m:"margin",p:"padding"},b6={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},NT={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},E6=x6(e=>{if(e.length>2)if(NT[e])e=NT[e];else return[e];const[n,l]=e.split(""),h=w6[n],m=b6[l]||"";return Array.isArray(m)?m.map(v=>h+v):[h+m]}),Dx=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ox=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Dx,...Ox];function sf(e,n,l,h){var m;const v=(m=F_(e,n,!1))!=null?m:l;return typeof v=="number"?E=>typeof E=="string"?E:v*E:Array.isArray(v)?E=>typeof E=="string"?E:v[E]:typeof v=="function"?v:()=>{}}function GI(e){return sf(e,"spacing",8)}function af(e,n){if(typeof n=="string"||n==null)return n;const l=Math.abs(n),h=e(l);return n>=0?h:typeof h=="number"?-h:`-${h}`}function T6(e,n){return l=>e.reduce((h,m)=>(h[m]=af(n,l),h),{})}function S6(e,n,l,h){if(n.indexOf(l)===-1)return null;const m=E6(l),v=T6(m,h),E=e[l];return oa(e,E,v)}function qI(e,n){const l=GI(e.theme);return Object.keys(e).map(h=>S6(e,n,h,l)).reduce(Tp,{})}function rr(e){return qI(e,Dx)}rr.propTypes={};rr.filterProps=Dx;function ir(e){return qI(e,Ox)}ir.propTypes={};ir.filterProps=Ox;function A6(e=8){if(e.mui)return e;const n=GI({spacing:e}),l=(...h)=>(h.length===0?[1]:h).map(v=>{const E=n(v);return typeof E=="number"?`${E}px`:E}).join(" ");return l.mui=!0,l}function N_(...e){const n=e.reduce((h,m)=>(m.filterProps.forEach(v=>{h[v]=m}),h),{}),l=h=>Object.keys(h).reduce((m,v)=>n[v]?Tp(m,n[v](h)):m,{});return l.propTypes={},l.filterProps=e.reduce((h,m)=>h.concat(m.filterProps),[]),l}function ho(e){return typeof e!="number"?e:`${e}px solid`}function yo(e,n){return cr({prop:e,themeKey:"borders",transform:n})}const C6=yo("border",ho),I6=yo("borderTop",ho),k6=yo("borderRight",ho),M6=yo("borderBottom",ho),P6=yo("borderLeft",ho),z6=yo("borderColor"),L6=yo("borderTopColor"),R6=yo("borderRightColor"),D6=yo("borderBottomColor"),O6=yo("borderLeftColor"),B6=yo("outline",ho),F6=yo("outlineColor"),U_=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const n=sf(e.theme,"shape.borderRadius",4),l=h=>({borderRadius:af(n,h)});return oa(e,e.borderRadius,l)}return null};U_.propTypes={};U_.filterProps=["borderRadius"];N_(C6,I6,k6,M6,P6,z6,L6,R6,D6,O6,U_,B6,F6);const j_=e=>{if(e.gap!==void 0&&e.gap!==null){const n=sf(e.theme,"spacing",8),l=h=>({gap:af(n,h)});return oa(e,e.gap,l)}return null};j_.propTypes={};j_.filterProps=["gap"];const V_=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const n=sf(e.theme,"spacing",8),l=h=>({columnGap:af(n,h)});return oa(e,e.columnGap,l)}return null};V_.propTypes={};V_.filterProps=["columnGap"];const $_=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const n=sf(e.theme,"spacing",8),l=h=>({rowGap:af(n,h)});return oa(e,e.rowGap,l)}return null};$_.propTypes={};$_.filterProps=["rowGap"];const N6=cr({prop:"gridColumn"}),U6=cr({prop:"gridRow"}),j6=cr({prop:"gridAutoFlow"}),V6=cr({prop:"gridAutoColumns"}),$6=cr({prop:"gridAutoRows"}),G6=cr({prop:"gridTemplateColumns"}),q6=cr({prop:"gridTemplateRows"}),W6=cr({prop:"gridTemplateAreas"}),Z6=cr({prop:"gridArea"});N_(j_,V_,$_,N6,U6,j6,V6,$6,G6,q6,W6,Z6);function eh(e,n){return n==="grey"?n:e}const H6=cr({prop:"color",themeKey:"palette",transform:eh}),X6=cr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:eh}),K6=cr({prop:"backgroundColor",themeKey:"palette",transform:eh});N_(H6,X6,K6);function Vi(e){return e<=1&&e!==0?`${e*100}%`:e}const Y6=cr({prop:"width",transform:Vi}),Bx=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const n=l=>{var h,m;const v=((h=e.theme)==null||(h=h.breakpoints)==null||(h=h.values)==null?void 0:h[l])||Rx[l];return v?((m=e.theme)==null||(m=m.breakpoints)==null?void 0:m.unit)!=="px"?{maxWidth:`${v}${e.theme.breakpoints.unit}`}:{maxWidth:v}:{maxWidth:Vi(l)}};return oa(e,e.maxWidth,n)}return null};Bx.filterProps=["maxWidth"];const J6=cr({prop:"minWidth",transform:Vi}),Q6=cr({prop:"height",transform:Vi}),eN=cr({prop:"maxHeight",transform:Vi}),tN=cr({prop:"minHeight",transform:Vi});cr({prop:"size",cssProperty:"width",transform:Vi});cr({prop:"size",cssProperty:"height",transform:Vi});const nN=cr({prop:"boxSizing"});N_(Y6,Bx,J6,Q6,eN,tN,nN);const rN={border:{themeKey:"borders",transform:ho},borderTop:{themeKey:"borders",transform:ho},borderRight:{themeKey:"borders",transform:ho},borderBottom:{themeKey:"borders",transform:ho},borderLeft:{themeKey:"borders",transform:ho},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ho},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:U_},color:{themeKey:"palette",transform:eh},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:eh},backgroundColor:{themeKey:"palette",transform:eh},p:{style:ir},pt:{style:ir},pr:{style:ir},pb:{style:ir},pl:{style:ir},px:{style:ir},py:{style:ir},padding:{style:ir},paddingTop:{style:ir},paddingRight:{style:ir},paddingBottom:{style:ir},paddingLeft:{style:ir},paddingX:{style:ir},paddingY:{style:ir},paddingInline:{style:ir},paddingInlineStart:{style:ir},paddingInlineEnd:{style:ir},paddingBlock:{style:ir},paddingBlockStart:{style:ir},paddingBlockEnd:{style:ir},m:{style:rr},mt:{style:rr},mr:{style:rr},mb:{style:rr},ml:{style:rr},mx:{style:rr},my:{style:rr},margin:{style:rr},marginTop:{style:rr},marginRight:{style:rr},marginBottom:{style:rr},marginLeft:{style:rr},marginX:{style:rr},marginY:{style:rr},marginInline:{style:rr},marginInlineStart:{style:rr},marginInlineEnd:{style:rr},marginBlock:{style:rr},marginBlockStart:{style:rr},marginBlockEnd:{style:rr},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:j_},rowGap:{style:$_},columnGap:{style:V_},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Vi},maxWidth:{style:Bx},minWidth:{transform:Vi},height:{transform:Vi},maxHeight:{transform:Vi},minHeight:{transform:Vi},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Fx=rN;function iN(...e){const n=e.reduce((h,m)=>h.concat(Object.keys(m)),[]),l=new Set(n);return e.every(h=>l.size===Object.keys(h).length)}function oN(e,n){return typeof e=="function"?e(n):e}function sN(){function e(l,h,m,v){const E={[l]:h,theme:m},s=v[l];if(!s)return{[l]:h};const{cssProperty:k=l,themeKey:D,transform:V,style:G}=s;if(h==null)return null;if(D==="typography"&&h==="inherit")return{[l]:h};const J=F_(m,D)||{};return G?G(E):oa(E,h,ae=>{let me=o_(J,V,ae);return ae===me&&typeof ae=="string"&&(me=o_(J,V,`${l}${ae==="default"?"":$I(ae)}`,ae)),k===!1?me:{[k]:me}})}function n(l){var h;const{sx:m,theme:v={}}=l||{};if(!m)return null;const E=(h=v.unstable_sxConfig)!=null?h:Fx;function s(k){let D=k;if(typeof k=="function")D=k(v);else if(typeof k!="object")return k;if(!D)return null;const V=y6(v.breakpoints),G=Object.keys(V);let J=V;return Object.keys(D).forEach(ve=>{const ae=oN(D[ve],v);if(ae!=null)if(typeof ae=="object")if(E[ve])J=Tp(J,e(ve,ae,v,E));else{const me=oa({theme:v},ae,Ce=>({[ve]:Ce}));iN(me,ae)?J[ve]=n({sx:ae,theme:v}):J=Tp(J,me)}else J=Tp(J,e(ve,ae,v,E))}),v6(G,J)}return Array.isArray(m)?m.map(s):s(m)}return n}const WI=sN();WI.filterProps=["sx"];const ZI=WI;function aN(e,n){const l=this;return l.vars&&typeof l.getColorSchemeSelector=="function"?{[l.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:n}:l.palette.mode===e?n:{}}const lN=["breakpoints","palette","spacing","shape"];function cN(e={},...n){const{breakpoints:l={},palette:h={},spacing:m,shape:v={}}=e,E=pl(e,lN),s=m6(l),k=A6(m);let D=ea({breakpoints:s,direction:"ltr",components:{},palette:Bn({mode:"light"},h),spacing:k,shape:Bn({},_6,v)},E);return D.applyStyles=aN,D=n.reduce((V,G)=>ea(V,G),D),D.unstable_sxConfig=Bn({},Fx,E==null?void 0:E.unstable_sxConfig),D.unstable_sx=function(G){return ZI({sx:G,theme:this})},D}function uN(e){return Object.keys(e).length===0}function hN(e=null){const n=ut.useContext(NI);return!n||uN(n)?e:n}function dN(e,n=Number.MIN_SAFE_INTEGER,l=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(e,l))}const pN=Object.freeze(Object.defineProperty({__proto__:null,default:dN},Symbol.toStringTag,{value:"Module"})),fN=ut.createContext(null),HI=fN;function XI(){return ut.useContext(HI)}const mN=typeof Symbol=="function"&&Symbol.for,gN=mN?Symbol.for("mui.nested"):"__THEME_NESTED__";function _N(e,n){return typeof n=="function"?n(e):Bn({},e,n)}function yN(e){const{children:n,theme:l}=e,h=XI(),m=ut.useMemo(()=>{const v=h===null?l:_N(h,l);return v!=null&&(v[gN]=h!==null),v},[l,h]);return Ka.jsx(HI.Provider,{value:m,children:n})}const vN=["value"],xN=ut.createContext();function wN(e){let{value:n}=e,l=pl(e,vN);return Ka.jsx(xN.Provider,Bn({value:n??!0},l))}const bN=ut.createContext(void 0);function EN({value:e,children:n}){return Ka.jsx(bN.Provider,{value:e,children:n})}const UT={};function jT(e,n,l,h=!1){return ut.useMemo(()=>{const m=e&&n[e]||n;if(typeof l=="function"){const v=l(m),E=e?Bn({},n,{[e]:v}):v;return h?()=>E:E}return e?Bn({},n,{[e]:l}):Bn({},n,l)},[e,n,l,h])}function TN(e){const{children:n,theme:l,themeId:h}=e,m=hN(UT),v=XI()||UT,E=jT(h,m,l),s=jT(h,v,l,!0),k=E.direction==="rtl";return Ka.jsx(yN,{theme:s,children:Ka.jsx(NI.Provider,{value:E,children:Ka.jsx(wN,{value:k,children:Ka.jsx(EN,{value:E==null?void 0:E.components,children:n})})})})}function SN(e,n){return Bn({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},n)}var ur={},KI={exports:{}};(function(e){function n(l){return l&&l.__esModule?l:{default:l}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(KI);var AN=KI.exports;const CN=XT(kF),IN=XT(pN);var YI=AN;Object.defineProperty(ur,"__esModule",{value:!0});ur.alpha=tk;ur.blend=jN;ur.colorChannel=void 0;var kN=ur.darken=Ux;ur.decomposeColor=_o;ur.emphasize=nk;var MN=ur.getContrastRatio=ON;ur.getLuminance=s_;ur.hexToRgb=JI;ur.hslToRgb=ek;var PN=ur.lighten=jx;ur.private_safeAlpha=BN;ur.private_safeColorChannel=void 0;ur.private_safeDarken=FN;ur.private_safeEmphasize=UN;ur.private_safeLighten=NN;ur.recomposeColor=xh;ur.rgbToHex=DN;var VT=YI(CN),zN=YI(IN);function Nx(e,n=0,l=1){return(0,zN.default)(e,n,l)}function JI(e){e=e.slice(1);const n=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let l=e.match(n);return l&&l[0].length===1&&(l=l.map(h=>h+h)),l?`rgb${l.length===4?"a":""}(${l.map((h,m)=>m<3?parseInt(h,16):Math.round(parseInt(h,16)/255*1e3)/1e3).join(", ")})`:""}function LN(e){const n=e.toString(16);return n.length===1?`0${n}`:n}function _o(e){if(e.type)return e;if(e.charAt(0)==="#")return _o(JI(e));const n=e.indexOf("("),l=e.substring(0,n);if(["rgb","rgba","hsl","hsla","color"].indexOf(l)===-1)throw new Error((0,VT.default)(9,e));let h=e.substring(n+1,e.length-1),m;if(l==="color"){if(h=h.split(" "),m=h.shift(),h.length===4&&h[3].charAt(0)==="/"&&(h[3]=h[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(m)===-1)throw new Error((0,VT.default)(10,m))}else h=h.split(",");return h=h.map(v=>parseFloat(v)),{type:l,values:h,colorSpace:m}}const QI=e=>{const n=_o(e);return n.values.slice(0,3).map((l,h)=>n.type.indexOf("hsl")!==-1&&h!==0?`${l}%`:l).join(" ")};ur.colorChannel=QI;const RN=(e,n)=>{try{return QI(e)}catch{return e}};ur.private_safeColorChannel=RN;function xh(e){const{type:n,colorSpace:l}=e;let{values:h}=e;return n.indexOf("rgb")!==-1?h=h.map((m,v)=>v<3?parseInt(m,10):m):n.indexOf("hsl")!==-1&&(h[1]=`${h[1]}%`,h[2]=`${h[2]}%`),n.indexOf("color")!==-1?h=`${l} ${h.join(" ")}`:h=`${h.join(", ")}`,`${n}(${h})`}function DN(e){if(e.indexOf("#")===0)return e;const{values:n}=_o(e);return`#${n.map((l,h)=>LN(h===3?Math.round(255*l):l)).join("")}`}function ek(e){e=_o(e);const{values:n}=e,l=n[0],h=n[1]/100,m=n[2]/100,v=h*Math.min(m,1-m),E=(D,V=(D+l/30)%12)=>m-v*Math.max(Math.min(V-3,9-V,1),-1);let s="rgb";const k=[Math.round(E(0)*255),Math.round(E(8)*255),Math.round(E(4)*255)];return e.type==="hsla"&&(s+="a",k.push(n[3])),xh({type:s,values:k})}function s_(e){e=_o(e);let n=e.type==="hsl"||e.type==="hsla"?_o(ek(e)).values:e.values;return n=n.map(l=>(e.type!=="color"&&(l/=255),l<=.03928?l/12.92:((l+.055)/1.055)**2.4)),Number((.2126*n[0]+.7152*n[1]+.0722*n[2]).toFixed(3))}function ON(e,n){const l=s_(e),h=s_(n);return(Math.max(l,h)+.05)/(Math.min(l,h)+.05)}function tk(e,n){return e=_o(e),n=Nx(n),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${n}`:e.values[3]=n,xh(e)}function BN(e,n,l){try{return tk(e,n)}catch{return e}}function Ux(e,n){if(e=_o(e),n=Nx(n),e.type.indexOf("hsl")!==-1)e.values[2]*=1-n;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let l=0;l<3;l+=1)e.values[l]*=1-n;return xh(e)}function FN(e,n,l){try{return Ux(e,n)}catch{return e}}function jx(e,n){if(e=_o(e),n=Nx(n),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*n;else if(e.type.indexOf("rgb")!==-1)for(let l=0;l<3;l+=1)e.values[l]+=(255-e.values[l])*n;else if(e.type.indexOf("color")!==-1)for(let l=0;l<3;l+=1)e.values[l]+=(1-e.values[l])*n;return xh(e)}function NN(e,n,l){try{return jx(e,n)}catch{return e}}function nk(e,n=.15){return s_(e)>.5?Ux(e,n):jx(e,n)}function UN(e,n,l){try{return nk(e,n)}catch{return e}}function jN(e,n,l,h=1){const m=(k,D)=>Math.round((k**(1/h)*(1-l)+D**(1/h)*l)**h),v=_o(e),E=_o(n),s=[m(v.values[0],E.values[0]),m(v.values[1],E.values[1]),m(v.values[2],E.values[2])];return xh({type:"rgb",values:s})}const VN={black:"#000",white:"#fff"},Kp=VN,$N={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},GN=$N,qN={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Au=qN,WN={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Cu=WN,ZN={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},cp=ZN,HN={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Iu=HN,XN={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},ku=XN,KN={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Mu=KN,YN=["mode","contrastThreshold","tonalOffset"],$T={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Kp.white,default:Kp.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},av={text:{primary:Kp.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Kp.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function GT(e,n,l,h){const m=h.light||h,v=h.dark||h*1.5;e[n]||(e.hasOwnProperty(l)?e[n]=e[l]:n==="light"?e.light=PN(e.main,m):n==="dark"&&(e.dark=kN(e.main,v)))}function JN(e="light"){return e==="dark"?{main:Iu[200],light:Iu[50],dark:Iu[400]}:{main:Iu[700],light:Iu[400],dark:Iu[800]}}function QN(e="light"){return e==="dark"?{main:Au[200],light:Au[50],dark:Au[400]}:{main:Au[500],light:Au[300],dark:Au[700]}}function eU(e="light"){return e==="dark"?{main:Cu[500],light:Cu[300],dark:Cu[700]}:{main:Cu[700],light:Cu[400],dark:Cu[800]}}function tU(e="light"){return e==="dark"?{main:ku[400],light:ku[300],dark:ku[700]}:{main:ku[700],light:ku[500],dark:ku[900]}}function nU(e="light"){return e==="dark"?{main:Mu[400],light:Mu[300],dark:Mu[700]}:{main:Mu[800],light:Mu[500],dark:Mu[900]}}function rU(e="light"){return e==="dark"?{main:cp[400],light:cp[300],dark:cp[700]}:{main:"#ed6c02",light:cp[500],dark:cp[900]}}function iU(e){const{mode:n="light",contrastThreshold:l=3,tonalOffset:h=.2}=e,m=pl(e,YN),v=e.primary||JN(n),E=e.secondary||QN(n),s=e.error||eU(n),k=e.info||tU(n),D=e.success||nU(n),V=e.warning||rU(n);function G(me){return MN(me,av.text.primary)>=l?av.text.primary:$T.text.primary}const J=({color:me,name:Ce,mainShade:ie=500,lightShade:te=300,darkShade:le=700})=>{if(me=Bn({},me),!me.main&&me[ie]&&(me.main=me[ie]),!me.hasOwnProperty("main"))throw new Error(Zp(11,Ce?` (${Ce})`:"",ie));if(typeof me.main!="string")throw new Error(Zp(12,Ce?` (${Ce})`:"",JSON.stringify(me.main)));return GT(me,"light",te,h),GT(me,"dark",le,h),me.contrastText||(me.contrastText=G(me.main)),me},ve={dark:av,light:$T};return ea(Bn({common:Bn({},Kp),mode:n,primary:J({color:v,name:"primary"}),secondary:J({color:E,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:J({color:s,name:"error"}),warning:J({color:V,name:"warning"}),info:J({color:k,name:"info"}),success:J({color:D,name:"success"}),grey:GN,contrastThreshold:l,getContrastText:G,augmentColor:J,tonalOffset:h},ve[n]),m)}const oU=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function sU(e){return Math.round(e*1e5)/1e5}const qT={textTransform:"uppercase"},WT='"Roboto", "Helvetica", "Arial", sans-serif';function aU(e,n){const l=typeof n=="function"?n(e):n,{fontFamily:h=WT,fontSize:m=14,fontWeightLight:v=300,fontWeightRegular:E=400,fontWeightMedium:s=500,fontWeightBold:k=700,htmlFontSize:D=16,allVariants:V,pxToRem:G}=l,J=pl(l,oU),ve=m/14,ae=G||(ie=>`${ie/D*ve}rem`),me=(ie,te,le,ze,Oe)=>Bn({fontFamily:h,fontWeight:ie,fontSize:ae(te),lineHeight:le},h===WT?{letterSpacing:`${sU(ze/te)}em`}:{},Oe,V),Ce={h1:me(v,96,1.167,-1.5),h2:me(v,60,1.2,-.5),h3:me(E,48,1.167,0),h4:me(E,34,1.235,.25),h5:me(E,24,1.334,0),h6:me(s,20,1.6,.15),subtitle1:me(E,16,1.75,.15),subtitle2:me(s,14,1.57,.1),body1:me(E,16,1.5,.15),body2:me(E,14,1.43,.15),button:me(s,14,1.75,.4,qT),caption:me(E,12,1.66,.4),overline:me(E,12,2.66,1,qT),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ea(Bn({htmlFontSize:D,pxToRem:ae,fontFamily:h,fontSize:m,fontWeightLight:v,fontWeightRegular:E,fontWeightMedium:s,fontWeightBold:k},Ce),J,{clone:!1})}const lU=.2,cU=.14,uU=.12;function Un(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${lU})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${cU})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${uU})`].join(",")}const hU=["none",Un(0,2,1,-1,0,1,1,0,0,1,3,0),Un(0,3,1,-2,0,2,2,0,0,1,5,0),Un(0,3,3,-2,0,3,4,0,0,1,8,0),Un(0,2,4,-1,0,4,5,0,0,1,10,0),Un(0,3,5,-1,0,5,8,0,0,1,14,0),Un(0,3,5,-1,0,6,10,0,0,1,18,0),Un(0,4,5,-2,0,7,10,1,0,2,16,1),Un(0,5,5,-3,0,8,10,1,0,3,14,2),Un(0,5,6,-3,0,9,12,1,0,3,16,2),Un(0,6,6,-3,0,10,14,1,0,4,18,3),Un(0,6,7,-4,0,11,15,1,0,4,20,3),Un(0,7,8,-4,0,12,17,2,0,5,22,4),Un(0,7,8,-4,0,13,19,2,0,5,24,4),Un(0,7,9,-4,0,14,21,2,0,5,26,4),Un(0,8,9,-5,0,15,22,2,0,6,28,5),Un(0,8,10,-5,0,16,24,2,0,6,30,5),Un(0,8,11,-5,0,17,26,2,0,6,32,5),Un(0,9,11,-5,0,18,28,2,0,7,34,6),Un(0,9,12,-6,0,19,29,2,0,7,36,6),Un(0,10,13,-6,0,20,31,3,0,8,38,7),Un(0,10,13,-6,0,21,33,3,0,8,40,7),Un(0,10,14,-6,0,22,35,3,0,8,42,7),Un(0,11,14,-7,0,23,36,3,0,9,44,8),Un(0,11,15,-7,0,24,38,3,0,9,46,8)],dU=hU,pU=["duration","easing","delay"],fU={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},mU={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ZT(e){return`${Math.round(e)}ms`}function gU(e){if(!e)return 0;const n=e/36;return Math.round((4+15*n**.25+n/5)*10)}function _U(e){const n=Bn({},fU,e.easing),l=Bn({},mU,e.duration);return Bn({getAutoHeightDuration:gU,create:(m=["all"],v={})=>{const{duration:E=l.standard,easing:s=n.easeInOut,delay:k=0}=v;return pl(v,pU),(Array.isArray(m)?m:[m]).map(D=>`${D} ${typeof E=="string"?E:ZT(E)} ${s} ${typeof k=="string"?k:ZT(k)}`).join(",")}},e,{easing:n,duration:l})}const yU={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},vU=yU,xU=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function wU(e={},...n){const{mixins:l={},palette:h={},transitions:m={},typography:v={}}=e,E=pl(e,xU);if(e.vars)throw new Error(Zp(18));const s=iU(h),k=cN(e);let D=ea(k,{mixins:SN(k.breakpoints,l),palette:s,shadows:dU.slice(),typography:aU(s,v),transitions:_U(m),zIndex:Bn({},vU)});return D=ea(D,E),D=n.reduce((V,G)=>ea(V,G),D),D.unstable_sxConfig=Bn({},Fx,E==null?void 0:E.unstable_sxConfig),D.unstable_sx=function(G){return ZI({sx:G,theme:this})},D}const bU=["theme"];function EU(e){let{theme:n}=e,l=pl(e,bU);const h=n[RT];return Ka.jsx(TN,Bn({},l,{themeId:h?RT:void 0,theme:h||n}))}var rk={exports:{}};(function(e,n){(function(l,h){e.exports=h()})(Go,function(){var l,h,m;function v(s,k){if(!l)l=k;else if(!h)h=k;else{var D="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+l+")(sharedChunk); ("+h+")(sharedChunk); self.onerror = null;",V={};l(V),m=k(V),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(m.workerUrl=window.URL.createObjectURL(new Blob([D],{type:"text/javascript"})))}}v(["exports"],function(s){var k=typeof self<"u"?self:{},D="2.15.0";let V;const G={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(V==null){const r=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{V={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):r}catch{V=r}}return V},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!G.API_URL)return null;try{const r=new URL(G.API_URL);return r.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":r.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},J={supported:!1,testSupport:function(r){!me&&ae&&(Ce?ie(r):ve=r)}};let ve,ae,me=!1,Ce=!1;function ie(r){const t=r.createTexture();r.bindTexture(r.TEXTURE_2D,t);try{if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,ae),r.isContextLost())return;J.supported=!0}catch{}r.deleteTexture(t),me=!0}k.document&&(ae=k.document.createElement("img"),ae.onload=function(){ve&&ie(ve),ve=null,Ce=!0},ae.onerror=function(){me=!0,ve=null},ae.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const te="01";function le(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ze=Oe;function Oe(r,t,i,a){this.cx=3*r,this.bx=3*(i-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=t,this.p2x=i,this.p2y=a}Oe.prototype={sampleCurveX:function(r){return((this.ax*r+this.bx)*r+this.cx)*r},sampleCurveY:function(r){return((this.ay*r+this.by)*r+this.cy)*r},sampleCurveDerivativeX:function(r){return(3*this.ax*r+2*this.bx)*r+this.cx},solveCurveX:function(r,t){if(t===void 0&&(t=1e-6),r<0)return 0;if(r>1)return 1;for(var i=r,a=0;a<8;a++){var u=this.sampleCurveX(i)-r;if(Math.abs(u)u?g=i:y=i,i=.5*(y-g)+g;return i},solve:function(r,t){return this.sampleCurveY(this.solveCurveX(r,t))}};var Ke=le(ze),He=ht;function ht(r,t){this.x=r,this.y=t}ht.prototype={clone:function(){return new ht(this.x,this.y)},add:function(r){return this.clone()._add(r)},sub:function(r){return this.clone()._sub(r)},multByPoint:function(r){return this.clone()._multByPoint(r)},divByPoint:function(r){return this.clone()._divByPoint(r)},mult:function(r){return this.clone()._mult(r)},div:function(r){return this.clone()._div(r)},rotate:function(r){return this.clone()._rotate(r)},rotateAround:function(r,t){return this.clone()._rotateAround(r,t)},matMult:function(r){return this.clone()._matMult(r)},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(r){return this.x===r.x&&this.y===r.y},dist:function(r){return Math.sqrt(this.distSqr(r))},distSqr:function(r){var t=r.x-this.x,i=r.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith:function(r){return this.angleWithSep(r.x,r.y)},angleWithSep:function(r,t){return Math.atan2(this.x*t-this.y*r,this.x*r+this.y*t)},_matMult:function(r){var t=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=t,this},_add:function(r){return this.x+=r.x,this.y+=r.y,this},_sub:function(r){return this.x-=r.x,this.y-=r.y,this},_mult:function(r){return this.x*=r,this.y*=r,this},_div:function(r){return this.x/=r,this.y/=r,this},_multByPoint:function(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint:function(r){return this.x/=r.x,this.y/=r.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var r=this.y;return this.y=this.x,this.x=-r,this},_rotate:function(r){var t=Math.cos(r),i=Math.sin(r),a=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=a,this},_rotateAround:function(r,t){var i=Math.cos(r),a=Math.sin(r),u=t.y+a*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-a*(this.y-t.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ht.convert=function(r){return r instanceof ht?r:Array.isArray(r)?new ht(r[0],r[1]):r};var Ve=le(He);const jt=Math.PI/180,wr=180/Math.PI;function St(r){return r*jt}function Vt(r){return r*wr}const Vr=[[0,0],[1,0],[1,1],[0,1]];function $r(r){if(r<=0)return 0;if(r>=1)return 1;const t=r*r,i=t*r;return 4*(r<.5?i:3*(r-t)+i-.75)}function Li(r,t,i,a){const u=new Ke(r,t,i,a);return function(p){return u.solve(p)}}const Ki=Li(.25,.1,.25,1);function Je(r,t,i){return Math.min(i,Math.max(t,r))}function Tt(r,t,i){return(i=Je((i-r)/(t-r),0,1))*i*(3-2*i)}function xt(r,t,i){const a=i-t,u=((r-t)%a+a)%a+t;return u===t?i:u}function Bt(r,t,i){if(!r.length)return i(null,[]);let a=r.length;const u=new Array(r.length);let p=null;r.forEach((g,y)=>{t(g,(w,b)=>{w&&(p=w),u[y]=b,--a==0&&i(p,u)})})}function dn(r){const t=[];for(const i in r)t.push(r[i]);return t}function vn(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}let sr=1;function ii(){return sr++}function ar(){return function r(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,r)}()}function br(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Es(r){return!!r&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(r)}function Yi(r,t){r.forEach(i=>{t[i]&&(t[i]=t[i].bind(t))})}function xn(r,t){return r.indexOf(t,r.length-t.length)!==-1}function kt(r,t,i){const a={};for(const u in r)a[u]=t.call(i||this,r[u],u,r);return a}function Yo(r,t,i){const a={};for(const u in r)t.call(i||this,r[u],u,r)&&(a[u]=r[u]);return a}function Dr(r){return Array.isArray(r)?r.map(Dr):typeof r=="object"&&r?kt(r,Dr):r}const Jo={};function wn(r){Jo[r]||(typeof console<"u"&&console.warn(r),Jo[r]=!0)}function pi(r,t,i){return(i.y-r.y)*(t.x-r.x)>(t.y-r.y)*(i.x-r.x)}function Tc(r){let t=0;for(let i,a,u=0,p=r.length,g=p-1;u@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,a,u,p)=>{const g=u||p;return t[a]=!g||g.toLowerCase(),""}),t["max-age"]){const i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t}let fl=null;function aa(r){if(fl==null){const t=r.navigator?r.navigator.userAgent:null;fl=!!r.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return fl}function ml(r){try{const t=k[r];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}function Qo(r,t){return[r[4*t],r[4*t+1],r[4*t+2],r[4*t+3]]}const la="mapbox-tiles";let Sc=500,Ac=50,fi,es;function gl(){try{return k.caches}catch{}}function Ts(){gl()&&!fi&&(fi=k.caches.open(la))}function ca(r){const t=r.indexOf("?");if(t<0)return r;const i=function(u){const p=u.indexOf("?");return p>0?u.slice(p+1).split("&"):[]}(r),a=i.filter(u=>{const p=u.split("=");return p[0]==="language"||p[0]==="worldview"});return a.length?`${r.slice(0,t)}?${a.join("&")}`:r.slice(0,t)}let _l=1/0;const Ss={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Ss);class ts extends Error{constructor(t,i,a){i===401&&be(a)&&(t+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(t),this.status=i,this.url=a}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const As=vo()?()=>self.worker&&self.worker.referrer:()=>(k.location.protocol==="blob:"?k.parent:k).location.href,Cs=function(r,t){if(!(/^file:/.test(i=r.url)||/^file:/.test(As())&&!/^\w+:/.test(i))){if(k.fetch&&k.Request&&k.AbortController&&k.Request.prototype.hasOwnProperty("signal"))return function(a,u){const p=new k.AbortController,g=new k.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:As(),referrerPolicy:a.referrerPolicy,signal:p.signal});let y=!1,w=!1;const b=(A=g.url).indexOf("sku=")>0&&be(A);var A;a.type==="json"&&g.headers.set("Accept","application/json");const I=(L,R,F)=>{if(w)return;if(L&&L.message!=="SecurityError"&&wn(L.toString()),R&&F)return M(R);const $=Date.now();k.fetch(g).then(K=>{if(K.ok){const se=b?K.clone():null;return M(K,se,$)}return u(new ts(K.statusText,K.status,a.url))}).catch(K=>{K.name!=="AbortError"&&u(new Error(`${K.message} ${a.url}`))})},M=(L,R,F)=>{(a.type==="arrayBuffer"?L.arrayBuffer():a.type==="json"?L.json():L.text()).then($=>{w||(R&&F&&function(K,se,Y){if(Ts(),!fi)return;const re={status:se.status,statusText:se.statusText,headers:new k.Headers};se.headers.forEach((Ie,Te)=>re.headers.set(Te,Ie));const ue=oi(se.headers.get("Cache-Control")||"");if(ue["no-store"])return;ue["max-age"]&&re.headers.set("Expires",new Date(Y+1e3*ue["max-age"]).toUTCString());const ce=re.headers.get("Expires");ce&&(new Date(ce).getTime()-Y<42e4||function(Ie,Te){if(es===void 0)try{new Response(new ReadableStream),es=!0}catch{es=!1}es?Te(Ie.body):Ie.blob().then(Te)}(se,Ie=>{const Te=new k.Response(Ie,re);Ts(),fi&&fi.then(De=>De.put(ca(K.url),Te)).catch(De=>wn(De.message))}))}(g,R,F),y=!0,u(null,$,L.headers.get("Cache-Control"),L.headers.get("Expires")))}).catch($=>{w||u(new Error($.message))})};return b?function(L,R){if(Ts(),!fi)return R(null);const F=ca(L.url);fi.then($=>{$.match(F).then(K=>{const se=function(Y){if(!Y)return!1;const re=new Date(Y.headers.get("Expires")||0),ue=oi(Y.headers.get("Cache-Control")||"");return re>Date.now()&&!ue["no-cache"]}(K);$.delete(F),se&&$.put(F,K.clone()),R(null,K,se)}).catch(R)}).catch(R)}(g,I):I(null,null),{cancel:()=>{w=!0,y||p.abort()}}}(r,t);if(vo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",r,t,void 0,!0)}var i;return function(a,u){const p=new k.XMLHttpRequest;p.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(p.responseType="arraybuffer");for(const g in a.headers)p.setRequestHeader(g,a.headers[g]);return a.type==="json"&&(p.responseType="text",p.setRequestHeader("Accept","application/json")),p.withCredentials=a.credentials==="include",p.onerror=()=>{u(new Error(p.statusText))},p.onload=()=>{if((p.status>=200&&p.status<300||p.status===0)&&p.response!==null){let g=p.response;if(a.type==="json")try{g=JSON.parse(p.response)}catch(y){return u(y)}u(null,g,p.getResponseHeader("Cache-Control"),p.getResponseHeader("Expires"))}else u(new ts(p.statusText,p.status,a.url))},p.send(a.body),{cancel:()=>p.abort()}}(r,t)},ua=function(r,t){return Cs(vn(r,{type:"arrayBuffer"}),t)};function Cc(r){const t=k.document.createElement("a");return t.href=r,t.protocol===k.document.location.protocol&&t.host===k.document.location.host}const oe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let N,U;N=[],U=0;const ne=function(r,t){if(J.supported&&(r.headers||(r.headers={}),r.headers.accept="image/webp,*/*"),U>=G.MAX_PARALLEL_IMAGE_REQUESTS){const p={requestParameters:r,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return N.push(p),p}U++;let i=!1;const a=()=>{if(!i)for(i=!0,U--;N.length&&U{a(),p?t(p):g&&(k.createImageBitmap?function(b,A){const I=new k.Blob([new Uint8Array(b)],{type:"image/png"});k.createImageBitmap(I).then(M=>{A(null,M)}).catch(M=>{A(new Error(`Could not load image because of ${M.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(g,(b,A)=>t(b,A,y,w)):function(b,A){const I=new k.Image,M=k.URL;I.onload=()=>{A(null,I),M.revokeObjectURL(I.src),I.onload=null,k.requestAnimationFrame(()=>{I.src=oe})},I.onerror=()=>A(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 L=new k.Blob([new Uint8Array(b)],{type:"image/png"});I.src=b.byteLength?M.createObjectURL(L):oe}(g,(b,A)=>t(b,A,y,w)))});return{cancel:()=>{u.cancel(),a()}}},he="NO_ACCESS_TOKEN";function _e(r){return r.indexOf("mapbox:")===0}function be(r){return G.API_URL_REGEX.test(r)}function we(r){return G.API_CDN_URL_REGEX.test(r)}function ge(r){return G.API_STYLE_REGEX.test(r)&&!Pe(r)}function Pe(r){return G.API_SPRITE_REGEX.test(r)}const nt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function rt(r){const t=r.match(nt);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Qe(r){const t=r.params.length?`?${r.params.join("&")}`:"";return`${r.protocol}://${r.authority}${r.path}${t}`}const Mt="mapbox.eventData";function Rt(r){if(!r)return null;const t=r.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(k.atob(t[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class Pt{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const i=Rt(G.ACCESS_TOKEN);let a="";return a=i&&i.u?k.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(u,p)=>String.fromCharCode(+("0x"+p)))):G.ACCESS_TOKEN||"",t?`${Mt}.${t}:${a}`:`${Mt}:${a}`}fetchEventData(){const t=ml("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(t)try{const u=k.localStorage.getItem(i);u&&(this.eventData=JSON.parse(u));const p=k.localStorage.getItem(a);p&&(this.anonId=p)}catch{wn("Unable to read from LocalStorage")}}saveEventData(){const t=ml("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(t)try{k.localStorage.setItem(a,this.anonId),Object.keys(this.eventData).length>=1&&k.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{wn("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,i,a,u){if(!G.EVENTS_URL)return;const p=rt(G.EVENTS_URL);p.params.push(`access_token=${u||G.ACCESS_TOKEN||""}`);const g={event:this.type,created:new Date(t).toISOString()},y=i?vn(g,i):g,w={url:Qe(p),headers:{"Content-Type":"text/plain"},body:JSON.stringify([y])};this.pendingRequest=function(b,A){return Cs(vn(b,{method:"POST"}),A)}(w,b=>{this.pendingRequest=null,a(b),this.saveEventData(),this.processRequests(u)})}queueRequest(t,i){this.queue.push(t),this.processRequests(i)}}const Dt=new class extends Pt{constructor(r){super("appUserTurnstile"),this._customAccessToken=r}postTurnstileEvent(r,t){G.EVENTS_URL&&G.ACCESS_TOKEN&&Array.isArray(r)&&r.some(i=>_e(i)||be(i))&&this.queueRequest(Date.now(),t)}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=Rt(G.ACCESS_TOKEN),i=t?t.u:G.ACCESS_TOKEN;let a=i!==this.eventData.tokenU;Es(this.anonId)||(this.anonId=ar(),a=!0);const u=this.queue.shift();if(this.eventData.lastSuccess){const p=new Date(this.eventData.lastSuccess),g=new Date(u),y=(u-this.eventData.lastSuccess)/864e5;a=a||y>=1||y<-1||p.getDate()!==g.getDate()}else a=!0;a?this.postEvent(u,{sdkIdentifier:"mapbox-gl-js",sdkVersion:D,skuId:te,"enabled.telemetry":!1,userId:this.anonId},p=>{p||(this.eventData.lastSuccess=u,this.eventData.tokenU=i)},r):this.processRequests()}},Gt=Dt.postTurnstileEvent.bind(Dt),In=new class extends Pt{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(r,t,i,a){this.skuToken=t,this.errorCb=a,G.EVENTS_URL&&(i||G.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},i):this.errorCb(new Error(he)))}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),Es(this.anonId)||(this.anonId=ar()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:D,skuId:te,skuToken:this.skuToken,userId:this.anonId},a=>{a?this.errorCb(a):t&&(this.success[t]=!0)},r))}},Vn=In.postMapLoadEvent.bind(In),Ir=new class extends Pt{constructor(){super("gljs.performance")}postPerformanceEvent(r,t){G.EVENTS_URL&&(r||G.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},r)}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:t,performanceData:i}=this.queue.shift(),a=function(u){const p=k.performance.getEntriesByType("resource"),g=k.performance.getEntriesByType("mark"),y=function(M){const L={};if(M){for(const R in M)if(R!=="other")for(const F of M[R]){const $=`${R}ResolveRangeMin`,K=`${R}ResolveRangeMax`,se=`${R}RequestCount`,Y=`${R}RequestCachedCount`;L[$]=Math.min(L[$]||1/0,F.startTime),L[K]=Math.max(L[K]||-1/0,F.responseEnd);const re=ue=>{L[ue]===void 0&&(L[ue]=0),++L[ue]};F.transferSize!==void 0&&F.transferSize===0&&re(Y),re(se)}}return L}(function(M,L){const R={};if(M)for(const F of M){const $=L(F);R[$]===void 0&&(R[$]=[]),R[$].push(F)}return R}(p,lf)),w=k.devicePixelRatio,b=k.navigator.connection||k.navigator.mozConnection||k.navigator.webkitConnection,A={counters:[],metadata:[],attributes:[]},I=(M,L,R)=>{R!=null&&M.push({name:L,value:R.toString()})};for(const M in y)I(A.counters,M,y[M]);if(u.interactionRange[0]!==1/0&&u.interactionRange[1]!==-1/0&&(I(A.counters,"interactionRangeMin",u.interactionRange[0]),I(A.counters,"interactionRangeMax",u.interactionRange[1])),g)for(const M of Object.keys(ha)){const L=ha[M],R=g.find(F=>F.name===L);R&&I(A.counters,L,R.startTime)}return I(A.counters,"visibilityHidden",u.visibilityHidden),I(A.attributes,"style",function(M){if(M)for(const L of M){const R=L.name.split("?")[0];if(ge(R)){const F=R.split("/").slice(-2);if(F.length===2)return`mapbox://styles/${F[0]}/${F[1]}`}}}(p)),I(A.attributes,"terrainEnabled",u.terrainEnabled?"true":"false"),I(A.attributes,"fogEnabled",u.fogEnabled?"true":"false"),I(A.attributes,"projection",u.projection),I(A.attributes,"zoom",u.zoom),I(A.metadata,"devicePixelRatio",w),I(A.metadata,"connectionEffectiveType",b?b.effectiveType:void 0),I(A.metadata,"navigatorUserAgent",k.navigator.userAgent),I(A.metadata,"screenWidth",k.screen.width),I(A.metadata,"screenHeight",k.screen.height),I(A.metadata,"windowWidth",k.innerWidth),I(A.metadata,"windowHeight",k.innerHeight),I(A.metadata,"mapWidth",u.width/w),I(A.metadata,"mapHeight",u.height/w),I(A.metadata,"webglRenderer",u.renderer),I(A.metadata,"webglVendor",u.vendor),I(A.metadata,"sdkVersion",D),I(A.metadata,"sdkIdentifier","mapbox-gl-js"),A}(i);for(const u of a.metadata);for(const u of a.counters);for(const u of a.attributes);this.postEvent(t,a,()=>{},r)}},tr=Ir.postPerformanceEvent.bind(Ir),Ji=new class extends Pt{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(r,t,i,a){if(!G.API_URL||!G.SESSION_PATH)return;const u=rt(G.API_URL+G.SESSION_PATH);u.params.push(`sku=${t||""}`),u.params.push(`access_token=${a||G.ACCESS_TOKEN||""}`);const p={url:Qe(u),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(g,y){return Cs(vn(g,{method:"GET"}),y)}(p,g=>{this.pendingRequest=null,i(g),this.saveEventData(),this.processRequests(a)})}getSessionAPI(r,t,i,a){this.skuToken=t,this.errorCb=a,G.SESSION_PATH&&G.API_URL&&(i||G.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},i):this.errorCb(new Error(he)))}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||this.getSession(i,this.skuToken,a=>{a?this.errorCb(a):t&&(this.success[t]=!0)},r)}},hr=Ji.getSessionAPI.bind(Ji),Or=new Set,ha={create:"create",load:"load",fullLoad:"fullLoad"},G_={mark(r){k.performance.mark(r)},measure(r,t,i){k.performance.measure(r,t,i)}};function lf(r){const t=r.name.split("?")[0];return we(t)&&t.includes("mapbox-gl.js")?"javascript":we(t)&&t.includes("mapbox-gl.css")?"css":function(i){return G.API_FONTS_REGEX.test(i)}(t)?"fontRange":Pe(t)?"sprite":ge(t)?"style":function(i){return G.API_TILEJSON_REGEX.test(i)}(t)?"tilejson":"other"}const Jt=k.performance;function wh(r){const t=r?r.url.toString():void 0;return Jt.getEntriesByName(t)}let yl,bh,Ic,Qi;const xo={now:()=>Ic!==void 0?Ic:k.performance.now(),setNow(r){Ic=r},restoreNow(){Ic=void 0},frame(r){const t=k.requestAnimationFrame(r);return{cancel:()=>k.cancelAnimationFrame(t)}},getImageData(r,t=0){const{width:i,height:a}=r;Qi||(Qi=k.document.createElement("canvas"));const u=Qi.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return(i>Qi.width||a>Qi.height)&&(Qi.width=i,Qi.height=a),u.clearRect(-t,-t,i+2*t,a+2*t),u.drawImage(r,0,0,i,a),u.getImageData(-t,-t,i+2*t,a+2*t)},resolveURL:r=>(yl||(yl=k.document.createElement("a")),yl.href=r,yl.href),get devicePixelRatio(){return k.devicePixelRatio},get prefersReducedMotion(){return!!k.matchMedia&&(bh==null&&(bh=k.matchMedia("(prefers-reduced-motion: reduce)")),bh.matches)}};function Eh(r,t,i){i[r]&&i[r].indexOf(t)!==-1||(i[r]=i[r]||[],i[r].push(t))}function Th(r,t,i){if(i&&i[r]){const a=i[r].indexOf(t);a!==-1&&i[r].splice(a,1)}}class Is{constructor(t,i={}){vn(this,i),this.type=t}}class wo extends Is{constructor(t,i={}){super("error",vn({error:t},i))}}class vl{on(t,i){return this._listeners=this._listeners||{},Eh(t,i,this._listeners),this}off(t,i){return Th(t,i,this._listeners),Th(t,i,this._oneTimeListeners),this}once(t,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Eh(t,i,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,i){typeof t=="string"&&(t=new Is(t,i||{}));const a=t.type;if(this.listens(a)){t.target=this;const u=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const y of u)y.call(this,t);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const y of p)Th(a,y,this._oneTimeListeners),y.call(this,t);const g=this._eventedParent;g&&(vn(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(t))}else t instanceof wo&&console.error(t.error);return this}listens(t){return!!(this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t))}setEventedParent(t,i){return this._eventedParent=t,this._eventedParentData=i,this}}var Re=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function bo(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}function $n(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function dr(r){if(Array.isArray(r))return r.map(dr);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const t={};for(const i in r)t[i]=dr(r[i]);return t}return $n(r)}class cf extends Error{constructor(t,i){super(i),this.message=i,this.key=t}}var eo=cf;class Sh{constructor(t,i=[]){this.parent=t,this.bindings={};for(const[a,u]of i)this.bindings[a]=u}concat(t){return new Sh(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}var uf=Sh;const da={kind:"null"},lt={kind:"number"},$t={kind:"string"},Ft={kind:"boolean"},si={kind:"color"},Ri={kind:"object"},Nt={kind:"value"},ai={kind:"collator"},xl={kind:"formatted"},ks={kind:"resolvedImage"};function mi(r,t){return{kind:"array",itemType:r,N:t}}function Sn(r){if(r.kind==="array"){const t=Sn(r.itemType);return typeof r.N=="number"?`array<${t}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${t}>`}return r.kind}const hf=[da,lt,$t,Ft,si,xl,Ri,mi(Nt),ks];function Eo(r,t){if(t.kind==="error")return null;if(r.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Eo(r.itemType,t.itemType))&&(typeof r.N!="number"||r.N===t.N))return null}else{if(r.kind===t.kind)return null;if(r.kind==="value"){for(const i of hf)if(!Eo(i,t))return null}}return`Expected ${Sn(r)} but found ${Sn(t)} instead.`}function wl(r,t){return t.some(i=>i.kind===r.kind)}function bl(r,t){return t.some(i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r)}var Ah,df={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function El(r){return(r=Math.round(r))<0?0:r>255?255:r}function Tl(r){return El(r[r.length-1]==="%"?parseFloat(r)/100*255:parseInt(r))}function kc(r){return(t=r[r.length-1]==="%"?parseFloat(r)/100:parseFloat(r))<0?0:t>1?1:t;var t}function pa(r,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?r+(t-r)*i*6:2*i<1?t:3*i<2?r+(t-r)*(2/3-i)*6:r}try{Ah={}.parseCSSColor=function(r){var t,i=r.replace(/ /g,"").toLowerCase();if(i in df)return df[i].slice();if(i[0]==="#")return i.length===4?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:i.length===7&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var a=i.indexOf("("),u=i.indexOf(")");if(a!==-1&&u+1===i.length){var p=i.substr(0,a),g=i.substr(a+1,u-(a+1)).split(","),y=1;switch(p){case"rgba":if(g.length!==4)return null;y=kc(g.pop());case"rgb":return g.length!==3?null:[Tl(g[0]),Tl(g[1]),Tl(g[2]),y];case"hsla":if(g.length!==4)return null;y=kc(g.pop());case"hsl":if(g.length!==3)return null;var w=(parseFloat(g[0])%360+360)%360/360,b=kc(g[1]),A=kc(g[2]),I=A<=.5?A*(b+1):A+b-A*b,M=2*A-I;return[El(255*pa(M,I,w+1/3)),El(255*pa(M,I,w)),El(255*pa(M,I,w-1/3)),y];default:return null}}return null}}catch{}class Gr{constructor(t,i,a,u=1){this.r=t,this.g=i,this.b=a,this.a=u}static parse(t){if(!t)return;if(t instanceof Gr)return t;if(typeof t!="string")return;const i=Ah(t);return i?new Gr(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[t,i,a,u]=this.toArray();return`rgba(${Math.round(t)},${Math.round(i)},${Math.round(a)},${u})`}toArray(){const{r:t,g:i,b:a,a:u}=this;return u===0?[0,0,0,0]:[255*t/u,255*i/u,255*a/u,u]}toArray01(){const{r:t,g:i,b:a,a:u}=this;return u===0?[0,0,0,0]:[t/u,i/u,a/u,u]}toArray01PremultipliedAlpha(){const{r:t,g:i,b:a,a:u}=this;return[t,i,a,u]}}Gr.black=new Gr(0,0,0,1),Gr.white=new Gr(1,1,1,1),Gr.transparent=new Gr(0,0,0,0),Gr.red=new Gr(1,0,0,1),Gr.blue=new Gr(0,0,1,1);var Fn=Gr;class Ch{constructor(t,i,a){this.sensitivity=t?i?"variant":"case":i?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,i){return this.collator.compare(t,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ih{constructor(t,i,a,u,p){this.text=t.normalize?t.normalize():t,this.image=i,this.scale=a,this.fontStack=u,this.textColor=p}}class qr{constructor(t){this.sections=t}static fromString(t){return new qr([new Ih(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof qr?t:qr.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const i of this.sections){if(i.image){t.push(["image",i.image.name]);continue}t.push(i.text);const a={};i.fontStack&&(a["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(a["font-scale"]=i.scale),i.textColor&&(a["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(a)}return t}}class gi{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new gi({name:t,available:!1}):null}serialize(){return["image",this.name]}}function pf(r,t,i,a){return typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof i=="number"&&i>=0&&i<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[r,t,i,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[r,t,i,a]:[r,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Sl(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Fn||r instanceof Ch||r instanceof qr||r instanceof gi)return!0;if(Array.isArray(r)){for(const t of r)if(!Sl(t))return!1;return!0}if(typeof r=="object"){for(const t in r)if(!Sl(r[t]))return!1;return!0}return!1}function Ln(r){if(r===null)return da;if(typeof r=="string")return $t;if(typeof r=="boolean")return Ft;if(typeof r=="number")return lt;if(r instanceof Fn)return si;if(r instanceof Ch)return ai;if(r instanceof qr)return xl;if(r instanceof gi)return ks;if(Array.isArray(r)){const t=r.length;let i;for(const a of r){const u=Ln(a);if(i){if(i===u)continue;i=Nt;break}i=u}return mi(i||Nt,t)}return Ri}function Al(r){const t=typeof r;return r===null?"":t==="string"||t==="number"||t==="boolean"?String(r):r instanceof Fn||r instanceof qr||r instanceof gi?r.toString():JSON.stringify(r)}class kh{constructor(t,i){this.type=t,this.value=i}static parse(t,i){if(t.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Sl(t[1]))return i.error("invalid value");const a=t[1];let u=Ln(a);const p=i.expectedType;return u.kind!=="array"||u.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(u=p),new kh(u,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Fn?["rgba"].concat(this.value.toArray()):this.value instanceof qr?this.value.serialize():this.value}}var Ms=kh,Er=class{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}};const Mh={string:$t,number:lt,boolean:Ft,object:Ri};class Ph{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let a,u=1;const p=t[0];if(p==="array"){let y,w;if(t.length>2){const b=t[1];if(typeof b!="string"||!(b in Mh)||b==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);y=Mh[b],u++}else y=Nt;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return i.error('The length argument to "array" must be a positive integer literal',2);w=t[2],u++}a=mi(y,w)}else a=Mh[p];const g=[];for(;ut.outputDefined())}serialize(){const t=this.type,i=[t.kind];if(t.kind==="array"){const a=t.itemType;if(a.kind==="string"||a.kind==="number"||a.kind==="boolean"){i.push(a.kind);const u=t.N;(typeof u=="number"||this.args.length>1)&&i.push(u)}}return i.concat(this.args.map(a=>a.serialize()))}}var To=Ph;class ns{constructor(t){this.type=xl,this.sections=t}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return i.error("First argument must be an image or text section.");const u=[];let p=!1;for(let g=1;g<=t.length-1;++g){const y=t[g];if(p&&typeof y=="object"&&!Array.isArray(y)){p=!1;let w=null;if(y["font-scale"]&&(w=i.parse(y["font-scale"],1,lt),!w))return null;let b=null;if(y["text-font"]&&(b=i.parse(y["text-font"],1,mi($t)),!b))return null;let A=null;if(y["text-color"]&&(A=i.parse(y["text-color"],1,si),!A))return null;const I=u[u.length-1];I.scale=w,I.font=b,I.textColor=A}else{const w=i.parse(t[g],1,Nt);if(!w)return null;const b=w.type.kind;if(b!=="string"&&b!=="value"&&b!=="null"&&b!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,u.push({content:w,scale:null,font:null,textColor:null})}}return new ns(u)}evaluate(t){return new qr(this.sections.map(i=>{const a=i.content.evaluate(t);return Ln(a)===ks?new Ih("",a,null,null,null):new Ih(Al(a),null,i.scale?i.scale.evaluate(t):null,i.font?i.font.evaluate(t).join(","):null,i.textColor?i.textColor.evaluate(t):null)}))}eachChild(t){for(const i of this.sections)t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const i of this.sections){t.push(i.content.serialize());const a={};i.scale&&(a["font-scale"]=i.scale.serialize()),i.font&&(a["text-font"]=i.font.serialize()),i.textColor&&(a["text-color"]=i.textColor.serialize()),t.push(a)}return t}}class Mc{constructor(t){this.type=ks,this.input=t}static parse(t,i){if(t.length!==2)return i.error("Expected two arguments.");const a=i.parse(t[1],1,$t);return a?new Mc(a):i.error("No image name provided.")}evaluate(t){const i=this.input.evaluate(t),a=gi.fromString(i);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(i)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const q_={"to-boolean":Ft,"to-color":si,"to-number":lt,"to-string":$t};class zh{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[0];if((a==="to-boolean"||a==="to-string")&&t.length!==2)return i.error("Expected one argument.");const u=q_[a],p=[];for(let g=1;g4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:pf(i[0],i[1],i[2],i[3]),!a))return new Fn(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Er(a||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const a of this.args){if(i=a.evaluate(t),i===null)return 0;const u=Number(i);if(!isNaN(u))return u}throw new Er(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?qr.fromString(Al(this.args[0].evaluate(t))):this.type.kind==="resolvedImage"?gi.fromString(Al(this.args[0].evaluate(t))):Al(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if(this.type.kind==="formatted")return new ns([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Mc(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild(i=>{t.push(i.serialize())}),t}}var fa=zh;const to=["Unknown","Point","LineString","Polygon"];var Lh=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?to[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const r=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:a}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*t-r[0])+this.featureDistanceData.bearing[1]*(a*t-r[1])}return 0}parseColor(r){let t=this._parseColorCache[r];return t||(t=this._parseColorCache[r]=Fn.parse(r)),t}};class Ps{constructor(t,i,a,u){this.name=t,this.type=i,this._evaluate=a,this.args=u}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,i){const a=t[0],u=Ps.definitions[a];if(!u)return i.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(u)?u[0]:u.type,g=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,y=g.filter(([b])=>!Array.isArray(b)||b.length===t.length-1);let w=null;for(const[b,A]of y){w=new Nh(i.registry,i.path,null,i.scope);const I=[];let M=!1;for(let L=1;L{return M=I,Array.isArray(M)?`(${M.map(Sn).join(", ")})`:`(${Sn(M.type)}...)`;var M}).join(" | "),A=[];for(let I=1;I=t[2]||r[1]<=t[1]||r[3]>=t[3])}function Il(r,t){const i=(180+r[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,u=Math.pow(2,t.z);return[Math.round(i*u*Ao),Math.round(a*u*Ao)]}function ff(r,t,i){const a=r[0]-t[0],u=r[1]-t[1],p=r[0]-i[0],g=r[1]-i[1];return a*g-p*u==0&&a*p<=0&&u*g<=0}function zc(r,t){let i=!1;for(let g=0,y=t.length;g(a=r)[1]!=(p=w[b+1])[1]>a[1]&&a[0]<(p[0]-u[0])*(a[1]-u[1])/(p[1]-u[1])+u[0]&&(i=!i)}}var a,u,p;return i}function Rh(r,t){for(let i=0;i0&&y<0||g<0&&y>0}function ga(r,t,i){for(const b of i)for(let A=0;Ai[2]){const u=.5*a;let p=r[0]-i[0]>u?-a:i[0]-r[0]>u?a:0;p===0&&(p=r[0]-i[2]>u?-a:i[2]-r[0]>u?a:0),r[0]+=p}Pc(t,r)}function gf(r,t,i,a){const u=Math.pow(2,a.z)*Ao,p=[a.x*Ao,a.y*Ao],g=[];if(!r)return g;for(const y of r)for(const w of y){const b=[w.x+p[0],w.y+p[1]];Bh(b,t,i,u),g.push(b)}return g}function Fh(r,t,i,a){const u=Math.pow(2,a.z)*Ao,p=[a.x*Ao,a.y*Ao],g=[];if(!r)return g;for(const w of r){const b=[];for(const A of w){const I=[A.x+p[0],A.y+p[1]];Pc(t,I),b.push(I)}g.push(b)}if(t[2]-t[0]<=u/2){(y=t)[0]=y[1]=1/0,y[2]=y[3]=-1/0;for(const w of g)for(const b of w)Bh(b,t,i,u)}var y;return g}class _a{constructor(t,i){this.type=Ft,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Sl(t[1])){const a=t[1];if(a.type==="FeatureCollection")for(let u=0;u{t&&!ya(i)&&(t=!1)}),t}function Co(r){if(r instanceof So&&r.name==="feature-state")return!1;let t=!0;return r.eachChild(i=>{t&&!Co(i)&&(t=!1)}),t}function zs(r,t){if(r instanceof So&&t.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild(a=>{i&&!zs(a,t)&&(i=!1)}),i}class Rc{constructor(t,i){this.type=i.type,this.name=t,this.boundExpression=i}static parse(t,i){if(t.length!==2||typeof t[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const a=t[1];return i.scope.has(a)?new Rc(a,i.scope.get(a)):i.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var _f=Rc;class kl{constructor(t,i=[],a,u=new uf,p=[]){this.registry=t,this.path=i,this.key=i.map(g=>`[${g}]`).join(""),this.scope=u,this.errors=p,this.expectedType=a}parse(t,i,a,u,p={}){return i?this.concat(i,a,u)._parse(t,p):this._parse(t,p)}_parse(t,i){function a(u,p,g){return g==="assert"?new To(p,[u]):g==="coerce"?new fa(p,[u]):u}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const u=t[0];if(typeof u!="string")return this.error(`Expression name must be a string, but found ${typeof u} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[u];if(p){let g=p.parse(t,this);if(!g)return null;if(this.expectedType){const y=this.expectedType,w=g.type;if(y.kind!=="string"&&y.kind!=="number"&&y.kind!=="boolean"&&y.kind!=="object"&&y.kind!=="array"||w.kind!=="value")if(y.kind!=="color"&&y.kind!=="formatted"&&y.kind!=="resolvedImage"||w.kind!=="value"&&w.kind!=="string"){if(this.checkSubtype(y,w))return null}else g=a(g,y,i.typeAnnotation||"coerce");else g=a(g,y,i.typeAnnotation||"assert")}if(!(g instanceof Ms)&&g.type.kind!=="resolvedImage"&&Uh(g)){const y=new Lh;try{g=new Ms(g.type,g.evaluate(y))}catch(w){return this.error(w.message),null}}return g}return this.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,i,a){const u=typeof t=="number"?this.path.concat(t):this.path,p=a?this.scope.concat(a):this.scope;return new kl(this.registry,u,i||null,p,this.errors)}error(t,...i){const a=`${this.key}${i.map(u=>`[${u}]`).join("")}`;this.errors.push(new eo(a,t))}checkSubtype(t,i){const a=Eo(t,i);return a&&this.error(a),a}}var Nh=kl;function Uh(r){if(r instanceof _f)return Uh(r.boundExpression);if(r instanceof So&&r.name==="error"||r instanceof Cl||r instanceof Lc)return!1;const t=r instanceof fa||r instanceof To;let i=!0;return r.eachChild(a=>{i=t?i&&Uh(a):i&&a instanceof Ms}),!!i&&ya(r)&&zs(r,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Dc(r,t){const i=r.length-1;let a,u,p=0,g=i,y=0;for(;p<=g;)if(y=Math.floor((p+g)/2),a=r[y],u=r[y+1],a<=t){if(y===i||tt))throw new Er("Input is not a number.");g=y-1}return 0}class Oc{constructor(t,i,a){this.type=t,this.input=i,this.labels=[],this.outputs=[];for(const[u,p]of a)this.labels.push(u),this.outputs.push(p)}static parse(t,i){if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");const a=i.parse(t[1],1,lt);if(!a)return null;const u=[];let p=null;i.expectedType&&i.expectedType.kind!=="value"&&(p=i.expectedType);for(let g=1;g=y)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',b);const I=i.parse(w,A,p);if(!I)return null;p=p||I.type,u.push([y,I])}return new Oc(p,a,u)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const u=this.input.evaluate(t);if(u<=i[0])return a[0].evaluate(t);const p=i.length;return u>=i[p-1]?a[p-1].evaluate(t):a[Dc(i,u)].evaluate(t)}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let i=0;i0&&t.push(this.labels[i]),t.push(this.outputs[i].serialize());return t}}var jh=Oc;function Wt(r,t,i){return r*(1-i)+t*i}var Ml=Object.freeze({__proto__:null,array:function(r,t,i){return r.map((a,u)=>Wt(a,t[u],i))},color:function(r,t,i){return new Fn(Wt(r.r,t.r,i),Wt(r.g,t.g,i),Wt(r.b,t.b,i),Wt(r.a,t.a,i))},number:Wt});const yf=.95047,Vh=1.08883,vf=4/29,Ls=6/29,$h=3*Ls*Ls,Z_=Ls*Ls*Ls,H_=Math.PI/180,X_=180/Math.PI;function Gh(r){return r>Z_?Math.pow(r,1/3):r/$h+vf}function qh(r){return r>Ls?r*r*r:$h*(r-vf)}function Wh(r){return 255*(r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055)}function Bc(r){return(r/=255)<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function xf(r){const t=Bc(r.r),i=Bc(r.g),a=Bc(r.b),u=Gh((.4124564*t+.3575761*i+.1804375*a)/yf),p=Gh((.2126729*t+.7151522*i+.072175*a)/1);return{l:116*p-16,a:500*(u-p),b:200*(p-Gh((.0193339*t+.119192*i+.9503041*a)/Vh)),alpha:r.a}}function wf(r){let t=(r.l+16)/116,i=isNaN(r.a)?t:t+r.a/500,a=isNaN(r.b)?t:t-r.b/200;return t=1*qh(t),i=yf*qh(i),a=Vh*qh(a),new Fn(Wh(3.2404542*i-1.5371385*t-.4985314*a),Wh(-.969266*i+1.8760108*t+.041556*a),Wh(.0556434*i-.2040259*t+1.0572252*a),r.alpha)}function K_(r,t,i){const a=t-r;return r+i*(a>180||a<-180?a-360*Math.round(a/360):a)}const Pl={forward:xf,reverse:wf,interpolate:function(r,t,i){return{l:Wt(r.l,t.l,i),a:Wt(r.a,t.a,i),b:Wt(r.b,t.b,i),alpha:Wt(r.alpha,t.alpha,i)}}},va={forward:function(r){const{l:t,a:i,b:a}=xf(r),u=Math.atan2(a,i)*X_;return{h:u<0?u+360:u,c:Math.sqrt(i*i+a*a),l:t,alpha:r.a}},reverse:function(r){const t=r.h*H_,i=r.c;return wf({l:r.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:r.alpha})},interpolate:function(r,t,i){return{h:K_(r.h,t.h,i),c:Wt(r.c,t.c,i),l:Wt(r.l,t.l,i),alpha:Wt(r.alpha,t.alpha,i)}}};var Zh=Object.freeze({__proto__:null,hcl:va,lab:Pl});class zl{constructor(t,i,a,u,p){this.type=t,this.operator=i,this.interpolation=a,this.input=u,this.labels=[],this.outputs=[];for(const[g,y]of p)this.labels.push(g),this.outputs.push(y)}static interpolationFactor(t,i,a,u){let p=0;if(t.name==="exponential")p=Hh(i,t.base,a,u);else if(t.name==="linear")p=Hh(i,1,a,u);else if(t.name==="cubic-bezier"){const g=t.controlPoints;p=new Ke(g[0],g[1],g[2],g[3]).solve(Hh(i,1,a,u))}return p}static parse(t,i){let[a,u,p,...g]=t;if(!Array.isArray(u)||u.length===0)return i.error("Expected an interpolation type expression.",1);if(u[0]==="linear")u={name:"linear"};else if(u[0]==="exponential"){const b=u[1];if(typeof b!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);u={name:"exponential",base:b}}else{if(u[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(u[0])}`,1,0);{const b=u.slice(1);if(b.length!==4||b.some(A=>typeof A!="number"||A<0||A>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);u={name:"cubic-bezier",controlPoints:b}}}if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(p=i.parse(p,2,lt),!p)return null;const y=[];let w=null;a==="interpolate-hcl"||a==="interpolate-lab"?w=si:i.expectedType&&i.expectedType.kind!=="value"&&(w=i.expectedType);for(let b=0;b=A)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);const R=i.parse(I,L,w);if(!R)return null;w=w||R.type,y.push([A,R])}return w.kind==="number"||w.kind==="color"||w.kind==="array"&&w.itemType.kind==="number"&&typeof w.N=="number"?new zl(w,a,u,p,y):i.error(`Type ${Sn(w)} is not interpolatable.`)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const u=this.input.evaluate(t);if(u<=i[0])return a[0].evaluate(t);const p=i.length;if(u>=i[p-1])return a[p-1].evaluate(t);const g=Dc(i,u),y=zl.interpolationFactor(this.interpolation,u,i[g],i[g+1]),w=a[g].evaluate(t),b=a[g+1].evaluate(t);return this.operator==="interpolate"?Ml[this.type.kind.toLowerCase()](w,b,y):this.operator==="interpolate-hcl"?va.reverse(va.interpolate(va.forward(w),va.forward(b),y)):Pl.reverse(Pl.interpolate(Pl.forward(w),Pl.forward(b),y))}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,t,this.input.serialize()];for(let a=0;aEo(u,y.type));return new Fc(g?Nt:a,p)}evaluate(t){let i,a=null,u=0;for(const p of this.args){if(u++,a=p.evaluate(t),a&&a instanceof gi&&!a.available&&(i||(i=a),a=null,u===this.args.length))return i;if(a!==null)break}return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(i=>{t.push(i.serialize())}),t}}var Xh=Fc;class Nc{constructor(t,i){this.type=i.type,this.bindings=[].concat(t),this.result=i}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const i of this.bindings)t(i[1]);t(this.result)}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let p=1;p=a.length)throw new Er(`Array index out of bounds: ${i} > ${a.length-1}.`);if(i!==Math.floor(i))throw new Er(`Array index must be an integer, but found ${i} instead.`);return a[i]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Y_=Kh;class Yh{constructor(t,i){this.type=Ft,this.needle=t,this.haystack=i}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,Nt);return a&&u?wl(a.type,[Ft,$t,lt,da,Nt])?new Yh(a,u):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(a.type)} instead`):null}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(a==null)return!1;if(!bl(i,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(Ln(i))} instead.`);if(!bl(a,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Sn(Ln(a))} instead.`);return a.indexOf(i)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Uc=Yh;class Ll{constructor(t,i,a){this.type=lt,this.needle=t,this.haystack=i,this.fromIndex=a}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,Nt);if(!a||!u)return null;if(!wl(a.type,[Ft,$t,lt,da,Nt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(a.type)} instead`);if(t.length===4){const p=i.parse(t[3],3,lt);return p?new Ll(a,u,p):null}return new Ll(a,u)}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!bl(i,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(Ln(i))} instead.`);if(!bl(a,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Sn(Ln(a))} instead.`);if(this.fromIndex){const u=this.fromIndex.evaluate(t);return a.indexOf(i,u)}return a.indexOf(i)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Ef=Ll;class Jh{constructor(t,i,a,u,p,g){this.inputType=t,this.type=i,this.input=a,this.cases=u,this.outputs=p,this.otherwise=g}static parse(t,i){if(t.length<5)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return i.error("Expected an even number of arguments.");let a,u;i.expectedType&&i.expectedType.kind!=="value"&&(u=i.expectedType);const p={},g=[];for(let b=2;bNumber.MAX_SAFE_INTEGER)return M.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof R=="number"&&Math.floor(R)!==R)return M.error("Numeric branch labels must be integer values.");if(a){if(M.checkSubtype(a,Ln(R)))return null}else a=Ln(R);if(p[String(R)]!==void 0)return M.error("Branch labels must be unique.");p[String(R)]=g.length}const L=i.parse(I,b,u);if(!L)return null;u=u||L.type,g.push(L)}const y=i.parse(t[1],1,Nt);if(!y)return null;const w=i.parse(t[t.length-1],t.length-1,u);return w?y.type.kind!=="value"&&i.concat(1).checkSubtype(a,y.type)?null:new Jh(a,u,y,p,g,w):null}evaluate(t){const i=this.input.evaluate(t);return(Ln(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),a=[],u={};for(const g of i){const y=u[this.cases[g]];y===void 0?(u[this.cases[g]]=a.length,a.push([this.cases[g],[g]])):a[y][1].push(g)}const p=g=>this.inputType.kind==="number"?Number(g):g;for(const[g,y]of a)t.push(y.length===1?p(y[0]):y.map(p)),t.push(this.outputs[g].serialize());return t.push(this.otherwise.serialize()),t}}var J_=Jh;class Qh{constructor(t,i,a){this.type=t,this.branches=i,this.otherwise=a}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return i.error("Expected an odd number of arguments.");let a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);const u=[];for(let g=1;gi.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(i=>{t.push(i.serialize())}),t}}var Tf=Qh;class Rl{constructor(t,i,a,u){this.type=t,this.input=i,this.beginIndex=a,this.endIndex=u}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,lt);if(!a||!u)return null;if(!wl(a.type,[mi(Nt),$t,Nt]))return i.error(`Expected first argument to be of type array or string, but found ${Sn(a.type)} instead`);if(t.length===4){const p=i.parse(t[3],3,lt);return p?new Rl(a.type,a,u,p):null}return new Rl(a.type,a,u)}evaluate(t){const i=this.input.evaluate(t),a=this.beginIndex.evaluate(t);if(!bl(i,["string","array"]))throw new Er(`Expected first argument to be of type array or string, but found ${Sn(Ln(i))} instead.`);if(this.endIndex){const u=this.endIndex.evaluate(t);return i.slice(a,u)}return i.slice(a)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Sf=Rl;function jc(r,t){return r==="=="||r==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Af(r,t,i,a){return a.compare(t,i)===0}function xa(r,t,i){const a=r!=="=="&&r!=="!=";return class ik{constructor(p,g,y){this.type=Ft,this.lhs=p,this.rhs=g,this.collator=y,this.hasUntypedArgument=p.type.kind==="value"||g.type.kind==="value"}static parse(p,g){if(p.length!==3&&p.length!==4)return g.error("Expected two or three arguments.");const y=p[0];let w=g.parse(p[1],1,Nt);if(!w)return null;if(!jc(y,w.type))return g.concat(1).error(`"${y}" comparisons are not supported for type '${Sn(w.type)}'.`);let b=g.parse(p[2],2,Nt);if(!b)return null;if(!jc(y,b.type))return g.concat(2).error(`"${y}" comparisons are not supported for type '${Sn(b.type)}'.`);if(w.type.kind!==b.type.kind&&w.type.kind!=="value"&&b.type.kind!=="value")return g.error(`Cannot compare types '${Sn(w.type)}' and '${Sn(b.type)}'.`);a&&(w.type.kind==="value"&&b.type.kind!=="value"?w=new To(b.type,[w]):w.type.kind!=="value"&&b.type.kind==="value"&&(b=new To(w.type,[b])));let A=null;if(p.length===4){if(w.type.kind!=="string"&&b.type.kind!=="string"&&w.type.kind!=="value"&&b.type.kind!=="value")return g.error("Cannot use collator to compare non-string types.");if(A=g.parse(p[3],3,ai),!A)return null}return new ik(w,b,A)}evaluate(p){const g=this.lhs.evaluate(p),y=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const w=Ln(g),b=Ln(y);if(w.kind!==b.kind||w.kind!=="string"&&w.kind!=="number")throw new Er(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${w.kind}, ${b.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const w=Ln(g),b=Ln(y);if(w.kind!=="string"||b.kind!=="string")return t(p,g,y)}return this.collator?i(p,g,y,this.collator.evaluate(p)):t(p,g,y)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}serialize(){const p=[r];return this.eachChild(g=>{p.push(g.serialize())}),p}}}const Q_=xa("==",function(r,t,i){return t===i},Af),ey=xa("!=",function(r,t,i){return t!==i},function(r,t,i,a){return!Af(0,t,i,a)}),ty=xa("<",function(r,t,i){return t",function(r,t,i){return t>i},function(r,t,i,a){return a.compare(t,i)>0}),ry=xa("<=",function(r,t,i){return t<=i},function(r,t,i,a){return a.compare(t,i)<=0}),Cf=xa(">=",function(r,t,i){return t>=i},function(r,t,i,a){return a.compare(t,i)>=0});class Vc{constructor(t,i,a,u,p,g){this.type=$t,this.number=t,this.locale=i,this.currency=a,this.unit=u,this.minFractionDigits=p,this.maxFractionDigits=g}static parse(t,i){if(t.length!==3)return i.error("Expected two arguments.");const a=i.parse(t[1],1,lt);if(!a)return null;const u=t[2];if(typeof u!="object"||Array.isArray(u))return i.error("NumberFormat options argument must be an object.");let p=null;if(u.locale&&(p=i.parse(u.locale,1,$t),!p))return null;let g=null;if(u.currency&&(g=i.parse(u.currency,1,$t),!g))return null;let y=null;if(u.unit&&(y=i.parse(u.unit,1,$t),!y))return null;let w=null;if(u["min-fraction-digits"]&&(w=i.parse(u["min-fraction-digits"],1,lt),!w))return null;let b=null;return u["max-fraction-digits"]&&(b=i.parse(u["max-fraction-digits"],1,lt),!b)?null:new Vc(a,p,g,y,w,b)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class wa{constructor(t){this.type=lt,this.input=t}static parse(t,i){if(t.length!==2)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=i.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Sn(a.type)} instead.`):new wa(a):null}evaluate(t){const i=this.input.evaluate(t);if(typeof i=="string"||Array.isArray(i))return i.length;throw new Er(`Expected value to be of type string or array, but found ${Sn(Ln(i))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(i=>{t.push(i.serialize())}),t}}const If={"==":Q_,"!=":ey,">":ny,"<":ty,">=":Cf,"<=":ry,array:To,at:Y_,boolean:To,case:Tf,coalesce:Xh,collator:Cl,format:ns,image:Mc,in:Uc,"index-of":Ef,interpolate:no,"interpolate-hcl":no,"interpolate-lab":no,length:wa,let:bf,literal:Ms,match:J_,number:To,"number-format":Vc,object:To,slice:Sf,step:jh,string:To,"to-boolean":fa,"to-color":fa,"to-number":fa,"to-string":fa,var:_f,within:Lc};function kf(r,[t,i,a,u]){t=t.evaluate(r),i=i.evaluate(r),a=a.evaluate(r);const p=u?u.evaluate(r):1,g=pf(t,i,a,p);if(g)throw new Er(g);return new Fn(t/255*p,i/255*p,a/255*p,p)}function Io(r,t){return r in t}function $c(r,t){const i=t[r];return i===void 0?null:i}function _i(r){return{type:r}}So.register(If,{error:[{kind:"error"},[$t],(r,[t])=>{throw new Er(t.evaluate(r))}],typeof:[$t,[Nt],(r,[t])=>Sn(Ln(t.evaluate(r)))],"to-rgba":[mi(lt,4),[si],(r,[t])=>t.evaluate(r).toArray()],rgb:[si,[lt,lt,lt],kf],rgba:[si,[lt,lt,lt,lt],kf],has:{type:Ft,overloads:[[[$t],(r,[t])=>Io(t.evaluate(r),r.properties())],[[$t,Ri],(r,[t,i])=>Io(t.evaluate(r),i.evaluate(r))]]},get:{type:Nt,overloads:[[[$t],(r,[t])=>$c(t.evaluate(r),r.properties())],[[$t,Ri],(r,[t,i])=>$c(t.evaluate(r),i.evaluate(r))]]},"feature-state":[Nt,[$t],(r,[t])=>$c(t.evaluate(r),r.featureState||{})],properties:[Ri,[],r=>r.properties()],"geometry-type":[$t,[],r=>r.geometryType()],id:[Nt,[],r=>r.id()],zoom:[lt,[],r=>r.globals.zoom],pitch:[lt,[],r=>r.globals.pitch||0],"distance-from-center":[lt,[],r=>r.distanceFromCenter()],"heatmap-density":[lt,[],r=>r.globals.heatmapDensity||0],"line-progress":[lt,[],r=>r.globals.lineProgress||0],"sky-radial-progress":[lt,[],r=>r.globals.skyRadialProgress||0],accumulated:[Nt,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[lt,_i(lt),(r,t)=>{let i=0;for(const a of t)i+=a.evaluate(r);return i}],"*":[lt,_i(lt),(r,t)=>{let i=1;for(const a of t)i*=a.evaluate(r);return i}],"-":{type:lt,overloads:[[[lt,lt],(r,[t,i])=>t.evaluate(r)-i.evaluate(r)],[[lt],(r,[t])=>-t.evaluate(r)]]},"/":[lt,[lt,lt],(r,[t,i])=>t.evaluate(r)/i.evaluate(r)],"%":[lt,[lt,lt],(r,[t,i])=>t.evaluate(r)%i.evaluate(r)],ln2:[lt,[],()=>Math.LN2],pi:[lt,[],()=>Math.PI],e:[lt,[],()=>Math.E],"^":[lt,[lt,lt],(r,[t,i])=>Math.pow(t.evaluate(r),i.evaluate(r))],sqrt:[lt,[lt],(r,[t])=>Math.sqrt(t.evaluate(r))],log10:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))/Math.LN10],ln:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))],log2:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))/Math.LN2],sin:[lt,[lt],(r,[t])=>Math.sin(t.evaluate(r))],cos:[lt,[lt],(r,[t])=>Math.cos(t.evaluate(r))],tan:[lt,[lt],(r,[t])=>Math.tan(t.evaluate(r))],asin:[lt,[lt],(r,[t])=>Math.asin(t.evaluate(r))],acos:[lt,[lt],(r,[t])=>Math.acos(t.evaluate(r))],atan:[lt,[lt],(r,[t])=>Math.atan(t.evaluate(r))],min:[lt,_i(lt),(r,t)=>Math.min(...t.map(i=>i.evaluate(r)))],max:[lt,_i(lt),(r,t)=>Math.max(...t.map(i=>i.evaluate(r)))],abs:[lt,[lt],(r,[t])=>Math.abs(t.evaluate(r))],round:[lt,[lt],(r,[t])=>{const i=t.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[lt,[lt],(r,[t])=>Math.floor(t.evaluate(r))],ceil:[lt,[lt],(r,[t])=>Math.ceil(t.evaluate(r))],"filter-==":[Ft,[$t,Nt],(r,[t,i])=>r.properties()[t.value]===i.value],"filter-id-==":[Ft,[Nt],(r,[t])=>r.id()===t.value],"filter-type-==":[Ft,[$t],(r,[t])=>r.geometryType()===t.value],"filter-<":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a{const i=r.id(),a=t.value;return typeof i==typeof a&&i":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a>u}],"filter-id->":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>a}],"filter-<=":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a<=u}],"filter-id-<=":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i<=a}],"filter->=":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a>=u}],"filter-id->=":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>=a}],"filter-has":[Ft,[Nt],(r,[t])=>t.value in r.properties()],"filter-has-id":[Ft,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ft,[mi($t)],(r,[t])=>t.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ft,[mi(Nt)],(r,[t])=>t.value.indexOf(r.id())>=0],"filter-in-small":[Ft,[$t,mi(Nt)],(r,[t,i])=>i.value.indexOf(r.properties()[t.value])>=0],"filter-in-large":[Ft,[$t,mi(Nt)],(r,[t,i])=>function(a,u,p,g){for(;p<=g;){const y=p+g>>1;if(u[y]===a)return!0;u[y]>a?g=y-1:p=y+1}return!1}(r.properties()[t.value],i.value,0,i.value.length-1)],all:{type:Ft,overloads:[[[Ft,Ft],(r,[t,i])=>t.evaluate(r)&&i.evaluate(r)],[_i(Ft),(r,t)=>{for(const i of t)if(!i.evaluate(r))return!1;return!0}]]},any:{type:Ft,overloads:[[[Ft,Ft],(r,[t,i])=>t.evaluate(r)||i.evaluate(r)],[_i(Ft),(r,t)=>{for(const i of t)if(i.evaluate(r))return!0;return!1}]]},"!":[Ft,[Ft],(r,[t])=>!t.evaluate(r)],"is-supported-script":[Ft,[$t],(r,[t])=>{const i=r.globals&&r.globals.isSupportedScript;return!i||i(t.evaluate(r))}],upcase:[$t,[$t],(r,[t])=>t.evaluate(r).toUpperCase()],downcase:[$t,[$t],(r,[t])=>t.evaluate(r).toLowerCase()],concat:[$t,_i(Nt),(r,t)=>t.map(i=>Al(i.evaluate(r))).join("")],"resolved-locale":[$t,[ai],(r,[t])=>t.evaluate(r).resolvedLocale()]});var Dl=If;function Mf(r){return{result:"success",value:r}}function Rs(r){return{result:"error",value:r}}function ba(r){return r["property-type"]==="data-driven"}function Gc(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function qc(r){return!!r.expression&&r.expression.interpolated}function Zt(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Ol(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function Pf(r){return r}function Wc(r,t){const i=t.type==="color",a=r.stops&&typeof r.stops[0][0]=="object",u=a||!(a||r.property!==void 0),p=r.type||(qc(t)?"exponential":"interval");if(i&&((r=bo({},r)).stops&&(r.stops=r.stops.map(b=>[b[0],Fn.parse(b[1])])),r.default=Fn.parse(r.default?r.default:t.default)),r.colorSpace&&r.colorSpace!=="rgb"&&!Zh[r.colorSpace])throw new Error(`Unknown color space: ${r.colorSpace}`);let g,y,w;if(p==="exponential")g=ko;else if(p==="interval")g=Zc;else if(p==="categorical"){g=zf,y=Object.create(null);for(const b of r.stops)y[b[0]]=b[1];w=typeof r.stops[0][0]}else{if(p!=="identity")throw new Error(`Unknown function type "${p}"`);g=Lf}if(a){const b={},A=[];for(let L=0;LL[0]),evaluate:({zoom:L},R)=>ko({stops:I,base:r.base},t,L).evaluate(L,R)}}if(u){const b=p==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:no.interpolationFactor.bind(void 0,b),zoomStops:r.stops.map(A=>A[0]),evaluate:({zoom:A})=>g(r,t,A,y,w)}}return{kind:"source",evaluate(b,A){const I=A&&A.properties?A.properties[r.property]:void 0;return I===void 0?Ea(r.default,t.default):g(r,t,I,y,w)}}}function Ea(r,t,i){return r!==void 0?r:t!==void 0?t:i!==void 0?i:void 0}function zf(r,t,i,a,u){return Ea(typeof i===u?a[i]:void 0,r.default,t.default)}function Zc(r,t,i){if(Zt(i)!=="number")return Ea(r.default,t.default);const a=r.stops.length;if(a===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[a-1][0])return r.stops[a-1][1];const u=Dc(r.stops.map(p=>p[0]),i);return r.stops[u][1]}function ko(r,t,i){const a=r.base!==void 0?r.base:1;if(Zt(i)!=="number")return Ea(r.default,t.default);const u=r.stops.length;if(u===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[u-1][0])return r.stops[u-1][1];const p=Dc(r.stops.map(A=>A[0]),i),g=function(A,I,M,L){const R=L-M,F=A-M;return R===0?0:I===1?F/R:(Math.pow(I,F)-1)/(Math.pow(I,R)-1)}(i,a,r.stops[p][0],r.stops[p+1][0]),y=r.stops[p][1],w=r.stops[p+1][1];let b=Ml[t.type]||Pf;if(r.colorSpace&&r.colorSpace!=="rgb"){const A=Zh[r.colorSpace];b=(I,M)=>A.reverse(A.interpolate(A.forward(I),A.forward(M),g))}return typeof y.evaluate=="function"?{evaluate(...A){const I=y.evaluate.apply(void 0,A),M=w.evaluate.apply(void 0,A);if(I!==void 0&&M!==void 0)return b(I,M,g)}}:b(y,w,g)}function Lf(r,t,i){return t.type==="color"?i=Fn.parse(i):t.type==="formatted"?i=qr.fromString(i.toString()):t.type==="resolvedImage"?i=gi.fromString(i.toString()):Zt(i)===t.type||t.type==="enum"&&t.values[i]||(i=void 0),Ea(i,r.default,t.default)}class Hc{constructor(t,i){this.expression=t,this._warningHistory={},this._evaluator=new Lh,this._defaultValue=i?function(a){return a.type==="color"&&(Ol(a.default)||Array.isArray(a.default))?new Fn(0,0,0,0):a.type==="color"?Fn.parse(a.default)||null:a.default===void 0?null:a.default}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(t,i,a,u,p,g,y,w){return this._evaluator.globals=t,this._evaluator.feature=i,this._evaluator.featureState=a,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=g,this._evaluator.featureTileCoord=y||null,this._evaluator.featureDistanceData=w||null,this.expression.evaluate(this._evaluator)}evaluate(t,i,a,u,p,g,y,w){this._evaluator.globals=t,this._evaluator.feature=i||null,this._evaluator.featureState=a||null,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=g||null,this._evaluator.featureTileCoord=y||null,this._evaluator.featureDistanceData=w||null;try{const b=this.expression.evaluate(this._evaluator);if(b==null||typeof b=="number"&&b!=b)return this._defaultValue;if(this._enumValues&&!(b in this._enumValues))throw new Er(`Expected value to be one of ${Object.keys(this._enumValues).map(A=>JSON.stringify(A)).join(", ")}, but found ${JSON.stringify(b)} instead.`);return b}catch(b){return this._warningHistory[b.message]||(this._warningHistory[b.message]=!0,typeof console<"u"&&console.warn(b.message)),this._defaultValue}}}function Ta(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in Dl}function Sa(r,t){const i=new Nh(Dl,[],t?function(u){const p={color:si,string:$t,number:lt,enum:$t,boolean:Ft,formatted:xl,resolvedImage:ks};return u.type==="array"?mi(p[u.value]||Nt,u.length):p[u.type]}(t):void 0),a=i.parse(r,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Mf(new Hc(a,t)):Rs(i.errors)}class ed{constructor(t,i){this.kind=t,this._styleExpression=i,this.isStateDependent=t!=="constant"&&!Co(i.expression)}evaluateWithoutErrorHandling(t,i,a,u,p,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,u,p,g)}evaluate(t,i,a,u,p,g){return this._styleExpression.evaluate(t,i,a,u,p,g)}}class Bl{constructor(t,i,a,u){this.kind=t,this.zoomStops=a,this._styleExpression=i,this.isStateDependent=t!=="camera"&&!Co(i.expression),this.interpolationType=u}evaluateWithoutErrorHandling(t,i,a,u,p,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,u,p,g)}evaluate(t,i,a,u,p,g){return this._styleExpression.evaluate(t,i,a,u,p,g)}interpolationFactor(t,i,a){return this.interpolationType?no.interpolationFactor(this.interpolationType,t,i,a):0}}function Fl(r,t){if((r=Sa(r,t)).result==="error")return r;const i=r.value.expression,a=ya(i);if(!a&&!ba(t))return Rs([new eo("","data expressions not supported")]);const u=zs(i,["zoom","pitch","distance-from-center"]);if(!u&&!Gc(t))return Rs([new eo("","zoom expressions not supported")]);const p=Kc(i);return p||u?p instanceof eo?Rs([p]):p instanceof no&&!qc(t)?Rs([new eo("",'"interpolate" expressions cannot be used with this property')]):Mf(p?new Bl(a?"camera":"composite",r.value,p.labels,p instanceof no?p.interpolation:void 0):new ed(a?"constant":"source",r.value)):Rs([new eo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xc{constructor(t,i){this._parameters=t,this._specification=i,bo(this,Wc(this._parameters,this._specification))}static deserialize(t){return new Xc(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Kc(r){let t=null;if(r instanceof bf)t=Kc(r.result);else if(r instanceof Xh){for(const i of r.args)if(t=Kc(i),t)break}else(r instanceof jh||r instanceof no)&&r.input instanceof So&&r.input.name==="zoom"&&(t=r);return t instanceof eo||r.eachChild(i=>{const a=Kc(i);a instanceof eo?t=a:!t&&a?t=new eo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new eo("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}class ct{constructor(t,i,a,u){this.message=(t?`${t}: `:"")+a,u&&(this.identifier=u),i!=null&&i.__line__&&(this.line=i.__line__)}}function Di(r){const t=r.key,i=r.value,a=r.valueSpec||{},u=r.objectElementValidators||{},p=r.style,g=r.styleSpec;let y=[];const w=Zt(i);if(w!=="object")return[new ct(t,i,`object expected, ${w} found`)];for(const b in i){const A=b.split(".")[0];let I;u[A]?I=u[A]:a[A]?I=kr:u["*"]?I=u["*"]:a["*"]&&(I=kr),I?y=y.concat(I({key:(t&&`${t}.`)+b,value:i[b],valueSpec:a[A]||a["*"],style:p,styleSpec:g,object:i,objectKey:b},i)):y.push(new ct(t,i[b],`unknown property "${b}"`))}for(const b in a)u[b]||a[b].required&&a[b].default===void 0&&i[b]===void 0&&y.push(new ct(t,i,`missing required property "${b}"`));return y}function Rf(r){const t=r.value,i=r.valueSpec,a=r.style,u=r.styleSpec,p=r.key,g=r.arrayElementValidator||kr;if(Zt(t)!=="array")return[new ct(p,t,`array expected, ${Zt(t)} found`)];if(i.length&&t.length!==i.length)return[new ct(p,t,`array length ${i.length} expected, length ${t.length} found`)];if(i["min-length"]&&t.lengthp)return[new ct(t,i,`${i} is greater than the maximum value ${p}`)]}return[]}function Ul(r){const t=r.valueSpec,i=$n(r.value.type);let a,u,p,g={};const y=i!=="categorical"&&r.value.property===void 0,w=!y,b=Zt(r.value.stops)==="array"&&Zt(r.value.stops[0])==="array"&&Zt(r.value.stops[0][0])==="object",A=Di({key:r.key,value:r.value,valueSpec:r.styleSpec.function,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(L){if(i==="identity")return[new ct(L.key,L.value,'identity function may not have a "stops" property')];let R=[];const F=L.value;return R=R.concat(Rf({key:L.key,value:F,valueSpec:L.valueSpec,style:L.style,styleSpec:L.styleSpec,arrayElementValidator:I})),Zt(F)==="array"&&F.length===0&&R.push(new ct(L.key,F,"array must have at least one stop")),R},default:function(L){return kr({key:L.key,value:L.value,valueSpec:t,style:L.style,styleSpec:L.styleSpec})}}});return i==="identity"&&y&&A.push(new ct(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||A.push(new ct(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!qc(r.valueSpec)&&A.push(new ct(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(w&&!ba(r.valueSpec)?A.push(new ct(r.key,r.value,"property functions not supported")):y&&!Gc(r.valueSpec)&&A.push(new ct(r.key,r.value,"zoom functions not supported"))),i!=="categorical"&&!b||r.value.property!==void 0||A.push(new ct(r.key,r.value,'"property" property is required')),A;function I(L){let R=[];const F=L.value,$=L.key;if(Zt(F)!=="array")return[new ct($,F,`array expected, ${Zt(F)} found`)];if(F.length!==2)return[new ct($,F,`array length 2 expected, length ${F.length} found`)];if(b){if(Zt(F[0])!=="object")return[new ct($,F,`object expected, ${Zt(F[0])} found`)];if(F[0].zoom===void 0)return[new ct($,F,"object stop key must have zoom")];if(F[0].value===void 0)return[new ct($,F,"object stop key must have value")];const K=$n(F[0].zoom);if(typeof K!="number")return[new ct($,F[0].zoom,"stop zoom values must be numbers")];if(p&&p>K)return[new ct($,F[0].zoom,"stop zoom values must appear in ascending order")];K!==p&&(p=K,u=void 0,g={}),R=R.concat(Di({key:`${$}[0]`,value:F[0],valueSpec:{zoom:{}},style:L.style,styleSpec:L.styleSpec,objectElementValidators:{zoom:Nl,value:M}}))}else R=R.concat(M({key:`${$}[0]`,value:F[0],valueSpec:{},style:L.style,styleSpec:L.styleSpec},F));return Ta(dr(F[1]))?R.concat([new ct(`${$}[1]`,F[1],"expressions are not allowed in function stops.")]):R.concat(kr({key:`${$}[1]`,value:F[1],valueSpec:t,style:L.style,styleSpec:L.styleSpec}))}function M(L,R){const F=Zt(L.value),$=$n(L.value),K=L.value!==null?L.value:R;if(a){if(F!==a)return[new ct(L.key,K,`${F} stop domain type must match previous stop domain type ${a}`)]}else a=F;if(F!=="number"&&F!=="string"&&F!=="boolean"&&typeof $!="number"&&typeof $!="string"&&typeof $!="boolean")return[new ct(L.key,K,"stop domain value must be a number, string, or boolean")];if(F!=="number"&&i!=="categorical"){let se=`number expected, ${F} found`;return ba(t)&&i===void 0&&(se+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ct(L.key,K,se)]}return i!=="categorical"||F!=="number"||typeof $=="number"&&isFinite($)&&Math.floor($)===$?i!=="categorical"&&F==="number"&&typeof $=="number"&&typeof u=="number"&&u!==void 0&&$new ct(`${r.key}${a.key}`,r.value,a.message));const i=t.value.expression||t.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new ct(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Co(i))return[new ct(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter")return jl(i,r);if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!zs(i,["zoom","feature-state"]))return[new ct(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!ya(i))return[new ct(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function jl(r,t){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(t.valueSpec&&t.valueSpec.expression)for(const u of t.valueSpec.expression.parameters)i.delete(u);if(i.size===0)return[];const a=[];return r instanceof So&&i.has(r.name)?[new ct(t.key,t.value,`["${r.name}"] expression is not supported in a filter for a ${t.object.type} layer with id: ${t.object.id}`)]:(r.eachChild(u=>{a.push(...jl(u,t))}),a)}function Yc(r){const t=r.key,i=r.value,a=r.valueSpec,u=[];return Array.isArray(a.values)?a.values.indexOf($n(i))===-1&&u.push(new ct(t,i,`expected one of [${a.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(a.values).indexOf($n(i))===-1&&u.push(new ct(t,i,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(i)} found`)),u}function td(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const t of r.slice(1))if(!td(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}function Jc(r,t="fill"){if(r==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};td(r)||(r=Ca(r));const i=r;let a=!0;try{a=function(b){if(!Aa(b))return b;let A=dr(b);return Qc(A),A=Df(A),A}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. -This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md -and paste the contents of this message in the report. -Thank you! -Filter Expression: -${JSON.stringify(i,null,2)} - `)}const u=Re[`filter_${t}`],p=Sa(a,u);let g=null;if(p.result==="error")throw new Error(p.value.map(b=>`${b.key}: ${b.message}`).join(", "));g=(b,A,I)=>p.value.evaluate(b,A,{},I);let y=null,w=null;if(a!==i){const b=Sa(i,u);if(b.result==="error")throw new Error(b.value.map(A=>`${A.key}: ${A.message}`).join(", "));y=(A,I,M,L,R)=>b.value.evaluate(A,I,{},M,void 0,void 0,L,R),w=!ya(b.value.expression)}return{filter:g,dynamicFilter:y||void 0,needGeometry:Of(a),needFeature:!!w}}function Df(r){if(!Array.isArray(r))return r;const t=function(i){if(nd.has(i[0])){for(let a=1;aDf(i))}function Qc(r){let t=!1;const i=[];if(r[0]==="case"){for(let a=1;a",">=","<","<=","to-boolean"]);function iy(r,t){return rt?1:0}function Of(r){if(!Array.isArray(r))return!1;if(r[0]==="within")return!0;for(let t=1;t"||t==="<="||t===">="?rd(r[1],r[2],t):t==="any"?(i=r.slice(1),["any"].concat(i.map(Ca))):t==="all"?["all"].concat(r.slice(1).map(Ca)):t==="none"?["all"].concat(r.slice(1).map(Ca).map(eu)):t==="in"?id(r[1],r.slice(2)):t==="!in"?eu(id(r[1],r.slice(2))):t==="has"?od(r[1]):t==="!has"?eu(od(r[1])):t!=="within"||r;var i}function rd(r,t,i){switch(r){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,r,t]}}function id(r,t){if(t.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(i=>typeof i!=typeof t[0])?["filter-in-large",r,["literal",t.sort(iy)]]:["filter-in-small",r,["literal",t]]}}function od(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function eu(r){return["!",r]}function Vl(r){return td(dr(r.value))?pr(bo({},r,{expressionContext:"filter",valueSpec:r.styleSpec[`filter_${r.layerType||"fill"}`]})):$l(r)}function $l(r){const t=r.value,i=r.key;if(Zt(t)!=="array")return[new ct(i,t,`array expected, ${Zt(t)} found`)];const a=r.styleSpec;let u,p=[];if(t.length<1)return[new ct(i,t,"filter array must have at least 1 element")];switch(p=p.concat(Yc({key:`${i}[0]`,value:t[0],valueSpec:a.filter_operator,style:r.style,styleSpec:r.styleSpec})),$n(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&$n(t[1])==="$type"&&p.push(new ct(i,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&p.push(new ct(i,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(u=Zt(t[1]),u!=="string"&&p.push(new ct(`${i}[1]`,t[1],`string expected, ${u} found`)));for(let g=2;g{b in i&&t.push(new ct(a,i[b],`"${b}" is prohibited for ref layers`))}),u.layers.forEach(b=>{$n(b.id)===y&&(w=b)}),w?w.ref?t.push(new ct(a,i.ref,"ref cannot reference another ref layer")):g=$n(w.type):typeof y=="string"&&t.push(new ct(a,i.ref,`ref layer "${y}" not found`))}else if(g!=="background"&&g!=="sky")if(i.source){const w=u.sources&&u.sources[i.source],b=w&&$n(w.type);w?b==="vector"&&g==="raster"?t.push(new ct(a,i.source,`layer "${i.id}" requires a raster source`)):b==="raster"&&g!=="raster"?t.push(new ct(a,i.source,`layer "${i.id}" requires a vector source`)):b!=="vector"||i["source-layer"]?b==="raster-dem"&&g!=="hillshade"?t.push(new ct(a,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):g!=="line"||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||b==="geojson"&&w.lineMetrics||t.push(new ct(a,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ct(a,i,`layer "${i.id}" must specify a "source-layer"`)):t.push(new ct(a,i.source,`source "${i.source}" not found`))}else t.push(new ct(a,i,'missing required property "source"'));return t=t.concat(Di({key:a,value:i,valueSpec:p.layer,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{"*":()=>[],type:()=>kr({key:`${a}.type`,value:i.type,valueSpec:p.layer.type,style:r.style,styleSpec:r.styleSpec,object:i,objectKey:"type"}),filter:w=>Vl(bo({layerType:g},w)),layout:w=>Di({layer:i,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":b=>ad(bo({layerType:g},b))}}),paint:w=>Di({layer:i,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":b=>Bf(bo({layerType:g},b))}})}})),t}function rs(r){const t=r.value,i=r.key,a=Zt(t);return a!=="string"?[new ct(i,t,`string expected, ${a} found`)]:[]}const Nf={promoteId:function({key:r,value:t}){if(Zt(t)==="string")return rs({key:r,value:t});{const i=[];for(const a in t)i.push(...rs({key:`${r}.${a}`,value:t[a]}));return i}}};function Uf(r){const t=r.value,i=r.key,a=r.styleSpec,u=r.style;if(!t.type)return[new ct(i,t,'"type" is required')];const p=$n(t.type);let g;switch(p){case"vector":case"raster":case"raster-dem":return g=Di({key:i,value:t,valueSpec:a[`source_${p.replace("-","_")}`],style:r.style,styleSpec:a,objectElementValidators:Nf}),g;case"geojson":if(g=Di({key:i,value:t,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Nf}),t.cluster)for(const y in t.clusterProperties){const[w,b]=t.clusterProperties[y],A=typeof w=="string"?[w,["accumulated"],["get",y]]:w;g.push(...pr({key:`${i}.${y}.map`,value:b,expressionContext:"cluster-map"})),g.push(...pr({key:`${i}.${y}.reduce`,value:A,expressionContext:"cluster-reduce"}))}return g;case"video":return Di({key:i,value:t,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return Di({key:i,value:t,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new ct(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Yc({key:`${i}.type`,value:t.type,valueSpec:{values:oy(a)},style:u,styleSpec:a})}}function oy(r){return r.source.reduce((t,i)=>{const a=r[i];return a.type.type==="enum"&&(t=t.concat(Object.keys(a.type.values))),t},[])}function jf(r){const t=r.value,i=r.styleSpec,a=i.light,u=r.style;let p=[];const g=Zt(t);if(t===void 0)return p;if(g!=="object")return p=p.concat([new ct("light",t,`object expected, ${g} found`)]),p;for(const y in t){const w=y.match(/^(.*)-transition$/);p=p.concat(w&&a[w[1]]&&a[w[1]].transition?kr({key:y,value:t[y],valueSpec:i.transition,style:u,styleSpec:i}):a[y]?kr({key:y,value:t[y],valueSpec:a[y],style:u,styleSpec:i}):[new ct(y,t[y],`unknown property "${y}"`)])}return p}function ld(r){const t=r.value,i=r.key,a=r.style,u=r.styleSpec,p=u.terrain;let g=[];const y=Zt(t);if(t===void 0)return g;if(y!=="object")return g=g.concat([new ct("terrain",t,`object expected, ${y} found`)]),g;for(const w in t){const b=w.match(/^(.*)-transition$/);g=g.concat(b&&p[b[1]]&&p[b[1]].transition?kr({key:w,value:t[w],valueSpec:u.transition,style:a,styleSpec:u}):p[w]?kr({key:w,value:t[w],valueSpec:p[w],style:a,styleSpec:u}):[new ct(w,t[w],`unknown property "${w}"`)])}if(t.source){const w=a.sources&&a.sources[t.source],b=w&&$n(w.type);w?b!=="raster-dem"&&g.push(new ct(i,t.source,`terrain cannot be used with a source of type ${String(b)}, it only be used with a "raster-dem" source type`)):g.push(new ct(i,t.source,`source "${t.source}" not found`))}else g.push(new ct(i,t,'terrain is missing required property "source"'));return g}function Vf(r){const t=r.value,i=r.style,a=r.styleSpec,u=a.fog;let p=[];const g=Zt(t);if(t===void 0)return p;if(g!=="object")return p=p.concat([new ct("fog",t,`object expected, ${g} found`)]),p;for(const y in t){const w=y.match(/^(.*)-transition$/);p=p.concat(w&&u[w[1]]&&u[w[1]].transition?kr({key:y,value:t[y],valueSpec:a.transition,style:i,styleSpec:a}):u[y]?kr({key:y,value:t[y],valueSpec:u[y],style:i,styleSpec:a}):[new ct(y,t[y],`unknown property "${y}"`)])}return p}const $f={"*":()=>[],array:Rf,boolean:function(r){const t=r.value,i=r.key,a=Zt(t);return a!=="boolean"?[new ct(i,t,`boolean expected, ${a} found`)]:[]},number:Nl,color:function(r){const t=r.key,i=r.value,a=Zt(i);return a!=="string"?[new ct(t,i,`color expected, ${a} found`)]:Ah(i)===null?[new ct(t,i,`color expected, "${i}" found`)]:[]},enum:Yc,filter:Vl,function:Ul,layer:Ff,object:Di,source:Uf,light:jf,terrain:ld,fog:Vf,string:rs,formatted:function(r){return rs(r).length===0?[]:pr(r)},resolvedImage:function(r){return rs(r).length===0?[]:pr(r)},projection:function(r){const t=r.value,i=r.styleSpec,a=i.projection,u=r.style;let p=[];const g=Zt(t);if(g==="object")for(const y in t)p=p.concat(kr({key:y,value:t[y],valueSpec:a[y],style:u,styleSpec:i}));else g!=="string"&&(p=p.concat([new ct("projection",t,`object or string expected, ${g} found`)]));return p}};function kr(r){const t=r.value,i=r.valueSpec,a=r.styleSpec;return i.expression&&Ol($n(t))?Ul(r):i.expression&&Ta(dr(t))?pr(r):i.type&&$f[i.type]?$f[i.type](r):Di(bo({},r,{valueSpec:i.type?a[i.type]:i}))}function sy(r){const t=r.value,i=r.key,a=rs(r);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new ct(i,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new ct(i,t,'"glyphs" url must include a "{range}" token'))),a}function Gf(r,t=Re){return yi(kr({key:"",value:r,valueSpec:t.$root,styleSpec:t,style:r,objectElementValidators:{glyphs:sy,"*":()=>[]}}))}const ay=r=>yi(Bf(r)),ly=r=>yi(ad(r));function yi(r){return r.slice().sort((t,i)=>t.line&&i.line?t.line-i.line:0)}function qf(r,t){let i=!1;if(t&&t.length)for(const a of t)r.fire(new wo(new Error(a.message))),i=!0;return i}var cy=ro,Oi=3;function ro(r,t,i){var a=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;var u=new Int32Array(this.arrayBuffer);r=u[0],this.d=(t=u[1])+2*(i=u[2]);for(var p=0;p=A[L+0]&&a>=A[L+1])?(g[M]=!0,p.push(b[M])):g[M]=!1}}},ro.prototype._forEachCell=function(r,t,i,a,u,p,g,y){for(var w=this._convertToCellCoord(r),b=this._convertToCellCoord(t),A=this._convertToCellCoord(i),I=this._convertToCellCoord(a),M=w;M<=A;M++)for(var L=b;L<=I;L++){var R=this.d*L+M;if((!y||y(this._convertFromCellCoord(M),this._convertFromCellCoord(L),this._convertFromCellCoord(M+1),this._convertFromCellCoord(L+1)))&&u.call(this,r,t,i,a,R,p,g,y))return}},ro.prototype._convertFromCellCoord=function(r){return(r-this.padding)/this.scale},ro.prototype._convertToCellCoord=function(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))},ro.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var r=this.cells,t=Oi+this.cells.length+1+1,i=0,a=0;a=0||(u[p]=Ia(r[p],t)));r instanceof Error&&(u.message=r.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(u.$name=a),u}throw new Error("can't serialize object of type "+typeof r)}function Os(r){if(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||cd(r)||ud(r)||ArrayBuffer.isView(r)||r instanceof k.ImageData)return r;if(Array.isArray(r))return r.map(Os);if(typeof r=="object"){const t=r.$name||"Object",{klass:i}=tu[t];if(!i)throw new Error(`can't deserialize unregistered class ${t}`);if(i.deserialize)return i.deserialize(r);const a=Object.create(i.prototype);for(const u of Object.keys(r))u!=="$name"&&(a[u]=Os(r[u]));return a}throw new Error("can't deserialize object of type "+typeof r)}const at={"Latin-1 Supplement":r=>r>=128&&r<=255,Arabic:r=>r>=1536&&r<=1791,"Arabic Supplement":r=>r>=1872&&r<=1919,"Arabic Extended-A":r=>r>=2208&&r<=2303,"Hangul Jamo":r=>r>=4352&&r<=4607,"Unified Canadian Aboriginal Syllabics":r=>r>=5120&&r<=5759,Khmer:r=>r>=6016&&r<=6143,"Unified Canadian Aboriginal Syllabics Extended":r=>r>=6320&&r<=6399,"General Punctuation":r=>r>=8192&&r<=8303,"Letterlike Symbols":r=>r>=8448&&r<=8527,"Number Forms":r=>r>=8528&&r<=8591,"Miscellaneous Technical":r=>r>=8960&&r<=9215,"Control Pictures":r=>r>=9216&&r<=9279,"Optical Character Recognition":r=>r>=9280&&r<=9311,"Enclosed Alphanumerics":r=>r>=9312&&r<=9471,"Geometric Shapes":r=>r>=9632&&r<=9727,"Miscellaneous Symbols":r=>r>=9728&&r<=9983,"Miscellaneous Symbols and Arrows":r=>r>=11008&&r<=11263,"CJK Radicals Supplement":r=>r>=11904&&r<=12031,"Kangxi Radicals":r=>r>=12032&&r<=12255,"Ideographic Description Characters":r=>r>=12272&&r<=12287,"CJK Symbols and Punctuation":r=>r>=12288&&r<=12351,Hiragana:r=>r>=12352&&r<=12447,Katakana:r=>r>=12448&&r<=12543,Bopomofo:r=>r>=12544&&r<=12591,"Hangul Compatibility Jamo":r=>r>=12592&&r<=12687,Kanbun:r=>r>=12688&&r<=12703,"Bopomofo Extended":r=>r>=12704&&r<=12735,"CJK Strokes":r=>r>=12736&&r<=12783,"Katakana Phonetic Extensions":r=>r>=12784&&r<=12799,"Enclosed CJK Letters and Months":r=>r>=12800&&r<=13055,"CJK Compatibility":r=>r>=13056&&r<=13311,"CJK Unified Ideographs Extension A":r=>r>=13312&&r<=19903,"Yijing Hexagram Symbols":r=>r>=19904&&r<=19967,"CJK Unified Ideographs":r=>r>=19968&&r<=40959,"Yi Syllables":r=>r>=40960&&r<=42127,"Yi Radicals":r=>r>=42128&&r<=42191,"Hangul Jamo Extended-A":r=>r>=43360&&r<=43391,"Hangul Syllables":r=>r>=44032&&r<=55215,"Hangul Jamo Extended-B":r=>r>=55216&&r<=55295,"Private Use Area":r=>r>=57344&&r<=63743,"CJK Compatibility Ideographs":r=>r>=63744&&r<=64255,"Arabic Presentation Forms-A":r=>r>=64336&&r<=65023,"Vertical Forms":r=>r>=65040&&r<=65055,"CJK Compatibility Forms":r=>r>=65072&&r<=65103,"Small Form Variants":r=>r>=65104&&r<=65135,"Arabic Presentation Forms-B":r=>r>=65136&&r<=65279,"Halfwidth and Fullwidth Forms":r=>r>=65280&&r<=65519};function hd(r){for(const t of r)if(dd(t.charCodeAt(0)))return!0;return!1}function uy(r){for(const t of r)if(!Wf(t.charCodeAt(0)))return!1;return!0}function Wf(r){return!(at.Arabic(r)||at["Arabic Supplement"](r)||at["Arabic Extended-A"](r)||at["Arabic Presentation Forms-A"](r)||at["Arabic Presentation Forms-B"](r))}function dd(r){return!(r!==746&&r!==747&&(r<4352||!(at["Bopomofo Extended"](r)||at.Bopomofo(r)||at["CJK Compatibility Forms"](r)&&!(r>=65097&&r<=65103)||at["CJK Compatibility Ideographs"](r)||at["CJK Compatibility"](r)||at["CJK Radicals Supplement"](r)||at["CJK Strokes"](r)||!(!at["CJK Symbols and Punctuation"](r)||r>=12296&&r<=12305||r>=12308&&r<=12319||r===12336)||at["CJK Unified Ideographs Extension A"](r)||at["CJK Unified Ideographs"](r)||at["Enclosed CJK Letters and Months"](r)||at["Hangul Compatibility Jamo"](r)||at["Hangul Jamo Extended-A"](r)||at["Hangul Jamo Extended-B"](r)||at["Hangul Jamo"](r)||at["Hangul Syllables"](r)||at.Hiragana(r)||at["Ideographic Description Characters"](r)||at.Kanbun(r)||at["Kangxi Radicals"](r)||at["Katakana Phonetic Extensions"](r)||at.Katakana(r)&&r!==12540||!(!at["Halfwidth and Fullwidth Forms"](r)||r===65288||r===65289||r===65293||r>=65306&&r<=65310||r===65339||r===65341||r===65343||r>=65371&&r<=65503||r===65507||r>=65512&&r<=65519)||!(!at["Small Form Variants"](r)||r>=65112&&r<=65118||r>=65123&&r<=65126)||at["Unified Canadian Aboriginal Syllabics"](r)||at["Unified Canadian Aboriginal Syllabics Extended"](r)||at["Vertical Forms"](r)||at["Yijing Hexagram Symbols"](r)||at["Yi Syllables"](r)||at["Yi Radicals"](r))))}function Zf(r){return!(dd(r)||function(t){return!!(at["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||at["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||at["Letterlike Symbols"](t)||at["Number Forms"](t)||at["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||at["Control Pictures"](t)&&t!==9251||at["Optical Character Recognition"](t)||at["Enclosed Alphanumerics"](t)||at["Geometric Shapes"](t)||at["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||at["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||at["CJK Symbols and Punctuation"](t)||at.Katakana(t)||at["Private Use Area"](t)||at["CJK Compatibility Forms"](t)||at["Small Form Variants"](t)||at["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(r))}function Hf(r){return r>=1424&&r<=2303||at["Arabic Presentation Forms-A"](r)||at["Arabic Presentation Forms-B"](r)}function hy(r,t){return!(!t&&Hf(r)||r>=2304&&r<=3583||r>=3840&&r<=4255||at.Khmer(r))}function dy(r){for(const t of r)if(Hf(t.charCodeAt(0)))return!0;return!1}const pd="deferred",fd="loading",md="loaded";let ka=null,d="unavailable",o=null;const c=function(r){r&&typeof r=="string"&&r.indexOf("NetworkError")>-1&&(d="error"),ka&&ka(r)};function f(){_.fire(new Is("pluginStateChange",{pluginStatus:d,pluginURL:o}))}const _=new vl,x=function(){return d},T=function(){if(d!==pd||!o)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");d=fd,f(),o&&ua({url:o},r=>{r?c(r):(d=md,f())})},S={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>d===md||S.applyArabicShaping!=null,isLoading:()=>d===fd,setState(r){d=r.pluginStatus,o=r.pluginURL},isParsed:()=>S.applyArabicShaping!=null&&S.processBidirectionalText!=null&&S.processStyledBidirectionalText!=null,getPluginURL:()=>o};class C{constructor(t,i){this.zoom=t,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(t){return function(i,a){for(const u of i)if(!hy(u.charCodeAt(0),a))return!1;return!0}(t,S.isLoaded())}}class z{constructor(t,i){this.property=t,this.value=i,this.expression=function(a,u){if(Ol(a))return new Xc(a,u);if(Ta(a)){const p=Fl(a,u);if(p.result==="error")throw new Error(p.value.map(g=>`${g.key}: ${g.message}`).join(", "));return p.value}{let p=a;return typeof a=="string"&&u.type==="color"&&(p=Fn.parse(a)),{kind:"constant",evaluate:()=>p}}}(i===void 0?t.specification.default:i,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,i,a){return this.property.possiblyEvaluate(this,t,i,a)}}class P{constructor(t){this.property=t,this.value=new z(t,void 0)}transitioned(t,i){return new j(this.property,this.value,i,vn({},t.transition,this.transition),t.now)}untransitioned(){return new j(this.property,this.value,null,{},0)}}class O{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return Dr(this._values[t].value.value)}setValue(t,i){this._values.hasOwnProperty(t)||(this._values[t]=new P(this._values[t].property)),this._values[t].value=new z(this._values[t].property,i===null?void 0:Dr(i))}getTransition(t){return Dr(this._values[t].transition)}setTransition(t,i){this._values.hasOwnProperty(t)||(this._values[t]=new P(this._values[t].property)),this._values[t].transition=Dr(i)||void 0}serialize(){const t={};for(const i of Object.keys(this._values)){const a=this.getValue(i);a!==void 0&&(t[i]=a);const u=this.getTransition(i);u!==void 0&&(t[`${i}-transition`]=u)}return t}transitioned(t,i){const a=new W(this._properties);for(const u of Object.keys(this._values))a._values[u]=this._values[u].transitioned(t,i._values[u]);return a}untransitioned(){const t=new W(this._properties);for(const i of Object.keys(this._values))t._values[i]=this._values[i].untransitioned();return t}}class j{constructor(t,i,a,u,p){const g=u.delay||0,y=u.duration||0;p=p||0,this.property=t,this.value=i,this.begin=p+g,this.end=this.begin+y,t.specification.transition&&(u.delay||u.duration)&&(this.prior=a)}possiblyEvaluate(t,i,a){const u=t.now||0,p=this.value.possiblyEvaluate(t,i,a),g=this.prior;if(g){if(u>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(uthis.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function ye(r,t=1){let i=0,a=0;return{members:r.map(u=>{const p=fe[u.type].BYTES_PER_ELEMENT,g=i=Ae(i,Math.max(t,p)),y=u.components||1;return a=Math.max(a,p),i+=p*y,{name:u.name,type:u.type,components:y,offset:g}}),size:Ae(i,Math.max(a,t)),alignment:t}}function Ae(r,t){return Math.ceil(r/t)*t}class We extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.int16[u+0]=i,this.int16[u+1]=a,t}}We.prototype.bytesPerElement=4,dt(We,"StructArrayLayout2i4");class Ee extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.int16[p+0]=i,this.int16[p+1]=a,this.int16[p+2]=u,t}}Ee.prototype.bytesPerElement=6,dt(Ee,"StructArrayLayout3i6");class Fe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.int16[g+0]=i,this.int16[g+1]=a,this.int16[g+2]=u,this.int16[g+3]=p,t}}Fe.prototype.bytesPerElement=8,dt(Fe,"StructArrayLayout4i8");class ke extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y){const w=this.length;return this.resize(w+1),this.emplace(w,t,i,a,u,p,g,y)}emplace(t,i,a,u,p,g,y,w){const b=6*t,A=12*t,I=3*t;return this.int16[b+0]=i,this.int16[b+1]=a,this.uint8[A+4]=u,this.uint8[A+5]=p,this.uint8[A+6]=g,this.uint8[A+7]=y,this.float32[I+2]=w,t}}ke.prototype.bytesPerElement=12,dt(ke,"StructArrayLayout2i4ub1f12");class qe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.float32[g+0]=i,this.float32[g+1]=a,this.float32[g+2]=u,this.float32[g+3]=p,t}}qe.prototype.bytesPerElement=16,dt(qe,"StructArrayLayout4f16");class Se extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=6*t,w=3*t;return this.uint16[y+0]=i,this.uint16[y+1]=a,this.uint16[y+2]=u,this.uint16[y+3]=p,this.float32[w+2]=g,t}}Se.prototype.bytesPerElement=12,dt(Se,"StructArrayLayout4ui1f12");class Be extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.uint16[g+0]=i,this.uint16[g+1]=a,this.uint16[g+2]=u,this.uint16[g+3]=p,t}}Be.prototype.bytesPerElement=8,dt(Be,"StructArrayLayout4ui8");class Xe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,i,a,u,p,g)}emplace(t,i,a,u,p,g,y){const w=6*t;return this.int16[w+0]=i,this.int16[w+1]=a,this.int16[w+2]=u,this.int16[w+3]=p,this.int16[w+4]=g,this.int16[w+5]=y,t}}Xe.prototype.bytesPerElement=12,dt(Xe,"StructArrayLayout6i12");class $e extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M){const L=this.length;return this.resize(L+1),this.emplace(L,t,i,a,u,p,g,y,w,b,A,I,M)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L){const R=12*t;return this.int16[R+0]=i,this.int16[R+1]=a,this.int16[R+2]=u,this.int16[R+3]=p,this.uint16[R+4]=g,this.uint16[R+5]=y,this.uint16[R+6]=w,this.uint16[R+7]=b,this.int16[R+8]=A,this.int16[R+9]=I,this.int16[R+10]=M,this.int16[R+11]=L,t}}$e.prototype.bytesPerElement=24,dt($e,"StructArrayLayout4i4ui4i24");class Ye extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,i,a,u,p,g)}emplace(t,i,a,u,p,g,y){const w=10*t,b=5*t;return this.int16[w+0]=i,this.int16[w+1]=a,this.int16[w+2]=u,this.float32[b+2]=p,this.float32[b+3]=g,this.float32[b+4]=y,t}}Ye.prototype.bytesPerElement=20,dt(Ye,"StructArrayLayout3i3f20");class gt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint32[1*t+0]=i,t}}gt.prototype.bytesPerElement=4,dt(gt,"StructArrayLayout1ul4");class Et extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L){const R=this.length;return this.resize(R+1),this.emplace(R,t,i,a,u,p,g,y,w,b,A,I,M,L)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=20*t,$=10*t;return this.int16[F+0]=i,this.int16[F+1]=a,this.int16[F+2]=u,this.int16[F+3]=p,this.int16[F+4]=g,this.float32[$+3]=y,this.float32[$+4]=w,this.float32[$+5]=b,this.float32[$+6]=A,this.int16[F+14]=I,this.uint32[$+8]=M,this.uint16[F+18]=L,this.uint16[F+19]=R,t}}Et.prototype.bytesPerElement=40,dt(Et,"StructArrayLayout5i4f1i1ul2ui40");class pt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y){const w=this.length;return this.resize(w+1),this.emplace(w,t,i,a,u,p,g,y)}emplace(t,i,a,u,p,g,y,w){const b=8*t;return this.int16[b+0]=i,this.int16[b+1]=a,this.int16[b+2]=u,this.int16[b+4]=p,this.int16[b+5]=g,this.int16[b+6]=y,this.int16[b+7]=w,t}}pt.prototype.bytesPerElement=16,dt(pt,"StructArrayLayout3i2i2i16");class wt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=4*t,w=8*t;return this.float32[y+0]=i,this.float32[y+1]=a,this.float32[y+2]=u,this.int16[w+6]=p,this.int16[w+7]=g,t}}wt.prototype.bytesPerElement=16,dt(wt,"StructArrayLayout2f1f2i16");class Ut extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=12*t,y=3*t;return this.uint8[g+0]=i,this.uint8[g+1]=a,this.float32[y+1]=u,this.float32[y+2]=p,t}}Ut.prototype.bytesPerElement=12,dt(Ut,"StructArrayLayout2ub2f12");class Ot extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.float32[p+0]=i,this.float32[p+1]=a,this.float32[p+2]=u,t}}Ot.prototype.bytesPerElement=12,dt(Ot,"StructArrayLayout3f12");class mt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.uint16[p+0]=i,this.uint16[p+1]=a,this.uint16[p+2]=u,t}}mt.prototype.bytesPerElement=6,dt(mt,"StructArrayLayout3ui6");class en extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue){const ce=this.length;return this.resize(ce+1),this.emplace(ce,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce){const Ie=30*t,Te=15*t,De=60*t;return this.int16[Ie+0]=i,this.int16[Ie+1]=a,this.int16[Ie+2]=u,this.float32[Te+2]=p,this.float32[Te+3]=g,this.uint16[Ie+8]=y,this.uint16[Ie+9]=w,this.uint32[Te+5]=b,this.uint32[Te+6]=A,this.uint32[Te+7]=I,this.uint16[Ie+16]=M,this.uint16[Ie+17]=L,this.uint16[Ie+18]=R,this.float32[Te+10]=F,this.float32[Te+11]=$,this.uint8[De+48]=K,this.uint8[De+49]=se,this.uint8[De+50]=Y,this.uint32[Te+13]=re,this.int16[Ie+28]=ue,this.uint8[De+58]=ce,t}}en.prototype.bytesPerElement=60,dt(en,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class rn extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge){const et=this.length;return this.resize(et+1),this.emplace(et,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge,et){const Le=38*t,ot=19*t;return this.int16[Le+0]=i,this.int16[Le+1]=a,this.int16[Le+2]=u,this.float32[ot+2]=p,this.float32[ot+3]=g,this.int16[Le+8]=y,this.int16[Le+9]=w,this.int16[Le+10]=b,this.int16[Le+11]=A,this.int16[Le+12]=I,this.int16[Le+13]=M,this.uint16[Le+14]=L,this.uint16[Le+15]=R,this.uint16[Le+16]=F,this.uint16[Le+17]=$,this.uint16[Le+18]=K,this.uint16[Le+19]=se,this.uint16[Le+20]=Y,this.uint16[Le+21]=re,this.uint16[Le+22]=ue,this.uint16[Le+23]=ce,this.uint16[Le+24]=Ie,this.uint16[Le+25]=Te,this.uint16[Le+26]=De,this.uint16[Le+27]=Ze,this.uint16[Le+28]=Me,this.uint32[ot+15]=Ue,this.float32[ot+16]=je,this.float32[ot+17]=Ge,this.float32[ot+18]=et,t}}rn.prototype.bytesPerElement=76,dt(rn,"StructArrayLayout3i2f6i15ui1ul3f76");class on extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.float32[1*t+0]=i,t}}on.prototype.bytesPerElement=4,dt(on,"StructArrayLayout1f4");class sn extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=5*t;return this.float32[y+0]=i,this.float32[y+1]=a,this.float32[y+2]=u,this.float32[y+3]=p,this.float32[y+4]=g,t}}sn.prototype.bytesPerElement=20,dt(sn,"StructArrayLayout5f20");class Mr extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=6*t;return this.uint32[3*t+0]=i,this.uint16[g+2]=a,this.uint16[g+3]=u,this.uint16[g+4]=p,t}}Mr.prototype.bytesPerElement=12,dt(Mr,"StructArrayLayout1ul3ui12");class fr extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.uint16[u+0]=i,this.uint16[u+1]=a,t}}fr.prototype.bytesPerElement=4,dt(fr,"StructArrayLayout2ui4");class vi extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint16[1*t+0]=i,t}}vi.prototype.bytesPerElement=2,dt(vi,"StructArrayLayout1ui2");class io extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.float32[u+0]=i,this.float32[u+1]=a,t}}io.prototype.bytesPerElement=8,dt(io,"StructArrayLayout2f8");class An extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}An.prototype.size=40;class an extends Et{get(t){return new An(this,t)}}dt(an,"CollisionBoxArray");class Xt extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(t){this._structArray.uint8[this._pos1+49]=t}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(t){this._structArray.uint8[this._pos1+50]=t}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(t){this._structArray.uint32[this._pos4+13]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(t){this._structArray.uint8[this._pos1+58]=t}}Xt.prototype.size=60;class Gn extends en{get(t){return new Xt(this,t)}}dt(Gn,"PlacedSymbolArray");class Br extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(t){this._structArray.uint32[this._pos4+15]=t}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Br.prototype.size=76;class En extends rn{get(t){return new Br(this,t)}}dt(En,"SymbolInstanceArray");class Wr extends on{getoffsetX(t){return this.float32[1*t+0]}}dt(Wr,"GlyphOffsetArray");class nu extends We{getx(t){return this.int16[2*t+0]}gety(t){return this.int16[2*t+1]}}dt(nu,"SymbolLineVertexArray");class Bs extends pe{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Bs.prototype.size=12;class Gl extends Mr{get(t){return new Bs(this,t)}}dt(Gl,"FeatureIndexArray");class Mo extends fr{geta_centroid_pos0(t){return this.uint16[2*t+0]}geta_centroid_pos1(t){return this.uint16[2*t+1]}}dt(Mo,"FillExtrusionCentroidArray");const is=ye([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Fs=ye([{name:"a_dash",components:4,type:"Uint16"}]);var ru={exports:{}},ql={exports:{}};ql.exports=function(r,t){var i,a,u,p,g,y,w,b;for(a=r.length-(i=3&r.length),u=t,g=3432918353,y=461845907,b=0;b>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*y+(((w>>>16)*y&65535)<<16)&4294967295)<<13|u>>>19))+((5*(u>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(w=0,i){case 3:w^=(255&r.charCodeAt(b+2))<<16;case 2:w^=(255&r.charCodeAt(b+1))<<8;case 1:u^=w=(65535&(w=(w=(65535&(w^=255&r.charCodeAt(b)))*g+(((w>>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*y+(((w>>>16)*y&65535)<<16)&4294967295}return u^=r.length,u=2246822507*(65535&(u^=u>>>16))+((2246822507*(u>>>16)&65535)<<16)&4294967295,u=3266489909*(65535&(u^=u>>>13))+((3266489909*(u>>>16)&65535)<<16)&4294967295,(u^=u>>>16)>>>0};var gd=ql.exports,$x={exports:{}};$x.exports=function(r,t){for(var i,a=r.length,u=t^a,p=0;a>=4;)i=1540483477*(65535&(i=255&r.charCodeAt(p)|(255&r.charCodeAt(++p))<<8|(255&r.charCodeAt(++p))<<16|(255&r.charCodeAt(++p))<<24))+((1540483477*(i>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),a-=4,++p;switch(a){case 3:u^=(255&r.charCodeAt(p+2))<<16;case 2:u^=(255&r.charCodeAt(p+1))<<8;case 1:u=1540483477*(65535&(u^=255&r.charCodeAt(p)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0};var Gx=gd,ok=$x.exports;ru.exports=Gx,ru.exports.murmur3=Gx,ru.exports.murmur2=ok;var py=le(ru.exports);class Xf{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,i,a,u){this.ids.push(qx(t)),this.positions.push(i,a,u)}getPositions(t){const i=qx(t);let a=0,u=this.ids.length-1;for(;a>1;this.ids[g]>=i?u=g:a=g+1}const p=[];for(;this.ids[a]===i;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(t,i){const a=new Float64Array(t.ids),u=new Uint32Array(t.positions);return fy(a,u,0,a.length-1),i&&i.push(a.buffer,u.buffer),{ids:a,positions:u}}static deserialize(t){const i=new Xf;return i.ids=t.ids,i.positions=t.positions,i.indexed=!0,i}}function qx(r){const t=+r;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:py(String(r))}function fy(r,t,i,a){for(;i>1];let p=i-1,g=a+1;for(;;){do p++;while(r[p]u);if(p>=g)break;Kf(r,p,g),Kf(t,3*p,3*g),Kf(t,3*p+1,3*g+1),Kf(t,3*p+2,3*g+2)}g-i`u_${u}`),this.type=a}setUniform(t,i,a,u,p){i.set(t,p,u.constantOr(this.value))}getBinding(t,i){return this.type==="color"?new Zx(t):new Yf(t)}}class iu{constructor(t,i){this.uniformNames=i.map(a=>`u_${a}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(t){this.pixelRatio=t.pixelRatio||1,this.pattern=t.tl.concat(t.br)}setUniform(t,i,a,u,p){const g=p==="u_pattern"||p==="u_dash"?this.pattern:p==="u_pixel_ratio"?this.pixelRatio:null;g&&i.set(t,p,g)}getBinding(t,i){return i==="u_pattern"||i==="u_dash"?new Wx(t):new Yf(t)}}class Us{constructor(t,i,a,u){this.expression=t,this.type=a,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new u}populatePaintArray(t,i,a,u,p,g){const y=this.paintVertexArray.length,w=this.expression.evaluate(new C(0),i,{},p,u,g);this.paintVertexArray.resize(t),this._setPaintValue(y,t,w)}updatePaintArray(t,i,a,u,p){const g=this.expression.evaluate({zoom:0},a,u,void 0,p);this._setPaintValue(t,i,g)}_setPaintValue(t,i,a){if(this.type==="color"){const u=my(a);for(let p=t;p`u_${y}_t`),this.type=a,this.useIntegerZoom=u,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=i.map(y=>({name:`a_${y}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new g}populatePaintArray(t,i,a,u,p,g){const y=this.expression.evaluate(new C(this.zoom),i,{},p,u,g),w=this.expression.evaluate(new C(this.zoom+1),i,{},p,u,g),b=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(b,t,y,w)}updatePaintArray(t,i,a,u,p){const g=this.expression.evaluate({zoom:this.zoom},a,u,void 0,p),y=this.expression.evaluate({zoom:this.zoom+1},a,u,void 0,p);this._setPaintValue(t,i,g,y)}_setPaintValue(t,i,a,u){if(this.type==="color"){const p=my(a),g=my(u);for(let y=t;y!0){this.binders={},this._buffers=[];const u=[];for(const p in t.paint._values){if(!a(p))continue;const g=t.paint.get(p);if(!(g instanceof Z&&ba(g.property.specification)))continue;const y=uk(p,t.type),w=g.value,b=g.property.specification.type,A=!!g.property.useIntegerZoom,I=p==="line-dasharray"||p.endsWith("pattern"),M=p==="line-dasharray"&&t.layout.get("line-cap").value.kind!=="constant";if(w.kind!=="constant"||M)if(w.kind==="source"||M||I){const L=Hx(p,b,"source");this.binders[p]=I?new Ma(w,y,b,L,t.id):new Us(w,y,b,L),u.push(`/a_${p}`)}else{const L=Hx(p,b,"composite");this.binders[p]=new Po(w,y,b,A,i,L),u.push(`/z_${p}`)}else this.binders[p]=I?new iu(w.value,y):new _d(w.value,y,b),u.push(`/u_${p}`)}this.cacheKey=u.sort().join("")}getMaxValue(t){const i=this.binders[t];return i instanceof Us||i instanceof Po?i.maxValue:0}populatePaintArrays(t,i,a,u,p,g){for(const y in this.binders){const w=this.binders[y];(w instanceof Us||w instanceof Po||w instanceof Ma)&&w.populatePaintArray(t,i,a,u,p,g)}}setConstantPatternPositions(t){for(const i in this.binders){const a=this.binders[i];a instanceof iu&&a.setConstantPatternPositions(t)}}updatePaintArrays(t,i,a,u,p,g){let y=!1;for(const w in t){const b=i.getPositions(w);for(const A of b){const I=a.feature(A.index);for(const M in this.binders){const L=this.binders[M];if((L instanceof Us||L instanceof Po||L instanceof Ma)&&L.expression.isStateDependent===!0){const R=u.paint.get(M);L.expression=R.value,L.updatePaintArray(A.start,A.end,I,t[w],p,g),y=!0}}}}return y}defines(){const t=[];for(const i in this.binders){const a=this.binders[i];(a instanceof _d||a instanceof iu)&&t.push(...a.uniformNames.map(u=>`#define HAS_UNIFORM_${u}`))}return t}getBinderAttributes(){const t=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof Us||a instanceof Po||a instanceof Ma)for(let u=0;u!0){this.programConfigurations={};for(const u of t)this.programConfigurations[u.id]=new Pa(u,i,a);this.needsUpload=!1,this._featureMap=new Xf,this._bufferOffset=0}populatePaintArrays(t,i,a,u,p,g,y){for(const w in this.programConfigurations)this.programConfigurations[w].populatePaintArrays(t,i,u,p,g,y);i.id!==void 0&&this._featureMap.add(i.id,a,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,i,a,u,p){for(const g of a)this.needsUpload=this.programConfigurations[g.id].updatePaintArrays(t,this._featureMap,i,g,u,p)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}const ck={"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","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function uk(r,t){return ck[r]||[r.replace(`${t}-`,"").replace(/-/g,"_")]}const hk={"line-pattern":{source:Se,composite:Se},"fill-pattern":{source:Se,composite:Se},"fill-extrusion-pattern":{source:Se,composite:Se},"line-dasharray":{source:Be,composite:Be}},dk={color:{source:io,composite:qe},number:{source:on,composite:io}};function Hx(r,t,i){const a=hk[r];return a&&a[i]||dk[t][i]}dt(_d,"ConstantBinder"),dt(iu,"PatternConstantBinder"),dt(Us,"SourceExpressionBinder"),dt(Ma,"PatternCompositeBinder"),dt(Po,"CompositeExpressionBinder"),dt(Pa,"ProgramConfiguration",{omit:["_buffers"]}),dt(Wl,"ProgramConfigurationSet");const Xx="-transition";class zo extends vl{constructor(t,i){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&t.type!=="sky"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),i.layout&&(this._unevaluatedLayout=new H(i.layout)),i.paint)){this._transitionablePaint=new O(i.paint);for(const a in t.paint)this.setPaintProperty(a,t.paint[a],{validate:!1});for(const a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new X(i.paint)}}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,i,a={}){i!=null&&this._validate(ly,`layers.${this.id}.layout.${t}`,t,i,a)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,i):this.visibility=i)}getPaintProperty(t){return xn(t,Xx)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,i,a={}){if(i!=null&&this._validate(ay,`layers.${this.id}.paint.${t}`,t,i,a))return!1;if(xn(t,Xx))return this._transitionablePaint.setTransition(t.slice(0,-11),i||void 0),!1;{const u=this._transitionablePaint._values[t],p=u.value.isDataDriven(),g=u.value;this._transitionablePaint.setValue(t,i),this._handleSpecialPaintPropertyUpdate(t);const y=this._transitionablePaint._values[t].value,w=y.isDataDriven(),b=xn(t,"pattern")||t==="line-dasharray";return w||p||b||this._handleOverridablePaintPropertyUpdate(t,g,y)}}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getProgramConfiguration(t){return null}_handleOverridablePaintPropertyUpdate(t,i,a){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,i)}serialize(){const t={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&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),Yo(t,(i,a)=>!(i===void 0||a==="layout"&&!Object.keys(i).length||a==="paint"&&!Object.keys(i).length))}_validate(t,i,a,u,p={}){return(!p||p.validate!==!1)&&qf(this,t.call(Gf,{key:i,layerType:this.type,objectKey:a,value:u,styleSpec:Re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const i=this.paint.get(t);if(i instanceof Z&&ba(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Jc(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const pk=ye([{name:"a_pos",components:2,type:"Int16"}],4),fk=ye([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class qn{constructor(t=[]){this.segments=t}prepareSegment(t,i,a,u){let p=this.segments[this.segments.length-1];return t>qn.MAX_VERTEX_ARRAY_LENGTH&&wn(`Max vertices per segment is ${qn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!p||p.vertexLength+t>qn.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==u)&&(p={vertexOffset:i.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},u!==void 0&&(p.sortKey=u),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const t of this.segments)for(const i in t.vaos)t.vaos[i].destroy()}static simpleSegment(t,i,a,u){return new qn([{vertexOffset:t,primitiveOffset:i,vertexLength:a,primitiveLength:u,vaos:{},sortKey:0}])}}qn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dt(qn,"SegmentVector");var vt=8192;class za{constructor(t,i){t&&(i?this.setSouthWest(t).setNorthEast(i):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 ln?new ln(t.lng,t.lat):ln.convert(t),this}setSouthWest(t){return this._sw=t instanceof ln?new ln(t.lng,t.lat):ln.convert(t),this}extend(t){const i=this._sw,a=this._ne;let u,p;if(t instanceof ln)u=t,p=t;else{if(!(t instanceof za))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(za.convert(t)):this.extend(ln.convert(t)):typeof t=="object"&&t!==null&&t.hasOwnProperty("lat")&&(t.hasOwnProperty("lon")||t.hasOwnProperty("lng"))?this.extend(ln.convert(t)):this;if(u=t._sw,p=t._ne,!u||!p)return this}return i||a?(i.lng=Math.min(u.lng,i.lng),i.lat=Math.min(u.lat,i.lat),a.lng=Math.max(p.lng,a.lng),a.lat=Math.max(p.lat,a.lat)):(this._sw=new ln(u.lng,u.lat),this._ne=new ln(p.lng,p.lat)),this}getCenter(){return new ln((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 ln(this.getWest(),this.getNorth())}getSouthEast(){return new ln(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:i,lat:a}=ln.convert(t);let u=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&u}static convert(t){return!t||t instanceof za?t:new za(t)}}var Jf=1e-6,xi=typeof Float32Array<"u"?Float32Array:Array;function Kx(){var r=new xi(9);return xi!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function Yx(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=i[0],L=i[1],R=i[2],F=i[3],$=i[4],K=i[5],se=i[6],Y=i[7],re=i[8];return r[0]=M*a+L*g+R*b,r[1]=M*u+L*y+R*A,r[2]=M*p+L*w+R*I,r[3]=F*a+$*g+K*b,r[4]=F*u+$*y+K*A,r[5]=F*p+$*w+K*I,r[6]=se*a+Y*g+re*b,r[7]=se*u+Y*y+re*A,r[8]=se*p+Y*w+re*I,r}function Lo(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function gy(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=t[4],y=t[5],w=t[6],b=t[7],A=t[8],I=t[9],M=t[10],L=t[11],R=t[12],F=t[13],$=t[14],K=t[15],se=i*y-a*g,Y=i*w-u*g,re=i*b-p*g,ue=a*w-u*y,ce=a*b-p*y,Ie=u*b-p*w,Te=A*F-I*R,De=A*$-M*R,Ze=A*K-L*R,Me=I*$-M*F,Ue=I*K-L*F,je=M*K-L*$,Ge=se*je-Y*Ue+re*Me+ue*Ze-ce*De+Ie*Te;return Ge?(r[0]=(y*je-w*Ue+b*Me)*(Ge=1/Ge),r[1]=(u*Ue-a*je-p*Me)*Ge,r[2]=(F*Ie-$*ce+K*ue)*Ge,r[3]=(M*ce-I*Ie-L*ue)*Ge,r[4]=(w*Ze-g*je-b*De)*Ge,r[5]=(i*je-u*Ze+p*De)*Ge,r[6]=($*re-R*Ie-K*Y)*Ge,r[7]=(A*Ie-M*re+L*Y)*Ge,r[8]=(g*Ue-y*Ze+b*Te)*Ge,r[9]=(a*Ze-i*Ue-p*Te)*Ge,r[10]=(R*ce-F*re+K*se)*Ge,r[11]=(I*re-A*ce-L*se)*Ge,r[12]=(y*De-g*Me-w*Te)*Ge,r[13]=(i*Me-a*De+u*Te)*Ge,r[14]=(F*Y-R*ue-$*se)*Ge,r[15]=(A*ue-I*Y+M*se)*Ge,r):null}function Zl(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=t[9],L=t[10],R=t[11],F=t[12],$=t[13],K=t[14],se=t[15],Y=i[0],re=i[1],ue=i[2],ce=i[3];return r[0]=Y*a+re*y+ue*I+ce*F,r[1]=Y*u+re*w+ue*M+ce*$,r[2]=Y*p+re*b+ue*L+ce*K,r[3]=Y*g+re*A+ue*R+ce*se,r[4]=(Y=i[4])*a+(re=i[5])*y+(ue=i[6])*I+(ce=i[7])*F,r[5]=Y*u+re*w+ue*M+ce*$,r[6]=Y*p+re*b+ue*L+ce*K,r[7]=Y*g+re*A+ue*R+ce*se,r[8]=(Y=i[8])*a+(re=i[9])*y+(ue=i[10])*I+(ce=i[11])*F,r[9]=Y*u+re*w+ue*M+ce*$,r[10]=Y*p+re*b+ue*L+ce*K,r[11]=Y*g+re*A+ue*R+ce*se,r[12]=(Y=i[12])*a+(re=i[13])*y+(ue=i[14])*I+(ce=i[15])*F,r[13]=Y*u+re*w+ue*M+ce*$,r[14]=Y*p+re*b+ue*L+ce*K,r[15]=Y*g+re*A+ue*R+ce*se,r}function yd(r,t,i){var a,u,p,g,y,w,b,A,I,M,L,R,F=i[0],$=i[1],K=i[2];return t===r?(r[12]=t[0]*F+t[4]*$+t[8]*K+t[12],r[13]=t[1]*F+t[5]*$+t[9]*K+t[13],r[14]=t[2]*F+t[6]*$+t[10]*K+t[14],r[15]=t[3]*F+t[7]*$+t[11]*K+t[15]):(u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=t[9],L=t[10],R=t[11],r[0]=a=t[0],r[1]=u,r[2]=p,r[3]=g,r[4]=y,r[5]=w,r[6]=b,r[7]=A,r[8]=I,r[9]=M,r[10]=L,r[11]=R,r[12]=a*F+y*$+I*K+t[12],r[13]=u*F+w*$+M*K+t[13],r[14]=p*F+b*$+L*K+t[14],r[15]=g*F+A*$+R*K+t[15]),r}function Hl(r,t,i){var a=i[0],u=i[1],p=i[2];return r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r[3]=t[3]*a,r[4]=t[4]*u,r[5]=t[5]*u,r[6]=t[6]*u,r[7]=t[7]*u,r[8]=t[8]*p,r[9]=t[9]*p,r[10]=t[10]*p,r[11]=t[11]*p,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function _y(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[4],g=t[5],y=t[6],w=t[7],b=t[8],A=t[9],I=t[10],M=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=p*u+b*a,r[5]=g*u+A*a,r[6]=y*u+I*a,r[7]=w*u+M*a,r[8]=b*u-p*a,r[9]=A*u-g*a,r[10]=I*u-y*a,r[11]=M*u-w*a,r}function Qf(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[0],g=t[1],y=t[2],w=t[3],b=t[8],A=t[9],I=t[10],M=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=p*u-b*a,r[1]=g*u-A*a,r[2]=y*u-I*a,r[3]=w*u-M*a,r[8]=p*a+b*u,r[9]=g*a+A*u,r[10]=y*a+I*u,r[11]=w*a+M*u,r}function Jx(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Qx(r,t,i){var a,u,p,g=i[0],y=i[1],w=i[2],b=Math.hypot(g,y,w);return b0&&(p=1/Math.sqrt(p)),r[0]=t[0]*p,r[1]=t[1]*p,r[2]=t[2]*p,r}function oo(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function xy(r,t,i){var a=t[0],u=t[1],p=t[2],g=i[0],y=i[1],w=i[2];return r[0]=u*w-p*y,r[1]=p*g-a*w,r[2]=a*y-u*g,r}function Nn(r,t,i){var a=t[0],u=t[1],p=t[2],g=i[3]*a+i[7]*u+i[11]*p+i[15];return r[0]=(i[0]*a+i[4]*u+i[8]*p+i[12])/(g=g||1),r[1]=(i[1]*a+i[5]*u+i[9]*p+i[13])/g,r[2]=(i[2]*a+i[6]*u+i[10]*p+i[14])/g,r}function nw(r,t,i){var a=i[0],u=i[1],p=i[2],g=t[0],y=t[1],w=t[2],b=u*w-p*y,A=p*g-a*w,I=a*y-u*g,M=u*I-p*A,L=p*b-a*I,R=a*A-u*b,F=2*i[3];return A*=F,I*=F,L*=2,R*=2,r[0]=g+(b*=F)+(M*=2),r[1]=y+A+L,r[2]=w+I+R,r}var Ed,Ro=vy,gk=tw,_k=vd;function rw(r,t,i){return r[0]=t[0]*i,r[1]=t[1]*i,r[2]=t[2]*i,r[3]=t[3]*i,r}function iw(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=i*i+a*a+u*u+p*p;return g>0&&(g=1/Math.sqrt(g)),r[0]=i*g,r[1]=a*g,r[2]=u*g,r[3]=p*g,r}function Xl(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3];return r[0]=i[0]*a+i[4]*u+i[8]*p+i[12]*g,r[1]=i[1]*a+i[5]*u+i[9]*p+i[13]*g,r[2]=i[2]*a+i[6]*u+i[10]*p+i[14]*g,r[3]=i[3]*a+i[7]*u+i[11]*p+i[15]*g,r}function ow(){var r=new xi(4);return xi!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function sw(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function aw(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w+g*y,r[1]=u*w+p*y,r[2]=p*w-u*y,r[3]=g*w-a*y,r}function lw(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w-p*y,r[1]=u*w+g*y,r[2]=p*w+a*y,r[3]=g*w-u*y,r}yy(),Ed=new xi(4),xi!=Float32Array&&(Ed[0]=0,Ed[1]=0,Ed[2]=0,Ed[3]=0);var yk=iw;yy(),ou(1,0,0),ou(0,1,0),ow(),ow(),Kx();const vk=ye([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:cw}=vk,uw=ye([{name:"a_pos_3",components:3,type:"Int16"}]);var Td=ye([{name:"a_pos",type:"Int16",components:2}]);class wy{constructor(t,i){this.pos=t,this.dir=i}intersectsPlane(t,i,a){const u=oo(i,this.dir);if(Math.abs(u)<1e-6)return!1;const p=((t[0]-this.pos[0])*i[0]+(t[1]-this.pos[1])*i[1]+(t[2]-this.pos[2])*i[2])/u;return a[0]=this.pos[0]+this.dir[0]*p,a[1]=this.pos[1]+this.dir[1]*p,a[2]=this.pos[2]+this.dir[2]*p,!0}closestPointOnSphere(t,i,a){if(function(L,R){var F=L[0],$=L[1],K=L[2],se=R[0],Y=R[1],re=R[2];return Math.abs(F-se)<=Jf*Math.max(1,Math.abs(F),Math.abs(se))&&Math.abs($-Y)<=Jf*Math.max(1,Math.abs($),Math.abs(Y))&&Math.abs(K-re)<=Jf*Math.max(1,Math.abs(K),Math.abs(re))}(this.pos,t)||i===0)return a[0]=a[1]=a[2]=0,!1;const[u,p,g]=this.dir,y=this.pos[0]-t[0],w=this.pos[1]-t[1],b=this.pos[2]-t[2],A=u*u+p*p+g*g,I=2*(y*u+w*p+b*g),M=I*I-4*A*(y*y+w*w+b*b-i*i);if(M<0){const L=Math.max(-I/2,0),R=y+u*L,F=w+p*L,$=b+g*L,K=Math.hypot(R,F,$);return a[0]=R*i/K,a[1]=F*i/K,a[2]=$*i/K,!1}{const L=(-I-Math.sqrt(M))/(2*A);if(L<0){const R=Math.hypot(y,w,b);return a[0]=y*i/R,a[1]=w*i/R,a[2]=b*i/R,!1}return a[0]=y+u*L,a[1]=w+p*L,a[2]=b+g*L,!0}}}class by{constructor(t,i,a,u,p){this.TL=t,this.TR=i,this.BR=a,this.BL=u,this.horizon=p}static fromInvProjectionMatrix(t,i,a){const u=[-1,1,1],p=[1,1,1],g=[1,-1,1],y=[-1,-1,1],w=Nn(u,u,t),b=Nn(p,p,t),A=Nn(g,g,t),I=Nn(y,y,t);return new by(w,b,A,I,i/a)}}class Ey{constructor(t,i){this.points=t,this.planes=i}static fromInvProjectionMatrix(t,i,a,u){const p=Math.pow(2,a),g=[[-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(w=>{const b=Xl([],w,t),A=1/b[3]/i*p;return function(I,M,L){return I[0]=M[0]*L[0],I[1]=M[1]*L[1],I[2]=M[2]*L[2],I[3]=M[3]*L[3],I}(b,b,[A,A,u?1/b[3]:A,A])}),y=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(w=>{const b=Zr([],xy([],Ro([],g[w[0]],g[w[1]]),Ro([],g[w[2]],g[w[1]]))),A=-oo(b,g[w[1]]);return b.concat(A)});return new Ey(g,y)}}class Hr{static fromPoints(t){const i=[1/0,1/0,1/0],a=[-1/0,-1/0,-1/0];for(const u of t)xd(i,i,u),wd(a,a,u);return new Hr(i,a)}static applyTransform(t,i){const a=t.getCorners();for(let u=0;u=0;if(g===0)return 0;g!==i.length&&(a=!1)}if(a)return 2;for(let u=0;u<3;u++){let p=Number.MAX_VALUE,g=-Number.MAX_VALUE;for(let y=0;ythis.max[u]-this.min[u])return 0}return 1}}const Ty=5,hw=6,os=vt/Math.PI/2,xk=16383,Kl=64,Sd=[Kl,32,16],so=-os,ao=os,wk=[new Hr([so,so,so],[ao,ao,ao]),new Hr([so,so,so],[0,0,ao]),new Hr([0,so,so],[ao,0,ao]),new Hr([so,0,so],[0,ao,ao]),new Hr([0,0,so],[ao,ao,ao])];function em(r){return r*os/Id}function dw(r,t,i,a=!0){const u=Bi([],r._camera.position,r.worldSize),p=[t,i,1,1];Xl(p,p,r.pixelMatrixInverse),rw(p,p,1/p[3]);const g=Zr([],Ro([],p,u)),y=r.globeMatrix,w=[y[12],y[13],y[14]],b=Ro([],w,u),A=vd(b),I=Zr([],b),M=r.worldSize/(2*Math.PI),L=oo(I,g),R=Math.asin(M/A);if(R1?null:function(a,u,p,g){const y=Math.sin(p);return a*(Math.sin((1-g)*p)/y)+u*(Math.sin(g*p)/y)}(r.a[t],r.b[t],r.angle,Je(i,0,1))+r.center[t]}function ss(r){if(r.z<=1)return wk[r.z+2*r.y+r.x];const t=Ay(tm(r));return Hr.fromPoints(t)}function Yl(r,t,i){return Bi(r,r,1-i),bd(r,r,t,i)}function pw(r,t){const i=lu(t.zoom);if(i===0)return ss(r);const a=tm(r),u=Ay(a),p=as(a.getWest())*t.worldSize,g=as(a.getEast())*t.worldSize,y=ls(a.getNorth())*t.worldSize,w=ls(a.getSouth())*t.worldSize,b=[p,y,0],A=[g,y,0],I=[p,w,0],M=[g,w,0],L=gy([],t.globeMatrix);return Nn(b,b,L),Nn(A,A,L),Nn(I,I,L),Nn(M,M,L),u[0]=Yl(u[0],I,i),u[1]=Yl(u[1],M,i),u[2]=Yl(u[2],A,i),u[3]=Yl(u[3],b,i),Hr.fromPoints(u)}function fw(r,t,i){for(const a of r)Nn(a,a,t),Bi(a,a,i)}function Ek(r,t,i){const a=t/r.worldSize,u=r.globeMatrix;if(i.z<=1){const Te=ss(i).getCorners();return fw(Te,u,a),Hr.fromPoints(Te)}const p=tm(i),g=Ay(p);fw(g,u,a);const y=Number.MAX_VALUE,w=[-y,-y,-y],b=[y,y,y];if(p.contains(r.center)){for(const Ze of g)xd(b,b,Ze),wd(w,w,Ze);w[2]=0;const Te=r.point,De=[Te.x*a,Te.y*a,0];return xd(b,b,De),wd(w,w,De),new Hr(b,w)}const A=[u[12]*a,u[13]*a,u[14]*a],I=p.getCenter(),M=Je(r.center.lat,-zr,zr),L=Je(I.lat,-zr,zr),R=as(r.center.lng),F=ls(M);let $=R-as(I.lng);const K=F-ls(L);$>.5?$-=1:$<-.5&&($+=1);let se=0;Math.abs($)>Math.abs(K)?se=$>=0?1:3:(se=K>=0?0:2,bd(A,A,[u[4]*a,u[5]*a,u[6]*a],-Math.sin(St(K>=0?p.getSouth():p.getNorth()))*os));const Y=g[se],re=g[(se+1)%4],ue=new bk(Y,re,A),ce=[Sy(ue,0)||Y[0],Sy(ue,1)||Y[1],Sy(ue,2)||Y[2]],Ie=lu(r.zoom);if(Ie>0){const Te=function({x:Ze,y:Me,z:Ue},je,Ge,et,Le){const ot=1/(1<.5?_t=-1:Ct<-.5&&(_t=1),ft=((ft+_t)*je-(et*=je))*Ge+et,st=((st+_t)*je-et)*Ge+et,At=(At*je-(Le*=je))*Ge+Le,tt=(tt*je-Le)*Ge+Le,[[ft,tt,0],[st,tt,0],[st,At,0],[ft,At,0]]}(i,t,r._pixelsPerMercatorPixel,R,F);for(let Ze=0;ZeMath.PI/2*1.01}const yw=St(85),Tk=Math.cos(yw),Sk=Math.sin(yw),Id=63710088e-1,vw=2*Math.PI*Id;class La{constructor(t,i){if(isNaN(t)||isNaN(i))throw new Error(`Invalid LngLat object: (${t}, ${i})`);if(this.lng=+t,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new La(xt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const i=Math.PI/180,a=this.lat*i,u=t.lat*i,p=Math.sin(a)*Math.sin(u)+Math.cos(a)*Math.cos(u)*Math.cos((t.lng-this.lng)*i);return Id*Math.acos(Math.min(p,1))}toBounds(t=0){const i=360*t/40075017,a=i/Math.cos(Math.PI/180*this.lat);return new za(new La(this.lng-a,this.lat-i),new La(this.lng+a,this.lat+i))}toEcef(t){const i=em(t);return au(this.lat,this.lng,os+i)}static convert(t){if(t instanceof La)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new La(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new La(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}var ln=La;function ky(r){return vw*Math.cos(r*Math.PI/180)}function as(r){return(180+r)/360}function ls(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function Do(r,t){return r/ky(t)}function Fi(r){return 360*r-180}function Pr(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}function xw(r,t){return r*ky(Pr(t))}const zr=85.051129;function ww(r){return 1/Math.cos(r*Math.PI/180)}class cu{constructor(t,i,a=0){this.x=+t,this.y=+i,this.z=+a}static fromLngLat(t,i=0){const a=ln.convert(t);return new cu(as(a.lng),ls(a.lat),Do(i,a.lat))}toLngLat(){return new ln(Fi(this.x),Pr(this.y))}toAltitude(){return xw(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/vw*ww(Pr(this.y))}}function My(r,t,i,a,u,p,g,y,w){const b=(t+a)/2,A=(i+u)/2,I=new Ve(b,A);y(I),function(M,L,R,F,$,K){const se=R-$,Y=F-K;return Math.abs((F-L)*se-(R-M)*Y)/Math.hypot(se,Y)}(I.x,I.y,p.x,p.y,g.x,g.y)>=w?(My(r,t,i,b,A,p,I,y,w),My(r,b,A,a,u,I,g,y,w)):r.push(g)}function bw(r,t,i){let a=r[0],u=a.x,p=a.y;t(a);const g=[a];for(let y=1;yr.x+1||ar.y+1)&&wn("Geometry exceeds allowed extent, reduce your vector tile buffer size"),r}function Vs(r,t,i){const a=r.loadGeometry(),u=r.extent,p=vt/u;if(t&&i&&i.projection.isReprojectedInTileSpace){const g=1<{const L=Fi((t.x+M.x/u)/g),R=Pr((t.y+M.y/u)/g),F=A.project(L,R);M.x=(F.x*y-w)*u,M.y=(F.y*y-b)*u};for(let M=0;M=u||R.y<0||R.y>=u||(I(R),L.push(R));a[M]=L}}for(const g of a)for(const y of g)Ck(y,p);return a}function Jl(r,t){return{type:r.type,id:r.id,properties:r.properties,geometry:t?Vs(r):[]}}function rm(r,t,i,a,u){r.emplaceBack(2*t+(a+1)/2,2*i+(u+1)/2)}function im(r,t,i){r.emplaceBack(t.x,t.y,t.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Ly{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.projection=t.projection,this.layoutVertexArray=new We,this.indexArray=new mt,this.segments=new qn,this.programConfigurations=new Wl(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a,u){const p=this.layers[0],g=[];let y=null;p.type==="circle"&&(y=p.layout.get("circle-sort-key"));for(const{feature:b,id:A,index:I,sourceLayerIndex:M}of t){const L=this.layers[0]._featureFilter.needGeometry,R=Jl(b,L);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),R,a))continue;const F=y?y.evaluate(R,{},a):void 0,$={id:A,properties:b.properties,type:b.type,sourceLayerIndex:M,index:I,geometry:L?R.geometry:Vs(b,a,u),patterns:{},sortKey:F};g.push($)}y&&g.sort((b,A)=>b.sortKey-A.sortKey);let w=null;u.projection.name==="globe"&&(this.globeExtVertexArray=new Xe,w=u.projection);for(const b of g){const{geometry:A,index:I,sourceLayerIndex:M}=b,L=t[I].feature;this.addFeature(b,A,I,i.availableImages,a,w),i.featureIndex.insert(L,A,I,M,this.index)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pk.members),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,fk.members))),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(t,i,a,u,p,g){for(const y of i)for(const w of y){const b=w.x,A=w.y;if(b<0||b>=vt||A<0||A>=vt)continue;if(g){const L=g.projectTilePoint(b,A,p),R=g.upVector(p,b,A),F=this.globeExtVertexArray;im(F,L,R),im(F,L,R),im(F,L,R),im(F,L,R)}const I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),M=I.vertexLength;rm(this.layoutVertexArray,b,A,-1,-1),rm(this.layoutVertexArray,b,A,1,-1),rm(this.layoutVertexArray,b,A,1,1),rm(this.layoutVertexArray,b,A,-1,1),this.indexArray.emplaceBack(M,M+1,M+2),this.indexArray.emplaceBack(M,M+2,M+3),I.vertexLength+=4,I.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{},u,p)}}function Tw(r,t){for(let i=0;i1){if(Ry(r,t))return!0;for(let a=0;a1?i:i.sub(t)._mult(u)._add(t))}function Cw(r,t){let i,a,u,p=!1;for(let g=0;gt.y!=u.y>t.y&&t.x<(u.x-a.x)*(t.y-a.y)/(u.y-a.y)+a.x&&(p=!p)}return p}function Ql(r,t){let i=!1;for(let a=0,u=r.length-1;at.y!=g.y>t.y&&t.x<(g.x-p.x)*(t.y-p.y)/(g.y-p.y)+p.x&&(i=!i)}return i}function Iw(r,t,i,a,u){for(const g of r)if(t<=g.x&&i<=g.y&&a>=g.x&&u>=g.y)return!0;const p=[new Ve(t,i),new Ve(t,u),new Ve(a,u),new Ve(a,i)];if(r.length>2){for(const g of p)if(Ql(r,g))return!0}for(let g=0;gu.x&&t.x>u.x||r.yu.y&&t.y>u.y)return!1;const p=pi(r,t,i[0]);return p!==pi(r,t,i[1])||p!==pi(r,t,i[2])||p!==pi(r,t,i[3])}function uu(r,t,i){const a=t.paint.get(r).value;return a.kind==="constant"?a.value:i.programConfigurations.get(t.id).getMaxValue(r)}function om(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function kw(r,t,i,a,u){if(!t[0]&&!t[1])return r;const p=Ve.convert(t)._mult(u);i==="viewport"&&p._rotate(-a);const g=[];for(let y=0;y0){const Y=i.projection.upVector(b,L.x,L.y);F.x+=Y[0]*A*R,F.y+=Y[1]*A*R,F.z+=Y[2]*A*R}const $=p?L:Rk(F.x,F.y,F.z,a),K=p?r.tilespaceRays.map(Y=>Ok(Y,R)):r.queryGeometry.screenGeometry,se=Xl([],[F.x,F.y,F.z,1],a);if(!g&&p?w*=se[3]/i.cameraToCenterDistance:g&&!p&&(w*=i.cameraToCenterDistance/se[3]),p){const Y=Pr((M.y/vt+b.y)/(1<r.width||u.height>r.height||i.x>r.width-u.width||i.y>r.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>t.width||u.height>t.height||a.x>t.width-u.width||a.y>t.height-u.height)throw new RangeError("out of range destination coordinates for image copy");const g=r.data,y=t.data;for(let w=0;w{t[r.evaluationKey]=w;const b=r.expression.evaluate(t);u.data[g+y+0]=Math.floor(255*b.r/b.a),u.data[g+y+1]=Math.floor(255*b.g/b.a),u.data[g+y+2]=Math.floor(255*b.b/b.a),u.data[g+y+3]=Math.floor(255*b.a)};if(r.clips)for(let g=0,y=0;g80*i){a=p=r[0],u=g=r[1];for(var R=i;Rp&&(p=y),w>g&&(g=w);b=(b=Math.max(p-a,g-u))!==0?32767/b:0}return kd(M,L,i,a,u,b,0),L}function Ow(r,t,i,a,u){var p,g;if(u===jy(r,t,i,a)>0)for(p=t;p=t;p-=a)g=Nw(p,r[p],r[p+1],g);return g&&am(g,g.next)&&(Pd(g),g=g.next),g}function ec(r,t){if(!r)return r;t||(t=r);var i,a=r;do if(i=!1,a.steiner||!am(a,a.next)&&Wn(a.prev,a,a.next)!==0)a=a.next;else{if(Pd(a),(a=t=a.prev)===a.next)break;i=!0}while(i||a!==t);return t}function kd(r,t,i,a,u,p,g){if(r){!g&&p&&function(A,I,M,L){var R=A;do R.z===0&&(R.z=Ny(R.x,R.y,I,M,L)),R.prevZ=R.prev,R.nextZ=R.next,R=R.next;while(R!==A);R.prevZ.nextZ=null,R.prevZ=null,function(F){var $,K,se,Y,re,ue,ce,Ie,Te=1;do{for(K=F,F=null,re=null,ue=0;K;){for(ue++,se=K,ce=0,$=0;$0||Ie>0&&se;)ce!==0&&(Ie===0||!se||K.z<=se.z)?(Y=K,K=K.nextZ,ce--):(Y=se,se=se.nextZ,Ie--),re?re.nextZ=Y:F=Y,Y.prevZ=re,re=Y;K=se}re.nextZ=null,Te*=2}while(ue>1)}(R)}(r,a,u,p);for(var y,w,b=r;r.prev!==r.next;)if(y=r.prev,w=r.next,p?Vk(r,a,u,p):jk(r))t.push(y.i/i|0),t.push(r.i/i|0),t.push(w.i/i|0),Pd(r),r=w.next,b=w.next;else if((r=w)===b){g?g===1?kd(r=$k(ec(r),t,i),t,i,a,u,p,2):g===2&&Gk(r,t,i,a,u,p):kd(ec(r),t,i,a,u,p,1);break}}}function jk(r){var t=r.prev,i=r,a=r.next;if(Wn(t,i,a)>=0)return!1;for(var u=t.x,p=i.x,g=a.x,y=t.y,w=i.y,b=a.y,A=up?u>g?u:g:p>g?p:g,L=y>w?y>b?y:b:w>b?w:b,R=a.next;R!==t;){if(R.x>=A&&R.x<=M&&R.y>=I&&R.y<=L&&hu(u,y,p,w,g,b,R.x,R.y)&&Wn(R.prev,R,R.next)>=0)return!1;R=R.next}return!0}function Vk(r,t,i,a){var u=r.prev,p=r,g=r.next;if(Wn(u,p,g)>=0)return!1;for(var y=u.x,w=p.x,b=g.x,A=u.y,I=p.y,M=g.y,L=yw?y>b?y:b:w>b?w:b,$=A>I?A>M?A:M:I>M?I:M,K=Ny(L,R,t,i,a),se=Ny(F,$,t,i,a),Y=r.prevZ,re=r.nextZ;Y&&Y.z>=K&&re&&re.z<=se;){if(Y.x>=L&&Y.x<=F&&Y.y>=R&&Y.y<=$&&Y!==u&&Y!==g&&hu(y,A,w,I,b,M,Y.x,Y.y)&&Wn(Y.prev,Y,Y.next)>=0||(Y=Y.prevZ,re.x>=L&&re.x<=F&&re.y>=R&&re.y<=$&&re!==u&&re!==g&&hu(y,A,w,I,b,M,re.x,re.y)&&Wn(re.prev,re,re.next)>=0))return!1;re=re.nextZ}for(;Y&&Y.z>=K;){if(Y.x>=L&&Y.x<=F&&Y.y>=R&&Y.y<=$&&Y!==u&&Y!==g&&hu(y,A,w,I,b,M,Y.x,Y.y)&&Wn(Y.prev,Y,Y.next)>=0)return!1;Y=Y.prevZ}for(;re&&re.z<=se;){if(re.x>=L&&re.x<=F&&re.y>=R&&re.y<=$&&re!==u&&re!==g&&hu(y,A,w,I,b,M,re.x,re.y)&&Wn(re.prev,re,re.next)>=0)return!1;re=re.nextZ}return!0}function $k(r,t,i){var a=r;do{var u=a.prev,p=a.next.next;!am(u,p)&&Bw(u,a,a.next,p)&&Md(u,p)&&Md(p,u)&&(t.push(u.i/i|0),t.push(a.i/i|0),t.push(p.i/i|0),Pd(a),Pd(a.next),a=r=p),a=a.next}while(a!==r);return ec(a)}function Gk(r,t,i,a,u,p){var g=r;do{for(var y=g.next.next;y!==g.prev;){if(g.i!==y.i&&Xk(g,y)){var w=Fw(g,y);return g=ec(g,g.next),w=ec(w,w.next),kd(g,t,i,a,u,p,0),void kd(w,t,i,a,u,p,0)}y=y.next}g=g.next}while(g!==r)}function qk(r,t){return r.x-t.x}function Wk(r,t){var i=function(u,p){var g,y=p,w=u.x,b=u.y,A=-1/0;do{if(b<=y.y&&b>=y.next.y&&y.next.y!==y.y){var I=y.x+(b-y.y)*(y.next.x-y.x)/(y.next.y-y.y);if(I<=w&&I>A&&(A=I,g=y.x=y.x&&y.x>=R&&w!==y.x&&hu(bg.x||y.x===g.x&&Zk(g,y)))&&(g=y,$=M)),y=y.next;while(y!==L);return g}(r,t);if(!i)return t;var a=Fw(i,r);return ec(a,a.next),ec(i,i.next)}function Zk(r,t){return Wn(r.prev,r,t.prev)<0&&Wn(t.next,r,r.next)<0}function Ny(r,t,i,a,u){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-i)*u|0)|r<<8))|r<<4))|r<<2))|r<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-a)*u|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Hk(r){var t=r,i=r;do(t.x=(r-g)*(p-y)&&(r-g)*(a-y)>=(i-g)*(t-y)&&(i-g)*(p-y)>=(u-g)*(a-y)}function Xk(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!function(i,a){var u=i;do{if(u.i!==i.i&&u.next.i!==i.i&&u.i!==a.i&&u.next.i!==a.i&&Bw(u,u.next,i,a))return!0;u=u.next}while(u!==i);return!1}(r,t)&&(Md(r,t)&&Md(t,r)&&function(i,a){var u=i,p=!1,g=(i.x+a.x)/2,y=(i.y+a.y)/2;do u.y>y!=u.next.y>y&&u.next.y!==u.y&&g<(u.next.x-u.x)*(y-u.y)/(u.next.y-u.y)+u.x&&(p=!p),u=u.next;while(u!==i);return p}(r,t)&&(Wn(r.prev,r,t.prev)||Wn(r,t.prev,t))||am(r,t)&&Wn(r.prev,r,r.next)>0&&Wn(t.prev,t,t.next)>0)}function Wn(r,t,i){return(t.y-r.y)*(i.x-t.x)-(t.x-r.x)*(i.y-t.y)}function am(r,t){return r.x===t.x&&r.y===t.y}function Bw(r,t,i,a){var u=cm(Wn(r,t,i)),p=cm(Wn(r,t,a)),g=cm(Wn(i,a,r)),y=cm(Wn(i,a,t));return u!==p&&g!==y||!(u!==0||!lm(r,i,t))||!(p!==0||!lm(r,a,t))||!(g!==0||!lm(i,r,a))||!(y!==0||!lm(i,t,a))}function lm(r,t,i){return t.x<=Math.max(r.x,i.x)&&t.x>=Math.min(r.x,i.x)&&t.y<=Math.max(r.y,i.y)&&t.y>=Math.min(r.y,i.y)}function cm(r){return r>0?1:r<0?-1:0}function Md(r,t){return Wn(r.prev,r,r.next)<0?Wn(r,t,r.next)>=0&&Wn(r,r.prev,t)>=0:Wn(r,t,r.prev)<0||Wn(r,r.next,t)<0}function Fw(r,t){var i=new Uy(r.i,r.x,r.y),a=new Uy(t.i,t.x,t.y),u=r.next,p=t.prev;return r.next=t,t.prev=r,i.next=u,u.prev=i,a.next=i,i.prev=a,p.next=a,a.prev=p,a}function Nw(r,t,i,a){var u=new Uy(r,t,i);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function Pd(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Uy(r,t,i){this.i=r,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function jy(r,t,i,a){for(var u=0,p=t,g=i-a;p0&&i.holes.push(a+=r[u-1].length)}return i};var Vy=le(Fy.exports);function Kk(r,t,i,a,u){Uw(r,t,i||0,a||r.length-1,u||Yk)}function Uw(r,t,i,a,u){for(;a>i;){if(a-i>600){var p=a-i+1,g=t-i+1,y=Math.log(p),w=.5*Math.exp(2*y/3),b=.5*Math.sqrt(y*w*(p-w)/p)*(g-p/2<0?-1:1);Uw(r,t,Math.max(i,Math.floor(t-g*w/p+b)),Math.min(a,Math.floor(t+(p-g)*w/p+b)),u)}var A=r[t],I=i,M=a;for(zd(r,i,t),u(r[a],A)>0&&zd(r,i,a);I0;)M--}u(r[i],A)===0?zd(r,i,M):zd(r,++M,a),M<=t&&(i=M+1),t<=M&&(a=M-1)}}function zd(r,t,i){var a=r[t];r[t]=r[i],r[i]=a}function Yk(r,t){return rt?1:0}function $y(r,t){const i=r.length;if(i<=1)return[r];const a=[];let u,p;for(let g=0;g1)for(let g=0;gi.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new We,this.indexArray=new mt,this.indexArray2=new fr,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.segments2=new qn,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=t.projection}populate(t,i,a,u){this.hasPattern=Gy("fill",this.layers,i);const p=this.layers[0].layout.get("fill-sort-key"),g=[];for(const{feature:y,id:w,index:b,sourceLayerIndex:A}of t){const I=this.layers[0]._featureFilter.needGeometry,M=Jl(y,I);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),M,a))continue;const L=p?p.evaluate(M,{},a,i.availableImages):void 0,R={id:w,properties:y.properties,type:y.type,sourceLayerIndex:A,index:b,geometry:I?M.geometry:Vs(y,a,u),patterns:{},sortKey:L};g.push(R)}p&&g.sort((y,w)=>y.sortKey-w.sortKey);for(const y of g){const{geometry:w,index:b,sourceLayerIndex:A}=y;if(this.hasPattern){const I=qy("fill",this.layers,y,this.zoom,i);this.patternFeatures.push(I)}else this.addFeature(y,w,b,a,{},i.availableImages);i.featureIndex.insert(t[b].feature,w,b,A,this.index)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}addFeatures(t,i,a,u,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,i,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Uk),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),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(t,i,a,u,p,g=[]){for(const y of $y(i,500)){let w=0;for(const R of y)w+=R.length;const b=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray),A=b.vertexLength,I=[],M=[];for(const R of y){if(R.length===0)continue;R!==y[0]&&M.push(I.length/2);const F=this.segments2.prepareSegment(R.length,this.layoutVertexArray,this.indexArray2),$=F.vertexLength;this.layoutVertexArray.emplaceBack(R[0].x,R[0].y),this.indexArray2.emplaceBack($+R.length-1,$),I.push(R[0].x),I.push(R[0].y);for(let K=1;K>3}if(u--,a===1||a===2)p+=r.readSVarint(),g+=r.readSVarint(),a===1&&(t&&y.push(t),t=[]),t.push(new oM(p,g));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&y.push(t),y},du.prototype.bbox=function(){var r=this._pbf;r.pos=this._geometry;for(var t=r.readVarint()+r.pos,i=1,a=0,u=0,p=0,g=1/0,y=-1/0,w=1/0,b=-1/0;r.pos>3}if(a--,i===1||i===2)(u+=r.readSVarint())y&&(y=u),(p+=r.readSVarint())b&&(b=p);else if(i!==7)throw new Error("unknown command "+i)}return[g,w,y,b]},du.prototype.toGeoJSON=function(r,t,i){var a,u,p=this.extent*Math.pow(2,i),g=this.extent*r,y=this.extent*t,w=this.loadGeometry(),b=du.types[this.type];function A(L){for(var R=0;R>3;u=g===1?a.readString():g===2?a.readFloat():g===3?a.readDouble():g===4?a.readVarint64():g===5?a.readVarint():g===6?a.readSVarint():g===7?a.readBoolean():null}return u}(i))}$w.prototype.feature=function(r){if(r<0||r>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[r];var t=this._pbf.readVarint()+this._pbf.pos;return new lM(this._pbf,t,this.extent,this._keys,this._values)};var uM=Vw;function hM(r,t,i){if(r===3){var a=new uM(i,i.readVarint()+i.pos);a.length&&(t[a.name]=a)}}var Wy=hm.VectorTile=function(r,t){this.layers=r.readFields(hM,{},t)},dm=hm.VectorTileFeature=jw;function pm(r,t,i,a){const u=[],p=a===0?(g,y,w,b,A,I)=>{g.push(new Ve(I,w+(I-y)/(b-y)*(A-w)))}:(g,y,w,b,A,I)=>{g.push(new Ve(y+(I-w)/(A-w)*(b-y),I))};for(const g of r){const y=[];for(const w of g){if(w.length<=2)continue;const b=[];for(let M=0;Mt&&p(b,L,R,F,$,t):K>i?se=t&&p(b,L,R,F,$,t),se>i&&K<=i&&p(b,L,R,F,$,i)}let A=w[w.length-1];const I=a===0?A.x:A.y;I>=t&&I<=i&&b.push(A),b.length&&(A=b[b.length-1],b[0].x===A.x&&b[0].y===A.y||b.push(b[0]),y.push(b))}y.length&&u.push(y)}return u}hm.VectorTileLayer=Vw;const dM=dm.types,pM=Math.pow(2,13);function Ld(r,t,i,a,u,p,g,y){r.emplaceBack((t<<1)+g,(i<<1)+p,(Math.floor(a*pM)<<1)+u,Math.round(y))}function Rd(r,t,i){r.emplaceBack(t.x,t.y,t.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Gw{constructor(){this.acc=new Ve(0,0),this.polyCount=[]}startRing(t){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Ve(t.x,t.y),this.max=new Ve(t.x,t.y))}append(t,i){this.currentPolyCount.edges++,this.acc._add(t);const a=this.min,u=this.max;t.xu.x&&(u.x=t.x),t.yu.y&&(u.y=t.y),((t.x===0||t.x===vt)&&t.x===i.x)!=((t.y===0||t.y===vt)&&t.y===i.y)&&this.processBorderOverlap(t,i),i.x<0!=t.x<0&&this.addBorderIntersection(0,Wt(i.y,t.y,(0-i.x)/(t.x-i.x))),i.x>vt!=t.x>vt&&this.addBorderIntersection(1,Wt(i.y,t.y,(vt-i.x)/(t.x-i.x))),i.y<0!=t.y<0&&this.addBorderIntersection(2,Wt(i.x,t.x,(0-i.y)/(t.y-i.y))),i.y>vt!=t.y>vt&&this.addBorderIntersection(3,Wt(i.x,t.x,(vt-i.y)/(t.y-i.y)))}addBorderIntersection(t,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const a=this.borders[t];ia[1]&&(a[1]=i)}processBorderOverlap(t,i){if(t.x===i.x){if(t.y===i.y)return;const a=t.x===0?0:1;this.addBorderIntersection(a,i.y),this.addBorderIntersection(a,t.y)}else{const a=t.y===0?2:3;this.addBorderIntersection(a,i.x),this.addBorderIntersection(a,t.x)}}centroid(){const t=this.polyCount.reduce((i,a)=>i+a.edges,0);return t!==0?this.acc.div(t)._round():new Ve(0,0)}span(){return new Ve(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((t,i)=>t+ +(i[0]!==Number.MAX_VALUE),0)}}class Dd{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=t.projection,this.layoutVertexArray=new Fe,this.centroidVertexArray=new Mo,this.indexArray=new mt,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=t.enableTerrain}populate(t,i,a,u){this.features=[],this.hasPattern=Gy("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(p){const g=Math.exp(Math.PI*(1-p.y/(1<=0;K--){const se=L[K];(se.length===0||(R=se[0]).every(Y=>Y.x<=0)||R.every(Y=>Y.x>=vt)||R.every(Y=>Y.y<=0)||R.every(Y=>Y.y>=vt))&&L.splice(K,1)}var R;let F;if(A)F=Yw(L,w,u);else{F=[];for(const K of L)F.push({polygon:K,bounds:w})}const $=M?this.edgeRadius:0;for(const{polygon:K,bounds:se}of F){let Y=0,re=0;for(const ce of K)M&&!ce[0].equals(ce[ce.length-1])&&ce.push(ce[0]),re+=M?ce.length-1:ce.length;const ue=this.segments.prepareSegment((M?5:4)*re,this.layoutVertexArray,this.indexArray);if(M){const ce=[],Ie=[];Y=ue.vertexLength;for(const De of K){let Ze,Me;De.length&&De!==K[0]&&Ie.push(ce.length/2),Ze=De[1].sub(De[0])._perp()._unit();for(let Ue=1;Ue4&&Hw(ce[ce.length-2],ce[0],ce[1]),Me=$?fM(ce[ce.length-2],ce[0],ce[1],$):0;Te=ce[1].sub(ce[0])._perp()._unit();let Ue=!0;for(let je=1,Ge=0;je0?1:0,tt=et.dist(Le);if(Ge+tt>32768&&(Ge=0),$){De=ot.sub(Le)._perp()._unit();let It=Ww(et,Le,ot,qw(Te,De),$);isNaN(It)&&(It=0);const bt=Le.sub(et)._unit();et=et.add(bt.mult(Me))._round(),Le=Le.add(bt.mult(-It))._round(),Me=It,Te=De}const _t=ue.vertexLength,Ct=ce.length>4&&Hw(et,Le,ot);let Ht=Xw(Ge,Ze,Ue);if(Ld(this.layoutVertexArray,et.x,et.y,st,At,0,0,Ht),Ld(this.layoutVertexArray,et.x,et.y,st,At,0,1,Ht),Ge+=tt,Ht=Xw(Ge,Ct,!Ue),Ze=Ct,Ld(this.layoutVertexArray,Le.x,Le.y,st,At,0,0,Ht),Ld(this.layoutVertexArray,Le.x,Le.y,st,At,0,1,Ht),ue.vertexLength+=4,this.indexArray.emplaceBack(_t+0,_t+1,_t+2),this.indexArray.emplaceBack(_t+1,_t+3,_t+2),ue.primitiveLength+=2,$){const It=Y+(je===1?ce.length-2:je-2),bt=je===1?Y:It+1;if(this.indexArray.emplaceBack(_t+1,It,_t+3),this.indexArray.emplaceBack(It,bt,_t+3),ue.primitiveLength+=2,Ie===void 0&&(Ie=_t),!Zw(ot,ce[je],se)){const bn=je===ce.length-1?Ie:ue.vertexLength;this.indexArray.emplaceBack(_t+2,_t+3,bn),this.indexArray.emplaceBack(_t+3,bn+1,bn),this.indexArray.emplaceBack(_t+3,bt,bn+1),ue.primitiveLength+=3}Ue=!Ue}if(A){const It=this.layoutVertexExtArray,bt=b.projectTilePoint(et.x,et.y,u),bn=b.projectTilePoint(Le.x,Le.y,u),zt=b.upVector(u,et.x,et.y),Lt=b.upVector(u,Le.x,Le.y);Rd(It,bt,zt),Rd(It,bt,zt),Rd(It,bn,Lt),Rd(It,bn,Lt)}}M&&(Y+=ce.length-1)}}if(I&&I.polyCount.length>0){if(I.borders){I.vertexArrayOffset=this.centroidVertexArray.length;const K=I.borders,se=this.featuresOnBorder.push(I)-1;for(let Y=0;Y<4;Y++)K[Y][0]!==Number.MAX_VALUE&&this.borders[Y].push(se)}this.encodeCentroid(I.borders?void 0:I.centroid(),I)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,g,u)}sortBorders(){for(let t=0;t<4;t++)this.borders[t].sort((i,a)=>this.featuresOnBorder[i].borders[t][0]-this.featuresOnBorder[a].borders[t][0])}encodeCentroid(t,i,a=!0){let u,p;if(t)if(t.y!==0){const y=i.span()._mult(this.tileToMeter);u=(Math.max(t.x,1)<<3)+Math.min(7,Math.round(y.x/10)),p=(Math.max(t.y,1)<<3)+Math.min(7,Math.round(y.y/10))}else u=Math.ceil(7*(t.x+450)),p=0;else u=0,p=+a;let g=a?this.centroidVertexArray.length:i.vertexArrayOffset;for(const y of i.polyCount){a&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*y.edges+y.top);for(let w=0;wi[1].x&&t.x>i[1].x||r.yi[1].y&&t.y>i[1].y}function Hw(r,t,i){if(r.x<0||r.x>=vt||t.x<0||t.x>=vt||i.x<0||i.x>=vt)return!1;const a=i.sub(t),u=a.perp(),p=r.sub(t);return(a.x*p.x+a.y*p.y)/Math.sqrt((a.x*a.x+a.y*a.y)*(p.x*p.x+p.y*p.y))>-.866&&u.x*p.x+u.y*p.y<0}function Xw(r,t,i){const a=t?2|r:-3&r;return i?1|a:-2&a}function Kw(){const r=Math.PI/32,t=Math.tan(r),i=Id;return i*Math.sqrt(1+2*t*t)-i}function Yw(r,t,i){const a=1<{for(const Te of ce)R.push({polygon:Te,bounds:Ie})},$=Math.ceil(Math.log2(A)),K=Math.ceil(Math.log2(I)),se=$-K,Y=[];for(let ce=0;ce0?0:1);for(let ce=0;ceIe+1?ue.push({polygons:Ge,bounds:Le,depth:Ie+1}):F(Ge,Le)}if(et.length){const Le=[new Ve(Te===0?je:De.x,Te===1?je:De.y),Ze];Y.length>Ie+1?ue.push({polygons:et,bounds:Le,depth:Ie+1}):F(et,Le)}}return R}(r,t,Math.ceil((p-u)/11.25),Math.ceil((g-y)/11.25),1,(w,b,A)=>{if(w===0)return .5*(b+A);{const I=Pr((i.y+b/vt)/a);return(ls(.5*(Pr((i.y+A/vt)/a)+I))*a-i.y)*vt}})}dt(Dd,"FillExtrusionBucket",{omit:["layers","features"]}),dt(Gw,"PartMetadata");const mM=new ee({"fill-extrusion-edge-radius":new B(Re["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var gM={paint:new ee({"fill-extrusion-opacity":new B(Re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new q(Re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new B(Re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new B(Re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new q(Re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new q(Re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new q(Re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new B(Re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new B(Re["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new B(Re["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new B(Re["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:mM};function Jw(r,t,i){var a=2*Math.PI*6378137/256/Math.pow(2,i);return[r*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}class fm{constructor(t,i,a){this.z=t,this.x=i,this.y=a,this.key=Od(0,t,t,i,a)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,i){const a=function(p,g,y){var w=Jw(256*p,256*(g=Math.pow(2,y)-g-1),y),b=Jw(256*(p+1),256*(g+1),y);return w[0]+","+w[1]+","+b[0]+","+b[1]}(this.x,this.y,this.z),u=function(p,g,y){let w,b="";for(let A=p;A>0;A--)w=1<this.canonical.z?new Xr(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Xr(t,this.wrap,t,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(t,i=!0){if(this.overscaledZ===t&&i)return this.key;if(t>this.canonical.z)return Od(this.wrap*+i,t,this.canonical.z,this.canonical.x,this.canonical.y);{const a=this.canonical.z-t;return Od(this.wrap*+i,t,t,this.canonical.x>>a,this.canonical.y>>a)}}isChildOf(t){if(t.wrap!==this.wrap)return!1;const i=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ>i&&t.canonical.y===this.canonical.y>>i}children(t){if(this.overscaledZ>=t)return[new Xr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,a=2*this.canonical.x,u=2*this.canonical.y;return[new Xr(i,this.wrap,i,a,u),new Xr(i,this.wrap,i,a+1,u),new Xr(i,this.wrap,i,a,u+1),new Xr(i,this.wrap,i,a+1,u+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.yi.id),this.index=t.index,this.projection=t.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new ke,this.layoutVertexArray2=new qe,this.indexArray=new mt,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a,u){this.hasPattern=Gy("line",this.layers,i);const p=this.layers[0].layout.get("line-sort-key"),g=[];for(const{feature:A,id:I,index:M,sourceLayerIndex:L}of t){const R=this.layers[0]._featureFilter.needGeometry,F=Jl(A,R);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),F,a))continue;const $=p?p.evaluate(F,{},a):void 0,K={id:I,properties:A.properties,type:A.type,sourceLayerIndex:L,index:M,geometry:R?F.geometry:Vs(A,a,u),patterns:{},sortKey:$};g.push(K)}p&&g.sort((A,I)=>A.sortKey-I.sortKey);const{lineAtlas:y,featureIndex:w}=i,b=this.addConstantDashes(y);for(const A of g){const{geometry:I,index:M,sourceLayerIndex:L}=A;if(b&&this.addFeatureDashes(A,y),this.hasPattern){const R=qy("line",this.layers,A,this.zoom,i);this.patternFeatures.push(R)}else this.addFeature(A,I,M,a,y.positions,i.availableImages);w.insert(t[M].feature,I,M,L,this.index)}}addConstantDashes(t){let i=!1;for(const a of this.layers){const u=a.paint.get("line-dasharray").value,p=a.layout.get("line-cap").value;if(u.kind!=="constant"||p.kind!=="constant")i=!0;else{const g=p.value,y=u.value;if(!y)continue;t.addDash(y,g)}}return i}addFeatureDashes(t,i){const a=this.zoom;for(const u of this.layers){const p=u.paint.get("line-dasharray").value,g=u.layout.get("line-cap").value;if(p.kind==="constant"&&g.kind==="constant")continue;let y,w;if(p.kind==="constant"){if(y=p.value,!y)continue}else y=p.evaluate({zoom:a},t);w=g.kind==="constant"?g.value:g.evaluate({zoom:a},t),i.addDash(y,w),t.patterns[u.id]=i.getKey(y,w)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}addFeatures(t,i,a,u,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,i,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,xM)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,yM),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,i,a,u,p,g){const y=this.layers[0].layout,w=y.get("line-join").evaluate(t,{}),b=y.get("line-cap").evaluate(t,{}),A=y.get("line-miter-limit"),I=y.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const M of i)this.addLine(M,t,w,b,A,I);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,g,u)}addLine(t,i,a,u,p,g){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let K=0;K=2&&t[w-1].equals(t[w-2]);)w--;let b=0;for(;b0;if(Ie&&K>b){const Me=M.dist(L);if(Me>2*A){const Ue=M.sub(M.sub(L)._mult(A/Me)._round());this.updateDistance(L,Ue),this.addCurrentVertex(Ue,F,0,0,I),L=Ue}}const De=L&&R;let Ze=De?a:y?"butt":u;if(De&&Ze==="round"&&(uep&&(Ze="bevel"),Ze==="bevel"&&(ue>2&&(Ze="flipbevel"),ue100)se=$.mult(-1);else{const Me=ue*F.add($).mag()/F.sub($).mag();se._perp()._mult(Me*(Te?-1:1))}this.addCurrentVertex(M,se,0,0,I),this.addCurrentVertex(M,se.mult(-1),0,0,I)}else if(Ze==="bevel"||Ze==="fakeround"){const Me=-Math.sqrt(ue*ue-1),Ue=Te?Me:0,je=Te?0:Me;if(L&&this.addCurrentVertex(M,F,Ue,je,I),Ze==="fakeround"){const Ge=Math.round(180*ce/Math.PI/20);for(let et=1;et2*A){const Ue=M.add(R.sub(M)._mult(A/Me)._round());this.updateDistance(M,Ue),this.addCurrentVertex(Ue,$,0,0,I),M=Ue}}}}addCurrentVertex(t,i,a,u,p,g=!1){const y=i.y*u-i.x,w=-i.y-i.x*u;this.addHalfVertex(t,i.x+i.y*a,i.y-i.x*a,g,!1,a,p),this.addHalfVertex(t,y,w,g,!0,-u,p)}addHalfVertex({x:t,y:i},a,u,p,g,y,w){this.layoutVertexArray.emplaceBack((t<<1)+(p?1:0),(i<<1)+(g?1:0),Math.round(63*a)+128,Math.round(63*u)+128,1+(y===0?0:y<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const b=w.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),w.primitiveLength++),g?this.e2=b:this.e1=b}updateScaledDistance(){if(this.lineClips){const t=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=t*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(t,i){this.distance+=t.dist(i),this.updateScaledDistance()}}dt(mm,"LineBucket",{omit:["layers","patternFeatures"]});const EM=new ee({"line-cap":new q(Re.layout_line["line-cap"]),"line-join":new q(Re.layout_line["line-join"]),"line-miter-limit":new B(Re.layout_line["line-miter-limit"]),"line-round-limit":new B(Re.layout_line["line-round-limit"]),"line-sort-key":new q(Re.layout_line["line-sort-key"])});var nb={paint:new ee({"line-opacity":new q(Re.paint_line["line-opacity"]),"line-color":new q(Re.paint_line["line-color"]),"line-translate":new B(Re.paint_line["line-translate"]),"line-translate-anchor":new B(Re.paint_line["line-translate-anchor"]),"line-width":new q(Re.paint_line["line-width"]),"line-gap-width":new q(Re.paint_line["line-gap-width"]),"line-offset":new q(Re.paint_line["line-offset"]),"line-blur":new q(Re.paint_line["line-blur"]),"line-dasharray":new q(Re.paint_line["line-dasharray"]),"line-pattern":new q(Re.paint_line["line-pattern"]),"line-gradient":new Q(Re.paint_line["line-gradient"]),"line-trim-offset":new B(Re.paint_line["line-trim-offset"])}),layout:EM};const rb=new class extends q{possiblyEvaluate(r,t){return t=new C(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(r,t)}evaluate(r,t,i,a){return t=vn({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(r,t,i,a)}}(nb.paint.properties["line-width"].specification);function ib(r,t){return t>0?t+2*r:r}rb.useIntegerZoom=!0;const TM=ye([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),SM=ye([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),AM=ye([{name:"a_projected_pos",components:4,type:"Float32"}],4);ye([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const CM=ye([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),IM=ye([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const ob=ye([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),kM=ye([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);ye([{name:"triangle",components:3,type:"Uint16"}]),ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ye([{type:"Float32",name:"offsetX"}]),ye([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Tr=24;const Oo=128;function Zy(r,t){const{expression:i}=t;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new C(r+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:u}=i;let p=0;for(;p{a.text=function(u,p,g){const y=p.layout.get("text-transform").evaluate(g,{});return y==="uppercase"?u=u.toLocaleUpperCase():y==="lowercase"&&(u=u.toLocaleLowerCase()),S.applyArabicShaping&&(u=S.applyArabicShaping(u)),u}(a.text,t,i)}),r}const Fd={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function zM(r){return r==="︶"||r==="﹈"||r==="︸"||r==="﹄"||r==="﹂"||r==="︾"||r==="︼"||r==="︺"||r==="︘"||r==="﹀"||r==="︐"||r==="︓"||r==="︔"||r==="`"||r===" ̄"||r==="︑"||r==="︒"}function LM(r){return r==="︵"||r==="﹇"||r==="︷"||r==="﹃"||r==="﹁"||r==="︽"||r==="︻"||r==="︹"||r==="︗"||r==="︿"}var sb=pn,ab=function(r,t,i,a,u){var p,g,y=8*u-a-1,w=(1<>1,A=-7,I=i?u-1:0,M=i?-1:1,L=r[t+I];for(I+=M,p=L&(1<<-A)-1,L>>=-A,A+=y;A>0;p=256*p+r[t+I],I+=M,A-=8);for(g=p&(1<<-A)-1,p>>=-A,A+=a;A>0;g=256*g+r[t+I],I+=M,A-=8);if(p===0)p=1-b;else{if(p===w)return g?NaN:1/0*(L?-1:1);g+=Math.pow(2,a),p-=b}return(L?-1:1)*g*Math.pow(2,p-a)},lb=function(r,t,i,a,u,p){var g,y,w,b=8*p-u-1,A=(1<>1,M=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=a?0:p-1,R=a?1:-1,F=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(y=isNaN(t)?1:0,g=A):(g=Math.floor(Math.log(t)/Math.LN2),t*(w=Math.pow(2,-g))<1&&(g--,w*=2),(t+=g+I>=1?M/w:M*Math.pow(2,1-I))*w>=2&&(g++,w/=2),g+I>=A?(y=0,g=A):g+I>=1?(y=(t*w-1)*Math.pow(2,u),g+=I):(y=t*Math.pow(2,I-1)*Math.pow(2,u),g=0));u>=8;r[i+L]=255&y,L+=R,y/=256,u-=8);for(g=g<0;r[i+L]=255&g,L+=R,g/=256,b-=8);r[i+L-R]|=128*F};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function pn(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}pn.Varint=0,pn.Fixed64=1,pn.Bytes=2,pn.Fixed32=5;var Hy=4294967296,cb=1/Hy,ub=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Gs(r){return r.type===pn.Bytes?r.readVarint()+r.pos:r.pos+1}function mu(r,t,i){return i?4294967296*t+(r>>>0):4294967296*(t>>>0)+(r>>>0)}function hb(r,t,i){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(a);for(var u=i.pos-1;u>=r;u--)i.buf[u+a]=i.buf[u]}function RM(r,t){for(var i=0;i>>8,r[i+2]=t>>>16,r[i+3]=t>>>24}function db(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+(r[t+3]<<24)}pn.prototype={destroy:function(){this.buf=null},readFields:function(r,t,i){for(i=i||this.length;this.pos>3,p=this.pos;this.type=7&a,r(u,t,this),this.pos===p&&this.skip(a)}return t},readMessage:function(r,t){return this.readFields(r,t,this.readVarint()+this.pos)},readFixed32:function(){var r=_m(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=db(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=_m(this.buf,this.pos)+_m(this.buf,this.pos+4)*Hy;return this.pos+=8,r},readSFixed64:function(){var r=_m(this.buf,this.pos)+db(this.buf,this.pos+4)*Hy;return this.pos+=8,r},readFloat:function(){var r=ab(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=ab(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var t,i,a=this.buf;return t=127&(i=a[this.pos++]),i<128?t:(t|=(127&(i=a[this.pos++]))<<7,i<128?t:(t|=(127&(i=a[this.pos++]))<<14,i<128?t:(t|=(127&(i=a[this.pos++]))<<21,i<128?t:function(u,p,g){var y,w,b=g.buf;if(y=(112&(w=b[g.pos++]))>>4,w<128||(y|=(127&(w=b[g.pos++]))<<3,w<128)||(y|=(127&(w=b[g.pos++]))<<10,w<128)||(y|=(127&(w=b[g.pos++]))<<17,w<128)||(y|=(127&(w=b[g.pos++]))<<24,w<128)||(y|=(1&(w=b[g.pos++]))<<31,w<128))return mu(u,y,p);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=a[this.pos]))<<28,r,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2==1?(r+1)/-2:r/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var r=this.readVarint()+this.pos,t=this.pos;return this.pos=r,r-t>=12&&ub?function(i,a,u){return ub.decode(i.subarray(a,u))}(this.buf,t,r):function(i,a,u){for(var p="",g=a;g239?4:A>223?3:A>191?2:1;if(g+M>u)break;M===1?A<128&&(I=A):M===2?(192&(y=i[g+1]))==128&&(I=(31&A)<<6|63&y)<=127&&(I=null):M===3?(w=i[g+2],(192&(y=i[g+1]))==128&&(192&w)==128&&((I=(15&A)<<12|(63&y)<<6|63&w)<=2047||I>=55296&&I<=57343)&&(I=null)):M===4&&(w=i[g+2],b=i[g+3],(192&(y=i[g+1]))==128&&(192&w)==128&&(192&b)==128&&((I=(15&A)<<18|(63&y)<<12|(63&w)<<6|63&b)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,M=1):I>65535&&(I-=65536,p+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),p+=String.fromCharCode(I),g+=M}return p}(this.buf,t,r)},readBytes:function(){var r=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,r);return this.pos=r,t},readPackedVarint:function(r,t){if(this.type!==pn.Bytes)return r.push(this.readVarint(t));var i=Gs(this);for(r=r||[];this.pos127;);else if(t===pn.Bytes)this.pos=this.readVarint()+this.pos;else if(t===pn.Fixed32)this.pos+=4;else{if(t!==pn.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(r,t){this.writeVarint(r<<3|t)},realloc:function(r){for(var t=this.length||16;t268435455||r<0?function(t,i){var a,u;if(t>=0?(a=t%4294967296|0,u=t/4294967296|0):(u=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,u=u+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(p,g,y){y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,y.buf[y.pos]=127&(p>>>=7)}(a,0,i),function(p,g){var y=(7&p)<<4;g.buf[g.pos++]|=y|((p>>>=3)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p)))))}(u,i)}(r,this):(this.realloc(4),this.buf[this.pos++]=127&r|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=r>>>7&127))))},writeSVarint:function(r){this.writeVarint(r<0?2*-r-1:2*r)},writeBoolean:function(r){this.writeVarint(!!r)},writeString:function(r){r=String(r),this.realloc(4*r.length),this.pos++;var t=this.pos;this.pos=function(a,u,p){for(var g,y,w=0;w55295&&g<57344){if(!y){g>56319||w+1===u.length?(a[p++]=239,a[p++]=191,a[p++]=189):y=g;continue}if(g<56320){a[p++]=239,a[p++]=191,a[p++]=189,y=g;continue}g=y-55296<<10|g-56320|65536,y=null}else y&&(a[p++]=239,a[p++]=191,a[p++]=189,y=null);g<128?a[p++]=g:(g<2048?a[p++]=g>>6|192:(g<65536?a[p++]=g>>12|224:(a[p++]=g>>18|240,a[p++]=g>>12&63|128),a[p++]=g>>6&63|128),a[p++]=63&g|128)}return p}(this.buf,r,this.pos);var i=this.pos-t;i>=128&&hb(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(r){this.realloc(4),lb(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),lb(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var t=r.length;this.writeVarint(t),this.realloc(t);for(var i=0;i=128&&hb(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a},writeMessage:function(r,t,i){this.writeTag(r,pn.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(r,t){t.length&&this.writeMessage(r,RM,t)},writePackedSVarint:function(r,t){t.length&&this.writeMessage(r,DM,t)},writePackedBoolean:function(r,t){t.length&&this.writeMessage(r,FM,t)},writePackedFloat:function(r,t){t.length&&this.writeMessage(r,OM,t)},writePackedDouble:function(r,t){t.length&&this.writeMessage(r,BM,t)},writePackedFixed32:function(r,t){t.length&&this.writeMessage(r,NM,t)},writePackedSFixed32:function(r,t){t.length&&this.writeMessage(r,UM,t)},writePackedFixed64:function(r,t){t.length&&this.writeMessage(r,jM,t)},writePackedSFixed64:function(r,t){t.length&&this.writeMessage(r,VM,t)},writeBytesField:function(r,t){this.writeTag(r,pn.Bytes),this.writeBytes(t)},writeFixed32Field:function(r,t){this.writeTag(r,pn.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(r,t){this.writeTag(r,pn.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(r,t){this.writeTag(r,pn.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(r,t){this.writeTag(r,pn.Fixed64),this.writeSFixed64(t)},writeVarintField:function(r,t){this.writeTag(r,pn.Varint),this.writeVarint(t)},writeSVarintField:function(r,t){this.writeTag(r,pn.Varint),this.writeSVarint(t)},writeStringField:function(r,t){this.writeTag(r,pn.Bytes),this.writeString(t)},writeFloatField:function(r,t){this.writeTag(r,pn.Fixed32),this.writeFloat(t)},writeDoubleField:function(r,t){this.writeTag(r,pn.Fixed64),this.writeDouble(t)},writeBooleanField:function(r,t){this.writeVarintField(r,!!t)}};var ym=le(sb);const Xy=3;function $M(r,t,i){t.glyphs=[],r===1&&i.readMessage(GM,t)}function GM(r,t,i){if(r===3){const{id:a,bitmap:u,width:p,height:g,left:y,top:w,advance:b}=i.readMessage(qM,{});t.glyphs.push({id:a,bitmap:new $s({width:p+2*Xy,height:g+2*Xy},u),metrics:{width:p,height:g,left:y,top:w,advance:b}})}else r===4?t.ascender=i.readSVarint():r===5&&(t.descender=i.readSVarint())}function qM(r,t,i){r===1?t.id=i.readVarint():r===2?t.bitmap=i.readBytes():r===3?t.width=i.readVarint():r===4?t.height=i.readVarint():r===5?t.left=i.readSVarint():r===6?t.top=i.readSVarint():r===7&&(t.advance=i.readVarint())}const pb=Xy;function Ky(r){let t=0,i=0;for(const g of r)t+=g.w*g.h,i=Math.max(i,g.w);r.sort((g,y)=>y.h-g.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let u=0,p=0;for(const g of r)for(let y=a.length-1;y>=0;y--){const w=a[y];if(!(g.w>w.w||g.h>w.h)){if(g.x=w.x,g.y=w.y,p=Math.max(p,g.y+g.h),u=Math.max(u,g.x+g.w),g.w===w.w&&g.h===w.h){const b=a.pop();yt.hasImage(a)),t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in t.updatedImages)this.patchUpdatedImage(this.iconPositions[a],t.getImage(a),i),this.patchUpdatedImage(this.patternPositions[a],t.getImage(a),i)}patchUpdatedImage(t,i,a){if(!t||!i||t.version===i.version)return;t.version=i.version;const[u,p]=t.tl;a.update(i.data,void 0,{x:u,y:p})}}dt(Yy,"ImagePosition"),dt(fb,"ImageAtlas");const Ni={horizontal:1,vertical:2,horizontalOnly:3},mb=-17;class Nd{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,i){const a=new Nd;return a.scale=t||1,a.fontStack=i,a}static forImage(t){const i=new Nd;return i.imageName=t,i}}class _u{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,i){const a=new _u;for(let u=0;u=0&&a>=t&&vm[this.text.charCodeAt(a)];a--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)}substring(t,i){const a=new _u;return a.text=this.text.substring(t,i),a.sectionIndex=this.sectionIndex.slice(t,i),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,i)=>Math.max(t,this.sections[i].scale),0)}addTextSection(t,i){this.text+=t.text,this.sections.push(Nd.forText(t.scale,t.fontStack||i));const a=this.sections.length-1;for(let u=0;u=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Jy(r,t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=_u.fromFeature(r,u);I===Ni.vertical&&F.verticalizePunctuation(M);let $=[];const K=function(ce,Ie,Te,De,Ze,Me){if(!ce)return[];const Ue=[],je=function(ot,ft,st,At,tt,_t){let Ct=0;for(let Ht=0;Ht=0;let et=0;for(let ot=0;ot0&&No>un&&(un=No)}else{const Yr=Te[nr.fontStack];if(!Yr)continue;Yr[Mn]&&(gn=Yr[Mn]);const gr=Ie[nr.fontStack];if(!gr)continue;const No=gr.glyphs[Mn];if(!No)continue;if(Xn=No.metrics,Kn=Mn!==8203?Tr:0,_t){const Tu=gr.ascender!==void 0?Math.abs(gr.ascender):0,Xd=gr.descender!==void 0?Math.abs(gr.descender):0,Kd=(Tu+Xd)*Kt;kn-i/2;){if(g--,g<0)return!1;y-=r[g].dist(p),p=r[g]}y+=r[g].dist(r[g+1]),g++;const w=[];let b=0;for(;ya;)b-=w.shift().angleDelta;if(b>u)return!1;g++,y+=A.dist(I)}return!0}function Eb(r){let t=0;for(let i=0;ib){const R=(b-w)/L,F=Wt(I.x,M.x,R),$=Wt(I.y,M.y,R),K=new qs(F,$,0,M.angleTo(I),A);return!g||bb(r,K,y,g,t)?K:void 0}w+=L}}function KM(r,t,i,a,u,p,g,y,w){const b=Tb(a,p,g),A=Sb(a,u),I=A*g,M=r[0].x===0||r[0].x===w||r[0].y===0||r[0].y===w;return t-I=0&&re=0&&ue=0&&M+b<=A){const ce=new qs(re,ue,0,se,R);ce._round(),a&&!bb(r,ce,p,a,u)||L.push(ce)}}I+=K}return y||L.length||g||(L=Ab(r,I/2,i,a,u,p,g,!0,w)),L}function Cb(r,t,i,a,u){const p=[];for(let g=0;g=a&&I.x>=a||(A.x>=a?A=new Ve(a,A.y+(a-A.x)/(I.x-A.x)*(I.y-A.y))._round():I.x>=a&&(I=new Ve(a,A.y+(a-A.x)/(I.x-A.x)*(I.y-A.y))._round()),A.y>=u&&I.y>=u||(A.y>=u?A=new Ve(A.x+(u-A.y)/(I.y-A.y)*(I.x-A.x),u)._round():I.y>=u&&(I=new Ve(A.x+(u-A.y)/(I.y-A.y)*(I.x-A.x),u)._round()),w&&A.equals(w[w.length-1])||(w=[A],p.push(w)),w.push(I)))))}}return p}dt(qs,"Anchor");const Ud=1e20;function Ib(r,t,i,a,u,p,g,y,w){for(let b=t;b-1);w++,p[w]=y,g[w]=b,g[w+1]=Ud}for(let y=0,w=0;y{let y=this.entries[u];y||(y=this.entries[u]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let w=y.glyphs[p];if(w!==void 0)return void g(null,{stack:u,id:p,glyph:w});if(w=this._tinySDF(y,u,p),w)return y.glyphs[p]=w,void g(null,{stack:u,id:p,glyph:w});const b=Math.floor(p/256);if(256*b>65535)return void g(new Error("glyphs > 65535 not supported"));if(y.ranges[b])return void g(null,{stack:u,id:p,glyph:w});let A=y.requests[b];A||(A=y.requests[b]=[],yu.loadGlyphRange(u,b,this.url,this.requestManager,(I,M)=>{if(M){y.ascender=M.ascender,y.descender=M.descender;for(const L in M.glyphs)this._doesCharSupportLocalGlyph(+L)||(y.glyphs[+L]=M.glyphs[+L]);y.ranges[b]=!0}for(const L of A)L(I,M);delete y.requests[b]})),A.push((I,M)=>{I?g(I):M&&g(null,{stack:u,id:p,glyph:M.glyphs[p]||null})})},(u,p)=>{if(u)i(u);else if(p){const g={};for(const{stack:y,id:w,glyph:b}of p)g[y]===void 0&&(g[y]={}),g[y].glyphs===void 0&&(g[y].glyphs={}),g[y].glyphs[w]=b&&{id:b.id,bitmap:b.bitmap.clone(),metrics:b.metrics},g[y].ascender=this.entries[y].ascender,g[y].descender=this.entries[y].descender;i(null,g)}})}_doesCharSupportLocalGlyph(t){return this.localGlyphMode!==e0.none&&(this.localGlyphMode===e0.all?!!this.localFontFamily:!!this.localFontFamily&&(at["CJK Unified Ideographs"](t)||at["Hangul Syllables"](t)||at.Hiragana(t)||at.Katakana(t)||at["CJK Symbols and Punctuation"](t)))}_tinySDF(t,i,a){const u=this.localFontFamily;if(!u||!this._doesCharSupportLocalGlyph(a))return;let p=t.tinySDF;if(!p){let F="400";/bold/i.test(i)?F="900":/medium/i.test(i)?F="500":/light/i.test(i)&&(F="200"),p=t.tinySDF=new yu.TinySDF({fontFamily:u,fontWeight:F,fontSize:24*Bo,buffer:3*Bo,radius:8*Bo}),p.fontWeight=F}if(this.localGlyphs[p.fontWeight][a])return this.localGlyphs[p.fontWeight][a];const g=String.fromCharCode(a),{data:y,width:w,height:b,glyphWidth:A,glyphHeight:I,glyphLeft:M,glyphTop:L,glyphAdvance:R}=p.draw(g);return this.localGlyphs[p.fontWeight][a]={id:a,bitmap:new $s({width:w,height:b},y),metrics:{width:A/Bo,height:I/Bo,left:M/Bo,top:L/Bo-27,advance:R/Bo,localGlyph:!0}}}}yu.loadGlyphRange=function(r,t,i,a,u){const p=256*t,g=p+255,y=a.transformRequest(a.normalizeGlyphsURL(i).replace("{fontstack}",r).replace("{range}",`${p}-${g}`),Ss.Glyphs);ua(y,(w,b)=>{if(w)u(w);else if(b){const A={},I=function(M){return new ym(M).readFields($M,{})}(b);for(const M of I.glyphs)A[M.id]=M;u(null,{glyphs:A,ascender:I.ascender,descender:I.descender})}})},yu.TinySDF=class{constructor({fontSize:r=24,buffer:t=3,radius:i=8,cutoff:a=.25,fontFamily:u="sans-serif",fontWeight:p="normal",fontStyle:g="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=i;const y=this.size=r+4*t,w=this._createCanvas(y),b=this.ctx=w.getContext("2d",{willReadFrequently:!0});b.font=`${g} ${p} ${r}px ${u}`,b.textBaseline="alphabetic",b.textAlign="left",b.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}_createCanvas(r){const t=document.createElement("canvas");return t.width=t.height=r,t}draw(r){const{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:a,actualBoundingBoxLeft:u,actualBoundingBoxRight:p}=this.ctx.measureText(r),g=Math.ceil(i),y=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-u))),w=Math.min(this.size-this.buffer,g+Math.ceil(a)),b=y+2*this.buffer,A=w+2*this.buffer,I=Math.max(b*A,0),M=new Uint8ClampedArray(I),L={data:M,width:b,height:A,glyphWidth:y,glyphHeight:w,glyphTop:g,glyphLeft:0,glyphAdvance:t};if(y===0||w===0)return L;const{ctx:R,buffer:F,gridInner:$,gridOuter:K}=this;R.clearRect(F,F,y,w),R.fillText(r,F,F+g);const se=R.getImageData(F,F,y,w);K.fill(Ud,0,I),$.fill(0,0,I);for(let Y=0;Y0?Ie*Ie:0,$[ce]=Ie<0?Ie*Ie:0}}Ib(K,0,0,b,A,b,this.f,this.v,this.z),Ib($,F,F,y,w,b,this.f,this.v,this.z);for(let Y=0;YMe+Ue[1]-Ue[0],R=I.reduce(L,0),F=M.reduce(L,0),$=y-R,K=w-F;let se=0,Y=R,re=0,ue=F,ce=0,Ie=$,Te=0,De=K;if(p.content&&a){const Me=p.content;se=xm(I,0,Me[0]),re=xm(M,0,Me[1]),Y=xm(I,Me[0],Me[2]),ue=xm(M,Me[1],Me[3]),ce=Me[0]-se,Te=Me[1]-re,Ie=Me[2]-Me[0]-Y,De=Me[3]-Me[1]-ue}const Ze=(Me,Ue,je,Ge)=>{const et=wm(Me.stretch-se,Y,b,r.left),Le=bm(Me.fixed-ce,Ie,Me.stretch,R),ot=wm(Ue.stretch-re,ue,A,r.top),ft=bm(Ue.fixed-Te,De,Ue.stretch,F),st=wm(je.stretch-se,Y,b,r.left),At=bm(je.fixed-ce,Ie,je.stretch,R),tt=wm(Ge.stretch-re,ue,A,r.top),_t=bm(Ge.fixed-Te,De,Ge.stretch,F),Ct=new Ve(et,ot),Ht=new Ve(st,ot),It=new Ve(st,tt),bt=new Ve(et,tt),bn=new Ve(Le/g,ft/g),zt=new Ve(At/g,_t/g),Lt=t*Math.PI/180;if(Lt){const mn=Math.sin(Lt),un=Math.cos(Lt),kn=[un,-mn,mn,un];Ct._matMult(kn),Ht._matMult(kn),bt._matMult(kn),It._matMult(kn)}const cn=Me.stretch+Me.fixed,fn=Ue.stretch+Ue.fixed;return{tl:Ct,tr:Ht,bl:bt,br:It,tex:{x:p.paddedRect.x+vu+cn,y:p.paddedRect.y+vu+fn,w:je.stretch+je.fixed-cn,h:Ge.stretch+Ge.fixed-fn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:bn,pixelOffsetBR:zt,minFontScaleX:Ie/g/b,minFontScaleY:De/g/A,isSDF:i}};if(a&&(p.stretchX||p.stretchY)){const Me=Pb(I,$,R),Ue=Pb(M,K,F);for(let je=0;je0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:i,compare:a}=this,u=i[t];for(;t>0;){const p=t-1>>1,g=i[p];if(a(u,g)>=0)break;i[t]=g,t=p}i[t]=u}_down(t){const{data:i,compare:a}=this,u=this.length>>1,p=i[t];for(;t=0)break;i[t]=y,t=g}i[t]=p}}function QM(r,t){return rt?1:0}function eP(r,t=1,i=!1){let a=1/0,u=1/0,p=-1/0,g=-1/0;const y=r[0];for(let L=0;Lp)&&(p=R.x),(!L||R.y>g)&&(g=R.y)}const w=Math.min(p-a,g-u);let b=w/2;const A=new JM([],tP);if(w===0)return new Ve(a,u);for(let L=a;LI.d||!I.d)&&(I=L,i&&console.log("found best %d after %d probes",Math.round(1e4*L.d)/1e4,M)),L.max-I.d<=t||(b=L.h/2,A.push(new xu(L.p.x-b,L.p.y-b,b,r)),A.push(new xu(L.p.x+b,L.p.y-b,b,r)),A.push(new xu(L.p.x-b,L.p.y+b,b,r)),A.push(new xu(L.p.x+b,L.p.y+b,b,r)),M+=4)}return i&&(console.log(`num probes: ${M}`),console.log(`best distance: ${I.d}`)),I.p}function tP(r,t){return t.max-r.max}class xu{constructor(t,i,a,u){this.p=new Ve(t,i),this.h=a,this.d=function(p,g){let y=!1,w=1/0;for(let b=0;bp.y!=F.y>p.y&&p.x<(F.x-R.x)*(p.y-R.y)/(F.y-R.y)+R.x&&(y=!y),w=Math.min(w,Aw(p,R,F))}}return(y?1:-1)*Math.sqrt(w)}(this.p,u),this.max=this.d+this.h*Math.SQRT2}}const wu=7,t0=Number.POSITIVE_INFINITY,nP=Math.sqrt(2);function zb(r,[t,i]){let a=0,u=0;if(i===t0){t<0&&(t=0);const p=t/nP;switch(r){case"top-right":case"top-left":u=p-wu;break;case"bottom-right":case"bottom-left":u=-p+wu;break;case"bottom":u=-t+wu;break;case"top":u=t-wu}switch(r){case"top-right":case"bottom-right":a=-p;break;case"top-left":case"bottom-left":a=p;break;case"left":a=t;break;case"right":a=-t}}else{switch(t=Math.abs(t),i=Math.abs(i),r){case"top-right":case"top-left":case"top":u=i-wu;break;case"bottom-right":case"bottom-left":case"bottom":u=-i+wu}switch(r){case"top-right":case"bottom-right":case"right":a=-t;break;case"top-left":case"bottom-left":case"left":a=t}}return[a,u]}function rP(r,t,i,a,u,p,g,y,w,b){r.createArrays(),r.tilePixelRatio=vt/(512*r.overscaling),r.compareText={},r.iconsNeedLinear=!1;const A=r.layers[0].layout,I=r.layers[0]._unevaluatedLayout._values,M={};if(r.textSizeData.kind==="composite"){const{minZoom:F,maxZoom:$}=r.textSizeData;M.compositeTextSizes=[I["text-size"].possiblyEvaluate(new C(F),y),I["text-size"].possiblyEvaluate(new C($),y)]}if(r.iconSizeData.kind==="composite"){const{minZoom:F,maxZoom:$}=r.iconSizeData;M.compositeIconSizes=[I["icon-size"].possiblyEvaluate(new C(F),y),I["icon-size"].possiblyEvaluate(new C($),y)]}M.layoutTextSize=I["text-size"].possiblyEvaluate(new C(w+1),y),M.layoutIconSize=I["icon-size"].possiblyEvaluate(new C(w+1),y),M.textMaxSize=I["text-size"].possiblyEvaluate(new C(18),y);const L=A.get("text-rotation-alignment")==="map"&&A.get("symbol-placement")!=="point",R=A.get("text-size");for(const F of r.features){const $=A.get("text-font").evaluate(F,{},y).join(","),K=R.evaluate(F,{},y),se=M.layoutTextSize.evaluate(F,{},y),Y=(M.layoutIconSize.evaluate(F,{},y),{horizontal:{},vertical:void 0}),re=F.text;let ue,ce=[0,0];if(re){const De=re.toString(),Ze=A.get("text-letter-spacing").evaluate(F,{},y)*Tr,Me=A.get("text-line-height").evaluate(F,{},y)*Tr,Ue=uy(De)?Ze:0,je=A.get("text-anchor").evaluate(F,{},y),Ge=A.get("text-variable-anchor");if(!Ge){const st=A.get("text-radial-offset").evaluate(F,{},y);ce=st?zb(je,[st*Tr,t0]):A.get("text-offset").evaluate(F,{},y).map(At=>At*Tr)}let et=L?"center":A.get("text-justify").evaluate(F,{},y);const Le=A.get("symbol-placement")==="point",ot=Le?A.get("text-max-width").evaluate(F,{},y)*Tr:1/0,ft=st=>{r.allowVerticalPlacement&&hd(De)&&(Y.vertical=Jy(re,t,i,u,$,ot,Me,je,st,Ue,ce,Ni.vertical,!0,se,K))};if(!L&&Ge){const st=et==="auto"?Ge.map(tt=>n0(tt)):[et];let At=!1;for(let tt=0;tt=0||!hd(De)){const st=Jy(re,t,i,u,$,ot,Me,je,et,Ue,ce,Ni.horizontal,!1,se,K);st&&(Y.horizontal[et]=st)}ft(Le?"left":et)}}let Ie=!1;if(F.icon&&F.icon.name){const De=a[F.icon.name];De&&(ue=HM(u[F.icon.name],A.get("icon-offset").evaluate(F,{},y),A.get("icon-anchor").evaluate(F,{},y)),Ie=De.sdf,r.sdfIcons===void 0?r.sdfIcons=De.sdf:r.sdfIcons!==De.sdf&&wn("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(De.pixelRatio!==r.pixelRatio||A.get("icon-rotate").constantOr(1)!==0)&&(r.iconsNeedLinear=!0))}const Te=Rb(Y.horizontal)||Y.vertical;r.iconsInText||(r.iconsInText=!!Te&&Te.iconsInText),(Te||ue)&&iP(r,F,Y,ue,a,M,se,0,ce,Ie,g,y,b)}p&&r.generateCollisionDebugBuffers(w,r.collisionBoxArray)}function n0(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function iP(r,t,i,a,u,p,g,y,w,b,A,I,M){let L=p.textMaxSize.evaluate(t,{},I);L===void 0&&(L=g);const R=r.layers[0].layout,F=R.get("icon-offset").evaluate(t,{},I),$=Rb(i.horizontal)||i.vertical,K=M.name==="globe",se=Tr,Y=g/se,re=r.tilePixelRatio*L/se,ue=(je=r.overscaling,r.zoom>18&&je>2&&(je>>=1),Math.max(vt/(512*je),1)*R.get("symbol-spacing")),ce=R.get("text-padding")*r.tilePixelRatio,Ie=R.get("icon-padding")*r.tilePixelRatio,Te=St(R.get("text-max-angle")),De=R.get("text-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",Ze=R.get("icon-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",Me=R.get("symbol-placement"),Ue=ue/2;var je;const Ge=R.get("icon-text-fit");let et;a&&Ge!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(et=wb(a,i.vertical,Ge,R.get("icon-text-fit-padding"),F,Y)),$&&(a=wb(a,$,Ge,R.get("icon-text-fit-padding"),F,Y)));const Le=(ot,ft,st)=>{if(ft.x<0||ft.x>=vt||ft.y<0||ft.y>=vt)return;let At=null;if(K){const{x:tt,y:_t,z:Ct}=M.projectTilePoint(ft.x,ft.y,st);At={anchor:new qs(tt,_t,Ct,0,void 0),up:M.upVector(st,ft.x,ft.y)}}(function(tt,_t,Ct,Ht,It,bt,bn,zt,Lt,cn,fn,mn,un,kn,Rn,Zn,hn,nr,Hn,Mn,Kt,Xn,gn,Kr,Kn){const Sr=tt.addToLineVertexArray(_t,Ht);let mr,Yr,gr,No,Tu,Xd,Kd,p2=0,f2=0,m2=0,g2=0,_0=-1,y0=-1;const ds={};let _2=py("");const rc=Ct?Ct.anchor:_t;let v0=0,x0=0;if(Lt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[v0,x0]=Lt.layout.get("text-offset").evaluate(Kt,{},Kn).map(bi=>bi*Tr):(v0=Lt.layout.get("text-radial-offset").evaluate(Kt,{},Kn)*Tr,x0=t0),tt.allowVerticalPlacement&&It.vertical){const bi=It.vertical;if(Rn)Xd=r0(bi),zt&&(Kd=r0(zt));else{const Ei=Lt.layout.get("text-rotate").evaluate(Kt,{},Kn)+90;gr=Em(cn,rc,_t,fn,mn,un,bi,kn,Ei,Zn),zt&&(No=Em(cn,rc,_t,fn,mn,un,zt,nr,Ei))}}if(bt){const bi=Lt.layout.get("icon-rotate").evaluate(Kt,{},Kn),Ei=Lt.layout.get("icon-text-fit")!=="none",Yd=Mb(bt,bi,gn,Ei),b0=zt?Mb(zt,bi,gn,Ei):void 0;Yr=Em(cn,rc,_t,fn,mn,un,bt,nr,bi),p2=4*Yd.length;const y2=tt.iconSizeData;let ic=null;y2.kind==="source"?(ic=[Oo*Lt.layout.get("icon-size").evaluate(Kt,{},Kn)],ic[0]>Ra&&wn(`${tt.layerIds[0]}: Value for "icon-size" is >= ${jd}. Reduce your "icon-size".`)):y2.kind==="composite"&&(ic=[Oo*Xn.compositeIconSizes[0].evaluate(Kt,{},Kn),Oo*Xn.compositeIconSizes[1].evaluate(Kt,{},Kn)],(ic[0]>Ra||ic[1]>Ra)&&wn(`${tt.layerIds[0]}: Value for "icon-size" is >= ${jd}. Reduce your "icon-size".`)),tt.addSymbols(tt.icon,Yd,ic,Mn,Hn,Kt,!1,Ct,_t,Sr.lineStartIndex,Sr.lineLength,-1,Kr,Kn),_0=tt.icon.placedSymbolArray.length-1,b0&&(f2=4*b0.length,tt.addSymbols(tt.icon,b0,ic,Mn,Hn,Kt,Ni.vertical,Ct,_t,Sr.lineStartIndex,Sr.lineLength,-1,Kr,Kn),y0=tt.icon.placedSymbolArray.length-1)}for(const bi in It.horizontal){const Ei=It.horizontal[bi];mr||(_2=py(Ei.text),Rn?Tu=r0(Ei):mr=Em(cn,rc,_t,fn,mn,un,Ei,kn,Lt.layout.get("text-rotate").evaluate(Kt,{},Kn),Zn));const Yd=Ei.positionedLines.length===1;if(m2+=Lb(tt,Ct,_t,Ei,bn,Lt,Rn,Kt,Zn,Sr,It.vertical?Ni.horizontal:Ni.horizontalOnly,Yd?Object.keys(It.horizontal):[bi],ds,_0,Xn,Kr,Kn),Yd)break}It.vertical&&(g2+=Lb(tt,Ct,_t,It.vertical,bn,Lt,Rn,Kt,Zn,Sr,Ni.vertical,["vertical"],ds,y0,Xn,Kr,Kn));let Ua=-1;const w0=(bi,Ei)=>bi?Math.max(bi,Ei):Ei;Ua=w0(Tu,Ua),Ua=w0(Xd,Ua),Ua=w0(Kd,Ua);const zP=Ua>-1?1:0;tt.glyphOffsetArray.length>=Oa.MAX_GLYPHS&&wn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Kt.sortKey!==void 0&&tt.addToSortKeyRanges(tt.symbolInstances.length,Kt.sortKey),tt.symbolInstances.emplaceBack(rc.x,rc.y,rc.z,_t.x,_t.y,ds.right>=0?ds.right:-1,ds.center>=0?ds.center:-1,ds.left>=0?ds.left:-1,ds.vertical>=0?ds.vertical:-1,_0,y0,_2,mr!==void 0?mr:tt.collisionBoxArray.length,mr!==void 0?mr+1:tt.collisionBoxArray.length,gr!==void 0?gr:tt.collisionBoxArray.length,gr!==void 0?gr+1:tt.collisionBoxArray.length,Yr!==void 0?Yr:tt.collisionBoxArray.length,Yr!==void 0?Yr+1:tt.collisionBoxArray.length,No||tt.collisionBoxArray.length,No?No+1:tt.collisionBoxArray.length,fn,m2,g2,p2,f2,zP,0,v0,x0,Ua)})(r,ft,At,ot,i,a,u,et,r.layers[0],r.collisionBoxArray,t.index,t.sourceLayerIndex,r.index,ce,De,w,0,Ie,Ze,F,t,p,b,A,I)};if(Me==="line")for(const ot of Cb(t.geometry,0,0,vt,vt)){const ft=KM(ot,ue,Te,i.vertical||$,a,se,re,r.overscaling,vt);for(const st of ft)$&&oP(r,$.text,Ue,st)||Le(ot,st,I)}else if(Me==="line-center"){for(const ot of t.geometry)if(ot.length>1){const ft=XM(ot,Te,i.vertical||$,a,se,re);ft&&Le(ot,ft,I)}}else if(t.type==="Polygon")for(const ot of $y(t.geometry,0)){const ft=eP(ot,16);Le(ot[0],new qs(ft.x,ft.y,0,0,void 0),I)}else if(t.type==="LineString")for(const ot of t.geometry)Le(ot,new qs(ot[0].x,ot[0].y,0,0,void 0),I);else if(t.type==="Point")for(const ot of t.geometry)for(const ft of ot)Le([ft],new qs(ft.x,ft.y,0,0,void 0),I)}const jd=255,Ra=jd*Oo;function Lb(r,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$){const K=function(re,ue,ce,Ie,Te,De,Ze,Me){const Ue=[];if(ue.positionedLines.length===0)return Ue;const je=Ie.layout.get("text-rotate").evaluate(De,{})*Math.PI/180,Ge=function(st){const At=st[0],tt=st[1],_t=At*tt;return _t>0?[At,-tt]:_t<0?[-At,tt]:At===0?[tt,At]:[tt,-At]}(ce);let et=Math.abs(ue.top-ue.bottom);for(const st of ue.positionedLines)et-=st.lineOffset;const Le=ue.positionedLines.length,ot=et/Le;let ft=ue.top-ce[1];for(let st=0;stRa&&wn(`${r.layerIds[0]}: Value for "text-size" is >= ${jd}. Reduce your "text-size".`)):se.kind==="composite"&&(Y=[Oo*R.compositeTextSizes[0].evaluate(y,{},$),Oo*R.compositeTextSizes[1].evaluate(y,{},$)],(Y[0]>Ra||Y[1]>Ra)&&wn(`${r.layerIds[0]}: Value for "text-size" is >= ${jd}. Reduce your "text-size".`)),r.addSymbols(r.text,K,Y,w,g,y,A,t,i,b.lineStartIndex,b.lineLength,L,F,$);for(const re of I)M[re]=r.text.placedSymbolArray.length-1;return 4*K.length}function Rb(r){for(const t in r)return r[t];return null}function Em(r,t,i,a,u,p,g,y,w,b){let A=g.top,I=g.bottom,M=g.left,L=g.right;const R=g.collisionPadding;if(R&&(M-=R[0],A-=R[1],L+=R[2],I+=R[3]),w){const F=new Ve(M,A),$=new Ve(L,A),K=new Ve(M,I),se=new Ve(L,I),Y=St(w);let re=new Ve(0,0);b&&(re=new Ve(b[0],b[1])),F._rotateAround(Y,re),$._rotateAround(Y,re),K._rotateAround(Y,re),se._rotateAround(Y,re),M=Math.min(F.x,$.x,K.x,se.x),L=Math.max(F.x,$.x,K.x,se.x),A=Math.min(F.y,$.y,K.y,se.y),I=Math.max(F.y,$.y,K.y,se.y)}return r.emplaceBack(t.x,t.y,t.z,i.x,i.y,M,A,L,I,y,a,u,p),r.length-1}function r0(r){r.collisionPadding&&(r.top-=r.collisionPadding[1],r.bottom+=r.collisionPadding[3]);const t=r.bottom-r.top;return t>0?Math.max(10,t):null}function oP(r,t,i,a){const u=r.compareText;if(t in u){const p=u[t];for(let g=p.length-1;g>=0;g--)if(a.dist(p[g])Y&&(re(ce,Ge,Te,De,Ue,je),re(Ge,Ie,Ue,je,Ze,Me))}re(I,M,a,p,u,p),re(M,L,u,p,u,g),re(L,R,u,g,a,g),re(R,I,a,g,a,p),F-=Y,$-=Y,K+=Y,se+=Y;const ue=1/Math.max(K-F,se-$);return{scale:ue,x:F*ue,y:$*ue,x2:K*ue,y2:se*ue,projection:t}}const sP=Lo(new Float32Array(16));class Da{constructor(t){this.spec=t,this.name=t.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(t,i){return{x:0,y:0,z:0}}unproject(t,i){return new ln(0,0)}projectTilePoint(t,i,a){return{x:t,y:i,z:0}}locationPoint(t,i,a=!0){return t._coordinatePoint(t.locationCoordinate(i),a)}pixelsPerMeter(t,i){return Do(1,t)*i}pixelSpaceConversion(t,i,a){return 1}farthestPixelDistance(t){return Db(t,t.pixelsPerMeter)}pointCoordinate(t,i,a,u){const p=t.horizonLineFromTop(!1),g=new Ve(i,Math.max(p,a));return t.rayIntersectionCoordinate(t.pointRayIntersection(g,u))}pointCoordinate3D(t,i,a){const u=new Ve(i,a);if(t.elevation)return t.elevation.pointCoordinate(u);{const p=this.pointCoordinate(t,u.x,u.y,0);return[p.x,p.y,p.z]}}isPointAboveHorizon(t,i){if(t.elevation)return!this.pointCoordinate3D(t,i.x,i.y);const a=t.horizonLineFromTop();return i.y0?i<-bu+a&&(i=-bu+a):i>bu-a&&(i=bu-a);const g=p/Math.pow(Sm(i),u);let y=g*Math.sin(u*t),w=p-g*Math.cos(u*t);return y=.5*(y/Math.PI+.5),w=.5*(w/Math.PI+.5),{x:y,y:this.southernCenter?w:1-w,z:0}}unproject(t,i){t=(2*t-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n:a,f:u}=this,p=u-i,g=Math.sign(p),y=Math.sign(a)*Math.sqrt(t*t+p*p);let w=Math.atan2(t,Math.abs(p))*g;p*a<0&&(w-=Math.PI*Math.sign(t)*g);const b=Je(Vt(w/a)+this.center[0],-180,180),A=Je(Vt(2*Math.atan(Math.pow(u/y,1/a))-bu),-zr,zr);return new ln(b,this.southernCenter?-A:A)}}class Ob extends Da{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(t,i){return{x:as(t),y:ls(i),z:0}}unproject(t,i){const a=Fi(t),u=Pr(i);return new ln(a,u)}}const Bb=St(zr);class hP extends Da{project(t,i){const a=(i=St(i))*i,u=a*a;return{x:.5*((t=St(t))*(.8707-.131979*a+u*(u*(.003971*a-.001529*u)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+a*(.015085+u*(.028874*a-.044475-.005916*u)))/Math.PI+1),z:0}}unproject(t,i){t=(2*t-.5)*Math.PI;let a=i=(2*(1-i)-1)*Math.PI,u=25,p=0,g=a*a;do{g=a*a;const b=g*g;p=(a*(1.007226+g*(.015085+b*(.028874*g-.044475-.005916*b)))-i)/(1.007226+g*(.045255+b*(.259866*g-.311325-.005916*11*b))),a=Je(a-p,-Bb,Bb)}while(Math.abs(p)>1e-6&&--u>0);g=a*a;const y=Je(Vt(t/(.8707+g*(g*(g*g*g*(.003971-.001529*g)-.013791)-.131979))),-180,180),w=Vt(a);return new ln(y,w)}}const Fb=St(zr);class dP extends Da{project(t,i){i=St(i),t=St(t);const a=Math.cos(i),u=2/Math.PI,p=Math.acos(a*Math.cos(t/2)),g=Math.sin(p)/p,y=.5*(t*u+2*a*Math.sin(t/2)/g)||0,w=.5*(i+Math.sin(i)/g)||0;return{x:.5*(y/Math.PI+.5),y:1-.5*(w/Math.PI+1),z:0}}unproject(t,i){let a=t=(2*t-.5)*Math.PI,u=i=(2*(1-i)-1)*Math.PI,p=25;const g=1e-6;let y=0,w=0;do{const b=Math.cos(u),A=Math.sin(u),I=2*A*b,M=A*A,L=b*b,R=Math.cos(a/2),F=Math.sin(a/2),$=2*R*F,K=F*F,se=1-L*R*R,Y=se?1/se:0,re=se?Math.acos(b*R)*Math.sqrt(1/se):0,ue=.5*(2*re*b*F+2*a/Math.PI)-t,ce=.5*(re*A+u)-i,Ie=.5*Y*(L*K+re*b*R*M)+1/Math.PI,Te=Y*($*I/4-re*A*F),De=.125*Y*(I*F-re*A*L*$),Ze=.5*Y*(M*R+re*K*b)+.5,Me=Te*De-Ze*Ie;y=(ce*Te-ue*Ze)/Me,w=(ue*De-ce*Ie)/Me,a=Je(a-y,-Math.PI,Math.PI),u=Je(u-w,-Fb,Fb)}while((Math.abs(y)>g||Math.abs(w)>g)&&--p>0);return new ln(Vt(a),Vt(u))}}class Nb extends Da{constructor(t){super(t),this.center=t.center||[0,0],this.parallels=t.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(St(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(t,i){const{scale:a,cosPhi:u}=this;return{x:St(t)*u*a+.5,y:-Math.sin(St(i))/u*a+.5,z:0}}unproject(t,i){const{scale:a,cosPhi:u}=this,p=-(i-.5)/a,g=Je(Vt((t-.5)/a)/u,-180,180),y=Math.asin(Je(p*u,-1,1)),w=Je(Vt(y),-zr,zr);return new ln(g,w)}}class pP extends Ob{constructor(t){super(t),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(t,i,a){const u=Ad(t,i,a);return Nn(u,u,Cd(ss(a))),{x:u[0],y:u[1],z:u[2]}}locationPoint(t,i){const a=au(i.lat,i.lng),u=Zr([],a),p=t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(i),t._centerAltitude):t._centerAltitude;bd(a,a,u,Do(1,0)*vt*p);const g=Lo(new Float64Array(16));return Zl(g,t.pixelMatrix,t.globeMatrix),Nn(a,a,g),new Ve(a[0],a[1])}pixelsPerMeter(t,i){return Do(1,0)*i}pixelSpaceConversion(t,i,a){const u=Do(1,t)*i,p=Wt(Do(1,45)*i,u,a);return this.pixelsPerMeter(t,i)/p}createTileMatrix(t,i,a){const u=Cy(ss(a.canonical));return Zl(new Float64Array(16),t.globeMatrix,u)}createInversionMatrix(t,i){const{center:a}=t,u=Cd(ss(i));return Qf(u,u,St(a.lng)),_y(u,u,St(a.lat)),Hl(u,u,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(u)}pointCoordinate(t,i,a,u){return dw(t,i,a,!0)||new cu(0,0)}pointCoordinate3D(t,i,a){const u=this.pointCoordinate(t,i,a,0);return[u.x,u.y,u.z]}isPointAboveHorizon(t,i){return!dw(t,i.x,i.y,!1)}farthestPixelDistance(t){const i=function(u,p){const g=u.cameraToCenterDistance,y=u._centerAltitude*p,w=u._camera,b=u._camera.forward(),A=js([],Bi([],b,-g),[0,0,y]),I=u.worldSize/(2*Math.PI),M=[0,0,-I],L=u.width/u.height,R=Math.tan(u.fovAboveCenter),F=Bi([],w.up(),R),$=Bi([],w.right(),R*L),K=Zr([],js([],js([],b,F),$)),se=[];let Y;if(new wy(A,K).closestPointOnSphere(M,I,se)){const re=js([],se,M),ue=Ro([],re,A);Y=Math.cos(u.fovAboveCenter)*vd(ue)}else{const re=Ro([],A,M),ue=Ro([],M,A);Zr(ue,ue);const ce=vd(re)-I;Y=Math.sqrt(ce*(ce+2*I));const Ie=Math.acos(Y/(I+ce))-Math.acos(oo(b,ue));Y*=Math.cos(Ie)}return 1.01*Y}(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),a=lu(t.zoom);if(a>0){const u=Db(t,Do(1,t.center.lat)*t.worldSize),p=t.worldSize/(2*Math.PI),g=Math.max(t.width,t.height)/t.worldSize*Math.PI;return Wt(i,u+p*(1-Math.cos(g)),Math.pow(a,10))}return i}upVector(t,i,a){return Ad(i,a,t,1)}upVectorScale(t){return{metersToTile:em(nm(ss(t)))}}}function Ub(r){const t=r.parallels,i=!!t&&Math.abs(t[0]+t[1])<.01;switch(r.name){case"mercator":return new Ob(r);case"equirectangular":return new cP(r);case"naturalEarth":return new hP(r);case"equalEarth":return new lP(r);case"winkelTripel":return new dP(r);case"albers":return i?new Nb(r):new aP(r);case"lambertConformalConic":return i?new Nb(r):new uP(r);case"globe":return new pP(r)}throw new Error(`Invalid projection name: ${r.name}`)}const fP=dm.types,mP=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Am(r,t,i,a,u,p,g,y,w,b,A,I,M){const L=y?Math.min(Ra,Math.round(y[0])):0,R=y?Math.min(Ra,Math.round(y[1])):0;r.emplaceBack(t,i,Math.round(32*a),Math.round(32*u),p,g,(L<<1)+(w?1:0),R,16*b,16*A,256*I,256*M)}function Cm(r,t,i,a,u,p,g){r.emplaceBack(t,i,a,u,p,g)}function Im(r,t,i,a,u){r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u)}function gP(r){for(const t of r.sections)if(dy(t.text))return!0;return!1}class i0{constructor(t){this.layoutVertexArray=new $e,this.indexArray=new mt,this.programConfigurations=t,this.segments=new qn,this.dynamicLayoutVertexArray=new qe,this.opacityVertexArray=new gt,this.placedSymbolArray=new Gn,this.globeExtVertexArray=new Ye}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,i,a,u){this.isEmpty()||(a&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,TM.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,AM.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,mP,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,SM.members,!0)),this.opacityVertexBuffer.itemSize=1),(a||u)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}dt(i0,"SymbolBuffers");class o0{constructor(t,i,a){this.layoutVertexArray=new t,this.layoutAttributes=i,this.indexArray=new a,this.segments=new qn,this.collisionVertexArray=new Ut,this.collisionVertexArrayExt=new Ot}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,CM.members,!0),this.collisionVertexBufferExt=t.createVertexBuffer(this.collisionVertexArrayExt,IM.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}dt(o0,"CollisionBuffers");class Oa{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(g=>g.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Lo([]),this.placementViewportMatrix=Lo([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Zy(this.zoom,i["text-size"]),this.iconSizeData=Zy(this.zoom,i["icon-size"]);const a=this.layers[0].layout,u=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=a.get("text-allow-overlap")||a.get("icon-allow-overlap")||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&u.constantOr(1)!==void 0,this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=a.get("text-writing-mode").map(g=>Ni[g]),this.stateDependentLayerIds=this.layers.filter(g=>g.isStateDependent()).map(g=>g.id),this.sourceID=t.sourceID,this.projection=t.projection}createArrays(){this.text=new i0(new Wl(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new i0(new Wl(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new Wr,this.lineVertexArray=new nu,this.symbolInstances=new En}calculateGlyphDependencies(t,i,a,u,p){for(let g=0;g0)&&(w.value.kind!=="constant"||w.value.value.length>0),M=A.value.kind!=="constant"||!!A.value.value||Object.keys(A.parameters).length>0,L=g.get("symbol-sort-key");if(this.features=[],!I&&!M)return;const R=i.iconDependencies,F=i.glyphDependencies,$=i.availableImages,K=new C(this.zoom);for(const{feature:se,id:Y,index:re,sourceLayerIndex:ue}of t){const ce=p._featureFilter.needGeometry,Ie=Jl(se,ce);if(!p._featureFilter.filter(K,Ie,a))continue;if(ce||(Ie.geometry=Vs(se,a,u)),y&&se.type!==1&&a.z<=5){const Me=Ie.geometry,Ue=.98078528056,je=(Ge,et)=>oo(Ad(Ge.x,Ge.y,a,1),Ad(et.x,et.y,a,1))=0;for(const je of Te.sections)if(je.image)R[je.image.name]=!0;else{const Ge=hd(Te.toString()),et=je.fontStack||Me,Le=F[et]=F[et]||{};this.calculateGlyphDependencies(je.text,Le,Ue,this.allowVerticalPlacement,Ge)}}}g.get("symbol-placement")==="line"&&(this.features=function(se){const Y={},re={},ue=[];let ce=0;function Ie(Me){ue.push(se[Me]),ce++}function Te(Me,Ue,je){const Ge=re[Me];return delete re[Me],re[Ue]=Ge,ue[Ge].geometry[0].pop(),ue[Ge].geometry[0]=ue[Ge].geometry[0].concat(je[0]),Ge}function De(Me,Ue,je){const Ge=Y[Ue];return delete Y[Ue],Y[Me]=Ge,ue[Ge].geometry[0].shift(),ue[Ge].geometry[0]=je[0].concat(ue[Ge].geometry[0]),Ge}function Ze(Me,Ue,je){const Ge=je?Ue[0][Ue[0].length-1]:Ue[0][0];return`${Me}:${Ge.x}:${Ge.y}`}for(let Me=0;MeMe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((se,Y)=>se.sortKey-Y.sortKey)}update(t,i,a,u){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,i,this.layers,a,u),this.icon.programConfigurations.updatePaintArrays(t,i,this.layers,a,u))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Ub(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,i){const a=this.lineVertexArray.length;if(t.segment!==void 0)for(const{x:u,y:p}of i)this.lineVertexArray.emplaceBack(u,p);return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=t.indexArray,$=t.layoutVertexArray,K=t.globeExtVertexArray,se=t.segments.prepareSegment(4*i.length,$,F,this.canOverlap?g.sortKey:void 0),Y=this.glyphOffsetArray.length,re=se.vertexLength,ue=this.allowVerticalPlacement&&y===Ni.vertical?Math.PI/2:0,ce=g.text&&g.text.sections;for(let Te=0;Te=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:u),g=gm(this.textSizeData,t,p)/Tr;return this.tilePixelRatio*g}getSymbolInstanceIconSize(t,i,a){const u=this.icon.placedSymbolArray.get(a),p=gm(this.iconSizeData,t,u);return this.tilePixelRatio*p}_commitDebugCollisionVertexUpdate(t,i,a){t.emplaceBack(i,-a,-a),t.emplaceBack(i,a,-a),t.emplaceBack(i,a,a),t.emplaceBack(i,-a,a)}_updateTextDebugCollisionBoxes(t,i,a,u,p,g){for(let y=u;y0}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(t,i){const a=t.placedSymbolArray.get(i),u=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;pu[y]-u[w]||p[w]-p[y]),g}addToSortKeyRanges(t,i){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===i?a.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex);const{rightJustifiedTextSymbolIndex:u,centerJustifiedTextSymbolIndex:p,leftJustifiedTextSymbolIndex:g,verticalPlacedTextSymbolIndex:y,placedIconSymbolIndex:w,verticalPlacedIconSymbolIndex:b}=a;u>=0&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&p!==u&&this.addIndicesForPlacedSymbol(this.text,p),g>=0&&g!==p&&g!==u&&this.addIndicesForPlacedSymbol(this.text,g),y>=0&&this.addIndicesForPlacedSymbol(this.text,y),w>=0&&this.addIndicesForPlacedSymbol(this.icon,w),b>=0&&this.addIndicesForPlacedSymbol(this.icon,b)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}dt(Oa,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Oa.MAX_GLYPHS=65535,Oa.addDynamicAttributes=Im;const _P=new ee({"symbol-placement":new B(Re.layout_symbol["symbol-placement"]),"symbol-spacing":new B(Re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new B(Re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new q(Re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new B(Re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new B(Re.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new B(Re.layout_symbol["icon-ignore-placement"]),"icon-optional":new B(Re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new B(Re.layout_symbol["icon-rotation-alignment"]),"icon-size":new q(Re.layout_symbol["icon-size"]),"icon-text-fit":new B(Re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new B(Re.layout_symbol["icon-text-fit-padding"]),"icon-image":new q(Re.layout_symbol["icon-image"]),"icon-rotate":new q(Re.layout_symbol["icon-rotate"]),"icon-padding":new B(Re.layout_symbol["icon-padding"]),"icon-keep-upright":new B(Re.layout_symbol["icon-keep-upright"]),"icon-offset":new q(Re.layout_symbol["icon-offset"]),"icon-anchor":new q(Re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new B(Re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new B(Re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new B(Re.layout_symbol["text-rotation-alignment"]),"text-field":new q(Re.layout_symbol["text-field"]),"text-font":new q(Re.layout_symbol["text-font"]),"text-size":new q(Re.layout_symbol["text-size"]),"text-max-width":new q(Re.layout_symbol["text-max-width"]),"text-line-height":new q(Re.layout_symbol["text-line-height"]),"text-letter-spacing":new q(Re.layout_symbol["text-letter-spacing"]),"text-justify":new q(Re.layout_symbol["text-justify"]),"text-radial-offset":new q(Re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new B(Re.layout_symbol["text-variable-anchor"]),"text-anchor":new q(Re.layout_symbol["text-anchor"]),"text-max-angle":new B(Re.layout_symbol["text-max-angle"]),"text-writing-mode":new B(Re.layout_symbol["text-writing-mode"]),"text-rotate":new q(Re.layout_symbol["text-rotate"]),"text-padding":new B(Re.layout_symbol["text-padding"]),"text-keep-upright":new B(Re.layout_symbol["text-keep-upright"]),"text-transform":new q(Re.layout_symbol["text-transform"]),"text-offset":new q(Re.layout_symbol["text-offset"]),"text-allow-overlap":new B(Re.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new B(Re.layout_symbol["text-ignore-placement"]),"text-optional":new B(Re.layout_symbol["text-optional"])});var s0={paint:new ee({"icon-opacity":new q(Re.paint_symbol["icon-opacity"]),"icon-color":new q(Re.paint_symbol["icon-color"]),"icon-halo-color":new q(Re.paint_symbol["icon-halo-color"]),"icon-halo-width":new q(Re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new q(Re.paint_symbol["icon-halo-blur"]),"icon-translate":new B(Re.paint_symbol["icon-translate"]),"icon-translate-anchor":new B(Re.paint_symbol["icon-translate-anchor"]),"text-opacity":new q(Re.paint_symbol["text-opacity"]),"text-color":new q(Re.paint_symbol["text-color"],{runtimeType:si,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new q(Re.paint_symbol["text-halo-color"]),"text-halo-width":new q(Re.paint_symbol["text-halo-width"]),"text-halo-blur":new q(Re.paint_symbol["text-halo-blur"]),"text-translate":new B(Re.paint_symbol["text-translate"]),"text-translate-anchor":new B(Re.paint_symbol["text-translate-anchor"])}),layout:_P};class jb{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:da,this.defaultValue=t}evaluate(t){if(t.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(t.formattedSection))return i.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}dt(jb,"FormatSectionOverride",{omit:["defaultValue"]});class km extends zo{constructor(t){super(t,s0)}recalculate(t,i){super.recalculate(t,i),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")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const a=this.layout.get("text-writing-mode");if(a){const u=[];for(const p of a)u.indexOf(p)<0&&u.push(p);this.layout._values["text-writing-mode"]=u}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(t,i,a,u){const p=this.layout.get(t).evaluate(i,{},a,u),g=this._unevaluatedLayout._values[t];return g.isDataDriven()||Ta(g.value)||!p?p:function(y,w){return w.replace(/{([^{}]+)}/g,(b,A)=>A in y?String(y[A]):"")}(i.properties,p)}createBucket(t){return new Oa(t)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const t of s0.paint.overridableProperties){if(!km.hasPaintOverride(this.layout,t))continue;const i=this.paint.get(t),a=new jb(i),u=new Hc(a,i.property.specification);let p=null;p=i.value.kind==="constant"||i.value.kind==="source"?new ed("source",u):new Bl("composite",u,i.value.zoomStops,i.value._interpolationType),this.paint._values[t]=new Z(i.property,p,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,a){return!(!this.layout||i.isDataDriven()||a.isDataDriven())&&km.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,i){const a=t.get("text-field"),u=s0.paint.properties[i];let p=!1;const g=y=>{for(const w of y)if(u.overrides&&u.overrides.hasOverride(w))return void(p=!0)};if(a.value.kind==="constant"&&a.value.value instanceof qr)g(a.value.value.sections);else if(a.value.kind==="source"){const y=b=>{p||(b instanceof Ms&&Ln(b.value)===xl?g(b.value.sections):b instanceof ns?g(b.sections):b.eachChild(y))},w=a.value;w._styleExpression&&y(w._styleExpression.expression)}return p}getProgramConfiguration(t){return new Pa(this,t)}}var yP={paint:new ee({"background-color":new B(Re.paint_background["background-color"]),"background-pattern":new B(Re.paint_background["background-pattern"]),"background-opacity":new B(Re.paint_background["background-opacity"])})},vP={paint:new ee({"raster-opacity":new B(Re.paint_raster["raster-opacity"]),"raster-hue-rotate":new B(Re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new B(Re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new B(Re.paint_raster["raster-brightness-max"]),"raster-saturation":new B(Re.paint_raster["raster-saturation"]),"raster-contrast":new B(Re.paint_raster["raster-contrast"]),"raster-resampling":new B(Re.paint_raster["raster-resampling"]),"raster-fade-duration":new B(Re.paint_raster["raster-fade-duration"])})};class xP extends zo{constructor(t){super(t,{}),this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)}}var wP={paint:new ee({"sky-type":new B(Re.paint_sky["sky-type"]),"sky-atmosphere-sun":new B(Re.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new B(Re.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new B(Re.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new B(Re.paint_sky["sky-gradient-radius"]),"sky-gradient":new Q(Re.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new B(Re.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new B(Re.paint_sky["sky-atmosphere-color"]),"sky-opacity":new B(Re.paint_sky["sky-opacity"])})};function a0(r,t,i){const a=[0,0,1],u=sw([]);return lw(u,u,i?-St(r)+Math.PI:St(r)),aw(u,u,-St(t)),nw(a,a,u),Zr(a,a)}const bP={circle:class extends zo{constructor(r){super(r,Lk)}createBucket(r){return new Ly(r)}queryRadius(r){const t=r;return uu("circle-radius",this,t)+uu("circle-stroke-width",this,t)+om(this.paint.get("circle-translate"))}queryIntersectsFeature(r,t,i,a,u,p,g,y){const w=Mw(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),b=this.paint.get("circle-radius").evaluate(t,i)+this.paint.get("circle-stroke-width").evaluate(t,i);return Pw(r,a,p,g,y,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",w,b)}getProgramIds(){return["circle"]}getProgramConfiguration(r){return new Pa(this,r)}},heatmap:class extends zo{createBucket(r){return new Lw(r)}constructor(r){super(r,Bk),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(r){r==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=By({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(r){return uu("heatmap-radius",this,r)}queryIntersectsFeature(r,t,i,a,u,p,g,y){const w=this.paint.get("heatmap-radius").evaluate(t,i);return Pw(r,a,p,g,y,!0,!0,new Ve(0,0),w)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(r){return new Pa(this,r)}},hillshade:class extends zo{constructor(r){super(r,Fk)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends zo{constructor(r){super(r,eM)}getProgramIds(){const r=this.paint.get("fill-pattern"),t=r&&r.constantOr(1),i=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(r){return new Pa(this,r)}recalculate(r,t){super.recalculate(r,t);const i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(r){return new um(r)}queryRadius(){return om(this.paint.get("fill-translate"))}queryIntersectsFeature(r,t,i,a,u,p){return!r.queryGeometry.isAboveHorizon&&Sw(kw(r.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),a)}isTileClipped(){return!0}},"fill-extrusion":class extends zo{constructor(r){super(r,gM)}createBucket(r){return new Dd(r)}queryRadius(){return om(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(r){return new Pa(this,r)}queryIntersectsFeature(r,t,i,a,u,p,g,y,w){const b=Mw(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),A=this.paint.get("fill-extrusion-height").evaluate(t,i),I=this.paint.get("fill-extrusion-base").evaluate(t,i),M=[0,0],L=y&&p.elevation,R=p.elevation?p.elevation.exaggeration():1,F=r.tile.getBucket(this);if(L&&F instanceof Dd){const re=F.centroidVertexArray,ue=w+1;uere.polygon).flat());const $=L?y:null,[K,se]=function(re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge){return re.projection.name==="globe"?function(et,Le,ot,ft,st,At,tt,_t,Ct,Ht,It){const bt=[],bn=[],zt=et.projection.upVectorScale(It,et.center.lat,et.worldSize).metersToTile,Lt=[0,0,0,1],cn=[0,0,0,1],fn=(un,kn,Rn,Zn)=>{un[0]=kn,un[1]=Rn,un[2]=Zn,un[3]=1},mn=Kw();ot>0&&(ot+=mn),ft+=mn;for(const un of Le){const kn=[],Rn=[];for(const Zn of un){const hn=Zn.x+st.x,nr=Zn.y+st.y,Hn=et.projection.projectTilePoint(hn,nr,It),Mn=et.projection.upVector(It,Zn.x,Zn.y);let Kt=ot,Xn=ft;if(tt){const gn=tb(hn,nr,ot,ft,tt,_t,Ct,Ht);Kt+=gn.base,Xn+=gn.top}ot!==0?fn(Lt,Hn.x+Mn[0]*zt*Kt,Hn.y+Mn[1]*zt*Kt,Hn.z+Mn[2]*zt*Kt):fn(Lt,Hn.x,Hn.y,Hn.z),fn(cn,Hn.x+Mn[0]*zt*Xn,Hn.y+Mn[1]*zt*Xn,Hn.z+Mn[2]*zt*Xn),Nn(Lt,Lt,At),Nn(cn,cn,At),kn.push(new pu(Lt[0],Lt[1],Lt[2])),Rn.push(new pu(cn[0],cn[1],cn[2]))}bt.push(kn),bn.push(Rn)}return[bt,bn]}(re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge):Ze?function(et,Le,ot,ft,st,At,tt,_t,Ct){const Ht=[],It=[],bt=[0,0,0,1];for(const bn of et){const zt=[],Lt=[];for(const cn of bn){const fn=cn.x+ft.x,mn=cn.y+ft.y,un=tb(fn,mn,Le,ot,At,tt,_t,Ct);bt[0]=fn,bt[1]=mn,bt[2]=un.base,bt[3]=1,Xl(bt,bt,st),bt[3]=Math.max(bt[3],1e-5);const kn=new pu(bt[0]/bt[3],bt[1]/bt[3],bt[2]/bt[3]);bt[0]=fn,bt[1]=mn,bt[2]=un.top,bt[3]=1,Xl(bt,bt,st),bt[3]=Math.max(bt[3],1e-5);const Rn=new pu(bt[0]/bt[3],bt[1]/bt[3],bt[2]/bt[3]);zt.push(kn),Lt.push(Rn)}Ht.push(zt),It.push(Lt)}return[Ht,It]}(ue,ce,Ie,Te,De,Ze,Me,Ue,je):function(et,Le,ot,ft,st){const At=[],tt=[],_t=st[8]*Le,Ct=st[9]*Le,Ht=st[10]*Le,It=st[11]*Le,bt=st[8]*ot,bn=st[9]*ot,zt=st[10]*ot,Lt=st[11]*ot;for(const cn of et){const fn=[],mn=[];for(const un of cn){const kn=un.x+ft.x,Rn=un.y+ft.y,Zn=st[0]*kn+st[4]*Rn+st[12],hn=st[1]*kn+st[5]*Rn+st[13],nr=st[2]*kn+st[6]*Rn+st[14],Hn=st[3]*kn+st[7]*Rn+st[15],Mn=Zn+_t,Kt=hn+Ct,Xn=nr+Ht,gn=Math.max(Hn+It,1e-5),Kr=Zn+bt,Kn=hn+bn,Sr=nr+zt,mr=Math.max(Hn+Lt,1e-5);fn.push(new pu(Mn/gn,Kt/gn,Xn/gn)),mn.push(new pu(Kr/mr,Kn/mr,Sr/mr))}At.push(fn),tt.push(mn)}return[At,tt]}(ue,ce,Ie,Te,De)}(p,a,I,A,b,g,$,M,R,p.center.lat,r.tileID.canonical),Y=r.queryGeometry;return function(re,ue,ce){let Ie=1/0;Sw(ce,ue)&&(Ie=eb(ce,ue[0]));for(let Te=0;Te=3){for(let R=0;R{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(){this._channel=void 0,this._callback=()=>{}}}class TP{constructor(){this.tasks={},this.taskQueue=[],Yi(["process"],this),this.invoker=new EP(this.process),this.nextId=0}add(t,i){const a=this.nextId++,u=function({type:p,isSymbolTile:g,zoom:y}){return y=y||0,p==="message"?0:p!=="maybePrepare"||g?p!=="parseTile"||g?p==="parseTile"&&g?300-y:p==="maybePrepare"&&g?400-y:500:200-y:100-y}(i);if(u===0){vo();try{t()}finally{}return{cancel:()=>{}}}return this.tasks[a]={fn:t,metadata:i,priority:u,id:a},this.taskQueue.push(a),this.invoker.trigger(),{cancel:()=>{delete this.tasks[a]}}}process(){vo();try{if(this.taskQueue=this.taskQueue.filter(a=>!!this.tasks[a]),!this.taskQueue.length)return;const t=this.pick();if(t===null)return;const i=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let t=null,i=1/0;for(let u=0;u>=1)>1;){const b=i+u>>1,A=a+p>>1;1&t?(u=i,p=a,i=g,a=y):(i=u,a=p,u=g,p=y),g=b,y=A}const w=4*r;Ba[w+0]=i,Ba[w+1]=a,Ba[w+2]=u,Ba[w+3]=p}const us=new Uint16Array(2178),Fa=new Uint8Array(1089),Mm=new Uint16Array(1089);function Gb(r){return r===0?-.03125:r===32?.03125:0}var qb=ye([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const Wb={type:2,extent:vt,loadGeometry:()=>[[new Ve(0,0),new Ve(vt+1,0),new Ve(vt+1,vt+1),new Ve(0,vt+1),new Ve(0,0)]]};class l0{constructor(t,i,a,u,p){this.tileID=t,this.uid=ii(),this.uses=0,this.tileSize=i,this.tileZoom=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=p,this.expiredRequestCount=0,this.state="loading",u&&u.transform&&(this.projection=u.transform.projection)}registerFadeDuration(t){const i=t+this.timeAdded;ip.getLayer(b)).filter(Boolean);if(w.length!==0){y.layers=w,y.stateDependentLayerIds&&(y.stateDependentLayers=y.stateDependentLayerIds.map(b=>w.filter(A=>A.id===b)[0]));for(const b of w)g[b.id]=y}}return g}(t.buckets,i.style),this.hasSymbolBuckets=!1;for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Oa){if(this.hasSymbolBuckets=!0,!a)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Oa&&p.hasRTLText){this.hasRTLText=!0,S.isLoading()||S.isLoaded()||x()!=="deferred"||T();break}}this.queryPadding=0;for(const u in this.buckets){const p=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(u).queryRadius(p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas)}else this.collisionBoxArray=new an}unloadVectorData(){if(this.hasData()){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const u=this.buckets[a];u.uploadPending()&&u.upload(t)}const i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Wd(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Wd(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Wd(t,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,i,a,u,p,g,y,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:u,pixelPosMatrix:y,transform:g,params:p,tileTransform:this.tileTransform},t,i,a):{}}querySourceFeatures(t,i){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const u=a.loadVTLayers(),p=i?i.sourceLayer:"",g=u._geojsonTileLayer||u[p];if(!g)return;const y=Jc(i&&i.filter),{z:w,x:b,y:A}=this.tileID.canonical,I={z:w,x:b,y:A};for(let M=0;Ma)u=!1;else if(i)if(this.expirationTime=0;$--){const K=4*$,se=Ba[K+0],Y=Ba[K+1],re=Ba[K+2],ue=Ba[K+3],ce=se+re>>1,Ie=Y+ue>>1,Te=ce+Ie-Y,De=Ie+se-ce,Ze=Y*cs+se,Me=ue*cs+re,Ue=Ie*cs+ce,je=Math.hypot((us[2*Ze+0]+us[2*Me+0])/2-us[2*Ue+0],(us[2*Ze+1]+us[2*Me+1])/2-us[2*Ue+1])>=16;Fa[Ue]=Fa[Ue]||(je?1:0),$<1022&&(Fa[Ue]=Fa[Ue]||Fa[(Y+De>>1)*cs+(se+Te>>1)]||Fa[(ue+De>>1)*cs+(re+Te>>1)])}const I=new Fe,M=new mt;let L=0;function R($,K){const se=K*cs+$;return Mm[se]===0&&(I.emplaceBack(us[2*se+0],us[2*se+1],$*vt/lo,K*vt/lo),Mm[se]=++L),Mm[se]-1}function F($,K,se,Y,re,ue){const ce=$+se>>1,Ie=K+Y>>1;if(Math.abs($-re)+Math.abs(K-ue)>1&&Fa[Ie*cs+ce])F(re,ue,$,K,ce,Ie),F(se,Y,re,ue,ce,Ie);else{const Te=R($,K),De=R(se,Y),Ze=R(re,ue);M.emplaceBack(Te,De,Ze)}}return F(0,0,lo,lo,lo,0),F(lo,lo,0,0,0,lo),{vertices:I,indices:M}}(this.tileID.canonical,i);u=g.vertices,p=g.indices}else{u=new Fe,p=new mt;for(const{x:y,y:w}of a)u.emplaceBack(y,w,0,0);const g=Vy(u.int16,void 0,4);for(let y=0;y0&&(y=gy(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,u,i,p,y,g),this._makeGlobeTileDebugTextBuffer(t,u,i,p,y,g)}_globePoint(t,i,a,u,p,g,y){let w=Ad(t,i,a);if(g){const b=1<.5?L=-1:M<-.5&&(L=1);let R=(t/vt+a.x)/b+L,F=(i/vt+a.y)/b;R=(R-A)*u._pixelsPerMercatorPixel+A,F=(F-I)*u._pixelsPerMercatorPixel+I;const $=[R*u.worldSize,F*u.worldSize,0];Nn($,$,g),w=Yl(w,$,y)}return Nn(w,w,p)}_makeGlobeTileDebugBorderBuffer(t,i,a,u,p,g){const y=new We,w=new vi,b=new Ee,A=(M,L,R,F,$)=>{const K=(R-M)/($-1),se=(F-L)/($-1),Y=y.length;for(let re=0;re<$;re++){const ue=M+re*K,ce=L+re*se;y.emplaceBack(ue,ce);const Ie=this._globePoint(ue,ce,i,a,u,p,g);b.emplaceBack(Ie[0],Ie[1],Ie[2]),w.emplaceBack(Y+re)}},I=vt;A(0,0,I,0,16),A(I,0,I,I,16),A(I,I,0,I,16),A(0,I,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(w),this._tileDebugBuffer=t.createVertexBuffer(y,Td.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(b,uw.members),this._tileDebugSegments=qn.simpleSegment(0,0,y.length,w.length)}_makeGlobeTileDebugTextBuffer(t,i,a,u,p,g){const y=vt/4,w=new We,b=new mt,A=new Ee,I=25;b.reserve(32),w.reserve(I),A.reserve(I);const M=(L,R)=>I*L+R;for(let L=0;Lt[g])return null}else{const y=1/a[g];let w=(r[g]-i[g])*y,b=(t[g]-i[g])*y;if(w>b){const A=w;w=b,b=A}if(w>u&&(u=w),bp)return null}return u}function Xb(r,t,i,a,u,p,g,y,w,b,A){const I=a-r,M=u-t,L=p-i,R=g-r,F=y-t,$=w-i,K=A[1]*$-A[2]*F,se=A[2]*R-A[0]*$,Y=A[0]*F-A[1]*R,re=I*K+M*se+L*Y;if(Math.abs(re)<1e-15)return null;const ue=1/re,ce=b[0]-r,Ie=b[1]-t,Te=b[2]-i,De=(ce*K+Ie*se+Te*Y)*ue;if(De<0||De>1)return null;const Ze=Ie*L-Te*M,Me=Te*I-ce*L,Ue=ce*M-Ie*I,je=(A[0]*Ze+A[1]*Me+A[2]*Ue)*ue;return je<0||De+je>1?null:(R*Ze+F*Me+$*Ue)*ue}function Kb(r,t,i){return(r-t)/(i-t)}function Yb(r,t,i,a,u,p,g,y,w){const b=1<{const se=$?1:0,Y=(L+1)*F-se,re=R*F,ue=(R+1)*F-se;K[0]=L*F,K[1]=re,K[2]=Y,K[3]=ue};let I=new Zb(w);const M=[];for(let L=0;L=1;w/=2){const L=y[y.length-1];I=new Zb(w);for(let R=0;R0;){const{idx:R,t:F,nodex:$,nodey:K,depth:se}=L.pop();if(this.leaves[R]){Yb($,K,se,t,i,a,u,I,M);const re=1<=Le[2])return F}continue}let Y=0;for(let re=0;re=b[A[Te]]&&(A.splice(Te,0,re),Ie=!0);Ie||(A[Y]=re),Y++}}for(let re=0;re=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(t+1)}static pack(t,i){const a=[0,0,0,0],u=Pm.getUnpackVector(i);let p=Math.floor((t+u[3])/u[2]);return a[2]=p%256,p=Math.floor(p/256),a[1]=p%256,p=Math.floor(p/256),a[0]=p,a}getPixels(){return new wi({width:this.stride,height:this.stride},this.pixels)}backfillBorder(t,i,a){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let u=i*this.dim,p=i*this.dim+this.dim,g=a*this.dim,y=a*this.dim+this.dim;switch(i){case-1:u=p-1;break;case 1:p=u+1}switch(a){case-1:g=y-1;break;case 1:y=g+1}const w=-i*this.dim,b=-a*this.dim;for(let A=g;A{this.remove(t,p)},a)),this.data[u].push(p),this.order.push(u),this.order.length>this.max){const g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}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 i=this.data[t].shift();return i.timeout&&clearTimeout(i.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),i.value}getByKey(t){const i=this.data[t];return i?i[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,i){if(!this.has(t))return this;const a=t.wrapped().key,u=i===void 0?0:this.data[a].indexOf(i),p=this.data[a][u];return this.data[a].splice(u,1),p.timeout&&clearTimeout(p.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(p.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(t){const i=[];for(const a in this.data)for(const u of this.data[a])t(u.value)||i.push(u);for(const a of i)this.remove(a.value.tileID,a)}}class Eu{constructor(t,i,a){this.func=t,this.mask=i,this.range=a}}Eu.ReadOnly=!1,Eu.ReadWrite=!0,Eu.disabled=new Eu(519,Eu.ReadOnly,[0,1]);const c0=7680;class u0{constructor(t,i,a,u,p,g){this.test=t,this.ref=i,this.mask=a,this.fail=u,this.depthFail=p,this.pass=g}}u0.disabled=new u0({func:519,mask:0},0,0,c0,c0,c0);class hs{constructor(t,i,a){this.blendFunction=t,this.blendColor=i,this.mask=a}}hs.Replace=[1,0],hs.disabled=new hs(hs.Replace,Fn.transparent,[!1,!1,!1,!1]),hs.unblended=new hs(hs.Replace,Fn.transparent,[!0,!0,!0,!0]),hs.alphaBlended=new hs([1,771],Fn.transparent,[!0,!0,!0,!0]);const h0=1029,d0=2305;class Fo{constructor(t,i,a){this.enable=t,this.mode=i,this.frontFace=a}}Fo.disabled=new Fo(!1,h0,d0),Fo.backCCW=new Fo(!0,h0,d0),Fo.backCW=new Fo(!0,h0,2304),Fo.frontCW=new Fo(!0,1028,2304),Fo.frontCCW=new Fo(!0,1028,d0);class nc extends vl{constructor(t,i,a){super(),this.id=t,this._onlySymbols=a,i.on("data",u=>{u.dataType==="source"&&u.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&u.dataType==="source"&&u.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new kP(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new AP,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(t){this.map=t,this._minTileCacheSize=this._minTileCacheSize===void 0&&t?t._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&t?t._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const t in this._tiles){const i=this._tiles[t];if(i.state!=="loaded"&&i.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)}_loadTile(t,i){return t.isSymbolTile=this._onlySymbols,this._source.loadTile(t,i)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t,()=>{})}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 i in this._tiles){const a=this._tiles[i];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return dn(this._tiles).map(t=>t.tileID).sort(t2).map(t=>t.key)}getRenderableIds(t){const i=[];for(const a in this._tiles)this._isIdRenderable(+a,t)&&i.push(this._tiles[a]);return t?i.sort((a,u)=>{const p=a.tileID,g=u.tileID,y=new Ve(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),w=new Ve(g.canonical.x,g.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-g.overscaledZ||w.y-y.y||w.x-y.x}).map(a=>a.tileID.key):i.map(a=>a.tileID).sort(t2).map(a=>a.key)}hasRenderableParent(t){const i=this.findLoadedParent(t,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(t,i){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(i||!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,i){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=i),this._loadTile(a,this._tileLoaded.bind(this,a,t,i)))}_tileLoaded(t,i,a,u){if(u)if(t.state="errored",u.status!==404)this._source.fire(new wo(u,{tile:t}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const p=this.map.painter.terrain;this.update(this.transform,p.getScaledDemTileSize(),!0),p.resetTileLookupCache(this.id)}else this.update(this.transform);else t.timeAdded=xo.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),this._source.type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new Is("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const i=this.getRenderableIds();for(let u=0;u1||(Math.abs(g)>1&&(Math.abs(g+w)===1?g+=w:Math.abs(g-w)===1&&(g-=w)),p.dem&&u.dem&&(u.dem.backfillBorder(p.dem,g,y),u.neighboringTiles&&u.neighboringTiles[b]&&(u.neighboringTiles[b].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,i,a,u){for(const p in this._tiles){let g=this._tiles[p];if(u[p]||!g.hasData()||g.tileID.overscaledZ<=i||g.tileID.overscaledZ>a)continue;let y=g.tileID;for(;g&&g.tileID.overscaledZ>i+1;){const b=g.tileID.scaledTo(g.tileID.overscaledZ-1);g=this._tiles[b.key],g&&g.hasData()&&(y=b)}let w=y;for(;w.overscaledZ>i;)if(w=w.scaledTo(w.overscaledZ-1),t[w.key]){u[y.key]=y;break}}}findLoadedParent(t,i){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=i?a:null}for(let a=t.overscaledZ-1;a>=i;a--){const u=t.scaledTo(a),p=this._getLoadedTile(u);if(p)return p}}_getLoadedTile(t){const i=this._tiles[t.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,i){i=i||this._source.tileSize;const a=Math.ceil(t.width/i)+1,u=Math.ceil(t.height/i)+1,p=Math.floor(a*u*5),g=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,p):p,y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(y)}handleWrapJump(t){const i=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,i){const a={};for(const u in this._tiles){const p=this._tiles[u];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+i),a[p.tileID.key]=p}this._tiles=a;for(const u in this._timers)clearTimeout(this._timers[u]),delete this._timers[u];for(const u in this._tiles)this._setTileReloadTimer(+u,this._tiles[u])}}update(t,i,a){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!a)return;let u;this.updateCacheSize(t,i),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?u=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(y=>new Xr(y.canonical.z,y.wrap,y.canonical.z,y.canonical.x,y.canonical.y)):(u=t.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!a,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(u=u.filter(y=>this._source.hasTile(y)))):u=[];const p=this._updateRetainedTiles(u);if(n2(this._source.type)&&u.length!==0){const y={},w={},b=Object.keys(p);for(const I of b){const M=p[I],L=this._tiles[I];if(!L||L.fadeEndTime&&L.fadeEndTime<=xo.now())continue;const R=this.findLoadedParent(M,Math.max(M.overscaledZ-nc.maxOverzooming,this._source.minzoom));R&&(this._addTile(R.tileID),y[R.tileID.key]=R.tileID),w[I]=M}const A=u[u.length-1].overscaledZ;for(const I in this._tiles){const M=this._tiles[I];if(p[I]||!M.hasData())continue;let L=M.tileID;for(;L.overscaledZ>A;){L=L.scaledTo(L.overscaledZ-1);const R=this._tiles[L.key];if(R&&R.hasData()&&w[L.key]){p[I]=M.tileID;break}}}for(const I in y)p[I]||(this._coveredTiles[I]=!0,p[I]=y[I])}for(const y in p)this._tiles[y].clearFadeHold();const g=function(y,w){const b=[];for(const A in y)A in w||b.push(A);return b}(this._tiles,p);for(const y of g){const w=this._tiles[y];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(+y)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const i={};if(t.length===0)return i;const a={},u=t.reduce((b,A)=>Math.min(b,A.overscaledZ),1/0),p=t[0].overscaledZ,g=Math.max(p-nc.maxOverzooming,this._source.minzoom),y=Math.max(p+nc.maxUnderzooming,this._source.minzoom),w={};for(const b of t){const A=this._addTile(b);i[b.key]=b,A.hasData()||u=this._source.maxzoom){const M=b.children(this._source.maxzoom)[0],L=this.getTile(M);if(L&&L.hasData()){i[M.key]=M;continue}}else{const M=b.children(this._source.maxzoom);if(i[M[0].key]&&i[M[1].key]&&i[M[2].key]&&i[M[3].key])continue}let I=A.wasRequested();for(let M=b.overscaledZ-1;M>=g;--M){const L=b.scaledTo(M);if(a[L.key]||(a[L.key]=!0,A=this.getTile(L),!A&&I&&(A=this._addTile(L)),A&&(i[L.key]=L,I=A.wasRequested(),A.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const i=[];let a,u=this._tiles[t].tileID;for(;u.overscaledZ>0;){if(u.key in this._loadedParentTiles){a=this._loadedParentTiles[u.key];break}i.push(u.key);const p=u.scaledTo(u.overscaledZ-1);if(a=this._getLoadedTile(p),a)break;u=p}for(const p of i)this._loadedParentTiles[p]=a}}_addTile(t){let i=this._tiles[t.key];if(i)return i;i=this._cache.getAndRemove(t),i&&(this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,i)));const a=!!i;if(!a){const u=this.map?this.map.painter:null;i=new l0(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,u,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,t.key,i.state))}return i?(i.uses++,this._tiles[t.key]=i,a||this._source.fire(new Is("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(t,i){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=i.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const i=this._tiles[t];i&&(i.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),i.uses>0||(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,i,a){const u=[],p=this.transform;if(!p)return u;const g=p.projection.name==="globe",y=as(p.center.lng);for(const w in this._tiles){const b=this._tiles[w];if(a&&b.clearQueryDebugViz(),b.holdingForFade())continue;let A;if(g){const I=b.tileID.canonical;if(I.z===0){const M=[Math.abs(Je(y,...Zd(I,-1))-y),Math.abs(Je(y,...Zd(I,1))-y)];A=[0,2*M.indexOf(Math.min(...M))-1]}else{const M=[Math.abs(Je(y,...Zd(I,-1))-y),Math.abs(Je(y,...Zd(I,0))-y),Math.abs(Je(y,...Zd(I,1))-y)];A=[M.indexOf(Math.min(...M))-1]}}else A=[0];for(const I of A){const M=t.containsTile(b,p,i,I);M&&u.push(M)}}return u}getVisibleCoordinates(t){const i=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of i)a.projMatrix=this.transform.calculateProjMatrix(a.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(n2(this._source.type))for(const t in this._tiles){const i=this._tiles[t];if(i.fadeEndTime!==void 0&&i.fadeEndTime>=xo.now())return!0}return!1}setFeatureState(t,i,a){this._state.updateState(t=t||"_geojsonTileLayer",i,a)}removeFeatureState(t,i,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",i,a)}getFeatureState(t,i){return this._state.getState(t=t||"_geojsonTileLayer",i)}setDependencies(t,i,a){const u=this._tiles[t];u&&u.setDependencies(i,a)}reloadTilesForDependencies(t,i){for(const a in this._tiles)this._tiles[a].hasDependency(t,i)&&this._reloadTile(+a,"reloading");this._cache.filter(a=>!a.hasDependency(t,i))}_preloadTiles(t,i){if(!this._sourceLoaded){const y=()=>{this._sourceLoaded&&(this._source.off("data",y),this._preloadTiles(t,i))};return void this._source.on("data",y)}const a=new Map,u=Array.isArray(t)?t:[t],p=this.map.painter.terrain,g=this.usedForTerrain&&p?p.getScaledDemTileSize():this._source.tileSize;for(const y of u){const w=y.coveringTiles({tileSize:g,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const b of w)a.set(b.key,b);this.usedForTerrain&&y.updateElevation(!1)}Bt(Array.from(a.values()),(y,w)=>{const b=new l0(y,this._source.tileSize*y.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(b,A=>{this._source.type==="raster-dem"&&b.dem&&this._backfillDEM(b),w(A,b)})},i)}}function t2(r,t){const i=Math.abs(2*r.wrap)-+(r.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return r.overscaledZ-t.overscaledZ||a-i||t.canonical.y-r.canonical.y||t.canonical.x-r.canonical.x}function n2(r){return r==="raster"||r==="image"||r==="video"||r==="custom"}function Zd(r,t){const i=1<=0&&I[3]>=0&&w.insert(y,I[0],I[1],I[2],I[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Wy(new ym(this.rawTileData)).layers,this.sourceLayerCoder=new Vb(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const t in this.vtLayers)this.vtFeatures[t]=[]}return this.vtLayers}query(t,i,a,u){this.loadVTLayers();const p=t.params||{},g=Jc(p.filter),y=t.tileResult,w=t.transform,b=y.bufferedTilespaceBounds,A=this.grid.query(b.min.x,b.min.y,b.max.x,b.max.y,(R,F,$,K)=>Iw(y.bufferedTilespaceGeometry,R,F,$,K));A.sort(MP);let I=null;w.elevation&&A.length>0&&(I=zm.create(w.elevation,this.tileID));const M={};let L;for(let R=0;R(K||(K=Vs(se,this.tileID.canonical,t.tileTransform)),Y.queryIntersectsFeature(y,se,re,K,this.z,t.transform,t.pixelPosMatrix,I,ue)))}return M}loadMatchingFeature(t,i,a,u,p,g,y,w,b){const{featureIndex:A,bucketIndex:I,sourceLayerIndex:M,layoutVertexArrayOffset:L}=i,R=this.bucketLayerIDs[I];if(u&&!function(se,Y){for(let re=0;re=0)return!0;return!1}(u,R))return;const F=this.sourceLayerCoder.decode(M),$=this.vtLayers[F].feature(A);if(a.needGeometry){const se=Jl($,!0);if(!a.filter(new C(this.tileID.overscaledZ),se,this.tileID.canonical))return}else if(!a.filter(new C(this.tileID.overscaledZ),$))return;const K=this.getId($,F);for(let se=0;se{const y=t instanceof X?t.get(g):null;return y&&y.evaluate?y.evaluate(i,a,u):y})}function MP(r,t){return t-r}dt(r2,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class o2{constructor(t,i){this.width=t,this.height=i,this.nextRow=0,this.image=new $s({width:t,height:i}),this.positions={},this.uploaded=!1}getDash(t,i){const a=this.getKey(t,i);return this.positions[a]}trim(){const t=this.width,i=this.height=br(this.nextRow);this.image.resize({width:t,height:i})}getKey(t,i){return t.join(",")+i}getDashRanges(t,i,a){const u=[];let p=t.length%2==1?-t[t.length-1]*a:0,g=t[0]*a,y=!0;u.push({left:p,right:g,isDash:y,zeroLength:t[0]===0});let w=t[0];for(let b=1;b1&&(w=t[++y]);const A=Math.abs(b-w.left),I=Math.abs(b-w.right),M=Math.min(A,I);let L;const R=p/a*(u+1);if(w.isDash){const F=u-Math.abs(R);L=Math.sqrt(M*M+F*F)}else L=u-Math.sqrt(M*M+R*R);this.image.data[g+b]=Math.max(0,Math.min(255,L+128))}}}addRegularDash(t,i){for(let w=t.length-1;w>=0;--w){const b=t[w],A=t[w+1];b.zeroLength?t.splice(w,1):A&&A.isDash===b.isDash&&(A.left=b.left,t.splice(w,1))}const a=t[0],u=t[t.length-1];a.isDash===u.isDash&&(a.left=u.left-this.width,u.right=a.right+this.width);const p=this.width*this.nextRow;let g=0,y=t[g];for(let w=0;w1&&(y=t[++g]);const b=Math.abs(w-y.left),A=Math.abs(w-y.right),I=Math.min(b,A);this.image.data[p+w]=Math.max(0,Math.min(255,(y.isDash?I:-I)+i+128))}}addDash(t,i){const a=this.getKey(t,i);if(this.positions[a])return this.positions[a];const u=i==="round",p=u?7:0,g=2*p+1;if(this.nextRow+g>this.height)return wn("LineAtlas out of space"),null;t.length===0&&t.push(1);let y=0;for(let A=0;A=Ue.maxzoom||Ue.visibility!=="none"&&(p0(Me,this.zoom,a),(w[Ue.id]=Ue.createBucket({index:y.bucketLayerIDs.length,layers:Me,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:De,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:a})).populate(Ze,A,this.tileID.canonical,this.tileTransform),y.bucketLayerIDs.push(Me.map(je=>je.id)))}}let M,L,R,F;b.trim();const $={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},K=()=>{if(M)return p(M);if(L&&R&&F){const ue=new a2(L),ce=new fb(R,F);for(const Ie in w){const Te=w[Ie];Te instanceof Oa?(p0(Te.layers,this.zoom,a),rP(Te,L,ue.positions,R,ce.iconPositions,this.showCollisionBoxes,a,this.tileID.canonical,this.tileZoom,this.projection)):Te.hasPattern&&(Te instanceof mm||Te instanceof um||Te instanceof Dd)&&(p0(Te.layers,this.zoom,a),Te.addFeatures(A,this.tileID.canonical,ce.patternPositions,a,this.tileTransform))}this.status="done",p(null,{buckets:dn(w).filter(Ie=>!Ie.isEmpty()),featureIndex:y,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ue.image,lineAtlas:b,imageAtlas:ce,glyphMap:this.returnDependencies?L:null,iconMap:this.returnDependencies?R:null,glyphPositions:this.returnDependencies?ue.positions:null})}},se=kt(A.glyphDependencies,ue=>Object.keys(ue).map(Number));Object.keys(se).length?u.send("getGlyphs",{uid:this.uid,stacks:se},(ue,ce)=>{M||(M=ue,L=ce,K())},void 0,!1,$):L={};const Y=Object.keys(A.iconDependencies);Y.length?u.send("getImages",{icons:Y,source:this.source,tileID:this.tileID,type:"icons"},(ue,ce)=>{M||(M=ue,R=ce,K())},void 0,!1,$):R={};const re=Object.keys(A.patternDependencies);re.length?u.send("getImages",{icons:re,source:this.source,tileID:this.tileID,type:"patterns"},(ue,ce)=>{M||(M=ue,F=ce,K())},void 0,!1,$):F={},K()}}function p0(r,t,i){const a=new C(t);for(const u of r)u.recalculate(a,i)}class l2{constructor(t){this.entries={},this.scheduler=t}request(t,i,a,u){const p=this.entries[t]=this.entries[t]||{callbacks:[]};if(p.result){const[g,y]=p.result;return this.scheduler?this.scheduler.add(()=>{u(g,y)},i):u(g,y),()=>{}}return p.callbacks.push(u),p.cancel||(p.cancel=a((g,y)=>{p.result=[g,y];for(const w of p.callbacks)this.scheduler?this.scheduler.add(()=>{w(g,y)},i):w(g,y);setTimeout(()=>delete this.entries[t],3e3)})),()=>{p.result||(p.callbacks=p.callbacks.filter(g=>g!==u),p.callbacks.length||(p.cancel(),delete this.entries[t]))}}}function c2(r,t,i){const a=JSON.stringify(r.request);return r.data&&(this.deduped.entries[a]={result:[null,r.data]}),this.deduped.request(a,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom},u=>{const p=ua(r.request,(g,y,w,b)=>{g?u(g):y&&u(null,{vectorTile:i?void 0:new Wy(new ym(y)),rawData:y,cacheControl:w,expires:b})});return()=>{p.cancel(),u()}},t)}const u2=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class f0{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,a]=new Uint8Array(t,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const u=a>>4;if(u!==1)throw new Error(`Got v${u} data when expected v1.`);const p=u2[15&a];if(!p)throw new Error("Unrecognized array type.");const[g]=new Uint16Array(t,2,1),[y]=new Uint32Array(t,4,1);return new f0(y,g,p,t)}constructor(t,i=64,a=Float64Array,u){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=a,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const p=u2.indexOf(this.ArrayType),g=2*t*this.ArrayType.BYTES_PER_ELEMENT,y=t*this.IndexArrayType.BYTES_PER_ELEMENT,w=(8-y%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);u&&u instanceof ArrayBuffer?(this.data=u,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+y+w,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+g+y+w),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+y+w,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=t)}add(t,i){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=t,this.coords[this._pos++]=i,a}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return m0(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,i,a,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:g,nodeSize:y}=this,w=[0,p.length-1,0],b=[];for(;w.length;){const A=w.pop()||0,I=w.pop()||0,M=w.pop()||0;if(I-M<=y){for(let $=M;$<=I;$++){const K=g[2*$],se=g[2*$+1];K>=t&&K<=a&&se>=i&&se<=u&&b.push(p[$])}continue}const L=M+I>>1,R=g[2*L],F=g[2*L+1];R>=t&&R<=a&&F>=i&&F<=u&&b.push(p[L]),(A===0?t<=R:i<=F)&&(w.push(M),w.push(L-1),w.push(1-A)),(A===0?a>=R:u>=F)&&(w.push(L+1),w.push(I),w.push(1-A))}return b}within(t,i,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:p,nodeSize:g}=this,y=[0,u.length-1,0],w=[],b=a*a;for(;y.length;){const A=y.pop()||0,I=y.pop()||0,M=y.pop()||0;if(I-M<=g){for(let $=M;$<=I;$++)d2(p[2*$],p[2*$+1],t,i)<=b&&w.push(u[$]);continue}const L=M+I>>1,R=p[2*L],F=p[2*L+1];d2(R,F,t,i)<=b&&w.push(u[L]),(A===0?t-a<=R:i-a<=F)&&(y.push(M),y.push(L-1),y.push(1-A)),(A===0?t+a>=R:i+a>=F)&&(y.push(L+1),y.push(I),y.push(1-A))}return w}}function m0(r,t,i,a,u,p){if(u-a<=i)return;const g=a+u>>1;h2(r,t,g,a,u,p),m0(r,t,i,a,g-1,1-p),m0(r,t,i,g+1,u,1-p)}function h2(r,t,i,a,u,p){for(;u>a;){if(u-a>600){const b=u-a+1,A=i-a+1,I=Math.log(b),M=.5*Math.exp(2*I/3),L=.5*Math.sqrt(I*M*(b-M)/b)*(A-b/2<0?-1:1);h2(r,t,i,Math.max(a,Math.floor(i-A*M/b+L)),Math.min(u,Math.floor(i+(b-A)*M/b+L)),p)}const g=t[2*i+p];let y=a,w=u;for(Hd(r,t,a,i),t[2*u+p]>g&&Hd(r,t,a,u);yg;)w--}t[2*a+p]===g?Hd(r,t,a,w):(w++,Hd(r,t,w,u)),w<=i&&(a=w+1),i<=w&&(u=w-1)}}function Hd(r,t,i,a){g0(r,i,a),g0(t,2*i,2*a),g0(t,2*i+1,2*a+1)}function g0(r,t,i){const a=r[t];r[t]=r[i],r[i]=a}function d2(r,t,i,a){const u=r-i,p=t-a;return u*u+p*p}s.ARRAY_TYPE=xi,s.AUTH_ERR_MSG=he,s.Aabb=Hr,s.Actor=class{constructor(r,t,i){this.target=r,this.parent=t,this.mapId=i,this.callbacks={},this.cancelCallbacks={},Yi(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=vo()?r:k,this.scheduler=new TP}send(r,t,i,a,u=!1,p){const g=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=p,this.callbacks[g]=i);const y=aa(this.globalScope)?void 0:[];return this.target.postMessage({id:g,type:r,hasCallback:!!i,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:Ia(t,y)},y),{cancel:()=>{i&&delete this.callbacks[g],this.target.postMessage({id:g,type:"",targetMapId:a,sourceMapId:this.mapId})}}}receive(r){const t=r.data,i=t.id;if(i&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type===""){const a=this.cancelCallbacks[i];delete this.cancelCallbacks[i],a&&a.cancel()}else if(t.mustQueue||vo()){const a=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,t),a&&a.metadata||{type:"message"})}else this.processTask(i,t)}processTask(r,t){if(t.type===""){const i=this.callbacks[r];delete this.callbacks[r],i&&(t.error?i(Os(t.error)):i(null,Os(t.data)))}else{const i=aa(this.globalScope)?void 0:[],a=t.hasCallback?(p,g)=>{delete this.cancelCallbacks[r],this.target.postMessage({id:r,type:"",sourceMapId:this.mapId,error:p?Ia(p):null,data:Ia(g,i)},i)}:p=>{},u=Os(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,u,a);else if(this.parent.getWorkerSource){const p=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,p[0],u.source)[p[1]](u,a)}else a(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},s.CanonicalTileID=fm,s.Color=Fn,s.ColorMode=hs,s.CullFaceMode=Fo,s.DEMData=Pm,s.DataConstantProperty=B,s.DedupedRequest=l2,s.DepthMode=Eu,s.EXTENT=vt,s.Elevation=class{isDataAvailableAtPoint(r){const t=this._source();if(this.isUsingMockSource()||!t||r.y<0||r.y>1)return!1;const i=t.getSource().maxzoom,a=1<1)return t;const u=a.getSource().maxzoom,p=1<{const p=this.getAtTileOffset(r,u.x,u.y),g=a.upVector(r.canonical,u.x,u.y);return Bi(g,g,p*a.upVectorScale(r.canonical,t,i).metersToTile),g}}getForTilePoints(r,t,i,a){if(this.isUsingMockSource())return!1;const u=zm.create(this,r,a);return!!u&&(t.forEach(p=>{p[2]=this.exaggeration()*u.getElevationAt(p[0],p[1],i)}),!0)}getMinMaxForTile(r){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(r);if(!t||!t.dem)return null;const i=t.dem.tree,a=t.tileID,u=1<{let M=b===p-1?b-2:b===0?b:b-1;return M+=I?24575:0,[M,A]};for(let b=0;bthis._skuTokenExpiresAt}transformRequest(r,t){return this._transformRequestFn&&this._transformRequestFn(r,t)||{url:r}}normalizeStyleURL(r,t){if(!_e(r))return r;const i=rt(r);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeGlyphsURL(r,t){if(!_e(r))return r;const i=rt(r);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeSourceURL(r,t,i,a){if(!_e(r))return r;const u=rt(r);return u.path=`/v4/${u.authority}.json`,u.params.push("secure"),i&&u.params.push(`language=${i}`),a&&u.params.push(`worldview=${a}`),this._makeAPIURL(u,this._customAccessToken||t)}normalizeSpriteURL(r,t,i,a){const u=rt(r);return _e(r)?(u.path=`/styles/v1${u.path}/sprite${t}${i}`,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=`${t}${i}`,Qe(u))}normalizeTileURL(r,t,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),r&&!_e(r))return r;const a=rt(r);a.path=a.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${t||i&&a.authority!=="raster"&&i===512?"@2x":""}${J.supported?".webp":"$1"}`),a.authority==="raster"?a.path=`/${G.RASTER_URL_PREFIX}${a.path}`:(a.path=a.path.replace(/^.+\/v4\//,"/"),a.path=`/${G.TILE_URL_VERSION}${a.path}`);const u=this._customAccessToken||function(p){for(const g of p){const y=g.match(/^access_token=(.*)$/);if(y)return y[1]}return null}(a.params)||G.ACCESS_TOKEN;return G.REQUIRE_ACCESS_TOKEN&&u&&this._skuToken&&a.params.push(`sku=${this._skuToken}`),this._makeAPIURL(a,u)}canonicalizeTileURL(r,t){const i=rt(r);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return r;let a="mapbox://";i.path.match(/^\/raster\/v1\//)?a+=`raster/${i.path.replace(`/${G.RASTER_URL_PREFIX}/`,"")}`:a+=`tiles/${i.path.replace(`/${G.TILE_URL_VERSION}/`,"")}`;let u=i.params;return t&&(u=u.filter(p=>!p.match(/^access_token=/))),u.length&&(a+=`?${u.join("&")}`),a}canonicalizeTileset(r,t){const i=!!t&&_e(t),a=[];for(const u of r.tiles||[])be(u)?a.push(this.canonicalizeTileURL(u,i)):a.push(u);return a}_makeAPIURL(r,t){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",a=rt(G.API_URL);if(r.protocol=a.protocol,r.authority=a.authority,r.protocol==="http"){const u=r.params.indexOf("secure");u>=0&&r.params.splice(u,1)}if(a.path!=="/"&&(r.path=`${a.path}${r.path}`),!G.REQUIRE_ACCESS_TOKEN)return Qe(r);if(t=t||G.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if(t[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return r.params=r.params.filter(u=>u.indexOf("access_token")===-1),r.params.push(`access_token=${t||""}`),Qe(r)}},s.ResourceType=Ss,s.SegmentVector=qn,s.SourceCache=nc,s.StencilMode=u0,s.StructArrayLayout1ui2=vi,s.StructArrayLayout2f1f2i16=wt,s.StructArrayLayout2i4=We,s.StructArrayLayout2ui4=fr,s.StructArrayLayout3f12=Ot,s.StructArrayLayout3ui6=mt,s.StructArrayLayout4i8=Fe,s.StructArrayLayout5f20=sn,s.Texture=Wd,s.Tile=l0,s.Transitionable=O,s.Uniform1f=Yf,s.Uniform1i=class extends Ns{constructor(r){super(r),this.current=0}set(r,t,i){this.fetchUniformLocation(r,t)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},s.Uniform2f=class extends Ns{constructor(r){super(r),this.current=[0,0]}set(r,t,i){this.fetchUniformLocation(r,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},s.Uniform3f=class extends Ns{constructor(r){super(r),this.current=[0,0,0]}set(r,t,i){this.fetchUniformLocation(r,t)&&(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])))}},s.Uniform4f=Wx,s.UniformColor=Zx,s.UniformMatrix2f=class extends Ns{constructor(r){super(r),this.current=lk}set(r,t,i){if(this.fetchUniformLocation(r,t)){for(let a=0;a<4;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}},s.UniformMatrix3f=class extends Ns{constructor(r){super(r),this.current=ak}set(r,t,i){if(this.fetchUniformLocation(r,t)){for(let a=0;a<9;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},s.UniformMatrix4f=class extends Ns{constructor(r){super(r),this.current=sk}set(r,t,i){if(this.fetchUniformLocation(r,t)){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 a=1;a<16;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},s.UnwrappedTileID=Qw,s.ValidationError=ct,s.VectorTileFeature=dm,s.VectorTileWorkerSource=class extends vl{constructor(r,t,i,a,u){super(),this.actor=r,this.layerIndex=t,this.availableImages=i,this.loadVectorData=u||c2,this.loading={},this.loaded={},this.deduped=new l2(r.scheduler),this.isSpriteLoaded=a,this.scheduler=r.scheduler}loadTile(r,t){const i=r.uid,a=r&&r.request,u=a&&a.collectResourceTiming,p=this.loading[i]=new PP(r);p.abort=this.loadVectorData(r,(g,y)=>{const w=!this.loading[i];if(delete this.loading[i],w||g||!y)return p.status="done",w||(this.loaded[i]=p),t(g);const b=y.rawData,A={};y.expires&&(A.expires=y.expires),y.cacheControl&&(A.cacheControl=y.cacheControl),p.vectorTile=y.vectorTile||new Wy(new ym(b));const I=()=>{p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,(M,L)=>{if(M||!L)return t(M);const R={};if(u){const F=wh(a);F.length>0&&(R.resourceTiming=JSON.parse(JSON.stringify(F)))}t(null,vn({rawTileData:b.slice(0)},L,A,R))})};this.isSpriteLoaded?I():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(I,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom}):I()}),this.loaded=this.loaded||{},this.loaded[i]=p})}reloadTile(r,t){const i=this.loaded,a=r.uid,u=this;if(i&&i[a]){const p=i[a];p.showCollisionBoxes=r.showCollisionBoxes,p.enableTerrain=!!r.enableTerrain,p.projection=r.projection,p.tileTransform=tc(r.tileID.canonical,r.projection);const g=(y,w)=>{const b=p.reloadCallback;b&&(delete p.reloadCallback,p.parse(p.vectorTile,u.layerIndex,this.availableImages,u.actor,b)),t(y,w)};p.status==="parsing"?p.reloadCallback=g:p.status==="done"&&(p.vectorTile?p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,g):g())}}abortTile(r,t){const i=r.uid,a=this.loading[i];a&&(a.abort&&a.abort(),delete this.loading[i]),t()}removeTile(r,t){const i=this.loaded,a=r.uid;i&&i[a]&&delete i[a],t()}},s.WritingMode=Ni,s.ZoomDependentExpression=Bl,s.add=js,s.addDynamicAttributes=Im,s.adjoint=function(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=t[4],y=t[5],w=t[6],b=t[7],A=t[8];return r[0]=g*A-y*b,r[1]=u*b-a*A,r[2]=a*y-u*g,r[3]=y*w-p*A,r[4]=i*A-u*w,r[5]=u*p-i*y,r[6]=p*b-g*w,r[7]=a*w-i*b,r[8]=i*g-a*p,r},s.asyncAll=Bt,s.bezier=Li,s.bindAll=Yi,s.boundsAttributes=qb,s.bufferConvexPolygon=function(r,t){const i=[];for(let a=0;aAc&&(r.getActor().send("enforceCacheSizeLimit",Sc),_l=0)},s.calculateGlobeLabelMatrix=function(r,t){const{x:i,y:a}=r.point,u=gw(i,a,r.worldSize/r._pixelsPerMercatorPixel,0,0);return Zl(u,u,Cy(ss(t)))},s.calculateGlobeMatrix=function(r){const{x:t,y:i}=r.point,{lng:a,lat:u}=r._center;return gw(t,i,r.worldSize,a,u)},s.calculateGlobeMercatorMatrix=function(r){const t=r.pixelsPerMeter,i=t/Do(1,r.center.lat),a=Lo(new Float64Array(16));return yd(a,a,[r.point.x,r.point.y,0]),Hl(a,a,[i,i,t]),Float32Array.from(a)},s.circumferenceAtLatitude=ky,s.clamp=Je,s.clearTileCache=function(r){if(!gl())return;const t=k.caches.delete(la);r&&t.catch(r).then(()=>r())},s.clipLine=Cb,s.clone=function(r){var t=new xi(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t},s.clone$1=Dr,s.collisionCircleLayout=kM,s.config=G,s.conjugate=function(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r},s.create=function(){var r=new xi(16);return xi!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},s.create$1=Kx,s.createExpression=Sa,s.createLayout=ye,s.createStyleLayer=function(r){return r.type==="custom"?new xP(r):new bP[r.type](r)},s.cross=xy,s.degToRad=St,s.distance=function(r,t){return Math.hypot(t[0]-r[0],t[1]-r[1],t[2]-r[2])},s.div=function(r,t,i){return r[0]=t[0]/i[0],r[1]=t[1]/i[1],r[2]=t[2]/i[2],r},s.dot=oo,s.earthRadius=Id,s.ease=Ki,s.easeCubicInOut=$r,s.ecefToLatLng=function([r,t,i]){const a=Math.hypot(r,t,i),u=Math.atan2(r,i),p=.5*Math.PI-Math.acos(-t/a);return new ln(Vt(u),Vt(p))},s.emitValidationErrors=qf,s.endsWith=xn,s.enforceCacheSizeLimit=function(r){Ts(),fi&&fi.then(t=>{t.keys().then(i=>{for(let a=0;ap&&(a+=(r[u]-p)*(r[u]-p)),t[u]0){const R=180/a;Yx(L,L,[R/b+1,0,0,0,R/A+1,0,-.5*R/I,.5*R/M,1])}return L[2]=w,L[5]=r.x,L[8]=r.y,L},s.getImage=ne,s.getJSON=function(r,t){return Cs(vn(r,{type:"json"}),t)},s.getLatitudinalLod=function(r){const t=zr-5;r=Je(r,-t,t)/t*90;const i=Math.pow(Math.abs(Math.sin(St(r))),3);return Math.round(i*(Sd.length-1))},s.getMapSessionAPI=hr,s.getPerformanceMeasurement=wh,s.getProjection=Ub,s.getRTLTextPluginStatus=x,s.getReferrer=As,s.getTilePoint=function(r,{x:t,y:i},a=0){return new Ve(((t-a)*r.scale-r.x)*vt,(i*r.scale-r.y)*vt)},s.getTileVec3=function(r,t,i=0){return ou(((t.x-i)*r.scale-r.x)*vt,(t.y*r.scale-r.y)*vt,xw(t.z,t.y))},s.getVideo=function(r,t){const i=k.document.createElement("video");i.muted=!0,i.onloadstart=function(){t(null,i)};for(let a=0;a{}}},s.globeCenterToScreenPoint=function(r){const t=[0,0,0],i=Lo(new Float64Array(16));return Zl(i,r.pixelMatrix,r.globeMatrix),Nn(t,t,i),new Ve(t[0],t[1])},s.globeDenormalizeECEF=Cy,s.globeECEFOrigin=function(r,t){const i=[0,0,0];return Nn(i,i,Cd(ss(t.canonical))),Nn(i,i,r),i},s.globeMetersToEcef=em,s.globeNormalizeECEF=Cd,s.globePixelsToTileUnits=function(r,t){return vt/(512*Math.pow(2,r))*nm(ss(t))},s.globePoleMatrixForTile=function(r,t,i){const a=Lo(new Float64Array(16)),u=(t/(1<0;return a===0&&!u&&!g&&p},s.identity=Lo,s.identity$1=sw,s.invert=gy,s.isFullscreen=function(){return!!k.document.fullscreenElement||!!k.document.webkitFullscreenElement},s.isLngLatBehindGlobe=Iy,s.isMapAuthenticated=function(r){return Or.has(r)},s.isMapboxURL=_e,s.isSafariWithAntialiasingBug=function(r){const t=r.navigator?r.navigator.userAgent:null;return!!aa(r)&&t&&(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},s.latFromMercatorY=Pr,s.latLngToECEF=au,s.len=_k,s.length=vd,s.length$1=function(r){return Math.hypot(r[0],r[1],r[2],r[3])},s.lngFromMercatorX=Fi,s.loadVectorTile=c2,s.makeRequest=Cs,s.mapValue=function(r,t,i,a,u){return Je((r-t)/(i-t)*(u-a)+a,a,u)},s.mercatorScale=ww,s.mercatorXfromLng=as,s.mercatorYfromLat=ls,s.mercatorZfromAltitude=Do,s.mul=mk,s.mul$1=gk,s.multiply=Zl,s.multiply$1=Yx,s.multiply$2=tw,s.nextPowerOfTwo=br,s.normalize=Zr,s.normalize$1=yk,s.normalize$2=iw,s.number=Wt,s.ortho=function(r,t,i,a,u,p,g){var y=1/(t-i),w=1/(a-u),b=1/(p-g);return r[0]=-2*y,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*w,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*b,r[11]=0,r[12]=(t+i)*y,r[13]=(u+a)*w,r[14]=(g+p)*b,r[15]=1,r},s.pbf=sb,s.perspective=function(r,t,i,a,u){var p,g=1/Math.tan(t/2);return r[0]=g/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,u!=null&&u!==1/0?(r[10]=(u+a)*(p=1/(a-u)),r[14]=2*u*a*p):(r[10]=-1,r[14]=-2*a),r},s.pick=function(r,t){const i={};for(let a=0;a0&&i[0]<=r.width&&i[1]>0&&i[1]<=r.height&&!Iy(r,new ln(r.center.lat,90)),a[0]>0&&a[0]<=r.width&&a[1]>0&&a[1]<=r.height&&!Iy(r,new ln(r.center.lat,-90))]},s.polygonContainsPoint=Ql,s.polygonIntersectsBox=Iw,s.polygonIntersectsPolygon=Tw,s.polygonizeBounds=function(r,t,i=0,a=!0){const u=new Ve(i,i),p=r.sub(u),g=t.add(u),y=[p,new Ve(g.x,p.y),g,new Ve(p.x,g.y)];return a&&y.push(p.clone()),y},s.posAttributes=Td,s.postMapLoadEvent=Vn,s.postPerformanceEvent=tr,s.postTurnstileEvent=Gt,s.potpack=Ky,s.prevPowerOfTwo=function(r){return r<=1?1:Math.pow(2,Math.floor(Math.log(r)/Math.LN2))},s.radToDeg=Vt,s.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.registerForPluginStateChange=function(r){return r({pluginStatus:d,pluginURL:o}),_.on("pluginStateChange",r),r},s.removeAuthState=function(r){Or.delete(r)},s.renderColorRamp=By,s.resample=bw,s.rotateX=_y,s.rotateX$1=aw,s.rotateY=Qf,s.rotateY$1=lw,s.rotateZ=function(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[0],g=t[1],y=t[2],w=t[3],b=t[4],A=t[5],I=t[6],M=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=p*u+b*a,r[1]=g*u+A*a,r[2]=y*u+I*a,r[3]=w*u+M*a,r[4]=b*u-p*a,r[5]=A*u-g*a,r[6]=I*u-y*a,r[7]=M*u-w*a,r},s.rotateZ$1=function(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w+u*y,r[1]=u*w-a*y,r[2]=p*w+g*y,r[3]=g*w-p*y,r},s.scale=Hl,s.scale$1=rw,s.scale$2=Bi,s.scaleAndAdd=bd,s.set=function(r,t,i,a){return r[0]=t,r[1]=i,r[2]=a,r},s.setCacheLimits=function(r,t){Sc=r,Ac=t},s.setColumn=function(r,t,i){r[4*t+0]=i[0],r[4*t+1]=i[1],r[4*t+2]=i[2],r[4*t+3]=i[3]},s.setRTLTextPlugin=function(r,t,i=!1){if(d===pd||d===fd||d===md)throw new Error("setRTLTextPlugin cannot be called multiple times.");o=xo.resolveURL(r),d=pd,ka=t,f(),i||T()},s.smoothstep=Tt,s.spec=Re,s.squaredLength=function(r){var t=r[0],i=r[1],a=r[2];return t*t+i*i+a*a},s.storeAuthState=function(r,t){t?Or.add(r):Or.delete(r)},s.sub=Ro,s.subtract=vy,s.symbolSize=MM,s.tileAABB=function(r,t,i,a,u,p,g,y,w){if(w.name==="globe")return Ek(r,t,new fm(i,a,u));const b=tc({z:i,x:a,y:u},w);return new Hr([(p+b.x/b.scale)*t,t*(b.y/b.scale),g],[(p+b.x2/b.scale)*t,t*(b.y2/b.scale),y])},s.tileCornersToBounds=tm,s.tileTransform=tc,s.transformMat3=function(r,t,i){var a=t[0],u=t[1],p=t[2];return r[0]=a*i[0]+u*i[3]+p*i[6],r[1]=a*i[1]+u*i[4]+p*i[7],r[2]=a*i[2]+u*i[5]+p*i[8],r},s.transformMat4=Nn,s.transformMat4$1=Xl,s.transformQuat=nw,s.transitionTileAABBinECEF=pw,s.translate=yd,s.transpose=function(r,t){if(r===t){var i=t[1],a=t[2],u=t[5];r[1]=t[3],r[2]=t[6],r[3]=i,r[5]=t[7],r[6]=a,r[7]=u}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r},s.triggerPluginCompletionEvent=c,s.uniqueId=ii,s.updateGlobeVertexNormal=function(r,t,i,a,u){const p=5*t+2;r.float32[p+0]=i,r.float32[p+1]=a,r.float32[p+2]=u},s.validateCustomStyleLayer=function(r){const t=[],i=r.id;return i===void 0&&t.push({message:`layers.${i}: missing required property "id"`}),r.render===void 0&&t.push({message:`layers.${i}: missing required method "render"`}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},s.validateFilter=r=>yi(Vl(r)),s.validateFog=r=>yi(Vf(r)),s.validateLayer=r=>yi(Ff(r)),s.validateLight=r=>yi(jf(r)),s.validateSource=r=>yi(Uf(r)),s.validateStyle=Gf,s.validateTerrain=r=>yi(ld(r)),s.values=dn,s.vectorTile=hm,s.version=D,s.warnOnce=wn,s.window=k,s.wrap=xt}),v(["./shared"],function(s){function k(oe){if(typeof oe=="number"||typeof oe=="boolean"||typeof oe=="string"||oe==null)return JSON.stringify(oe);if(Array.isArray(oe)){let U="[";for(const ne of oe)U+=`${k(ne)},`;return`${U}]`}let N="{";for(const U of Object.keys(oe).sort())N+=`${U}:${k(oe[U])},`;return`${N}}`}function D(oe){let N="";for(const U of s.refProperties)N+=`/${k(oe[U])}`;return N}class V{constructor(N){this.keyCache={},N&&this.replace(N)}replace(N){this._layerConfigs={},this._layers={},this.update(N,[])}update(N,U){for(const he of N)this._layerConfigs[he.id]=he,(this._layers[he.id]=s.createStyleLayer(he)).compileFilter(),this.keyCache[he.id]&&delete this.keyCache[he.id];for(const he of U)delete this.keyCache[he],delete this._layerConfigs[he],delete this._layers[he];this.familiesBySource={};const ne=function(he,_e){const be={};for(let ge=0;gethis._layers[rt.id]),be=_e[0];if(be.visibility==="none")continue;const we=be.source||"";let ge=this.familiesBySource[we];ge||(ge=this.familiesBySource[we]={});const Pe=be.sourceLayer||"_geojsonTileLayer";let nt=ge[Pe];nt||(nt=ge[Pe]=[]),nt.push(_e)}}}class G{loadTile(N,U){const{uid:ne,encoding:he,rawImageData:_e,padding:be,buildQuadTree:we}=N,ge=s.window.ImageBitmap&&_e instanceof s.window.ImageBitmap?this.getImageData(_e,be):_e;U(null,new s.DEMData(ne,ge,he,be<1,we))}getImageData(N,U){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(N.width,N.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=N.width,this.offscreenCanvas.height=N.height,this.offscreenCanvasContext.drawImage(N,0,0,N.width,N.height);const ne=this.offscreenCanvasContext.getImageData(-U,-U,N.width+2*U,N.height+2*U);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),ne}}function J(oe,N){if(oe.length!==0){ve(oe[0],N);for(var U=1;U=Math.abs(we)?U-ge+we:we-ge+U,U=ge}U+ne>=0!=!!N&&oe.reverse()}var ae=s.getDefaultExportFromCjs(function oe(N,U){var ne,he=N&&N.type;if(he==="FeatureCollection")for(ne=0;ne>31}function Vr(oe,N){for(var U=oe.loadGeometry(),ne=oe.type,he=0,_e=0,be=U.length,we=0;weoe},Je=Math.fround||(Tt=new Float32Array(1),oe=>(Tt[0]=+oe,Tt[0]));var Tt;const xt=3,Bt=5,dn=6;class vn{constructor(N){this.options=Object.assign(Object.create(Ki),N),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(N){const{log:U,minZoom:ne,maxZoom:he}=this.options;U&&console.time("total time");const _e=`prepare ${N.length} points`;U&&console.time(_e),this.points=N;const be=[];for(let ge=0;ge=ne;ge--){const Pe=+Date.now();we=this.trees[ge]=this._createTree(this._cluster(we,ge)),U&&console.log("z%d: %d clusters in %dms",ge,we.numItems,+Date.now()-Pe)}return U&&console.timeEnd("total time"),this}getClusters(N,U){let ne=((N[0]+180)%360+360)%360-180;const he=Math.max(-90,Math.min(90,N[1]));let _e=N[2]===180?180:((N[2]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,N[3]));if(N[2]-N[0]>=360)ne=-180,_e=180;else if(ne>_e){const rt=this.getClusters([ne,he,180,be],U),Qe=this.getClusters([-180,he,_e,be],U);return rt.concat(Qe)}const we=this.trees[this._limitZoom(U)],ge=we.range(ar(ne),br(be),ar(_e),br(he)),Pe=we.data,nt=[];for(const rt of ge){const Qe=this.stride*rt;nt.push(Pe[Qe+Bt]>1?sr(Pe,Qe,this.clusterProps):this.points[Pe[Qe+xt]])}return nt}getChildren(N){const U=this._getOriginId(N),ne=this._getOriginZoom(N),he="No cluster with the specified id.",_e=this.trees[ne];if(!_e)throw new Error(he);const be=_e.data;if(U*this.stride>=be.length)throw new Error(he);const we=this.options.radius/(this.options.extent*Math.pow(2,ne-1)),ge=_e.within(be[U*this.stride],be[U*this.stride+1],we),Pe=[];for(const nt of ge){const rt=nt*this.stride;be[rt+4]===N&&Pe.push(be[rt+Bt]>1?sr(be,rt,this.clusterProps):this.points[be[rt+xt]])}if(Pe.length===0)throw new Error(he);return Pe}getLeaves(N,U,ne){const he=[];return this._appendLeaves(he,N,U=U||10,ne=ne||0,0),he}getTile(N,U,ne){const he=this.trees[this._limitZoom(N)],_e=Math.pow(2,N),{extent:be,radius:we}=this.options,ge=we/be,Pe=(ne-ge)/_e,nt=(ne+1+ge)/_e,rt={features:[]};return this._addTileFeatures(he.range((U-ge)/_e,Pe,(U+1+ge)/_e,nt),he.data,U,ne,_e,rt),U===0&&this._addTileFeatures(he.range(1-ge/_e,Pe,1,nt),he.data,_e,ne,_e,rt),U===_e-1&&this._addTileFeatures(he.range(0,Pe,ge/_e,nt),he.data,-1,ne,_e,rt),rt.features.length?rt:null}getClusterExpansionZoom(N){let U=this._getOriginZoom(N)-1;for(;U<=this.options.maxZoom;){const ne=this.getChildren(N);if(U++,ne.length!==1)break;N=ne[0].properties.cluster_id}return U}_appendLeaves(N,U,ne,he,_e){const be=this.getChildren(U);for(const we of be){const ge=we.properties;if(ge&&ge.cluster?_e+ge.point_count<=he?_e+=ge.point_count:_e=this._appendLeaves(N,ge.cluster_id,ne,he,_e):_e1;let nt,rt,Qe;if(Pe)nt=ii(U,ge,this.clusterProps),rt=U[ge],Qe=U[ge+1];else{const Pt=this.points[U[ge+xt]];nt=Pt.properties;const[Dt,Gt]=Pt.geometry.coordinates;rt=ar(Dt),Qe=br(Gt)}const Mt={type:1,geometry:[[Math.round(this.options.extent*(rt*_e-ne)),Math.round(this.options.extent*(Qe*_e-he))]],tags:nt};let Rt;Rt=Pe||this.options.generateId?U[ge+xt]:this.points[U[ge+xt]].id,Rt!==void 0&&(Mt.id=Rt),be.features.push(Mt)}}_limitZoom(N){return Math.max(this.options.minZoom,Math.min(Math.floor(+N),this.options.maxZoom+1))}_cluster(N,U){const{radius:ne,extent:he,reduce:_e,minPoints:be}=this.options,we=ne/(he*Math.pow(2,U)),ge=N.data,Pe=[],nt=this.stride;for(let rt=0;rtU&&(Dt+=ge[In+Bt])}if(Dt>Pt&&Dt>=be){let Gt,In=Qe*Pt,Vn=Mt*Pt,Ir=-1;const tr=((rt/nt|0)<<5)+(U+1)+this.points.length;for(const Ji of Rt){const hr=Ji*nt;if(ge[hr+2]<=U)continue;ge[hr+2]=U;const Or=ge[hr+Bt];In+=ge[hr]*Or,Vn+=ge[hr+1]*Or,ge[hr+4]=tr,_e&&(Gt||(Gt=this._map(ge,rt,!0),Ir=this.clusterProps.length,this.clusterProps.push(Gt)),_e(Gt,this._map(ge,hr)))}ge[rt+4]=tr,Pe.push(In/Dt,Vn/Dt,1/0,tr,-1,Dt),_e&&Pe.push(Ir)}else{for(let Gt=0;Gt1)for(const Gt of Rt){const In=Gt*nt;if(!(ge[In+2]<=U)){ge[In+2]=U;for(let Vn=0;Vn>5}_getOriginZoom(N){return(N-this.points.length)%32}_map(N,U,ne){if(N[U+Bt]>1){const be=this.clusterProps[N[U+dn]];return ne?Object.assign({},be):be}const he=this.points[N[U+xt]].properties,_e=this.options.map(he);return ne&&_e===he?Object.assign({},_e):_e}}function sr(oe,N,U){return{type:"Feature",id:oe[N+xt],properties:ii(oe,N,U),geometry:{type:"Point",coordinates:[(ne=oe[N],360*(ne-.5)),Es(oe[N+1])]}};var ne}function ii(oe,N,U){const ne=oe[N+Bt],he=ne>=1e4?`${Math.round(ne/1e3)}k`:ne>=1e3?Math.round(ne/100)/10+"k":ne,_e=oe[N+dn],be=_e===-1?{}:Object.assign({},U[_e]);return Object.assign(be,{cluster:!0,cluster_id:oe[N+xt],point_count:ne,point_count_abbreviated:he})}function ar(oe){return oe/360+.5}function br(oe){const N=Math.sin(oe*Math.PI/180),U=.5-.25*Math.log((1+N)/(1-N))/Math.PI;return U<0?0:U>1?1:U}function Es(oe){const N=(180-360*oe)*Math.PI/180;return 360*Math.atan(Math.exp(N))/Math.PI-90}function Yi(oe,N,U,ne){for(var he,_e=ne,be=U-N>>1,we=U-N,ge=oe[N],Pe=oe[N+1],nt=oe[U],rt=oe[U+1],Qe=N+3;Qe_e)he=Qe,_e=Mt;else if(Mt===_e){var Rt=Math.abs(Qe-be);Rtne&&(he-N>3&&Yi(oe,N,he,ne),oe[he+2]=_e,U-he>3&&Yi(oe,he,U,ne))}function xn(oe,N,U,ne,he,_e){var be=he-U,we=_e-ne;if(be!==0||we!==0){var ge=((oe-U)*be+(N-ne)*we)/(be*be+we*we);ge>1?(U=he,ne=_e):ge>0&&(U+=be*ge,ne+=we*ge)}return(be=oe-U)*be+(we=N-ne)*we}function kt(oe,N,U,ne){var he={id:oe===void 0?null:oe,type:N,geometry:U,tags:ne,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(_e){var be=_e.geometry,we=_e.type;if(we==="Point"||we==="MultiPoint"||we==="LineString")Yo(_e,be);else if(we==="Polygon"||we==="MultiLineString")for(var ge=0;ge0&&(be+=ne?(he*Pe-ge*_e)/2:Math.sqrt(Math.pow(ge-he,2)+Math.pow(Pe-_e,2))),he=ge,_e=Pe}var nt=N.length-3;N[2]=1,Yi(N,0,nt,U),N[nt+2]=1,N.size=Math.abs(be),N.start=0,N.end=N.size}function pi(oe,N,U,ne){for(var he=0;he1?1:U}function oi(oe,N,U,ne,he,_e,be,we){if(ne/=N,_e>=(U/=N)&&be=ne)return null;for(var ge=[],Pe=0;Pe=U&&Rt=ne)){var Pt=[];if(Qe==="Point"||Qe==="MultiPoint")fl(rt,Pt,U,ne,he);else if(Qe==="LineString")aa(rt,Pt,U,ne,he,!1,we.lineMetrics);else if(Qe==="MultiLineString")Qo(rt,Pt,U,ne,he,!1);else if(Qe==="Polygon")Qo(rt,Pt,U,ne,he,!0);else if(Qe==="MultiPolygon")for(var Dt=0;Dt=U&&be<=ne&&(N.push(oe[_e]),N.push(oe[_e+1]),N.push(oe[_e+2]))}}function aa(oe,N,U,ne,he,_e,be){for(var we,ge,Pe=ml(oe),nt=he===0?Sc:Ac,rt=oe.start,Qe=0;QeU&&(ge=nt(Pe,Mt,Rt,Dt,Gt,U),be&&(Pe.start=rt+we*ge)):In>ne?Vn=U&&(ge=nt(Pe,Mt,Rt,Dt,Gt,U),Ir=!0),Vn>ne&&In<=ne&&(ge=nt(Pe,Mt,Rt,Dt,Gt,ne),Ir=!0),!_e&&Ir&&(be&&(Pe.end=rt+we*ge),N.push(Pe),Pe=ml(oe)),be&&(rt+=we)}var tr=oe.length-3;Mt=oe[tr],Rt=oe[tr+1],Pt=oe[tr+2],(In=he===0?Mt:Rt)>=U&&In<=ne&&la(Pe,Mt,Rt,Pt),tr=Pe.length-3,_e&&tr>=3&&(Pe[tr]!==Pe[0]||Pe[tr+1]!==Pe[1])&&la(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&N.push(Pe)}function ml(oe){var N=[];return N.size=oe.size,N.start=oe.start,N.end=oe.end,N}function Qo(oe,N,U,ne,he,_e){for(var be=0;bebe.maxX&&(be.maxX=nt),rt>be.maxY&&(be.maxY=rt)}return be}function _l(oe,N,U,ne){var he=N.geometry,_e=N.type,be=[];if(_e==="Point"||_e==="MultiPoint")for(var we=0;we0&&N.size<(he?be:ne))U.numPoints+=N.length/3;else{for(var we=[],ge=0;gebe)&&(U.numSimplified++,we.push(N[ge]),we.push(N[ge+1])),U.numPoints++;he&&function(Pe,nt){for(var rt=0,Qe=0,Mt=Pe.length,Rt=Mt-2;Qe0===nt)for(Qe=0,Mt=Pe.length;Qe24)throw new Error("maxZoom should be in the 0-24 range");if(N.promoteId&&N.generateId)throw new Error("promoteId and generateId cannot be used together.");var ne=function(he,_e){var be=[];if(he.type==="FeatureCollection")for(var we=0;we1&&console.time("creation"),Qe=this.tiles[rt]=ca(oe,N,U,ne,ge),this.tileCoords.push({z:N,x:U,y:ne}),Pe)){Pe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",N,U,ne,Qe.numFeatures,Qe.numPoints,Qe.numSimplified),console.timeEnd("creation"));var Mt="z"+N;this.stats[Mt]=(this.stats[Mt]||0)+1,this.total++}if(Qe.source=oe,he){if(N===ge.maxZoom||N===he)continue;var Rt=1<1&&console.time("clipping");var Pt,Dt,Gt,In,Vn,Ir,tr=.5*ge.buffer/ge.extent,Ji=.5-tr,hr=.5+tr,Or=1+tr;Pt=Dt=Gt=In=null,Vn=oi(oe,nt,U-tr,U+hr,0,Qe.minX,Qe.maxX,ge),Ir=oi(oe,nt,U+Ji,U+Or,0,Qe.minX,Qe.maxX,ge),oe=null,Vn&&(Pt=oi(Vn,nt,ne-tr,ne+hr,1,Qe.minY,Qe.maxY,ge),Dt=oi(Vn,nt,ne+Ji,ne+Or,1,Qe.minY,Qe.maxY,ge),Vn=null),Ir&&(Gt=oi(Ir,nt,ne-tr,ne+hr,1,Qe.minY,Qe.maxY,ge),In=oi(Ir,nt,ne+Ji,ne+Or,1,Qe.minY,Qe.maxY,ge),Ir=null),Pe>1&&console.timeEnd("clipping"),we.push(Pt||[],N+1,2*U,2*ne),we.push(Dt||[],N+1,2*U,2*ne+1),we.push(Gt||[],N+1,2*U+1,2*ne),we.push(In||[],N+1,2*U+1,2*ne+1)}}},ts.prototype.getTile=function(oe,N,U){var ne=this.options,he=ne.extent,_e=ne.debug;if(oe<0||oe>24)return null;var be=1<1&&console.log("drilling down to z%d-%d-%d",oe,N,U);for(var ge,Pe=oe,nt=N,rt=U;!ge&&Pe>0;)Pe--,nt=Math.floor(nt/2),rt=Math.floor(rt/2),ge=this.tiles[As(Pe,nt,rt)];return ge&&ge.source?(_e>1&&console.log("found parent tile z%d-%d-%d",Pe,nt,rt),_e>1&&console.time("drilling down"),this.splitTile(ge.source,Pe,nt,rt,oe,N,U),_e>1&&console.timeEnd("drilling down"),this.tiles[we]?gl(this.tiles[we],he):null):null};class ua extends s.VectorTileWorkerSource{constructor(N,U,ne,he,_e){super(N,U,ne,he,Cs),_e&&(this.loadGeoJSON=_e)}loadData(N,U){const ne=N&&N.request,he=ne&&ne.collectResourceTiming;this.loadGeoJSON(N,(_e,be)=>{if(_e||!be)return U(_e);if(typeof be!="object")return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));{ae(be,!0);try{if(N.filter){const ge=s.createExpression(N.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ge.result==="error")throw new Error(ge.value.map(nt=>`${nt.key}: ${nt.message}`).join(", "));be={type:"FeatureCollection",features:be.features.filter(nt=>ge.value.evaluate({zoom:0},nt))}}this._geoJSONIndex=N.cluster?new vn(function({superclusterOptions:ge,clusterProperties:Pe}){if(!Pe||!ge)return ge;const nt={},rt={},Qe={accumulated:null,zoom:0},Mt={properties:null},Rt=Object.keys(Pe);for(const Pt of Rt){const[Dt,Gt]=Pe[Pt],In=s.createExpression(Gt),Vn=s.createExpression(typeof Dt=="string"?[Dt,["accumulated"],["get",Pt]]:Dt);nt[Pt]=In.value,rt[Pt]=Vn.value}return ge.map=Pt=>{Mt.properties=Pt;const Dt={};for(const Gt of Rt)Dt[Gt]=nt[Gt].evaluate(Qe,Mt);return Dt},ge.reduce=(Pt,Dt)=>{Mt.properties=Dt;for(const Gt of Rt)Qe.accumulated=Pt[Gt],Pt[Gt]=rt[Gt].evaluate(Qe,Mt)},ge}(N)).load(be.features):function(ge,Pe){return new ts(ge,Pe)}(be,N.geojsonVtOptions)}catch(ge){return U(ge)}this.loaded={};const we={};if(he){const ge=s.getPerformanceMeasurement(ne);ge&&(we.resourceTiming={},we.resourceTiming[N.source]=JSON.parse(JSON.stringify(ge)))}U(null,we)}})}reloadTile(N,U){const ne=this.loaded;return ne&&ne[N.uid]?super.reloadTile(N,U):this.loadTile(N,U)}loadGeoJSON(N,U){if(N.request)s.getJSON(N.request,U);else{if(typeof N.data!="string")return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));try{return U(null,JSON.parse(N.data))}catch{return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(N,U){try{U(null,this._geoJSONIndex.getClusterExpansionZoom(N.clusterId))}catch(ne){U(ne)}}getClusterChildren(N,U){try{U(null,this._geoJSONIndex.getChildren(N.clusterId))}catch(ne){U(ne)}}getClusterLeaves(N,U){try{U(null,this._geoJSONIndex.getLeaves(N.clusterId,N.limit,N.offset))}catch(ne){U(ne)}}}class Cc{constructor(N){this.self=N,this.actor=new s.Actor(N,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=s.getProjection({name:"mercator"}),this.workerSourceTypes={vector:s.VectorTileWorkerSource,geojson:ua},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(U,ne)=>{if(this.workerSourceTypes[U])throw new Error(`Worker source with name "${U}" already registered.`);this.workerSourceTypes[U]=ne},this.self.registerRTLTextPlugin=U=>{if(s.plugin.isParsed())throw new Error("RTL text plugin already registered.");s.plugin.applyArabicShaping=U.applyArabicShaping,s.plugin.processBidirectionalText=U.processBidirectionalText,s.plugin.processStyledBidirectionalText=U.processStyledBidirectionalText}}clearCaches(N,U,ne){delete this.layerIndexes[N],delete this.availableImages[N],delete this.workerSources[N],delete this.demWorkerSources[N],ne()}checkIfReady(N,U,ne){ne()}setReferrer(N,U){this.referrer=U}spriteLoaded(N,U){this.isSpriteLoaded[N]=U;for(const ne in this.workerSources[N]){const he=this.workerSources[N][ne];for(const _e in he)he[_e]instanceof s.VectorTileWorkerSource&&(he[_e].isSpriteLoaded=U,he[_e].fire(new s.Event("isSpriteLoaded")))}}setImages(N,U,ne){this.availableImages[N]=U;for(const he in this.workerSources[N]){const _e=this.workerSources[N][he];for(const be in _e)_e[be].availableImages=U}ne()}enableTerrain(N,U,ne){this.terrain=U,ne()}setProjection(N,U){this.projections[N]=s.getProjection(U)}setLayers(N,U,ne){this.getLayerIndex(N).replace(U),ne()}updateLayers(N,U,ne){this.getLayerIndex(N).update(U.layers,U.removedIds),ne()}loadTile(N,U,ne){const he=this.enableTerrain?s.extend({enableTerrain:this.terrain},U):U;he.projection=this.projections[N]||this.defaultProjection,this.getWorkerSource(N,U.type,U.source).loadTile(he,ne)}loadDEMTile(N,U,ne){const he=this.enableTerrain?s.extend({buildQuadTree:this.terrain},U):U;this.getDEMWorkerSource(N,U.source).loadTile(he,ne)}reloadTile(N,U,ne){const he=this.enableTerrain?s.extend({enableTerrain:this.terrain},U):U;he.projection=this.projections[N]||this.defaultProjection,this.getWorkerSource(N,U.type,U.source).reloadTile(he,ne)}abortTile(N,U,ne){this.getWorkerSource(N,U.type,U.source).abortTile(U,ne)}removeTile(N,U,ne){this.getWorkerSource(N,U.type,U.source).removeTile(U,ne)}removeSource(N,U,ne){if(!this.workerSources[N]||!this.workerSources[N][U.type]||!this.workerSources[N][U.type][U.source])return;const he=this.workerSources[N][U.type][U.source];delete this.workerSources[N][U.type][U.source],he.removeSource!==void 0?he.removeSource(U,ne):ne()}loadWorkerSource(N,U,ne){try{this.self.importScripts(U.url),ne()}catch(he){ne(he.toString())}}syncRTLPluginState(N,U,ne){try{s.plugin.setState(U);const he=s.plugin.getPluginURL();if(s.plugin.isLoaded()&&!s.plugin.isParsed()&&he!=null){this.self.importScripts(he);const _e=s.plugin.isParsed();ne(_e?void 0:new Error(`RTL Text Plugin failed to import scripts from ${he}`),_e)}}catch(he){ne(he.toString())}}getAvailableImages(N){let U=this.availableImages[N];return U||(U=[]),U}getLayerIndex(N){let U=this.layerIndexes[N];return U||(U=this.layerIndexes[N]=new V),U}getWorkerSource(N,U,ne){if(this.workerSources[N]||(this.workerSources[N]={}),this.workerSources[N][U]||(this.workerSources[N][U]={}),!this.workerSources[N][U][ne]){const he={send:(_e,be,we,ge,Pe,nt)=>{this.actor.send(_e,be,we,N,Pe,nt)},scheduler:this.actor.scheduler};this.workerSources[N][U][ne]=new this.workerSourceTypes[U](he,this.getLayerIndex(N),this.getAvailableImages(N),this.isSpriteLoaded[N])}return this.workerSources[N][U][ne]}getDEMWorkerSource(N,U){return this.demWorkerSources[N]||(this.demWorkerSources[N]={}),this.demWorkerSources[N][U]||(this.demWorkerSources[N][U]=new G),this.demWorkerSources[N][U]}enforceCacheSizeLimit(N,U){s.enforceCacheSizeLimit(U)}getWorkerPerformanceMetrics(N,U,ne){ne(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Cc(self)),Cc}),v(["./shared"],function(s){function k(d,o){if(Array.isArray(d)){if(!Array.isArray(o)||d.length!==o.length)return!1;for(let c=0;c"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var f,_,x=new Blob([""],{type:"text/javascript"}),T=URL.createObjectURL(x);try{_=new Worker(T),f=!0}catch{f=!1}return _&&_.terminate(),URL.revokeObjectURL(T),f}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var f=document.createElement("canvas");f.width=f.height=1;var _=f.getContext("2d");if(!_)return!1;var x=_.getImageData(0,0,1,1);return x&&x.width===f.width}()?(G[c=o&&o.failIfMajorPerformanceCaveat]===void 0&&(G[c]=function(f){var _,x=function(T){var S=document.createElement("canvas"),C=Object.create(V.webGLContextAttributes);return C.failIfMajorPerformanceCaveat=T,S.getContext("webgl",C)||S.getContext("experimental-webgl",C)}(f);if(!x)return!1;try{_=x.createShader(x.VERTEX_SHADER)}catch{return!1}return!(!_||x.isContextLost())&&(x.shaderSource(_,"void main() {}"),x.compileShader(_),x.getShaderParameter(_,x.COMPILE_STATUS)===!0)}(c)),G[c]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var c}(d)}var G={};function J(d,o,c){const f=s.window.document.createElement(d);return o!==void 0&&(f.className=o),c&&c.appendChild(f),f}function ve(d,o,c){const f=s.window.document.createElementNS("http://www.w3.org/2000/svg",d);for(const _ of Object.keys(o))f.setAttributeNS(null,_,o[_]);return c&&c.appendChild(f),f}V.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const ae=s.window.document&&s.window.document.documentElement.style,me=ae&&ae.userSelect!==void 0?"userSelect":"WebkitUserSelect";let Ce;function ie(){ae&&me&&(Ce=ae[me],ae[me]="none")}function te(){ae&&me&&(ae[me]=Ce)}function le(d){d.preventDefault(),d.stopPropagation(),s.window.removeEventListener("click",le,!0)}function ze(){s.window.addEventListener("click",le,!0),s.window.setTimeout(()=>{s.window.removeEventListener("click",le,!0)},0)}function Oe(d,o){const c=d.getBoundingClientRect();return ht(d,c,o)}function Ke(d,o){const c=d.getBoundingClientRect(),f=[];for(let _=0;_=0?0:d.button}function ht(d,o,c){const f=d.offsetWidth===o.width?1:d.offsetWidth/o.width;return new s.Point((c.clientX-o.left)*f,(c.clientY-o.top)*f)}function Ve(d,o){var c=o[0],f=o[1],_=o[2],x=o[3],T=c*x-_*f;return T?(d[0]=x*(T=1/T),d[1]=-f*T,d[2]=-_*T,d[3]=c*T,d):null}function jt(d){const{userImage:o}=d;return!!(o&&o.render&&o.render())&&(d.data.replace(new Uint8Array(o.data.buffer)),!0)}class wr extends s.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(o){if(this.loaded!==o&&(this.loaded=o,o)){for(const{ids:c,callback:f}of this.requestors)this._notify(c,f);this.requestors=[]}}hasImage(o){return!!this.getImage(o)}getImage(o){return this.images[o]}addImage(o,c){this._validate(o,c)&&(this.images[o]=c)}_validate(o,c){let f=!0;return this._validateStretch(c.stretchX,c.data&&c.data.width)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "stretchX" value`))),f=!1),this._validateStretch(c.stretchY,c.data&&c.data.height)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "stretchY" value`))),f=!1),this._validateContent(c.content,c)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "content" value`))),f=!1),f}_validateStretch(o,c){if(!o)return!0;let f=0;for(const _ of o){if(_[0]{this.ready=!0})}broadcast(o,c,f){s.asyncAll(this.actors,(_,x)=>{_.send(o,c,x)},f=f||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(o=>{o.remove()}),this.actors=[],this.workerPool.release(this.id)}}function Bt(d,o,c){return o*(s.EXTENT/(d.tileSize*Math.pow(2,c-d.tileID.overscaledZ)))}xt.Actor=s.Actor;class dn{constructor(o,c,f,_){this.screenBounds=o,this.cameraPoint=c,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=f,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,_)}static createFromScreenPoints(o,c){let f,_;if(o instanceof s.Point||typeof o[0]=="number"){const x=s.Point.convert(o);f=[x],_=c.isPointAboveHorizon(x)}else{const x=s.Point.convert(o[0]),T=s.Point.convert(o[1]);f=[x,T],_=s.polygonizeBounds(x,T).every(S=>c.isPointAboveHorizon(S))}return new dn(f,c.getCameraPoint(),_,c)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(o){return s.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],o)}bufferedCameraGeometry(o){const c=this.screenBounds[0],f=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],_=s.polygonizeBounds(c,f,0,!1);return this.cameraPoint.y>f.y&&(this.cameraPoint.x>c.x&&this.cameraPoint.x=f.x?_[2]=this.cameraPoint:this.cameraPoint.x<=c.x&&(_[3]=this.cameraPoint)),s.bufferConvexPolygon(_,o)}bufferedCameraGeometryGlobe(o){const c=this.screenBounds[0],f=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],_=s.polygonizeBounds(c,f,o),x=this.cameraPoint.clone();switch(3*((x.y>c.y)+(x.y>f.y))+((x.x>c.x)+(x.x>f.x))){case 0:_[0]=x,_[4]=x.clone();break;case 1:_.splice(1,0,x);break;case 2:_[1]=x;break;case 3:_.splice(4,0,x);break;case 5:_.splice(2,0,x);break;case 6:_[3]=x;break;case 7:_.splice(3,0,x);break;case 8:_[2]=x}return _}containsTile(o,c,f,_=0){const x=o.queryPadding/c._pixelsPerMercatorPixel+1,T=f?this._bufferedCameraMercator(x,c):this._bufferedScreenMercator(x,c);let S=o.tileID.wrap+(T.unwrapped?_:0);const C=T.polygon.map(X=>s.getTilePoint(o.tileTransform,X,S));if(!s.polygonIntersectsBox(C,0,0,s.EXTENT,s.EXTENT))return;S=o.tileID.wrap+(this.screenGeometryMercator.unwrapped?_:0);const z=this.screenGeometryMercator.polygon.map(X=>s.getTileVec3(o.tileTransform,X,S)),P=z.map(X=>new s.Point(X[0],X[1])),O=c.getFreeCameraOptions().position||new s.MercatorCoordinate(0,0,0),j=s.getTileVec3(o.tileTransform,O,S),W=z.map(X=>{const B=s.sub(X,X,j);return s.normalize(B,B),new s.Ray(j,B)}),H=Bt(o,1,c.zoom)*c._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:P,tilespaceRays:W,bufferedTilespaceGeometry:C,bufferedTilespaceBounds:(Z=s.getBounds(C),Z.min.x=s.clamp(Z.min.x,0,s.EXTENT),Z.min.y=s.clamp(Z.min.y,0,s.EXTENT),Z.max.x=s.clamp(Z.max.x,0,s.EXTENT),Z.max.y=s.clamp(Z.max.y,0,s.EXTENT),Z),tile:o,tileID:o.tileID,pixelToTileUnitsFactor:H};var Z}_bufferedScreenMercator(o,c){const f=ii(o);if(this._screenRaycastCache[f])return this._screenRaycastCache[f];{let _;return _=c.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(o),c):{polygon:this.bufferedScreenGeometry(o).map(x=>c.pointCoordinate3D(x)),unwrapped:!0},this._screenRaycastCache[f]=_,_}}_bufferedCameraMercator(o,c){const f=ii(o);if(this._cameraRaycastCache[f])return this._cameraRaycastCache[f];{let _;return _=c.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(o),c):{polygon:this.bufferedCameraGeometry(o).map(x=>c.pointCoordinate3D(x)),unwrapped:!0},this._cameraRaycastCache[f]=_,_}}_projectAndResample(o,c){const f=function(x,T){const S=s.multiply([],T.pixelMatrix,T.globeMatrix),C=[0,-s.GLOBE_RADIUS,0,1],z=[0,s.GLOBE_RADIUS,0,1],P=[0,0,0,1];s.transformMat4$1(C,C,S),s.transformMat4$1(z,z,S),s.transformMat4$1(P,P,S);const O=new s.Point(C[0]/C[3],C[1]/C[3]),j=new s.Point(z[0]/z[3],z[1]/z[3]),W=s.polygonContainsPoint(x,O)&&C[3]1?vn(x.slice(0,X),T):[],Q=Xnew s.Point(sr(pe.x),pe.y)),Q=Q.map(pe=>new s.Point(sr(pe.x),pe.y));const ee=[...q];ee.length===0&&ee.push(Q[Q.length-1]);const de=s.number(ee[ee.length-1].y,(Q.length===0?q[0]:Q[0]).y,B);let fe;return fe=W?[new s.Point(0,de),new s.Point(0,0),new s.Point(1,0),new s.Point(1,de)]:[new s.Point(1,de),new s.Point(1,1),new s.Point(0,1),new s.Point(0,de)],ee.push(...fe),Q.length===0?ee.push(q[0]):ee.push(...Q),{polygon:ee.map(pe=>new s.MercatorCoordinate(pe.x,pe.y)),unwrapped:!1}}(o,c);if(f)return f;const _=function(x,T){let S=!1,C=-1/0,z=0;for(let O=0;OC&&(C=x[O].x,z=O);for(let O=0;O.5&&(W.x{O.x-=1}),{polygon:x,unwrapped:S}}(vn(o,c).map(x=>new s.Point(sr(x.x),x.y)),c);return{polygon:_.polygon.map(x=>new s.MercatorCoordinate(x.x,x.y)),unwrapped:_.unwrapped}}}function vn(d,o){return s.resample(d,c=>{const f=o.pointCoordinate3D(c);c.x=f.x,c.y=f.y},1/256)}function sr(d){return d<0?1+d%1:d%1}function ii(d){return 100*d|0}function ar(d,o,c,f,_){const x=function(T,S){if(T)return _(T);if(S){d.url&&S.tiles&&d.tiles&&delete d.tiles;const C=s.pick(s.extend(S,d),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);S.vector_layers&&(C.vectorLayers=S.vector_layers,C.vectorLayerIds=C.vectorLayers.map(z=>z.id)),C.tiles=o.canonicalizeTileset(C,d.url),_(null,C)}};return d.url?s.getJSON(o.transformRequest(o.normalizeSourceURL(d.url,null,c,f),s.ResourceType.Source),x):s.exported.frame(()=>x(null,d))}class br{constructor(o,c,f){this.bounds=s.LngLatBounds.convert(this.validateBounds(o)),this.minzoom=c||0,this.maxzoom=f||24}validateBounds(o){return Array.isArray(o)&&o.length===4?[Math.max(-180,o[0]),Math.max(-90,o[1]),Math.min(180,o[2]),Math.min(90,o[3])]:[-180,-90,180,90]}contains(o){const c=Math.pow(2,o.z),f=Math.floor(s.mercatorXfromLng(this.bounds.getWest())*c),_=Math.floor(s.mercatorYfromLat(this.bounds.getNorth())*c),x=Math.ceil(s.mercatorXfromLng(this.bounds.getEast())*c),T=Math.ceil(s.mercatorYfromLat(this.bounds.getSouth())*c);return o.x>=f&&o.x=_&&o.y{this._tileJSONRequest=null,this._loaded=!0,_?(c&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${c}`),f&&f.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${f}`),this.fire(new s.ErrorEvent(_))):x&&(s.extend(this,x),x.bounds&&(this.tileBounds=new br(x.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(x.tiles,this.map._requestManager._customAccessToken),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),o&&o(_)})}loaded(){return this._loaded}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}loadTile(o,c){const f=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme)),_={request:this.map._requestManager.transformRequest(f,s.ResourceType.Tile),data:void 0,uid:o.uid,tileID:o.tileID,tileZoom:o.tileZoom,zoom:o.tileID.overscaledZ,tileSize:this.tileSize*o.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:o.isSymbolTile};if(_.request.collectResourceTiming=this._collectResourceTiming,o.actor&&o.state!=="expired")o.state==="loading"?o.reloadCallback=c:o.request=o.actor.send("reloadTile",_,x.bind(this));else if(o.actor=this._tileWorkers[f]=this._tileWorkers[f]||this.dispatcher.getActor(),this.dispatcher.ready)o.request=o.actor.send("loadTile",_,x.bind(this),void 0,!0);else{const T=s.loadVectorTile.call({deduped:this._deduped},_,(S,C)=>{S||!C?x.call(this,S):(_.data={cacheControl:C.cacheControl,expires:C.expires,rawData:C.rawData.slice(0)},o.actor&&o.actor.send("loadTile",_,x.bind(this),void 0,!0))},!0);o.request={cancel:T}}function x(T,S){return delete o.request,o.aborted?c(null):T&&T.status!==404?c(T):(S&&S.resourceTiming&&(o.resourceTiming=S.resourceTiming),this.map._refreshExpiredTiles&&S&&o.setExpiryData(S),o.loadVectorData(S,this.map.painter),s.cacheEntryPossiblyAdded(this.dispatcher),c(null),void(o.reloadCallback&&(this.loadTile(o,o.reloadCallback),o.reloadCallback=null)))}}abortTile(o){o.request&&(o.request.cancel(),delete o.request),o.actor&&o.actor.send("abortTile",{uid:o.uid,type:this.type,source:this.id})}unloadTile(o){o.unloadVectorData(),o.actor&&o.actor.send("removeTile",{uid:o.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Qe extends s.Evented{constructor(o,c,f,_){super(),this.id=o,this.dispatcher=f,this.setEventedParent(_),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.extend({type:"raster"},c),s.extend(this,s.pick(c,["url","scheme","tileSize"]))}load(o){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=ar(this._options,this.map._requestManager,null,null,(c,f)=>{this._tileJSONRequest=null,this._loaded=!0,c?this.fire(new s.ErrorEvent(c)):f&&(s.extend(this,f),f.bounds&&(this.tileBounds=new br(f.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(f.tiles),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),o&&o(c)})}loaded(){return this._loaded}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}loadTile(o,c){const f=s.exported.devicePixelRatio>=2,_=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme),f,this.tileSize);o.request=s.getImage(this.map._requestManager.transformRequest(_,s.ResourceType.Tile),(x,T,S,C)=>(delete o.request,o.aborted?(o.state="unloaded",c(null)):x?(o.state="errored",c(x)):T?(this.map._refreshExpiredTiles&&o.setExpiryData({cacheControl:S,expires:C}),o.setTexture(T,this.map.painter),o.state="loaded",s.cacheEntryPossiblyAdded(this.dispatcher),void c(null)):c(null)))}static loadTileData(o,c,f){o.setTexture(c,f)}static unloadTileData(o,c){o.texture&&c.saveTileTexture(o.texture)}abortTile(o,c){o.request&&(o.request.cancel(),delete o.request),c()}unloadTile(o,c){o.texture&&this.map.painter.saveTileTexture(o.texture),c()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Mt(d,o,c,f,_,x,T,S){const C=[d,c,_,o,f,x,1,1,1],z=[T,S,1],P=s.adjoint([],C),[O,j,W]=s.transformMat3(z,z,s.transpose(P,P));return s.multiply$1(C,[O,0,0,0,j,0,0,0,W],C)}class Rt extends s.Evented{constructor(o,c,f,_){super(),this.id=o,this.dispatcher=f,this.coordinates=c.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(_),this.options=c,this._dirty=!1}load(o,c){this._loaded=c||!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=s.getImage(this.map._requestManager.transformRequest(this.url,s.ResourceType.Image),(f,_)=>{if(this._imageRequest=null,this._loaded=!0,f)this.fire(new s.ErrorEvent(f));else if(_){const{HTMLImageElement:x}=s.window;this.image=_ instanceof x?s.exported.getImageData(_):_,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,o&&(this.coordinates=o),this._finishLoading()}})}loaded(){return this._loaded}updateImage(o){return this.image&&o.url?(this._imageRequest&&o.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=o.url,this.load(o.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(o){this.map=o,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(o){this.coordinates=o,this._boundsArray=void 0;const c=o.map(s.MercatorCoordinate.fromLngLat);return this.tileID=function(f){let _=1/0,x=1/0,T=-1/0,S=-1/0;for(const O of f)_=Math.min(_,O.x),x=Math.min(x,O.y),T=Math.max(T,O.x),S=Math.max(S,O.y);const C=Math.max(T-_,S-x),z=Math.max(0,Math.floor(-Math.log(C)/Math.LN2)),P=Math.pow(2,z);return new s.CanonicalTileID(z,Math.floor((_+T)/2*P),Math.floor((x+S)/2*P))}(c),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(o){for(const C in this.tiles){const z=this.tiles[C];z.state!=="loaded"&&(z.state="loaded",z.texture=this.texture)}if(this._boundsArray)return;const c=s.tileTransform(this.tileID,this.map.transform.projection),[f,_,x,T]=this.coordinates.map(C=>{const z=c.projection.project(C[0],C[1]);return s.getTilePoint(c,z)._round()});this.perspectiveTransform=function(C,z,P,O,j,W,H,Z,X,B){const q=Mt(0,0,C,0,0,z,C,z),Q=Mt(P,O,j,W,H,Z,X,B);return s.multiply$1(Q,s.adjoint(q,q),Q),[Q[6]/Q[8]*C/s.EXTENT,Q[7]/Q[8]*z/s.EXTENT]}(this.width,this.height,f.x,f.y,_.x,_.y,T.x,T.y,x.x,x.y);const S=this._boundsArray=new s.StructArrayLayout4i8;S.emplaceBack(f.x,f.y,0,0),S.emplaceBack(_.x,_.y,s.EXTENT,0),S.emplaceBack(T.x,T.y,0,s.EXTENT),S.emplaceBack(x.x,x.y,s.EXTENT,s.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=o.createVertexBuffer(S,s.boundsAttributes.members),this.boundsSegments=s.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const o=this.map.painter.context,c=o.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new s.Texture(o,this.image,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(o)}loadTile(o,c){this.tileID&&this.tileID.equals(o.tileID.canonical)?(this.tiles[String(o.tileID.wrap)]=o,o.buckets={},c(null)):(o.state="errored",c(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Pt={vector:rt,raster:Qe,"raster-dem":class extends Qe{constructor(d,o,c,f){super(d,o,c,f),this.type="raster-dem",this.maxzoom=22,this._options=s.extend({type:"raster-dem"},o),this.encoding=o.encoding||"mapbox"}loadTile(d,o){const c=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function f(_,x){_&&(d.state="errored",o(_)),x&&(d.dem=x,d.dem.onDeserialize(),d.needsHillshadePrepare=!0,d.needsDEMTextureUpload=!0,d.state="loaded",o(null))}d.request=s.getImage(this.map._requestManager.transformRequest(c,s.ResourceType.Tile),(function(_,x,T,S){if(delete d.request,d.aborted)d.state="unloaded",o(null);else if(_)d.state="errored",o(_);else if(x){this.map._refreshExpiredTiles&&d.setExpiryData({cacheControl:T,expires:S});const C=s.window.ImageBitmap&&x instanceof s.window.ImageBitmap&&(ca==null&&(ca=s.window.OffscreenCanvas&&new s.window.OffscreenCanvas(1,1).getContext("2d")&&typeof s.window.createImageBitmap=="function"),ca),z=1-(x.width-s.prevPowerOfTwo(x.width))/2;z<1||d.neighboringTiles||(d.neighboringTiles=this._getNeighboringTiles(d.tileID));const P=C?x:s.exported.getImageData(x,z),O={uid:d.uid,coord:d.tileID,source:this.id,rawImageData:P,encoding:this.encoding,padding:z};d.actor&&d.state!=="expired"||(d.actor=this.dispatcher.getActor(),d.actor.send("loadDEMTile",O,f.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(d){const o=d.canonical,c=Math.pow(2,o.z),f=(o.x-1+c)%c,_=o.x===0?d.wrap-1:d.wrap,x=(o.x+1+c)%c,T=o.x+1===c?d.wrap+1:d.wrap,S={};return S[new s.OverscaledTileID(d.overscaledZ,_,o.z,f,o.y).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,T,o.z,x,o.y).key]={backfilled:!1},o.y>0&&(S[new s.OverscaledTileID(d.overscaledZ,_,o.z,f,o.y-1).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,d.wrap,o.z,o.x,o.y-1).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,T,o.z,x,o.y-1).key]={backfilled:!1}),o.y+1{if(this._loaded=!0,this._pendingLoad=null,c)this.fire(new s.ErrorEvent(c));else{const _={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&f&&f.resourceTiming&&f.resourceTiming[this.id]&&(_.resourceTiming=f.resourceTiming[this.id]),this.fire(new s.Event("data",_)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(d,o){const c=d.actor?"reloadTile":"loadTile";d.actor=this.actor,d.request=this.actor.send(c,{type:this.type,uid:d.uid,tileID:d.tileID,tileZoom:d.tileZoom,zoom:d.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(f,_)=>(delete d.request,d.unloadVectorData(),d.aborted?o(null):f?o(f):(d.loadVectorData(_,this.map.painter,c==="reloadTile"),o(null))),void 0,c==="loadTile")}abortTile(d){d.request&&(d.request.cancel(),delete d.request),d.aborted=!0}unloadTile(d){d.unloadVectorData(),this.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Rt{constructor(d,o,c,f){super(d,o,c,f),this.roundZoom=!0,this.type="video",this.options=o}load(){this._loaded=!1;const d=this.options;this.urls=[];for(const o of d.urls)this.urls.push(this.map._requestManager.transformRequest(o,s.ResourceType.Source).url);s.getVideo(this.urls,(o,c)=>{this._loaded=!0,o?this.fire(new s.ErrorEvent(o)):c&&(this.video=c,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(d){if(this.video){const o=this.video.seekable;do.end(0)?this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${o.start(0)} and ${o.end(0)}-second mark.`))):this.video.currentTime=d}}getVideo(){return this.video}onAdd(d){this.map||(this.map=d,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const d=this.map.painter.context,o=d.gl;this.texture?this.video.paused||(this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,this.video)):(this.texture=new s.Texture(d,this.video,o.RGBA),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(d)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Rt,canvas:class extends Rt{constructor(d,o,c,f){super(d,o,c,f),o.coordinates?Array.isArray(o.coordinates)&&o.coordinates.length===4&&!o.coordinates.some(_=>!Array.isArray(_)||_.length!==2||_.some(x=>typeof x!="number"))||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'missing required property "coordinates"'))),o.animate&&typeof o.animate!="boolean"&&this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'optional "animate" property must be a boolean value'))),o.canvas?typeof o.canvas=="string"||o.canvas instanceof s.window.HTMLCanvasElement||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,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 s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'missing required property "canvas"'))),this.options=o,this.animate=o.animate===void 0||o.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof s.window.HTMLCanvasElement?this.options.canvas:s.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new s.ErrorEvent(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())}getCanvas(){return this.canvas}onAdd(d){this.map=d,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const o=this.map.painter.context;this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.Texture(o,this.canvas,o.gl.RGBA,{premultiply:!0}),this._prepareData(o)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const d of[this.canvas.width,this.canvas.height])if(isNaN(d)||d<=0)return!0;return!1}},custom:class extends s.Evented{constructor(d,o,c,f){super(),this.id=d,this.type="custom",this._dataType="raster",this._dispatcher=c,this._implementation=o,this.setEventedParent(f),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new br(this._implementation.bounds,this.minzoom,this.maxzoom)),o.update=this._update.bind(this),o.clearTiles=this._clearTiles.bind(this),o.coveringTiles=this._coveringTiles.bind(this),s.extend(this,s.pick(o,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return s.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(d){this._map=d,this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(d),this.load()}onRemove(d){this._implementation.onRemove&&this._implementation.onRemove(d)}hasTile(d){if(this._implementation.hasTile){const{x:o,y:c,z:f}=d.canonical;return this._implementation.hasTile({x:o,y:c,z:f})}return!this.tileBounds||this.tileBounds.contains(d.canonical)}loadTile(d,o){const{x:c,y:f,z:_}=d.tileID.canonical,x=new s.window.AbortController;d.request=Promise.resolve(this._implementation.loadTile({x:c,y:f,z:_},{signal:x.signal})).then((function(T){return delete d.request,d.aborted?(d.state="unloaded",o(null)):T===void 0?(d.state="errored",o(null)):T===null?(this.loadTileData(d,{width:this.tileSize,height:this.tileSize,data:null}),d.state="loaded",o(null)):function(S){return S instanceof s.window.ImageData||S instanceof s.window.HTMLCanvasElement||S instanceof s.window.ImageBitmap||S instanceof s.window.HTMLImageElement}(T)?(this.loadTileData(d,T),d.state="loaded",void o(null)):(d.state="errored",o(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(T=>{T.code!==20&&(d.state="errored",o(T))}),d.request.cancel=()=>x.abort()}loadTileData(d,o){Qe.loadTileData(d,o,this._map.painter)}unloadTileData(d){Qe.unloadTileData(d,this._map.painter)}unloadTile(d,o){if(this.unloadTileData(d),this._implementation.unloadTile){const{x:c,y:f,z:_}=d.tileID.canonical;this._implementation.unloadTile({x:c,y:f,z:_})}o()}abortTile(d,o){d.request&&d.request.cancel&&(d.request.cancel(),delete d.request),o()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(d=>({x:d.canonical.x,y:d.canonical.y,z:d.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}}},Dt=function(d,o,c,f){const _=new Pt[o.type](d,o,c,f);if(_.id!==d)throw new Error(`Expected Source id to be ${d} instead of ${_.id}`);return s.bindAll(["load","abort","unload","serialize","prepare"],_),_};function Gt(d,o){const c=s.identity([]);return s.scale(c,c,[.5*d.width,.5*-d.height,1]),s.translate(c,c,[1,-1,0]),s.multiply(c,c,d.calculateProjMatrix(o.toUnwrapped())),Float32Array.from(c)}function In(d,o,c,f,_,x,T,S=!1){const C=d.tilesIn(f,T,S);C.sort(Ir);const z=[];for(const O of C)z.push({wrappedTileID:O.tile.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(o,c,d._state,O,_,x,Gt(d.transform,O.tile.tileID),S)});const P=function(O){const j={},W={};for(const H of O){const Z=H.queryResults,X=H.wrappedTileID,B=W[X]=W[X]||{};for(const q in Z){const Q=Z[q],ee=B[q]=B[q]||{},de=j[q]=j[q]||[];for(const fe of Q)ee[fe.featureIndex]||(ee[fe.featureIndex]=!0,de.push(fe))}}return j}(z);for(const O in P)P[O].forEach(j=>{const W=j.feature,H=W.layer;H&&H.type!=="background"&&H.type!=="sky"&&(W.source=H.source,H["source-layer"]&&(W.sourceLayer=H["source-layer"]),W.state=W.id!==void 0?d.getFeatureState(H["source-layer"],W.id):{})});return P}function Vn(d,o){const c=d.getRenderableIds().map(x=>d.getTileByID(x)),f=[],_={};for(let x=0;x{c.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ji]}numActive(){return Object.keys(this.active).length}}let Or;function ha(){return Or||(Or=new hr),Or}function G_(d,o){const c={};for(const f in d)f!=="ref"&&(c[f]=d[f]);return s.refProperties.forEach(f=>{f in o&&(c[f]=o[f])}),c}function lf(d){d=d.slice();const o=Object.create(null);for(let c=0;c0?(_-T)/S:0;return this.points[x].mult(1-C).add(this.points[c].mult(C))}}class Is{constructor(o,c,f){const _=this.boxCells=[],x=this.circleCells=[];this.xCellCount=Math.ceil(o/f),this.yCellCount=Math.ceil(c/f);for(let T=0;Tthis.width||_<0||c>this.height)return!x&&[];const S=[];if(o<=0&&c<=0&&this.width<=f&&this.height<=_){if(x)return!0;for(let C=0;C0:S}_queryCircle(o,c,f,_,x){const T=o-f,S=o+f,C=c-f,z=c+f;if(S<0||T>this.width||z<0||C>this.height)return!_&&[];const P=[];return this._forEachCell(T,C,S,z,this._queryCellCircle,P,{hitTest:_,circle:{x:o,y:c,radius:f},seenUids:{box:{},circle:{}}},x),_?P.length>0:P}query(o,c,f,_,x){return this._query(o,c,f,_,!1,x)}hitTest(o,c,f,_,x){return this._query(o,c,f,_,!0,x)}hitTestCircle(o,c,f,_){return this._queryCircle(o,c,f,!0,_)}_queryCell(o,c,f,_,x,T,S,C){const z=S.seenUids,P=this.boxCells[x];if(P!==null){const j=this.bboxes;for(const W of P)if(!z.box[W]){z.box[W]=!0;const H=4*W;if(o<=j[H+2]&&c<=j[H+3]&&f>=j[H+0]&&_>=j[H+1]&&(!C||C(this.boxKeys[W]))){if(S.hitTest)return T.push(!0),!0;T.push({key:this.boxKeys[W],x1:j[H],y1:j[H+1],x2:j[H+2],y2:j[H+3]})}}}const O=this.circleCells[x];if(O!==null){const j=this.circles;for(const W of O)if(!z.circle[W]){z.circle[W]=!0;const H=3*W;if(this._circleAndRectCollide(j[H],j[H+1],j[H+2],o,c,f,_)&&(!C||C(this.circleKeys[W]))){if(S.hitTest)return T.push(!0),!0;{const Z=j[H],X=j[H+1],B=j[H+2];T.push({key:this.circleKeys[W],x1:Z-B,y1:X-B,x2:Z+B,y2:X+B})}}}}}_queryCellCircle(o,c,f,_,x,T,S,C){const z=S.circle,P=S.seenUids,O=this.boxCells[x];if(O!==null){const W=this.bboxes;for(const H of O)if(!P.box[H]){P.box[H]=!0;const Z=4*H;if(this._circleAndRectCollide(z.x,z.y,z.radius,W[Z+0],W[Z+1],W[Z+2],W[Z+3])&&(!C||C(this.boxKeys[H])))return T.push(!0),!0}}const j=this.circleCells[x];if(j!==null){const W=this.circles;for(const H of j)if(!P.circle[H]){P.circle[H]=!0;const Z=3*H;if(this._circlesCollide(W[Z],W[Z+1],W[Z+2],z.x,z.y,z.radius)&&(!C||C(this.circleKeys[H])))return T.push(!0),!0}}}_forEachCell(o,c,f,_,x,T,S,C){const z=this._convertToXCellCoord(o),P=this._convertToYCellCoord(c),O=this._convertToXCellCoord(f),j=this._convertToYCellCoord(_);for(let W=z;W<=O;W++)for(let H=P;H<=j;H++)if(x.call(this,o,c,f,_,this.xCellCount*H+W,T,S,C))return}_convertToXCellCoord(o){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(o*this.xScale)))}_convertToYCellCoord(o){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(o*this.yScale)))}_circlesCollide(o,c,f,_,x,T){const S=_-o,C=x-c,z=f+T;return z*z>S*S+C*C}_circleAndRectCollide(o,c,f,_,x,T,S){const C=(T-_)/2,z=Math.abs(o-(_+C));if(z>C+f)return!1;const P=(S-x)/2,O=Math.abs(c-(x+P));if(O>P+f)return!1;if(z<=C||O<=P)return!0;const j=z-C,W=O-P;return j*j+W*W<=f*f}}const wo={unknown:0,flipRequired:1,flipNotRequired:2},vl=Math.tan(85*Math.PI/180);function Re(d,o,c,f,_,x,T){const S=s.create();if(c)if(x.name==="globe"){const C=s.calculateGlobeLabelMatrix(_,o);s.multiply(S,S,C)}else{const C=Ve([],T);S[0]=C[0],S[1]=C[1],S[4]=C[2],S[5]=C[3],f||s.rotateZ(S,S,_.angle)}else s.multiply(S,_.labelPlaneMatrix,d);return S}function bo(d,o,c,f,_,x,T){const S=Re(d,o,c,f,_,x,T);return x.name==="globe"&&c||(S[2]=S[6]=S[10]=S[14]=0),S}function $n(d,o,c,f,_,x,T){if(c){if(x.name==="globe"){const S=Re(d,o,c,f,_,x,T);return s.invert(S,S),s.multiply(S,d,S),S}{const S=s.clone(d),C=s.identity([]);return C[0]=T[0],C[1]=T[1],C[4]=T[2],C[5]=T[3],s.multiply(S,S,C),f||s.rotateZ(S,S,-_.angle),S}}return _.glCoordMatrix}function dr(d,o,c,f){const _=[d,o,c,1];c?s.transformMat4$1(_,_,f):Nt(_,_,f);const x=_[3];return _[0]/=x,_[1]/=x,_[2]/=x,_}function cf(d,o){return Math.min(.5+d/o*.5,1.5)}function eo(d,o){const c=d[0]/d[3],f=d[1]/d[3];return c>=-o[0]&&c<=o[0]&&f>=-o[1]&&f<=o[1]}function Sh(d,o,c,f,_,x,T,S,C,z){const P=c.transform,O=f?d.textSizeData:d.iconSizeData,j=s.evaluateSizeForZoom(O,c.transform.zoom),W=P.projection.name==="globe",H=[256/c.width*2+1,256/c.height*2+1],Z=f?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;Z.clear();let X=null;W&&(X=f?d.text.globeExtVertexArray:d.icon.globeExtVertexArray);const B=d.lineVertexArray,q=f?d.text.placedSymbolArray:d.icon.placedSymbolArray,Q=c.transform.width/c.transform.height;let ee,de=!1;for(let fe=0;feMath.abs(c)?{useVertical:!0}:d===s.WritingMode.vertical?f>0?{needsFlipping:!0}:null:o!==wo.unknown&&function(_,x){return _===0||Math.abs(x/_)>vl}(c,f)?o===wo.flipRequired?{needsFlipping:!0}:null:c<0?{needsFlipping:!0}:null}function lt(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B,q){const Q=o/24,ee=d.lineOffsetX*Q,de=d.lineOffsetY*Q,{lineStartIndex:fe,glyphStartIndex:pe,numGlyphs:xe,segment:ye,writingMode:Ae,flipState:We}=d,Ee=fe+d.lineLength,Fe=ke=>{if(P){const[Xe,$e,Ye]=ke.up,gt=z.length;s.updateGlobeVertexNormal(P,gt+0,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+1,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+2,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+3,Xe,$e,Ye)}const[qe,Se,Be]=ke.point;s.addDynamicAttributes(z,qe,Se,Be,ke.angle)};if(xe>1){const ke=uf(Q,S,ee,de,c,O,j,d,C,x,W,Z,!1,X,B,q);if(!ke)return{notEnoughRoom:!0};if(f&&!c){let[qe,Se,Be]=ke.first.point,[Xe,$e,Ye]=ke.last.point;[qe,Se]=dr(qe,Se,Be,T),[Xe,$e]=dr(Xe,$e,Ye,T);const gt=da(Ae,We,(Xe-qe)*H,$e-Se);if(d.flipState=gt&>.needsFlipping?wo.flipRequired:wo.flipNotRequired,gt)return gt}Fe(ke.first);for(let qe=pe+1;qe0?Xe:Ft(j,Be,qe,1,_,void 0,X,B.canonical),Ye=da(Ae,We,($e[0]-qe[0])*H,$e[1]-qe[1]);if(d.flipState=Ye&&Ye.needsFlipping?wo.flipRequired:wo.flipNotRequired,Ye)return Ye}const ke=si(Q*S.getoffsetX(pe),ee,de,c,O,j,ye,fe,Ee,C,x,W,Z,!1,!1,X,B,q);if(!ke)return{notEnoughRoom:!0};Fe(ke)}return{}}function $t(d,o,c,f,_){const{x,y:T,z:S}=f.projectTilePoint(d.x,d.y,o);if(!_)return dr(x,T,S,c);const[C,z,P]=_(d);return dr(x+C,T+z,S+P,c)}function Ft(d,o,c,f,_,x,T,S){const C=$t(d.sub(o)._unit()._add(d),S,_,T,x);return s.sub(C,c,C),s.normalize(C,C),s.scaleAndAdd(C,c,C,f)}function si(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B){const q=f?d-o:d+o;let Q=q>0?1:-1,ee=0;f&&(Q*=-1,ee=Math.PI),Q<0&&(ee+=Math.PI);let de=S+T+(Q>0?0:1)|0,fe=_,pe=_,xe=0,ye=0;const Ae=Math.abs(q),We=[],Ee=[];let Fe=x,ke=Fe;const qe=()=>Ft(ke,Fe,pe,Ae-xe+1,P,j,Z,X.canonical);for(;xe+ye<=Ae;){if(de+=Q,de=C)return null;if(pe=fe,ke=Fe,We.push(pe),W&&Ee.push(ke),Fe=new s.Point(z.getx(de),z.gety(de)),fe=O[de],!fe){const wt=$t(Fe,X.canonical,P,Z,j);fe=wt[3]>0?O[de]=wt:qe()}xe+=ye,ye=s.distance(pe,fe)}H&&j&&(O[de]&&(fe=qe(),ye=s.distance(pe,fe)),O[de]=fe);const Se=(Ae-xe)/ye,Be=Fe.sub(ke)._mult(Se)._add(ke),Xe=s.sub([],fe,pe),$e=s.scaleAndAdd([],pe,Xe,Se);let Ye=[0,0,1],gt=Xe[0],Et=Xe[1];if(B&&(Ye=Z.upVector(X.canonical,Be.x,Be.y),Ye[0]!==0||Ye[1]!==0||Ye[2]!==1)){const wt=[Ye[2],0,-Ye[0]],Ut=s.cross([],Ye,wt);s.normalize(wt,wt),s.normalize(Ut,Ut),gt=s.dot(Xe,wt),Et=s.dot(Xe,Ut)}if(c){const wt=s.cross([],Ye,Xe);s.normalize(wt,wt),s.scaleAndAdd($e,$e,wt,c*Q)}const pt=ee+Math.atan2(Et,gt);return We.push($e),W&&Ee.push(Be),{point:$e,angle:pt,path:We,tilePath:Ee,up:Ye}}function Ri(d,o){const c=o.length,f=c+4*d;o.resize(f),o.float32.fill(-1/0,4*c,4*f)}function Nt(d,o,c){const f=o[0],_=o[1];return d[0]=c[0]*f+c[4]*_+c[12],d[1]=c[1]*f+c[5]*_+c[13],d[3]=c[3]*f+c[7]*_+c[15],d}const ai=100;class xl{constructor(o,c,f=new Is(o.width+200,o.height+200,25),_=new Is(o.width+200,o.height+200,25)){this.transform=o,this.grid=f,this.ignoredGrid=_,this.pitchfactor=Math.cos(o._pitch)*o.cameraToCenterDistance,this.screenRightBoundary=o.width+ai,this.screenBottomBoundary=o.height+ai,this.gridRightBoundary=o.width+200,this.gridBottomBoundary=o.height+200,this.fogState=c}placeCollisionBox(o,c,f,_,x,T,S,C){let z=f.projectedAnchorX,P=f.projectedAnchorY,O=f.projectedAnchorZ;const j=f.elevation,W=f.tileID,H=o.getProjection();if(j&&W){const[fe,pe,xe]=H.upVector(W.canonical,f.tileAnchorX,f.tileAnchorY),ye=H.upVectorScale(W.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;z+=fe*j*ye,P+=pe*j*ye,O+=xe*j*ye}const Z=this.projectAndGetPerspectiveRatio(S,z,P,O,f.tileID,H.name==="globe"||!!j||this.transform.pitch>0,H),X=T*Z.perspectiveRatio,B=(f.x1*c+_.x-f.padding)*X+Z.point.x,q=(f.y1*c+_.y-f.padding)*X+Z.point.y,Q=(f.x2*c+_.x+f.padding)*X+Z.point.x,ee=(f.y2*c+_.y+f.padding)*X+Z.point.y,de=Z.perspectiveRatio<=.55||Z.occluded;return!this.isInsideGrid(B,q,Q,ee)||!x&&this.grid.hitTest(B,q,Q,ee,C)||de?{box:[],offscreen:!1,occluded:Z.occluded}:{box:[B,q,Q,ee],offscreen:this.isOffscreen(B,q,Q,ee),occluded:!1}}placeCollisionCircles(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z){const X=[],B=this.transform.elevation,q=o.getProjection(),Q=B?B.getAtTileOffsetFunc(Z,this.transform.center.lat,this.transform.worldSize,q):null,ee=new s.Point(f.tileAnchorX,f.tileAnchorY);let{x:de,y:fe,z:pe}=q.projectTilePoint(ee.x,ee.y,Z.canonical);if(Q){const[Be,Xe,$e]=Q(ee);de+=Be,fe+=Xe,pe+=$e}const xe=q.name==="globe",ye=this.projectAndGetPerspectiveRatio(S,de,fe,pe,Z,xe||!!B||this.transform.pitch>0,q),{perspectiveRatio:Ae}=ye,We=(O?T/Ae:T*Ae)/s.ONE_EM,Ee=dr(de,fe,pe,C),Fe=ye.signedDistanceFromCamera>0?uf(We,x,f.lineOffsetX*We,f.lineOffsetY*We,!1,Ee,ee,f,_,C,{},B&&!O?Q:null,O&&!!B,q,Z,O):null;let ke=!1,qe=!1,Se=!0;if(Fe&&!ye.occluded){const Be=.5*W*Ae+H,Xe=new s.Point(-100,-100),$e=new s.Point(this.screenRightBoundary,this.screenBottomBoundary),Ye=new Th,{first:gt,last:Et}=Fe,pt=gt.path.length;let wt=[];for(let mt=pt-1;mt>=1;mt--)wt.push(gt.path[mt]);for(let mt=1;mt(Q&&!xe&&(rn=Q(onmt[3]<=0)&&(wt=[]));let Ot=[];if(wt.length>0){let mt=1/0,en=-1/0,rn=1/0,on=-1/0;for(const sn of wt)mt=Math.min(mt,sn[0]),rn=Math.min(rn,sn[1]),en=Math.max(en,sn[0]),on=Math.max(on,sn[1]);en>=Xe.x&&mt<=$e.x&&on>=Xe.y&&rn<=$e.y&&(Ot=[wt.map(sn=>new s.Point(sn[0],sn[1]))],(mt$e.x||rn$e.y)&&(Ot=s.clipLine(Ot,Xe.x,Xe.y,$e.x,$e.y)))}for(const mt of Ot){Ye.reset(mt,.25*Be);let en=0;en=Ye.length<=.5*Be?1:Math.ceil(Ye.paddedLength/Ut)+1;for(let rn=0;rn0?(s.transformMat4$1(C,C,o),this.fogState&&x&&S.name!=="globe"&&(z=function(j,W,H,Z,X,B){const q=B.calculateFogTileMatrix(X),Q=[W,H,Z];return s.transformMat4(Q,Q,q),Li(j,Q,B.pitch,B._fov)}(this.fogState,c,f,_,x.toUnwrapped(),this.transform)>.9)):Nt(C,C,o);const P=C[3];return{point:new s.Point((C[0]/P+1)/2*this.transform.width+ai,(-C[1]/P+1)/2*this.transform.height+ai),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(S)/P*.5,1.5),signedDistanceFromCamera:P,occluded:T&&C[2]>P||z}}isOffscreen(o,c,f,_){return f=this.screenRightBoundary||_this.screenBottomBoundary}isInsideGrid(o,c,f,_){return f>=0&&o=0&&cf.collisionGroupID===c}}return this.collisionGroups[o]}}function El(d,o,c,f,_){const{horizontalAlign:x,verticalAlign:T}=s.getAnchorAlignment(d),S=-(x-.5)*o,C=-(T-.5)*c,z=s.evaluateVariableOffset(d,f);return new s.Point(S+z[0]*_,C+z[1]*_)}function Tl(d,o,c,f,_){const x=new s.Point(d,o);return c&&x._rotate(f?_:-_),x}class kc{constructor(o,c,f,_,x){this.transform=o.clone(),this.projection=o.projection.name,this.collisionIndex=new xl(this.transform,x),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new df(f),this.collisionCircleArrays={},this.prevPlacement=_,_&&(_.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(o,c,f,_){const x=f.getBucket(c),T=f.latestFeatureIndex;if(!x||!T||c.id!==x.layerIds[0])return;const S=x.layers[0].layout,C=f.collisionBoxArray,z=Math.pow(2,this.transform.zoom-f.tileID.overscaledZ),P=f.tileSize/s.EXTENT,O=f.tileID.toUnwrapped();this.transform.setProjection(x.projection);const j=(W=f.tileID,H=x.getProjection(),Z=this.transform,H.name===this.projection?Z.calculateProjMatrix(W.toUnwrapped()):ks(Z,H,W));var W,H,Z;const X=S.get("text-pitch-alignment")==="map",B=S.get("text-rotation-alignment")==="map";c.compileFilter();const q=c.dynamicFilter(),Q=c.dynamicFilterNeedsFeature(),ee=this.transform.calculatePixelsToTileUnitsMatrix(f),de=bo(j,f.tileID.canonical,X,B,this.transform,x.getProjection(),ee);let fe=null;if(X){const ye=$n(j,f.tileID.canonical,X,B,this.transform,x.getProjection(),ee);fe=s.multiply([],this.transform.labelPlaneMatrix,ye)}let pe=null;q&&f.latestFeatureIndex&&(pe={unwrappedTileID:O,dynamicFilter:q,dynamicFilterNeedsFeature:Q,featureIndex:f.latestFeatureIndex}),this.retainedQueryData[x.bucketInstanceId]=new Ah(x.bucketInstanceId,T,x.sourceLayerIndex,x.index,f.tileID);const xe={bucket:x,layout:S,posMatrix:j,textLabelPlaneMatrix:de,labelToScreenMatrix:fe,clippingData:pe,scale:z,textPixelRatio:P,holdingForFade:f.holdingForFade(),collisionBoxArray:C,partiallyEvaluatedTextSize:s.evaluateSizeForZoom(x.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:s.evaluateSizeForZoom(x.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(x.sourceID)};if(_)for(const ye of x.sortKeyRanges){const{sortKey:Ae,symbolInstanceStart:We,symbolInstanceEnd:Ee}=ye;o.push({sortKey:Ae,symbolInstanceStart:We,symbolInstanceEnd:Ee,parameters:xe})}else o.push({symbolInstanceStart:0,symbolInstanceEnd:x.symbolInstances.length,parameters:xe})}attemptAnchorPlacement(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B,q){const{textOffset0:Q,textOffset1:ee,crossTileID:de}=j,fe=[Q,ee],pe=El(o,f,_,fe,x),xe=this.collisionIndex.placeCollisionBox(H,x,c,Tl(pe.x,pe.y,T,S,this.transform.angle),O,C,z,P.predicate);if(X){const ye=H.getSymbolInstanceIconSize(q,this.transform.zoom,j.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(H,ye,X,Tl(pe.x,pe.y,T,S,this.transform.angle),O,C,z,P.predicate).box.length===0)return}if(xe.box.length>0){let ye;return this.prevPlacement&&this.prevPlacement.variableOffsets[de]&&this.prevPlacement.placements[de]&&this.prevPlacement.placements[de].text&&(ye=this.prevPlacement.variableOffsets[de].anchor),this.variableOffsets[de]={textOffset:fe,width:f,height:_,anchor:o,textScale:x,prevAnchor:ye},this.markUsedJustification(H,o,j,Z),H.allowVerticalPlacement&&(this.markUsedOrientation(H,Z,j),this.placedOrientations[de]=Z),{shift:pe,placedGlyphBoxes:xe}}}placeLayerBucketPart(o,c,f,_){const{bucket:x,layout:T,posMatrix:S,textLabelPlaneMatrix:C,labelToScreenMatrix:z,clippingData:P,textPixelRatio:O,holdingForFade:j,collisionBoxArray:W,partiallyEvaluatedTextSize:H,partiallyEvaluatedIconSize:Z,collisionGroup:X}=o.parameters,B=T.get("text-optional"),q=T.get("icon-optional"),Q=T.get("text-allow-overlap"),ee=T.get("icon-allow-overlap"),de=T.get("text-rotation-alignment")==="map",fe=T.get("text-pitch-alignment")==="map",pe=T.get("icon-text-fit")!=="none",xe=T.get("symbol-z-order")==="viewport-y";this.transform.setProjection(x.projection);let ye=Q&&(ee||!x.hasIconData()||q),Ae=ee&&(Q||!x.hasTextData()||B);!x.collisionArrays&&W&&x.deserializeCollisionBoxes(W),f&&_&&x.updateCollisionDebugBuffers(this.transform.zoom,W);const We=(Ee,Fe,ke)=>{const{crossTileID:qe,numVerticalGlyphVertices:Se}=Ee;if(P){const An={zoom:this.transform.zoom,pitch:this.transform.pitch};let an=null;if(P.dynamicFilterNeedsFeature){const Xt=this.retainedQueryData[x.bucketInstanceId];an=P.featureIndex.loadFeature({featureIndex:Ee.featureIndex,bucketIndex:Xt.bucketIndex,sourceLayerIndex:Xt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,P.dynamicFilter)(An,an,this.retainedQueryData[x.bucketInstanceId].tileID.canonical,new s.Point(Ee.tileAnchorX,Ee.tileAnchorY),this.transform.calculateDistanceTileData(P.unwrappedTileID)))return this.placements[qe]=new wl(!1,!1,!1,!0),void c.add(qe)}if(c.has(qe))return;if(j)return void(this.placements[qe]=new wl(!1,!1,!1));let Be=!1,Xe=!1,$e=!0,Ye=!1,gt=!1,Et=null,pt={box:null,offscreen:null,occluded:null},wt={box:null,offscreen:null,occluded:null},Ut=null,Ot=null,mt=null,en=0,rn=0,on=0;ke.textFeatureIndex?en=ke.textFeatureIndex:Ee.useRuntimeCollisionCircles&&(en=Ee.featureIndex),ke.verticalTextFeatureIndex&&(rn=ke.verticalTextFeatureIndex);const sn=An=>{An.tileID=this.retainedQueryData[x.bucketInstanceId].tileID;const an=this.transform.elevation;(an||An.elevation)&&(An.elevation=an?an.getAtTileOffset(An.tileID,An.tileAnchorX,An.tileAnchorY):0)},Mr=ke.textBox;if(Mr){sn(Mr);const An=Xt=>{let Gn=s.WritingMode.horizontal;if(x.allowVerticalPlacement&&!Xt&&this.prevPlacement){const Br=this.prevPlacement.placedOrientations[qe];Br&&(this.placedOrientations[qe]=Br,Gn=Br,this.markUsedOrientation(x,Gn,Ee))}return Gn},an=(Xt,Gn)=>{if(x.allowVerticalPlacement&&Se>0&&ke.verticalTextBox){for(const Br of x.writingModes)if(Br===s.WritingMode.vertical?(pt=Gn(),wt=pt):pt=Xt(),pt&&pt.box&&pt.box.length)break}else pt=Xt()};if(T.get("text-variable-anchor")){let Xt=T.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[qe]){const En=this.prevPlacement.variableOffsets[qe];Xt.indexOf(En.anchor)>0&&(Xt=Xt.filter(Wr=>Wr!==En.anchor),Xt.unshift(En.anchor))}const Gn=(En,Wr,nu)=>{const Bs=x.getSymbolInstanceTextSize(H,Ee,this.transform.zoom,Fe),Gl=(En.x2-En.x1)*Bs+2*En.padding,Mo=(En.y2-En.y1)*Bs+2*En.padding,is=pe&&!ee?Wr:null;is&&sn(is);let Fs={box:[],offscreen:!1,occluded:!1};const ru=Q?2*Xt.length:Xt.length;for(let ql=0;ql=Xt.length,Ee,Fe,x,nu,is,H,Z);if(gd&&(Fs=gd.placedGlyphBoxes,Fs&&Fs.box&&Fs.box.length)){Be=!0,Et=gd.shift;break}}return Fs};an(()=>Gn(Mr,ke.iconBox,s.WritingMode.horizontal),()=>{const En=ke.verticalTextBox;return En&&sn(En),x.allowVerticalPlacement&&!(pt&&pt.box&&pt.box.length)&&Se>0&&En?Gn(En,ke.verticalIconBox,s.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),pt&&(Be=pt.box,$e=pt.offscreen,Ye=pt.occluded);const Br=An(!(!pt||!pt.box));if(!Be&&this.prevPlacement){const En=this.prevPlacement.variableOffsets[qe];En&&(this.variableOffsets[qe]=En,this.markUsedJustification(x,En.anchor,Ee,Br))}}else{const Xt=(Gn,Br)=>{const En=x.getSymbolInstanceTextSize(H,Ee,this.transform.zoom,Fe),Wr=this.collisionIndex.placeCollisionBox(x,En,Gn,new s.Point(0,0),Q,O,S,X.predicate);return Wr&&Wr.box&&Wr.box.length&&(this.markUsedOrientation(x,Br,Ee),this.placedOrientations[qe]=Br),Wr};an(()=>Xt(Mr,s.WritingMode.horizontal),()=>{const Gn=ke.verticalTextBox;return x.allowVerticalPlacement&&Se>0&&Gn?(sn(Gn),Xt(Gn,s.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),An(!!(pt&&pt.box&&pt.box.length))}}if(Ut=pt,Be=Ut&&Ut.box&&Ut.box.length>0,$e=Ut&&Ut.offscreen,Ye=Ut&&Ut.occluded,Ee.useRuntimeCollisionCircles){const An=x.text.placedSymbolArray.get(Ee.centerJustifiedTextSymbolIndex>=0?Ee.centerJustifiedTextSymbolIndex:Ee.verticalPlacedTextSymbolIndex),an=s.evaluateSizeForFeature(x.textSizeData,H,An),Xt=T.get("text-padding");Ot=this.collisionIndex.placeCollisionCircles(x,Q,An,x.lineVertexArray,x.glyphOffsetArray,an,S,C,z,f,fe,X.predicate,Ee.collisionCircleDiameter*an/s.ONE_EM,Xt,this.retainedQueryData[x.bucketInstanceId].tileID),Be=Q||Ot.circles.length>0&&!Ot.collisionDetected,$e=$e&&Ot.offscreen,Ye=Ot.occluded}if(ke.iconFeatureIndex&&(on=ke.iconFeatureIndex),ke.iconBox){const An=an=>{sn(an);const Xt=pe&&Et?Tl(Et.x,Et.y,de,fe,this.transform.angle):new s.Point(0,0),Gn=x.getSymbolInstanceIconSize(Z,this.transform.zoom,Ee.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(x,Gn,an,Xt,ee,O,S,X.predicate)};wt&&wt.box&&wt.box.length&&ke.verticalIconBox?(mt=An(ke.verticalIconBox),Xe=mt.box.length>0):(mt=An(ke.iconBox),Xe=mt.box.length>0),$e=$e&&mt.offscreen,gt=mt.occluded}const fr=B||Ee.numHorizontalGlyphVertices===0&&Se===0,vi=q||Ee.numIconVertices===0;if(fr||vi?vi?fr||(Xe=Xe&&Be):Be=Xe&&Be:Xe=Be=Xe&&Be,Be&&Ut&&Ut.box&&this.collisionIndex.insertCollisionBox(Ut.box,T.get("text-ignore-placement"),x.bucketInstanceId,wt&&wt.box&&rn?rn:en,X.ID),Xe&&mt&&this.collisionIndex.insertCollisionBox(mt.box,T.get("icon-ignore-placement"),x.bucketInstanceId,on,X.ID),Ot&&(Be&&this.collisionIndex.insertCollisionCircles(Ot.circles,T.get("text-ignore-placement"),x.bucketInstanceId,en,X.ID),f)){const An=x.bucketInstanceId;let an=this.collisionCircleArrays[An];an===void 0&&(an=this.collisionCircleArrays[An]=new bl);for(let Xt=0;Xt=0;--Fe){const ke=Ee[Fe];We(x.symbolInstances.get(ke),ke,x.collisionArrays[ke])}}else for(let Ee=o.symbolInstanceStart;Ee=0&&(o.text.placedSymbolArray.get(x).crossTileID=O>=0&&x!==O?0:z),T>=0&&(o.text.placedSymbolArray.get(T).crossTileID=O>=0&&T!==O?0:z),S>=0&&(o.text.placedSymbolArray.get(S).crossTileID=O>=0&&S!==O?0:z),C>=0&&(o.text.placedSymbolArray.get(C).crossTileID=O>=0&&C!==O?0:z)}markUsedOrientation(o,c,f){const _=c===s.WritingMode.horizontal||c===s.WritingMode.horizontalOnly?c:0,x=c===s.WritingMode.vertical?c:0,{leftJustifiedTextSymbolIndex:T,centerJustifiedTextSymbolIndex:S,rightJustifiedTextSymbolIndex:C,verticalPlacedTextSymbolIndex:z}=f,P=o.text.placedSymbolArray;T>=0&&(P.get(T).placedOrientation=_),S>=0&&(P.get(S).placedOrientation=_),C>=0&&(P.get(C).placedOrientation=_),z>=0&&(P.get(z).placedOrientation=x)}commit(o){this.commitTime=o,this.zoomAtLastRecencyCheck=this.transform.zoom;const c=this.prevPlacement;let f=!1;this.prevZoomAdjustment=c?c.zoomAdjustment(this.transform.zoom):0;const _=c?c.symbolFadeChange(o):1,x=c?c.opacities:{},T=c?c.variableOffsets:{},S=c?c.placedOrientations:{};for(const C in this.placements){const z=this.placements[C],P=x[C];P?(this.opacities[C]=new Eo(P,_,z.text,z.icon,null,z.clipped),f=f||z.text!==P.text.placed||z.icon!==P.icon.placed):(this.opacities[C]=new Eo(null,_,z.text,z.icon,z.skipFade,z.clipped),f=f||z.text||z.icon)}for(const C in x){const z=x[C];if(!this.opacities[C]){const P=new Eo(z,_,!1,!1);P.isHidden()||(this.opacities[C]=P,f=f||z.text.placed||z.icon.placed)}}for(const C in T)this.variableOffsets[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.variableOffsets[C]=T[C]);for(const C in S)this.placedOrientations[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.placedOrientations[C]=S[C]);f?this.lastPlacementChangeTime=o:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=c?c.lastPlacementChangeTime:o)}updateLayerOpacities(o,c){const f=new Set;for(const _ of c){const x=_.getBucket(o);x&&_.latestFeatureIndex&&o.id===x.layerIds[0]&&this.updateBucketOpacities(x,f,_.collisionBoxArray)}}updateBucketOpacities(o,c,f){o.hasTextData()&&o.text.opacityVertexArray.clear(),o.hasIconData()&&o.icon.opacityVertexArray.clear(),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexArray.clear(),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexArray.clear();const _=o.layers[0].layout,x=!!o.layers[0].dynamicFilter(),T=new Eo(null,0,!1,!1,!0),S=_.get("text-allow-overlap"),C=_.get("icon-allow-overlap"),z=_.get("text-variable-anchor"),P=_.get("text-rotation-alignment")==="map",O=_.get("text-pitch-alignment")==="map",j=_.get("icon-text-fit")!=="none",W=new Eo(null,0,S&&(C||!o.hasIconData()||_.get("icon-optional")),C&&(S||!o.hasTextData()||_.get("text-optional")),!0);!o.collisionArrays&&f&&(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData())&&o.deserializeCollisionBoxes(f);const H=(X,B,q)=>{for(let Q=0;Q0||Q>0,ye=de>0,Ae=this.placedOrientations[ee],We=Ae===s.WritingMode.vertical,Ee=Ae===s.WritingMode.horizontal||Ae===s.WritingMode.horizontalOnly;if(!xe&&!ye||pe.isHidden()||Z++,xe){const Fe=Sl(pe.text);H(o.text,q,We?Ln:Fe),H(o.text,Q,Ee?Ln:Fe);const ke=pe.text.isHidden(),{leftJustifiedTextSymbolIndex:qe,centerJustifiedTextSymbolIndex:Se,rightJustifiedTextSymbolIndex:Be,verticalPlacedTextSymbolIndex:Xe}=B,$e=o.text.placedSymbolArray,Ye=ke||We?1:0;qe>=0&&($e.get(qe).hidden=Ye),Se>=0&&($e.get(Se).hidden=Ye),Be>=0&&($e.get(Be).hidden=Ye),Xe>=0&&($e.get(Xe).hidden=ke||Ee?1:0);const gt=this.variableOffsets[ee];gt&&this.markUsedJustification(o,gt.anchor,B,Ae);const Et=this.placedOrientations[ee];Et&&(this.markUsedJustification(o,"left",B,Et),this.markUsedOrientation(o,Et,B))}if(ye){const Fe=Sl(pe.icon),{placedIconSymbolIndex:ke,verticalPlacedIconSymbolIndex:qe}=B,Se=o.icon.placedSymbolArray,Be=pe.icon.isHidden()?1:0;ke>=0&&(H(o.icon,de,We?Ln:Fe),Se.get(ke).hidden=Be),qe>=0&&(H(o.icon,B.numVerticalIconVertices,Ee?Ln:Fe),Se.get(qe).hidden=Be)}if(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData()){const Fe=o.collisionArrays[X];if(Fe){let ke=new s.Point(0,0),qe=!0;if(Fe.textBox||Fe.verticalTextBox){if(z){const Be=this.variableOffsets[ee];Be?(ke=El(Be.anchor,Be.width,Be.height,Be.textOffset,Be.textScale),P&&ke._rotate(O?this.transform.angle:-this.transform.angle)):qe=!1}x&&(qe=!pe.clipped),Fe.textBox&&pa(o.textCollisionBox.collisionVertexArray,pe.text.placed,!qe||We,ke.x,ke.y),Fe.verticalTextBox&&pa(o.textCollisionBox.collisionVertexArray,pe.text.placed,!qe||Ee,ke.x,ke.y)}const Se=qe&&!!(!Ee&&Fe.verticalIconBox);Fe.iconBox&&pa(o.iconCollisionBox.collisionVertexArray,pe.icon.placed,Se,j?ke.x:0,j?ke.y:0),Fe.verticalIconBox&&pa(o.iconCollisionBox.collisionVertexArray,pe.icon.placed,!Se,j?ke.x:0,j?ke.y:0)}}}if(o.fullyClipped=Z===0,o.sortFeatures(this.transform.angle),this.retainedQueryData[o.bucketInstanceId]&&(this.retainedQueryData[o.bucketInstanceId].featureSortOrder=o.featureSortOrder),o.hasTextData()&&o.text.opacityVertexBuffer&&o.text.opacityVertexBuffer.updateData(o.text.opacityVertexArray),o.hasIconData()&&o.icon.opacityVertexBuffer&&o.icon.opacityVertexBuffer.updateData(o.icon.opacityVertexArray),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexBuffer&&o.iconCollisionBox.collisionVertexBuffer.updateData(o.iconCollisionBox.collisionVertexArray),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexBuffer&&o.textCollisionBox.collisionVertexBuffer.updateData(o.textCollisionBox.collisionVertexArray),o.bucketInstanceId in this.collisionCircleArrays){const X=this.collisionCircleArrays[o.bucketInstanceId];o.placementInvProjMatrix=X.invProjMatrix,o.placementViewportMatrix=X.viewportMatrix,o.collisionCircleArray=X.circles,delete this.collisionCircleArrays[o.bucketInstanceId]}}symbolFadeChange(o){return this.fadeDuration===0?1:(o-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(o){return Math.max(0,(this.transform.zoom-o)/1.5)}hasTransitions(o){return this.stale||o-this.lastPlacementChangeTimeo}setStale(){this.stale=!0}}function pa(d,o,c,f,_){d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0)}const Gr=Math.pow(2,25),Fn=Math.pow(2,24),Ch=Math.pow(2,17),Ih=Math.pow(2,16),qr=Math.pow(2,9),gi=Math.pow(2,8),pf=Math.pow(2,1);function Sl(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;const o=d.placed?1:0,c=Math.floor(127*d.opacity);return c*Gr+o*Fn+c*Ch+o*Ih+c*qr+o*gi+c*pf+o}const Ln=0;class Al{constructor(o){this._sortAcrossTiles=o.layout.get("symbol-z-order")!=="viewport-y"&&o.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(o,c,f,_,x){const T=this._bucketParts;for(;this._currentTileIndexS.sortKey-C.sortKey));this._currentPartIndex{const T=s.exported.now()-_;return!this._forceFullPlacement&&T>2};for(;this._currentPlacementIndex>=0;){const T=c[o[this._currentPlacementIndex]],S=this.placement.collisionIndex.transform.zoom;if(T.type==="symbol"&&(!T.minzoom||T.minzoom<=S)&&(!T.maxzoom||T.maxzoom>S)){if(this._inProgressLayer||(this._inProgressLayer=new Al(T)),this._inProgressLayer.continuePlacement(f[T.source],this.placement,this._showCollisionBoxes,T,x))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(o){return this.placement.commit(o),this.placement}}const Ms=512/s.EXTENT/2;class Er{constructor(o,c,f){this.tileID=o,this.bucketInstanceId=f,this.index=new s.KDBush(c.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const _=o.canonical.x*s.EXTENT,x=o.canonical.y*s.EXTENT;for(let T=0;To.overscaledZ)for(const S in T){const C=T[S];C.tileID.isChildOf(o)&&C.findMatches(c.symbolInstances,o,_)}else{const S=T[o.scaledTo(Number(x)).key];S&&S.findMatches(c.symbolInstances,o,_)}}for(let x=0;x{c[f]=!0});for(const f in this.layerIndexes)c[f]||delete this.layerIndexes[f]}}const ns=(d,o)=>s.emitValidationErrors(d,o&&o.filter(c=>c.identifier!=="source.canvas")),Mc=s.pick(Jt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),q_=s.pick(Jt,["setCenter","setZoom","setBearing","setPitch"]),zh={version:8,layers:[],sources:{}},fa={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class to extends s.Evented{constructor(o,c={}){super(),this.map=o,this.dispatcher=new xt(ha(),this),this.imageManager=new wr,this.imageManager.setEventedParent(this),this.glyphManager=new s.GlyphManager(o._requestManager,c.localFontFamily?s.LocalGlyphMode.all:c.localIdeographFontFamily?s.LocalGlyphMode.ideographs:s.LocalGlyphMode.none,c.localFontFamily||c.localIdeographFontFamily),this.crossTileSymbolIndex=new To,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",s.getReferrer());const f=this;this._rtlTextPluginCallback=to.registerForPluginStateChange(_=>{f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:_.pluginStatus,pluginURL:_.pluginURL},(x,T)=>{if(s.triggerPluginCompletionEvent(x),T&&T.every(S=>S))for(const S in f._sourceCaches){const C=f._sourceCaches[S],z=C.getSource().type;z!=="vector"&&z!=="geojson"||C.reload()}})}),this.on("data",_=>{if(_.dataType!=="source"||_.sourceDataType!=="metadata")return;const x=this.getSource(_.sourceId);if(x&&x.vectorLayerIds)for(const T in this._layers){const S=this._layers[T];S.source===x.id&&this._validateLayer(S)}})}loadURL(o,c={}){this.fire(new s.Event("dataloading",{dataType:"style"}));const f=typeof c.validate=="boolean"?c.validate:!s.isMapboxURL(o);o=this.map._requestManager.normalizeStyleURL(o,c.accessToken);const _=this.map._requestManager.transformRequest(o,s.ResourceType.Style);this._request=s.getJSON(_,(x,T)=>{this._request=null,x?this.fire(new s.ErrorEvent(x)):T&&this._load(T,f)})}loadJSON(o,c={}){this.fire(new s.Event("dataloading",{dataType:"style"})),this._request=s.exported.frame(()=>{this._request=null,this._load(o,c.validate!==!1)})}loadEmpty(){this.fire(new s.Event("dataloading",{dataType:"style"})),this._load(zh,!1)}_updateLayerCount(o,c){const f=c?1:-1;o.is3D()&&(this._num3DLayers+=f),o.type==="circle"&&(this._numCircleLayers+=f),o.type==="symbol"&&(this._numSymbolLayers+=f)}_load(o,c){if(c&&ns(this,s.validateStyle(o)))return;this._loaded=!0,this.stylesheet=s.clone$1(o),this._updateMapProjection();for(const _ in o.sources)this.addSource(_,o.sources[_],{validate:!1});this._changed=!1,o.sprite?this._loadSprite(o.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(o.glyphs);const f=lf(this.stylesheet.layers);this._order=f.map(_=>_.id),this._layers={},this._serializedLayers={};for(const _ of f){const x=s.createStyleLayer(_);x.setEventedParent(this,{layer:{id:x.id}}),this._layers[x.id]=x,this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Vt(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new s.Event("data",{dataType:"style"})),this.fire(new s.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(o){o?this.stylesheet.projection=o:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(o){this._spriteRequest=function(c,f,_){let x,T,S;const C=s.exported.devicePixelRatio>1?"@2x":"";let z=s.getJSON(f.transformRequest(f.normalizeSpriteURL(c,C,".json"),s.ResourceType.SpriteJSON),(j,W)=>{z=null,S||(S=j,x=W,O())}),P=s.getImage(f.transformRequest(f.normalizeSpriteURL(c,C,".png"),s.ResourceType.SpriteImage),(j,W)=>{P=null,S||(S=j,T=W,O())});function O(){if(S)_(S);else if(x&&T){const j=s.exported.getImageData(T),W={};for(const H in x){const{width:Z,height:X,x:B,y:q,sdf:Q,pixelRatio:ee,stretchX:de,stretchY:fe,content:pe}=x[H],xe=new s.RGBAImage({width:Z,height:X});s.RGBAImage.copy(j,xe,{x:B,y:q},{x:0,y:0},{width:Z,height:X}),W[H]={data:xe,pixelRatio:ee,sdf:Q,stretchX:de,stretchY:fe,content:pe}}_(null,W)}}return{cancel(){z&&(z.cancel(),z=null),P&&(P.cancel(),P=null)}}}(o,this.map._requestManager,(c,f)=>{if(this._spriteRequest=null,c)this.fire(new s.ErrorEvent(c));else if(f)for(const _ in f)this.imageManager.addImage(_,f[_]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new s.Event("data",{dataType:"style"}))})}_validateLayer(o){const c=this.getSource(o.source);if(!c)return;const f=o.sourceLayer;f&&(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(f)===-1)&&this.fire(new s.ErrorEvent(new Error(`Source layer "${f}" does not exist on source "${c.id}" as specified by style layer "${o.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const o in this._sourceCaches)if(!this._sourceCaches[o].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(o){const c=[];for(const f of o){const _=this._layers[f];_.type!=="custom"&&c.push(_.serialize())}return c}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const o in this._sourceCaches)if(this._sourceCaches[o].hasTransition())return!0;for(const o in this._layers)if(this._layers[o].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(o){return!!this.terrain&&(typeof o.isLayerDraped=="function"?o.isLayerDraped():fa[o.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(o){if(!this._loaded)return;const c=this._changed;if(this._changed){const _=Object.keys(this._updatedLayers),x=Object.keys(this._removedLayers);(_.length||x.length)&&this._updateWorkerLayers(_,x);for(const T in this._updatedSources){const S=this._updatedSources[T];S==="reload"?this._reloadSource(T):S==="clear"&&this._clearSource(T)}this._updateTilesForChangedImages();for(const T in this._updatedPaintProps)this._layers[T].updateTransitions(o);this.light.updateTransitions(o),this.fog&&this.fog.updateTransitions(o),this._resetUpdates()}const f={};for(const _ in this._sourceCaches){const x=this._sourceCaches[_];f[_]=x.used,x.used=!1}for(const _ of this._order){const x=this._layers[_];if(x.recalculate(o,this._availableImages),!x.isHidden(o.zoom)){const S=this._getLayerSourceCache(x);S&&(S.used=!0)}const T=this.map.painter;if(T){const S=x.getProgramIds();if(!S)continue;const C=x.getProgramConfiguration(o.zoom);for(const z of S)T.useProgram(z,C)}}for(const _ in f){const x=this._sourceCaches[_];f[_]!==x.used&&x.getSource().fire(new s.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:x.getSource().id}))}this.light.recalculate(o),this.terrain&&this.terrain.recalculate(o),this.fog&&this.fog.recalculate(o),this.z=o.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),c&&this.fire(new s.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const o=Object.keys(this._changedImages);if(o.length){for(const c in this._sourceCaches)this._sourceCaches[c].reloadTilesForDependencies(["icons","patterns"],o);this._changedImages={}}}_updateWorkerLayers(o,c){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(o),removedIds:c})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(o){if(this._checkLoaded(),ns(this,s.validateStyle(o)))return!1;(o=s.clone$1(o)).layers=lf(o.layers);const c=function(_,x){if(!_)return[{command:Jt.setStyle,args:[x]}];let T=[];try{if(!k(_.version,x.version))return[{command:Jt.setStyle,args:[x]}];k(_.center,x.center)||T.push({command:Jt.setCenter,args:[x.center]}),k(_.zoom,x.zoom)||T.push({command:Jt.setZoom,args:[x.zoom]}),k(_.bearing,x.bearing)||T.push({command:Jt.setBearing,args:[x.bearing]}),k(_.pitch,x.pitch)||T.push({command:Jt.setPitch,args:[x.pitch]}),k(_.sprite,x.sprite)||T.push({command:Jt.setSprite,args:[x.sprite]}),k(_.glyphs,x.glyphs)||T.push({command:Jt.setGlyphs,args:[x.glyphs]}),k(_.transition,x.transition)||T.push({command:Jt.setTransition,args:[x.transition]}),k(_.light,x.light)||T.push({command:Jt.setLight,args:[x.light]}),k(_.fog,x.fog)||T.push({command:Jt.setFog,args:[x.fog]}),k(_.projection,x.projection)||T.push({command:Jt.setProjection,args:[x.projection]});const S={},C=[];(function(O,j,W,H){let Z;for(Z in j=j||{},O=O||{})O.hasOwnProperty(Z)&&(j.hasOwnProperty(Z)||yl(Z,W,H));for(Z in j){if(!j.hasOwnProperty(Z))continue;const X=j[Z];O.hasOwnProperty(Z)?k(O[Z],X)||(O[Z].type==="geojson"&&X.type==="geojson"&&Ic(O,j,Z)?W.push({command:Jt.setGeoJSONSourceData,args:[Z,X.data]}):bh(Z,j,W,H)):wh(Z,j,W)}})(_.sources,x.sources,C,S);const z=[];_.layers&&_.layers.forEach(O=>{O.source&&S[O.source]?T.push({command:Jt.removeLayer,args:[O.id]}):z.push(O)});let P=_.terrain;P&&S[P.source]&&(T.push({command:Jt.setTerrain,args:[void 0]}),P=void 0),T=T.concat(C),k(P,x.terrain)||T.push({command:Jt.setTerrain,args:[x.terrain]}),function(O,j,W){j=j||[];const H=(O=O||[]).map(xo),Z=j.map(xo),X=O.reduce(Eh,{}),B=j.reduce(Eh,{}),q=H.slice(),Q=Object.create(null);let ee,de,fe,pe,xe,ye,Ae;for(ee=0,de=0;ee!(_.command in q_));if(c.length===0)return!1;const f=c.filter(_=>!(_.command in Mc));if(f.length>0)throw new Error(`Unimplemented: ${f.map(_=>_.command).join(", ")}.`);return c.forEach(_=>{_.command!=="setTransition"&&_.command!=="setProjection"&&this[_.command].apply(this,_.args)}),this.stylesheet=o,this._updateMapProjection(),!0}addImage(o,c){return this.getImage(o)?this.fire(new s.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(o,c),this._afterImageUpdated(o),this)}updateImage(o,c){this.imageManager.updateImage(o,c)}getImage(o){return this.imageManager.getImage(o)}removeImage(o){return this.getImage(o)?(this.imageManager.removeImage(o),this._afterImageUpdated(o),this):this.fire(new s.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(o){this._availableImages=this.imageManager.listImages(),this._changedImages[o]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new s.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(o,c,f={}){if(this._checkLoaded(),this.getSource(o)!==void 0)throw new Error("There is already a source with this ID");if(!c.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(c).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(c.type)>=0&&this._validate(s.validateSource,`sources.${o}`,c,null,f))return;this.map&&this.map._collectResourceTiming&&(c.collectResourceTiming=!0);const _=Dt(o,c,this.dispatcher,this);_.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(o),source:_.serialize(),sourceId:o}));const x=T=>{const S=(T?"symbol:":"other:")+o,C=this._sourceCaches[S]=new s.SourceCache(S,_,T);(T?this._symbolSourceCaches:this._otherSourceCaches)[o]=C,C.style=this,C.onAdd(this.map)};x(!1),c.type!=="vector"&&c.type!=="geojson"||x(!0),_.onAdd&&_.onAdd(this.map),this._changed=!0}removeSource(o){this._checkLoaded();const c=this.getSource(o);if(!c)throw new Error("There is no source with this ID");for(const _ in this._layers)if(this._layers[_].source===o)return this.fire(new s.ErrorEvent(new Error(`Source "${o}" cannot be removed while layer "${_}" is using it.`)));if(this.terrain&&this.terrain.get().source===o)return this.fire(new s.ErrorEvent(new Error(`Source "${o}" cannot be removed while terrain is using it.`)));const f=this._getSourceCaches(o);for(const _ of f)delete this._sourceCaches[_.id],delete this._updatedSources[_.id],_.fire(new s.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:_.getSource().id})),_.setEventedParent(null),_.clearTiles();return delete this._otherSourceCaches[o],delete this._symbolSourceCaches[o],c.setEventedParent(null),c.onRemove&&c.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(o,c){this._checkLoaded(),this.getSource(o).setData(c),this._changed=!0}getSource(o){const c=this._getSourceCache(o);return c&&c.getSource()}_getSources(){const o=[];for(const c in this._otherSourceCaches){const f=this._getSourceCache(c);f&&o.push(f.getSource())}return o}addLayer(o,c,f={}){this._checkLoaded();const _=o.id;if(this.getLayer(_))return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${_}" already exists on this map`)));let x;if(o.type==="custom"){if(ns(this,s.validateCustomStyleLayer(o)))return;x=s.createStyleLayer(o)}else{if(typeof o.source=="object"&&(this.addSource(_,o.source),o=s.clone$1(o),o=s.extend(o,{source:_})),this._validate(s.validateLayer,`layers.${_}`,o,{arrayIndex:-1},f))return;x=s.createStyleLayer(o),this._validateLayer(x),x.setEventedParent(this,{layer:{id:_}}),this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}const T=c?this._order.indexOf(c):this._order.length;if(c&&T===-1)return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`)));this._order.splice(T,0,_),this._layerOrderChanged=!0,this._layers[_]=x;const S=this._getLayerSourceCache(x);if(this._removedLayers[_]&&x.source&&S&&x.type!=="custom"){const C=this._removedLayers[_];delete this._removedLayers[_],C.type!==x.type?this._updatedSources[x.source]="clear":(this._updatedSources[x.source]="reload",S.pause())}this._updateLayer(x),x.onAdd&&x.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(o,c){if(this._checkLoaded(),this._changed=!0,!this._layers[o])return void this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be moved.`)));if(o===c)return;const f=this._order.indexOf(o);this._order.splice(f,1);const _=c?this._order.indexOf(c):this._order.length;c&&_===-1?this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`))):(this._order.splice(_,0,o),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(o){this._checkLoaded();const c=this._layers[o];if(!c)return void this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be removed.`)));c.setEventedParent(null),this._updateLayerCount(c,!1);const f=this._order.indexOf(o);this._order.splice(f,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[o]=c,delete this._layers[o],delete this._serializedLayers[o],delete this._updatedLayers[o],delete this._updatedPaintProps[o],c.onRemove&&c.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(o){return this._layers[o]}hasLayer(o){return o in this._layers}hasLayerType(o){for(const c in this._layers)if(this._layers[c].type===o)return!0;return!1}setLayerZoomRange(o,c,f){this._checkLoaded();const _=this.getLayer(o);_?_.minzoom===c&&_.maxzoom===f||(c!=null&&(_.minzoom=c),f!=null&&(_.maxzoom=f),this._updateLayer(_)):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(o,c,f={}){this._checkLoaded();const _=this.getLayer(o);if(_){if(!k(_.filter,c))return c==null?(_.filter=void 0,void this._updateLayer(_)):void(this._validate(s.validateFilter,`layers.${_.id}.filter`,c,{layerType:_.type},f)||(_.filter=s.clone$1(c),this._updateLayer(_)))}else this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be filtered.`)))}getFilter(o){const c=this.getLayer(o);return c&&s.clone$1(c.filter)}setLayoutProperty(o,c,f,_={}){this._checkLoaded();const x=this.getLayer(o);x?k(x.getLayoutProperty(c),f)||(x.setLayoutProperty(c,f,_),this._updateLayer(x)):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(o,c){const f=this.getLayer(o);if(f)return f.getLayoutProperty(c);this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style.`)))}setPaintProperty(o,c,f,_={}){this._checkLoaded();const x=this.getLayer(o);x?k(x.getPaintProperty(c),f)||(x.setPaintProperty(c,f,_)&&this._updateLayer(x),this._changed=!0,this._updatedPaintProps[o]=!0):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(o,c){const f=this.getLayer(o);return f&&f.getPaintProperty(c)}setFeatureState(o,c){this._checkLoaded();const f=o.source,_=o.sourceLayer,x=this.getSource(f);if(!x)return void this.fire(new s.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)));const T=x.type;if(T==="geojson"&&_)return void this.fire(new s.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(T==="vector"&&!_)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));o.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided.")));const S=this._getSourceCaches(f);for(const C of S)C.setFeatureState(_,o.id,c)}removeFeatureState(o,c){this._checkLoaded();const f=o.source,_=this.getSource(f);if(!_)return void this.fire(new s.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)));const x=_.type,T=x==="vector"?o.sourceLayer:void 0;if(x==="vector"&&!T)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(c&&typeof o.id!="string"&&typeof o.id!="number")return void this.fire(new s.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const S=this._getSourceCaches(f);for(const C of S)C.removeFeatureState(T,o.id,c)}getFeatureState(o){this._checkLoaded();const c=o.source,f=o.sourceLayer,_=this.getSource(c);if(_){if(_.type!=="vector"||f)return o.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(c)[0].getFeatureState(f,o.id);this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new s.ErrorEvent(new Error(`The source '${c}' does not exist in the map's style.`)))}getTransition(){return s.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const o={};for(const c in this._sourceCaches){const f=this._sourceCaches[c].getSource();o[f.id]||(o[f.id]=f.serialize())}return s.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:o,layers:this._serializeLayers(this._order)},c=>c!==void 0)}_updateLayer(o){this._updatedLayers[o.id]=!0;const c=this._getLayerSourceCache(o);o.source&&!this._updatedSources[o.source]&&c&&c.getSource().type!=="raster"&&(this._updatedSources[o.source]="reload",c.pause()),this._changed=!0,o.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(o){const c=T=>this._layers[T].type==="fill-extrusion",f={},_=[];for(let T=this._order.length-1;T>=0;T--){const S=this._order[T];if(c(S)){f[S]=T;for(const C of o){const z=C[S];if(z)for(const P of z)_.push(P)}}}_.sort((T,S)=>S.intersectionZ-T.intersectionZ);const x=[];for(let T=this._order.length-1;T>=0;T--){const S=this._order[T];if(c(S))for(let C=_.length-1;C>=0;C--){const z=_[C].feature;if(f[z.layer.id]{const z=this.getLayer(C);return z&&z.is3D()}):this.has3DLayers(),S=dn.createFromScreenPoints(o,f);for(const C in this._sourceCaches){const z=this._sourceCaches[C].getSource().id;c.layers&&!_[z]||x.push(In(this._sourceCaches[C],this._layers,this._serializedLayers,S,c,f,T,!!this.map._showQueryGeometry))}return this.placement&&x.push(function(C,z,P,O,j,W,H){const Z={},X=W.queryRenderedSymbols(O),B=[];for(const q of Object.keys(X).map(Number))B.push(H[q]);B.sort(Ir);for(const q of B){const Q=q.featureIndex.lookupSymbolFeatures(X[q.bucketInstanceId],z,q.bucketIndex,q.sourceLayerIndex,j.filter,j.layers,j.availableImages,C);for(const ee in Q){const de=Z[ee]=Z[ee]||[],fe=Q[ee];fe.sort((pe,xe)=>{const ye=q.featureSortOrder;if(ye){const Ae=ye.indexOf(pe.featureIndex);return ye.indexOf(xe.featureIndex)-Ae}return xe.featureIndex-pe.featureIndex});for(const pe of fe)de.push(pe)}}for(const q in Z)Z[q].forEach(Q=>{const ee=Q.feature,de=P(C[q]);if(!de)return;const fe=de.getFeatureState(ee.layer["source-layer"],ee.id);ee.source=ee.layer.source,ee.layer["source-layer"]&&(ee.sourceLayer=ee.layer["source-layer"]),ee.state=fe});return Z}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),S.screenGeometry,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(x)}querySourceFeatures(o,c){c&&c.filter&&this._validate(s.validateFilter,"querySourceFeatures.filter",c.filter,null,c);const f=this._getSourceCaches(o);let _=[];for(const x of f)_=_.concat(Vn(x,c));return _}addSourceType(o,c,f){return to.getSourceType(o)?f(new Error(`A source type called "${o}" already exists.`)):(to.setSourceType(o,c),c.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:o,url:c.workerSourceURL},f):f(null,null))}getLight(){return this.light.getLight()}setLight(o,c={}){this._checkLoaded();const f=this.light.getLight();let _=!1;for(const T in o)if(!k(o[T],f[T])){_=!0;break}if(!_)return;const x=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(o,c),this.light.updateTransitions(x)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(o,c=1){if(this._checkLoaded(),!o)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let f=o;if(c===1){if(typeof f.source=="object"){const _="terrain-dem-src";this.addSource(_,f.source),f=s.clone$1(f),f=s.extend(f,{source:_})}if(this._validate(s.validateTerrain,"terrain",f))return}if(!this.terrain||this.terrain&&c!==this.terrain.drapeRenderMode){if(!f)return;this._createTerrain(f,c)}else{const _=this.terrain,x=_.get();for(const T of Object.keys(s.spec.terrain))!f.hasOwnProperty(T)&&s.spec.terrain[T].default&&(f[T]=s.spec.terrain[T].default);for(const T in f)if(!k(f[T],x[T])){_.set(f),this.stylesheet.terrain=f;const S=this._setTransitionParameters({duration:0});_.updateTransitions(S);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(o){const c=this.fog=new Tt(o,this.map.transform);this.stylesheet.fog=o;const f=this._setTransitionParameters({duration:0});c.updateTransitions(f)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const o of this.map._markers)o._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(o){if(this._checkLoaded(),!o)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const c=this.fog,f=c.get();Object.keys(o).length===0&&c.set(o);for(const _ in o)if(!k(o[_],f[_])){c.set(o),this.stylesheet.fog=o;const x=this._setTransitionParameters({duration:0});c.updateTransitions(x);break}}else this._createFog(o);this._markersNeedUpdate=!0}_setTransitionParameters(o){return{now:s.exported.now(),transition:s.extend(o,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const o=this._order.filter(f=>this.isLayerDraped(this._layers[f])),c=this._order.filter(f=>!this.isLayerDraped(this._layers[f]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...o),this._drapedFirstOrder.push(...c)}_createTerrain(o,c){const f=this.terrain=new $r(o,c);this.stylesheet.terrain=o,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const _=this._setTransitionParameters({duration:0});f.updateTransitions(_)}_force3DLayerUpdate(){for(const o in this._layers){const c=this._layers[o];c.type==="fill-extrusion"&&this._updateLayer(c)}}_forceSymbolLayerUpdate(){for(const o in this._layers){const c=this._layers[o];c.type==="symbol"&&this._updateLayer(c)}}_validate(o,c,f,_,x={}){return(!x||x.validate!==!1)&&ns(this,o.call(s.validateStyle,s.extend({key:c,style:this.serialize(),value:f,styleSpec:s.spec},_)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const o in this._layers)this._layers[o].setEventedParent(null);for(const o in this._sourceCaches)this._sourceCaches[o].clearTiles(),this._sourceCaches[o].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(o){const c=this._getSourceCaches(o);for(const f of c)f.clearTiles()}_reloadSource(o){const c=this._getSourceCaches(o);for(const f of c)f.resume(),f.reload()}_reloadSources(){for(const o of this._getSources())o.reload&&o.reload()}_updateSources(o){for(const c in this._sourceCaches)this._sourceCaches[c].update(o)}_generateCollisionBoxes(){for(const o in this._sourceCaches){const c=this._sourceCaches[o];c.resume(),c.reload()}}_updatePlacement(o,c,f,_,x=!1){let T=!1,S=!1;const C={};for(const z of this._order){const P=this._layers[z];if(P.type!=="symbol")continue;if(!C[P.source]){const j=this._getLayerSourceCache(P);if(!j)continue;C[P.source]=j.getRenderableIds(!0).map(W=>j.getTileByID(W)).sort((W,H)=>H.tileID.overscaledZ-W.tileID.overscaledZ||(W.tileID.isLessThan(H.tileID)?-1:1))}const O=this.crossTileSymbolIndex.addLayer(P,C[P.source],o.center.lng,o.projection);T=T||O}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),x=x||this._layerOrderChanged||f===0,this._layerOrderChanged&&this.fire(new s.Event("neworder")),(x||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.exported.now(),o.zoom))&&(this.pauseablePlacement=new kh(o,this._order,x,c,f,_,this.placement,this.fog&&o.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,C),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.exported.now()),S=!0),T&&this.pauseablePlacement.placement.setStale()),S||T)for(const z of this._order){const P=this._layers[z];P.type==="symbol"&&this.placement.updateLayerOpacities(P,C[P.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.exported.now())}_releaseSymbolFadeTiles(){for(const o in this._sourceCaches)this._sourceCaches[o].releaseSymbolFadeTiles()}getImages(o,c,f){this.imageManager.getImages(c.icons,f),this._updateTilesForChangedImages();const _=x=>{x&&x.setDependencies(c.tileID.key,c.type,c.icons)};_(this._otherSourceCaches[c.source]),_(this._symbolSourceCaches[c.source])}getGlyphs(o,c,f){this.glyphManager.getGlyphs(c.stacks,f)}getResource(o,c,f){return s.makeRequest(c,f)}_getSourceCache(o){return this._otherSourceCaches[o]}_getLayerSourceCache(o){return o.type==="symbol"?this._symbolSourceCaches[o.source]:this._otherSourceCaches[o.source]}_getSourceCaches(o){const c=[];return this._otherSourceCaches[o]&&c.push(this._otherSourceCaches[o]),this._symbolSourceCaches[o]&&c.push(this._symbolSourceCaches[o]),c}_isSourceCacheLoaded(o){const c=this._getSourceCaches(o);return c.length===0?(this.fire(new s.ErrorEvent(new Error(`There is no source with ID '${o}'`))),!1):c.every(f=>f.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}to.getSourceType=function(d){return Pt[d]},to.setSourceType=function(d,o){Pt[d]=o},to.registerForPluginStateChange=s.registerForPluginStateChange;var Lh=` -#define EPSILON 0.0000001 -#define PI 3.141592653589793 -#define EXTENT 8192.0 -#define HALF_PI PI/2.0 -#define QUARTER_PI PI/4.0 -#define RAD_TO_DEG 180.0/PI -#define DEG_TO_RAD PI/180.0 -#define GLOBE_RADIUS EXTENT/PI/2.0`,Ps="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",So=` -#define ELEVATION_SCALE 7.0 -#define ELEVATION_OFFSET 450.0 -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( -mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} -#else -vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } -#endif -const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt) -{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);} -#ifdef TERRAIN -#ifdef TERRAIN_DEM_FLOAT_FORMAT -uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev; -#else -uniform sampler2D u_dem;uniform sampler2D u_dem_prev; -#endif -uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a; -#else -float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos)); -#ifdef TERRAIN_DEM_NEAREST_FILTER -return u_exaggeration*tl; -#endif -float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); -#endif -}float prevElevation(vec2 apos) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a; -#else -float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); -#endif -} -#ifdef TERRAIN_VERTEX_MORPHING -float elevation(vec2 apos) { -#ifdef ZERO_EXAGGERATION -return 0.0; -#endif -float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} -#else -float elevation(vec2 apos) { -#ifdef ZERO_EXAGGERATION -return 0.0; -#endif -return currentElevation(apos);} -#endif -highp float unpack_depth(highp vec4 rgba_depth) -{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4( -unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy)) -);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a; -#else -vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack); -#endif -return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} -#else -float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; } -#endif`,Cl=`#ifdef FOG -uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} -#endif`,Ao=`#ifdef FOG -uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} -#endif`;let Pc={},ma={};const Il=[];ga(Lh,Il),ga(So,Il),ga(Cl,Il),ga(Ao,Il),Pc=Qt("",So),ma=Qt(Ao,Cl);const ff=Qt(` -#if __VERSION__ >=300 -#define varying in -#define gl_FragColor glFragColor -#define texture2D texture -#define textureCube texture -out vec4 glFragColor; -#endif -highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth) -{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,` -#if __VERSION__ >=300 -#define attribute in -#define varying out -#define texture2D texture -#endif -float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} -#ifdef PROJECTION_GLOBE_VIEW -vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { -#ifndef PROJECTED_POS_ON_VIEWPORT -float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; -#else -return vec3(0.0); -#endif -}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} -#endif -vec2 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 -);}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;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),zc=Lh,Rh=` -#ifdef GL_ES -precision mediump float; -#else - -#if !defined(lowp) -#define lowp -#endif - -#if !defined(mediump) -#define mediump -#endif - -#if !defined(highp) -#define highp -#endif - -#endif`;var Dh={background:Qt(`uniform vec4 u_color;uniform float u_opacity; -#ifdef LIGHTING_3D_MODE -varying vec4 v_color; -#endif -void main() {vec4 out_color; -#ifdef LIGHTING_3D_MODE -out_color=v_color; -#else -out_color=u_color; -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#ifdef LIGHTING_3D_MODE -uniform vec4 u_color;varying vec4 v_color; -#endif -void main() {gl_Position=u_matrix*vec4(a_pos,0,1); -#ifdef LIGHTING_3D_MODE -v_color=apply_lighting(u_color); -#endif -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),backgroundPattern:Qt(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),circle:Qt(`varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 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) -);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_apply_premultiplied(out_color,v_fog_pos); -#endif -gl_FragColor=out_color*(v_visibility*opacity_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`#define NUM_VISIBILITY_RINGS 2 -#define INV_SQRT2 0.70710678 -#define ELEVATION_BIAS 0.0001 -#define NUM_SAMPLES_PER_RING 16 -uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; -#endif -varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { -#if defined(TERRAIN) -return elevation(pos)+ELEVATION_BIAS; -#else -return 0.0; -#endif -}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); -#ifdef PITCH_WITH_MAP -#ifdef PROJECTION_GLOBE_VIEW -return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); -#else -return u_matrix*( world_center+vec4(sample_offset,0,0) ); -#endif -#else -return projected_center+vec4(sample_offset,0,0); -#endif -}float get_sample_step() { -#ifdef PITCH_WITH_MAP -return 2.0*PI/float(NUM_SAMPLES_PER_RING); -#else -return PI/float(NUM_SAMPLES_PER_RING); -#endif -}void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors; -#ifdef PROJECTION_GLOBE_VIEW -vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); -#else -surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1); -#endif -vec4 projected_center=u_matrix*world_center;float view_scale=0.0; -#ifdef PITCH_WITH_MAP -#ifdef SCALE_WITH_MAP -view_scale=1.0; -#else -view_scale=projected_center.w/u_camera_to_center_distance; -#endif -#else -#ifdef SCALE_WITH_MAP -view_scale=u_camera_to_center_distance; -#else -view_scale=projected_center.w; -#endif -#endif -gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; -#ifdef TERRAIN -float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; -#ifdef PITCH_WITH_MAP -float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; -#else -occlusion_world_center=world_center;occlusion_projected_center=projected_center; -#endif -for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); -#else -visibility=1.0; -#endif -#ifdef PROJECTION_GLOBE_VIEW -visibility=1.0; -#endif -v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); -#ifdef FOG -v_fog_pos=fog_position(world_center.xyz); -#endif -}`),clippingMask:Qt("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:Qt(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float 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); -#ifdef FOG -if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; -#endif -varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 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;vec2 tilePos=floor(a_pos*0.5);vec3 pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#else -pos=vec3(tilePos+extrude,elevation(tilePos)); -#endif -gl_Position=u_matrix*vec4(pos,1); -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),heatmapTexture:Qt(`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; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(0.0); -#endif -}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:Qt("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;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_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),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,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:Qt("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_2f;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_2f;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:Qt("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; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3; -#endif -varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0; -#ifdef PROJECTION_GLOBE_VIEW -gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1); -#else -gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1); -#endif -}`),fill:Qt(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -vec4 out_color=color; -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillOutline:Qt(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color; -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillOutlinePattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillPattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillExtrusion:Qt(`varying vec4 v_color; -#ifdef RENDER_SHADOWS -varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; -#endif -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef ZERO_ROOF_RADIUS -varying vec4 v_roof_color; -#endif -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -varying highp vec3 v_normal; -#endif -void main() { -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -vec3 normal=v_normal; -#endif -float z;vec4 color; -#ifdef ZERO_ROOF_RADIUS -z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z); -#else -color=v_color; -#endif -#ifdef FAUX_AO -float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; -#ifdef ZERO_ROOF_RADIUS -concave*=(1.0-z); -#endif -float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade; -#endif -#ifdef RENDER_SHADOWS -#ifdef ZERO_ROOF_RADIUS -normal=mix(normal,vec3(0.0,0.0,1.0),z); -#endif -color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`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;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; -#endif -varying vec4 v_color; -#ifdef RENDER_SHADOWS -uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; -#endif -#ifdef ZERO_ROOF_RADIUS -varying vec4 v_roof_color; -#endif -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -varying highp vec3 v_normal; -#endif -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0)); -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -v_normal=normal; -#endif -base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); -#if defined(HAS_CENTROID) || defined(TERRAIN) -centroid_pos=a_centroid_pos; -#endif -float ele=0.0;float h=0.0;float c_ele;vec3 pos; -#ifdef TERRAIN -bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h); -#else -h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h); -#endif -#ifdef PROJECTION_GLOBE_VIEW -float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#endif -float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden); -#ifdef RENDER_SHADOWS -v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w; -#endif -float NdotL=0.0;float colorvalue=0.0; -#ifdef LIGHTING_3D_MODE -NdotL=calculate_NdotL(normal); -#else -colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL); -#endif -if (normal.y !=0.0) {float r=0.84; -#ifndef LIGHTING_3D_MODE -r=mix(0.7,0.98,1.0-u_lightintensity); -#endif -NdotL*=( -(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0); -#ifdef FAUX_AO -float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; -#ifdef TERRAIN -top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); -#endif -v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); -#ifdef PROJECTION_GLOBE_VIEW -top_height+=u_height_lift; -#endif -gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; -#endif -#ifdef LIGHTING_3D_MODE -v_color=apply_lighting(color,NdotL); -#else -v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); -#endif -v_color*=u_opacity; -#ifdef ZERO_ROOF_RADIUS -v_roof_color=vec4(0.0,0.0,0.0,1.0); -#ifdef LIGHTING_3D_MODE -v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0))); -#else -float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); -#endif -v_roof_color*=u_opacity; -#endif -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),fillExtrusionPattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image; -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef LIGHTING_3D_MODE -varying float v_NdotL; -#endif -varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color,v_NdotL)*u_opacity; -#else -out_color=out_color*v_lighting; -#endif -#ifdef FAUX_AO -float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;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 vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; -#endif -varying vec2 v_pos;varying vec4 v_lighting; -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef LIGHTING_3D_MODE -varying float v_NdotL; -#endif -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); -#if defined(HAS_CENTROID) || defined(TERRAIN) -centroid_pos=a_centroid_pos; -#endif -float ele=0.0;float h=z;vec3 p;float c_ele; -#ifdef TERRAIN -bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h); -#else -p=vec3(pos_nx.xy,z); -#endif -#ifdef PROJECTION_GLOBE_VIEW -float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#endif -float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 -? pos_nx.xy -: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; -#ifdef LIGHTING_3D_MODE -NdotL=calculate_NdotL(normal); -#else -NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); -#endif -if (normal.y !=0.0) {float r=0.84; -#ifndef LIGHTING_3D_MODE -r=mix(0.7,0.98,1.0-u_lightintensity); -#endif -NdotL*=( -(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} -#ifdef FAUX_AO -float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; -#ifdef TERRAIN -top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); -#endif -v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); -#ifdef PROJECTION_GLOBE_VIEW -top_height+=u_height_lift; -#endif -gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; -#endif -#ifdef LIGHTING_3D_MODE -v_NdotL=NdotL; -#else -v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; -#endif -#ifdef FOG -v_fog_pos=fog_position(p); -#endif -}`),hillshadePrepare:Qt(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -return texture2D(u_image,coord).a/4.0; -#else -vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0; -#endif -}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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+e+e+h)-(a+d+d+f),(f+g+g+h)-(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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"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:Qt(`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;void 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;float 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; -#ifdef LIGHTING_3D_MODE -gl_FragColor=apply_lighting(gl_FragColor); -#endif -#ifdef FOG -gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos)); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`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; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),line:Qt(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv; -#ifdef RENDER_LINE_DASH -uniform sampler2D u_dash_image;varying vec2 v_tex; -#endif -#ifdef RENDER_LINE_GRADIENT -uniform sampler2D u_gradient_image; -#endif -uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;} -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 dash -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize lowp vec4 dash -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -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); -#ifdef RENDER_LINE_DASH -float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist); -#endif -highp vec4 out_color; -#ifdef RENDER_LINE_GRADIENT -out_color=texture2D(u_gradient_image,v_uv.xy); -#else -out_color=color; -#endif -float trimmed=1.0; -#ifdef RENDER_LINE_TRIM_OFFSET -highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}} -#endif -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -#ifdef RENDER_LINE_ALPHA_DISCARD -if (alpha < u_alpha_discard_threshold) {discard;} -#endif -#ifdef RENDER_LINE_BORDER -float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2); -#ifdef RENDER_LINE_BORDER_AUTO -float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);} -#else -out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha); -#endif -} -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define EXTRUDE_SCALE 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data; -#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) -attribute highp vec4 a_packed; -#endif -#ifdef RENDER_LINE_DASH -attribute float a_linesofar; -#endif -uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;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 vec4 v_uv; -#ifdef RENDER_LINE_DASH -uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex; -#endif -#ifdef RENDER_LINE_GRADIENT -uniform float u_image_height; -#endif -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 dash -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize lowp vec4 dash -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float 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;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; -#ifndef RENDER_TO_TEXTURE -float 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; -#else -v_gamma_scale=1.0; -#endif -#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) -float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3]; -#ifdef RENDER_LINE_GRADIENT -highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end); -#else -v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end); -#endif -#endif -#ifdef RENDER_LINE_DASH -float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y); -#endif -v_width2=vec2(outset,inset); -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),linePattern:Qt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;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; -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.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=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -color=apply_lighting(color); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;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; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -float 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;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_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; -#ifndef RENDER_TO_TEXTURE -float 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; -#else -v_gamma_scale=1.0; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth; -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),raster:Qt(`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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply(out_color,v_fog_pos)); -#endif -gl_FragColor=vec4(out_color*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),symbolIcon:Qt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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 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;uniform vec3 u_up_vector; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];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;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point; -#ifdef PROJECTION_GLOBE_VIEW -vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1); -#else -offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); -#endif -vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -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;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:Qt(`#define SDF_PX 8.0 -uniform 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; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float 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 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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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 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 vec3 u_up_vector; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];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;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point; -#ifdef PROJECTION_GLOBE_VIEW -vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1); -#else -offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); -#endif -vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float gamma_scale=gl_Position.w;float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:Qt(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform 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; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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 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 vec3 u_up_vector;uniform vec2 u_texsize_icon; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];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;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}`),terrainRaster:Qt(`uniform sampler2D u_image0;varying vec2 v_pos0; -#ifdef FOG -varying float v_fog_opacity; -#endif -#ifdef RENDER_SHADOWS -varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; -#endif -void main() {vec4 color=texture2D(u_image0,v_pos0); -#ifdef RENDER_SHADOWS -color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth); -#endif -#ifdef FOG -#ifdef ZERO_EXAGGERATION -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#else -color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); -#endif -#endif -gl_FragColor=color; -#ifdef TERRAIN_WIREFRAME -gl_FragColor=vec4(1.0,0.0,0.0,0.8); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0; -#ifdef FOG -varying float v_fog_opacity; -#endif -#ifdef RENDER_SHADOWS -uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; -#endif -const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height; -#ifdef TERRAIN_WIREFRAME -elevation+=wireframeOffset; -#endif -v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); -#ifdef FOG -#ifdef ZERO_EXAGGERATION -v_fog_pos=fog_position(decodedPos); -#else -v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); -#endif -#endif -#ifdef RENDER_SHADOWS -vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w; -#endif -}`),terrainDepth:Qt(`#ifdef GL_ES -precision highp float; -#endif -varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:Qt(` -varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( -cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb; -#ifdef FOG -sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); -#endif -sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Ps),skyboxGradient:Qt(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5)); -#ifdef FOG -color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; -#endif -color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Ps),skyboxCapture:Qt(` -varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m; -#ifdef GL_ES -precision highp float; -#endif -#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) -#define BETA_M vec3(21e-6,21e-6,21e-6) -#define MIE_G 0.76 -#define DENSITY_HEIGHT_SCALE_R 8000.0 -#define DENSITY_HEIGHT_SCALE_M 1200.0 -#define PLANET_RADIUS 6360e3 -#define ATMOSPHERE_RADIUS 6420e3 -#define SAMPLE_STEPS 10 -#define DENSITY_STEPS 4 -float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:Qt(`uniform sampler2D u_image0;varying vec2 v_pos0; -#ifndef FOG -uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; -#endif -void main() {vec4 color; -#ifdef CUSTOM_ANTIALIASING -vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias); -#else -color=texture2D(u_image0,v_pos0); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color; -#ifdef TERRAIN_WIREFRAME -gl_FragColor=vec4(1.0,0.0,0.0,0.8); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; -#ifdef GLOBE_POLES -attribute vec3 a_globe_pos;attribute vec2 a_uv; -#else -attribute vec2 a_pos; -#endif -varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() { -#ifdef GLOBE_POLES -vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; -#else -float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); -#endif -v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; -#ifdef GLOBE_POLES -vec3 up_vector=globe_derived_up_vector; -#else -vec3 up_vector=elevationVector(tile_pos); -#endif -float height=elevation(tile_pos); -#ifdef TERRAIN_WIREFRAME -height+=wireframeOffset; -#endif -globe_pos+=up_vector*height; -#ifndef GLOBE_POLES -globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; -#endif -#ifdef GLOBE_POLES -vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); -#else -vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); -#endif -gl_Position=u_proj_matrix*interpolated_pos; -#ifdef FOG -v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); -#endif -}`),globeAtmosphere:Qt(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; -#ifdef PROJECTION_GLOBE_VIEW -globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;} -#endif -highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? -0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle; -#ifdef PROJECTION_GLOBE_VIEW -highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? -PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); -#else -horizon_angle=horizon_angle_mercator; -#endif -horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x: -(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y: -uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( -mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function ga(d,o){const c=d.replace(/\s*\/\/[^\n]*\n/g,` -`).split(` -`);for(let f of c)if(f=f.trim(),f[0]==="#"&&f.includes("if")&&!f.includes("endif")){f=f.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const _=f.split(" ");for(const x of _)o.includes(x)||o.push(x)}}function Qt(d,o){const c=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,f=o.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),_={},x=[...Il];return ga(d,x),ga(o,x),{fragmentSource:d=d.replace(c,(T,S,C,z,P)=>(_[P]=!0,S==="define"?` -#ifndef HAS_UNIFORM_u_${P} -varying ${C} ${z} ${P}; -#else -uniform ${C} ${z} u_${P}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${P} - ${C} ${z} ${P} = u_${P}; -#endif -`)),vertexSource:o=o.replace(c,(T,S,C,z,P)=>{const O=z==="float"?"vec2":"vec4",j=P.match(/color/)?"color":O;return _[P]?S==="define"?` -#ifndef HAS_UNIFORM_u_${P} -uniform lowp float u_${P}_t; -attribute ${C} ${O} a_${P}; -varying ${C} ${z} ${P}; -#else -uniform ${C} ${z} u_${P}; -#endif -`:j==="vec4"?` -#ifndef HAS_UNIFORM_u_${P} - ${P} = a_${P}; -#else - ${C} ${z} ${P} = u_${P}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${P} - ${P} = unpack_mix_${j}(a_${P}, u_${P}_t); -#else - ${C} ${z} ${P} = u_${P}; -#endif -`:S==="define"?` -#ifndef HAS_UNIFORM_u_${P} -uniform lowp float u_${P}_t; -attribute ${C} ${O} a_${P}; -#else -uniform ${C} ${z} u_${P}; -#endif -`:j==="vec4"?` -#ifndef HAS_UNIFORM_u_${P} - ${C} ${z} ${P} = a_${P}; -#else - ${C} ${z} ${P} = u_${P}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${P} - ${C} ${z} ${P} = unpack_mix_${j}(a_${P}, u_${P}_t); -#else - ${C} ${z} ${P} = u_${P}; -#endif -`}),staticAttributes:f,usedDefines:x}}class W_{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(o,c,f,_,x,T,S){this.context=o;let C=this.boundPaintVertexBuffers.length!==_.length;for(let P=0;!C&&P<_.length;P++)this.boundPaintVertexBuffers[P]!==_[P]&&(C=!0);let z=this.boundDynamicVertexBuffers.length!==S.length;for(let P=0;!z&&P{const Q=B.paint.get("hillshade-shadow-color"),ee=B.paint.get("hillshade-highlight-color"),de=B.paint.get("hillshade-accent-color");let fe=B.paint.get("hillshade-illumination-direction")*(Math.PI/180);B.paint.get("hillshade-illumination-anchor")==="viewport"&&(fe-=Z.transform.angle);const pe=!Z.options.moving;return{u_matrix:q||Z.transform.calculateProjMatrix(X.tileID.toUnwrapped(),pe),u_image:0,u_latrange:Oh(0,X.tileID),u_light:[B.paint.get("hillshade-exaggeration"),fe],u_shadow:Q,u_highlight:ee,u_accent:de}})(d,c,f,d.terrain?o.projMatrix:null);d.prepareDrawProgram(S,P,o.toUnwrapped());const{tileBoundsBuffer:j,tileBoundsIndexBuffer:W,tileBoundsSegments:H}=d.getTileBoundsBuffers(c);P.draw(S,C.TRIANGLES,_,x,T,s.CullFaceMode.disabled,O,f.id,j,W,H)}function Bh(d,o,c){if(!o.needsDEMTextureUpload)return;const f=d.context,_=f.gl;f.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||d.getTileTexture(c.stride);const x=c.getPixels();o.demTexture?o.demTexture.update(x,{premultiply:!1}):o.demTexture=new s.Texture(f,x,_.RGBA,{premultiply:!1}),o.needsDEMTextureUpload=!1}function gf(d,o,c,f,_,x){const T=d.context,S=T.gl;if(!o.dem)return;const C=o.dem;if(T.activeTexture.set(S.TEXTURE1),Bh(d,o,C),!o.demTexture)return;o.demTexture.bind(S.NEAREST,S.CLAMP_TO_EDGE);const z=C.dim;T.activeTexture.set(S.TEXTURE0);let P=o.fbo;if(!P){const H=new s.Texture(T,{width:z,height:z,data:null},S.RGBA);H.bind(S.LINEAR,S.CLAMP_TO_EDGE),P=o.fbo=T.createFramebuffer(z,z,!0),P.colorAttachment.set(H.texture)}T.bindFramebuffer.set(P.framebuffer),T.viewport.set([0,0,z,z]);const{tileBoundsBuffer:O,tileBoundsIndexBuffer:j,tileBoundsSegments:W}=d.getMercatorTileBoundsBuffers();d.useProgram("hillshadePrepare").draw(T,S.TRIANGLES,f,_,x,s.CullFaceMode.disabled,((H,Z)=>{const X=Z.stride,B=s.create();return s.ortho(B,0,s.EXTENT,-s.EXTENT,0,0,1),s.translate(B,B,[0,-s.EXTENT,0]),{u_matrix:B,u_image:1,u_dimension:[X,X],u_zoom:H.overscaledZ,u_unpack:Z.unpackVector}})(o.tileID,C),c.id,O,j,W),o.needsHillshadePrepare=!1}const Fh=d=>({u_matrix:new s.UniformMatrix4f(d),u_image0:new s.Uniform1i(d),u_skirt_height:new s.Uniform1f(d)}),_a=(d,o)=>({u_matrix:d,u_image0:0,u_skirt_height:o}),Lc=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H)=>({u_proj_matrix:Float32Array.from(d),u_globe_matrix:o,u_normalize_matrix:Float32Array.from(f),u_merc_matrix:c,u_zoom_transition:_,u_merc_center:x,u_image0:0,u_frustum_tl:T,u_frustum_tr:S,u_frustum_br:C,u_frustum_bl:z,u_globe_pos:P,u_globe_radius:O,u_viewport:j,u_grid_matrix:H?Float32Array.from(H):new Float32Array(9),u_skirt_height:W});function ya(d,o){return d!=null&&o!=null&&!(!d.hasData()||!o.hasData())&&d.demTexture!=null&&o.demTexture!=null&&d.tileID.key!==o.tileID.key}const Co=new class{constructor(){this.operations={}}newMorphing(d,o,c,f,_){if(d in this.operations){const x=this.operations[d];x.to.tileID.key!==c.tileID.key&&(x.queued=c)}else this.operations[d]={startTime:f,phase:0,duration:_,from:o,to:c,queued:null}}getMorphValuesForProxy(d){if(!(d in this.operations))return null;const o=this.operations[d];return{from:o.from,to:o.to,phase:o.phase}}update(d){for(const o in this.operations){const c=this.operations[o];for(c.phase=(d-c.startTime)/c.duration;c.phase>=1||!this._validOp(c);)if(!this._nextOp(c,d)){delete this.operations[o];break}}}_nextOp(d,o){return!!d.queued&&(d.from=d.to,d.to=d.queued,d.queued=null,d.phase=0,d.startTime=o,!0)}_validOp(d){return d.from.hasData()&&d.to.hasData()}},zs={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Rc(d){return 6*Math.pow(1.5,22-d)}function _f(d,o){const c=1<({u_matrix:d});function Nh(d,o,c,f,_){if(_>0){const x=s.exported.now(),T=(x-d.timeAdded)/_,S=o?(x-o.timeAdded)/_:-1,C=c.getSource(),z=f.coveringZoomLevel({tileSize:C.tileSize,roundZoom:C.roundZoom}),P=!o||Math.abs(o.tileID.overscaledZ-z)>Math.abs(d.tileID.overscaledZ-z),O=P&&d.refreshedUponExpiration?1:s.clamp(P?T:1-S,0,1);return d.refreshedUponExpiration&&T>=1&&(d.refreshedUponExpiration=!1),o?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}class Uh extends s.SourceCache{constructor(o){const c={type:"raster-dem",maxzoom:o.transform.maxZoom},f=new xt(ha(),null),_=Dt("mock-dem",c,f,o.style);super("mock-dem",_,!1),_.setEventedParent(this),this._sourceLoaded=!0}_loadTile(o,c){o.state="loaded",c(null)}}class Dc extends s.SourceCache{constructor(o){const c=Dt("proxy",{type:"geojson",maxzoom:o.transform.maxZoom},new xt(ha(),null),o.style);super("proxy",c,!1),c.setEventedParent(this),this.map=this.getSource().map=o,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(o,c,f){if(o.freezeTileCoverage)return;this.transform=o;const _=o.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((x,T)=>{if(x[T.key]="",!this._tiles[T.key]){const S=new s.Tile(T,this._source.tileSize*T.overscaleFactor(),o.tileZoom);S.state="loaded",this._tiles[T.key]=S}return x},{});for(const x in this._tiles)x in _||(this.freeFBO(x),this._tiles[x].unloadVectorData(),delete this._tiles[x])}freeFBO(o){const c=this.proxyCachedFBO[o];if(c!==void 0){const f=Object.values(c);this.renderCachePool.push(...f),delete this.proxyCachedFBO[o]}}deallocRenderCache(){this.renderCache.forEach(o=>o.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Oc extends s.OverscaledTileID{constructor(o,c,f){super(o.overscaledZ,o.wrap,o.canonical.z,o.canonical.x,o.canonical.y),this.proxyTileKey=c,this.projMatrix=f}}class jh extends s.Elevation{constructor(o,c){super(),this.painter=o,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[f,_,x]=function(C){const z=new s.StructArrayLayout2i4,P=new s.StructArrayLayout3ui6,O=131;z.reserve(17161),P.reserve(33800);const j=s.EXTENT/128,W=s.EXTENT+j/2,H=W+j;for(let X=-j;XW||X<0||X>W?24575:0,Q=s.clamp(Math.round(B),0,s.EXTENT),ee=s.clamp(Math.round(X),0,s.EXTENT);z.emplaceBack(Q+q,ee)}const Z=(X,B)=>{const q=B*O+X;P.emplaceBack(q+1,q,q+O),P.emplaceBack(q+O,q+O+1,q+1)};for(let X=1;X<129;X++)for(let B=1;B<129;B++)Z(B,X);return[0,129].forEach(X=>{for(let B=0;B<130;B++)Z(B,X),Z(X,B)}),[z,P,32768]}(),T=o.context;this.gridBuffer=T.createVertexBuffer(f,s.posAttributes.members),this.gridIndexBuffer=T.createIndexBuffer(_),this.gridSegments=s.SegmentVector.simpleSegment(0,0,f.length,_.length),this.gridNoSkirtSegments=s.SegmentVector.simpleSegment(0,0,f.length,x),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Dc(c.map),this.orthoMatrix=s.create(),s.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,s.EXTENT,0,s.EXTENT,0,1);const S=T.gl;this._overlapStencilMode=new s.StencilMode({func:S.GEQUAL,mask:255},0,255,S.KEEP,S.KEEP,S.REPLACE),this._previousZoom=o.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=c,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Uh(c.map)}set style(o){o.on("data",this._onStyleDataEvent.bind(this)),o.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=o,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(o,c,f){if(o&&o.terrain){this._style!==o&&(this.style=o),this.enabled=!0;const _=o.terrain.properties;this.sourceCache=o.terrain.drapeRenderMode===0?this._mockSourceCache:o._getSourceCache(_.get("source")),this._exaggeration=_.get("exaggeration");const x=()=>{this.sourceCache.used&&s.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. -This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const T=this.getScaledDemTileSize();this.sourceCache.update(c,T,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,x(),this._initializing=!0),x(),c.updateElevation(!0,f),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(c),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(o){this._findCoveringTileCache[o]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const o=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||o.efficiency!==100&&s.warnOnce(`Terrain render cache efficiency is not optimal (${o.efficiency}%) and performance - may be affected negatively, consider placing all background, fill and line layers before layer - with id '${o.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(o){o.coord&&o.dataType==="source"?this._clearRenderCacheForTile(o.sourceCacheId,o.coord):o.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const o in this._style._sourceCaches)this._style._sourceCaches[o].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(o=>o.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const o=2*this.proxySourceCache.getSource().tileSize;return[o,o]}set useVertexMorphing(o){this._useVertexMorphing=o}updateTileBinding(o){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const c=this.proxySourceCache,f=this.painter.transform;this._initializing&&(this._initializing=f._centerAltitude===0&&this.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(f.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const _=this.proxyCoords=c.getIds().map(C=>{const z=c.getTileByID(C).tileID;return z.projMatrix=f.calculateProjMatrix(z.toUnwrapped()),z});(function(C,z){const P=z.transform.pointCoordinate(z.transform.getCameraPoint()),O=new s.Point(P.x,P.y);C.sort((j,W)=>{if(W.overscaledZ-j.overscaledZ)return W.overscaledZ-j.overscaledZ;const H=new s.Point(j.canonical.x+(1<{this.proxyToSource[C.key]={}}),this.terrainTileForTile={};const T=this._style._sourceCaches;for(const C in T){const z=T[C];if(!z.used||(z!==this.sourceCache&&this.resetTileLookupCache(z.id),this._setupProxiedCoordsForOrtho(z,o[C],x),z.usedForTerrain))continue;const P=o[C];z.getSource().reparseOverscaled&&this._assignTerrainTiles(P)}this.proxiedCoords[c.id]=_.map(C=>new Oc(C,C.key,this.orthoMatrix)),this._assignTerrainTiles(_),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(x),this.renderingToTexture=!1,this._updateTimestamp=s.exported.now();const S={};this._visibleDemTiles=[];for(const C of this.proxyCoords){const z=this.terrainTileForTile[C.key];if(!z)continue;const P=z.tileID.key;P in S||(this._visibleDemTiles.push(z),S[P]=P)}}_assignTerrainTiles(o){this._initializing||o.forEach(c=>{if(this.terrainTileForTile[c.key])return;const f=this._findTileCoveringTileID(c,this.sourceCache);f&&(this.terrainTileForTile[c.key]=f)})}_prepareDEMTextures(){const o=this.painter.context,c=o.gl;for(const f in this.terrainTileForTile){const _=this.terrainTileForTile[f],x=_.dem;!x||_.demTexture&&!_.needsDEMTextureUpload||(o.activeTexture.set(c.TEXTURE1),Bh(this.painter,_,x))}}_prepareDemTileUniforms(o,c,f,_){if(!c||c.demTexture==null)return!1;const x=o.tileID.canonical,T=Math.pow(2,c.tileID.canonical.z-x.z),S=_||"";return f[`u_dem_tl${S}`]=[x.x*T%1,x.y*T%1],f[`u_dem_scale${S}`]=T,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const o=this.painter.context,c=o.gl;if(!this._emptyDepthBufferTexture){const f=new s.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new s.Texture(o,f,c.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let o=0;const c=this._visibleDemTiles.reduce((f,_)=>{if(!_.dem)return f;const x=_.dem.tree.minimums[0];return x>0&&o++,f+x},0);return o?c/o:0}_updateEmptyDEMTexture(){const o=this.painter.context,c=o.gl;o.activeTexture.set(c.TEXTURE2);const f=this._getLoadedAreaMinimum(),_=new s.RGBAImage({width:1,height:1},new Uint8Array(s.DEMData.pack(f,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let x=this._emptyDEMTexture;return x?x.update(_,{premultiply:!1}):x=this._emptyDEMTexture=new s.Texture(o,_,c.RGBA,{premultiply:!1}),x}setupElevationDraw(o,c,f){const _=this.painter.context,x=_.gl,T=(S=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:s.DEMData.getUnpackVector(S),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var S;T.u_dem_size=this.sourceCache.getSource().tileSize,T.u_exaggeration=this.exaggeration();let C=null,z=null,P=1;if(f&&f.morphing&&this._useVertexMorphing){const O=f.morphing.srcDemTile,j=f.morphing.dstDemTile;P=f.morphing.phase,O&&j&&(this._prepareDemTileUniforms(o,O,T,"_prev")&&(z=O),this._prepareDemTileUniforms(o,j,T)&&(C=j))}if(z&&C?(_.activeTexture.set(x.TEXTURE2),C.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),_.activeTexture.set(x.TEXTURE4),z.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),T.u_dem_lerp=P):(C=this.terrainTileForTile[o.tileID.key],_.activeTexture.set(x.TEXTURE2),(this._prepareDemTileUniforms(o,C,T)?C.demTexture:this.emptyDEMTexture).bind(x.NEAREST,x.CLAMP_TO_EDGE)),_.activeTexture.set(x.TEXTURE3),f&&f.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),this._depthFBO&&(T.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),T.u_depth_size_inv=[1,1]),f&&f.useMeterToDem&&C){const O=(1<{if(B===qe)return;const Be=[zs[qe],"PROJECTION_GLOBE_VIEW"];ee&&Be.push("CUSTOM_ANTIALIASING"),Se&&Be.push(zs[q]),X=z.useProgram("globeRaster",null,Be),B=qe},fe=z.colorModeForRenderPass(),pe=new s.DepthMode(Z.LEQUAL,s.DepthMode.ReadWrite,z.depthRangeFor3D);Co.update(W);const xe=s.calculateGlobeMercatorMatrix(Q),ye=[s.mercatorXfromLng(Q.center.lng),s.mercatorYfromLat(Q.center.lat)],Ae=q?[!1,!0]:[!1],We=z.globeSharedBuffers,Ee=[Q.width*s.exported.devicePixelRatio,Q.height*s.exported.devicePixelRatio],Fe=Float32Array.from(Q.globeMatrix),ke={useDenormalizedUpVectorScale:!0};if(Ae.forEach(qe=>{const Se=z.transform,Be=Rc(Se.zoom)*P.exaggeration();B=-1;const Xe=qe?Z.LINES:Z.TRIANGLES;for(const $e of j){const Ye=O.getTile($e),gt=s.StencilMode.disabled,Et=P.prevTerrainTileForTile[$e.key],pt=P.terrainTileForTile[$e.key];ya(Et,pt)&&Co.newMorphing($e.key,Et,pt,W,250),H.activeTexture.set(Z.TEXTURE0),Ye.texture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);const wt=Co.getMorphValuesForProxy($e.key),Ut=wt?1:0;wt&&s.extend$1(ke,{morphing:{srcDemTile:wt.from,dstDemTile:wt.to,phase:s.easeCubicInOut(wt.phase)}});const Ot=s.tileCornersToBounds($e.canonical),mt=s.getLatitudinalLod(Ot.getCenter().lat),en=s.getGridMatrix($e.canonical,Ot,mt,Se.worldSize/Se._pixelsPerMercatorPixel),rn=s.globeNormalizeECEF(s.globeTileBounds($e.canonical)),on=Lc(Se.projMatrix,Fe,xe,rn,s.globeToMercatorTransition(Se.zoom),ye,Se.frustumCorners.TL,Se.frustumCorners.TR,Se.frustumCorners.BR,Se.frustumCorners.BL,Se.globeCenterInViewSpace,Se.globeRadius,Ee,Be,en);if(de(Ut,qe),P.setupElevationDraw(Ye,X,ke),z.prepareDrawProgram(H,X,$e.toUnwrapped()),We){const[sn,Mr,fr]=qe?We.getWirefameBuffers(z.context,mt):We.getGridBuffers(mt,Be!==0);X.draw(H,Xe,pe,gt,fe,s.CullFaceMode.backCCW,on,"globe_raster",sn,Mr,fr)}}}),We){const qe=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];ee&&qe.push("CUSTOM_ANTIALIASING"),X=z.useProgram("globeRaster",null,qe);for(const Se of j){const{x:Be,y:Xe,z:$e}=Se.canonical,Ye=Xe===0,gt=Xe===(1<<$e)-1,[Et,pt,wt,Ut]=We.getPoleBuffers($e);if(Ut&&(Ye||gt)){const Ot=O.getTile(Se);H.activeTexture.set(Z.TEXTURE0),Ot.texture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);let mt=s.globePoleMatrixForTile($e,Be,Q);const en=s.globeNormalizeECEF(s.globeTileBounds(Se.canonical)),rn=(on,sn)=>on.draw(H,Z.TRIANGLES,pe,s.StencilMode.disabled,fe,s.CullFaceMode.disabled,Lc(Q.projMatrix,mt,mt,en,0,ye,Q.frustumCorners.TL,Q.frustumCorners.TR,Q.frustumCorners.BR,Q.frustumCorners.BL,Q.globeCenterInViewSpace,Q.globeRadius,Ee,0),"globe_pole_raster",sn,wt,Ut);P.setupElevationDraw(Ot,X,ke),z.prepareDrawProgram(H,X,Se.toUnwrapped()),Ye&&rn(X,Et),gt&&(mt=s.scale(s.create(),mt,[1,-1,1]),rn(X,pt))}}}})(_,x,T,S,C);else{const z=_.context,P=z.gl;let O,j;const W=_.options.showTerrainWireframe?2:0,H=(Q,ee)=>{if(j===Q)return;const de=[zs[Q]];ee&&de.push(zs[W]),O=_.useProgram("terrainRaster",null,de),j=Q},Z=_.colorModeForRenderPass(),X=new s.DepthMode(P.LEQUAL,s.DepthMode.ReadWrite,_.depthRangeFor3D);Co.update(C);const B=_.transform,q=Rc(B.zoom)*x.exaggeration();(W?[!1,!0]:[!1]).forEach(Q=>{j=-1;const ee=Q?P.LINES:P.TRIANGLES,[de,fe]=Q?x.getWirefameBuffer():[x.gridIndexBuffer,x.gridSegments];for(const pe of S){const xe=T.getTile(pe),ye=s.StencilMode.disabled,Ae=x.prevTerrainTileForTile[pe.key],We=x.terrainTileForTile[pe.key];ya(Ae,We)&&Co.newMorphing(pe.key,Ae,We,C,250),z.activeTexture.set(P.TEXTURE0),xe.texture.bind(P.LINEAR,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST);const Ee=Co.getMorphValuesForProxy(pe.key),Fe=Ee?1:0;let ke;Ee&&(ke={morphing:{srcDemTile:Ee.from,dstDemTile:Ee.to,phase:s.easeCubicInOut(Ee.phase)}});const qe=_a(pe.projMatrix,_f(pe.canonical,B.renderWorldCopies)?q/10:q);H(Fe,Q),x.setupElevationDraw(xe,O,ke),_.prepareDrawProgram(z,O,pe.toUnwrapped()),O.draw(z,ee,X,ye,Z,s.CullFaceMode.backCCW,qe,"terrain_raster",x.gridBuffer,de,fe)}})}}(c,this,this.proxySourceCache,o,this._updateTimestamp),this.renderingToTexture=!0,c.gpuTimingDeferredRenderEnd(),o.splice(0,o.length))}renderBatch(o){if(this._drapedRenderBatches.length===0)return o+1;this.renderingToTexture=!0;const c=this.painter,f=this.painter.context,_=this.proxySourceCache,x=this.proxiedCoords[_.id],T=this._drapedRenderBatches.shift(),S=[],C=c.style.order;let z=0;for(const P of x){const O=_.getTileByID(P.proxyTileKey),j=_.proxyCachedFBO[P.key]?_.proxyCachedFBO[P.key][o]:void 0,W=j!==void 0?_.renderCache[j]:this.pool[z++],H=j!==void 0;if(O.texture=W.tex,H&&!W.dirty){S.push(O.tileID);continue}let Z;f.bindFramebuffer.set(W.fb.framebuffer),this.renderedToTile=!1,W.dirty&&(f.clear({color:s.Color.transparent,stencil:0}),W.dirty=!1);for(let X=T.start;X<=T.end;++X){const B=c.style._layers[C[X]];if(B.isHidden(c.transform.zoom))continue;const q=c.style._getLayerSourceCache(B),Q=q?this.proxyToSource[P.key][q.id]:[P];if(!Q)continue;const ee=Q;f.viewport.set([0,0,W.fb.width,W.fb.height]),Z!==(q?q.id:null)&&(this._setupStencil(W,Q,B,q),Z=q?q.id:null),c.renderLayer(c,q,B,ee)}this.renderedToTile?(W.dirty=!0,S.push(O.tileID)):H||--z,z===5&&(z=0,this.renderToBackBuffer(S))}return this.renderToBackBuffer(S),this.renderingToTexture=!1,f.bindFramebuffer.set(null),f.viewport.set([0,0,c.width,c.height]),T.end+1}postRender(){}renderCacheEfficiency(o){const c=o.order.length;if(c===0)return{efficiency:100};let f,_=0,x=0,T=!1;for(let S=0;Sc.dem).forEach(c=>{o=Math.min(o,c.dem.tree.minimums[0])}),o===0?o:(o-30)*this._exaggeration}raycast(o,c,f){if(!this._visibleDemTiles)return null;const _=this._visibleDemTiles.filter(x=>x.dem).map(x=>{const T=x.tileID,S=1<(x.t!==null?x.t:Number.MAX_VALUE)-(T.t!==null?T.t:Number.MAX_VALUE));for(const x of _){if(x.t==null)return null;const T=x.tile.dem.tree.raycast(x.minx,x.miny,x.maxx,x.maxy,o,c,f);if(T!=null)return T}return null}_createFBO(){const o=this.painter.context,c=o.gl,f=this.drapeBufferSize;o.activeTexture.set(c.TEXTURE0);const _=new s.Texture(o,{width:f[0],height:f[1],data:null},c.RGBA);_.bind(c.LINEAR,c.CLAMP_TO_EDGE);const x=o.createFramebuffer(f[0],f[1],!1);return x.colorAttachment.set(_.texture),x.depthAttachment=new ge(o,x.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=o.createRenderbuffer(o.gl.DEPTH_STENCIL,f[0],f[1]),this._stencilRef=0,x.depthAttachment.set(this._sharedDepthStencil),o.clear({stencil:0})):x.depthAttachment.set(this._sharedDepthStencil),o.extTextureFilterAnisotropic&&!o.extTextureFilterAnisotropicForceOff&&c.texParameterf(c.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax),{fb:x,tex:_,dirty:!1}}_initFBOPool(){for(;this.pool.length{const c=this._style._layers[o],f=c.isHidden(this.painter.transform.zoom);return c.type==="custom"?!f&&c.shouldRedrape():!f&&c.hasTransition()})}_clearLineLayersFromRenderCache(){let o=!1;for(const f of this._style._getSources())if(f instanceof rt){o=!0;break}if(!o)return;const c={};for(let f=0;fc.renderCachePool.length){const T=Object.values(c.proxyCachedFBO);c.proxyCachedFBO={};for(let S=0;S=0;T--){const S=f[T];if(c.getTileByID(S.key),c.proxyCachedFBO[S.key]!==void 0){const C=o[S.key],z=this.proxyToSource[S.key];let P=0;for(const O in z){const j=z[O],W=C[O];if(!W||W.length!==j.length||j.some((H,Z)=>H!==W[Z]||_[O]&&_[O].hasOwnProperty(H.key))){P=-1;break}++P}for(const O in c.proxyCachedFBO[S.key])c.renderCache[c.proxyCachedFBO[S.key][O]].dirty=P<0||P!==Object.values(C).length}}const x=[...this._drapedRenderBatches];x.sort((T,S)=>S.end-S.start-(T.end-T.start));for(const T of x)for(const S of f){if(c.proxyCachedFBO[S.key])continue;let C=c.renderCachePool.pop();C===void 0&&c.renderCache.length<50&&(C=c.renderCache.length,c.renderCache.push(this._createFBO())),C!==void 0&&(c.proxyCachedFBO[S.key]={},c.proxyCachedFBO[S.key][T.start]=C,c.renderCache[C].dirty=!0)}this._tilesDirty={}}_setupStencil(o,c,f,_){if(!_||!this._sourceTilesOverlap[_.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const x=this.painter.context,T=x.gl;if(c.length<=1)return void(this._overlapStencilType=!1);let S;if(f.isTileClipped())S=c.length,this._overlapStencilMode.test={func:T.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(c[0].overscaledZ>c[c.length-1].overscaledZ))return void(this._overlapStencilType=!1);S=1,this._overlapStencilMode.test={func:T.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+S>255&&(x.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=S,this._overlapStencilMode.ref=this._stencilRef,f.isTileClipped()&&this._renderTileClippingMasks(c,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(o){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[o.key]),this._overlapStencilMode):s.StencilMode.disabled}_renderTileClippingMasks(o,c){const f=this.painter,_=this.painter.context,x=_.gl;f._tileClippingMaskIDs={},_.setColorMode(s.ColorMode.disabled),_.setDepthMode(s.DepthMode.disabled);const T=f.useProgram("clippingMask");for(const S of o){const C=f._tileClippingMaskIDs[S.key]=--c;T.draw(_,x.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:x.ALWAYS,mask:0},C,255,x.KEEP,x.KEEP,x.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,kl(S.projMatrix),"$clipping",f.tileExtentBuffer,f.quadTriangleIndexBuffer,f.tileExtentSegments)}}pointCoordinate(o){const c=this.painter.transform;if(o.x<0||o.x>c.width||o.y<0||o.y>c.height)return null;const f=[o.x,o.y,1,1];s.transformMat4$1(f,f,c.pixelMatrixInverse),s.scale$1(f,f,1/f[3]),f[0]/=c.worldSize,f[1]/=c.worldSize;const _=c._camera.position,x=s.mercatorZfromAltitude(1,c.center.lat),T=[_[0],_[1],_[2]/x,0],S=s.subtract([],f.slice(0,3),T);s.normalize(S,S);const C=this.raycast(T,S,this._exaggeration);return C!==null&&C?(s.scaleAndAdd(T,T,S,C),T[3]=T[2],T[2]*=x,T):null}drawDepth(){const o=this.painter,c=o.context,f=this.proxySourceCache,_=Math.ceil(o.width),x=Math.ceil(o.height);if(!this._depthFBO||this._depthFBO.width===_&&this._depthFBO.height===x||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const T=c.gl,S=c.createFramebuffer(_,x,!0);c.activeTexture.set(T.TEXTURE0);const C=new s.Texture(c,{width:_,height:x,data:null},T.RGBA);C.bind(T.NEAREST,T.CLAMP_TO_EDGE),S.colorAttachment.set(C.texture);const z=c.createRenderbuffer(c.gl.DEPTH_COMPONENT16,_,x);S.depthAttachment.set(z),this._depthFBO=S,this._depthTexture=C}c.bindFramebuffer.set(this._depthFBO.framebuffer),c.viewport.set([0,0,_,x]),function(T,S,C,z){if(T.transform.projection.name==="globe")return;const P=T.context,O=P.gl;P.clear({depth:1});const j=T.useProgram("terrainDepth"),W=new s.DepthMode(O.LESS,s.DepthMode.ReadWrite,T.depthRangeFor3D);for(const H of z){const Z=C.getTile(H),X=_a(H.projMatrix,0);S.setupElevationDraw(Z,j),j.draw(P,O.TRIANGLES,W,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.backCCW,X,"terrain_depth",S.gridBuffer,S.gridIndexBuffer,S.gridNoSkirtSegments)}}(o,this,f,this.proxyCoords)}_setupProxiedCoordsForOrtho(o,c,f){if(o.getSource()instanceof Rt)return this._setupProxiedCoordsForImageSource(o,c,f);this._findCoveringTileCache[o.id]=this._findCoveringTileCache[o.id]||{};const _=this.proxiedCoords[o.id]=[],x=this.proxyCoords;for(let S=0;S(P.min.x=Math.min(P.min.x,O.x-S.x),P.min.y=Math.min(P.min.y,O.y-S.y),P.max.x=Math.max(P.max.x,O.x-S.x),P.max.y=Math.max(P.max.y,O.y-S.y),P),{min:new s.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),z=(P,O)=>{const j=P.wrap+P.canonical.x/(1<Z+C.max.x||W+HX+C.max.y};for(let P=0;PT.key===c.tileID.key);if(x)return x}if(c.tileID.key!==o.key){const x=o.canonical.z-c.tileID.canonical.z;let T,S,C;_=s.create();const z=c.tileID.wrap-o.wrap<0?(T=s.EXTENT>>x,S=T*((c.tileID.canonical.x<=O){const j=o.canonical.z-O;c.getSource().reparseOverscaled?(S=Math.max(o.canonical.z+2,c.transform.tileZoom),T=new s.OverscaledTileID(S,o.wrap,O,o.canonical.x>>j,o.canonical.y>>j)):j!==0&&(S=O,T=new s.OverscaledTileID(S,o.wrap,O,o.canonical.x>>j,o.canonical.y>>j))}T.key!==o.key&&(z.push(T.key),f=c.getTile(T))}const P=O=>{z.forEach(j=>{_[j]=O}),z.length=0};for(S-=1;S>=C&&(!f||!f.hasData());S--){f&&P(f.tileID.key);const O=T.calculateScaledKey(S);if(f=c.getTileByID(O),f&&f.hasData())break;const j=_[O];if(j===null)break;j===void 0?z.push(O):f=c.getTileByID(j)}return P(f?f.tileID.key:null),f&&f.hasData()?f:null}findDEMTileFor(o){return this.enabled?this._findTileCoveringTileID(o,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(o,c){let f=this._tilesDirty[o];f||(f=this._tilesDirty[o]={}),f[c.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const o=function(c){let f=0;const _=new s.StructArrayLayout2ui4,x=131;for(let T=1;T<129;T++){for(let S=1;S<129;S++)f=T*x+S,_.emplaceBack(f,f+1),_.emplaceBack(f,f+x),_.emplaceBack(f+1,f+x),T===128&&_.emplaceBack(f+x,f+x+1);_.emplaceBack(f+1,f+1+x)}return _}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(o),this.wireframeSegments=s.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,o.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class Wt{static cacheKey(o,c,f,_){let x=`${c}${_?_.cacheKey:""}`;for(const T of f)o.usedDefines.includes(T)&&(x+=`/${T}`);return x}constructor(o,c,f,_,x,T){const S=o.gl;this.program=S.createProgram();const C=function(B){const q=[];for(let Q=0;Q`#define ${B}`));const j=o.isWebGL2?`#version 300 es -`:"",W=j+O.concat(o.extStandardDerivatives&&j.length===0?`#extension GL_OES_standard_derivatives : enable -`.concat(Rh):Rh,Rh,zc,ff.fragmentSource,ma.fragmentSource,f.fragmentSource).join(` -`),H=j+O.concat(` -#ifdef GL_ES -precision highp float; -#else - -#if !defined(lowp) -#define lowp -#endif - -#if !defined(mediump) -#define mediump -#endif - -#if !defined(highp) -#define highp -#endif - -#endif`,zc,ff.vertexSource,ma.vertexSource,Pc.vertexSource,f.vertexSource).join(` -`),Z=S.createShader(S.FRAGMENT_SHADER);if(S.isContextLost())return void(this.failedToCreate=!0);S.shaderSource(Z,W),S.compileShader(Z),S.attachShader(this.program,Z);const X=S.createShader(S.VERTEX_SHADER);if(S.isContextLost())this.failedToCreate=!0;else{S.shaderSource(X,H),S.compileShader(X),S.attachShader(this.program,X),this.attributes={},this.numAttributes=P.length;for(let B=0;B({u_dem:new s.Uniform1i(B),u_dem_prev:new s.Uniform1i(B),u_dem_unpack:new s.Uniform4f(B),u_dem_tl:new s.Uniform2f(B),u_dem_scale:new s.Uniform1f(B),u_dem_tl_prev:new s.Uniform2f(B),u_dem_scale_prev:new s.Uniform1f(B),u_dem_size:new s.Uniform1f(B),u_dem_lerp:new s.Uniform1f(B),u_exaggeration:new s.Uniform1f(B),u_depth:new s.Uniform1i(B),u_depth_size_inv:new s.Uniform2f(B),u_meter_to_dem:new s.Uniform1f(B),u_label_plane_matrix_inv:new s.UniformMatrix4f(B)}))(o)),T.includes("GLOBE")&&(this.globeUniforms=(B=>({u_tile_tl_up:new s.Uniform3f(B),u_tile_tr_up:new s.Uniform3f(B),u_tile_br_up:new s.Uniform3f(B),u_tile_bl_up:new s.Uniform3f(B),u_tile_up_scale:new s.Uniform1f(B)}))(o)),T.includes("FOG")&&(this.fogUniforms=(B=>({u_fog_matrix:new s.UniformMatrix4f(B),u_fog_range:new s.Uniform2f(B),u_fog_color:new s.Uniform4f(B),u_fog_horizon_blend:new s.Uniform1f(B),u_fog_temporal_offset:new s.Uniform1f(B),u_frustum_tl:new s.Uniform3f(B),u_frustum_tr:new s.Uniform3f(B),u_frustum_br:new s.Uniform3f(B),u_frustum_bl:new s.Uniform3f(B),u_globe_pos:new s.Uniform3f(B),u_globe_radius:new s.Uniform1f(B),u_globe_transition:new s.Uniform1f(B),u_is_globe:new s.Uniform1i(B),u_viewport:new s.Uniform2f(B)}))(o))}}setTerrainUniformValues(o,c){if(!this.terrainUniforms)return;const f=this.terrainUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_]&&f[_].set(this.program,_,c[_])}}setGlobeUniformValues(o,c){if(!this.globeUniforms)return;const f=this.globeUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_]&&f[_].set(this.program,_,c[_])}}setFogUniformValues(o,c){if(!this.fogUniforms)return;const f=this.fogUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_].set(this.program,_,c[_])}}draw(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z){const X=o.gl;if(this.failedToCreate)return;o.program.set(this.program),o.setDepthMode(f),o.setStencilMode(_),o.setColorMode(x),o.setCullFace(T);for(const q of Object.keys(this.fixedUniforms))this.fixedUniforms[q].set(this.program,q,S[q]);H&&H.setUniforms(this.program,o,this.binderUniforms,j,{zoom:W});const B={[X.LINES]:2,[X.TRIANGLES]:3,[X.LINE_STRIP]:1}[c];for(const q of O.get()){const Q=q.vaos||(q.vaos={});(Q[C]||(Q[C]=new W_)).bind(o,this,z,H?H.getPaintVertexBuffers():[],P,q.vertexOffset,Z||[]),X.drawElements(c,q.primitiveLength*B,X.UNSIGNED_SHORT,q.primitiveOffset*B*2)}}}function Ml(d,o){const c=Math.pow(2,o.tileID.overscaledZ),f=o.tileSize*Math.pow(2,d.transform.tileZoom)/c,_=f*(o.tileID.canonical.x+o.tileID.wrap*c),x=f*o.tileID.canonical.y;return{u_image:0,u_texsize:o.imageAtlasTexture.size,u_tile_units_to_pixels:1/Bt(o,1,d.transform.tileZoom),u_pixel_coord_upper:[_>>16,x>>16],u_pixel_coord_lower:[65535&_,65535&x]}}const yf=s.create(),Vh=(d,o,c,f,_,x,T,S,C,z,P)=>{const O=o.style.light,j=O.properties.get("position"),W=[j.x,j.y,j.z],H=s.create$1();O.properties.get("anchor")==="viewport"&&(s.fromRotation(H,-o.transform.angle),s.transformMat3(W,W,H));const Z=O.properties.get("color"),X=o.transform,B={u_matrix:d,u_lightpos:W,u_lightintensity:O.properties.get("intensity"),u_lightcolor:[Z.r,Z.g,Z.b],u_vertical_gradient:+c,u_opacity:f,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:yf,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:_,u_edge_radius:x};return X.projection.name==="globe"&&(B.u_tile_id=[T.canonical.x,T.canonical.y,1<{const j=Vh(d,o,c,f,_,x,T,C,z,P,O),W={u_height_factor:-Math.pow(2,T.overscaledZ)/S.tileSize/8};return s.extend(j,Ml(o,S),W)},Ls=d=>({u_matrix:d}),$h=(d,o,c)=>s.extend(Ls(d),Ml(o,c)),Z_=(d,o)=>({u_matrix:d,u_world:o}),H_=(d,o,c,f)=>s.extend($h(d,o,c),{u_world:f}),X_=s.create(),Gh=(d,o,c,f,_,x)=>{const T=d.transform,S=T.projection.name==="globe";let C;if(x.paint.get("circle-pitch-alignment")==="map")if(S){const P=s.globePixelsToTileUnits(T.zoom,o.canonical)*T._pixelsPerMercatorPixel;C=Float32Array.from([P,0,0,P])}else C=T.calculatePixelsToTileUnitsMatrix(c);else C=new Float32Array([T.pixelsToGLUnits[0],0,0,T.pixelsToGLUnits[1]]);const z={u_camera_to_center_distance:T.cameraToCenterDistance,u_matrix:d.translatePosMatrix(o.projMatrix,c,x.paint.get("circle-translate"),x.paint.get("circle-translate-anchor")),u_device_pixel_ratio:s.exported.devicePixelRatio,u_extrude_scale:C,u_inv_rot_matrix:X_,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(S){z.u_inv_rot_matrix=f,z.u_merc_center=_,z.u_tile_id=[o.canonical.x,o.canonical.y,1<{const o=[];return d.paint.get("circle-pitch-alignment")==="map"&&o.push("PITCH_WITH_MAP"),d.paint.get("circle-pitch-scale")==="map"&&o.push("SCALE_WITH_MAP"),o},Wh=(d,o,c,f)=>{const _=s.EXTENT/c.tileSize;return{u_matrix:d,u_camera_to_center_distance:o.getCameraToCenterDistance(f),u_extrude_scale:[o.pixelsToGLUnits[0]/_,o.pixelsToGLUnits[1]/_]}},Bc=(d,o,c=1)=>({u_matrix:d,u_color:o,u_overlay:0,u_overlay_scale:c}),xf=s.create(),wf=(d,o,c,f,_,x,T)=>{const S=d.transform,C=S.projection.name==="globe",z=C?s.globePixelsToTileUnits(S.zoom,o.canonical)*S._pixelsPerMercatorPixel:Bt(c,1,x),P={u_matrix:o.projMatrix,u_extrude_scale:z,u_intensity:T,u_inv_rot_matrix:xf,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(C){P.u_inv_rot_matrix=f,P.u_merc_center=_,P.u_tile_id=[o.canonical.x,o.canonical.y,1<{const S=d.transform,C=S.calculatePixelsToTileUnitsMatrix(o);return{u_matrix:Zh(d,o,c,f),u_pixels_to_tile_units:C,u_device_pixel_ratio:x,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:_,u_texsize:zl(c)?o.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:va(o,d.transform),u_alpha_discard_threshold:0,u_trim_offset:T}},Pl=(d,o,c,f,_)=>{const x=d.transform;return{u_matrix:Zh(d,o,c,f),u_texsize:o.imageAtlasTexture.size,u_pixels_to_tile_units:x.calculatePixelsToTileUnitsMatrix(o),u_device_pixel_ratio:_,u_image:0,u_tile_units_to_pixels:va(o,x),u_units_to_pixels:[1/x.pixelsToGLUnits[0],1/x.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function va(d,o){return 1/Bt(d,1,o.tileZoom)}function Zh(d,o,c,f){return d.translatePosMatrix(f||o.tileID.projMatrix,o,c.paint.get("line-translate"),c.paint.get("line-translate-anchor"))}function zl(d){const o=d.paint.get("line-dasharray").value;return o.value||o.kind!=="constant"}const Hh=(d,o,c,f,_,x)=>{return{u_matrix:d,u_tl_parent:o,u_scale_parent:c,u_fade_t:f.mix,u_opacity:f.opacity*_.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:_.paint.get("raster-brightness-min"),u_brightness_high:_.paint.get("raster-brightness-max"),u_saturation_factor:(S=_.paint.get("raster-saturation"),S>0?1-1/(1.001-S):-S),u_contrast_factor:(T=_.paint.get("raster-contrast"),T>0?1/(1-T):1+T),u_spin_weights:no(_.paint.get("raster-hue-rotate")),u_perspective_transform:x};var T,S};function no(d){d*=Math.PI/180;const o=Math.sin(d),c=Math.cos(d);return[(2*c+1)/3,(-Math.sqrt(3)*o-c+1)/3,(Math.sqrt(3)*o-c+1)/3]}const Fc=s.create(),Xh=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z)=>{const X=_.transform,B={u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:X.cameraToCenterDistance,u_rotate_symbol:+c,u_aspect_ratio:X.width/X.height,u_fade_change:_.options.fadeDuration?_.symbolFadeChange:1,u_matrix:x,u_label_plane_matrix:T,u_coord_matrix:S,u_is_text:+C,u_pitch_with_map:+f,u_texsize:z,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Fc,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Fc,u_up_vector:[0,-1,0]};return Z.name==="globe"&&(B.u_tile_id=[P.canonical.x,P.canonical.y,1<s.extend(Xh(d,o,c,f,_,x,T,S,C,z,O,j,W,H,Z,X),{u_gamma_scale:f?_.transform.cameraToCenterDistance*Math.cos(_.terrain?0:_.transform._pitch):1,u_device_pixel_ratio:s.exported.devicePixelRatio,u_is_halo:+P}),bf=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z)=>s.extend(Nc(d,o,c,f,_,x,T,S,!0,C,!0,P,O,j,W,H,Z),{u_texsize_icon:z,u_texture_icon:1}),Kh=(d,o,c)=>({u_matrix:d,u_opacity:o,u_color:c}),Y_=(d,o,c,f,_)=>s.extend(function(x,T,S){const C=T.imageManager.getPattern(x.toString()),{width:z,height:P}=T.imageManager.getPixelSize(),O=Math.pow(2,S.tileID.overscaledZ),j=S.tileSize*Math.pow(2,T.transform.tileZoom)/O,W=j*(S.tileID.canonical.x+S.tileID.wrap*O),H=j*S.tileID.canonical.y;return{u_image:0,u_pattern_tl:C.tl,u_pattern_br:C.br,u_texsize:[z,P],u_pattern_size:C.displaySize,u_tile_units_to_pixels:1/Bt(S,1,T.transform.tileZoom),u_pixel_coord_upper:[W>>16,H>>16],u_pixel_coord_lower:[65535&W,65535&H]}}(f,c,_),{u_matrix:d,u_opacity:o}),Yh={fillExtrusion:d=>({u_matrix:new s.UniformMatrix4f(d),u_lightpos:new s.Uniform3f(d),u_lightintensity:new s.Uniform1f(d),u_lightcolor:new s.Uniform3f(d),u_vertical_gradient:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_edge_radius:new s.Uniform1f(d),u_ao:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_up_dir:new s.Uniform3f(d),u_height_lift:new s.Uniform1f(d)}),fillExtrusionPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_lightpos:new s.Uniform3f(d),u_lightintensity:new s.Uniform1f(d),u_lightcolor:new s.Uniform3f(d),u_vertical_gradient:new s.Uniform1f(d),u_height_factor:new s.Uniform1f(d),u_edge_radius:new s.Uniform1f(d),u_ao:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_up_dir:new s.Uniform3f(d),u_height_lift:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d)}),fill:d=>({u_matrix:new s.UniformMatrix4f(d)}),fillPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),fillOutline:d=>({u_matrix:new s.UniformMatrix4f(d),u_world:new s.Uniform2f(d)}),fillOutlinePattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_world:new s.Uniform2f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),circle:d=>({u_camera_to_center_distance:new s.Uniform1f(d),u_extrude_scale:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_up_dir:new s.Uniform3f(d)}),collisionBox:d=>({u_matrix:new s.UniformMatrix4f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_extrude_scale:new s.Uniform2f(d)}),collisionCircle:d=>({u_matrix:new s.UniformMatrix4f(d),u_inv_matrix:new s.UniformMatrix4f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_viewport_size:new s.Uniform2f(d)}),debug:d=>({u_color:new s.UniformColor(d),u_matrix:new s.UniformMatrix4f(d),u_overlay:new s.Uniform1i(d),u_overlay_scale:new s.Uniform1f(d)}),clippingMask:d=>({u_matrix:new s.UniformMatrix4f(d)}),heatmap:d=>({u_extrude_scale:new s.Uniform1f(d),u_intensity:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_up_dir:new s.Uniform3f(d)}),heatmapTexture:d=>({u_image:new s.Uniform1i(d),u_color_ramp:new s.Uniform1i(d),u_opacity:new s.Uniform1f(d)}),hillshade:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_latrange:new s.Uniform2f(d),u_light:new s.Uniform2f(d),u_shadow:new s.UniformColor(d),u_highlight:new s.UniformColor(d),u_accent:new s.UniformColor(d)}),hillshadePrepare:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_dimension:new s.Uniform2f(d),u_zoom:new s.Uniform1f(d),u_unpack:new s.Uniform4f(d)}),line:d=>({u_matrix:new s.UniformMatrix4f(d),u_pixels_to_tile_units:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_units_to_pixels:new s.Uniform2f(d),u_dash_image:new s.Uniform1i(d),u_gradient_image:new s.Uniform1i(d),u_image_height:new s.Uniform1f(d),u_texsize:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_alpha_discard_threshold:new s.Uniform1f(d),u_trim_offset:new s.Uniform2f(d)}),linePattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_texsize:new s.Uniform2f(d),u_pixels_to_tile_units:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_units_to_pixels:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_alpha_discard_threshold:new s.Uniform1f(d)}),raster:d=>({u_matrix:new s.UniformMatrix4f(d),u_tl_parent:new s.Uniform2f(d),u_scale_parent:new s.Uniform1f(d),u_fade_t:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_image0:new s.Uniform1i(d),u_image1:new s.Uniform1i(d),u_brightness_low:new s.Uniform1f(d),u_brightness_high:new s.Uniform1f(d),u_saturation_factor:new s.Uniform1f(d),u_contrast_factor:new s.Uniform1f(d),u_spin_weights:new s.Uniform3f(d),u_perspective_transform:new s.Uniform2f(d)}),symbolIcon:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_camera_forward:new s.Uniform3f(d),u_tile_matrix:new s.UniformMatrix4f(d),u_up_vector:new s.Uniform3f(d),u_ecef_origin:new s.Uniform3f(d),u_texture:new s.Uniform1i(d)}),symbolSDF:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_texture:new s.Uniform1i(d),u_gamma_scale:new s.Uniform1f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_camera_forward:new s.Uniform3f(d),u_tile_matrix:new s.UniformMatrix4f(d),u_up_vector:new s.Uniform3f(d),u_ecef_origin:new s.Uniform3f(d),u_is_halo:new s.Uniform1i(d)}),symbolTextAndIcon:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_texsize_icon:new s.Uniform2f(d),u_texture:new s.Uniform1i(d),u_texture_icon:new s.Uniform1i(d),u_gamma_scale:new s.Uniform1f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_is_halo:new s.Uniform1i(d)}),background:d=>({u_matrix:new s.UniformMatrix4f(d),u_opacity:new s.Uniform1f(d),u_color:new s.UniformColor(d)}),backgroundPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_opacity:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_pattern_tl:new s.Uniform2f(d),u_pattern_br:new s.Uniform2f(d),u_texsize:new s.Uniform2f(d),u_pattern_size:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),terrainRaster:Fh,terrainDepth:Fh,skybox:d=>({u_matrix:new s.UniformMatrix4f(d),u_sun_direction:new s.Uniform3f(d),u_cubemap:new s.Uniform1i(d),u_opacity:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d)}),skyboxGradient:d=>({u_matrix:new s.UniformMatrix4f(d),u_color_ramp:new s.Uniform1i(d),u_center_direction:new s.Uniform3f(d),u_radius:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d)}),skyboxCapture:d=>({u_matrix_3f:new s.UniformMatrix3f(d),u_sun_direction:new s.Uniform3f(d),u_sun_intensity:new s.Uniform1f(d),u_color_tint_r:new s.Uniform4f(d),u_color_tint_m:new s.Uniform4f(d),u_luminance:new s.Uniform1f(d)}),globeRaster:d=>({u_proj_matrix:new s.UniformMatrix4f(d),u_globe_matrix:new s.UniformMatrix4f(d),u_normalize_matrix:new s.UniformMatrix4f(d),u_merc_matrix:new s.UniformMatrix4f(d),u_zoom_transition:new s.Uniform1f(d),u_merc_center:new s.Uniform2f(d),u_image0:new s.Uniform1i(d),u_grid_matrix:new s.UniformMatrix3f(d),u_skirt_height:new s.Uniform1f(d),u_frustum_tl:new s.Uniform3f(d),u_frustum_tr:new s.Uniform3f(d),u_frustum_br:new s.Uniform3f(d),u_frustum_bl:new s.Uniform3f(d),u_globe_pos:new s.Uniform3f(d),u_globe_radius:new s.Uniform1f(d),u_viewport:new s.Uniform2f(d)}),globeAtmosphere:d=>({u_frustum_tl:new s.Uniform3f(d),u_frustum_tr:new s.Uniform3f(d),u_frustum_br:new s.Uniform3f(d),u_frustum_bl:new s.Uniform3f(d),u_horizon:new s.Uniform1f(d),u_transition:new s.Uniform1f(d),u_fadeout_range:new s.Uniform1f(d),u_color:new s.Uniform4f(d),u_high_color:new s.Uniform4f(d),u_space_color:new s.Uniform4f(d),u_star_intensity:new s.Uniform1f(d),u_star_density:new s.Uniform1f(d),u_star_size:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d),u_horizon_angle:new s.Uniform1f(d),u_rotation_matrix:new s.UniformMatrix4f(d)})};let Uc;function Ll(d,o,c,f,_,x,T){const S=d.context,C=S.gl,z=d.transform,P=d.useProgram("collisionBox"),O=[];let j=0,W=0;for(let ee=0;ee0){const Ee=s.create(),Fe=ye;s.mul(Ee,pe.placementInvProjMatrix,z.glCoordMatrix),s.mul(Ee,Ee,pe.placementViewportMatrix),O.push({circleArray:We,circleOffset:W,transform:Fe,invTransform:Ee,projection:pe.getProjection()}),j+=We.length/4,W=j}Ae&&(d.terrain&&d.terrain.setupElevationDraw(fe,P),P.draw(S,C.LINES,s.DepthMode.disabled,s.StencilMode.disabled,d.colorModeForRenderPass(),s.CullFaceMode.disabled,Wh(ye,z,fe,pe.getProjection()),c.id,Ae.layoutVertexBuffer,Ae.indexBuffer,Ae.segments,null,z.zoom,null,[Ae.collisionVertexBuffer,Ae.collisionVertexBufferExt]))}if(!T||!O.length)return;const H=d.useProgram("collisionCircle"),Z=new s.StructArrayLayout2f1f2i16;Z.resize(4*j),Z._trim();let X=0;for(const ee of O)for(let de=0;de=0&&(H[ee.associatedIconIndex]={x:Ee,y:Fe,z:ke,angle:$e})}else Ri(pe,j)}if(P){W.clear();const Q=d.icon.placedSymbolArray;for(let ee=0;eeEe.sortKey-Fe.sortKey);for(const Ee of ye){const Fe=Ee.state;if(d.terrain&&d.terrain.setupElevationDraw(Fe.tile,Fe.program,{useDepthForOcclusion:!xe,labelPlaneMatrixInv:Fe.labelPlaneMatrixInv}),j.activeTexture.set(W.TEXTURE0),Fe.atlasTexture.bind(Fe.atlasInterpolation,W.CLAMP_TO_EDGE),Fe.atlasTextureIcon&&(j.activeTexture.set(W.TEXTURE1),Fe.atlasTextureIcon&&Fe.atlasTextureIcon.bind(Fe.atlasInterpolationIcon,W.CLAMP_TO_EDGE)),Fe.isSDF){const ke=Fe.uniformValues;Fe.hasHalo&&(ke.u_is_halo=1,Rl(Fe.buffers,Ee.segments,c,d,Fe.program,de,P,O,ke)),ke.u_is_halo=0}Rl(Fe.buffers,Ee.segments,c,d,Fe.program,de,P,O,Fe.uniformValues)}}function Rl(d,o,c,f,_,x,T,S,C){const z=f.context,P=[d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer,d.globeExtVertexBuffer];_.draw(z,z.gl.TRIANGLES,x,T,S,s.CullFaceMode.disabled,C,c.id,d.layoutVertexBuffer,d.indexBuffer,o,c.paint,f.transform.zoom,d.programConfigurations.get(c.id),P)}function Sf(d,o,c,f,_,x,T){const S=d.context.gl,C=c.paint.get("fill-pattern"),z=C&&C.constantOr(1);let P,O,j,W,H;T?(O=z&&!c.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",P=S.LINES):(O=z?"fillPattern":"fill",P=S.TRIANGLES);for(const Z of f){const X=o.getTile(Z);if(z&&!X.patternsLoaded())continue;const B=X.getBucket(c);if(!B)continue;d.prepareDrawTile();const q=B.programConfigurations.get(c.id),Q=d.useProgram(O,q);z&&(d.context.activeTexture.set(S.TEXTURE0),X.imageAtlasTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),q.updatePaintBuffers());const ee=C.constantOr(null);if(ee&&X.imageAtlas){const fe=X.imageAtlas.patternPositions[ee.toString()];fe&&q.setConstantPatternPositions(fe)}const de=d.translatePosMatrix(Z.projMatrix,X,c.paint.get("fill-translate"),c.paint.get("fill-translate-anchor"));if(T){W=B.indexBuffer2,H=B.segments2;const fe=d.terrain&&d.terrain.renderingToTexture?d.terrain.drapeBufferSize:[S.drawingBufferWidth,S.drawingBufferHeight];j=O==="fillOutlinePattern"&&z?H_(de,d,X,fe):Z_(de,fe)}else W=B.indexBuffer,H=B.segments,j=z?$h(de,d,X):Ls(de);d.prepareDrawProgram(d.context,Q,Z.toUnwrapped()),Q.draw(d.context,P,_,d.stencilModeForClipping(Z),x,s.CullFaceMode.disabled,j,c.id,B.layoutVertexBuffer,W,H,c.paint,d.transform.zoom,q)}}function jc(d,o,c,f,_,x,T){const S=d.context,C=S.gl,z=d.transform,P=c.paint.get("fill-extrusion-pattern"),O=P.constantOr(1),j=c.paint.get("fill-extrusion-opacity"),W=[c.paint.get("fill-extrusion-ambient-occlusion-intensity"),c.paint.get("fill-extrusion-ambient-occlusion-radius")],H=c.layout.get("fill-extrusion-edge-radius"),Z=H>0&&!c.paint.get("fill-extrusion-rounded-roof"),X=Z?0:H,B=z.projection.name==="globe"?s.fillExtrusionHeightLift():0,q=z.projection.name==="globe",Q=q?s.globeToMercatorTransition(z.zoom):0,ee=[s.mercatorXfromLng(z.center.lng),s.mercatorYfromLat(z.center.lat)],de=[];q&&de.push("PROJECTION_GLOBE_VIEW"),W[0]>0&&de.push("FAUX_AO"),Z&&de.push("ZERO_ROOF_RADIUS");for(const fe of f){const pe=o.getTile(fe),xe=pe.getBucket(c);if(!xe||xe.projection.name!==z.projection.name)continue;const ye=xe.programConfigurations.get(c.id),Ae=d.useProgram(O?"fillExtrusionPattern":"fillExtrusion",ye,de);if(d.terrain){const Be=d.terrain;if(d.style.terrainSetForDrapingOnly())Be.setupElevationDraw(pe,Ae,{useMeterToDem:!0});else{if(!xe.enableTerrain)continue;if(Be.setupElevationDraw(pe,Ae,{useMeterToDem:!0}),Af(S,o,fe,xe,c,Be),!xe.centroidVertexBuffer){const Xe=Ae.attributes.a_centroid_pos;Xe!==void 0&&C.vertexAttrib2f(Xe,0,0)}}}O&&(d.context.activeTexture.set(C.TEXTURE0),pe.imageAtlasTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),ye.updatePaintBuffers());const We=P.constantOr(null);if(We&&pe.imageAtlas){const Be=pe.imageAtlas.patternPositions[We.toString()];Be&&ye.setConstantPatternPositions(Be)}const Ee=d.translatePosMatrix(fe.projMatrix,pe,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),Fe=z.projection.createInversionMatrix(z,fe.canonical),ke=c.paint.get("fill-extrusion-vertical-gradient"),qe=O?vf(Ee,d,ke,j,W,X,fe,pe,B,Q,ee,Fe):Vh(Ee,d,ke,j,W,X,fe,B,Q,ee,Fe);d.prepareDrawProgram(S,Ae,fe.toUnwrapped());const Se=[];d.terrain&&Se.push(xe.centroidVertexBuffer),q&&Se.push(xe.layoutVertexExtBuffer),Ae.draw(S,S.gl.TRIANGLES,_,x,T,s.CullFaceMode.backCCW,qe,c.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,c.paint,d.transform.zoom,ye,Se)}}function Af(d,o,c,f,_,x){const T=[B=>{let q=B.canonical.x-1,Q=B.wrap;return q<0&&(q=(1<{let q=B.canonical.x+1,Q=B.wrap;return q===1<new s.OverscaledTileID(B.overscaledZ,B.wrap,B.canonical.z,B.canonical.x,(B.canonical.y===0?1<new s.OverscaledTileID(B.overscaledZ,B.wrap,B.canonical.z,B.canonical.x,B.canonical.y===(1<{const q=o.getSource().minzoom,Q=de=>{const fe=o.getTileByID(de);if(fe&&fe.hasData())return fe.getBucket(_)},ee=[0,-1,1];for(const de of ee){if(B.overscaledZ+de(C[0]=Math.min(B.min.y,q.min.y),C[1]=Math.max(B.max.y,q.max.y),C[2]=s.EXTENT-q.min.x>B.max.x?q.min.x-s.EXTENT:B.max.x,C),P=(B,q)=>(C[0]=Math.min(B.min.x,q.min.x),C[1]=Math.max(B.max.x,q.max.x),C[2]=s.EXTENT-q.min.y>B.max.y?q.min.y-s.EXTENT:B.max.y,C),O=[(B,q)=>z(B,q),(B,q)=>z(q,B),(B,q)=>P(B,q),(B,q)=>P(q,B)],j=new s.Point(0,0);let W,H,Z;const X=(B,q,Q,ee,de)=>{const fe=[[ee?Q:B,ee?B:Q,0],[ee?Q:q,ee?q:Q,0]],pe=de<0?s.EXTENT+de:de,xe=[ee?pe:(B+q)/2,ee?(B+q)/2:pe,0];return Q===0&&de<0||Q!==0&&de>0?x.getForTilePoints(Z,[xe],!0,H):fe.push(xe),x.getForTilePoints(c,fe,!0,W),Math.max(fe[0][2],fe[1][2],xe[2])/x.exaggeration()};for(let B=0;B<4;B++){const q=(B<2?1:5)-B,Q=f.borders[B];if(Q.length===0)continue;const ee=Z=T[B](c),de=S(ee);if(!(de&&de instanceof s.FillExtrusionBucket&&de.enableTerrain)||f.borderDoneWithNeighborZ[B]===de.canonical.z&&de.borderDoneWithNeighborZ[q]===f.canonical.z||(H=x.findDEMTileFor(ee),!H||!H.dem))continue;if(!W){const ye=x.findDEMTileFor(c);if(!ye||!ye.dem)return;W=ye}const fe=de.borders[q];let pe=0;const xe=de.borderDoneWithNeighborZ[q]!==f.canonical.z;if(f.canonical.z===de.canonical.z){for(let ye=0;yeWe[0]+3));)xe&&de.encodeCentroid(void 0,Ee,!1),pe++;if(Ee&&peWe[1]-3)&&(ke++,++pe!==fe.length);)Ee=de.featuresOnBorder[fe[pe]];if(Ee=de.featuresOnBorder[fe[Fe]],Ae.intersectsCount()>1||Ee.intersectsCount()>1||ke!==1){ke!==1&&(pe=Fe),f.encodeCentroid(void 0,Ae,!1),xe&&de.encodeCentroid(void 0,Ee,!1);continue}const qe=O[B](Ae,Ee),Se=B%2?s.EXTENT-1:0;j.x=X(qe[0],Math.min(s.EXTENT-1,qe[1]),Se,B<2,qe[2]),j.y=0,f.encodeCentroid(j,Ae,!1),xe&&de.encodeCentroid(j,Ee,!1)}else f.encodeCentroid(void 0,Ae,!1)}f.borderDoneWithNeighborZ[B]=de.canonical.z,f.needsCentroidUpdate=!0,xe&&(de.borderDoneWithNeighborZ[q]=f.canonical.z,de.needsCentroidUpdate=!0)}else{for(const ye of Q)f.encodeCentroid(void 0,f.featuresOnBorder[ye],!1);if(xe){for(const ye of fe)de.encodeCentroid(void 0,de.featuresOnBorder[ye],!1);de.borderDoneWithNeighborZ[q]=f.canonical.z,de.needsCentroidUpdate=!0}f.borderDoneWithNeighborZ[B]=de.canonical.z,f.needsCentroidUpdate=!0}}(f.needsCentroidUpdate||!f.centroidVertexBuffer&&f.centroidVertexArray.length!==0)&&f.uploadCentroid(d)}const xa=new s.Color(1,0,0,1),Q_=new s.Color(0,1,0,1),ey=new s.Color(0,0,1,1),ty=new s.Color(1,0,1,1),ny=new s.Color(0,1,1,1);function ry(d,o,c){const f=d.context,_=d.transform,x=f.gl,T=_.projection.name==="globe",S=T?["PROJECTION_GLOBE_VIEW"]:null;let C=c.projMatrix;if(T&&s.globeToMercatorTransition(_.zoom)>0){const Ae=s.transitionTileAABBinECEF(c.canonical,_),We=s.globeDenormalizeECEF(Ae);C=s.multiply(new Float32Array(16),_.globeMatrix,We),s.multiply(C,_.projMatrix,C)}const z=d.useProgram("debug",null,S),P=o.getTileByID(c.key);d.terrain&&d.terrain.setupElevationDraw(P,z);const O=s.DepthMode.disabled,j=s.StencilMode.disabled,W=d.colorModeForRenderPass(),H="$debug";f.activeTexture.set(x.TEXTURE0),d.emptyTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),T?P._makeGlobeTileDebugBuffers(d.context,_):P._makeDebugTileBoundsBuffers(d.context,_.projection);const Z=P._tileDebugBuffer||d.debugBuffer,X=P._tileDebugIndexBuffer||d.debugIndexBuffer,B=P._tileDebugSegments||d.debugSegments;z.draw(f,x.LINE_STRIP,O,j,W,s.CullFaceMode.disabled,Bc(C,s.Color.red),H,Z,X,B,null,null,null,[P._globeTileDebugBorderBuffer]);const q=P.latestRawTileData,Q=Math.floor((q&&q.byteLength||0)/1024),ee=o.getTile(c).tileSize,de=512/Math.min(ee,512)*(c.overscaledZ/_.zoom)*.5;let fe=c.canonical.toString();c.overscaledZ!==c.canonical.z&&(fe+=` => ${c.overscaledZ}`),fe+=` ${Q}kb`,function(Ae,We){Ae.initDebugOverlayCanvas();const Ee=Ae.debugOverlayCanvas,Fe=Ae.context.gl,ke=Ae.debugOverlayCanvas.getContext("2d");ke.clearRect(0,0,Ee.width,Ee.height),ke.shadowColor="white",ke.shadowBlur=2,ke.lineWidth=1.5,ke.strokeStyle="white",ke.textBaseline="top",ke.font="bold 36px Open Sans, sans-serif",ke.fillText(We,5,5),ke.strokeText(We,5,5),Ae.debugOverlayTexture.update(Ee),Ae.debugOverlayTexture.bind(Fe.LINEAR,Fe.CLAMP_TO_EDGE)}(d,fe);const pe=P._tileDebugTextBuffer||d.debugBuffer,xe=P._tileDebugTextIndexBuffer||d.quadTriangleIndexBuffer,ye=P._tileDebugTextSegments||d.debugSegments;z.draw(f,x.TRIANGLES,O,j,s.ColorMode.alphaBlended,s.CullFaceMode.disabled,Bc(C,s.Color.transparent,de),H,pe,xe,ye,null,null,null,[P._globeTileDebugTextBuffer])}function Cf(d,o,c,f){wa(d,0,o+c/2,d.transform.width,c,f)}function Vc(d,o,c,f){wa(d,o-c/2,0,c,d.transform.height,f)}function wa(d,o,c,f,_,x){const T=d.context,S=T.gl;S.enable(S.SCISSOR_TEST),S.scissor(o*s.exported.devicePixelRatio,c*s.exported.devicePixelRatio,f*s.exported.devicePixelRatio,_*s.exported.devicePixelRatio),T.clear({color:x}),S.disable(S.SCISSOR_TEST)}const If=s.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:kf}=If;function Io(d,o,c,f){d.emplaceBack(o,c,f)}class $c{constructor(o){this.vertexArray=new s.StructArrayLayout3f12,this.indices=new s.StructArrayLayout3ui6,Io(this.vertexArray,-1,-1,1),Io(this.vertexArray,1,-1,1),Io(this.vertexArray,-1,1,1),Io(this.vertexArray,1,1,1),Io(this.vertexArray,-1,-1,-1),Io(this.vertexArray,1,-1,-1),Io(this.vertexArray,-1,1,-1),Io(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=o.createVertexBuffer(this.vertexArray,kf),this.indexBuffer=o.createIndexBuffer(this.indices),this.segment=s.SegmentVector.simpleSegment(0,0,36,12)}}function _i(d,o,c,f,_,x){const T=d.gl,S=o.paint.get("sky-atmosphere-color"),C=o.paint.get("sky-atmosphere-halo-color"),z=o.paint.get("sky-atmosphere-sun-intensity"),P=((O,j,W,H,Z)=>({u_matrix_3f:O,u_sun_direction:j,u_sun_intensity:W,u_color_tint_r:[H.r,H.g,H.b,H.a],u_color_tint_m:[Z.r,Z.g,Z.b,Z.a],u_luminance:5e-5}))(s.fromMat4(s.create$1(),f),_,z,S,C);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+x,o.skyboxTexture,0),c.draw(d,T.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.frontCW,P,"skyboxCapture",o.skyboxGeometry.vertexBuffer,o.skyboxGeometry.indexBuffer,o.skyboxGeometry.segment)}const Dl=s.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Mf{constructor(o){const c=new s.StructArrayLayout5f20;c.emplaceBack(-1,1,1,0,0),c.emplaceBack(1,1,1,1,0),c.emplaceBack(1,-1,1,1,1),c.emplaceBack(-1,-1,1,0,1);const f=new s.StructArrayLayout3ui6;f.emplaceBack(0,1,2),f.emplaceBack(2,3,0),this.vertexBuffer=o.createVertexBuffer(c,Dl.members),this.indexBuffer=o.createIndexBuffer(f),this.segments=s.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Rs={symbol:function(d,o,c,f,_){if(d.renderPass!=="translucent")return;const x=s.StencilMode.disabled,T=d.colorModeForRenderPass();c.layout.get("text-variable-anchor")&&function(S,C,z,P,O,j,W){const H=C.transform,Z=O==="map",X=j==="map";for(const B of S){const q=P.getTile(B),Q=q.getBucket(z);if(!Q||!Q.text||!Q.text.segments.get().length)continue;const ee=s.evaluateSizeForZoom(Q.textSizeData,H.zoom),de=Sn(B,Q.getProjection(),H),fe=H.calculatePixelsToTileUnitsMatrix(q),pe=Re(de,q.tileID.canonical,X,Z,H,Q.getProjection(),fe),xe=z.layout.get("icon-text-fit")!=="none"&&Q.hasIconData();if(ee){const ye=Math.pow(2,H.zoom-q.tileID.overscaledZ);J_(Q,Z,X,W,s.symbolSize,H,pe,B,ye,ee,xe)}}}(f,d,c,o,c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),_),c.paint.get("icon-opacity").constantOr(1)!==0&&Tf(d,o,c,f,!1,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),c.layout.get("icon-rotation-alignment"),c.layout.get("icon-pitch-alignment"),c.layout.get("icon-keep-upright"),x,T),c.paint.get("text-opacity").constantOr(1)!==0&&Tf(d,o,c,f,!0,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),c.layout.get("text-keep-upright"),x,T),o.map.showCollisionBoxes&&(Ll(d,o,c,f,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),!0),Ll(d,o,c,f,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),!1))},circle:function(d,o,c,f){if(d.renderPass!=="translucent")return;const _=c.paint.get("circle-opacity"),x=c.paint.get("circle-stroke-width"),T=c.paint.get("circle-stroke-opacity"),S=c.layout.get("circle-sort-key").constantOr(1)!==void 0;if(_.constantOr(1)===0&&(x.constantOr(1)===0||T.constantOr(1)===0))return;const C=d.context,z=C.gl,P=d.transform,O=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),j=s.StencilMode.disabled,W=d.colorModeForRenderPass(),H=P.projection.name==="globe",Z=[s.mercatorXfromLng(P.center.lng),s.mercatorYfromLat(P.center.lat)],X=[];for(let q=0;qq.sortKey-Q.sortKey);const B={useDepthForOcclusion:!H};for(const q of X){const{programConfiguration:Q,program:ee,layoutVertexBuffer:de,globeExtVertexBuffer:fe,indexBuffer:pe,uniformValues:xe,tile:ye}=q.state,Ae=q.segments;d.terrain&&d.terrain.setupElevationDraw(ye,ee,B),d.prepareDrawProgram(C,ee,ye.tileID.toUnwrapped()),ee.draw(C,z.TRIANGLES,O,j,W,s.CullFaceMode.disabled,xe,c.id,de,pe,Ae,c.paint,P.zoom,Q,[fe])}},heatmap:function(d,o,c,f){if(c.paint.get("heatmap-opacity")!==0)if(d.renderPass==="offscreen"){const _=d.context,x=_.gl,T=s.StencilMode.disabled,S=new s.ColorMode([x.ONE,x.ONE],s.Color.transparent,[!0,!0,!0,!0]);(function(W,H,Z,X){const B=W.gl,q=H.width*X,Q=H.height*X;W.activeTexture.set(B.TEXTURE1),W.viewport.set([0,0,q,Q]);let ee=Z.heatmapFbo;if(!ee||ee&&(ee.width!==q||ee.height!==Q)){ee&&ee.destroy();const de=B.createTexture();B.bindTexture(B.TEXTURE_2D,de),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.LINEAR),ee=Z.heatmapFbo=W.createFramebuffer(q,Q,!1),function(fe,pe,xe,ye,Ae,We){const Ee=fe.gl;Ee.texImage2D(Ee.TEXTURE_2D,0,fe.isWebGL2&&fe.extRenderToTextureHalfFloat?Ee.RGBA16F:Ee.RGBA,Ae,We,0,Ee.RGBA,fe.extRenderToTextureHalfFloat?fe.isWebGL2?Ee.HALF_FLOAT:fe.extTextureHalfFloat.HALF_FLOAT_OES:Ee.UNSIGNED_BYTE,null),ye.colorAttachment.set(xe)}(W,0,de,ee,q,Q)}else B.bindTexture(B.TEXTURE_2D,ee.colorAttachment.get()),W.bindFramebuffer.set(ee.framebuffer)})(_,d,c,d.transform.projection.name==="globe"?.5:.25),_.clear({color:s.Color.transparent});const C=d.transform,z=C.projection.name==="globe",P=z?["PROJECTION_GLOBE_VIEW"]:null,O=z?s.CullFaceMode.frontCCW:s.CullFaceMode.disabled,j=[s.mercatorXfromLng(C.center.lng),s.mercatorYfromLat(C.center.lat)];for(let W=0;W({u_image:0,u_color_ramp:1,u_opacity:O.paint.get("heatmap-opacity")}))(0,x),x.id,_.viewportBuffer,_.quadTriangleIndexBuffer,_.viewportSegments,x.paint,_.transform.zoom)}(d,c))},line:function(d,o,c,f){if(d.renderPass!=="translucent")return;const _=c.paint.get("line-opacity"),x=c.paint.get("line-width");if(_.constantOr(1)===0||x.constantOr(1)===0)return;const T=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),S=d.colorModeForRenderPass(),C=d.terrain&&d.terrain.renderingToTexture?1:s.exported.devicePixelRatio,z=c.paint.get("line-dasharray"),P=z.constantOr(1),O=c.layout.get("line-cap"),j=c.paint.get("line-pattern"),W=j.constantOr(1),H=c.paint.get("line-gradient"),Z=W?"linePattern":"line",X=d.context,B=X.gl,q=(ee=>{const de=[];zl(ee)&&de.push("RENDER_LINE_DASH"),ee.paint.get("line-gradient")&&de.push("RENDER_LINE_GRADIENT");const fe=ee.paint.get("line-trim-offset");fe[0]===0&&fe[1]===0||de.push("RENDER_LINE_TRIM_OFFSET");const pe=ee.paint.get("line-pattern").constantOr(1),xe=ee.paint.get("line-opacity").constantOr(1)!==1;return!pe&&xe&&de.push("RENDER_LINE_ALPHA_DISCARD"),de})(c);let Q=q.includes("RENDER_LINE_ALPHA_DISCARD");d.terrain&&d.terrain.clipOrMaskOverlapStencilType()&&(Q=!1);for(const ee of f){const de=o.getTile(ee);if(W&&!de.patternsLoaded())continue;const fe=de.getBucket(c);if(!fe)continue;d.prepareDrawTile();const pe=fe.programConfigurations.get(c.id),xe=d.useProgram(Z,pe,q),ye=j.constantOr(null);if(ye&&de.imageAtlas){const Be=de.imageAtlas.patternPositions[ye.toString()];Be&&pe.setConstantPatternPositions(Be)}const Ae=z.constantOr(null),We=O.constantOr(null);if(!W&&Ae&&We&&de.lineAtlas){const Be=de.lineAtlas.getDash(Ae,We);Be&&pe.setConstantPatternPositions(Be)}let[Ee,Fe]=c.paint.get("line-trim-offset");(We==="round"||We==="square")&&Ee!==Fe&&(Ee===0&&(Ee-=1),Fe===1&&(Fe+=1));const ke=d.terrain?ee.projMatrix:null,qe=W?Pl(d,de,c,ke,C):K_(d,de,c,ke,fe.lineClipsArray.length,C,[Ee,Fe]);if(H){const Be=fe.gradients[c.id];let Xe=Be.texture;if(c.gradientVersion!==Be.version){let $e=256;if(c.stepInterpolant){const Ye=o.getSource().maxzoom,gt=ee.canonical.z===Ye?Math.ceil(1<{xe.draw(X,B.TRIANGLES,T,Be,S,s.CullFaceMode.disabled,qe,c.id,fe.layoutVertexBuffer,fe.indexBuffer,fe.segments,c.paint,d.transform.zoom,pe,[fe.layoutVertexBuffer2])};if(Q){const Be=d.stencilModeForClipping(ee).ref;Be===0&&d.terrain&&X.clear({stencil:0});const Xe={func:B.EQUAL,mask:255};qe.u_alpha_discard_threshold=.8,Se(new s.StencilMode(Xe,Be,255,B.KEEP,B.KEEP,B.INVERT)),qe.u_alpha_discard_threshold=0,Se(new s.StencilMode(Xe,Be,255,B.KEEP,B.KEEP,B.KEEP))}else Se(d.stencilModeForClipping(ee))}Q&&(d.resetStencilClippingMasks(),d.terrain&&X.clear({stencil:0}))},fill:function(d,o,c,f){const _=c.paint.get("fill-color"),x=c.paint.get("fill-opacity");if(x.constantOr(1)===0)return;const T=d.colorModeForRenderPass(),S=c.paint.get("fill-pattern"),C=d.opaquePassEnabledForLayer()&&!S.constantOr(1)&&_.constantOr(s.Color.transparent).a===1&&x.constantOr(0)===1?"opaque":"translucent";if(d.renderPass===C){const z=d.depthModeForSublayer(1,d.renderPass==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly);Sf(d,o,c,f,z,T,!1)}if(d.renderPass==="translucent"&&c.paint.get("fill-antialias")){const z=d.depthModeForSublayer(c.getPaintProperty("fill-outline-color")?2:0,s.DepthMode.ReadOnly);Sf(d,o,c,f,z,T,!0)}},"fill-extrusion":function(d,o,c,f){const _=c.paint.get("fill-extrusion-opacity");if(_!==0&&d.renderPass==="translucent"){const x=new s.DepthMode(d.context.gl.LEQUAL,s.DepthMode.ReadWrite,d.depthRangeFor3D);if(_!==1||c.paint.get("fill-extrusion-pattern").constantOr(1))jc(d,o,c,f,x,s.StencilMode.disabled,s.ColorMode.disabled),jc(d,o,c,f,x,d.stencilModeFor3D(),d.colorModeForRenderPass()),d.resetStencilClippingMasks();else{const T=d.colorModeForRenderPass();jc(d,o,c,f,x,s.StencilMode.disabled,T)}}},hillshade:function(d,o,c,f){if(d.renderPass!=="offscreen"&&d.renderPass!=="translucent")return;const _=d.context,x=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),T=d.colorModeForRenderPass(),S=d.terrain&&d.terrain.renderingToTexture,[C,z]=d.renderPass!=="translucent"||S?[{},f]:d.stencilConfigForOverlap(f);for(const P of z){const O=o.getTile(P);if(O.needsHillshadePrepare&&d.renderPass==="offscreen")gf(d,O,c,x,s.StencilMode.disabled,T);else if(d.renderPass==="translucent"){const j=S&&d.terrain?d.terrain.stencilModeForRTTOverlap(P):C[P.overscaledZ];mf(d,P,O,c,x,j,T)}}_.viewport.set([0,0,d.width,d.height]),d.resetStencilClippingMasks()},raster:function(d,o,c,f,_,x){if(d.renderPass!=="translucent"||c.paint.get("raster-opacity")===0||!f.length)return;const T=d.context,S=T.gl,C=o.getSource(),z=d.useProgram("raster"),P=d.colorModeForRenderPass(),O=d.terrain&&d.terrain.renderingToTexture,[j,W]=C instanceof Rt||O?[{},f]:d.stencilConfigForOverlap(f),H=W[W.length-1].overscaledZ,Z=!d.options.moving;for(const X of W){const B=O?s.DepthMode.disabled:d.depthModeForSublayer(X.overscaledZ-H,c.paint.get("raster-opacity")===1?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly,S.LESS),q=X.toUnwrapped(),Q=o.getTile(X);if(O&&(!Q||!Q.hasData()))continue;const ee=O?X.projMatrix:d.transform.calculateProjMatrix(q,Z),de=d.terrain&&O?d.terrain.stencilModeForRTTOverlap(X):j[X.overscaledZ],fe=x?0:c.paint.get("raster-fade-duration");Q.registerFadeDuration(fe);const pe=o.findLoadedParent(X,0),xe=Nh(Q,pe,o,d.transform,fe);let ye,Ae;d.terrain&&d.terrain.prepareDrawTile();const We=c.paint.get("raster-resampling")==="nearest"?S.NEAREST:S.LINEAR;T.activeTexture.set(S.TEXTURE0),Q.texture.bind(We,S.CLAMP_TO_EDGE),T.activeTexture.set(S.TEXTURE1),pe?(pe.texture.bind(We,S.CLAMP_TO_EDGE),ye=Math.pow(2,pe.tileID.overscaledZ-Q.tileID.overscaledZ),Ae=[Q.tileID.canonical.x*ye%1,Q.tileID.canonical.y*ye%1]):Q.texture.bind(We,S.CLAMP_TO_EDGE),Q.texture.useMipmap&&T.extTextureFilterAnisotropic&&d.transform.pitch>20&&S.texParameterf(S.TEXTURE_2D,T.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,T.extTextureFilterAnisotropicMax);const Ee=Hh(ee,Ae||[0,0],ye||1,xe,c,C instanceof Rt?C.perspectiveTransform:[0,0]);if(d.prepareDrawProgram(T,z,q),C instanceof Rt)C.boundsBuffer&&C.boundsSegments&&z.draw(T,S.TRIANGLES,B,s.StencilMode.disabled,P,s.CullFaceMode.disabled,Ee,c.id,C.boundsBuffer,d.quadTriangleIndexBuffer,C.boundsSegments);else{const{tileBoundsBuffer:Fe,tileBoundsIndexBuffer:ke,tileBoundsSegments:qe}=d.getTileBoundsBuffers(Q);z.draw(T,S.TRIANGLES,B,de,P,s.CullFaceMode.disabled,Ee,c.id,Fe,ke,qe)}}d.resetStencilClippingMasks()},background:function(d,o,c,f){const _=c.paint.get("background-color"),x=c.paint.get("background-opacity");if(x===0)return;const T=d.context,S=T.gl,C=d.transform,z=C.tileSize,P=c.paint.get("background-pattern");if(d.isPatternMissing(P))return;const O=!P&&_.a===1&&x===1&&d.opaquePassEnabledForLayer()?"opaque":"translucent";if(d.renderPass!==O)return;const j=s.StencilMode.disabled,W=d.depthModeForSublayer(0,O==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly),H=d.colorModeForRenderPass(),Z=d.useProgram(P?"backgroundPattern":"background");let X,B=f;B||(X=d.getBackgroundTiles(),B=Object.values(X).map(q=>q.tileID)),P&&(T.activeTexture.set(S.TEXTURE0),d.imageManager.bind(d.context));for(const q of B){const Q=q.toUnwrapped(),ee=f?q.projMatrix:d.transform.calculateProjMatrix(Q);d.prepareDrawTile();const de=o?o.getTile(q):X?X[q.key]:new s.Tile(q,z,C.zoom,d),fe=P?Y_(ee,x,d,P,{tileID:q,tileSize:z}):Kh(ee,x,_);d.prepareDrawProgram(T,Z,Q);const{tileBoundsBuffer:pe,tileBoundsIndexBuffer:xe,tileBoundsSegments:ye}=d.getTileBoundsBuffers(de);Z.draw(T,S.TRIANGLES,W,j,H,s.CullFaceMode.disabled,fe,c.id,pe,xe,ye)}},sky:function(d,o,c){const f=d.transform,_=f.projection.name==="mercator"||f.projection.name==="globe"?1:s.smoothstep(7,8,f.zoom),x=c.paint.get("sky-opacity")*_;if(x===0)return;const T=d.context,S=c.paint.get("sky-type"),C=new s.DepthMode(T.gl.LEQUAL,s.DepthMode.ReadOnly,[0,1]),z=d.frameCounter/1e3%1;S==="atmosphere"?d.renderPass==="offscreen"?c.needsSkyboxCapture(d)&&(function(P,O,j,W){const H=P.context,Z=H.gl;let X=O.skyboxFbo;if(!X){X=O.skyboxFbo=H.createFramebuffer(32,32,!1),O.skyboxGeometry=new $c(H),O.skyboxTexture=H.gl.createTexture(),Z.bindTexture(Z.TEXTURE_CUBE_MAP,O.skyboxTexture),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_WRAP_S,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_WRAP_T,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_MIN_FILTER,Z.LINEAR),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_MAG_FILTER,Z.LINEAR);for(let ee=0;ee<6;++ee)Z.texImage2D(Z.TEXTURE_CUBE_MAP_POSITIVE_X+ee,0,Z.RGBA,32,32,0,Z.RGBA,Z.UNSIGNED_BYTE,null)}H.bindFramebuffer.set(X.framebuffer),H.viewport.set([0,0,32,32]);const B=O.getCenter(P,!0),q=P.useProgram("skyboxCapture"),Q=new Float64Array(16);s.identity(Q),s.rotateY(Q,Q,.5*-Math.PI),_i(H,O,q,Q,B,0),s.identity(Q),s.rotateY(Q,Q,.5*Math.PI),_i(H,O,q,Q,B,1),s.identity(Q),s.rotateX(Q,Q,.5*-Math.PI),_i(H,O,q,Q,B,2),s.identity(Q),s.rotateX(Q,Q,.5*Math.PI),_i(H,O,q,Q,B,3),s.identity(Q),_i(H,O,q,Q,B,4),s.identity(Q),s.rotateY(Q,Q,Math.PI),_i(H,O,q,Q,B,5),H.viewport.set([0,0,P.width,P.height])}(d,c),c.markSkyboxValid(d)):d.renderPass==="sky"&&function(P,O,j,W,H){const Z=P.context,X=Z.gl,B=P.transform,q=P.useProgram("skybox");Z.activeTexture.set(X.TEXTURE0),X.bindTexture(X.TEXTURE_CUBE_MAP,O.skyboxTexture);const Q=((ee,de,fe,pe,xe)=>({u_matrix:ee,u_sun_direction:de,u_cubemap:0,u_opacity:pe,u_temporal_offset:xe}))(B.skyboxMatrix,O.getCenter(P,!1),0,W,H);P.prepareDrawProgram(Z,q),q.draw(Z,X.TRIANGLES,j,s.StencilMode.disabled,P.colorModeForRenderPass(),s.CullFaceMode.backCW,Q,"skybox",O.skyboxGeometry.vertexBuffer,O.skyboxGeometry.indexBuffer,O.skyboxGeometry.segment)}(d,c,C,x,z):S==="gradient"&&d.renderPass==="sky"&&function(P,O,j,W,H){const Z=P.context,X=Z.gl,B=P.transform,q=P.useProgram("skyboxGradient");O.skyboxGeometry||(O.skyboxGeometry=new $c(Z)),Z.activeTexture.set(X.TEXTURE0);let Q=O.colorRampTexture;Q||(Q=O.colorRampTexture=new s.Texture(Z,O.colorRamp,X.RGBA)),Q.bind(X.LINEAR,X.CLAMP_TO_EDGE);const ee=((de,fe,pe,xe,ye)=>({u_matrix:de,u_color_ramp:0,u_center_direction:fe,u_radius:s.degToRad(pe),u_opacity:xe,u_temporal_offset:ye}))(B.skyboxMatrix,O.getCenter(P,!1),O.paint.get("sky-gradient-radius"),W,H);P.prepareDrawProgram(Z,q),q.draw(Z,X.TRIANGLES,j,s.StencilMode.disabled,P.colorModeForRenderPass(),s.CullFaceMode.backCW,ee,"skyboxGradient",O.skyboxGeometry.vertexBuffer,O.skyboxGeometry.indexBuffer,O.skyboxGeometry.segment)}(d,c,C,x,z)},debug:function(d,o,c){for(let f=0;f_)return void(this.transform.fogCullDistSq=null);const x=f+.78*(_-f);this.transform.fogCullDistSq=x*x}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(o,c){if(this.width=o*s.exported.devicePixelRatio,this.height=c*s.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const f of this.style.order)this.style._layers[f].resize()}setup(){const o=this.context,c=new s.StructArrayLayout2i4;c.emplaceBack(0,0),c.emplaceBack(s.EXTENT,0),c.emplaceBack(0,s.EXTENT),c.emplaceBack(s.EXTENT,s.EXTENT),this.tileExtentBuffer=o.createVertexBuffer(c,s.posAttributes.members),this.tileExtentSegments=s.SegmentVector.simpleSegment(0,0,4,2);const f=new s.StructArrayLayout2i4;f.emplaceBack(0,0),f.emplaceBack(s.EXTENT,0),f.emplaceBack(0,s.EXTENT),f.emplaceBack(s.EXTENT,s.EXTENT),this.debugBuffer=o.createVertexBuffer(f,s.posAttributes.members),this.debugSegments=s.SegmentVector.simpleSegment(0,0,4,5);const _=new s.StructArrayLayout2i4;_.emplaceBack(-1,-1),_.emplaceBack(1,-1),_.emplaceBack(-1,1),_.emplaceBack(1,1),this.viewportBuffer=o.createVertexBuffer(_,s.posAttributes.members),this.viewportSegments=s.SegmentVector.simpleSegment(0,0,4,2);const x=new s.StructArrayLayout4i8;x.emplaceBack(0,0,0,0),x.emplaceBack(s.EXTENT,0,s.EXTENT,0),x.emplaceBack(0,s.EXTENT,0,s.EXTENT),x.emplaceBack(s.EXTENT,s.EXTENT,s.EXTENT,s.EXTENT),this.mercatorBoundsBuffer=o.createVertexBuffer(x,s.boundsAttributes.members),this.mercatorBoundsSegments=s.SegmentVector.simpleSegment(0,0,4,2);const T=new s.StructArrayLayout3ui6;T.emplaceBack(0,1,2),T.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(T);const S=new s.StructArrayLayout1ui2;for(const z of[0,1,3,2,0])S.emplaceBack(z);this.debugIndexBuffer=o.createIndexBuffer(S),this.emptyTexture=new s.Texture(o,new s.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),o.gl.RGBA),this.identityMat=s.create();const C=this.context.gl;this.stencilClearMode=new s.StencilMode({func:C.ALWAYS,mask:0},0,255,C.ZERO,C.ZERO,C.ZERO),this.loadTimeStamps.push(s.window.performance.now()),this.atmosphereBuffer=new Mf(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(o){return o._makeTileBoundsBuffers(this.context,this.transform.projection),o._tileBoundsBuffer?{tileBoundsBuffer:o._tileBoundsBuffer,tileBoundsIndexBuffer:o._tileBoundsIndexBuffer,tileBoundsSegments:o._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const o=this.context,c=o.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(o,c.TRIANGLES,s.DepthMode.disabled,this.stencilClearMode,s.ColorMode.disabled,s.CullFaceMode.disabled,kl(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(o,c,f){if(!c||this.currentStencilSource===c.id||!o.isTileClipped()||!f||f.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let S=!1;for(const C of f)if(this._tileClippingMaskIDs[C.key]===void 0){S=!0;break}if(!S)return}this.currentStencilSource=c.id;const _=this.context,x=_.gl;this.nextStencilID+f.length>256&&this.clearStencil(),_.setColorMode(s.ColorMode.disabled),_.setDepthMode(s.DepthMode.disabled);const T=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const S of f){const C=c.getTile(S),z=this._tileClippingMaskIDs[S.key]=this.nextStencilID++,{tileBoundsBuffer:P,tileBoundsIndexBuffer:O,tileBoundsSegments:j}=this.getTileBoundsBuffers(C);T.draw(_,x.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:x.ALWAYS,mask:0},z,255,x.KEEP,x.KEEP,x.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,kl(S.projMatrix),"$clipping",P,O,j)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const o=this.nextStencilID++,c=this.context.gl;return new s.StencilMode({func:c.NOTEQUAL,mask:255},o,255,c.KEEP,c.KEEP,c.REPLACE)}stencilModeForClipping(o){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(o);const c=this.context.gl;return new s.StencilMode({func:c.EQUAL,mask:255},this._tileClippingMaskIDs[o.key],0,c.KEEP,c.KEEP,c.REPLACE)}stencilConfigForOverlap(o){const c=this.context.gl,f=o.sort((T,S)=>S.overscaledZ-T.overscaledZ),_=f[f.length-1].overscaledZ,x=f[0].overscaledZ-_+1;if(x>1){this.currentStencilSource=void 0,this.nextStencilID+x>256&&this.clearStencil();const T={};for(let S=0;S=0;this.currentLayer--){const z=this.style._layers[f[this.currentLayer]],P=o._getLayerSourceCache(z);if(z.isSky())continue;const O=P?T[P.id]:void 0;this._renderTileClippingMasks(z,P,O),this.renderLayer(this,P,z,O)}if(this.style.fog&&this.transform.projection.supportsFog&&function(z,P){const O=z.context,j=O.gl,W=z.transform,H=new s.DepthMode(j.LEQUAL,s.DepthMode.ReadOnly,[0,1]),Z=z.useProgram("globeAtmosphere",null,W.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),X=s.globeToMercatorTransition(W.zoom),B=P.properties.get("color").toArray01(),q=P.properties.get("high-color").toArray01(),Q=P.properties.get("space-color").toArray01PremultipliedAlpha(),ee=s.identity$1([]);s.rotateY$1(ee,ee,-s.degToRad(W._center.lng)),s.rotateX$1(ee,ee,s.degToRad(W._center.lat)),s.rotateZ$1(ee,ee,W.angle),s.rotateX$1(ee,ee,-W._pitch);const de=s.fromQuat(new Float32Array(16),ee),fe=s.mapValue(P.properties.get("star-intensity"),0,1,0,.25),pe=5e-4,xe=s.mapValue(P.properties.get("horizon-blend"),0,1,pe,.25),ye=s.globeUseCustomAntiAliasing(z,O,W)&&xe===pe?W.worldSize/(2*Math.PI*1.025)-1:W.globeRadius,Ae=z.frameCounter/1e3%1,We=s.length(W.globeCenterInViewSpace),Ee=Math.sqrt(Math.pow(We,2)-Math.pow(ye,2)),Fe=Math.acos(Ee/We),ke=((Se,Be,Xe,$e,Ye,gt,Et,pt,wt,Ut,Ot,mt,en,rn)=>({u_frustum_tl:Se,u_frustum_tr:Be,u_frustum_br:Xe,u_frustum_bl:$e,u_horizon:Ye,u_transition:gt,u_fadeout_range:Et,u_color:pt,u_high_color:wt,u_space_color:Ut,u_star_intensity:Ot,u_star_size:5*s.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:mt,u_horizon_angle:en,u_rotation_matrix:rn}))(W.frustumCorners.TL,W.frustumCorners.TR,W.frustumCorners.BR,W.frustumCorners.BL,W.frustumCorners.horizon,X,xe,B,q,Q,fe,Ae,Fe,de);z.prepareDrawProgram(O,Z);const qe=z.atmosphereBuffer;qe&&Z.draw(O,j.TRIANGLES,H,s.StencilMode.disabled,s.ColorMode.alphaBlended,s.CullFaceMode.backCW,ke,"skybox",qe.vertexBuffer,qe.indexBuffer,qe.segments)}(this,this.style.fog),this.renderPass="sky",(s.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const O=o._getLayerSourceCache(P);O&&!P.isHidden(this.transform.zoom)&&(!z||z.getSource().maxzoom0?c.pop():null}isPatternMissing(o){return o===null||o!==void 0&&!this.imageManager.getPattern(o.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const o=this.terrain&&this.terrain.renderingToTexture,c=this.terrain&&this.terrain.exaggeration()===0,f=this.style&&this.style.fog,_=[];return this.terrainRenderModeElevated()&&_.push("TERRAIN"),this.transform.projection.name==="globe"&&_.push("GLOBE"),c&&_.push("ZERO_EXAGGERATION"),f&&!o&&f.getOpacity(this.transform.pitch)!==0&&_.push("FOG"),o&&_.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&_.push("OVERDRAW_INSPECTOR"),_}useProgram(o,c,f){this.cache=this.cache||{};const _=f||[],x=this.currentGlobalDefines().concat(_),T=Wt.cacheKey(Dh[o],o,x,c);return this.cache[T]||(this.cache[T]=new Wt(this.context,o,Dh[o],c,Yh[o],x)),this.cache[T]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const o=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(o.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=s.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(o,c,f){if(this.terrain&&this.terrain.renderingToTexture)return;const _=this.style.fog;if(_){const x=_.getOpacity(this.transform.pitch),T=((S,C,z,P,O,j,W,H,Z,X,B)=>{const q=S.transform,Q=C.properties.get("color").toArray01();Q[3]=P;const ee=S.frameCounter/1e3%1;return{u_fog_matrix:z?q.calculateFogTileMatrix(z):S.identityMat,u_fog_range:C.getFovAdjustedRange(q._fov),u_fog_color:Q,u_fog_horizon_blend:C.properties.get("horizon-blend"),u_fog_temporal_offset:ee,u_frustum_tl:O,u_frustum_tr:j,u_frustum_br:W,u_frustum_bl:H,u_globe_pos:Z,u_globe_radius:X,u_viewport:B,u_globe_transition:s.globeToMercatorTransition(q.zoom),u_is_globe:+(q.projection.name==="globe")}})(this,_,f,x,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.exported.devicePixelRatio,this.transform.height*s.exported.devicePixelRatio]);c.setFogUniformValues(o,T)}}setTileLoadedFlag(o){this.tileLoaded=o}saveCanvasCopy(){const o=this.canvasCopy();o&&(this.frameCopies.push(o),this.tileLoaded=!1)}canvasCopy(){const o=this.context.gl,c=o.createTexture();return o.bindTexture(o.TEXTURE_2D,c),o.copyTexImage2D(o.TEXTURE_2D,0,o.RGBA,0,0,o.drawingBufferWidth,o.drawingBufferHeight,0),c}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const o=this.style&&this.style.fog;return!!o&&o.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const o=this._backgroundTiles,c=this._backgroundTiles={},f=this.transform.coveringTiles({tileSize:512});for(const _ of f)c[_.key]=o[_.key]||new s.Tile(_,512,this.transform.tileZoom,this);return c}clearBackgroundTiles(){this._backgroundTiles={}}}class Gc{constructor(o=0,c=0,f=0,_=0){if(isNaN(o)||o<0||isNaN(c)||c<0||isNaN(f)||f<0||isNaN(_)||_<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=o,this.bottom=c,this.left=f,this.right=_}interpolate(o,c,f){return c.top!=null&&o.top!=null&&(this.top=s.number(o.top,c.top,f)),c.bottom!=null&&o.bottom!=null&&(this.bottom=s.number(o.bottom,c.bottom,f)),c.left!=null&&o.left!=null&&(this.left=s.number(o.left,c.left,f)),c.right!=null&&o.right!=null&&(this.right=s.number(o.right,c.right,f)),this}getCenter(o,c){const f=s.clamp((this.left+o-this.right)/2,0,o),_=s.clamp((this.top+c-this.bottom)/2,0,c);return new s.Point(f,_)}equals(o){return this.top===o.top&&this.bottom===o.bottom&&this.left===o.left&&this.right===o.right}clone(){return new Gc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function qc(d,o){const c=s.getColumn(d,3);s.fromQuat(d,o),s.setColumn(d,3,c)}function Zt(d,o){const c=s.identity$1([]);return s.rotateZ$1(c,c,-o),s.rotateX$1(c,c,-d),c}function Ol(d,o){const c=[d[0],d[1],0],f=[o[0],o[1],0];if(s.length(c)>=1e-15){const T=s.normalize([],c);s.scale$2(f,T,s.dot(f,T)),o[0]=f[0],o[1]=f[1]}const _=s.cross([],o,d);if(s.len(_)<1e-15)return null;const x=Math.atan2(-_[1],_[0]);return Zt(Math.atan2(Math.sqrt(d[0]*d[0]+d[1]*d[1]),-d[2]),x)}class Pf{constructor(o,c){this.position=o,this.orientation=c}get position(){return this._position}set position(o){if(o){const c=o instanceof s.MercatorCoordinate?o:new s.MercatorCoordinate(o[0],o[1],o[2]);this._renderWorldCopies&&(c.x=s.wrap(c.x,0,1)),this._position=c}else this._position=null}lookAtPoint(o,c){if(this.orientation=null,!this.position)return;const f=this.position,_=this._elevation?this._elevation.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(o)):0,x=s.MercatorCoordinate.fromLngLat(o,_),T=[x.x-f.x,x.y-f.y,x.z-f.z];c||(c=[0,0,1]),c[2]=Math.abs(c[2]),this.orientation=Ol(T,c)}setPitchBearing(o,c){this.orientation=Zt(s.degToRad(o),s.degToRad(-c))}}class Wc{constructor(o,c){this._transform=s.identity([]),this.orientation=c,this.position=o}get mercatorPosition(){const o=this.position;return new s.MercatorCoordinate(o[0],o[1],o[2])}get position(){const o=s.getColumn(this._transform,3);return[o[0],o[1],o[2]]}set position(o){var c;o&&s.setColumn(this._transform,3,[(c=o)[0],c[1],c[2],1])}get orientation(){return this._orientation}set orientation(o){this._orientation=o||s.identity$1([]),o&&qc(this._transform,this._orientation)}getPitchBearing(){const o=this.forward(),c=this.right();return{bearing:Math.atan2(-c[1],c[0]),pitch:Math.atan2(Math.sqrt(o[0]*o[0]+o[1]*o[1]),-o[2])}}setPitchBearing(o,c){this._orientation=Zt(o,c),qc(this._transform,this._orientation)}forward(){const o=s.getColumn(this._transform,2);return[-o[0],-o[1],-o[2]]}up(){const o=s.getColumn(this._transform,1);return[-o[0],-o[1],-o[2]]}right(){const o=s.getColumn(this._transform,0);return[o[0],o[1],o[2]]}getCameraToWorld(o,c){const f=new Float64Array(16);return s.invert(f,this.getWorldToCamera(o,c)),f}getWorldToCameraPosition(o,c,f){const _=this.position;s.scale$2(_,_,-o);const x=new Float64Array(16);return s.fromScaling(x,[f,f,f]),s.translate(x,x,_),x[10]*=c,x}getWorldToCamera(o,c){const f=new Float64Array(16),_=new Float64Array(4),x=this.position;return s.conjugate(_,this._orientation),s.scale$2(x,x,-o),s.fromQuat(f,_),s.translate(f,f,x),f[1]*=-1,f[5]*=-1,f[9]*=-1,f[13]*=-1,f[8]*=c,f[9]*=c,f[10]*=c,f[11]*=c,f}getCameraToClipPerspective(o,c,f,_){const x=new Float64Array(16);return s.perspective(x,o,c,f,_),x}getDistanceToElevation(o,c=!1){const f=o===0?0:s.mercatorZfromAltitude(o,c?s.latFromMercatorY(this.position[1]):this.position[1]),_=this.forward();return(f-this.position[2])/_[2]}clone(){return new Wc([...this.position],[...this.orientation])}}function Ea(d,o){const c=Zc(d.projection,d.zoom,d.width,d.height),f=function(x,T,S,C,z){const P=new s.LngLat(S.lng-180*ko,S.lat),O=new s.LngLat(S.lng+180*ko,S.lat),j=x.project(P.lng,P.lat),W=x.project(O.lng,O.lat),H=-Math.atan2(W.y-j.y,W.x-j.x),Z=s.MercatorCoordinate.fromLngLat(S);Z.y=s.clamp(Z.y,-1+ko,1-ko);const X=Z.toLngLat(),B=x.project(X.lng,X.lat),q=s.MercatorCoordinate.fromLngLat(X);q.x+=ko;const Q=q.toLngLat(),ee=x.project(Q.lng,Q.lat),de=Hc(ee.x-B.x,ee.y-B.y,H),fe=s.MercatorCoordinate.fromLngLat(X);fe.y+=ko;const pe=fe.toLngLat(),xe=x.project(pe.lng,pe.lat),ye=Hc(xe.x-B.x,xe.y-B.y,H),Ae=Math.abs(de.x)/Math.abs(ye.y),We=s.identity([]);s.rotateZ(We,We,-H*(1-(z?0:C)));const Ee=s.identity([]);return s.scale(Ee,Ee,[1,1-(1-Ae)*C,1]),Ee[4]=-ye.x/ye.y*C,s.rotateZ(Ee,Ee,H),s.multiply(Ee,We,Ee),Ee}(d.projection,0,d.center,c,o),_=zf(d);return s.scale(f,f,[_,_,1]),f}function zf(d){const o=d.projection,c=Zc(d.projection,d.zoom,d.width,d.height),f=Lf(o,d.center),_=Lf(o,s.LngLat.convert(o.center));return Math.pow(2,f*c+(1-c)*_)}function Zc(d,o,c,f,_=1/0){const x=d.range;if(!x)return 0;const T=Math.min(_,Math.max(c,f)),S=Math.log(T/1024)/Math.LN2;return s.smoothstep(x[0]+S,x[1]+S,o)}const ko=1/4e4;function Lf(d,o){const c=s.clamp(o.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),f=new s.LngLat(o.lng-180*ko,c),_=new s.LngLat(o.lng+180*ko,c),x=d.project(f.lng,c),T=d.project(_.lng,c),S=s.MercatorCoordinate.fromLngLat(f),C=s.MercatorCoordinate.fromLngLat(_),z=T.x-x.x,P=T.y-x.y,O=C.x-S.x,j=C.y-S.y,W=Math.sqrt((O*O+j*j)/(z*z+P*P));return Math.log(W)/Math.LN2}function Hc(d,o,c){const f=Math.cos(c),_=Math.sin(c);return{x:d*f-o*_,y:d*_+o*f}}class Ta{constructor(o,c,f,_,x,T,S){this.tileSize=512,this._renderWorldCopies=x===void 0||x,this._minZoom=o||0,this._maxZoom=c||22,this._minPitch=f??0,this._maxPitch=_??60,this.setProjection(T),this.setMaxBounds(S),this.width=0,this.height=0,this._center=new s.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Gc,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Wc,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const o=new Ta(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return o._elevation=this._elevation,o._centerAltitude=this._centerAltitude,o._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,o.tileSize=this.tileSize,o.mercatorFromTransition=this.mercatorFromTransition,o.width=this.width,o.height=this.height,o.cameraElevationReference=this.cameraElevationReference,o._center=this._center,o._setZoom(this.zoom),o._seaLevelZoom=this._seaLevelZoom,o.angle=this.angle,o._fov=this._fov,o._pitch=this._pitch,o._nearZ=this._nearZ,o._farZ=this._farZ,o._averageElevation=this._averageElevation,o._unmodified=this._unmodified,o._edgeInsets=this._edgeInsets.clone(),o._camera=this._camera.clone(),o._calcMatrices(),o.freezeTileCoverage=this.freezeTileCoverage,o.frustumCorners=this.frustumCorners,o}get elevation(){return this._elevation}set elevation(o){this._elevation!==o&&(this._elevation=o,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(o,c=!1){const f=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||f)&&this._updateCameraOnTerrain(),(o||f)&&this._constrainCamera(c),this._calcMatrices()}getProjection(){return s.pick(this.projection,["name","center","parallels"])}setProjection(o){this.projectionOptions=o||{name:"mercator"};const c=this.projection?this.getProjection():void 0;this.projection=s.getProjection(this.projectionOptions);const f=!k(c,this.getProjection());return f&&this._calcMatrices(),this.mercatorFromTransition=!1,f}setMercatorFromTransition(){const o=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=s.getProjection({name:"mercator"});const c=o!==this.projection.name;return c&&this._calcMatrices(),c}get minZoom(){return this._minZoom}set minZoom(o){this._minZoom!==o&&(this._minZoom=o,this.zoom=Math.max(this.zoom,o))}get maxZoom(){return this._maxZoom}set maxZoom(o){this._maxZoom!==o&&(this._maxZoom=o,this.zoom=Math.min(this.zoom,o))}get minPitch(){return this._minPitch}set minPitch(o){this._minPitch!==o&&(this._minPitch=o,this.pitch=Math.max(this.pitch,o))}get maxPitch(){return this._maxPitch}set maxPitch(o){this._maxPitch!==o&&(this._maxPitch=o,this.pitch=Math.min(this.pitch,o))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(o){o===void 0?o=!0:o===null&&(o=!1),this._renderWorldCopies=o}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get cameraWorldSize(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return s.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.Point(this.width,this.height)}get bearing(){return s.wrap(this.rotation,-180,180)}set bearing(o){this.rotation=o}get rotation(){return-this.angle/Math.PI*180}set rotation(o){const c=-o*Math.PI/180;var f;this.angle!==c&&(this._unmodified=!1,this.angle=c,this._calcMatrices(),this.rotationMatrix=(f=new s.ARRAY_TYPE(4),s.ARRAY_TYPE!=Float32Array&&(f[1]=0,f[2]=0),f[0]=1,f[3]=1,f),function(_,x,T){var S=x[0],C=x[1],z=x[2],P=x[3],O=Math.sin(T),j=Math.cos(T);_[0]=S*j+z*O,_[1]=C*j+P*O,_[2]=S*-O+z*j,_[3]=C*-O+P*j}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(o){const c=s.clamp(o,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==c&&(this._unmodified=!1,this._pitch=c,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const o=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/o)}set fov(o){o=Math.max(.01,Math.min(60,o)),this._fov!==o&&(this._unmodified=!1,this._fov=s.degToRad(o),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(o){this._averageElevation=o,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(o){const c=Math.min(Math.max(o,this.minZoom),this.maxZoom);this._zoom!==c&&(this._unmodified=!1,this._setZoom(c),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(o){this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const o=this._elevation;this._centerAltitude=o.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=o.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const o=this._elevation,c=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],f=this.horizonLineFromTop();let _=0,x=0;for(let T=0;To.maxzoom&&(c=o.maxzoom);const T=this.locationCoordinate(this.center),S=this.center.lat,C=1<{const Xe=new s.MercatorCoordinate(Se.x+25e-6,Se.y,Se.z),$e=new s.MercatorCoordinate(Se.x,Se.y+25e-6,Se.z),Ye=Se.toLngLat(),gt=Xe.toLngLat(),Et=$e.toLngLat(),pt=this.locationCoordinate(Ye),wt=this.locationCoordinate(gt),Ut=this.locationCoordinate(Et),Ot=Math.hypot(wt.x-pt.x,wt.y-pt.y),mt=Math.hypot(Ut.x-pt.x,Ut.y-pt.y);return Math.sqrt(Ot*mt)*de/25e-6},pe=Se=>{const Be=Q,Xe=ee;return{aabb:s.tileAABB(this,C,0,0,0,Se,Xe,Be,this.projection),zoom:0,x:0,y:0,minZ:Xe,maxZ:Be,wrap:Se,fullyVisible:!1}},xe=[];let ye=[];const Ae=c,We=o.reparseOverscaled?f:c,Ee=Se=>Se*Se,Fe=Ee((Z-this._centerAltitude)*H),ke=Se=>{if(!this._elevation||!Se.tileID||!x)return;const Be=this._elevation.getMinMaxForTile(Se.tileID),Xe=Se.aabb;Be?(Xe.min[2]=Be.min,Xe.max[2]=Be.max,Xe.center[2]=(Xe.min[2]+Xe.max[2])/2):(Se.shouldSplit=qe(Se),Se.shouldSplit||(Xe.min[2]=Xe.max[2]=Xe.center[2]=this._centerAltitude))},qe=Se=>{if(Se.zoom=.9)return!0}else if(_&&($e=Ee(Se.aabb.distanceZ(X)*H)),this.projection.isReprojectedInTileSpace&&f<=5){const pt=Math.pow(2,Se.zoom),wt=fe(new s.MercatorCoordinate((Se.x+.5)/pt,(Se.y+.5)/pt));Ye=wt>.85?1:wt}const gt=Be*Be+Xe*Xe+$e,Et=Ee((1<{if(wt*Ee(.707)0;){const Se=xe.pop(),Be=Se.x,Xe=Se.y;let $e=Se.fullyVisible;if(!$e){const Ye=Se.aabb.intersects(j);if(Ye===0)continue;$e=Ye===2}if(Se.zoom!==Ae&&qe(Se))for(let Ye=0;Ye<4;Ye++){const gt=(Be<<1)+Ye%2,Et=(Xe<<1)+(Ye>>1),pt={aabb:x?Se.aabb.quadrant(Ye):s.tileAABB(this,C,Se.zoom+1,gt,Et,Se.wrap,Se.minZ,Se.maxZ,this.projection),zoom:Se.zoom+1,x:gt,y:Et,wrap:Se.wrap,fullyVisible:$e,tileID:void 0,shouldSplit:void 0,minZ:Se.minZ,maxZ:Se.maxZ};_&&!P&&(pt.tileID=new s.OverscaledTileID(Se.zoom+1===Ae?We:Se.zoom+1,Se.wrap,Se.zoom+1,gt,Et),ke(pt)),xe.push(pt)}else{const Ye=Se.zoom===Ae?We:Se.zoom;if(o.minzoom&&o.minzoom>Ye)continue;const gt=z[0]-(.5+Be+(Se.wrap<{const $e=[0,0,0,1],Ye=[s.EXTENT,s.EXTENT,0,1],gt=this.calculateFogTileMatrix(Xe.tileID.toUnwrapped());s.transformMat4$1($e,$e,gt),s.transformMat4$1(Ye,Ye,gt);const Et=s.getAABBPointSquareDist($e,Ye);if(Et===0)return!0;let pt=!1;const wt=this._elevation;if(wt&&Et>Se&&Be!==0){const Ut=this.calculateProjMatrix(Xe.tileID.toUnwrapped());let Ot;o.isTerrainDEM||(Ot=wt.getMinMaxForTile(Xe.tileID)),Ot||(Ot={min:ee,max:Q});const mt=s.furthestTileCorner(this.rotation),en=[mt[0]*s.EXTENT,mt[1]*s.EXTENT,Ot.max];s.transformMat4(en,en,Ut),pt=(1-en[1])*this.height*.5Se.distanceSq-Be.distanceSq).map(Se=>Se.tileID)}resize(o,c){this.width=o,this.height=c,this.pixelsToGLUnits=[2/o,-2/c],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(o){return Math.pow(2,o)}scaleZoom(o){return Math.log(o)/Math.LN2}project(o){const c=s.clamp(o.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),f=this.projection.project(o.lng,c);return new s.Point(f.x*this.worldSize,f.y*this.worldSize)}unproject(o){return this.projection.unproject(o.x/this.worldSize,o.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(o,c){let f,_;const x=this.centerPoint;if(this.projection.name==="globe"){const S=this.worldSize;f=(c.x-x.x)/S,_=(c.y-x.y)/S}else{const S=this.pointCoordinate(c),C=this.pointCoordinate(x);f=S.x-C.x,_=S.y-C.y}const T=this.locationCoordinate(o);this.setLocation(new s.MercatorCoordinate(T.x-f,T.y-_))}setLocation(o){this.center=this.coordinateLocation(o),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(o){return this.projection.locationPoint(this,o)}locationPoint3D(o){return this.projection.locationPoint(this,o,!0)}pointLocation(o){return this.coordinateLocation(this.pointCoordinate(o))}pointLocation3D(o){return this.coordinateLocation(this.pointCoordinate3D(o))}locationCoordinate(o,c){const f=c?s.mercatorZfromAltitude(c,o.lat):void 0,_=this.projection.project(o.lng,o.lat);return new s.MercatorCoordinate(_.x,_.y,f)}coordinateLocation(o){return this.projection.unproject(o.x,o.y)}pointRayIntersection(o,c){const f=c??this._centerAltitude,_=[o.x,o.y,0,1],x=[o.x,o.y,1,1];s.transformMat4$1(_,_,this.pixelMatrixInverse),s.transformMat4$1(x,x,this.pixelMatrixInverse);const T=x[3];s.scale$1(_,_,1/_[3]),s.scale$1(x,x,1/T);const S=_[2],C=x[2];return{p0:_,p1:x,t:S===C?0:(f-S)/(C-S)}}screenPointToMercatorRay(o){const c=[o.x,o.y,0,1],f=[o.x,o.y,1,1];return s.transformMat4$1(c,c,this.pixelMatrixInverse),s.transformMat4$1(f,f,this.pixelMatrixInverse),s.scale$1(c,c,1/c[3]),s.scale$1(f,f,1/f[3]),c[2]=s.mercatorZfromAltitude(c[2],this._center.lat)*this.worldSize,f[2]=s.mercatorZfromAltitude(f[2],this._center.lat)*this.worldSize,s.scale$1(c,c,1/this.worldSize),s.scale$1(f,f,1/this.worldSize),new s.Ray([c[0],c[1],c[2]],s.normalize([],s.sub([],f,c)))}rayIntersectionCoordinate(o){const{p0:c,p1:f,t:_}=o,x=s.mercatorZfromAltitude(c[2],this._center.lat),T=s.mercatorZfromAltitude(f[2],this._center.lat);return new s.MercatorCoordinate(s.number(c[0],f[0],_)/this.worldSize,s.number(c[1],f[1],_)/this.worldSize,s.number(x,T,_))}pointCoordinate(o,c=this._centerAltitude){return this.projection.pointCoordinate(this,o.x,o.y,c)}pointCoordinate3D(o){if(!this.elevation)return this.pointCoordinate(o);let c=this.projection.pointCoordinate3D(this,o.x,o.y);if(c)return new s.MercatorCoordinate(c[0],c[1],c[2]);let f=0,_=this.horizonLineFromTop();if(o.y>_)return this.pointCoordinate(o);const x=.02*_,T=o.clone();for(let S=0;S<10&&_-f>x;S++){T.y=s.number(f,_,.66);const C=this.projection.pointCoordinate3D(this,T.x,T.y);C?(_=T.y,c=C):f=T.y}return c?new s.MercatorCoordinate(c[0],c[1],c[2]):this.pointCoordinate(o)}isPointAboveHorizon(o){return this.projection.isPointAboveHorizon(this,o)}isPointOnSurface(o){if(o.y<0||o.y>this.height||o.x<0||o.x>this.width)return!1;if(this.elevation||this.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(o);const c=this.pointCoordinate(o);return c.y>=0&&c.y<=1}_coordinatePoint(o,c){const f=c&&this.elevation?this.elevation.getAtPointOrZero(o,this._centerAltitude):this._centerAltitude,_=[o.x*this.worldSize,o.y*this.worldSize,f+o.toAltitude(),1];return s.transformMat4$1(_,_,this.pixelMatrix),_[3]>0?new s.Point(_[0]/_[3],_[1]/_[3]):new s.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:o,left:c}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,_=this.width-this._edgeInsets.right,x=this.pointLocation3D(new s.Point(c,o)),T=this.pointLocation3D(new s.Point(_,o)),S=this.pointLocation3D(new s.Point(_,f)),C=this.pointLocation3D(new s.Point(c,f));let z=Math.min(x.lng,T.lng,S.lng,C.lng),P=Math.max(x.lng,T.lng,S.lng,C.lng),O=Math.min(x.lat,T.lat,S.lat,C.lat),j=Math.max(x.lat,T.lat,S.lat,C.lat);const W=Math.pow(2,-this.zoom)/16*270,H=this.projection.name==="globe"?1:4,Z=(X,B,q,Q,ee)=>{const de=(X+q)/2,fe=(B+Q)/2,pe=new s.Point(de,fe),{lng:xe,lat:ye}=this.pointLocation3D(pe),Ae=Math.max(0,z-xe,O-ye,xe-P,ye-j);z=Math.min(z,xe),P=Math.max(P,xe),O=Math.min(O,ye),j=Math.max(j,ye),(eeW)&&(Z(X,B,de,fe,ee+1),Z(de,fe,q,Q,ee+1))};if(Z(c,o,_,o,1),Z(_,o,_,f,1),Z(_,f,c,f,1),Z(c,f,c,o,1),this.projection.name==="globe"){const[X,B]=s.polesInViewport(this);X?(j=90,P=180,z=-180):B&&(O=-90,P=180,z=-180)}return new s.LngLatBounds(new s.LngLat(z,O),new s.LngLat(P,j))}_getBoundsRectangular(o,c){const{top:f,left:_}=this._edgeInsets,x=this.height-this._edgeInsets.bottom,T=this.width-this._edgeInsets.right,S=new s.Point(_,f),C=new s.Point(T,f),z=new s.Point(T,x),P=new s.Point(_,x);let O=this.pointCoordinate(S,o),j=this.pointCoordinate(C,o);const W=this.pointCoordinate(z,c),H=this.pointCoordinate(P,c),Z=(X,B)=>(B.y-X.y)/(B.x-X.x);return O.y>1&&j.y>=0?O=new s.MercatorCoordinate((1-H.y)/Z(H,O)+H.x,1):O.y<0&&j.y<=1&&(O=new s.MercatorCoordinate(-H.y/Z(H,O)+H.x,0)),j.y>1&&O.y>=0?j=new s.MercatorCoordinate((1-W.y)/Z(W,j)+W.x,1):j.y<0&&O.y<=1&&(j=new s.MercatorCoordinate(-W.y/Z(W,j)+W.x,0)),new s.LngLatBounds().extend(this.coordinateLocation(O)).extend(this.coordinateLocation(j)).extend(this.coordinateLocation(H)).extend(this.coordinateLocation(W))}_getBoundsRectangularTerrain(){const o=this.elevation;if(!o.visibleDemTiles.length||o.isUsingMockSource())return this._getBoundsRectangular(0,0);const c=o.visibleDemTiles.reduce((f,_)=>{if(_.dem){const x=_.dem.tree;f.min=Math.min(f.min,x.minimums[0]),f.max=Math.max(f.max,x.maximums[0])}return f},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(c.min*o.exaggeration(),c.max*o.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(o=!0){const c=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,f=this.height/2-c*(1-this._horizonShift);return o?Math.max(0,f):f}getMaxBounds(){return this.maxBounds}setMaxBounds(o){this.maxBounds=o,this.minLat=-s.MAX_MERCATOR_LATITUDE,this.maxLat=s.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,o&&(this.minLat=o.getSouth(),this.maxLat=o.getNorth(),this.minLng=o.getWest(),this.maxLng=o.getEast(),this.maxLngO&&(S=O-z),O-PW&&(T=W-C),W-j.5?Q-1:Q,ee>.5?ee-1:ee,0]),this.alignedProjMatrix=de,S=s.create(),s.scale(S,S,[this.width/2,-this.height/2,1]),s.translate(S,S,[1,-1,0]),this.labelPlaneMatrix=S,S=s.create(),s.scale(S,S,[1,-1,1]),s.translate(S,S,[-1,-1,0]),s.scale(S,S,[2/this.width,2/this.height,1]),this.glCoordMatrix=S,this.pixelMatrix=s.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},S=s.invert(new Float64Array(16),this.pixelMatrix),!S)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=S,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=s.calculateGlobeMatrix(this);const fe=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.transformMat4(fe,fe,x),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=S;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const o=this.cameraWorldSizeForFog,c=this.cameraPixelsPerMeter,f=this._camera.position,_=1/this.height/this._pixelsPerMercatorPixel,x=[o,o,c];s.scale$2(x,x,_),s.scale$2(f,f,-1),s.multiply$2(f,f,x);const T=s.create();s.translate(T,T,f),s.scale(T,T,x),this.mercatorFogMatrix=T,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(o,c,_)}_computeCameraPosition(o){const c=(o=o||this.pixelsPerMeter)/this.pixelsPerMeter,f=this._camera.forward(),_=this.point,x=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*c-o/this.worldSize*this._centerAltitude;return[_.x/this.worldSize-f[0]*x,_.y/this.worldSize-f[1]*x,o/this.worldSize*this._centerAltitude-f[2]*x]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(o){const c=this._maxCameraBoundsDistance()*Math.cos(this._pitch),f=this._camera.position[2],_=o[2];let x=1;this.projection.wrap&&(this.center=this.center.wrap()),_>0&&(x=Math.min((c-f)/_,1)),this._camera.position=s.scaleAndAdd([],this._camera.position,o,x),this._updateStateFromCamera()}_updateStateFromCamera(){const o=this._camera.position,c=this._camera.forward(),{pitch:f,bearing:_}=this._camera.getPitchBearing(),x=s.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,T=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.degToRad(this._maxPitch)),S=Math.max((o[2]-x)/Math.cos(f),T),C=this._zoomFromMercatorZ(S);s.scaleAndAdd(o,o,c,S),this._pitch=s.clamp(f,s.degToRad(this.minPitch),s.degToRad(this.maxPitch)),this.angle=s.wrap(_,-Math.PI,Math.PI),this._setZoom(s.clamp(C,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.MercatorCoordinate(o[0],o[1],o[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(o){return Math.pow(2,o)*this.tileSize}_mercatorZfromZoom(o){return this.cameraToCenterDistance/this._worldSizeFromZoom(o)}_minimumHeightOverTerrain(){const o=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(o)}_zoomFromMercatorZ(o){return this.scaleZoom(this.cameraToCenterDistance/(o*this.tileSize))}zoomFromMercatorZAdjusted(o){let c=0,f=s.GLOBE_ZOOM_THRESHOLD_MAX,_=0,x=1/0;for(;f-c>1e-6&&f>c;){const T=c+.5*(f-c),S=this.tileSize*Math.pow(2,T),C=this.getCameraToCenterDistance(this.projection,T,S),z=this.scaleZoom(C/(o*this.tileSize)),P=Math.abs(T-z);Pz||j.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.Point(0,0),new s.Point(this.width,this.height))}zoomDeltaToMovement(o,c){const f=s.length(s.sub([],this._camera.position,o)),_=this._zoomFromMercatorZ(f)+c;return f-this._mercatorZfromZoom(_)}getCameraPoint(){if(this.projection.name==="globe"){const o=function([c,f,_],x){const T=[c,f,_,1];s.transformMat4$1(T,T,x);const S=T[3]=Math.max(T[3],1e-6);return T[0]/=S,T[1]/=S,T[2]/=S,T}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.Point(o[0],o[1])}{const o=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.Point(0,o))}}getCameraToCenterDistance(o,c=this.zoom,f=this.worldSize){const _=Zc(o,c,this.width,this.height,1024),x=o.pixelSpaceConversion(this.center.lat,f,_);return .5/Math.tan(.5*this._fov)*this.height*x}getWorldToCameraMatrix(){const o=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&s.multiply(o,o,this.globeMatrix),o}}function Sa(d,o){let c=!1,f=null;const _=()=>{f=null,c&&(d(),f=setTimeout(_,o),c=!1)};return()=>(c=!0,f||_(),f)}class ed{constructor(o){this._hashName=o&&encodeURIComponent(o),s.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Sa(this._updateHashUnthrottled.bind(this),300)}addTo(o){return this._map=o,s.window.addEventListener("hashchange",this._onHashChange,!1),o.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),s.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const o=this._map;if(!o)return"";const c=Bl(o);if(this._hashName){const f=this._hashName;let _=!1;const x=s.window.location.hash.slice(1).split("&").map(T=>{const S=T.split("=")[0];return S===f?(_=!0,`${S}=${c}`):T}).filter(T=>T);return _||x.push(`${f}=${c}`),`#${x.join("&")}`}return`#${c}`}_getCurrentHash(){const o=s.window.location.hash.replace("#","");if(this._hashName){let c;return o.split("&").map(f=>f.split("=")).forEach(f=>{f[0]===this._hashName&&(c=f)}),(c&&c[1]||"").split("/")}return o.split("/")}_onHashChange(){const o=this._map;if(!o)return!1;const c=this._getCurrentHash();if(c.length>=3&&!c.some(f=>isNaN(f))){const f=o.dragRotate.isEnabled()&&o.touchZoomRotate.isEnabled()?+(c[3]||0):o.getBearing();return o.jumpTo({center:[+c[2],+c[1]],zoom:+c[0],bearing:f,pitch:+(c[4]||0)}),!0}return!1}_updateHashUnthrottled(){const o=s.window.location.href.replace(/(#.+)?$/,this.getHashString());s.window.history.replaceState(s.window.history.state,null,o)}}function Bl(d,o){const c=d.getCenter(),f=Math.round(100*d.getZoom())/100,_=Math.ceil((f*Math.LN2+Math.log(512/360/.5))/Math.LN10),x=Math.pow(10,_),T=Math.round(c.lng*x)/x,S=Math.round(c.lat*x)/x,C=d.getBearing(),z=d.getPitch();let P=o?`/${T}/${S}/${f}`:`${f}/${S}/${T}`;return(C||z)&&(P+="/"+Math.round(10*C)/10),z&&(P+=`/${Math.round(z)}`),P}const Fl={linearity:.3,easing:s.bezier(0,0,.3,1)},Xc=s.extend({deceleration:2500,maxSpeed:1400},Fl),Kc=s.extend({deceleration:20,maxSpeed:1400},Fl),ct=s.extend({deceleration:1e3,maxSpeed:360},Fl),Di=s.extend({deceleration:1e3,maxSpeed:90},Fl);class Rf{constructor(o){this._map=o,this.clear()}clear(){this._inertiaBuffer=[]}record(o){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.exported.now(),settings:o})}_drainInertiaBuffer(){const o=this._inertiaBuffer,c=s.exported.now();for(;o.length>0&&c-o[0].time>160;)o.shift()}_onMoveEnd(o){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const c={zoom:0,bearing:0,pitch:0,pan:new s.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:x}of this._inertiaBuffer)c.zoom+=x.zoomDelta||0,c.bearing+=x.bearingDelta||0,c.pitch+=x.pitchDelta||0,x.panDelta&&c.pan._add(x.panDelta),x.around&&(c.around=x.around),x.pinchAround&&(c.pinchAround=x.pinchAround);const f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,_={};if(c.pan.mag()){const x=Ul(c.pan.mag(),f,s.extend({},Xc,o||{}));_.offset=c.pan.mult(x.amount/c.pan.mag()),_.center=this._map.transform.center,Nl(_,x)}if(c.zoom){const x=Ul(c.zoom,f,Kc);_.zoom=this._map.transform.zoom+x.amount,Nl(_,x)}if(c.bearing){const x=Ul(c.bearing,f,ct);_.bearing=this._map.transform.bearing+s.clamp(x.amount,-179,179),Nl(_,x)}if(c.pitch){const x=Ul(c.pitch,f,Di);_.pitch=this._map.transform.pitch+x.amount,Nl(_,x)}if(_.zoom||_.bearing){const x=c.pinchAround===void 0?c.around:c.pinchAround;_.around=x?this._map.unproject(x):this._map.getCenter()}return this.clear(),_.noMoveStart=!0,_}}function Nl(d,o){(!d.duration||d.durationc.unproject(C)),S=x.reduce((C,z,P,O)=>C.add(z.div(O.length)),new s.Point(0,0));super(o,{points:x,point:S,lngLats:T,lngLat:c.unproject(S),originalEvent:f}),this._defaultPrevented=!1}}class Yc extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,c,f){super(o,{originalEvent:f}),this._defaultPrevented=!1}}class td{constructor(o,c){this._map=o,this._clickTolerance=c.clickTolerance}reset(){this._mousedownPos=void 0}wheel(o){return this._firePreventable(new Yc(o.type,this._map,o))}mousedown(o,c){return this._mousedownPos=c,this._firePreventable(new pr(o.type,this._map,o))}mouseup(o){this._map.fire(new pr(o.type,this._map,o))}preclick(o){const c=s.extend({},o);c.type="preclick",this._map.fire(new pr(c.type,this._map,c))}click(o,c){this._mousedownPos&&this._mousedownPos.dist(c)>=this._clickTolerance||(this.preclick(o),this._map.fire(new pr(o.type,this._map,o)))}dblclick(o){return this._firePreventable(new pr(o.type,this._map,o))}mouseover(o){this._map.fire(new pr(o.type,this._map,o))}mouseout(o){this._map.fire(new pr(o.type,this._map,o))}touchstart(o){return this._firePreventable(new jl(o.type,this._map,o))}touchmove(o){this._map.fire(new jl(o.type,this._map,o))}touchend(o){this._map.fire(new jl(o.type,this._map,o))}touchcancel(o){this._map.fire(new jl(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Jc{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(o){this._map.fire(new pr(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new pr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._map.fire(new pr(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Df{constructor(o,c){this._map=o,this._el=o.getCanvasContainer(),this._container=o.getContainer(),this._clickTolerance=c.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(o,c){this.isEnabled()&&o.shiftKey&&o.button===0&&(ie(),this._startPos=this._lastPos=c,this._active=!0)}mousemoveWindow(o,c){if(!this._active)return;const f=c,_=this._startPos,x=this._lastPos;if(!_||!x||x.equals(f)||!this._box&&f.dist(_){this._box&&(this._box.style.transform=`translate(${T}px,${C}px)`,this._box.style.width=S-T+"px",this._box.style.height=z-C+"px")})}mouseupWindow(o,c){if(!this._active)return;const f=this._startPos,_=c;if(f&&o.button===0){if(this.reset(),ze(),f.x!==_.x||f.y!==_.y)return this._map.fire(new s.Event("boxzoomend",{originalEvent:o})),{cameraAnimation:x=>x.fitScreenCoordinates(f,_,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",o)}}keydown(o){this._active&&o.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",o))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),te(),delete this._startPos,delete this._lastPos}_fireEvent(o,c){return this._map.fire(new s.Event(o,{originalEvent:c}))}}function Qc(d,o){const c={};for(let f=0;fthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=o.timeStamp),f.length===this.numTouches&&(this.centroid=function(_){const x=new s.Point(0,0);for(const T of _)x._add(T);return x.div(_.length)}(c),this.touches=Qc(f,c)))}touchmove(o,c,f){if(this.aborted||!this.centroid)return;const _=Qc(f,c);for(const x in this.touches){const T=_[x];(!T||T.dist(this.touches[x])>30)&&(this.aborted=!0)}}touchend(o,c,f){if((!this.centroid||o.timeStamp-this.startTime>500)&&(this.aborted=!0),f.length===0){const _=!this.aborted&&this.centroid;if(this.reset(),_)return _}}}class nd{constructor(o){this.singleTap=new Aa(o),this.numTaps=o.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(o,c,f){this.singleTap.touchstart(o,c,f)}touchmove(o,c,f){this.singleTap.touchmove(o,c,f)}touchend(o,c,f){const _=this.singleTap.touchend(o,c,f);if(_){const x=o.timeStamp-this.lastTime<500,T=!this.lastTap||this.lastTap.dist(_)<30;if(x&&T||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=_,this.count===this.numTaps)return this.reset(),_}}}class iy{constructor(){this._zoomIn=new nd({numTouches:1,numTaps:2}),this._zoomOut=new nd({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(o,c,f){this._zoomIn.touchstart(o,c,f),this._zoomOut.touchstart(o,c,f)}touchmove(o,c,f){this._zoomIn.touchmove(o,c,f),this._zoomOut.touchmove(o,c,f)}touchend(o,c,f){const _=this._zoomIn.touchend(o,c,f),x=this._zoomOut.touchend(o,c,f);return _?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()+1,around:T.unproject(_)},{originalEvent:o})}):x?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()-1,around:T.unproject(x)},{originalEvent:o})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Of={0:1,2:2};class Ca{constructor(o){this.reset(),this._clickTolerance=o.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(o,c){return!1}_move(o,c){return{}}mousedown(o,c){if(this._lastPoint)return;const f=He(o);this._correctButton(o,f)&&(this._lastPoint=c,this._eventButton=f)}mousemoveWindow(o,c){const f=this._lastPoint;if(f){if(o.preventDefault(),this._eventButton!=null&&function(_,x){const T=Of[x];return _.buttons===void 0||(_.buttons&T)!==T}(o,this._eventButton))this.reset();else if(this._moved||!(c.dist(f)0&&(this._active=!0);const _=Qc(f,c),x=new s.Point(0,0),T=new s.Point(0,0);let S=0;for(const z in _){const P=_[z],O=this._touches[z];O&&(x._add(P),T._add(P.sub(O)),S++,_[z]=P)}if(this._touches=_,S{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class Vl{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(o){}_move(o,c,f){return{}}touchstart(o,c,f){this._firstTwoTouches||f.length<2||(this._firstTwoTouches=[f[0].identifier,f[1].identifier],this._start([c[0],c[1]]))}touchmove(o,c,f){const _=this._firstTwoTouches;if(!_)return;o.preventDefault();const[x,T]=_,S=$l(f,c,x),C=$l(f,c,T);if(!S||!C)return;const z=this._aroundCenter?null:S.add(C).div(2);return this._move([S,C],z,o)}touchend(o,c,f){if(!this._firstTwoTouches)return;const[_,x]=this._firstTwoTouches,T=$l(f,c,_),S=$l(f,c,x);T&&S||(this._active&&ze(),this.reset())}touchcancel(){this.reset()}enable(o){this._enabled=!0,this._aroundCenter=!!o&&o.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function $l(d,o,c){for(let f=0;fMath.abs(d.x)}class Nf extends Vl{constructor(o){super(),this._map=o}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(o){this._lastPoints=o,rs(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,c,f){const _=this._lastPoints;if(!_)return;const x=o[0].sub(_[0]),T=o[1].sub(_[1]);return this._map._cooperativeGestures&&!s.isFullscreen()&&f.touches.length<3||(this._valid=this.gestureBeginsVertically(x,T,f.timeStamp),!this._valid)?void 0:(this._lastPoints=o,this._active=!0,{pitchDelta:(x.y+T.y)/2*-.5})}gestureBeginsVertically(o,c,f){if(this._valid!==void 0)return this._valid;const _=o.mag()>=2,x=c.mag()>=2;if(!_&&!x)return;if(!_||!x)return this._firstMove==null&&(this._firstMove=f),f-this._firstMove<100&&void 0;const T=o.y>0==c.y>0;return rs(o)&&rs(c)&&T}}const Uf={panStep:100,bearingStep:15,pitchStep:10};class oy{constructor(){const o=Uf;this._panStep=o.panStep,this._bearingStep=o.bearingStep,this._pitchStep=o.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(o){if(o.altKey||o.ctrlKey||o.metaKey)return;let c=0,f=0,_=0,x=0,T=0;switch(o.keyCode){case 61:case 107:case 171:case 187:c=1;break;case 189:case 109:case 173:c=-1;break;case 37:o.shiftKey?f=-1:(o.preventDefault(),x=-1);break;case 39:o.shiftKey?f=1:(o.preventDefault(),x=1);break;case 38:o.shiftKey?_=1:(o.preventDefault(),T=-1);break;case 40:o.shiftKey?_=-1:(o.preventDefault(),T=1);break;default:return}return this._rotationDisabled&&(f=0,_=0),{cameraAnimation:S=>{const C=S.getZoom();S.easeTo({duration:300,easeId:"keyboardHandler",easing:jf,zoom:c?Math.round(C)+c*(o.shiftKey?2:1):C,bearing:S.getBearing()+f*this._bearingStep,pitch:S.getPitch()+_*this._pitchStep,offset:[-x*this._panStep,-T*this._panStep],center:S.getCenter()},{originalEvent:o})}}}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 jf(d){return d*(2-d)}const ld=4.000244140625;class Vf{constructor(o,c){this._map=o,this._el=o.getCanvasContainer(),this._handler=c,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,s.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(o){this._defaultZoomRate=o}setWheelZoomRate(o){this._wheelZoomRate=o}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(o){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!o&&o.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(o){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(o.ctrlKey||o.metaKey||this.isZooming()||s.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let c=o.deltaMode===s.window.WheelEvent.DOM_DELTA_LINE?40*o.deltaY:o.deltaY;const f=s.exported.now(),_=f-(this._lastWheelEventTime||0);this._lastWheelEventTime=f,c!==0&&c%ld==0?this._type="wheel":c!==0&&Math.abs(c)<4?this._type="trackpad":_>400?(this._type=null,this._lastValue=c,this._timeout=setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(_*c)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,c+=this._lastValue)),o.shiftKey&&c&&(c/=4),this._type&&(this._lastWheelEvent=o,this._delta-=c,this._active||this._start(o)),o.preventDefault()}_onTimeout(o){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)}_start(o){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 c=Oe(this._el,o);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:c,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const o=this._map.transform;this._type==="wheel"&&o.projection.wrap&&(o._center.lng>=180||o._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const c=()=>o._terrainEnabled()&&this._aroundCoord?o.computeZoomRelativeTo(this._aroundCoord):o.zoom;if(this._delta!==0){const C=this._type==="wheel"&&Math.abs(this._delta)>ld?this._wheelZoomRate:this._defaultZoomRate;let z=2/(1+Math.exp(-Math.abs(this._delta*C)));this._delta<0&&z!==0&&(z=1/z);const P=c(),O=Math.pow(2,P),j=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):O;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(j*z))),this._type==="wheel"&&(this._startZoom=P,this._easing=this._smoothOutEasing(200)),this._delta=0}const f=typeof this._targetZoom=="number"?this._targetZoom:c(),_=this._startZoom,x=this._easing;let T,S=!1;if(this._type==="wheel"&&_&&x){const C=Math.min((s.exported.now()-this._lastWheelEventTime)/200,1),z=x(C);T=s.number(_,f,z),C<1?this._frameId||(this._frameId=!0):S=!0}else T=f,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!S,zoomDelta:T-c(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let c=s.ease;if(this._prevEase){const f=this._prevEase,_=(s.exported.now()-f.start)/f.duration,x=f.easing(_+.01)-f.easing(_),T=.27/Math.sqrt(x*x+1e-4)*.01,S=Math.sqrt(.0729-T*T);c=s.bezier(T,S,.25,1)}return this._prevEase={start:s.exported.now(),duration:o,easing:c},c}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=J("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(s.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class $f{constructor(o,c){this._clickZoom=o,this._tapZoom=c}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 kr{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(o,c){return o.preventDefault(),{cameraAnimation:f=>{f.easeTo({duration:300,zoom:f.getZoom()+(o.shiftKey?-1:1),around:f.unproject(c)},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sy{constructor(){this._tap=new nd({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(o,c,f){this._swipePoint||(this._tapTime&&o.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?f.length>0&&(this._swipePoint=c[0],this._swipeTouch=f[0].identifier):this._tap.touchstart(o,c,f))}touchmove(o,c,f){if(this._tapTime){if(this._swipePoint){if(f[0].identifier!==this._swipeTouch)return;const _=c[0],x=_.y-this._swipePoint.y;return this._swipePoint=_,o.preventDefault(),this._active=!0,{zoomDelta:x/128}}}else this._tap.touchmove(o,c,f)}touchend(o,c,f){this._tapTime?this._swipePoint&&f.length===0&&this.reset():this._tap.touchend(o,c,f)&&(this._tapTime=o.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gf{constructor(o,c,f){this._el=o,this._mousePan=c,this._touchPan=f}enable(o){this._inertiaOptions=o||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ay{constructor(o,c,f){this._pitchWithRotate=o.pitchWithRotate,this._mouseRotate=c,this._mousePitch=f}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 ly{constructor(o,c,f,_){this._el=o,this._touchZoom=c,this._touchRotate=f,this._tapDragZoom=_,this._rotationDisabled=!1,this._enabled=!0}enable(o){this._touchZoom.enable(o),this._rotationDisabled||this._touchRotate.enable(o),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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 yi=d=>d.zoom||d.drag||d.pitch||d.rotate;class qf extends s.Event{}class cy{constructor(){this.constants=[1,1,.01],this.radius=0}setup(o,c){const f=s.sub([],c,o);this.radius=s.length(f[2]<0?s.div([],f,this.constants):[f[0],f[1],0])}projectRay(o){s.div(o,o,this.constants),s.normalize(o,o),s.mul$1(o,o,this.constants);const c=s.scale$2([],o,this.radius);if(c[2]>0){const f=s.scale$2([],[0,0,1],s.dot(c,[0,0,1])),_=s.scale$2([],s.normalize([],[c[0],c[1],0]),this.radius),x=s.add([],c,s.scale$2([],s.sub([],s.add([],_,f),c),2));c[0]=x[0],c[1]=x[1]}return c}}function Oi(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta}class ro{constructor(o,c){this._map=o,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rf(o),this._bearingSnap=c.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new cy,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(c),s.bindAll(["handleEvent","handleWindowEvent"],this);const f=this._el;this._listeners=[[f,"touchstart",{passive:!0}],[f,"touchmove",{passive:!1}],[f,"touchend",void 0],[f,"touchcancel",void 0],[f,"mousedown",void 0],[f,"mousemove",void 0],[f,"mouseup",void 0],[s.window.document,"mousemove",{capture:!0}],[s.window.document,"mouseup",void 0],[f,"mouseover",void 0],[f,"mouseout",void 0],[f,"dblclick",void 0],[f,"click",void 0],[f,"keydown",{capture:!1}],[f,"keyup",void 0],[f,"wheel",{passive:!1}],[f,"contextmenu",void 0],[s.window,"blur",void 0]];for(const[_,x,T]of this._listeners)_.addEventListener(x,_===s.window.document?this.handleWindowEvent:this.handleEvent,T)}destroy(){for(const[o,c,f]of this._listeners)o.removeEventListener(c,o===s.window.document?this.handleWindowEvent:this.handleEvent,f)}_addDefaultHandlers(o){const c=this._map,f=c.getCanvasContainer();this._add("mapEvent",new td(c,o));const _=c.boxZoom=new Df(c,o);this._add("boxZoom",_);const x=new iy,T=new kr;c.doubleClickZoom=new $f(T,x),this._add("tapZoom",x),this._add("clickZoom",T);const S=new sy;this._add("tapDragZoom",S);const C=c.touchPitch=new Nf(c);this._add("touchPitch",C);const z=new id(o),P=new od(o);c.dragRotate=new ay(o,z,P),this._add("mouseRotate",z,["mousePitch"]),this._add("mousePitch",P,["mouseRotate"]);const O=new rd(o),j=new eu(c,o);c.dragPan=new Gf(f,O,j),this._add("mousePan",O),this._add("touchPan",j,["touchZoom","touchRotate"]);const W=new Ff,H=new Bf;c.touchZoomRotate=new ly(f,H,W,S),this._add("touchRotate",W,["touchPan","touchZoom"]),this._add("touchZoom",H,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Jc(c));const Z=c.scrollZoom=new Vf(c,this);this._add("scrollZoom",Z,["mousePan"]);const X=c.keyboard=new oy;this._add("keyboard",X);for(const B of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])o.interactive&&o[B]&&c[B].enable(o[B])}_add(o,c,f){this._handlers.push({handlerName:o,handler:c,allowed:f}),this._handlersById[o]=c}stop(o){if(!this._updatingCamera){for(const{handler:c}of this._handlers)c.reset();this._inertia.clear(),this._fireEvents({},{},o),this._changes=[]}}isActive(){for(const{handler:o}of this._handlers)if(o.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!yi(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(o,c,f){for(const _ in o)if(_!==f&&(!c||c.indexOf(_)<0))return!0;return!1}handleWindowEvent(o){this.handleEvent(o,`${o.type}Window`)}_getMapTouches(o){const c=[];for(const f of o)this._el.contains(f.target)&&c.push(f);return c}handleEvent(o,c){this._updatingCamera=!0;const f=o.type==="renderFrame",_=f?void 0:o,x={needsRenderFrame:!1},T={},S={},C=o.touches?this._getMapTouches(o.touches):void 0,z=C?Ke(this._el,C):f?void 0:Oe(this._el,o);for(const{handlerName:j,handler:W,allowed:H}of this._handlers){if(!W.isEnabled())continue;let Z;this._blockedByActive(S,H,j)?W.reset():W[c||o.type]&&(Z=W[c||o.type](o,z,C),this.mergeHandlerResult(x,T,Z,j,_),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||W.isActive())&&(S[j]=W)}const P={};for(const j in this._previousActiveHandlers)S[j]||(P[j]=_);this._previousActiveHandlers=S,(Object.keys(P).length||Oi(x))&&(this._changes.push([x,T,P]),this._triggerRenderFrame()),(Object.keys(S).length||Oi(x))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:O}=x;O&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],O(this._map))}mergeHandlerResult(o,c,f,_,x){if(!f)return;s.extend(o,f);const T={handlerName:_,originalEvent:f.originalEvent||x};f.zoomDelta!==void 0&&(c.zoom=T),f.panDelta!==void 0&&(c.drag=T),f.pitchDelta!==void 0&&(c.pitch=T),f.bearingDelta!==void 0&&(c.rotate=T)}_applyChanges(){const o={},c={},f={};for(const[_,x,T]of this._changes)_.panDelta&&(o.panDelta=(o.panDelta||new s.Point(0,0))._add(_.panDelta)),_.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+_.zoomDelta),_.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+_.bearingDelta),_.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+_.pitchDelta),_.around!==void 0&&(o.around=_.around),_.aroundCoord!==void 0&&(o.aroundCoord=_.aroundCoord),_.pinchAround!==void 0&&(o.pinchAround=_.pinchAround),_.noInertia&&(o.noInertia=_.noInertia),s.extend(c,x),s.extend(f,T);this._updateMapTransform(o,c,f),this._changes=[]}_updateMapTransform(o,c,f){const _=this._map,x=_.transform,T=q=>[q.x,q.y,q.z];if((q=>{const Q=this._eventsInProgress.drag;return Q&&!this._handlersById[Q.handlerName].isActive()})()&&!Oi(o)){const q=x.zoom;x.cameraElevationReference="sea",x.recenterOnTerrain(),x.cameraElevationReference="ground",q!==x.zoom&&this._map._update(!0)}if(x._isCameraConstrained&&_._stop(!0),!Oi(o))return void this._fireEvents(c,f,!0);let{panDelta:S,zoomDelta:C,bearingDelta:z,pitchDelta:P,around:O,aroundCoord:j,pinchAround:W}=o;x._isCameraConstrained&&(C>0&&(C=0),x._isCameraConstrained=!1),W!==void 0&&(O=W),(C||(q=>c[q]&&!this._eventsInProgress[q])("drag"))&&O&&(this._dragOrigin=T(x.pointCoordinate3D(O)),this._trackingEllipsoid.setup(x._camera.position,this._dragOrigin)),x.cameraElevationReference="sea",_._stop(!0),O=O||_.transform.centerPoint,z&&(x.bearing+=z),P&&(x.pitch+=P),x._updateCameraState();const H=[0,0,0];if(S)if(x.projection.name==="mercator"){const q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(O).dir),Q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(O.sub(S)).dir);H[0]=Q[0]-q[0],H[1]=Q[1]-q[1]}else{const q=x.pointCoordinate(O);if(x.projection.name==="globe"){S=S.rotate(-x.angle);const Q=x._pixelsPerMercatorPixel/x.worldSize;H[0]=-S.x*s.mercatorScale(s.latFromMercatorY(q.y))*Q,H[1]=-S.y*s.mercatorScale(x.center.lat)*Q}else{const Q=x.pointCoordinate(O.sub(S));q&&Q&&(H[0]=Q.x-q.x,H[1]=Q.y-q.y)}}const Z=x.zoom,X=[0,0,0];if(C){const q=T(j||x.pointCoordinate3D(O)),Q={dir:s.normalize([],s.sub([],q,x._camera.position))};if(Q.dir[2]<0){const ee=x.zoomDeltaToMovement(q,C);s.scale$2(X,Q.dir,ee)}}const B=s.add(H,H,X);x._translateCameraConstrained(B),C&&Math.abs(x.zoom-Z)>1e-4&&x.recenterOnTerrain(),x.cameraElevationReference="ground",this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(c,f,!0)}_fireEvents(o,c,f){const _=yi(this._eventsInProgress),x=yi(o),T={};for(const P in o){const{originalEvent:O}=o[P];this._eventsInProgress[P]||(T[`${P}start`]=O),this._eventsInProgress[P]=o[P]}!_&&x&&this._fireEvent("movestart",x.originalEvent);for(const P in T)this._fireEvent(P,T[P]);x&&this._fireEvent("move",x.originalEvent);for(const P in o){const{originalEvent:O}=o[P];this._fireEvent(P,O)}const S={};let C;for(const P in this._eventsInProgress){const{handlerName:O,originalEvent:j}=this._eventsInProgress[P];this._handlersById[O].isActive()||(delete this._eventsInProgress[P],C=c[O]||j,S[`${P}end`]=C)}for(const P in S)this._fireEvent(P,S[P]);const z=yi(this._eventsInProgress);if(f&&(_||x)&&!z){this._updatingCamera=!0;const P=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=j=>j!==0&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new qf("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const Ds="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class tu extends s.Evented{constructor(o,c){super(),this._moving=!1,this._zooming=!1,this.transform=o,this._bearingSnap=c.bearingSnap,this._respectPrefersReducedMotion=c.respectPrefersReducedMotion!==!1,s.bindAll(["_renderFrameCallback"],this)}getCenter(){return new s.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(o,c){return this.jumpTo({center:o},c)}panBy(o,c,f){return o=s.Point.convert(o).mult(-1),this.panTo(this.transform.center,s.extend({offset:o},c),f)}panTo(o,c,f){return this.easeTo(s.extend({center:o},c),f)}getZoom(){return this.transform.zoom}setZoom(o,c){return this.jumpTo({zoom:o},c),this}zoomTo(o,c,f){return this.easeTo(s.extend({zoom:o},c),f)}zoomIn(o,c){return this.zoomTo(this.getZoom()+1,o,c),this}zoomOut(o,c){return this.zoomTo(this.getZoom()-1,o,c),this}getBearing(){return this.transform.bearing}setBearing(o,c){return this.jumpTo({bearing:o},c),this}getPadding(){return this.transform.padding}setPadding(o,c){return this.jumpTo({padding:o},c),this}rotateTo(o,c,f){return this.easeTo(s.extend({bearing:o},c),f)}resetNorth(o,c){return this.rotateTo(0,s.extend({duration:1e3},o),c),this}resetNorthPitch(o,c){return this.easeTo(s.extend({bearing:0,pitch:0,duration:1e3},o),c),this}snapToNorth(o,c){return Math.abs(this.getBearing())o.aspect?f/(2*Math.tan(.5*o.fovX)*o.aspect):_/(2*Math.tan(.5*o.fovY)*o.aspect)}_cameraForBoundsOnGlobe(o,c,f,_,x,T){const S=o.clone(),C=this._extendCameraOptions(T);S.bearing=_,S.pitch=x;const z=s.LngLat.convert(c),P=s.LngLat.convert(f),O=.5*(z.lat+P.lat),j=.5*(z.lng+P.lng),W=s.latLngToECEF(O,j),H=s.normalize([],W),Z=s.normalize([],s.cross([],H,[0,1,0])),X=s.cross([],Z,H),B=[Z[0],Z[1],Z[2],0,X[0],X[1],X[2],0,H[0],H[1],H[2],0,0,0,0,1],q=[W,s.latLngToECEF(z.lat,z.lng),s.latLngToECEF(P.lat,z.lng),s.latLngToECEF(P.lat,P.lng),s.latLngToECEF(z.lat,P.lng),s.latLngToECEF(O,z.lng),s.latLngToECEF(O,P.lng),s.latLngToECEF(z.lat,j),s.latLngToECEF(P.lat,j)];let Q=s.Aabb.fromPoints(q.map($e=>[s.dot(Z,$e),s.dot(X,$e),s.dot(H,$e)]));const ee=s.transformMat4([],Q.center,B);s.squaredLength(ee)===0&&s.set(ee,0,0,1),s.normalize(ee,ee),s.scale$2(ee,ee,s.GLOBE_RADIUS),S.center=s.ecefToLatLng(ee);const de=S.getWorldToCameraMatrix(),fe=s.invert(new Float64Array(16),de);Q=s.Aabb.applyTransform(Q,s.multiply([],de,B)),s.transformMat4(ee,ee,de);const pe=.5*(Q.max[2]-Q.min[2]),xe=this._minimumAABBFrustumDistance(S,Q),ye=s.scale$2([],[0,0,1],pe),Ae=s.add(ye,ee,ye),We=xe+(S.pitch===0?0:s.distance(ee,Ae)),Ee=S.globeCenterInViewSpace,Fe=s.sub([],ee,[Ee[0],Ee[1],Ee[2]]);s.normalize(Fe,Fe),s.scale$2(Fe,Fe,We);const ke=s.add([],ee,Fe);s.transformMat4(ke,ke,fe);const qe=s.earthRadius/s.GLOBE_RADIUS,Se=s.length(ke),Be=s.mercatorZfromAltitude(Math.max(Se*qe-s.earthRadius,Number.EPSILON),0),Xe=Math.min(S.zoomFromMercatorZAdjusted(Be),C.maxZoom);return Xe>.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(S.setProjection({name:"mercator"}),S.zoom=Xe,this._cameraForBounds(S,c,f,_,x,T)):{center:S.center,zoom:Xe,bearing:_,pitch:x}}queryTerrainElevation(o,c){const f=this.transform.elevation;return f?(c=s.extend({},{exaggerated:!0},c),f.getAtPoint(s.MercatorCoordinate.fromLngLat(o),null,c.exaggerated)):null}_cameraForBounds(o,c,f,_,x,T){if(o.projection.name==="globe")return this._cameraForBoundsOnGlobe(o,c,f,_,x,T);const S=o.clone(),C=this._extendCameraOptions(T),z=S.padding;S.bearing=_,S.pitch=x;const P=s.LngLat.convert(c),O=s.LngLat.convert(f),j=new s.LngLat(P.lng,O.lat),W=new s.LngLat(O.lng,P.lat),H=S.project(P),Z=S.project(O),X=this.queryTerrainElevation(P),B=this.queryTerrainElevation(O),q=this.queryTerrainElevation(j),Q=this.queryTerrainElevation(W),ee=[[H.x,H.y,Math.min(X||0,B||0,q||0,Q||0)],[Z.x,Z.y,Math.max(X||0,B||0,q||0,Q||0)]];let de=s.Aabb.fromPoints(ee);const fe=S.getWorldToCameraMatrix(),pe=s.invert(new Float64Array(16),fe);de=s.Aabb.applyTransform(de,fe);const xe=s.sub([],de.max,de.min),ye=z.left||0,Ae=z.right||0,We=z.bottom||0,Ee=z.top||0,{left:Fe,right:ke,top:qe,bottom:Se}=C.padding,Be=.5*(ye+Ae),Xe=.5*(Ee+We),$e=Math.min(S.scaleZoom(S.scale*Math.min((S.width-(ye+Ae+Fe+ke))/xe[0],(S.height-(We+Ee+Se+qe))/xe[1])),C.maxZoom),Ye=S.scale/S.zoomScale($e);de=new s.Aabb([de.min[0]-(Fe+Be)*Ye,de.min[1]-(Se+Xe)*Ye,de.min[2]],[de.max[0]+(ke+Be)*Ye,de.max[1]+(qe+Xe)*Ye,de.max[2]]);const gt=.5*xe[2],Et=this._minimumAABBFrustumDistance(S,de),pt=[0,0,1,0];s.transformMat4$1(pt,pt,fe),s.normalize$2(pt,pt);const wt=s.scale$2([],pt,Et+gt),Ut=s.add([],de.center,wt),Ot=(typeof C.offset.x=="number"&&typeof C.offset.y=="number"?new s.Point(C.offset.x,C.offset.y):s.Point.convert(C.offset)).rotate(-s.degToRad(_));de.center[0]-=Ot.x*Ye,de.center[1]+=Ot.y*Ye,s.transformMat4(de.center,de.center,pe),s.transformMat4(Ut,Ut,pe);const mt=[de.center[0],de.center[1],Ut[2]*S.pixelsPerMeter];s.scale$2(mt,mt,1/S.worldSize);const en=s.lngFromMercatorX(mt[0]),rn=s.latFromMercatorY(mt[1]),on=Math.min(S._zoomFromMercatorZ(mt[2]),C.maxZoom),sn=new s.LngLat(en,rn);return S.mercatorFromTransition&&on<.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(S.setProjection({name:"globe"}),S.zoom=on,this._cameraForBounds(S,c,f,_,x,T)):{center:sn,zoom:on,bearing:_,pitch:x}}fitBounds(o,c,f){const _=this.cameraForBounds(o,c);return this._fitInternal(_,c,f)}fitScreenCoordinates(o,c,f,_,x){const T=s.Point.convert(o),S=s.Point.convert(c),C=new s.Point(Math.min(T.x,S.x),Math.min(T.y,S.y)),z=new s.Point(Math.max(T.x,S.x),Math.max(T.y,S.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(T,S))return this;const P=this.transform.pointLocation3D(C),O=this.transform.pointLocation3D(z),j=this.transform.pointLocation3D(new s.Point(C.x,z.y)),W=this.transform.pointLocation3D(new s.Point(z.x,C.y)),H=[Math.min(P.lng,O.lng,j.lng,W.lng),Math.min(P.lat,O.lat,j.lat,W.lat)],Z=[Math.max(P.lng,O.lng,j.lng,W.lng),Math.max(P.lat,O.lat,j.lat,W.lat)],X=_&&_.pitch?_.pitch:this.getPitch(),B=this._cameraForBounds(this.transform,H,Z,f,X,_);return this._fitInternal(B,_,x)}_fitInternal(o,c,f){return o?(delete(c=s.extend(o,c)).padding,c.linear?this.easeTo(c,f):this.flyTo(c,f)):this}jumpTo(o,c){this.stop();const f=o.preloadOnly?this.transform.clone():this.transform;let _=!1,x=!1,T=!1;return"zoom"in o&&f.zoom!==+o.zoom&&(_=!0,f.zoom=+o.zoom),o.center!==void 0&&(f.center=s.LngLat.convert(o.center)),"bearing"in o&&f.bearing!==+o.bearing&&(x=!0,f.bearing=+o.bearing),"pitch"in o&&f.pitch!==+o.pitch&&(T=!0,f.pitch=+o.pitch),o.padding==null||f.isPaddingEqual(o.padding)||(f.padding=o.padding),o.preloadOnly?(this._preloadTiles(f),this):(this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),_&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),x&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),T&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.warnOnce(Ds),this.transform.getFreeCameraOptions()}setFreeCameraOptions(o,c){const f=this.transform;if(!f.projection.supportsFreeCamera)return s.warnOnce(Ds),this;this.stop();const _=f.zoom,x=f.pitch,T=f.bearing;f.setFreeCameraOptions(o);const S=_!==f.zoom,C=x!==f.pitch,z=T!==f.bearing;return this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),S&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),z&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),C&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)),this}easeTo(o,c){this._stop(!1,o.easeId),((o=s.extend({offset:[0,0],duration:500,easing:s.ease},o)).animate===!1||this._prefersReducedMotion(o))&&(o.duration=0);const f=this.transform,_=this.getZoom(),x=this.getBearing(),T=this.getPitch(),S=this.getPadding(),C="zoom"in o?+o.zoom:_,z="bearing"in o?this._normalizeBearing(o.bearing,x):x,P="pitch"in o?+o.pitch:T,O="padding"in o?o.padding:f.padding,j=s.Point.convert(o.offset);let W,H,Z;if(f.projection.name==="globe"){const ye=s.MercatorCoordinate.fromLngLat(f.center),Ae=j.rotate(-f.angle);ye.x+=Ae.x/f.worldSize,ye.y+=Ae.y/f.worldSize;const We=ye.toLngLat(),Ee=s.LngLat.convert(o.center||We);this._normalizeCenter(Ee),W=f.centerPoint.add(Ae),H=new s.Point(ye.x,ye.y).mult(f.worldSize),Z=new s.Point(s.mercatorXfromLng(Ee.lng),s.mercatorYfromLat(Ee.lat)).mult(f.worldSize).sub(H)}else{W=f.centerPoint.add(j);const ye=f.pointLocation(W),Ae=s.LngLat.convert(o.center||ye);this._normalizeCenter(Ae),H=f.project(ye),Z=f.project(Ae).sub(H)}const X=f.zoomScale(C-_);let B,q;o.around&&(B=s.LngLat.convert(o.around),q=f.locationPoint(B));const Q=this._zooming||C!==_,ee=this._rotating||x!==z,de=this._pitching||P!==T,fe=!f.isPaddingEqual(O),pe=ye=>Ae=>{if(Q&&(ye.zoom=s.number(_,C,Ae)),ee&&(ye.bearing=s.number(x,z,Ae)),de&&(ye.pitch=s.number(T,P,Ae)),fe&&(ye.interpolatePadding(S,O,Ae),W=ye.centerPoint.add(j)),B)ye.setLocationAtPoint(B,q);else{const We=ye.zoomScale(ye.zoom-_),Ee=C>_?Math.min(2,X):Math.max(.5,X),Fe=Math.pow(Ee,1-Ae),ke=ye.unproject(H.add(Z.mult(Ae*Fe)).mult(We));ye.setLocationAtPoint(ye.renderWorldCopies?ke.wrap():ke,W)}return o.preloadOnly||this._fireMoveEvents(c),ye};if(o.preloadOnly){const ye=this._emulate(pe,o.duration,f);return this._preloadTiles(ye),this}const xe={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=Q,this._rotating=ee,this._pitching=de,this._padding=fe,this._easeId=o.easeId,this._prepareEase(c,o.noMoveStart,xe),this._ease(pe(f),ye=>{f.recenterOnTerrain(),this._afterEase(c,ye)},o),this}_prepareEase(o,c,f={}){this._moving=!0,this.transform.cameraElevationReference="sea",c||f.moving||this.fire(new s.Event("movestart",o)),this._zooming&&!f.zooming&&this.fire(new s.Event("zoomstart",o)),this._rotating&&!f.rotating&&this.fire(new s.Event("rotatestart",o)),this._pitching&&!f.pitching&&this.fire(new s.Event("pitchstart",o))}_fireMoveEvents(o){this.fire(new s.Event("move",o)),this._zooming&&this.fire(new s.Event("zoom",o)),this._rotating&&this.fire(new s.Event("rotate",o)),this._pitching&&this.fire(new s.Event("pitch",o))}_afterEase(o,c){if(this._easeId&&c&&this._easeId===c)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const f=this._zooming,_=this._rotating,x=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,f&&this.fire(new s.Event("zoomend",o)),_&&this.fire(new s.Event("rotateend",o)),x&&this.fire(new s.Event("pitchend",o)),this.fire(new s.Event("moveend",o))}flyTo(o,c){if(this._prefersReducedMotion(o)){const $e=s.pick(o,["center","zoom","bearing","pitch","around"]);return this.jumpTo($e,c)}this.stop(),o=s.extend({offset:[0,0],speed:1.2,curve:1.42,easing:s.ease},o);const f=this.transform,_=this.getZoom(),x=this.getBearing(),T=this.getPitch(),S=this.getPadding(),C="zoom"in o?s.clamp(+o.zoom,f.minZoom,f.maxZoom):_,z="bearing"in o?this._normalizeBearing(o.bearing,x):x,P="pitch"in o?+o.pitch:T,O="padding"in o?o.padding:f.padding,j=f.zoomScale(C-_),W=s.Point.convert(o.offset);let H=f.centerPoint.add(W);const Z=f.pointLocation(H),X=s.LngLat.convert(o.center||Z);this._normalizeCenter(X);const B=f.project(Z),q=f.project(X).sub(B);let Q=o.curve;const ee=Math.max(f.width,f.height),de=ee/j,fe=q.mag();if("minZoom"in o){const $e=s.clamp(Math.min(o.minZoom,_,C),f.minZoom,f.maxZoom),Ye=ee/f.zoomScale($e-_);Q=Math.sqrt(Ye/fe*2)}const pe=Q*Q;function xe($e){const Ye=(de*de-ee*ee+($e?-1:1)*pe*pe*fe*fe)/(2*($e?de:ee)*pe*fe);return Math.log(Math.sqrt(Ye*Ye+1)-Ye)}function ye($e){return(Math.exp($e)-Math.exp(-$e))/2}function Ae($e){return(Math.exp($e)+Math.exp(-$e))/2}const We=xe(0);let Ee=function($e){return Ae(We)/Ae(We+Q*$e)},Fe=function($e){return ee*((Ae(We)*(ye(Ye=We+Q*$e)/Ae(Ye))-ye(We))/pe)/fe;var Ye},ke=(xe(1)-We)/Q;if(Math.abs(fe)<1e-6||!isFinite(ke)){if(Math.abs(ee-de)<1e-6)return this.easeTo(o,c);const $e=deo.maxDuration&&(o.duration=0);const qe=x!==z,Se=P!==T,Be=!f.isPaddingEqual(O),Xe=$e=>Ye=>{const gt=Ye*ke,Et=1/Ee(gt);$e.zoom=Ye===1?C:_+$e.scaleZoom(Et),qe&&($e.bearing=s.number(x,z,Ye)),Se&&($e.pitch=s.number(T,P,Ye)),Be&&($e.interpolatePadding(S,O,Ye),H=$e.centerPoint.add(W));const pt=Ye===1?X:$e.unproject(B.add(q.mult(Fe(gt))).mult(Et));return $e.setLocationAtPoint($e.renderWorldCopies?pt.wrap():pt,H),$e._updateCameraOnTerrain(),o.preloadOnly||this._fireMoveEvents(c),$e};if(o.preloadOnly){const $e=this._emulate(Xe,o.duration,f);return this._preloadTiles($e),this}return this._zooming=!0,this._rotating=qe,this._pitching=Se,this._padding=Be,this._prepareEase(c,!1),this._ease(Xe(f),()=>this._afterEase(c),o),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(o,c){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const f=this._onEaseEnd;this._onEaseEnd=void 0,f.call(this,c)}if(!o){const f=this.handlers;f&&f.stop(!1)}return this}_ease(o,c,f){f.animate===!1||f.duration===0?(o(1),c()):(this._easeStart=s.exported.now(),this._easeOptions=f,this._onEaseFrame=o,this._onEaseEnd=c,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const o=Math.min((s.exported.now()-this._easeStart)/this._easeOptions.duration,1),c=this._onEaseFrame;c&&c(this._easeOptions.easing(o)),o<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(o,c){o=s.wrap(o,-180,180);const f=Math.abs(o-c);return Math.abs(o-360-c)180?-360:f<-180?360:0}_prefersReducedMotion(o){return this._respectPrefersReducedMotion&&s.exported.prefersReducedMotion&&!(o&&o.essential)}_emulate(o,c,f){const _=Math.ceil(15*c/1e3),x=[],T=o(f.clone());for(let S=0;S<=_;S++){const C=T(S/_);x.push(C.clone())}return x}}class dt{constructor(o={}){this.options=o,s.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(o){const c=this.options&&this.options.compact;return this._map=o,this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=J("button","mapboxgl-ctrl-attrib-button",this._container),J("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=J("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),c&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),c===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(o,c){const f=this._map._getUIString(`AttributionControl.${c}`);o.setAttribute("aria-label",f),o.removeAttribute("title"),o.firstElementChild&&o.firstElementChild.setAttribute("title",f)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let o=this._editLink;o||(o=this._editLink=this._container.querySelector(".mapbox-improve-map"));const c=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.config.ACCESS_TOKEN}];if(o){const f=c.reduce((_,x,T)=>(x.value&&(_+=`${x.key}=${x.value}${T_.length-x.length),o=o.filter((_,x)=>{for(let T=x+1;T=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?o=[...this.options.customAttribution,...o]:o.unshift(this.options.customAttribution));const f=o.join(" | ");f!==this._attribHTML&&(this._attribHTML=f,o.length?(this._innerContainer.innerHTML=f,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class cd{constructor(){s.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(o){this._map=o,this._container=J("div","mapboxgl-ctrl");const c=J("a","mapboxgl-ctrl-logo");return c.target="_blank",c.rel="noopener nofollow",c.href="https://www.mapbox.com/",c.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),c.setAttribute("rel","noopener nofollow"),this._container.appendChild(c),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(o){o&&o.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const o=this._map.style._sourceCaches;if(Object.entries(o).length===0)return!0;for(const c in o){const f=o[c].getSource();if(f.hasOwnProperty("mapbox_logo")&&!f.mapbox_logo)return!1}return!0}_updateCompact(){const o=this._container.children;if(o.length){const c=o[0];this._map.getCanvasContainer().offsetWidth<250?c.classList.add("mapboxgl-compact"):c.classList.remove("mapboxgl-compact")}}}class ud{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(o){const c=++this._id;return this._queue.push({callback:o,id:c,cancelled:!1}),c}remove(o){const c=this._currentlyRunning,f=c?this._queue.concat(c):this._queue;for(const _ of f)if(_.id===o)return void(_.cancelled=!0)}run(o=0){const c=this._currentlyRunning=this._queue;this._queue=[];for(const f of c)if(!f.cancelled&&(f.callback(o),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ia(d,o,c){if(d=new s.LngLat(d.lng,d.lat),o){const f=new s.LngLat(d.lng-360,d.lat),_=new s.LngLat(d.lng+360,d.lat),x=360*Math.ceil(Math.abs(d.lng-c.center.lng)/360),T=c.locationPoint(d).distSqr(o),S=o.x<0||o.y<0||o.x>c.width||o.y>c.height;c.locationPoint(f).distSqr(o)180;){const f=c.locationPoint(d);if(f.x>=0&&f.y>=0&&f.x<=c.width&&f.y<=c.height)break;d.lng>c.center.lng?d.lng-=360:d.lng+=360}return d}const Os={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%)"};class at extends s.Evented{constructor(o,c){if(super(),(o instanceof s.window.HTMLElement||c)&&(o=s.extend({element:o},c)),s.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=o&&o.anchor||"center",this._color=o&&o.color||"#3FB1CE",this._scale=o&&o.scale||1,this._draggable=o&&o.draggable||!1,this._clickTolerance=o&&o.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=o&&o.rotation||0,this._rotationAlignment=o&&o.rotationAlignment||"auto",this._pitchAlignment=o&&o.pitchAlignment&&o.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=o&&o.occludedOpacity||.2,o&&o.element)this._element=o.element,this._offset=s.Point.convert(o&&o.offset||[0,0]);else{this._defaultMarker=!0,this._element=J("div");const _=41,x=27,T=ve("svg",{display:"block",height:_*this._scale+"px",width:x*this._scale+"px",viewBox:`0 0 ${x} ${_}`},this._element),S=ve("radialGradient",{id:"shadowGradient"},ve("defs",{},T));ve("stop",{offset:"10%","stop-opacity":.4},S),ve("stop",{offset:"100%","stop-opacity":.05},S),ve("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},T),ve("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},T),ve("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},T),ve("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},T),this._offset=s.Point.convert(o&&o.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",_=>{_.preventDefault()}),this._element.addEventListener("mousedown",_=>{_.preventDefault()});const f=this._element.classList;for(const _ in Os)f.remove(`mapboxgl-marker-anchor-${_}`);f.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(o){return o===this._map||(this.remove(),this._map=o,o.getCanvasContainer().appendChild(this._element),o.on("move",this._updateMoving),o.on("moveend",this._update),o.on("remove",this._clearFadeTimer),o._addMarker(this),this.setDraggable(this._draggable),this._update(),o.on("click",this._onMapClick)),this}remove(){const o=this._map;return o&&(o.off("click",this._onMapClick),o.off("move",this._updateMoving),o.off("moveend",this._update),o.off("mousedown",this._addDragHandler),o.off("touchstart",this._addDragHandler),o.off("mouseup",this._onUp),o.off("touchend",this._onUp),o.off("mousemove",this._onMove),o.off("touchmove",this._onMove),o.off("remove",this._clearFadeTimer),o._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=s.LngLat.convert(o),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(o){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),o){if(!("offset"in o.options)){const _=Math.sqrt(Math.pow(13.5,2)/2);o.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[_,-1*(38.1-13.5+_)],"bottom-right":[-_,-1*(38.1-13.5+_)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,o._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(o){const c=o.code,f=o.charCode||o.keyCode;c!=="Space"&&c!=="Enter"&&f!==32&&f!==13||this.togglePopup()}_onMapClick(o){const c=o.originalEvent.target,f=this._element;this._popup&&(c===f||f.contains(c))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const o=this._popup;return o?(o.isOpen()?(o.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(o.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const o=this._map,c=this._pos;if(!o||!c)return!1;const f=o.unproject(c),_=o.getFreeCameraOptions();if(!_.position)return!1;const x=_.position.toLngLat();return x.distanceTo(f)<.9*x.distanceTo(this._lngLat)}_evaluateOpacity(){const o=this._map;if(!o)return;const c=this._pos;if(!c||c.x<0||c.x>o.transform.width||c.y<0||c.y>o.transform.height)return void this._clearFadeTimer();const f=o.unproject(c);let _;o._showingGlobe()&&s.isLngLatBehindGlobe(o.transform,this._lngLat)?_=0:(_=1-o._queryFogOpacity(f),o.transform._terrainEnabled()&&o.getTerrain()&&this._behindTerrain()&&(_*=this._occludedOpacity)),this._element.style.opacity=`${_}`,this._element.style.pointerEvents=_>0?"auto":"none",this._popup&&this._popup._setOpacity(_),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const o=this._pos;if(!o||!this._map)return;const c=this._offset.mult(this._scale);this._element.style.transform=` - translate(${o.x}px,${o.y}px) - ${Os[this._anchor]} - ${this._calculateXYTransform()} ${this._calculateZTransform()} - translate(${c.x}px,${c.y}px) - `}_calculateXYTransform(){const o=this._pos,c=this._map,f=this.getPitchAlignment();if(!c||!o||f!=="map")return"";if(!c._showingGlobe()){const C=c.getPitch();return C?`rotateX(${C}deg)`:""}const _=s.radToDeg(s.globeTiltAtLngLat(c.transform,this._lngLat)),x=o.sub(s.globeCenterToScreenPoint(c.transform)),T=Math.abs(x.x)+Math.abs(x.y);if(T===0)return"";const S=_/T;return`rotateX(${-x.y*S}deg) rotateY(${x.x*S}deg)`}_calculateZTransform(){const o=this._pos,c=this._map;if(!c||!o)return"";let f=0;const _=this.getRotationAlignment();if(_==="map")if(c._showingGlobe()){const x=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),T=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(x);f=s.radToDeg(Math.atan2(T.y,T.x))-90}else f=-c.getBearing();else if(_==="horizon"){const x=s.smoothstep(4,6,c.getZoom()),T=s.globeCenterToScreenPoint(c.transform);T.y+=x*c.transform.height;const S=o.sub(T),C=s.radToDeg(Math.atan2(S.y,S.x));f=(C>90?C-270:C+90)*(1-x)}return f+=this._rotation,f?`rotateZ(${f}deg)`:""}_update(o){s.window.cancelAnimationFrame(this._updateFrameId);const c=this._map;c&&(c.transform.renderWorldCopies&&(this._lngLat=Ia(this._lngLat,this._pos,c.transform)),this._pos=c.project(this._lngLat),o===!0?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),c._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(c._showingGlobe()||c.getTerrain()||c.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(o){return this._offset=s.Point.convert(o),this._update(),this}_onMove(o){const c=this._map;if(!c)return;const f=this._pointerdownPos,_=this._positionDelta;if(f&&_){if(!this._isDragging){const x=this._clickTolerance||c._clickTolerance;if(o.point.dist(f)=this._endTime)return this._end;const c=s.easeCubicInOut((o-this._startTime)/(this._endTime-this._startTime));return this._start*(1-c)+this._end*c}isEasing(o){return o>=this._startTime&&o<=this._endTime}jumpTo(o){this._startTime=-1/0,this._endTime=-1/0,this._start=o,this._end=o}easeTo(o,c,f){this._start=this.getValue(c),this._end=o,this._startTime=c,this._endTime=c+f}}const Zf={"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","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Hf={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},hy={showCompass:!0,showZoom:!0,visualizePitch:!1};class dy{constructor(o,c,f=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new id({clickTolerance:o.dragRotate._mouseRotate._clickTolerance}),this.map=o,f&&(this.mousePitch=new od({clickTolerance:o.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener("mousedown",this.mousedown),c.addEventListener("touchstart",this.touchstart,{passive:!1}),c.addEventListener("touchmove",this.touchmove),c.addEventListener("touchend",this.touchend),c.addEventListener("touchcancel",this.reset)}down(o,c){this.mouseRotate.mousedown(o,c),this.mousePitch&&this.mousePitch.mousedown(o,c),ie()}move(o,c){const f=this.map,_=this.mouseRotate.mousemoveWindow(o,c),x=_&&_.bearingDelta;if(x&&f.setBearing(f.getBearing()+x),this.mousePitch){const T=this.mousePitch.mousemoveWindow(o,c),S=T&&T.pitchDelta;S&&f.setPitch(f.getPitch()+S)}}off(){const o=this.element;o.removeEventListener("mousedown",this.mousedown),o.removeEventListener("touchstart",this.touchstart,{passive:!1}),o.removeEventListener("touchmove",this.touchmove),o.removeEventListener("touchend",this.touchend),o.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){te(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(o){this.down(s.extend({},o,{ctrlKey:!0,preventDefault:()=>o.preventDefault()}),Oe(this.element,o)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(o){this.move(o,Oe(this.element,o))}mouseup(o){this.mouseRotate.mouseupWindow(o),this.mousePitch&&this.mousePitch.mouseupWindow(o),this.offTemp()}touchstart(o){o.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Ke(this.element,o.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>o.preventDefault()},this._startPos))}touchmove(o){o.targetTouches.length!==1?this.reset():(this._lastPos=Ke(this.element,o.targetTouches)[0],this.move({preventDefault:()=>o.preventDefault()},this._lastPos))}touchend(o){o.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(d.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(d.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Ta(d.minZoom,d.maxZoom,d.minPitch,d.maxPitch,d.renderWorldCopies),d),this._interactive=d.interactive,this._minTileCacheSize=d.minTileCacheSize,this._maxTileCacheSize=d.maxTileCacheSize,this._failIfMajorPerformanceCaveat=d.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=d.preserveDrawingBuffer,this._antialias=d.antialias,this._useWebGL2=d.useWebGL2,this._trackResize=d.trackResize,this._bearingSnap=d.bearingSnap,this._refreshExpiredTiles=d.refreshExpiredTiles,this._fadeDuration=d.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=d.crossSourceCollisions,this._collectResourceTiming=d.collectResourceTiming,this._optimizeForTerrain=d.optimizeForTerrain,this._language=this._parseLanguage(d.language),this._worldview=d.worldview,this._renderTaskQueue=new ud,this._domRenderTaskQueue=new ud,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},Zf,d.locale),this._clickTolerance=d.clickTolerance,this._cooperativeGestures=d.cooperativeGestures,this._performanceMetricsCollection=d.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new dd(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(d.transformRequest,d.accessToken,d.testMode),this._silenceAuthErrors=!!d.testMode,typeof d.container=="string"){if(this._container=s.window.document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),d.maxBounds&&this.setMaxBounds(d.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),s.window!==void 0&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new ro(this,d),this._localFontFamily=d.localFontFamily,this._localIdeographFontFamily=d.localIdeographFontFamily,d.style&&this.setStyle(d.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),d.projection&&this.setProjection(d.projection),this._hash=d.hash&&new ed(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,s.extend({},d.fitBoundsOptions,{duration:0})))),this.resize(),d.attributionControl&&this.addControl(new dt({customAttribution:d.customAttribution})),this._logoControl=new cd,this.addControl(this._logoControl,d.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",o=>{this._update(o.dataType==="style"),this.fire(new s.Event(`${o.dataType}data`,o))}),this.on("dataloading",o=>{this.fire(new s.Event(`${o.dataType}dataloading`,o))})}_getMapId(){return this._mapId}addControl(d,o){if(o===void 0&&(o=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const c=d.onAdd(this);this._controls.push(d);const f=this._controlPositions[o];return o.indexOf("bottom")!==-1?f.insertBefore(c,f.firstChild):f.appendChild(c),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(d);return o>-1&&this._controls.splice(o,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(d){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const o=!this._moving;return o&&this.fire(new s.Event("movestart",d)).fire(new s.Event("move",d)),this.fire(new s.Event("resize",d)),o&&this.fire(new s.Event("moveend",d)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(d){return this.transform.setMaxBounds(s.LngLatBounds.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d?this.setZoom(d):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d?this.setPitch(d):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(d){return d==="auto"?s.window.navigator.language:Array.isArray(d)?d.length===0?void 0:d.map(o=>o==="auto"?s.window.navigator.language:o):d}setLanguage(d){const o=this._parseLanguage(d);if(!this.style||o===this._language)return this;this._language=o,this.style._reloadSources();for(const c of this._controls)c._setLanguage&&c._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(d){return this.style&&d!==this._worldview?(this._worldview=d,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(d){return this._lazyInitEmptyStyle(),d?typeof d=="string"&&(d={name:d}):d=null,this._useExplicitProjection=!!d,this._prioritizeAndUpdateProjection(d,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const d=this.transform,o=d.projection.name;let c;o==="globe"&&d.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(d.setMercatorFromTransition(),c=!0):o==="mercator"&&d.zoom=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(d),this.style.applyProjectionUpdate(),o){this.painter.clearBackgroundTiles();for(const c in this.style._sourceCaches)this.style._sourceCaches[c].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(d){return this.transform.locationPoint3D(s.LngLat.convert(d))}unproject(d){return this.transform.pointLocation3D(s.Point.convert(d))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(d,o,c){if(d==="mouseenter"||d==="mouseover"){let f=!1;const _=T=>{const S=o.filter(z=>this.getLayer(z)),C=S.length?this.queryRenderedFeatures(T.point,{layers:S}):[];C.length?f||(f=!0,c.call(this,new pr(d,this,T.originalEvent,{features:C}))):f=!1},x=()=>{f=!1};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:x}}}if(d==="mouseleave"||d==="mouseout"){let f=!1;const _=T=>{const S=o.filter(C=>this.getLayer(C));(S.length?this.queryRenderedFeatures(T.point,{layers:S}):[]).length?f=!0:f&&(f=!1,c.call(this,new pr(d,this,T.originalEvent)))},x=T=>{f&&(f=!1,c.call(this,new pr(d,this,T.originalEvent)))};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:x}}}{const f=_=>{const x=o.filter(S=>this.getLayer(S)),T=x.length?this.queryRenderedFeatures(_.point,{layers:x}):[];T.length&&(_.features=T,c.call(this,_),delete _.features)};return{layers:new Set(o),listener:c,delegates:{[d]:f}}}}on(d,o,c){if(c===void 0)return super.on(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(f);for(const _ in f.delegates)this.on(_,f.delegates[_]);return this}once(d,o,c){if(c===void 0)return super.once(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);for(const _ in f.delegates)this.once(_,f.delegates[_]);return this}off(d,o,c){if(c===void 0)return super.off(d,o);o=new Set(Array.isArray(o)?o:[o]);const f=(x,T)=>{if(x.size!==T.size)return!1;for(const S of x)if(!T.has(S))return!1;return!0},_=this._delegatedListeners?this._delegatedListeners[d]:void 0;return _&&(x=>{for(let T=0;T{_?this.fire(new s.ErrorEvent(_)):x&&this._updateDiff(x,o)})}else typeof d=="object"&&this._updateDiff(d,o)}_updateDiff(d,o){try{this.style.setState(d)&&this._update(!0)}catch(c){s.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(d,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(d,o){return this._lazyInitEmptyStyle(),this.style.addSource(d,o),this._update(!0)}isSourceLoaded(d){return!!this.style&&this.style._isSourceCacheLoaded(d)}areTilesLoaded(){const d=this.style&&this.style._sourceCaches;for(const o in d){const c=d[o]._tiles;for(const f in c){const _=c[f];if(_.state!=="loaded"&&_.state!=="errored")return!1}}return!0}addSourceType(d,o,c){this._lazyInitEmptyStyle(),this.style.addSourceType(d,o,c)}removeSource(d){return this.style.removeSource(d),this._updateTerrain(),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,o,{pixelRatio:c=1,sdf:f=!1,stretchX:_,stretchY:x,content:T}={}){if(this._lazyInitEmptyStyle(),o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap){const{width:S,height:C,data:z}=s.exported.getImageData(o);this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},z),pixelRatio:c,stretchX:_,stretchY:x,content:T,sdf:f,version:0})}else if(o.width===void 0||o.height===void 0)this.fire(new s.ErrorEvent(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`")));else{const{width:S,height:C}=o,z=o;this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},new Uint8Array(z.data)),pixelRatio:c,stretchX:_,stretchY:x,content:T,sdf:f,version:0,userImage:z}),z.onAdd&&z.onAdd(this,d)}}updateImage(d,o){const c=this.style.getImage(d);if(!c)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const f=o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap?s.exported.getImageData(o):o,{width:_,height:x}=f;_!==void 0&&x!==void 0?_===c.data.width&&x===c.data.height?(c.data.replace(f.data,!(o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap)),this.style.updateImage(d,c)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${_}, ${x}) - must be that same as the previous version of the image - (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,o){s.getImage(this._requestManager.transformRequest(d,s.ResourceType.Image),(c,f)=>{o(c,f instanceof s.window.HTMLImageElement?s.exported.getImageData(f):f)})}listImages(){return this.style.listImages()}addLayer(d,o){return this._lazyInitEmptyStyle(),this.style.addLayer(d,o),this._update(!0)}moveLayer(d,o){return this.style.moveLayer(d,o),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}setLayerZoomRange(d,o,c){return this.style.setLayerZoomRange(d,o,c),this._update(!0)}setFilter(d,o,c={}){return this.style.setFilter(d,o,c),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,o,c,f={}){return this.style.setPaintProperty(d,o,c,f),this._update(!0)}getPaintProperty(d,o){return this.style.getPaintProperty(d,o)}setLayoutProperty(d,o,c,f={}){return this.style.setLayoutProperty(d,o,c,f),this._update(!0)}getLayoutProperty(d,o){return this.style.getLayoutProperty(d,o)}setLight(d,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,o),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(d){return this._lazyInitEmptyStyle(),!d&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(d),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(d){return this._lazyInitEmptyStyle(),this.style.setFog(d),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(d){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(d),this.transform):0}setFeatureState(d,o){return this.style.setFeatureState(d,o),this._update()}removeFeatureState(d,o){return this.style.removeFeatureState(d,o),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}_updateContainerDimensions(){if(!this._container)return;const d=this._container.getBoundingClientRect().width||400,o=this._container.getBoundingClientRect().height||300;let c,f,_,x=this._container;for(;x&&(!f||!_);){const T=s.window.getComputedStyle(x).transform;T&&T!=="none"&&(c=T.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&c[0]!=="0"&&c[0]!=="1"&&(f=c[0]),c[3]&&c[3]!=="0"&&c[3]!=="1"&&(_=c[3])),x=x.parentElement}this._containerWidth=f?Math.abs(d/f):d,this._containerHeight=_?Math.abs(o/_):o}_detectMissingCSS(){s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const d=this._container;d.classList.add("mapboxgl-map"),(this._missingCSSCanary=J("div","mapboxgl-canary",d)).style.visibility="hidden",this._detectMissingCSS();const o=this._canvasContainer=J("div","mapboxgl-canvas-container",d);this._interactive&&o.classList.add("mapboxgl-interactive"),this._canvas=J("canvas","mapboxgl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=J("div","mapboxgl-control-container",d),f=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{f[_]=J("div",`mapboxgl-ctrl-${_}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,o){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(d),this._canvas.height=c*Math.ceil(o),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${o}px`}_addMarker(d){this._markers.push(d)}_removeMarker(d){const o=this._markers.indexOf(d);o!==-1&&this._markers.splice(o,1)}_addPopup(d){this._popups.push(d)}_removePopup(d){const o=this._popups.indexOf(d);o!==-1&&this._popups.splice(o,1)}_setupPainter(){const d=s.extend({},D.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),o=this._useWebGL2&&this._canvas.getContext("webgl2",d),c=o||this._canvas.getContext("webgl",d)||this._canvas.getContext("experimental-webgl",d);c?(this._useWebGL2&&!o&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new ba(c,this.transform,!!o),this.on("data",f=>{f.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(d){d.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:d}))}_contextRestored(d){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:d}))}_onMapScroll(d){if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_requestDomTask(d){!this.loaded()||this.loaded()&&!this.isMoving()?d():this._domRenderTaskQueue.add(d)}_render(d){let o;const c=this.painter.context.extTimerQuery,f=s.exported.now();if(this.listens("gpu-timing-frame")&&(o=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,o)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(d),this._domRenderTaskQueue.run(d),this._removed)return;this._updateProjectionTransition();const _=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,C=this.transform.pitch,z=s.exported.now(),P=new s.EvaluationParameters(S,{now:z,fadeDuration:_,pitch:C,transition:this.style.getTransition()});this.style.update(P)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let x=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),x=this._updateAverageElevation(f),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):x=this._updateAverageElevation(f),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,_,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:_,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),o){const S=s.exported.now()-f;c.endQueryEXT(c.TIME_ELAPSED_EXT,o),setTimeout(()=>{const C=c.getQueryObjectEXT(o,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(o),this.fire(new s.Event("gpu-timing-frame",{cpuTime:S,gpuTime:C})),s.window.performance.mark("frame-gpu",{startTime:f,detail:{gpuTime:C}})},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const C=this.painter.queryGpuTimers(S);this.fire(new s.Event("gpu-timing-layer",{layerTimes:C}))},50)}if(this.listens("gpu-timing-deferred-render")){const S=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const C=this.painter.queryGpuTimeDeferredRender(S);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:C}))},50)}const T=this._sourcesDirty||this._styleDirty||this._placementDirty||x;if(T||this._repaint)this.triggerRepaint();else{const S=!this.isMoving()&&this.loaded();if(S&&(x=this._updateAverageElevation(f,!0)),x)this.triggerRepaint();else if(this._triggerFrame(!1),S&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const C=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:C})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||T||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(d){for(const o of this._markers)d&&!this.getRenderWorldCopies()&&(o._lngLat=o._lngLat.wrap()),o._update();for(const o of this._popups)!d||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}_updateAverageElevation(d,o=!1){const c=f=>(this.transform.averageElevation=f,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&c(0);if((o||d-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(d)){const f=this.transform.averageElevation;let _=this.transform.sampleAverageElevation(),x=!1;this.transform.elevation&&(x=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(_)?_=0:this._averageElevationLastSampledAt=d;const T=Math.abs(f-_);if(T>1){if(this._isInitialLoad||x)return this._averageElevation.jumpTo(_),c(_);this._averageElevation.easeTo(_,d,300)}else if(T>1e-4)return this._averageElevation.jumpTo(_),c(_)}return!!this._averageElevation.isEasing(d)&&c(this._averageElevation.getValue(d))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,d=>{if(d&&(d.message===s.AUTH_ERR_MSG||d.status===401)){const o=this.painter.context.gl;s.storeAuthState(o,!1),this._logoControl instanceof cd&&this._logoControl._updateLogo(),o&&o.clear(o.DEPTH_BUFFER_BIT|o.COLOR_BUFFER_BIT|o.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const d=this._isDragging();this.painter.updateTerrain(this.style,d)}_calculateSpeedIndex(){const d=this.painter.canvasCopy(),o=this.painter.getCanvasCopiesAndTimestamps();o.timeStamps.push(performance.now());const c=this.painter.context.gl,f=c.createFramebuffer();function _(x){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,x,0);const T=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,T),T}return c.bindFramebuffer(c.FRAMEBUFFER,f),this._canvasPixelComparison(_(d),o.canvasCopies.map(_),o.timeStamps)}_canvasPixelComparison(d,o,c){let f=c[1]-c[0];const _=d.length/4;for(let x=0;x{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(o)}))}_preloadTiles(d){const o=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(o,(c,f)=>c._preloadTiles(d,f),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(d){this._trackResize&&this.resize({originalEvent:d})._update()}_onVisibilityChange(){s.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(d){this._showTerrainWireframe!==d&&(this._showTerrainWireframe=d,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(d){this._speedIndexTiming!==d&&(this._speedIndexTiming=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(d){this._showTileAABBs!==d&&(this._showTileAABBs=d,d&&this._update())}_setCacheLimits(d,o){s.setCacheLimits(d,o)}get version(){return s.version}},NavigationControl:class{constructor(d){this.options=s.extend({},hy,d),this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",o=>{this._map&&this._map.zoomIn({},{originalEvent:o})}),J("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",o=>{this._map&&this._map.zoomOut({},{originalEvent:o})}),J("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",o=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:o}):c.resetNorth({},{originalEvent:o}))}),this._compassIcon=J("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const d=this._map;if(!d)return;const o=d.getZoom(),c=o===d.getMaxZoom(),f=o===d.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const d=this._map;if(!d)return;const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(d.transform.pitch*(Math.PI/180)),.5)}) rotateX(${d.transform.pitch}deg) rotateZ(${d.transform.angle*(180/Math.PI)}deg)`:`rotate(${d.transform.angle*(180/Math.PI)}deg)`;d._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=o)})}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),d.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&d.on("pitch",this._rotateCompassArrow),d.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new dy(d,this._compass,this.options.visualizePitch)),this._container}onRemove(){const d=this._map;d&&(this._container.remove(),this.options.showZoom&&d.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&d.off("pitch",this._rotateCompassArrow),d.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(d,o){const c=J("button",d,this._container);return c.type="button",c.addEventListener("click",o),c}_setButtonTitle(d,o){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${o}`);d.setAttribute("aria-label",c),d.firstElementChild&&d.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(d){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},pd,d),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Sa(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(d){return this._map=d,this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(d){const o=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,d(c)};this._supportsGeolocation!==void 0?d(this._supportsGeolocation):s.window.navigator.permissions!==void 0?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>o(c.state!=="denied")).catch(()=>o()):o()}_isOutOfMapMaxBounds(d){const o=this._map.getMaxBounds(),c=d.coords;return!!o&&(c.longitudeo.getEast()||c.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",d)),this._finish()}}_updateCamera(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude),c=d.coords.accuracy,f=this._map.getBearing(),_=s.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(o.toBounds(c),_,{geolocateSource:!0})}_updateMarker(d){if(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const d=this._map.transform,o=s.mercatorZfromAltitude(1,d._center.lat)*d.worldSize,c=Math.ceil(2*this._accuracy*o);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",d)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(d){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=J("button","mapboxgl-ctrl-geolocate",this._container),J("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",d===!1){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=J("div","mapboxgl-user-location"),this._dotElement.appendChild(J("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(J("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new at({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=J("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new at({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",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(d){this._userLocationDotMarker&&(d.webkitCompassHeading?this._heading=d.webkitCompassHeading:d.absolute===!0&&(this._heading=-1*d.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(d={maximumAge:6e5,timeout:0},this._noTimeout=!0):(d=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,d),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const d=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};s.window.DeviceMotionEvent!==void 0&&typeof s.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&d()}).catch(console.error):d()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:dt,ScaleControl:class{constructor(d){this.options=s.extend({},fd,d),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const d=this.options.maxWidth||100,o=this._map,c=o._containerHeight/2,f=o._containerWidth/2-d/2,_=o.unproject([f,c]),x=o.unproject([f+d,c]),T=_.distanceTo(x);if(this.options.unit==="imperial"){const S=3.2808*T;S>5280?this._setScale(d,S/5280,"mile"):this._setScale(d,S,"foot")}else this.options.unit==="nautical"?this._setScale(d,T/1852,"nautical-mile"):T>=1e3?this._setScale(d,T/1e3,"kilometer"):this._setScale(d,T,"meter")}_setScale(d,o,c){this._map._requestDomTask(()=>{const f=function(x){const T=Math.pow(10,`${Math.floor(x)}`.length-1);let S=x/T;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:S>=1?1:function(C){const z=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*z)/z}(S),T*S}(o),_=f/o;this._container.innerHTML=this._isNumberFormatSupported&&c!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(f):`${f} ${md[c]}`,this._container.style.width=d*_+"px"})}onAdd(d){return this._map=d,this._language=d.getLanguage(),this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-scale",d.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(d){this._language=d,this._update()}setUnit(d){this.options.unit=d,this._update()}},FullscreenControl:class{constructor(d){this._fullscreen=!1,d&&d.container&&(d.container instanceof s.window.HTMLElement?this._container=d.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const d=this._fullscreenButton=J("button","mapboxgl-ctrl-fullscreen",this._controlContainer);J("span","mapboxgl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",d)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(d){super(),this.options=s.extend(Object.create(hd),d),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(d&&d.className?d.className.trim().split(/\s+/):[])}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&d.on("preclick",this._onClose),this.options.closeOnMove&&d.on("move",this._onClose),d.on("remove",this.remove),this._update(),d._addPopup(this),this._focusFirstElement(),this._trackPointer?(d.on("mousemove",this._onMouseEvent),d.on("mouseup",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")):d.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const d=this._map;return d&&(d.off("move",this._update),d.off("move",this._onClose),d.off("preclick",this._onClose),d.off("click",this._onClose),d.off("remove",this.remove),d.off("mousemove",this._onMouseEvent),d.off("mouseup",this._onMouseEvent),d.off("drag",this._onMouseEvent),d._canvasContainer&&d._canvasContainer.classList.remove("mapboxgl-track-pointer"),d._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(d){this._lngLat=s.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update();const o=this._map;return o&&(o.on("move",this._update),o.off("mousemove",this._onMouseEvent),o._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const d=this._map;return d&&(d.off("move",this._update),d.on("mousemove",this._onMouseEvent),d.on("drag",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(s.window.document.createTextNode(d))}setHTML(d){const o=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let f;for(c.innerHTML=d;f=c.firstChild,f;)o.appendChild(f);return this.setDOMContent(o)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){let o=this._content;if(o)for(;o.hasChildNodes();)o.firstChild&&o.removeChild(o.firstChild);else o=this._content=J("div","mapboxgl-popup-content",this._container||void 0);if(o.appendChild(d),this.options.closeButton){const c=this._closeButton=J("button","mapboxgl-popup-close-button",o);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(d){return this._classList.add(d),this._updateClassList(),this}removeClassName(d){return this._classList.delete(d),this._updateClassList(),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){let o;return this._classList.delete(d)?o=!1:(this._classList.add(d),o=!0),this._updateClassList(),o}_onMouseEvent(d){this._update(d.point)}_getAnchor(d){if(this.options.anchor)return this.options.anchor;const o=this._map,c=this._container,f=this._pos;if(!o||!c||!f)return"bottom";const _=c.offsetWidth,x=c.offsetHeight,T=f.x<_/2,S=f.x>o.transform.width-_/2;if(f.y+do.transform.height-x){if(T)return"bottom-left";if(S)return"bottom-right"}return T?"left":S?"right":"bottom"}_updateClassList(){const d=this._container;if(!d)return;const o=[...this._classList];o.push("mapboxgl-popup"),this._anchor&&o.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&o.push("mapboxgl-popup-track-pointer"),d.className=o.join(" ")}_update(d){const o=this._map,c=this._content;if(!o||!this._lngLat&&!this._trackPointer||!c)return;let f=this._container;if(f||(f=this._container=J("div","mapboxgl-popup",o.getContainer()),this._tip=J("div","mapboxgl-popup-tip",f),f.appendChild(c)),this.options.maxWidth&&f.style.maxWidth!==this.options.maxWidth&&(f.style.maxWidth=this.options.maxWidth),o.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ia(this._lngLat,this._pos,o.transform)),!this._trackPointer||d){const _=this._pos=this._trackPointer&&d?d:o.project(this._lngLat),x=Wf(this.options.offset),T=this._anchor=this._getAnchor(x.y),S=Wf(this.options.offset,T),C=_.add(S).round();o._requestDomTask(()=>{this._container&&T&&(this._container.style.transform=`${Os[T]} translate(${C.x}px,${C.y}px)`)})}if(!this._marker&&o._showingGlobe()){const _=s.isLngLatBehindGlobe(o.transform,this._lngLat)?0:1;this._setOpacity(_)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(uy);d&&d.focus()}_onClose(){this.remove()}_setOpacity(d){this._container&&(this._container.style.opacity=`${d}`),this._content&&(this._content.style.pointerEvents=d?"auto":"none")}},Marker:at,Style:to,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Pf,Evented:s.Evented,config:s.config,prewarm:function(){ha().acquire(Ji)},clearPrewarmedResources:function(){const d=Or;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Ji),Or=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(d){s.config.ACCESS_TOKEN=d},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(d){s.config.API_URL=d},get workerCount(){return hr.workerCount},set workerCount(d){hr.workerCount=d},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(d){s.config.MAX_PARALLEL_IMAGE_REQUESTS=d},clearStorage(d){s.clearTileCache(d)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return ka});var E=m;return E})})(rk);var Vx=rk.exports;const TU=g1(Vx),SU=LP({__proto__:null,default:TU},[Vx]);const lv="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA",HT="/examples/who-wins-b2s/rural_places_5000_plus.json",AU=wU({typography:{fontFamily:"Montserrat"},palette:{primary:{main:"#00835D",light:"#A3E2B5",dark:"#26535C",contrastText:"white"}}});function CU(){var m;const e=ut.useContext(QC),n=ut.useRef(null),l=ut.useMemo(()=>new Vx.Popup().setText("Hello world!"),[]);ut.useCallback(()=>{var v;(v=n.current)==null||v.togglePopup()},[]);let h=!1;return ut.useEffect(()=>{if(e&&!e.data.hasOwnProperty("placeData")&&!h){console.log("Initial place data fetch..."),console.log(HT),h=!0;const v=window.document.getElementById("info-wrapper");v!==null&&(v.style.opacity="1.0",v.style.position="absolute",v.style.background=`rgba(46, 60, 67, 0.5) url('${e.baseURL}/images/loading.gif') no-repeat fixed center`,v.style.backgroundSize="20px"),e.setData({...(e==null?void 0:e.data)||{},placeData:null}),e==null||e.apiClient.get(HT).then(E=>{E&&E.hasOwnProperty("data")&&(console.log("Data result:",E.data.features),e.setData({...e.data,placeData:E.data.features}),h=!1,v!==null&&(v.style.opacity="0.0",v.style.pointerEvents="none",setTimeout(()=>{v.style.background="transparent"},533)))}).catch(E=>{console.error("Error fetching data:",E),h=!1,v!==null&&(v.style.opacity="0.0",v.style.pointerEvents="none",setTimeout(()=>{v.style.background="transparent"},533))})}},[e==null?void 0:e.data]),ut.createElement(EU,{theme:AU},ut.createElement("div",{className:"slippy-map"},ut.createElement(QO,{mapboxAccessToken:lv,initialViewState:{latitude:40,longitude:-100,pitch:45,zoom:3.5},style:{width:600,height:400},mapStyle:`https://api.mapbox.com/styles/v1/ruralinno/cl010e7b7001p15pe3l0306hv?access_token=${lv}`},!!(e!=null&&e.data)&&!!((m=e==null?void 0:e.data)!=null&&m.placeData)&&e.data.placeData.length>0&&!!n&&typeof n!==void 0&&ut.createElement(eI,{longitude:-122.4,latitude:37.8,color:"red",popup:l,ref:n}),ut.createElement(uF,{mapboxAccessToken:lv,position:"top-right"}),ut.createElement(t4,{position:"top-right"}),ut.createElement(e4,{position:"top-right"}),ut.createElement(n4,{position:"bottom-left",unit:"imperial"}))),ut.createElement("div",{id:"info-wrapper",style:{pointerEvents:"none",position:"absolute",top:0,minWidth:"100vw",minHeight:"100vh",transition:"opacity 5.05s ease-in-out 0.025s",opacity:"initial",background:"transparent",backgroundSize:"20px",zIndex:100}}))}const IU="https://cori-risi-apps.s3.amazonaws.com";function kU(e){sC(e).render(ut.createElement(ut.StrictMode,null,ut.createElement(bO,{baseURL:IU},ut.createElement(CU,null))))}kU(document.getElementById("app")); diff --git a/assets/index-1c2d9ba0.css b/assets/index-1c2d9ba0.css deleted file mode 100644 index ed466c7..0000000 --- a/assets/index-1c2d9ba0.css +++ /dev/null @@ -1 +0,0 @@ -.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}:root,[data-amplify-theme]{--amplify-components-button-link-color: #ffffff;--amplify-components-button-link-loading-background-color: #2c3e50;--amplify-components-button-link-loading-border-color: #1a242f;--amplify-components-button-link-disabled-background-color: #2c3e50;--amplify-components-button-link-disabled-border-color: #1a242f;--amplify-components-button-link-active-border-color: #1a242f;--amplify-components-button-link-focus-border-color: #1a242f;--amplify-components-button-link-hover-border-color: #1a242f;--amplify-components-button-link-border-color: #1a242f;--amplify-components-button-link-background-color: #2c3e50;--amplify-components-button-menu-background-color: #2c3e50;--amplify-components-button-primary-background-color: #2c3e50;--amplify-components-button-primary-active-background-color: #1a242f;--amplify-components-button-primary-active-border-color: #1a242f;--amplify-components-button-primary-focus-background-color: #1a242f;--amplify-components-button-primary-focus-border-color: #1a242f;--amplify-components-button-primary-hover-background-color: #1a242f;--amplify-components-button-primary-hover-border-color: #1a242f;--amplify-components-button-primary-loading-border-color: #1a242f;--amplify-components-button-primary-disabled-border-color: #1a242f;--amplify-components-button-primary-border-color: #1a242f;--amplify-components-button-disabled-background-color: #2c3e50;--amplify-components-button-loading-background-color: #2c3e50;--amplify-components-tabs-item-active-color: #18bc9c;--amplify-components-tabs-item-border-style: 4px solid #2c3e50;--amplify-components-tabs-item-active-border-color: #2c3e50}[data-amplify-theme=default-theme] [data-amplify-authenticator] [data-amplify-router]{background-color:var(--amplify-components-authenticator-router-background-color);box-shadow:var(--amplify-components-authenticator-router-box-shadow);border-color:transparent}.ApiContextProvider_amplify-button--primary__x3TB9{border-width:var(--amplify-components-button-primary-border-width);background-color:var(--amplify-components-button-primary-background-color);border-color:var(--amplify-components-button-primary-border-color);color:var(--amplify-components-button-primary-color);--amplify-internal-button-disabled-border-color: var( --amplify-components-button-primary-disabled-border-color );--amplify-internal-button-disabled-background-color: var( --amplify-components-button-primary-disabled-background-color );--amplify-internal-button-disabled-color: var( --amplify-components-button-primary-disabled-color );--amplify-internal-button-loading-background-color: var( --amplify-components-button-primary-loading-background-color );--amplify-internal-button-loading-border-color: var( --amplify-components-button-primary-loading-border-color );--amplify-internal-button-loading-color: var( --amplify-components-button-primary-loading-color )}.ApiContextProvider_amplify-button--primary__x3TB9:hover{background-color:var(--amplify-components-button-primary-hover-background-color);border-color:var(--amplify-components-button-primary-hover-border-color);color:var(--amplify-components-button-primary-hover-color)}.ApiContextProvider_amplify-button--primary__x3TB9:focus{background-color:var(--amplify-components-button-primary-focus-background-color);border-color:var(--amplify-components-button-primary-focus-border-color);color:var(--amplify-components-button-primary-focus-color);box-shadow:var(--amplify-components-button-primary-focus-box-shadow)}.ApiContextProvider_amplify-button--primary__x3TB9:active{background-color:var(--amplify-components-button-primary-active-background-color);border-color:var(--amplify-components-button-primary-active-border-color);color:var(--amplify-components-button-primary-active-color)}.ApiContextProvider_amplify-tabs-item__-6nTX[data-state=active]{color:var(--amplify-components-tabs-item-active-color);border-color:var(--amplify-components-tabs-item-active-border-color);background-color:var(--amplify-components-tabs-item-active-background-color);transition-property:none}.ApiContextProvider_amplify-input__ycAUW.ApiContextProvider_amplify-field-group__control__cRTcr{text-align:left}.CategoricalLegend-module_categorical-legend__KiFcS{display:flex;flex-wrap:wrap;margin:1.5rem 0px}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU{display:flex;justify-content:space-around;margin:0 20px 5px 0}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU .CategoricalLegend-module_key__1Hgb-{height:1rem;width:1rem;opacity:.9}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU p{line-height:1rem;font-size:1rem;margin:0 0 0 6px}.HoverInfo-module_tooltip__3wVpX{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.HoverInfo-module_tooltip__3wVpX h3{margin:.5rem 0rem}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_details__4eyQ7{margin:.1rem 0rem;line-height:1.6}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_prop-score__DKjwo{font-weight:400;margin:0}.slippy-map{position:relative;width:100vw;height:100vh}.slippy-map>*{overflow:hidden}.slippy-map>.mapboxgl-map{width:100%!important;height:100%!important}.tooltip{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.tooltip h3{margin:.5rem 0rem}.tooltip .details{margin:.1rem 0rem;line-height:1.6}.tooltip .prop-score{font-weight:400;margin:0}.tooltip .click-prompt{font-style:italic;font-weight:600;margin-top:5px}.tooltip p{margin:0}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body{font-family:Montserrat,Arial,Helvetica,sans-serif}h1{font-size:2rem}h2{font-size:1.8rem}h3{font-size:1.6rem}h4{font-size:1.4rem}h5{font-size:1.2rem}h6{font-size:1rem}h1,h2,h3,h4,h5,h6{font-family:Montserrat,Arial,Helvetica,sans-serif;margin-top:.5em;margin-bottom:.5em}p,a{font-family:Montserrat,Arial,Helvetica,sans-serif;line-height:1.4}a{margin-top:0;margin-bottom:0;color:#00835d;text-decoration:underline;font-weight:700}a:hover{text-decoration:underline;cursor:pointer}.control-panel{position:absolute;top:0;right:0;max-width:320px;background:#fff;box-shadow:0 2px 4px #0000004d;padding:12px 24px;margin:20px;font-size:13px;line-height:2;color:#6b6b76;text-transform:uppercase;outline:none;z-index:2}.mapboxgl-ctrl,.mapboxgl-popup{font-family:Bitter,serif}.mapboxgl-popup .mapboxgl-popup-content{font-family:Bitter,serif!important;font-size:12pt;background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:12px 20px;pointer-events:auto;position:relative} diff --git a/assets/index-14d1d7ab.js b/assets/index-a6df8453.js similarity index 99% rename from assets/index-14d1d7ab.js rename to assets/index-a6df8453.js index 8784286..c03700b 100644 --- a/assets/index-14d1d7ab.js +++ b/assets/index-a6df8453.js @@ -1385,4 +1385,4 @@ precision highp float; translate(${c.x}px,${c.y}px) `}_calculateXYTransform(){const o=this._pos,c=this._map,f=this.getPitchAlignment();if(!c||!o||f!=="map")return"";if(!c._showingGlobe()){const C=c.getPitch();return C?`rotateX(${C}deg)`:""}const _=s.radToDeg(s.globeTiltAtLngLat(c.transform,this._lngLat)),v=o.sub(s.globeCenterToScreenPoint(c.transform)),E=Math.abs(v.x)+Math.abs(v.y);if(E===0)return"";const S=_/E;return`rotateX(${-v.y*S}deg) rotateY(${v.x*S}deg)`}_calculateZTransform(){const o=this._pos,c=this._map;if(!c||!o)return"";let f=0;const _=this.getRotationAlignment();if(_==="map")if(c._showingGlobe()){const v=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),E=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(v);f=s.radToDeg(Math.atan2(E.y,E.x))-90}else f=-c.getBearing();else if(_==="horizon"){const v=s.smoothstep(4,6,c.getZoom()),E=s.globeCenterToScreenPoint(c.transform);E.y+=v*c.transform.height;const S=o.sub(E),C=s.radToDeg(Math.atan2(S.y,S.x));f=(C>90?C-270:C+90)*(1-v)}return f+=this._rotation,f?`rotateZ(${f}deg)`:""}_update(o){s.window.cancelAnimationFrame(this._updateFrameId);const c=this._map;c&&(c.transform.renderWorldCopies&&(this._lngLat=aa(this._lngLat,this._pos,c.transform)),this._pos=c.project(this._lngLat),o===!0?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),c._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(c._showingGlobe()||c.getTerrain()||c.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(o){return this._offset=s.Point.convert(o),this._update(),this}_onMove(o){const c=this._map;if(!c)return;const f=this._pointerdownPos,_=this._positionDelta;if(f&&_){if(!this._isDragging){const v=this._clickTolerance||c._clickTolerance;if(o.point.dist(f)=this._endTime)return this._end;const c=s.easeCubicInOut((o-this._startTime)/(this._endTime-this._startTime));return this._start*(1-c)+this._end*c}isEasing(o){return o>=this._startTime&&o<=this._endTime}jumpTo(o){this._startTime=-1/0,this._endTime=-1/0,this._start=o,this._end=o}easeTo(o,c,f){this._start=this.getValue(c),this._end=o,this._startTime=c,this._endTime=c+f}}const nf={"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","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},rf={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},r_={showCompass:!0,showZoom:!0,visualizePitch:!1};class o_{constructor(o,c,f=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new Th({clickTolerance:o.dragRotate._mouseRotate._clickTolerance}),this.map=o,f&&(this.mousePitch=new Sh({clickTolerance:o.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener("mousedown",this.mousedown),c.addEventListener("touchstart",this.touchstart,{passive:!1}),c.addEventListener("touchmove",this.touchmove),c.addEventListener("touchend",this.touchend),c.addEventListener("touchcancel",this.reset)}down(o,c){this.mouseRotate.mousedown(o,c),this.mousePitch&&this.mousePitch.mousedown(o,c),ue()}move(o,c){const f=this.map,_=this.mouseRotate.mousemoveWindow(o,c),v=_&&_.bearingDelta;if(v&&f.setBearing(f.getBearing()+v),this.mousePitch){const E=this.mousePitch.mousemoveWindow(o,c),S=E&&E.pitchDelta;S&&f.setPitch(f.getPitch()+S)}}off(){const o=this.element;o.removeEventListener("mousedown",this.mousedown),o.removeEventListener("touchstart",this.touchstart,{passive:!1}),o.removeEventListener("touchmove",this.touchmove),o.removeEventListener("touchend",this.touchend),o.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){re(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(o){this.down(s.extend({},o,{ctrlKey:!0,preventDefault:()=>o.preventDefault()}),je(this.element,o)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(o){this.move(o,je(this.element,o))}mouseup(o){this.mouseRotate.mouseupWindow(o),this.mousePitch&&this.mousePitch.mouseupWindow(o),this.offTemp()}touchstart(o){o.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=tt(this.element,o.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>o.preventDefault()},this._startPos))}touchmove(o){o.targetTouches.length!==1?this.reset():(this._lastPos=tt(this.element,o.targetTouches)[0],this.move({preventDefault:()=>o.preventDefault()},this._lastPos))}touchend(o){o.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(d.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(d.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new ia(d.minZoom,d.maxZoom,d.minPitch,d.maxPitch,d.renderWorldCopies),d),this._interactive=d.interactive,this._minTileCacheSize=d.minTileCacheSize,this._maxTileCacheSize=d.maxTileCacheSize,this._failIfMajorPerformanceCaveat=d.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=d.preserveDrawingBuffer,this._antialias=d.antialias,this._useWebGL2=d.useWebGL2,this._trackResize=d.trackResize,this._bearingSnap=d.bearingSnap,this._refreshExpiredTiles=d.refreshExpiredTiles,this._fadeDuration=d.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=d.crossSourceCollisions,this._collectResourceTiming=d.collectResourceTiming,this._optimizeForTerrain=d.optimizeForTerrain,this._language=this._parseLanguage(d.language),this._worldview=d.worldview,this._renderTaskQueue=new kh,this._domRenderTaskQueue=new kh,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},nf,d.locale),this._clickTolerance=d.clickTolerance,this._cooperativeGestures=d.cooperativeGestures,this._performanceMetricsCollection=d.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new zh(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(d.transformRequest,d.accessToken,d.testMode),this._silenceAuthErrors=!!d.testMode,typeof d.container=="string"){if(this._container=s.window.document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),d.maxBounds&&this.setMaxBounds(d.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),s.window!==void 0&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new Gr(this,d),this._localFontFamily=d.localFontFamily,this._localIdeographFontFamily=d.localIdeographFontFamily,d.style&&this.setStyle(d.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),d.projection&&this.setProjection(d.projection),this._hash=d.hash&&new xh(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,s.extend({},d.fitBoundsOptions,{duration:0})))),this.resize(),d.attributionControl&&this.addControl(new ht({customAttribution:d.customAttribution})),this._logoControl=new Mh,this.addControl(this._logoControl,d.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",o=>{this._update(o.dataType==="style"),this.fire(new s.Event(`${o.dataType}data`,o))}),this.on("dataloading",o=>{this.fire(new s.Event(`${o.dataType}dataloading`,o))})}_getMapId(){return this._mapId}addControl(d,o){if(o===void 0&&(o=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const c=d.onAdd(this);this._controls.push(d);const f=this._controlPositions[o];return o.indexOf("bottom")!==-1?f.insertBefore(c,f.firstChild):f.appendChild(c),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(d);return o>-1&&this._controls.splice(o,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(d){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const o=!this._moving;return o&&this.fire(new s.Event("movestart",d)).fire(new s.Event("move",d)),this.fire(new s.Event("resize",d)),o&&this.fire(new s.Event("moveend",d)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(d){return this.transform.setMaxBounds(s.LngLatBounds.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d?this.setZoom(d):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d?this.setPitch(d):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(d){return d==="auto"?s.window.navigator.language:Array.isArray(d)?d.length===0?void 0:d.map(o=>o==="auto"?s.window.navigator.language:o):d}setLanguage(d){const o=this._parseLanguage(d);if(!this.style||o===this._language)return this;this._language=o,this.style._reloadSources();for(const c of this._controls)c._setLanguage&&c._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(d){return this.style&&d!==this._worldview?(this._worldview=d,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(d){return this._lazyInitEmptyStyle(),d?typeof d=="string"&&(d={name:d}):d=null,this._useExplicitProjection=!!d,this._prioritizeAndUpdateProjection(d,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const d=this.transform,o=d.projection.name;let c;o==="globe"&&d.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(d.setMercatorFromTransition(),c=!0):o==="mercator"&&d.zoom=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(d),this.style.applyProjectionUpdate(),o){this.painter.clearBackgroundTiles();for(const c in this.style._sourceCaches)this.style._sourceCaches[c].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(d){return this.transform.locationPoint3D(s.LngLat.convert(d))}unproject(d){return this.transform.pointLocation3D(s.Point.convert(d))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(d,o,c){if(d==="mouseenter"||d==="mouseover"){let f=!1;const _=E=>{const S=o.filter(z=>this.getLayer(z)),C=S.length?this.queryRenderedFeatures(E.point,{layers:S}):[];C.length?f||(f=!0,c.call(this,new oi(d,this,E.originalEvent,{features:C}))):f=!1},v=()=>{f=!1};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:v}}}if(d==="mouseleave"||d==="mouseout"){let f=!1;const _=E=>{const S=o.filter(C=>this.getLayer(C));(S.length?this.queryRenderedFeatures(E.point,{layers:S}):[]).length?f=!0:f&&(f=!1,c.call(this,new oi(d,this,E.originalEvent)))},v=E=>{f&&(f=!1,c.call(this,new oi(d,this,E.originalEvent)))};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:v}}}{const f=_=>{const v=o.filter(S=>this.getLayer(S)),E=v.length?this.queryRenderedFeatures(_.point,{layers:v}):[];E.length&&(_.features=E,c.call(this,_),delete _.features)};return{layers:new Set(o),listener:c,delegates:{[d]:f}}}}on(d,o,c){if(c===void 0)return super.on(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(f);for(const _ in f.delegates)this.on(_,f.delegates[_]);return this}once(d,o,c){if(c===void 0)return super.once(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);for(const _ in f.delegates)this.once(_,f.delegates[_]);return this}off(d,o,c){if(c===void 0)return super.off(d,o);o=new Set(Array.isArray(o)?o:[o]);const f=(v,E)=>{if(v.size!==E.size)return!1;for(const S of v)if(!E.has(S))return!1;return!0},_=this._delegatedListeners?this._delegatedListeners[d]:void 0;return _&&(v=>{for(let E=0;E{_?this.fire(new s.ErrorEvent(_)):v&&this._updateDiff(v,o)})}else typeof d=="object"&&this._updateDiff(d,o)}_updateDiff(d,o){try{this.style.setState(d)&&this._update(!0)}catch(c){s.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(d,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(d,o){return this._lazyInitEmptyStyle(),this.style.addSource(d,o),this._update(!0)}isSourceLoaded(d){return!!this.style&&this.style._isSourceCacheLoaded(d)}areTilesLoaded(){const d=this.style&&this.style._sourceCaches;for(const o in d){const c=d[o]._tiles;for(const f in c){const _=c[f];if(_.state!=="loaded"&&_.state!=="errored")return!1}}return!0}addSourceType(d,o,c){this._lazyInitEmptyStyle(),this.style.addSourceType(d,o,c)}removeSource(d){return this.style.removeSource(d),this._updateTerrain(),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,o,{pixelRatio:c=1,sdf:f=!1,stretchX:_,stretchY:v,content:E}={}){if(this._lazyInitEmptyStyle(),o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap){const{width:S,height:C,data:z}=s.exported.getImageData(o);this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},z),pixelRatio:c,stretchX:_,stretchY:v,content:E,sdf:f,version:0})}else if(o.width===void 0||o.height===void 0)this.fire(new s.ErrorEvent(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`")));else{const{width:S,height:C}=o,z=o;this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},new Uint8Array(z.data)),pixelRatio:c,stretchX:_,stretchY:v,content:E,sdf:f,version:0,userImage:z}),z.onAdd&&z.onAdd(this,d)}}updateImage(d,o){const c=this.style.getImage(d);if(!c)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const f=o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap?s.exported.getImageData(o):o,{width:_,height:v}=f;_!==void 0&&v!==void 0?_===c.data.width&&v===c.data.height?(c.data.replace(f.data,!(o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap)),this.style.updateImage(d,c)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${_}, ${v}) must be that same as the previous version of the image - (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,o){s.getImage(this._requestManager.transformRequest(d,s.ResourceType.Image),(c,f)=>{o(c,f instanceof s.window.HTMLImageElement?s.exported.getImageData(f):f)})}listImages(){return this.style.listImages()}addLayer(d,o){return this._lazyInitEmptyStyle(),this.style.addLayer(d,o),this._update(!0)}moveLayer(d,o){return this.style.moveLayer(d,o),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}setLayerZoomRange(d,o,c){return this.style.setLayerZoomRange(d,o,c),this._update(!0)}setFilter(d,o,c={}){return this.style.setFilter(d,o,c),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,o,c,f={}){return this.style.setPaintProperty(d,o,c,f),this._update(!0)}getPaintProperty(d,o){return this.style.getPaintProperty(d,o)}setLayoutProperty(d,o,c,f={}){return this.style.setLayoutProperty(d,o,c,f),this._update(!0)}getLayoutProperty(d,o){return this.style.getLayoutProperty(d,o)}setLight(d,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,o),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(d){return this._lazyInitEmptyStyle(),!d&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(d),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(d){return this._lazyInitEmptyStyle(),this.style.setFog(d),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(d){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(d),this.transform):0}setFeatureState(d,o){return this.style.setFeatureState(d,o),this._update()}removeFeatureState(d,o){return this.style.removeFeatureState(d,o),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}_updateContainerDimensions(){if(!this._container)return;const d=this._container.getBoundingClientRect().width||400,o=this._container.getBoundingClientRect().height||300;let c,f,_,v=this._container;for(;v&&(!f||!_);){const E=s.window.getComputedStyle(v).transform;E&&E!=="none"&&(c=E.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&c[0]!=="0"&&c[0]!=="1"&&(f=c[0]),c[3]&&c[3]!=="0"&&c[3]!=="1"&&(_=c[3])),v=v.parentElement}this._containerWidth=f?Math.abs(d/f):d,this._containerHeight=_?Math.abs(o/_):o}_detectMissingCSS(){s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const d=this._container;d.classList.add("mapboxgl-map"),(this._missingCSSCanary=oe("div","mapboxgl-canary",d)).style.visibility="hidden",this._detectMissingCSS();const o=this._canvasContainer=oe("div","mapboxgl-canvas-container",d);this._interactive&&o.classList.add("mapboxgl-interactive"),this._canvas=oe("canvas","mapboxgl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=oe("div","mapboxgl-control-container",d),f=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{f[_]=oe("div",`mapboxgl-ctrl-${_}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,o){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(d),this._canvas.height=c*Math.ceil(o),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${o}px`}_addMarker(d){this._markers.push(d)}_removeMarker(d){const o=this._markers.indexOf(d);o!==-1&&this._markers.splice(o,1)}_addPopup(d){this._popups.push(d)}_removePopup(d){const o=this._popups.indexOf(d);o!==-1&&this._popups.splice(o,1)}_setupPainter(){const d=s.extend({},F.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),o=this._useWebGL2&&this._canvas.getContext("webgl2",d),c=o||this._canvas.getContext("webgl",d)||this._canvas.getContext("experimental-webgl",d);c?(this._useWebGL2&&!o&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new ta(c,this.transform,!!o),this.on("data",f=>{f.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(d){d.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:d}))}_contextRestored(d){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:d}))}_onMapScroll(d){if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_requestDomTask(d){!this.loaded()||this.loaded()&&!this.isMoving()?d():this._domRenderTaskQueue.add(d)}_render(d){let o;const c=this.painter.context.extTimerQuery,f=s.exported.now();if(this.listens("gpu-timing-frame")&&(o=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,o)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(d),this._domRenderTaskQueue.run(d),this._removed)return;this._updateProjectionTransition();const _=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,C=this.transform.pitch,z=s.exported.now(),P=new s.EvaluationParameters(S,{now:z,fadeDuration:_,pitch:C,transition:this.style.getTransition()});this.style.update(P)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let v=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),v=this._updateAverageElevation(f),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):v=this._updateAverageElevation(f),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,_,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:_,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),o){const S=s.exported.now()-f;c.endQueryEXT(c.TIME_ELAPSED_EXT,o),setTimeout(()=>{const C=c.getQueryObjectEXT(o,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(o),this.fire(new s.Event("gpu-timing-frame",{cpuTime:S,gpuTime:C})),s.window.performance.mark("frame-gpu",{startTime:f,detail:{gpuTime:C}})},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const C=this.painter.queryGpuTimers(S);this.fire(new s.Event("gpu-timing-layer",{layerTimes:C}))},50)}if(this.listens("gpu-timing-deferred-render")){const S=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const C=this.painter.queryGpuTimeDeferredRender(S);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:C}))},50)}const E=this._sourcesDirty||this._styleDirty||this._placementDirty||v;if(E||this._repaint)this.triggerRepaint();else{const S=!this.isMoving()&&this.loaded();if(S&&(v=this._updateAverageElevation(f,!0)),v)this.triggerRepaint();else if(this._triggerFrame(!1),S&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const C=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:C})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||E||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(d){for(const o of this._markers)d&&!this.getRenderWorldCopies()&&(o._lngLat=o._lngLat.wrap()),o._update();for(const o of this._popups)!d||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}_updateAverageElevation(d,o=!1){const c=f=>(this.transform.averageElevation=f,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&c(0);if((o||d-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(d)){const f=this.transform.averageElevation;let _=this.transform.sampleAverageElevation(),v=!1;this.transform.elevation&&(v=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(_)?_=0:this._averageElevationLastSampledAt=d;const E=Math.abs(f-_);if(E>1){if(this._isInitialLoad||v)return this._averageElevation.jumpTo(_),c(_);this._averageElevation.easeTo(_,d,300)}else if(E>1e-4)return this._averageElevation.jumpTo(_),c(_)}return!!this._averageElevation.isEasing(d)&&c(this._averageElevation.getValue(d))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,d=>{if(d&&(d.message===s.AUTH_ERR_MSG||d.status===401)){const o=this.painter.context.gl;s.storeAuthState(o,!1),this._logoControl instanceof Mh&&this._logoControl._updateLogo(),o&&o.clear(o.DEPTH_BUFFER_BIT|o.COLOR_BUFFER_BIT|o.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const d=this._isDragging();this.painter.updateTerrain(this.style,d)}_calculateSpeedIndex(){const d=this.painter.canvasCopy(),o=this.painter.getCanvasCopiesAndTimestamps();o.timeStamps.push(performance.now());const c=this.painter.context.gl,f=c.createFramebuffer();function _(v){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,v,0);const E=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,E),E}return c.bindFramebuffer(c.FRAMEBUFFER,f),this._canvasPixelComparison(_(d),o.canvasCopies.map(_),o.timeStamps)}_canvasPixelComparison(d,o,c){let f=c[1]-c[0];const _=d.length/4;for(let v=0;v{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(o)}))}_preloadTiles(d){const o=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(o,(c,f)=>c._preloadTiles(d,f),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(d){this._trackResize&&this.resize({originalEvent:d})._update()}_onVisibilityChange(){s.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(d){this._showTerrainWireframe!==d&&(this._showTerrainWireframe=d,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(d){this._speedIndexTiming!==d&&(this._speedIndexTiming=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(d){this._showTileAABBs!==d&&(this._showTileAABBs=d,d&&this._update())}_setCacheLimits(d,o){s.setCacheLimits(d,o)}get version(){return s.version}},NavigationControl:class{constructor(d){this.options=s.extend({},r_,d),this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",o=>{this._map&&this._map.zoomIn({},{originalEvent:o})}),oe("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",o=>{this._map&&this._map.zoomOut({},{originalEvent:o})}),oe("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",o=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:o}):c.resetNorth({},{originalEvent:o}))}),this._compassIcon=oe("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const d=this._map;if(!d)return;const o=d.getZoom(),c=o===d.getMaxZoom(),f=o===d.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const d=this._map;if(!d)return;const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(d.transform.pitch*(Math.PI/180)),.5)}) rotateX(${d.transform.pitch}deg) rotateZ(${d.transform.angle*(180/Math.PI)}deg)`:`rotate(${d.transform.angle*(180/Math.PI)}deg)`;d._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=o)})}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),d.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&d.on("pitch",this._rotateCompassArrow),d.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new o_(d,this._compass,this.options.visualizePitch)),this._container}onRemove(){const d=this._map;d&&(this._container.remove(),this.options.showZoom&&d.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&d.off("pitch",this._rotateCompassArrow),d.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(d,o){const c=oe("button",d,this._container);return c.type="button",c.addEventListener("click",o),c}_setButtonTitle(d,o){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${o}`);d.setAttribute("aria-label",c),d.firstElementChild&&d.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(d){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},Lh,d),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=ra(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(d){return this._map=d,this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(d){const o=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,d(c)};this._supportsGeolocation!==void 0?d(this._supportsGeolocation):s.window.navigator.permissions!==void 0?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>o(c.state!=="denied")).catch(()=>o()):o()}_isOutOfMapMaxBounds(d){const o=this._map.getMaxBounds(),c=d.coords;return!!o&&(c.longitudeo.getEast()||c.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",d)),this._finish()}}_updateCamera(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude),c=d.coords.accuracy,f=this._map.getBearing(),_=s.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(o.toBounds(c),_,{geolocateSource:!0})}_updateMarker(d){if(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const d=this._map.transform,o=s.mercatorZfromAltitude(1,d._center.lat)*d.worldSize,c=Math.ceil(2*this._accuracy*o);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",d)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(d){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=oe("button","mapboxgl-ctrl-geolocate",this._container),oe("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",d===!1){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=oe("div","mapboxgl-user-location"),this._dotElement.appendChild(oe("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(oe("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new st({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=oe("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new st({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",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(d){this._userLocationDotMarker&&(d.webkitCompassHeading?this._heading=d.webkitCompassHeading:d.absolute===!0&&(this._heading=-1*d.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(d={maximumAge:6e5,timeout:0},this._noTimeout=!0):(d=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,d),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const d=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};s.window.DeviceMotionEvent!==void 0&&typeof s.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&d()}).catch(console.error):d()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:ht,ScaleControl:class{constructor(d){this.options=s.extend({},Rh,d),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const d=this.options.maxWidth||100,o=this._map,c=o._containerHeight/2,f=o._containerWidth/2-d/2,_=o.unproject([f,c]),v=o.unproject([f+d,c]),E=_.distanceTo(v);if(this.options.unit==="imperial"){const S=3.2808*E;S>5280?this._setScale(d,S/5280,"mile"):this._setScale(d,S,"foot")}else this.options.unit==="nautical"?this._setScale(d,E/1852,"nautical-mile"):E>=1e3?this._setScale(d,E/1e3,"kilometer"):this._setScale(d,E,"meter")}_setScale(d,o,c){this._map._requestDomTask(()=>{const f=function(v){const E=Math.pow(10,`${Math.floor(v)}`.length-1);let S=v/E;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:S>=1?1:function(C){const z=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*z)/z}(S),E*S}(o),_=f/o;this._container.innerHTML=this._isNumberFormatSupported&&c!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(f):`${f} ${Dh[c]}`,this._container.style.width=d*_+"px"})}onAdd(d){return this._map=d,this._language=d.getLanguage(),this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-scale",d.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(d){this._language=d,this._update()}setUnit(d){this.options.unit=d,this._update()}},FullscreenControl:class{constructor(d){this._fullscreen=!1,d&&d.container&&(d.container instanceof s.window.HTMLElement?this._container=d.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const d=this._fullscreenButton=oe("button","mapboxgl-ctrl-fullscreen",this._controlContainer);oe("span","mapboxgl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",d)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(d){super(),this.options=s.extend(Object.create(Ph),d),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(d&&d.className?d.className.trim().split(/\s+/):[])}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&d.on("preclick",this._onClose),this.options.closeOnMove&&d.on("move",this._onClose),d.on("remove",this.remove),this._update(),d._addPopup(this),this._focusFirstElement(),this._trackPointer?(d.on("mousemove",this._onMouseEvent),d.on("mouseup",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")):d.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const d=this._map;return d&&(d.off("move",this._update),d.off("move",this._onClose),d.off("preclick",this._onClose),d.off("click",this._onClose),d.off("remove",this.remove),d.off("mousemove",this._onMouseEvent),d.off("mouseup",this._onMouseEvent),d.off("drag",this._onMouseEvent),d._canvasContainer&&d._canvasContainer.classList.remove("mapboxgl-track-pointer"),d._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(d){this._lngLat=s.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update();const o=this._map;return o&&(o.on("move",this._update),o.off("mousemove",this._onMouseEvent),o._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const d=this._map;return d&&(d.off("move",this._update),d.on("mousemove",this._onMouseEvent),d.on("drag",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(s.window.document.createTextNode(d))}setHTML(d){const o=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let f;for(c.innerHTML=d;f=c.firstChild,f;)o.appendChild(f);return this.setDOMContent(o)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){let o=this._content;if(o)for(;o.hasChildNodes();)o.firstChild&&o.removeChild(o.firstChild);else o=this._content=oe("div","mapboxgl-popup-content",this._container||void 0);if(o.appendChild(d),this.options.closeButton){const c=this._closeButton=oe("button","mapboxgl-popup-close-button",o);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(d){return this._classList.add(d),this._updateClassList(),this}removeClassName(d){return this._classList.delete(d),this._updateClassList(),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){let o;return this._classList.delete(d)?o=!1:(this._classList.add(d),o=!0),this._updateClassList(),o}_onMouseEvent(d){this._update(d.point)}_getAnchor(d){if(this.options.anchor)return this.options.anchor;const o=this._map,c=this._container,f=this._pos;if(!o||!c||!f)return"bottom";const _=c.offsetWidth,v=c.offsetHeight,E=f.x<_/2,S=f.x>o.transform.width-_/2;if(f.y+do.transform.height-v){if(E)return"bottom-left";if(S)return"bottom-right"}return E?"left":S?"right":"bottom"}_updateClassList(){const d=this._container;if(!d)return;const o=[...this._classList];o.push("mapboxgl-popup"),this._anchor&&o.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&o.push("mapboxgl-popup-track-pointer"),d.className=o.join(" ")}_update(d){const o=this._map,c=this._content;if(!o||!this._lngLat&&!this._trackPointer||!c)return;let f=this._container;if(f||(f=this._container=oe("div","mapboxgl-popup",o.getContainer()),this._tip=oe("div","mapboxgl-popup-tip",f),f.appendChild(c)),this.options.maxWidth&&f.style.maxWidth!==this.options.maxWidth&&(f.style.maxWidth=this.options.maxWidth),o.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=aa(this._lngLat,this._pos,o.transform)),!this._trackPointer||d){const _=this._pos=this._trackPointer&&d?d:o.project(this._lngLat),v=tf(this.options.offset),E=this._anchor=this._getAnchor(v.y),S=tf(this.options.offset,E),C=_.add(S).round();o._requestDomTask(()=>{this._container&&E&&(this._container.style.transform=`${_s[E]} translate(${C.x}px,${C.y}px)`)})}if(!this._marker&&o._showingGlobe()){const _=s.isLngLatBehindGlobe(o.transform,this._lngLat)?0:1;this._setOpacity(_)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(i_);d&&d.focus()}_onClose(){this.remove()}_setOpacity(d){this._container&&(this._container.style.opacity=`${d}`),this._content&&(this._content.style.pointerEvents=d?"auto":"none")}},Marker:st,Style:jr,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Up,Evented:s.Evented,config:s.config,prewarm:function(){$s().acquire(Fr)},clearPrewarmedResources:function(){const d=Ci;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Fr),Ci=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(d){s.config.ACCESS_TOKEN=d},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(d){s.config.API_URL=d},get workerCount(){return ii.workerCount},set workerCount(d){ii.workerCount=d},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(d){s.config.MAX_PARALLEL_IMAGE_REQUESTS=d},clearStorage(d){s.clearTileCache(d)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return la});var T=g;return T})})(KA);var wx=KA.exports;const b4=sv(wx),E4=AM({__proto__:null,default:b4},[wx]);const e0="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA",p2="/examples/cori.data.rin/rin_service_areas.geojson";function T4(){var x;const t=ft.useContext(_A),i=ft.useRef(null),l=ft.useMemo(()=>(T,s,M,F)=>{console.log("Set popup: ",i.current);const q=new wx.Popup;return F.hasOwnProperty(M)?(q.setLngLat([T,s]),q.setText(F[M])):q.setText("Hello world!"),q},[]);let h=!1;function g(T,s,M,F,q,X,oe){return ft.createElement(yA,{ref:T,longitude:s,latitude:M,color:F,popup:q(s,M,X,oe),key:oe[X]+"-marker"})}return ft.useEffect(()=>{if(t&&!t.data.hasOwnProperty("placeData")&&!h){console.log("Initial place data fetch..."),console.log(p2),h=!0;const T=window.document.getElementById("info-wrapper");T!==null&&(T.style.opacity="1.0",T.style.position="absolute",T.style.background=`rgba(46, 60, 67, 0.5) url('${t.baseURL}/images/loading.gif') no-repeat fixed center`,T.style.backgroundSize="20px"),t.setData({...(t==null?void 0:t.data)||{},placeData:null}),t==null||t.apiClient.get(p2).then(s=>{s&&s.hasOwnProperty("data")&&(console.log("Data result:",s.data.features),t.setData({...t.data,placeData:s.data.features}),h=!1,T!==null&&(T.style.opacity="0.0",T.style.pointerEvents="none",setTimeout(()=>{T.style.background="transparent"},533)))}).catch(s=>{console.error("Error fetching data:",s),h=!1,T!==null&&(T.style.opacity="0.0",T.style.pointerEvents="none",setTimeout(()=>{T.style.background="transparent"},533))})}},[t==null?void 0:t.data]),ft.createElement(ft.Fragment,null,ft.createElement("div",{className:"slippy-map"},ft.createElement(Z3,{mapboxAccessToken:e0,initialViewState:{latitude:40,longitude:-100,pitch:45,zoom:3.5},style:{width:600,height:400},mapStyle:`https://api.mapbox.com/styles/v1/ruralinno/cl010e7b7001p15pe3l0306hv?access_token=${e0}`},!!(t!=null&&t.data)&&!!((x=t==null?void 0:t.data)!=null&&x.placeData)&&t.data.placeData.length>0&&!!i&&typeof i!==void 0&&t.data.placeData.map(T=>{console.log(T);const s=typeof T.geometry.coordinates[0]=="number"?T.geometry.coordinates[0]:0,M=typeof T.geometry.coordinates[1]=="number"?T.geometry.coordinates[1]:0;return g(i,s,M,"#247dc9",l,"rin_community",T.properties)}),ft.createElement(i4,{mapboxAccessToken:e0,position:"top-right"}),ft.createElement(H3,{position:"top-right"}),ft.createElement(W3,{position:"top-right"}),ft.createElement(X3,{position:"bottom-left",unit:"imperial"}))),ft.createElement("div",{id:"info-wrapper",style:{pointerEvents:"none",position:"absolute",top:0,minWidth:"100vw",minHeight:"100vh",transition:"opacity 5.05s ease-in-out 0.025s",opacity:"initial",background:"transparent",backgroundSize:"20px",zIndex:100}}))}const S4="https://cori-risi-apps.s3.amazonaws.com";function A4(t){TS(t).render(ft.createElement(ft.StrictMode,null,ft.createElement(m3,{baseURL:S4},ft.createElement(T4,null))))}A4(document.getElementById("app")); + (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,o){s.getImage(this._requestManager.transformRequest(d,s.ResourceType.Image),(c,f)=>{o(c,f instanceof s.window.HTMLImageElement?s.exported.getImageData(f):f)})}listImages(){return this.style.listImages()}addLayer(d,o){return this._lazyInitEmptyStyle(),this.style.addLayer(d,o),this._update(!0)}moveLayer(d,o){return this.style.moveLayer(d,o),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}setLayerZoomRange(d,o,c){return this.style.setLayerZoomRange(d,o,c),this._update(!0)}setFilter(d,o,c={}){return this.style.setFilter(d,o,c),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,o,c,f={}){return this.style.setPaintProperty(d,o,c,f),this._update(!0)}getPaintProperty(d,o){return this.style.getPaintProperty(d,o)}setLayoutProperty(d,o,c,f={}){return this.style.setLayoutProperty(d,o,c,f),this._update(!0)}getLayoutProperty(d,o){return this.style.getLayoutProperty(d,o)}setLight(d,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,o),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(d){return this._lazyInitEmptyStyle(),!d&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(d),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(d){return this._lazyInitEmptyStyle(),this.style.setFog(d),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(d){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(d),this.transform):0}setFeatureState(d,o){return this.style.setFeatureState(d,o),this._update()}removeFeatureState(d,o){return this.style.removeFeatureState(d,o),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}_updateContainerDimensions(){if(!this._container)return;const d=this._container.getBoundingClientRect().width||400,o=this._container.getBoundingClientRect().height||300;let c,f,_,v=this._container;for(;v&&(!f||!_);){const E=s.window.getComputedStyle(v).transform;E&&E!=="none"&&(c=E.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&c[0]!=="0"&&c[0]!=="1"&&(f=c[0]),c[3]&&c[3]!=="0"&&c[3]!=="1"&&(_=c[3])),v=v.parentElement}this._containerWidth=f?Math.abs(d/f):d,this._containerHeight=_?Math.abs(o/_):o}_detectMissingCSS(){s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const d=this._container;d.classList.add("mapboxgl-map"),(this._missingCSSCanary=oe("div","mapboxgl-canary",d)).style.visibility="hidden",this._detectMissingCSS();const o=this._canvasContainer=oe("div","mapboxgl-canvas-container",d);this._interactive&&o.classList.add("mapboxgl-interactive"),this._canvas=oe("canvas","mapboxgl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=oe("div","mapboxgl-control-container",d),f=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{f[_]=oe("div",`mapboxgl-ctrl-${_}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,o){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(d),this._canvas.height=c*Math.ceil(o),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${o}px`}_addMarker(d){this._markers.push(d)}_removeMarker(d){const o=this._markers.indexOf(d);o!==-1&&this._markers.splice(o,1)}_addPopup(d){this._popups.push(d)}_removePopup(d){const o=this._popups.indexOf(d);o!==-1&&this._popups.splice(o,1)}_setupPainter(){const d=s.extend({},F.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),o=this._useWebGL2&&this._canvas.getContext("webgl2",d),c=o||this._canvas.getContext("webgl",d)||this._canvas.getContext("experimental-webgl",d);c?(this._useWebGL2&&!o&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new ta(c,this.transform,!!o),this.on("data",f=>{f.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(d){d.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:d}))}_contextRestored(d){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:d}))}_onMapScroll(d){if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_requestDomTask(d){!this.loaded()||this.loaded()&&!this.isMoving()?d():this._domRenderTaskQueue.add(d)}_render(d){let o;const c=this.painter.context.extTimerQuery,f=s.exported.now();if(this.listens("gpu-timing-frame")&&(o=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,o)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(d),this._domRenderTaskQueue.run(d),this._removed)return;this._updateProjectionTransition();const _=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,C=this.transform.pitch,z=s.exported.now(),P=new s.EvaluationParameters(S,{now:z,fadeDuration:_,pitch:C,transition:this.style.getTransition()});this.style.update(P)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let v=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),v=this._updateAverageElevation(f),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):v=this._updateAverageElevation(f),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,_,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:_,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),o){const S=s.exported.now()-f;c.endQueryEXT(c.TIME_ELAPSED_EXT,o),setTimeout(()=>{const C=c.getQueryObjectEXT(o,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(o),this.fire(new s.Event("gpu-timing-frame",{cpuTime:S,gpuTime:C})),s.window.performance.mark("frame-gpu",{startTime:f,detail:{gpuTime:C}})},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const C=this.painter.queryGpuTimers(S);this.fire(new s.Event("gpu-timing-layer",{layerTimes:C}))},50)}if(this.listens("gpu-timing-deferred-render")){const S=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const C=this.painter.queryGpuTimeDeferredRender(S);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:C}))},50)}const E=this._sourcesDirty||this._styleDirty||this._placementDirty||v;if(E||this._repaint)this.triggerRepaint();else{const S=!this.isMoving()&&this.loaded();if(S&&(v=this._updateAverageElevation(f,!0)),v)this.triggerRepaint();else if(this._triggerFrame(!1),S&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const C=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:C})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||E||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(d){for(const o of this._markers)d&&!this.getRenderWorldCopies()&&(o._lngLat=o._lngLat.wrap()),o._update();for(const o of this._popups)!d||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}_updateAverageElevation(d,o=!1){const c=f=>(this.transform.averageElevation=f,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&c(0);if((o||d-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(d)){const f=this.transform.averageElevation;let _=this.transform.sampleAverageElevation(),v=!1;this.transform.elevation&&(v=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(_)?_=0:this._averageElevationLastSampledAt=d;const E=Math.abs(f-_);if(E>1){if(this._isInitialLoad||v)return this._averageElevation.jumpTo(_),c(_);this._averageElevation.easeTo(_,d,300)}else if(E>1e-4)return this._averageElevation.jumpTo(_),c(_)}return!!this._averageElevation.isEasing(d)&&c(this._averageElevation.getValue(d))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,d=>{if(d&&(d.message===s.AUTH_ERR_MSG||d.status===401)){const o=this.painter.context.gl;s.storeAuthState(o,!1),this._logoControl instanceof Mh&&this._logoControl._updateLogo(),o&&o.clear(o.DEPTH_BUFFER_BIT|o.COLOR_BUFFER_BIT|o.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const d=this._isDragging();this.painter.updateTerrain(this.style,d)}_calculateSpeedIndex(){const d=this.painter.canvasCopy(),o=this.painter.getCanvasCopiesAndTimestamps();o.timeStamps.push(performance.now());const c=this.painter.context.gl,f=c.createFramebuffer();function _(v){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,v,0);const E=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,E),E}return c.bindFramebuffer(c.FRAMEBUFFER,f),this._canvasPixelComparison(_(d),o.canvasCopies.map(_),o.timeStamps)}_canvasPixelComparison(d,o,c){let f=c[1]-c[0];const _=d.length/4;for(let v=0;v{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(o)}))}_preloadTiles(d){const o=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(o,(c,f)=>c._preloadTiles(d,f),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(d){this._trackResize&&this.resize({originalEvent:d})._update()}_onVisibilityChange(){s.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(d){this._showTerrainWireframe!==d&&(this._showTerrainWireframe=d,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(d){this._speedIndexTiming!==d&&(this._speedIndexTiming=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(d){this._showTileAABBs!==d&&(this._showTileAABBs=d,d&&this._update())}_setCacheLimits(d,o){s.setCacheLimits(d,o)}get version(){return s.version}},NavigationControl:class{constructor(d){this.options=s.extend({},r_,d),this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",o=>{this._map&&this._map.zoomIn({},{originalEvent:o})}),oe("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",o=>{this._map&&this._map.zoomOut({},{originalEvent:o})}),oe("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",o=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:o}):c.resetNorth({},{originalEvent:o}))}),this._compassIcon=oe("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const d=this._map;if(!d)return;const o=d.getZoom(),c=o===d.getMaxZoom(),f=o===d.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const d=this._map;if(!d)return;const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(d.transform.pitch*(Math.PI/180)),.5)}) rotateX(${d.transform.pitch}deg) rotateZ(${d.transform.angle*(180/Math.PI)}deg)`:`rotate(${d.transform.angle*(180/Math.PI)}deg)`;d._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=o)})}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),d.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&d.on("pitch",this._rotateCompassArrow),d.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new o_(d,this._compass,this.options.visualizePitch)),this._container}onRemove(){const d=this._map;d&&(this._container.remove(),this.options.showZoom&&d.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&d.off("pitch",this._rotateCompassArrow),d.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(d,o){const c=oe("button",d,this._container);return c.type="button",c.addEventListener("click",o),c}_setButtonTitle(d,o){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${o}`);d.setAttribute("aria-label",c),d.firstElementChild&&d.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(d){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},Lh,d),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=ra(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(d){return this._map=d,this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(d){const o=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,d(c)};this._supportsGeolocation!==void 0?d(this._supportsGeolocation):s.window.navigator.permissions!==void 0?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>o(c.state!=="denied")).catch(()=>o()):o()}_isOutOfMapMaxBounds(d){const o=this._map.getMaxBounds(),c=d.coords;return!!o&&(c.longitudeo.getEast()||c.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",d)),this._finish()}}_updateCamera(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude),c=d.coords.accuracy,f=this._map.getBearing(),_=s.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(o.toBounds(c),_,{geolocateSource:!0})}_updateMarker(d){if(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const d=this._map.transform,o=s.mercatorZfromAltitude(1,d._center.lat)*d.worldSize,c=Math.ceil(2*this._accuracy*o);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",d)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(d){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=oe("button","mapboxgl-ctrl-geolocate",this._container),oe("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",d===!1){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=oe("div","mapboxgl-user-location"),this._dotElement.appendChild(oe("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(oe("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new st({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=oe("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new st({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",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(d){this._userLocationDotMarker&&(d.webkitCompassHeading?this._heading=d.webkitCompassHeading:d.absolute===!0&&(this._heading=-1*d.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(d={maximumAge:6e5,timeout:0},this._noTimeout=!0):(d=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,d),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const d=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};s.window.DeviceMotionEvent!==void 0&&typeof s.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&d()}).catch(console.error):d()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:ht,ScaleControl:class{constructor(d){this.options=s.extend({},Rh,d),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const d=this.options.maxWidth||100,o=this._map,c=o._containerHeight/2,f=o._containerWidth/2-d/2,_=o.unproject([f,c]),v=o.unproject([f+d,c]),E=_.distanceTo(v);if(this.options.unit==="imperial"){const S=3.2808*E;S>5280?this._setScale(d,S/5280,"mile"):this._setScale(d,S,"foot")}else this.options.unit==="nautical"?this._setScale(d,E/1852,"nautical-mile"):E>=1e3?this._setScale(d,E/1e3,"kilometer"):this._setScale(d,E,"meter")}_setScale(d,o,c){this._map._requestDomTask(()=>{const f=function(v){const E=Math.pow(10,`${Math.floor(v)}`.length-1);let S=v/E;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:S>=1?1:function(C){const z=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*z)/z}(S),E*S}(o),_=f/o;this._container.innerHTML=this._isNumberFormatSupported&&c!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(f):`${f} ${Dh[c]}`,this._container.style.width=d*_+"px"})}onAdd(d){return this._map=d,this._language=d.getLanguage(),this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-scale",d.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(d){this._language=d,this._update()}setUnit(d){this.options.unit=d,this._update()}},FullscreenControl:class{constructor(d){this._fullscreen=!1,d&&d.container&&(d.container instanceof s.window.HTMLElement?this._container=d.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const d=this._fullscreenButton=oe("button","mapboxgl-ctrl-fullscreen",this._controlContainer);oe("span","mapboxgl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",d)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(d){super(),this.options=s.extend(Object.create(Ph),d),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(d&&d.className?d.className.trim().split(/\s+/):[])}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&d.on("preclick",this._onClose),this.options.closeOnMove&&d.on("move",this._onClose),d.on("remove",this.remove),this._update(),d._addPopup(this),this._focusFirstElement(),this._trackPointer?(d.on("mousemove",this._onMouseEvent),d.on("mouseup",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")):d.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const d=this._map;return d&&(d.off("move",this._update),d.off("move",this._onClose),d.off("preclick",this._onClose),d.off("click",this._onClose),d.off("remove",this.remove),d.off("mousemove",this._onMouseEvent),d.off("mouseup",this._onMouseEvent),d.off("drag",this._onMouseEvent),d._canvasContainer&&d._canvasContainer.classList.remove("mapboxgl-track-pointer"),d._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(d){this._lngLat=s.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update();const o=this._map;return o&&(o.on("move",this._update),o.off("mousemove",this._onMouseEvent),o._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const d=this._map;return d&&(d.off("move",this._update),d.on("mousemove",this._onMouseEvent),d.on("drag",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(s.window.document.createTextNode(d))}setHTML(d){const o=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let f;for(c.innerHTML=d;f=c.firstChild,f;)o.appendChild(f);return this.setDOMContent(o)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){let o=this._content;if(o)for(;o.hasChildNodes();)o.firstChild&&o.removeChild(o.firstChild);else o=this._content=oe("div","mapboxgl-popup-content",this._container||void 0);if(o.appendChild(d),this.options.closeButton){const c=this._closeButton=oe("button","mapboxgl-popup-close-button",o);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(d){return this._classList.add(d),this._updateClassList(),this}removeClassName(d){return this._classList.delete(d),this._updateClassList(),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){let o;return this._classList.delete(d)?o=!1:(this._classList.add(d),o=!0),this._updateClassList(),o}_onMouseEvent(d){this._update(d.point)}_getAnchor(d){if(this.options.anchor)return this.options.anchor;const o=this._map,c=this._container,f=this._pos;if(!o||!c||!f)return"bottom";const _=c.offsetWidth,v=c.offsetHeight,E=f.x<_/2,S=f.x>o.transform.width-_/2;if(f.y+do.transform.height-v){if(E)return"bottom-left";if(S)return"bottom-right"}return E?"left":S?"right":"bottom"}_updateClassList(){const d=this._container;if(!d)return;const o=[...this._classList];o.push("mapboxgl-popup"),this._anchor&&o.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&o.push("mapboxgl-popup-track-pointer"),d.className=o.join(" ")}_update(d){const o=this._map,c=this._content;if(!o||!this._lngLat&&!this._trackPointer||!c)return;let f=this._container;if(f||(f=this._container=oe("div","mapboxgl-popup",o.getContainer()),this._tip=oe("div","mapboxgl-popup-tip",f),f.appendChild(c)),this.options.maxWidth&&f.style.maxWidth!==this.options.maxWidth&&(f.style.maxWidth=this.options.maxWidth),o.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=aa(this._lngLat,this._pos,o.transform)),!this._trackPointer||d){const _=this._pos=this._trackPointer&&d?d:o.project(this._lngLat),v=tf(this.options.offset),E=this._anchor=this._getAnchor(v.y),S=tf(this.options.offset,E),C=_.add(S).round();o._requestDomTask(()=>{this._container&&E&&(this._container.style.transform=`${_s[E]} translate(${C.x}px,${C.y}px)`)})}if(!this._marker&&o._showingGlobe()){const _=s.isLngLatBehindGlobe(o.transform,this._lngLat)?0:1;this._setOpacity(_)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(i_);d&&d.focus()}_onClose(){this.remove()}_setOpacity(d){this._container&&(this._container.style.opacity=`${d}`),this._content&&(this._content.style.pointerEvents=d?"auto":"none")}},Marker:st,Style:jr,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Up,Evented:s.Evented,config:s.config,prewarm:function(){$s().acquire(Fr)},clearPrewarmedResources:function(){const d=Ci;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Fr),Ci=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(d){s.config.ACCESS_TOKEN=d},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(d){s.config.API_URL=d},get workerCount(){return ii.workerCount},set workerCount(d){ii.workerCount=d},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(d){s.config.MAX_PARALLEL_IMAGE_REQUESTS=d},clearStorage(d){s.clearTileCache(d)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return la});var T=g;return T})})(KA);var wx=KA.exports;const b4=sv(wx),E4=AM({__proto__:null,default:b4},[wx]);const e0="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA",p2="/examples/cori.data.rin/rin_service_areas.geojson";function T4(){var x;const t=ft.useContext(_A),i=ft.useRef(null),l=ft.useMemo(()=>(T,s,M,F)=>{console.log("Set popup: ",i.current);const q=new wx.Popup;return F.hasOwnProperty(M)?(q.setLngLat([T,s]),q.setText(F[M])):q.setText("Hello world!"),q},[]);let h=!1;function g(T,s,M,F,q,X,oe){return ft.createElement(yA,{ref:T,longitude:s,latitude:M,color:F,popup:q(s,M,X,oe),key:oe[X]+"-marker"})}return ft.useEffect(()=>{if(t&&!t.data.hasOwnProperty("placeData")&&!h){console.log("Initial place data fetch..."),console.log(p2),h=!0;const T=window.document.getElementById("info-wrapper");T!==null&&(T.style.opacity="1.0",T.style.position="absolute",T.style.background=`rgba(46, 60, 67, 0.5) url('${t.baseURL}/images/loading.gif') no-repeat fixed center`,T.style.backgroundSize="20px"),t.setData({...(t==null?void 0:t.data)||{},placeData:null}),t==null||t.apiClient.get(p2).then(s=>{s&&s.hasOwnProperty("data")&&(console.log("Data result:",s.data.features),t.setData({...t.data,placeData:s.data.features}),h=!1,T!==null&&(T.style.opacity="0.0",T.style.pointerEvents="none",setTimeout(()=>{T.style.background="transparent"},533)))}).catch(s=>{console.error("Error fetching data:",s),h=!1,T!==null&&(T.style.opacity="0.0",T.style.pointerEvents="none",setTimeout(()=>{T.style.background="transparent"},533))})}},[t==null?void 0:t.data]),ft.createElement(ft.Fragment,null,ft.createElement("div",{className:"slippy-map"},ft.createElement(Z3,{mapboxAccessToken:e0,initialViewState:{latitude:40,longitude:-99,pitch:45,zoom:4},style:{width:600,height:400},mapStyle:`https://api.mapbox.com/styles/v1/ruralinno/cl010e7b7001p15pe3l0306hv?access_token=${e0}`},!!(t!=null&&t.data)&&!!((x=t==null?void 0:t.data)!=null&&x.placeData)&&t.data.placeData.length>0&&!!i&&typeof i!==void 0&&t.data.placeData.map(T=>{console.log(T);const s=typeof T.geometry.coordinates[0]=="number"?T.geometry.coordinates[0]:0,M=typeof T.geometry.coordinates[1]=="number"?T.geometry.coordinates[1]:0;return g(i,s,M,"#16343e",l,"rin_community",T.properties)}),ft.createElement(i4,{mapboxAccessToken:e0,position:"top-right"}),ft.createElement(H3,{position:"top-right"}),ft.createElement(W3,{position:"top-right"}),ft.createElement(X3,{position:"bottom-left",unit:"imperial"}))),ft.createElement("div",{id:"info-wrapper",style:{pointerEvents:"none",position:"absolute",top:0,minWidth:"100vw",minHeight:"100vh",transition:"opacity 5.05s ease-in-out 0.025s",opacity:"initial",background:"transparent",backgroundSize:"20px",zIndex:100}}))}const S4="https://cori-risi-apps.s3.amazonaws.com";function A4(t){TS(t).render(ft.createElement(ft.StrictMode,null,ft.createElement(m3,{baseURL:S4},ft.createElement(T4,null))))}A4(document.getElementById("app")); diff --git a/assets/index-b3a314fc.css b/assets/index-a9a39f4f.css similarity index 98% rename from assets/index-b3a314fc.css rename to assets/index-a9a39f4f.css index 7734cba..1643090 100644 --- a/assets/index-b3a314fc.css +++ b/assets/index-a9a39f4f.css @@ -1 +1 @@ -.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}:root,[data-amplify-theme]{--amplify-components-button-link-color: #ffffff;--amplify-components-button-link-loading-background-color: #2c3e50;--amplify-components-button-link-loading-border-color: #1a242f;--amplify-components-button-link-disabled-background-color: #2c3e50;--amplify-components-button-link-disabled-border-color: #1a242f;--amplify-components-button-link-active-border-color: #1a242f;--amplify-components-button-link-focus-border-color: #1a242f;--amplify-components-button-link-hover-border-color: #1a242f;--amplify-components-button-link-border-color: #1a242f;--amplify-components-button-link-background-color: #2c3e50;--amplify-components-button-menu-background-color: #2c3e50;--amplify-components-button-primary-background-color: #2c3e50;--amplify-components-button-primary-active-background-color: #1a242f;--amplify-components-button-primary-active-border-color: #1a242f;--amplify-components-button-primary-focus-background-color: #1a242f;--amplify-components-button-primary-focus-border-color: #1a242f;--amplify-components-button-primary-hover-background-color: #1a242f;--amplify-components-button-primary-hover-border-color: #1a242f;--amplify-components-button-primary-loading-border-color: #1a242f;--amplify-components-button-primary-disabled-border-color: #1a242f;--amplify-components-button-primary-border-color: #1a242f;--amplify-components-button-disabled-background-color: #2c3e50;--amplify-components-button-loading-background-color: #2c3e50;--amplify-components-tabs-item-active-color: #18bc9c;--amplify-components-tabs-item-border-style: 4px solid #2c3e50;--amplify-components-tabs-item-active-border-color: #2c3e50}[data-amplify-theme=default-theme] [data-amplify-authenticator] [data-amplify-router]{background-color:var(--amplify-components-authenticator-router-background-color);box-shadow:var(--amplify-components-authenticator-router-box-shadow);border-color:transparent}.ApiContextProvider_amplify-button--primary__x3TB9{border-width:var(--amplify-components-button-primary-border-width);background-color:var(--amplify-components-button-primary-background-color);border-color:var(--amplify-components-button-primary-border-color);color:var(--amplify-components-button-primary-color);--amplify-internal-button-disabled-border-color: var( --amplify-components-button-primary-disabled-border-color );--amplify-internal-button-disabled-background-color: var( --amplify-components-button-primary-disabled-background-color );--amplify-internal-button-disabled-color: var( --amplify-components-button-primary-disabled-color );--amplify-internal-button-loading-background-color: var( --amplify-components-button-primary-loading-background-color );--amplify-internal-button-loading-border-color: var( --amplify-components-button-primary-loading-border-color );--amplify-internal-button-loading-color: var( --amplify-components-button-primary-loading-color )}.ApiContextProvider_amplify-button--primary__x3TB9:hover{background-color:var(--amplify-components-button-primary-hover-background-color);border-color:var(--amplify-components-button-primary-hover-border-color);color:var(--amplify-components-button-primary-hover-color)}.ApiContextProvider_amplify-button--primary__x3TB9:focus{background-color:var(--amplify-components-button-primary-focus-background-color);border-color:var(--amplify-components-button-primary-focus-border-color);color:var(--amplify-components-button-primary-focus-color);box-shadow:var(--amplify-components-button-primary-focus-box-shadow)}.ApiContextProvider_amplify-button--primary__x3TB9:active{background-color:var(--amplify-components-button-primary-active-background-color);border-color:var(--amplify-components-button-primary-active-border-color);color:var(--amplify-components-button-primary-active-color)}.ApiContextProvider_amplify-tabs-item__-6nTX[data-state=active]{color:var(--amplify-components-tabs-item-active-color);border-color:var(--amplify-components-tabs-item-active-border-color);background-color:var(--amplify-components-tabs-item-active-background-color);transition-property:none}.ApiContextProvider_amplify-input__ycAUW.ApiContextProvider_amplify-field-group__control__cRTcr{text-align:left}.CategoricalLegend-module_categorical-legend__KiFcS{display:flex;flex-wrap:wrap;margin:1.5rem 0px}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU{display:flex;justify-content:space-around;margin:0 20px 5px 0}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU .CategoricalLegend-module_key__1Hgb-{height:1rem;width:1rem;opacity:.9}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU p{line-height:1rem;font-size:1rem;margin:0 0 0 6px}.HoverInfo-module_tooltip__3wVpX{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.HoverInfo-module_tooltip__3wVpX h3{margin:.5rem 0rem}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_details__4eyQ7{margin:.1rem 0rem;line-height:1.6}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_prop-score__DKjwo{font-weight:400;margin:0}.slippy-map{position:relative;width:100vw;height:100vh}.slippy-map>*{overflow:hidden}.slippy-map>.mapboxgl-map{width:100%!important;height:100%!important}.tooltip{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.tooltip h3{margin:.5rem 0rem}.tooltip .details{margin:.1rem 0rem;line-height:1.6}.tooltip .prop-score{font-weight:400;margin:0}.tooltip .click-prompt{font-style:italic;font-weight:600;margin-top:5px}.tooltip p{margin:0}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body{font-family:Montserrat,Arial,Helvetica,sans-serif;overflow:none}h1{font-size:2rem}h2{font-size:1.8rem}h3{font-size:1.6rem}h4{font-size:1.4rem}h5{font-size:1.2rem}h6{font-size:1rem}h1,h2,h3,h4,h5,h6{font-family:Montserrat,Arial,Helvetica,sans-serif;margin-top:.5em;margin-bottom:.5em}p,a{font-family:Montserrat,Arial,Helvetica,sans-serif;line-height:1.4}a{margin-top:0;margin-bottom:0;color:#00835d;text-decoration:underline;font-weight:700}a:hover{text-decoration:underline;cursor:pointer}#map{display:flex} +.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}:root,[data-amplify-theme]{--amplify-components-button-link-color: #ffffff;--amplify-components-button-link-loading-background-color: #2c3e50;--amplify-components-button-link-loading-border-color: #1a242f;--amplify-components-button-link-disabled-background-color: #2c3e50;--amplify-components-button-link-disabled-border-color: #1a242f;--amplify-components-button-link-active-border-color: #1a242f;--amplify-components-button-link-focus-border-color: #1a242f;--amplify-components-button-link-hover-border-color: #1a242f;--amplify-components-button-link-border-color: #1a242f;--amplify-components-button-link-background-color: #2c3e50;--amplify-components-button-menu-background-color: #2c3e50;--amplify-components-button-primary-background-color: #2c3e50;--amplify-components-button-primary-active-background-color: #1a242f;--amplify-components-button-primary-active-border-color: #1a242f;--amplify-components-button-primary-focus-background-color: #1a242f;--amplify-components-button-primary-focus-border-color: #1a242f;--amplify-components-button-primary-hover-background-color: #1a242f;--amplify-components-button-primary-hover-border-color: #1a242f;--amplify-components-button-primary-loading-border-color: #1a242f;--amplify-components-button-primary-disabled-border-color: #1a242f;--amplify-components-button-primary-border-color: #1a242f;--amplify-components-button-disabled-background-color: #2c3e50;--amplify-components-button-loading-background-color: #2c3e50;--amplify-components-tabs-item-active-color: #18bc9c;--amplify-components-tabs-item-border-style: 4px solid #2c3e50;--amplify-components-tabs-item-active-border-color: #2c3e50}[data-amplify-theme=default-theme] [data-amplify-authenticator] [data-amplify-router]{background-color:var(--amplify-components-authenticator-router-background-color);box-shadow:var(--amplify-components-authenticator-router-box-shadow);border-color:transparent}.ApiContextProvider_amplify-button--primary__x3TB9{border-width:var(--amplify-components-button-primary-border-width);background-color:var(--amplify-components-button-primary-background-color);border-color:var(--amplify-components-button-primary-border-color);color:var(--amplify-components-button-primary-color);--amplify-internal-button-disabled-border-color: var( --amplify-components-button-primary-disabled-border-color );--amplify-internal-button-disabled-background-color: var( --amplify-components-button-primary-disabled-background-color );--amplify-internal-button-disabled-color: var( --amplify-components-button-primary-disabled-color );--amplify-internal-button-loading-background-color: var( --amplify-components-button-primary-loading-background-color );--amplify-internal-button-loading-border-color: var( --amplify-components-button-primary-loading-border-color );--amplify-internal-button-loading-color: var( --amplify-components-button-primary-loading-color )}.ApiContextProvider_amplify-button--primary__x3TB9:hover{background-color:var(--amplify-components-button-primary-hover-background-color);border-color:var(--amplify-components-button-primary-hover-border-color);color:var(--amplify-components-button-primary-hover-color)}.ApiContextProvider_amplify-button--primary__x3TB9:focus{background-color:var(--amplify-components-button-primary-focus-background-color);border-color:var(--amplify-components-button-primary-focus-border-color);color:var(--amplify-components-button-primary-focus-color);box-shadow:var(--amplify-components-button-primary-focus-box-shadow)}.ApiContextProvider_amplify-button--primary__x3TB9:active{background-color:var(--amplify-components-button-primary-active-background-color);border-color:var(--amplify-components-button-primary-active-border-color);color:var(--amplify-components-button-primary-active-color)}.ApiContextProvider_amplify-tabs-item__-6nTX[data-state=active]{color:var(--amplify-components-tabs-item-active-color);border-color:var(--amplify-components-tabs-item-active-border-color);background-color:var(--amplify-components-tabs-item-active-background-color);transition-property:none}.ApiContextProvider_amplify-input__ycAUW.ApiContextProvider_amplify-field-group__control__cRTcr{text-align:left}.CategoricalLegend-module_categorical-legend__KiFcS{display:flex;flex-wrap:wrap;margin:1.5rem 0px}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU{display:flex;justify-content:space-around;margin:0 20px 5px 0}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU .CategoricalLegend-module_key__1Hgb-{height:1rem;width:1rem;opacity:.9}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU p{line-height:1rem;font-size:1rem;margin:0 0 0 6px}.HoverInfo-module_tooltip__3wVpX{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.HoverInfo-module_tooltip__3wVpX h3{margin:.5rem 0rem}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_details__4eyQ7{margin:.1rem 0rem;line-height:1.6}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_prop-score__DKjwo{font-weight:400;margin:0}.slippy-map{position:relative;width:100vw;height:100vh}.slippy-map>*{overflow:hidden}.slippy-map>.mapboxgl-map{width:100%!important;height:100%!important}.tooltip{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.tooltip h3{margin:.5rem 0rem}.tooltip .details{margin:.1rem 0rem;line-height:1.6}.tooltip .prop-score{font-weight:400;margin:0}.tooltip .click-prompt{font-style:italic;font-weight:600;margin-top:5px}.tooltip p{margin:0}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}a{color:#00835d;margin-top:0;margin-bottom:0;text-decoration:underline}a:hover{text-decoration:underline;cursor:pointer}.control-panel{position:absolute;top:0;right:0;max-width:320px;background:#fff;box-shadow:0 2px 4px #0000004d;padding:12px 24px;margin:20px;font-size:13px;line-height:2;color:#6b6b76;text-transform:uppercase;outline:none;z-index:2}.mapboxgl-ctrl{font-family:Bitter,serif!important}.mapboxgl-ctrl .mapboxgl-ctrl-top-left{font-family:Bitter,monospace!important}.mapboxgl-popup{font-family:Bitter,serif}.mapboxgl-popup .mapboxgl-popup-content{font-family:Bitter,serif!important;font-size:12pt;color:#fff;background:#16343e;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:12px 20px;pointer-events:auto;position:relative}.mapboxgl-popup .mapboxgl-popup-content button{color:#16343e;background:#fff} diff --git a/cisco b/cisco index b19ab24..8f897f2 160000 --- a/cisco +++ b/cisco @@ -1 +1 @@ -Subproject commit b19ab24bbb904a6297c4796dfb11f5fe07aec0d7 +Subproject commit 8f897f257750dfba12221d34b61f711baac47229 diff --git a/docs/RIN-data-infrastructure.html b/docs/RIN-data-infrastructure.html index 3fa7b5c..77d173a 100644 --- a/docs/RIN-data-infrastructure.html +++ b/docs/RIN-data-infrastructure.html @@ -73,7 +73,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/frontend/dist/assets/images/Full-Logo_CORI_Cream.svg b/docs/frontend/dist/assets/images/Full-Logo_CORI_Cream.svg new file mode 100644 index 0000000..fa8d332 --- /dev/null +++ b/docs/frontend/dist/assets/images/Full-Logo_CORI_Cream.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/frontend/dist/assets/images/Full-Logo_CORI_Dark-Teal.svg b/docs/frontend/dist/assets/images/Full-Logo_CORI_Dark-Teal.svg new file mode 100644 index 0000000..6f8bee8 --- /dev/null +++ b/docs/frontend/dist/assets/images/Full-Logo_CORI_Dark-Teal.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/frontend/dist/assets/images/Logo-Mark_Black.png b/docs/frontend/dist/assets/images/Logo-Mark_Black.png new file mode 100644 index 0000000..99d5589 Binary files /dev/null and b/docs/frontend/dist/assets/images/Logo-Mark_Black.png differ diff --git a/docs/frontend/dist/assets/images/Program_Evaluation_basics.png b/docs/frontend/dist/assets/images/Program_Evaluation_basics.png new file mode 100644 index 0000000..d12fb99 Binary files /dev/null and b/docs/frontend/dist/assets/images/Program_Evaluation_basics.png differ diff --git a/docs/frontend/dist/assets/images/Tech_Talent_Development_support_and_services.png b/docs/frontend/dist/assets/images/Tech_Talent_Development_support_and_services.png new file mode 100644 index 0000000..255c947 Binary files /dev/null and b/docs/frontend/dist/assets/images/Tech_Talent_Development_support_and_services.png differ diff --git a/docs/frontend/dist/assets/images/airtable_icon.png b/docs/frontend/dist/assets/images/airtable_icon.png new file mode 100644 index 0000000..18a0d36 Binary files /dev/null and b/docs/frontend/dist/assets/images/airtable_icon.png differ diff --git a/docs/frontend/dist/assets/images/airtable_labeled_icon.png b/docs/frontend/dist/assets/images/airtable_labeled_icon.png new file mode 100644 index 0000000..86d1c16 Binary files /dev/null and b/docs/frontend/dist/assets/images/airtable_labeled_icon.png differ diff --git a/docs/frontend/dist/assets/images/standard_cori_prez.png b/docs/frontend/dist/assets/images/standard_cori_prez.png new file mode 100644 index 0000000..9a284ca Binary files /dev/null and b/docs/frontend/dist/assets/images/standard_cori_prez.png differ diff --git a/docs/frontend/dist/assets/images/why.png b/docs/frontend/dist/assets/images/why.png new file mode 100644 index 0000000..db6ec7e Binary files /dev/null and b/docs/frontend/dist/assets/images/why.png differ diff --git a/docs/frontend/dist/assets/index-0b9b7d26.js b/docs/frontend/dist/assets/index-0b9b7d26.js deleted file mode 100644 index 7145046..0000000 --- a/docs/frontend/dist/assets/index-0b9b7d26.js +++ /dev/null @@ -1,1396 +0,0 @@ -function LP(e,n){for(var l=0;lh[m]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))h(m);new MutationObserver(m=>{for(const v of m)if(v.type==="childList")for(const E of v.addedNodes)E.tagName==="LINK"&&E.rel==="modulepreload"&&h(E)}).observe(document,{childList:!0,subtree:!0});function l(m){const v={};return m.integrity&&(v.integrity=m.integrity),m.referrerPolicy&&(v.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?v.credentials="include":m.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function h(m){if(m.ep)return;m.ep=!0;const v=l(m);fetch(m.href,v)}})();var Go=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function g1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function XT(e){if(e.__esModule)return e;var n=e.default;if(typeof n=="function"){var l=function h(){return this instanceof h?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};l.prototype=n.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(e).forEach(function(h){var m=Object.getOwnPropertyDescriptor(e,h);Object.defineProperty(l,h,m.get?m:{enumerable:!0,get:function(){return e[h]}})}),l}var KT={exports:{}},Yt={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Yp=Symbol.for("react.element"),RP=Symbol.for("react.portal"),DP=Symbol.for("react.fragment"),OP=Symbol.for("react.strict_mode"),BP=Symbol.for("react.profiler"),FP=Symbol.for("react.provider"),NP=Symbol.for("react.context"),UP=Symbol.for("react.forward_ref"),jP=Symbol.for("react.suspense"),VP=Symbol.for("react.memo"),$P=Symbol.for("react.lazy"),v2=Symbol.iterator;function GP(e){return e===null||typeof e!="object"?null:(e=v2&&e[v2]||e["@@iterator"],typeof e=="function"?e:null)}var YT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},JT=Object.assign,QT={};function hh(e,n,l){this.props=e,this.context=n,this.refs=QT,this.updater=l||YT}hh.prototype.isReactComponent={};hh.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")};hh.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function eS(){}eS.prototype=hh.prototype;function _1(e,n,l){this.props=e,this.context=n,this.refs=QT,this.updater=l||YT}var y1=_1.prototype=new eS;y1.constructor=_1;JT(y1,hh.prototype);y1.isPureReactComponent=!0;var x2=Array.isArray,tS=Object.prototype.hasOwnProperty,v1={current:null},nS={key:!0,ref:!0,__self:!0,__source:!0};function rS(e,n,l){var h,m={},v=null,E=null;if(n!=null)for(h in n.ref!==void 0&&(E=n.ref),n.key!==void 0&&(v=""+n.key),n)tS.call(n,h)&&!nS.hasOwnProperty(h)&&(m[h]=n[h]);var s=arguments.length-2;if(s===1)m.children=l;else if(1>>1,dn=Je[Bt];if(0>>1;Btm(ii,xt))arm(br,ii)?(Je[Bt]=br,Je[ar]=xt,Bt=ar):(Je[Bt]=ii,Je[sr]=xt,Bt=sr);else if(arm(br,xt))Je[Bt]=br,Je[ar]=xt,Bt=ar;else break e}}return Tt}function m(Je,Tt){var xt=Je.sortIndex-Tt.sortIndex;return xt!==0?xt:Je.id-Tt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var v=performance;e.unstable_now=function(){return v.now()}}else{var E=Date,s=E.now();e.unstable_now=function(){return E.now()-s}}var k=[],D=[],V=1,G=null,J=3,ve=!1,ae=!1,me=!1,Ce=typeof setTimeout=="function"?setTimeout:null,ie=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function le(Je){for(var Tt=l(D);Tt!==null;){if(Tt.callback===null)h(D);else if(Tt.startTime<=Je)h(D),Tt.sortIndex=Tt.expirationTime,n(k,Tt);else break;Tt=l(D)}}function ze(Je){if(me=!1,le(Je),!ae)if(l(k)!==null)ae=!0,Li(Oe);else{var Tt=l(D);Tt!==null&&Ki(ze,Tt.startTime-Je)}}function Oe(Je,Tt){ae=!1,me&&(me=!1,ie(ht),ht=-1),ve=!0;var xt=J;try{for(le(Tt),G=l(k);G!==null&&(!(G.expirationTime>Tt)||Je&&!wr());){var Bt=G.callback;if(typeof Bt=="function"){G.callback=null,J=G.priorityLevel;var dn=Bt(G.expirationTime<=Tt);Tt=e.unstable_now(),typeof dn=="function"?G.callback=dn:G===l(k)&&h(k),le(Tt)}else h(k);G=l(k)}if(G!==null)var vn=!0;else{var sr=l(D);sr!==null&&Ki(ze,sr.startTime-Tt),vn=!1}return vn}finally{G=null,J=xt,ve=!1}}var Ke=!1,He=null,ht=-1,Ve=5,jt=-1;function wr(){return!(e.unstable_now()-jtJe||125Bt?(Je.sortIndex=xt,n(D,Je),l(k)===null&&Je===l(D)&&(me?(ie(ht),ht=-1):me=!0,Ki(ze,xt-Bt))):(Je.sortIndex=dn,n(k,Je),ae||ve||(ae=!0,Li(Oe))),Je},e.unstable_shouldYield=wr,e.unstable_wrapCallback=function(Je){var Tt=J;return function(){var xt=J;J=Tt;try{return Je.apply(this,arguments)}finally{J=xt}}}})(aS);sS.exports=aS;var XP=sS.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var KP=ut,Zi=XP;function it(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,l=1;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cv=Object.prototype.hasOwnProperty,YP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,b2={},E2={};function JP(e){return cv.call(E2,e)?!0:cv.call(b2,e)?!1:YP.test(e)?E2[e]=!0:(b2[e]=!0,!1)}function QP(e,n,l,h){if(l!==null&&l.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return h?!1:l!==null?!l.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ez(e,n,l,h){if(n===null||typeof n>"u"||QP(e,n,l,h))return!0;if(h)return!1;if(l!==null)switch(l.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function di(e,n,l,h,m,v,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=h,this.attributeNamespace=m,this.mustUseProperty=l,this.propertyName=e,this.type=n,this.sanitizeURL=v,this.removeEmptyString=E}var jr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jr[e]=new di(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];jr[n]=new di(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jr[e]=new di(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jr[e]=new di(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){jr[e]=new di(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jr[e]=new di(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jr[e]=new di(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jr[e]=new di(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jr[e]=new di(e,5,!1,e.toLowerCase(),null,!1,!1)});var w1=/[\-:]([a-z])/g;function b1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(w1,b1);jr[n]=new di(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jr[e]=new di(e,1,!1,e.toLowerCase(),null,!1,!1)});jr.xlinkHref=new di("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jr[e]=new di(e,1,!1,e.toLowerCase(),null,!0,!0)});function E1(e,n,l,h){var m=jr.hasOwnProperty(n)?jr[n]:null;(m!==null?m.type!==0:h||!(2s||m[E]!==v[s]){var k=` -`+m[E].replace(" at new "," at ");return e.displayName&&k.includes("")&&(k=k.replace("",e.displayName)),k}while(1<=E&&0<=s);break}}}finally{A0=!1,Error.prepareStackTrace=l}return(e=e?e.displayName||e.name:"")?up(e):""}function tz(e){switch(e.tag){case 5:return up(e.type);case 16:return up("Lazy");case 13:return up("Suspense");case 19:return up("SuspenseList");case 0:case 2:case 15:return e=C0(e.type,!1),e;case 11:return e=C0(e.type.render,!1),e;case 1:return e=C0(e.type,!0),e;default:return""}}function pv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Lu:return"Fragment";case zu:return"Portal";case uv:return"Profiler";case T1:return"StrictMode";case hv:return"Suspense";case dv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case uS:return(e.displayName||"Context")+".Consumer";case cS:return(e._context.displayName||"Context")+".Provider";case S1:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A1:return n=e.displayName||null,n!==null?n:pv(e.type)||"Memo";case Ga:n=e._payload,e=e._init;try{return pv(e(n))}catch{}}return null}function nz(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pv(n);case 8:return n===T1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function sl(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dS(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function rz(e){var n=dS(e)?"checked":"value",l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),h=""+e[n];if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var m=l.get,v=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return m.call(this)},set:function(E){h=""+E,v.call(this,E)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return h},setValue:function(E){h=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Dm(e){e._valueTracker||(e._valueTracker=rz(e))}function pS(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),h="";return e&&(h=dS(e)?e.checked?"true":"false":e.value),e=h,e!==l?(n.setValue(e),!0):!1}function Sg(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fv(e,n){var l=n.checked;return Qn({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??e._wrapperState.initialChecked})}function S2(e,n){var l=n.defaultValue==null?"":n.defaultValue,h=n.checked!=null?n.checked:n.defaultChecked;l=sl(n.value!=null?n.value:l),e._wrapperState={initialChecked:h,initialValue:l,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function fS(e,n){n=n.checked,n!=null&&E1(e,"checked",n,!1)}function mv(e,n){fS(e,n);var l=sl(n.value),h=n.type;if(l!=null)h==="number"?(l===0&&e.value===""||e.value!=l)&&(e.value=""+l):e.value!==""+l&&(e.value=""+l);else if(h==="submit"||h==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?gv(e,n.type,l):n.hasOwnProperty("defaultValue")&&gv(e,n.type,sl(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function A2(e,n,l){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var h=n.type;if(!(h!=="submit"&&h!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,l||n===e.value||(e.value=n),e.defaultValue=n}l=e.name,l!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,l!==""&&(e.name=l)}function gv(e,n,l){(n!=="number"||Sg(e.ownerDocument)!==e)&&(l==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+l&&(e.defaultValue=""+l))}var hp=Array.isArray;function qu(e,n,l,h){if(e=e.options,n){n={};for(var m=0;m"+n.valueOf().toString()+"",n=Om.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Ap(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var fp={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},iz=["Webkit","ms","Moz","O"];Object.keys(fp).forEach(function(e){iz.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),fp[n]=fp[e]})});function yS(e,n,l){return n==null||typeof n=="boolean"||n===""?"":l||typeof n!="number"||n===0||fp.hasOwnProperty(e)&&fp[e]?(""+n).trim():n+"px"}function vS(e,n){e=e.style;for(var l in n)if(n.hasOwnProperty(l)){var h=l.indexOf("--")===0,m=yS(l,n[l],h);l==="float"&&(l="cssFloat"),h?e.setProperty(l,m):e[l]=m}}var oz=Qn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vv(e,n){if(n){if(oz[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(it(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(it(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(it(61))}if(n.style!=null&&typeof n.style!="object")throw Error(it(62))}}function xv(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wv=null;function C1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bv=null,Wu=null,Zu=null;function k2(e){if(e=ef(e)){if(typeof bv!="function")throw Error(it(280));var n=e.stateNode;n&&(n=h_(n),bv(e.stateNode,e.type,n))}}function xS(e){Wu?Zu?Zu.push(e):Zu=[e]:Wu=e}function wS(){if(Wu){var e=Wu,n=Zu;if(Zu=Wu=null,k2(e),n)for(e=0;e>>=0,e===0?32:31-(gz(e)/_z|0)|0}var Bm=64,Fm=4194304;function dp(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kg(e,n){var l=e.pendingLanes;if(l===0)return 0;var h=0,m=e.suspendedLanes,v=e.pingedLanes,E=l&268435455;if(E!==0){var s=E&~m;s!==0?h=dp(s):(v&=E,v!==0&&(h=dp(v)))}else E=l&~m,E!==0?h=dp(E):v!==0&&(h=dp(v));if(h===0)return 0;if(n!==0&&n!==h&&!(n&m)&&(m=h&-h,v=n&-n,m>=v||m===16&&(v&4194240)!==0))return n;if(h&4&&(h|=l&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=h;0l;l++)n.push(e);return n}function Jp(e,n,l){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-qo(n),e[n]=l}function wz(e,n){var l=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var h=e.eventTimes;for(e=e.expirationTimes;0=gp),F2=String.fromCharCode(32),N2=!1;function jS(e,n){switch(e){case"keyup":return Xz.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function VS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ru=!1;function Yz(e,n){switch(e){case"compositionend":return VS(n);case"keypress":return n.which!==32?null:(N2=!0,F2);case"textInput":return e=n.data,e===F2&&N2?null:e;default:return null}}function Jz(e,n){if(Ru)return e==="compositionend"||!D1&&jS(e,n)?(e=NS(),ag=z1=Ha=null,Ru=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:l,offset:n-e};e=h}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=$2(l)}}function WS(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?WS(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ZS(){for(var e=window,n=Sg();n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=Sg(e.document)}return n}function O1(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function aL(e){var n=ZS(),l=e.focusedElem,h=e.selectionRange;if(n!==l&&l&&l.ownerDocument&&WS(l.ownerDocument.documentElement,l)){if(h!==null&&O1(l)){if(n=h.start,e=h.end,e===void 0&&(e=n),"selectionStart"in l)l.selectionStart=n,l.selectionEnd=Math.min(e,l.value.length);else if(e=(n=l.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var m=l.textContent.length,v=Math.min(h.start,m);h=h.end===void 0?v:Math.min(h.end,m),!e.extend&&v>h&&(m=h,h=v,v=m),m=G2(l,v);var E=G2(l,h);m&&E&&(e.rangeCount!==1||e.anchorNode!==m.node||e.anchorOffset!==m.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(m.node,m.offset),e.removeAllRanges(),v>h?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=l;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l=document.documentMode,Du=null,Iv=null,yp=null,kv=!1;function q2(e,n,l){var h=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;kv||Du==null||Du!==Sg(h)||(h=Du,"selectionStart"in h&&O1(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),yp&&zp(yp,h)||(yp=h,h=zg(Iv,"onSelect"),0Fu||(e.current=Dv[Fu],Dv[Fu]=null,Fu--)}function Pn(e,n){Fu++,Dv[Fu]=e.current,e.current=n}var al={},ni=hl(al),Ci=hl(!1),mc=al;function nh(e,n){var l=e.type.contextTypes;if(!l)return al;var h=e.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===n)return h.__reactInternalMemoizedMaskedChildContext;var m={},v;for(v in l)m[v]=n[v];return h&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=m),m}function Ii(e){return e=e.childContextTypes,e!=null}function Rg(){On(Ci),On(ni)}function J2(e,n,l){if(ni.current!==al)throw Error(it(168));Pn(ni,n),Pn(Ci,l)}function nA(e,n,l){var h=e.stateNode;if(n=n.childContextTypes,typeof h.getChildContext!="function")return l;h=h.getChildContext();for(var m in h)if(!(m in n))throw Error(it(108,nz(e)||"Unknown",m));return Qn({},l,h)}function Dg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||al,mc=ni.current,Pn(ni,e),Pn(Ci,Ci.current),!0}function Q2(e,n,l){var h=e.stateNode;if(!h)throw Error(it(169));l?(e=nA(e,n,mc),h.__reactInternalMemoizedMergedChildContext=e,On(Ci),On(ni),Pn(ni,e)):On(Ci),Pn(Ci,l)}var Hs=null,d_=!1,j0=!1;function rA(e){Hs===null?Hs=[e]:Hs.push(e)}function vL(e){d_=!0,rA(e)}function dl(){if(!j0&&Hs!==null){j0=!0;var e=0,n=Tn;try{var l=Hs;for(Tn=1;e>=E,m-=E,Ys=1<<32-qo(n)+m|l<ht?(Ve=He,He=null):Ve=He.sibling;var jt=J(ie,He,le[ht],ze);if(jt===null){He===null&&(He=Ve);break}e&&He&&jt.alternate===null&&n(ie,He),te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt,He=Ve}if(ht===le.length)return l(ie,He),jn&&sc(ie,ht),Oe;if(He===null){for(;htht?(Ve=He,He=null):Ve=He.sibling;var wr=J(ie,He,jt.value,ze);if(wr===null){He===null&&(He=Ve);break}e&&He&&wr.alternate===null&&n(ie,He),te=v(wr,te,ht),Ke===null?Oe=wr:Ke.sibling=wr,Ke=wr,He=Ve}if(jt.done)return l(ie,He),jn&&sc(ie,ht),Oe;if(He===null){for(;!jt.done;ht++,jt=le.next())jt=G(ie,jt.value,ze),jt!==null&&(te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt);return jn&&sc(ie,ht),Oe}for(He=h(ie,He);!jt.done;ht++,jt=le.next())jt=ve(He,ie,ht,jt.value,ze),jt!==null&&(e&&jt.alternate!==null&&He.delete(jt.key===null?ht:jt.key),te=v(jt,te,ht),Ke===null?Oe=jt:Ke.sibling=jt,Ke=jt);return e&&He.forEach(function(St){return n(ie,St)}),jn&&sc(ie,ht),Oe}function Ce(ie,te,le,ze){if(typeof le=="object"&&le!==null&&le.type===Lu&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case Rm:e:{for(var Oe=le.key,Ke=te;Ke!==null;){if(Ke.key===Oe){if(Oe=le.type,Oe===Lu){if(Ke.tag===7){l(ie,Ke.sibling),te=m(Ke,le.props.children),te.return=ie,ie=te;break e}}else if(Ke.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===Ga&&nE(Oe)===Ke.type){l(ie,Ke.sibling),te=m(Ke,le.props),te.ref=rp(ie,Ke,le),te.return=ie,ie=te;break e}l(ie,Ke);break}else n(ie,Ke);Ke=Ke.sibling}le.type===Lu?(te=fc(le.props.children,ie.mode,ze,le.key),te.return=ie,ie=te):(ze=mg(le.type,le.key,le.props,null,ie.mode,ze),ze.ref=rp(ie,te,le),ze.return=ie,ie=ze)}return E(ie);case zu:e:{for(Ke=le.key;te!==null;){if(te.key===Ke)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){l(ie,te.sibling),te=m(te,le.children||[]),te.return=ie,ie=te;break e}else{l(ie,te);break}else n(ie,te);te=te.sibling}te=X0(le,ie.mode,ze),te.return=ie,ie=te}return E(ie);case Ga:return Ke=le._init,Ce(ie,te,Ke(le._payload),ze)}if(hp(le))return ae(ie,te,le,ze);if(Jd(le))return me(ie,te,le,ze);qm(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,te!==null&&te.tag===6?(l(ie,te.sibling),te=m(te,le),te.return=ie,ie=te):(l(ie,te),te=H0(le,ie.mode,ze),te.return=ie,ie=te),E(ie)):l(ie,te)}return Ce}var ih=aA(!0),lA=aA(!1),Fg=hl(null),Ng=null,ju=null,U1=null;function j1(){U1=ju=Ng=null}function V1(e){var n=Fg.current;On(Fg),e._currentValue=n}function Fv(e,n,l){for(;e!==null;){var h=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,h!==null&&(h.childLanes|=n)):h!==null&&(h.childLanes&n)!==n&&(h.childLanes|=n),e===l)break;e=e.return}}function Xu(e,n){Ng=e,U1=ju=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&n&&(Ai=!0),e.firstContext=null)}function mo(e){var n=e._currentValue;if(U1!==e)if(e={context:e,memoizedValue:n,next:null},ju===null){if(Ng===null)throw Error(it(308));ju=e,Ng.dependencies={lanes:0,firstContext:e}}else ju=ju.next=e;return n}var uc=null;function $1(e){uc===null?uc=[e]:uc.push(e)}function cA(e,n,l,h){var m=n.interleaved;return m===null?(l.next=l,$1(n)):(l.next=m.next,m.next=l),n.interleaved=l,ra(e,h)}function ra(e,n){e.lanes|=n;var l=e.alternate;for(l!==null&&(l.lanes|=n),l=e,e=e.return;e!==null;)e.childLanes|=n,l=e.alternate,l!==null&&(l.childLanes|=n),l=e,e=e.return;return l.tag===3?l.stateNode:null}var qa=!1;function G1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uA(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qs(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function tl(e,n,l){var h=e.updateQueue;if(h===null)return null;if(h=h.shared,nn&2){var m=h.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),h.pending=n,ra(e,l)}return m=h.interleaved,m===null?(n.next=n,$1(h)):(n.next=m.next,m.next=n),h.interleaved=n,ra(e,l)}function cg(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194240)!==0)){var h=n.lanes;h&=e.pendingLanes,l|=h,n.lanes=l,k1(e,l)}}function rE(e,n){var l=e.updateQueue,h=e.alternate;if(h!==null&&(h=h.updateQueue,l===h)){var m=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var E={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};v===null?m=v=E:v=v.next=E,l=l.next}while(l!==null);v===null?m=v=n:v=v.next=n}else m=v=n;l={baseState:h.baseState,firstBaseUpdate:m,lastBaseUpdate:v,shared:h.shared,effects:h.effects},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}function Ug(e,n,l,h){var m=e.updateQueue;qa=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,s=m.shared.pending;if(s!==null){m.shared.pending=null;var k=s,D=k.next;k.next=null,E===null?v=D:E.next=D,E=k;var V=e.alternate;V!==null&&(V=V.updateQueue,s=V.lastBaseUpdate,s!==E&&(s===null?V.firstBaseUpdate=D:s.next=D,V.lastBaseUpdate=k))}if(v!==null){var G=m.baseState;E=0,V=D=k=null,s=v;do{var J=s.lane,ve=s.eventTime;if((h&J)===J){V!==null&&(V=V.next={eventTime:ve,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var ae=e,me=s;switch(J=n,ve=l,me.tag){case 1:if(ae=me.payload,typeof ae=="function"){G=ae.call(ve,G,J);break e}G=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=me.payload,J=typeof ae=="function"?ae.call(ve,G,J):ae,J==null)break e;G=Qn({},G,J);break e;case 2:qa=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,J=m.effects,J===null?m.effects=[s]:J.push(s))}else ve={eventTime:ve,lane:J,tag:s.tag,payload:s.payload,callback:s.callback,next:null},V===null?(D=V=ve,k=G):V=V.next=ve,E|=J;if(s=s.next,s===null){if(s=m.shared.pending,s===null)break;J=s,s=J.next,J.next=null,m.lastBaseUpdate=J,m.shared.pending=null}}while(1);if(V===null&&(k=G),m.baseState=k,m.firstBaseUpdate=D,m.lastBaseUpdate=V,n=m.shared.interleaved,n!==null){m=n;do E|=m.lane,m=m.next;while(m!==n)}else v===null&&(m.shared.lanes=0);yc|=E,e.lanes=E,e.memoizedState=G}}function iE(e,n,l){if(e=n.effects,n.effects=null,e!==null)for(n=0;nl?l:4,e(!0);var h=$0.transition;$0.transition={};try{e(!1),n()}finally{Tn=l,$0.transition=h}}function CA(){return go().memoizedState}function EL(e,n,l){var h=rl(e);if(l={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null},IA(e))kA(n,l);else if(l=cA(e,n,l,h),l!==null){var m=ui();Wo(l,e,h,m),MA(l,n,h)}}function TL(e,n,l){var h=rl(e),m={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null};if(IA(e))kA(n,m);else{var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var E=n.lastRenderedState,s=v(E,l);if(m.hasEagerState=!0,m.eagerState=s,Xo(s,E)){var k=n.interleaved;k===null?(m.next=m,$1(n)):(m.next=k.next,k.next=m),n.interleaved=m;return}}catch{}finally{}l=cA(e,n,m,h),l!==null&&(m=ui(),Wo(l,e,h,m),MA(l,n,h))}}function IA(e){var n=e.alternate;return e===Jn||n!==null&&n===Jn}function kA(e,n){vp=Vg=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function MA(e,n,l){if(l&4194240){var h=n.lanes;h&=e.pendingLanes,l|=h,n.lanes=l,k1(e,l)}}var $g={readContext:mo,useCallback:Jr,useContext:Jr,useEffect:Jr,useImperativeHandle:Jr,useInsertionEffect:Jr,useLayoutEffect:Jr,useMemo:Jr,useReducer:Jr,useRef:Jr,useState:Jr,useDebugValue:Jr,useDeferredValue:Jr,useTransition:Jr,useMutableSource:Jr,useSyncExternalStore:Jr,useId:Jr,unstable_isNewReconciler:!1},SL={readContext:mo,useCallback:function(e,n){return gs().memoizedState=[e,n===void 0?null:n],e},useContext:mo,useEffect:sE,useImperativeHandle:function(e,n,l){return l=l!=null?l.concat([e]):null,hg(4194308,4,bA.bind(null,n,e),l)},useLayoutEffect:function(e,n){return hg(4194308,4,e,n)},useInsertionEffect:function(e,n){return hg(4,2,e,n)},useMemo:function(e,n){var l=gs();return n=n===void 0?null:n,e=e(),l.memoizedState=[e,n],e},useReducer:function(e,n,l){var h=gs();return n=l!==void 0?l(n):n,h.memoizedState=h.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},h.queue=e,e=e.dispatch=EL.bind(null,Jn,e),[h.memoizedState,e]},useRef:function(e){var n=gs();return e={current:e},n.memoizedState=e},useState:oE,useDebugValue:J1,useDeferredValue:function(e){return gs().memoizedState=e},useTransition:function(){var e=oE(!1),n=e[0];return e=bL.bind(null,e[1]),gs().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,l){var h=Jn,m=gs();if(jn){if(l===void 0)throw Error(it(407));l=l()}else{if(l=n(),Rr===null)throw Error(it(349));_c&30||fA(h,n,l)}m.memoizedState=l;var v={value:l,getSnapshot:n};return m.queue=v,sE(gA.bind(null,h,v,e),[e]),h.flags|=2048,Up(9,mA.bind(null,h,v,l,n),void 0,null),l},useId:function(){var e=gs(),n=Rr.identifierPrefix;if(jn){var l=Js,h=Ys;l=(h&~(1<<32-qo(h)-1)).toString(32)+l,n=":"+n+"R"+l,l=Fp++,0<\/script>",e=e.removeChild(e.firstChild)):typeof h.is=="string"?e=E.createElement(l,{is:h.is}):(e=E.createElement(l),l==="select"&&(E=e,h.multiple?E.multiple=!0:h.size&&(E.size=h.size))):e=E.createElementNS(e,l),e[ys]=n,e[Dp]=h,UA(e,n,!1,!1),n.stateNode=e;e:{switch(E=xv(l,h),l){case"dialog":Dn("cancel",e),Dn("close",e),m=h;break;case"iframe":case"object":case"embed":Dn("load",e),m=h;break;case"video":case"audio":for(m=0;mah&&(n.flags|=128,h=!0,ip(v,!1),n.lanes=4194304)}else{if(!h)if(e=jg(E),e!==null){if(n.flags|=128,h=!0,l=e.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),ip(v,!0),v.tail===null&&v.tailMode==="hidden"&&!E.alternate&&!jn)return Qr(n),null}else 2*lr()-v.renderingStartTime>ah&&l!==1073741824&&(n.flags|=128,h=!0,ip(v,!1),n.lanes=4194304);v.isBackwards?(E.sibling=n.child,n.child=E):(l=v.last,l!==null?l.sibling=E:n.child=E,v.last=E)}return v.tail!==null?(n=v.tail,v.rendering=n,v.tail=n.sibling,v.renderingStartTime=lr(),n.sibling=null,l=Yn.current,Pn(Yn,h?l&1|2:l&1),n):(Qr(n),null);case 22:case 23:return ix(),h=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==h&&(n.flags|=8192),h&&n.mode&1?ji&1073741824&&(Qr(n),n.subtreeFlags&6&&(n.flags|=8192)):Qr(n),null;case 24:return null;case 25:return null}throw Error(it(156,n.tag))}function LL(e,n){switch(F1(n),n.tag){case 1:return Ii(n.type)&&Rg(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return oh(),On(Ci),On(ni),Z1(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return W1(n),null;case 13:if(On(Yn),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(it(340));rh()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return On(Yn),null;case 4:return oh(),null;case 10:return V1(n.type._context),null;case 22:case 23:return ix(),null;case 24:return null;default:return null}}var Zm=!1,ti=!1,RL=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Vu(e,n){var l=e.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(h){or(e,n,h)}else l.current=null}function Zv(e,n,l){try{l()}catch(h){or(e,n,h)}}var _E=!1;function DL(e,n){if(Mv=Mg,e=ZS(),O1(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var h=l.getSelection&&l.getSelection();if(h&&h.rangeCount!==0){l=h.anchorNode;var m=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var E=0,s=-1,k=-1,D=0,V=0,G=e,J=null;t:for(;;){for(var ve;G!==l||m!==0&&G.nodeType!==3||(s=E+m),G!==v||h!==0&&G.nodeType!==3||(k=E+h),G.nodeType===3&&(E+=G.nodeValue.length),(ve=G.firstChild)!==null;)J=G,G=ve;for(;;){if(G===e)break t;if(J===l&&++D===m&&(s=E),J===v&&++V===h&&(k=E),(ve=G.nextSibling)!==null)break;G=J,J=G.parentNode}G=ve}l=s===-1||k===-1?null:{start:s,end:k}}else l=null}l=l||{start:0,end:0}}else l=null;for(Pv={focusedElem:e,selectionRange:l},Mg=!1,yt=n;yt!==null;)if(n=yt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,yt=e;else for(;yt!==null;){n=yt;try{var ae=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ae!==null){var me=ae.memoizedProps,Ce=ae.memoizedState,ie=n.stateNode,te=ie.getSnapshotBeforeUpdate(n.elementType===n.type?me:jo(n.type,me),Ce);ie.__reactInternalSnapshotBeforeUpdate=te}break;case 3:var le=n.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(it(163))}}catch(ze){or(n,n.return,ze)}if(e=n.sibling,e!==null){e.return=n.return,yt=e;break}yt=n.return}return ae=_E,_E=!1,ae}function xp(e,n,l){var h=n.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var m=h=h.next;do{if((m.tag&e)===e){var v=m.destroy;m.destroy=void 0,v!==void 0&&Zv(n,l,v)}m=m.next}while(m!==h)}}function m_(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var l=n=n.next;do{if((l.tag&e)===e){var h=l.create;l.destroy=h()}l=l.next}while(l!==n)}}function Hv(e){var n=e.ref;if(n!==null){var l=e.stateNode;switch(e.tag){case 5:e=l;break;default:e=l}typeof n=="function"?n(e):n.current=e}}function $A(e){var n=e.alternate;n!==null&&(e.alternate=null,$A(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[ys],delete n[Dp],delete n[Rv],delete n[_L],delete n[yL])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function GA(e){return e.tag===5||e.tag===3||e.tag===4}function yE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||GA(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xv(e,n,l){var h=e.tag;if(h===5||h===6)e=e.stateNode,n?l.nodeType===8?l.parentNode.insertBefore(e,n):l.insertBefore(e,n):(l.nodeType===8?(n=l.parentNode,n.insertBefore(e,l)):(n=l,n.appendChild(e)),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Lg));else if(h!==4&&(e=e.child,e!==null))for(Xv(e,n,l),e=e.sibling;e!==null;)Xv(e,n,l),e=e.sibling}function Kv(e,n,l){var h=e.tag;if(h===5||h===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(h!==4&&(e=e.child,e!==null))for(Kv(e,n,l),e=e.sibling;e!==null;)Kv(e,n,l),e=e.sibling}var Fr=null,Vo=!1;function ja(e,n,l){for(l=l.child;l!==null;)qA(e,n,l),l=l.sibling}function qA(e,n,l){if(vs&&typeof vs.onCommitFiberUnmount=="function")try{vs.onCommitFiberUnmount(a_,l)}catch{}switch(l.tag){case 5:ti||Vu(l,n);case 6:var h=Fr,m=Vo;Fr=null,ja(e,n,l),Fr=h,Vo=m,Fr!==null&&(Vo?(e=Fr,l=l.stateNode,e.nodeType===8?e.parentNode.removeChild(l):e.removeChild(l)):Fr.removeChild(l.stateNode));break;case 18:Fr!==null&&(Vo?(e=Fr,l=l.stateNode,e.nodeType===8?U0(e.parentNode,l):e.nodeType===1&&U0(e,l),Mp(e)):U0(Fr,l.stateNode));break;case 4:h=Fr,m=Vo,Fr=l.stateNode.containerInfo,Vo=!0,ja(e,n,l),Fr=h,Vo=m;break;case 0:case 11:case 14:case 15:if(!ti&&(h=l.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){m=h=h.next;do{var v=m,E=v.destroy;v=v.tag,E!==void 0&&(v&2||v&4)&&Zv(l,n,E),m=m.next}while(m!==h)}ja(e,n,l);break;case 1:if(!ti&&(Vu(l,n),h=l.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=l.memoizedProps,h.state=l.memoizedState,h.componentWillUnmount()}catch(s){or(l,n,s)}ja(e,n,l);break;case 21:ja(e,n,l);break;case 22:l.mode&1?(ti=(h=ti)||l.memoizedState!==null,ja(e,n,l),ti=h):ja(e,n,l);break;default:ja(e,n,l)}}function vE(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var l=e.stateNode;l===null&&(l=e.stateNode=new RL),n.forEach(function(h){var m=GL.bind(null,e,h);l.has(h)||(l.add(h),h.then(m,m))})}}function Uo(e,n){var l=n.deletions;if(l!==null)for(var h=0;hm&&(m=E),h&=~v}if(h=m,h=lr()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*BL(h/1960))-h,10e?16:e,Xa===null)var h=!1;else{if(e=Xa,Xa=null,Wg=0,nn&6)throw Error(it(331));var m=nn;for(nn|=4,yt=e.current;yt!==null;){var v=yt,E=v.child;if(yt.flags&16){var s=v.deletions;if(s!==null){for(var k=0;klr()-nx?pc(e,0):tx|=l),ki(e,n)}function QA(e,n){n===0&&(e.mode&1?(n=Fm,Fm<<=1,!(Fm&130023424)&&(Fm=4194304)):n=1);var l=ui();e=ra(e,n),e!==null&&(Jp(e,n,l),ki(e,l))}function $L(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),QA(e,l)}function GL(e,n){var l=0;switch(e.tag){case 13:var h=e.stateNode,m=e.memoizedState;m!==null&&(l=m.retryLane);break;case 19:h=e.stateNode;break;default:throw Error(it(314))}h!==null&&h.delete(n),QA(e,l)}var eC;eC=function(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps||Ci.current)Ai=!0;else{if(!(e.lanes&l)&&!(n.flags&128))return Ai=!1,PL(e,n,l);Ai=!!(e.flags&131072)}else Ai=!1,jn&&n.flags&1048576&&iA(n,Bg,n.index);switch(n.lanes=0,n.tag){case 2:var h=n.type;dg(e,n),e=n.pendingProps;var m=nh(n,ni.current);Xu(n,l),m=X1(null,n,h,e,m,l);var v=K1();return n.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Ii(h)?(v=!0,Dg(n)):v=!1,n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,G1(n),m.updater=f_,n.stateNode=m,m._reactInternals=n,Uv(n,h,e,l),n=$v(null,n,h,!0,v,l)):(n.tag=0,jn&&v&&B1(n),ci(null,n,m,l),n=n.child),n;case 16:h=n.elementType;e:{switch(dg(e,n),e=n.pendingProps,m=h._init,h=m(h._payload),n.type=h,m=n.tag=WL(h),e=jo(h,e),m){case 0:n=Vv(null,n,h,e,l);break e;case 1:n=fE(null,n,h,e,l);break e;case 11:n=dE(null,n,h,e,l);break e;case 14:n=pE(null,n,h,jo(h.type,e),l);break e}throw Error(it(306,h,""))}return n;case 0:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),Vv(e,n,h,m,l);case 1:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),fE(e,n,h,m,l);case 3:e:{if(BA(n),e===null)throw Error(it(387));h=n.pendingProps,v=n.memoizedState,m=v.element,uA(e,n),Ug(n,h,null,l);var E=n.memoizedState;if(h=E.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=v,n.memoizedState=v,n.flags&256){m=sh(Error(it(423)),n),n=mE(e,n,h,l,m);break e}else if(h!==m){m=sh(Error(it(424)),n),n=mE(e,n,h,l,m);break e}else for($i=el(n.stateNode.containerInfo.firstChild),Gi=n,jn=!0,$o=null,l=lA(n,null,h,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(rh(),h===m){n=ia(e,n,l);break e}ci(e,n,h,l)}n=n.child}return n;case 5:return hA(n),e===null&&Bv(n),h=n.type,m=n.pendingProps,v=e!==null?e.memoizedProps:null,E=m.children,zv(h,m)?E=null:v!==null&&zv(h,v)&&(n.flags|=32),OA(e,n),ci(e,n,E,l),n.child;case 6:return e===null&&Bv(n),null;case 13:return FA(e,n,l);case 4:return q1(n,n.stateNode.containerInfo),h=n.pendingProps,e===null?n.child=ih(n,null,h,l):ci(e,n,h,l),n.child;case 11:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),dE(e,n,h,m,l);case 7:return ci(e,n,n.pendingProps,l),n.child;case 8:return ci(e,n,n.pendingProps.children,l),n.child;case 12:return ci(e,n,n.pendingProps.children,l),n.child;case 10:e:{if(h=n.type._context,m=n.pendingProps,v=n.memoizedProps,E=m.value,Pn(Fg,h._currentValue),h._currentValue=E,v!==null)if(Xo(v.value,E)){if(v.children===m.children&&!Ci.current){n=ia(e,n,l);break e}}else for(v=n.child,v!==null&&(v.return=n);v!==null;){var s=v.dependencies;if(s!==null){E=v.child;for(var k=s.firstContext;k!==null;){if(k.context===h){if(v.tag===1){k=Qs(-1,l&-l),k.tag=2;var D=v.updateQueue;if(D!==null){D=D.shared;var V=D.pending;V===null?k.next=k:(k.next=V.next,V.next=k),D.pending=k}}v.lanes|=l,k=v.alternate,k!==null&&(k.lanes|=l),Fv(v.return,l,n),s.lanes|=l;break}k=k.next}}else if(v.tag===10)E=v.type===n.type?null:v.child;else if(v.tag===18){if(E=v.return,E===null)throw Error(it(341));E.lanes|=l,s=E.alternate,s!==null&&(s.lanes|=l),Fv(E,l,n),E=v.sibling}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===n){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}ci(e,n,m.children,l),n=n.child}return n;case 9:return m=n.type,h=n.pendingProps.children,Xu(n,l),m=mo(m),h=h(m),n.flags|=1,ci(e,n,h,l),n.child;case 14:return h=n.type,m=jo(h,n.pendingProps),m=jo(h.type,m),pE(e,n,h,m,l);case 15:return RA(e,n,n.type,n.pendingProps,l);case 17:return h=n.type,m=n.pendingProps,m=n.elementType===h?m:jo(h,m),dg(e,n),n.tag=1,Ii(h)?(e=!0,Dg(n)):e=!1,Xu(n,l),PA(n,h,m),Uv(n,h,m,l),$v(null,n,h,!0,e,l);case 19:return NA(e,n,l);case 22:return DA(e,n,l)}throw Error(it(156,n.tag))};function tC(e,n){return IS(e,n)}function qL(e,n,l,h){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function po(e,n,l,h){return new qL(e,n,l,h)}function sx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WL(e){if(typeof e=="function")return sx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===S1)return 11;if(e===A1)return 14}return 2}function il(e,n){var l=e.alternate;return l===null?(l=po(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&14680064,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l}function mg(e,n,l,h,m,v){var E=2;if(h=e,typeof e=="function")sx(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case Lu:return fc(l.children,m,v,n);case T1:E=8,m|=8;break;case uv:return e=po(12,l,n,m|2),e.elementType=uv,e.lanes=v,e;case hv:return e=po(13,l,n,m),e.elementType=hv,e.lanes=v,e;case dv:return e=po(19,l,n,m),e.elementType=dv,e.lanes=v,e;case hS:return __(l,m,v,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cS:E=10;break e;case uS:E=9;break e;case S1:E=11;break e;case A1:E=14;break e;case Ga:E=16,h=null;break e}throw Error(it(130,e==null?e:typeof e,""))}return n=po(E,l,n,m),n.elementType=e,n.type=h,n.lanes=v,n}function fc(e,n,l,h){return e=po(7,e,h,n),e.lanes=l,e}function __(e,n,l,h){return e=po(22,e,h,n),e.elementType=hS,e.lanes=l,e.stateNode={isHidden:!1},e}function H0(e,n,l){return e=po(6,e,null,n),e.lanes=l,e}function X0(e,n,l){return n=po(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function ZL(e,n,l,h,m){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=k0(0),this.expirationTimes=k0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=k0(0),this.identifierPrefix=h,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function ax(e,n,l,h,m,v,E,s,k){return e=new ZL(e,n,l,s,k),n===1?(n=1,v===!0&&(n|=8)):n=0,v=po(3,null,null,n),e.current=v,v.stateNode=e,v.memoizedState={element:h,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},G1(v),e}function HL(e,n,l){var h=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oC)}catch(e){console.error(e)}}oC(),oS.exports=Hi;var hx=oS.exports,sC,CE=hx;sC=CE.createRoot,CE.hydrateRoot;const QL="Logging",eR="NoHubcallbackProvidedException";var Ui;(function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE",e.NONE="NONE"})(Ui||(Ui={}));const IE={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class Zo{constructor(n,l=Ui.WARN){this.name=n,this.level=l,this._pluggables=[]}_padding(n){return n<10?"0"+n:""+n}_ts(){const n=new Date;return[this._padding(n.getMinutes()),this._padding(n.getSeconds())].join(":")+"."+n.getMilliseconds()}configure(n){return n?(this._config=n,this._config):this._config}_log(n,...l){let h=this.level;Zo.LOG_LEVEL&&(h=Zo.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(h=window.LOG_LEVEL);const m=IE[h];if(!(IE[n]>=m))return;let E=console.log.bind(console);n===Ui.ERROR&&console.error&&(E=console.error.bind(console)),n===Ui.WARN&&console.warn&&(E=console.warn.bind(console)),Zo.BIND_ALL_LOG_LEVELS&&(n===Ui.INFO&&console.info&&(E=console.info.bind(console)),n===Ui.DEBUG&&console.debug&&(E=console.debug.bind(console)));const s=`[${n}] ${this._ts()} ${this.name}`;let k="";if(l.length===1&&typeof l[0]=="string")k=`${s} - ${l[0]}`,E(k);else if(l.length===1)k=`${s} ${l[0]}`,E(s,l[0]);else if(typeof l[0]=="string"){let D=l.slice(1);D.length===1&&(D=D[0]),k=`${s} - ${l[0]} ${D}`,E(`${s} - ${l[0]}`,D)}else k=`${s} ${l}`,E(s,l);for(const D of this._pluggables){const V={message:k,timestamp:Date.now()};D.pushLogs([V])}}log(...n){this._log(Ui.INFO,...n)}info(...n){this._log(Ui.INFO,...n)}warn(...n){this._log(Ui.WARN,...n)}error(...n){this._log(Ui.ERROR,...n)}debug(...n){this._log(Ui.DEBUG,...n)}verbose(...n){this._log(Ui.VERBOSE,...n)}addPluggable(n){n&&n.getCategoryName()===QL&&(this._pluggables.push(n),n.configure(this._config))}listPluggables(){return this._pluggables}}Zo.LOG_LEVEL=null;Zo.BIND_ALL_LOG_LEVELS=!1;class bs extends Error{constructor({message:n,name:l,recoverySuggestion:h,underlyingError:m}){super(n),this.name=l,this.underlyingError=m,this.recoverySuggestion=h,this.constructor=bs,Object.setPrototypeOf(this,bs.prototype)}}var Vp;(function(e){e.NoEndpointId="NoEndpointId",e.PlatformNotSupported="PlatformNotSupported",e.Unknown="Unknown",e.NetworkError="NetworkError"})(Vp||(Vp={}));const aC=(e,n=bs)=>(l,h,m)=>{const{message:v,recoverySuggestion:E}=e[h];if(!l)throw new n({name:h,message:m?`${v} ${m}`:v,recoverySuggestion:E})},Xg=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",sp=new Zo("Hub");class tR{constructor(n){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=n}_remove(n,l){const h=this.listeners.get(n);if(!h){sp.warn(`No listeners for ${n}`);return}this.listeners.set(n,[...h.filter(({callback:m})=>m!==l)])}dispatch(n,l,h,m){typeof n=="string"&&this.protectedChannels.indexOf(n)>-1&&(m===Xg||sp.warn(`WARNING: ${n} is protected and dispatching on it can have unintended consequences`));const v={channel:n,payload:{...l},source:h,patternInfo:[]};try{this._toListeners(v)}catch(E){sp.error(E)}}listen(n,l,h="noname"){let m;if(typeof l!="function")throw new bs({name:eR,message:"No callback supplied to Hub"});m=l;let v=this.listeners.get(n);return v||(v=[],this.listeners.set(n,v)),v.push({name:h,callback:m}),()=>{this._remove(n,m)}}_toListeners(n){const{channel:l,payload:h}=n,m=this.listeners.get(l);m&&m.forEach(v=>{sp.debug(`Dispatching to ${l} with `,h);try{v.callback(n)}catch(E){sp.error(E)}})}}const t1=new tR("__default__"),nR=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new bs({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},rR={convert(e){return nR()(e)}};var Xs;(function(e){e.AuthTokenConfigException="AuthTokenConfigException",e.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",e.AuthUserPoolException="AuthUserPoolException",e.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",e.OAuthNotConfigureException="OAuthNotConfigureException"})(Xs||(Xs={}));const iR={[Xs.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[Xs.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[Xs.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[Xs.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[Xs.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},lC=aC(iR);function Ti(e){let n=!0;e?n=!!e.userPoolId&&!!e.userPoolClientId:n=!1,lC(n,Xs.AuthUserPoolException)}function gg(e){const n=!!(e!=null&&e.identityPoolId);lC(n,Xs.InvalidIdentityPoolIdException)}function $p(e){const n=e.split(".");if(n.length!==3)throw new Error("Invalid token");try{const h=n[1].replace(/-/g,"+").replace(/_/g,"/"),m=decodeURIComponent(rR.convert(h).split("").map(E=>`%${`00${E.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),v=JSON.parse(m);return{toString:()=>e,payload:v}}catch{throw new Error("Invalid token payload")}}const cC=e=>{const n=Reflect.ownKeys(e);for(const l of n){const h=e[l];(h&&typeof h=="object"||typeof h=="function")&&cC(h)}return Object.freeze(e)},oR=new Zo("parseAWSExports"),sR={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},aR=(e={})=>{var sr,ii,ar,br,Es,Yi;if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new bs({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});const{aws_appsync_apiKey:n,aws_appsync_authenticationType:l,aws_appsync_graphqlEndpoint:h,aws_appsync_region:m,aws_bots_config:v,aws_cognito_identity_pool_id:E,aws_cognito_sign_up_verification_method:s,aws_cognito_mfa_configuration:k,aws_cognito_mfa_types:D,aws_cognito_password_protection_settings:V,aws_cognito_verification_mechanisms:G,aws_cognito_signup_attributes:J,aws_cognito_social_providers:ve,aws_cognito_username_attributes:ae,aws_mandatory_sign_in:me,aws_mobile_analytics_app_id:Ce,aws_mobile_analytics_app_region:ie,aws_user_files_s3_bucket:te,aws_user_files_s3_bucket_region:le,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:ze,aws_user_pools_id:Oe,aws_user_pools_web_client_id:Ke,geo:He,oauth:ht,predictions:Ve,aws_cloud_logic_custom:jt,Notifications:wr,modelIntrospection:St}=e,Vt={};Ce&&(Vt.Analytics={Pinpoint:{appId:Ce,region:ie}});const{InAppMessaging:Vr,Push:$r}=wr??{};if(Vr!=null&&Vr.AWSPinpoint||$r!=null&&$r.AWSPinpoint){if(Vr!=null&&Vr.AWSPinpoint){const{appId:xn,region:kt}=Vr.AWSPinpoint;Vt.Notifications={InAppMessaging:{Pinpoint:{appId:xn,region:kt}}}}if($r!=null&&$r.AWSPinpoint){const{appId:xn,region:kt}=$r.AWSPinpoint;Vt.Notifications={...Vt.Notifications,PushNotification:{Pinpoint:{appId:xn,region:kt}}}}}if(Array.isArray(v)&&(Vt.Interactions={LexV1:Object.fromEntries(v.map(xn=>[xn.name,xn]))}),h){const xn=sR[l];xn||oR.debug(`Invalid authentication type ${l}. Falling back to IAM.`),Vt.API={GraphQL:{endpoint:h,apiKey:n,region:m,defaultAuthMode:xn??"iam"}},St&&(Vt.API.GraphQL.modelIntrospection=St)}const Li=k?{status:k&&k.toLowerCase(),totpEnabled:(D==null?void 0:D.includes("TOTP"))??!1,smsEnabled:(D==null?void 0:D.includes("SMS"))??!1}:void 0,Ki=V?{minLength:V.passwordPolicyMinLength,requireLowercase:((sr=V.passwordPolicyCharacters)==null?void 0:sr.includes("REQUIRES_LOWERCASE"))??!1,requireUppercase:((ii=V.passwordPolicyCharacters)==null?void 0:ii.includes("REQUIRES_UPPERCASE"))??!1,requireNumbers:((ar=V.passwordPolicyCharacters)==null?void 0:ar.includes("REQUIRES_NUMBERS"))??!1,requireSpecialCharacters:((br=V.passwordPolicyCharacters)==null?void 0:br.includes("REQUIRES_SYMBOLS"))??!1}:void 0,Tt=Array.from(new Set([...G??[],...J??[]])).reduce((xn,kt)=>({...xn,[kt.toLowerCase()]:{required:!0}}),{}),xt=(ae==null?void 0:ae.includes("EMAIL"))??!1,Bt=(ae==null?void 0:ae.includes("PHONE_NUMBER"))??!1;(E||Oe)&&(Vt.Auth={Cognito:{identityPoolId:E,allowGuestAccess:me!=="enable",signUpVerificationMethod:s,userAttributes:Tt,userPoolClientId:Ke,userPoolId:Oe,mfa:Li,passwordFormat:Ki,loginWith:{username:!(xt||Bt),email:xt,phone:Bt}}});const dn=ht?Object.keys(ht).length>0:!1,vn=ve?ve.length>0:!1;if(Vt.Auth&&dn&&(Vt.Auth.Cognito.loginWith={...Vt.Auth.Cognito.loginWith,oauth:{...lR(ht),...vn&&{providers:cR(ve)}}}),te&&(Vt.Storage={S3:{bucket:te,region:le,dangerouslyConnectToHttpEndpointForTesting:ze}}),He){const{amazon_location_service:xn}=He;Vt.Geo={LocationService:{maps:xn.maps,geofenceCollections:xn.geofenceCollections,searchIndices:xn.search_indices,region:xn.region}}}if(jt&&(Vt.API={...Vt.API,REST:jt.reduce((xn,kt)=>{const{name:Yo,endpoint:Dr,region:Jo,service:wn}=kt;return{...xn,[Yo]:{endpoint:Dr,...wn?{service:wn}:void 0,...Jo?{region:Jo}:void 0}}},{})}),Ve){const{VoiceId:xn}=((Yi=(Es=Ve==null?void 0:Ve.convert)==null?void 0:Es.speechGenerator)==null?void 0:Yi.defaults)??{};Vt.Predictions=xn?{...Ve,convert:{...Ve.convert,speechGenerator:{...Ve.convert.speechGenerator,defaults:{voiceId:xn}}}}:Ve}return Vt},kE=e=>(e==null?void 0:e.split(","))??[],lR=({domain:e,scope:n,redirectSignIn:l,redirectSignOut:h,responseType:m})=>({domain:e,scopes:n,redirectSignIn:kE(l),redirectSignOut:kE(h),responseType:m}),cR=e=>e.map(n=>{const l=n.toLowerCase();return l.charAt(0).toUpperCase()+l.slice(1)}),uR=Symbol("oauth-listener");function hR(e){const{version:n}=e;return n?n.startsWith("1"):!1}function dR(e){if(!e)return;const{bucket_name:n,aws_region:l,buckets:h}=e;return{S3:{bucket:n,region:l,buckets:h&&ER(h)}}}function pR(e){if(!e)return;const{user_pool_id:n,user_pool_client_id:l,identity_pool_id:h,password_policy:m,mfa_configuration:v,mfa_methods:E,unauthenticated_identities_enabled:s,oauth:k,username_attributes:D,standard_required_attributes:V}=e,G={Cognito:{userPoolId:n,userPoolClientId:l}};return h&&(G.Cognito={...G.Cognito,identityPoolId:h}),m&&(G.Cognito.passwordFormat={requireLowercase:m.require_lowercase,requireNumbers:m.require_numbers,requireUppercase:m.require_uppercase,requireSpecialCharacters:m.require_symbols,minLength:m.min_length??6}),v&&(G.Cognito.mfa={status:bR(v),smsEnabled:E==null?void 0:E.includes("SMS"),totpEnabled:E==null?void 0:E.includes("TOTP")}),s&&(G.Cognito.allowGuestAccess=s),k&&(G.Cognito.loginWith={oauth:{domain:k.domain,redirectSignIn:k.redirect_sign_in_uri,redirectSignOut:k.redirect_sign_out_uri,responseType:k.response_type==="token"?"token":"code",scopes:k.scopes,providers:wR(k.identity_providers)}}),D&&(G.Cognito.loginWith={...G.Cognito.loginWith,email:D.includes("email"),phone:D.includes("phone_number"),username:D.includes("username")}),V&&(G.Cognito.userAttributes=V.reduce((J,ve)=>({...J,[ve]:{required:!0}}),{})),G}function fR(e){if(!(e!=null&&e.amazon_pinpoint))return;const{amazon_pinpoint:n}=e;return{Pinpoint:{appId:n.app_id,region:n.aws_region}}}function mR(e){if(!e)return;const{aws_region:n,geofence_collections:l,maps:h,search_indices:m}=e;return{LocationService:{region:n,searchIndices:m,geofenceCollections:l,maps:h}}}function gR(e){if(!e)return;const{aws_region:n,default_authorization_type:l,url:h,api_key:m,model_introspection:v}=e;return{GraphQL:{endpoint:h,defaultAuthMode:xR(l),region:n,apiKey:m,modelIntrospection:v}}}function _R(e){if(!e)return;const{aws_region:n,channels:l,amazon_pinpoint_app_id:h}=e,m=l.includes("IN_APP_MESSAGING"),v=l.includes("APNS")||l.includes("FCM");if(!(m||v))return;const E={};return m&&(E.InAppMessaging={Pinpoint:{appId:h,region:n}}),v&&(E.PushNotification={Pinpoint:{appId:h,region:n}}),E}function yR(e){const n={};return e.storage&&(n.Storage=dR(e.storage)),e.auth&&(n.Auth=pR(e.auth)),e.analytics&&(n.Analytics=fR(e.analytics)),e.geo&&(n.Geo=mR(e.geo)),e.data&&(n.API=gR(e.data)),e.notifications&&(n.Notifications=_R(e.notifications)),n}const vR={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function xR(e){return vR[e]}const ME={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function wR(e=[]){return e.reduce((n,l)=>(ME[l]!==void 0&&n.push(ME[l]),n),[])}function bR(e){return e==="OPTIONAL"?"optional":e==="REQUIRED"?"on":"off"}function ER(e){const n={};return e.forEach(({name:l,bucket_name:h,aws_region:m})=>{if(l in n)throw new Error(`Duplicate friendly name found: ${l}. Name must be unique.`);n[l]={bucketName:h,region:m}}),n}const uC=e=>Object.keys(e).some(n=>n.startsWith("aws_"))?aR(e):hR(e)?yR(e):e;function PE({expiresAt:e,clockDrift:n}){return Date.now()+n>e}class TR{configure(n,l){this.authConfig=n,this.authOptions=l}async fetchAuthSession(n={}){var v,E,s,k,D,V;let l,h;const m=await this.getTokens(n);return m?(h=(E=(v=m.accessToken)==null?void 0:v.payload)==null?void 0:E.sub,l=await((k=(s=this.authOptions)==null?void 0:s.credentialsProvider)==null?void 0:k.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:m,authenticated:!0,forceRefresh:n.forceRefresh}))):l=await((V=(D=this.authOptions)==null?void 0:D.credentialsProvider)==null?void 0:V.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:n.forceRefresh})),{tokens:m,credentials:l==null?void 0:l.credentials,identityId:l==null?void 0:l.identityId,userSub:h}}async clearCredentials(){var n,l;await((l=(n=this.authOptions)==null?void 0:n.credentialsProvider)==null?void 0:l.clearCredentialsAndIdentityId())}async getTokens(n){var l,h;return await((h=(l=this.authOptions)==null?void 0:l.tokenProvider)==null?void 0:h.getTokens(n))??void 0}}const SR=e=>new TextEncoder().encode(e);typeof Buffer<"u"&&Buffer.from;for(let e=0;e<256;e++){let n=e.toString(16).toLowerCase();n.length===1&&(n=`0${n}`)}var _r;(function(e){e.WebUnknown="0",e.React="1",e.NextJs="2",e.Angular="3",e.VueJs="4",e.Nuxt="5",e.Svelte="6",e.ServerSideUnknown="100",e.ReactSSR="101",e.NextJsSSR="102",e.AngularSSR="103",e.VueJsSSR="104",e.NuxtSSR="105",e.SvelteSSR="106",e.ReactNative="201",e.Expo="202"})(_r||(_r={}));var zE;(function(e){e.API="api",e.Auth="auth",e.Analytics="analytics",e.DataStore="datastore",e.Geo="geo",e.InAppMessaging="inappmessaging",e.Interactions="interactions",e.Predictions="predictions",e.PubSub="pubsub",e.PushNotification="pushnotification",e.Storage="storage"})(zE||(zE={}));var LE;(function(e){e.Record="1",e.IdentifyUser="2"})(LE||(LE={}));var RE;(function(e){e.GraphQl="1",e.Get="2",e.Post="3",e.Put="4",e.Patch="5",e.Del="6",e.Head="7"})(RE||(RE={}));var DE;(function(e){e.SignUp="1",e.ConfirmSignUp="2",e.ResendSignUpCode="3",e.SignIn="4",e.FetchMFAPreference="6",e.UpdateMFAPreference="7",e.SetUpTOTP="10",e.VerifyTOTPSetup="11",e.ConfirmSignIn="12",e.DeleteUserAttributes="15",e.DeleteUser="16",e.UpdateUserAttributes="17",e.FetchUserAttributes="18",e.ConfirmUserAttribute="22",e.SignOut="26",e.UpdatePassword="27",e.ResetPassword="28",e.ConfirmResetPassword="29",e.FederatedSignIn="30",e.RememberDevice="32",e.ForgetDevice="33",e.FetchDevices="34",e.SendUserAttributeVerificationCode="35",e.SignInWithRedirect="36"})(DE||(DE={}));var OE;(function(e){e.Subscribe="1",e.GraphQl="2"})(OE||(OE={}));var BE;(function(e){e.SearchByText="0",e.SearchByCoordinates="1",e.SearchForSuggestions="2",e.SearchByPlaceId="3",e.SaveGeofences="4",e.GetGeofence="5",e.ListGeofences="6",e.DeleteGeofences="7"})(BE||(BE={}));var FE;(function(e){e.SyncMessages="1",e.IdentifyUser="2",e.NotifyMessageInteraction="3"})(FE||(FE={}));var NE;(function(e){e.None="0"})(NE||(NE={}));var UE;(function(e){e.Convert="1",e.Identify="2",e.Interpret="3"})(UE||(UE={}));var jE;(function(e){e.Subscribe="1"})(jE||(jE={}));var VE;(function(e){e.InitializePushNotifications="1",e.IdentifyUser="2"})(VE||(VE={}));var $E;(function(e){e.UploadData="1",e.DownloadData="2",e.List="3",e.Copy="4",e.Remove="5",e.GetProperties="6",e.GetUrl="7"})($E||($E={}));const b_=()=>typeof global<"u",fh=()=>typeof window<"u",hC=()=>typeof document<"u",dx=()=>typeof process<"u",Gp=(e,n)=>!!Object.keys(e).find(l=>l.startsWith(n));function AR(){const e=h=>h.startsWith("_react")||h.startsWith("__react"),n=h=>Object.keys(h).find(e),l=()=>Array.from(document.querySelectorAll("[id]"));return hC()&&l().some(n)}function CR(){return dx()&&typeof process.env<"u"&&!!Object.keys(process.env).find(e=>e.includes("react"))}function IR(){return fh()&&Gp(window,"__VUE")}function kR(){return b_()&&Gp(global,"__VUE")}function MR(){return fh()&&Gp(window,"__SVELTE")}function PR(){return dx()&&typeof process.env<"u"&&!!Object.keys(process.env).find(e=>e.includes("svelte"))}function zR(){return fh()&&window.next&&typeof window.next=="object"}function LR(){return b_()&&(Gp(global,"__next")||Gp(global,"__NEXT"))}function RR(){return fh()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function DR(){return b_()&&typeof global.__NUXT_PATHS__<"u"}function OR(){const e=!!(hC()&&document.querySelector("[ng-version]")),n=!!(fh()&&typeof window.ng<"u");return e||n}function BR(){var e;return dx()&&typeof process.env=="object"&&((e={}.npm_lifecycle_script)==null?void 0:e.startsWith("ng "))||!1}function FR(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function NR(){return b_()&&typeof global.expo<"u"}function UR(){return fh()}const jR=[{platform:_r.Expo,detectionMethod:NR},{platform:_r.ReactNative,detectionMethod:FR},{platform:_r.NextJs,detectionMethod:zR},{platform:_r.Nuxt,detectionMethod:RR},{platform:_r.Angular,detectionMethod:OR},{platform:_r.React,detectionMethod:AR},{platform:_r.VueJs,detectionMethod:IR},{platform:_r.Svelte,detectionMethod:MR},{platform:_r.WebUnknown,detectionMethod:UR},{platform:_r.NextJsSSR,detectionMethod:LR},{platform:_r.NuxtSSR,detectionMethod:DR},{platform:_r.ReactSSR,detectionMethod:CR},{platform:_r.VueJsSSR,detectionMethod:kR},{platform:_r.AngularSSR,detectionMethod:BR},{platform:_r.SvelteSSR,detectionMethod:PR}];function VR(){var e;return((e=jR.find(n=>n.detectionMethod()))==null?void 0:e.platform)||_r.ServerSideUnknown}const $R=()=>typeof window<"u"&&typeof window.document<"u";class GR{constructor(){this.oAuthListener=void 0,this.resourcesConfig={},this.libraryOptions={},this.Auth=new TR}configure(n,l){const h=uC(n);this.resourcesConfig=h,l&&(this.libraryOptions=l),this.resourcesConfig=cC(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),t1.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",Xg),this.notifyOAuthListener()}getConfig(){return this.resourcesConfig}[uR](n){var l,h,m;(h=(l=this.resourcesConfig.Auth)==null?void 0:l.Cognito.loginWith)!=null&&h.oauth?n((m=this.resourcesConfig.Auth)==null?void 0:m.Cognito):this.oAuthListener=n}notifyOAuthListener(){var n,l,h;!((l=(n=this.resourcesConfig.Auth)==null?void 0:n.Cognito.loginWith)!=null&&l.oauth)||!this.oAuthListener||(this.oAuthListener((h=this.resourcesConfig.Auth)==null?void 0:h.Cognito),this.oAuthListener=void 0)}}const Ws=new GR,E_=e=>{const{headers:n,statusCode:l}=e;return{...qR(e)?e.$metadata:{},httpStatusCode:l,requestId:n["x-amzn-requestid"]??n["x-amzn-request-id"]??n["x-amz-request-id"],extendedRequestId:n["x-amz-id-2"],cfId:n["x-amz-cf-id"]}},qR=e=>typeof(e==null?void 0:e.$metadata)=="object",nf=async e=>{if(!e||e.statusCode<300)return;const n=await T_(e),h=(E=>{const[s]=E.toString().split(/[,:]+/);return s.includes("#")?s.split("#")[1]:s})(e.headers["x-amzn-errortype"]??n.code??n.__type??"UnknownError"),m=n.message??n.Message??"Unknown error",v=new Error(m);return Object.assign(v,{name:h,$metadata:E_(e)})},T_=async e=>{if(!e.body)throw new Error("Missing response payload");const n=await e.body.json();return Object.assign(n,{$metadata:E_(e)})},px=(e,n,l,h)=>async(m,v)=>{const E={...h,...m},s=await E.endpointResolver(E,v),k=await n(v,s),D=await e(k,{...E});return l(D)},dC={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},WR={partitions:[dC,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},pC=e=>{const{partitions:n}=WR;for(const{regions:l,outputs:h,regionRegex:m}of n){const v=new RegExp(m);if(l.includes(e)||v.test(e))return h.dnsSuffix}return dC.outputs.dnsSuffix},ZR=3,HR=({maxAttempts:e=ZR,retryDecider:n,computeDelay:l,abortSignal:h})=>{if(e<1)throw new Error("maxAttempts must be greater than 0");return(m,v)=>async function(s){let k,D=v.attemptsCount??0,V;const G=()=>{if(V)return GE(V,D),V;throw GE(k,D),k};for(;!(h!=null&&h.aborted)&&DD?v.attemptsCount??0:D+1,v.attemptsCount=D,await n(V,k)){if(!(h!=null&&h.aborted)&&D{if(n!=null&&n.aborted)return Promise.resolve();let l,h;const m=new Promise(v=>{h=v,l=setTimeout(v,e)});return n==null||n.addEventListener("abort",function v(E){clearTimeout(l),n==null||n.removeEventListener("abort",v),h()}),m},GE=(e,n)=>{Object.prototype.toString.call(e)==="[object Object]"&&(e.$metadata={...e.$metadata??{},attempts:n})},KR=({userAgentHeader:e="x-amz-user-agent",userAgentValue:n=""})=>l=>async function(m){if(n.trim().length===0)return await l(m);{const v=e.toLowerCase();return m.headers[v]=m.headers[v]?`${m.headers[v]} ${n}`:n,await l(m)}},fx=(e,n)=>(l,h)=>{const m={};let v=E=>e(E,h);for(let E=n.length-1;E>=0;E--){const s=n[E];v=s(h)(v,m)}return v(l)},K0=e=>{let n;return()=>(n||(n=e()),n)},YR=e=>!["HEAD","GET","DELETE"].includes(e.toUpperCase()),JR=async({url:e,method:n,headers:l,body:h},{abortSignal:m,cache:v,withCrossDomainCredentials:E})=>{var G;let s;try{s=await fetch(e,{method:n,headers:l,body:YR(n)?h:void 0,signal:m,cache:v,credentials:E?"include":"same-origin"})}catch(J){throw J instanceof TypeError?new bs({name:Vp.NetworkError,message:"A network error has occurred.",underlyingError:J}):J}const k={};(G=s.headers)==null||G.forEach((J,ve)=>{k[ve.toLowerCase()]=J});const D={statusCode:s.status,headers:k,body:null},V=Object.assign(s.body??{},{text:K0(()=>s.text()),blob:K0(()=>s.blob()),json:K0(()=>s.json())});return{...D,body:V}},fC=fx(JR,[KR,HR]),QR=5*60*1e3;function e3(e=QR){return h=>{const m=2**h*100+100*Math.random();return m>e?!1:m}}const qE=5*60*1e3,mC=e=>{const l=e3(qE)(e);return l===!1?qE:l},t3=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],n3=e=>!!e&&t3.includes(e),gC=e=>async(n,l)=>{const h=l??await e(n)??void 0,m=(h==null?void 0:h.code)||(h==null?void 0:h.name),v=n==null?void 0:n.statusCode;return s3(l)||o3(v,m)||n3(m)||a3(v,m)},r3=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],i3=["TimeoutError","RequestTimeout","RequestTimeoutException"],o3=(e,n)=>e===429||!!n&&r3.includes(n),s3=e=>(e==null?void 0:e.name)==="Network error",a3=(e,n)=>!!e&&[500,502,503,504].includes(e)||!!n&&i3.includes(n),n1=URL,l3="6.6.0";let Ep;const _g=[];let Kg=!1;const c3=10,u3=10,h3=1e3,_C=()=>{var e;if(!Ep){if(Ep=VR(),Kg)for(;_g.length;)(e=_g.pop())==null||e();else _g.forEach(n=>{n()});WE(_r.ServerSideUnknown,c3),WE(_r.WebUnknown,u3)}return Ep},d3=e=>{Kg||_g.push(e)};function p3(){Ep=void 0}function WE(e,n){Ep===e&&!Kg&&setTimeout(()=>{p3(),Kg=!0,setTimeout(_C,h3)},n)}const f3={},m3=(e,n)=>{var l,h;return(h=(l=f3[e])==null?void 0:l[n])==null?void 0:h.additionalDetails},g3="aws-amplify",_3=({category:e,action:n}={})=>{const l=[[g3,l3]];if(e&&l.push([e,n]),l.push(["framework",_C()]),e&&n){const h=m3(e,n);h&&h.forEach(m=>{l.push(m)})}return l},mx=e=>_3(e).map(([h,m])=>h&&m?`${h}/${m}`:h).join(" "),y3="cognito-identity",v3=({region:e})=>({url:new n1(`https://cognito-identity.${e}.${pC(e)}`)}),x3=()=>e=>async function(l){return l.headers["cache-control"]="no-store",e(l)},yC=fx(fC,[x3]),gx={service:y3,endpointResolver:v3,retryDecider:gC(nf),computeDelay:mC,userAgentValue:mx(),cache:"no-store"};d3(()=>{gx.userAgentValue=mx()});const vC=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),xC=({url:e},n,l)=>({headers:n,url:e,body:l,method:"POST"}),w3=(e,n)=>{const l=vC("GetId"),h=JSON.stringify(e);return xC(n,l,h)},b3=async e=>{if(e.statusCode>=300)throw await nf(e);return{IdentityId:(await T_(e)).IdentityId,$metadata:E_(e)}},E3=px(yC,w3,b3,gx),T3=(e,n)=>{const l=vC("GetCredentialsForIdentity"),h=JSON.stringify(e);return xC(n,l,h)},S3=async e=>{if(e.statusCode>=300)throw await nf(e);{const n=await T_(e);return{IdentityId:n.IdentityId,Credentials:A3(n.Credentials),$metadata:E_(e)}}},A3=({AccessKeyId:e,SecretKey:n,SessionToken:l,Expiration:h}={})=>({AccessKeyId:e,SecretKey:n,SessionToken:l,Expiration:h&&new Date(h*1e3)}),ZE=px(yC,T3,S3,gx);class Km extends bs{constructor(){super({name:Vp.PlatformNotSupported,message:"Function not supported on current platform"})}}class wC{constructor(n){this.storage=n}async setItem(n,l){if(!this.storage)throw new Km;this.storage.setItem(n,l)}async getItem(n){if(!this.storage)throw new Km;return this.storage.getItem(n)}async removeItem(n){if(!this.storage)throw new Km;this.storage.removeItem(n)}async clear(){if(!this.storage)throw new Km;this.storage.clear()}}class bC{constructor(){this.storage=new Map}get length(){return this.storage.size}key(n){return n>this.length-1?null:Array.from(this.storage.keys())[n]}setItem(n,l){this.storage.set(n,l)}getItem(n){return this.storage.get(n)??null}removeItem(n){this.storage.delete(n)}clear(){this.storage.clear()}}const C3=()=>typeof window<"u"&&window.localStorage?window.localStorage:new bC,I3=()=>typeof window<"u"&&window.sessionStorage?window.sessionStorage:new bC;class k3 extends wC{constructor(){super(C3())}}class M3 extends wC{constructor(){super(I3())}}/*! js-cookie v3.0.5 | MIT */function Ym(e){for(var n=1;n"u")){E=Ym({},n,E),typeof E.expires=="number"&&(E.expires=new Date(Date.now()+E.expires*864e5)),E.expires&&(E.expires=E.expires.toUTCString()),m=encodeURIComponent(m).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var k in E)E[k]&&(s+="; "+k,E[k]!==!0&&(s+="="+E[k].split(";")[0]));return document.cookie=m+"="+e.write(v,m)+s}}function h(m){if(!(typeof document>"u"||arguments.length&&!m)){for(var v=document.cookie?document.cookie.split("; "):[],E={},s=0;sthis.removeItem(h));await Promise.all(l)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const qp=new k3;new M3;const z3=e=>{let n;return async(...l)=>n||(n=new Promise((h,m)=>{e(...l).then(v=>{h(v)}).catch(v=>{m(v)}).finally(()=>{n=void 0})}),n)};class er extends bs{constructor(n){super(n),this.constructor=er,Object.setPrototypeOf(this,er.prototype)}}function EC(e){if(!e||e.name==="Error"||e instanceof TypeError)throw new er({name:Vp.Unknown,message:"An unknown error has occurred.",underlyingError:e})}const TC="cognito-idp",L3=({region:e})=>{var m;const n=(m=Ws.getConfig().Auth)==null?void 0:m.Cognito,l=n==null?void 0:n.userPoolEndpoint,h=new n1(`https://${TC}.${e}.${pC(e)}`);return{url:l?new n1(l):h}},R3=()=>(e,n)=>async function(h){return h.headers["cache-control"]="no-store",e(h)},D3=fx(fC,[R3]),O3={service:TC,endpointResolver:L3,retryDecider:gC(nf),computeDelay:mC,userAgentValue:mx(),cache:"no-store"},B3=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${e}`}),F3=({url:e},n,l)=>({headers:n,url:e,body:l,method:"POST"}),N3=e=>(n,l)=>{const h=B3(e),m=JSON.stringify(n);return F3(l,h,m)},U3=()=>async e=>{if(e.statusCode>=300){const n=await nf(e);throw EC(n),new er({name:n.name,message:n.message})}else return await T_(e)},j3=px(D3,N3("InitiateAuth"),U3(),O3);function V3(e){const n=e==null?void 0:e.split("_")[0];if(!e||e.indexOf("_")<0||!n||typeof n!="string")throw new er({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return n}function i1(e){if(!e||!e.includes(":"))throw new er({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}const SC="UserUnAuthenticatedException",$3="InvalidRedirectException",G3="InvalidAppSchemeException",q3="InvalidPreferredRedirectUrlException";new er({name:$3,message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new er({name:G3,message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});new er({name:q3,message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."});const W3="InvalidOriginException";new er({name:W3,message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."});const Z3="TokenRefreshException";function H3(e){if(!e||!e.idToken)throw new er({name:SC,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}const X3=new er({name:Z3,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. - Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. - E.g { responseType: 'code' }`}),K3=new er({name:SC,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function Y3(e){if(eD(e))throw X3;if(!Q3(e))throw K3}const J3={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function AC(e){return(e==null?void 0:e.accessToken)||(e==null?void 0:e.idToken)}function Q3(e){return AC(e)&&(e==null?void 0:e.refreshToken)}function eD(e){return AC(e)&&!(e!=null&&e.refreshToken)}function tD({username:e,userPoolId:n,userPoolClientId:l}){if(typeof window>"u")return;const h=window.AmazonCognitoAdvancedSecurityData;if(typeof h>"u")return;const m=h.getData(e,n,l);return m?{EncodedData:m}:{}}const nD=async({tokens:e,authConfig:n,username:l})=>{var J,ve;Ti(n==null?void 0:n.Cognito);const h=V3(n.Cognito.userPoolId);Y3(e);const m=e.refreshToken,v={REFRESH_TOKEN:m};(J=e.deviceMetadata)!=null&&J.deviceKey&&(v.DEVICE_KEY=e.deviceMetadata.deviceKey);const E=tD({username:l,userPoolId:n.Cognito.userPoolId,userPoolClientId:n.Cognito.userPoolClientId}),{AuthenticationResult:s}=await j3({region:h},{ClientId:(ve=n==null?void 0:n.Cognito)==null?void 0:ve.userPoolClientId,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:v,UserContextData:E}),k=$p((s==null?void 0:s.AccessToken)??""),D=s!=null&&s.IdToken?$p(s.IdToken):void 0,{iat:V}=k.payload;if(!V)throw new er({name:"iatNotFoundException",message:"iat not found in access token"});const G=V*1e3-new Date().getTime();return{accessToken:k,idToken:D,clockDrift:G,refreshToken:m,username:l}},rD=z3(nD),iD={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var Yg;(function(e){e.InvalidAuthTokens="InvalidAuthTokens"})(Yg||(Yg={}));const oD={[Yg.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},sD=aC(oD);class aD{constructor(){this.name="CognitoIdentityServiceProvider"}getKeyValueStorage(){if(!this.keyValueStorage)throw new er({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(n){this.keyValueStorage=n}setAuthConfig(n){this.authConfig=n}async loadTokens(){try{const n=await this.getAuthKeys(),l=await this.getKeyValueStorage().getItem(n.accessToken);if(!l)throw new er({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const h=$p(l),m=await this.getKeyValueStorage().getItem(n.idToken),v=m?$p(m):void 0,E=await this.getKeyValueStorage().getItem(n.refreshToken)??void 0,s=await this.getKeyValueStorage().getItem(n.clockDrift)??"0",k=Number.parseInt(s),D=await this.getKeyValueStorage().getItem(n.signInDetails),V={accessToken:h,idToken:v,refreshToken:E,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:k,username:await this.getLastAuthUser()};return D&&(V.signInDetails=JSON.parse(D)),V}catch{return null}}async storeTokens(n){sD(n!==void 0,Yg.InvalidAuthTokens),await this.clearTokens();const l=n.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),l);const h=await this.getAuthKeys();await this.getKeyValueStorage().setItem(h.accessToken,n.accessToken.toString()),n.idToken&&await this.getKeyValueStorage().setItem(h.idToken,n.idToken.toString()),n.refreshToken&&await this.getKeyValueStorage().setItem(h.refreshToken,n.refreshToken),n.deviceMetadata&&(n.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(h.deviceKey,n.deviceMetadata.deviceKey),n.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(h.deviceGroupKey,n.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(h.randomPasswordKey,n.deviceMetadata.randomPassword)),n.signInDetails&&await this.getKeyValueStorage().setItem(h.signInDetails,JSON.stringify(n.signInDetails)),await this.getKeyValueStorage().setItem(h.clockDrift,`${n.clockDrift}`)}async clearTokens(){const n=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(n.accessToken),this.getKeyValueStorage().removeItem(n.idToken),this.getKeyValueStorage().removeItem(n.clockDrift),this.getKeyValueStorage().removeItem(n.refreshToken),this.getKeyValueStorage().removeItem(n.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(n.oauthMetadata)])}async getDeviceMetadata(n){const l=await this.getAuthKeys(n),h=await this.getKeyValueStorage().getItem(l.deviceKey),m=await this.getKeyValueStorage().getItem(l.deviceGroupKey),v=await this.getKeyValueStorage().getItem(l.randomPasswordKey);return v&&m&&h?{deviceKey:h,deviceGroupKey:m,randomPassword:v}:null}async clearDeviceMetadata(n){const l=await this.getAuthKeys(n);await Promise.all([this.getKeyValueStorage().removeItem(l.deviceKey),this.getKeyValueStorage().removeItem(l.deviceGroupKey),this.getKeyValueStorage().removeItem(l.randomPasswordKey)])}async getAuthKeys(n){var h;Ti((h=this.authConfig)==null?void 0:h.Cognito);const l=n??await this.getLastAuthUser();return lD(this.name,`${this.authConfig.Cognito.userPoolClientId}.${l}`)}getLastAuthUserKey(){var l;Ti((l=this.authConfig)==null?void 0:l.Cognito);const n=this.authConfig.Cognito.userPoolClientId;return`${this.name}.${n}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(n){const{oauthMetadata:l}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(l,JSON.stringify(n))}async getOAuthMetadata(){const{oauthMetadata:n}=await this.getAuthKeys(),l=await this.getKeyValueStorage().getItem(n);return l&&JSON.parse(l)}}const lD=(e,n)=>_x(iD)(`${e}`,n);function _x(e){const n=Object.values({...e});return(l,h)=>n.reduce((m,v)=>({...m,[v]:`${l}.${h}.${v}`}),{})}const XE="amplify-signin-with-hostedUI",fs="CognitoIdentityServiceProvider";class cD{constructor(n){this.keyValueStorage=n}async clearOAuthInflightData(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(n.inflightOAuth),this.keyValueStorage.removeItem(n.oauthPKCE),this.keyValueStorage.removeItem(n.oauthState)])}async clearOAuthData(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(XE),this.keyValueStorage.removeItem(n.oauthSignIn)}loadOAuthState(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthState)}storeOAuthState(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(l.oauthState,n)}loadPKCE(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(n.oauthPKCE)}storePKCE(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(l.oauthPKCE,n)}setAuthConfig(n){this.cognitoConfig=n}async loadOAuthInFlight(){Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(n.inflightOAuth)==="true"}async storeOAuthInFlight(n){Ti(this.cognitoConfig);const l=ms(fs,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(l.inflightOAuth,`${n}`)}async loadOAuthSignIn(){var v;Ti(this.cognitoConfig);const n=ms(fs,this.cognitoConfig.userPoolClientId),l=await this.keyValueStorage.getItem(XE),[h,m]=((v=await this.keyValueStorage.getItem(n.oauthSignIn))==null?void 0:v.split(","))??[];return{isOAuthSignIn:h==="true"||l==="true",preferPrivateSession:m==="true"}}async storeOAuthSignIn(n,l=!1){Ti(this.cognitoConfig);const h=ms(fs,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(h.oauthSignIn,`${n},${l}`)}}const ms=(e,n)=>_x(J3)(e,n),KE=new cD(qp),uD=[],hD=e=>{uD.push(e)};class dD{constructor(){this.waitForInflightOAuth=$R()?async()=>{if(await KE.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((n,l)=>{hD(n)}),this.inflightPromise)}:async()=>{}}setAuthConfig(n){KE.setAuthConfig(n.Cognito),this.authConfig=n}setTokenRefresher(n){this.tokenRefresher=n}setAuthTokenStore(n){this.tokenStore=n}getTokenStore(){if(!this.tokenStore)throw new er({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new er({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}async getTokens(n){var E,s,k,D,V;let l;try{Ti((E=this.authConfig)==null?void 0:E.Cognito)}catch{return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,l=await this.getTokenStore().loadTokens();const h=await this.getTokenStore().getLastAuthUser();if(l===null)return null;const m=!!(l!=null&&l.idToken)&&PE({expiresAt:(((k=(s=l.idToken)==null?void 0:s.payload)==null?void 0:k.exp)??0)*1e3,clockDrift:l.clockDrift??0}),v=PE({expiresAt:(((V=(D=l.accessToken)==null?void 0:D.payload)==null?void 0:V.exp)??0)*1e3,clockDrift:l.clockDrift??0});return(n!=null&&n.forceRefresh||m||v)&&(l=await this.refreshTokens({tokens:l,username:h}),l===null)?null:{accessToken:l==null?void 0:l.accessToken,idToken:l==null?void 0:l.idToken,signInDetails:l==null?void 0:l.signInDetails}}async refreshTokens({tokens:n,username:l}){try{const{signInDetails:h}=n,m=await this.getTokenRefresher()({tokens:n,authConfig:this.authConfig,username:l});return m.signInDetails=h,await this.setTokens({tokens:m}),t1.dispatch("auth",{event:"tokenRefresh"},"Auth",Xg),m}catch(h){return this.handleErrors(h)}}handleErrors(n){if(EC(n),n.message!=="Network error"&&this.clearTokens(),t1.dispatch("auth",{event:"tokenRefresh_failure",data:{error:n}},"Auth",Xg),n.name.startsWith("NotAuthorizedException"))return null;throw n}async setTokens({tokens:n}){return this.getTokenStore().storeTokens(n)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(n){return this.getTokenStore().getDeviceMetadata(n)}clearDeviceMetadata(n){return this.getTokenStore().clearDeviceMetadata(n)}setOAuthMetadata(n){return this.getTokenStore().setOAuthMetadata(n)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class pD{constructor(){this.authTokenStore=new aD,this.authTokenStore.setKeyValueStorage(qp),this.tokenOrchestrator=new dD,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(rD)}getTokens({forceRefresh:n}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:n})}setKeyValueStorage(n){this.authTokenStore.setKeyValueStorage(n)}setAuthConfig(n){this.authTokenStore.setAuthConfig(n),this.tokenOrchestrator.setAuthConfig(n)}}const Qm=new pD,fD={identityId:"identityId"},mD=new Zo("DefaultIdentityIdStore");class gD{setAuthConfig(n){gg(n.Cognito),this.authConfig=n,this._authKeys=_D("Cognito",n.Cognito.identityPoolId)}constructor(n){this._authKeys={},this.keyValueStorage=n}async loadIdentityId(){var n;gg((n=this.authConfig)==null?void 0:n.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const l=await this.keyValueStorage.getItem(this._authKeys.identityId);return l?{id:l,type:"guest"}:null}}catch(l){return mD.log("Error getting stored IdentityId.",l),null}}async storeIdentityId(n){var l;gg((l=this.authConfig)==null?void 0:l.Cognito),n.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,n.id),this._primaryIdentityId=void 0):(this._primaryIdentityId=n.id,this.keyValueStorage.removeItem(this._authKeys.identityId))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const _D=(e,n)=>_x(fD)(`com.amplify.${e}`,n);function CC(e){const n=$p(e).payload.iss,l={};if(!n)throw new er({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const h=n.replace(/(^\w+:|^)\/\//,"");return l[h]=e,l}const yD=new Zo("CognitoIdentityIdProvider");async function vD({tokens:e,authConfig:n,identityIdStore:l}){l.setAuthConfig({Cognito:n});let h=await l.loadIdentityId();if(e){if(h&&h.type==="primary")return h.id;{const m=e.idToken?CC(e.idToken.toString()):{},v=await YE(m,n);h&&h.id===v&&yD.debug(`The guest identity ${h.id} has become the primary identity.`),h={id:v,type:"primary"}}}else{if(h&&h.type==="guest")return h.id;h={id:await YE({},n),type:"guest"}}return l.storeIdentityId(h),h.id}async function YE(e,n){const l=n==null?void 0:n.identityPoolId,h=i1(l),m=(await E3({region:h},{IdentityPoolId:l,Logins:e})).IdentityId;if(!m)throw new er({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return m}const eg=new Zo("CognitoCredentialsProvider"),JE=50*60*1e3;class xD{constructor(n){this._nextCredentialsRefresh=0,this._identityIdStore=n}async clearCredentialsAndIdentityId(){eg.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){eg.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(n){const l=n.authenticated,{tokens:h}=n,{authConfig:m}=n;try{gg(m==null?void 0:m.Cognito)}catch{return}if(!l&&!m.Cognito.allowGuestAccess)return;const{forceRefresh:v}=n,E=this.hasTokenChanged(h),s=await vD({tokens:h,authConfig:m.Cognito,identityIdStore:this._identityIdStore});return(v||E)&&this.clearCredentials(),l?(H3(h),this.credsForOIDCTokens(m.Cognito,h,s)):this.getGuestCredentials(s,m.Cognito)}async getGuestCredentials(n,l){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return eg.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const h=i1(l.identityPoolId),m=await ZE({region:h},{IdentityId:n});if(m.Credentials&&m.Credentials.AccessKeyId&&m.Credentials.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+JE;const v={credentials:{accessKeyId:m.Credentials.AccessKeyId,secretAccessKey:m.Credentials.SecretKey,sessionToken:m.Credentials.SessionToken,expiration:m.Credentials.Expiration},identityId:n},E=m.IdentityId;return E&&(v.identityId=E,this._identityIdStore.storeIdentityId({id:E,type:"guest"})),this._credentialsAndIdentityId={...v,isAuthenticatedCreds:!1},v}else throw new er({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(n,l,h){var s;if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return eg.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const m=l.idToken?CC(l.idToken.toString()):{},v=i1(n.identityPoolId),E=await ZE({region:v},{IdentityId:h,Logins:m});if(E.Credentials&&E.Credentials.AccessKeyId&&E.Credentials.SecretKey){const k={credentials:{accessKeyId:E.Credentials.AccessKeyId,secretAccessKey:E.Credentials.SecretKey,sessionToken:E.Credentials.SessionToken,expiration:E.Credentials.Expiration},identityId:h};this._credentialsAndIdentityId={...k,isAuthenticatedCreds:!0,associatedIdToken:(s=l.idToken)==null?void 0:s.toString()},this._nextCredentialsRefresh=new Date().getTime()+JE;const D=E.IdentityId;return D&&(k.identityId=D,this._identityIdStore.storeIdentityId({id:D,type:"primary"})),k}else throw new er({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(n){var l,h;return!!n&&!!((l=this._credentialsAndIdentityId)!=null&&l.associatedIdToken)&&((h=n.idToken)==null?void 0:h.toString())!==this._credentialsAndIdentityId.associatedIdToken}}const wD=new xD(new gD(qp)),bD={configure(e,n){const l=uC(e);if(!l.Auth){Ws.configure(l,n);return}if(n!=null&&n.Auth){Ws.configure(l,n);return}if(!Ws.libraryOptions.Auth){Qm.setAuthConfig(l.Auth),Qm.setKeyValueStorage(n!=null&&n.ssr?new HE({sameSite:"lax"}):qp),Ws.configure(l,{...n,Auth:{tokenProvider:Qm,credentialsProvider:wD}});return}if(n){n.ssr!==void 0&&Qm.setKeyValueStorage(n.ssr?new HE({sameSite:"lax"}):qp),Ws.configure(l,{Auth:Ws.libraryOptions.Auth,...n});return}Ws.configure(l)},getConfig(){return Ws.getConfig()}};/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */var ED={oauth:{domain:"authcori.auth.us-east-1.amazoncognito.com"}},TD="us-east-1",SD="us-east-1_QeA4600FA",AD="5eusi16g0o2q1g1rr5ehgudodm",CD="authcori.auth.us-east-1.amazoncognito.com",ID="us-east-1",kD="us-east-1:2194a76a-fa3d-4c33-999e-e3c4b2b049ee",MD=["EMAIL"],PD=["EMAIL","OPENID"],zD=["EMAIL","OPENID"],LD={passwordPolicyMinLength:8,passwordPolicyCharacters:["REQUIRES_NUMBERS","REQUIRES_LOWERCASE","REQUIRES_UPPERCASE","REQUIRES_SYMBOLS"]},RD="https://bdkxhfgus5dztobic7gvn5ymue.appsync-api.us-east-1.amazonaws.com/graphql",DD="us-east-1",OD="da2-yexc3mow25fc3amaendi4vscuq",BD="API_KEY",FD="AMAZON_COGNITO_USER_POOLS,AWS_IAM",ND={version:1,models:{Todo:{name:"Todo",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},content:{name:"content",isArray:!1,type:"String",isRequired:!1,attributes:[]},owner:{name:"owner",isArray:!1,type:"String",isRequired:!1,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!0,attributes:[]},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!0,attributes:[]}},syncable:!0,pluralName:"Todos",attributes:[{type:"model",properties:{}},{type:"key",properties:{fields:["id"]}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]},{allow:"public",operations:["read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}}},enums:{},nonModels:{}},UD={Auth:ED,aws_project_region:TD,aws_user_pools_id:SD,aws_user_pools_web_client_id:AD,aws_cognito_domain:CD,aws_cognito_region:ID,aws_cognito_identity_pool_id:kD,aws_cognito_signup_attributes:MD,aws_cognito_username_attributes:PD,aws_cognito_verification_mechanisms:zD,aws_cognito_password_protection_settings:LD,aws_appsync_graphqlEndpoint:RD,aws_appsync_region:DD,aws_appsync_apiKey:OD,aws_appsync_authenticationType:BD,aws_appsync_additionalAuthenticationTypes:FD,modelIntrospection:ND};/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */bD.configure(UD);const jD={domain:void 0,region:void 0,identityPoolId:void 0,userPoolId:void 0,userPoolClientId:void 0};ut.createContext(jD);function IC(e,n){return function(){return e.apply(n,arguments)}}const{toString:VD}=Object.prototype,{getPrototypeOf:yx}=Object,S_=(e=>n=>{const l=VD.call(n);return e[l]||(e[l]=l.slice(8,-1).toLowerCase())})(Object.create(null)),Ko=e=>(e=e.toLowerCase(),n=>S_(n)===e),A_=e=>n=>typeof n===e,{isArray:mh}=Array,Wp=A_("undefined");function $D(e){return e!==null&&!Wp(e)&&e.constructor!==null&&!Wp(e.constructor)&&qi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const kC=Ko("ArrayBuffer");function GD(e){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&kC(e.buffer),n}const qD=A_("string"),qi=A_("function"),MC=A_("number"),C_=e=>e!==null&&typeof e=="object",WD=e=>e===!0||e===!1,yg=e=>{if(S_(e)!=="object")return!1;const n=yx(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ZD=Ko("Date"),HD=Ko("File"),XD=Ko("Blob"),KD=Ko("FileList"),YD=e=>C_(e)&&qi(e.pipe),JD=e=>{let n;return e&&(typeof FormData=="function"&&e instanceof FormData||qi(e.append)&&((n=S_(e))==="formdata"||n==="object"&&qi(e.toString)&&e.toString()==="[object FormData]"))},QD=Ko("URLSearchParams"),[e5,t5,n5,r5]=["ReadableStream","Request","Response","Headers"].map(Ko),i5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rf(e,n,{allOwnKeys:l=!1}={}){if(e===null||typeof e>"u")return;let h,m;if(typeof e!="object"&&(e=[e]),mh(e))for(h=0,m=e.length;h0;)if(m=l[h],n===m.toLowerCase())return m;return null}const dc=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),zC=e=>!Wp(e)&&e!==dc;function o1(){const{caseless:e}=zC(this)&&this||{},n={},l=(h,m)=>{const v=e&&PC(n,m)||m;yg(n[v])&&yg(h)?n[v]=o1(n[v],h):yg(h)?n[v]=o1({},h):mh(h)?n[v]=h.slice():n[v]=h};for(let h=0,m=arguments.length;h(rf(n,(m,v)=>{l&&qi(m)?e[v]=IC(m,l):e[v]=m},{allOwnKeys:h}),e),s5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),a5=(e,n,l,h)=>{e.prototype=Object.create(n.prototype,h),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:n.prototype}),l&&Object.assign(e.prototype,l)},l5=(e,n,l,h)=>{let m,v,E;const s={};if(n=n||{},e==null)return n;do{for(m=Object.getOwnPropertyNames(e),v=m.length;v-- >0;)E=m[v],(!h||h(E,e,n))&&!s[E]&&(n[E]=e[E],s[E]=!0);e=l!==!1&&yx(e)}while(e&&(!l||l(e,n))&&e!==Object.prototype);return n},c5=(e,n,l)=>{e=String(e),(l===void 0||l>e.length)&&(l=e.length),l-=n.length;const h=e.indexOf(n,l);return h!==-1&&h===l},u5=e=>{if(!e)return null;if(mh(e))return e;let n=e.length;if(!MC(n))return null;const l=new Array(n);for(;n-- >0;)l[n]=e[n];return l},h5=(e=>n=>e&&n instanceof e)(typeof Uint8Array<"u"&&yx(Uint8Array)),d5=(e,n)=>{const h=(e&&e[Symbol.iterator]).call(e);let m;for(;(m=h.next())&&!m.done;){const v=m.value;n.call(e,v[0],v[1])}},p5=(e,n)=>{let l;const h=[];for(;(l=e.exec(n))!==null;)h.push(l);return h},f5=Ko("HTMLFormElement"),m5=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(l,h,m){return h.toUpperCase()+m}),QE=(({hasOwnProperty:e})=>(n,l)=>e.call(n,l))(Object.prototype),g5=Ko("RegExp"),LC=(e,n)=>{const l=Object.getOwnPropertyDescriptors(e),h={};rf(l,(m,v)=>{let E;(E=n(m,v,e))!==!1&&(h[v]=E||m)}),Object.defineProperties(e,h)},_5=e=>{LC(e,(n,l)=>{if(qi(e)&&["arguments","caller","callee"].indexOf(l)!==-1)return!1;const h=e[l];if(qi(h)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+l+"'")})}})},y5=(e,n)=>{const l={},h=m=>{m.forEach(v=>{l[v]=!0})};return mh(e)?h(e):h(String(e).split(n)),l},v5=()=>{},x5=(e,n)=>e!=null&&Number.isFinite(e=+e)?e:n,Y0="abcdefghijklmnopqrstuvwxyz",eT="0123456789",RC={DIGIT:eT,ALPHA:Y0,ALPHA_DIGIT:Y0+Y0.toUpperCase()+eT},w5=(e=16,n=RC.ALPHA_DIGIT)=>{let l="";const{length:h}=n;for(;e--;)l+=n[Math.random()*h|0];return l};function b5(e){return!!(e&&qi(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const E5=e=>{const n=new Array(10),l=(h,m)=>{if(C_(h)){if(n.indexOf(h)>=0)return;if(!("toJSON"in h)){n[m]=h;const v=mh(h)?[]:{};return rf(h,(E,s)=>{const k=l(E,m+1);!Wp(k)&&(v[s]=k)}),n[m]=void 0,v}}return h};return l(e,0)},T5=Ko("AsyncFunction"),S5=e=>e&&(C_(e)||qi(e))&&qi(e.then)&&qi(e.catch),DC=((e,n)=>e?setImmediate:n?((l,h)=>(dc.addEventListener("message",({source:m,data:v})=>{m===dc&&v===l&&h.length&&h.shift()()},!1),m=>{h.push(m),dc.postMessage(l,"*")}))(`axios@${Math.random()}`,[]):l=>setTimeout(l))(typeof setImmediate=="function",qi(dc.postMessage)),A5=typeof queueMicrotask<"u"?queueMicrotask.bind(dc):typeof process<"u"&&process.nextTick||DC,Ne={isArray:mh,isArrayBuffer:kC,isBuffer:$D,isFormData:JD,isArrayBufferView:GD,isString:qD,isNumber:MC,isBoolean:WD,isObject:C_,isPlainObject:yg,isReadableStream:e5,isRequest:t5,isResponse:n5,isHeaders:r5,isUndefined:Wp,isDate:ZD,isFile:HD,isBlob:XD,isRegExp:g5,isFunction:qi,isStream:YD,isURLSearchParams:QD,isTypedArray:h5,isFileList:KD,forEach:rf,merge:o1,extend:o5,trim:i5,stripBOM:s5,inherits:a5,toFlatObject:l5,kindOf:S_,kindOfTest:Ko,endsWith:c5,toArray:u5,forEachEntry:d5,matchAll:p5,isHTMLForm:f5,hasOwnProperty:QE,hasOwnProp:QE,reduceDescriptors:LC,freezeMethods:_5,toObjectSet:y5,toCamelCase:m5,noop:v5,toFiniteNumber:x5,findKey:PC,global:dc,isContextDefined:zC,ALPHABET:RC,generateString:w5,isSpecCompliantForm:b5,toJSONObject:E5,isAsyncFn:T5,isThenable:S5,setImmediate:DC,asap:A5};function qt(e,n,l,h,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",n&&(this.code=n),l&&(this.config=l),h&&(this.request=h),m&&(this.response=m,this.status=m.status?m.status:null)}Ne.inherits(qt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ne.toJSONObject(this.config),code:this.code,status:this.status}}});const OC=qt.prototype,BC={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{BC[e]={value:e}});Object.defineProperties(qt,BC);Object.defineProperty(OC,"isAxiosError",{value:!0});qt.from=(e,n,l,h,m,v)=>{const E=Object.create(OC);return Ne.toFlatObject(e,E,function(k){return k!==Error.prototype},s=>s!=="isAxiosError"),qt.call(E,e.message,n,l,h,m),E.cause=e,E.name=e.name,v&&Object.assign(E,v),E};const C5=null;function s1(e){return Ne.isPlainObject(e)||Ne.isArray(e)}function FC(e){return Ne.endsWith(e,"[]")?e.slice(0,-2):e}function tT(e,n,l){return e?e.concat(n).map(function(m,v){return m=FC(m),!l&&v?"["+m+"]":m}).join(l?".":""):n}function I5(e){return Ne.isArray(e)&&!e.some(s1)}const k5=Ne.toFlatObject(Ne,{},null,function(n){return/^is[A-Z]/.test(n)});function I_(e,n,l){if(!Ne.isObject(e))throw new TypeError("target must be an object");n=n||new FormData,l=Ne.toFlatObject(l,{metaTokens:!0,dots:!1,indexes:!1},!1,function(me,Ce){return!Ne.isUndefined(Ce[me])});const h=l.metaTokens,m=l.visitor||V,v=l.dots,E=l.indexes,k=(l.Blob||typeof Blob<"u"&&Blob)&&Ne.isSpecCompliantForm(n);if(!Ne.isFunction(m))throw new TypeError("visitor must be a function");function D(ae){if(ae===null)return"";if(Ne.isDate(ae))return ae.toISOString();if(!k&&Ne.isBlob(ae))throw new qt("Blob is not supported. Use a Buffer instead.");return Ne.isArrayBuffer(ae)||Ne.isTypedArray(ae)?k&&typeof Blob=="function"?new Blob([ae]):Buffer.from(ae):ae}function V(ae,me,Ce){let ie=ae;if(ae&&!Ce&&typeof ae=="object"){if(Ne.endsWith(me,"{}"))me=h?me:me.slice(0,-2),ae=JSON.stringify(ae);else if(Ne.isArray(ae)&&I5(ae)||(Ne.isFileList(ae)||Ne.endsWith(me,"[]"))&&(ie=Ne.toArray(ae)))return me=FC(me),ie.forEach(function(le,ze){!(Ne.isUndefined(le)||le===null)&&n.append(E===!0?tT([me],ze,v):E===null?me:me+"[]",D(le))}),!1}return s1(ae)?!0:(n.append(tT(Ce,me,v),D(ae)),!1)}const G=[],J=Object.assign(k5,{defaultVisitor:V,convertValue:D,isVisitable:s1});function ve(ae,me){if(!Ne.isUndefined(ae)){if(G.indexOf(ae)!==-1)throw Error("Circular reference detected in "+me.join("."));G.push(ae),Ne.forEach(ae,function(ie,te){(!(Ne.isUndefined(ie)||ie===null)&&m.call(n,ie,Ne.isString(te)?te.trim():te,me,J))===!0&&ve(ie,me?me.concat(te):[te])}),G.pop()}}if(!Ne.isObject(e))throw new TypeError("data must be an object");return ve(e),n}function nT(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(h){return n[h]})}function vx(e,n){this._pairs=[],e&&I_(e,this,n)}const NC=vx.prototype;NC.append=function(n,l){this._pairs.push([n,l])};NC.toString=function(n){const l=n?function(h){return n.call(this,h,nT)}:nT;return this._pairs.map(function(m){return l(m[0])+"="+l(m[1])},"").join("&")};function M5(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function UC(e,n,l){if(!n)return e;const h=l&&l.encode||M5,m=l&&l.serialize;let v;if(m?v=m(n,l):v=Ne.isURLSearchParams(n)?n.toString():new vx(n,l).toString(h),v){const E=e.indexOf("#");E!==-1&&(e=e.slice(0,E)),e+=(e.indexOf("?")===-1?"?":"&")+v}return e}class P5{constructor(){this.handlers=[]}use(n,l,h){return this.handlers.push({fulfilled:n,rejected:l,synchronous:h?h.synchronous:!1,runWhen:h?h.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){Ne.forEach(this.handlers,function(h){h!==null&&n(h)})}}const rT=P5,jC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},z5=typeof URLSearchParams<"u"?URLSearchParams:vx,L5=typeof FormData<"u"?FormData:null,R5=typeof Blob<"u"?Blob:null,D5={isBrowser:!0,classes:{URLSearchParams:z5,FormData:L5,Blob:R5},protocols:["http","https","file","blob","url","data"]},xx=typeof window<"u"&&typeof document<"u",a1=typeof navigator=="object"&&navigator||void 0,O5=xx&&(!a1||["ReactNative","NativeScript","NS"].indexOf(a1.product)<0),B5=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),F5=xx&&window.location.href||"http://localhost",N5=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xx,hasStandardBrowserEnv:O5,hasStandardBrowserWebWorkerEnv:B5,navigator:a1,origin:F5},Symbol.toStringTag,{value:"Module"})),Mi={...N5,...D5};function U5(e,n){return I_(e,new Mi.classes.URLSearchParams,Object.assign({visitor:function(l,h,m,v){return Mi.isNode&&Ne.isBuffer(l)?(this.append(h,l.toString("base64")),!1):v.defaultVisitor.apply(this,arguments)}},n))}function j5(e){return Ne.matchAll(/\w+|\[(\w*)]/g,e).map(n=>n[0]==="[]"?"":n[1]||n[0])}function V5(e){const n={},l=Object.keys(e);let h;const m=l.length;let v;for(h=0;h=l.length;return E=!E&&Ne.isArray(m)?m.length:E,k?(Ne.hasOwnProp(m,E)?m[E]=[m[E],h]:m[E]=h,!s):((!m[E]||!Ne.isObject(m[E]))&&(m[E]=[]),n(l,h,m[E],v)&&Ne.isArray(m[E])&&(m[E]=V5(m[E])),!s)}if(Ne.isFormData(e)&&Ne.isFunction(e.entries)){const l={};return Ne.forEachEntry(e,(h,m)=>{n(j5(h),m,l,0)}),l}return null}function $5(e,n,l){if(Ne.isString(e))try{return(n||JSON.parse)(e),Ne.trim(e)}catch(h){if(h.name!=="SyntaxError")throw h}return(l||JSON.stringify)(e)}const wx={transitional:jC,adapter:["xhr","http","fetch"],transformRequest:[function(n,l){const h=l.getContentType()||"",m=h.indexOf("application/json")>-1,v=Ne.isObject(n);if(v&&Ne.isHTMLForm(n)&&(n=new FormData(n)),Ne.isFormData(n))return m?JSON.stringify(VC(n)):n;if(Ne.isArrayBuffer(n)||Ne.isBuffer(n)||Ne.isStream(n)||Ne.isFile(n)||Ne.isBlob(n)||Ne.isReadableStream(n))return n;if(Ne.isArrayBufferView(n))return n.buffer;if(Ne.isURLSearchParams(n))return l.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let s;if(v){if(h.indexOf("application/x-www-form-urlencoded")>-1)return U5(n,this.formSerializer).toString();if((s=Ne.isFileList(n))||h.indexOf("multipart/form-data")>-1){const k=this.env&&this.env.FormData;return I_(s?{"files[]":n}:n,k&&new k,this.formSerializer)}}return v||m?(l.setContentType("application/json",!1),$5(n)):n}],transformResponse:[function(n){const l=this.transitional||wx.transitional,h=l&&l.forcedJSONParsing,m=this.responseType==="json";if(Ne.isResponse(n)||Ne.isReadableStream(n))return n;if(n&&Ne.isString(n)&&(h&&!this.responseType||m)){const E=!(l&&l.silentJSONParsing)&&m;try{return JSON.parse(n)}catch(s){if(E)throw s.name==="SyntaxError"?qt.from(s,qt.ERR_BAD_RESPONSE,this,null,this.response):s}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mi.classes.FormData,Blob:Mi.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ne.forEach(["delete","get","head","post","put","patch"],e=>{wx.headers[e]={}});const bx=wx,G5=Ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),q5=e=>{const n={};let l,h,m;return e&&e.split(` -`).forEach(function(E){m=E.indexOf(":"),l=E.substring(0,m).trim().toLowerCase(),h=E.substring(m+1).trim(),!(!l||n[l]&&G5[l])&&(l==="set-cookie"?n[l]?n[l].push(h):n[l]=[h]:n[l]=n[l]?n[l]+", "+h:h)}),n},iT=Symbol("internals");function ap(e){return e&&String(e).trim().toLowerCase()}function vg(e){return e===!1||e==null?e:Ne.isArray(e)?e.map(vg):String(e)}function W5(e){const n=Object.create(null),l=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let h;for(;h=l.exec(e);)n[h[1]]=h[2];return n}const Z5=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function J0(e,n,l,h,m){if(Ne.isFunction(h))return h.call(this,n,l);if(m&&(n=l),!!Ne.isString(n)){if(Ne.isString(h))return n.indexOf(h)!==-1;if(Ne.isRegExp(h))return h.test(n)}}function H5(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,l,h)=>l.toUpperCase()+h)}function X5(e,n){const l=Ne.toCamelCase(" "+n);["get","set","has"].forEach(h=>{Object.defineProperty(e,h+l,{value:function(m,v,E){return this[h].call(this,n,m,v,E)},configurable:!0})})}class k_{constructor(n){n&&this.set(n)}set(n,l,h){const m=this;function v(s,k,D){const V=ap(k);if(!V)throw new Error("header name must be a non-empty string");const G=Ne.findKey(m,V);(!G||m[G]===void 0||D===!0||D===void 0&&m[G]!==!1)&&(m[G||k]=vg(s))}const E=(s,k)=>Ne.forEach(s,(D,V)=>v(D,V,k));if(Ne.isPlainObject(n)||n instanceof this.constructor)E(n,l);else if(Ne.isString(n)&&(n=n.trim())&&!Z5(n))E(q5(n),l);else if(Ne.isHeaders(n))for(const[s,k]of n.entries())v(k,s,h);else n!=null&&v(l,n,h);return this}get(n,l){if(n=ap(n),n){const h=Ne.findKey(this,n);if(h){const m=this[h];if(!l)return m;if(l===!0)return W5(m);if(Ne.isFunction(l))return l.call(this,m,h);if(Ne.isRegExp(l))return l.exec(m);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,l){if(n=ap(n),n){const h=Ne.findKey(this,n);return!!(h&&this[h]!==void 0&&(!l||J0(this,this[h],h,l)))}return!1}delete(n,l){const h=this;let m=!1;function v(E){if(E=ap(E),E){const s=Ne.findKey(h,E);s&&(!l||J0(h,h[s],s,l))&&(delete h[s],m=!0)}}return Ne.isArray(n)?n.forEach(v):v(n),m}clear(n){const l=Object.keys(this);let h=l.length,m=!1;for(;h--;){const v=l[h];(!n||J0(this,this[v],v,n,!0))&&(delete this[v],m=!0)}return m}normalize(n){const l=this,h={};return Ne.forEach(this,(m,v)=>{const E=Ne.findKey(h,v);if(E){l[E]=vg(m),delete l[v];return}const s=n?H5(v):String(v).trim();s!==v&&delete l[v],l[s]=vg(m),h[s]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const l=Object.create(null);return Ne.forEach(this,(h,m)=>{h!=null&&h!==!1&&(l[m]=n&&Ne.isArray(h)?h.join(", "):h)}),l}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,l])=>n+": "+l).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...l){const h=new this(n);return l.forEach(m=>h.set(m)),h}static accessor(n){const h=(this[iT]=this[iT]={accessors:{}}).accessors,m=this.prototype;function v(E){const s=ap(E);h[s]||(X5(m,E),h[s]=!0)}return Ne.isArray(n)?n.forEach(v):v(n),this}}k_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ne.reduceDescriptors(k_.prototype,({value:e},n)=>{let l=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(h){this[l]=h}}});Ne.freezeMethods(k_);const Ho=k_;function Q0(e,n){const l=this||bx,h=n||l,m=Ho.from(h.headers);let v=h.data;return Ne.forEach(e,function(s){v=s.call(l,v,m.normalize(),n?n.status:void 0)}),m.normalize(),v}function $C(e){return!!(e&&e.__CANCEL__)}function gh(e,n,l){qt.call(this,e??"canceled",qt.ERR_CANCELED,n,l),this.name="CanceledError"}Ne.inherits(gh,qt,{__CANCEL__:!0});function GC(e,n,l){const h=l.config.validateStatus;!l.status||!h||h(l.status)?e(l):n(new qt("Request failed with status code "+l.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(l.status/100)-4],l.config,l.request,l))}function K5(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}function Y5(e,n){e=e||10;const l=new Array(e),h=new Array(e);let m=0,v=0,E;return n=n!==void 0?n:1e3,function(k){const D=Date.now(),V=h[v];E||(E=D),l[m]=k,h[m]=D;let G=v,J=0;for(;G!==m;)J+=l[G++],G=G%e;if(m=(m+1)%e,m===v&&(v=(v+1)%e),D-E{l=V,m=null,v&&(clearTimeout(v),v=null),e.apply(null,D)};return[(...D)=>{const V=Date.now(),G=V-l;G>=h?E(D,V):(m=D,v||(v=setTimeout(()=>{v=null,E(m)},h-G)))},()=>m&&E(m)]}const Jg=(e,n,l=3)=>{let h=0;const m=Y5(50,250);return J5(v=>{const E=v.loaded,s=v.lengthComputable?v.total:void 0,k=E-h,D=m(k),V=E<=s;h=E;const G={loaded:E,total:s,progress:s?E/s:void 0,bytes:k,rate:D||void 0,estimated:D&&s&&V?(s-E)/D:void 0,event:v,lengthComputable:s!=null,[n?"download":"upload"]:!0};e(G)},l)},oT=(e,n)=>{const l=e!=null;return[h=>n[0]({lengthComputable:l,total:e,loaded:h}),n[1]]},sT=e=>(...n)=>Ne.asap(()=>e(...n)),Q5=Mi.hasStandardBrowserEnv?function(){const n=Mi.navigator&&/(msie|trident)/i.test(Mi.navigator.userAgent),l=document.createElement("a");let h;function m(v){let E=v;return n&&(l.setAttribute("href",E),E=l.href),l.setAttribute("href",E),{href:l.href,protocol:l.protocol?l.protocol.replace(/:$/,""):"",host:l.host,search:l.search?l.search.replace(/^\?/,""):"",hash:l.hash?l.hash.replace(/^#/,""):"",hostname:l.hostname,port:l.port,pathname:l.pathname.charAt(0)==="/"?l.pathname:"/"+l.pathname}}return h=m(window.location.href),function(E){const s=Ne.isString(E)?m(E):E;return s.protocol===h.protocol&&s.host===h.host}}():function(){return function(){return!0}}(),eO=Mi.hasStandardBrowserEnv?{write(e,n,l,h,m,v){const E=[e+"="+encodeURIComponent(n)];Ne.isNumber(l)&&E.push("expires="+new Date(l).toGMTString()),Ne.isString(h)&&E.push("path="+h),Ne.isString(m)&&E.push("domain="+m),v===!0&&E.push("secure"),document.cookie=E.join("; ")},read(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tO(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function nO(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}function qC(e,n){return e&&!tO(n)?nO(e,n):n}const aT=e=>e instanceof Ho?{...e}:e;function xc(e,n){n=n||{};const l={};function h(D,V,G){return Ne.isPlainObject(D)&&Ne.isPlainObject(V)?Ne.merge.call({caseless:G},D,V):Ne.isPlainObject(V)?Ne.merge({},V):Ne.isArray(V)?V.slice():V}function m(D,V,G){if(Ne.isUndefined(V)){if(!Ne.isUndefined(D))return h(void 0,D,G)}else return h(D,V,G)}function v(D,V){if(!Ne.isUndefined(V))return h(void 0,V)}function E(D,V){if(Ne.isUndefined(V)){if(!Ne.isUndefined(D))return h(void 0,D)}else return h(void 0,V)}function s(D,V,G){if(G in n)return h(D,V);if(G in e)return h(void 0,D)}const k={url:v,method:v,data:v,baseURL:E,transformRequest:E,transformResponse:E,paramsSerializer:E,timeout:E,timeoutMessage:E,withCredentials:E,withXSRFToken:E,adapter:E,responseType:E,xsrfCookieName:E,xsrfHeaderName:E,onUploadProgress:E,onDownloadProgress:E,decompress:E,maxContentLength:E,maxBodyLength:E,beforeRedirect:E,transport:E,httpAgent:E,httpsAgent:E,cancelToken:E,socketPath:E,responseEncoding:E,validateStatus:s,headers:(D,V)=>m(aT(D),aT(V),!0)};return Ne.forEach(Object.keys(Object.assign({},e,n)),function(V){const G=k[V]||m,J=G(e[V],n[V],V);Ne.isUndefined(J)&&G!==s||(l[V]=J)}),l}const WC=e=>{const n=xc({},e);let{data:l,withXSRFToken:h,xsrfHeaderName:m,xsrfCookieName:v,headers:E,auth:s}=n;n.headers=E=Ho.from(E),n.url=UC(qC(n.baseURL,n.url),e.params,e.paramsSerializer),s&&E.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let k;if(Ne.isFormData(l)){if(Mi.hasStandardBrowserEnv||Mi.hasStandardBrowserWebWorkerEnv)E.setContentType(void 0);else if((k=E.getContentType())!==!1){const[D,...V]=k?k.split(";").map(G=>G.trim()).filter(Boolean):[];E.setContentType([D||"multipart/form-data",...V].join("; "))}}if(Mi.hasStandardBrowserEnv&&(h&&Ne.isFunction(h)&&(h=h(n)),h||h!==!1&&Q5(n.url))){const D=m&&v&&eO.read(v);D&&E.set(m,D)}return n},rO=typeof XMLHttpRequest<"u",iO=rO&&function(e){return new Promise(function(l,h){const m=WC(e);let v=m.data;const E=Ho.from(m.headers).normalize();let{responseType:s,onUploadProgress:k,onDownloadProgress:D}=m,V,G,J,ve,ae;function me(){ve&&ve(),ae&&ae(),m.cancelToken&&m.cancelToken.unsubscribe(V),m.signal&&m.signal.removeEventListener("abort",V)}let Ce=new XMLHttpRequest;Ce.open(m.method.toUpperCase(),m.url,!0),Ce.timeout=m.timeout;function ie(){if(!Ce)return;const le=Ho.from("getAllResponseHeaders"in Ce&&Ce.getAllResponseHeaders()),Oe={data:!s||s==="text"||s==="json"?Ce.responseText:Ce.response,status:Ce.status,statusText:Ce.statusText,headers:le,config:e,request:Ce};GC(function(He){l(He),me()},function(He){h(He),me()},Oe),Ce=null}"onloadend"in Ce?Ce.onloadend=ie:Ce.onreadystatechange=function(){!Ce||Ce.readyState!==4||Ce.status===0&&!(Ce.responseURL&&Ce.responseURL.indexOf("file:")===0)||setTimeout(ie)},Ce.onabort=function(){Ce&&(h(new qt("Request aborted",qt.ECONNABORTED,e,Ce)),Ce=null)},Ce.onerror=function(){h(new qt("Network Error",qt.ERR_NETWORK,e,Ce)),Ce=null},Ce.ontimeout=function(){let ze=m.timeout?"timeout of "+m.timeout+"ms exceeded":"timeout exceeded";const Oe=m.transitional||jC;m.timeoutErrorMessage&&(ze=m.timeoutErrorMessage),h(new qt(ze,Oe.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,e,Ce)),Ce=null},v===void 0&&E.setContentType(null),"setRequestHeader"in Ce&&Ne.forEach(E.toJSON(),function(ze,Oe){Ce.setRequestHeader(Oe,ze)}),Ne.isUndefined(m.withCredentials)||(Ce.withCredentials=!!m.withCredentials),s&&s!=="json"&&(Ce.responseType=m.responseType),D&&([J,ae]=Jg(D,!0),Ce.addEventListener("progress",J)),k&&Ce.upload&&([G,ve]=Jg(k),Ce.upload.addEventListener("progress",G),Ce.upload.addEventListener("loadend",ve)),(m.cancelToken||m.signal)&&(V=le=>{Ce&&(h(!le||le.type?new gh(null,e,Ce):le),Ce.abort(),Ce=null)},m.cancelToken&&m.cancelToken.subscribe(V),m.signal&&(m.signal.aborted?V():m.signal.addEventListener("abort",V)));const te=K5(m.url);if(te&&Mi.protocols.indexOf(te)===-1){h(new qt("Unsupported protocol "+te+":",qt.ERR_BAD_REQUEST,e));return}Ce.send(v||null)})},oO=(e,n)=>{const{length:l}=e=e?e.filter(Boolean):[];if(n||l){let h=new AbortController,m;const v=function(D){if(!m){m=!0,s();const V=D instanceof Error?D:this.reason;h.abort(V instanceof qt?V:new gh(V instanceof Error?V.message:V))}};let E=n&&setTimeout(()=>{E=null,v(new qt(`timeout ${n} of ms exceeded`,qt.ETIMEDOUT))},n);const s=()=>{e&&(E&&clearTimeout(E),E=null,e.forEach(D=>{D.unsubscribe?D.unsubscribe(v):D.removeEventListener("abort",v)}),e=null)};e.forEach(D=>D.addEventListener("abort",v));const{signal:k}=h;return k.unsubscribe=()=>Ne.asap(s),k}},sO=oO,aO=function*(e,n){let l=e.byteLength;if(!n||l{const m=lO(e,n);let v=0,E,s=k=>{E||(E=!0,h&&h(k))};return new ReadableStream({async pull(k){try{const{done:D,value:V}=await m.next();if(D){s(),k.close();return}let G=V.byteLength;if(l){let J=v+=G;l(J)}k.enqueue(new Uint8Array(V))}catch(D){throw s(D),D}},cancel(k){return s(k),m.return()}},{highWaterMark:2})},M_=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ZC=M_&&typeof ReadableStream=="function",uO=M_&&(typeof TextEncoder=="function"?(e=>n=>e.encode(n))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),HC=(e,...n)=>{try{return!!e(...n)}catch{return!1}},hO=ZC&&HC(()=>{let e=!1;const n=new Request(Mi.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!n}),cT=64*1024,l1=ZC&&HC(()=>Ne.isReadableStream(new Response("").body)),Qg={stream:l1&&(e=>e.body)};M_&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(n=>{!Qg[n]&&(Qg[n]=Ne.isFunction(e[n])?l=>l[n]():(l,h)=>{throw new qt(`Response type '${n}' is not supported`,qt.ERR_NOT_SUPPORT,h)})})})(new Response);const dO=async e=>{if(e==null)return 0;if(Ne.isBlob(e))return e.size;if(Ne.isSpecCompliantForm(e))return(await new Request(Mi.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Ne.isArrayBufferView(e)||Ne.isArrayBuffer(e))return e.byteLength;if(Ne.isURLSearchParams(e)&&(e=e+""),Ne.isString(e))return(await uO(e)).byteLength},pO=async(e,n)=>{const l=Ne.toFiniteNumber(e.getContentLength());return l??dO(n)},fO=M_&&(async e=>{let{url:n,method:l,data:h,signal:m,cancelToken:v,timeout:E,onDownloadProgress:s,onUploadProgress:k,responseType:D,headers:V,withCredentials:G="same-origin",fetchOptions:J}=WC(e);D=D?(D+"").toLowerCase():"text";let ve=sO([m,v&&v.toAbortSignal()],E),ae;const me=ve&&ve.unsubscribe&&(()=>{ve.unsubscribe()});let Ce;try{if(k&&hO&&l!=="get"&&l!=="head"&&(Ce=await pO(V,h))!==0){let Oe=new Request(n,{method:"POST",body:h,duplex:"half"}),Ke;if(Ne.isFormData(h)&&(Ke=Oe.headers.get("content-type"))&&V.setContentType(Ke),Oe.body){const[He,ht]=oT(Ce,Jg(sT(k)));h=lT(Oe.body,cT,He,ht)}}Ne.isString(G)||(G=G?"include":"omit");const ie="credentials"in Request.prototype;ae=new Request(n,{...J,signal:ve,method:l.toUpperCase(),headers:V.normalize().toJSON(),body:h,duplex:"half",credentials:ie?G:void 0});let te=await fetch(ae);const le=l1&&(D==="stream"||D==="response");if(l1&&(s||le&&me)){const Oe={};["status","statusText","headers"].forEach(Ve=>{Oe[Ve]=te[Ve]});const Ke=Ne.toFiniteNumber(te.headers.get("content-length")),[He,ht]=s&&oT(Ke,Jg(sT(s),!0))||[];te=new Response(lT(te.body,cT,He,()=>{ht&&ht(),me&&me()}),Oe)}D=D||"text";let ze=await Qg[Ne.findKey(Qg,D)||"text"](te,e);return!le&&me&&me(),await new Promise((Oe,Ke)=>{GC(Oe,Ke,{data:ze,headers:Ho.from(te.headers),status:te.status,statusText:te.statusText,config:e,request:ae})})}catch(ie){throw me&&me(),ie&&ie.name==="TypeError"&&/fetch/i.test(ie.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,e,ae),{cause:ie.cause||ie}):qt.from(ie,ie&&ie.code,e,ae)}}),c1={http:C5,xhr:iO,fetch:fO};Ne.forEach(c1,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch{}Object.defineProperty(e,"adapterName",{value:n})}});const uT=e=>`- ${e}`,mO=e=>Ne.isFunction(e)||e===null||e===!1,XC={getAdapter:e=>{e=Ne.isArray(e)?e:[e];const{length:n}=e;let l,h;const m={};for(let v=0;v`adapter ${s} `+(k===!1?"is not supported by the environment":"is not available in the build"));let E=n?v.length>1?`since : -`+v.map(uT).join(` -`):" "+uT(v[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+E,"ERR_NOT_SUPPORT")}return h},adapters:c1};function ev(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gh(null,e)}function hT(e){return ev(e),e.headers=Ho.from(e.headers),e.data=Q0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),XC.getAdapter(e.adapter||bx.adapter)(e).then(function(h){return ev(e),h.data=Q0.call(e,e.transformResponse,h),h.headers=Ho.from(h.headers),h},function(h){return $C(h)||(ev(e),h&&h.response&&(h.response.data=Q0.call(e,e.transformResponse,h.response),h.response.headers=Ho.from(h.response.headers))),Promise.reject(h)})}const KC="1.7.7",Ex={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{Ex[e]=function(h){return typeof h===e||"a"+(n<1?"n ":" ")+e}});const dT={};Ex.transitional=function(n,l,h){function m(v,E){return"[Axios v"+KC+"] Transitional option '"+v+"'"+E+(h?". "+h:"")}return(v,E,s)=>{if(n===!1)throw new qt(m(E," has been removed"+(l?" in "+l:"")),qt.ERR_DEPRECATED);return l&&!dT[E]&&(dT[E]=!0,console.warn(m(E," has been deprecated since v"+l+" and will be removed in the near future"))),n?n(v,E,s):!0}};function gO(e,n,l){if(typeof e!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const h=Object.keys(e);let m=h.length;for(;m-- >0;){const v=h[m],E=n[v];if(E){const s=e[v],k=s===void 0||E(s,v,e);if(k!==!0)throw new qt("option "+v+" must be "+k,qt.ERR_BAD_OPTION_VALUE);continue}if(l!==!0)throw new qt("Unknown option "+v,qt.ERR_BAD_OPTION)}}const u1={assertOptions:gO,validators:Ex},Va=u1.validators;class e_{constructor(n){this.defaults=n,this.interceptors={request:new rT,response:new rT}}async request(n,l){try{return await this._request(n,l)}catch(h){if(h instanceof Error){let m;Error.captureStackTrace?Error.captureStackTrace(m={}):m=new Error;const v=m.stack?m.stack.replace(/^.+\n/,""):"";try{h.stack?v&&!String(h.stack).endsWith(v.replace(/^.+\n.+\n/,""))&&(h.stack+=` -`+v):h.stack=v}catch{}}throw h}}_request(n,l){typeof n=="string"?(l=l||{},l.url=n):l=n||{},l=xc(this.defaults,l);const{transitional:h,paramsSerializer:m,headers:v}=l;h!==void 0&&u1.assertOptions(h,{silentJSONParsing:Va.transitional(Va.boolean),forcedJSONParsing:Va.transitional(Va.boolean),clarifyTimeoutError:Va.transitional(Va.boolean)},!1),m!=null&&(Ne.isFunction(m)?l.paramsSerializer={serialize:m}:u1.assertOptions(m,{encode:Va.function,serialize:Va.function},!0)),l.method=(l.method||this.defaults.method||"get").toLowerCase();let E=v&&Ne.merge(v.common,v[l.method]);v&&Ne.forEach(["delete","get","head","post","put","patch","common"],ae=>{delete v[ae]}),l.headers=Ho.concat(E,v);const s=[];let k=!0;this.interceptors.request.forEach(function(me){typeof me.runWhen=="function"&&me.runWhen(l)===!1||(k=k&&me.synchronous,s.unshift(me.fulfilled,me.rejected))});const D=[];this.interceptors.response.forEach(function(me){D.push(me.fulfilled,me.rejected)});let V,G=0,J;if(!k){const ae=[hT.bind(this),void 0];for(ae.unshift.apply(ae,s),ae.push.apply(ae,D),J=ae.length,V=Promise.resolve(l);G{if(!h._listeners)return;let v=h._listeners.length;for(;v-- >0;)h._listeners[v](m);h._listeners=null}),this.promise.then=m=>{let v;const E=new Promise(s=>{h.subscribe(s),v=s}).then(m);return E.cancel=function(){h.unsubscribe(v)},E},n(function(v,E,s){h.reason||(h.reason=new gh(v,E,s),l(h.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const l=this._listeners.indexOf(n);l!==-1&&this._listeners.splice(l,1)}toAbortSignal(){const n=new AbortController,l=h=>{n.abort(h)};return this.subscribe(l),n.signal.unsubscribe=()=>this.unsubscribe(l),n.signal}static source(){let n;return{token:new Tx(function(m){n=m}),cancel:n}}}const _O=Tx;function yO(e){return function(l){return e.apply(null,l)}}function vO(e){return Ne.isObject(e)&&e.isAxiosError===!0}const h1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(h1).forEach(([e,n])=>{h1[n]=e});const xO=h1;function YC(e){const n=new xg(e),l=IC(xg.prototype.request,n);return Ne.extend(l,xg.prototype,n,{allOwnKeys:!0}),Ne.extend(l,n,null,{allOwnKeys:!0}),l.create=function(m){return YC(xc(e,m))},l}const xr=YC(bx);xr.Axios=xg;xr.CanceledError=gh;xr.CancelToken=_O;xr.isCancel=$C;xr.VERSION=KC;xr.toFormData=I_;xr.AxiosError=qt;xr.Cancel=xr.CanceledError;xr.all=function(n){return Promise.all(n)};xr.spread=yO;xr.isAxiosError=vO;xr.mergeConfig=xc;xr.AxiosHeaders=Ho;xr.formToJSON=e=>VC(Ne.isHTMLForm(e)?new FormData(e):e);xr.getAdapter=XC.getAdapter;xr.HttpStatusCode=xO;xr.default=xr;const wO=xr;/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */const Gu="https://cori-data-api.ruralinnovation.us/",d1=wO.create({baseURL:Gu,headers:{"Content-Type":"application/json"}}),tv={},JC={apiClient:d1,authenticated:!1,authenticated_user:null,autoSignOut:null,baseURL:Gu,token:null,data:{get:()=>tv,set:e=>{for(const n in e)e.hasOwnProperty[n]&&(tv[n]=e)}},setData:e=>{for(const n in e)e.hasOwnProperty[n]&&(tv[n]=e)}},QC=ut.createContext(JC);let tg=!1,pT=!1;function bO(e){const[n,l]=ut.useState(Object.assign(Object.assign({},JC),{baseURL:e.baseURL?e.baseURL:Gu,setData:h}));function h(m){const v=n;l(Object.assign(Object.assign({},v),{data:Object.assign(Object.assign({},v.data),m),setData:h}))}return e.baseURL&&e.baseURL.length>0&&d1.interceptors.request.use(m=>(m.baseURL=e.baseURL,console.log("API baseURL updated:",m.baseURL),m),m=>Promise.reject(m)),ut.useEffect(()=>{if(l(Object.assign(Object.assign({},n),{autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:m}=e;m(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL?e.baseURL:Gu})),e.fetchAuthSession){const{fetchAuthSession:m}=e;m().then(E=>{if(!tg){const s=E.tokens;if(console.log("API tokens:",s),s&&s.hasOwnProperty("idToken")&&(tg=!0,console.log("API Session is authenticated:",tg),console.log("API Session config:",E),console.log("idToken:",s.idToken),d1.interceptors.request.use(k=>{const D=s.idToken;return D&&(k.headers.Authorization=`Bearer ${D}`),e.baseURL&&(k.baseURL=e.baseURL),k},k=>Promise.reject(k)),l(Object.assign(Object.assign({},n),{authenticated:!0,autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:k}=e;k(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL||Gu,token:s.idToken})),e.getCurrentUser)){const{getCurrentUser:k}=e;k().then(V=>{pT||(pT=!0,console.log("API User is authenticated:",tg),console.log("API User:",V),console.log("API User type:",V.constructor.name),l(Object.assign(Object.assign({},n),{authenticated:!0,authenticated_user:V,autoSignOut:e.signOut&&typeof e.signOut=="function"?()=>{const{signOut:G}=e;G(),window.alert("Please refresh this session by clicking the browser's reload button!"),window.location=window.location.protocol+"//"+window.location.host+window.location.pathname}:null,baseURL:e.baseURL||Gu,token:s.idToken})))})}}})}},[]),T0.createElement(T0.Fragment,null,T0.createElement(QC.Provider,{value:n},e.children))}const EO="modulepreload",TO=function(e){return"/"+e},fT={},SO=function(n,l,h){if(!l||l.length===0)return n();const m=document.getElementsByTagName("link");return Promise.all(l.map(v=>{if(v=TO(v),v in fT)return;fT[v]=!0;const E=v.endsWith(".css"),s=E?'[rel="stylesheet"]':"";if(!!h)for(let V=m.length-1;V>=0;V--){const G=m[V];if(G.href===v&&(!E||G.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${s}`))return;const D=document.createElement("link");if(D.rel=E?"stylesheet":EO,E||(D.as="script",D.crossOrigin=""),D.href=v,document.head.appendChild(D),E)return new Promise((V,G)=>{D.addEventListener("load",V),D.addEventListener("error",()=>G(new Error(`Unable to preload CSS for ${v}`)))})})).then(()=>n()).catch(v=>{const E=new Event("vite:preloadError",{cancelable:!0});if(E.payload=v,window.dispatchEvent(E),!E.defaultPrevented)throw v})},AO=ut.createContext(null);function CO(e,n){const l=Array.isArray(e)?e[0]:e?e.x:0,h=Array.isArray(e)?e[1]:e?e.y:0,m=Array.isArray(n)?n[0]:n?n.x:0,v=Array.isArray(n)?n[1]:n?n.y:0;return l===m&&h===v}function Ks(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let l=0;l{let m=null;"interactive"in h&&(m=Object.assign({},h),delete m.interactive);const v=n[h.ref];if(v){m=m||Object.assign({},h),delete m.ref;for(const E of kO)E in v&&(m[E]=v[E])}return m||h});return{...e,layers:l}}const vT={version:8,sources:{},layers:[]},xT={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"},nv={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"},wT={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},MO=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],PO=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class lh{constructor(n,l,h){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=m=>{const v=this.props[wT[m.type]];v?v(m):m.type==="error"&&console.error(m.error)},this._onPointerEvent=m=>{(m.type==="mousemove"||m.type==="mouseout")&&this._updateHover(m);const v=this.props[xT[m.type]];v&&(this.props.interactiveLayerIds&&m.type!=="mouseover"&&m.type!=="mouseout"&&(m.features=this._hoveredFeatures||this._queryRenderedFeatures(m.point)),v(m),delete m.features)},this._onCameraEvent=m=>{if(!this._internalUpdate){const v=this.props[nv[m.type]];v&&v(m)}m.type in this._deferredEvents&&(this._deferredEvents[m.type]=!1)},this._MapClass=n,this.props=l,this._initialize(h)}get map(){return this._map}get transform(){return this._renderTransform}setProps(n){const l=this.props;this.props=n;const h=this._updateSettings(n,l);h&&this._createShadowTransform(this._map);const m=this._updateSize(n),v=this._updateViewState(n,!0);this._updateStyle(n,l),this._updateStyleComponents(n,l),this._updateHandlers(n,l),(h||m||v&&!this._map.isMoving())&&this.redraw()}static reuse(n,l){const h=lh.savedMaps.pop();if(!h)return null;const m=h.map,v=m.getContainer();for(l.className=v.className;v.childNodes.length>0;)l.appendChild(v.childNodes[0]);m._container=l;const E=m._resizeObserver;E&&(E.disconnect(),E.observe(l)),h.setProps({...n,styleDiffing:!1}),m.resize();const{initialViewState:s}=n;return s&&(s.bounds?m.fitBounds(s.bounds,{...s.fitBoundsOptions,duration:0}):h._updateViewState(s,!1)),m.isStyleLoaded()?m.fire("load"):m.once("styledata",()=>m.fire("load")),m._update(),h}_initialize(n){const{props:l}=this,{mapStyle:h=vT}=l,m={...l,...l.initialViewState,accessToken:l.mapboxAccessToken||zO()||null,container:n,style:yT(h)},v=m.initialViewState||m.viewState||m;if(Object.assign(m,{center:[v.longitude||0,v.latitude||0],zoom:v.zoom||0,pitch:v.pitch||0,bearing:v.bearing||0}),l.gl){const V=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=V,l.gl)}const E=new this._MapClass(m);v.padding&&E.setPadding(v.padding),l.cursor&&(E.getCanvas().style.cursor=l.cursor),this._createShadowTransform(E);const s=E._render;E._render=V=>{this._inRender=!0,s.call(E,V),this._inRender=!1};const k=E._renderTaskQueue.run;E._renderTaskQueue.run=V=>{k.call(E._renderTaskQueue,V),this._onBeforeRepaint()},E.on("render",()=>this._onAfterRepaint());const D=E.fire;E.fire=this._fireEvent.bind(this,D),E.on("resize",()=>{this._renderTransform.resize(E.transform.width,E.transform.height)}),E.on("styledata",()=>{this._updateStyleComponents(this.props,{}),mT(E.transform,this._renderTransform)}),E.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const V in xT)E.on(V,this._onPointerEvent);for(const V in nv)E.on(V,this._onCameraEvent);for(const V in wT)E.on(V,this._onEvent);this._map=E}recycle(){const l=this.map.getContainer().querySelector("[mapboxgl-children]");l==null||l.remove(),lh.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const n=this._map;!this._inRender&&n.style&&(n._frame&&(n._frame.cancel(),n._frame=null),n._render())}_createShadowTransform(n){const l=IO(n.transform);n.painter.transform=l,this._renderTransform=l}_updateSize(n){const{viewState:l}=n;if(l){const h=this._map;if(l.width!==h.transform.width||l.height!==h.transform.height)return h.resize(),!0}return!1}_updateViewState(n,l){if(this._internalUpdate)return!1;const h=this._map,m=this._renderTransform,{zoom:v,pitch:E,bearing:s}=m,k=h.isMoving();k&&(m.cameraElevationReference="sea");const D=_T(m,{...gT(h.transform),...n});if(k&&(m.cameraElevationReference="ground"),D&&l){const V=this._deferredEvents;V.move=!0,V.zoom||(V.zoom=v!==m.zoom),V.rotate||(V.rotate=s!==m.bearing),V.pitch||(V.pitch=E!==m.pitch)}return k||_T(h.transform,n),D}_updateSettings(n,l){const h=this._map;let m=!1;for(const v of MO)if(v in n&&!Ks(n[v],l[v])){m=!0;const E=h[`set${v[0].toUpperCase()}${v.slice(1)}`];E==null||E.call(h,n[v])}return m}_updateStyle(n,l){if(n.cursor!==l.cursor&&(this._map.getCanvas().style.cursor=n.cursor||""),n.mapStyle!==l.mapStyle){const{mapStyle:h=vT,styleDiffing:m=!0}=n,v={diff:m};return"localIdeographFontFamily"in n&&(v.localIdeographFontFamily=n.localIdeographFontFamily),this._map.setStyle(yT(h),v),!0}return!1}_updateStyleComponents(n,l){const h=this._map;let m=!1;return h.isStyleLoaded()&&("light"in n&&h.setLight&&!Ks(n.light,l.light)&&(m=!0,h.setLight(n.light)),"fog"in n&&h.setFog&&!Ks(n.fog,l.fog)&&(m=!0,h.setFog(n.fog)),"terrain"in n&&h.setTerrain&&!Ks(n.terrain,l.terrain)&&(!n.terrain||h.getSource(n.terrain.source))&&(m=!0,h.setTerrain(n.terrain))),m}_updateHandlers(n,l){var h,m;const v=this._map;let E=!1;for(const s of PO){const k=(h=n[s])!==null&&h!==void 0?h:!0,D=(m=l[s])!==null&&m!==void 0?m:!0;Ks(k,D)||(E=!0,k?v[s].enable(k):v[s].disable())}return E}_queryRenderedFeatures(n){const l=this._map,h=l.transform,{interactiveLayerIds:m=[]}=this.props;try{return l.transform=this._renderTransform,l.queryRenderedFeatures(n,{layers:m.filter(l.getLayer.bind(l))})}catch{return[]}finally{l.transform=h}}_updateHover(n){var l;const{props:h}=this;if(h.interactiveLayerIds&&(h.onMouseMove||h.onMouseEnter||h.onMouseLeave)){const v=n.type,E=((l=this._hoveredFeatures)===null||l===void 0?void 0:l.length)>0,s=this._queryRenderedFeatures(n.point),k=s.length>0;!k&&E&&(n.type="mouseleave",this._onPointerEvent(n)),this._hoveredFeatures=s,k&&!E&&(n.type="mouseenter",this._onPointerEvent(n)),n.type=v}else this._hoveredFeatures=null}_fireEvent(n,l,h){const m=this._map,v=m.transform,E=typeof l=="string"?l:l.type;return E==="move"&&this._updateViewState(this.props,!1),E in nv&&(typeof l=="object"&&(l.viewState=gT(v)),this._map.isMoving())?(m.transform=this._renderTransform,n.call(m,l,h),m.transform=v,m):(n.call(m,l,h),m)}_onBeforeRepaint(){const n=this._map;this._internalUpdate=!0;for(const h in this._deferredEvents)this._deferredEvents[h]&&n.fire(h);this._internalUpdate=!1;const l=this._map.transform;n.transform=this._renderTransform,this._onAfterRepaint=()=>{mT(this._renderTransform,l),n.transform=l}}}lh.savedMaps=[];function zO(){let e=null;if(typeof location<"u"){const n=/access_token=([^&\/]*)/.exec(location.search);e=n&&n[1]}try{e=e||void 0}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const LO=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function RO(e){if(!e)return null;const n=e.map,l={getMap:()=>n,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:h=>{const m=n.transform;n.transform=e.transform;const v=n.project(h);return n.transform=m,v},unproject:h=>{const m=n.transform;n.transform=e.transform;const v=n.unproject(h);return n.transform=m,v},queryTerrainElevation:(h,m)=>{const v=n.transform;n.transform=e.transform;const E=n.queryTerrainElevation(h,m);return n.transform=v,E},queryRenderedFeatures:(h,m)=>{const v=n.transform;n.transform=e.transform;const E=n.queryRenderedFeatures(h,m);return n.transform=v,E}};for(const h of DO(n))!(h in l)&&!LO.includes(h)&&(l[h]=n[h].bind(n));return l}function DO(e){const n=new Set;let l=e;for(;l;){for(const h of Object.getOwnPropertyNames(l))h[0]!=="_"&&typeof e[h]=="function"&&h!=="fire"&&h!=="setEventedParent"&&n.add(h);l=Object.getPrototypeOf(l)}return Array.from(n)}const OO=typeof document<"u"?ut.useLayoutEffect:ut.useEffect,BO=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function FO(e,n){for(const h of BO)h in n&&(e[h]=n[h]);const{RTLTextPlugin:l="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=n;l&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(l,h=>{h&&console.error(h)},!0)}const P_=ut.createContext(null);function NO(e,n,l){const h=ut.useContext(AO),[m,v]=ut.useState(null),E=ut.useRef(),{current:s}=ut.useRef({mapLib:null,map:null});ut.useEffect(()=>{const V=e.mapLib;let G=!0,J;return Promise.resolve(V||l).then(ve=>{if(!G)return;if(!ve)throw new Error("Invalid mapLib");const ae="Map"in ve?ve:ve.default;if(!ae.Map)throw new Error("Invalid mapLib");if(FO(ae,e),!ae.supported||ae.supported(e))e.reuseMaps&&(J=lh.reuse(e,E.current)),J||(J=new lh(ae.Map,e,E.current)),s.map=RO(J),s.mapLib=ae,v(J),h==null||h.onMapMount(s.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(ve=>{const{onError:ae}=e;ae?ae({type:"error",target:null,originalEvent:null,error:ve}):console.error(ve)}),()=>{G=!1,J&&(h==null||h.onMapUnmount(e.id),e.reuseMaps?J.recycle():J.destroy())}},[]),OO(()=>{m&&m.setProps(e)}),ut.useImperativeHandle(n,()=>s.map,[m]);const k=ut.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),D={height:"100%"};return ut.createElement("div",{id:e.id,ref:E,style:k},m&&ut.createElement(P_.Provider,{value:s},ut.createElement("div",{"mapboxgl-children":"",style:D},e.children)))}const UO=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ec(e,n){if(!e||!n)return;const l=e.style;for(const h in n){const m=n[h];Number.isFinite(m)&&!UO.test(h)?l[h]=`${m}px`:l[h]=m}}function jO(e,n){const{map:l,mapLib:h}=ut.useContext(P_),m=ut.useRef({props:e});m.current.props=e;const v=ut.useMemo(()=>{let me=!1;ut.Children.forEach(e.children,te=>{te&&(me=!0)});const Ce={...e,element:me?document.createElement("div"):null},ie=new h.Marker(Ce);return ie.setLngLat([e.longitude,e.latitude]),ie.getElement().addEventListener("click",te=>{var le,ze;(ze=(le=m.current.props).onClick)===null||ze===void 0||ze.call(le,{type:"click",target:ie,originalEvent:te})}),ie.on("dragstart",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDragStart)===null||ze===void 0||ze.call(le,Oe)}),ie.on("drag",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDrag)===null||ze===void 0||ze.call(le,Oe)}),ie.on("dragend",te=>{var le,ze;const Oe=te;Oe.lngLat=v.getLngLat(),(ze=(le=m.current.props).onDragEnd)===null||ze===void 0||ze.call(le,Oe)}),ie},[]);ut.useEffect(()=>(v.addTo(l.getMap()),()=>{v.remove()}),[]);const{longitude:E,latitude:s,offset:k,style:D,draggable:V=!1,popup:G=null,rotation:J=0,rotationAlignment:ve="auto",pitchAlignment:ae="auto"}=e;return ut.useEffect(()=>{Ec(v.getElement(),D)},[D]),ut.useImperativeHandle(n,()=>v,[]),(v.getLngLat().lng!==E||v.getLngLat().lat!==s)&&v.setLngLat([E,s]),k&&!CO(v.getOffset(),k)&&v.setOffset(k),v.isDraggable()!==V&&v.setDraggable(V),v.getRotation()!==J&&v.setRotation(J),v.getRotationAlignment()!==ve&&v.setRotationAlignment(ve),v.getPitchAlignment()!==ae&&v.setPitchAlignment(ae),v.getPopup()!==G&&v.setPopup(G),hx.createPortal(e.children,v.getElement())}const VO=ut.memo(ut.forwardRef(jO));function bT(e){return new Set(e?e.trim().split(/\s+/):[])}function $O(e,n){const{map:l,mapLib:h}=ut.useContext(P_),m=ut.useMemo(()=>document.createElement("div"),[]),v=ut.useRef({props:e});v.current.props=e;const E=ut.useMemo(()=>{const s={...e},k=new h.Popup(s);return k.setLngLat([e.longitude,e.latitude]),k.once("open",D=>{var V,G;(G=(V=v.current.props).onOpen)===null||G===void 0||G.call(V,D)}),k},[]);if(ut.useEffect(()=>{const s=k=>{var D,V;(V=(D=v.current.props).onClose)===null||V===void 0||V.call(D,k)};return E.on("close",s),E.setDOMContent(m).addTo(l.getMap()),()=>{E.off("close",s),E.isOpen()&&E.remove()}},[]),ut.useEffect(()=>{Ec(E.getElement(),e.style)},[e.style]),ut.useImperativeHandle(n,()=>E,[]),E.isOpen()&&((E.getLngLat().lng!==e.longitude||E.getLngLat().lat!==e.latitude)&&E.setLngLat([e.longitude,e.latitude]),e.offset&&!Ks(E.options.offset,e.offset)&&E.setOffset(e.offset),(E.options.anchor!==e.anchor||E.options.maxWidth!==e.maxWidth)&&(E.options.anchor=e.anchor,E.setMaxWidth(e.maxWidth)),E.options.className!==e.className)){const s=bT(E.options.className),k=bT(e.className);for(const D of s)k.has(D)||E.removeClassName(D);for(const D of k)s.has(D)||E.addClassName(D);E.options.className=e.className}return hx.createPortal(e.children,m)}ut.memo(ut.forwardRef($O));function _h(e,n,l,h){const m=ut.useContext(P_),v=ut.useMemo(()=>e(m),[]);return ut.useEffect(()=>{const E=h||l||n,s=typeof n=="function"&&typeof l=="function"?n:null,k=typeof l=="function"?l:typeof n=="function"?n:null,{map:D}=m;return D.hasControl(v)||(D.addControl(v,E==null?void 0:E.position),s&&s(m)),()=>{k&&k(m),D.hasControl(v)&&D.removeControl(v)}},[]),v}function GO(e){const n=_h(({mapLib:l})=>new l.AttributionControl(e),{position:e.position});return ut.useEffect(()=>{Ec(n._container,e.style)},[e.style]),null}ut.memo(GO);function qO(e){const n=_h(({mapLib:l})=>new l.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return ut.useEffect(()=>{Ec(n._controlContainer,e.style)},[e.style]),null}ut.memo(qO);function WO(e,n){const l=ut.useRef({props:e}),h=_h(({mapLib:m})=>{const v=new m.GeolocateControl(e),E=v._setupUI;return v._setupUI=s=>{v._container.hasChildNodes()||E(s)},v.on("geolocate",s=>{var k,D;(D=(k=l.current.props).onGeolocate)===null||D===void 0||D.call(k,s)}),v.on("error",s=>{var k,D;(D=(k=l.current.props).onError)===null||D===void 0||D.call(k,s)}),v.on("outofmaxbounds",s=>{var k,D;(D=(k=l.current.props).onOutOfMaxBounds)===null||D===void 0||D.call(k,s)}),v.on("trackuserlocationstart",s=>{var k,D;(D=(k=l.current.props).onTrackUserLocationStart)===null||D===void 0||D.call(k,s)}),v.on("trackuserlocationend",s=>{var k,D;(D=(k=l.current.props).onTrackUserLocationEnd)===null||D===void 0||D.call(k,s)}),v},{position:e.position});return l.current.props=e,ut.useImperativeHandle(n,()=>h,[]),ut.useEffect(()=>{Ec(h._container,e.style)},[e.style]),null}const ZO=ut.memo(ut.forwardRef(WO));function HO(e){const n=_h(({mapLib:l})=>new l.NavigationControl(e),{position:e.position});return ut.useEffect(()=>{Ec(n._container,e.style)},[e.style]),null}const XO=ut.memo(HO);function KO(e){const n=_h(({mapLib:v})=>new v.ScaleControl(e),{position:e.position}),l=ut.useRef(e),h=l.current;l.current=e;const{style:m}=e;return e.maxWidth!==void 0&&e.maxWidth!==h.maxWidth&&(n.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==h.unit&&n.setUnit(e.unit),ut.useEffect(()=>{Ec(n._container,m)},[m]),null}const YO=ut.memo(KO),JO=SO(()=>Promise.resolve().then(()=>SU),void 0),QO=(()=>ut.forwardRef(function(n,l){return NO(n,l,JO)}))(),eI=VO,e4=XO,t4=ZO,n4=YO;var yh=i4,r4=Object.prototype.hasOwnProperty;function i4(){for(var e={},n=0;n-1};ri.prototype.value=function(e){if(this.selected=e,this.el.value=this.getItemValue(e),document.createEvent){var n=document.createEvent("HTMLEvents");n.initEvent("change",!0,!1),this.el.dispatchEvent(n)}else this.el.fireEvent("onchange")};ri.prototype.getCandidates=function(e){var n={pre:"",post:"",extract:(function(h){return this.getItemValue(h)}).bind(this)},l;this.options.filter?(l=l4.filter(this.query,this.data,n),l=l.map((function(h){return{original:h.original,string:this.render(h.original,h.string)}}).bind(this))):l=this.data.map((function(h){var m=this.render(h);return{original:h,string:m}}).bind(this)),e(l)};ri.prototype.getItemValue=function(e){return e};ri.prototype.render=function(e,n){if(n)return n;for(var l=e.original?this.getItemValue(e.original):this.getItemValue(e),h=this.normalize(l),m=h.lastIndexOf(this.query);m>-1;){var v=m+this.query.length;l=l.slice(0,m)+""+l.slice(m,v)+""+l.slice(v),m=h.slice(0,m).lastIndexOf(this.query)}return l};ri.prototype.renderError=function(e){this.list.drawError(e)};var u4=ri,nI=u4,h4=nI;typeof window<"u"&&(window.Suggestions=nI);var d4="Expected a function",ET=0/0,p4="[object Symbol]",f4=/^\s+|\s+$/g,m4=/^[-+]0x[0-9a-f]+$/i,g4=/^0b[01]+$/i,_4=/^0o[0-7]+$/i,y4=parseInt,v4=typeof Go=="object"&&Go&&Go.Object===Object&&Go,x4=typeof self=="object"&&self&&self.Object===Object&&self,w4=v4||x4||Function("return this")(),b4=Object.prototype,E4=b4.toString,T4=Math.max,S4=Math.min,rv=function(){return w4.Date.now()};function A4(e,n,l){var h,m,v,E,s,k,D=0,V=!1,G=!1,J=!0;if(typeof e!="function")throw new TypeError(d4);n=TT(n)||0,p1(l)&&(V=!!l.leading,G="maxWait"in l,v=G?T4(TT(l.maxWait)||0,n):v,J="trailing"in l?!!l.trailing:J);function ve(Ke){var He=h,ht=m;return h=m=void 0,D=Ke,E=e.apply(ht,He),E}function ae(Ke){return D=Ke,s=setTimeout(ie,n),V?ve(Ke):E}function me(Ke){var He=Ke-k,ht=Ke-D,Ve=n-He;return G?S4(Ve,v-ht):Ve}function Ce(Ke){var He=Ke-k,ht=Ke-D;return k===void 0||He>=n||He<0||G&&ht>=v}function ie(){var Ke=rv();if(Ce(Ke))return te(Ke);s=setTimeout(ie,me(Ke))}function te(Ke){return s=void 0,J&&h?ve(Ke):(h=m=void 0,E)}function le(){s!==void 0&&clearTimeout(s),D=0,h=k=m=s=void 0}function ze(){return s===void 0?E:te(rv())}function Oe(){var Ke=rv(),He=Ce(Ke);if(h=arguments,m=this,k=Ke,He){if(s===void 0)return ae(k);if(G)return s=setTimeout(ie,n),ve(k)}return s===void 0&&(s=setTimeout(ie,n)),E}return Oe.cancel=le,Oe.flush=ze,Oe}function p1(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function C4(e){return!!e&&typeof e=="object"}function I4(e){return typeof e=="symbol"||C4(e)&&E4.call(e)==p4}function TT(e){if(typeof e=="number")return e;if(I4(e))return ET;if(p1(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=p1(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=e.replace(f4,"");var l=g4.test(e);return l||_4.test(e)?y4(e.slice(2),l?2:8):m4.test(e)?ET:+e}var k4=A4,Sx={exports:{}},Yu=typeof Reflect=="object"?Reflect:null,ST=Yu&&typeof Yu.apply=="function"?Yu.apply:function(n,l,h){return Function.prototype.apply.call(n,l,h)},wg;Yu&&typeof Yu.ownKeys=="function"?wg=Yu.ownKeys:Object.getOwnPropertySymbols?wg=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:wg=function(n){return Object.getOwnPropertyNames(n)};function M4(e){console&&console.warn&&console.warn(e)}var rI=Number.isNaN||function(n){return n!==n};function Cn(){Cn.init.call(this)}Sx.exports=Cn;Sx.exports.once=R4;Cn.EventEmitter=Cn;Cn.prototype._events=void 0;Cn.prototype._eventsCount=0;Cn.prototype._maxListeners=void 0;var AT=10;function z_(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Cn,"defaultMaxListeners",{enumerable:!0,get:function(){return AT},set:function(e){if(typeof e!="number"||e<0||rI(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");AT=e}});Cn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Cn.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||rI(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function iI(e){return e._maxListeners===void 0?Cn.defaultMaxListeners:e._maxListeners}Cn.prototype.getMaxListeners=function(){return iI(this)};Cn.prototype.emit=function(n){for(var l=[],h=1;h0&&(E=l[0]),E instanceof Error)throw E;var s=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw s.context=E,s}var k=v[n];if(k===void 0)return!1;if(typeof k=="function")ST(k,this,l);else for(var D=k.length,V=cI(k,D),h=0;h0&&E.length>m&&!E.warned){E.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=n,s.count=E.length,M4(s)}return e}Cn.prototype.addListener=function(n,l){return oI(this,n,l,!1)};Cn.prototype.on=Cn.prototype.addListener;Cn.prototype.prependListener=function(n,l){return oI(this,n,l,!0)};function P4(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function sI(e,n,l){var h={fired:!1,wrapFn:void 0,target:e,type:n,listener:l},m=P4.bind(h);return m.listener=l,h.wrapFn=m,m}Cn.prototype.once=function(n,l){return z_(l),this.on(n,sI(this,n,l)),this};Cn.prototype.prependOnceListener=function(n,l){return z_(l),this.prependListener(n,sI(this,n,l)),this};Cn.prototype.removeListener=function(n,l){var h,m,v,E,s;if(z_(l),m=this._events,m===void 0)return this;if(h=m[n],h===void 0)return this;if(h===l||h.listener===l)--this._eventsCount===0?this._events=Object.create(null):(delete m[n],m.removeListener&&this.emit("removeListener",n,h.listener||l));else if(typeof h!="function"){for(v=-1,E=h.length-1;E>=0;E--)if(h[E]===l||h[E].listener===l){s=h[E].listener,v=E;break}if(v<0)return this;v===0?h.shift():z4(h,v),h.length===1&&(m[n]=h[0]),m.removeListener!==void 0&&this.emit("removeListener",n,s||l)}return this};Cn.prototype.off=Cn.prototype.removeListener;Cn.prototype.removeAllListeners=function(n){var l,h,m;if(h=this._events,h===void 0)return this;if(h.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):h[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete h[n]),this;if(arguments.length===0){var v=Object.keys(h),E;for(m=0;m=0;m--)this.removeListener(n,l[m]);return this};function aI(e,n,l){var h=e._events;if(h===void 0)return[];var m=h[n];return m===void 0?[]:typeof m=="function"?l?[m.listener||m]:[m]:l?L4(m):cI(m,m.length)}Cn.prototype.listeners=function(n){return aI(this,n,!0)};Cn.prototype.rawListeners=function(n){return aI(this,n,!1)};Cn.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):lI.call(e,n)};Cn.prototype.listenerCount=lI;function lI(e){var n=this._events;if(n!==void 0){var l=n[e];if(typeof l=="function")return 1;if(l!==void 0)return l.length}return 0}Cn.prototype.eventNames=function(){return this._eventsCount>0?wg(this._events):[]};function cI(e,n){for(var l=new Array(n),h=0;h]*)>(.*)/);if(!n)return null;var l=n[1],h=n[2].split(";"),m=null,v=h.reduce(function(E,s){var k=F4(s);return k?k.key==="rel"?(m||(m=k.value),E):(E[k.key]=k.value,E):E},{});return m?{url:l,rel:m,params:v}:null}function U4(e){return e?e.split(/,\s*=400){var E=new IT({request:e,body:n.response,statusCode:n.status});h(E);return}l(n)};var v=e.body;typeof v=="string"?n.send(v):v?n.send(JSON.stringify(v)):m?n.send(m):n.send(),t_[e.id]=n}).then(function(l){return J4(e,l)})}function dI(e,n){var l=e.url(n),h=new window.XMLHttpRequest;return h.open(e.method,l),Object.keys(e.headers).forEach(function(m){h.setRequestHeader(m,e.headers[m])}),h}function Q4(e){return Promise.resolve().then(function(){var n=dI(e,e.client.accessToken);return hI(e,n)})}var eB={browserAbort:Y4,sendRequestXhr:hI,browserSend:Q4,createRequestXhr:dI},n_={exports:{}};/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */n_.exports;(function(e,n){(function(l){var h=n,m=e&&e.exports==h&&e,v=typeof Go=="object"&&Go;(v.global===v||v.window===v)&&(l=v);var E=function(ae){this.message=ae};E.prototype=new Error,E.prototype.name="InvalidCharacterError";var s=function(ae){throw new E(ae)},k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=/[\t\n\f\r ]/g,V=function(ae){ae=String(ae).replace(D,"");var me=ae.length;me%4==0&&(ae=ae.replace(/==?$/,""),me=ae.length),(me%4==1||/[^+a-zA-Z0-9/]/.test(ae))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var Ce=0,ie,te,le="",ze=-1;++ze>(-2*Ce&6)));return le},G=function(ae){ae=String(ae),/[^\0-\xFF]/.test(ae)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var me=ae.length%3,Ce="",ie=-1,te,le,ze,Oe,Ke=ae.length-me;++ie>18&63)+k.charAt(Oe>>12&63)+k.charAt(Oe>>6&63)+k.charAt(Oe&63);return me==2?(te=ae.charCodeAt(ie)<<8,le=ae.charCodeAt(++ie),Oe=te+le,Ce+=k.charAt(Oe>>10)+k.charAt(Oe>>4&63)+k.charAt(Oe<<2&63)+"="):me==1&&(Oe=ae.charCodeAt(ie),Ce+=k.charAt(Oe>>2)+k.charAt(Oe<<4&63)+"=="),Ce},J={encode:G,decode:V,version:"0.1.0"};if(h&&!h.nodeType)if(m)m.exports=J;else for(var ve in J)J.hasOwnProperty(ve)&&(h[ve]=J[ve]);else l.base64=J})(Go)})(n_,n_.exports);var tB=n_.exports,nB=tB,ov={};function rB(e){if(ov[e])return ov[e];var n=e.split("."),l=n[0],h=n[1];if(!h)throw new Error("Invalid token");var m=iB(h),v={usage:l,user:m.u};return oc(m,"a")&&(v.authorization=m.a),oc(m,"exp")&&(v.expires=m.exp*1e3),oc(m,"iat")&&(v.created=m.iat*1e3),oc(m,"scopes")&&(v.scopes=m.scopes),oc(m,"client")&&(v.client=m.client),oc(m,"ll")&&(v.lastLogin=m.ll),oc(m,"iu")&&(v.impersonator=m.iu),ov[e]=v,v}function iB(e){try{return JSON.parse(nB.decode(e))}catch{throw new Error("Invalid token")}}function oc(e,n){return Object.prototype.hasOwnProperty.call(e,n)}var pI=rB,fI={exports:{}};(function(e){var n=Object.prototype.hasOwnProperty,l="~";function h(){}Object.create&&(h.prototype=Object.create(null),new h().__proto__||(l=!1));function m(k,D,V){this.fn=k,this.context=D,this.once=V||!1}function v(k,D,V,G,J){if(typeof V!="function")throw new TypeError("The listener must be a function");var ve=new m(V,G||k,J),ae=l?l+D:D;return k._events[ae]?k._events[ae].fn?k._events[ae]=[k._events[ae],ve]:k._events[ae].push(ve):(k._events[ae]=ve,k._eventsCount++),k}function E(k,D){--k._eventsCount===0?k._events=new h:delete k._events[D]}function s(){this._events=new h,this._eventsCount=0}s.prototype.eventNames=function(){var D=[],V,G;if(this._eventsCount===0)return D;for(G in V=this._events)n.call(V,G)&&D.push(l?G.slice(1):G);return Object.getOwnPropertySymbols?D.concat(Object.getOwnPropertySymbols(V)):D},s.prototype.listeners=function(D){var V=l?l+D:D,G=this._events[V];if(!G)return[];if(G.fn)return[G.fn];for(var J=0,ve=G.length,ae=new Array(ve);Jv.length?E:v})}};zn.equal=function(n){return function(h){if(h!==n)return JSON.stringify(n)}};zn.oneOf=function(){var n=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments),l=n.map(function(h){return zn.equal(h)});return zn.oneOfType.apply(this,l)};zn.range=function(n){var l=n[0],h=n[1];return function(v){var E=cl(zn.number,v);if(E||vh)return"number between "+l+" & "+h+" (inclusive)"}};zn.any=function(){};zn.boolean=function(n){if(typeof n!="boolean")return"boolean"};zn.number=function(n){if(typeof n!="number")return"number"};zn.plainArray=function(n){if(!Array.isArray(n))return"array"};zn.plainObject=function(n){if(!EB(n))return"object"};zn.string=function(n){if(typeof n!="string")return"string"};zn.func=function(n){if(typeof n!="function")return"function"};function cl(e,n){if(!(n==null&&!e.hasOwnProperty("__required"))){var l=e(n);if(l)return Array.isArray(l)?l:[l]}}function Ix(e,n){var l=e.length,h=e[l-1],m=e.slice(0,l-1);return m.length===0&&(m=[bI]),n=TB(n,{path:m}),typeof h=="function"?h(n):TI(n,AB(h))}function SB(e){return e.length<2?e[0]:e.length===2?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e.slice(-1)}function AB(e){return"must be "+CB(e)+"."}function CB(e){return/^an? /.test(e)?e:/^[aeiou]/i.test(e)?"an "+e:/^[a-z]/i.test(e)?"a "+e:e}function TI(e,n){var l=SI(e.path),h=e.path.join(".")+" "+n,m=l?"Item at position ":"";return m+h}function SI(e){return typeof e[e.length-1]=="number"||typeof e[0]=="number"}function IB(e){return Object.keys(e||{}).map(function(n){return{key:n,value:e[n]}})}zn.validate=cl;zn.processMessage=Ix;var kB=zn,MB=yh,Ju=kB;function PB(e){if(typeof window<"u")return e instanceof Go.Blob||e instanceof Go.ArrayBuffer?void 0:"Blob or ArrayBuffer";if(!(typeof e=="string"||e.pipe!==void 0))return"Filename or Readable stream"}function zB(e,n){return Ju.assert(Ju.strictShape(e),n)}function LB(e){var n="date";if(typeof e=="boolean")return n;try{var l=new Date(e);if(l.getTime&&isNaN(l.getTime()))return n}catch{return n}}function RB(e){return Ju.tuple(Ju.number,Ju.number)(e)}var DB=MB(Ju,{file:PB,date:LB,coordinates:RB,assertShape:zB});function OB(e,n){var l=function(h,m){return n.indexOf(h)!==-1&&m!==void 0};return typeof n=="function"&&(l=n),Object.keys(e).filter(function(h){return l(h,e[h])}).reduce(function(h,m){return h[m]=e[m],h},{})}var BB=OB;function FB(e,n){return Object.keys(e).reduce(function(l,h){return l[h]=n(h,e[h]),l},{})}var NB=FB,UB=NB;function jB(e){return UB(e,function(n,l){return typeof l=="boolean"?JSON.stringify(l):l})}var VB=jB,$B=yI,GB=wI;function qB(e){return function(n){var l;$B.prototype.isPrototypeOf(n)?l=n:l=GB(n);var h=Object.create(e);return h.client=l,h}}var WB=qB,AI=yh,tn=DB,r_=BB,CI=VB,ZB=WB,kx={},II=["country","region","postcode","district","place","locality","neighborhood","address","poi","poi.landmark"];kx.forwardGeocode=function(e){tn.assertShape({query:tn.required(tn.string),mode:tn.oneOf("mapbox.places","mapbox.places-permanent"),countries:tn.arrayOf(tn.string),proximity:tn.oneOf(tn.coordinates,"ip"),types:tn.arrayOf(tn.oneOf(II)),autocomplete:tn.boolean,bbox:tn.arrayOf(tn.number),limit:tn.number,language:tn.arrayOf(tn.string),routing:tn.boolean,fuzzyMatch:tn.boolean,worldview:tn.string})(e),e.mode=e.mode||"mapbox.places";var n=CI(AI({country:e.countries},r_(e,["proximity","types","autocomplete","bbox","limit","language","routing","fuzzyMatch","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:r_(e,["mode","query"]),query:n})};kx.reverseGeocode=function(e){tn.assertShape({query:tn.required(tn.coordinates),mode:tn.oneOf("mapbox.places","mapbox.places-permanent"),countries:tn.arrayOf(tn.string),types:tn.arrayOf(tn.oneOf(II)),bbox:tn.arrayOf(tn.number),limit:tn.number,language:tn.arrayOf(tn.string),reverseMode:tn.oneOf("distance","score"),routing:tn.boolean,worldview:tn.string})(e),e.mode=e.mode||"mapbox.places";var n=CI(AI({country:e.countries},r_(e,["country","types","bbox","limit","language","reverseMode","routing","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:r_(e,["mode","query"]),query:n})};var HB=ZB(kx),XB=self.crypto||self.msCrypto,Mx="-_",ol=36;for(;ol--;)Mx+=ol.toString(36);ol=36;for(;ol---10;)Mx+=ol.toString(36).toUpperCase();var KB=function(e){var n="",l=XB.getRandomValues(new Uint8Array(e||21));for(ol=e||21;ol--;)n+=Mx[l[ol]&63];return n},YB=KB;function kI(e){this.origin=e.origin||"https://api.mapbox.com",this.endpoint="events/v2",this.access_token=e.accessToken,this.version="0.2.0",this.sessionID=this.generateSessionID(),this.userAgent=this.getUserAgent(),this.options=e,this.send=this.send.bind(this),this.countries=e.countries?e.countries.split(","):null,this.types=e.types?e.types.split(","):null,this.bbox=e.bbox?e.bbox:null,this.language=e.language?e.language.split(","):null,this.limit=e.limit?+e.limit:null,this.locale=navigator.language||null,this.enableEventLogging=this.shouldEnableLogging(e),this.eventQueue=new Array,this.flushInterval=e.flushInterval||1e3,this.maxQueueSize=e.maxQueueSize||100,this.timer=this.flushInterval?setTimeout(this.flush.bind(this),this.flushInterval):null,this.lastSentInput="",this.lastSentIndex=0}kI.prototype={select:function(e,n){var l=this.getSelectedIndex(e,n),h=this.getEventPayload("search.select",n);if(h.resultIndex=l,h.resultPlaceName=e.place_name,h.resultId=e.id,!(l===this.lastSentIndex&&h.queryString===this.lastSentInput||l==-1)&&(this.lastSentIndex=l,this.lastSentInput=h.queryString,!!h.queryString))return this.push(h)},start:function(e){var n=this.getEventPayload("search.start",e);if(n.queryString)return this.push(n)},keyevent:function(e,n){if(e.key&&!(e.metaKey||[9,27,37,39,13,38,40].indexOf(e.keyCode)!==-1)){var l=this.getEventPayload("search.keystroke",n);if(l.lastAction=e.key,!!l.queryString)return this.push(l)}},send:function(e,n){if(!this.enableEventLogging)return n?n():void 0;var l=this.getRequestOptions(e);this.request(l,(function(h){if(h)return this.handleError(h,n);if(n)return n()}).bind(this))},getRequestOptions:function(e){Array.isArray(e)||(e=[e]);var n={method:"POST",host:this.origin,path:this.endpoint+"?access_token="+this.access_token,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)};return n},getEventPayload:function(e,n){var l;n.options.proximity?l=[n.options.proximity.longitude,n.options.proximity.latitude]:l=null;var h=n._map?n._map.getZoom():void 0,m={event:e,created:+new Date,sessionIdentifier:this.sessionID,country:this.countries,userAgent:this.userAgent,language:this.language,bbox:this.bbox,types:this.types,endpoint:"mapbox.places",autocomplete:n.options.autocomplete,fuzzyMatch:n.options.fuzzyMatch,proximity:l,limit:n.options.limit,routing:n.options.routing,worldview:n.options.worldview,mapZoom:h,keyboardLocale:this.locale};return e==="search.select"?m.queryString=n.inputString:e!="search.select"&&n._inputEl?m.queryString=n._inputEl.value:m.queryString=n.inputString,m},request:function(e,n){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(this.readyState==4)return this.status==204?n(null):n(this.statusText)},l.open(e.method,e.host+"/"+e.path,!0);for(var h in e.headers){var m=e.headers[h];l.setRequestHeader(h,m)}l.send(e.body)},handleError:function(e,n){if(n)return n(e)},generateSessionID:function(){return YB()},getUserAgent:function(){return"mapbox-gl-geocoder."+this.version+"."+navigator.userAgent},getSelectedIndex:function(e,n){if(n._typeahead){var l=n._typeahead.data,h=e.id,m=l.map(function(E){return E.id}),v=m.indexOf(h);return v}},shouldEnableLogging:function(e){return!(e.enableEventLogging===!1||e.origin&&e.origin.indexOf("api.mapbox.com")==-1||e.localGeocoder||e.filter)},flush:function(){this.eventQueue.length>0&&(this.send(this.eventQueue),this.eventQueue=new Array),this.timer&&clearTimeout(this.timer),this.flushInterval&&(this.timer=setTimeout(this.flush.bind(this),this.flushInterval))},push:function(e,n){this.eventQueue.push(e),(this.eventQueue.length>=this.maxQueueSize||n)&&this.flush()},remove:function(){this.flush()}};var JB=kI,QB={de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"לחפש",ja:"サーチ",lv:"Meklēt",pt:"Procurar",sr:"Претрага",zh:"搜索",cs:"Vyhledávání",hu:"Keresés",ka:"ძიება",nb:"Søke",sk:"Vyhľadávanie",th:"ค้นหา",fi:"Hae",is:"Leita",ko:"수색",pl:"Szukaj",sl:"Iskanje",fa:"جستجو",ru:"Поиск"},eF={placeholder:QB},MI={exports:{}};(function(e){(function(n,l,h){e.exports?e.exports=h():n[l]=h()})(Go,"subtag",function(){var n="",l=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;function h(k){return k.match(l)||[]}function m(k){return h(k).filter(function(D,V){return D&&V})}function v(k){return k=h(k),{language:k[1]||n,extlang:k[2]||n,script:k[3]||n,region:k[4]||n}}function E(k,D,V){Object.defineProperty(k,D,{value:V,enumerable:!0})}function s(k,D,V){function G(J){return h(J)[k]||n}E(G,"pattern",D),E(v,V,G)}return s(1,/^[a-zA-Z]{2,3}$/,"language"),s(2,/^[a-zA-Z]{3}$/,"extlang"),s(3,/^[a-zA-Z]{4}$/,"script"),s(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,"region"),E(v,"split",m),v})})(MI);var tF=MI.exports,nF=h4,rF=k4,lc=yh,iF=O4.EventEmitter,PT=B4,zT=xB,LT=HB,oF=JB,sF=eF,aF=tF;const $a={FORWARD:0,LOCAL:1,REVERSE:2};function PI(e){this._eventEmitter=new iF,this.options=lc({},this.options,e),this.inputString="",this.fresh=!0,this.lastSelected=null}PI.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,minLength:2,reverseGeocode:!1,limit:5,origin:"https://api.mapbox.com",enableEventLogging:!0,marker:!0,mapboxgl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,getItemValue:function(e){return e.place_name},render:function(e){var n=e.place_name.split(",");return'
'+n[0]+'
'+n.splice(1,n.length).join(",")+"
"}},addTo:function(e){function n(l,h){if(!document.body.contains(h))throw new Error("Element provided to #addTo() exists, but is not in the DOM");const m=l.onAdd();h.appendChild(m)}if(e._controlContainer)e.addControl(this);else if(e instanceof HTMLElement)n(this,e);else if(typeof e=="string"){const l=document.querySelectorAll(e);if(l.length===0)throw new Error("Element ",e,"not found.");if(l.length>1)throw new Error("Geocoder can only be added to a single html element");n(this,l[0])}else throw new Error("Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element")},onAdd:function(e){if(e&&typeof e!="string"&&(this._map=e),this.setLanguage(),this.options.localGeocoderOnly||(this.geocoderService=LT(zT({accessToken:this.options.accessToken,origin:this.options.origin}))),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this.eventManager=new oF(this.options),this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this);var n=this.container=document.createElement("div");n.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl";var l=this.createIcon("search",'');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",rF(this._onKeyDown,200)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton),this._inputEl.addEventListener("keyup",(function(v){this.eventManager.keyevent(v,this)}).bind(this));var h=document.createElement("div");h.classList.add("mapboxgl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button";var m=this.createIcon("close",'');return this._clearEl.appendChild(m),this._loadingEl=this.createIcon("loading",''),h.appendChild(this._clearEl),h.appendChild(this._loadingEl),n.appendChild(l),n.appendChild(this._inputEl),n.appendChild(h),this._typeahead=new nF(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit}),this.setRenderFunction(this.options.render),this._typeahead.getItemValue=this.options.getItemValue,this.mapMarker=null,this._handleMarker=this._handleMarker.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._mapboxgl=this.options.mapboxgl,!this._mapboxgl&&this.options.marker&&(console.error("No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl."),this.options.marker=!1)),n},createIcon:function(e,n){var l=document.createElementNS("http://www.w3.org/2000/svg","svg");if(l.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+e),l.setAttribute("viewBox","0 0 18 18"),l.setAttribute("xml:space","preserve"),l.setAttribute("width",18),l.setAttribute("height",18),"innerHTML"in l)l.innerHTML=n;else{var h=document.createElement("div");h.innerHTML=""+n.valueOf().toString()+"";var m=h.firstChild,v=m.firstChild;l.appendChild(v)}return l},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_onPaste:function(e){var n=(e.clipboardData||window.clipboardData).getData("text");n.length>=this.options.minLength&&this._geocode(n)},_onKeyDown:function(e){var n=27,l=9;if(e.keyCode===n&&this.options.clearAndBlurOnEsc)return this._clear(e),this._inputEl.blur();var h=e.target&&e.target.shadowRoot?e.target.shadowRoot.activeElement:e.target,m=h?h.value:"";if(!m)return this.fresh=!0,e.keyCode!==l&&this.clear(e),this._clearEl.style.display="none";e.metaKey||[l,n,37,39,13,38,40].indexOf(e.keyCode)!==-1||h.value.length>=this.options.minLength&&this._geocode(h.value)},_showButton:function(){this._typeahead.selected&&(this._clearEl.style.display="block")},_hideButton:function(){this._typeahead.selected&&(this._clearEl.style.display="none")},_onBlur:function(e){this.options.clearOnBlur&&this._clearOnBlur(e),this.options.collapsed&&this._collapse()},_onChange:function(){var e=this._typeahead.selected;if(e&&JSON.stringify(e)!==this.lastSelected){if(this._clearEl.style.display="none",this.options.flyTo){var n;if(e.properties&&PT[e.properties.short_code])n=lc({},this.options.flyTo),this._map&&this._map.fitBounds(PT[e.properties.short_code].bbox,n);else if(e.bbox){var l=e.bbox;n=lc({},this.options.flyTo),this._map&&this._map.fitBounds([[l[0],l[1]],[l[2],l[3]]],n)}else{var h={zoom:this.options.zoom};n=lc({},h,this.options.flyTo),e.center?n.center=e.center:e.geometry&&e.geometry.type&&e.geometry.type==="Point"&&e.geometry.coordinates&&(n.center=e.geometry.coordinates),this._map&&this._map.flyTo(n)}}this.options.marker&&this._mapboxgl&&this._handleMarker(e),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(e),this._eventEmitter.emit("result",{result:e}),this.eventManager.select(e,this)}},_requestType:function(e,n){var l;const h=/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)[ ]*$/;return e.localGeocoderOnly?l=$a.LOCAL:e.reverseGeocode&&h.test(n)?l=$a.REVERSE:l=$a.FORWARD,l},_setupConfig:function(e,n){const l=["bbox","limit","proximity","countries","types","language","reverseMode","mode","autocomplete","fuzzyMatch","routing","worldview"],h=/[\s,]+/;var m=this,v=l.reduce(function(s,k){if(m.options[k]===void 0||m.options[k]===null)return s;["countries","types","language"].indexOf(k)>-1?s[k]=m.options[k].split(h):s[k]=m.options[k];const D=typeof m.options[k].longitude=="number"&&typeof m.options[k].latitude=="number";if(k==="proximity"&&D){const V=m.options[k].longitude,G=m.options[k].latitude;s[k]=[V,G]}return s},{});switch(e){case $a.REVERSE:{var E=n.split(h).map(function(s){return parseFloat(s,10)}).reverse();v.types&&v.types[0],v=lc(v,{query:E,limit:1}),["proximity","autocomplete","fuzzyMatch","bbox"].forEach(function(s){s in v&&delete v[s]})}break;case $a.FORWARD:/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)*[ ]*$/.test(n)&&(n=n.replace(/,/g," ")),v=lc(v,{query:n});break}return v},_geocode:function(e){this.inputString=e,this._loadingEl.style.display="block",this._eventEmitter.emit("loading",{query:e});const n=this._requestType(this.options,e),l=this._setupConfig(n,e);var h;switch(n){case $a.LOCAL:h=Promise.resolve();break;case $a.FORWARD:h=this.geocoderService.forwardGeocode(l).send();break;case $a.REVERSE:h=this.geocoderService.reverseGeocode(l).send();break}var m=this.options.localGeocoder?this.options.localGeocoder(e)||[]:[],v=[],E=null;return h.catch((function(s){E=s}).bind(this)).then((function(s){this._loadingEl.style.display="none";var k={};return s?s.statusCode=="200"&&(k=s.body,k.request=s.request,k.headers=s.headers):k={type:"FeatureCollection",features:[]},k.config=l,this.fresh&&(this.eventManager.start(this),this.fresh=!1),k.features=k.features?m.concat(k.features):m,this.options.externalGeocoder?(v=this.options.externalGeocoder(e,k.features)||[],v.then(function(D){return k.features=k.features?D.concat(k.features):D,k},function(){return k})):k}).bind(this)).then((function(s){if(E)throw E;this.options.filter&&s.features.length&&(s.features=s.features.filter(this.options.filter)),s.features.length?(this._clearEl.style.display="block",this._eventEmitter.emit("results",s),this._typeahead.update(s.features)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",s))}).bind(this)).catch((function(s){this._loadingEl.style.display="none",m.length&&this.options.localGeocoder||v.length&&this.options.externalGeocoder?(this._clearEl.style.display="block",this._typeahead.update(m)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:m}),this._eventEmitter.emit("error",{error:s})}).bind(this)),h},_clear:function(e){e&&e.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this._onChange(),this._clearEl.style.display="none",this._removeMarker(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(e){this._clear(e),this._inputEl.focus()},_clearOnBlur:function(e){var n=this;e.relatedTarget&&n._clear(e)},_onQueryResult:function(e){var n=e.body;if(n.features.length){var l=n.features[0];this._typeahead.selected=l,this._inputEl.value=l.place_name,this._onChange()}},_updateProximity:function(){if(this._map)if(this._map.getZoom()>9){var e=this._map.getCenter().wrap();this.setProximity({longitude:e.lng,latitude:e.lat})}else this.setProximity(null)},_collapse:function(){!this._inputEl.value&&this._inputEl!==document.activeElement&&this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed")},query:function(e){return this._geocode(e).then(this._onQueryResult),this},_renderError:function(){var e="
There was an error reaching the server
";this._renderMessage(e)},_renderNoResults:function(){var e="
No results found
";this._renderMessage(e)},_renderMessage:function(e){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(e)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var e=this.options.language.split(",")[0],n=aF.language(e),l=sF.placeholder[n];if(l)return l}return"Search"},setInput:function(e){return this._inputEl.value=e,this._typeahead.selected=null,this._typeahead.clear(),e.length>=this.options.minLength&&this._geocode(e),this},setProximity:function(e){return this.options.proximity=e,this},getProximity:function(){return this.options.proximity},setRenderFunction:function(e){return e&&typeof e=="function"&&(this._typeahead.render=e),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(e){var n=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=e||this.options.language||n,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(e){return this.options.zoom=e,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(e){return this.options.flyTo=e,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(e){return this.placeholder=e||this._getPlaceholderText(),this._inputEl.placeholder=this.placeholder,this._inputEl.setAttribute("aria-label",this.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(e){return this.options.bbox=e,this},getCountries:function(){return this.options.countries},setCountries:function(e){return this.options.countries=e,this},getTypes:function(){return this.options.types},setTypes:function(e){return this.options.types=e,this},getMinLength:function(){return this.options.minLength},setMinLength:function(e){return this.options.minLength=e,this._typeahead&&(this._typeahead.options.minLength=e),this},getLimit:function(){return this.options.limit},setLimit:function(e){return this.options.limit=e,this._typeahead&&(this._typeahead.options.limit=e),this},getFilter:function(){return this.options.filter},setFilter:function(e){return this.options.filter=e,this},setOrigin:function(e){return this.options.origin=e,this.geocoderService=LT(zT({accessToken:this.options.accessToken,origin:this.options.origin})),this},getOrigin:function(){return this.options.origin},setAutocomplete:function(e){return this.options.autocomplete=e,this},getAutocomplete:function(){return this.options.autocomplete},setFuzzyMatch:function(e){return this.options.fuzzyMatch=e,this},getFuzzyMatch:function(){return this.options.fuzzyMatch},setRouting:function(e){return this.options.routing=e,this},getRouting:function(){return this.options.routing},setWorldview:function(e){return this.options.worldview=e,this},getWorldview:function(){return this.options.worldview},_handleMarker:function(e){if(this._map){this._removeMarker();var n={color:"#4668F2"},l=lc({},n,this.options.marker);return this.mapMarker=new this._mapboxgl.Marker(l),e.center?this.mapMarker.setLngLat(e.center).addTo(this._map):e.geometry&&e.geometry.type&&e.geometry.type==="Point"&&e.geometry.coordinates&&this.mapMarker.setLngLat(e.geometry.coordinates).addTo(this._map),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},on:function(e,n){return this._eventEmitter.on(e,n),this},off:function(e,n){return this._eventEmitter.removeListener(e,n),this.eventManager.remove(),this}};var lF=PI;const cF=g1(lF);/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */function uF(e){const[n,l]=ut.useState(null),h=Object.assign({},e),m=_h(()=>{const v=new cF(Object.assign(Object.assign({},h),{marker:n||!1,accessToken:h.mapboxAccessToken}));return h.onLoading&&v.on("loading",h.onLoading),h.onResults&&v.on("results",h.onResults),h.onResult&&v.on("result",E=>{var s;h.onResult!==void 0&&h.onResult(E);const{result:k}=E,D=k&&(k.center||((s=k.geometry)===null||s===void 0?void 0:s.type)==="Point"&&k.geometry.coordinates);if(D&&h.marker){const V=typeof h.marker=="object"?h.marker:{};l(ut.createElement(eI,Object.assign({},V,{longitude:D[0],latitude:D[1]})))}else l(null)}),h.onError&&v.on("error",h.onError),v},{position:h.position});return m.hasOwnProperty("_map")&&m._map&&(m.getProximity()!==h.proximity&&h.proximity!==void 0&&m.setProximity(h.proximity),m.getRenderFunction()!==h.render&&h.render!==void 0&&m.setRenderFunction(h.render),m.getLanguage()!==h.language&&h.language!==void 0&&m.setLanguage(h.language),m.getZoom()!==h.zoom&&h.zoom!==void 0&&m.setZoom(h.zoom),m.getFlyTo()!==h.flyTo&&h.flyTo!==void 0&&m.setFlyTo(h.flyTo),m.getPlaceholder()!==h.placeholder&&h.placeholder!==void 0&&m.setPlaceholder(h.placeholder),m.getCountries()!==h.countries&&h.countries!==void 0&&m.setCountries(h.countries),m.getTypes()!==h.types&&h.types!==void 0&&m.setTypes(h.types),m.getMinLength()!==h.minLength&&h.minLength!==void 0&&m.setMinLength(h.minLength),m.getLimit()!==h.limit&&h.limit!==void 0&&m.setLimit(h.limit),m.getFilter()!==h.filter&&h.filter!==void 0&&m.setFilter(h.filter),m.getOrigin()!==h.origin&&h.origin!==void 0&&m.setOrigin(h.origin),m.getAutocomplete()!==h.autocomplete&&h.autocomplete!==void 0&&m.setAutocomplete(h.autocomplete),m.getFuzzyMatch()!==h.fuzzyMatch&&h.fuzzyMatch!==void 0&&m.setFuzzyMatch(h.fuzzyMatch),m.getRouting()!==h.routing&&h.routing!==void 0&&m.setRouting(h.routing),m.getWorldview()!==h.worldview&&h.worldview!==void 0&&m.setWorldview(h.worldview)),n}/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */var hF=8,dF="LIVE - CORI light basemap - county labels",pF={"mapbox:type":"default","mapbox:origin":"light-v10","mapbox:autocomposite":!0,"mapbox:groups":{"1444855769305.6016":{name:"Tunnels",collapsed:!0},"1444855786460.0557":{name:"Roads",collapsed:!0},"1444855799204.86":{name:"Bridges",collapsed:!0},"1444934295202.7542":{name:"Admin boundaries",collapsed:!1}},"mapbox:sdk-support":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"},"mapbox:uiParadigm":"layers","mapbox:thumb":"data:image/webp;base64,UklGRmAJAABXRUJQVlA4TFQJAAAvO8AOAPX4drZtmWTXts7/wMzUqCCLGZOCMjCzbfx/1jFYYr9m+zeF5Gqx8bj3bozqqoouhWLj6dCYQqn+K1W6Vb1HB+Nn+HqXMatDQowkSVJTM/xwkv+mwu1OF8S2kRxJ7PyjfbMzs6a7+j8Be9jFwDSO7Za6ajtXwy/CHsEeYqSRsWzFQAbkSKlndkzfLGcN0zHLlJYZyNmbaOFmTdM0apq3d+t5Y906dr68rJ16zskdY1kaCWdraPJQE8CKlJazrjk+nrVM2/y0Q8ZpQtFux7BmD3bG8fxnncEJvUfnnPObbeMBsKIKWwJLA5PS8njL3DLP4CPmpnkG4+PxuFaBT22n9wiwUuTNx93WpXE+s4bmwJJyWCFwVAX3SJuMZ8fb5ic/uYKb5qc/HY+XqSvlgEmPIYI91BF5/X6fOW3Hpn0x7BGCGMgOIUVMAPdLSmn8xk/+ddM0zT/NUlqmDDhHT0NSj4pzfDEiNh53M7rOC/ElKUxkESgctcF75jilNBuP35gtU2kUjLo1fQicFbF5v7lCb488VM7WALsaKYd2zVFMDJBTSmn50/F4uY8oH9g2dlja+Pv3HebWDpZz2CAZV8BymTpIaTYb/3SZ9qXU6tvEuVU4hpI2Xye6NVcGNl5gQmAtIFJK47Qcj4/vYUcXT2V/e+hiR0dKjfeJAXNqGGNjZyGHYGhSSrPZcjkbH+83Acwe6dm7BBtfXc6umi7y9rHj4OwwIMkKSw5gmVJqm/FsNhvPlmlc+PcAb+MGLpNvvzvdHEb//8OovHFcQ+Yq/v9FAAPYcsiPFeA6pdTGbLkcz8YpXVyWKaW1nwkYRs7diBfOOr8KN/XMr5rQ0a5ZP9bB2pgIyCgcIBlYpJT6JqXl+HicUjv5Y0rp+jbBBm1ktlJfyo4HjVCu55uvNWTWNgGEcRjHAhvXJeOfjmep/JFd4HvbAxzyF3Odt55noJNjJLBCyEgTLJk6peO0PB7PlmVLsAG10hVYoHr+7tb9Xnc+Gq9LkmUp5EAAOaWOWc5mhcmkYAH+9Y69oGxQ5rm+/blu2ZcnO8ieP+xiF/UnHn5CsSdvpGRwWo4fz5bj8QTIKdUqxA4DhjDSXN3bt/Ha18gPbdnClr2jx9/+C/GJd2vFG1e2C6uWywDw0KQAUNdOEHYNtdW/9Ppr//pCNFKyMNiw+I5lm+I8GpNlnQuACwNyDES2sNDdYzNgTqQqy4CycbYlyn/fGMJR56jXN5Bxl/k8lnLsCjmL/zgc0lfHoSnKIiaEXOZssAXrI0t7EE3HQLYenf4V9p3x7Le+duJxX2Uu4IN6w2A8AvZRYLMfBfv7gOs6f/4Qh9THjV3bkxx+9L5vzc/c983rz+06z4+BKDFWCKySTMgGEOW5ydRzy6pCJj76rcn68b9LrtNns3fqsW0A+cjYLlkRkjH3+nFcfyKbqtCX7v4vzs98Z5ulUMGaHrGvbYdldC/acUDMI+ogY9183D4xWa0atXp1Br1lYw5HKnGOiHB2CO/nHtr6vCTlx0cmz3Gsv3eHObHhVctqJNe877Ab7FbtEc2e1A6XKBS5tkS5X360Y9aVjhVZn9gJGwSNx7N9/c6ZCgLgO3R6exWZUku4tlww9q0U0NLnbVRPI7tw57hOOqLMqjr1TIaJXRYSZIVsii+vgOg4skLzlWTD3c//qfA+yp242/sFnDDP4So+huswWBjmlsucf4/xnfEEj8BG783+2+m1R/Cwpne5evS5sQcLGVuteLpeZ7t/G9xbff0Z2zLAfWyKHbTUtLDN0QHWoN5OvctX2717l9Pva6cXffKx4bCViTpG+tVNnNTa5To8WwdB2UMAAw2Zon5/ALs1zbroWo0Y4X6velAf1fMDOyYxtTE8CTd9B3XbZaOa7TodvmY9vT4jvkIrjFmfqvz74xFhs1bO88CeoLNJpRweGiaO6s0RMyD5SJu+O73drb1VV6tOo9aXe3UGdR4CQ54G9w7T69Pt06SzDDx8Hqf1kXqv+rVsSi2rSZ6bubRsjXZYAOrTBwatmpl3mvaI2tXLv/+bbsw9QFv16qXf50bdXd7OZbV7/XOnV6/3p9ml79Y1ZDzSwgXLPLmji9aluLFNAQ9oAxZdfaknii934lsv8XK2bcAjuF9Pr6/O5W/1a0BhTB523M/AWetlA3tmaFOmXUO5w1i2AQLY0+L3n6c4MEOlxchsfJZ6hhtxcSoAnriA7AlgABsJMGZOcfFHk+sMho1j6TdNfOzUi6rwNkXLqsFl2GDLMjmA36dexbYL3nzu+M2J8ZIFfPpBwZZCtilmwEVh+P79qDeifhpzKNl4Pvdv2mupHWSAAUPx+47wnrFx4b4NBocBs4uqJf0XpTady3fw3Mhy/nZW2/5EGHBYVRgb3IEpWqZ0BlsZA7aFW5fuMyencAAHhvuQ8ye+/fD/fvUw4/vvtso8oiDLYLhPX08oOgYl4u6xhubkBMIc/hqo+UQYYmWxr3MIq5CJN2mq5wDKOdew+XfldefSRoX6NZKV69dHAMXLeD/AddTuqU85SNTfH1s4fAR07k8ekrXJlWXqeDtMNhXYR0F5VQKOHGHxcnyJ79kMC/ousDIHp7Zm2CMaCsbK1psuubIKWlaZrZyzye1oO4cmYwCZty45t7eYTIB/AiMHWlV+U9yrjE3k/E/yv9chv6lqOrXQ2oyrr1lzZ8DyAuNQR28WDBhTqMAR7/7MEACWb5ubKeJ7VUxdW8haAAK7otSADZji39Rd2pUKxPyjO8HTp+AHDmFccMG5BLBsF7xYrOIWzjJtvVtw/sKHF/sLgL9vCYxs4YKHZh8Zm1U1nZqa/PTXBuwdMiLP7OLgrULXSAaBsYRs38GW/rtgyWyMlV9EMSMdAKtGqu7Td3BzPBgxAOrjqKZ0wj16DETYvrZc31VRqj24OoBzp4u7vpT7zvk4OqBEuT4seAG4DFeWbLQ+9ZJclv13AxI8+yvIA/qFKR+AwSIfCVAFYJdAoG99F0uAASJ+7Xi5EzjuZk6s0hOYTLCZqwIsl4NhOjk0QLgQkevcYqaLo5VxjzyzJ/ltOJTB8wgDqICNVX3/cUwBt5OcFdkG/4OAbDbok6v49AOAgnrQJKaTmMi5qmKxcLBaev4vkeePDFjAp+cUg2cm51YN1WMoN56HKE4rgx0vnz19+Fc/ub79ZLILKw5pa4UxHOSSqQE="},fF=[-72.26808525539167,43.37747275058169],mF=10.873762090608595,gF=0,_F=2,yF={composite:{url:"mapbox://mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v8,ruralinno.2pv0vm2z,ruralinno.3v9y79ly,ruralinno.5639ssfg,ruralinno.c504wkuy,ruralinno.7stpbs93,ruralinno.cwz2k5qc,ruralinno.1joudpqe",type:"vector"}},vF="mapbox://sprites/ruralinno/cl010e7b7001p15pe3l0306hv/68n9slz9mfbus83an19oqbf32",xF="mapbox://fonts/ruralinno/{fontstack}/{range}.pbf",wF=[{id:"land",type:"background",layout:{},paint:{"background-color":"hsl(55, 0%, 100%)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",maxzoom:7,layout:{},paint:{"fill-color":"hsl(0, 0%, 100%)","fill-opacity":["interpolate",["exponential",1.5],["zoom"],2,.1,7,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",minzoom:5,filter:["==",["get","class"],"national_park"],layout:{},paint:{"fill-color":"hsla(150, 6%, 93%, 0.63)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.5]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",minzoom:5,filter:["match",["get","class"],["park","airport","glacier","pitch","sand"],!0,!1],layout:{},paint:{"fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,["match",["get","class"],"glacier",.5,1]],"fill-color":"hsl(150, 0%, 100%)"}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",layout:{},paint:{"fill-translate-anchor":"viewport","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-color":"hsl(185, 7%, 73%)"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":"round"},paint:{"line-color":"hsl(187, 9%, 81%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",layout:{},paint:{"fill-color":"#cad2d3","fill-opacity":.5}},{id:"hillshade",type:"fill",source:"composite","source-layer":"hillshade",minzoom:6,layout:{},paint:{"fill-color":["match",["get","class"],"shadow","hsl(0, 0%, 35%)","hsl(0, 0%, 100%)"],"fill-opacity":["interpolate",["linear"],["zoom"],12,["match",["get","level"],[67,56],.02,[89,78],.01,.015],15,0]}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",minzoom:21.1,filter:["all",["==",["geometry-type"],"Polygon"],["==",["get","class"],"land"]],layout:{},paint:{"fill-color":"hsl(156, 20%, 95%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"land"]],layout:{"line-cap":"round"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(156, 20%, 95%)"}},{id:"aeroway-polygon",type:"fill",source:"composite","source-layer":"aeroway",minzoom:11,filter:["all",["==",["geometry-type"],"Polygon"],["match",["get","type"],["runway","taxiway","helipad"],!0,!1]],layout:{},paint:{"fill-opacity":["interpolate",["linear"],["zoom"],11,0,11.5,1],"fill-color":"hsl(0, 0%, 97%)"}},{id:"aeroway-line",type:"line",source:"composite","source-layer":"aeroway",minzoom:9,filter:["==",["geometry-type"],"LineString"],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],9,["match",["get","type"],"runway",1,.5],18,["match",["get","type"],"runway",80,20]],"line-color":"hsl(0, 0%, 97%)"}},{id:"building-outline",type:"line",source:"composite","source-layer":"building",minzoom:15,filter:["all",["!=",["get","type"],"building:part"],["==",["get","underground"],"false"]],layout:{},paint:{"line-color":"hsl(55, 3%, 87%)","line-width":["interpolate",["exponential",1.5],["zoom"],15,.75,20,3],"line-opacity":["interpolate",["linear"],["zoom"],15,0,16,1]}},{id:"building",type:"fill",source:"composite","source-layer":"building",minzoom:15,filter:["all",["!=",["get","type"],"building:part"],["==",["get","underground"],"false"]],layout:{},paint:{"fill-outline-color":"hsl(55, 3%, 87%)","fill-opacity":["interpolate",["linear"],["zoom"],15,0,16,1],"fill-color":"hsl(55, 5%, 91%)"}},{id:"tunnel-street-minor-low",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(185, 7%, 88%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"tunnel-street-minor-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-opacity":["step",["zoom"],0,14,1],"line-dasharray":[3,3]}},{id:"tunnel-primary-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,["match",["get","class"],"primary",1,.75],18,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-dasharray":[3,3]}},{id:"tunnel-major-link-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-dasharray":[3,3]}},{id:"tunnel-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(185, 12%, 89%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-dasharray":[3,3]}},{id:"tunnel-construction",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"construction"],["==",["geometry-type"],"LineString"]],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-color":"hsl(187, 7%, 88%)","line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]]}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"path"],["!=",["get","type"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,18,4],"line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]],"line-color":"hsl(0, 0%, 85%)"}},{id:"tunnel-steps",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 85%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"tunnel-major-link",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(187, 7%, 88%)"}},{id:"tunnel-pedestrian",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(187, 7%, 88%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"tunnel-street-minor",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(187, 7%, 88%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"tunnel-primary-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(187, 7%, 88%)"}},{id:"tunnel-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855769305.6016"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"tunnel"],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(187, 7%, 88%)"}},{id:"road-pedestrian-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"pedestrian"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,14.5],"line-color":"hsl(156, 12%, 92%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-minor-low",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"road-street-low",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"road-minor-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-opacity":["step",["zoom"],0,14,1]}},{id:"road-street-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-opacity":["step",["zoom"],0,14,1]}},{id:"road-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9.3,filter:["all",["match",["get","class"],["secondary","tertiary"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,.75,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.1,18,26]}},{id:"road-primary-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9.9,filter:["all",["==",["get","class"],"primary"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32]}},{id:"road-major-link-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:10,filter:["all",["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-opacity":["step",["zoom"],0,11,1]}},{id:"road-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:8.5,filter:["all",["match",["get","class"],["motorway","trunk"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-opacity":["step",["zoom"],["match",["get","class"],"motorway",1,0],6,1]}},{id:"road-construction",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","class"],"construction"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]]}},{id:"road-path",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"path"],["step",["zoom"],["!",["match",["get","type"],["steps","sidewalk","crossing"],!0,!1]],16,["!=",["get","type"],"steps"]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],13,.5,14,1,15,1,18,4],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]]}},{id:"road-steps",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","type"],"steps"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"road-major-link",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:10,filter:["all",["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"road-pedestrian",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:12,filter:["all",["==",["get","class"],"pedestrian"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"road-minor",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["step",["zoom"],["==",["get","class"],"track"],14,["match",["get","class"],["track","secondary_link","tertiary_link","service"],!0,!1]],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,["match",["get","class"],"track",1,.5],18,12],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-street",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:11,filter:["all",["match",["get","class"],["street","street_limited","primary_link"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"road-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",filter:["all",["match",["get","class"],["secondary","tertiary"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.1,18,22],"line-color":"hsl(0, 0%, 100%)"}},{id:"road-primary",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:9,filter:["all",["==",["get","class"],"primary"],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"#f6eac1","line-opacity":["interpolate",["linear"],["zoom"],6,0,8,["match",["get","class"],["trunk"],.2,0],16,["match",["get","class"],["trunk"],1,.81]]}},{id:"road-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:8,filter:["all",["match",["get","class"],["motorway","trunk"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.5,18,32],"line-color":["match",["get","class"],["motorway"],"hsl(26, 100%, 68%)","#f2d163"],"line-opacity":["interpolate",["linear"],["zoom"],6,["match",["get","class"],["trunk"],.3,0],8,.4,18,.7]}},{id:"road-rail",type:"line",metadata:{"mapbox:group":"1444855786460.0557"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["match",["get","class"],["major_rail","minor_rail"],!0,!1],["match",["get","structure"],["none","ford"],!0,!1]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,20,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-pedestrian-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,14.5],"line-opacity":["step",["zoom"],0,14,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-street-minor-low",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],1,14,0]}},{id:"bridge-street-minor-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-opacity":["step",["zoom"],0,14,1],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-primary-secondary-tertiary-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,["match",["get","class"],"primary",1,.75],18,2],"line-opacity":["step",["zoom"],0,10,1],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-major-link-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-motorway-trunk-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway","trunk"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-construction",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"construction"],["==",["geometry-type"],"LineString"]],layout:{},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,2,18,18],"line-dasharray":["step",["zoom"],["literal",[.4,.8]],15,["literal",[.3,.6]],16,["literal",[.2,.3]],17,["literal",[.2,.25]],18,["literal",[.15,.15]]],"line-color":"hsl(156, 0%, 100%)"}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"path"],["!=",["get","type"],"steps"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,18,4],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[1,.5]]]}},{id:"bridge-steps",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:14,filter:["all",["==",["get","type"],"steps"],["==",["get","structure"],"bridge"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],15,1,16,1.6,18,6],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.75,1]],16,["literal",[1,.75]],17,["literal",[.3,.3]]]}},{id:"bridge-major-link",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-pedestrian",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["==",["get","class"],"pedestrian"],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,18,12],"line-color":"hsl(0, 0%, 100%)","line-dasharray":["step",["zoom"],["literal",[1,0]],15,["literal",[1.5,.4]],16,["literal",[1,.2]]]}},{id:"bridge-street-minor",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["step",["zoom"],["match",["get","class"],["street","street_limited","track","primary_link"],!0,!1],14,["match",["get","class"],["street","street_limited","track","primary_link","secondary_link","tertiary_link","service"],!0,!1]],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,["match",["get","class"],["street","street_limited","primary_link"],2,"track",1,.5],18,["match",["get","class"],["street","street_limited","primary_link"],18,12]],"line-color":"hsl(0, 0%, 100%)","line-opacity":["step",["zoom"],0,14,1]}},{id:"bridge-primary-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["primary","secondary","tertiary"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,["match",["get","class"],"primary",.75,.1],18,["match",["get","class"],"primary",32,26]],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-motorway-trunk",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["motorway","trunk"],!0,!1],["<=",["get","layer"],1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-rail",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],["match",["get","class"],["major_rail","minor_rail"],!0,!1]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],14,.5,20,1],"line-color":"hsl(156, 12%, 92%)"}},{id:"bridge-major-link-2-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.75,20,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18]}},{id:"bridge-motorway-trunk-2-case",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],10,1,18,2],"line-color":"hsl(156, 12%, 92%)","line-gap-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32]}},{id:"bridge-major-link-2",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway_link","trunk_link"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],12,.5,14,2,18,18],"line-color":"hsl(0, 0%, 100%)"}},{id:"bridge-motorway-trunk-2",type:"line",metadata:{"mapbox:group":"1444855799204.86"},source:"composite","source-layer":"road",minzoom:13,filter:["all",["==",["get","structure"],"bridge"],[">=",["get","layer"],2],["match",["get","class"],["motorway","trunk"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":["interpolate",["exponential",1.5],["zoom"],5,.75,18,32],"line-color":"hsl(0, 0%, 100%)"}},{id:"admin-1-boundary-bg",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",filter:["all",["==",["get","admin_level"],1],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"bevel"},paint:{"line-blur":["interpolate",["linear"],["zoom"],3,0,8,3],"line-width":["interpolate",["linear"],["zoom"],7,3.75,12,5.5],"line-opacity":["interpolate",["linear"],["zoom"],7,0,8,.75],"line-dasharray":[1,0],"line-translate":[0,0],"line-color":"hsl(0, 0%, 84%)"}},{id:"admin-0-boundary-bg",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,3.5,10,8],"line-color":"hsl(0, 0%, 84%)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-translate":[0,0],"line-blur":["interpolate",["linear"],["zoom"],3,0,10,2]}},{id:"admin-1-boundary",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",filter:["all",["==",["get","admin_level"],1],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["linear"],["zoom"],7,.75,12,1.5],"line-opacity":["interpolate",["linear"],["zoom"],2,0,3,1],"line-color":["interpolate",["linear"],["zoom"],3,"hsl(0, 0%, 80%)",7,"hsl(0, 0%, 70%)"]}},{id:"admin-0-boundary",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 62%)","line-width":["interpolate",["linear"],["zoom"],3,.5,10,2]}},{id:"admin-0-boundary-disputed",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"admin",minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","US"],!0,!1]],layout:{"line-join":"round"},paint:{"line-dasharray":[1.5,1.5],"line-color":"hsl(0, 0%, 62%)","line-width":["interpolate",["linear"],["zoom"],3,.5,10,2]}},{id:"county_border",type:"line",metadata:{"mapbox:group":"1444934295202.7542"},source:"composite","source-layer":"attr_county_labels_pg-155yvu",minzoom:6,maxzoom:12,paint:{"line-width":["interpolate",["linear"],["zoom"],5,.5,9,1.7,18,2],"line-color":"hsl(0, 0%, 59%)","line-opacity":["interpolate",["linear"],["zoom"],5,.2,9,.5,18,1]}},{id:"cousub_border",type:"line",source:"composite","source-layer":"attr_cousub_labels_less_pl-9lemol",minzoom:8,maxzoom:14,layout:{},paint:{"line-color":"hsl(0, 3%, 38%)","line-width":["interpolate",["linear"],["zoom"],0,1,6,1,22,1],"line-opacity":["interpolate",["linear"],["zoom"],7,.1,18,.2]}},{id:"place_border",type:"line",source:"composite","source-layer":"attr_place_labels_less_pl-0n1bxr",minzoom:8,maxzoom:14,paint:{"line-color":"hsla(0, 0%, 58%, 0.62)","line-dasharray":[3,2]}},{id:"road-label",type:"symbol",source:"composite","source-layer":"road",minzoom:10,filter:["step",["zoom"],["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],!0,!1],12,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary","pedestrian","street","street_limited"],!0,!1],15,["match",["get","class"],["ferry","golf","path"],!1,!0]],layout:{"text-size":["interpolate",["linear"],["zoom"],10,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],10,["motorway_link","trunk_link","primary_link","secondary_link","tertiary_link","pedestrian","street","street_limited"],9,6.5],18,["match",["get","class"],["motorway","trunk","primary","secondary","tertiary"],16,["motorway_link","trunk_link","primary_link","secondary_link","tertiary_link","pedestrian","street","street_limited"],14,13]],"text-max-angle":30,"text-font":["DIN Offc Pro Regular","Arial Unicode MS Regular"],"symbol-placement":"line","text-padding":1,"text-rotation-alignment":"map","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.01},paint:{"text-color":"hsl(0, 0%, 42%)","text-halo-color":["match",["get","class"],["motorway","trunk"],"hsla(0, 0%, 100%, 0.75)","hsl(0, 0%, 100%)"],"text-halo-blur":1,"text-halo-width":.1}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,16],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:4,filter:["all",["match",["get","class"],["glacier","landform"],!0,!1],["==",["geometry-type"],"LineString"],["<=",["get","filterrank"],1]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(0, 0%, 100%)","text-halo-blur":.5,"text-color":"hsl(0, 0%, 42%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland"],!0,!1],["==",["geometry-type"],"Point"],["<=",["get","filterrank"],1]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"text-offset":["literal",[0,0]]},paint:{"text-color":"hsl(0, 0%, 42%)","text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":.5,"text-halo-blur":.5}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],7,["step",["get","sizerank"],24,6,18,12,12],10,["step",["get","sizerank"],18,9,12],18,["step",["get","sizerank"],18,9,16]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water"],!0,!1],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],7,["step",["get","sizerank"],24,6,18,12,12],10,["step",["get","sizerank"],18,9,12]],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10]},paint:{"text-color":"hsl(187, 7%, 51%)"}},{id:"poi-label",type:"symbol",source:"composite","source-layer":"poi_label",minzoom:6,filter:["<=",["get","filterrank"],1],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]]},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":.1,"text-halo-blur":.5,"text-color":["step",["zoom"],["step",["get","sizerank"],"hsl(0, 0%, 66%)",5,"hsl(230, 0%, 56%)"],17,["step",["get","sizerank"],"hsl(0, 0%, 66%)",13,"hsl(0, 0%, 56%)"]]}},{id:"airport-label",type:"symbol",source:"composite","source-layer":"airport_label",minzoom:8,layout:{"text-line-height":1.1,"text-size":["step",["get","sizerank"],18,9,12],"icon-image":["step",["get","sizerank"],["concat",["get","maki"],"-15"],9,["concat",["get","maki"],"-11"]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Regular"],visibility:"none","text-offset":[0,.75],"text-rotation-alignment":"viewport","text-anchor":"top","text-field":["step",["get","sizerank"],["coalesce",["get","name_en"],["get","name"]],15,["get","ref"]],"text-letter-spacing":.01,"text-max-width":9},paint:{"text-color":"hsla(0, 0%, 42%, 0)","text-halo-color":"hsl(0, 0%, 100%)","text-halo-width":1,"text-opacity":0}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",minzoom:10,maxzoom:15,filter:["all",["==",["get","class"],"settlement_subdivision"],["<=",["get","filterrank"],4]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Offc Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.1],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",17,16]],visibility:"none"},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 62%)","text-halo-blur":.5,"text-halo-width":.1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",minzoom:3,maxzoom:9,filter:["==",["get","class"],"state"],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],10,6,9.5,7,9],9,["step",["get","symbolrank"],24,6,18,7,14]],"text-transform":"uppercase","text-font":["DIN Offc Pro Bold","Arial Unicode MS Bold"],"text-field":["step",["zoom"],["step",["get","symbolrank"],["coalesce",["get","name_en"],["get","name"]],5,["coalesce",["get","abbr"],["get","name_en"],["get","name"]]],5,["coalesce",["get","name_en"],["get","name"]]],"text-letter-spacing":.15,"text-max-width":6},paint:{"text-halo-color":"hsl(0, 0%, 100%)","text-color":"hsl(0, 0%, 66%)","text-halo-width":.1}},{id:"county_label",type:"symbol",source:"composite","source-layer":"attr_county_labels-5i5o0f",minzoom:7.5,maxzoom:14,layout:{"text-field":["step",["zoom"],["upcase",["to-string",["get","name"]]],6,["upcase",["to-string",["get","name"]]],10,["upcase",["to-string",["get","namelsad"]]],22,["upcase",["to-string",["get","namelsad"]]]],"text-font":["step",["zoom"],["literal",["Open Sans Regular","Arial Unicode MS Regular"]],6,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],8,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],11,["literal",["Montserrat Medium","Arial Unicode MS Regular"]],22,["literal",["Montserrat Medium","Arial Unicode MS Regular"]]],"text-size":["interpolate",["linear"],["zoom"],0,0,6,6,6.5,10,7.5,14,9,30,11,75,14,85],"text-allow-overlap":["step",["zoom"],!1,5,!1,10,!1,11,!0],"text-max-width":5,"text-ignore-placement":["step",["zoom"],!1,6,!1,9,!0,12,!0,22,!0]},paint:{"text-color":"hsl(0, 0%, 48%)","text-opacity":["interpolate",["linear"],["zoom"],6.49999,1,6.5,.7,8,.3,11,.1,16,.05]}},{id:"cousub_label",type:"symbol",source:"composite","source-layer":"attr_cousub_labels_plus_pt-0kx5lj",minzoom:9,layout:{"text-field":["upcase",["get","display_name"]],"text-size":["interpolate",["linear"],["zoom"],7.9,0,8,8,9,10,14,30],"text-max-width":5,"text-line-height":1.1,visibility:"none"},paint:{"text-color":"hsla(0, 0%, 31%, 0.76)","text-halo-width":10,"text-halo-color":"hsl(0, 0%, 100%)"}},{id:"place-label new",type:"symbol",source:"composite","source-layer":"rural_places-4rf4i9",minzoom:9,filter:["match",["get","census_boundary_year"],[2020],!0,!1],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],15,["step",["get","symbolrank"],28,9,26,10,23,11,21,12,20,13,19,15,17]],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["Montserrat Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","NAME"]],"text-max-width":7},paint:{"text-color":["step",["get","symbolrank"],"hsl(0, 2%, 61%)",11,"hsl(0, 1%, 68%)",16,"hsl(0, 1%, 75%)"],"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1}},{id:"settlement-label",type:"symbol",source:"composite","source-layer":"place_label",maxzoom:10.76,filter:["all",["<=",["get","filterrank"],3],["==",["get","class"],"settlement"],["step",["zoom"],!0,12,[">=",["get","symbolrank"],11],13,[">=",["get","symbolrank"],12]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],15,["step",["get","symbolrank"],28,9,26,10,23,11,21,12,20,13,19,15,17]],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["step",["zoom"],["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]],8,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],11,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],10,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],12,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],11,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],13,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],12,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],15,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],13,["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]]],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],"text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":["step",["get","symbolrank"],"hsl(0, 0%, 42%)",11,"hsl(0, 0%, 55%)",16,"hsl(0, 0%, 62%)"],"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1}},{id:"wwb2s-places_lat_lon",type:"symbol",source:"composite","source-layer":"places_lat_lon-awryh9",minzoom:10.75,maxzoom:20,filter:["all",[">=",["get","pop"],101],[">",["get","pct_rural"],0],["step",["zoom"],!0,13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],13]]],layout:{"text-line-height":1.1,"text-size":["step",["get","symbolrank"],20,9,18,10,16,11,14,12,12],"icon-image":["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],"text-font":["step",["zoom"],["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]],8,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],11,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],10,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],12,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],11,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],13,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],12,["step",["get","symbolrank"],["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]],15,["literal",["DIN Offc Pro Regular","Arial Unicode MS Regular"]]],13,["literal",["DIN Offc Pro Medium","Arial Unicode MS Regular"]]],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],"text-offset":["step",["zoom"],["match",["get","capital"],2,["match",["get","text_anchor"],"bottom",["literal",[0,-.3]],"bottom-left",["literal",[.3,-.1]],"left",["literal",[.45,.1]],"top-left",["literal",[.3,.1]],"top",["literal",[0,.3]],"top-right",["literal",[-.3,.1]],"right",["literal",[-.45,0]],"bottom-right",["literal",[-.3,-.1]],["literal",[0,-.3]]],["match",["get","text_anchor"],"bottom",["literal",[0,-.25]],"bottom-left",["literal",[.2,-.05]],"left",["literal",[.4,.05]],"top-left",["literal",[.2,.05]],"top",["literal",[0,.25]],"top-right",["literal",[-.2,.05]],"right",["literal",[-.4,.05]],"bottom-right",["literal",[-.2,-.05]],["literal",[0,-.25]]]],8,["literal",[0,0]]],"text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","NAME"],["get","name"]],"text-max-width":7},paint:{"text-halo-color":"hsl(0, 0%, 100%)","icon-opacity":["step",["zoom"],1,8,0],"text-halo-blur":1,"text-halo-width":.1,"text-color":["interpolate",["linear"],["zoom"],0,"hsl(0, 0%, 62%)",22,"#000000"],"text-opacity":["interpolate",["linear"],["zoom"],7,0,9,.97,22,1]}},{id:"custom-pattern",type:"fill",source:"composite","source-layer":"attr_county_labels_pg-155yvu",minzoom:6,layout:{visibility:"none"},paint:{"fill-color":"hsla(303, 73%, 74%, 0.66)","fill-pattern":"stripe-4"}}],bF="2022-02-24T13:16:14.872Z",EF="2024-07-11T16:18:50.102Z",TF="cl010e7b7001p15pe3l0306hv",SF="ruralinno",AF="private",CF=!1,IF={version:hF,name:dF,metadata:pF,center:fF,zoom:mF,bearing:gF,pitch:_F,sources:yF,sprite:vF,glyphs:xF,layers:wF,created:bF,modified:EF,id:TF,owner:SF,visibility:AF,protected:!1,draft:CF};/* - * Frontend UI component library for the CORI Data API - * {@link https://github.com/ruralinnovation/cori.data.api} - * @copyright Rural Innovation Strategies, Inc. - * @license ISC - */Object.assign({},IF);function Zp(e){let n="https://mui.com/production-error/?code="+e;for(let l=1;l0?Nr(vh,--Pi):0,uh--,yr===10&&(uh=1,D_--),yr}function Wi(){return yr=Pi2||Xp(yr)>3?"":" "}function GF(e,n){for(;--n&&Wi()&&!(yr<48||yr>102||yr>57&&yr<65||yr>70&&yr<97););return of(e,bg()+(n<6&&ws()==32&&Wi()==32))}function m1(e){for(;Wi();)switch(yr){case e:return Pi;case 34:case 39:e!==34&&e!==39&&m1(yr);break;case 40:e===41&&m1(e);break;case 92:Wi();break}return Pi}function qF(e,n){for(;Wi()&&e+yr!==47+10;)if(e+yr===42+42&&ws()===47)break;return"/*"+of(n,Pi-1)+"*"+R_(e===47?e:Wi())}function WF(e){for(;!Xp(ws());)Wi();return of(e,Pi)}function ZF(e){return BI(Tg("",null,null,null,[""],e=OI(e),0,[0],e))}function Tg(e,n,l,h,m,v,E,s,k){for(var D=0,V=0,G=E,J=0,ve=0,ae=0,me=1,Ce=1,ie=1,te=0,le="",ze=m,Oe=v,Ke=h,He=le;Ce;)switch(ae=te,te=Wi()){case 40:if(ae!=108&&Nr(He,G-1)==58){f1(He+=yn(Eg(te),"&","&\f"),"&\f")!=-1&&(ie=-1);break}case 34:case 39:case 91:He+=Eg(te);break;case 9:case 10:case 13:case 32:He+=$F(ae);break;case 92:He+=GF(bg()-1,7);continue;case 47:switch(ws()){case 42:case 47:rg(HF(qF(Wi(),bg()),n,l),k);break;default:He+="/"}break;case 123*me:s[D++]=_s(He)*ie;case 125*me:case 59:case 0:switch(te){case 0:case 125:Ce=0;case 59+V:ie==-1&&(He=yn(He,/\f/g,"")),ve>0&&_s(He)-G&&rg(ve>32?OT(He+";",h,l,G-1):OT(yn(He," ","")+";",h,l,G-2),k);break;case 59:He+=";";default:if(rg(Ke=DT(He,n,l,D,V,m,s,le,ze=[],Oe=[],G),v),te===123)if(V===0)Tg(He,n,Ke,Ke,ze,v,G,s,Oe);else switch(J===99&&Nr(He,3)===110?100:J){case 100:case 108:case 109:case 115:Tg(e,Ke,Ke,h&&rg(DT(e,Ke,Ke,0,0,m,s,le,m,ze=[],G),Oe),m,Oe,G,s,h?ze:Oe);break;default:Tg(He,Ke,Ke,Ke,[""],Oe,0,s,Oe)}}D=V=ve=0,me=ie=1,le=He="",G=E;break;case 58:G=1+_s(He),ve=ae;default:if(me<1){if(te==123)--me;else if(te==125&&me++==0&&VF()==125)continue}switch(He+=R_(te),te*me){case 38:ie=V>0?1:(He+="\f",-1);break;case 44:s[D++]=(_s(He)-1)*ie,ie=1;break;case 64:ws()===45&&(He+=Eg(Wi())),J=ws(),V=G=_s(le=He+=WF(bg())),te++;break;case 45:ae===45&&_s(He)==2&&(me=0)}}return v}function DT(e,n,l,h,m,v,E,s,k,D,V){for(var G=m-1,J=m===0?v:[""],ve=Lx(J),ae=0,me=0,Ce=0;ae0?J[ie]+" "+te:yn(te,/&\f/g,J[ie])))&&(k[Ce++]=le);return O_(e,n,l,m===0?Px:s,k,D,V)}function HF(e,n,l){return O_(e,n,l,zI,R_(jF()),Hp(e,2,-2),0)}function OT(e,n,l,h){return O_(e,n,l,zx,Hp(e,0,h),Hp(e,h+1,-1),h)}function Qu(e,n){for(var l="",h=Lx(e),m=0;m6)switch(Nr(e,n+1)){case 109:if(Nr(e,n+4)!==45)break;case 102:return yn(e,/(.+:)(.+)-([^]+)/,"$1"+_n+"$2-$3$1"+i_+(Nr(e,n+3)==108?"$3":"$2-$3"))+e;case 115:return~f1(e,"stretch")?FI(yn(e,"stretch","fill-available"),n)+e:e}break;case 4949:if(Nr(e,n+1)!==115)break;case 6444:switch(Nr(e,_s(e)-3-(~f1(e,"!important")&&10))){case 107:return yn(e,":",":"+_n)+e;case 101:return yn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_n+(Nr(e,14)===45?"inline-":"")+"box$3$1"+_n+"$2$3$1"+ei+"$2box$3")+e}break;case 5936:switch(Nr(e,n+11)){case 114:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _n+e+ei+yn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _n+e+ei+e+e}return e}var r6=function(n,l,h,m){if(n.length>-1&&!n.return)switch(n.type){case zx:n.return=FI(n.value,n.length);break;case LI:return Qu([lp(n,{value:yn(n.value,"@","@"+_n)})],m);case Px:if(n.length)return UF(n.props,function(v){switch(NF(v,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Qu([lp(n,{props:[yn(v,/:(read-\w+)/,":"+i_+"$1")]})],m);case"::placeholder":return Qu([lp(n,{props:[yn(v,/:(plac\w+)/,":"+_n+"input-$1")]}),lp(n,{props:[yn(v,/:(plac\w+)/,":"+i_+"$1")]}),lp(n,{props:[yn(v,/:(plac\w+)/,ei+"input-$1")]})],m)}return""})}},i6=[r6],o6=function(n){var l=n.key;if(l==="css"){var h=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(h,function(me){var Ce=me.getAttribute("data-emotion");Ce.indexOf(" ")!==-1&&(document.head.appendChild(me),me.setAttribute("data-s",""))})}var m=n.stylisPlugins||i6,v={},E,s=[];E=n.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+l+' "]'),function(me){for(var Ce=me.getAttribute("data-emotion").split(" "),ie=1;ie{n[l]=VI(e[l])}),n}function ea(e,n,l={clone:!0}){const h=l.clone?Bn({},e):e;return Pu(e)&&Pu(n)&&Object.keys(n).forEach(m=>{Pu(n[m])&&Object.prototype.hasOwnProperty.call(e,m)&&Pu(e[m])?h[m]=ea(e[m],n[m],l):l.clone?h[m]=Pu(n[m])?VI(n[m]):n[m]:h[m]=n[m]}),h}const p6=["values","unit","step"],f6=e=>{const n=Object.keys(e).map(l=>({key:l,val:e[l]}))||[];return n.sort((l,h)=>l.val-h.val),n.reduce((l,h)=>Bn({},l,{[h.key]:h.val}),{})};function m6(e){const{values:n={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:l="px",step:h=5}=e,m=pl(e,p6),v=f6(n),E=Object.keys(v);function s(J){return`@media (min-width:${typeof n[J]=="number"?n[J]:J}${l})`}function k(J){return`@media (max-width:${(typeof n[J]=="number"?n[J]:J)-h/100}${l})`}function D(J,ve){const ae=E.indexOf(ve);return`@media (min-width:${typeof n[J]=="number"?n[J]:J}${l}) and (max-width:${(ae!==-1&&typeof n[E[ae]]=="number"?n[E[ae]]:ve)-h/100}${l})`}function V(J){return E.indexOf(J)+1`@media (min-width:${Rx[e]}px)`};function oa(e,n,l){const h=e.theme||{};if(Array.isArray(n)){const v=h.breakpoints||FT;return n.reduce((E,s,k)=>(E[v.up(v.keys[k])]=l(n[k]),E),{})}if(typeof n=="object"){const v=h.breakpoints||FT;return Object.keys(n).reduce((E,s)=>{if(Object.keys(v.values||Rx).indexOf(s)!==-1){const k=v.up(s);E[k]=l(n[s],s)}else{const k=s;E[k]=n[k]}return E},{})}return l(n)}function y6(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((h,m)=>{const v=e.up(m);return h[v]={},h},{}))||{}}function v6(e,n){return e.reduce((l,h)=>{const m=l[h];return(!m||Object.keys(m).length===0)&&delete l[h],l},n)}function $I(e){if(typeof e!="string")throw new Error(Zp(7));return e.charAt(0).toUpperCase()+e.slice(1)}function F_(e,n,l=!0){if(!n||typeof n!="string")return null;if(e&&e.vars&&l){const h=`vars.${n}`.split(".").reduce((m,v)=>m&&m[v]?m[v]:null,e);if(h!=null)return h}return n.split(".").reduce((h,m)=>h&&h[m]!=null?h[m]:null,e)}function o_(e,n,l,h=l){let m;return typeof e=="function"?m=e(l):Array.isArray(e)?m=e[l]||h:m=F_(e,l)||h,n&&(m=n(m,h,e)),m}function cr(e){const{prop:n,cssProperty:l=e.prop,themeKey:h,transform:m}=e,v=E=>{if(E[n]==null)return null;const s=E[n],k=E.theme,D=F_(k,h)||{};return oa(E,s,G=>{let J=o_(D,m,G);return G===J&&typeof G=="string"&&(J=o_(D,m,`${n}${G==="default"?"":$I(G)}`,G)),l===!1?J:{[l]:J}})};return v.propTypes={},v.filterProps=[n],v}function x6(e){const n={};return l=>(n[l]===void 0&&(n[l]=e(l)),n[l])}const w6={m:"margin",p:"padding"},b6={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},NT={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},E6=x6(e=>{if(e.length>2)if(NT[e])e=NT[e];else return[e];const[n,l]=e.split(""),h=w6[n],m=b6[l]||"";return Array.isArray(m)?m.map(v=>h+v):[h+m]}),Dx=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ox=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Dx,...Ox];function sf(e,n,l,h){var m;const v=(m=F_(e,n,!1))!=null?m:l;return typeof v=="number"?E=>typeof E=="string"?E:v*E:Array.isArray(v)?E=>typeof E=="string"?E:v[E]:typeof v=="function"?v:()=>{}}function GI(e){return sf(e,"spacing",8)}function af(e,n){if(typeof n=="string"||n==null)return n;const l=Math.abs(n),h=e(l);return n>=0?h:typeof h=="number"?-h:`-${h}`}function T6(e,n){return l=>e.reduce((h,m)=>(h[m]=af(n,l),h),{})}function S6(e,n,l,h){if(n.indexOf(l)===-1)return null;const m=E6(l),v=T6(m,h),E=e[l];return oa(e,E,v)}function qI(e,n){const l=GI(e.theme);return Object.keys(e).map(h=>S6(e,n,h,l)).reduce(Tp,{})}function rr(e){return qI(e,Dx)}rr.propTypes={};rr.filterProps=Dx;function ir(e){return qI(e,Ox)}ir.propTypes={};ir.filterProps=Ox;function A6(e=8){if(e.mui)return e;const n=GI({spacing:e}),l=(...h)=>(h.length===0?[1]:h).map(v=>{const E=n(v);return typeof E=="number"?`${E}px`:E}).join(" ");return l.mui=!0,l}function N_(...e){const n=e.reduce((h,m)=>(m.filterProps.forEach(v=>{h[v]=m}),h),{}),l=h=>Object.keys(h).reduce((m,v)=>n[v]?Tp(m,n[v](h)):m,{});return l.propTypes={},l.filterProps=e.reduce((h,m)=>h.concat(m.filterProps),[]),l}function ho(e){return typeof e!="number"?e:`${e}px solid`}function yo(e,n){return cr({prop:e,themeKey:"borders",transform:n})}const C6=yo("border",ho),I6=yo("borderTop",ho),k6=yo("borderRight",ho),M6=yo("borderBottom",ho),P6=yo("borderLeft",ho),z6=yo("borderColor"),L6=yo("borderTopColor"),R6=yo("borderRightColor"),D6=yo("borderBottomColor"),O6=yo("borderLeftColor"),B6=yo("outline",ho),F6=yo("outlineColor"),U_=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const n=sf(e.theme,"shape.borderRadius",4),l=h=>({borderRadius:af(n,h)});return oa(e,e.borderRadius,l)}return null};U_.propTypes={};U_.filterProps=["borderRadius"];N_(C6,I6,k6,M6,P6,z6,L6,R6,D6,O6,U_,B6,F6);const j_=e=>{if(e.gap!==void 0&&e.gap!==null){const n=sf(e.theme,"spacing",8),l=h=>({gap:af(n,h)});return oa(e,e.gap,l)}return null};j_.propTypes={};j_.filterProps=["gap"];const V_=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const n=sf(e.theme,"spacing",8),l=h=>({columnGap:af(n,h)});return oa(e,e.columnGap,l)}return null};V_.propTypes={};V_.filterProps=["columnGap"];const $_=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const n=sf(e.theme,"spacing",8),l=h=>({rowGap:af(n,h)});return oa(e,e.rowGap,l)}return null};$_.propTypes={};$_.filterProps=["rowGap"];const N6=cr({prop:"gridColumn"}),U6=cr({prop:"gridRow"}),j6=cr({prop:"gridAutoFlow"}),V6=cr({prop:"gridAutoColumns"}),$6=cr({prop:"gridAutoRows"}),G6=cr({prop:"gridTemplateColumns"}),q6=cr({prop:"gridTemplateRows"}),W6=cr({prop:"gridTemplateAreas"}),Z6=cr({prop:"gridArea"});N_(j_,V_,$_,N6,U6,j6,V6,$6,G6,q6,W6,Z6);function eh(e,n){return n==="grey"?n:e}const H6=cr({prop:"color",themeKey:"palette",transform:eh}),X6=cr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:eh}),K6=cr({prop:"backgroundColor",themeKey:"palette",transform:eh});N_(H6,X6,K6);function Vi(e){return e<=1&&e!==0?`${e*100}%`:e}const Y6=cr({prop:"width",transform:Vi}),Bx=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const n=l=>{var h,m;const v=((h=e.theme)==null||(h=h.breakpoints)==null||(h=h.values)==null?void 0:h[l])||Rx[l];return v?((m=e.theme)==null||(m=m.breakpoints)==null?void 0:m.unit)!=="px"?{maxWidth:`${v}${e.theme.breakpoints.unit}`}:{maxWidth:v}:{maxWidth:Vi(l)}};return oa(e,e.maxWidth,n)}return null};Bx.filterProps=["maxWidth"];const J6=cr({prop:"minWidth",transform:Vi}),Q6=cr({prop:"height",transform:Vi}),eN=cr({prop:"maxHeight",transform:Vi}),tN=cr({prop:"minHeight",transform:Vi});cr({prop:"size",cssProperty:"width",transform:Vi});cr({prop:"size",cssProperty:"height",transform:Vi});const nN=cr({prop:"boxSizing"});N_(Y6,Bx,J6,Q6,eN,tN,nN);const rN={border:{themeKey:"borders",transform:ho},borderTop:{themeKey:"borders",transform:ho},borderRight:{themeKey:"borders",transform:ho},borderBottom:{themeKey:"borders",transform:ho},borderLeft:{themeKey:"borders",transform:ho},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ho},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:U_},color:{themeKey:"palette",transform:eh},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:eh},backgroundColor:{themeKey:"palette",transform:eh},p:{style:ir},pt:{style:ir},pr:{style:ir},pb:{style:ir},pl:{style:ir},px:{style:ir},py:{style:ir},padding:{style:ir},paddingTop:{style:ir},paddingRight:{style:ir},paddingBottom:{style:ir},paddingLeft:{style:ir},paddingX:{style:ir},paddingY:{style:ir},paddingInline:{style:ir},paddingInlineStart:{style:ir},paddingInlineEnd:{style:ir},paddingBlock:{style:ir},paddingBlockStart:{style:ir},paddingBlockEnd:{style:ir},m:{style:rr},mt:{style:rr},mr:{style:rr},mb:{style:rr},ml:{style:rr},mx:{style:rr},my:{style:rr},margin:{style:rr},marginTop:{style:rr},marginRight:{style:rr},marginBottom:{style:rr},marginLeft:{style:rr},marginX:{style:rr},marginY:{style:rr},marginInline:{style:rr},marginInlineStart:{style:rr},marginInlineEnd:{style:rr},marginBlock:{style:rr},marginBlockStart:{style:rr},marginBlockEnd:{style:rr},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:j_},rowGap:{style:$_},columnGap:{style:V_},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Vi},maxWidth:{style:Bx},minWidth:{transform:Vi},height:{transform:Vi},maxHeight:{transform:Vi},minHeight:{transform:Vi},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Fx=rN;function iN(...e){const n=e.reduce((h,m)=>h.concat(Object.keys(m)),[]),l=new Set(n);return e.every(h=>l.size===Object.keys(h).length)}function oN(e,n){return typeof e=="function"?e(n):e}function sN(){function e(l,h,m,v){const E={[l]:h,theme:m},s=v[l];if(!s)return{[l]:h};const{cssProperty:k=l,themeKey:D,transform:V,style:G}=s;if(h==null)return null;if(D==="typography"&&h==="inherit")return{[l]:h};const J=F_(m,D)||{};return G?G(E):oa(E,h,ae=>{let me=o_(J,V,ae);return ae===me&&typeof ae=="string"&&(me=o_(J,V,`${l}${ae==="default"?"":$I(ae)}`,ae)),k===!1?me:{[k]:me}})}function n(l){var h;const{sx:m,theme:v={}}=l||{};if(!m)return null;const E=(h=v.unstable_sxConfig)!=null?h:Fx;function s(k){let D=k;if(typeof k=="function")D=k(v);else if(typeof k!="object")return k;if(!D)return null;const V=y6(v.breakpoints),G=Object.keys(V);let J=V;return Object.keys(D).forEach(ve=>{const ae=oN(D[ve],v);if(ae!=null)if(typeof ae=="object")if(E[ve])J=Tp(J,e(ve,ae,v,E));else{const me=oa({theme:v},ae,Ce=>({[ve]:Ce}));iN(me,ae)?J[ve]=n({sx:ae,theme:v}):J=Tp(J,me)}else J=Tp(J,e(ve,ae,v,E))}),v6(G,J)}return Array.isArray(m)?m.map(s):s(m)}return n}const WI=sN();WI.filterProps=["sx"];const ZI=WI;function aN(e,n){const l=this;return l.vars&&typeof l.getColorSchemeSelector=="function"?{[l.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:n}:l.palette.mode===e?n:{}}const lN=["breakpoints","palette","spacing","shape"];function cN(e={},...n){const{breakpoints:l={},palette:h={},spacing:m,shape:v={}}=e,E=pl(e,lN),s=m6(l),k=A6(m);let D=ea({breakpoints:s,direction:"ltr",components:{},palette:Bn({mode:"light"},h),spacing:k,shape:Bn({},_6,v)},E);return D.applyStyles=aN,D=n.reduce((V,G)=>ea(V,G),D),D.unstable_sxConfig=Bn({},Fx,E==null?void 0:E.unstable_sxConfig),D.unstable_sx=function(G){return ZI({sx:G,theme:this})},D}function uN(e){return Object.keys(e).length===0}function hN(e=null){const n=ut.useContext(NI);return!n||uN(n)?e:n}function dN(e,n=Number.MIN_SAFE_INTEGER,l=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(e,l))}const pN=Object.freeze(Object.defineProperty({__proto__:null,default:dN},Symbol.toStringTag,{value:"Module"})),fN=ut.createContext(null),HI=fN;function XI(){return ut.useContext(HI)}const mN=typeof Symbol=="function"&&Symbol.for,gN=mN?Symbol.for("mui.nested"):"__THEME_NESTED__";function _N(e,n){return typeof n=="function"?n(e):Bn({},e,n)}function yN(e){const{children:n,theme:l}=e,h=XI(),m=ut.useMemo(()=>{const v=h===null?l:_N(h,l);return v!=null&&(v[gN]=h!==null),v},[l,h]);return Ka.jsx(HI.Provider,{value:m,children:n})}const vN=["value"],xN=ut.createContext();function wN(e){let{value:n}=e,l=pl(e,vN);return Ka.jsx(xN.Provider,Bn({value:n??!0},l))}const bN=ut.createContext(void 0);function EN({value:e,children:n}){return Ka.jsx(bN.Provider,{value:e,children:n})}const UT={};function jT(e,n,l,h=!1){return ut.useMemo(()=>{const m=e&&n[e]||n;if(typeof l=="function"){const v=l(m),E=e?Bn({},n,{[e]:v}):v;return h?()=>E:E}return e?Bn({},n,{[e]:l}):Bn({},n,l)},[e,n,l,h])}function TN(e){const{children:n,theme:l,themeId:h}=e,m=hN(UT),v=XI()||UT,E=jT(h,m,l),s=jT(h,v,l,!0),k=E.direction==="rtl";return Ka.jsx(yN,{theme:s,children:Ka.jsx(NI.Provider,{value:E,children:Ka.jsx(wN,{value:k,children:Ka.jsx(EN,{value:E==null?void 0:E.components,children:n})})})})}function SN(e,n){return Bn({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},n)}var ur={},KI={exports:{}};(function(e){function n(l){return l&&l.__esModule?l:{default:l}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(KI);var AN=KI.exports;const CN=XT(kF),IN=XT(pN);var YI=AN;Object.defineProperty(ur,"__esModule",{value:!0});ur.alpha=tk;ur.blend=jN;ur.colorChannel=void 0;var kN=ur.darken=Ux;ur.decomposeColor=_o;ur.emphasize=nk;var MN=ur.getContrastRatio=ON;ur.getLuminance=s_;ur.hexToRgb=JI;ur.hslToRgb=ek;var PN=ur.lighten=jx;ur.private_safeAlpha=BN;ur.private_safeColorChannel=void 0;ur.private_safeDarken=FN;ur.private_safeEmphasize=UN;ur.private_safeLighten=NN;ur.recomposeColor=xh;ur.rgbToHex=DN;var VT=YI(CN),zN=YI(IN);function Nx(e,n=0,l=1){return(0,zN.default)(e,n,l)}function JI(e){e=e.slice(1);const n=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let l=e.match(n);return l&&l[0].length===1&&(l=l.map(h=>h+h)),l?`rgb${l.length===4?"a":""}(${l.map((h,m)=>m<3?parseInt(h,16):Math.round(parseInt(h,16)/255*1e3)/1e3).join(", ")})`:""}function LN(e){const n=e.toString(16);return n.length===1?`0${n}`:n}function _o(e){if(e.type)return e;if(e.charAt(0)==="#")return _o(JI(e));const n=e.indexOf("("),l=e.substring(0,n);if(["rgb","rgba","hsl","hsla","color"].indexOf(l)===-1)throw new Error((0,VT.default)(9,e));let h=e.substring(n+1,e.length-1),m;if(l==="color"){if(h=h.split(" "),m=h.shift(),h.length===4&&h[3].charAt(0)==="/"&&(h[3]=h[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(m)===-1)throw new Error((0,VT.default)(10,m))}else h=h.split(",");return h=h.map(v=>parseFloat(v)),{type:l,values:h,colorSpace:m}}const QI=e=>{const n=_o(e);return n.values.slice(0,3).map((l,h)=>n.type.indexOf("hsl")!==-1&&h!==0?`${l}%`:l).join(" ")};ur.colorChannel=QI;const RN=(e,n)=>{try{return QI(e)}catch{return e}};ur.private_safeColorChannel=RN;function xh(e){const{type:n,colorSpace:l}=e;let{values:h}=e;return n.indexOf("rgb")!==-1?h=h.map((m,v)=>v<3?parseInt(m,10):m):n.indexOf("hsl")!==-1&&(h[1]=`${h[1]}%`,h[2]=`${h[2]}%`),n.indexOf("color")!==-1?h=`${l} ${h.join(" ")}`:h=`${h.join(", ")}`,`${n}(${h})`}function DN(e){if(e.indexOf("#")===0)return e;const{values:n}=_o(e);return`#${n.map((l,h)=>LN(h===3?Math.round(255*l):l)).join("")}`}function ek(e){e=_o(e);const{values:n}=e,l=n[0],h=n[1]/100,m=n[2]/100,v=h*Math.min(m,1-m),E=(D,V=(D+l/30)%12)=>m-v*Math.max(Math.min(V-3,9-V,1),-1);let s="rgb";const k=[Math.round(E(0)*255),Math.round(E(8)*255),Math.round(E(4)*255)];return e.type==="hsla"&&(s+="a",k.push(n[3])),xh({type:s,values:k})}function s_(e){e=_o(e);let n=e.type==="hsl"||e.type==="hsla"?_o(ek(e)).values:e.values;return n=n.map(l=>(e.type!=="color"&&(l/=255),l<=.03928?l/12.92:((l+.055)/1.055)**2.4)),Number((.2126*n[0]+.7152*n[1]+.0722*n[2]).toFixed(3))}function ON(e,n){const l=s_(e),h=s_(n);return(Math.max(l,h)+.05)/(Math.min(l,h)+.05)}function tk(e,n){return e=_o(e),n=Nx(n),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${n}`:e.values[3]=n,xh(e)}function BN(e,n,l){try{return tk(e,n)}catch{return e}}function Ux(e,n){if(e=_o(e),n=Nx(n),e.type.indexOf("hsl")!==-1)e.values[2]*=1-n;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let l=0;l<3;l+=1)e.values[l]*=1-n;return xh(e)}function FN(e,n,l){try{return Ux(e,n)}catch{return e}}function jx(e,n){if(e=_o(e),n=Nx(n),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*n;else if(e.type.indexOf("rgb")!==-1)for(let l=0;l<3;l+=1)e.values[l]+=(255-e.values[l])*n;else if(e.type.indexOf("color")!==-1)for(let l=0;l<3;l+=1)e.values[l]+=(1-e.values[l])*n;return xh(e)}function NN(e,n,l){try{return jx(e,n)}catch{return e}}function nk(e,n=.15){return s_(e)>.5?Ux(e,n):jx(e,n)}function UN(e,n,l){try{return nk(e,n)}catch{return e}}function jN(e,n,l,h=1){const m=(k,D)=>Math.round((k**(1/h)*(1-l)+D**(1/h)*l)**h),v=_o(e),E=_o(n),s=[m(v.values[0],E.values[0]),m(v.values[1],E.values[1]),m(v.values[2],E.values[2])];return xh({type:"rgb",values:s})}const VN={black:"#000",white:"#fff"},Kp=VN,$N={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},GN=$N,qN={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Au=qN,WN={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Cu=WN,ZN={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},cp=ZN,HN={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Iu=HN,XN={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},ku=XN,KN={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Mu=KN,YN=["mode","contrastThreshold","tonalOffset"],$T={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Kp.white,default:Kp.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},av={text:{primary:Kp.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Kp.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function GT(e,n,l,h){const m=h.light||h,v=h.dark||h*1.5;e[n]||(e.hasOwnProperty(l)?e[n]=e[l]:n==="light"?e.light=PN(e.main,m):n==="dark"&&(e.dark=kN(e.main,v)))}function JN(e="light"){return e==="dark"?{main:Iu[200],light:Iu[50],dark:Iu[400]}:{main:Iu[700],light:Iu[400],dark:Iu[800]}}function QN(e="light"){return e==="dark"?{main:Au[200],light:Au[50],dark:Au[400]}:{main:Au[500],light:Au[300],dark:Au[700]}}function eU(e="light"){return e==="dark"?{main:Cu[500],light:Cu[300],dark:Cu[700]}:{main:Cu[700],light:Cu[400],dark:Cu[800]}}function tU(e="light"){return e==="dark"?{main:ku[400],light:ku[300],dark:ku[700]}:{main:ku[700],light:ku[500],dark:ku[900]}}function nU(e="light"){return e==="dark"?{main:Mu[400],light:Mu[300],dark:Mu[700]}:{main:Mu[800],light:Mu[500],dark:Mu[900]}}function rU(e="light"){return e==="dark"?{main:cp[400],light:cp[300],dark:cp[700]}:{main:"#ed6c02",light:cp[500],dark:cp[900]}}function iU(e){const{mode:n="light",contrastThreshold:l=3,tonalOffset:h=.2}=e,m=pl(e,YN),v=e.primary||JN(n),E=e.secondary||QN(n),s=e.error||eU(n),k=e.info||tU(n),D=e.success||nU(n),V=e.warning||rU(n);function G(me){return MN(me,av.text.primary)>=l?av.text.primary:$T.text.primary}const J=({color:me,name:Ce,mainShade:ie=500,lightShade:te=300,darkShade:le=700})=>{if(me=Bn({},me),!me.main&&me[ie]&&(me.main=me[ie]),!me.hasOwnProperty("main"))throw new Error(Zp(11,Ce?` (${Ce})`:"",ie));if(typeof me.main!="string")throw new Error(Zp(12,Ce?` (${Ce})`:"",JSON.stringify(me.main)));return GT(me,"light",te,h),GT(me,"dark",le,h),me.contrastText||(me.contrastText=G(me.main)),me},ve={dark:av,light:$T};return ea(Bn({common:Bn({},Kp),mode:n,primary:J({color:v,name:"primary"}),secondary:J({color:E,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:J({color:s,name:"error"}),warning:J({color:V,name:"warning"}),info:J({color:k,name:"info"}),success:J({color:D,name:"success"}),grey:GN,contrastThreshold:l,getContrastText:G,augmentColor:J,tonalOffset:h},ve[n]),m)}const oU=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function sU(e){return Math.round(e*1e5)/1e5}const qT={textTransform:"uppercase"},WT='"Roboto", "Helvetica", "Arial", sans-serif';function aU(e,n){const l=typeof n=="function"?n(e):n,{fontFamily:h=WT,fontSize:m=14,fontWeightLight:v=300,fontWeightRegular:E=400,fontWeightMedium:s=500,fontWeightBold:k=700,htmlFontSize:D=16,allVariants:V,pxToRem:G}=l,J=pl(l,oU),ve=m/14,ae=G||(ie=>`${ie/D*ve}rem`),me=(ie,te,le,ze,Oe)=>Bn({fontFamily:h,fontWeight:ie,fontSize:ae(te),lineHeight:le},h===WT?{letterSpacing:`${sU(ze/te)}em`}:{},Oe,V),Ce={h1:me(v,96,1.167,-1.5),h2:me(v,60,1.2,-.5),h3:me(E,48,1.167,0),h4:me(E,34,1.235,.25),h5:me(E,24,1.334,0),h6:me(s,20,1.6,.15),subtitle1:me(E,16,1.75,.15),subtitle2:me(s,14,1.57,.1),body1:me(E,16,1.5,.15),body2:me(E,14,1.43,.15),button:me(s,14,1.75,.4,qT),caption:me(E,12,1.66,.4),overline:me(E,12,2.66,1,qT),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ea(Bn({htmlFontSize:D,pxToRem:ae,fontFamily:h,fontSize:m,fontWeightLight:v,fontWeightRegular:E,fontWeightMedium:s,fontWeightBold:k},Ce),J,{clone:!1})}const lU=.2,cU=.14,uU=.12;function Un(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${lU})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${cU})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${uU})`].join(",")}const hU=["none",Un(0,2,1,-1,0,1,1,0,0,1,3,0),Un(0,3,1,-2,0,2,2,0,0,1,5,0),Un(0,3,3,-2,0,3,4,0,0,1,8,0),Un(0,2,4,-1,0,4,5,0,0,1,10,0),Un(0,3,5,-1,0,5,8,0,0,1,14,0),Un(0,3,5,-1,0,6,10,0,0,1,18,0),Un(0,4,5,-2,0,7,10,1,0,2,16,1),Un(0,5,5,-3,0,8,10,1,0,3,14,2),Un(0,5,6,-3,0,9,12,1,0,3,16,2),Un(0,6,6,-3,0,10,14,1,0,4,18,3),Un(0,6,7,-4,0,11,15,1,0,4,20,3),Un(0,7,8,-4,0,12,17,2,0,5,22,4),Un(0,7,8,-4,0,13,19,2,0,5,24,4),Un(0,7,9,-4,0,14,21,2,0,5,26,4),Un(0,8,9,-5,0,15,22,2,0,6,28,5),Un(0,8,10,-5,0,16,24,2,0,6,30,5),Un(0,8,11,-5,0,17,26,2,0,6,32,5),Un(0,9,11,-5,0,18,28,2,0,7,34,6),Un(0,9,12,-6,0,19,29,2,0,7,36,6),Un(0,10,13,-6,0,20,31,3,0,8,38,7),Un(0,10,13,-6,0,21,33,3,0,8,40,7),Un(0,10,14,-6,0,22,35,3,0,8,42,7),Un(0,11,14,-7,0,23,36,3,0,9,44,8),Un(0,11,15,-7,0,24,38,3,0,9,46,8)],dU=hU,pU=["duration","easing","delay"],fU={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},mU={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ZT(e){return`${Math.round(e)}ms`}function gU(e){if(!e)return 0;const n=e/36;return Math.round((4+15*n**.25+n/5)*10)}function _U(e){const n=Bn({},fU,e.easing),l=Bn({},mU,e.duration);return Bn({getAutoHeightDuration:gU,create:(m=["all"],v={})=>{const{duration:E=l.standard,easing:s=n.easeInOut,delay:k=0}=v;return pl(v,pU),(Array.isArray(m)?m:[m]).map(D=>`${D} ${typeof E=="string"?E:ZT(E)} ${s} ${typeof k=="string"?k:ZT(k)}`).join(",")}},e,{easing:n,duration:l})}const yU={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},vU=yU,xU=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function wU(e={},...n){const{mixins:l={},palette:h={},transitions:m={},typography:v={}}=e,E=pl(e,xU);if(e.vars)throw new Error(Zp(18));const s=iU(h),k=cN(e);let D=ea(k,{mixins:SN(k.breakpoints,l),palette:s,shadows:dU.slice(),typography:aU(s,v),transitions:_U(m),zIndex:Bn({},vU)});return D=ea(D,E),D=n.reduce((V,G)=>ea(V,G),D),D.unstable_sxConfig=Bn({},Fx,E==null?void 0:E.unstable_sxConfig),D.unstable_sx=function(G){return ZI({sx:G,theme:this})},D}const bU=["theme"];function EU(e){let{theme:n}=e,l=pl(e,bU);const h=n[RT];return Ka.jsx(TN,Bn({},l,{themeId:h?RT:void 0,theme:h||n}))}var rk={exports:{}};(function(e,n){(function(l,h){e.exports=h()})(Go,function(){var l,h,m;function v(s,k){if(!l)l=k;else if(!h)h=k;else{var D="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+l+")(sharedChunk); ("+h+")(sharedChunk); self.onerror = null;",V={};l(V),m=k(V),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(m.workerUrl=window.URL.createObjectURL(new Blob([D],{type:"text/javascript"})))}}v(["exports"],function(s){var k=typeof self<"u"?self:{},D="2.15.0";let V;const G={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(V==null){const r=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{V={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):r}catch{V=r}}return V},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!G.API_URL)return null;try{const r=new URL(G.API_URL);return r.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":r.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},J={supported:!1,testSupport:function(r){!me&&ae&&(Ce?ie(r):ve=r)}};let ve,ae,me=!1,Ce=!1;function ie(r){const t=r.createTexture();r.bindTexture(r.TEXTURE_2D,t);try{if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,ae),r.isContextLost())return;J.supported=!0}catch{}r.deleteTexture(t),me=!0}k.document&&(ae=k.document.createElement("img"),ae.onload=function(){ve&&ie(ve),ve=null,Ce=!0},ae.onerror=function(){me=!0,ve=null},ae.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const te="01";function le(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ze=Oe;function Oe(r,t,i,a){this.cx=3*r,this.bx=3*(i-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=t,this.p2x=i,this.p2y=a}Oe.prototype={sampleCurveX:function(r){return((this.ax*r+this.bx)*r+this.cx)*r},sampleCurveY:function(r){return((this.ay*r+this.by)*r+this.cy)*r},sampleCurveDerivativeX:function(r){return(3*this.ax*r+2*this.bx)*r+this.cx},solveCurveX:function(r,t){if(t===void 0&&(t=1e-6),r<0)return 0;if(r>1)return 1;for(var i=r,a=0;a<8;a++){var u=this.sampleCurveX(i)-r;if(Math.abs(u)u?g=i:y=i,i=.5*(y-g)+g;return i},solve:function(r,t){return this.sampleCurveY(this.solveCurveX(r,t))}};var Ke=le(ze),He=ht;function ht(r,t){this.x=r,this.y=t}ht.prototype={clone:function(){return new ht(this.x,this.y)},add:function(r){return this.clone()._add(r)},sub:function(r){return this.clone()._sub(r)},multByPoint:function(r){return this.clone()._multByPoint(r)},divByPoint:function(r){return this.clone()._divByPoint(r)},mult:function(r){return this.clone()._mult(r)},div:function(r){return this.clone()._div(r)},rotate:function(r){return this.clone()._rotate(r)},rotateAround:function(r,t){return this.clone()._rotateAround(r,t)},matMult:function(r){return this.clone()._matMult(r)},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(r){return this.x===r.x&&this.y===r.y},dist:function(r){return Math.sqrt(this.distSqr(r))},distSqr:function(r){var t=r.x-this.x,i=r.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith:function(r){return this.angleWithSep(r.x,r.y)},angleWithSep:function(r,t){return Math.atan2(this.x*t-this.y*r,this.x*r+this.y*t)},_matMult:function(r){var t=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=t,this},_add:function(r){return this.x+=r.x,this.y+=r.y,this},_sub:function(r){return this.x-=r.x,this.y-=r.y,this},_mult:function(r){return this.x*=r,this.y*=r,this},_div:function(r){return this.x/=r,this.y/=r,this},_multByPoint:function(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint:function(r){return this.x/=r.x,this.y/=r.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var r=this.y;return this.y=this.x,this.x=-r,this},_rotate:function(r){var t=Math.cos(r),i=Math.sin(r),a=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=a,this},_rotateAround:function(r,t){var i=Math.cos(r),a=Math.sin(r),u=t.y+a*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-a*(this.y-t.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ht.convert=function(r){return r instanceof ht?r:Array.isArray(r)?new ht(r[0],r[1]):r};var Ve=le(He);const jt=Math.PI/180,wr=180/Math.PI;function St(r){return r*jt}function Vt(r){return r*wr}const Vr=[[0,0],[1,0],[1,1],[0,1]];function $r(r){if(r<=0)return 0;if(r>=1)return 1;const t=r*r,i=t*r;return 4*(r<.5?i:3*(r-t)+i-.75)}function Li(r,t,i,a){const u=new Ke(r,t,i,a);return function(p){return u.solve(p)}}const Ki=Li(.25,.1,.25,1);function Je(r,t,i){return Math.min(i,Math.max(t,r))}function Tt(r,t,i){return(i=Je((i-r)/(t-r),0,1))*i*(3-2*i)}function xt(r,t,i){const a=i-t,u=((r-t)%a+a)%a+t;return u===t?i:u}function Bt(r,t,i){if(!r.length)return i(null,[]);let a=r.length;const u=new Array(r.length);let p=null;r.forEach((g,y)=>{t(g,(w,b)=>{w&&(p=w),u[y]=b,--a==0&&i(p,u)})})}function dn(r){const t=[];for(const i in r)t.push(r[i]);return t}function vn(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}let sr=1;function ii(){return sr++}function ar(){return function r(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,r)}()}function br(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Es(r){return!!r&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(r)}function Yi(r,t){r.forEach(i=>{t[i]&&(t[i]=t[i].bind(t))})}function xn(r,t){return r.indexOf(t,r.length-t.length)!==-1}function kt(r,t,i){const a={};for(const u in r)a[u]=t.call(i||this,r[u],u,r);return a}function Yo(r,t,i){const a={};for(const u in r)t.call(i||this,r[u],u,r)&&(a[u]=r[u]);return a}function Dr(r){return Array.isArray(r)?r.map(Dr):typeof r=="object"&&r?kt(r,Dr):r}const Jo={};function wn(r){Jo[r]||(typeof console<"u"&&console.warn(r),Jo[r]=!0)}function pi(r,t,i){return(i.y-r.y)*(t.x-r.x)>(t.y-r.y)*(i.x-r.x)}function Tc(r){let t=0;for(let i,a,u=0,p=r.length,g=p-1;u@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,a,u,p)=>{const g=u||p;return t[a]=!g||g.toLowerCase(),""}),t["max-age"]){const i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t}let fl=null;function aa(r){if(fl==null){const t=r.navigator?r.navigator.userAgent:null;fl=!!r.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return fl}function ml(r){try{const t=k[r];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}function Qo(r,t){return[r[4*t],r[4*t+1],r[4*t+2],r[4*t+3]]}const la="mapbox-tiles";let Sc=500,Ac=50,fi,es;function gl(){try{return k.caches}catch{}}function Ts(){gl()&&!fi&&(fi=k.caches.open(la))}function ca(r){const t=r.indexOf("?");if(t<0)return r;const i=function(u){const p=u.indexOf("?");return p>0?u.slice(p+1).split("&"):[]}(r),a=i.filter(u=>{const p=u.split("=");return p[0]==="language"||p[0]==="worldview"});return a.length?`${r.slice(0,t)}?${a.join("&")}`:r.slice(0,t)}let _l=1/0;const Ss={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Ss);class ts extends Error{constructor(t,i,a){i===401&&be(a)&&(t+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(t),this.status=i,this.url=a}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const As=vo()?()=>self.worker&&self.worker.referrer:()=>(k.location.protocol==="blob:"?k.parent:k).location.href,Cs=function(r,t){if(!(/^file:/.test(i=r.url)||/^file:/.test(As())&&!/^\w+:/.test(i))){if(k.fetch&&k.Request&&k.AbortController&&k.Request.prototype.hasOwnProperty("signal"))return function(a,u){const p=new k.AbortController,g=new k.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:As(),referrerPolicy:a.referrerPolicy,signal:p.signal});let y=!1,w=!1;const b=(A=g.url).indexOf("sku=")>0&&be(A);var A;a.type==="json"&&g.headers.set("Accept","application/json");const I=(L,R,F)=>{if(w)return;if(L&&L.message!=="SecurityError"&&wn(L.toString()),R&&F)return M(R);const $=Date.now();k.fetch(g).then(K=>{if(K.ok){const se=b?K.clone():null;return M(K,se,$)}return u(new ts(K.statusText,K.status,a.url))}).catch(K=>{K.name!=="AbortError"&&u(new Error(`${K.message} ${a.url}`))})},M=(L,R,F)=>{(a.type==="arrayBuffer"?L.arrayBuffer():a.type==="json"?L.json():L.text()).then($=>{w||(R&&F&&function(K,se,Y){if(Ts(),!fi)return;const re={status:se.status,statusText:se.statusText,headers:new k.Headers};se.headers.forEach((Ie,Te)=>re.headers.set(Te,Ie));const ue=oi(se.headers.get("Cache-Control")||"");if(ue["no-store"])return;ue["max-age"]&&re.headers.set("Expires",new Date(Y+1e3*ue["max-age"]).toUTCString());const ce=re.headers.get("Expires");ce&&(new Date(ce).getTime()-Y<42e4||function(Ie,Te){if(es===void 0)try{new Response(new ReadableStream),es=!0}catch{es=!1}es?Te(Ie.body):Ie.blob().then(Te)}(se,Ie=>{const Te=new k.Response(Ie,re);Ts(),fi&&fi.then(De=>De.put(ca(K.url),Te)).catch(De=>wn(De.message))}))}(g,R,F),y=!0,u(null,$,L.headers.get("Cache-Control"),L.headers.get("Expires")))}).catch($=>{w||u(new Error($.message))})};return b?function(L,R){if(Ts(),!fi)return R(null);const F=ca(L.url);fi.then($=>{$.match(F).then(K=>{const se=function(Y){if(!Y)return!1;const re=new Date(Y.headers.get("Expires")||0),ue=oi(Y.headers.get("Cache-Control")||"");return re>Date.now()&&!ue["no-cache"]}(K);$.delete(F),se&&$.put(F,K.clone()),R(null,K,se)}).catch(R)}).catch(R)}(g,I):I(null,null),{cancel:()=>{w=!0,y||p.abort()}}}(r,t);if(vo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",r,t,void 0,!0)}var i;return function(a,u){const p=new k.XMLHttpRequest;p.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(p.responseType="arraybuffer");for(const g in a.headers)p.setRequestHeader(g,a.headers[g]);return a.type==="json"&&(p.responseType="text",p.setRequestHeader("Accept","application/json")),p.withCredentials=a.credentials==="include",p.onerror=()=>{u(new Error(p.statusText))},p.onload=()=>{if((p.status>=200&&p.status<300||p.status===0)&&p.response!==null){let g=p.response;if(a.type==="json")try{g=JSON.parse(p.response)}catch(y){return u(y)}u(null,g,p.getResponseHeader("Cache-Control"),p.getResponseHeader("Expires"))}else u(new ts(p.statusText,p.status,a.url))},p.send(a.body),{cancel:()=>p.abort()}}(r,t)},ua=function(r,t){return Cs(vn(r,{type:"arrayBuffer"}),t)};function Cc(r){const t=k.document.createElement("a");return t.href=r,t.protocol===k.document.location.protocol&&t.host===k.document.location.host}const oe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let N,U;N=[],U=0;const ne=function(r,t){if(J.supported&&(r.headers||(r.headers={}),r.headers.accept="image/webp,*/*"),U>=G.MAX_PARALLEL_IMAGE_REQUESTS){const p={requestParameters:r,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return N.push(p),p}U++;let i=!1;const a=()=>{if(!i)for(i=!0,U--;N.length&&U{a(),p?t(p):g&&(k.createImageBitmap?function(b,A){const I=new k.Blob([new Uint8Array(b)],{type:"image/png"});k.createImageBitmap(I).then(M=>{A(null,M)}).catch(M=>{A(new Error(`Could not load image because of ${M.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(g,(b,A)=>t(b,A,y,w)):function(b,A){const I=new k.Image,M=k.URL;I.onload=()=>{A(null,I),M.revokeObjectURL(I.src),I.onload=null,k.requestAnimationFrame(()=>{I.src=oe})},I.onerror=()=>A(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 L=new k.Blob([new Uint8Array(b)],{type:"image/png"});I.src=b.byteLength?M.createObjectURL(L):oe}(g,(b,A)=>t(b,A,y,w)))});return{cancel:()=>{u.cancel(),a()}}},he="NO_ACCESS_TOKEN";function _e(r){return r.indexOf("mapbox:")===0}function be(r){return G.API_URL_REGEX.test(r)}function we(r){return G.API_CDN_URL_REGEX.test(r)}function ge(r){return G.API_STYLE_REGEX.test(r)&&!Pe(r)}function Pe(r){return G.API_SPRITE_REGEX.test(r)}const nt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function rt(r){const t=r.match(nt);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Qe(r){const t=r.params.length?`?${r.params.join("&")}`:"";return`${r.protocol}://${r.authority}${r.path}${t}`}const Mt="mapbox.eventData";function Rt(r){if(!r)return null;const t=r.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(k.atob(t[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class Pt{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const i=Rt(G.ACCESS_TOKEN);let a="";return a=i&&i.u?k.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(u,p)=>String.fromCharCode(+("0x"+p)))):G.ACCESS_TOKEN||"",t?`${Mt}.${t}:${a}`:`${Mt}:${a}`}fetchEventData(){const t=ml("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(t)try{const u=k.localStorage.getItem(i);u&&(this.eventData=JSON.parse(u));const p=k.localStorage.getItem(a);p&&(this.anonId=p)}catch{wn("Unable to read from LocalStorage")}}saveEventData(){const t=ml("localStorage"),i=this.getStorageKey(),a=this.getStorageKey("uuid");if(t)try{k.localStorage.setItem(a,this.anonId),Object.keys(this.eventData).length>=1&&k.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{wn("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,i,a,u){if(!G.EVENTS_URL)return;const p=rt(G.EVENTS_URL);p.params.push(`access_token=${u||G.ACCESS_TOKEN||""}`);const g={event:this.type,created:new Date(t).toISOString()},y=i?vn(g,i):g,w={url:Qe(p),headers:{"Content-Type":"text/plain"},body:JSON.stringify([y])};this.pendingRequest=function(b,A){return Cs(vn(b,{method:"POST"}),A)}(w,b=>{this.pendingRequest=null,a(b),this.saveEventData(),this.processRequests(u)})}queueRequest(t,i){this.queue.push(t),this.processRequests(i)}}const Dt=new class extends Pt{constructor(r){super("appUserTurnstile"),this._customAccessToken=r}postTurnstileEvent(r,t){G.EVENTS_URL&&G.ACCESS_TOKEN&&Array.isArray(r)&&r.some(i=>_e(i)||be(i))&&this.queueRequest(Date.now(),t)}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=Rt(G.ACCESS_TOKEN),i=t?t.u:G.ACCESS_TOKEN;let a=i!==this.eventData.tokenU;Es(this.anonId)||(this.anonId=ar(),a=!0);const u=this.queue.shift();if(this.eventData.lastSuccess){const p=new Date(this.eventData.lastSuccess),g=new Date(u),y=(u-this.eventData.lastSuccess)/864e5;a=a||y>=1||y<-1||p.getDate()!==g.getDate()}else a=!0;a?this.postEvent(u,{sdkIdentifier:"mapbox-gl-js",sdkVersion:D,skuId:te,"enabled.telemetry":!1,userId:this.anonId},p=>{p||(this.eventData.lastSuccess=u,this.eventData.tokenU=i)},r):this.processRequests()}},Gt=Dt.postTurnstileEvent.bind(Dt),In=new class extends Pt{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(r,t,i,a){this.skuToken=t,this.errorCb=a,G.EVENTS_URL&&(i||G.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},i):this.errorCb(new Error(he)))}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),Es(this.anonId)||(this.anonId=ar()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:D,skuId:te,skuToken:this.skuToken,userId:this.anonId},a=>{a?this.errorCb(a):t&&(this.success[t]=!0)},r))}},Vn=In.postMapLoadEvent.bind(In),Ir=new class extends Pt{constructor(){super("gljs.performance")}postPerformanceEvent(r,t){G.EVENTS_URL&&(r||G.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},r)}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:t,performanceData:i}=this.queue.shift(),a=function(u){const p=k.performance.getEntriesByType("resource"),g=k.performance.getEntriesByType("mark"),y=function(M){const L={};if(M){for(const R in M)if(R!=="other")for(const F of M[R]){const $=`${R}ResolveRangeMin`,K=`${R}ResolveRangeMax`,se=`${R}RequestCount`,Y=`${R}RequestCachedCount`;L[$]=Math.min(L[$]||1/0,F.startTime),L[K]=Math.max(L[K]||-1/0,F.responseEnd);const re=ue=>{L[ue]===void 0&&(L[ue]=0),++L[ue]};F.transferSize!==void 0&&F.transferSize===0&&re(Y),re(se)}}return L}(function(M,L){const R={};if(M)for(const F of M){const $=L(F);R[$]===void 0&&(R[$]=[]),R[$].push(F)}return R}(p,lf)),w=k.devicePixelRatio,b=k.navigator.connection||k.navigator.mozConnection||k.navigator.webkitConnection,A={counters:[],metadata:[],attributes:[]},I=(M,L,R)=>{R!=null&&M.push({name:L,value:R.toString()})};for(const M in y)I(A.counters,M,y[M]);if(u.interactionRange[0]!==1/0&&u.interactionRange[1]!==-1/0&&(I(A.counters,"interactionRangeMin",u.interactionRange[0]),I(A.counters,"interactionRangeMax",u.interactionRange[1])),g)for(const M of Object.keys(ha)){const L=ha[M],R=g.find(F=>F.name===L);R&&I(A.counters,L,R.startTime)}return I(A.counters,"visibilityHidden",u.visibilityHidden),I(A.attributes,"style",function(M){if(M)for(const L of M){const R=L.name.split("?")[0];if(ge(R)){const F=R.split("/").slice(-2);if(F.length===2)return`mapbox://styles/${F[0]}/${F[1]}`}}}(p)),I(A.attributes,"terrainEnabled",u.terrainEnabled?"true":"false"),I(A.attributes,"fogEnabled",u.fogEnabled?"true":"false"),I(A.attributes,"projection",u.projection),I(A.attributes,"zoom",u.zoom),I(A.metadata,"devicePixelRatio",w),I(A.metadata,"connectionEffectiveType",b?b.effectiveType:void 0),I(A.metadata,"navigatorUserAgent",k.navigator.userAgent),I(A.metadata,"screenWidth",k.screen.width),I(A.metadata,"screenHeight",k.screen.height),I(A.metadata,"windowWidth",k.innerWidth),I(A.metadata,"windowHeight",k.innerHeight),I(A.metadata,"mapWidth",u.width/w),I(A.metadata,"mapHeight",u.height/w),I(A.metadata,"webglRenderer",u.renderer),I(A.metadata,"webglVendor",u.vendor),I(A.metadata,"sdkVersion",D),I(A.metadata,"sdkIdentifier","mapbox-gl-js"),A}(i);for(const u of a.metadata);for(const u of a.counters);for(const u of a.attributes);this.postEvent(t,a,()=>{},r)}},tr=Ir.postPerformanceEvent.bind(Ir),Ji=new class extends Pt{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(r,t,i,a){if(!G.API_URL||!G.SESSION_PATH)return;const u=rt(G.API_URL+G.SESSION_PATH);u.params.push(`sku=${t||""}`),u.params.push(`access_token=${a||G.ACCESS_TOKEN||""}`);const p={url:Qe(u),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(g,y){return Cs(vn(g,{method:"GET"}),y)}(p,g=>{this.pendingRequest=null,i(g),this.saveEventData(),this.processRequests(a)})}getSessionAPI(r,t,i,a){this.skuToken=t,this.errorCb=a,G.SESSION_PATH&&G.API_URL&&(i||G.ACCESS_TOKEN?this.queueRequest({id:r,timestamp:Date.now()},i):this.errorCb(new Error(he)))}processRequests(r){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||this.getSession(i,this.skuToken,a=>{a?this.errorCb(a):t&&(this.success[t]=!0)},r)}},hr=Ji.getSessionAPI.bind(Ji),Or=new Set,ha={create:"create",load:"load",fullLoad:"fullLoad"},G_={mark(r){k.performance.mark(r)},measure(r,t,i){k.performance.measure(r,t,i)}};function lf(r){const t=r.name.split("?")[0];return we(t)&&t.includes("mapbox-gl.js")?"javascript":we(t)&&t.includes("mapbox-gl.css")?"css":function(i){return G.API_FONTS_REGEX.test(i)}(t)?"fontRange":Pe(t)?"sprite":ge(t)?"style":function(i){return G.API_TILEJSON_REGEX.test(i)}(t)?"tilejson":"other"}const Jt=k.performance;function wh(r){const t=r?r.url.toString():void 0;return Jt.getEntriesByName(t)}let yl,bh,Ic,Qi;const xo={now:()=>Ic!==void 0?Ic:k.performance.now(),setNow(r){Ic=r},restoreNow(){Ic=void 0},frame(r){const t=k.requestAnimationFrame(r);return{cancel:()=>k.cancelAnimationFrame(t)}},getImageData(r,t=0){const{width:i,height:a}=r;Qi||(Qi=k.document.createElement("canvas"));const u=Qi.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return(i>Qi.width||a>Qi.height)&&(Qi.width=i,Qi.height=a),u.clearRect(-t,-t,i+2*t,a+2*t),u.drawImage(r,0,0,i,a),u.getImageData(-t,-t,i+2*t,a+2*t)},resolveURL:r=>(yl||(yl=k.document.createElement("a")),yl.href=r,yl.href),get devicePixelRatio(){return k.devicePixelRatio},get prefersReducedMotion(){return!!k.matchMedia&&(bh==null&&(bh=k.matchMedia("(prefers-reduced-motion: reduce)")),bh.matches)}};function Eh(r,t,i){i[r]&&i[r].indexOf(t)!==-1||(i[r]=i[r]||[],i[r].push(t))}function Th(r,t,i){if(i&&i[r]){const a=i[r].indexOf(t);a!==-1&&i[r].splice(a,1)}}class Is{constructor(t,i={}){vn(this,i),this.type=t}}class wo extends Is{constructor(t,i={}){super("error",vn({error:t},i))}}class vl{on(t,i){return this._listeners=this._listeners||{},Eh(t,i,this._listeners),this}off(t,i){return Th(t,i,this._listeners),Th(t,i,this._oneTimeListeners),this}once(t,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Eh(t,i,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,i){typeof t=="string"&&(t=new Is(t,i||{}));const a=t.type;if(this.listens(a)){t.target=this;const u=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const y of u)y.call(this,t);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const y of p)Th(a,y,this._oneTimeListeners),y.call(this,t);const g=this._eventedParent;g&&(vn(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(t))}else t instanceof wo&&console.error(t.error);return this}listens(t){return!!(this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t))}setEventedParent(t,i){return this._eventedParent=t,this._eventedParentData=i,this}}var Re=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"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"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function bo(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}function $n(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function dr(r){if(Array.isArray(r))return r.map(dr);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const t={};for(const i in r)t[i]=dr(r[i]);return t}return $n(r)}class cf extends Error{constructor(t,i){super(i),this.message=i,this.key=t}}var eo=cf;class Sh{constructor(t,i=[]){this.parent=t,this.bindings={};for(const[a,u]of i)this.bindings[a]=u}concat(t){return new Sh(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}var uf=Sh;const da={kind:"null"},lt={kind:"number"},$t={kind:"string"},Ft={kind:"boolean"},si={kind:"color"},Ri={kind:"object"},Nt={kind:"value"},ai={kind:"collator"},xl={kind:"formatted"},ks={kind:"resolvedImage"};function mi(r,t){return{kind:"array",itemType:r,N:t}}function Sn(r){if(r.kind==="array"){const t=Sn(r.itemType);return typeof r.N=="number"?`array<${t}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${t}>`}return r.kind}const hf=[da,lt,$t,Ft,si,xl,Ri,mi(Nt),ks];function Eo(r,t){if(t.kind==="error")return null;if(r.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Eo(r.itemType,t.itemType))&&(typeof r.N!="number"||r.N===t.N))return null}else{if(r.kind===t.kind)return null;if(r.kind==="value"){for(const i of hf)if(!Eo(i,t))return null}}return`Expected ${Sn(r)} but found ${Sn(t)} instead.`}function wl(r,t){return t.some(i=>i.kind===r.kind)}function bl(r,t){return t.some(i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r)}var Ah,df={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function El(r){return(r=Math.round(r))<0?0:r>255?255:r}function Tl(r){return El(r[r.length-1]==="%"?parseFloat(r)/100*255:parseInt(r))}function kc(r){return(t=r[r.length-1]==="%"?parseFloat(r)/100:parseFloat(r))<0?0:t>1?1:t;var t}function pa(r,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?r+(t-r)*i*6:2*i<1?t:3*i<2?r+(t-r)*(2/3-i)*6:r}try{Ah={}.parseCSSColor=function(r){var t,i=r.replace(/ /g,"").toLowerCase();if(i in df)return df[i].slice();if(i[0]==="#")return i.length===4?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:i.length===7&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var a=i.indexOf("("),u=i.indexOf(")");if(a!==-1&&u+1===i.length){var p=i.substr(0,a),g=i.substr(a+1,u-(a+1)).split(","),y=1;switch(p){case"rgba":if(g.length!==4)return null;y=kc(g.pop());case"rgb":return g.length!==3?null:[Tl(g[0]),Tl(g[1]),Tl(g[2]),y];case"hsla":if(g.length!==4)return null;y=kc(g.pop());case"hsl":if(g.length!==3)return null;var w=(parseFloat(g[0])%360+360)%360/360,b=kc(g[1]),A=kc(g[2]),I=A<=.5?A*(b+1):A+b-A*b,M=2*A-I;return[El(255*pa(M,I,w+1/3)),El(255*pa(M,I,w)),El(255*pa(M,I,w-1/3)),y];default:return null}}return null}}catch{}class Gr{constructor(t,i,a,u=1){this.r=t,this.g=i,this.b=a,this.a=u}static parse(t){if(!t)return;if(t instanceof Gr)return t;if(typeof t!="string")return;const i=Ah(t);return i?new Gr(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[t,i,a,u]=this.toArray();return`rgba(${Math.round(t)},${Math.round(i)},${Math.round(a)},${u})`}toArray(){const{r:t,g:i,b:a,a:u}=this;return u===0?[0,0,0,0]:[255*t/u,255*i/u,255*a/u,u]}toArray01(){const{r:t,g:i,b:a,a:u}=this;return u===0?[0,0,0,0]:[t/u,i/u,a/u,u]}toArray01PremultipliedAlpha(){const{r:t,g:i,b:a,a:u}=this;return[t,i,a,u]}}Gr.black=new Gr(0,0,0,1),Gr.white=new Gr(1,1,1,1),Gr.transparent=new Gr(0,0,0,0),Gr.red=new Gr(1,0,0,1),Gr.blue=new Gr(0,0,1,1);var Fn=Gr;class Ch{constructor(t,i,a){this.sensitivity=t?i?"variant":"case":i?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,i){return this.collator.compare(t,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ih{constructor(t,i,a,u,p){this.text=t.normalize?t.normalize():t,this.image=i,this.scale=a,this.fontStack=u,this.textColor=p}}class qr{constructor(t){this.sections=t}static fromString(t){return new qr([new Ih(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof qr?t:qr.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const i of this.sections){if(i.image){t.push(["image",i.image.name]);continue}t.push(i.text);const a={};i.fontStack&&(a["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(a["font-scale"]=i.scale),i.textColor&&(a["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(a)}return t}}class gi{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new gi({name:t,available:!1}):null}serialize(){return["image",this.name]}}function pf(r,t,i,a){return typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof i=="number"&&i>=0&&i<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[r,t,i,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[r,t,i,a]:[r,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Sl(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Fn||r instanceof Ch||r instanceof qr||r instanceof gi)return!0;if(Array.isArray(r)){for(const t of r)if(!Sl(t))return!1;return!0}if(typeof r=="object"){for(const t in r)if(!Sl(r[t]))return!1;return!0}return!1}function Ln(r){if(r===null)return da;if(typeof r=="string")return $t;if(typeof r=="boolean")return Ft;if(typeof r=="number")return lt;if(r instanceof Fn)return si;if(r instanceof Ch)return ai;if(r instanceof qr)return xl;if(r instanceof gi)return ks;if(Array.isArray(r)){const t=r.length;let i;for(const a of r){const u=Ln(a);if(i){if(i===u)continue;i=Nt;break}i=u}return mi(i||Nt,t)}return Ri}function Al(r){const t=typeof r;return r===null?"":t==="string"||t==="number"||t==="boolean"?String(r):r instanceof Fn||r instanceof qr||r instanceof gi?r.toString():JSON.stringify(r)}class kh{constructor(t,i){this.type=t,this.value=i}static parse(t,i){if(t.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Sl(t[1]))return i.error("invalid value");const a=t[1];let u=Ln(a);const p=i.expectedType;return u.kind!=="array"||u.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(u=p),new kh(u,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Fn?["rgba"].concat(this.value.toArray()):this.value instanceof qr?this.value.serialize():this.value}}var Ms=kh,Er=class{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}};const Mh={string:$t,number:lt,boolean:Ft,object:Ri};class Ph{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let a,u=1;const p=t[0];if(p==="array"){let y,w;if(t.length>2){const b=t[1];if(typeof b!="string"||!(b in Mh)||b==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);y=Mh[b],u++}else y=Nt;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return i.error('The length argument to "array" must be a positive integer literal',2);w=t[2],u++}a=mi(y,w)}else a=Mh[p];const g=[];for(;ut.outputDefined())}serialize(){const t=this.type,i=[t.kind];if(t.kind==="array"){const a=t.itemType;if(a.kind==="string"||a.kind==="number"||a.kind==="boolean"){i.push(a.kind);const u=t.N;(typeof u=="number"||this.args.length>1)&&i.push(u)}}return i.concat(this.args.map(a=>a.serialize()))}}var To=Ph;class ns{constructor(t){this.type=xl,this.sections=t}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return i.error("First argument must be an image or text section.");const u=[];let p=!1;for(let g=1;g<=t.length-1;++g){const y=t[g];if(p&&typeof y=="object"&&!Array.isArray(y)){p=!1;let w=null;if(y["font-scale"]&&(w=i.parse(y["font-scale"],1,lt),!w))return null;let b=null;if(y["text-font"]&&(b=i.parse(y["text-font"],1,mi($t)),!b))return null;let A=null;if(y["text-color"]&&(A=i.parse(y["text-color"],1,si),!A))return null;const I=u[u.length-1];I.scale=w,I.font=b,I.textColor=A}else{const w=i.parse(t[g],1,Nt);if(!w)return null;const b=w.type.kind;if(b!=="string"&&b!=="value"&&b!=="null"&&b!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,u.push({content:w,scale:null,font:null,textColor:null})}}return new ns(u)}evaluate(t){return new qr(this.sections.map(i=>{const a=i.content.evaluate(t);return Ln(a)===ks?new Ih("",a,null,null,null):new Ih(Al(a),null,i.scale?i.scale.evaluate(t):null,i.font?i.font.evaluate(t).join(","):null,i.textColor?i.textColor.evaluate(t):null)}))}eachChild(t){for(const i of this.sections)t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const i of this.sections){t.push(i.content.serialize());const a={};i.scale&&(a["font-scale"]=i.scale.serialize()),i.font&&(a["text-font"]=i.font.serialize()),i.textColor&&(a["text-color"]=i.textColor.serialize()),t.push(a)}return t}}class Mc{constructor(t){this.type=ks,this.input=t}static parse(t,i){if(t.length!==2)return i.error("Expected two arguments.");const a=i.parse(t[1],1,$t);return a?new Mc(a):i.error("No image name provided.")}evaluate(t){const i=this.input.evaluate(t),a=gi.fromString(i);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(i)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const q_={"to-boolean":Ft,"to-color":si,"to-number":lt,"to-string":$t};class zh{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[0];if((a==="to-boolean"||a==="to-string")&&t.length!==2)return i.error("Expected one argument.");const u=q_[a],p=[];for(let g=1;g4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:pf(i[0],i[1],i[2],i[3]),!a))return new Fn(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Er(a||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const a of this.args){if(i=a.evaluate(t),i===null)return 0;const u=Number(i);if(!isNaN(u))return u}throw new Er(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?qr.fromString(Al(this.args[0].evaluate(t))):this.type.kind==="resolvedImage"?gi.fromString(Al(this.args[0].evaluate(t))):Al(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if(this.type.kind==="formatted")return new ns([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Mc(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild(i=>{t.push(i.serialize())}),t}}var fa=zh;const to=["Unknown","Point","LineString","Polygon"];var Lh=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?to[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const r=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:a}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*t-r[0])+this.featureDistanceData.bearing[1]*(a*t-r[1])}return 0}parseColor(r){let t=this._parseColorCache[r];return t||(t=this._parseColorCache[r]=Fn.parse(r)),t}};class Ps{constructor(t,i,a,u){this.name=t,this.type=i,this._evaluate=a,this.args=u}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,i){const a=t[0],u=Ps.definitions[a];if(!u)return i.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(u)?u[0]:u.type,g=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,y=g.filter(([b])=>!Array.isArray(b)||b.length===t.length-1);let w=null;for(const[b,A]of y){w=new Nh(i.registry,i.path,null,i.scope);const I=[];let M=!1;for(let L=1;L{return M=I,Array.isArray(M)?`(${M.map(Sn).join(", ")})`:`(${Sn(M.type)}...)`;var M}).join(" | "),A=[];for(let I=1;I=t[2]||r[1]<=t[1]||r[3]>=t[3])}function Il(r,t){const i=(180+r[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,u=Math.pow(2,t.z);return[Math.round(i*u*Ao),Math.round(a*u*Ao)]}function ff(r,t,i){const a=r[0]-t[0],u=r[1]-t[1],p=r[0]-i[0],g=r[1]-i[1];return a*g-p*u==0&&a*p<=0&&u*g<=0}function zc(r,t){let i=!1;for(let g=0,y=t.length;g(a=r)[1]!=(p=w[b+1])[1]>a[1]&&a[0]<(p[0]-u[0])*(a[1]-u[1])/(p[1]-u[1])+u[0]&&(i=!i)}}var a,u,p;return i}function Rh(r,t){for(let i=0;i0&&y<0||g<0&&y>0}function ga(r,t,i){for(const b of i)for(let A=0;Ai[2]){const u=.5*a;let p=r[0]-i[0]>u?-a:i[0]-r[0]>u?a:0;p===0&&(p=r[0]-i[2]>u?-a:i[2]-r[0]>u?a:0),r[0]+=p}Pc(t,r)}function gf(r,t,i,a){const u=Math.pow(2,a.z)*Ao,p=[a.x*Ao,a.y*Ao],g=[];if(!r)return g;for(const y of r)for(const w of y){const b=[w.x+p[0],w.y+p[1]];Bh(b,t,i,u),g.push(b)}return g}function Fh(r,t,i,a){const u=Math.pow(2,a.z)*Ao,p=[a.x*Ao,a.y*Ao],g=[];if(!r)return g;for(const w of r){const b=[];for(const A of w){const I=[A.x+p[0],A.y+p[1]];Pc(t,I),b.push(I)}g.push(b)}if(t[2]-t[0]<=u/2){(y=t)[0]=y[1]=1/0,y[2]=y[3]=-1/0;for(const w of g)for(const b of w)Bh(b,t,i,u)}var y;return g}class _a{constructor(t,i){this.type=Ft,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Sl(t[1])){const a=t[1];if(a.type==="FeatureCollection")for(let u=0;u{t&&!ya(i)&&(t=!1)}),t}function Co(r){if(r instanceof So&&r.name==="feature-state")return!1;let t=!0;return r.eachChild(i=>{t&&!Co(i)&&(t=!1)}),t}function zs(r,t){if(r instanceof So&&t.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild(a=>{i&&!zs(a,t)&&(i=!1)}),i}class Rc{constructor(t,i){this.type=i.type,this.name=t,this.boundExpression=i}static parse(t,i){if(t.length!==2||typeof t[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const a=t[1];return i.scope.has(a)?new Rc(a,i.scope.get(a)):i.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var _f=Rc;class kl{constructor(t,i=[],a,u=new uf,p=[]){this.registry=t,this.path=i,this.key=i.map(g=>`[${g}]`).join(""),this.scope=u,this.errors=p,this.expectedType=a}parse(t,i,a,u,p={}){return i?this.concat(i,a,u)._parse(t,p):this._parse(t,p)}_parse(t,i){function a(u,p,g){return g==="assert"?new To(p,[u]):g==="coerce"?new fa(p,[u]):u}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const u=t[0];if(typeof u!="string")return this.error(`Expression name must be a string, but found ${typeof u} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[u];if(p){let g=p.parse(t,this);if(!g)return null;if(this.expectedType){const y=this.expectedType,w=g.type;if(y.kind!=="string"&&y.kind!=="number"&&y.kind!=="boolean"&&y.kind!=="object"&&y.kind!=="array"||w.kind!=="value")if(y.kind!=="color"&&y.kind!=="formatted"&&y.kind!=="resolvedImage"||w.kind!=="value"&&w.kind!=="string"){if(this.checkSubtype(y,w))return null}else g=a(g,y,i.typeAnnotation||"coerce");else g=a(g,y,i.typeAnnotation||"assert")}if(!(g instanceof Ms)&&g.type.kind!=="resolvedImage"&&Uh(g)){const y=new Lh;try{g=new Ms(g.type,g.evaluate(y))}catch(w){return this.error(w.message),null}}return g}return this.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,i,a){const u=typeof t=="number"?this.path.concat(t):this.path,p=a?this.scope.concat(a):this.scope;return new kl(this.registry,u,i||null,p,this.errors)}error(t,...i){const a=`${this.key}${i.map(u=>`[${u}]`).join("")}`;this.errors.push(new eo(a,t))}checkSubtype(t,i){const a=Eo(t,i);return a&&this.error(a),a}}var Nh=kl;function Uh(r){if(r instanceof _f)return Uh(r.boundExpression);if(r instanceof So&&r.name==="error"||r instanceof Cl||r instanceof Lc)return!1;const t=r instanceof fa||r instanceof To;let i=!0;return r.eachChild(a=>{i=t?i&&Uh(a):i&&a instanceof Ms}),!!i&&ya(r)&&zs(r,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Dc(r,t){const i=r.length-1;let a,u,p=0,g=i,y=0;for(;p<=g;)if(y=Math.floor((p+g)/2),a=r[y],u=r[y+1],a<=t){if(y===i||tt))throw new Er("Input is not a number.");g=y-1}return 0}class Oc{constructor(t,i,a){this.type=t,this.input=i,this.labels=[],this.outputs=[];for(const[u,p]of a)this.labels.push(u),this.outputs.push(p)}static parse(t,i){if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");const a=i.parse(t[1],1,lt);if(!a)return null;const u=[];let p=null;i.expectedType&&i.expectedType.kind!=="value"&&(p=i.expectedType);for(let g=1;g=y)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',b);const I=i.parse(w,A,p);if(!I)return null;p=p||I.type,u.push([y,I])}return new Oc(p,a,u)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const u=this.input.evaluate(t);if(u<=i[0])return a[0].evaluate(t);const p=i.length;return u>=i[p-1]?a[p-1].evaluate(t):a[Dc(i,u)].evaluate(t)}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let i=0;i0&&t.push(this.labels[i]),t.push(this.outputs[i].serialize());return t}}var jh=Oc;function Wt(r,t,i){return r*(1-i)+t*i}var Ml=Object.freeze({__proto__:null,array:function(r,t,i){return r.map((a,u)=>Wt(a,t[u],i))},color:function(r,t,i){return new Fn(Wt(r.r,t.r,i),Wt(r.g,t.g,i),Wt(r.b,t.b,i),Wt(r.a,t.a,i))},number:Wt});const yf=.95047,Vh=1.08883,vf=4/29,Ls=6/29,$h=3*Ls*Ls,Z_=Ls*Ls*Ls,H_=Math.PI/180,X_=180/Math.PI;function Gh(r){return r>Z_?Math.pow(r,1/3):r/$h+vf}function qh(r){return r>Ls?r*r*r:$h*(r-vf)}function Wh(r){return 255*(r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055)}function Bc(r){return(r/=255)<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function xf(r){const t=Bc(r.r),i=Bc(r.g),a=Bc(r.b),u=Gh((.4124564*t+.3575761*i+.1804375*a)/yf),p=Gh((.2126729*t+.7151522*i+.072175*a)/1);return{l:116*p-16,a:500*(u-p),b:200*(p-Gh((.0193339*t+.119192*i+.9503041*a)/Vh)),alpha:r.a}}function wf(r){let t=(r.l+16)/116,i=isNaN(r.a)?t:t+r.a/500,a=isNaN(r.b)?t:t-r.b/200;return t=1*qh(t),i=yf*qh(i),a=Vh*qh(a),new Fn(Wh(3.2404542*i-1.5371385*t-.4985314*a),Wh(-.969266*i+1.8760108*t+.041556*a),Wh(.0556434*i-.2040259*t+1.0572252*a),r.alpha)}function K_(r,t,i){const a=t-r;return r+i*(a>180||a<-180?a-360*Math.round(a/360):a)}const Pl={forward:xf,reverse:wf,interpolate:function(r,t,i){return{l:Wt(r.l,t.l,i),a:Wt(r.a,t.a,i),b:Wt(r.b,t.b,i),alpha:Wt(r.alpha,t.alpha,i)}}},va={forward:function(r){const{l:t,a:i,b:a}=xf(r),u=Math.atan2(a,i)*X_;return{h:u<0?u+360:u,c:Math.sqrt(i*i+a*a),l:t,alpha:r.a}},reverse:function(r){const t=r.h*H_,i=r.c;return wf({l:r.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:r.alpha})},interpolate:function(r,t,i){return{h:K_(r.h,t.h,i),c:Wt(r.c,t.c,i),l:Wt(r.l,t.l,i),alpha:Wt(r.alpha,t.alpha,i)}}};var Zh=Object.freeze({__proto__:null,hcl:va,lab:Pl});class zl{constructor(t,i,a,u,p){this.type=t,this.operator=i,this.interpolation=a,this.input=u,this.labels=[],this.outputs=[];for(const[g,y]of p)this.labels.push(g),this.outputs.push(y)}static interpolationFactor(t,i,a,u){let p=0;if(t.name==="exponential")p=Hh(i,t.base,a,u);else if(t.name==="linear")p=Hh(i,1,a,u);else if(t.name==="cubic-bezier"){const g=t.controlPoints;p=new Ke(g[0],g[1],g[2],g[3]).solve(Hh(i,1,a,u))}return p}static parse(t,i){let[a,u,p,...g]=t;if(!Array.isArray(u)||u.length===0)return i.error("Expected an interpolation type expression.",1);if(u[0]==="linear")u={name:"linear"};else if(u[0]==="exponential"){const b=u[1];if(typeof b!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);u={name:"exponential",base:b}}else{if(u[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(u[0])}`,1,0);{const b=u.slice(1);if(b.length!==4||b.some(A=>typeof A!="number"||A<0||A>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);u={name:"cubic-bezier",controlPoints:b}}}if(t.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(p=i.parse(p,2,lt),!p)return null;const y=[];let w=null;a==="interpolate-hcl"||a==="interpolate-lab"?w=si:i.expectedType&&i.expectedType.kind!=="value"&&(w=i.expectedType);for(let b=0;b=A)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);const R=i.parse(I,L,w);if(!R)return null;w=w||R.type,y.push([A,R])}return w.kind==="number"||w.kind==="color"||w.kind==="array"&&w.itemType.kind==="number"&&typeof w.N=="number"?new zl(w,a,u,p,y):i.error(`Type ${Sn(w)} is not interpolatable.`)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const u=this.input.evaluate(t);if(u<=i[0])return a[0].evaluate(t);const p=i.length;if(u>=i[p-1])return a[p-1].evaluate(t);const g=Dc(i,u),y=zl.interpolationFactor(this.interpolation,u,i[g],i[g+1]),w=a[g].evaluate(t),b=a[g+1].evaluate(t);return this.operator==="interpolate"?Ml[this.type.kind.toLowerCase()](w,b,y):this.operator==="interpolate-hcl"?va.reverse(va.interpolate(va.forward(w),va.forward(b),y)):Pl.reverse(Pl.interpolate(Pl.forward(w),Pl.forward(b),y))}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,t,this.input.serialize()];for(let a=0;aEo(u,y.type));return new Fc(g?Nt:a,p)}evaluate(t){let i,a=null,u=0;for(const p of this.args){if(u++,a=p.evaluate(t),a&&a instanceof gi&&!a.available&&(i||(i=a),a=null,u===this.args.length))return i;if(a!==null)break}return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(i=>{t.push(i.serialize())}),t}}var Xh=Fc;class Nc{constructor(t,i){this.type=i.type,this.bindings=[].concat(t),this.result=i}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const i of this.bindings)t(i[1]);t(this.result)}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let p=1;p=a.length)throw new Er(`Array index out of bounds: ${i} > ${a.length-1}.`);if(i!==Math.floor(i))throw new Er(`Array index must be an integer, but found ${i} instead.`);return a[i]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Y_=Kh;class Yh{constructor(t,i){this.type=Ft,this.needle=t,this.haystack=i}static parse(t,i){if(t.length!==3)return i.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,Nt);return a&&u?wl(a.type,[Ft,$t,lt,da,Nt])?new Yh(a,u):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(a.type)} instead`):null}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(a==null)return!1;if(!bl(i,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(Ln(i))} instead.`);if(!bl(a,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Sn(Ln(a))} instead.`);return a.indexOf(i)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Uc=Yh;class Ll{constructor(t,i,a){this.type=lt,this.needle=t,this.haystack=i,this.fromIndex=a}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,Nt);if(!a||!u)return null;if(!wl(a.type,[Ft,$t,lt,da,Nt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(a.type)} instead`);if(t.length===4){const p=i.parse(t[3],3,lt);return p?new Ll(a,u,p):null}return new Ll(a,u)}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!bl(i,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Sn(Ln(i))} instead.`);if(!bl(a,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Sn(Ln(a))} instead.`);if(this.fromIndex){const u=this.fromIndex.evaluate(t);return a.indexOf(i,u)}return a.indexOf(i)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Ef=Ll;class Jh{constructor(t,i,a,u,p,g){this.inputType=t,this.type=i,this.input=a,this.cases=u,this.outputs=p,this.otherwise=g}static parse(t,i){if(t.length<5)return i.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return i.error("Expected an even number of arguments.");let a,u;i.expectedType&&i.expectedType.kind!=="value"&&(u=i.expectedType);const p={},g=[];for(let b=2;bNumber.MAX_SAFE_INTEGER)return M.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof R=="number"&&Math.floor(R)!==R)return M.error("Numeric branch labels must be integer values.");if(a){if(M.checkSubtype(a,Ln(R)))return null}else a=Ln(R);if(p[String(R)]!==void 0)return M.error("Branch labels must be unique.");p[String(R)]=g.length}const L=i.parse(I,b,u);if(!L)return null;u=u||L.type,g.push(L)}const y=i.parse(t[1],1,Nt);if(!y)return null;const w=i.parse(t[t.length-1],t.length-1,u);return w?y.type.kind!=="value"&&i.concat(1).checkSubtype(a,y.type)?null:new Jh(a,u,y,p,g,w):null}evaluate(t){const i=this.input.evaluate(t);return(Ln(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),a=[],u={};for(const g of i){const y=u[this.cases[g]];y===void 0?(u[this.cases[g]]=a.length,a.push([this.cases[g],[g]])):a[y][1].push(g)}const p=g=>this.inputType.kind==="number"?Number(g):g;for(const[g,y]of a)t.push(y.length===1?p(y[0]):y.map(p)),t.push(this.outputs[g].serialize());return t.push(this.otherwise.serialize()),t}}var J_=Jh;class Qh{constructor(t,i,a){this.type=t,this.branches=i,this.otherwise=a}static parse(t,i){if(t.length<4)return i.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return i.error("Expected an odd number of arguments.");let a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);const u=[];for(let g=1;gi.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(i=>{t.push(i.serialize())}),t}}var Tf=Qh;class Rl{constructor(t,i,a,u){this.type=t,this.input=i,this.beginIndex=a,this.endIndex=u}static parse(t,i){if(t.length<=2||t.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=i.parse(t[1],1,Nt),u=i.parse(t[2],2,lt);if(!a||!u)return null;if(!wl(a.type,[mi(Nt),$t,Nt]))return i.error(`Expected first argument to be of type array or string, but found ${Sn(a.type)} instead`);if(t.length===4){const p=i.parse(t[3],3,lt);return p?new Rl(a.type,a,u,p):null}return new Rl(a.type,a,u)}evaluate(t){const i=this.input.evaluate(t),a=this.beginIndex.evaluate(t);if(!bl(i,["string","array"]))throw new Er(`Expected first argument to be of type array or string, but found ${Sn(Ln(i))} instead.`);if(this.endIndex){const u=this.endIndex.evaluate(t);return i.slice(a,u)}return i.slice(a)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Sf=Rl;function jc(r,t){return r==="=="||r==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Af(r,t,i,a){return a.compare(t,i)===0}function xa(r,t,i){const a=r!=="=="&&r!=="!=";return class ik{constructor(p,g,y){this.type=Ft,this.lhs=p,this.rhs=g,this.collator=y,this.hasUntypedArgument=p.type.kind==="value"||g.type.kind==="value"}static parse(p,g){if(p.length!==3&&p.length!==4)return g.error("Expected two or three arguments.");const y=p[0];let w=g.parse(p[1],1,Nt);if(!w)return null;if(!jc(y,w.type))return g.concat(1).error(`"${y}" comparisons are not supported for type '${Sn(w.type)}'.`);let b=g.parse(p[2],2,Nt);if(!b)return null;if(!jc(y,b.type))return g.concat(2).error(`"${y}" comparisons are not supported for type '${Sn(b.type)}'.`);if(w.type.kind!==b.type.kind&&w.type.kind!=="value"&&b.type.kind!=="value")return g.error(`Cannot compare types '${Sn(w.type)}' and '${Sn(b.type)}'.`);a&&(w.type.kind==="value"&&b.type.kind!=="value"?w=new To(b.type,[w]):w.type.kind!=="value"&&b.type.kind==="value"&&(b=new To(w.type,[b])));let A=null;if(p.length===4){if(w.type.kind!=="string"&&b.type.kind!=="string"&&w.type.kind!=="value"&&b.type.kind!=="value")return g.error("Cannot use collator to compare non-string types.");if(A=g.parse(p[3],3,ai),!A)return null}return new ik(w,b,A)}evaluate(p){const g=this.lhs.evaluate(p),y=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const w=Ln(g),b=Ln(y);if(w.kind!==b.kind||w.kind!=="string"&&w.kind!=="number")throw new Er(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${w.kind}, ${b.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const w=Ln(g),b=Ln(y);if(w.kind!=="string"||b.kind!=="string")return t(p,g,y)}return this.collator?i(p,g,y,this.collator.evaluate(p)):t(p,g,y)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}serialize(){const p=[r];return this.eachChild(g=>{p.push(g.serialize())}),p}}}const Q_=xa("==",function(r,t,i){return t===i},Af),ey=xa("!=",function(r,t,i){return t!==i},function(r,t,i,a){return!Af(0,t,i,a)}),ty=xa("<",function(r,t,i){return t",function(r,t,i){return t>i},function(r,t,i,a){return a.compare(t,i)>0}),ry=xa("<=",function(r,t,i){return t<=i},function(r,t,i,a){return a.compare(t,i)<=0}),Cf=xa(">=",function(r,t,i){return t>=i},function(r,t,i,a){return a.compare(t,i)>=0});class Vc{constructor(t,i,a,u,p,g){this.type=$t,this.number=t,this.locale=i,this.currency=a,this.unit=u,this.minFractionDigits=p,this.maxFractionDigits=g}static parse(t,i){if(t.length!==3)return i.error("Expected two arguments.");const a=i.parse(t[1],1,lt);if(!a)return null;const u=t[2];if(typeof u!="object"||Array.isArray(u))return i.error("NumberFormat options argument must be an object.");let p=null;if(u.locale&&(p=i.parse(u.locale,1,$t),!p))return null;let g=null;if(u.currency&&(g=i.parse(u.currency,1,$t),!g))return null;let y=null;if(u.unit&&(y=i.parse(u.unit,1,$t),!y))return null;let w=null;if(u["min-fraction-digits"]&&(w=i.parse(u["min-fraction-digits"],1,lt),!w))return null;let b=null;return u["max-fraction-digits"]&&(b=i.parse(u["max-fraction-digits"],1,lt),!b)?null:new Vc(a,p,g,y,w,b)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class wa{constructor(t){this.type=lt,this.input=t}static parse(t,i){if(t.length!==2)return i.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=i.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Sn(a.type)} instead.`):new wa(a):null}evaluate(t){const i=this.input.evaluate(t);if(typeof i=="string"||Array.isArray(i))return i.length;throw new Er(`Expected value to be of type string or array, but found ${Sn(Ln(i))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(i=>{t.push(i.serialize())}),t}}const If={"==":Q_,"!=":ey,">":ny,"<":ty,">=":Cf,"<=":ry,array:To,at:Y_,boolean:To,case:Tf,coalesce:Xh,collator:Cl,format:ns,image:Mc,in:Uc,"index-of":Ef,interpolate:no,"interpolate-hcl":no,"interpolate-lab":no,length:wa,let:bf,literal:Ms,match:J_,number:To,"number-format":Vc,object:To,slice:Sf,step:jh,string:To,"to-boolean":fa,"to-color":fa,"to-number":fa,"to-string":fa,var:_f,within:Lc};function kf(r,[t,i,a,u]){t=t.evaluate(r),i=i.evaluate(r),a=a.evaluate(r);const p=u?u.evaluate(r):1,g=pf(t,i,a,p);if(g)throw new Er(g);return new Fn(t/255*p,i/255*p,a/255*p,p)}function Io(r,t){return r in t}function $c(r,t){const i=t[r];return i===void 0?null:i}function _i(r){return{type:r}}So.register(If,{error:[{kind:"error"},[$t],(r,[t])=>{throw new Er(t.evaluate(r))}],typeof:[$t,[Nt],(r,[t])=>Sn(Ln(t.evaluate(r)))],"to-rgba":[mi(lt,4),[si],(r,[t])=>t.evaluate(r).toArray()],rgb:[si,[lt,lt,lt],kf],rgba:[si,[lt,lt,lt,lt],kf],has:{type:Ft,overloads:[[[$t],(r,[t])=>Io(t.evaluate(r),r.properties())],[[$t,Ri],(r,[t,i])=>Io(t.evaluate(r),i.evaluate(r))]]},get:{type:Nt,overloads:[[[$t],(r,[t])=>$c(t.evaluate(r),r.properties())],[[$t,Ri],(r,[t,i])=>$c(t.evaluate(r),i.evaluate(r))]]},"feature-state":[Nt,[$t],(r,[t])=>$c(t.evaluate(r),r.featureState||{})],properties:[Ri,[],r=>r.properties()],"geometry-type":[$t,[],r=>r.geometryType()],id:[Nt,[],r=>r.id()],zoom:[lt,[],r=>r.globals.zoom],pitch:[lt,[],r=>r.globals.pitch||0],"distance-from-center":[lt,[],r=>r.distanceFromCenter()],"heatmap-density":[lt,[],r=>r.globals.heatmapDensity||0],"line-progress":[lt,[],r=>r.globals.lineProgress||0],"sky-radial-progress":[lt,[],r=>r.globals.skyRadialProgress||0],accumulated:[Nt,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[lt,_i(lt),(r,t)=>{let i=0;for(const a of t)i+=a.evaluate(r);return i}],"*":[lt,_i(lt),(r,t)=>{let i=1;for(const a of t)i*=a.evaluate(r);return i}],"-":{type:lt,overloads:[[[lt,lt],(r,[t,i])=>t.evaluate(r)-i.evaluate(r)],[[lt],(r,[t])=>-t.evaluate(r)]]},"/":[lt,[lt,lt],(r,[t,i])=>t.evaluate(r)/i.evaluate(r)],"%":[lt,[lt,lt],(r,[t,i])=>t.evaluate(r)%i.evaluate(r)],ln2:[lt,[],()=>Math.LN2],pi:[lt,[],()=>Math.PI],e:[lt,[],()=>Math.E],"^":[lt,[lt,lt],(r,[t,i])=>Math.pow(t.evaluate(r),i.evaluate(r))],sqrt:[lt,[lt],(r,[t])=>Math.sqrt(t.evaluate(r))],log10:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))/Math.LN10],ln:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))],log2:[lt,[lt],(r,[t])=>Math.log(t.evaluate(r))/Math.LN2],sin:[lt,[lt],(r,[t])=>Math.sin(t.evaluate(r))],cos:[lt,[lt],(r,[t])=>Math.cos(t.evaluate(r))],tan:[lt,[lt],(r,[t])=>Math.tan(t.evaluate(r))],asin:[lt,[lt],(r,[t])=>Math.asin(t.evaluate(r))],acos:[lt,[lt],(r,[t])=>Math.acos(t.evaluate(r))],atan:[lt,[lt],(r,[t])=>Math.atan(t.evaluate(r))],min:[lt,_i(lt),(r,t)=>Math.min(...t.map(i=>i.evaluate(r)))],max:[lt,_i(lt),(r,t)=>Math.max(...t.map(i=>i.evaluate(r)))],abs:[lt,[lt],(r,[t])=>Math.abs(t.evaluate(r))],round:[lt,[lt],(r,[t])=>{const i=t.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[lt,[lt],(r,[t])=>Math.floor(t.evaluate(r))],ceil:[lt,[lt],(r,[t])=>Math.ceil(t.evaluate(r))],"filter-==":[Ft,[$t,Nt],(r,[t,i])=>r.properties()[t.value]===i.value],"filter-id-==":[Ft,[Nt],(r,[t])=>r.id()===t.value],"filter-type-==":[Ft,[$t],(r,[t])=>r.geometryType()===t.value],"filter-<":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a{const i=r.id(),a=t.value;return typeof i==typeof a&&i":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a>u}],"filter-id->":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>a}],"filter-<=":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a<=u}],"filter-id-<=":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i<=a}],"filter->=":[Ft,[$t,Nt],(r,[t,i])=>{const a=r.properties()[t.value],u=i.value;return typeof a==typeof u&&a>=u}],"filter-id->=":[Ft,[Nt],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>=a}],"filter-has":[Ft,[Nt],(r,[t])=>t.value in r.properties()],"filter-has-id":[Ft,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ft,[mi($t)],(r,[t])=>t.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ft,[mi(Nt)],(r,[t])=>t.value.indexOf(r.id())>=0],"filter-in-small":[Ft,[$t,mi(Nt)],(r,[t,i])=>i.value.indexOf(r.properties()[t.value])>=0],"filter-in-large":[Ft,[$t,mi(Nt)],(r,[t,i])=>function(a,u,p,g){for(;p<=g;){const y=p+g>>1;if(u[y]===a)return!0;u[y]>a?g=y-1:p=y+1}return!1}(r.properties()[t.value],i.value,0,i.value.length-1)],all:{type:Ft,overloads:[[[Ft,Ft],(r,[t,i])=>t.evaluate(r)&&i.evaluate(r)],[_i(Ft),(r,t)=>{for(const i of t)if(!i.evaluate(r))return!1;return!0}]]},any:{type:Ft,overloads:[[[Ft,Ft],(r,[t,i])=>t.evaluate(r)||i.evaluate(r)],[_i(Ft),(r,t)=>{for(const i of t)if(i.evaluate(r))return!0;return!1}]]},"!":[Ft,[Ft],(r,[t])=>!t.evaluate(r)],"is-supported-script":[Ft,[$t],(r,[t])=>{const i=r.globals&&r.globals.isSupportedScript;return!i||i(t.evaluate(r))}],upcase:[$t,[$t],(r,[t])=>t.evaluate(r).toUpperCase()],downcase:[$t,[$t],(r,[t])=>t.evaluate(r).toLowerCase()],concat:[$t,_i(Nt),(r,t)=>t.map(i=>Al(i.evaluate(r))).join("")],"resolved-locale":[$t,[ai],(r,[t])=>t.evaluate(r).resolvedLocale()]});var Dl=If;function Mf(r){return{result:"success",value:r}}function Rs(r){return{result:"error",value:r}}function ba(r){return r["property-type"]==="data-driven"}function Gc(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function qc(r){return!!r.expression&&r.expression.interpolated}function Zt(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Ol(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function Pf(r){return r}function Wc(r,t){const i=t.type==="color",a=r.stops&&typeof r.stops[0][0]=="object",u=a||!(a||r.property!==void 0),p=r.type||(qc(t)?"exponential":"interval");if(i&&((r=bo({},r)).stops&&(r.stops=r.stops.map(b=>[b[0],Fn.parse(b[1])])),r.default=Fn.parse(r.default?r.default:t.default)),r.colorSpace&&r.colorSpace!=="rgb"&&!Zh[r.colorSpace])throw new Error(`Unknown color space: ${r.colorSpace}`);let g,y,w;if(p==="exponential")g=ko;else if(p==="interval")g=Zc;else if(p==="categorical"){g=zf,y=Object.create(null);for(const b of r.stops)y[b[0]]=b[1];w=typeof r.stops[0][0]}else{if(p!=="identity")throw new Error(`Unknown function type "${p}"`);g=Lf}if(a){const b={},A=[];for(let L=0;LL[0]),evaluate:({zoom:L},R)=>ko({stops:I,base:r.base},t,L).evaluate(L,R)}}if(u){const b=p==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:no.interpolationFactor.bind(void 0,b),zoomStops:r.stops.map(A=>A[0]),evaluate:({zoom:A})=>g(r,t,A,y,w)}}return{kind:"source",evaluate(b,A){const I=A&&A.properties?A.properties[r.property]:void 0;return I===void 0?Ea(r.default,t.default):g(r,t,I,y,w)}}}function Ea(r,t,i){return r!==void 0?r:t!==void 0?t:i!==void 0?i:void 0}function zf(r,t,i,a,u){return Ea(typeof i===u?a[i]:void 0,r.default,t.default)}function Zc(r,t,i){if(Zt(i)!=="number")return Ea(r.default,t.default);const a=r.stops.length;if(a===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[a-1][0])return r.stops[a-1][1];const u=Dc(r.stops.map(p=>p[0]),i);return r.stops[u][1]}function ko(r,t,i){const a=r.base!==void 0?r.base:1;if(Zt(i)!=="number")return Ea(r.default,t.default);const u=r.stops.length;if(u===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[u-1][0])return r.stops[u-1][1];const p=Dc(r.stops.map(A=>A[0]),i),g=function(A,I,M,L){const R=L-M,F=A-M;return R===0?0:I===1?F/R:(Math.pow(I,F)-1)/(Math.pow(I,R)-1)}(i,a,r.stops[p][0],r.stops[p+1][0]),y=r.stops[p][1],w=r.stops[p+1][1];let b=Ml[t.type]||Pf;if(r.colorSpace&&r.colorSpace!=="rgb"){const A=Zh[r.colorSpace];b=(I,M)=>A.reverse(A.interpolate(A.forward(I),A.forward(M),g))}return typeof y.evaluate=="function"?{evaluate(...A){const I=y.evaluate.apply(void 0,A),M=w.evaluate.apply(void 0,A);if(I!==void 0&&M!==void 0)return b(I,M,g)}}:b(y,w,g)}function Lf(r,t,i){return t.type==="color"?i=Fn.parse(i):t.type==="formatted"?i=qr.fromString(i.toString()):t.type==="resolvedImage"?i=gi.fromString(i.toString()):Zt(i)===t.type||t.type==="enum"&&t.values[i]||(i=void 0),Ea(i,r.default,t.default)}class Hc{constructor(t,i){this.expression=t,this._warningHistory={},this._evaluator=new Lh,this._defaultValue=i?function(a){return a.type==="color"&&(Ol(a.default)||Array.isArray(a.default))?new Fn(0,0,0,0):a.type==="color"?Fn.parse(a.default)||null:a.default===void 0?null:a.default}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(t,i,a,u,p,g,y,w){return this._evaluator.globals=t,this._evaluator.feature=i,this._evaluator.featureState=a,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=g,this._evaluator.featureTileCoord=y||null,this._evaluator.featureDistanceData=w||null,this.expression.evaluate(this._evaluator)}evaluate(t,i,a,u,p,g,y,w){this._evaluator.globals=t,this._evaluator.feature=i||null,this._evaluator.featureState=a||null,this._evaluator.canonical=u||null,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=g||null,this._evaluator.featureTileCoord=y||null,this._evaluator.featureDistanceData=w||null;try{const b=this.expression.evaluate(this._evaluator);if(b==null||typeof b=="number"&&b!=b)return this._defaultValue;if(this._enumValues&&!(b in this._enumValues))throw new Er(`Expected value to be one of ${Object.keys(this._enumValues).map(A=>JSON.stringify(A)).join(", ")}, but found ${JSON.stringify(b)} instead.`);return b}catch(b){return this._warningHistory[b.message]||(this._warningHistory[b.message]=!0,typeof console<"u"&&console.warn(b.message)),this._defaultValue}}}function Ta(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in Dl}function Sa(r,t){const i=new Nh(Dl,[],t?function(u){const p={color:si,string:$t,number:lt,enum:$t,boolean:Ft,formatted:xl,resolvedImage:ks};return u.type==="array"?mi(p[u.value]||Nt,u.length):p[u.type]}(t):void 0),a=i.parse(r,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Mf(new Hc(a,t)):Rs(i.errors)}class ed{constructor(t,i){this.kind=t,this._styleExpression=i,this.isStateDependent=t!=="constant"&&!Co(i.expression)}evaluateWithoutErrorHandling(t,i,a,u,p,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,u,p,g)}evaluate(t,i,a,u,p,g){return this._styleExpression.evaluate(t,i,a,u,p,g)}}class Bl{constructor(t,i,a,u){this.kind=t,this.zoomStops=a,this._styleExpression=i,this.isStateDependent=t!=="camera"&&!Co(i.expression),this.interpolationType=u}evaluateWithoutErrorHandling(t,i,a,u,p,g){return this._styleExpression.evaluateWithoutErrorHandling(t,i,a,u,p,g)}evaluate(t,i,a,u,p,g){return this._styleExpression.evaluate(t,i,a,u,p,g)}interpolationFactor(t,i,a){return this.interpolationType?no.interpolationFactor(this.interpolationType,t,i,a):0}}function Fl(r,t){if((r=Sa(r,t)).result==="error")return r;const i=r.value.expression,a=ya(i);if(!a&&!ba(t))return Rs([new eo("","data expressions not supported")]);const u=zs(i,["zoom","pitch","distance-from-center"]);if(!u&&!Gc(t))return Rs([new eo("","zoom expressions not supported")]);const p=Kc(i);return p||u?p instanceof eo?Rs([p]):p instanceof no&&!qc(t)?Rs([new eo("",'"interpolate" expressions cannot be used with this property')]):Mf(p?new Bl(a?"camera":"composite",r.value,p.labels,p instanceof no?p.interpolation:void 0):new ed(a?"constant":"source",r.value)):Rs([new eo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xc{constructor(t,i){this._parameters=t,this._specification=i,bo(this,Wc(this._parameters,this._specification))}static deserialize(t){return new Xc(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Kc(r){let t=null;if(r instanceof bf)t=Kc(r.result);else if(r instanceof Xh){for(const i of r.args)if(t=Kc(i),t)break}else(r instanceof jh||r instanceof no)&&r.input instanceof So&&r.input.name==="zoom"&&(t=r);return t instanceof eo||r.eachChild(i=>{const a=Kc(i);a instanceof eo?t=a:!t&&a?t=new eo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new eo("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}class ct{constructor(t,i,a,u){this.message=(t?`${t}: `:"")+a,u&&(this.identifier=u),i!=null&&i.__line__&&(this.line=i.__line__)}}function Di(r){const t=r.key,i=r.value,a=r.valueSpec||{},u=r.objectElementValidators||{},p=r.style,g=r.styleSpec;let y=[];const w=Zt(i);if(w!=="object")return[new ct(t,i,`object expected, ${w} found`)];for(const b in i){const A=b.split(".")[0];let I;u[A]?I=u[A]:a[A]?I=kr:u["*"]?I=u["*"]:a["*"]&&(I=kr),I?y=y.concat(I({key:(t&&`${t}.`)+b,value:i[b],valueSpec:a[A]||a["*"],style:p,styleSpec:g,object:i,objectKey:b},i)):y.push(new ct(t,i[b],`unknown property "${b}"`))}for(const b in a)u[b]||a[b].required&&a[b].default===void 0&&i[b]===void 0&&y.push(new ct(t,i,`missing required property "${b}"`));return y}function Rf(r){const t=r.value,i=r.valueSpec,a=r.style,u=r.styleSpec,p=r.key,g=r.arrayElementValidator||kr;if(Zt(t)!=="array")return[new ct(p,t,`array expected, ${Zt(t)} found`)];if(i.length&&t.length!==i.length)return[new ct(p,t,`array length ${i.length} expected, length ${t.length} found`)];if(i["min-length"]&&t.lengthp)return[new ct(t,i,`${i} is greater than the maximum value ${p}`)]}return[]}function Ul(r){const t=r.valueSpec,i=$n(r.value.type);let a,u,p,g={};const y=i!=="categorical"&&r.value.property===void 0,w=!y,b=Zt(r.value.stops)==="array"&&Zt(r.value.stops[0])==="array"&&Zt(r.value.stops[0][0])==="object",A=Di({key:r.key,value:r.value,valueSpec:r.styleSpec.function,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(L){if(i==="identity")return[new ct(L.key,L.value,'identity function may not have a "stops" property')];let R=[];const F=L.value;return R=R.concat(Rf({key:L.key,value:F,valueSpec:L.valueSpec,style:L.style,styleSpec:L.styleSpec,arrayElementValidator:I})),Zt(F)==="array"&&F.length===0&&R.push(new ct(L.key,F,"array must have at least one stop")),R},default:function(L){return kr({key:L.key,value:L.value,valueSpec:t,style:L.style,styleSpec:L.styleSpec})}}});return i==="identity"&&y&&A.push(new ct(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||A.push(new ct(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!qc(r.valueSpec)&&A.push(new ct(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(w&&!ba(r.valueSpec)?A.push(new ct(r.key,r.value,"property functions not supported")):y&&!Gc(r.valueSpec)&&A.push(new ct(r.key,r.value,"zoom functions not supported"))),i!=="categorical"&&!b||r.value.property!==void 0||A.push(new ct(r.key,r.value,'"property" property is required')),A;function I(L){let R=[];const F=L.value,$=L.key;if(Zt(F)!=="array")return[new ct($,F,`array expected, ${Zt(F)} found`)];if(F.length!==2)return[new ct($,F,`array length 2 expected, length ${F.length} found`)];if(b){if(Zt(F[0])!=="object")return[new ct($,F,`object expected, ${Zt(F[0])} found`)];if(F[0].zoom===void 0)return[new ct($,F,"object stop key must have zoom")];if(F[0].value===void 0)return[new ct($,F,"object stop key must have value")];const K=$n(F[0].zoom);if(typeof K!="number")return[new ct($,F[0].zoom,"stop zoom values must be numbers")];if(p&&p>K)return[new ct($,F[0].zoom,"stop zoom values must appear in ascending order")];K!==p&&(p=K,u=void 0,g={}),R=R.concat(Di({key:`${$}[0]`,value:F[0],valueSpec:{zoom:{}},style:L.style,styleSpec:L.styleSpec,objectElementValidators:{zoom:Nl,value:M}}))}else R=R.concat(M({key:`${$}[0]`,value:F[0],valueSpec:{},style:L.style,styleSpec:L.styleSpec},F));return Ta(dr(F[1]))?R.concat([new ct(`${$}[1]`,F[1],"expressions are not allowed in function stops.")]):R.concat(kr({key:`${$}[1]`,value:F[1],valueSpec:t,style:L.style,styleSpec:L.styleSpec}))}function M(L,R){const F=Zt(L.value),$=$n(L.value),K=L.value!==null?L.value:R;if(a){if(F!==a)return[new ct(L.key,K,`${F} stop domain type must match previous stop domain type ${a}`)]}else a=F;if(F!=="number"&&F!=="string"&&F!=="boolean"&&typeof $!="number"&&typeof $!="string"&&typeof $!="boolean")return[new ct(L.key,K,"stop domain value must be a number, string, or boolean")];if(F!=="number"&&i!=="categorical"){let se=`number expected, ${F} found`;return ba(t)&&i===void 0&&(se+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ct(L.key,K,se)]}return i!=="categorical"||F!=="number"||typeof $=="number"&&isFinite($)&&Math.floor($)===$?i!=="categorical"&&F==="number"&&typeof $=="number"&&typeof u=="number"&&u!==void 0&&$new ct(`${r.key}${a.key}`,r.value,a.message));const i=t.value.expression||t.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new ct(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Co(i))return[new ct(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter")return jl(i,r);if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!zs(i,["zoom","feature-state"]))return[new ct(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!ya(i))return[new ct(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function jl(r,t){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(t.valueSpec&&t.valueSpec.expression)for(const u of t.valueSpec.expression.parameters)i.delete(u);if(i.size===0)return[];const a=[];return r instanceof So&&i.has(r.name)?[new ct(t.key,t.value,`["${r.name}"] expression is not supported in a filter for a ${t.object.type} layer with id: ${t.object.id}`)]:(r.eachChild(u=>{a.push(...jl(u,t))}),a)}function Yc(r){const t=r.key,i=r.value,a=r.valueSpec,u=[];return Array.isArray(a.values)?a.values.indexOf($n(i))===-1&&u.push(new ct(t,i,`expected one of [${a.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(a.values).indexOf($n(i))===-1&&u.push(new ct(t,i,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(i)} found`)),u}function td(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const t of r.slice(1))if(!td(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}function Jc(r,t="fill"){if(r==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};td(r)||(r=Ca(r));const i=r;let a=!0;try{a=function(b){if(!Aa(b))return b;let A=dr(b);return Qc(A),A=Df(A),A}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. -This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md -and paste the contents of this message in the report. -Thank you! -Filter Expression: -${JSON.stringify(i,null,2)} - `)}const u=Re[`filter_${t}`],p=Sa(a,u);let g=null;if(p.result==="error")throw new Error(p.value.map(b=>`${b.key}: ${b.message}`).join(", "));g=(b,A,I)=>p.value.evaluate(b,A,{},I);let y=null,w=null;if(a!==i){const b=Sa(i,u);if(b.result==="error")throw new Error(b.value.map(A=>`${A.key}: ${A.message}`).join(", "));y=(A,I,M,L,R)=>b.value.evaluate(A,I,{},M,void 0,void 0,L,R),w=!ya(b.value.expression)}return{filter:g,dynamicFilter:y||void 0,needGeometry:Of(a),needFeature:!!w}}function Df(r){if(!Array.isArray(r))return r;const t=function(i){if(nd.has(i[0])){for(let a=1;aDf(i))}function Qc(r){let t=!1;const i=[];if(r[0]==="case"){for(let a=1;a",">=","<","<=","to-boolean"]);function iy(r,t){return rt?1:0}function Of(r){if(!Array.isArray(r))return!1;if(r[0]==="within")return!0;for(let t=1;t"||t==="<="||t===">="?rd(r[1],r[2],t):t==="any"?(i=r.slice(1),["any"].concat(i.map(Ca))):t==="all"?["all"].concat(r.slice(1).map(Ca)):t==="none"?["all"].concat(r.slice(1).map(Ca).map(eu)):t==="in"?id(r[1],r.slice(2)):t==="!in"?eu(id(r[1],r.slice(2))):t==="has"?od(r[1]):t==="!has"?eu(od(r[1])):t!=="within"||r;var i}function rd(r,t,i){switch(r){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,r,t]}}function id(r,t){if(t.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(i=>typeof i!=typeof t[0])?["filter-in-large",r,["literal",t.sort(iy)]]:["filter-in-small",r,["literal",t]]}}function od(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function eu(r){return["!",r]}function Vl(r){return td(dr(r.value))?pr(bo({},r,{expressionContext:"filter",valueSpec:r.styleSpec[`filter_${r.layerType||"fill"}`]})):$l(r)}function $l(r){const t=r.value,i=r.key;if(Zt(t)!=="array")return[new ct(i,t,`array expected, ${Zt(t)} found`)];const a=r.styleSpec;let u,p=[];if(t.length<1)return[new ct(i,t,"filter array must have at least 1 element")];switch(p=p.concat(Yc({key:`${i}[0]`,value:t[0],valueSpec:a.filter_operator,style:r.style,styleSpec:r.styleSpec})),$n(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&$n(t[1])==="$type"&&p.push(new ct(i,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&p.push(new ct(i,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(u=Zt(t[1]),u!=="string"&&p.push(new ct(`${i}[1]`,t[1],`string expected, ${u} found`)));for(let g=2;g{b in i&&t.push(new ct(a,i[b],`"${b}" is prohibited for ref layers`))}),u.layers.forEach(b=>{$n(b.id)===y&&(w=b)}),w?w.ref?t.push(new ct(a,i.ref,"ref cannot reference another ref layer")):g=$n(w.type):typeof y=="string"&&t.push(new ct(a,i.ref,`ref layer "${y}" not found`))}else if(g!=="background"&&g!=="sky")if(i.source){const w=u.sources&&u.sources[i.source],b=w&&$n(w.type);w?b==="vector"&&g==="raster"?t.push(new ct(a,i.source,`layer "${i.id}" requires a raster source`)):b==="raster"&&g!=="raster"?t.push(new ct(a,i.source,`layer "${i.id}" requires a vector source`)):b!=="vector"||i["source-layer"]?b==="raster-dem"&&g!=="hillshade"?t.push(new ct(a,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):g!=="line"||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||b==="geojson"&&w.lineMetrics||t.push(new ct(a,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ct(a,i,`layer "${i.id}" must specify a "source-layer"`)):t.push(new ct(a,i.source,`source "${i.source}" not found`))}else t.push(new ct(a,i,'missing required property "source"'));return t=t.concat(Di({key:a,value:i,valueSpec:p.layer,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{"*":()=>[],type:()=>kr({key:`${a}.type`,value:i.type,valueSpec:p.layer.type,style:r.style,styleSpec:r.styleSpec,object:i,objectKey:"type"}),filter:w=>Vl(bo({layerType:g},w)),layout:w=>Di({layer:i,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":b=>ad(bo({layerType:g},b))}}),paint:w=>Di({layer:i,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":b=>Bf(bo({layerType:g},b))}})}})),t}function rs(r){const t=r.value,i=r.key,a=Zt(t);return a!=="string"?[new ct(i,t,`string expected, ${a} found`)]:[]}const Nf={promoteId:function({key:r,value:t}){if(Zt(t)==="string")return rs({key:r,value:t});{const i=[];for(const a in t)i.push(...rs({key:`${r}.${a}`,value:t[a]}));return i}}};function Uf(r){const t=r.value,i=r.key,a=r.styleSpec,u=r.style;if(!t.type)return[new ct(i,t,'"type" is required')];const p=$n(t.type);let g;switch(p){case"vector":case"raster":case"raster-dem":return g=Di({key:i,value:t,valueSpec:a[`source_${p.replace("-","_")}`],style:r.style,styleSpec:a,objectElementValidators:Nf}),g;case"geojson":if(g=Di({key:i,value:t,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Nf}),t.cluster)for(const y in t.clusterProperties){const[w,b]=t.clusterProperties[y],A=typeof w=="string"?[w,["accumulated"],["get",y]]:w;g.push(...pr({key:`${i}.${y}.map`,value:b,expressionContext:"cluster-map"})),g.push(...pr({key:`${i}.${y}.reduce`,value:A,expressionContext:"cluster-reduce"}))}return g;case"video":return Di({key:i,value:t,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return Di({key:i,value:t,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new ct(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Yc({key:`${i}.type`,value:t.type,valueSpec:{values:oy(a)},style:u,styleSpec:a})}}function oy(r){return r.source.reduce((t,i)=>{const a=r[i];return a.type.type==="enum"&&(t=t.concat(Object.keys(a.type.values))),t},[])}function jf(r){const t=r.value,i=r.styleSpec,a=i.light,u=r.style;let p=[];const g=Zt(t);if(t===void 0)return p;if(g!=="object")return p=p.concat([new ct("light",t,`object expected, ${g} found`)]),p;for(const y in t){const w=y.match(/^(.*)-transition$/);p=p.concat(w&&a[w[1]]&&a[w[1]].transition?kr({key:y,value:t[y],valueSpec:i.transition,style:u,styleSpec:i}):a[y]?kr({key:y,value:t[y],valueSpec:a[y],style:u,styleSpec:i}):[new ct(y,t[y],`unknown property "${y}"`)])}return p}function ld(r){const t=r.value,i=r.key,a=r.style,u=r.styleSpec,p=u.terrain;let g=[];const y=Zt(t);if(t===void 0)return g;if(y!=="object")return g=g.concat([new ct("terrain",t,`object expected, ${y} found`)]),g;for(const w in t){const b=w.match(/^(.*)-transition$/);g=g.concat(b&&p[b[1]]&&p[b[1]].transition?kr({key:w,value:t[w],valueSpec:u.transition,style:a,styleSpec:u}):p[w]?kr({key:w,value:t[w],valueSpec:p[w],style:a,styleSpec:u}):[new ct(w,t[w],`unknown property "${w}"`)])}if(t.source){const w=a.sources&&a.sources[t.source],b=w&&$n(w.type);w?b!=="raster-dem"&&g.push(new ct(i,t.source,`terrain cannot be used with a source of type ${String(b)}, it only be used with a "raster-dem" source type`)):g.push(new ct(i,t.source,`source "${t.source}" not found`))}else g.push(new ct(i,t,'terrain is missing required property "source"'));return g}function Vf(r){const t=r.value,i=r.style,a=r.styleSpec,u=a.fog;let p=[];const g=Zt(t);if(t===void 0)return p;if(g!=="object")return p=p.concat([new ct("fog",t,`object expected, ${g} found`)]),p;for(const y in t){const w=y.match(/^(.*)-transition$/);p=p.concat(w&&u[w[1]]&&u[w[1]].transition?kr({key:y,value:t[y],valueSpec:a.transition,style:i,styleSpec:a}):u[y]?kr({key:y,value:t[y],valueSpec:u[y],style:i,styleSpec:a}):[new ct(y,t[y],`unknown property "${y}"`)])}return p}const $f={"*":()=>[],array:Rf,boolean:function(r){const t=r.value,i=r.key,a=Zt(t);return a!=="boolean"?[new ct(i,t,`boolean expected, ${a} found`)]:[]},number:Nl,color:function(r){const t=r.key,i=r.value,a=Zt(i);return a!=="string"?[new ct(t,i,`color expected, ${a} found`)]:Ah(i)===null?[new ct(t,i,`color expected, "${i}" found`)]:[]},enum:Yc,filter:Vl,function:Ul,layer:Ff,object:Di,source:Uf,light:jf,terrain:ld,fog:Vf,string:rs,formatted:function(r){return rs(r).length===0?[]:pr(r)},resolvedImage:function(r){return rs(r).length===0?[]:pr(r)},projection:function(r){const t=r.value,i=r.styleSpec,a=i.projection,u=r.style;let p=[];const g=Zt(t);if(g==="object")for(const y in t)p=p.concat(kr({key:y,value:t[y],valueSpec:a[y],style:u,styleSpec:i}));else g!=="string"&&(p=p.concat([new ct("projection",t,`object or string expected, ${g} found`)]));return p}};function kr(r){const t=r.value,i=r.valueSpec,a=r.styleSpec;return i.expression&&Ol($n(t))?Ul(r):i.expression&&Ta(dr(t))?pr(r):i.type&&$f[i.type]?$f[i.type](r):Di(bo({},r,{valueSpec:i.type?a[i.type]:i}))}function sy(r){const t=r.value,i=r.key,a=rs(r);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new ct(i,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new ct(i,t,'"glyphs" url must include a "{range}" token'))),a}function Gf(r,t=Re){return yi(kr({key:"",value:r,valueSpec:t.$root,styleSpec:t,style:r,objectElementValidators:{glyphs:sy,"*":()=>[]}}))}const ay=r=>yi(Bf(r)),ly=r=>yi(ad(r));function yi(r){return r.slice().sort((t,i)=>t.line&&i.line?t.line-i.line:0)}function qf(r,t){let i=!1;if(t&&t.length)for(const a of t)r.fire(new wo(new Error(a.message))),i=!0;return i}var cy=ro,Oi=3;function ro(r,t,i){var a=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;var u=new Int32Array(this.arrayBuffer);r=u[0],this.d=(t=u[1])+2*(i=u[2]);for(var p=0;p=A[L+0]&&a>=A[L+1])?(g[M]=!0,p.push(b[M])):g[M]=!1}}},ro.prototype._forEachCell=function(r,t,i,a,u,p,g,y){for(var w=this._convertToCellCoord(r),b=this._convertToCellCoord(t),A=this._convertToCellCoord(i),I=this._convertToCellCoord(a),M=w;M<=A;M++)for(var L=b;L<=I;L++){var R=this.d*L+M;if((!y||y(this._convertFromCellCoord(M),this._convertFromCellCoord(L),this._convertFromCellCoord(M+1),this._convertFromCellCoord(L+1)))&&u.call(this,r,t,i,a,R,p,g,y))return}},ro.prototype._convertFromCellCoord=function(r){return(r-this.padding)/this.scale},ro.prototype._convertToCellCoord=function(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))},ro.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var r=this.cells,t=Oi+this.cells.length+1+1,i=0,a=0;a=0||(u[p]=Ia(r[p],t)));r instanceof Error&&(u.message=r.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(u.$name=a),u}throw new Error("can't serialize object of type "+typeof r)}function Os(r){if(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||cd(r)||ud(r)||ArrayBuffer.isView(r)||r instanceof k.ImageData)return r;if(Array.isArray(r))return r.map(Os);if(typeof r=="object"){const t=r.$name||"Object",{klass:i}=tu[t];if(!i)throw new Error(`can't deserialize unregistered class ${t}`);if(i.deserialize)return i.deserialize(r);const a=Object.create(i.prototype);for(const u of Object.keys(r))u!=="$name"&&(a[u]=Os(r[u]));return a}throw new Error("can't deserialize object of type "+typeof r)}const at={"Latin-1 Supplement":r=>r>=128&&r<=255,Arabic:r=>r>=1536&&r<=1791,"Arabic Supplement":r=>r>=1872&&r<=1919,"Arabic Extended-A":r=>r>=2208&&r<=2303,"Hangul Jamo":r=>r>=4352&&r<=4607,"Unified Canadian Aboriginal Syllabics":r=>r>=5120&&r<=5759,Khmer:r=>r>=6016&&r<=6143,"Unified Canadian Aboriginal Syllabics Extended":r=>r>=6320&&r<=6399,"General Punctuation":r=>r>=8192&&r<=8303,"Letterlike Symbols":r=>r>=8448&&r<=8527,"Number Forms":r=>r>=8528&&r<=8591,"Miscellaneous Technical":r=>r>=8960&&r<=9215,"Control Pictures":r=>r>=9216&&r<=9279,"Optical Character Recognition":r=>r>=9280&&r<=9311,"Enclosed Alphanumerics":r=>r>=9312&&r<=9471,"Geometric Shapes":r=>r>=9632&&r<=9727,"Miscellaneous Symbols":r=>r>=9728&&r<=9983,"Miscellaneous Symbols and Arrows":r=>r>=11008&&r<=11263,"CJK Radicals Supplement":r=>r>=11904&&r<=12031,"Kangxi Radicals":r=>r>=12032&&r<=12255,"Ideographic Description Characters":r=>r>=12272&&r<=12287,"CJK Symbols and Punctuation":r=>r>=12288&&r<=12351,Hiragana:r=>r>=12352&&r<=12447,Katakana:r=>r>=12448&&r<=12543,Bopomofo:r=>r>=12544&&r<=12591,"Hangul Compatibility Jamo":r=>r>=12592&&r<=12687,Kanbun:r=>r>=12688&&r<=12703,"Bopomofo Extended":r=>r>=12704&&r<=12735,"CJK Strokes":r=>r>=12736&&r<=12783,"Katakana Phonetic Extensions":r=>r>=12784&&r<=12799,"Enclosed CJK Letters and Months":r=>r>=12800&&r<=13055,"CJK Compatibility":r=>r>=13056&&r<=13311,"CJK Unified Ideographs Extension A":r=>r>=13312&&r<=19903,"Yijing Hexagram Symbols":r=>r>=19904&&r<=19967,"CJK Unified Ideographs":r=>r>=19968&&r<=40959,"Yi Syllables":r=>r>=40960&&r<=42127,"Yi Radicals":r=>r>=42128&&r<=42191,"Hangul Jamo Extended-A":r=>r>=43360&&r<=43391,"Hangul Syllables":r=>r>=44032&&r<=55215,"Hangul Jamo Extended-B":r=>r>=55216&&r<=55295,"Private Use Area":r=>r>=57344&&r<=63743,"CJK Compatibility Ideographs":r=>r>=63744&&r<=64255,"Arabic Presentation Forms-A":r=>r>=64336&&r<=65023,"Vertical Forms":r=>r>=65040&&r<=65055,"CJK Compatibility Forms":r=>r>=65072&&r<=65103,"Small Form Variants":r=>r>=65104&&r<=65135,"Arabic Presentation Forms-B":r=>r>=65136&&r<=65279,"Halfwidth and Fullwidth Forms":r=>r>=65280&&r<=65519};function hd(r){for(const t of r)if(dd(t.charCodeAt(0)))return!0;return!1}function uy(r){for(const t of r)if(!Wf(t.charCodeAt(0)))return!1;return!0}function Wf(r){return!(at.Arabic(r)||at["Arabic Supplement"](r)||at["Arabic Extended-A"](r)||at["Arabic Presentation Forms-A"](r)||at["Arabic Presentation Forms-B"](r))}function dd(r){return!(r!==746&&r!==747&&(r<4352||!(at["Bopomofo Extended"](r)||at.Bopomofo(r)||at["CJK Compatibility Forms"](r)&&!(r>=65097&&r<=65103)||at["CJK Compatibility Ideographs"](r)||at["CJK Compatibility"](r)||at["CJK Radicals Supplement"](r)||at["CJK Strokes"](r)||!(!at["CJK Symbols and Punctuation"](r)||r>=12296&&r<=12305||r>=12308&&r<=12319||r===12336)||at["CJK Unified Ideographs Extension A"](r)||at["CJK Unified Ideographs"](r)||at["Enclosed CJK Letters and Months"](r)||at["Hangul Compatibility Jamo"](r)||at["Hangul Jamo Extended-A"](r)||at["Hangul Jamo Extended-B"](r)||at["Hangul Jamo"](r)||at["Hangul Syllables"](r)||at.Hiragana(r)||at["Ideographic Description Characters"](r)||at.Kanbun(r)||at["Kangxi Radicals"](r)||at["Katakana Phonetic Extensions"](r)||at.Katakana(r)&&r!==12540||!(!at["Halfwidth and Fullwidth Forms"](r)||r===65288||r===65289||r===65293||r>=65306&&r<=65310||r===65339||r===65341||r===65343||r>=65371&&r<=65503||r===65507||r>=65512&&r<=65519)||!(!at["Small Form Variants"](r)||r>=65112&&r<=65118||r>=65123&&r<=65126)||at["Unified Canadian Aboriginal Syllabics"](r)||at["Unified Canadian Aboriginal Syllabics Extended"](r)||at["Vertical Forms"](r)||at["Yijing Hexagram Symbols"](r)||at["Yi Syllables"](r)||at["Yi Radicals"](r))))}function Zf(r){return!(dd(r)||function(t){return!!(at["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||at["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||at["Letterlike Symbols"](t)||at["Number Forms"](t)||at["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||at["Control Pictures"](t)&&t!==9251||at["Optical Character Recognition"](t)||at["Enclosed Alphanumerics"](t)||at["Geometric Shapes"](t)||at["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||at["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||at["CJK Symbols and Punctuation"](t)||at.Katakana(t)||at["Private Use Area"](t)||at["CJK Compatibility Forms"](t)||at["Small Form Variants"](t)||at["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(r))}function Hf(r){return r>=1424&&r<=2303||at["Arabic Presentation Forms-A"](r)||at["Arabic Presentation Forms-B"](r)}function hy(r,t){return!(!t&&Hf(r)||r>=2304&&r<=3583||r>=3840&&r<=4255||at.Khmer(r))}function dy(r){for(const t of r)if(Hf(t.charCodeAt(0)))return!0;return!1}const pd="deferred",fd="loading",md="loaded";let ka=null,d="unavailable",o=null;const c=function(r){r&&typeof r=="string"&&r.indexOf("NetworkError")>-1&&(d="error"),ka&&ka(r)};function f(){_.fire(new Is("pluginStateChange",{pluginStatus:d,pluginURL:o}))}const _=new vl,x=function(){return d},T=function(){if(d!==pd||!o)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");d=fd,f(),o&&ua({url:o},r=>{r?c(r):(d=md,f())})},S={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>d===md||S.applyArabicShaping!=null,isLoading:()=>d===fd,setState(r){d=r.pluginStatus,o=r.pluginURL},isParsed:()=>S.applyArabicShaping!=null&&S.processBidirectionalText!=null&&S.processStyledBidirectionalText!=null,getPluginURL:()=>o};class C{constructor(t,i){this.zoom=t,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(t){return function(i,a){for(const u of i)if(!hy(u.charCodeAt(0),a))return!1;return!0}(t,S.isLoaded())}}class z{constructor(t,i){this.property=t,this.value=i,this.expression=function(a,u){if(Ol(a))return new Xc(a,u);if(Ta(a)){const p=Fl(a,u);if(p.result==="error")throw new Error(p.value.map(g=>`${g.key}: ${g.message}`).join(", "));return p.value}{let p=a;return typeof a=="string"&&u.type==="color"&&(p=Fn.parse(a)),{kind:"constant",evaluate:()=>p}}}(i===void 0?t.specification.default:i,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,i,a){return this.property.possiblyEvaluate(this,t,i,a)}}class P{constructor(t){this.property=t,this.value=new z(t,void 0)}transitioned(t,i){return new j(this.property,this.value,i,vn({},t.transition,this.transition),t.now)}untransitioned(){return new j(this.property,this.value,null,{},0)}}class O{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return Dr(this._values[t].value.value)}setValue(t,i){this._values.hasOwnProperty(t)||(this._values[t]=new P(this._values[t].property)),this._values[t].value=new z(this._values[t].property,i===null?void 0:Dr(i))}getTransition(t){return Dr(this._values[t].transition)}setTransition(t,i){this._values.hasOwnProperty(t)||(this._values[t]=new P(this._values[t].property)),this._values[t].transition=Dr(i)||void 0}serialize(){const t={};for(const i of Object.keys(this._values)){const a=this.getValue(i);a!==void 0&&(t[i]=a);const u=this.getTransition(i);u!==void 0&&(t[`${i}-transition`]=u)}return t}transitioned(t,i){const a=new W(this._properties);for(const u of Object.keys(this._values))a._values[u]=this._values[u].transitioned(t,i._values[u]);return a}untransitioned(){const t=new W(this._properties);for(const i of Object.keys(this._values))t._values[i]=this._values[i].untransitioned();return t}}class j{constructor(t,i,a,u,p){const g=u.delay||0,y=u.duration||0;p=p||0,this.property=t,this.value=i,this.begin=p+g,this.end=this.begin+y,t.specification.transition&&(u.delay||u.duration)&&(this.prior=a)}possiblyEvaluate(t,i,a){const u=t.now||0,p=this.value.possiblyEvaluate(t,i,a),g=this.prior;if(g){if(u>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(uthis.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function ye(r,t=1){let i=0,a=0;return{members:r.map(u=>{const p=fe[u.type].BYTES_PER_ELEMENT,g=i=Ae(i,Math.max(t,p)),y=u.components||1;return a=Math.max(a,p),i+=p*y,{name:u.name,type:u.type,components:y,offset:g}}),size:Ae(i,Math.max(a,t)),alignment:t}}function Ae(r,t){return Math.ceil(r/t)*t}class We extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.int16[u+0]=i,this.int16[u+1]=a,t}}We.prototype.bytesPerElement=4,dt(We,"StructArrayLayout2i4");class Ee extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.int16[p+0]=i,this.int16[p+1]=a,this.int16[p+2]=u,t}}Ee.prototype.bytesPerElement=6,dt(Ee,"StructArrayLayout3i6");class Fe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.int16[g+0]=i,this.int16[g+1]=a,this.int16[g+2]=u,this.int16[g+3]=p,t}}Fe.prototype.bytesPerElement=8,dt(Fe,"StructArrayLayout4i8");class ke extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y){const w=this.length;return this.resize(w+1),this.emplace(w,t,i,a,u,p,g,y)}emplace(t,i,a,u,p,g,y,w){const b=6*t,A=12*t,I=3*t;return this.int16[b+0]=i,this.int16[b+1]=a,this.uint8[A+4]=u,this.uint8[A+5]=p,this.uint8[A+6]=g,this.uint8[A+7]=y,this.float32[I+2]=w,t}}ke.prototype.bytesPerElement=12,dt(ke,"StructArrayLayout2i4ub1f12");class qe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.float32[g+0]=i,this.float32[g+1]=a,this.float32[g+2]=u,this.float32[g+3]=p,t}}qe.prototype.bytesPerElement=16,dt(qe,"StructArrayLayout4f16");class Se extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=6*t,w=3*t;return this.uint16[y+0]=i,this.uint16[y+1]=a,this.uint16[y+2]=u,this.uint16[y+3]=p,this.float32[w+2]=g,t}}Se.prototype.bytesPerElement=12,dt(Se,"StructArrayLayout4ui1f12");class Be extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=4*t;return this.uint16[g+0]=i,this.uint16[g+1]=a,this.uint16[g+2]=u,this.uint16[g+3]=p,t}}Be.prototype.bytesPerElement=8,dt(Be,"StructArrayLayout4ui8");class Xe extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,i,a,u,p,g)}emplace(t,i,a,u,p,g,y){const w=6*t;return this.int16[w+0]=i,this.int16[w+1]=a,this.int16[w+2]=u,this.int16[w+3]=p,this.int16[w+4]=g,this.int16[w+5]=y,t}}Xe.prototype.bytesPerElement=12,dt(Xe,"StructArrayLayout6i12");class $e extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M){const L=this.length;return this.resize(L+1),this.emplace(L,t,i,a,u,p,g,y,w,b,A,I,M)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L){const R=12*t;return this.int16[R+0]=i,this.int16[R+1]=a,this.int16[R+2]=u,this.int16[R+3]=p,this.uint16[R+4]=g,this.uint16[R+5]=y,this.uint16[R+6]=w,this.uint16[R+7]=b,this.int16[R+8]=A,this.int16[R+9]=I,this.int16[R+10]=M,this.int16[R+11]=L,t}}$e.prototype.bytesPerElement=24,dt($e,"StructArrayLayout4i4ui4i24");class Ye extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,i,a,u,p,g)}emplace(t,i,a,u,p,g,y){const w=10*t,b=5*t;return this.int16[w+0]=i,this.int16[w+1]=a,this.int16[w+2]=u,this.float32[b+2]=p,this.float32[b+3]=g,this.float32[b+4]=y,t}}Ye.prototype.bytesPerElement=20,dt(Ye,"StructArrayLayout3i3f20");class gt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint32[1*t+0]=i,t}}gt.prototype.bytesPerElement=4,dt(gt,"StructArrayLayout1ul4");class Et extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L){const R=this.length;return this.resize(R+1),this.emplace(R,t,i,a,u,p,g,y,w,b,A,I,M,L)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=20*t,$=10*t;return this.int16[F+0]=i,this.int16[F+1]=a,this.int16[F+2]=u,this.int16[F+3]=p,this.int16[F+4]=g,this.float32[$+3]=y,this.float32[$+4]=w,this.float32[$+5]=b,this.float32[$+6]=A,this.int16[F+14]=I,this.uint32[$+8]=M,this.uint16[F+18]=L,this.uint16[F+19]=R,t}}Et.prototype.bytesPerElement=40,dt(Et,"StructArrayLayout5i4f1i1ul2ui40");class pt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y){const w=this.length;return this.resize(w+1),this.emplace(w,t,i,a,u,p,g,y)}emplace(t,i,a,u,p,g,y,w){const b=8*t;return this.int16[b+0]=i,this.int16[b+1]=a,this.int16[b+2]=u,this.int16[b+4]=p,this.int16[b+5]=g,this.int16[b+6]=y,this.int16[b+7]=w,t}}pt.prototype.bytesPerElement=16,dt(pt,"StructArrayLayout3i2i2i16");class wt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=4*t,w=8*t;return this.float32[y+0]=i,this.float32[y+1]=a,this.float32[y+2]=u,this.int16[w+6]=p,this.int16[w+7]=g,t}}wt.prototype.bytesPerElement=16,dt(wt,"StructArrayLayout2f1f2i16");class Ut extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=12*t,y=3*t;return this.uint8[g+0]=i,this.uint8[g+1]=a,this.float32[y+1]=u,this.float32[y+2]=p,t}}Ut.prototype.bytesPerElement=12,dt(Ut,"StructArrayLayout2ub2f12");class Ot extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.float32[p+0]=i,this.float32[p+1]=a,this.float32[p+2]=u,t}}Ot.prototype.bytesPerElement=12,dt(Ot,"StructArrayLayout3f12");class mt extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a)}emplace(t,i,a,u){const p=3*t;return this.uint16[p+0]=i,this.uint16[p+1]=a,this.uint16[p+2]=u,t}}mt.prototype.bytesPerElement=6,dt(mt,"StructArrayLayout3ui6");class en extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue){const ce=this.length;return this.resize(ce+1),this.emplace(ce,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce){const Ie=30*t,Te=15*t,De=60*t;return this.int16[Ie+0]=i,this.int16[Ie+1]=a,this.int16[Ie+2]=u,this.float32[Te+2]=p,this.float32[Te+3]=g,this.uint16[Ie+8]=y,this.uint16[Ie+9]=w,this.uint32[Te+5]=b,this.uint32[Te+6]=A,this.uint32[Te+7]=I,this.uint16[Ie+16]=M,this.uint16[Ie+17]=L,this.uint16[Ie+18]=R,this.float32[Te+10]=F,this.float32[Te+11]=$,this.uint8[De+48]=K,this.uint8[De+49]=se,this.uint8[De+50]=Y,this.uint32[Te+13]=re,this.int16[Ie+28]=ue,this.uint8[De+58]=ce,t}}en.prototype.bytesPerElement=60,dt(en,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class rn extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge){const et=this.length;return this.resize(et+1),this.emplace(et,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge)}emplace(t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$,K,se,Y,re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge,et){const Le=38*t,ot=19*t;return this.int16[Le+0]=i,this.int16[Le+1]=a,this.int16[Le+2]=u,this.float32[ot+2]=p,this.float32[ot+3]=g,this.int16[Le+8]=y,this.int16[Le+9]=w,this.int16[Le+10]=b,this.int16[Le+11]=A,this.int16[Le+12]=I,this.int16[Le+13]=M,this.uint16[Le+14]=L,this.uint16[Le+15]=R,this.uint16[Le+16]=F,this.uint16[Le+17]=$,this.uint16[Le+18]=K,this.uint16[Le+19]=se,this.uint16[Le+20]=Y,this.uint16[Le+21]=re,this.uint16[Le+22]=ue,this.uint16[Le+23]=ce,this.uint16[Le+24]=Ie,this.uint16[Le+25]=Te,this.uint16[Le+26]=De,this.uint16[Le+27]=Ze,this.uint16[Le+28]=Me,this.uint32[ot+15]=Ue,this.float32[ot+16]=je,this.float32[ot+17]=Ge,this.float32[ot+18]=et,t}}rn.prototype.bytesPerElement=76,dt(rn,"StructArrayLayout3i2f6i15ui1ul3f76");class on extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.float32[1*t+0]=i,t}}on.prototype.bytesPerElement=4,dt(on,"StructArrayLayout1f4");class sn extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,u,p){const g=this.length;return this.resize(g+1),this.emplace(g,t,i,a,u,p)}emplace(t,i,a,u,p,g){const y=5*t;return this.float32[y+0]=i,this.float32[y+1]=a,this.float32[y+2]=u,this.float32[y+3]=p,this.float32[y+4]=g,t}}sn.prototype.bytesPerElement=20,dt(sn,"StructArrayLayout5f20");class Mr extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,u)}emplace(t,i,a,u,p){const g=6*t;return this.uint32[3*t+0]=i,this.uint16[g+2]=a,this.uint16[g+3]=u,this.uint16[g+4]=p,t}}Mr.prototype.bytesPerElement=12,dt(Mr,"StructArrayLayout1ul3ui12");class fr extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.uint16[u+0]=i,this.uint16[u+1]=a,t}}fr.prototype.bytesPerElement=4,dt(fr,"StructArrayLayout2ui4");class vi extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint16[1*t+0]=i,t}}vi.prototype.bytesPerElement=2,dt(vi,"StructArrayLayout1ui2");class io extends xe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const u=2*t;return this.float32[u+0]=i,this.float32[u+1]=a,t}}io.prototype.bytesPerElement=8,dt(io,"StructArrayLayout2f8");class An extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}An.prototype.size=40;class an extends Et{get(t){return new An(this,t)}}dt(an,"CollisionBoxArray");class Xt extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(t){this._structArray.uint8[this._pos1+49]=t}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(t){this._structArray.uint8[this._pos1+50]=t}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(t){this._structArray.uint32[this._pos4+13]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(t){this._structArray.uint8[this._pos1+58]=t}}Xt.prototype.size=60;class Gn extends en{get(t){return new Xt(this,t)}}dt(Gn,"PlacedSymbolArray");class Br extends pe{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(t){this._structArray.uint32[this._pos4+15]=t}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Br.prototype.size=76;class En extends rn{get(t){return new Br(this,t)}}dt(En,"SymbolInstanceArray");class Wr extends on{getoffsetX(t){return this.float32[1*t+0]}}dt(Wr,"GlyphOffsetArray");class nu extends We{getx(t){return this.int16[2*t+0]}gety(t){return this.int16[2*t+1]}}dt(nu,"SymbolLineVertexArray");class Bs extends pe{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Bs.prototype.size=12;class Gl extends Mr{get(t){return new Bs(this,t)}}dt(Gl,"FeatureIndexArray");class Mo extends fr{geta_centroid_pos0(t){return this.uint16[2*t+0]}geta_centroid_pos1(t){return this.uint16[2*t+1]}}dt(Mo,"FillExtrusionCentroidArray");const is=ye([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Fs=ye([{name:"a_dash",components:4,type:"Uint16"}]);var ru={exports:{}},ql={exports:{}};ql.exports=function(r,t){var i,a,u,p,g,y,w,b;for(a=r.length-(i=3&r.length),u=t,g=3432918353,y=461845907,b=0;b>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*y+(((w>>>16)*y&65535)<<16)&4294967295)<<13|u>>>19))+((5*(u>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(w=0,i){case 3:w^=(255&r.charCodeAt(b+2))<<16;case 2:w^=(255&r.charCodeAt(b+1))<<8;case 1:u^=w=(65535&(w=(w=(65535&(w^=255&r.charCodeAt(b)))*g+(((w>>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*y+(((w>>>16)*y&65535)<<16)&4294967295}return u^=r.length,u=2246822507*(65535&(u^=u>>>16))+((2246822507*(u>>>16)&65535)<<16)&4294967295,u=3266489909*(65535&(u^=u>>>13))+((3266489909*(u>>>16)&65535)<<16)&4294967295,(u^=u>>>16)>>>0};var gd=ql.exports,$x={exports:{}};$x.exports=function(r,t){for(var i,a=r.length,u=t^a,p=0;a>=4;)i=1540483477*(65535&(i=255&r.charCodeAt(p)|(255&r.charCodeAt(++p))<<8|(255&r.charCodeAt(++p))<<16|(255&r.charCodeAt(++p))<<24))+((1540483477*(i>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),a-=4,++p;switch(a){case 3:u^=(255&r.charCodeAt(p+2))<<16;case 2:u^=(255&r.charCodeAt(p+1))<<8;case 1:u=1540483477*(65535&(u^=255&r.charCodeAt(p)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0};var Gx=gd,ok=$x.exports;ru.exports=Gx,ru.exports.murmur3=Gx,ru.exports.murmur2=ok;var py=le(ru.exports);class Xf{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,i,a,u){this.ids.push(qx(t)),this.positions.push(i,a,u)}getPositions(t){const i=qx(t);let a=0,u=this.ids.length-1;for(;a>1;this.ids[g]>=i?u=g:a=g+1}const p=[];for(;this.ids[a]===i;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(t,i){const a=new Float64Array(t.ids),u=new Uint32Array(t.positions);return fy(a,u,0,a.length-1),i&&i.push(a.buffer,u.buffer),{ids:a,positions:u}}static deserialize(t){const i=new Xf;return i.ids=t.ids,i.positions=t.positions,i.indexed=!0,i}}function qx(r){const t=+r;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:py(String(r))}function fy(r,t,i,a){for(;i>1];let p=i-1,g=a+1;for(;;){do p++;while(r[p]u);if(p>=g)break;Kf(r,p,g),Kf(t,3*p,3*g),Kf(t,3*p+1,3*g+1),Kf(t,3*p+2,3*g+2)}g-i`u_${u}`),this.type=a}setUniform(t,i,a,u,p){i.set(t,p,u.constantOr(this.value))}getBinding(t,i){return this.type==="color"?new Zx(t):new Yf(t)}}class iu{constructor(t,i){this.uniformNames=i.map(a=>`u_${a}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(t){this.pixelRatio=t.pixelRatio||1,this.pattern=t.tl.concat(t.br)}setUniform(t,i,a,u,p){const g=p==="u_pattern"||p==="u_dash"?this.pattern:p==="u_pixel_ratio"?this.pixelRatio:null;g&&i.set(t,p,g)}getBinding(t,i){return i==="u_pattern"||i==="u_dash"?new Wx(t):new Yf(t)}}class Us{constructor(t,i,a,u){this.expression=t,this.type=a,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new u}populatePaintArray(t,i,a,u,p,g){const y=this.paintVertexArray.length,w=this.expression.evaluate(new C(0),i,{},p,u,g);this.paintVertexArray.resize(t),this._setPaintValue(y,t,w)}updatePaintArray(t,i,a,u,p){const g=this.expression.evaluate({zoom:0},a,u,void 0,p);this._setPaintValue(t,i,g)}_setPaintValue(t,i,a){if(this.type==="color"){const u=my(a);for(let p=t;p`u_${y}_t`),this.type=a,this.useIntegerZoom=u,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=i.map(y=>({name:`a_${y}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new g}populatePaintArray(t,i,a,u,p,g){const y=this.expression.evaluate(new C(this.zoom),i,{},p,u,g),w=this.expression.evaluate(new C(this.zoom+1),i,{},p,u,g),b=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(b,t,y,w)}updatePaintArray(t,i,a,u,p){const g=this.expression.evaluate({zoom:this.zoom},a,u,void 0,p),y=this.expression.evaluate({zoom:this.zoom+1},a,u,void 0,p);this._setPaintValue(t,i,g,y)}_setPaintValue(t,i,a,u){if(this.type==="color"){const p=my(a),g=my(u);for(let y=t;y!0){this.binders={},this._buffers=[];const u=[];for(const p in t.paint._values){if(!a(p))continue;const g=t.paint.get(p);if(!(g instanceof Z&&ba(g.property.specification)))continue;const y=uk(p,t.type),w=g.value,b=g.property.specification.type,A=!!g.property.useIntegerZoom,I=p==="line-dasharray"||p.endsWith("pattern"),M=p==="line-dasharray"&&t.layout.get("line-cap").value.kind!=="constant";if(w.kind!=="constant"||M)if(w.kind==="source"||M||I){const L=Hx(p,b,"source");this.binders[p]=I?new Ma(w,y,b,L,t.id):new Us(w,y,b,L),u.push(`/a_${p}`)}else{const L=Hx(p,b,"composite");this.binders[p]=new Po(w,y,b,A,i,L),u.push(`/z_${p}`)}else this.binders[p]=I?new iu(w.value,y):new _d(w.value,y,b),u.push(`/u_${p}`)}this.cacheKey=u.sort().join("")}getMaxValue(t){const i=this.binders[t];return i instanceof Us||i instanceof Po?i.maxValue:0}populatePaintArrays(t,i,a,u,p,g){for(const y in this.binders){const w=this.binders[y];(w instanceof Us||w instanceof Po||w instanceof Ma)&&w.populatePaintArray(t,i,a,u,p,g)}}setConstantPatternPositions(t){for(const i in this.binders){const a=this.binders[i];a instanceof iu&&a.setConstantPatternPositions(t)}}updatePaintArrays(t,i,a,u,p,g){let y=!1;for(const w in t){const b=i.getPositions(w);for(const A of b){const I=a.feature(A.index);for(const M in this.binders){const L=this.binders[M];if((L instanceof Us||L instanceof Po||L instanceof Ma)&&L.expression.isStateDependent===!0){const R=u.paint.get(M);L.expression=R.value,L.updatePaintArray(A.start,A.end,I,t[w],p,g),y=!0}}}}return y}defines(){const t=[];for(const i in this.binders){const a=this.binders[i];(a instanceof _d||a instanceof iu)&&t.push(...a.uniformNames.map(u=>`#define HAS_UNIFORM_${u}`))}return t}getBinderAttributes(){const t=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof Us||a instanceof Po||a instanceof Ma)for(let u=0;u!0){this.programConfigurations={};for(const u of t)this.programConfigurations[u.id]=new Pa(u,i,a);this.needsUpload=!1,this._featureMap=new Xf,this._bufferOffset=0}populatePaintArrays(t,i,a,u,p,g,y){for(const w in this.programConfigurations)this.programConfigurations[w].populatePaintArrays(t,i,u,p,g,y);i.id!==void 0&&this._featureMap.add(i.id,a,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,i,a,u,p){for(const g of a)this.needsUpload=this.programConfigurations[g.id].updatePaintArrays(t,this._featureMap,i,g,u,p)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}const ck={"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","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function uk(r,t){return ck[r]||[r.replace(`${t}-`,"").replace(/-/g,"_")]}const hk={"line-pattern":{source:Se,composite:Se},"fill-pattern":{source:Se,composite:Se},"fill-extrusion-pattern":{source:Se,composite:Se},"line-dasharray":{source:Be,composite:Be}},dk={color:{source:io,composite:qe},number:{source:on,composite:io}};function Hx(r,t,i){const a=hk[r];return a&&a[i]||dk[t][i]}dt(_d,"ConstantBinder"),dt(iu,"PatternConstantBinder"),dt(Us,"SourceExpressionBinder"),dt(Ma,"PatternCompositeBinder"),dt(Po,"CompositeExpressionBinder"),dt(Pa,"ProgramConfiguration",{omit:["_buffers"]}),dt(Wl,"ProgramConfigurationSet");const Xx="-transition";class zo extends vl{constructor(t,i){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&t.type!=="sky"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),i.layout&&(this._unevaluatedLayout=new H(i.layout)),i.paint)){this._transitionablePaint=new O(i.paint);for(const a in t.paint)this.setPaintProperty(a,t.paint[a],{validate:!1});for(const a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new X(i.paint)}}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,i,a={}){i!=null&&this._validate(ly,`layers.${this.id}.layout.${t}`,t,i,a)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,i):this.visibility=i)}getPaintProperty(t){return xn(t,Xx)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,i,a={}){if(i!=null&&this._validate(ay,`layers.${this.id}.paint.${t}`,t,i,a))return!1;if(xn(t,Xx))return this._transitionablePaint.setTransition(t.slice(0,-11),i||void 0),!1;{const u=this._transitionablePaint._values[t],p=u.value.isDataDriven(),g=u.value;this._transitionablePaint.setValue(t,i),this._handleSpecialPaintPropertyUpdate(t);const y=this._transitionablePaint._values[t].value,w=y.isDataDriven(),b=xn(t,"pattern")||t==="line-dasharray";return w||p||b||this._handleOverridablePaintPropertyUpdate(t,g,y)}}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getProgramConfiguration(t){return null}_handleOverridablePaintPropertyUpdate(t,i,a){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,i)}serialize(){const t={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&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),Yo(t,(i,a)=>!(i===void 0||a==="layout"&&!Object.keys(i).length||a==="paint"&&!Object.keys(i).length))}_validate(t,i,a,u,p={}){return(!p||p.validate!==!1)&&qf(this,t.call(Gf,{key:i,layerType:this.type,objectKey:a,value:u,styleSpec:Re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const i=this.paint.get(t);if(i instanceof Z&&ba(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Jc(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const pk=ye([{name:"a_pos",components:2,type:"Int16"}],4),fk=ye([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class qn{constructor(t=[]){this.segments=t}prepareSegment(t,i,a,u){let p=this.segments[this.segments.length-1];return t>qn.MAX_VERTEX_ARRAY_LENGTH&&wn(`Max vertices per segment is ${qn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!p||p.vertexLength+t>qn.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==u)&&(p={vertexOffset:i.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},u!==void 0&&(p.sortKey=u),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const t of this.segments)for(const i in t.vaos)t.vaos[i].destroy()}static simpleSegment(t,i,a,u){return new qn([{vertexOffset:t,primitiveOffset:i,vertexLength:a,primitiveLength:u,vaos:{},sortKey:0}])}}qn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dt(qn,"SegmentVector");var vt=8192;class za{constructor(t,i){t&&(i?this.setSouthWest(t).setNorthEast(i):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 ln?new ln(t.lng,t.lat):ln.convert(t),this}setSouthWest(t){return this._sw=t instanceof ln?new ln(t.lng,t.lat):ln.convert(t),this}extend(t){const i=this._sw,a=this._ne;let u,p;if(t instanceof ln)u=t,p=t;else{if(!(t instanceof za))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(za.convert(t)):this.extend(ln.convert(t)):typeof t=="object"&&t!==null&&t.hasOwnProperty("lat")&&(t.hasOwnProperty("lon")||t.hasOwnProperty("lng"))?this.extend(ln.convert(t)):this;if(u=t._sw,p=t._ne,!u||!p)return this}return i||a?(i.lng=Math.min(u.lng,i.lng),i.lat=Math.min(u.lat,i.lat),a.lng=Math.max(p.lng,a.lng),a.lat=Math.max(p.lat,a.lat)):(this._sw=new ln(u.lng,u.lat),this._ne=new ln(p.lng,p.lat)),this}getCenter(){return new ln((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 ln(this.getWest(),this.getNorth())}getSouthEast(){return new ln(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:i,lat:a}=ln.convert(t);let u=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&u}static convert(t){return!t||t instanceof za?t:new za(t)}}var Jf=1e-6,xi=typeof Float32Array<"u"?Float32Array:Array;function Kx(){var r=new xi(9);return xi!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function Yx(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=i[0],L=i[1],R=i[2],F=i[3],$=i[4],K=i[5],se=i[6],Y=i[7],re=i[8];return r[0]=M*a+L*g+R*b,r[1]=M*u+L*y+R*A,r[2]=M*p+L*w+R*I,r[3]=F*a+$*g+K*b,r[4]=F*u+$*y+K*A,r[5]=F*p+$*w+K*I,r[6]=se*a+Y*g+re*b,r[7]=se*u+Y*y+re*A,r[8]=se*p+Y*w+re*I,r}function Lo(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function gy(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=t[4],y=t[5],w=t[6],b=t[7],A=t[8],I=t[9],M=t[10],L=t[11],R=t[12],F=t[13],$=t[14],K=t[15],se=i*y-a*g,Y=i*w-u*g,re=i*b-p*g,ue=a*w-u*y,ce=a*b-p*y,Ie=u*b-p*w,Te=A*F-I*R,De=A*$-M*R,Ze=A*K-L*R,Me=I*$-M*F,Ue=I*K-L*F,je=M*K-L*$,Ge=se*je-Y*Ue+re*Me+ue*Ze-ce*De+Ie*Te;return Ge?(r[0]=(y*je-w*Ue+b*Me)*(Ge=1/Ge),r[1]=(u*Ue-a*je-p*Me)*Ge,r[2]=(F*Ie-$*ce+K*ue)*Ge,r[3]=(M*ce-I*Ie-L*ue)*Ge,r[4]=(w*Ze-g*je-b*De)*Ge,r[5]=(i*je-u*Ze+p*De)*Ge,r[6]=($*re-R*Ie-K*Y)*Ge,r[7]=(A*Ie-M*re+L*Y)*Ge,r[8]=(g*Ue-y*Ze+b*Te)*Ge,r[9]=(a*Ze-i*Ue-p*Te)*Ge,r[10]=(R*ce-F*re+K*se)*Ge,r[11]=(I*re-A*ce-L*se)*Ge,r[12]=(y*De-g*Me-w*Te)*Ge,r[13]=(i*Me-a*De+u*Te)*Ge,r[14]=(F*Y-R*ue-$*se)*Ge,r[15]=(A*ue-I*Y+M*se)*Ge,r):null}function Zl(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=t[9],L=t[10],R=t[11],F=t[12],$=t[13],K=t[14],se=t[15],Y=i[0],re=i[1],ue=i[2],ce=i[3];return r[0]=Y*a+re*y+ue*I+ce*F,r[1]=Y*u+re*w+ue*M+ce*$,r[2]=Y*p+re*b+ue*L+ce*K,r[3]=Y*g+re*A+ue*R+ce*se,r[4]=(Y=i[4])*a+(re=i[5])*y+(ue=i[6])*I+(ce=i[7])*F,r[5]=Y*u+re*w+ue*M+ce*$,r[6]=Y*p+re*b+ue*L+ce*K,r[7]=Y*g+re*A+ue*R+ce*se,r[8]=(Y=i[8])*a+(re=i[9])*y+(ue=i[10])*I+(ce=i[11])*F,r[9]=Y*u+re*w+ue*M+ce*$,r[10]=Y*p+re*b+ue*L+ce*K,r[11]=Y*g+re*A+ue*R+ce*se,r[12]=(Y=i[12])*a+(re=i[13])*y+(ue=i[14])*I+(ce=i[15])*F,r[13]=Y*u+re*w+ue*M+ce*$,r[14]=Y*p+re*b+ue*L+ce*K,r[15]=Y*g+re*A+ue*R+ce*se,r}function yd(r,t,i){var a,u,p,g,y,w,b,A,I,M,L,R,F=i[0],$=i[1],K=i[2];return t===r?(r[12]=t[0]*F+t[4]*$+t[8]*K+t[12],r[13]=t[1]*F+t[5]*$+t[9]*K+t[13],r[14]=t[2]*F+t[6]*$+t[10]*K+t[14],r[15]=t[3]*F+t[7]*$+t[11]*K+t[15]):(u=t[1],p=t[2],g=t[3],y=t[4],w=t[5],b=t[6],A=t[7],I=t[8],M=t[9],L=t[10],R=t[11],r[0]=a=t[0],r[1]=u,r[2]=p,r[3]=g,r[4]=y,r[5]=w,r[6]=b,r[7]=A,r[8]=I,r[9]=M,r[10]=L,r[11]=R,r[12]=a*F+y*$+I*K+t[12],r[13]=u*F+w*$+M*K+t[13],r[14]=p*F+b*$+L*K+t[14],r[15]=g*F+A*$+R*K+t[15]),r}function Hl(r,t,i){var a=i[0],u=i[1],p=i[2];return r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r[3]=t[3]*a,r[4]=t[4]*u,r[5]=t[5]*u,r[6]=t[6]*u,r[7]=t[7]*u,r[8]=t[8]*p,r[9]=t[9]*p,r[10]=t[10]*p,r[11]=t[11]*p,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function _y(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[4],g=t[5],y=t[6],w=t[7],b=t[8],A=t[9],I=t[10],M=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=p*u+b*a,r[5]=g*u+A*a,r[6]=y*u+I*a,r[7]=w*u+M*a,r[8]=b*u-p*a,r[9]=A*u-g*a,r[10]=I*u-y*a,r[11]=M*u-w*a,r}function Qf(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[0],g=t[1],y=t[2],w=t[3],b=t[8],A=t[9],I=t[10],M=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=p*u-b*a,r[1]=g*u-A*a,r[2]=y*u-I*a,r[3]=w*u-M*a,r[8]=p*a+b*u,r[9]=g*a+A*u,r[10]=y*a+I*u,r[11]=w*a+M*u,r}function Jx(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Qx(r,t,i){var a,u,p,g=i[0],y=i[1],w=i[2],b=Math.hypot(g,y,w);return b0&&(p=1/Math.sqrt(p)),r[0]=t[0]*p,r[1]=t[1]*p,r[2]=t[2]*p,r}function oo(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function xy(r,t,i){var a=t[0],u=t[1],p=t[2],g=i[0],y=i[1],w=i[2];return r[0]=u*w-p*y,r[1]=p*g-a*w,r[2]=a*y-u*g,r}function Nn(r,t,i){var a=t[0],u=t[1],p=t[2],g=i[3]*a+i[7]*u+i[11]*p+i[15];return r[0]=(i[0]*a+i[4]*u+i[8]*p+i[12])/(g=g||1),r[1]=(i[1]*a+i[5]*u+i[9]*p+i[13])/g,r[2]=(i[2]*a+i[6]*u+i[10]*p+i[14])/g,r}function nw(r,t,i){var a=i[0],u=i[1],p=i[2],g=t[0],y=t[1],w=t[2],b=u*w-p*y,A=p*g-a*w,I=a*y-u*g,M=u*I-p*A,L=p*b-a*I,R=a*A-u*b,F=2*i[3];return A*=F,I*=F,L*=2,R*=2,r[0]=g+(b*=F)+(M*=2),r[1]=y+A+L,r[2]=w+I+R,r}var Ed,Ro=vy,gk=tw,_k=vd;function rw(r,t,i){return r[0]=t[0]*i,r[1]=t[1]*i,r[2]=t[2]*i,r[3]=t[3]*i,r}function iw(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=i*i+a*a+u*u+p*p;return g>0&&(g=1/Math.sqrt(g)),r[0]=i*g,r[1]=a*g,r[2]=u*g,r[3]=p*g,r}function Xl(r,t,i){var a=t[0],u=t[1],p=t[2],g=t[3];return r[0]=i[0]*a+i[4]*u+i[8]*p+i[12]*g,r[1]=i[1]*a+i[5]*u+i[9]*p+i[13]*g,r[2]=i[2]*a+i[6]*u+i[10]*p+i[14]*g,r[3]=i[3]*a+i[7]*u+i[11]*p+i[15]*g,r}function ow(){var r=new xi(4);return xi!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function sw(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function aw(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w+g*y,r[1]=u*w+p*y,r[2]=p*w-u*y,r[3]=g*w-a*y,r}function lw(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w-p*y,r[1]=u*w+g*y,r[2]=p*w+a*y,r[3]=g*w-u*y,r}yy(),Ed=new xi(4),xi!=Float32Array&&(Ed[0]=0,Ed[1]=0,Ed[2]=0,Ed[3]=0);var yk=iw;yy(),ou(1,0,0),ou(0,1,0),ow(),ow(),Kx();const vk=ye([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:cw}=vk,uw=ye([{name:"a_pos_3",components:3,type:"Int16"}]);var Td=ye([{name:"a_pos",type:"Int16",components:2}]);class wy{constructor(t,i){this.pos=t,this.dir=i}intersectsPlane(t,i,a){const u=oo(i,this.dir);if(Math.abs(u)<1e-6)return!1;const p=((t[0]-this.pos[0])*i[0]+(t[1]-this.pos[1])*i[1]+(t[2]-this.pos[2])*i[2])/u;return a[0]=this.pos[0]+this.dir[0]*p,a[1]=this.pos[1]+this.dir[1]*p,a[2]=this.pos[2]+this.dir[2]*p,!0}closestPointOnSphere(t,i,a){if(function(L,R){var F=L[0],$=L[1],K=L[2],se=R[0],Y=R[1],re=R[2];return Math.abs(F-se)<=Jf*Math.max(1,Math.abs(F),Math.abs(se))&&Math.abs($-Y)<=Jf*Math.max(1,Math.abs($),Math.abs(Y))&&Math.abs(K-re)<=Jf*Math.max(1,Math.abs(K),Math.abs(re))}(this.pos,t)||i===0)return a[0]=a[1]=a[2]=0,!1;const[u,p,g]=this.dir,y=this.pos[0]-t[0],w=this.pos[1]-t[1],b=this.pos[2]-t[2],A=u*u+p*p+g*g,I=2*(y*u+w*p+b*g),M=I*I-4*A*(y*y+w*w+b*b-i*i);if(M<0){const L=Math.max(-I/2,0),R=y+u*L,F=w+p*L,$=b+g*L,K=Math.hypot(R,F,$);return a[0]=R*i/K,a[1]=F*i/K,a[2]=$*i/K,!1}{const L=(-I-Math.sqrt(M))/(2*A);if(L<0){const R=Math.hypot(y,w,b);return a[0]=y*i/R,a[1]=w*i/R,a[2]=b*i/R,!1}return a[0]=y+u*L,a[1]=w+p*L,a[2]=b+g*L,!0}}}class by{constructor(t,i,a,u,p){this.TL=t,this.TR=i,this.BR=a,this.BL=u,this.horizon=p}static fromInvProjectionMatrix(t,i,a){const u=[-1,1,1],p=[1,1,1],g=[1,-1,1],y=[-1,-1,1],w=Nn(u,u,t),b=Nn(p,p,t),A=Nn(g,g,t),I=Nn(y,y,t);return new by(w,b,A,I,i/a)}}class Ey{constructor(t,i){this.points=t,this.planes=i}static fromInvProjectionMatrix(t,i,a,u){const p=Math.pow(2,a),g=[[-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(w=>{const b=Xl([],w,t),A=1/b[3]/i*p;return function(I,M,L){return I[0]=M[0]*L[0],I[1]=M[1]*L[1],I[2]=M[2]*L[2],I[3]=M[3]*L[3],I}(b,b,[A,A,u?1/b[3]:A,A])}),y=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(w=>{const b=Zr([],xy([],Ro([],g[w[0]],g[w[1]]),Ro([],g[w[2]],g[w[1]]))),A=-oo(b,g[w[1]]);return b.concat(A)});return new Ey(g,y)}}class Hr{static fromPoints(t){const i=[1/0,1/0,1/0],a=[-1/0,-1/0,-1/0];for(const u of t)xd(i,i,u),wd(a,a,u);return new Hr(i,a)}static applyTransform(t,i){const a=t.getCorners();for(let u=0;u=0;if(g===0)return 0;g!==i.length&&(a=!1)}if(a)return 2;for(let u=0;u<3;u++){let p=Number.MAX_VALUE,g=-Number.MAX_VALUE;for(let y=0;ythis.max[u]-this.min[u])return 0}return 1}}const Ty=5,hw=6,os=vt/Math.PI/2,xk=16383,Kl=64,Sd=[Kl,32,16],so=-os,ao=os,wk=[new Hr([so,so,so],[ao,ao,ao]),new Hr([so,so,so],[0,0,ao]),new Hr([0,so,so],[ao,0,ao]),new Hr([so,0,so],[0,ao,ao]),new Hr([0,0,so],[ao,ao,ao])];function em(r){return r*os/Id}function dw(r,t,i,a=!0){const u=Bi([],r._camera.position,r.worldSize),p=[t,i,1,1];Xl(p,p,r.pixelMatrixInverse),rw(p,p,1/p[3]);const g=Zr([],Ro([],p,u)),y=r.globeMatrix,w=[y[12],y[13],y[14]],b=Ro([],w,u),A=vd(b),I=Zr([],b),M=r.worldSize/(2*Math.PI),L=oo(I,g),R=Math.asin(M/A);if(R1?null:function(a,u,p,g){const y=Math.sin(p);return a*(Math.sin((1-g)*p)/y)+u*(Math.sin(g*p)/y)}(r.a[t],r.b[t],r.angle,Je(i,0,1))+r.center[t]}function ss(r){if(r.z<=1)return wk[r.z+2*r.y+r.x];const t=Ay(tm(r));return Hr.fromPoints(t)}function Yl(r,t,i){return Bi(r,r,1-i),bd(r,r,t,i)}function pw(r,t){const i=lu(t.zoom);if(i===0)return ss(r);const a=tm(r),u=Ay(a),p=as(a.getWest())*t.worldSize,g=as(a.getEast())*t.worldSize,y=ls(a.getNorth())*t.worldSize,w=ls(a.getSouth())*t.worldSize,b=[p,y,0],A=[g,y,0],I=[p,w,0],M=[g,w,0],L=gy([],t.globeMatrix);return Nn(b,b,L),Nn(A,A,L),Nn(I,I,L),Nn(M,M,L),u[0]=Yl(u[0],I,i),u[1]=Yl(u[1],M,i),u[2]=Yl(u[2],A,i),u[3]=Yl(u[3],b,i),Hr.fromPoints(u)}function fw(r,t,i){for(const a of r)Nn(a,a,t),Bi(a,a,i)}function Ek(r,t,i){const a=t/r.worldSize,u=r.globeMatrix;if(i.z<=1){const Te=ss(i).getCorners();return fw(Te,u,a),Hr.fromPoints(Te)}const p=tm(i),g=Ay(p);fw(g,u,a);const y=Number.MAX_VALUE,w=[-y,-y,-y],b=[y,y,y];if(p.contains(r.center)){for(const Ze of g)xd(b,b,Ze),wd(w,w,Ze);w[2]=0;const Te=r.point,De=[Te.x*a,Te.y*a,0];return xd(b,b,De),wd(w,w,De),new Hr(b,w)}const A=[u[12]*a,u[13]*a,u[14]*a],I=p.getCenter(),M=Je(r.center.lat,-zr,zr),L=Je(I.lat,-zr,zr),R=as(r.center.lng),F=ls(M);let $=R-as(I.lng);const K=F-ls(L);$>.5?$-=1:$<-.5&&($+=1);let se=0;Math.abs($)>Math.abs(K)?se=$>=0?1:3:(se=K>=0?0:2,bd(A,A,[u[4]*a,u[5]*a,u[6]*a],-Math.sin(St(K>=0?p.getSouth():p.getNorth()))*os));const Y=g[se],re=g[(se+1)%4],ue=new bk(Y,re,A),ce=[Sy(ue,0)||Y[0],Sy(ue,1)||Y[1],Sy(ue,2)||Y[2]],Ie=lu(r.zoom);if(Ie>0){const Te=function({x:Ze,y:Me,z:Ue},je,Ge,et,Le){const ot=1/(1<.5?_t=-1:Ct<-.5&&(_t=1),ft=((ft+_t)*je-(et*=je))*Ge+et,st=((st+_t)*je-et)*Ge+et,At=(At*je-(Le*=je))*Ge+Le,tt=(tt*je-Le)*Ge+Le,[[ft,tt,0],[st,tt,0],[st,At,0],[ft,At,0]]}(i,t,r._pixelsPerMercatorPixel,R,F);for(let Ze=0;ZeMath.PI/2*1.01}const yw=St(85),Tk=Math.cos(yw),Sk=Math.sin(yw),Id=63710088e-1,vw=2*Math.PI*Id;class La{constructor(t,i){if(isNaN(t)||isNaN(i))throw new Error(`Invalid LngLat object: (${t}, ${i})`);if(this.lng=+t,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new La(xt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const i=Math.PI/180,a=this.lat*i,u=t.lat*i,p=Math.sin(a)*Math.sin(u)+Math.cos(a)*Math.cos(u)*Math.cos((t.lng-this.lng)*i);return Id*Math.acos(Math.min(p,1))}toBounds(t=0){const i=360*t/40075017,a=i/Math.cos(Math.PI/180*this.lat);return new za(new La(this.lng-a,this.lat-i),new La(this.lng+a,this.lat+i))}toEcef(t){const i=em(t);return au(this.lat,this.lng,os+i)}static convert(t){if(t instanceof La)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new La(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new La(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}var ln=La;function ky(r){return vw*Math.cos(r*Math.PI/180)}function as(r){return(180+r)/360}function ls(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function Do(r,t){return r/ky(t)}function Fi(r){return 360*r-180}function Pr(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}function xw(r,t){return r*ky(Pr(t))}const zr=85.051129;function ww(r){return 1/Math.cos(r*Math.PI/180)}class cu{constructor(t,i,a=0){this.x=+t,this.y=+i,this.z=+a}static fromLngLat(t,i=0){const a=ln.convert(t);return new cu(as(a.lng),ls(a.lat),Do(i,a.lat))}toLngLat(){return new ln(Fi(this.x),Pr(this.y))}toAltitude(){return xw(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/vw*ww(Pr(this.y))}}function My(r,t,i,a,u,p,g,y,w){const b=(t+a)/2,A=(i+u)/2,I=new Ve(b,A);y(I),function(M,L,R,F,$,K){const se=R-$,Y=F-K;return Math.abs((F-L)*se-(R-M)*Y)/Math.hypot(se,Y)}(I.x,I.y,p.x,p.y,g.x,g.y)>=w?(My(r,t,i,b,A,p,I,y,w),My(r,b,A,a,u,I,g,y,w)):r.push(g)}function bw(r,t,i){let a=r[0],u=a.x,p=a.y;t(a);const g=[a];for(let y=1;yr.x+1||ar.y+1)&&wn("Geometry exceeds allowed extent, reduce your vector tile buffer size"),r}function Vs(r,t,i){const a=r.loadGeometry(),u=r.extent,p=vt/u;if(t&&i&&i.projection.isReprojectedInTileSpace){const g=1<{const L=Fi((t.x+M.x/u)/g),R=Pr((t.y+M.y/u)/g),F=A.project(L,R);M.x=(F.x*y-w)*u,M.y=(F.y*y-b)*u};for(let M=0;M=u||R.y<0||R.y>=u||(I(R),L.push(R));a[M]=L}}for(const g of a)for(const y of g)Ck(y,p);return a}function Jl(r,t){return{type:r.type,id:r.id,properties:r.properties,geometry:t?Vs(r):[]}}function rm(r,t,i,a,u){r.emplaceBack(2*t+(a+1)/2,2*i+(u+1)/2)}function im(r,t,i){r.emplaceBack(t.x,t.y,t.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Ly{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.projection=t.projection,this.layoutVertexArray=new We,this.indexArray=new mt,this.segments=new qn,this.programConfigurations=new Wl(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a,u){const p=this.layers[0],g=[];let y=null;p.type==="circle"&&(y=p.layout.get("circle-sort-key"));for(const{feature:b,id:A,index:I,sourceLayerIndex:M}of t){const L=this.layers[0]._featureFilter.needGeometry,R=Jl(b,L);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),R,a))continue;const F=y?y.evaluate(R,{},a):void 0,$={id:A,properties:b.properties,type:b.type,sourceLayerIndex:M,index:I,geometry:L?R.geometry:Vs(b,a,u),patterns:{},sortKey:F};g.push($)}y&&g.sort((b,A)=>b.sortKey-A.sortKey);let w=null;u.projection.name==="globe"&&(this.globeExtVertexArray=new Xe,w=u.projection);for(const b of g){const{geometry:A,index:I,sourceLayerIndex:M}=b,L=t[I].feature;this.addFeature(b,A,I,i.availableImages,a,w),i.featureIndex.insert(L,A,I,M,this.index)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pk.members),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,fk.members))),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(t,i,a,u,p,g){for(const y of i)for(const w of y){const b=w.x,A=w.y;if(b<0||b>=vt||A<0||A>=vt)continue;if(g){const L=g.projectTilePoint(b,A,p),R=g.upVector(p,b,A),F=this.globeExtVertexArray;im(F,L,R),im(F,L,R),im(F,L,R),im(F,L,R)}const I=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),M=I.vertexLength;rm(this.layoutVertexArray,b,A,-1,-1),rm(this.layoutVertexArray,b,A,1,-1),rm(this.layoutVertexArray,b,A,1,1),rm(this.layoutVertexArray,b,A,-1,1),this.indexArray.emplaceBack(M,M+1,M+2),this.indexArray.emplaceBack(M,M+2,M+3),I.vertexLength+=4,I.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{},u,p)}}function Tw(r,t){for(let i=0;i1){if(Ry(r,t))return!0;for(let a=0;a1?i:i.sub(t)._mult(u)._add(t))}function Cw(r,t){let i,a,u,p=!1;for(let g=0;gt.y!=u.y>t.y&&t.x<(u.x-a.x)*(t.y-a.y)/(u.y-a.y)+a.x&&(p=!p)}return p}function Ql(r,t){let i=!1;for(let a=0,u=r.length-1;at.y!=g.y>t.y&&t.x<(g.x-p.x)*(t.y-p.y)/(g.y-p.y)+p.x&&(i=!i)}return i}function Iw(r,t,i,a,u){for(const g of r)if(t<=g.x&&i<=g.y&&a>=g.x&&u>=g.y)return!0;const p=[new Ve(t,i),new Ve(t,u),new Ve(a,u),new Ve(a,i)];if(r.length>2){for(const g of p)if(Ql(r,g))return!0}for(let g=0;gu.x&&t.x>u.x||r.yu.y&&t.y>u.y)return!1;const p=pi(r,t,i[0]);return p!==pi(r,t,i[1])||p!==pi(r,t,i[2])||p!==pi(r,t,i[3])}function uu(r,t,i){const a=t.paint.get(r).value;return a.kind==="constant"?a.value:i.programConfigurations.get(t.id).getMaxValue(r)}function om(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function kw(r,t,i,a,u){if(!t[0]&&!t[1])return r;const p=Ve.convert(t)._mult(u);i==="viewport"&&p._rotate(-a);const g=[];for(let y=0;y0){const Y=i.projection.upVector(b,L.x,L.y);F.x+=Y[0]*A*R,F.y+=Y[1]*A*R,F.z+=Y[2]*A*R}const $=p?L:Rk(F.x,F.y,F.z,a),K=p?r.tilespaceRays.map(Y=>Ok(Y,R)):r.queryGeometry.screenGeometry,se=Xl([],[F.x,F.y,F.z,1],a);if(!g&&p?w*=se[3]/i.cameraToCenterDistance:g&&!p&&(w*=i.cameraToCenterDistance/se[3]),p){const Y=Pr((M.y/vt+b.y)/(1<r.width||u.height>r.height||i.x>r.width-u.width||i.y>r.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>t.width||u.height>t.height||a.x>t.width-u.width||a.y>t.height-u.height)throw new RangeError("out of range destination coordinates for image copy");const g=r.data,y=t.data;for(let w=0;w{t[r.evaluationKey]=w;const b=r.expression.evaluate(t);u.data[g+y+0]=Math.floor(255*b.r/b.a),u.data[g+y+1]=Math.floor(255*b.g/b.a),u.data[g+y+2]=Math.floor(255*b.b/b.a),u.data[g+y+3]=Math.floor(255*b.a)};if(r.clips)for(let g=0,y=0;g80*i){a=p=r[0],u=g=r[1];for(var R=i;Rp&&(p=y),w>g&&(g=w);b=(b=Math.max(p-a,g-u))!==0?32767/b:0}return kd(M,L,i,a,u,b,0),L}function Ow(r,t,i,a,u){var p,g;if(u===jy(r,t,i,a)>0)for(p=t;p=t;p-=a)g=Nw(p,r[p],r[p+1],g);return g&&am(g,g.next)&&(Pd(g),g=g.next),g}function ec(r,t){if(!r)return r;t||(t=r);var i,a=r;do if(i=!1,a.steiner||!am(a,a.next)&&Wn(a.prev,a,a.next)!==0)a=a.next;else{if(Pd(a),(a=t=a.prev)===a.next)break;i=!0}while(i||a!==t);return t}function kd(r,t,i,a,u,p,g){if(r){!g&&p&&function(A,I,M,L){var R=A;do R.z===0&&(R.z=Ny(R.x,R.y,I,M,L)),R.prevZ=R.prev,R.nextZ=R.next,R=R.next;while(R!==A);R.prevZ.nextZ=null,R.prevZ=null,function(F){var $,K,se,Y,re,ue,ce,Ie,Te=1;do{for(K=F,F=null,re=null,ue=0;K;){for(ue++,se=K,ce=0,$=0;$0||Ie>0&&se;)ce!==0&&(Ie===0||!se||K.z<=se.z)?(Y=K,K=K.nextZ,ce--):(Y=se,se=se.nextZ,Ie--),re?re.nextZ=Y:F=Y,Y.prevZ=re,re=Y;K=se}re.nextZ=null,Te*=2}while(ue>1)}(R)}(r,a,u,p);for(var y,w,b=r;r.prev!==r.next;)if(y=r.prev,w=r.next,p?Vk(r,a,u,p):jk(r))t.push(y.i/i|0),t.push(r.i/i|0),t.push(w.i/i|0),Pd(r),r=w.next,b=w.next;else if((r=w)===b){g?g===1?kd(r=$k(ec(r),t,i),t,i,a,u,p,2):g===2&&Gk(r,t,i,a,u,p):kd(ec(r),t,i,a,u,p,1);break}}}function jk(r){var t=r.prev,i=r,a=r.next;if(Wn(t,i,a)>=0)return!1;for(var u=t.x,p=i.x,g=a.x,y=t.y,w=i.y,b=a.y,A=up?u>g?u:g:p>g?p:g,L=y>w?y>b?y:b:w>b?w:b,R=a.next;R!==t;){if(R.x>=A&&R.x<=M&&R.y>=I&&R.y<=L&&hu(u,y,p,w,g,b,R.x,R.y)&&Wn(R.prev,R,R.next)>=0)return!1;R=R.next}return!0}function Vk(r,t,i,a){var u=r.prev,p=r,g=r.next;if(Wn(u,p,g)>=0)return!1;for(var y=u.x,w=p.x,b=g.x,A=u.y,I=p.y,M=g.y,L=yw?y>b?y:b:w>b?w:b,$=A>I?A>M?A:M:I>M?I:M,K=Ny(L,R,t,i,a),se=Ny(F,$,t,i,a),Y=r.prevZ,re=r.nextZ;Y&&Y.z>=K&&re&&re.z<=se;){if(Y.x>=L&&Y.x<=F&&Y.y>=R&&Y.y<=$&&Y!==u&&Y!==g&&hu(y,A,w,I,b,M,Y.x,Y.y)&&Wn(Y.prev,Y,Y.next)>=0||(Y=Y.prevZ,re.x>=L&&re.x<=F&&re.y>=R&&re.y<=$&&re!==u&&re!==g&&hu(y,A,w,I,b,M,re.x,re.y)&&Wn(re.prev,re,re.next)>=0))return!1;re=re.nextZ}for(;Y&&Y.z>=K;){if(Y.x>=L&&Y.x<=F&&Y.y>=R&&Y.y<=$&&Y!==u&&Y!==g&&hu(y,A,w,I,b,M,Y.x,Y.y)&&Wn(Y.prev,Y,Y.next)>=0)return!1;Y=Y.prevZ}for(;re&&re.z<=se;){if(re.x>=L&&re.x<=F&&re.y>=R&&re.y<=$&&re!==u&&re!==g&&hu(y,A,w,I,b,M,re.x,re.y)&&Wn(re.prev,re,re.next)>=0)return!1;re=re.nextZ}return!0}function $k(r,t,i){var a=r;do{var u=a.prev,p=a.next.next;!am(u,p)&&Bw(u,a,a.next,p)&&Md(u,p)&&Md(p,u)&&(t.push(u.i/i|0),t.push(a.i/i|0),t.push(p.i/i|0),Pd(a),Pd(a.next),a=r=p),a=a.next}while(a!==r);return ec(a)}function Gk(r,t,i,a,u,p){var g=r;do{for(var y=g.next.next;y!==g.prev;){if(g.i!==y.i&&Xk(g,y)){var w=Fw(g,y);return g=ec(g,g.next),w=ec(w,w.next),kd(g,t,i,a,u,p,0),void kd(w,t,i,a,u,p,0)}y=y.next}g=g.next}while(g!==r)}function qk(r,t){return r.x-t.x}function Wk(r,t){var i=function(u,p){var g,y=p,w=u.x,b=u.y,A=-1/0;do{if(b<=y.y&&b>=y.next.y&&y.next.y!==y.y){var I=y.x+(b-y.y)*(y.next.x-y.x)/(y.next.y-y.y);if(I<=w&&I>A&&(A=I,g=y.x=y.x&&y.x>=R&&w!==y.x&&hu(bg.x||y.x===g.x&&Zk(g,y)))&&(g=y,$=M)),y=y.next;while(y!==L);return g}(r,t);if(!i)return t;var a=Fw(i,r);return ec(a,a.next),ec(i,i.next)}function Zk(r,t){return Wn(r.prev,r,t.prev)<0&&Wn(t.next,r,r.next)<0}function Ny(r,t,i,a,u){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-i)*u|0)|r<<8))|r<<4))|r<<2))|r<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-a)*u|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Hk(r){var t=r,i=r;do(t.x=(r-g)*(p-y)&&(r-g)*(a-y)>=(i-g)*(t-y)&&(i-g)*(p-y)>=(u-g)*(a-y)}function Xk(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!function(i,a){var u=i;do{if(u.i!==i.i&&u.next.i!==i.i&&u.i!==a.i&&u.next.i!==a.i&&Bw(u,u.next,i,a))return!0;u=u.next}while(u!==i);return!1}(r,t)&&(Md(r,t)&&Md(t,r)&&function(i,a){var u=i,p=!1,g=(i.x+a.x)/2,y=(i.y+a.y)/2;do u.y>y!=u.next.y>y&&u.next.y!==u.y&&g<(u.next.x-u.x)*(y-u.y)/(u.next.y-u.y)+u.x&&(p=!p),u=u.next;while(u!==i);return p}(r,t)&&(Wn(r.prev,r,t.prev)||Wn(r,t.prev,t))||am(r,t)&&Wn(r.prev,r,r.next)>0&&Wn(t.prev,t,t.next)>0)}function Wn(r,t,i){return(t.y-r.y)*(i.x-t.x)-(t.x-r.x)*(i.y-t.y)}function am(r,t){return r.x===t.x&&r.y===t.y}function Bw(r,t,i,a){var u=cm(Wn(r,t,i)),p=cm(Wn(r,t,a)),g=cm(Wn(i,a,r)),y=cm(Wn(i,a,t));return u!==p&&g!==y||!(u!==0||!lm(r,i,t))||!(p!==0||!lm(r,a,t))||!(g!==0||!lm(i,r,a))||!(y!==0||!lm(i,t,a))}function lm(r,t,i){return t.x<=Math.max(r.x,i.x)&&t.x>=Math.min(r.x,i.x)&&t.y<=Math.max(r.y,i.y)&&t.y>=Math.min(r.y,i.y)}function cm(r){return r>0?1:r<0?-1:0}function Md(r,t){return Wn(r.prev,r,r.next)<0?Wn(r,t,r.next)>=0&&Wn(r,r.prev,t)>=0:Wn(r,t,r.prev)<0||Wn(r,r.next,t)<0}function Fw(r,t){var i=new Uy(r.i,r.x,r.y),a=new Uy(t.i,t.x,t.y),u=r.next,p=t.prev;return r.next=t,t.prev=r,i.next=u,u.prev=i,a.next=i,i.prev=a,p.next=a,a.prev=p,a}function Nw(r,t,i,a){var u=new Uy(r,t,i);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function Pd(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Uy(r,t,i){this.i=r,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function jy(r,t,i,a){for(var u=0,p=t,g=i-a;p0&&i.holes.push(a+=r[u-1].length)}return i};var Vy=le(Fy.exports);function Kk(r,t,i,a,u){Uw(r,t,i||0,a||r.length-1,u||Yk)}function Uw(r,t,i,a,u){for(;a>i;){if(a-i>600){var p=a-i+1,g=t-i+1,y=Math.log(p),w=.5*Math.exp(2*y/3),b=.5*Math.sqrt(y*w*(p-w)/p)*(g-p/2<0?-1:1);Uw(r,t,Math.max(i,Math.floor(t-g*w/p+b)),Math.min(a,Math.floor(t+(p-g)*w/p+b)),u)}var A=r[t],I=i,M=a;for(zd(r,i,t),u(r[a],A)>0&&zd(r,i,a);I0;)M--}u(r[i],A)===0?zd(r,i,M):zd(r,++M,a),M<=t&&(i=M+1),t<=M&&(a=M-1)}}function zd(r,t,i){var a=r[t];r[t]=r[i],r[i]=a}function Yk(r,t){return rt?1:0}function $y(r,t){const i=r.length;if(i<=1)return[r];const a=[];let u,p;for(let g=0;g1)for(let g=0;gi.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new We,this.indexArray=new mt,this.indexArray2=new fr,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.segments2=new qn,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=t.projection}populate(t,i,a,u){this.hasPattern=Gy("fill",this.layers,i);const p=this.layers[0].layout.get("fill-sort-key"),g=[];for(const{feature:y,id:w,index:b,sourceLayerIndex:A}of t){const I=this.layers[0]._featureFilter.needGeometry,M=Jl(y,I);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),M,a))continue;const L=p?p.evaluate(M,{},a,i.availableImages):void 0,R={id:w,properties:y.properties,type:y.type,sourceLayerIndex:A,index:b,geometry:I?M.geometry:Vs(y,a,u),patterns:{},sortKey:L};g.push(R)}p&&g.sort((y,w)=>y.sortKey-w.sortKey);for(const y of g){const{geometry:w,index:b,sourceLayerIndex:A}=y;if(this.hasPattern){const I=qy("fill",this.layers,y,this.zoom,i);this.patternFeatures.push(I)}else this.addFeature(y,w,b,a,{},i.availableImages);i.featureIndex.insert(t[b].feature,w,b,A,this.index)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}addFeatures(t,i,a,u,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,i,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Uk),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),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(t,i,a,u,p,g=[]){for(const y of $y(i,500)){let w=0;for(const R of y)w+=R.length;const b=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray),A=b.vertexLength,I=[],M=[];for(const R of y){if(R.length===0)continue;R!==y[0]&&M.push(I.length/2);const F=this.segments2.prepareSegment(R.length,this.layoutVertexArray,this.indexArray2),$=F.vertexLength;this.layoutVertexArray.emplaceBack(R[0].x,R[0].y),this.indexArray2.emplaceBack($+R.length-1,$),I.push(R[0].x),I.push(R[0].y);for(let K=1;K>3}if(u--,a===1||a===2)p+=r.readSVarint(),g+=r.readSVarint(),a===1&&(t&&y.push(t),t=[]),t.push(new oM(p,g));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&y.push(t),y},du.prototype.bbox=function(){var r=this._pbf;r.pos=this._geometry;for(var t=r.readVarint()+r.pos,i=1,a=0,u=0,p=0,g=1/0,y=-1/0,w=1/0,b=-1/0;r.pos>3}if(a--,i===1||i===2)(u+=r.readSVarint())y&&(y=u),(p+=r.readSVarint())b&&(b=p);else if(i!==7)throw new Error("unknown command "+i)}return[g,w,y,b]},du.prototype.toGeoJSON=function(r,t,i){var a,u,p=this.extent*Math.pow(2,i),g=this.extent*r,y=this.extent*t,w=this.loadGeometry(),b=du.types[this.type];function A(L){for(var R=0;R>3;u=g===1?a.readString():g===2?a.readFloat():g===3?a.readDouble():g===4?a.readVarint64():g===5?a.readVarint():g===6?a.readSVarint():g===7?a.readBoolean():null}return u}(i))}$w.prototype.feature=function(r){if(r<0||r>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[r];var t=this._pbf.readVarint()+this._pbf.pos;return new lM(this._pbf,t,this.extent,this._keys,this._values)};var uM=Vw;function hM(r,t,i){if(r===3){var a=new uM(i,i.readVarint()+i.pos);a.length&&(t[a.name]=a)}}var Wy=hm.VectorTile=function(r,t){this.layers=r.readFields(hM,{},t)},dm=hm.VectorTileFeature=jw;function pm(r,t,i,a){const u=[],p=a===0?(g,y,w,b,A,I)=>{g.push(new Ve(I,w+(I-y)/(b-y)*(A-w)))}:(g,y,w,b,A,I)=>{g.push(new Ve(y+(I-w)/(A-w)*(b-y),I))};for(const g of r){const y=[];for(const w of g){if(w.length<=2)continue;const b=[];for(let M=0;Mt&&p(b,L,R,F,$,t):K>i?se=t&&p(b,L,R,F,$,t),se>i&&K<=i&&p(b,L,R,F,$,i)}let A=w[w.length-1];const I=a===0?A.x:A.y;I>=t&&I<=i&&b.push(A),b.length&&(A=b[b.length-1],b[0].x===A.x&&b[0].y===A.y||b.push(b[0]),y.push(b))}y.length&&u.push(y)}return u}hm.VectorTileLayer=Vw;const dM=dm.types,pM=Math.pow(2,13);function Ld(r,t,i,a,u,p,g,y){r.emplaceBack((t<<1)+g,(i<<1)+p,(Math.floor(a*pM)<<1)+u,Math.round(y))}function Rd(r,t,i){r.emplaceBack(t.x,t.y,t.z,i[0]*16384,i[1]*16384,i[2]*16384)}class Gw{constructor(){this.acc=new Ve(0,0),this.polyCount=[]}startRing(t){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Ve(t.x,t.y),this.max=new Ve(t.x,t.y))}append(t,i){this.currentPolyCount.edges++,this.acc._add(t);const a=this.min,u=this.max;t.xu.x&&(u.x=t.x),t.yu.y&&(u.y=t.y),((t.x===0||t.x===vt)&&t.x===i.x)!=((t.y===0||t.y===vt)&&t.y===i.y)&&this.processBorderOverlap(t,i),i.x<0!=t.x<0&&this.addBorderIntersection(0,Wt(i.y,t.y,(0-i.x)/(t.x-i.x))),i.x>vt!=t.x>vt&&this.addBorderIntersection(1,Wt(i.y,t.y,(vt-i.x)/(t.x-i.x))),i.y<0!=t.y<0&&this.addBorderIntersection(2,Wt(i.x,t.x,(0-i.y)/(t.y-i.y))),i.y>vt!=t.y>vt&&this.addBorderIntersection(3,Wt(i.x,t.x,(vt-i.y)/(t.y-i.y)))}addBorderIntersection(t,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const a=this.borders[t];ia[1]&&(a[1]=i)}processBorderOverlap(t,i){if(t.x===i.x){if(t.y===i.y)return;const a=t.x===0?0:1;this.addBorderIntersection(a,i.y),this.addBorderIntersection(a,t.y)}else{const a=t.y===0?2:3;this.addBorderIntersection(a,i.x),this.addBorderIntersection(a,t.x)}}centroid(){const t=this.polyCount.reduce((i,a)=>i+a.edges,0);return t!==0?this.acc.div(t)._round():new Ve(0,0)}span(){return new Ve(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((t,i)=>t+ +(i[0]!==Number.MAX_VALUE),0)}}class Dd{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(i=>i.id),this.index=t.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=t.projection,this.layoutVertexArray=new Fe,this.centroidVertexArray=new Mo,this.indexArray=new mt,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=t.enableTerrain}populate(t,i,a,u){this.features=[],this.hasPattern=Gy("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(p){const g=Math.exp(Math.PI*(1-p.y/(1<=0;K--){const se=L[K];(se.length===0||(R=se[0]).every(Y=>Y.x<=0)||R.every(Y=>Y.x>=vt)||R.every(Y=>Y.y<=0)||R.every(Y=>Y.y>=vt))&&L.splice(K,1)}var R;let F;if(A)F=Yw(L,w,u);else{F=[];for(const K of L)F.push({polygon:K,bounds:w})}const $=M?this.edgeRadius:0;for(const{polygon:K,bounds:se}of F){let Y=0,re=0;for(const ce of K)M&&!ce[0].equals(ce[ce.length-1])&&ce.push(ce[0]),re+=M?ce.length-1:ce.length;const ue=this.segments.prepareSegment((M?5:4)*re,this.layoutVertexArray,this.indexArray);if(M){const ce=[],Ie=[];Y=ue.vertexLength;for(const De of K){let Ze,Me;De.length&&De!==K[0]&&Ie.push(ce.length/2),Ze=De[1].sub(De[0])._perp()._unit();for(let Ue=1;Ue4&&Hw(ce[ce.length-2],ce[0],ce[1]),Me=$?fM(ce[ce.length-2],ce[0],ce[1],$):0;Te=ce[1].sub(ce[0])._perp()._unit();let Ue=!0;for(let je=1,Ge=0;je0?1:0,tt=et.dist(Le);if(Ge+tt>32768&&(Ge=0),$){De=ot.sub(Le)._perp()._unit();let It=Ww(et,Le,ot,qw(Te,De),$);isNaN(It)&&(It=0);const bt=Le.sub(et)._unit();et=et.add(bt.mult(Me))._round(),Le=Le.add(bt.mult(-It))._round(),Me=It,Te=De}const _t=ue.vertexLength,Ct=ce.length>4&&Hw(et,Le,ot);let Ht=Xw(Ge,Ze,Ue);if(Ld(this.layoutVertexArray,et.x,et.y,st,At,0,0,Ht),Ld(this.layoutVertexArray,et.x,et.y,st,At,0,1,Ht),Ge+=tt,Ht=Xw(Ge,Ct,!Ue),Ze=Ct,Ld(this.layoutVertexArray,Le.x,Le.y,st,At,0,0,Ht),Ld(this.layoutVertexArray,Le.x,Le.y,st,At,0,1,Ht),ue.vertexLength+=4,this.indexArray.emplaceBack(_t+0,_t+1,_t+2),this.indexArray.emplaceBack(_t+1,_t+3,_t+2),ue.primitiveLength+=2,$){const It=Y+(je===1?ce.length-2:je-2),bt=je===1?Y:It+1;if(this.indexArray.emplaceBack(_t+1,It,_t+3),this.indexArray.emplaceBack(It,bt,_t+3),ue.primitiveLength+=2,Ie===void 0&&(Ie=_t),!Zw(ot,ce[je],se)){const bn=je===ce.length-1?Ie:ue.vertexLength;this.indexArray.emplaceBack(_t+2,_t+3,bn),this.indexArray.emplaceBack(_t+3,bn+1,bn),this.indexArray.emplaceBack(_t+3,bt,bn+1),ue.primitiveLength+=3}Ue=!Ue}if(A){const It=this.layoutVertexExtArray,bt=b.projectTilePoint(et.x,et.y,u),bn=b.projectTilePoint(Le.x,Le.y,u),zt=b.upVector(u,et.x,et.y),Lt=b.upVector(u,Le.x,Le.y);Rd(It,bt,zt),Rd(It,bt,zt),Rd(It,bn,Lt),Rd(It,bn,Lt)}}M&&(Y+=ce.length-1)}}if(I&&I.polyCount.length>0){if(I.borders){I.vertexArrayOffset=this.centroidVertexArray.length;const K=I.borders,se=this.featuresOnBorder.push(I)-1;for(let Y=0;Y<4;Y++)K[Y][0]!==Number.MAX_VALUE&&this.borders[Y].push(se)}this.encodeCentroid(I.borders?void 0:I.centroid(),I)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,g,u)}sortBorders(){for(let t=0;t<4;t++)this.borders[t].sort((i,a)=>this.featuresOnBorder[i].borders[t][0]-this.featuresOnBorder[a].borders[t][0])}encodeCentroid(t,i,a=!0){let u,p;if(t)if(t.y!==0){const y=i.span()._mult(this.tileToMeter);u=(Math.max(t.x,1)<<3)+Math.min(7,Math.round(y.x/10)),p=(Math.max(t.y,1)<<3)+Math.min(7,Math.round(y.y/10))}else u=Math.ceil(7*(t.x+450)),p=0;else u=0,p=+a;let g=a?this.centroidVertexArray.length:i.vertexArrayOffset;for(const y of i.polyCount){a&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*y.edges+y.top);for(let w=0;wi[1].x&&t.x>i[1].x||r.yi[1].y&&t.y>i[1].y}function Hw(r,t,i){if(r.x<0||r.x>=vt||t.x<0||t.x>=vt||i.x<0||i.x>=vt)return!1;const a=i.sub(t),u=a.perp(),p=r.sub(t);return(a.x*p.x+a.y*p.y)/Math.sqrt((a.x*a.x+a.y*a.y)*(p.x*p.x+p.y*p.y))>-.866&&u.x*p.x+u.y*p.y<0}function Xw(r,t,i){const a=t?2|r:-3&r;return i?1|a:-2&a}function Kw(){const r=Math.PI/32,t=Math.tan(r),i=Id;return i*Math.sqrt(1+2*t*t)-i}function Yw(r,t,i){const a=1<{for(const Te of ce)R.push({polygon:Te,bounds:Ie})},$=Math.ceil(Math.log2(A)),K=Math.ceil(Math.log2(I)),se=$-K,Y=[];for(let ce=0;ce0?0:1);for(let ce=0;ceIe+1?ue.push({polygons:Ge,bounds:Le,depth:Ie+1}):F(Ge,Le)}if(et.length){const Le=[new Ve(Te===0?je:De.x,Te===1?je:De.y),Ze];Y.length>Ie+1?ue.push({polygons:et,bounds:Le,depth:Ie+1}):F(et,Le)}}return R}(r,t,Math.ceil((p-u)/11.25),Math.ceil((g-y)/11.25),1,(w,b,A)=>{if(w===0)return .5*(b+A);{const I=Pr((i.y+b/vt)/a);return(ls(.5*(Pr((i.y+A/vt)/a)+I))*a-i.y)*vt}})}dt(Dd,"FillExtrusionBucket",{omit:["layers","features"]}),dt(Gw,"PartMetadata");const mM=new ee({"fill-extrusion-edge-radius":new B(Re["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var gM={paint:new ee({"fill-extrusion-opacity":new B(Re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new q(Re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new B(Re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new B(Re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new q(Re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new q(Re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new q(Re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new B(Re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new B(Re["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new B(Re["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new B(Re["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:mM};function Jw(r,t,i){var a=2*Math.PI*6378137/256/Math.pow(2,i);return[r*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}class fm{constructor(t,i,a){this.z=t,this.x=i,this.y=a,this.key=Od(0,t,t,i,a)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,i){const a=function(p,g,y){var w=Jw(256*p,256*(g=Math.pow(2,y)-g-1),y),b=Jw(256*(p+1),256*(g+1),y);return w[0]+","+w[1]+","+b[0]+","+b[1]}(this.x,this.y,this.z),u=function(p,g,y){let w,b="";for(let A=p;A>0;A--)w=1<this.canonical.z?new Xr(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Xr(t,this.wrap,t,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(t,i=!0){if(this.overscaledZ===t&&i)return this.key;if(t>this.canonical.z)return Od(this.wrap*+i,t,this.canonical.z,this.canonical.x,this.canonical.y);{const a=this.canonical.z-t;return Od(this.wrap*+i,t,t,this.canonical.x>>a,this.canonical.y>>a)}}isChildOf(t){if(t.wrap!==this.wrap)return!1;const i=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ>i&&t.canonical.y===this.canonical.y>>i}children(t){if(this.overscaledZ>=t)return[new Xr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,a=2*this.canonical.x,u=2*this.canonical.y;return[new Xr(i,this.wrap,i,a,u),new Xr(i,this.wrap,i,a+1,u),new Xr(i,this.wrap,i,a,u+1),new Xr(i,this.wrap,i,a+1,u+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.yi.id),this.index=t.index,this.projection=t.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new ke,this.layoutVertexArray2=new qe,this.indexArray=new mt,this.programConfigurations=new Wl(t.layers,t.zoom),this.segments=new qn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(t,i,a,u){this.hasPattern=Gy("line",this.layers,i);const p=this.layers[0].layout.get("line-sort-key"),g=[];for(const{feature:A,id:I,index:M,sourceLayerIndex:L}of t){const R=this.layers[0]._featureFilter.needGeometry,F=Jl(A,R);if(!this.layers[0]._featureFilter.filter(new C(this.zoom),F,a))continue;const $=p?p.evaluate(F,{},a):void 0,K={id:I,properties:A.properties,type:A.type,sourceLayerIndex:L,index:M,geometry:R?F.geometry:Vs(A,a,u),patterns:{},sortKey:$};g.push(K)}p&&g.sort((A,I)=>A.sortKey-I.sortKey);const{lineAtlas:y,featureIndex:w}=i,b=this.addConstantDashes(y);for(const A of g){const{geometry:I,index:M,sourceLayerIndex:L}=A;if(b&&this.addFeatureDashes(A,y),this.hasPattern){const R=qy("line",this.layers,A,this.zoom,i);this.patternFeatures.push(R)}else this.addFeature(A,I,M,a,y.positions,i.availableImages);w.insert(t[M].feature,I,M,L,this.index)}}addConstantDashes(t){let i=!1;for(const a of this.layers){const u=a.paint.get("line-dasharray").value,p=a.layout.get("line-cap").value;if(u.kind!=="constant"||p.kind!=="constant")i=!0;else{const g=p.value,y=u.value;if(!y)continue;t.addDash(y,g)}}return i}addFeatureDashes(t,i){const a=this.zoom;for(const u of this.layers){const p=u.paint.get("line-dasharray").value,g=u.layout.get("line-cap").value;if(p.kind==="constant"&&g.kind==="constant")continue;let y,w;if(p.kind==="constant"){if(y=p.value,!y)continue}else y=p.evaluate({zoom:a},t);w=g.kind==="constant"?g.value:g.evaluate({zoom:a},t),i.addDash(y,w),t.patterns[u.id]=i.getKey(y,w)}}update(t,i,a,u){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,a,u)}addFeatures(t,i,a,u,p){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,i,a,u)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,xM)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,yM),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,i,a,u,p,g){const y=this.layers[0].layout,w=y.get("line-join").evaluate(t,{}),b=y.get("line-cap").evaluate(t,{}),A=y.get("line-miter-limit"),I=y.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const M of i)this.addLine(M,t,w,b,A,I);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,p,g,u)}addLine(t,i,a,u,p,g){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let K=0;K=2&&t[w-1].equals(t[w-2]);)w--;let b=0;for(;b0;if(Ie&&K>b){const Me=M.dist(L);if(Me>2*A){const Ue=M.sub(M.sub(L)._mult(A/Me)._round());this.updateDistance(L,Ue),this.addCurrentVertex(Ue,F,0,0,I),L=Ue}}const De=L&&R;let Ze=De?a:y?"butt":u;if(De&&Ze==="round"&&(uep&&(Ze="bevel"),Ze==="bevel"&&(ue>2&&(Ze="flipbevel"),ue100)se=$.mult(-1);else{const Me=ue*F.add($).mag()/F.sub($).mag();se._perp()._mult(Me*(Te?-1:1))}this.addCurrentVertex(M,se,0,0,I),this.addCurrentVertex(M,se.mult(-1),0,0,I)}else if(Ze==="bevel"||Ze==="fakeround"){const Me=-Math.sqrt(ue*ue-1),Ue=Te?Me:0,je=Te?0:Me;if(L&&this.addCurrentVertex(M,F,Ue,je,I),Ze==="fakeround"){const Ge=Math.round(180*ce/Math.PI/20);for(let et=1;et2*A){const Ue=M.add(R.sub(M)._mult(A/Me)._round());this.updateDistance(M,Ue),this.addCurrentVertex(Ue,$,0,0,I),M=Ue}}}}addCurrentVertex(t,i,a,u,p,g=!1){const y=i.y*u-i.x,w=-i.y-i.x*u;this.addHalfVertex(t,i.x+i.y*a,i.y-i.x*a,g,!1,a,p),this.addHalfVertex(t,y,w,g,!0,-u,p)}addHalfVertex({x:t,y:i},a,u,p,g,y,w){this.layoutVertexArray.emplaceBack((t<<1)+(p?1:0),(i<<1)+(g?1:0),Math.round(63*a)+128,Math.round(63*u)+128,1+(y===0?0:y<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const b=w.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),w.primitiveLength++),g?this.e2=b:this.e1=b}updateScaledDistance(){if(this.lineClips){const t=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=t*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(t,i){this.distance+=t.dist(i),this.updateScaledDistance()}}dt(mm,"LineBucket",{omit:["layers","patternFeatures"]});const EM=new ee({"line-cap":new q(Re.layout_line["line-cap"]),"line-join":new q(Re.layout_line["line-join"]),"line-miter-limit":new B(Re.layout_line["line-miter-limit"]),"line-round-limit":new B(Re.layout_line["line-round-limit"]),"line-sort-key":new q(Re.layout_line["line-sort-key"])});var nb={paint:new ee({"line-opacity":new q(Re.paint_line["line-opacity"]),"line-color":new q(Re.paint_line["line-color"]),"line-translate":new B(Re.paint_line["line-translate"]),"line-translate-anchor":new B(Re.paint_line["line-translate-anchor"]),"line-width":new q(Re.paint_line["line-width"]),"line-gap-width":new q(Re.paint_line["line-gap-width"]),"line-offset":new q(Re.paint_line["line-offset"]),"line-blur":new q(Re.paint_line["line-blur"]),"line-dasharray":new q(Re.paint_line["line-dasharray"]),"line-pattern":new q(Re.paint_line["line-pattern"]),"line-gradient":new Q(Re.paint_line["line-gradient"]),"line-trim-offset":new B(Re.paint_line["line-trim-offset"])}),layout:EM};const rb=new class extends q{possiblyEvaluate(r,t){return t=new C(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(r,t)}evaluate(r,t,i,a){return t=vn({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(r,t,i,a)}}(nb.paint.properties["line-width"].specification);function ib(r,t){return t>0?t+2*r:r}rb.useIntegerZoom=!0;const TM=ye([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),SM=ye([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),AM=ye([{name:"a_projected_pos",components:4,type:"Float32"}],4);ye([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const CM=ye([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),IM=ye([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const ob=ye([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),kM=ye([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);ye([{name:"triangle",components:3,type:"Uint16"}]),ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),ye([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ye([{type:"Float32",name:"offsetX"}]),ye([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Tr=24;const Oo=128;function Zy(r,t){const{expression:i}=t;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new C(r+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:u}=i;let p=0;for(;p{a.text=function(u,p,g){const y=p.layout.get("text-transform").evaluate(g,{});return y==="uppercase"?u=u.toLocaleUpperCase():y==="lowercase"&&(u=u.toLocaleLowerCase()),S.applyArabicShaping&&(u=S.applyArabicShaping(u)),u}(a.text,t,i)}),r}const Fd={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function zM(r){return r==="︶"||r==="﹈"||r==="︸"||r==="﹄"||r==="﹂"||r==="︾"||r==="︼"||r==="︺"||r==="︘"||r==="﹀"||r==="︐"||r==="︓"||r==="︔"||r==="`"||r===" ̄"||r==="︑"||r==="︒"}function LM(r){return r==="︵"||r==="﹇"||r==="︷"||r==="﹃"||r==="﹁"||r==="︽"||r==="︻"||r==="︹"||r==="︗"||r==="︿"}var sb=pn,ab=function(r,t,i,a,u){var p,g,y=8*u-a-1,w=(1<>1,A=-7,I=i?u-1:0,M=i?-1:1,L=r[t+I];for(I+=M,p=L&(1<<-A)-1,L>>=-A,A+=y;A>0;p=256*p+r[t+I],I+=M,A-=8);for(g=p&(1<<-A)-1,p>>=-A,A+=a;A>0;g=256*g+r[t+I],I+=M,A-=8);if(p===0)p=1-b;else{if(p===w)return g?NaN:1/0*(L?-1:1);g+=Math.pow(2,a),p-=b}return(L?-1:1)*g*Math.pow(2,p-a)},lb=function(r,t,i,a,u,p){var g,y,w,b=8*p-u-1,A=(1<>1,M=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=a?0:p-1,R=a?1:-1,F=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(y=isNaN(t)?1:0,g=A):(g=Math.floor(Math.log(t)/Math.LN2),t*(w=Math.pow(2,-g))<1&&(g--,w*=2),(t+=g+I>=1?M/w:M*Math.pow(2,1-I))*w>=2&&(g++,w/=2),g+I>=A?(y=0,g=A):g+I>=1?(y=(t*w-1)*Math.pow(2,u),g+=I):(y=t*Math.pow(2,I-1)*Math.pow(2,u),g=0));u>=8;r[i+L]=255&y,L+=R,y/=256,u-=8);for(g=g<0;r[i+L]=255&g,L+=R,g/=256,b-=8);r[i+L-R]|=128*F};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function pn(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}pn.Varint=0,pn.Fixed64=1,pn.Bytes=2,pn.Fixed32=5;var Hy=4294967296,cb=1/Hy,ub=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Gs(r){return r.type===pn.Bytes?r.readVarint()+r.pos:r.pos+1}function mu(r,t,i){return i?4294967296*t+(r>>>0):4294967296*(t>>>0)+(r>>>0)}function hb(r,t,i){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(a);for(var u=i.pos-1;u>=r;u--)i.buf[u+a]=i.buf[u]}function RM(r,t){for(var i=0;i>>8,r[i+2]=t>>>16,r[i+3]=t>>>24}function db(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+(r[t+3]<<24)}pn.prototype={destroy:function(){this.buf=null},readFields:function(r,t,i){for(i=i||this.length;this.pos>3,p=this.pos;this.type=7&a,r(u,t,this),this.pos===p&&this.skip(a)}return t},readMessage:function(r,t){return this.readFields(r,t,this.readVarint()+this.pos)},readFixed32:function(){var r=_m(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=db(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=_m(this.buf,this.pos)+_m(this.buf,this.pos+4)*Hy;return this.pos+=8,r},readSFixed64:function(){var r=_m(this.buf,this.pos)+db(this.buf,this.pos+4)*Hy;return this.pos+=8,r},readFloat:function(){var r=ab(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=ab(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var t,i,a=this.buf;return t=127&(i=a[this.pos++]),i<128?t:(t|=(127&(i=a[this.pos++]))<<7,i<128?t:(t|=(127&(i=a[this.pos++]))<<14,i<128?t:(t|=(127&(i=a[this.pos++]))<<21,i<128?t:function(u,p,g){var y,w,b=g.buf;if(y=(112&(w=b[g.pos++]))>>4,w<128||(y|=(127&(w=b[g.pos++]))<<3,w<128)||(y|=(127&(w=b[g.pos++]))<<10,w<128)||(y|=(127&(w=b[g.pos++]))<<17,w<128)||(y|=(127&(w=b[g.pos++]))<<24,w<128)||(y|=(1&(w=b[g.pos++]))<<31,w<128))return mu(u,y,p);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=a[this.pos]))<<28,r,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2==1?(r+1)/-2:r/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var r=this.readVarint()+this.pos,t=this.pos;return this.pos=r,r-t>=12&&ub?function(i,a,u){return ub.decode(i.subarray(a,u))}(this.buf,t,r):function(i,a,u){for(var p="",g=a;g239?4:A>223?3:A>191?2:1;if(g+M>u)break;M===1?A<128&&(I=A):M===2?(192&(y=i[g+1]))==128&&(I=(31&A)<<6|63&y)<=127&&(I=null):M===3?(w=i[g+2],(192&(y=i[g+1]))==128&&(192&w)==128&&((I=(15&A)<<12|(63&y)<<6|63&w)<=2047||I>=55296&&I<=57343)&&(I=null)):M===4&&(w=i[g+2],b=i[g+3],(192&(y=i[g+1]))==128&&(192&w)==128&&(192&b)==128&&((I=(15&A)<<18|(63&y)<<12|(63&w)<<6|63&b)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,M=1):I>65535&&(I-=65536,p+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),p+=String.fromCharCode(I),g+=M}return p}(this.buf,t,r)},readBytes:function(){var r=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,r);return this.pos=r,t},readPackedVarint:function(r,t){if(this.type!==pn.Bytes)return r.push(this.readVarint(t));var i=Gs(this);for(r=r||[];this.pos127;);else if(t===pn.Bytes)this.pos=this.readVarint()+this.pos;else if(t===pn.Fixed32)this.pos+=4;else{if(t!==pn.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(r,t){this.writeVarint(r<<3|t)},realloc:function(r){for(var t=this.length||16;t268435455||r<0?function(t,i){var a,u;if(t>=0?(a=t%4294967296|0,u=t/4294967296|0):(u=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,u=u+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(p,g,y){y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,p>>>=7,y.buf[y.pos++]=127&p|128,y.buf[y.pos]=127&(p>>>=7)}(a,0,i),function(p,g){var y=(7&p)<<4;g.buf[g.pos++]|=y|((p>>>=3)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p|((p>>>=7)?128:0),p&&(g.buf[g.pos++]=127&p)))))}(u,i)}(r,this):(this.realloc(4),this.buf[this.pos++]=127&r|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=r>>>7&127))))},writeSVarint:function(r){this.writeVarint(r<0?2*-r-1:2*r)},writeBoolean:function(r){this.writeVarint(!!r)},writeString:function(r){r=String(r),this.realloc(4*r.length),this.pos++;var t=this.pos;this.pos=function(a,u,p){for(var g,y,w=0;w55295&&g<57344){if(!y){g>56319||w+1===u.length?(a[p++]=239,a[p++]=191,a[p++]=189):y=g;continue}if(g<56320){a[p++]=239,a[p++]=191,a[p++]=189,y=g;continue}g=y-55296<<10|g-56320|65536,y=null}else y&&(a[p++]=239,a[p++]=191,a[p++]=189,y=null);g<128?a[p++]=g:(g<2048?a[p++]=g>>6|192:(g<65536?a[p++]=g>>12|224:(a[p++]=g>>18|240,a[p++]=g>>12&63|128),a[p++]=g>>6&63|128),a[p++]=63&g|128)}return p}(this.buf,r,this.pos);var i=this.pos-t;i>=128&&hb(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(r){this.realloc(4),lb(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),lb(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var t=r.length;this.writeVarint(t),this.realloc(t);for(var i=0;i=128&&hb(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a},writeMessage:function(r,t,i){this.writeTag(r,pn.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(r,t){t.length&&this.writeMessage(r,RM,t)},writePackedSVarint:function(r,t){t.length&&this.writeMessage(r,DM,t)},writePackedBoolean:function(r,t){t.length&&this.writeMessage(r,FM,t)},writePackedFloat:function(r,t){t.length&&this.writeMessage(r,OM,t)},writePackedDouble:function(r,t){t.length&&this.writeMessage(r,BM,t)},writePackedFixed32:function(r,t){t.length&&this.writeMessage(r,NM,t)},writePackedSFixed32:function(r,t){t.length&&this.writeMessage(r,UM,t)},writePackedFixed64:function(r,t){t.length&&this.writeMessage(r,jM,t)},writePackedSFixed64:function(r,t){t.length&&this.writeMessage(r,VM,t)},writeBytesField:function(r,t){this.writeTag(r,pn.Bytes),this.writeBytes(t)},writeFixed32Field:function(r,t){this.writeTag(r,pn.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(r,t){this.writeTag(r,pn.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(r,t){this.writeTag(r,pn.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(r,t){this.writeTag(r,pn.Fixed64),this.writeSFixed64(t)},writeVarintField:function(r,t){this.writeTag(r,pn.Varint),this.writeVarint(t)},writeSVarintField:function(r,t){this.writeTag(r,pn.Varint),this.writeSVarint(t)},writeStringField:function(r,t){this.writeTag(r,pn.Bytes),this.writeString(t)},writeFloatField:function(r,t){this.writeTag(r,pn.Fixed32),this.writeFloat(t)},writeDoubleField:function(r,t){this.writeTag(r,pn.Fixed64),this.writeDouble(t)},writeBooleanField:function(r,t){this.writeVarintField(r,!!t)}};var ym=le(sb);const Xy=3;function $M(r,t,i){t.glyphs=[],r===1&&i.readMessage(GM,t)}function GM(r,t,i){if(r===3){const{id:a,bitmap:u,width:p,height:g,left:y,top:w,advance:b}=i.readMessage(qM,{});t.glyphs.push({id:a,bitmap:new $s({width:p+2*Xy,height:g+2*Xy},u),metrics:{width:p,height:g,left:y,top:w,advance:b}})}else r===4?t.ascender=i.readSVarint():r===5&&(t.descender=i.readSVarint())}function qM(r,t,i){r===1?t.id=i.readVarint():r===2?t.bitmap=i.readBytes():r===3?t.width=i.readVarint():r===4?t.height=i.readVarint():r===5?t.left=i.readSVarint():r===6?t.top=i.readSVarint():r===7&&(t.advance=i.readVarint())}const pb=Xy;function Ky(r){let t=0,i=0;for(const g of r)t+=g.w*g.h,i=Math.max(i,g.w);r.sort((g,y)=>y.h-g.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let u=0,p=0;for(const g of r)for(let y=a.length-1;y>=0;y--){const w=a[y];if(!(g.w>w.w||g.h>w.h)){if(g.x=w.x,g.y=w.y,p=Math.max(p,g.y+g.h),u=Math.max(u,g.x+g.w),g.w===w.w&&g.h===w.h){const b=a.pop();yt.hasImage(a)),t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in t.updatedImages)this.patchUpdatedImage(this.iconPositions[a],t.getImage(a),i),this.patchUpdatedImage(this.patternPositions[a],t.getImage(a),i)}patchUpdatedImage(t,i,a){if(!t||!i||t.version===i.version)return;t.version=i.version;const[u,p]=t.tl;a.update(i.data,void 0,{x:u,y:p})}}dt(Yy,"ImagePosition"),dt(fb,"ImageAtlas");const Ni={horizontal:1,vertical:2,horizontalOnly:3},mb=-17;class Nd{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,i){const a=new Nd;return a.scale=t||1,a.fontStack=i,a}static forImage(t){const i=new Nd;return i.imageName=t,i}}class _u{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,i){const a=new _u;for(let u=0;u=0&&a>=t&&vm[this.text.charCodeAt(a)];a--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)}substring(t,i){const a=new _u;return a.text=this.text.substring(t,i),a.sectionIndex=this.sectionIndex.slice(t,i),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,i)=>Math.max(t,this.sections[i].scale),0)}addTextSection(t,i){this.text+=t.text,this.sections.push(Nd.forText(t.scale,t.fontStack||i));const a=this.sections.length-1;for(let u=0;u=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Jy(r,t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=_u.fromFeature(r,u);I===Ni.vertical&&F.verticalizePunctuation(M);let $=[];const K=function(ce,Ie,Te,De,Ze,Me){if(!ce)return[];const Ue=[],je=function(ot,ft,st,At,tt,_t){let Ct=0;for(let Ht=0;Ht=0;let et=0;for(let ot=0;ot0&&No>un&&(un=No)}else{const Yr=Te[nr.fontStack];if(!Yr)continue;Yr[Mn]&&(gn=Yr[Mn]);const gr=Ie[nr.fontStack];if(!gr)continue;const No=gr.glyphs[Mn];if(!No)continue;if(Xn=No.metrics,Kn=Mn!==8203?Tr:0,_t){const Tu=gr.ascender!==void 0?Math.abs(gr.ascender):0,Xd=gr.descender!==void 0?Math.abs(gr.descender):0,Kd=(Tu+Xd)*Kt;kn-i/2;){if(g--,g<0)return!1;y-=r[g].dist(p),p=r[g]}y+=r[g].dist(r[g+1]),g++;const w=[];let b=0;for(;ya;)b-=w.shift().angleDelta;if(b>u)return!1;g++,y+=A.dist(I)}return!0}function Eb(r){let t=0;for(let i=0;ib){const R=(b-w)/L,F=Wt(I.x,M.x,R),$=Wt(I.y,M.y,R),K=new qs(F,$,0,M.angleTo(I),A);return!g||bb(r,K,y,g,t)?K:void 0}w+=L}}function KM(r,t,i,a,u,p,g,y,w){const b=Tb(a,p,g),A=Sb(a,u),I=A*g,M=r[0].x===0||r[0].x===w||r[0].y===0||r[0].y===w;return t-I=0&&re=0&&ue=0&&M+b<=A){const ce=new qs(re,ue,0,se,R);ce._round(),a&&!bb(r,ce,p,a,u)||L.push(ce)}}I+=K}return y||L.length||g||(L=Ab(r,I/2,i,a,u,p,g,!0,w)),L}function Cb(r,t,i,a,u){const p=[];for(let g=0;g=a&&I.x>=a||(A.x>=a?A=new Ve(a,A.y+(a-A.x)/(I.x-A.x)*(I.y-A.y))._round():I.x>=a&&(I=new Ve(a,A.y+(a-A.x)/(I.x-A.x)*(I.y-A.y))._round()),A.y>=u&&I.y>=u||(A.y>=u?A=new Ve(A.x+(u-A.y)/(I.y-A.y)*(I.x-A.x),u)._round():I.y>=u&&(I=new Ve(A.x+(u-A.y)/(I.y-A.y)*(I.x-A.x),u)._round()),w&&A.equals(w[w.length-1])||(w=[A],p.push(w)),w.push(I)))))}}return p}dt(qs,"Anchor");const Ud=1e20;function Ib(r,t,i,a,u,p,g,y,w){for(let b=t;b-1);w++,p[w]=y,g[w]=b,g[w+1]=Ud}for(let y=0,w=0;y{let y=this.entries[u];y||(y=this.entries[u]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let w=y.glyphs[p];if(w!==void 0)return void g(null,{stack:u,id:p,glyph:w});if(w=this._tinySDF(y,u,p),w)return y.glyphs[p]=w,void g(null,{stack:u,id:p,glyph:w});const b=Math.floor(p/256);if(256*b>65535)return void g(new Error("glyphs > 65535 not supported"));if(y.ranges[b])return void g(null,{stack:u,id:p,glyph:w});let A=y.requests[b];A||(A=y.requests[b]=[],yu.loadGlyphRange(u,b,this.url,this.requestManager,(I,M)=>{if(M){y.ascender=M.ascender,y.descender=M.descender;for(const L in M.glyphs)this._doesCharSupportLocalGlyph(+L)||(y.glyphs[+L]=M.glyphs[+L]);y.ranges[b]=!0}for(const L of A)L(I,M);delete y.requests[b]})),A.push((I,M)=>{I?g(I):M&&g(null,{stack:u,id:p,glyph:M.glyphs[p]||null})})},(u,p)=>{if(u)i(u);else if(p){const g={};for(const{stack:y,id:w,glyph:b}of p)g[y]===void 0&&(g[y]={}),g[y].glyphs===void 0&&(g[y].glyphs={}),g[y].glyphs[w]=b&&{id:b.id,bitmap:b.bitmap.clone(),metrics:b.metrics},g[y].ascender=this.entries[y].ascender,g[y].descender=this.entries[y].descender;i(null,g)}})}_doesCharSupportLocalGlyph(t){return this.localGlyphMode!==e0.none&&(this.localGlyphMode===e0.all?!!this.localFontFamily:!!this.localFontFamily&&(at["CJK Unified Ideographs"](t)||at["Hangul Syllables"](t)||at.Hiragana(t)||at.Katakana(t)||at["CJK Symbols and Punctuation"](t)))}_tinySDF(t,i,a){const u=this.localFontFamily;if(!u||!this._doesCharSupportLocalGlyph(a))return;let p=t.tinySDF;if(!p){let F="400";/bold/i.test(i)?F="900":/medium/i.test(i)?F="500":/light/i.test(i)&&(F="200"),p=t.tinySDF=new yu.TinySDF({fontFamily:u,fontWeight:F,fontSize:24*Bo,buffer:3*Bo,radius:8*Bo}),p.fontWeight=F}if(this.localGlyphs[p.fontWeight][a])return this.localGlyphs[p.fontWeight][a];const g=String.fromCharCode(a),{data:y,width:w,height:b,glyphWidth:A,glyphHeight:I,glyphLeft:M,glyphTop:L,glyphAdvance:R}=p.draw(g);return this.localGlyphs[p.fontWeight][a]={id:a,bitmap:new $s({width:w,height:b},y),metrics:{width:A/Bo,height:I/Bo,left:M/Bo,top:L/Bo-27,advance:R/Bo,localGlyph:!0}}}}yu.loadGlyphRange=function(r,t,i,a,u){const p=256*t,g=p+255,y=a.transformRequest(a.normalizeGlyphsURL(i).replace("{fontstack}",r).replace("{range}",`${p}-${g}`),Ss.Glyphs);ua(y,(w,b)=>{if(w)u(w);else if(b){const A={},I=function(M){return new ym(M).readFields($M,{})}(b);for(const M of I.glyphs)A[M.id]=M;u(null,{glyphs:A,ascender:I.ascender,descender:I.descender})}})},yu.TinySDF=class{constructor({fontSize:r=24,buffer:t=3,radius:i=8,cutoff:a=.25,fontFamily:u="sans-serif",fontWeight:p="normal",fontStyle:g="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=i;const y=this.size=r+4*t,w=this._createCanvas(y),b=this.ctx=w.getContext("2d",{willReadFrequently:!0});b.font=`${g} ${p} ${r}px ${u}`,b.textBaseline="alphabetic",b.textAlign="left",b.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}_createCanvas(r){const t=document.createElement("canvas");return t.width=t.height=r,t}draw(r){const{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:a,actualBoundingBoxLeft:u,actualBoundingBoxRight:p}=this.ctx.measureText(r),g=Math.ceil(i),y=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-u))),w=Math.min(this.size-this.buffer,g+Math.ceil(a)),b=y+2*this.buffer,A=w+2*this.buffer,I=Math.max(b*A,0),M=new Uint8ClampedArray(I),L={data:M,width:b,height:A,glyphWidth:y,glyphHeight:w,glyphTop:g,glyphLeft:0,glyphAdvance:t};if(y===0||w===0)return L;const{ctx:R,buffer:F,gridInner:$,gridOuter:K}=this;R.clearRect(F,F,y,w),R.fillText(r,F,F+g);const se=R.getImageData(F,F,y,w);K.fill(Ud,0,I),$.fill(0,0,I);for(let Y=0;Y0?Ie*Ie:0,$[ce]=Ie<0?Ie*Ie:0}}Ib(K,0,0,b,A,b,this.f,this.v,this.z),Ib($,F,F,y,w,b,this.f,this.v,this.z);for(let Y=0;YMe+Ue[1]-Ue[0],R=I.reduce(L,0),F=M.reduce(L,0),$=y-R,K=w-F;let se=0,Y=R,re=0,ue=F,ce=0,Ie=$,Te=0,De=K;if(p.content&&a){const Me=p.content;se=xm(I,0,Me[0]),re=xm(M,0,Me[1]),Y=xm(I,Me[0],Me[2]),ue=xm(M,Me[1],Me[3]),ce=Me[0]-se,Te=Me[1]-re,Ie=Me[2]-Me[0]-Y,De=Me[3]-Me[1]-ue}const Ze=(Me,Ue,je,Ge)=>{const et=wm(Me.stretch-se,Y,b,r.left),Le=bm(Me.fixed-ce,Ie,Me.stretch,R),ot=wm(Ue.stretch-re,ue,A,r.top),ft=bm(Ue.fixed-Te,De,Ue.stretch,F),st=wm(je.stretch-se,Y,b,r.left),At=bm(je.fixed-ce,Ie,je.stretch,R),tt=wm(Ge.stretch-re,ue,A,r.top),_t=bm(Ge.fixed-Te,De,Ge.stretch,F),Ct=new Ve(et,ot),Ht=new Ve(st,ot),It=new Ve(st,tt),bt=new Ve(et,tt),bn=new Ve(Le/g,ft/g),zt=new Ve(At/g,_t/g),Lt=t*Math.PI/180;if(Lt){const mn=Math.sin(Lt),un=Math.cos(Lt),kn=[un,-mn,mn,un];Ct._matMult(kn),Ht._matMult(kn),bt._matMult(kn),It._matMult(kn)}const cn=Me.stretch+Me.fixed,fn=Ue.stretch+Ue.fixed;return{tl:Ct,tr:Ht,bl:bt,br:It,tex:{x:p.paddedRect.x+vu+cn,y:p.paddedRect.y+vu+fn,w:je.stretch+je.fixed-cn,h:Ge.stretch+Ge.fixed-fn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:bn,pixelOffsetBR:zt,minFontScaleX:Ie/g/b,minFontScaleY:De/g/A,isSDF:i}};if(a&&(p.stretchX||p.stretchY)){const Me=Pb(I,$,R),Ue=Pb(M,K,F);for(let je=0;je0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:i,compare:a}=this,u=i[t];for(;t>0;){const p=t-1>>1,g=i[p];if(a(u,g)>=0)break;i[t]=g,t=p}i[t]=u}_down(t){const{data:i,compare:a}=this,u=this.length>>1,p=i[t];for(;t=0)break;i[t]=y,t=g}i[t]=p}}function QM(r,t){return rt?1:0}function eP(r,t=1,i=!1){let a=1/0,u=1/0,p=-1/0,g=-1/0;const y=r[0];for(let L=0;Lp)&&(p=R.x),(!L||R.y>g)&&(g=R.y)}const w=Math.min(p-a,g-u);let b=w/2;const A=new JM([],tP);if(w===0)return new Ve(a,u);for(let L=a;LI.d||!I.d)&&(I=L,i&&console.log("found best %d after %d probes",Math.round(1e4*L.d)/1e4,M)),L.max-I.d<=t||(b=L.h/2,A.push(new xu(L.p.x-b,L.p.y-b,b,r)),A.push(new xu(L.p.x+b,L.p.y-b,b,r)),A.push(new xu(L.p.x-b,L.p.y+b,b,r)),A.push(new xu(L.p.x+b,L.p.y+b,b,r)),M+=4)}return i&&(console.log(`num probes: ${M}`),console.log(`best distance: ${I.d}`)),I.p}function tP(r,t){return t.max-r.max}class xu{constructor(t,i,a,u){this.p=new Ve(t,i),this.h=a,this.d=function(p,g){let y=!1,w=1/0;for(let b=0;bp.y!=F.y>p.y&&p.x<(F.x-R.x)*(p.y-R.y)/(F.y-R.y)+R.x&&(y=!y),w=Math.min(w,Aw(p,R,F))}}return(y?1:-1)*Math.sqrt(w)}(this.p,u),this.max=this.d+this.h*Math.SQRT2}}const wu=7,t0=Number.POSITIVE_INFINITY,nP=Math.sqrt(2);function zb(r,[t,i]){let a=0,u=0;if(i===t0){t<0&&(t=0);const p=t/nP;switch(r){case"top-right":case"top-left":u=p-wu;break;case"bottom-right":case"bottom-left":u=-p+wu;break;case"bottom":u=-t+wu;break;case"top":u=t-wu}switch(r){case"top-right":case"bottom-right":a=-p;break;case"top-left":case"bottom-left":a=p;break;case"left":a=t;break;case"right":a=-t}}else{switch(t=Math.abs(t),i=Math.abs(i),r){case"top-right":case"top-left":case"top":u=i-wu;break;case"bottom-right":case"bottom-left":case"bottom":u=-i+wu}switch(r){case"top-right":case"bottom-right":case"right":a=-t;break;case"top-left":case"bottom-left":case"left":a=t}}return[a,u]}function rP(r,t,i,a,u,p,g,y,w,b){r.createArrays(),r.tilePixelRatio=vt/(512*r.overscaling),r.compareText={},r.iconsNeedLinear=!1;const A=r.layers[0].layout,I=r.layers[0]._unevaluatedLayout._values,M={};if(r.textSizeData.kind==="composite"){const{minZoom:F,maxZoom:$}=r.textSizeData;M.compositeTextSizes=[I["text-size"].possiblyEvaluate(new C(F),y),I["text-size"].possiblyEvaluate(new C($),y)]}if(r.iconSizeData.kind==="composite"){const{minZoom:F,maxZoom:$}=r.iconSizeData;M.compositeIconSizes=[I["icon-size"].possiblyEvaluate(new C(F),y),I["icon-size"].possiblyEvaluate(new C($),y)]}M.layoutTextSize=I["text-size"].possiblyEvaluate(new C(w+1),y),M.layoutIconSize=I["icon-size"].possiblyEvaluate(new C(w+1),y),M.textMaxSize=I["text-size"].possiblyEvaluate(new C(18),y);const L=A.get("text-rotation-alignment")==="map"&&A.get("symbol-placement")!=="point",R=A.get("text-size");for(const F of r.features){const $=A.get("text-font").evaluate(F,{},y).join(","),K=R.evaluate(F,{},y),se=M.layoutTextSize.evaluate(F,{},y),Y=(M.layoutIconSize.evaluate(F,{},y),{horizontal:{},vertical:void 0}),re=F.text;let ue,ce=[0,0];if(re){const De=re.toString(),Ze=A.get("text-letter-spacing").evaluate(F,{},y)*Tr,Me=A.get("text-line-height").evaluate(F,{},y)*Tr,Ue=uy(De)?Ze:0,je=A.get("text-anchor").evaluate(F,{},y),Ge=A.get("text-variable-anchor");if(!Ge){const st=A.get("text-radial-offset").evaluate(F,{},y);ce=st?zb(je,[st*Tr,t0]):A.get("text-offset").evaluate(F,{},y).map(At=>At*Tr)}let et=L?"center":A.get("text-justify").evaluate(F,{},y);const Le=A.get("symbol-placement")==="point",ot=Le?A.get("text-max-width").evaluate(F,{},y)*Tr:1/0,ft=st=>{r.allowVerticalPlacement&&hd(De)&&(Y.vertical=Jy(re,t,i,u,$,ot,Me,je,st,Ue,ce,Ni.vertical,!0,se,K))};if(!L&&Ge){const st=et==="auto"?Ge.map(tt=>n0(tt)):[et];let At=!1;for(let tt=0;tt=0||!hd(De)){const st=Jy(re,t,i,u,$,ot,Me,je,et,Ue,ce,Ni.horizontal,!1,se,K);st&&(Y.horizontal[et]=st)}ft(Le?"left":et)}}let Ie=!1;if(F.icon&&F.icon.name){const De=a[F.icon.name];De&&(ue=HM(u[F.icon.name],A.get("icon-offset").evaluate(F,{},y),A.get("icon-anchor").evaluate(F,{},y)),Ie=De.sdf,r.sdfIcons===void 0?r.sdfIcons=De.sdf:r.sdfIcons!==De.sdf&&wn("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(De.pixelRatio!==r.pixelRatio||A.get("icon-rotate").constantOr(1)!==0)&&(r.iconsNeedLinear=!0))}const Te=Rb(Y.horizontal)||Y.vertical;r.iconsInText||(r.iconsInText=!!Te&&Te.iconsInText),(Te||ue)&&iP(r,F,Y,ue,a,M,se,0,ce,Ie,g,y,b)}p&&r.generateCollisionDebugBuffers(w,r.collisionBoxArray)}function n0(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function iP(r,t,i,a,u,p,g,y,w,b,A,I,M){let L=p.textMaxSize.evaluate(t,{},I);L===void 0&&(L=g);const R=r.layers[0].layout,F=R.get("icon-offset").evaluate(t,{},I),$=Rb(i.horizontal)||i.vertical,K=M.name==="globe",se=Tr,Y=g/se,re=r.tilePixelRatio*L/se,ue=(je=r.overscaling,r.zoom>18&&je>2&&(je>>=1),Math.max(vt/(512*je),1)*R.get("symbol-spacing")),ce=R.get("text-padding")*r.tilePixelRatio,Ie=R.get("icon-padding")*r.tilePixelRatio,Te=St(R.get("text-max-angle")),De=R.get("text-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",Ze=R.get("icon-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",Me=R.get("symbol-placement"),Ue=ue/2;var je;const Ge=R.get("icon-text-fit");let et;a&&Ge!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(et=wb(a,i.vertical,Ge,R.get("icon-text-fit-padding"),F,Y)),$&&(a=wb(a,$,Ge,R.get("icon-text-fit-padding"),F,Y)));const Le=(ot,ft,st)=>{if(ft.x<0||ft.x>=vt||ft.y<0||ft.y>=vt)return;let At=null;if(K){const{x:tt,y:_t,z:Ct}=M.projectTilePoint(ft.x,ft.y,st);At={anchor:new qs(tt,_t,Ct,0,void 0),up:M.upVector(st,ft.x,ft.y)}}(function(tt,_t,Ct,Ht,It,bt,bn,zt,Lt,cn,fn,mn,un,kn,Rn,Zn,hn,nr,Hn,Mn,Kt,Xn,gn,Kr,Kn){const Sr=tt.addToLineVertexArray(_t,Ht);let mr,Yr,gr,No,Tu,Xd,Kd,p2=0,f2=0,m2=0,g2=0,_0=-1,y0=-1;const ds={};let _2=py("");const rc=Ct?Ct.anchor:_t;let v0=0,x0=0;if(Lt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[v0,x0]=Lt.layout.get("text-offset").evaluate(Kt,{},Kn).map(bi=>bi*Tr):(v0=Lt.layout.get("text-radial-offset").evaluate(Kt,{},Kn)*Tr,x0=t0),tt.allowVerticalPlacement&&It.vertical){const bi=It.vertical;if(Rn)Xd=r0(bi),zt&&(Kd=r0(zt));else{const Ei=Lt.layout.get("text-rotate").evaluate(Kt,{},Kn)+90;gr=Em(cn,rc,_t,fn,mn,un,bi,kn,Ei,Zn),zt&&(No=Em(cn,rc,_t,fn,mn,un,zt,nr,Ei))}}if(bt){const bi=Lt.layout.get("icon-rotate").evaluate(Kt,{},Kn),Ei=Lt.layout.get("icon-text-fit")!=="none",Yd=Mb(bt,bi,gn,Ei),b0=zt?Mb(zt,bi,gn,Ei):void 0;Yr=Em(cn,rc,_t,fn,mn,un,bt,nr,bi),p2=4*Yd.length;const y2=tt.iconSizeData;let ic=null;y2.kind==="source"?(ic=[Oo*Lt.layout.get("icon-size").evaluate(Kt,{},Kn)],ic[0]>Ra&&wn(`${tt.layerIds[0]}: Value for "icon-size" is >= ${jd}. Reduce your "icon-size".`)):y2.kind==="composite"&&(ic=[Oo*Xn.compositeIconSizes[0].evaluate(Kt,{},Kn),Oo*Xn.compositeIconSizes[1].evaluate(Kt,{},Kn)],(ic[0]>Ra||ic[1]>Ra)&&wn(`${tt.layerIds[0]}: Value for "icon-size" is >= ${jd}. Reduce your "icon-size".`)),tt.addSymbols(tt.icon,Yd,ic,Mn,Hn,Kt,!1,Ct,_t,Sr.lineStartIndex,Sr.lineLength,-1,Kr,Kn),_0=tt.icon.placedSymbolArray.length-1,b0&&(f2=4*b0.length,tt.addSymbols(tt.icon,b0,ic,Mn,Hn,Kt,Ni.vertical,Ct,_t,Sr.lineStartIndex,Sr.lineLength,-1,Kr,Kn),y0=tt.icon.placedSymbolArray.length-1)}for(const bi in It.horizontal){const Ei=It.horizontal[bi];mr||(_2=py(Ei.text),Rn?Tu=r0(Ei):mr=Em(cn,rc,_t,fn,mn,un,Ei,kn,Lt.layout.get("text-rotate").evaluate(Kt,{},Kn),Zn));const Yd=Ei.positionedLines.length===1;if(m2+=Lb(tt,Ct,_t,Ei,bn,Lt,Rn,Kt,Zn,Sr,It.vertical?Ni.horizontal:Ni.horizontalOnly,Yd?Object.keys(It.horizontal):[bi],ds,_0,Xn,Kr,Kn),Yd)break}It.vertical&&(g2+=Lb(tt,Ct,_t,It.vertical,bn,Lt,Rn,Kt,Zn,Sr,Ni.vertical,["vertical"],ds,y0,Xn,Kr,Kn));let Ua=-1;const w0=(bi,Ei)=>bi?Math.max(bi,Ei):Ei;Ua=w0(Tu,Ua),Ua=w0(Xd,Ua),Ua=w0(Kd,Ua);const zP=Ua>-1?1:0;tt.glyphOffsetArray.length>=Oa.MAX_GLYPHS&&wn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Kt.sortKey!==void 0&&tt.addToSortKeyRanges(tt.symbolInstances.length,Kt.sortKey),tt.symbolInstances.emplaceBack(rc.x,rc.y,rc.z,_t.x,_t.y,ds.right>=0?ds.right:-1,ds.center>=0?ds.center:-1,ds.left>=0?ds.left:-1,ds.vertical>=0?ds.vertical:-1,_0,y0,_2,mr!==void 0?mr:tt.collisionBoxArray.length,mr!==void 0?mr+1:tt.collisionBoxArray.length,gr!==void 0?gr:tt.collisionBoxArray.length,gr!==void 0?gr+1:tt.collisionBoxArray.length,Yr!==void 0?Yr:tt.collisionBoxArray.length,Yr!==void 0?Yr+1:tt.collisionBoxArray.length,No||tt.collisionBoxArray.length,No?No+1:tt.collisionBoxArray.length,fn,m2,g2,p2,f2,zP,0,v0,x0,Ua)})(r,ft,At,ot,i,a,u,et,r.layers[0],r.collisionBoxArray,t.index,t.sourceLayerIndex,r.index,ce,De,w,0,Ie,Ze,F,t,p,b,A,I)};if(Me==="line")for(const ot of Cb(t.geometry,0,0,vt,vt)){const ft=KM(ot,ue,Te,i.vertical||$,a,se,re,r.overscaling,vt);for(const st of ft)$&&oP(r,$.text,Ue,st)||Le(ot,st,I)}else if(Me==="line-center"){for(const ot of t.geometry)if(ot.length>1){const ft=XM(ot,Te,i.vertical||$,a,se,re);ft&&Le(ot,ft,I)}}else if(t.type==="Polygon")for(const ot of $y(t.geometry,0)){const ft=eP(ot,16);Le(ot[0],new qs(ft.x,ft.y,0,0,void 0),I)}else if(t.type==="LineString")for(const ot of t.geometry)Le(ot,new qs(ot[0].x,ot[0].y,0,0,void 0),I);else if(t.type==="Point")for(const ot of t.geometry)for(const ft of ot)Le([ft],new qs(ft.x,ft.y,0,0,void 0),I)}const jd=255,Ra=jd*Oo;function Lb(r,t,i,a,u,p,g,y,w,b,A,I,M,L,R,F,$){const K=function(re,ue,ce,Ie,Te,De,Ze,Me){const Ue=[];if(ue.positionedLines.length===0)return Ue;const je=Ie.layout.get("text-rotate").evaluate(De,{})*Math.PI/180,Ge=function(st){const At=st[0],tt=st[1],_t=At*tt;return _t>0?[At,-tt]:_t<0?[-At,tt]:At===0?[tt,At]:[tt,-At]}(ce);let et=Math.abs(ue.top-ue.bottom);for(const st of ue.positionedLines)et-=st.lineOffset;const Le=ue.positionedLines.length,ot=et/Le;let ft=ue.top-ce[1];for(let st=0;stRa&&wn(`${r.layerIds[0]}: Value for "text-size" is >= ${jd}. Reduce your "text-size".`)):se.kind==="composite"&&(Y=[Oo*R.compositeTextSizes[0].evaluate(y,{},$),Oo*R.compositeTextSizes[1].evaluate(y,{},$)],(Y[0]>Ra||Y[1]>Ra)&&wn(`${r.layerIds[0]}: Value for "text-size" is >= ${jd}. Reduce your "text-size".`)),r.addSymbols(r.text,K,Y,w,g,y,A,t,i,b.lineStartIndex,b.lineLength,L,F,$);for(const re of I)M[re]=r.text.placedSymbolArray.length-1;return 4*K.length}function Rb(r){for(const t in r)return r[t];return null}function Em(r,t,i,a,u,p,g,y,w,b){let A=g.top,I=g.bottom,M=g.left,L=g.right;const R=g.collisionPadding;if(R&&(M-=R[0],A-=R[1],L+=R[2],I+=R[3]),w){const F=new Ve(M,A),$=new Ve(L,A),K=new Ve(M,I),se=new Ve(L,I),Y=St(w);let re=new Ve(0,0);b&&(re=new Ve(b[0],b[1])),F._rotateAround(Y,re),$._rotateAround(Y,re),K._rotateAround(Y,re),se._rotateAround(Y,re),M=Math.min(F.x,$.x,K.x,se.x),L=Math.max(F.x,$.x,K.x,se.x),A=Math.min(F.y,$.y,K.y,se.y),I=Math.max(F.y,$.y,K.y,se.y)}return r.emplaceBack(t.x,t.y,t.z,i.x,i.y,M,A,L,I,y,a,u,p),r.length-1}function r0(r){r.collisionPadding&&(r.top-=r.collisionPadding[1],r.bottom+=r.collisionPadding[3]);const t=r.bottom-r.top;return t>0?Math.max(10,t):null}function oP(r,t,i,a){const u=r.compareText;if(t in u){const p=u[t];for(let g=p.length-1;g>=0;g--)if(a.dist(p[g])Y&&(re(ce,Ge,Te,De,Ue,je),re(Ge,Ie,Ue,je,Ze,Me))}re(I,M,a,p,u,p),re(M,L,u,p,u,g),re(L,R,u,g,a,g),re(R,I,a,g,a,p),F-=Y,$-=Y,K+=Y,se+=Y;const ue=1/Math.max(K-F,se-$);return{scale:ue,x:F*ue,y:$*ue,x2:K*ue,y2:se*ue,projection:t}}const sP=Lo(new Float32Array(16));class Da{constructor(t){this.spec=t,this.name=t.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(t,i){return{x:0,y:0,z:0}}unproject(t,i){return new ln(0,0)}projectTilePoint(t,i,a){return{x:t,y:i,z:0}}locationPoint(t,i,a=!0){return t._coordinatePoint(t.locationCoordinate(i),a)}pixelsPerMeter(t,i){return Do(1,t)*i}pixelSpaceConversion(t,i,a){return 1}farthestPixelDistance(t){return Db(t,t.pixelsPerMeter)}pointCoordinate(t,i,a,u){const p=t.horizonLineFromTop(!1),g=new Ve(i,Math.max(p,a));return t.rayIntersectionCoordinate(t.pointRayIntersection(g,u))}pointCoordinate3D(t,i,a){const u=new Ve(i,a);if(t.elevation)return t.elevation.pointCoordinate(u);{const p=this.pointCoordinate(t,u.x,u.y,0);return[p.x,p.y,p.z]}}isPointAboveHorizon(t,i){if(t.elevation)return!this.pointCoordinate3D(t,i.x,i.y);const a=t.horizonLineFromTop();return i.y0?i<-bu+a&&(i=-bu+a):i>bu-a&&(i=bu-a);const g=p/Math.pow(Sm(i),u);let y=g*Math.sin(u*t),w=p-g*Math.cos(u*t);return y=.5*(y/Math.PI+.5),w=.5*(w/Math.PI+.5),{x:y,y:this.southernCenter?w:1-w,z:0}}unproject(t,i){t=(2*t-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n:a,f:u}=this,p=u-i,g=Math.sign(p),y=Math.sign(a)*Math.sqrt(t*t+p*p);let w=Math.atan2(t,Math.abs(p))*g;p*a<0&&(w-=Math.PI*Math.sign(t)*g);const b=Je(Vt(w/a)+this.center[0],-180,180),A=Je(Vt(2*Math.atan(Math.pow(u/y,1/a))-bu),-zr,zr);return new ln(b,this.southernCenter?-A:A)}}class Ob extends Da{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(t,i){return{x:as(t),y:ls(i),z:0}}unproject(t,i){const a=Fi(t),u=Pr(i);return new ln(a,u)}}const Bb=St(zr);class hP extends Da{project(t,i){const a=(i=St(i))*i,u=a*a;return{x:.5*((t=St(t))*(.8707-.131979*a+u*(u*(.003971*a-.001529*u)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+a*(.015085+u*(.028874*a-.044475-.005916*u)))/Math.PI+1),z:0}}unproject(t,i){t=(2*t-.5)*Math.PI;let a=i=(2*(1-i)-1)*Math.PI,u=25,p=0,g=a*a;do{g=a*a;const b=g*g;p=(a*(1.007226+g*(.015085+b*(.028874*g-.044475-.005916*b)))-i)/(1.007226+g*(.045255+b*(.259866*g-.311325-.005916*11*b))),a=Je(a-p,-Bb,Bb)}while(Math.abs(p)>1e-6&&--u>0);g=a*a;const y=Je(Vt(t/(.8707+g*(g*(g*g*g*(.003971-.001529*g)-.013791)-.131979))),-180,180),w=Vt(a);return new ln(y,w)}}const Fb=St(zr);class dP extends Da{project(t,i){i=St(i),t=St(t);const a=Math.cos(i),u=2/Math.PI,p=Math.acos(a*Math.cos(t/2)),g=Math.sin(p)/p,y=.5*(t*u+2*a*Math.sin(t/2)/g)||0,w=.5*(i+Math.sin(i)/g)||0;return{x:.5*(y/Math.PI+.5),y:1-.5*(w/Math.PI+1),z:0}}unproject(t,i){let a=t=(2*t-.5)*Math.PI,u=i=(2*(1-i)-1)*Math.PI,p=25;const g=1e-6;let y=0,w=0;do{const b=Math.cos(u),A=Math.sin(u),I=2*A*b,M=A*A,L=b*b,R=Math.cos(a/2),F=Math.sin(a/2),$=2*R*F,K=F*F,se=1-L*R*R,Y=se?1/se:0,re=se?Math.acos(b*R)*Math.sqrt(1/se):0,ue=.5*(2*re*b*F+2*a/Math.PI)-t,ce=.5*(re*A+u)-i,Ie=.5*Y*(L*K+re*b*R*M)+1/Math.PI,Te=Y*($*I/4-re*A*F),De=.125*Y*(I*F-re*A*L*$),Ze=.5*Y*(M*R+re*K*b)+.5,Me=Te*De-Ze*Ie;y=(ce*Te-ue*Ze)/Me,w=(ue*De-ce*Ie)/Me,a=Je(a-y,-Math.PI,Math.PI),u=Je(u-w,-Fb,Fb)}while((Math.abs(y)>g||Math.abs(w)>g)&&--p>0);return new ln(Vt(a),Vt(u))}}class Nb extends Da{constructor(t){super(t),this.center=t.center||[0,0],this.parallels=t.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(St(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(t,i){const{scale:a,cosPhi:u}=this;return{x:St(t)*u*a+.5,y:-Math.sin(St(i))/u*a+.5,z:0}}unproject(t,i){const{scale:a,cosPhi:u}=this,p=-(i-.5)/a,g=Je(Vt((t-.5)/a)/u,-180,180),y=Math.asin(Je(p*u,-1,1)),w=Je(Vt(y),-zr,zr);return new ln(g,w)}}class pP extends Ob{constructor(t){super(t),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(t,i,a){const u=Ad(t,i,a);return Nn(u,u,Cd(ss(a))),{x:u[0],y:u[1],z:u[2]}}locationPoint(t,i){const a=au(i.lat,i.lng),u=Zr([],a),p=t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(i),t._centerAltitude):t._centerAltitude;bd(a,a,u,Do(1,0)*vt*p);const g=Lo(new Float64Array(16));return Zl(g,t.pixelMatrix,t.globeMatrix),Nn(a,a,g),new Ve(a[0],a[1])}pixelsPerMeter(t,i){return Do(1,0)*i}pixelSpaceConversion(t,i,a){const u=Do(1,t)*i,p=Wt(Do(1,45)*i,u,a);return this.pixelsPerMeter(t,i)/p}createTileMatrix(t,i,a){const u=Cy(ss(a.canonical));return Zl(new Float64Array(16),t.globeMatrix,u)}createInversionMatrix(t,i){const{center:a}=t,u=Cd(ss(i));return Qf(u,u,St(a.lng)),_y(u,u,St(a.lat)),Hl(u,u,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(u)}pointCoordinate(t,i,a,u){return dw(t,i,a,!0)||new cu(0,0)}pointCoordinate3D(t,i,a){const u=this.pointCoordinate(t,i,a,0);return[u.x,u.y,u.z]}isPointAboveHorizon(t,i){return!dw(t,i.x,i.y,!1)}farthestPixelDistance(t){const i=function(u,p){const g=u.cameraToCenterDistance,y=u._centerAltitude*p,w=u._camera,b=u._camera.forward(),A=js([],Bi([],b,-g),[0,0,y]),I=u.worldSize/(2*Math.PI),M=[0,0,-I],L=u.width/u.height,R=Math.tan(u.fovAboveCenter),F=Bi([],w.up(),R),$=Bi([],w.right(),R*L),K=Zr([],js([],js([],b,F),$)),se=[];let Y;if(new wy(A,K).closestPointOnSphere(M,I,se)){const re=js([],se,M),ue=Ro([],re,A);Y=Math.cos(u.fovAboveCenter)*vd(ue)}else{const re=Ro([],A,M),ue=Ro([],M,A);Zr(ue,ue);const ce=vd(re)-I;Y=Math.sqrt(ce*(ce+2*I));const Ie=Math.acos(Y/(I+ce))-Math.acos(oo(b,ue));Y*=Math.cos(Ie)}return 1.01*Y}(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),a=lu(t.zoom);if(a>0){const u=Db(t,Do(1,t.center.lat)*t.worldSize),p=t.worldSize/(2*Math.PI),g=Math.max(t.width,t.height)/t.worldSize*Math.PI;return Wt(i,u+p*(1-Math.cos(g)),Math.pow(a,10))}return i}upVector(t,i,a){return Ad(i,a,t,1)}upVectorScale(t){return{metersToTile:em(nm(ss(t)))}}}function Ub(r){const t=r.parallels,i=!!t&&Math.abs(t[0]+t[1])<.01;switch(r.name){case"mercator":return new Ob(r);case"equirectangular":return new cP(r);case"naturalEarth":return new hP(r);case"equalEarth":return new lP(r);case"winkelTripel":return new dP(r);case"albers":return i?new Nb(r):new aP(r);case"lambertConformalConic":return i?new Nb(r):new uP(r);case"globe":return new pP(r)}throw new Error(`Invalid projection name: ${r.name}`)}const fP=dm.types,mP=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Am(r,t,i,a,u,p,g,y,w,b,A,I,M){const L=y?Math.min(Ra,Math.round(y[0])):0,R=y?Math.min(Ra,Math.round(y[1])):0;r.emplaceBack(t,i,Math.round(32*a),Math.round(32*u),p,g,(L<<1)+(w?1:0),R,16*b,16*A,256*I,256*M)}function Cm(r,t,i,a,u,p,g){r.emplaceBack(t,i,a,u,p,g)}function Im(r,t,i,a,u){r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u),r.emplaceBack(t,i,a,u)}function gP(r){for(const t of r.sections)if(dy(t.text))return!0;return!1}class i0{constructor(t){this.layoutVertexArray=new $e,this.indexArray=new mt,this.programConfigurations=t,this.segments=new qn,this.dynamicLayoutVertexArray=new qe,this.opacityVertexArray=new gt,this.placedSymbolArray=new Gn,this.globeExtVertexArray=new Ye}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,i,a,u){this.isEmpty()||(a&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,TM.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,AM.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,mP,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,SM.members,!0)),this.opacityVertexBuffer.itemSize=1),(a||u)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}dt(i0,"SymbolBuffers");class o0{constructor(t,i,a){this.layoutVertexArray=new t,this.layoutAttributes=i,this.indexArray=new a,this.segments=new qn,this.collisionVertexArray=new Ut,this.collisionVertexArrayExt=new Ot}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,CM.members,!0),this.collisionVertexBufferExt=t.createVertexBuffer(this.collisionVertexArrayExt,IM.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}dt(o0,"CollisionBuffers");class Oa{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(g=>g.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Lo([]),this.placementViewportMatrix=Lo([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Zy(this.zoom,i["text-size"]),this.iconSizeData=Zy(this.zoom,i["icon-size"]);const a=this.layers[0].layout,u=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=a.get("text-allow-overlap")||a.get("icon-allow-overlap")||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&u.constantOr(1)!==void 0,this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=a.get("text-writing-mode").map(g=>Ni[g]),this.stateDependentLayerIds=this.layers.filter(g=>g.isStateDependent()).map(g=>g.id),this.sourceID=t.sourceID,this.projection=t.projection}createArrays(){this.text=new i0(new Wl(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new i0(new Wl(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new Wr,this.lineVertexArray=new nu,this.symbolInstances=new En}calculateGlyphDependencies(t,i,a,u,p){for(let g=0;g0)&&(w.value.kind!=="constant"||w.value.value.length>0),M=A.value.kind!=="constant"||!!A.value.value||Object.keys(A.parameters).length>0,L=g.get("symbol-sort-key");if(this.features=[],!I&&!M)return;const R=i.iconDependencies,F=i.glyphDependencies,$=i.availableImages,K=new C(this.zoom);for(const{feature:se,id:Y,index:re,sourceLayerIndex:ue}of t){const ce=p._featureFilter.needGeometry,Ie=Jl(se,ce);if(!p._featureFilter.filter(K,Ie,a))continue;if(ce||(Ie.geometry=Vs(se,a,u)),y&&se.type!==1&&a.z<=5){const Me=Ie.geometry,Ue=.98078528056,je=(Ge,et)=>oo(Ad(Ge.x,Ge.y,a,1),Ad(et.x,et.y,a,1))=0;for(const je of Te.sections)if(je.image)R[je.image.name]=!0;else{const Ge=hd(Te.toString()),et=je.fontStack||Me,Le=F[et]=F[et]||{};this.calculateGlyphDependencies(je.text,Le,Ue,this.allowVerticalPlacement,Ge)}}}g.get("symbol-placement")==="line"&&(this.features=function(se){const Y={},re={},ue=[];let ce=0;function Ie(Me){ue.push(se[Me]),ce++}function Te(Me,Ue,je){const Ge=re[Me];return delete re[Me],re[Ue]=Ge,ue[Ge].geometry[0].pop(),ue[Ge].geometry[0]=ue[Ge].geometry[0].concat(je[0]),Ge}function De(Me,Ue,je){const Ge=Y[Ue];return delete Y[Ue],Y[Me]=Ge,ue[Ge].geometry[0].shift(),ue[Ge].geometry[0]=je[0].concat(ue[Ge].geometry[0]),Ge}function Ze(Me,Ue,je){const Ge=je?Ue[0][Ue[0].length-1]:Ue[0][0];return`${Me}:${Ge.x}:${Ge.y}`}for(let Me=0;MeMe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((se,Y)=>se.sortKey-Y.sortKey)}update(t,i,a,u){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,i,this.layers,a,u),this.icon.programConfigurations.updatePaintArrays(t,i,this.layers,a,u))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Ub(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,i){const a=this.lineVertexArray.length;if(t.segment!==void 0)for(const{x:u,y:p}of i)this.lineVertexArray.emplaceBack(u,p);return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(t,i,a,u,p,g,y,w,b,A,I,M,L,R){const F=t.indexArray,$=t.layoutVertexArray,K=t.globeExtVertexArray,se=t.segments.prepareSegment(4*i.length,$,F,this.canOverlap?g.sortKey:void 0),Y=this.glyphOffsetArray.length,re=se.vertexLength,ue=this.allowVerticalPlacement&&y===Ni.vertical?Math.PI/2:0,ce=g.text&&g.text.sections;for(let Te=0;Te=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:u),g=gm(this.textSizeData,t,p)/Tr;return this.tilePixelRatio*g}getSymbolInstanceIconSize(t,i,a){const u=this.icon.placedSymbolArray.get(a),p=gm(this.iconSizeData,t,u);return this.tilePixelRatio*p}_commitDebugCollisionVertexUpdate(t,i,a){t.emplaceBack(i,-a,-a),t.emplaceBack(i,a,-a),t.emplaceBack(i,a,a),t.emplaceBack(i,-a,a)}_updateTextDebugCollisionBoxes(t,i,a,u,p,g){for(let y=u;y0}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(t,i){const a=t.placedSymbolArray.get(i),u=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;pu[y]-u[w]||p[w]-p[y]),g}addToSortKeyRanges(t,i){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===i?a.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex);const{rightJustifiedTextSymbolIndex:u,centerJustifiedTextSymbolIndex:p,leftJustifiedTextSymbolIndex:g,verticalPlacedTextSymbolIndex:y,placedIconSymbolIndex:w,verticalPlacedIconSymbolIndex:b}=a;u>=0&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&p!==u&&this.addIndicesForPlacedSymbol(this.text,p),g>=0&&g!==p&&g!==u&&this.addIndicesForPlacedSymbol(this.text,g),y>=0&&this.addIndicesForPlacedSymbol(this.text,y),w>=0&&this.addIndicesForPlacedSymbol(this.icon,w),b>=0&&this.addIndicesForPlacedSymbol(this.icon,b)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}dt(Oa,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Oa.MAX_GLYPHS=65535,Oa.addDynamicAttributes=Im;const _P=new ee({"symbol-placement":new B(Re.layout_symbol["symbol-placement"]),"symbol-spacing":new B(Re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new B(Re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new q(Re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new B(Re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new B(Re.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new B(Re.layout_symbol["icon-ignore-placement"]),"icon-optional":new B(Re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new B(Re.layout_symbol["icon-rotation-alignment"]),"icon-size":new q(Re.layout_symbol["icon-size"]),"icon-text-fit":new B(Re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new B(Re.layout_symbol["icon-text-fit-padding"]),"icon-image":new q(Re.layout_symbol["icon-image"]),"icon-rotate":new q(Re.layout_symbol["icon-rotate"]),"icon-padding":new B(Re.layout_symbol["icon-padding"]),"icon-keep-upright":new B(Re.layout_symbol["icon-keep-upright"]),"icon-offset":new q(Re.layout_symbol["icon-offset"]),"icon-anchor":new q(Re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new B(Re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new B(Re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new B(Re.layout_symbol["text-rotation-alignment"]),"text-field":new q(Re.layout_symbol["text-field"]),"text-font":new q(Re.layout_symbol["text-font"]),"text-size":new q(Re.layout_symbol["text-size"]),"text-max-width":new q(Re.layout_symbol["text-max-width"]),"text-line-height":new q(Re.layout_symbol["text-line-height"]),"text-letter-spacing":new q(Re.layout_symbol["text-letter-spacing"]),"text-justify":new q(Re.layout_symbol["text-justify"]),"text-radial-offset":new q(Re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new B(Re.layout_symbol["text-variable-anchor"]),"text-anchor":new q(Re.layout_symbol["text-anchor"]),"text-max-angle":new B(Re.layout_symbol["text-max-angle"]),"text-writing-mode":new B(Re.layout_symbol["text-writing-mode"]),"text-rotate":new q(Re.layout_symbol["text-rotate"]),"text-padding":new B(Re.layout_symbol["text-padding"]),"text-keep-upright":new B(Re.layout_symbol["text-keep-upright"]),"text-transform":new q(Re.layout_symbol["text-transform"]),"text-offset":new q(Re.layout_symbol["text-offset"]),"text-allow-overlap":new B(Re.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new B(Re.layout_symbol["text-ignore-placement"]),"text-optional":new B(Re.layout_symbol["text-optional"])});var s0={paint:new ee({"icon-opacity":new q(Re.paint_symbol["icon-opacity"]),"icon-color":new q(Re.paint_symbol["icon-color"]),"icon-halo-color":new q(Re.paint_symbol["icon-halo-color"]),"icon-halo-width":new q(Re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new q(Re.paint_symbol["icon-halo-blur"]),"icon-translate":new B(Re.paint_symbol["icon-translate"]),"icon-translate-anchor":new B(Re.paint_symbol["icon-translate-anchor"]),"text-opacity":new q(Re.paint_symbol["text-opacity"]),"text-color":new q(Re.paint_symbol["text-color"],{runtimeType:si,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new q(Re.paint_symbol["text-halo-color"]),"text-halo-width":new q(Re.paint_symbol["text-halo-width"]),"text-halo-blur":new q(Re.paint_symbol["text-halo-blur"]),"text-translate":new B(Re.paint_symbol["text-translate"]),"text-translate-anchor":new B(Re.paint_symbol["text-translate-anchor"])}),layout:_P};class jb{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:da,this.defaultValue=t}evaluate(t){if(t.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(t.formattedSection))return i.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}dt(jb,"FormatSectionOverride",{omit:["defaultValue"]});class km extends zo{constructor(t){super(t,s0)}recalculate(t,i){super.recalculate(t,i),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")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const a=this.layout.get("text-writing-mode");if(a){const u=[];for(const p of a)u.indexOf(p)<0&&u.push(p);this.layout._values["text-writing-mode"]=u}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(t,i,a,u){const p=this.layout.get(t).evaluate(i,{},a,u),g=this._unevaluatedLayout._values[t];return g.isDataDriven()||Ta(g.value)||!p?p:function(y,w){return w.replace(/{([^{}]+)}/g,(b,A)=>A in y?String(y[A]):"")}(i.properties,p)}createBucket(t){return new Oa(t)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const t of s0.paint.overridableProperties){if(!km.hasPaintOverride(this.layout,t))continue;const i=this.paint.get(t),a=new jb(i),u=new Hc(a,i.property.specification);let p=null;p=i.value.kind==="constant"||i.value.kind==="source"?new ed("source",u):new Bl("composite",u,i.value.zoomStops,i.value._interpolationType),this.paint._values[t]=new Z(i.property,p,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,a){return!(!this.layout||i.isDataDriven()||a.isDataDriven())&&km.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,i){const a=t.get("text-field"),u=s0.paint.properties[i];let p=!1;const g=y=>{for(const w of y)if(u.overrides&&u.overrides.hasOverride(w))return void(p=!0)};if(a.value.kind==="constant"&&a.value.value instanceof qr)g(a.value.value.sections);else if(a.value.kind==="source"){const y=b=>{p||(b instanceof Ms&&Ln(b.value)===xl?g(b.value.sections):b instanceof ns?g(b.sections):b.eachChild(y))},w=a.value;w._styleExpression&&y(w._styleExpression.expression)}return p}getProgramConfiguration(t){return new Pa(this,t)}}var yP={paint:new ee({"background-color":new B(Re.paint_background["background-color"]),"background-pattern":new B(Re.paint_background["background-pattern"]),"background-opacity":new B(Re.paint_background["background-opacity"])})},vP={paint:new ee({"raster-opacity":new B(Re.paint_raster["raster-opacity"]),"raster-hue-rotate":new B(Re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new B(Re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new B(Re.paint_raster["raster-brightness-max"]),"raster-saturation":new B(Re.paint_raster["raster-saturation"]),"raster-contrast":new B(Re.paint_raster["raster-contrast"]),"raster-resampling":new B(Re.paint_raster["raster-resampling"]),"raster-fade-duration":new B(Re.paint_raster["raster-fade-duration"])})};class xP extends zo{constructor(t){super(t,{}),this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)}}var wP={paint:new ee({"sky-type":new B(Re.paint_sky["sky-type"]),"sky-atmosphere-sun":new B(Re.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new B(Re.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new B(Re.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new B(Re.paint_sky["sky-gradient-radius"]),"sky-gradient":new Q(Re.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new B(Re.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new B(Re.paint_sky["sky-atmosphere-color"]),"sky-opacity":new B(Re.paint_sky["sky-opacity"])})};function a0(r,t,i){const a=[0,0,1],u=sw([]);return lw(u,u,i?-St(r)+Math.PI:St(r)),aw(u,u,-St(t)),nw(a,a,u),Zr(a,a)}const bP={circle:class extends zo{constructor(r){super(r,Lk)}createBucket(r){return new Ly(r)}queryRadius(r){const t=r;return uu("circle-radius",this,t)+uu("circle-stroke-width",this,t)+om(this.paint.get("circle-translate"))}queryIntersectsFeature(r,t,i,a,u,p,g,y){const w=Mw(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),b=this.paint.get("circle-radius").evaluate(t,i)+this.paint.get("circle-stroke-width").evaluate(t,i);return Pw(r,a,p,g,y,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",w,b)}getProgramIds(){return["circle"]}getProgramConfiguration(r){return new Pa(this,r)}},heatmap:class extends zo{createBucket(r){return new Lw(r)}constructor(r){super(r,Bk),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(r){r==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=By({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(r){return uu("heatmap-radius",this,r)}queryIntersectsFeature(r,t,i,a,u,p,g,y){const w=this.paint.get("heatmap-radius").evaluate(t,i);return Pw(r,a,p,g,y,!0,!0,new Ve(0,0),w)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(r){return new Pa(this,r)}},hillshade:class extends zo{constructor(r){super(r,Fk)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends zo{constructor(r){super(r,eM)}getProgramIds(){const r=this.paint.get("fill-pattern"),t=r&&r.constantOr(1),i=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(r){return new Pa(this,r)}recalculate(r,t){super.recalculate(r,t);const i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(r){return new um(r)}queryRadius(){return om(this.paint.get("fill-translate"))}queryIntersectsFeature(r,t,i,a,u,p){return!r.queryGeometry.isAboveHorizon&&Sw(kw(r.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),a)}isTileClipped(){return!0}},"fill-extrusion":class extends zo{constructor(r){super(r,gM)}createBucket(r){return new Dd(r)}queryRadius(){return om(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(r){return new Pa(this,r)}queryIntersectsFeature(r,t,i,a,u,p,g,y,w){const b=Mw(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,r.pixelToTileUnitsFactor),A=this.paint.get("fill-extrusion-height").evaluate(t,i),I=this.paint.get("fill-extrusion-base").evaluate(t,i),M=[0,0],L=y&&p.elevation,R=p.elevation?p.elevation.exaggeration():1,F=r.tile.getBucket(this);if(L&&F instanceof Dd){const re=F.centroidVertexArray,ue=w+1;uere.polygon).flat());const $=L?y:null,[K,se]=function(re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge){return re.projection.name==="globe"?function(et,Le,ot,ft,st,At,tt,_t,Ct,Ht,It){const bt=[],bn=[],zt=et.projection.upVectorScale(It,et.center.lat,et.worldSize).metersToTile,Lt=[0,0,0,1],cn=[0,0,0,1],fn=(un,kn,Rn,Zn)=>{un[0]=kn,un[1]=Rn,un[2]=Zn,un[3]=1},mn=Kw();ot>0&&(ot+=mn),ft+=mn;for(const un of Le){const kn=[],Rn=[];for(const Zn of un){const hn=Zn.x+st.x,nr=Zn.y+st.y,Hn=et.projection.projectTilePoint(hn,nr,It),Mn=et.projection.upVector(It,Zn.x,Zn.y);let Kt=ot,Xn=ft;if(tt){const gn=tb(hn,nr,ot,ft,tt,_t,Ct,Ht);Kt+=gn.base,Xn+=gn.top}ot!==0?fn(Lt,Hn.x+Mn[0]*zt*Kt,Hn.y+Mn[1]*zt*Kt,Hn.z+Mn[2]*zt*Kt):fn(Lt,Hn.x,Hn.y,Hn.z),fn(cn,Hn.x+Mn[0]*zt*Xn,Hn.y+Mn[1]*zt*Xn,Hn.z+Mn[2]*zt*Xn),Nn(Lt,Lt,At),Nn(cn,cn,At),kn.push(new pu(Lt[0],Lt[1],Lt[2])),Rn.push(new pu(cn[0],cn[1],cn[2]))}bt.push(kn),bn.push(Rn)}return[bt,bn]}(re,ue,ce,Ie,Te,De,Ze,Me,Ue,je,Ge):Ze?function(et,Le,ot,ft,st,At,tt,_t,Ct){const Ht=[],It=[],bt=[0,0,0,1];for(const bn of et){const zt=[],Lt=[];for(const cn of bn){const fn=cn.x+ft.x,mn=cn.y+ft.y,un=tb(fn,mn,Le,ot,At,tt,_t,Ct);bt[0]=fn,bt[1]=mn,bt[2]=un.base,bt[3]=1,Xl(bt,bt,st),bt[3]=Math.max(bt[3],1e-5);const kn=new pu(bt[0]/bt[3],bt[1]/bt[3],bt[2]/bt[3]);bt[0]=fn,bt[1]=mn,bt[2]=un.top,bt[3]=1,Xl(bt,bt,st),bt[3]=Math.max(bt[3],1e-5);const Rn=new pu(bt[0]/bt[3],bt[1]/bt[3],bt[2]/bt[3]);zt.push(kn),Lt.push(Rn)}Ht.push(zt),It.push(Lt)}return[Ht,It]}(ue,ce,Ie,Te,De,Ze,Me,Ue,je):function(et,Le,ot,ft,st){const At=[],tt=[],_t=st[8]*Le,Ct=st[9]*Le,Ht=st[10]*Le,It=st[11]*Le,bt=st[8]*ot,bn=st[9]*ot,zt=st[10]*ot,Lt=st[11]*ot;for(const cn of et){const fn=[],mn=[];for(const un of cn){const kn=un.x+ft.x,Rn=un.y+ft.y,Zn=st[0]*kn+st[4]*Rn+st[12],hn=st[1]*kn+st[5]*Rn+st[13],nr=st[2]*kn+st[6]*Rn+st[14],Hn=st[3]*kn+st[7]*Rn+st[15],Mn=Zn+_t,Kt=hn+Ct,Xn=nr+Ht,gn=Math.max(Hn+It,1e-5),Kr=Zn+bt,Kn=hn+bn,Sr=nr+zt,mr=Math.max(Hn+Lt,1e-5);fn.push(new pu(Mn/gn,Kt/gn,Xn/gn)),mn.push(new pu(Kr/mr,Kn/mr,Sr/mr))}At.push(fn),tt.push(mn)}return[At,tt]}(ue,ce,Ie,Te,De)}(p,a,I,A,b,g,$,M,R,p.center.lat,r.tileID.canonical),Y=r.queryGeometry;return function(re,ue,ce){let Ie=1/0;Sw(ce,ue)&&(Ie=eb(ce,ue[0]));for(let Te=0;Te=3){for(let R=0;R{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(){this._channel=void 0,this._callback=()=>{}}}class TP{constructor(){this.tasks={},this.taskQueue=[],Yi(["process"],this),this.invoker=new EP(this.process),this.nextId=0}add(t,i){const a=this.nextId++,u=function({type:p,isSymbolTile:g,zoom:y}){return y=y||0,p==="message"?0:p!=="maybePrepare"||g?p!=="parseTile"||g?p==="parseTile"&&g?300-y:p==="maybePrepare"&&g?400-y:500:200-y:100-y}(i);if(u===0){vo();try{t()}finally{}return{cancel:()=>{}}}return this.tasks[a]={fn:t,metadata:i,priority:u,id:a},this.taskQueue.push(a),this.invoker.trigger(),{cancel:()=>{delete this.tasks[a]}}}process(){vo();try{if(this.taskQueue=this.taskQueue.filter(a=>!!this.tasks[a]),!this.taskQueue.length)return;const t=this.pick();if(t===null)return;const i=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let t=null,i=1/0;for(let u=0;u>=1)>1;){const b=i+u>>1,A=a+p>>1;1&t?(u=i,p=a,i=g,a=y):(i=u,a=p,u=g,p=y),g=b,y=A}const w=4*r;Ba[w+0]=i,Ba[w+1]=a,Ba[w+2]=u,Ba[w+3]=p}const us=new Uint16Array(2178),Fa=new Uint8Array(1089),Mm=new Uint16Array(1089);function Gb(r){return r===0?-.03125:r===32?.03125:0}var qb=ye([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const Wb={type:2,extent:vt,loadGeometry:()=>[[new Ve(0,0),new Ve(vt+1,0),new Ve(vt+1,vt+1),new Ve(0,vt+1),new Ve(0,0)]]};class l0{constructor(t,i,a,u,p){this.tileID=t,this.uid=ii(),this.uses=0,this.tileSize=i,this.tileZoom=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=p,this.expiredRequestCount=0,this.state="loading",u&&u.transform&&(this.projection=u.transform.projection)}registerFadeDuration(t){const i=t+this.timeAdded;ip.getLayer(b)).filter(Boolean);if(w.length!==0){y.layers=w,y.stateDependentLayerIds&&(y.stateDependentLayers=y.stateDependentLayerIds.map(b=>w.filter(A=>A.id===b)[0]));for(const b of w)g[b.id]=y}}return g}(t.buckets,i.style),this.hasSymbolBuckets=!1;for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Oa){if(this.hasSymbolBuckets=!0,!a)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const u in this.buckets){const p=this.buckets[u];if(p instanceof Oa&&p.hasRTLText){this.hasRTLText=!0,S.isLoading()||S.isLoaded()||x()!=="deferred"||T();break}}this.queryPadding=0;for(const u in this.buckets){const p=this.buckets[u];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(u).queryRadius(p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas)}else this.collisionBoxArray=new an}unloadVectorData(){if(this.hasData()){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const u=this.buckets[a];u.uploadPending()&&u.upload(t)}const i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Wd(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Wd(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Wd(t,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,i,a,u,p,g,y,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:u,pixelPosMatrix:y,transform:g,params:p,tileTransform:this.tileTransform},t,i,a):{}}querySourceFeatures(t,i){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const u=a.loadVTLayers(),p=i?i.sourceLayer:"",g=u._geojsonTileLayer||u[p];if(!g)return;const y=Jc(i&&i.filter),{z:w,x:b,y:A}=this.tileID.canonical,I={z:w,x:b,y:A};for(let M=0;Ma)u=!1;else if(i)if(this.expirationTime=0;$--){const K=4*$,se=Ba[K+0],Y=Ba[K+1],re=Ba[K+2],ue=Ba[K+3],ce=se+re>>1,Ie=Y+ue>>1,Te=ce+Ie-Y,De=Ie+se-ce,Ze=Y*cs+se,Me=ue*cs+re,Ue=Ie*cs+ce,je=Math.hypot((us[2*Ze+0]+us[2*Me+0])/2-us[2*Ue+0],(us[2*Ze+1]+us[2*Me+1])/2-us[2*Ue+1])>=16;Fa[Ue]=Fa[Ue]||(je?1:0),$<1022&&(Fa[Ue]=Fa[Ue]||Fa[(Y+De>>1)*cs+(se+Te>>1)]||Fa[(ue+De>>1)*cs+(re+Te>>1)])}const I=new Fe,M=new mt;let L=0;function R($,K){const se=K*cs+$;return Mm[se]===0&&(I.emplaceBack(us[2*se+0],us[2*se+1],$*vt/lo,K*vt/lo),Mm[se]=++L),Mm[se]-1}function F($,K,se,Y,re,ue){const ce=$+se>>1,Ie=K+Y>>1;if(Math.abs($-re)+Math.abs(K-ue)>1&&Fa[Ie*cs+ce])F(re,ue,$,K,ce,Ie),F(se,Y,re,ue,ce,Ie);else{const Te=R($,K),De=R(se,Y),Ze=R(re,ue);M.emplaceBack(Te,De,Ze)}}return F(0,0,lo,lo,lo,0),F(lo,lo,0,0,0,lo),{vertices:I,indices:M}}(this.tileID.canonical,i);u=g.vertices,p=g.indices}else{u=new Fe,p=new mt;for(const{x:y,y:w}of a)u.emplaceBack(y,w,0,0);const g=Vy(u.int16,void 0,4);for(let y=0;y0&&(y=gy(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,u,i,p,y,g),this._makeGlobeTileDebugTextBuffer(t,u,i,p,y,g)}_globePoint(t,i,a,u,p,g,y){let w=Ad(t,i,a);if(g){const b=1<.5?L=-1:M<-.5&&(L=1);let R=(t/vt+a.x)/b+L,F=(i/vt+a.y)/b;R=(R-A)*u._pixelsPerMercatorPixel+A,F=(F-I)*u._pixelsPerMercatorPixel+I;const $=[R*u.worldSize,F*u.worldSize,0];Nn($,$,g),w=Yl(w,$,y)}return Nn(w,w,p)}_makeGlobeTileDebugBorderBuffer(t,i,a,u,p,g){const y=new We,w=new vi,b=new Ee,A=(M,L,R,F,$)=>{const K=(R-M)/($-1),se=(F-L)/($-1),Y=y.length;for(let re=0;re<$;re++){const ue=M+re*K,ce=L+re*se;y.emplaceBack(ue,ce);const Ie=this._globePoint(ue,ce,i,a,u,p,g);b.emplaceBack(Ie[0],Ie[1],Ie[2]),w.emplaceBack(Y+re)}},I=vt;A(0,0,I,0,16),A(I,0,I,I,16),A(I,I,0,I,16),A(0,I,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(w),this._tileDebugBuffer=t.createVertexBuffer(y,Td.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(b,uw.members),this._tileDebugSegments=qn.simpleSegment(0,0,y.length,w.length)}_makeGlobeTileDebugTextBuffer(t,i,a,u,p,g){const y=vt/4,w=new We,b=new mt,A=new Ee,I=25;b.reserve(32),w.reserve(I),A.reserve(I);const M=(L,R)=>I*L+R;for(let L=0;Lt[g])return null}else{const y=1/a[g];let w=(r[g]-i[g])*y,b=(t[g]-i[g])*y;if(w>b){const A=w;w=b,b=A}if(w>u&&(u=w),bp)return null}return u}function Xb(r,t,i,a,u,p,g,y,w,b,A){const I=a-r,M=u-t,L=p-i,R=g-r,F=y-t,$=w-i,K=A[1]*$-A[2]*F,se=A[2]*R-A[0]*$,Y=A[0]*F-A[1]*R,re=I*K+M*se+L*Y;if(Math.abs(re)<1e-15)return null;const ue=1/re,ce=b[0]-r,Ie=b[1]-t,Te=b[2]-i,De=(ce*K+Ie*se+Te*Y)*ue;if(De<0||De>1)return null;const Ze=Ie*L-Te*M,Me=Te*I-ce*L,Ue=ce*M-Ie*I,je=(A[0]*Ze+A[1]*Me+A[2]*Ue)*ue;return je<0||De+je>1?null:(R*Ze+F*Me+$*Ue)*ue}function Kb(r,t,i){return(r-t)/(i-t)}function Yb(r,t,i,a,u,p,g,y,w){const b=1<{const se=$?1:0,Y=(L+1)*F-se,re=R*F,ue=(R+1)*F-se;K[0]=L*F,K[1]=re,K[2]=Y,K[3]=ue};let I=new Zb(w);const M=[];for(let L=0;L=1;w/=2){const L=y[y.length-1];I=new Zb(w);for(let R=0;R0;){const{idx:R,t:F,nodex:$,nodey:K,depth:se}=L.pop();if(this.leaves[R]){Yb($,K,se,t,i,a,u,I,M);const re=1<=Le[2])return F}continue}let Y=0;for(let re=0;re=b[A[Te]]&&(A.splice(Te,0,re),Ie=!0);Ie||(A[Y]=re),Y++}}for(let re=0;re=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(t+1)}static pack(t,i){const a=[0,0,0,0],u=Pm.getUnpackVector(i);let p=Math.floor((t+u[3])/u[2]);return a[2]=p%256,p=Math.floor(p/256),a[1]=p%256,p=Math.floor(p/256),a[0]=p,a}getPixels(){return new wi({width:this.stride,height:this.stride},this.pixels)}backfillBorder(t,i,a){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let u=i*this.dim,p=i*this.dim+this.dim,g=a*this.dim,y=a*this.dim+this.dim;switch(i){case-1:u=p-1;break;case 1:p=u+1}switch(a){case-1:g=y-1;break;case 1:y=g+1}const w=-i*this.dim,b=-a*this.dim;for(let A=g;A{this.remove(t,p)},a)),this.data[u].push(p),this.order.push(u),this.order.length>this.max){const g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}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 i=this.data[t].shift();return i.timeout&&clearTimeout(i.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),i.value}getByKey(t){const i=this.data[t];return i?i[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,i){if(!this.has(t))return this;const a=t.wrapped().key,u=i===void 0?0:this.data[a].indexOf(i),p=this.data[a][u];return this.data[a].splice(u,1),p.timeout&&clearTimeout(p.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(p.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(t){const i=[];for(const a in this.data)for(const u of this.data[a])t(u.value)||i.push(u);for(const a of i)this.remove(a.value.tileID,a)}}class Eu{constructor(t,i,a){this.func=t,this.mask=i,this.range=a}}Eu.ReadOnly=!1,Eu.ReadWrite=!0,Eu.disabled=new Eu(519,Eu.ReadOnly,[0,1]);const c0=7680;class u0{constructor(t,i,a,u,p,g){this.test=t,this.ref=i,this.mask=a,this.fail=u,this.depthFail=p,this.pass=g}}u0.disabled=new u0({func:519,mask:0},0,0,c0,c0,c0);class hs{constructor(t,i,a){this.blendFunction=t,this.blendColor=i,this.mask=a}}hs.Replace=[1,0],hs.disabled=new hs(hs.Replace,Fn.transparent,[!1,!1,!1,!1]),hs.unblended=new hs(hs.Replace,Fn.transparent,[!0,!0,!0,!0]),hs.alphaBlended=new hs([1,771],Fn.transparent,[!0,!0,!0,!0]);const h0=1029,d0=2305;class Fo{constructor(t,i,a){this.enable=t,this.mode=i,this.frontFace=a}}Fo.disabled=new Fo(!1,h0,d0),Fo.backCCW=new Fo(!0,h0,d0),Fo.backCW=new Fo(!0,h0,2304),Fo.frontCW=new Fo(!0,1028,2304),Fo.frontCCW=new Fo(!0,1028,d0);class nc extends vl{constructor(t,i,a){super(),this.id=t,this._onlySymbols=a,i.on("data",u=>{u.dataType==="source"&&u.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&u.dataType==="source"&&u.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new kP(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new AP,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(t){this.map=t,this._minTileCacheSize=this._minTileCacheSize===void 0&&t?t._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&t?t._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const t in this._tiles){const i=this._tiles[t];if(i.state!=="loaded"&&i.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)}_loadTile(t,i){return t.isSymbolTile=this._onlySymbols,this._source.loadTile(t,i)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t,()=>{})}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 i in this._tiles){const a=this._tiles[i];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return dn(this._tiles).map(t=>t.tileID).sort(t2).map(t=>t.key)}getRenderableIds(t){const i=[];for(const a in this._tiles)this._isIdRenderable(+a,t)&&i.push(this._tiles[a]);return t?i.sort((a,u)=>{const p=a.tileID,g=u.tileID,y=new Ve(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),w=new Ve(g.canonical.x,g.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-g.overscaledZ||w.y-y.y||w.x-y.x}).map(a=>a.tileID.key):i.map(a=>a.tileID).sort(t2).map(a=>a.key)}hasRenderableParent(t){const i=this.findLoadedParent(t,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(t,i){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(i||!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,i){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=i),this._loadTile(a,this._tileLoaded.bind(this,a,t,i)))}_tileLoaded(t,i,a,u){if(u)if(t.state="errored",u.status!==404)this._source.fire(new wo(u,{tile:t}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const p=this.map.painter.terrain;this.update(this.transform,p.getScaledDemTileSize(),!0),p.resetTileLookupCache(this.id)}else this.update(this.transform);else t.timeAdded=xo.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),this._source.type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new Is("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const i=this.getRenderableIds();for(let u=0;u1||(Math.abs(g)>1&&(Math.abs(g+w)===1?g+=w:Math.abs(g-w)===1&&(g-=w)),p.dem&&u.dem&&(u.dem.backfillBorder(p.dem,g,y),u.neighboringTiles&&u.neighboringTiles[b]&&(u.neighboringTiles[b].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,i,a,u){for(const p in this._tiles){let g=this._tiles[p];if(u[p]||!g.hasData()||g.tileID.overscaledZ<=i||g.tileID.overscaledZ>a)continue;let y=g.tileID;for(;g&&g.tileID.overscaledZ>i+1;){const b=g.tileID.scaledTo(g.tileID.overscaledZ-1);g=this._tiles[b.key],g&&g.hasData()&&(y=b)}let w=y;for(;w.overscaledZ>i;)if(w=w.scaledTo(w.overscaledZ-1),t[w.key]){u[y.key]=y;break}}}findLoadedParent(t,i){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=i?a:null}for(let a=t.overscaledZ-1;a>=i;a--){const u=t.scaledTo(a),p=this._getLoadedTile(u);if(p)return p}}_getLoadedTile(t){const i=this._tiles[t.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,i){i=i||this._source.tileSize;const a=Math.ceil(t.width/i)+1,u=Math.ceil(t.height/i)+1,p=Math.floor(a*u*5),g=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,p):p,y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(y)}handleWrapJump(t){const i=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,i){const a={};for(const u in this._tiles){const p=this._tiles[u];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+i),a[p.tileID.key]=p}this._tiles=a;for(const u in this._timers)clearTimeout(this._timers[u]),delete this._timers[u];for(const u in this._tiles)this._setTileReloadTimer(+u,this._tiles[u])}}update(t,i,a){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!a)return;let u;this.updateCacheSize(t,i),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?u=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(y=>new Xr(y.canonical.z,y.wrap,y.canonical.z,y.canonical.x,y.canonical.y)):(u=t.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!a,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(u=u.filter(y=>this._source.hasTile(y)))):u=[];const p=this._updateRetainedTiles(u);if(n2(this._source.type)&&u.length!==0){const y={},w={},b=Object.keys(p);for(const I of b){const M=p[I],L=this._tiles[I];if(!L||L.fadeEndTime&&L.fadeEndTime<=xo.now())continue;const R=this.findLoadedParent(M,Math.max(M.overscaledZ-nc.maxOverzooming,this._source.minzoom));R&&(this._addTile(R.tileID),y[R.tileID.key]=R.tileID),w[I]=M}const A=u[u.length-1].overscaledZ;for(const I in this._tiles){const M=this._tiles[I];if(p[I]||!M.hasData())continue;let L=M.tileID;for(;L.overscaledZ>A;){L=L.scaledTo(L.overscaledZ-1);const R=this._tiles[L.key];if(R&&R.hasData()&&w[L.key]){p[I]=M.tileID;break}}}for(const I in y)p[I]||(this._coveredTiles[I]=!0,p[I]=y[I])}for(const y in p)this._tiles[y].clearFadeHold();const g=function(y,w){const b=[];for(const A in y)A in w||b.push(A);return b}(this._tiles,p);for(const y of g){const w=this._tiles[y];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(+y)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const i={};if(t.length===0)return i;const a={},u=t.reduce((b,A)=>Math.min(b,A.overscaledZ),1/0),p=t[0].overscaledZ,g=Math.max(p-nc.maxOverzooming,this._source.minzoom),y=Math.max(p+nc.maxUnderzooming,this._source.minzoom),w={};for(const b of t){const A=this._addTile(b);i[b.key]=b,A.hasData()||u=this._source.maxzoom){const M=b.children(this._source.maxzoom)[0],L=this.getTile(M);if(L&&L.hasData()){i[M.key]=M;continue}}else{const M=b.children(this._source.maxzoom);if(i[M[0].key]&&i[M[1].key]&&i[M[2].key]&&i[M[3].key])continue}let I=A.wasRequested();for(let M=b.overscaledZ-1;M>=g;--M){const L=b.scaledTo(M);if(a[L.key]||(a[L.key]=!0,A=this.getTile(L),!A&&I&&(A=this._addTile(L)),A&&(i[L.key]=L,I=A.wasRequested(),A.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const i=[];let a,u=this._tiles[t].tileID;for(;u.overscaledZ>0;){if(u.key in this._loadedParentTiles){a=this._loadedParentTiles[u.key];break}i.push(u.key);const p=u.scaledTo(u.overscaledZ-1);if(a=this._getLoadedTile(p),a)break;u=p}for(const p of i)this._loadedParentTiles[p]=a}}_addTile(t){let i=this._tiles[t.key];if(i)return i;i=this._cache.getAndRemove(t),i&&(this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,i)));const a=!!i;if(!a){const u=this.map?this.map.painter:null;i=new l0(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,u,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,t.key,i.state))}return i?(i.uses++,this._tiles[t.key]=i,a||this._source.fire(new Is("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(t,i){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=i.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const i=this._tiles[t];i&&(i.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),i.uses>0||(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,i,a){const u=[],p=this.transform;if(!p)return u;const g=p.projection.name==="globe",y=as(p.center.lng);for(const w in this._tiles){const b=this._tiles[w];if(a&&b.clearQueryDebugViz(),b.holdingForFade())continue;let A;if(g){const I=b.tileID.canonical;if(I.z===0){const M=[Math.abs(Je(y,...Zd(I,-1))-y),Math.abs(Je(y,...Zd(I,1))-y)];A=[0,2*M.indexOf(Math.min(...M))-1]}else{const M=[Math.abs(Je(y,...Zd(I,-1))-y),Math.abs(Je(y,...Zd(I,0))-y),Math.abs(Je(y,...Zd(I,1))-y)];A=[M.indexOf(Math.min(...M))-1]}}else A=[0];for(const I of A){const M=t.containsTile(b,p,i,I);M&&u.push(M)}}return u}getVisibleCoordinates(t){const i=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of i)a.projMatrix=this.transform.calculateProjMatrix(a.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(n2(this._source.type))for(const t in this._tiles){const i=this._tiles[t];if(i.fadeEndTime!==void 0&&i.fadeEndTime>=xo.now())return!0}return!1}setFeatureState(t,i,a){this._state.updateState(t=t||"_geojsonTileLayer",i,a)}removeFeatureState(t,i,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",i,a)}getFeatureState(t,i){return this._state.getState(t=t||"_geojsonTileLayer",i)}setDependencies(t,i,a){const u=this._tiles[t];u&&u.setDependencies(i,a)}reloadTilesForDependencies(t,i){for(const a in this._tiles)this._tiles[a].hasDependency(t,i)&&this._reloadTile(+a,"reloading");this._cache.filter(a=>!a.hasDependency(t,i))}_preloadTiles(t,i){if(!this._sourceLoaded){const y=()=>{this._sourceLoaded&&(this._source.off("data",y),this._preloadTiles(t,i))};return void this._source.on("data",y)}const a=new Map,u=Array.isArray(t)?t:[t],p=this.map.painter.terrain,g=this.usedForTerrain&&p?p.getScaledDemTileSize():this._source.tileSize;for(const y of u){const w=y.coveringTiles({tileSize:g,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const b of w)a.set(b.key,b);this.usedForTerrain&&y.updateElevation(!1)}Bt(Array.from(a.values()),(y,w)=>{const b=new l0(y,this._source.tileSize*y.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(b,A=>{this._source.type==="raster-dem"&&b.dem&&this._backfillDEM(b),w(A,b)})},i)}}function t2(r,t){const i=Math.abs(2*r.wrap)-+(r.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return r.overscaledZ-t.overscaledZ||a-i||t.canonical.y-r.canonical.y||t.canonical.x-r.canonical.x}function n2(r){return r==="raster"||r==="image"||r==="video"||r==="custom"}function Zd(r,t){const i=1<=0&&I[3]>=0&&w.insert(y,I[0],I[1],I[2],I[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Wy(new ym(this.rawTileData)).layers,this.sourceLayerCoder=new Vb(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const t in this.vtLayers)this.vtFeatures[t]=[]}return this.vtLayers}query(t,i,a,u){this.loadVTLayers();const p=t.params||{},g=Jc(p.filter),y=t.tileResult,w=t.transform,b=y.bufferedTilespaceBounds,A=this.grid.query(b.min.x,b.min.y,b.max.x,b.max.y,(R,F,$,K)=>Iw(y.bufferedTilespaceGeometry,R,F,$,K));A.sort(MP);let I=null;w.elevation&&A.length>0&&(I=zm.create(w.elevation,this.tileID));const M={};let L;for(let R=0;R(K||(K=Vs(se,this.tileID.canonical,t.tileTransform)),Y.queryIntersectsFeature(y,se,re,K,this.z,t.transform,t.pixelPosMatrix,I,ue)))}return M}loadMatchingFeature(t,i,a,u,p,g,y,w,b){const{featureIndex:A,bucketIndex:I,sourceLayerIndex:M,layoutVertexArrayOffset:L}=i,R=this.bucketLayerIDs[I];if(u&&!function(se,Y){for(let re=0;re=0)return!0;return!1}(u,R))return;const F=this.sourceLayerCoder.decode(M),$=this.vtLayers[F].feature(A);if(a.needGeometry){const se=Jl($,!0);if(!a.filter(new C(this.tileID.overscaledZ),se,this.tileID.canonical))return}else if(!a.filter(new C(this.tileID.overscaledZ),$))return;const K=this.getId($,F);for(let se=0;se{const y=t instanceof X?t.get(g):null;return y&&y.evaluate?y.evaluate(i,a,u):y})}function MP(r,t){return t-r}dt(r2,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class o2{constructor(t,i){this.width=t,this.height=i,this.nextRow=0,this.image=new $s({width:t,height:i}),this.positions={},this.uploaded=!1}getDash(t,i){const a=this.getKey(t,i);return this.positions[a]}trim(){const t=this.width,i=this.height=br(this.nextRow);this.image.resize({width:t,height:i})}getKey(t,i){return t.join(",")+i}getDashRanges(t,i,a){const u=[];let p=t.length%2==1?-t[t.length-1]*a:0,g=t[0]*a,y=!0;u.push({left:p,right:g,isDash:y,zeroLength:t[0]===0});let w=t[0];for(let b=1;b1&&(w=t[++y]);const A=Math.abs(b-w.left),I=Math.abs(b-w.right),M=Math.min(A,I);let L;const R=p/a*(u+1);if(w.isDash){const F=u-Math.abs(R);L=Math.sqrt(M*M+F*F)}else L=u-Math.sqrt(M*M+R*R);this.image.data[g+b]=Math.max(0,Math.min(255,L+128))}}}addRegularDash(t,i){for(let w=t.length-1;w>=0;--w){const b=t[w],A=t[w+1];b.zeroLength?t.splice(w,1):A&&A.isDash===b.isDash&&(A.left=b.left,t.splice(w,1))}const a=t[0],u=t[t.length-1];a.isDash===u.isDash&&(a.left=u.left-this.width,u.right=a.right+this.width);const p=this.width*this.nextRow;let g=0,y=t[g];for(let w=0;w1&&(y=t[++g]);const b=Math.abs(w-y.left),A=Math.abs(w-y.right),I=Math.min(b,A);this.image.data[p+w]=Math.max(0,Math.min(255,(y.isDash?I:-I)+i+128))}}addDash(t,i){const a=this.getKey(t,i);if(this.positions[a])return this.positions[a];const u=i==="round",p=u?7:0,g=2*p+1;if(this.nextRow+g>this.height)return wn("LineAtlas out of space"),null;t.length===0&&t.push(1);let y=0;for(let A=0;A=Ue.maxzoom||Ue.visibility!=="none"&&(p0(Me,this.zoom,a),(w[Ue.id]=Ue.createBucket({index:y.bucketLayerIDs.length,layers:Me,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:De,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:a})).populate(Ze,A,this.tileID.canonical,this.tileTransform),y.bucketLayerIDs.push(Me.map(je=>je.id)))}}let M,L,R,F;b.trim();const $={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},K=()=>{if(M)return p(M);if(L&&R&&F){const ue=new a2(L),ce=new fb(R,F);for(const Ie in w){const Te=w[Ie];Te instanceof Oa?(p0(Te.layers,this.zoom,a),rP(Te,L,ue.positions,R,ce.iconPositions,this.showCollisionBoxes,a,this.tileID.canonical,this.tileZoom,this.projection)):Te.hasPattern&&(Te instanceof mm||Te instanceof um||Te instanceof Dd)&&(p0(Te.layers,this.zoom,a),Te.addFeatures(A,this.tileID.canonical,ce.patternPositions,a,this.tileTransform))}this.status="done",p(null,{buckets:dn(w).filter(Ie=>!Ie.isEmpty()),featureIndex:y,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ue.image,lineAtlas:b,imageAtlas:ce,glyphMap:this.returnDependencies?L:null,iconMap:this.returnDependencies?R:null,glyphPositions:this.returnDependencies?ue.positions:null})}},se=kt(A.glyphDependencies,ue=>Object.keys(ue).map(Number));Object.keys(se).length?u.send("getGlyphs",{uid:this.uid,stacks:se},(ue,ce)=>{M||(M=ue,L=ce,K())},void 0,!1,$):L={};const Y=Object.keys(A.iconDependencies);Y.length?u.send("getImages",{icons:Y,source:this.source,tileID:this.tileID,type:"icons"},(ue,ce)=>{M||(M=ue,R=ce,K())},void 0,!1,$):R={};const re=Object.keys(A.patternDependencies);re.length?u.send("getImages",{icons:re,source:this.source,tileID:this.tileID,type:"patterns"},(ue,ce)=>{M||(M=ue,F=ce,K())},void 0,!1,$):F={},K()}}function p0(r,t,i){const a=new C(t);for(const u of r)u.recalculate(a,i)}class l2{constructor(t){this.entries={},this.scheduler=t}request(t,i,a,u){const p=this.entries[t]=this.entries[t]||{callbacks:[]};if(p.result){const[g,y]=p.result;return this.scheduler?this.scheduler.add(()=>{u(g,y)},i):u(g,y),()=>{}}return p.callbacks.push(u),p.cancel||(p.cancel=a((g,y)=>{p.result=[g,y];for(const w of p.callbacks)this.scheduler?this.scheduler.add(()=>{w(g,y)},i):w(g,y);setTimeout(()=>delete this.entries[t],3e3)})),()=>{p.result||(p.callbacks=p.callbacks.filter(g=>g!==u),p.callbacks.length||(p.cancel(),delete this.entries[t]))}}}function c2(r,t,i){const a=JSON.stringify(r.request);return r.data&&(this.deduped.entries[a]={result:[null,r.data]}),this.deduped.request(a,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom},u=>{const p=ua(r.request,(g,y,w,b)=>{g?u(g):y&&u(null,{vectorTile:i?void 0:new Wy(new ym(y)),rawData:y,cacheControl:w,expires:b})});return()=>{p.cancel(),u()}},t)}const u2=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class f0{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,a]=new Uint8Array(t,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const u=a>>4;if(u!==1)throw new Error(`Got v${u} data when expected v1.`);const p=u2[15&a];if(!p)throw new Error("Unrecognized array type.");const[g]=new Uint16Array(t,2,1),[y]=new Uint32Array(t,4,1);return new f0(y,g,p,t)}constructor(t,i=64,a=Float64Array,u){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=a,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const p=u2.indexOf(this.ArrayType),g=2*t*this.ArrayType.BYTES_PER_ELEMENT,y=t*this.IndexArrayType.BYTES_PER_ELEMENT,w=(8-y%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);u&&u instanceof ArrayBuffer?(this.data=u,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+y+w,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+g+y+w),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+y+w,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=t)}add(t,i){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=t,this.coords[this._pos++]=i,a}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return m0(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,i,a,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:g,nodeSize:y}=this,w=[0,p.length-1,0],b=[];for(;w.length;){const A=w.pop()||0,I=w.pop()||0,M=w.pop()||0;if(I-M<=y){for(let $=M;$<=I;$++){const K=g[2*$],se=g[2*$+1];K>=t&&K<=a&&se>=i&&se<=u&&b.push(p[$])}continue}const L=M+I>>1,R=g[2*L],F=g[2*L+1];R>=t&&R<=a&&F>=i&&F<=u&&b.push(p[L]),(A===0?t<=R:i<=F)&&(w.push(M),w.push(L-1),w.push(1-A)),(A===0?a>=R:u>=F)&&(w.push(L+1),w.push(I),w.push(1-A))}return b}within(t,i,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:p,nodeSize:g}=this,y=[0,u.length-1,0],w=[],b=a*a;for(;y.length;){const A=y.pop()||0,I=y.pop()||0,M=y.pop()||0;if(I-M<=g){for(let $=M;$<=I;$++)d2(p[2*$],p[2*$+1],t,i)<=b&&w.push(u[$]);continue}const L=M+I>>1,R=p[2*L],F=p[2*L+1];d2(R,F,t,i)<=b&&w.push(u[L]),(A===0?t-a<=R:i-a<=F)&&(y.push(M),y.push(L-1),y.push(1-A)),(A===0?t+a>=R:i+a>=F)&&(y.push(L+1),y.push(I),y.push(1-A))}return w}}function m0(r,t,i,a,u,p){if(u-a<=i)return;const g=a+u>>1;h2(r,t,g,a,u,p),m0(r,t,i,a,g-1,1-p),m0(r,t,i,g+1,u,1-p)}function h2(r,t,i,a,u,p){for(;u>a;){if(u-a>600){const b=u-a+1,A=i-a+1,I=Math.log(b),M=.5*Math.exp(2*I/3),L=.5*Math.sqrt(I*M*(b-M)/b)*(A-b/2<0?-1:1);h2(r,t,i,Math.max(a,Math.floor(i-A*M/b+L)),Math.min(u,Math.floor(i+(b-A)*M/b+L)),p)}const g=t[2*i+p];let y=a,w=u;for(Hd(r,t,a,i),t[2*u+p]>g&&Hd(r,t,a,u);yg;)w--}t[2*a+p]===g?Hd(r,t,a,w):(w++,Hd(r,t,w,u)),w<=i&&(a=w+1),i<=w&&(u=w-1)}}function Hd(r,t,i,a){g0(r,i,a),g0(t,2*i,2*a),g0(t,2*i+1,2*a+1)}function g0(r,t,i){const a=r[t];r[t]=r[i],r[i]=a}function d2(r,t,i,a){const u=r-i,p=t-a;return u*u+p*p}s.ARRAY_TYPE=xi,s.AUTH_ERR_MSG=he,s.Aabb=Hr,s.Actor=class{constructor(r,t,i){this.target=r,this.parent=t,this.mapId=i,this.callbacks={},this.cancelCallbacks={},Yi(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=vo()?r:k,this.scheduler=new TP}send(r,t,i,a,u=!1,p){const g=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=p,this.callbacks[g]=i);const y=aa(this.globalScope)?void 0:[];return this.target.postMessage({id:g,type:r,hasCallback:!!i,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:Ia(t,y)},y),{cancel:()=>{i&&delete this.callbacks[g],this.target.postMessage({id:g,type:"",targetMapId:a,sourceMapId:this.mapId})}}}receive(r){const t=r.data,i=t.id;if(i&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type===""){const a=this.cancelCallbacks[i];delete this.cancelCallbacks[i],a&&a.cancel()}else if(t.mustQueue||vo()){const a=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,t),a&&a.metadata||{type:"message"})}else this.processTask(i,t)}processTask(r,t){if(t.type===""){const i=this.callbacks[r];delete this.callbacks[r],i&&(t.error?i(Os(t.error)):i(null,Os(t.data)))}else{const i=aa(this.globalScope)?void 0:[],a=t.hasCallback?(p,g)=>{delete this.cancelCallbacks[r],this.target.postMessage({id:r,type:"",sourceMapId:this.mapId,error:p?Ia(p):null,data:Ia(g,i)},i)}:p=>{},u=Os(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,u,a);else if(this.parent.getWorkerSource){const p=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,p[0],u.source)[p[1]](u,a)}else a(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},s.CanonicalTileID=fm,s.Color=Fn,s.ColorMode=hs,s.CullFaceMode=Fo,s.DEMData=Pm,s.DataConstantProperty=B,s.DedupedRequest=l2,s.DepthMode=Eu,s.EXTENT=vt,s.Elevation=class{isDataAvailableAtPoint(r){const t=this._source();if(this.isUsingMockSource()||!t||r.y<0||r.y>1)return!1;const i=t.getSource().maxzoom,a=1<1)return t;const u=a.getSource().maxzoom,p=1<{const p=this.getAtTileOffset(r,u.x,u.y),g=a.upVector(r.canonical,u.x,u.y);return Bi(g,g,p*a.upVectorScale(r.canonical,t,i).metersToTile),g}}getForTilePoints(r,t,i,a){if(this.isUsingMockSource())return!1;const u=zm.create(this,r,a);return!!u&&(t.forEach(p=>{p[2]=this.exaggeration()*u.getElevationAt(p[0],p[1],i)}),!0)}getMinMaxForTile(r){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(r);if(!t||!t.dem)return null;const i=t.dem.tree,a=t.tileID,u=1<{let M=b===p-1?b-2:b===0?b:b-1;return M+=I?24575:0,[M,A]};for(let b=0;bthis._skuTokenExpiresAt}transformRequest(r,t){return this._transformRequestFn&&this._transformRequestFn(r,t)||{url:r}}normalizeStyleURL(r,t){if(!_e(r))return r;const i=rt(r);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeGlyphsURL(r,t){if(!_e(r))return r;const i=rt(r);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeSourceURL(r,t,i,a){if(!_e(r))return r;const u=rt(r);return u.path=`/v4/${u.authority}.json`,u.params.push("secure"),i&&u.params.push(`language=${i}`),a&&u.params.push(`worldview=${a}`),this._makeAPIURL(u,this._customAccessToken||t)}normalizeSpriteURL(r,t,i,a){const u=rt(r);return _e(r)?(u.path=`/styles/v1${u.path}/sprite${t}${i}`,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=`${t}${i}`,Qe(u))}normalizeTileURL(r,t,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),r&&!_e(r))return r;const a=rt(r);a.path=a.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${t||i&&a.authority!=="raster"&&i===512?"@2x":""}${J.supported?".webp":"$1"}`),a.authority==="raster"?a.path=`/${G.RASTER_URL_PREFIX}${a.path}`:(a.path=a.path.replace(/^.+\/v4\//,"/"),a.path=`/${G.TILE_URL_VERSION}${a.path}`);const u=this._customAccessToken||function(p){for(const g of p){const y=g.match(/^access_token=(.*)$/);if(y)return y[1]}return null}(a.params)||G.ACCESS_TOKEN;return G.REQUIRE_ACCESS_TOKEN&&u&&this._skuToken&&a.params.push(`sku=${this._skuToken}`),this._makeAPIURL(a,u)}canonicalizeTileURL(r,t){const i=rt(r);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return r;let a="mapbox://";i.path.match(/^\/raster\/v1\//)?a+=`raster/${i.path.replace(`/${G.RASTER_URL_PREFIX}/`,"")}`:a+=`tiles/${i.path.replace(`/${G.TILE_URL_VERSION}/`,"")}`;let u=i.params;return t&&(u=u.filter(p=>!p.match(/^access_token=/))),u.length&&(a+=`?${u.join("&")}`),a}canonicalizeTileset(r,t){const i=!!t&&_e(t),a=[];for(const u of r.tiles||[])be(u)?a.push(this.canonicalizeTileURL(u,i)):a.push(u);return a}_makeAPIURL(r,t){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",a=rt(G.API_URL);if(r.protocol=a.protocol,r.authority=a.authority,r.protocol==="http"){const u=r.params.indexOf("secure");u>=0&&r.params.splice(u,1)}if(a.path!=="/"&&(r.path=`${a.path}${r.path}`),!G.REQUIRE_ACCESS_TOKEN)return Qe(r);if(t=t||G.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if(t[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return r.params=r.params.filter(u=>u.indexOf("access_token")===-1),r.params.push(`access_token=${t||""}`),Qe(r)}},s.ResourceType=Ss,s.SegmentVector=qn,s.SourceCache=nc,s.StencilMode=u0,s.StructArrayLayout1ui2=vi,s.StructArrayLayout2f1f2i16=wt,s.StructArrayLayout2i4=We,s.StructArrayLayout2ui4=fr,s.StructArrayLayout3f12=Ot,s.StructArrayLayout3ui6=mt,s.StructArrayLayout4i8=Fe,s.StructArrayLayout5f20=sn,s.Texture=Wd,s.Tile=l0,s.Transitionable=O,s.Uniform1f=Yf,s.Uniform1i=class extends Ns{constructor(r){super(r),this.current=0}set(r,t,i){this.fetchUniformLocation(r,t)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},s.Uniform2f=class extends Ns{constructor(r){super(r),this.current=[0,0]}set(r,t,i){this.fetchUniformLocation(r,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},s.Uniform3f=class extends Ns{constructor(r){super(r),this.current=[0,0,0]}set(r,t,i){this.fetchUniformLocation(r,t)&&(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])))}},s.Uniform4f=Wx,s.UniformColor=Zx,s.UniformMatrix2f=class extends Ns{constructor(r){super(r),this.current=lk}set(r,t,i){if(this.fetchUniformLocation(r,t)){for(let a=0;a<4;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}},s.UniformMatrix3f=class extends Ns{constructor(r){super(r),this.current=ak}set(r,t,i){if(this.fetchUniformLocation(r,t)){for(let a=0;a<9;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},s.UniformMatrix4f=class extends Ns{constructor(r){super(r),this.current=sk}set(r,t,i){if(this.fetchUniformLocation(r,t)){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 a=1;a<16;a++)if(i[a]!==this.current[a]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},s.UnwrappedTileID=Qw,s.ValidationError=ct,s.VectorTileFeature=dm,s.VectorTileWorkerSource=class extends vl{constructor(r,t,i,a,u){super(),this.actor=r,this.layerIndex=t,this.availableImages=i,this.loadVectorData=u||c2,this.loading={},this.loaded={},this.deduped=new l2(r.scheduler),this.isSpriteLoaded=a,this.scheduler=r.scheduler}loadTile(r,t){const i=r.uid,a=r&&r.request,u=a&&a.collectResourceTiming,p=this.loading[i]=new PP(r);p.abort=this.loadVectorData(r,(g,y)=>{const w=!this.loading[i];if(delete this.loading[i],w||g||!y)return p.status="done",w||(this.loaded[i]=p),t(g);const b=y.rawData,A={};y.expires&&(A.expires=y.expires),y.cacheControl&&(A.cacheControl=y.cacheControl),p.vectorTile=y.vectorTile||new Wy(new ym(b));const I=()=>{p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,(M,L)=>{if(M||!L)return t(M);const R={};if(u){const F=wh(a);F.length>0&&(R.resourceTiming=JSON.parse(JSON.stringify(F)))}t(null,vn({rawTileData:b.slice(0)},L,A,R))})};this.isSpriteLoaded?I():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(I,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom}):I()}),this.loaded=this.loaded||{},this.loaded[i]=p})}reloadTile(r,t){const i=this.loaded,a=r.uid,u=this;if(i&&i[a]){const p=i[a];p.showCollisionBoxes=r.showCollisionBoxes,p.enableTerrain=!!r.enableTerrain,p.projection=r.projection,p.tileTransform=tc(r.tileID.canonical,r.projection);const g=(y,w)=>{const b=p.reloadCallback;b&&(delete p.reloadCallback,p.parse(p.vectorTile,u.layerIndex,this.availableImages,u.actor,b)),t(y,w)};p.status==="parsing"?p.reloadCallback=g:p.status==="done"&&(p.vectorTile?p.parse(p.vectorTile,this.layerIndex,this.availableImages,this.actor,g):g())}}abortTile(r,t){const i=r.uid,a=this.loading[i];a&&(a.abort&&a.abort(),delete this.loading[i]),t()}removeTile(r,t){const i=this.loaded,a=r.uid;i&&i[a]&&delete i[a],t()}},s.WritingMode=Ni,s.ZoomDependentExpression=Bl,s.add=js,s.addDynamicAttributes=Im,s.adjoint=function(r,t){var i=t[0],a=t[1],u=t[2],p=t[3],g=t[4],y=t[5],w=t[6],b=t[7],A=t[8];return r[0]=g*A-y*b,r[1]=u*b-a*A,r[2]=a*y-u*g,r[3]=y*w-p*A,r[4]=i*A-u*w,r[5]=u*p-i*y,r[6]=p*b-g*w,r[7]=a*w-i*b,r[8]=i*g-a*p,r},s.asyncAll=Bt,s.bezier=Li,s.bindAll=Yi,s.boundsAttributes=qb,s.bufferConvexPolygon=function(r,t){const i=[];for(let a=0;aAc&&(r.getActor().send("enforceCacheSizeLimit",Sc),_l=0)},s.calculateGlobeLabelMatrix=function(r,t){const{x:i,y:a}=r.point,u=gw(i,a,r.worldSize/r._pixelsPerMercatorPixel,0,0);return Zl(u,u,Cy(ss(t)))},s.calculateGlobeMatrix=function(r){const{x:t,y:i}=r.point,{lng:a,lat:u}=r._center;return gw(t,i,r.worldSize,a,u)},s.calculateGlobeMercatorMatrix=function(r){const t=r.pixelsPerMeter,i=t/Do(1,r.center.lat),a=Lo(new Float64Array(16));return yd(a,a,[r.point.x,r.point.y,0]),Hl(a,a,[i,i,t]),Float32Array.from(a)},s.circumferenceAtLatitude=ky,s.clamp=Je,s.clearTileCache=function(r){if(!gl())return;const t=k.caches.delete(la);r&&t.catch(r).then(()=>r())},s.clipLine=Cb,s.clone=function(r){var t=new xi(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t},s.clone$1=Dr,s.collisionCircleLayout=kM,s.config=G,s.conjugate=function(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r},s.create=function(){var r=new xi(16);return xi!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},s.create$1=Kx,s.createExpression=Sa,s.createLayout=ye,s.createStyleLayer=function(r){return r.type==="custom"?new xP(r):new bP[r.type](r)},s.cross=xy,s.degToRad=St,s.distance=function(r,t){return Math.hypot(t[0]-r[0],t[1]-r[1],t[2]-r[2])},s.div=function(r,t,i){return r[0]=t[0]/i[0],r[1]=t[1]/i[1],r[2]=t[2]/i[2],r},s.dot=oo,s.earthRadius=Id,s.ease=Ki,s.easeCubicInOut=$r,s.ecefToLatLng=function([r,t,i]){const a=Math.hypot(r,t,i),u=Math.atan2(r,i),p=.5*Math.PI-Math.acos(-t/a);return new ln(Vt(u),Vt(p))},s.emitValidationErrors=qf,s.endsWith=xn,s.enforceCacheSizeLimit=function(r){Ts(),fi&&fi.then(t=>{t.keys().then(i=>{for(let a=0;ap&&(a+=(r[u]-p)*(r[u]-p)),t[u]0){const R=180/a;Yx(L,L,[R/b+1,0,0,0,R/A+1,0,-.5*R/I,.5*R/M,1])}return L[2]=w,L[5]=r.x,L[8]=r.y,L},s.getImage=ne,s.getJSON=function(r,t){return Cs(vn(r,{type:"json"}),t)},s.getLatitudinalLod=function(r){const t=zr-5;r=Je(r,-t,t)/t*90;const i=Math.pow(Math.abs(Math.sin(St(r))),3);return Math.round(i*(Sd.length-1))},s.getMapSessionAPI=hr,s.getPerformanceMeasurement=wh,s.getProjection=Ub,s.getRTLTextPluginStatus=x,s.getReferrer=As,s.getTilePoint=function(r,{x:t,y:i},a=0){return new Ve(((t-a)*r.scale-r.x)*vt,(i*r.scale-r.y)*vt)},s.getTileVec3=function(r,t,i=0){return ou(((t.x-i)*r.scale-r.x)*vt,(t.y*r.scale-r.y)*vt,xw(t.z,t.y))},s.getVideo=function(r,t){const i=k.document.createElement("video");i.muted=!0,i.onloadstart=function(){t(null,i)};for(let a=0;a{}}},s.globeCenterToScreenPoint=function(r){const t=[0,0,0],i=Lo(new Float64Array(16));return Zl(i,r.pixelMatrix,r.globeMatrix),Nn(t,t,i),new Ve(t[0],t[1])},s.globeDenormalizeECEF=Cy,s.globeECEFOrigin=function(r,t){const i=[0,0,0];return Nn(i,i,Cd(ss(t.canonical))),Nn(i,i,r),i},s.globeMetersToEcef=em,s.globeNormalizeECEF=Cd,s.globePixelsToTileUnits=function(r,t){return vt/(512*Math.pow(2,r))*nm(ss(t))},s.globePoleMatrixForTile=function(r,t,i){const a=Lo(new Float64Array(16)),u=(t/(1<0;return a===0&&!u&&!g&&p},s.identity=Lo,s.identity$1=sw,s.invert=gy,s.isFullscreen=function(){return!!k.document.fullscreenElement||!!k.document.webkitFullscreenElement},s.isLngLatBehindGlobe=Iy,s.isMapAuthenticated=function(r){return Or.has(r)},s.isMapboxURL=_e,s.isSafariWithAntialiasingBug=function(r){const t=r.navigator?r.navigator.userAgent:null;return!!aa(r)&&t&&(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},s.latFromMercatorY=Pr,s.latLngToECEF=au,s.len=_k,s.length=vd,s.length$1=function(r){return Math.hypot(r[0],r[1],r[2],r[3])},s.lngFromMercatorX=Fi,s.loadVectorTile=c2,s.makeRequest=Cs,s.mapValue=function(r,t,i,a,u){return Je((r-t)/(i-t)*(u-a)+a,a,u)},s.mercatorScale=ww,s.mercatorXfromLng=as,s.mercatorYfromLat=ls,s.mercatorZfromAltitude=Do,s.mul=mk,s.mul$1=gk,s.multiply=Zl,s.multiply$1=Yx,s.multiply$2=tw,s.nextPowerOfTwo=br,s.normalize=Zr,s.normalize$1=yk,s.normalize$2=iw,s.number=Wt,s.ortho=function(r,t,i,a,u,p,g){var y=1/(t-i),w=1/(a-u),b=1/(p-g);return r[0]=-2*y,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*w,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*b,r[11]=0,r[12]=(t+i)*y,r[13]=(u+a)*w,r[14]=(g+p)*b,r[15]=1,r},s.pbf=sb,s.perspective=function(r,t,i,a,u){var p,g=1/Math.tan(t/2);return r[0]=g/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,u!=null&&u!==1/0?(r[10]=(u+a)*(p=1/(a-u)),r[14]=2*u*a*p):(r[10]=-1,r[14]=-2*a),r},s.pick=function(r,t){const i={};for(let a=0;a0&&i[0]<=r.width&&i[1]>0&&i[1]<=r.height&&!Iy(r,new ln(r.center.lat,90)),a[0]>0&&a[0]<=r.width&&a[1]>0&&a[1]<=r.height&&!Iy(r,new ln(r.center.lat,-90))]},s.polygonContainsPoint=Ql,s.polygonIntersectsBox=Iw,s.polygonIntersectsPolygon=Tw,s.polygonizeBounds=function(r,t,i=0,a=!0){const u=new Ve(i,i),p=r.sub(u),g=t.add(u),y=[p,new Ve(g.x,p.y),g,new Ve(p.x,g.y)];return a&&y.push(p.clone()),y},s.posAttributes=Td,s.postMapLoadEvent=Vn,s.postPerformanceEvent=tr,s.postTurnstileEvent=Gt,s.potpack=Ky,s.prevPowerOfTwo=function(r){return r<=1?1:Math.pow(2,Math.floor(Math.log(r)/Math.LN2))},s.radToDeg=Vt,s.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],s.registerForPluginStateChange=function(r){return r({pluginStatus:d,pluginURL:o}),_.on("pluginStateChange",r),r},s.removeAuthState=function(r){Or.delete(r)},s.renderColorRamp=By,s.resample=bw,s.rotateX=_y,s.rotateX$1=aw,s.rotateY=Qf,s.rotateY$1=lw,s.rotateZ=function(r,t,i){var a=Math.sin(i),u=Math.cos(i),p=t[0],g=t[1],y=t[2],w=t[3],b=t[4],A=t[5],I=t[6],M=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=p*u+b*a,r[1]=g*u+A*a,r[2]=y*u+I*a,r[3]=w*u+M*a,r[4]=b*u-p*a,r[5]=A*u-g*a,r[6]=I*u-y*a,r[7]=M*u-w*a,r},s.rotateZ$1=function(r,t,i){i*=.5;var a=t[0],u=t[1],p=t[2],g=t[3],y=Math.sin(i),w=Math.cos(i);return r[0]=a*w+u*y,r[1]=u*w-a*y,r[2]=p*w+g*y,r[3]=g*w-p*y,r},s.scale=Hl,s.scale$1=rw,s.scale$2=Bi,s.scaleAndAdd=bd,s.set=function(r,t,i,a){return r[0]=t,r[1]=i,r[2]=a,r},s.setCacheLimits=function(r,t){Sc=r,Ac=t},s.setColumn=function(r,t,i){r[4*t+0]=i[0],r[4*t+1]=i[1],r[4*t+2]=i[2],r[4*t+3]=i[3]},s.setRTLTextPlugin=function(r,t,i=!1){if(d===pd||d===fd||d===md)throw new Error("setRTLTextPlugin cannot be called multiple times.");o=xo.resolveURL(r),d=pd,ka=t,f(),i||T()},s.smoothstep=Tt,s.spec=Re,s.squaredLength=function(r){var t=r[0],i=r[1],a=r[2];return t*t+i*i+a*a},s.storeAuthState=function(r,t){t?Or.add(r):Or.delete(r)},s.sub=Ro,s.subtract=vy,s.symbolSize=MM,s.tileAABB=function(r,t,i,a,u,p,g,y,w){if(w.name==="globe")return Ek(r,t,new fm(i,a,u));const b=tc({z:i,x:a,y:u},w);return new Hr([(p+b.x/b.scale)*t,t*(b.y/b.scale),g],[(p+b.x2/b.scale)*t,t*(b.y2/b.scale),y])},s.tileCornersToBounds=tm,s.tileTransform=tc,s.transformMat3=function(r,t,i){var a=t[0],u=t[1],p=t[2];return r[0]=a*i[0]+u*i[3]+p*i[6],r[1]=a*i[1]+u*i[4]+p*i[7],r[2]=a*i[2]+u*i[5]+p*i[8],r},s.transformMat4=Nn,s.transformMat4$1=Xl,s.transformQuat=nw,s.transitionTileAABBinECEF=pw,s.translate=yd,s.transpose=function(r,t){if(r===t){var i=t[1],a=t[2],u=t[5];r[1]=t[3],r[2]=t[6],r[3]=i,r[5]=t[7],r[6]=a,r[7]=u}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r},s.triggerPluginCompletionEvent=c,s.uniqueId=ii,s.updateGlobeVertexNormal=function(r,t,i,a,u){const p=5*t+2;r.float32[p+0]=i,r.float32[p+1]=a,r.float32[p+2]=u},s.validateCustomStyleLayer=function(r){const t=[],i=r.id;return i===void 0&&t.push({message:`layers.${i}: missing required property "id"`}),r.render===void 0&&t.push({message:`layers.${i}: missing required method "render"`}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},s.validateFilter=r=>yi(Vl(r)),s.validateFog=r=>yi(Vf(r)),s.validateLayer=r=>yi(Ff(r)),s.validateLight=r=>yi(jf(r)),s.validateSource=r=>yi(Uf(r)),s.validateStyle=Gf,s.validateTerrain=r=>yi(ld(r)),s.values=dn,s.vectorTile=hm,s.version=D,s.warnOnce=wn,s.window=k,s.wrap=xt}),v(["./shared"],function(s){function k(oe){if(typeof oe=="number"||typeof oe=="boolean"||typeof oe=="string"||oe==null)return JSON.stringify(oe);if(Array.isArray(oe)){let U="[";for(const ne of oe)U+=`${k(ne)},`;return`${U}]`}let N="{";for(const U of Object.keys(oe).sort())N+=`${U}:${k(oe[U])},`;return`${N}}`}function D(oe){let N="";for(const U of s.refProperties)N+=`/${k(oe[U])}`;return N}class V{constructor(N){this.keyCache={},N&&this.replace(N)}replace(N){this._layerConfigs={},this._layers={},this.update(N,[])}update(N,U){for(const he of N)this._layerConfigs[he.id]=he,(this._layers[he.id]=s.createStyleLayer(he)).compileFilter(),this.keyCache[he.id]&&delete this.keyCache[he.id];for(const he of U)delete this.keyCache[he],delete this._layerConfigs[he],delete this._layers[he];this.familiesBySource={};const ne=function(he,_e){const be={};for(let ge=0;gethis._layers[rt.id]),be=_e[0];if(be.visibility==="none")continue;const we=be.source||"";let ge=this.familiesBySource[we];ge||(ge=this.familiesBySource[we]={});const Pe=be.sourceLayer||"_geojsonTileLayer";let nt=ge[Pe];nt||(nt=ge[Pe]=[]),nt.push(_e)}}}class G{loadTile(N,U){const{uid:ne,encoding:he,rawImageData:_e,padding:be,buildQuadTree:we}=N,ge=s.window.ImageBitmap&&_e instanceof s.window.ImageBitmap?this.getImageData(_e,be):_e;U(null,new s.DEMData(ne,ge,he,be<1,we))}getImageData(N,U){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(N.width,N.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=N.width,this.offscreenCanvas.height=N.height,this.offscreenCanvasContext.drawImage(N,0,0,N.width,N.height);const ne=this.offscreenCanvasContext.getImageData(-U,-U,N.width+2*U,N.height+2*U);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),ne}}function J(oe,N){if(oe.length!==0){ve(oe[0],N);for(var U=1;U=Math.abs(we)?U-ge+we:we-ge+U,U=ge}U+ne>=0!=!!N&&oe.reverse()}var ae=s.getDefaultExportFromCjs(function oe(N,U){var ne,he=N&&N.type;if(he==="FeatureCollection")for(ne=0;ne>31}function Vr(oe,N){for(var U=oe.loadGeometry(),ne=oe.type,he=0,_e=0,be=U.length,we=0;weoe},Je=Math.fround||(Tt=new Float32Array(1),oe=>(Tt[0]=+oe,Tt[0]));var Tt;const xt=3,Bt=5,dn=6;class vn{constructor(N){this.options=Object.assign(Object.create(Ki),N),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(N){const{log:U,minZoom:ne,maxZoom:he}=this.options;U&&console.time("total time");const _e=`prepare ${N.length} points`;U&&console.time(_e),this.points=N;const be=[];for(let ge=0;ge=ne;ge--){const Pe=+Date.now();we=this.trees[ge]=this._createTree(this._cluster(we,ge)),U&&console.log("z%d: %d clusters in %dms",ge,we.numItems,+Date.now()-Pe)}return U&&console.timeEnd("total time"),this}getClusters(N,U){let ne=((N[0]+180)%360+360)%360-180;const he=Math.max(-90,Math.min(90,N[1]));let _e=N[2]===180?180:((N[2]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,N[3]));if(N[2]-N[0]>=360)ne=-180,_e=180;else if(ne>_e){const rt=this.getClusters([ne,he,180,be],U),Qe=this.getClusters([-180,he,_e,be],U);return rt.concat(Qe)}const we=this.trees[this._limitZoom(U)],ge=we.range(ar(ne),br(be),ar(_e),br(he)),Pe=we.data,nt=[];for(const rt of ge){const Qe=this.stride*rt;nt.push(Pe[Qe+Bt]>1?sr(Pe,Qe,this.clusterProps):this.points[Pe[Qe+xt]])}return nt}getChildren(N){const U=this._getOriginId(N),ne=this._getOriginZoom(N),he="No cluster with the specified id.",_e=this.trees[ne];if(!_e)throw new Error(he);const be=_e.data;if(U*this.stride>=be.length)throw new Error(he);const we=this.options.radius/(this.options.extent*Math.pow(2,ne-1)),ge=_e.within(be[U*this.stride],be[U*this.stride+1],we),Pe=[];for(const nt of ge){const rt=nt*this.stride;be[rt+4]===N&&Pe.push(be[rt+Bt]>1?sr(be,rt,this.clusterProps):this.points[be[rt+xt]])}if(Pe.length===0)throw new Error(he);return Pe}getLeaves(N,U,ne){const he=[];return this._appendLeaves(he,N,U=U||10,ne=ne||0,0),he}getTile(N,U,ne){const he=this.trees[this._limitZoom(N)],_e=Math.pow(2,N),{extent:be,radius:we}=this.options,ge=we/be,Pe=(ne-ge)/_e,nt=(ne+1+ge)/_e,rt={features:[]};return this._addTileFeatures(he.range((U-ge)/_e,Pe,(U+1+ge)/_e,nt),he.data,U,ne,_e,rt),U===0&&this._addTileFeatures(he.range(1-ge/_e,Pe,1,nt),he.data,_e,ne,_e,rt),U===_e-1&&this._addTileFeatures(he.range(0,Pe,ge/_e,nt),he.data,-1,ne,_e,rt),rt.features.length?rt:null}getClusterExpansionZoom(N){let U=this._getOriginZoom(N)-1;for(;U<=this.options.maxZoom;){const ne=this.getChildren(N);if(U++,ne.length!==1)break;N=ne[0].properties.cluster_id}return U}_appendLeaves(N,U,ne,he,_e){const be=this.getChildren(U);for(const we of be){const ge=we.properties;if(ge&&ge.cluster?_e+ge.point_count<=he?_e+=ge.point_count:_e=this._appendLeaves(N,ge.cluster_id,ne,he,_e):_e1;let nt,rt,Qe;if(Pe)nt=ii(U,ge,this.clusterProps),rt=U[ge],Qe=U[ge+1];else{const Pt=this.points[U[ge+xt]];nt=Pt.properties;const[Dt,Gt]=Pt.geometry.coordinates;rt=ar(Dt),Qe=br(Gt)}const Mt={type:1,geometry:[[Math.round(this.options.extent*(rt*_e-ne)),Math.round(this.options.extent*(Qe*_e-he))]],tags:nt};let Rt;Rt=Pe||this.options.generateId?U[ge+xt]:this.points[U[ge+xt]].id,Rt!==void 0&&(Mt.id=Rt),be.features.push(Mt)}}_limitZoom(N){return Math.max(this.options.minZoom,Math.min(Math.floor(+N),this.options.maxZoom+1))}_cluster(N,U){const{radius:ne,extent:he,reduce:_e,minPoints:be}=this.options,we=ne/(he*Math.pow(2,U)),ge=N.data,Pe=[],nt=this.stride;for(let rt=0;rtU&&(Dt+=ge[In+Bt])}if(Dt>Pt&&Dt>=be){let Gt,In=Qe*Pt,Vn=Mt*Pt,Ir=-1;const tr=((rt/nt|0)<<5)+(U+1)+this.points.length;for(const Ji of Rt){const hr=Ji*nt;if(ge[hr+2]<=U)continue;ge[hr+2]=U;const Or=ge[hr+Bt];In+=ge[hr]*Or,Vn+=ge[hr+1]*Or,ge[hr+4]=tr,_e&&(Gt||(Gt=this._map(ge,rt,!0),Ir=this.clusterProps.length,this.clusterProps.push(Gt)),_e(Gt,this._map(ge,hr)))}ge[rt+4]=tr,Pe.push(In/Dt,Vn/Dt,1/0,tr,-1,Dt),_e&&Pe.push(Ir)}else{for(let Gt=0;Gt1)for(const Gt of Rt){const In=Gt*nt;if(!(ge[In+2]<=U)){ge[In+2]=U;for(let Vn=0;Vn>5}_getOriginZoom(N){return(N-this.points.length)%32}_map(N,U,ne){if(N[U+Bt]>1){const be=this.clusterProps[N[U+dn]];return ne?Object.assign({},be):be}const he=this.points[N[U+xt]].properties,_e=this.options.map(he);return ne&&_e===he?Object.assign({},_e):_e}}function sr(oe,N,U){return{type:"Feature",id:oe[N+xt],properties:ii(oe,N,U),geometry:{type:"Point",coordinates:[(ne=oe[N],360*(ne-.5)),Es(oe[N+1])]}};var ne}function ii(oe,N,U){const ne=oe[N+Bt],he=ne>=1e4?`${Math.round(ne/1e3)}k`:ne>=1e3?Math.round(ne/100)/10+"k":ne,_e=oe[N+dn],be=_e===-1?{}:Object.assign({},U[_e]);return Object.assign(be,{cluster:!0,cluster_id:oe[N+xt],point_count:ne,point_count_abbreviated:he})}function ar(oe){return oe/360+.5}function br(oe){const N=Math.sin(oe*Math.PI/180),U=.5-.25*Math.log((1+N)/(1-N))/Math.PI;return U<0?0:U>1?1:U}function Es(oe){const N=(180-360*oe)*Math.PI/180;return 360*Math.atan(Math.exp(N))/Math.PI-90}function Yi(oe,N,U,ne){for(var he,_e=ne,be=U-N>>1,we=U-N,ge=oe[N],Pe=oe[N+1],nt=oe[U],rt=oe[U+1],Qe=N+3;Qe_e)he=Qe,_e=Mt;else if(Mt===_e){var Rt=Math.abs(Qe-be);Rtne&&(he-N>3&&Yi(oe,N,he,ne),oe[he+2]=_e,U-he>3&&Yi(oe,he,U,ne))}function xn(oe,N,U,ne,he,_e){var be=he-U,we=_e-ne;if(be!==0||we!==0){var ge=((oe-U)*be+(N-ne)*we)/(be*be+we*we);ge>1?(U=he,ne=_e):ge>0&&(U+=be*ge,ne+=we*ge)}return(be=oe-U)*be+(we=N-ne)*we}function kt(oe,N,U,ne){var he={id:oe===void 0?null:oe,type:N,geometry:U,tags:ne,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(_e){var be=_e.geometry,we=_e.type;if(we==="Point"||we==="MultiPoint"||we==="LineString")Yo(_e,be);else if(we==="Polygon"||we==="MultiLineString")for(var ge=0;ge0&&(be+=ne?(he*Pe-ge*_e)/2:Math.sqrt(Math.pow(ge-he,2)+Math.pow(Pe-_e,2))),he=ge,_e=Pe}var nt=N.length-3;N[2]=1,Yi(N,0,nt,U),N[nt+2]=1,N.size=Math.abs(be),N.start=0,N.end=N.size}function pi(oe,N,U,ne){for(var he=0;he1?1:U}function oi(oe,N,U,ne,he,_e,be,we){if(ne/=N,_e>=(U/=N)&&be=ne)return null;for(var ge=[],Pe=0;Pe=U&&Rt=ne)){var Pt=[];if(Qe==="Point"||Qe==="MultiPoint")fl(rt,Pt,U,ne,he);else if(Qe==="LineString")aa(rt,Pt,U,ne,he,!1,we.lineMetrics);else if(Qe==="MultiLineString")Qo(rt,Pt,U,ne,he,!1);else if(Qe==="Polygon")Qo(rt,Pt,U,ne,he,!0);else if(Qe==="MultiPolygon")for(var Dt=0;Dt=U&&be<=ne&&(N.push(oe[_e]),N.push(oe[_e+1]),N.push(oe[_e+2]))}}function aa(oe,N,U,ne,he,_e,be){for(var we,ge,Pe=ml(oe),nt=he===0?Sc:Ac,rt=oe.start,Qe=0;QeU&&(ge=nt(Pe,Mt,Rt,Dt,Gt,U),be&&(Pe.start=rt+we*ge)):In>ne?Vn=U&&(ge=nt(Pe,Mt,Rt,Dt,Gt,U),Ir=!0),Vn>ne&&In<=ne&&(ge=nt(Pe,Mt,Rt,Dt,Gt,ne),Ir=!0),!_e&&Ir&&(be&&(Pe.end=rt+we*ge),N.push(Pe),Pe=ml(oe)),be&&(rt+=we)}var tr=oe.length-3;Mt=oe[tr],Rt=oe[tr+1],Pt=oe[tr+2],(In=he===0?Mt:Rt)>=U&&In<=ne&&la(Pe,Mt,Rt,Pt),tr=Pe.length-3,_e&&tr>=3&&(Pe[tr]!==Pe[0]||Pe[tr+1]!==Pe[1])&&la(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&N.push(Pe)}function ml(oe){var N=[];return N.size=oe.size,N.start=oe.start,N.end=oe.end,N}function Qo(oe,N,U,ne,he,_e){for(var be=0;bebe.maxX&&(be.maxX=nt),rt>be.maxY&&(be.maxY=rt)}return be}function _l(oe,N,U,ne){var he=N.geometry,_e=N.type,be=[];if(_e==="Point"||_e==="MultiPoint")for(var we=0;we0&&N.size<(he?be:ne))U.numPoints+=N.length/3;else{for(var we=[],ge=0;gebe)&&(U.numSimplified++,we.push(N[ge]),we.push(N[ge+1])),U.numPoints++;he&&function(Pe,nt){for(var rt=0,Qe=0,Mt=Pe.length,Rt=Mt-2;Qe0===nt)for(Qe=0,Mt=Pe.length;Qe24)throw new Error("maxZoom should be in the 0-24 range");if(N.promoteId&&N.generateId)throw new Error("promoteId and generateId cannot be used together.");var ne=function(he,_e){var be=[];if(he.type==="FeatureCollection")for(var we=0;we1&&console.time("creation"),Qe=this.tiles[rt]=ca(oe,N,U,ne,ge),this.tileCoords.push({z:N,x:U,y:ne}),Pe)){Pe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",N,U,ne,Qe.numFeatures,Qe.numPoints,Qe.numSimplified),console.timeEnd("creation"));var Mt="z"+N;this.stats[Mt]=(this.stats[Mt]||0)+1,this.total++}if(Qe.source=oe,he){if(N===ge.maxZoom||N===he)continue;var Rt=1<1&&console.time("clipping");var Pt,Dt,Gt,In,Vn,Ir,tr=.5*ge.buffer/ge.extent,Ji=.5-tr,hr=.5+tr,Or=1+tr;Pt=Dt=Gt=In=null,Vn=oi(oe,nt,U-tr,U+hr,0,Qe.minX,Qe.maxX,ge),Ir=oi(oe,nt,U+Ji,U+Or,0,Qe.minX,Qe.maxX,ge),oe=null,Vn&&(Pt=oi(Vn,nt,ne-tr,ne+hr,1,Qe.minY,Qe.maxY,ge),Dt=oi(Vn,nt,ne+Ji,ne+Or,1,Qe.minY,Qe.maxY,ge),Vn=null),Ir&&(Gt=oi(Ir,nt,ne-tr,ne+hr,1,Qe.minY,Qe.maxY,ge),In=oi(Ir,nt,ne+Ji,ne+Or,1,Qe.minY,Qe.maxY,ge),Ir=null),Pe>1&&console.timeEnd("clipping"),we.push(Pt||[],N+1,2*U,2*ne),we.push(Dt||[],N+1,2*U,2*ne+1),we.push(Gt||[],N+1,2*U+1,2*ne),we.push(In||[],N+1,2*U+1,2*ne+1)}}},ts.prototype.getTile=function(oe,N,U){var ne=this.options,he=ne.extent,_e=ne.debug;if(oe<0||oe>24)return null;var be=1<1&&console.log("drilling down to z%d-%d-%d",oe,N,U);for(var ge,Pe=oe,nt=N,rt=U;!ge&&Pe>0;)Pe--,nt=Math.floor(nt/2),rt=Math.floor(rt/2),ge=this.tiles[As(Pe,nt,rt)];return ge&&ge.source?(_e>1&&console.log("found parent tile z%d-%d-%d",Pe,nt,rt),_e>1&&console.time("drilling down"),this.splitTile(ge.source,Pe,nt,rt,oe,N,U),_e>1&&console.timeEnd("drilling down"),this.tiles[we]?gl(this.tiles[we],he):null):null};class ua extends s.VectorTileWorkerSource{constructor(N,U,ne,he,_e){super(N,U,ne,he,Cs),_e&&(this.loadGeoJSON=_e)}loadData(N,U){const ne=N&&N.request,he=ne&&ne.collectResourceTiming;this.loadGeoJSON(N,(_e,be)=>{if(_e||!be)return U(_e);if(typeof be!="object")return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));{ae(be,!0);try{if(N.filter){const ge=s.createExpression(N.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ge.result==="error")throw new Error(ge.value.map(nt=>`${nt.key}: ${nt.message}`).join(", "));be={type:"FeatureCollection",features:be.features.filter(nt=>ge.value.evaluate({zoom:0},nt))}}this._geoJSONIndex=N.cluster?new vn(function({superclusterOptions:ge,clusterProperties:Pe}){if(!Pe||!ge)return ge;const nt={},rt={},Qe={accumulated:null,zoom:0},Mt={properties:null},Rt=Object.keys(Pe);for(const Pt of Rt){const[Dt,Gt]=Pe[Pt],In=s.createExpression(Gt),Vn=s.createExpression(typeof Dt=="string"?[Dt,["accumulated"],["get",Pt]]:Dt);nt[Pt]=In.value,rt[Pt]=Vn.value}return ge.map=Pt=>{Mt.properties=Pt;const Dt={};for(const Gt of Rt)Dt[Gt]=nt[Gt].evaluate(Qe,Mt);return Dt},ge.reduce=(Pt,Dt)=>{Mt.properties=Dt;for(const Gt of Rt)Qe.accumulated=Pt[Gt],Pt[Gt]=rt[Gt].evaluate(Qe,Mt)},ge}(N)).load(be.features):function(ge,Pe){return new ts(ge,Pe)}(be,N.geojsonVtOptions)}catch(ge){return U(ge)}this.loaded={};const we={};if(he){const ge=s.getPerformanceMeasurement(ne);ge&&(we.resourceTiming={},we.resourceTiming[N.source]=JSON.parse(JSON.stringify(ge)))}U(null,we)}})}reloadTile(N,U){const ne=this.loaded;return ne&&ne[N.uid]?super.reloadTile(N,U):this.loadTile(N,U)}loadGeoJSON(N,U){if(N.request)s.getJSON(N.request,U);else{if(typeof N.data!="string")return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));try{return U(null,JSON.parse(N.data))}catch{return U(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(N,U){try{U(null,this._geoJSONIndex.getClusterExpansionZoom(N.clusterId))}catch(ne){U(ne)}}getClusterChildren(N,U){try{U(null,this._geoJSONIndex.getChildren(N.clusterId))}catch(ne){U(ne)}}getClusterLeaves(N,U){try{U(null,this._geoJSONIndex.getLeaves(N.clusterId,N.limit,N.offset))}catch(ne){U(ne)}}}class Cc{constructor(N){this.self=N,this.actor=new s.Actor(N,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=s.getProjection({name:"mercator"}),this.workerSourceTypes={vector:s.VectorTileWorkerSource,geojson:ua},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(U,ne)=>{if(this.workerSourceTypes[U])throw new Error(`Worker source with name "${U}" already registered.`);this.workerSourceTypes[U]=ne},this.self.registerRTLTextPlugin=U=>{if(s.plugin.isParsed())throw new Error("RTL text plugin already registered.");s.plugin.applyArabicShaping=U.applyArabicShaping,s.plugin.processBidirectionalText=U.processBidirectionalText,s.plugin.processStyledBidirectionalText=U.processStyledBidirectionalText}}clearCaches(N,U,ne){delete this.layerIndexes[N],delete this.availableImages[N],delete this.workerSources[N],delete this.demWorkerSources[N],ne()}checkIfReady(N,U,ne){ne()}setReferrer(N,U){this.referrer=U}spriteLoaded(N,U){this.isSpriteLoaded[N]=U;for(const ne in this.workerSources[N]){const he=this.workerSources[N][ne];for(const _e in he)he[_e]instanceof s.VectorTileWorkerSource&&(he[_e].isSpriteLoaded=U,he[_e].fire(new s.Event("isSpriteLoaded")))}}setImages(N,U,ne){this.availableImages[N]=U;for(const he in this.workerSources[N]){const _e=this.workerSources[N][he];for(const be in _e)_e[be].availableImages=U}ne()}enableTerrain(N,U,ne){this.terrain=U,ne()}setProjection(N,U){this.projections[N]=s.getProjection(U)}setLayers(N,U,ne){this.getLayerIndex(N).replace(U),ne()}updateLayers(N,U,ne){this.getLayerIndex(N).update(U.layers,U.removedIds),ne()}loadTile(N,U,ne){const he=this.enableTerrain?s.extend({enableTerrain:this.terrain},U):U;he.projection=this.projections[N]||this.defaultProjection,this.getWorkerSource(N,U.type,U.source).loadTile(he,ne)}loadDEMTile(N,U,ne){const he=this.enableTerrain?s.extend({buildQuadTree:this.terrain},U):U;this.getDEMWorkerSource(N,U.source).loadTile(he,ne)}reloadTile(N,U,ne){const he=this.enableTerrain?s.extend({enableTerrain:this.terrain},U):U;he.projection=this.projections[N]||this.defaultProjection,this.getWorkerSource(N,U.type,U.source).reloadTile(he,ne)}abortTile(N,U,ne){this.getWorkerSource(N,U.type,U.source).abortTile(U,ne)}removeTile(N,U,ne){this.getWorkerSource(N,U.type,U.source).removeTile(U,ne)}removeSource(N,U,ne){if(!this.workerSources[N]||!this.workerSources[N][U.type]||!this.workerSources[N][U.type][U.source])return;const he=this.workerSources[N][U.type][U.source];delete this.workerSources[N][U.type][U.source],he.removeSource!==void 0?he.removeSource(U,ne):ne()}loadWorkerSource(N,U,ne){try{this.self.importScripts(U.url),ne()}catch(he){ne(he.toString())}}syncRTLPluginState(N,U,ne){try{s.plugin.setState(U);const he=s.plugin.getPluginURL();if(s.plugin.isLoaded()&&!s.plugin.isParsed()&&he!=null){this.self.importScripts(he);const _e=s.plugin.isParsed();ne(_e?void 0:new Error(`RTL Text Plugin failed to import scripts from ${he}`),_e)}}catch(he){ne(he.toString())}}getAvailableImages(N){let U=this.availableImages[N];return U||(U=[]),U}getLayerIndex(N){let U=this.layerIndexes[N];return U||(U=this.layerIndexes[N]=new V),U}getWorkerSource(N,U,ne){if(this.workerSources[N]||(this.workerSources[N]={}),this.workerSources[N][U]||(this.workerSources[N][U]={}),!this.workerSources[N][U][ne]){const he={send:(_e,be,we,ge,Pe,nt)=>{this.actor.send(_e,be,we,N,Pe,nt)},scheduler:this.actor.scheduler};this.workerSources[N][U][ne]=new this.workerSourceTypes[U](he,this.getLayerIndex(N),this.getAvailableImages(N),this.isSpriteLoaded[N])}return this.workerSources[N][U][ne]}getDEMWorkerSource(N,U){return this.demWorkerSources[N]||(this.demWorkerSources[N]={}),this.demWorkerSources[N][U]||(this.demWorkerSources[N][U]=new G),this.demWorkerSources[N][U]}enforceCacheSizeLimit(N,U){s.enforceCacheSizeLimit(U)}getWorkerPerformanceMetrics(N,U,ne){ne(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Cc(self)),Cc}),v(["./shared"],function(s){function k(d,o){if(Array.isArray(d)){if(!Array.isArray(o)||d.length!==o.length)return!1;for(let c=0;c"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var f,_,x=new Blob([""],{type:"text/javascript"}),T=URL.createObjectURL(x);try{_=new Worker(T),f=!0}catch{f=!1}return _&&_.terminate(),URL.revokeObjectURL(T),f}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var f=document.createElement("canvas");f.width=f.height=1;var _=f.getContext("2d");if(!_)return!1;var x=_.getImageData(0,0,1,1);return x&&x.width===f.width}()?(G[c=o&&o.failIfMajorPerformanceCaveat]===void 0&&(G[c]=function(f){var _,x=function(T){var S=document.createElement("canvas"),C=Object.create(V.webGLContextAttributes);return C.failIfMajorPerformanceCaveat=T,S.getContext("webgl",C)||S.getContext("experimental-webgl",C)}(f);if(!x)return!1;try{_=x.createShader(x.VERTEX_SHADER)}catch{return!1}return!(!_||x.isContextLost())&&(x.shaderSource(_,"void main() {}"),x.compileShader(_),x.getShaderParameter(_,x.COMPILE_STATUS)===!0)}(c)),G[c]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var c}(d)}var G={};function J(d,o,c){const f=s.window.document.createElement(d);return o!==void 0&&(f.className=o),c&&c.appendChild(f),f}function ve(d,o,c){const f=s.window.document.createElementNS("http://www.w3.org/2000/svg",d);for(const _ of Object.keys(o))f.setAttributeNS(null,_,o[_]);return c&&c.appendChild(f),f}V.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const ae=s.window.document&&s.window.document.documentElement.style,me=ae&&ae.userSelect!==void 0?"userSelect":"WebkitUserSelect";let Ce;function ie(){ae&&me&&(Ce=ae[me],ae[me]="none")}function te(){ae&&me&&(ae[me]=Ce)}function le(d){d.preventDefault(),d.stopPropagation(),s.window.removeEventListener("click",le,!0)}function ze(){s.window.addEventListener("click",le,!0),s.window.setTimeout(()=>{s.window.removeEventListener("click",le,!0)},0)}function Oe(d,o){const c=d.getBoundingClientRect();return ht(d,c,o)}function Ke(d,o){const c=d.getBoundingClientRect(),f=[];for(let _=0;_=0?0:d.button}function ht(d,o,c){const f=d.offsetWidth===o.width?1:d.offsetWidth/o.width;return new s.Point((c.clientX-o.left)*f,(c.clientY-o.top)*f)}function Ve(d,o){var c=o[0],f=o[1],_=o[2],x=o[3],T=c*x-_*f;return T?(d[0]=x*(T=1/T),d[1]=-f*T,d[2]=-_*T,d[3]=c*T,d):null}function jt(d){const{userImage:o}=d;return!!(o&&o.render&&o.render())&&(d.data.replace(new Uint8Array(o.data.buffer)),!0)}class wr extends s.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(o){if(this.loaded!==o&&(this.loaded=o,o)){for(const{ids:c,callback:f}of this.requestors)this._notify(c,f);this.requestors=[]}}hasImage(o){return!!this.getImage(o)}getImage(o){return this.images[o]}addImage(o,c){this._validate(o,c)&&(this.images[o]=c)}_validate(o,c){let f=!0;return this._validateStretch(c.stretchX,c.data&&c.data.width)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "stretchX" value`))),f=!1),this._validateStretch(c.stretchY,c.data&&c.data.height)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "stretchY" value`))),f=!1),this._validateContent(c.content,c)||(this.fire(new s.ErrorEvent(new Error(`Image "${o}" has invalid "content" value`))),f=!1),f}_validateStretch(o,c){if(!o)return!0;let f=0;for(const _ of o){if(_[0]{this.ready=!0})}broadcast(o,c,f){s.asyncAll(this.actors,(_,x)=>{_.send(o,c,x)},f=f||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(o=>{o.remove()}),this.actors=[],this.workerPool.release(this.id)}}function Bt(d,o,c){return o*(s.EXTENT/(d.tileSize*Math.pow(2,c-d.tileID.overscaledZ)))}xt.Actor=s.Actor;class dn{constructor(o,c,f,_){this.screenBounds=o,this.cameraPoint=c,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=f,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,_)}static createFromScreenPoints(o,c){let f,_;if(o instanceof s.Point||typeof o[0]=="number"){const x=s.Point.convert(o);f=[x],_=c.isPointAboveHorizon(x)}else{const x=s.Point.convert(o[0]),T=s.Point.convert(o[1]);f=[x,T],_=s.polygonizeBounds(x,T).every(S=>c.isPointAboveHorizon(S))}return new dn(f,c.getCameraPoint(),_,c)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(o){return s.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],o)}bufferedCameraGeometry(o){const c=this.screenBounds[0],f=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],_=s.polygonizeBounds(c,f,0,!1);return this.cameraPoint.y>f.y&&(this.cameraPoint.x>c.x&&this.cameraPoint.x=f.x?_[2]=this.cameraPoint:this.cameraPoint.x<=c.x&&(_[3]=this.cameraPoint)),s.bufferConvexPolygon(_,o)}bufferedCameraGeometryGlobe(o){const c=this.screenBounds[0],f=this.screenBounds.length===1?this.screenBounds[0].add(new s.Point(1,1)):this.screenBounds[1],_=s.polygonizeBounds(c,f,o),x=this.cameraPoint.clone();switch(3*((x.y>c.y)+(x.y>f.y))+((x.x>c.x)+(x.x>f.x))){case 0:_[0]=x,_[4]=x.clone();break;case 1:_.splice(1,0,x);break;case 2:_[1]=x;break;case 3:_.splice(4,0,x);break;case 5:_.splice(2,0,x);break;case 6:_[3]=x;break;case 7:_.splice(3,0,x);break;case 8:_[2]=x}return _}containsTile(o,c,f,_=0){const x=o.queryPadding/c._pixelsPerMercatorPixel+1,T=f?this._bufferedCameraMercator(x,c):this._bufferedScreenMercator(x,c);let S=o.tileID.wrap+(T.unwrapped?_:0);const C=T.polygon.map(X=>s.getTilePoint(o.tileTransform,X,S));if(!s.polygonIntersectsBox(C,0,0,s.EXTENT,s.EXTENT))return;S=o.tileID.wrap+(this.screenGeometryMercator.unwrapped?_:0);const z=this.screenGeometryMercator.polygon.map(X=>s.getTileVec3(o.tileTransform,X,S)),P=z.map(X=>new s.Point(X[0],X[1])),O=c.getFreeCameraOptions().position||new s.MercatorCoordinate(0,0,0),j=s.getTileVec3(o.tileTransform,O,S),W=z.map(X=>{const B=s.sub(X,X,j);return s.normalize(B,B),new s.Ray(j,B)}),H=Bt(o,1,c.zoom)*c._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:P,tilespaceRays:W,bufferedTilespaceGeometry:C,bufferedTilespaceBounds:(Z=s.getBounds(C),Z.min.x=s.clamp(Z.min.x,0,s.EXTENT),Z.min.y=s.clamp(Z.min.y,0,s.EXTENT),Z.max.x=s.clamp(Z.max.x,0,s.EXTENT),Z.max.y=s.clamp(Z.max.y,0,s.EXTENT),Z),tile:o,tileID:o.tileID,pixelToTileUnitsFactor:H};var Z}_bufferedScreenMercator(o,c){const f=ii(o);if(this._screenRaycastCache[f])return this._screenRaycastCache[f];{let _;return _=c.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(o),c):{polygon:this.bufferedScreenGeometry(o).map(x=>c.pointCoordinate3D(x)),unwrapped:!0},this._screenRaycastCache[f]=_,_}}_bufferedCameraMercator(o,c){const f=ii(o);if(this._cameraRaycastCache[f])return this._cameraRaycastCache[f];{let _;return _=c.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(o),c):{polygon:this.bufferedCameraGeometry(o).map(x=>c.pointCoordinate3D(x)),unwrapped:!0},this._cameraRaycastCache[f]=_,_}}_projectAndResample(o,c){const f=function(x,T){const S=s.multiply([],T.pixelMatrix,T.globeMatrix),C=[0,-s.GLOBE_RADIUS,0,1],z=[0,s.GLOBE_RADIUS,0,1],P=[0,0,0,1];s.transformMat4$1(C,C,S),s.transformMat4$1(z,z,S),s.transformMat4$1(P,P,S);const O=new s.Point(C[0]/C[3],C[1]/C[3]),j=new s.Point(z[0]/z[3],z[1]/z[3]),W=s.polygonContainsPoint(x,O)&&C[3]1?vn(x.slice(0,X),T):[],Q=Xnew s.Point(sr(pe.x),pe.y)),Q=Q.map(pe=>new s.Point(sr(pe.x),pe.y));const ee=[...q];ee.length===0&&ee.push(Q[Q.length-1]);const de=s.number(ee[ee.length-1].y,(Q.length===0?q[0]:Q[0]).y,B);let fe;return fe=W?[new s.Point(0,de),new s.Point(0,0),new s.Point(1,0),new s.Point(1,de)]:[new s.Point(1,de),new s.Point(1,1),new s.Point(0,1),new s.Point(0,de)],ee.push(...fe),Q.length===0?ee.push(q[0]):ee.push(...Q),{polygon:ee.map(pe=>new s.MercatorCoordinate(pe.x,pe.y)),unwrapped:!1}}(o,c);if(f)return f;const _=function(x,T){let S=!1,C=-1/0,z=0;for(let O=0;OC&&(C=x[O].x,z=O);for(let O=0;O.5&&(W.x{O.x-=1}),{polygon:x,unwrapped:S}}(vn(o,c).map(x=>new s.Point(sr(x.x),x.y)),c);return{polygon:_.polygon.map(x=>new s.MercatorCoordinate(x.x,x.y)),unwrapped:_.unwrapped}}}function vn(d,o){return s.resample(d,c=>{const f=o.pointCoordinate3D(c);c.x=f.x,c.y=f.y},1/256)}function sr(d){return d<0?1+d%1:d%1}function ii(d){return 100*d|0}function ar(d,o,c,f,_){const x=function(T,S){if(T)return _(T);if(S){d.url&&S.tiles&&d.tiles&&delete d.tiles;const C=s.pick(s.extend(S,d),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);S.vector_layers&&(C.vectorLayers=S.vector_layers,C.vectorLayerIds=C.vectorLayers.map(z=>z.id)),C.tiles=o.canonicalizeTileset(C,d.url),_(null,C)}};return d.url?s.getJSON(o.transformRequest(o.normalizeSourceURL(d.url,null,c,f),s.ResourceType.Source),x):s.exported.frame(()=>x(null,d))}class br{constructor(o,c,f){this.bounds=s.LngLatBounds.convert(this.validateBounds(o)),this.minzoom=c||0,this.maxzoom=f||24}validateBounds(o){return Array.isArray(o)&&o.length===4?[Math.max(-180,o[0]),Math.max(-90,o[1]),Math.min(180,o[2]),Math.min(90,o[3])]:[-180,-90,180,90]}contains(o){const c=Math.pow(2,o.z),f=Math.floor(s.mercatorXfromLng(this.bounds.getWest())*c),_=Math.floor(s.mercatorYfromLat(this.bounds.getNorth())*c),x=Math.ceil(s.mercatorXfromLng(this.bounds.getEast())*c),T=Math.ceil(s.mercatorYfromLat(this.bounds.getSouth())*c);return o.x>=f&&o.x=_&&o.y{this._tileJSONRequest=null,this._loaded=!0,_?(c&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${c}`),f&&f.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${f}`),this.fire(new s.ErrorEvent(_))):x&&(s.extend(this,x),x.bounds&&(this.tileBounds=new br(x.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(x.tiles,this.map._requestManager._customAccessToken),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),o&&o(_)})}loaded(){return this._loaded}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}loadTile(o,c){const f=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme)),_={request:this.map._requestManager.transformRequest(f,s.ResourceType.Tile),data:void 0,uid:o.uid,tileID:o.tileID,tileZoom:o.tileZoom,zoom:o.tileID.overscaledZ,tileSize:this.tileSize*o.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:o.isSymbolTile};if(_.request.collectResourceTiming=this._collectResourceTiming,o.actor&&o.state!=="expired")o.state==="loading"?o.reloadCallback=c:o.request=o.actor.send("reloadTile",_,x.bind(this));else if(o.actor=this._tileWorkers[f]=this._tileWorkers[f]||this.dispatcher.getActor(),this.dispatcher.ready)o.request=o.actor.send("loadTile",_,x.bind(this),void 0,!0);else{const T=s.loadVectorTile.call({deduped:this._deduped},_,(S,C)=>{S||!C?x.call(this,S):(_.data={cacheControl:C.cacheControl,expires:C.expires,rawData:C.rawData.slice(0)},o.actor&&o.actor.send("loadTile",_,x.bind(this),void 0,!0))},!0);o.request={cancel:T}}function x(T,S){return delete o.request,o.aborted?c(null):T&&T.status!==404?c(T):(S&&S.resourceTiming&&(o.resourceTiming=S.resourceTiming),this.map._refreshExpiredTiles&&S&&o.setExpiryData(S),o.loadVectorData(S,this.map.painter),s.cacheEntryPossiblyAdded(this.dispatcher),c(null),void(o.reloadCallback&&(this.loadTile(o,o.reloadCallback),o.reloadCallback=null)))}}abortTile(o){o.request&&(o.request.cancel(),delete o.request),o.actor&&o.actor.send("abortTile",{uid:o.uid,type:this.type,source:this.id})}unloadTile(o){o.unloadVectorData(),o.actor&&o.actor.send("removeTile",{uid:o.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Qe extends s.Evented{constructor(o,c,f,_){super(),this.id=o,this.dispatcher=f,this.setEventedParent(_),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.extend({type:"raster"},c),s.extend(this,s.pick(c,["url","scheme","tileSize"]))}load(o){this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=ar(this._options,this.map._requestManager,null,null,(c,f)=>{this._tileJSONRequest=null,this._loaded=!0,c?this.fire(new s.ErrorEvent(c)):f&&(s.extend(this,f),f.bounds&&(this.tileBounds=new br(f.bounds,this.minzoom,this.maxzoom)),s.postTurnstileEvent(f.tiles),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))),o&&o(c)})}loaded(){return this._loaded}onAdd(o){this.map=o,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(o){return this._options.tiles=o,this.reload(),this}setUrl(o){return this.url=o,this._options.url=o,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return s.extend({},this._options)}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}loadTile(o,c){const f=s.exported.devicePixelRatio>=2,_=this.map._requestManager.normalizeTileURL(o.tileID.canonical.url(this.tiles,this.scheme),f,this.tileSize);o.request=s.getImage(this.map._requestManager.transformRequest(_,s.ResourceType.Tile),(x,T,S,C)=>(delete o.request,o.aborted?(o.state="unloaded",c(null)):x?(o.state="errored",c(x)):T?(this.map._refreshExpiredTiles&&o.setExpiryData({cacheControl:S,expires:C}),o.setTexture(T,this.map.painter),o.state="loaded",s.cacheEntryPossiblyAdded(this.dispatcher),void c(null)):c(null)))}static loadTileData(o,c,f){o.setTexture(c,f)}static unloadTileData(o,c){o.texture&&c.saveTileTexture(o.texture)}abortTile(o,c){o.request&&(o.request.cancel(),delete o.request),c()}unloadTile(o,c){o.texture&&this.map.painter.saveTileTexture(o.texture),c()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Mt(d,o,c,f,_,x,T,S){const C=[d,c,_,o,f,x,1,1,1],z=[T,S,1],P=s.adjoint([],C),[O,j,W]=s.transformMat3(z,z,s.transpose(P,P));return s.multiply$1(C,[O,0,0,0,j,0,0,0,W],C)}class Rt extends s.Evented{constructor(o,c,f,_){super(),this.id=o,this.dispatcher=f,this.coordinates=c.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(_),this.options=c,this._dirty=!1}load(o,c){this._loaded=c||!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=s.getImage(this.map._requestManager.transformRequest(this.url,s.ResourceType.Image),(f,_)=>{if(this._imageRequest=null,this._loaded=!0,f)this.fire(new s.ErrorEvent(f));else if(_){const{HTMLImageElement:x}=s.window;this.image=_ instanceof x?s.exported.getImageData(_):_,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,o&&(this.coordinates=o),this._finishLoading()}})}loaded(){return this._loaded}updateImage(o){return this.image&&o.url?(this._imageRequest&&o.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=o.url,this.load(o.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(o){this.map=o,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(o){this.coordinates=o,this._boundsArray=void 0;const c=o.map(s.MercatorCoordinate.fromLngLat);return this.tileID=function(f){let _=1/0,x=1/0,T=-1/0,S=-1/0;for(const O of f)_=Math.min(_,O.x),x=Math.min(x,O.y),T=Math.max(T,O.x),S=Math.max(S,O.y);const C=Math.max(T-_,S-x),z=Math.max(0,Math.floor(-Math.log(C)/Math.LN2)),P=Math.pow(2,z);return new s.CanonicalTileID(z,Math.floor((_+T)/2*P),Math.floor((x+S)/2*P))}(c),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(o){for(const C in this.tiles){const z=this.tiles[C];z.state!=="loaded"&&(z.state="loaded",z.texture=this.texture)}if(this._boundsArray)return;const c=s.tileTransform(this.tileID,this.map.transform.projection),[f,_,x,T]=this.coordinates.map(C=>{const z=c.projection.project(C[0],C[1]);return s.getTilePoint(c,z)._round()});this.perspectiveTransform=function(C,z,P,O,j,W,H,Z,X,B){const q=Mt(0,0,C,0,0,z,C,z),Q=Mt(P,O,j,W,H,Z,X,B);return s.multiply$1(Q,s.adjoint(q,q),Q),[Q[6]/Q[8]*C/s.EXTENT,Q[7]/Q[8]*z/s.EXTENT]}(this.width,this.height,f.x,f.y,_.x,_.y,T.x,T.y,x.x,x.y);const S=this._boundsArray=new s.StructArrayLayout4i8;S.emplaceBack(f.x,f.y,0,0),S.emplaceBack(_.x,_.y,s.EXTENT,0),S.emplaceBack(T.x,T.y,0,s.EXTENT),S.emplaceBack(x.x,x.y,s.EXTENT,s.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=o.createVertexBuffer(S,s.boundsAttributes.members),this.boundsSegments=s.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const o=this.map.painter.context,c=o.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new s.Texture(o,this.image,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(o)}loadTile(o,c){this.tileID&&this.tileID.equals(o.tileID.canonical)?(this.tiles[String(o.tileID.wrap)]=o,o.buckets={},c(null)):(o.state="errored",c(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Pt={vector:rt,raster:Qe,"raster-dem":class extends Qe{constructor(d,o,c,f){super(d,o,c,f),this.type="raster-dem",this.maxzoom=22,this._options=s.extend({type:"raster-dem"},o),this.encoding=o.encoding||"mapbox"}loadTile(d,o){const c=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function f(_,x){_&&(d.state="errored",o(_)),x&&(d.dem=x,d.dem.onDeserialize(),d.needsHillshadePrepare=!0,d.needsDEMTextureUpload=!0,d.state="loaded",o(null))}d.request=s.getImage(this.map._requestManager.transformRequest(c,s.ResourceType.Tile),(function(_,x,T,S){if(delete d.request,d.aborted)d.state="unloaded",o(null);else if(_)d.state="errored",o(_);else if(x){this.map._refreshExpiredTiles&&d.setExpiryData({cacheControl:T,expires:S});const C=s.window.ImageBitmap&&x instanceof s.window.ImageBitmap&&(ca==null&&(ca=s.window.OffscreenCanvas&&new s.window.OffscreenCanvas(1,1).getContext("2d")&&typeof s.window.createImageBitmap=="function"),ca),z=1-(x.width-s.prevPowerOfTwo(x.width))/2;z<1||d.neighboringTiles||(d.neighboringTiles=this._getNeighboringTiles(d.tileID));const P=C?x:s.exported.getImageData(x,z),O={uid:d.uid,coord:d.tileID,source:this.id,rawImageData:P,encoding:this.encoding,padding:z};d.actor&&d.state!=="expired"||(d.actor=this.dispatcher.getActor(),d.actor.send("loadDEMTile",O,f.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(d){const o=d.canonical,c=Math.pow(2,o.z),f=(o.x-1+c)%c,_=o.x===0?d.wrap-1:d.wrap,x=(o.x+1+c)%c,T=o.x+1===c?d.wrap+1:d.wrap,S={};return S[new s.OverscaledTileID(d.overscaledZ,_,o.z,f,o.y).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,T,o.z,x,o.y).key]={backfilled:!1},o.y>0&&(S[new s.OverscaledTileID(d.overscaledZ,_,o.z,f,o.y-1).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,d.wrap,o.z,o.x,o.y-1).key]={backfilled:!1},S[new s.OverscaledTileID(d.overscaledZ,T,o.z,x,o.y-1).key]={backfilled:!1}),o.y+1{if(this._loaded=!0,this._pendingLoad=null,c)this.fire(new s.ErrorEvent(c));else{const _={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&f&&f.resourceTiming&&f.resourceTiming[this.id]&&(_.resourceTiming=f.resourceTiming[this.id]),this.fire(new s.Event("data",_)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(d,o){const c=d.actor?"reloadTile":"loadTile";d.actor=this.actor,d.request=this.actor.send(c,{type:this.type,uid:d.uid,tileID:d.tileID,tileZoom:d.tileZoom,zoom:d.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:s.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(f,_)=>(delete d.request,d.unloadVectorData(),d.aborted?o(null):f?o(f):(d.loadVectorData(_,this.map.painter,c==="reloadTile"),o(null))),void 0,c==="loadTile")}abortTile(d){d.request&&(d.request.cancel(),delete d.request),d.aborted=!0}unloadTile(d){d.unloadVectorData(),this.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return s.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Rt{constructor(d,o,c,f){super(d,o,c,f),this.roundZoom=!0,this.type="video",this.options=o}load(){this._loaded=!1;const d=this.options;this.urls=[];for(const o of d.urls)this.urls.push(this.map._requestManager.transformRequest(o,s.ResourceType.Source).url);s.getVideo(this.urls,(o,c)=>{this._loaded=!0,o?this.fire(new s.ErrorEvent(o)):c&&(this.video=c,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(d){if(this.video){const o=this.video.seekable;do.end(0)?this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${o.start(0)} and ${o.end(0)}-second mark.`))):this.video.currentTime=d}}getVideo(){return this.video}onAdd(d){this.map||(this.map=d,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const d=this.map.painter.context,o=d.gl;this.texture?this.video.paused||(this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,this.video)):(this.texture=new s.Texture(d,this.video,o.RGBA),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(d)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Rt,canvas:class extends Rt{constructor(d,o,c,f){super(d,o,c,f),o.coordinates?Array.isArray(o.coordinates)&&o.coordinates.length===4&&!o.coordinates.some(_=>!Array.isArray(_)||_.length!==2||_.some(x=>typeof x!="number"))||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'missing required property "coordinates"'))),o.animate&&typeof o.animate!="boolean"&&this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'optional "animate" property must be a boolean value'))),o.canvas?typeof o.canvas=="string"||o.canvas instanceof s.window.HTMLCanvasElement||this.fire(new s.ErrorEvent(new s.ValidationError(`sources.${d}`,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 s.ErrorEvent(new s.ValidationError(`sources.${d}`,null,'missing required property "canvas"'))),this.options=o,this.animate=o.animate===void 0||o.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof s.window.HTMLCanvasElement?this.options.canvas:s.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new s.ErrorEvent(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())}getCanvas(){return this.canvas}onAdd(d){this.map=d,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const o=this.map.painter.context;this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new s.Texture(o,this.canvas,o.gl.RGBA,{premultiply:!0}),this._prepareData(o)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const d of[this.canvas.width,this.canvas.height])if(isNaN(d)||d<=0)return!0;return!1}},custom:class extends s.Evented{constructor(d,o,c,f){super(),this.id=d,this.type="custom",this._dataType="raster",this._dispatcher=c,this._implementation=o,this.setEventedParent(f),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new s.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new s.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new br(this._implementation.bounds,this.minzoom,this.maxzoom)),o.update=this._update.bind(this),o.clearTiles=this._clearTiles.bind(this),o.coveringTiles=this._coveringTiles.bind(this),s.extend(this,s.pick(o,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return s.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new s.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(d){this._map=d,this._loaded=!1,this.fire(new s.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(d),this.load()}onRemove(d){this._implementation.onRemove&&this._implementation.onRemove(d)}hasTile(d){if(this._implementation.hasTile){const{x:o,y:c,z:f}=d.canonical;return this._implementation.hasTile({x:o,y:c,z:f})}return!this.tileBounds||this.tileBounds.contains(d.canonical)}loadTile(d,o){const{x:c,y:f,z:_}=d.tileID.canonical,x=new s.window.AbortController;d.request=Promise.resolve(this._implementation.loadTile({x:c,y:f,z:_},{signal:x.signal})).then((function(T){return delete d.request,d.aborted?(d.state="unloaded",o(null)):T===void 0?(d.state="errored",o(null)):T===null?(this.loadTileData(d,{width:this.tileSize,height:this.tileSize,data:null}),d.state="loaded",o(null)):function(S){return S instanceof s.window.ImageData||S instanceof s.window.HTMLCanvasElement||S instanceof s.window.ImageBitmap||S instanceof s.window.HTMLImageElement}(T)?(this.loadTileData(d,T),d.state="loaded",void o(null)):(d.state="errored",o(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(T=>{T.code!==20&&(d.state="errored",o(T))}),d.request.cancel=()=>x.abort()}loadTileData(d,o){Qe.loadTileData(d,o,this._map.painter)}unloadTileData(d){Qe.unloadTileData(d,this._map.painter)}unloadTile(d,o){if(this.unloadTileData(d),this._implementation.unloadTile){const{x:c,y:f,z:_}=d.tileID.canonical;this._implementation.unloadTile({x:c,y:f,z:_})}o()}abortTile(d,o){d.request&&d.request.cancel&&(d.request.cancel(),delete d.request),o()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(d=>({x:d.canonical.x,y:d.canonical.y,z:d.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new s.Event("data",{dataType:"source",sourceDataType:"content"}))}}},Dt=function(d,o,c,f){const _=new Pt[o.type](d,o,c,f);if(_.id!==d)throw new Error(`Expected Source id to be ${d} instead of ${_.id}`);return s.bindAll(["load","abort","unload","serialize","prepare"],_),_};function Gt(d,o){const c=s.identity([]);return s.scale(c,c,[.5*d.width,.5*-d.height,1]),s.translate(c,c,[1,-1,0]),s.multiply(c,c,d.calculateProjMatrix(o.toUnwrapped())),Float32Array.from(c)}function In(d,o,c,f,_,x,T,S=!1){const C=d.tilesIn(f,T,S);C.sort(Ir);const z=[];for(const O of C)z.push({wrappedTileID:O.tile.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(o,c,d._state,O,_,x,Gt(d.transform,O.tile.tileID),S)});const P=function(O){const j={},W={};for(const H of O){const Z=H.queryResults,X=H.wrappedTileID,B=W[X]=W[X]||{};for(const q in Z){const Q=Z[q],ee=B[q]=B[q]||{},de=j[q]=j[q]||[];for(const fe of Q)ee[fe.featureIndex]||(ee[fe.featureIndex]=!0,de.push(fe))}}return j}(z);for(const O in P)P[O].forEach(j=>{const W=j.feature,H=W.layer;H&&H.type!=="background"&&H.type!=="sky"&&(W.source=H.source,H["source-layer"]&&(W.sourceLayer=H["source-layer"]),W.state=W.id!==void 0?d.getFeatureState(H["source-layer"],W.id):{})});return P}function Vn(d,o){const c=d.getRenderableIds().map(x=>d.getTileByID(x)),f=[],_={};for(let x=0;x{c.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ji]}numActive(){return Object.keys(this.active).length}}let Or;function ha(){return Or||(Or=new hr),Or}function G_(d,o){const c={};for(const f in d)f!=="ref"&&(c[f]=d[f]);return s.refProperties.forEach(f=>{f in o&&(c[f]=o[f])}),c}function lf(d){d=d.slice();const o=Object.create(null);for(let c=0;c0?(_-T)/S:0;return this.points[x].mult(1-C).add(this.points[c].mult(C))}}class Is{constructor(o,c,f){const _=this.boxCells=[],x=this.circleCells=[];this.xCellCount=Math.ceil(o/f),this.yCellCount=Math.ceil(c/f);for(let T=0;Tthis.width||_<0||c>this.height)return!x&&[];const S=[];if(o<=0&&c<=0&&this.width<=f&&this.height<=_){if(x)return!0;for(let C=0;C0:S}_queryCircle(o,c,f,_,x){const T=o-f,S=o+f,C=c-f,z=c+f;if(S<0||T>this.width||z<0||C>this.height)return!_&&[];const P=[];return this._forEachCell(T,C,S,z,this._queryCellCircle,P,{hitTest:_,circle:{x:o,y:c,radius:f},seenUids:{box:{},circle:{}}},x),_?P.length>0:P}query(o,c,f,_,x){return this._query(o,c,f,_,!1,x)}hitTest(o,c,f,_,x){return this._query(o,c,f,_,!0,x)}hitTestCircle(o,c,f,_){return this._queryCircle(o,c,f,!0,_)}_queryCell(o,c,f,_,x,T,S,C){const z=S.seenUids,P=this.boxCells[x];if(P!==null){const j=this.bboxes;for(const W of P)if(!z.box[W]){z.box[W]=!0;const H=4*W;if(o<=j[H+2]&&c<=j[H+3]&&f>=j[H+0]&&_>=j[H+1]&&(!C||C(this.boxKeys[W]))){if(S.hitTest)return T.push(!0),!0;T.push({key:this.boxKeys[W],x1:j[H],y1:j[H+1],x2:j[H+2],y2:j[H+3]})}}}const O=this.circleCells[x];if(O!==null){const j=this.circles;for(const W of O)if(!z.circle[W]){z.circle[W]=!0;const H=3*W;if(this._circleAndRectCollide(j[H],j[H+1],j[H+2],o,c,f,_)&&(!C||C(this.circleKeys[W]))){if(S.hitTest)return T.push(!0),!0;{const Z=j[H],X=j[H+1],B=j[H+2];T.push({key:this.circleKeys[W],x1:Z-B,y1:X-B,x2:Z+B,y2:X+B})}}}}}_queryCellCircle(o,c,f,_,x,T,S,C){const z=S.circle,P=S.seenUids,O=this.boxCells[x];if(O!==null){const W=this.bboxes;for(const H of O)if(!P.box[H]){P.box[H]=!0;const Z=4*H;if(this._circleAndRectCollide(z.x,z.y,z.radius,W[Z+0],W[Z+1],W[Z+2],W[Z+3])&&(!C||C(this.boxKeys[H])))return T.push(!0),!0}}const j=this.circleCells[x];if(j!==null){const W=this.circles;for(const H of j)if(!P.circle[H]){P.circle[H]=!0;const Z=3*H;if(this._circlesCollide(W[Z],W[Z+1],W[Z+2],z.x,z.y,z.radius)&&(!C||C(this.circleKeys[H])))return T.push(!0),!0}}}_forEachCell(o,c,f,_,x,T,S,C){const z=this._convertToXCellCoord(o),P=this._convertToYCellCoord(c),O=this._convertToXCellCoord(f),j=this._convertToYCellCoord(_);for(let W=z;W<=O;W++)for(let H=P;H<=j;H++)if(x.call(this,o,c,f,_,this.xCellCount*H+W,T,S,C))return}_convertToXCellCoord(o){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(o*this.xScale)))}_convertToYCellCoord(o){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(o*this.yScale)))}_circlesCollide(o,c,f,_,x,T){const S=_-o,C=x-c,z=f+T;return z*z>S*S+C*C}_circleAndRectCollide(o,c,f,_,x,T,S){const C=(T-_)/2,z=Math.abs(o-(_+C));if(z>C+f)return!1;const P=(S-x)/2,O=Math.abs(c-(x+P));if(O>P+f)return!1;if(z<=C||O<=P)return!0;const j=z-C,W=O-P;return j*j+W*W<=f*f}}const wo={unknown:0,flipRequired:1,flipNotRequired:2},vl=Math.tan(85*Math.PI/180);function Re(d,o,c,f,_,x,T){const S=s.create();if(c)if(x.name==="globe"){const C=s.calculateGlobeLabelMatrix(_,o);s.multiply(S,S,C)}else{const C=Ve([],T);S[0]=C[0],S[1]=C[1],S[4]=C[2],S[5]=C[3],f||s.rotateZ(S,S,_.angle)}else s.multiply(S,_.labelPlaneMatrix,d);return S}function bo(d,o,c,f,_,x,T){const S=Re(d,o,c,f,_,x,T);return x.name==="globe"&&c||(S[2]=S[6]=S[10]=S[14]=0),S}function $n(d,o,c,f,_,x,T){if(c){if(x.name==="globe"){const S=Re(d,o,c,f,_,x,T);return s.invert(S,S),s.multiply(S,d,S),S}{const S=s.clone(d),C=s.identity([]);return C[0]=T[0],C[1]=T[1],C[4]=T[2],C[5]=T[3],s.multiply(S,S,C),f||s.rotateZ(S,S,-_.angle),S}}return _.glCoordMatrix}function dr(d,o,c,f){const _=[d,o,c,1];c?s.transformMat4$1(_,_,f):Nt(_,_,f);const x=_[3];return _[0]/=x,_[1]/=x,_[2]/=x,_}function cf(d,o){return Math.min(.5+d/o*.5,1.5)}function eo(d,o){const c=d[0]/d[3],f=d[1]/d[3];return c>=-o[0]&&c<=o[0]&&f>=-o[1]&&f<=o[1]}function Sh(d,o,c,f,_,x,T,S,C,z){const P=c.transform,O=f?d.textSizeData:d.iconSizeData,j=s.evaluateSizeForZoom(O,c.transform.zoom),W=P.projection.name==="globe",H=[256/c.width*2+1,256/c.height*2+1],Z=f?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;Z.clear();let X=null;W&&(X=f?d.text.globeExtVertexArray:d.icon.globeExtVertexArray);const B=d.lineVertexArray,q=f?d.text.placedSymbolArray:d.icon.placedSymbolArray,Q=c.transform.width/c.transform.height;let ee,de=!1;for(let fe=0;feMath.abs(c)?{useVertical:!0}:d===s.WritingMode.vertical?f>0?{needsFlipping:!0}:null:o!==wo.unknown&&function(_,x){return _===0||Math.abs(x/_)>vl}(c,f)?o===wo.flipRequired?{needsFlipping:!0}:null:c<0?{needsFlipping:!0}:null}function lt(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B,q){const Q=o/24,ee=d.lineOffsetX*Q,de=d.lineOffsetY*Q,{lineStartIndex:fe,glyphStartIndex:pe,numGlyphs:xe,segment:ye,writingMode:Ae,flipState:We}=d,Ee=fe+d.lineLength,Fe=ke=>{if(P){const[Xe,$e,Ye]=ke.up,gt=z.length;s.updateGlobeVertexNormal(P,gt+0,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+1,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+2,Xe,$e,Ye),s.updateGlobeVertexNormal(P,gt+3,Xe,$e,Ye)}const[qe,Se,Be]=ke.point;s.addDynamicAttributes(z,qe,Se,Be,ke.angle)};if(xe>1){const ke=uf(Q,S,ee,de,c,O,j,d,C,x,W,Z,!1,X,B,q);if(!ke)return{notEnoughRoom:!0};if(f&&!c){let[qe,Se,Be]=ke.first.point,[Xe,$e,Ye]=ke.last.point;[qe,Se]=dr(qe,Se,Be,T),[Xe,$e]=dr(Xe,$e,Ye,T);const gt=da(Ae,We,(Xe-qe)*H,$e-Se);if(d.flipState=gt&>.needsFlipping?wo.flipRequired:wo.flipNotRequired,gt)return gt}Fe(ke.first);for(let qe=pe+1;qe0?Xe:Ft(j,Be,qe,1,_,void 0,X,B.canonical),Ye=da(Ae,We,($e[0]-qe[0])*H,$e[1]-qe[1]);if(d.flipState=Ye&&Ye.needsFlipping?wo.flipRequired:wo.flipNotRequired,Ye)return Ye}const ke=si(Q*S.getoffsetX(pe),ee,de,c,O,j,ye,fe,Ee,C,x,W,Z,!1,!1,X,B,q);if(!ke)return{notEnoughRoom:!0};Fe(ke)}return{}}function $t(d,o,c,f,_){const{x,y:T,z:S}=f.projectTilePoint(d.x,d.y,o);if(!_)return dr(x,T,S,c);const[C,z,P]=_(d);return dr(x+C,T+z,S+P,c)}function Ft(d,o,c,f,_,x,T,S){const C=$t(d.sub(o)._unit()._add(d),S,_,T,x);return s.sub(C,c,C),s.normalize(C,C),s.scaleAndAdd(C,c,C,f)}function si(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B){const q=f?d-o:d+o;let Q=q>0?1:-1,ee=0;f&&(Q*=-1,ee=Math.PI),Q<0&&(ee+=Math.PI);let de=S+T+(Q>0?0:1)|0,fe=_,pe=_,xe=0,ye=0;const Ae=Math.abs(q),We=[],Ee=[];let Fe=x,ke=Fe;const qe=()=>Ft(ke,Fe,pe,Ae-xe+1,P,j,Z,X.canonical);for(;xe+ye<=Ae;){if(de+=Q,de=C)return null;if(pe=fe,ke=Fe,We.push(pe),W&&Ee.push(ke),Fe=new s.Point(z.getx(de),z.gety(de)),fe=O[de],!fe){const wt=$t(Fe,X.canonical,P,Z,j);fe=wt[3]>0?O[de]=wt:qe()}xe+=ye,ye=s.distance(pe,fe)}H&&j&&(O[de]&&(fe=qe(),ye=s.distance(pe,fe)),O[de]=fe);const Se=(Ae-xe)/ye,Be=Fe.sub(ke)._mult(Se)._add(ke),Xe=s.sub([],fe,pe),$e=s.scaleAndAdd([],pe,Xe,Se);let Ye=[0,0,1],gt=Xe[0],Et=Xe[1];if(B&&(Ye=Z.upVector(X.canonical,Be.x,Be.y),Ye[0]!==0||Ye[1]!==0||Ye[2]!==1)){const wt=[Ye[2],0,-Ye[0]],Ut=s.cross([],Ye,wt);s.normalize(wt,wt),s.normalize(Ut,Ut),gt=s.dot(Xe,wt),Et=s.dot(Xe,Ut)}if(c){const wt=s.cross([],Ye,Xe);s.normalize(wt,wt),s.scaleAndAdd($e,$e,wt,c*Q)}const pt=ee+Math.atan2(Et,gt);return We.push($e),W&&Ee.push(Be),{point:$e,angle:pt,path:We,tilePath:Ee,up:Ye}}function Ri(d,o){const c=o.length,f=c+4*d;o.resize(f),o.float32.fill(-1/0,4*c,4*f)}function Nt(d,o,c){const f=o[0],_=o[1];return d[0]=c[0]*f+c[4]*_+c[12],d[1]=c[1]*f+c[5]*_+c[13],d[3]=c[3]*f+c[7]*_+c[15],d}const ai=100;class xl{constructor(o,c,f=new Is(o.width+200,o.height+200,25),_=new Is(o.width+200,o.height+200,25)){this.transform=o,this.grid=f,this.ignoredGrid=_,this.pitchfactor=Math.cos(o._pitch)*o.cameraToCenterDistance,this.screenRightBoundary=o.width+ai,this.screenBottomBoundary=o.height+ai,this.gridRightBoundary=o.width+200,this.gridBottomBoundary=o.height+200,this.fogState=c}placeCollisionBox(o,c,f,_,x,T,S,C){let z=f.projectedAnchorX,P=f.projectedAnchorY,O=f.projectedAnchorZ;const j=f.elevation,W=f.tileID,H=o.getProjection();if(j&&W){const[fe,pe,xe]=H.upVector(W.canonical,f.tileAnchorX,f.tileAnchorY),ye=H.upVectorScale(W.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;z+=fe*j*ye,P+=pe*j*ye,O+=xe*j*ye}const Z=this.projectAndGetPerspectiveRatio(S,z,P,O,f.tileID,H.name==="globe"||!!j||this.transform.pitch>0,H),X=T*Z.perspectiveRatio,B=(f.x1*c+_.x-f.padding)*X+Z.point.x,q=(f.y1*c+_.y-f.padding)*X+Z.point.y,Q=(f.x2*c+_.x+f.padding)*X+Z.point.x,ee=(f.y2*c+_.y+f.padding)*X+Z.point.y,de=Z.perspectiveRatio<=.55||Z.occluded;return!this.isInsideGrid(B,q,Q,ee)||!x&&this.grid.hitTest(B,q,Q,ee,C)||de?{box:[],offscreen:!1,occluded:Z.occluded}:{box:[B,q,Q,ee],offscreen:this.isOffscreen(B,q,Q,ee),occluded:!1}}placeCollisionCircles(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z){const X=[],B=this.transform.elevation,q=o.getProjection(),Q=B?B.getAtTileOffsetFunc(Z,this.transform.center.lat,this.transform.worldSize,q):null,ee=new s.Point(f.tileAnchorX,f.tileAnchorY);let{x:de,y:fe,z:pe}=q.projectTilePoint(ee.x,ee.y,Z.canonical);if(Q){const[Be,Xe,$e]=Q(ee);de+=Be,fe+=Xe,pe+=$e}const xe=q.name==="globe",ye=this.projectAndGetPerspectiveRatio(S,de,fe,pe,Z,xe||!!B||this.transform.pitch>0,q),{perspectiveRatio:Ae}=ye,We=(O?T/Ae:T*Ae)/s.ONE_EM,Ee=dr(de,fe,pe,C),Fe=ye.signedDistanceFromCamera>0?uf(We,x,f.lineOffsetX*We,f.lineOffsetY*We,!1,Ee,ee,f,_,C,{},B&&!O?Q:null,O&&!!B,q,Z,O):null;let ke=!1,qe=!1,Se=!0;if(Fe&&!ye.occluded){const Be=.5*W*Ae+H,Xe=new s.Point(-100,-100),$e=new s.Point(this.screenRightBoundary,this.screenBottomBoundary),Ye=new Th,{first:gt,last:Et}=Fe,pt=gt.path.length;let wt=[];for(let mt=pt-1;mt>=1;mt--)wt.push(gt.path[mt]);for(let mt=1;mt(Q&&!xe&&(rn=Q(onmt[3]<=0)&&(wt=[]));let Ot=[];if(wt.length>0){let mt=1/0,en=-1/0,rn=1/0,on=-1/0;for(const sn of wt)mt=Math.min(mt,sn[0]),rn=Math.min(rn,sn[1]),en=Math.max(en,sn[0]),on=Math.max(on,sn[1]);en>=Xe.x&&mt<=$e.x&&on>=Xe.y&&rn<=$e.y&&(Ot=[wt.map(sn=>new s.Point(sn[0],sn[1]))],(mt$e.x||rn$e.y)&&(Ot=s.clipLine(Ot,Xe.x,Xe.y,$e.x,$e.y)))}for(const mt of Ot){Ye.reset(mt,.25*Be);let en=0;en=Ye.length<=.5*Be?1:Math.ceil(Ye.paddedLength/Ut)+1;for(let rn=0;rn0?(s.transformMat4$1(C,C,o),this.fogState&&x&&S.name!=="globe"&&(z=function(j,W,H,Z,X,B){const q=B.calculateFogTileMatrix(X),Q=[W,H,Z];return s.transformMat4(Q,Q,q),Li(j,Q,B.pitch,B._fov)}(this.fogState,c,f,_,x.toUnwrapped(),this.transform)>.9)):Nt(C,C,o);const P=C[3];return{point:new s.Point((C[0]/P+1)/2*this.transform.width+ai,(-C[1]/P+1)/2*this.transform.height+ai),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(S)/P*.5,1.5),signedDistanceFromCamera:P,occluded:T&&C[2]>P||z}}isOffscreen(o,c,f,_){return f=this.screenRightBoundary||_this.screenBottomBoundary}isInsideGrid(o,c,f,_){return f>=0&&o=0&&cf.collisionGroupID===c}}return this.collisionGroups[o]}}function El(d,o,c,f,_){const{horizontalAlign:x,verticalAlign:T}=s.getAnchorAlignment(d),S=-(x-.5)*o,C=-(T-.5)*c,z=s.evaluateVariableOffset(d,f);return new s.Point(S+z[0]*_,C+z[1]*_)}function Tl(d,o,c,f,_){const x=new s.Point(d,o);return c&&x._rotate(f?_:-_),x}class kc{constructor(o,c,f,_,x){this.transform=o.clone(),this.projection=o.projection.name,this.collisionIndex=new xl(this.transform,x),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new df(f),this.collisionCircleArrays={},this.prevPlacement=_,_&&(_.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(o,c,f,_){const x=f.getBucket(c),T=f.latestFeatureIndex;if(!x||!T||c.id!==x.layerIds[0])return;const S=x.layers[0].layout,C=f.collisionBoxArray,z=Math.pow(2,this.transform.zoom-f.tileID.overscaledZ),P=f.tileSize/s.EXTENT,O=f.tileID.toUnwrapped();this.transform.setProjection(x.projection);const j=(W=f.tileID,H=x.getProjection(),Z=this.transform,H.name===this.projection?Z.calculateProjMatrix(W.toUnwrapped()):ks(Z,H,W));var W,H,Z;const X=S.get("text-pitch-alignment")==="map",B=S.get("text-rotation-alignment")==="map";c.compileFilter();const q=c.dynamicFilter(),Q=c.dynamicFilterNeedsFeature(),ee=this.transform.calculatePixelsToTileUnitsMatrix(f),de=bo(j,f.tileID.canonical,X,B,this.transform,x.getProjection(),ee);let fe=null;if(X){const ye=$n(j,f.tileID.canonical,X,B,this.transform,x.getProjection(),ee);fe=s.multiply([],this.transform.labelPlaneMatrix,ye)}let pe=null;q&&f.latestFeatureIndex&&(pe={unwrappedTileID:O,dynamicFilter:q,dynamicFilterNeedsFeature:Q,featureIndex:f.latestFeatureIndex}),this.retainedQueryData[x.bucketInstanceId]=new Ah(x.bucketInstanceId,T,x.sourceLayerIndex,x.index,f.tileID);const xe={bucket:x,layout:S,posMatrix:j,textLabelPlaneMatrix:de,labelToScreenMatrix:fe,clippingData:pe,scale:z,textPixelRatio:P,holdingForFade:f.holdingForFade(),collisionBoxArray:C,partiallyEvaluatedTextSize:s.evaluateSizeForZoom(x.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:s.evaluateSizeForZoom(x.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(x.sourceID)};if(_)for(const ye of x.sortKeyRanges){const{sortKey:Ae,symbolInstanceStart:We,symbolInstanceEnd:Ee}=ye;o.push({sortKey:Ae,symbolInstanceStart:We,symbolInstanceEnd:Ee,parameters:xe})}else o.push({symbolInstanceStart:0,symbolInstanceEnd:x.symbolInstances.length,parameters:xe})}attemptAnchorPlacement(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z,X,B,q){const{textOffset0:Q,textOffset1:ee,crossTileID:de}=j,fe=[Q,ee],pe=El(o,f,_,fe,x),xe=this.collisionIndex.placeCollisionBox(H,x,c,Tl(pe.x,pe.y,T,S,this.transform.angle),O,C,z,P.predicate);if(X){const ye=H.getSymbolInstanceIconSize(q,this.transform.zoom,j.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(H,ye,X,Tl(pe.x,pe.y,T,S,this.transform.angle),O,C,z,P.predicate).box.length===0)return}if(xe.box.length>0){let ye;return this.prevPlacement&&this.prevPlacement.variableOffsets[de]&&this.prevPlacement.placements[de]&&this.prevPlacement.placements[de].text&&(ye=this.prevPlacement.variableOffsets[de].anchor),this.variableOffsets[de]={textOffset:fe,width:f,height:_,anchor:o,textScale:x,prevAnchor:ye},this.markUsedJustification(H,o,j,Z),H.allowVerticalPlacement&&(this.markUsedOrientation(H,Z,j),this.placedOrientations[de]=Z),{shift:pe,placedGlyphBoxes:xe}}}placeLayerBucketPart(o,c,f,_){const{bucket:x,layout:T,posMatrix:S,textLabelPlaneMatrix:C,labelToScreenMatrix:z,clippingData:P,textPixelRatio:O,holdingForFade:j,collisionBoxArray:W,partiallyEvaluatedTextSize:H,partiallyEvaluatedIconSize:Z,collisionGroup:X}=o.parameters,B=T.get("text-optional"),q=T.get("icon-optional"),Q=T.get("text-allow-overlap"),ee=T.get("icon-allow-overlap"),de=T.get("text-rotation-alignment")==="map",fe=T.get("text-pitch-alignment")==="map",pe=T.get("icon-text-fit")!=="none",xe=T.get("symbol-z-order")==="viewport-y";this.transform.setProjection(x.projection);let ye=Q&&(ee||!x.hasIconData()||q),Ae=ee&&(Q||!x.hasTextData()||B);!x.collisionArrays&&W&&x.deserializeCollisionBoxes(W),f&&_&&x.updateCollisionDebugBuffers(this.transform.zoom,W);const We=(Ee,Fe,ke)=>{const{crossTileID:qe,numVerticalGlyphVertices:Se}=Ee;if(P){const An={zoom:this.transform.zoom,pitch:this.transform.pitch};let an=null;if(P.dynamicFilterNeedsFeature){const Xt=this.retainedQueryData[x.bucketInstanceId];an=P.featureIndex.loadFeature({featureIndex:Ee.featureIndex,bucketIndex:Xt.bucketIndex,sourceLayerIndex:Xt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,P.dynamicFilter)(An,an,this.retainedQueryData[x.bucketInstanceId].tileID.canonical,new s.Point(Ee.tileAnchorX,Ee.tileAnchorY),this.transform.calculateDistanceTileData(P.unwrappedTileID)))return this.placements[qe]=new wl(!1,!1,!1,!0),void c.add(qe)}if(c.has(qe))return;if(j)return void(this.placements[qe]=new wl(!1,!1,!1));let Be=!1,Xe=!1,$e=!0,Ye=!1,gt=!1,Et=null,pt={box:null,offscreen:null,occluded:null},wt={box:null,offscreen:null,occluded:null},Ut=null,Ot=null,mt=null,en=0,rn=0,on=0;ke.textFeatureIndex?en=ke.textFeatureIndex:Ee.useRuntimeCollisionCircles&&(en=Ee.featureIndex),ke.verticalTextFeatureIndex&&(rn=ke.verticalTextFeatureIndex);const sn=An=>{An.tileID=this.retainedQueryData[x.bucketInstanceId].tileID;const an=this.transform.elevation;(an||An.elevation)&&(An.elevation=an?an.getAtTileOffset(An.tileID,An.tileAnchorX,An.tileAnchorY):0)},Mr=ke.textBox;if(Mr){sn(Mr);const An=Xt=>{let Gn=s.WritingMode.horizontal;if(x.allowVerticalPlacement&&!Xt&&this.prevPlacement){const Br=this.prevPlacement.placedOrientations[qe];Br&&(this.placedOrientations[qe]=Br,Gn=Br,this.markUsedOrientation(x,Gn,Ee))}return Gn},an=(Xt,Gn)=>{if(x.allowVerticalPlacement&&Se>0&&ke.verticalTextBox){for(const Br of x.writingModes)if(Br===s.WritingMode.vertical?(pt=Gn(),wt=pt):pt=Xt(),pt&&pt.box&&pt.box.length)break}else pt=Xt()};if(T.get("text-variable-anchor")){let Xt=T.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[qe]){const En=this.prevPlacement.variableOffsets[qe];Xt.indexOf(En.anchor)>0&&(Xt=Xt.filter(Wr=>Wr!==En.anchor),Xt.unshift(En.anchor))}const Gn=(En,Wr,nu)=>{const Bs=x.getSymbolInstanceTextSize(H,Ee,this.transform.zoom,Fe),Gl=(En.x2-En.x1)*Bs+2*En.padding,Mo=(En.y2-En.y1)*Bs+2*En.padding,is=pe&&!ee?Wr:null;is&&sn(is);let Fs={box:[],offscreen:!1,occluded:!1};const ru=Q?2*Xt.length:Xt.length;for(let ql=0;ql=Xt.length,Ee,Fe,x,nu,is,H,Z);if(gd&&(Fs=gd.placedGlyphBoxes,Fs&&Fs.box&&Fs.box.length)){Be=!0,Et=gd.shift;break}}return Fs};an(()=>Gn(Mr,ke.iconBox,s.WritingMode.horizontal),()=>{const En=ke.verticalTextBox;return En&&sn(En),x.allowVerticalPlacement&&!(pt&&pt.box&&pt.box.length)&&Se>0&&En?Gn(En,ke.verticalIconBox,s.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),pt&&(Be=pt.box,$e=pt.offscreen,Ye=pt.occluded);const Br=An(!(!pt||!pt.box));if(!Be&&this.prevPlacement){const En=this.prevPlacement.variableOffsets[qe];En&&(this.variableOffsets[qe]=En,this.markUsedJustification(x,En.anchor,Ee,Br))}}else{const Xt=(Gn,Br)=>{const En=x.getSymbolInstanceTextSize(H,Ee,this.transform.zoom,Fe),Wr=this.collisionIndex.placeCollisionBox(x,En,Gn,new s.Point(0,0),Q,O,S,X.predicate);return Wr&&Wr.box&&Wr.box.length&&(this.markUsedOrientation(x,Br,Ee),this.placedOrientations[qe]=Br),Wr};an(()=>Xt(Mr,s.WritingMode.horizontal),()=>{const Gn=ke.verticalTextBox;return x.allowVerticalPlacement&&Se>0&&Gn?(sn(Gn),Xt(Gn,s.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),An(!!(pt&&pt.box&&pt.box.length))}}if(Ut=pt,Be=Ut&&Ut.box&&Ut.box.length>0,$e=Ut&&Ut.offscreen,Ye=Ut&&Ut.occluded,Ee.useRuntimeCollisionCircles){const An=x.text.placedSymbolArray.get(Ee.centerJustifiedTextSymbolIndex>=0?Ee.centerJustifiedTextSymbolIndex:Ee.verticalPlacedTextSymbolIndex),an=s.evaluateSizeForFeature(x.textSizeData,H,An),Xt=T.get("text-padding");Ot=this.collisionIndex.placeCollisionCircles(x,Q,An,x.lineVertexArray,x.glyphOffsetArray,an,S,C,z,f,fe,X.predicate,Ee.collisionCircleDiameter*an/s.ONE_EM,Xt,this.retainedQueryData[x.bucketInstanceId].tileID),Be=Q||Ot.circles.length>0&&!Ot.collisionDetected,$e=$e&&Ot.offscreen,Ye=Ot.occluded}if(ke.iconFeatureIndex&&(on=ke.iconFeatureIndex),ke.iconBox){const An=an=>{sn(an);const Xt=pe&&Et?Tl(Et.x,Et.y,de,fe,this.transform.angle):new s.Point(0,0),Gn=x.getSymbolInstanceIconSize(Z,this.transform.zoom,Ee.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(x,Gn,an,Xt,ee,O,S,X.predicate)};wt&&wt.box&&wt.box.length&&ke.verticalIconBox?(mt=An(ke.verticalIconBox),Xe=mt.box.length>0):(mt=An(ke.iconBox),Xe=mt.box.length>0),$e=$e&&mt.offscreen,gt=mt.occluded}const fr=B||Ee.numHorizontalGlyphVertices===0&&Se===0,vi=q||Ee.numIconVertices===0;if(fr||vi?vi?fr||(Xe=Xe&&Be):Be=Xe&&Be:Xe=Be=Xe&&Be,Be&&Ut&&Ut.box&&this.collisionIndex.insertCollisionBox(Ut.box,T.get("text-ignore-placement"),x.bucketInstanceId,wt&&wt.box&&rn?rn:en,X.ID),Xe&&mt&&this.collisionIndex.insertCollisionBox(mt.box,T.get("icon-ignore-placement"),x.bucketInstanceId,on,X.ID),Ot&&(Be&&this.collisionIndex.insertCollisionCircles(Ot.circles,T.get("text-ignore-placement"),x.bucketInstanceId,en,X.ID),f)){const An=x.bucketInstanceId;let an=this.collisionCircleArrays[An];an===void 0&&(an=this.collisionCircleArrays[An]=new bl);for(let Xt=0;Xt=0;--Fe){const ke=Ee[Fe];We(x.symbolInstances.get(ke),ke,x.collisionArrays[ke])}}else for(let Ee=o.symbolInstanceStart;Ee=0&&(o.text.placedSymbolArray.get(x).crossTileID=O>=0&&x!==O?0:z),T>=0&&(o.text.placedSymbolArray.get(T).crossTileID=O>=0&&T!==O?0:z),S>=0&&(o.text.placedSymbolArray.get(S).crossTileID=O>=0&&S!==O?0:z),C>=0&&(o.text.placedSymbolArray.get(C).crossTileID=O>=0&&C!==O?0:z)}markUsedOrientation(o,c,f){const _=c===s.WritingMode.horizontal||c===s.WritingMode.horizontalOnly?c:0,x=c===s.WritingMode.vertical?c:0,{leftJustifiedTextSymbolIndex:T,centerJustifiedTextSymbolIndex:S,rightJustifiedTextSymbolIndex:C,verticalPlacedTextSymbolIndex:z}=f,P=o.text.placedSymbolArray;T>=0&&(P.get(T).placedOrientation=_),S>=0&&(P.get(S).placedOrientation=_),C>=0&&(P.get(C).placedOrientation=_),z>=0&&(P.get(z).placedOrientation=x)}commit(o){this.commitTime=o,this.zoomAtLastRecencyCheck=this.transform.zoom;const c=this.prevPlacement;let f=!1;this.prevZoomAdjustment=c?c.zoomAdjustment(this.transform.zoom):0;const _=c?c.symbolFadeChange(o):1,x=c?c.opacities:{},T=c?c.variableOffsets:{},S=c?c.placedOrientations:{};for(const C in this.placements){const z=this.placements[C],P=x[C];P?(this.opacities[C]=new Eo(P,_,z.text,z.icon,null,z.clipped),f=f||z.text!==P.text.placed||z.icon!==P.icon.placed):(this.opacities[C]=new Eo(null,_,z.text,z.icon,z.skipFade,z.clipped),f=f||z.text||z.icon)}for(const C in x){const z=x[C];if(!this.opacities[C]){const P=new Eo(z,_,!1,!1);P.isHidden()||(this.opacities[C]=P,f=f||z.text.placed||z.icon.placed)}}for(const C in T)this.variableOffsets[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.variableOffsets[C]=T[C]);for(const C in S)this.placedOrientations[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.placedOrientations[C]=S[C]);f?this.lastPlacementChangeTime=o:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=c?c.lastPlacementChangeTime:o)}updateLayerOpacities(o,c){const f=new Set;for(const _ of c){const x=_.getBucket(o);x&&_.latestFeatureIndex&&o.id===x.layerIds[0]&&this.updateBucketOpacities(x,f,_.collisionBoxArray)}}updateBucketOpacities(o,c,f){o.hasTextData()&&o.text.opacityVertexArray.clear(),o.hasIconData()&&o.icon.opacityVertexArray.clear(),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexArray.clear(),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexArray.clear();const _=o.layers[0].layout,x=!!o.layers[0].dynamicFilter(),T=new Eo(null,0,!1,!1,!0),S=_.get("text-allow-overlap"),C=_.get("icon-allow-overlap"),z=_.get("text-variable-anchor"),P=_.get("text-rotation-alignment")==="map",O=_.get("text-pitch-alignment")==="map",j=_.get("icon-text-fit")!=="none",W=new Eo(null,0,S&&(C||!o.hasIconData()||_.get("icon-optional")),C&&(S||!o.hasTextData()||_.get("text-optional")),!0);!o.collisionArrays&&f&&(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData())&&o.deserializeCollisionBoxes(f);const H=(X,B,q)=>{for(let Q=0;Q0||Q>0,ye=de>0,Ae=this.placedOrientations[ee],We=Ae===s.WritingMode.vertical,Ee=Ae===s.WritingMode.horizontal||Ae===s.WritingMode.horizontalOnly;if(!xe&&!ye||pe.isHidden()||Z++,xe){const Fe=Sl(pe.text);H(o.text,q,We?Ln:Fe),H(o.text,Q,Ee?Ln:Fe);const ke=pe.text.isHidden(),{leftJustifiedTextSymbolIndex:qe,centerJustifiedTextSymbolIndex:Se,rightJustifiedTextSymbolIndex:Be,verticalPlacedTextSymbolIndex:Xe}=B,$e=o.text.placedSymbolArray,Ye=ke||We?1:0;qe>=0&&($e.get(qe).hidden=Ye),Se>=0&&($e.get(Se).hidden=Ye),Be>=0&&($e.get(Be).hidden=Ye),Xe>=0&&($e.get(Xe).hidden=ke||Ee?1:0);const gt=this.variableOffsets[ee];gt&&this.markUsedJustification(o,gt.anchor,B,Ae);const Et=this.placedOrientations[ee];Et&&(this.markUsedJustification(o,"left",B,Et),this.markUsedOrientation(o,Et,B))}if(ye){const Fe=Sl(pe.icon),{placedIconSymbolIndex:ke,verticalPlacedIconSymbolIndex:qe}=B,Se=o.icon.placedSymbolArray,Be=pe.icon.isHidden()?1:0;ke>=0&&(H(o.icon,de,We?Ln:Fe),Se.get(ke).hidden=Be),qe>=0&&(H(o.icon,B.numVerticalIconVertices,Ee?Ln:Fe),Se.get(qe).hidden=Be)}if(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData()){const Fe=o.collisionArrays[X];if(Fe){let ke=new s.Point(0,0),qe=!0;if(Fe.textBox||Fe.verticalTextBox){if(z){const Be=this.variableOffsets[ee];Be?(ke=El(Be.anchor,Be.width,Be.height,Be.textOffset,Be.textScale),P&&ke._rotate(O?this.transform.angle:-this.transform.angle)):qe=!1}x&&(qe=!pe.clipped),Fe.textBox&&pa(o.textCollisionBox.collisionVertexArray,pe.text.placed,!qe||We,ke.x,ke.y),Fe.verticalTextBox&&pa(o.textCollisionBox.collisionVertexArray,pe.text.placed,!qe||Ee,ke.x,ke.y)}const Se=qe&&!!(!Ee&&Fe.verticalIconBox);Fe.iconBox&&pa(o.iconCollisionBox.collisionVertexArray,pe.icon.placed,Se,j?ke.x:0,j?ke.y:0),Fe.verticalIconBox&&pa(o.iconCollisionBox.collisionVertexArray,pe.icon.placed,!Se,j?ke.x:0,j?ke.y:0)}}}if(o.fullyClipped=Z===0,o.sortFeatures(this.transform.angle),this.retainedQueryData[o.bucketInstanceId]&&(this.retainedQueryData[o.bucketInstanceId].featureSortOrder=o.featureSortOrder),o.hasTextData()&&o.text.opacityVertexBuffer&&o.text.opacityVertexBuffer.updateData(o.text.opacityVertexArray),o.hasIconData()&&o.icon.opacityVertexBuffer&&o.icon.opacityVertexBuffer.updateData(o.icon.opacityVertexArray),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexBuffer&&o.iconCollisionBox.collisionVertexBuffer.updateData(o.iconCollisionBox.collisionVertexArray),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexBuffer&&o.textCollisionBox.collisionVertexBuffer.updateData(o.textCollisionBox.collisionVertexArray),o.bucketInstanceId in this.collisionCircleArrays){const X=this.collisionCircleArrays[o.bucketInstanceId];o.placementInvProjMatrix=X.invProjMatrix,o.placementViewportMatrix=X.viewportMatrix,o.collisionCircleArray=X.circles,delete this.collisionCircleArrays[o.bucketInstanceId]}}symbolFadeChange(o){return this.fadeDuration===0?1:(o-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(o){return Math.max(0,(this.transform.zoom-o)/1.5)}hasTransitions(o){return this.stale||o-this.lastPlacementChangeTimeo}setStale(){this.stale=!0}}function pa(d,o,c,f,_){d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0),d.emplaceBack(o?1:0,c?1:0,f||0,_||0)}const Gr=Math.pow(2,25),Fn=Math.pow(2,24),Ch=Math.pow(2,17),Ih=Math.pow(2,16),qr=Math.pow(2,9),gi=Math.pow(2,8),pf=Math.pow(2,1);function Sl(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;const o=d.placed?1:0,c=Math.floor(127*d.opacity);return c*Gr+o*Fn+c*Ch+o*Ih+c*qr+o*gi+c*pf+o}const Ln=0;class Al{constructor(o){this._sortAcrossTiles=o.layout.get("symbol-z-order")!=="viewport-y"&&o.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(o,c,f,_,x){const T=this._bucketParts;for(;this._currentTileIndexS.sortKey-C.sortKey));this._currentPartIndex{const T=s.exported.now()-_;return!this._forceFullPlacement&&T>2};for(;this._currentPlacementIndex>=0;){const T=c[o[this._currentPlacementIndex]],S=this.placement.collisionIndex.transform.zoom;if(T.type==="symbol"&&(!T.minzoom||T.minzoom<=S)&&(!T.maxzoom||T.maxzoom>S)){if(this._inProgressLayer||(this._inProgressLayer=new Al(T)),this._inProgressLayer.continuePlacement(f[T.source],this.placement,this._showCollisionBoxes,T,x))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(o){return this.placement.commit(o),this.placement}}const Ms=512/s.EXTENT/2;class Er{constructor(o,c,f){this.tileID=o,this.bucketInstanceId=f,this.index=new s.KDBush(c.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const _=o.canonical.x*s.EXTENT,x=o.canonical.y*s.EXTENT;for(let T=0;To.overscaledZ)for(const S in T){const C=T[S];C.tileID.isChildOf(o)&&C.findMatches(c.symbolInstances,o,_)}else{const S=T[o.scaledTo(Number(x)).key];S&&S.findMatches(c.symbolInstances,o,_)}}for(let x=0;x{c[f]=!0});for(const f in this.layerIndexes)c[f]||delete this.layerIndexes[f]}}const ns=(d,o)=>s.emitValidationErrors(d,o&&o.filter(c=>c.identifier!=="source.canvas")),Mc=s.pick(Jt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),q_=s.pick(Jt,["setCenter","setZoom","setBearing","setPitch"]),zh={version:8,layers:[],sources:{}},fa={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class to extends s.Evented{constructor(o,c={}){super(),this.map=o,this.dispatcher=new xt(ha(),this),this.imageManager=new wr,this.imageManager.setEventedParent(this),this.glyphManager=new s.GlyphManager(o._requestManager,c.localFontFamily?s.LocalGlyphMode.all:c.localIdeographFontFamily?s.LocalGlyphMode.ideographs:s.LocalGlyphMode.none,c.localFontFamily||c.localIdeographFontFamily),this.crossTileSymbolIndex=new To,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",s.getReferrer());const f=this;this._rtlTextPluginCallback=to.registerForPluginStateChange(_=>{f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:_.pluginStatus,pluginURL:_.pluginURL},(x,T)=>{if(s.triggerPluginCompletionEvent(x),T&&T.every(S=>S))for(const S in f._sourceCaches){const C=f._sourceCaches[S],z=C.getSource().type;z!=="vector"&&z!=="geojson"||C.reload()}})}),this.on("data",_=>{if(_.dataType!=="source"||_.sourceDataType!=="metadata")return;const x=this.getSource(_.sourceId);if(x&&x.vectorLayerIds)for(const T in this._layers){const S=this._layers[T];S.source===x.id&&this._validateLayer(S)}})}loadURL(o,c={}){this.fire(new s.Event("dataloading",{dataType:"style"}));const f=typeof c.validate=="boolean"?c.validate:!s.isMapboxURL(o);o=this.map._requestManager.normalizeStyleURL(o,c.accessToken);const _=this.map._requestManager.transformRequest(o,s.ResourceType.Style);this._request=s.getJSON(_,(x,T)=>{this._request=null,x?this.fire(new s.ErrorEvent(x)):T&&this._load(T,f)})}loadJSON(o,c={}){this.fire(new s.Event("dataloading",{dataType:"style"})),this._request=s.exported.frame(()=>{this._request=null,this._load(o,c.validate!==!1)})}loadEmpty(){this.fire(new s.Event("dataloading",{dataType:"style"})),this._load(zh,!1)}_updateLayerCount(o,c){const f=c?1:-1;o.is3D()&&(this._num3DLayers+=f),o.type==="circle"&&(this._numCircleLayers+=f),o.type==="symbol"&&(this._numSymbolLayers+=f)}_load(o,c){if(c&&ns(this,s.validateStyle(o)))return;this._loaded=!0,this.stylesheet=s.clone$1(o),this._updateMapProjection();for(const _ in o.sources)this.addSource(_,o.sources[_],{validate:!1});this._changed=!1,o.sprite?this._loadSprite(o.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(o.glyphs);const f=lf(this.stylesheet.layers);this._order=f.map(_=>_.id),this._layers={},this._serializedLayers={};for(const _ of f){const x=s.createStyleLayer(_);x.setEventedParent(this,{layer:{id:x.id}}),this._layers[x.id]=x,this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Vt(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new s.Event("data",{dataType:"style"})),this.fire(new s.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(o){o?this.stylesheet.projection=o:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(o){this._spriteRequest=function(c,f,_){let x,T,S;const C=s.exported.devicePixelRatio>1?"@2x":"";let z=s.getJSON(f.transformRequest(f.normalizeSpriteURL(c,C,".json"),s.ResourceType.SpriteJSON),(j,W)=>{z=null,S||(S=j,x=W,O())}),P=s.getImage(f.transformRequest(f.normalizeSpriteURL(c,C,".png"),s.ResourceType.SpriteImage),(j,W)=>{P=null,S||(S=j,T=W,O())});function O(){if(S)_(S);else if(x&&T){const j=s.exported.getImageData(T),W={};for(const H in x){const{width:Z,height:X,x:B,y:q,sdf:Q,pixelRatio:ee,stretchX:de,stretchY:fe,content:pe}=x[H],xe=new s.RGBAImage({width:Z,height:X});s.RGBAImage.copy(j,xe,{x:B,y:q},{x:0,y:0},{width:Z,height:X}),W[H]={data:xe,pixelRatio:ee,sdf:Q,stretchX:de,stretchY:fe,content:pe}}_(null,W)}}return{cancel(){z&&(z.cancel(),z=null),P&&(P.cancel(),P=null)}}}(o,this.map._requestManager,(c,f)=>{if(this._spriteRequest=null,c)this.fire(new s.ErrorEvent(c));else if(f)for(const _ in f)this.imageManager.addImage(_,f[_]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new s.Event("data",{dataType:"style"}))})}_validateLayer(o){const c=this.getSource(o.source);if(!c)return;const f=o.sourceLayer;f&&(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(f)===-1)&&this.fire(new s.ErrorEvent(new Error(`Source layer "${f}" does not exist on source "${c.id}" as specified by style layer "${o.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const o in this._sourceCaches)if(!this._sourceCaches[o].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(o){const c=[];for(const f of o){const _=this._layers[f];_.type!=="custom"&&c.push(_.serialize())}return c}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const o in this._sourceCaches)if(this._sourceCaches[o].hasTransition())return!0;for(const o in this._layers)if(this._layers[o].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(o){return!!this.terrain&&(typeof o.isLayerDraped=="function"?o.isLayerDraped():fa[o.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(o){if(!this._loaded)return;const c=this._changed;if(this._changed){const _=Object.keys(this._updatedLayers),x=Object.keys(this._removedLayers);(_.length||x.length)&&this._updateWorkerLayers(_,x);for(const T in this._updatedSources){const S=this._updatedSources[T];S==="reload"?this._reloadSource(T):S==="clear"&&this._clearSource(T)}this._updateTilesForChangedImages();for(const T in this._updatedPaintProps)this._layers[T].updateTransitions(o);this.light.updateTransitions(o),this.fog&&this.fog.updateTransitions(o),this._resetUpdates()}const f={};for(const _ in this._sourceCaches){const x=this._sourceCaches[_];f[_]=x.used,x.used=!1}for(const _ of this._order){const x=this._layers[_];if(x.recalculate(o,this._availableImages),!x.isHidden(o.zoom)){const S=this._getLayerSourceCache(x);S&&(S.used=!0)}const T=this.map.painter;if(T){const S=x.getProgramIds();if(!S)continue;const C=x.getProgramConfiguration(o.zoom);for(const z of S)T.useProgram(z,C)}}for(const _ in f){const x=this._sourceCaches[_];f[_]!==x.used&&x.getSource().fire(new s.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:x.getSource().id}))}this.light.recalculate(o),this.terrain&&this.terrain.recalculate(o),this.fog&&this.fog.recalculate(o),this.z=o.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),c&&this.fire(new s.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const o=Object.keys(this._changedImages);if(o.length){for(const c in this._sourceCaches)this._sourceCaches[c].reloadTilesForDependencies(["icons","patterns"],o);this._changedImages={}}}_updateWorkerLayers(o,c){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(o),removedIds:c})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(o){if(this._checkLoaded(),ns(this,s.validateStyle(o)))return!1;(o=s.clone$1(o)).layers=lf(o.layers);const c=function(_,x){if(!_)return[{command:Jt.setStyle,args:[x]}];let T=[];try{if(!k(_.version,x.version))return[{command:Jt.setStyle,args:[x]}];k(_.center,x.center)||T.push({command:Jt.setCenter,args:[x.center]}),k(_.zoom,x.zoom)||T.push({command:Jt.setZoom,args:[x.zoom]}),k(_.bearing,x.bearing)||T.push({command:Jt.setBearing,args:[x.bearing]}),k(_.pitch,x.pitch)||T.push({command:Jt.setPitch,args:[x.pitch]}),k(_.sprite,x.sprite)||T.push({command:Jt.setSprite,args:[x.sprite]}),k(_.glyphs,x.glyphs)||T.push({command:Jt.setGlyphs,args:[x.glyphs]}),k(_.transition,x.transition)||T.push({command:Jt.setTransition,args:[x.transition]}),k(_.light,x.light)||T.push({command:Jt.setLight,args:[x.light]}),k(_.fog,x.fog)||T.push({command:Jt.setFog,args:[x.fog]}),k(_.projection,x.projection)||T.push({command:Jt.setProjection,args:[x.projection]});const S={},C=[];(function(O,j,W,H){let Z;for(Z in j=j||{},O=O||{})O.hasOwnProperty(Z)&&(j.hasOwnProperty(Z)||yl(Z,W,H));for(Z in j){if(!j.hasOwnProperty(Z))continue;const X=j[Z];O.hasOwnProperty(Z)?k(O[Z],X)||(O[Z].type==="geojson"&&X.type==="geojson"&&Ic(O,j,Z)?W.push({command:Jt.setGeoJSONSourceData,args:[Z,X.data]}):bh(Z,j,W,H)):wh(Z,j,W)}})(_.sources,x.sources,C,S);const z=[];_.layers&&_.layers.forEach(O=>{O.source&&S[O.source]?T.push({command:Jt.removeLayer,args:[O.id]}):z.push(O)});let P=_.terrain;P&&S[P.source]&&(T.push({command:Jt.setTerrain,args:[void 0]}),P=void 0),T=T.concat(C),k(P,x.terrain)||T.push({command:Jt.setTerrain,args:[x.terrain]}),function(O,j,W){j=j||[];const H=(O=O||[]).map(xo),Z=j.map(xo),X=O.reduce(Eh,{}),B=j.reduce(Eh,{}),q=H.slice(),Q=Object.create(null);let ee,de,fe,pe,xe,ye,Ae;for(ee=0,de=0;ee!(_.command in q_));if(c.length===0)return!1;const f=c.filter(_=>!(_.command in Mc));if(f.length>0)throw new Error(`Unimplemented: ${f.map(_=>_.command).join(", ")}.`);return c.forEach(_=>{_.command!=="setTransition"&&_.command!=="setProjection"&&this[_.command].apply(this,_.args)}),this.stylesheet=o,this._updateMapProjection(),!0}addImage(o,c){return this.getImage(o)?this.fire(new s.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(o,c),this._afterImageUpdated(o),this)}updateImage(o,c){this.imageManager.updateImage(o,c)}getImage(o){return this.imageManager.getImage(o)}removeImage(o){return this.getImage(o)?(this.imageManager.removeImage(o),this._afterImageUpdated(o),this):this.fire(new s.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(o){this._availableImages=this.imageManager.listImages(),this._changedImages[o]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new s.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(o,c,f={}){if(this._checkLoaded(),this.getSource(o)!==void 0)throw new Error("There is already a source with this ID");if(!c.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(c).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(c.type)>=0&&this._validate(s.validateSource,`sources.${o}`,c,null,f))return;this.map&&this.map._collectResourceTiming&&(c.collectResourceTiming=!0);const _=Dt(o,c,this.dispatcher,this);_.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(o),source:_.serialize(),sourceId:o}));const x=T=>{const S=(T?"symbol:":"other:")+o,C=this._sourceCaches[S]=new s.SourceCache(S,_,T);(T?this._symbolSourceCaches:this._otherSourceCaches)[o]=C,C.style=this,C.onAdd(this.map)};x(!1),c.type!=="vector"&&c.type!=="geojson"||x(!0),_.onAdd&&_.onAdd(this.map),this._changed=!0}removeSource(o){this._checkLoaded();const c=this.getSource(o);if(!c)throw new Error("There is no source with this ID");for(const _ in this._layers)if(this._layers[_].source===o)return this.fire(new s.ErrorEvent(new Error(`Source "${o}" cannot be removed while layer "${_}" is using it.`)));if(this.terrain&&this.terrain.get().source===o)return this.fire(new s.ErrorEvent(new Error(`Source "${o}" cannot be removed while terrain is using it.`)));const f=this._getSourceCaches(o);for(const _ of f)delete this._sourceCaches[_.id],delete this._updatedSources[_.id],_.fire(new s.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:_.getSource().id})),_.setEventedParent(null),_.clearTiles();return delete this._otherSourceCaches[o],delete this._symbolSourceCaches[o],c.setEventedParent(null),c.onRemove&&c.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(o,c){this._checkLoaded(),this.getSource(o).setData(c),this._changed=!0}getSource(o){const c=this._getSourceCache(o);return c&&c.getSource()}_getSources(){const o=[];for(const c in this._otherSourceCaches){const f=this._getSourceCache(c);f&&o.push(f.getSource())}return o}addLayer(o,c,f={}){this._checkLoaded();const _=o.id;if(this.getLayer(_))return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${_}" already exists on this map`)));let x;if(o.type==="custom"){if(ns(this,s.validateCustomStyleLayer(o)))return;x=s.createStyleLayer(o)}else{if(typeof o.source=="object"&&(this.addSource(_,o.source),o=s.clone$1(o),o=s.extend(o,{source:_})),this._validate(s.validateLayer,`layers.${_}`,o,{arrayIndex:-1},f))return;x=s.createStyleLayer(o),this._validateLayer(x),x.setEventedParent(this,{layer:{id:_}}),this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}const T=c?this._order.indexOf(c):this._order.length;if(c&&T===-1)return void this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`)));this._order.splice(T,0,_),this._layerOrderChanged=!0,this._layers[_]=x;const S=this._getLayerSourceCache(x);if(this._removedLayers[_]&&x.source&&S&&x.type!=="custom"){const C=this._removedLayers[_];delete this._removedLayers[_],C.type!==x.type?this._updatedSources[x.source]="clear":(this._updatedSources[x.source]="reload",S.pause())}this._updateLayer(x),x.onAdd&&x.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(o,c){if(this._checkLoaded(),this._changed=!0,!this._layers[o])return void this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be moved.`)));if(o===c)return;const f=this._order.indexOf(o);this._order.splice(f,1);const _=c?this._order.indexOf(c):this._order.length;c&&_===-1?this.fire(new s.ErrorEvent(new Error(`Layer with id "${c}" does not exist on this map.`))):(this._order.splice(_,0,o),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(o){this._checkLoaded();const c=this._layers[o];if(!c)return void this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be removed.`)));c.setEventedParent(null),this._updateLayerCount(c,!1);const f=this._order.indexOf(o);this._order.splice(f,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[o]=c,delete this._layers[o],delete this._serializedLayers[o],delete this._updatedLayers[o],delete this._updatedPaintProps[o],c.onRemove&&c.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(o){return this._layers[o]}hasLayer(o){return o in this._layers}hasLayerType(o){for(const c in this._layers)if(this._layers[c].type===o)return!0;return!1}setLayerZoomRange(o,c,f){this._checkLoaded();const _=this.getLayer(o);_?_.minzoom===c&&_.maxzoom===f||(c!=null&&(_.minzoom=c),f!=null&&(_.maxzoom=f),this._updateLayer(_)):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(o,c,f={}){this._checkLoaded();const _=this.getLayer(o);if(_){if(!k(_.filter,c))return c==null?(_.filter=void 0,void this._updateLayer(_)):void(this._validate(s.validateFilter,`layers.${_.id}.filter`,c,{layerType:_.type},f)||(_.filter=s.clone$1(c),this._updateLayer(_)))}else this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be filtered.`)))}getFilter(o){const c=this.getLayer(o);return c&&s.clone$1(c.filter)}setLayoutProperty(o,c,f,_={}){this._checkLoaded();const x=this.getLayer(o);x?k(x.getLayoutProperty(c),f)||(x.setLayoutProperty(c,f,_),this._updateLayer(x)):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(o,c){const f=this.getLayer(o);if(f)return f.getLayoutProperty(c);this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style.`)))}setPaintProperty(o,c,f,_={}){this._checkLoaded();const x=this.getLayer(o);x?k(x.getPaintProperty(c),f)||(x.setPaintProperty(c,f,_)&&this._updateLayer(x),this._changed=!0,this._updatedPaintProps[o]=!0):this.fire(new s.ErrorEvent(new Error(`The layer '${o}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(o,c){const f=this.getLayer(o);return f&&f.getPaintProperty(c)}setFeatureState(o,c){this._checkLoaded();const f=o.source,_=o.sourceLayer,x=this.getSource(f);if(!x)return void this.fire(new s.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)));const T=x.type;if(T==="geojson"&&_)return void this.fire(new s.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(T==="vector"&&!_)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));o.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided.")));const S=this._getSourceCaches(f);for(const C of S)C.setFeatureState(_,o.id,c)}removeFeatureState(o,c){this._checkLoaded();const f=o.source,_=this.getSource(f);if(!_)return void this.fire(new s.ErrorEvent(new Error(`The source '${f}' does not exist in the map's style.`)));const x=_.type,T=x==="vector"?o.sourceLayer:void 0;if(x==="vector"&&!T)return void this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(c&&typeof o.id!="string"&&typeof o.id!="number")return void this.fire(new s.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const S=this._getSourceCaches(f);for(const C of S)C.removeFeatureState(T,o.id,c)}getFeatureState(o){this._checkLoaded();const c=o.source,f=o.sourceLayer,_=this.getSource(c);if(_){if(_.type!=="vector"||f)return o.id===void 0&&this.fire(new s.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(c)[0].getFeatureState(f,o.id);this.fire(new s.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new s.ErrorEvent(new Error(`The source '${c}' does not exist in the map's style.`)))}getTransition(){return s.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const o={};for(const c in this._sourceCaches){const f=this._sourceCaches[c].getSource();o[f.id]||(o[f.id]=f.serialize())}return s.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:o,layers:this._serializeLayers(this._order)},c=>c!==void 0)}_updateLayer(o){this._updatedLayers[o.id]=!0;const c=this._getLayerSourceCache(o);o.source&&!this._updatedSources[o.source]&&c&&c.getSource().type!=="raster"&&(this._updatedSources[o.source]="reload",c.pause()),this._changed=!0,o.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(o){const c=T=>this._layers[T].type==="fill-extrusion",f={},_=[];for(let T=this._order.length-1;T>=0;T--){const S=this._order[T];if(c(S)){f[S]=T;for(const C of o){const z=C[S];if(z)for(const P of z)_.push(P)}}}_.sort((T,S)=>S.intersectionZ-T.intersectionZ);const x=[];for(let T=this._order.length-1;T>=0;T--){const S=this._order[T];if(c(S))for(let C=_.length-1;C>=0;C--){const z=_[C].feature;if(f[z.layer.id]{const z=this.getLayer(C);return z&&z.is3D()}):this.has3DLayers(),S=dn.createFromScreenPoints(o,f);for(const C in this._sourceCaches){const z=this._sourceCaches[C].getSource().id;c.layers&&!_[z]||x.push(In(this._sourceCaches[C],this._layers,this._serializedLayers,S,c,f,T,!!this.map._showQueryGeometry))}return this.placement&&x.push(function(C,z,P,O,j,W,H){const Z={},X=W.queryRenderedSymbols(O),B=[];for(const q of Object.keys(X).map(Number))B.push(H[q]);B.sort(Ir);for(const q of B){const Q=q.featureIndex.lookupSymbolFeatures(X[q.bucketInstanceId],z,q.bucketIndex,q.sourceLayerIndex,j.filter,j.layers,j.availableImages,C);for(const ee in Q){const de=Z[ee]=Z[ee]||[],fe=Q[ee];fe.sort((pe,xe)=>{const ye=q.featureSortOrder;if(ye){const Ae=ye.indexOf(pe.featureIndex);return ye.indexOf(xe.featureIndex)-Ae}return xe.featureIndex-pe.featureIndex});for(const pe of fe)de.push(pe)}}for(const q in Z)Z[q].forEach(Q=>{const ee=Q.feature,de=P(C[q]);if(!de)return;const fe=de.getFeatureState(ee.layer["source-layer"],ee.id);ee.source=ee.layer.source,ee.layer["source-layer"]&&(ee.sourceLayer=ee.layer["source-layer"]),ee.state=fe});return Z}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),S.screenGeometry,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(x)}querySourceFeatures(o,c){c&&c.filter&&this._validate(s.validateFilter,"querySourceFeatures.filter",c.filter,null,c);const f=this._getSourceCaches(o);let _=[];for(const x of f)_=_.concat(Vn(x,c));return _}addSourceType(o,c,f){return to.getSourceType(o)?f(new Error(`A source type called "${o}" already exists.`)):(to.setSourceType(o,c),c.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:o,url:c.workerSourceURL},f):f(null,null))}getLight(){return this.light.getLight()}setLight(o,c={}){this._checkLoaded();const f=this.light.getLight();let _=!1;for(const T in o)if(!k(o[T],f[T])){_=!0;break}if(!_)return;const x=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(o,c),this.light.updateTransitions(x)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(o,c=1){if(this._checkLoaded(),!o)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let f=o;if(c===1){if(typeof f.source=="object"){const _="terrain-dem-src";this.addSource(_,f.source),f=s.clone$1(f),f=s.extend(f,{source:_})}if(this._validate(s.validateTerrain,"terrain",f))return}if(!this.terrain||this.terrain&&c!==this.terrain.drapeRenderMode){if(!f)return;this._createTerrain(f,c)}else{const _=this.terrain,x=_.get();for(const T of Object.keys(s.spec.terrain))!f.hasOwnProperty(T)&&s.spec.terrain[T].default&&(f[T]=s.spec.terrain[T].default);for(const T in f)if(!k(f[T],x[T])){_.set(f),this.stylesheet.terrain=f;const S=this._setTransitionParameters({duration:0});_.updateTransitions(S);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(o){const c=this.fog=new Tt(o,this.map.transform);this.stylesheet.fog=o;const f=this._setTransitionParameters({duration:0});c.updateTransitions(f)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const o of this.map._markers)o._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(o){if(this._checkLoaded(),!o)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const c=this.fog,f=c.get();Object.keys(o).length===0&&c.set(o);for(const _ in o)if(!k(o[_],f[_])){c.set(o),this.stylesheet.fog=o;const x=this._setTransitionParameters({duration:0});c.updateTransitions(x);break}}else this._createFog(o);this._markersNeedUpdate=!0}_setTransitionParameters(o){return{now:s.exported.now(),transition:s.extend(o,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const o=this._order.filter(f=>this.isLayerDraped(this._layers[f])),c=this._order.filter(f=>!this.isLayerDraped(this._layers[f]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...o),this._drapedFirstOrder.push(...c)}_createTerrain(o,c){const f=this.terrain=new $r(o,c);this.stylesheet.terrain=o,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const _=this._setTransitionParameters({duration:0});f.updateTransitions(_)}_force3DLayerUpdate(){for(const o in this._layers){const c=this._layers[o];c.type==="fill-extrusion"&&this._updateLayer(c)}}_forceSymbolLayerUpdate(){for(const o in this._layers){const c=this._layers[o];c.type==="symbol"&&this._updateLayer(c)}}_validate(o,c,f,_,x={}){return(!x||x.validate!==!1)&&ns(this,o.call(s.validateStyle,s.extend({key:c,style:this.serialize(),value:f,styleSpec:s.spec},_)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),s.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const o in this._layers)this._layers[o].setEventedParent(null);for(const o in this._sourceCaches)this._sourceCaches[o].clearTiles(),this._sourceCaches[o].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(o){const c=this._getSourceCaches(o);for(const f of c)f.clearTiles()}_reloadSource(o){const c=this._getSourceCaches(o);for(const f of c)f.resume(),f.reload()}_reloadSources(){for(const o of this._getSources())o.reload&&o.reload()}_updateSources(o){for(const c in this._sourceCaches)this._sourceCaches[c].update(o)}_generateCollisionBoxes(){for(const o in this._sourceCaches){const c=this._sourceCaches[o];c.resume(),c.reload()}}_updatePlacement(o,c,f,_,x=!1){let T=!1,S=!1;const C={};for(const z of this._order){const P=this._layers[z];if(P.type!=="symbol")continue;if(!C[P.source]){const j=this._getLayerSourceCache(P);if(!j)continue;C[P.source]=j.getRenderableIds(!0).map(W=>j.getTileByID(W)).sort((W,H)=>H.tileID.overscaledZ-W.tileID.overscaledZ||(W.tileID.isLessThan(H.tileID)?-1:1))}const O=this.crossTileSymbolIndex.addLayer(P,C[P.source],o.center.lng,o.projection);T=T||O}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),x=x||this._layerOrderChanged||f===0,this._layerOrderChanged&&this.fire(new s.Event("neworder")),(x||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.exported.now(),o.zoom))&&(this.pauseablePlacement=new kh(o,this._order,x,c,f,_,this.placement,this.fog&&o.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,C),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.exported.now()),S=!0),T&&this.pauseablePlacement.placement.setStale()),S||T)for(const z of this._order){const P=this._layers[z];P.type==="symbol"&&this.placement.updateLayerOpacities(P,C[P.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.exported.now())}_releaseSymbolFadeTiles(){for(const o in this._sourceCaches)this._sourceCaches[o].releaseSymbolFadeTiles()}getImages(o,c,f){this.imageManager.getImages(c.icons,f),this._updateTilesForChangedImages();const _=x=>{x&&x.setDependencies(c.tileID.key,c.type,c.icons)};_(this._otherSourceCaches[c.source]),_(this._symbolSourceCaches[c.source])}getGlyphs(o,c,f){this.glyphManager.getGlyphs(c.stacks,f)}getResource(o,c,f){return s.makeRequest(c,f)}_getSourceCache(o){return this._otherSourceCaches[o]}_getLayerSourceCache(o){return o.type==="symbol"?this._symbolSourceCaches[o.source]:this._otherSourceCaches[o.source]}_getSourceCaches(o){const c=[];return this._otherSourceCaches[o]&&c.push(this._otherSourceCaches[o]),this._symbolSourceCaches[o]&&c.push(this._symbolSourceCaches[o]),c}_isSourceCacheLoaded(o){const c=this._getSourceCaches(o);return c.length===0?(this.fire(new s.ErrorEvent(new Error(`There is no source with ID '${o}'`))),!1):c.every(f=>f.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}to.getSourceType=function(d){return Pt[d]},to.setSourceType=function(d,o){Pt[d]=o},to.registerForPluginStateChange=s.registerForPluginStateChange;var Lh=` -#define EPSILON 0.0000001 -#define PI 3.141592653589793 -#define EXTENT 8192.0 -#define HALF_PI PI/2.0 -#define QUARTER_PI PI/4.0 -#define RAD_TO_DEG 180.0/PI -#define DEG_TO_RAD PI/180.0 -#define GLOBE_RADIUS EXTENT/PI/2.0`,Ps="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",So=` -#define ELEVATION_SCALE 7.0 -#define ELEVATION_OFFSET 450.0 -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix( -mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;} -#else -vec3 elevationVector(vec2 pos) { return vec3(0,0,1); } -#endif -const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt) -{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);} -#ifdef TERRAIN -#ifdef TERRAIN_DEM_FLOAT_FORMAT -uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev; -#else -uniform sampler2D u_dem;uniform sampler2D u_dem_prev; -#endif -uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a; -#else -float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos)); -#ifdef TERRAIN_DEM_NEAREST_FILTER -return u_exaggeration*tl; -#endif -float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); -#endif -}float prevElevation(vec2 apos) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a; -#else -float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y); -#endif -} -#ifdef TERRAIN_VERTEX_MORPHING -float elevation(vec2 apos) { -#ifdef ZERO_EXAGGERATION -return 0.0; -#endif -float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);} -#else -float elevation(vec2 apos) { -#ifdef ZERO_EXAGGERATION -return 0.0; -#endif -return currentElevation(apos);} -#endif -highp float unpack_depth(highp vec4 rgba_depth) -{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4( -unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy)) -);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a; -#else -vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack); -#endif -return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);} -#else -float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; } -#endif`,Cl=`#ifdef FOG -uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);} -#endif`,Ao=`#ifdef FOG -uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);} -#endif`;let Pc={},ma={};const Il=[];ga(Lh,Il),ga(So,Il),ga(Cl,Il),ga(Ao,Il),Pc=Qt("",So),ma=Qt(Ao,Cl);const ff=Qt(` -#if __VERSION__ >=300 -#define varying in -#define gl_FragColor glFragColor -#define texture2D texture -#define textureCube texture -out vec4 glFragColor; -#endif -highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth) -{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,` -#if __VERSION__ >=300 -#define attribute in -#define varying out -#define texture2D texture -#endif -float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;} -#ifdef PROJECTION_GLOBE_VIEW -vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) { -#ifndef PROJECTED_POS_ON_VIEWPORT -float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz; -#else -return vec3(0.0); -#endif -}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);} -#endif -vec2 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 -);}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;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),zc=Lh,Rh=` -#ifdef GL_ES -precision mediump float; -#else - -#if !defined(lowp) -#define lowp -#endif - -#if !defined(mediump) -#define mediump -#endif - -#if !defined(highp) -#define highp -#endif - -#endif`;var Dh={background:Qt(`uniform vec4 u_color;uniform float u_opacity; -#ifdef LIGHTING_3D_MODE -varying vec4 v_color; -#endif -void main() {vec4 out_color; -#ifdef LIGHTING_3D_MODE -out_color=v_color; -#else -out_color=u_color; -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#ifdef LIGHTING_3D_MODE -uniform vec4 u_color;varying vec4 v_color; -#endif -void main() {gl_Position=u_matrix*vec4(a_pos,0,1); -#ifdef LIGHTING_3D_MODE -v_color=apply_lighting(u_color); -#endif -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),backgroundPattern:Qt(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),circle:Qt(`varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 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) -);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_apply_premultiplied(out_color,v_fog_pos); -#endif -gl_FragColor=out_color*(v_visibility*opacity_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`#define NUM_VISIBILITY_RINGS 2 -#define INV_SQRT2 0.70710678 -#define ELEVATION_BIAS 0.0001 -#define NUM_SAMPLES_PER_RING 16 -uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; -#endif -varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) { -#if defined(TERRAIN) -return elevation(pos)+ELEVATION_BIAS; -#else -return 0.0; -#endif -}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale); -#ifdef PITCH_WITH_MAP -#ifdef PROJECTION_GLOBE_VIEW -return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) ); -#else -return u_matrix*( world_center+vec4(sample_offset,0,0) ); -#endif -#else -return projected_center+vec4(sample_offset,0,0); -#endif -}float get_sample_step() { -#ifdef PITCH_WITH_MAP -return 2.0*PI/float(NUM_SAMPLES_PER_RING); -#else -return PI/float(NUM_SAMPLES_PER_RING); -#endif -}void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors; -#ifdef PROJECTION_GLOBE_VIEW -vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1); -#else -surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1); -#endif -vec4 projected_center=u_matrix*world_center;float view_scale=0.0; -#ifdef PITCH_WITH_MAP -#ifdef SCALE_WITH_MAP -view_scale=1.0; -#else -view_scale=projected_center.w/u_camera_to_center_distance; -#endif -#else -#ifdef SCALE_WITH_MAP -view_scale=u_camera_to_center_distance; -#else -view_scale=projected_center.w; -#endif -#endif -gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0; -#ifdef TERRAIN -float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center; -#ifdef PITCH_WITH_MAP -float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center; -#else -occlusion_world_center=world_center;occlusion_projected_center=projected_center; -#endif -for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING); -#else -visibility=1.0; -#endif -#ifdef PROJECTION_GLOBE_VIEW -visibility=1.0; -#endif -v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur); -#ifdef FOG -v_fog_pos=fog_position(world_center.xyz); -#endif -}`),clippingMask:Qt("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:Qt(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float 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); -#ifdef FOG -if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);} -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir; -#endif -varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 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;vec2 tilePos=floor(a_pos*0.5);vec3 pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#else -pos=vec3(tilePos+extrude,elevation(tilePos)); -#endif -gl_Position=u_matrix*vec4(pos,1); -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),heatmapTexture:Qt(`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; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(0.0); -#endif -}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:Qt("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;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_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),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,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:Qt("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_2f;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_2f;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:Qt("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; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3; -#endif -varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0; -#ifdef PROJECTION_GLOBE_VIEW -gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1); -#else -gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1); -#endif -}`),fill:Qt(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -vec4 out_color=color; -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillOutline:Qt(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color; -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillOutlinePattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillPattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos); -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),fillExtrusion:Qt(`varying vec4 v_color; -#ifdef RENDER_SHADOWS -varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; -#endif -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef ZERO_ROOF_RADIUS -varying vec4 v_roof_color; -#endif -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -varying highp vec3 v_normal; -#endif -void main() { -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -vec3 normal=v_normal; -#endif -float z;vec4 color; -#ifdef ZERO_ROOF_RADIUS -z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z); -#else -color=v_color; -#endif -#ifdef FAUX_AO -float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x; -#ifdef ZERO_ROOF_RADIUS -concave*=(1.0-z); -#endif -float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade; -#endif -#ifdef RENDER_SHADOWS -#ifdef ZERO_ROOF_RADIUS -normal=mix(normal,vec3(0.0,0.0,1.0),z); -#endif -color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`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;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; -#endif -varying vec4 v_color; -#ifdef RENDER_SHADOWS -uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth; -#endif -#ifdef ZERO_ROOF_RADIUS -varying vec4 v_roof_color; -#endif -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -varying highp vec3 v_normal; -#endif -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0)); -#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) -v_normal=normal; -#endif -base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0); -#if defined(HAS_CENTROID) || defined(TERRAIN) -centroid_pos=a_centroid_pos; -#endif -float ele=0.0;float h=0.0;float c_ele;vec3 pos; -#ifdef TERRAIN -bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h); -#else -h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h); -#endif -#ifdef PROJECTION_GLOBE_VIEW -float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#endif -float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden); -#ifdef RENDER_SHADOWS -v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w; -#endif -float NdotL=0.0;float colorvalue=0.0; -#ifdef LIGHTING_3D_MODE -NdotL=calculate_NdotL(normal); -#else -colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL); -#endif -if (normal.y !=0.0) {float r=0.84; -#ifndef LIGHTING_3D_MODE -r=mix(0.7,0.98,1.0-u_lightintensity); -#endif -NdotL*=( -(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0); -#ifdef FAUX_AO -float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; -#ifdef TERRAIN -top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); -#endif -v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); -#ifdef PROJECTION_GLOBE_VIEW -top_height+=u_height_lift; -#endif -gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; -#endif -#ifdef LIGHTING_3D_MODE -v_color=apply_lighting(color,NdotL); -#else -v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); -#endif -v_color*=u_opacity; -#ifdef ZERO_ROOF_RADIUS -v_roof_color=vec4(0.0,0.0,0.0,1.0); -#ifdef LIGHTING_3D_MODE -v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0))); -#else -float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0)); -#endif -v_roof_color*=u_opacity; -#endif -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),fillExtrusionPattern:Qt(`uniform vec2 u_texsize;uniform sampler2D u_image; -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef LIGHTING_3D_MODE -varying float v_NdotL; -#endif -varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color,v_NdotL)*u_opacity; -#else -out_color=out_color*v_lighting; -#endif -#ifdef FAUX_AO -float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade; -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -gl_FragColor=out_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;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 vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift; -#endif -varying vec2 v_pos;varying vec4 v_lighting; -#ifdef FAUX_AO -uniform lowp vec2 u_ao;varying vec3 v_ao; -#endif -#ifdef LIGHTING_3D_MODE -varying float v_NdotL; -#endif -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0); -#if defined(HAS_CENTROID) || defined(TERRAIN) -centroid_pos=a_centroid_pos; -#endif -float ele=0.0;float h=z;vec3 p;float c_ele; -#ifdef TERRAIN -bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h); -#else -p=vec3(pos_nx.xy,z); -#endif -#ifdef PROJECTION_GLOBE_VIEW -float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition); -#endif -float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0 -? pos_nx.xy -: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0; -#ifdef LIGHTING_3D_MODE -NdotL=calculate_NdotL(normal); -#else -NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL); -#endif -if (normal.y !=0.0) {float r=0.84; -#ifndef LIGHTING_3D_MODE -r=mix(0.7,0.98,1.0-u_lightintensity); -#endif -NdotL*=( -(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));} -#ifdef FAUX_AO -float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height; -#ifdef TERRAIN -top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height); -#endif -v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]); -#ifdef PROJECTION_GLOBE_VIEW -top_height+=u_height_lift; -#endif -gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w; -#endif -#ifdef LIGHTING_3D_MODE -v_NdotL=NdotL; -#else -v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity; -#endif -#ifdef FOG -v_fog_pos=fog_position(p); -#endif -}`),hillshadePrepare:Qt(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) { -#ifdef TERRAIN_DEM_FLOAT_FORMAT -return texture2D(u_image,coord).a/4.0; -#else -vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0; -#endif -}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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+e+e+h)-(a+d+d+f),(f+g+g+h)-(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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,"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:Qt(`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;void 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;float 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; -#ifdef LIGHTING_3D_MODE -gl_FragColor=apply_lighting(gl_FragColor); -#endif -#ifdef FOG -gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos)); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`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; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),line:Qt(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv; -#ifdef RENDER_LINE_DASH -uniform sampler2D u_dash_image;varying vec2 v_tex; -#endif -#ifdef RENDER_LINE_GRADIENT -uniform sampler2D u_gradient_image; -#endif -uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;} -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 dash -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -float linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize lowp vec4 dash -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -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); -#ifdef RENDER_LINE_DASH -float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist); -#endif -highp vec4 out_color; -#ifdef RENDER_LINE_GRADIENT -out_color=texture2D(u_gradient_image,v_uv.xy); -#else -out_color=color; -#endif -float trimmed=1.0; -#ifdef RENDER_LINE_TRIM_OFFSET -highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}} -#endif -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos)); -#endif -#ifdef RENDER_LINE_ALPHA_DISCARD -if (alpha < u_alpha_discard_threshold) {discard;} -#endif -#ifdef RENDER_LINE_BORDER -float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2); -#ifdef RENDER_LINE_BORDER_AUTO -float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);} -#else -out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha); -#endif -} -#endif -gl_FragColor=out_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define EXTRUDE_SCALE 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data; -#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) -attribute highp vec4 a_packed; -#endif -#ifdef RENDER_LINE_DASH -attribute float a_linesofar; -#endif -uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;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 vec4 v_uv; -#ifdef RENDER_LINE_DASH -uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex; -#endif -#ifdef RENDER_LINE_GRADIENT -uniform float u_image_height; -#endif -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 dash -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize lowp vec4 dash -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float 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;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; -#ifndef RENDER_TO_TEXTURE -float 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; -#else -v_gamma_scale=1.0; -#endif -#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) -float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3]; -#ifdef RENDER_LINE_GRADIENT -highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end); -#else -v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end); -#endif -#endif -#ifdef RENDER_LINE_DASH -float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y); -#endif -v_width2=vec2(outset,inset); -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),linePattern:Qt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;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; -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.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=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos); -#ifdef LIGHTING_3D_MODE -color=apply_lighting(color); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;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; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern -#pragma mapbox: define lowp float pixel_ratio -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern -#pragma mapbox: initialize lowp float pixel_ratio -float 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;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_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude; -#ifndef RENDER_TO_TEXTURE -float 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; -#else -v_gamma_scale=1.0; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth; -#ifdef FOG -v_fog_pos=fog_position(pos); -#endif -}`),raster:Qt(`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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb); -#ifdef LIGHTING_3D_MODE -out_color=apply_lighting(out_color); -#endif -#ifdef FOG -out_color=fog_dither(fog_apply(out_color,v_fog_pos)); -#endif -gl_FragColor=vec4(out_color*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent; -#ifdef FOG -v_fog_pos=fog_position(a_pos); -#endif -}`),symbolIcon:Qt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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 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;uniform vec3 u_up_vector; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];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;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point; -#ifdef PROJECTION_GLOBE_VIEW -vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1); -#else -offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); -#endif -vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -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;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:Qt(`#define SDF_PX 8.0 -uniform 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; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float 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 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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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 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 vec3 u_up_vector; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];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;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point; -#ifdef PROJECTION_GLOBE_VIEW -vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1); -#else -offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1); -#endif -vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float gamma_scale=gl_Position.w;float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:Qt(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform 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; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}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); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity; -#ifdef PROJECTION_GLOBE_VIEW -attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal; -#endif -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 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 vec3 u_up_vector;uniform vec2 u_texsize_icon; -#ifdef PROJECTION_GLOBE_VIEW -uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix; -#endif -varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];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;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos; -#ifdef PROJECTION_GLOBE_VIEW -mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0; -#else -world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0; -#endif -vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp( -0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos; -#ifdef PROJECTION_GLOBE_VIEW -vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); -#else -projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0); -#endif -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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale); -#ifdef TERRAIN -#ifdef PITCH_WITH_MAP_TERRAIN -vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy); -#endif -#endif -float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade; -#ifdef PROJECTION_GLOBE_VIEW -vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#else -gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0)); -#endif -float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0; -#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW) -projection_transition_fade=1.0-step(EPSILON,u_zoom_transition); -#endif -v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}`),terrainRaster:Qt(`uniform sampler2D u_image0;varying vec2 v_pos0; -#ifdef FOG -varying float v_fog_opacity; -#endif -#ifdef RENDER_SHADOWS -varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; -#endif -void main() {vec4 color=texture2D(u_image0,v_pos0); -#ifdef RENDER_SHADOWS -color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth); -#endif -#ifdef FOG -#ifdef ZERO_EXAGGERATION -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#else -color=fog_dither(fog_apply_from_vert(color,v_fog_opacity)); -#endif -#endif -gl_FragColor=color; -#ifdef TERRAIN_WIREFRAME -gl_FragColor=vec4(1.0,0.0,0.0,0.8); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0; -#ifdef FOG -varying float v_fog_opacity; -#endif -#ifdef RENDER_SHADOWS -uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth; -#endif -const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height; -#ifdef TERRAIN_WIREFRAME -elevation+=wireframeOffset; -#endif -v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0); -#ifdef FOG -#ifdef ZERO_EXAGGERATION -v_fog_pos=fog_position(decodedPos); -#else -v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation))); -#endif -#endif -#ifdef RENDER_SHADOWS -vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w; -#endif -}`),terrainDepth:Qt(`#ifdef GL_ES -precision highp float; -#endif -varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:Qt(` -varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep( -cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb; -#ifdef FOG -sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color); -#endif -sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Ps),skyboxGradient:Qt(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5)); -#ifdef FOG -color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a; -#endif -color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,Ps),skyboxCapture:Qt(` -varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m; -#ifdef GL_ES -precision highp float; -#endif -#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6) -#define BETA_M vec3(21e-6,21e-6,21e-6) -#define MIE_G 0.76 -#define DENSITY_HEIGHT_SCALE_R 8000.0 -#define DENSITY_HEIGHT_SCALE_M 1200.0 -#define PLANET_RADIUS 6360e3 -#define ATMOSPHERE_RADIUS 6420e3 -#define SAMPLE_STEPS 10 -#define DENSITY_STEPS 4 -float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:Qt(`uniform sampler2D u_image0;varying vec2 v_pos0; -#ifndef FOG -uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport; -#endif -void main() {vec4 color; -#ifdef CUSTOM_ANTIALIASING -vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias); -#else -color=texture2D(u_image0,v_pos0); -#endif -#ifdef FOG -color=fog_dither(fog_apply_premultiplied(color,v_fog_pos)); -#endif -gl_FragColor=color; -#ifdef TERRAIN_WIREFRAME -gl_FragColor=vec4(1.0,0.0,0.0,0.8); -#endif -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height; -#ifdef GLOBE_POLES -attribute vec3 a_globe_pos;attribute vec2 a_uv; -#else -attribute vec2 a_pos; -#endif -varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() { -#ifdef GLOBE_POLES -vec3 globe_pos=a_globe_pos;vec2 uv=a_uv; -#else -float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY); -#endif -v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale; -#ifdef GLOBE_POLES -vec3 up_vector=globe_derived_up_vector; -#else -vec3 up_vector=elevationVector(tile_pos); -#endif -float height=elevation(tile_pos); -#ifdef TERRAIN_WIREFRAME -height+=wireframeOffset; -#endif -globe_pos+=up_vector*height; -#ifndef GLOBE_POLES -globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z; -#endif -#ifdef GLOBE_POLES -vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0); -#else -vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0); -#endif -gl_Position=u_proj_matrix*interpolated_pos; -#ifdef FOG -v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz); -#endif -}`),globeAtmosphere:Qt(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir; -#ifdef PROJECTION_GLOBE_VIEW -globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;} -#endif -highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ? -0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle; -#ifdef PROJECTION_GLOBE_VIEW -highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ? -PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t); -#else -horizon_angle=horizon_angle_mercator; -#endif -horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x: -(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y: -uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix( -mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix( -mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function ga(d,o){const c=d.replace(/\s*\/\/[^\n]*\n/g,` -`).split(` -`);for(let f of c)if(f=f.trim(),f[0]==="#"&&f.includes("if")&&!f.includes("endif")){f=f.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const _=f.split(" ");for(const x of _)o.includes(x)||o.push(x)}}function Qt(d,o){const c=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,f=o.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),_={},x=[...Il];return ga(d,x),ga(o,x),{fragmentSource:d=d.replace(c,(T,S,C,z,P)=>(_[P]=!0,S==="define"?` -#ifndef HAS_UNIFORM_u_${P} -varying ${C} ${z} ${P}; -#else -uniform ${C} ${z} u_${P}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${P} - ${C} ${z} ${P} = u_${P}; -#endif -`)),vertexSource:o=o.replace(c,(T,S,C,z,P)=>{const O=z==="float"?"vec2":"vec4",j=P.match(/color/)?"color":O;return _[P]?S==="define"?` -#ifndef HAS_UNIFORM_u_${P} -uniform lowp float u_${P}_t; -attribute ${C} ${O} a_${P}; -varying ${C} ${z} ${P}; -#else -uniform ${C} ${z} u_${P}; -#endif -`:j==="vec4"?` -#ifndef HAS_UNIFORM_u_${P} - ${P} = a_${P}; -#else - ${C} ${z} ${P} = u_${P}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${P} - ${P} = unpack_mix_${j}(a_${P}, u_${P}_t); -#else - ${C} ${z} ${P} = u_${P}; -#endif -`:S==="define"?` -#ifndef HAS_UNIFORM_u_${P} -uniform lowp float u_${P}_t; -attribute ${C} ${O} a_${P}; -#else -uniform ${C} ${z} u_${P}; -#endif -`:j==="vec4"?` -#ifndef HAS_UNIFORM_u_${P} - ${C} ${z} ${P} = a_${P}; -#else - ${C} ${z} ${P} = u_${P}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${P} - ${C} ${z} ${P} = unpack_mix_${j}(a_${P}, u_${P}_t); -#else - ${C} ${z} ${P} = u_${P}; -#endif -`}),staticAttributes:f,usedDefines:x}}class W_{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(o,c,f,_,x,T,S){this.context=o;let C=this.boundPaintVertexBuffers.length!==_.length;for(let P=0;!C&&P<_.length;P++)this.boundPaintVertexBuffers[P]!==_[P]&&(C=!0);let z=this.boundDynamicVertexBuffers.length!==S.length;for(let P=0;!z&&P{const Q=B.paint.get("hillshade-shadow-color"),ee=B.paint.get("hillshade-highlight-color"),de=B.paint.get("hillshade-accent-color");let fe=B.paint.get("hillshade-illumination-direction")*(Math.PI/180);B.paint.get("hillshade-illumination-anchor")==="viewport"&&(fe-=Z.transform.angle);const pe=!Z.options.moving;return{u_matrix:q||Z.transform.calculateProjMatrix(X.tileID.toUnwrapped(),pe),u_image:0,u_latrange:Oh(0,X.tileID),u_light:[B.paint.get("hillshade-exaggeration"),fe],u_shadow:Q,u_highlight:ee,u_accent:de}})(d,c,f,d.terrain?o.projMatrix:null);d.prepareDrawProgram(S,P,o.toUnwrapped());const{tileBoundsBuffer:j,tileBoundsIndexBuffer:W,tileBoundsSegments:H}=d.getTileBoundsBuffers(c);P.draw(S,C.TRIANGLES,_,x,T,s.CullFaceMode.disabled,O,f.id,j,W,H)}function Bh(d,o,c){if(!o.needsDEMTextureUpload)return;const f=d.context,_=f.gl;f.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||d.getTileTexture(c.stride);const x=c.getPixels();o.demTexture?o.demTexture.update(x,{premultiply:!1}):o.demTexture=new s.Texture(f,x,_.RGBA,{premultiply:!1}),o.needsDEMTextureUpload=!1}function gf(d,o,c,f,_,x){const T=d.context,S=T.gl;if(!o.dem)return;const C=o.dem;if(T.activeTexture.set(S.TEXTURE1),Bh(d,o,C),!o.demTexture)return;o.demTexture.bind(S.NEAREST,S.CLAMP_TO_EDGE);const z=C.dim;T.activeTexture.set(S.TEXTURE0);let P=o.fbo;if(!P){const H=new s.Texture(T,{width:z,height:z,data:null},S.RGBA);H.bind(S.LINEAR,S.CLAMP_TO_EDGE),P=o.fbo=T.createFramebuffer(z,z,!0),P.colorAttachment.set(H.texture)}T.bindFramebuffer.set(P.framebuffer),T.viewport.set([0,0,z,z]);const{tileBoundsBuffer:O,tileBoundsIndexBuffer:j,tileBoundsSegments:W}=d.getMercatorTileBoundsBuffers();d.useProgram("hillshadePrepare").draw(T,S.TRIANGLES,f,_,x,s.CullFaceMode.disabled,((H,Z)=>{const X=Z.stride,B=s.create();return s.ortho(B,0,s.EXTENT,-s.EXTENT,0,0,1),s.translate(B,B,[0,-s.EXTENT,0]),{u_matrix:B,u_image:1,u_dimension:[X,X],u_zoom:H.overscaledZ,u_unpack:Z.unpackVector}})(o.tileID,C),c.id,O,j,W),o.needsHillshadePrepare=!1}const Fh=d=>({u_matrix:new s.UniformMatrix4f(d),u_image0:new s.Uniform1i(d),u_skirt_height:new s.Uniform1f(d)}),_a=(d,o)=>({u_matrix:d,u_image0:0,u_skirt_height:o}),Lc=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H)=>({u_proj_matrix:Float32Array.from(d),u_globe_matrix:o,u_normalize_matrix:Float32Array.from(f),u_merc_matrix:c,u_zoom_transition:_,u_merc_center:x,u_image0:0,u_frustum_tl:T,u_frustum_tr:S,u_frustum_br:C,u_frustum_bl:z,u_globe_pos:P,u_globe_radius:O,u_viewport:j,u_grid_matrix:H?Float32Array.from(H):new Float32Array(9),u_skirt_height:W});function ya(d,o){return d!=null&&o!=null&&!(!d.hasData()||!o.hasData())&&d.demTexture!=null&&o.demTexture!=null&&d.tileID.key!==o.tileID.key}const Co=new class{constructor(){this.operations={}}newMorphing(d,o,c,f,_){if(d in this.operations){const x=this.operations[d];x.to.tileID.key!==c.tileID.key&&(x.queued=c)}else this.operations[d]={startTime:f,phase:0,duration:_,from:o,to:c,queued:null}}getMorphValuesForProxy(d){if(!(d in this.operations))return null;const o=this.operations[d];return{from:o.from,to:o.to,phase:o.phase}}update(d){for(const o in this.operations){const c=this.operations[o];for(c.phase=(d-c.startTime)/c.duration;c.phase>=1||!this._validOp(c);)if(!this._nextOp(c,d)){delete this.operations[o];break}}}_nextOp(d,o){return!!d.queued&&(d.from=d.to,d.to=d.queued,d.queued=null,d.phase=0,d.startTime=o,!0)}_validOp(d){return d.from.hasData()&&d.to.hasData()}},zs={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Rc(d){return 6*Math.pow(1.5,22-d)}function _f(d,o){const c=1<({u_matrix:d});function Nh(d,o,c,f,_){if(_>0){const x=s.exported.now(),T=(x-d.timeAdded)/_,S=o?(x-o.timeAdded)/_:-1,C=c.getSource(),z=f.coveringZoomLevel({tileSize:C.tileSize,roundZoom:C.roundZoom}),P=!o||Math.abs(o.tileID.overscaledZ-z)>Math.abs(d.tileID.overscaledZ-z),O=P&&d.refreshedUponExpiration?1:s.clamp(P?T:1-S,0,1);return d.refreshedUponExpiration&&T>=1&&(d.refreshedUponExpiration=!1),o?{opacity:1,mix:1-O}:{opacity:O,mix:0}}return{opacity:1,mix:0}}class Uh extends s.SourceCache{constructor(o){const c={type:"raster-dem",maxzoom:o.transform.maxZoom},f=new xt(ha(),null),_=Dt("mock-dem",c,f,o.style);super("mock-dem",_,!1),_.setEventedParent(this),this._sourceLoaded=!0}_loadTile(o,c){o.state="loaded",c(null)}}class Dc extends s.SourceCache{constructor(o){const c=Dt("proxy",{type:"geojson",maxzoom:o.transform.maxZoom},new xt(ha(),null),o.style);super("proxy",c,!1),c.setEventedParent(this),this.map=this.getSource().map=o,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(o,c,f){if(o.freezeTileCoverage)return;this.transform=o;const _=o.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((x,T)=>{if(x[T.key]="",!this._tiles[T.key]){const S=new s.Tile(T,this._source.tileSize*T.overscaleFactor(),o.tileZoom);S.state="loaded",this._tiles[T.key]=S}return x},{});for(const x in this._tiles)x in _||(this.freeFBO(x),this._tiles[x].unloadVectorData(),delete this._tiles[x])}freeFBO(o){const c=this.proxyCachedFBO[o];if(c!==void 0){const f=Object.values(c);this.renderCachePool.push(...f),delete this.proxyCachedFBO[o]}}deallocRenderCache(){this.renderCache.forEach(o=>o.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Oc extends s.OverscaledTileID{constructor(o,c,f){super(o.overscaledZ,o.wrap,o.canonical.z,o.canonical.x,o.canonical.y),this.proxyTileKey=c,this.projMatrix=f}}class jh extends s.Elevation{constructor(o,c){super(),this.painter=o,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[f,_,x]=function(C){const z=new s.StructArrayLayout2i4,P=new s.StructArrayLayout3ui6,O=131;z.reserve(17161),P.reserve(33800);const j=s.EXTENT/128,W=s.EXTENT+j/2,H=W+j;for(let X=-j;XW||X<0||X>W?24575:0,Q=s.clamp(Math.round(B),0,s.EXTENT),ee=s.clamp(Math.round(X),0,s.EXTENT);z.emplaceBack(Q+q,ee)}const Z=(X,B)=>{const q=B*O+X;P.emplaceBack(q+1,q,q+O),P.emplaceBack(q+O,q+O+1,q+1)};for(let X=1;X<129;X++)for(let B=1;B<129;B++)Z(B,X);return[0,129].forEach(X=>{for(let B=0;B<130;B++)Z(B,X),Z(X,B)}),[z,P,32768]}(),T=o.context;this.gridBuffer=T.createVertexBuffer(f,s.posAttributes.members),this.gridIndexBuffer=T.createIndexBuffer(_),this.gridSegments=s.SegmentVector.simpleSegment(0,0,f.length,_.length),this.gridNoSkirtSegments=s.SegmentVector.simpleSegment(0,0,f.length,x),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Dc(c.map),this.orthoMatrix=s.create(),s.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,s.EXTENT,0,s.EXTENT,0,1);const S=T.gl;this._overlapStencilMode=new s.StencilMode({func:S.GEQUAL,mask:255},0,255,S.KEEP,S.KEEP,S.REPLACE),this._previousZoom=o.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=c,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Uh(c.map)}set style(o){o.on("data",this._onStyleDataEvent.bind(this)),o.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=o,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(o,c,f){if(o&&o.terrain){this._style!==o&&(this.style=o),this.enabled=!0;const _=o.terrain.properties;this.sourceCache=o.terrain.drapeRenderMode===0?this._mockSourceCache:o._getSourceCache(_.get("source")),this._exaggeration=_.get("exaggeration");const x=()=>{this.sourceCache.used&&s.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. -This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const T=this.getScaledDemTileSize();this.sourceCache.update(c,T,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,x(),this._initializing=!0),x(),c.updateElevation(!0,f),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(c),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(o){this._findCoveringTileCache[o]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const o=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||o.efficiency!==100&&s.warnOnce(`Terrain render cache efficiency is not optimal (${o.efficiency}%) and performance - may be affected negatively, consider placing all background, fill and line layers before layer - with id '${o.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(o){o.coord&&o.dataType==="source"?this._clearRenderCacheForTile(o.sourceCacheId,o.coord):o.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const o in this._style._sourceCaches)this._style._sourceCaches[o].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(o=>o.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const o=2*this.proxySourceCache.getSource().tileSize;return[o,o]}set useVertexMorphing(o){this._useVertexMorphing=o}updateTileBinding(o){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const c=this.proxySourceCache,f=this.painter.transform;this._initializing&&(this._initializing=f._centerAltitude===0&&this.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(f.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const _=this.proxyCoords=c.getIds().map(C=>{const z=c.getTileByID(C).tileID;return z.projMatrix=f.calculateProjMatrix(z.toUnwrapped()),z});(function(C,z){const P=z.transform.pointCoordinate(z.transform.getCameraPoint()),O=new s.Point(P.x,P.y);C.sort((j,W)=>{if(W.overscaledZ-j.overscaledZ)return W.overscaledZ-j.overscaledZ;const H=new s.Point(j.canonical.x+(1<{this.proxyToSource[C.key]={}}),this.terrainTileForTile={};const T=this._style._sourceCaches;for(const C in T){const z=T[C];if(!z.used||(z!==this.sourceCache&&this.resetTileLookupCache(z.id),this._setupProxiedCoordsForOrtho(z,o[C],x),z.usedForTerrain))continue;const P=o[C];z.getSource().reparseOverscaled&&this._assignTerrainTiles(P)}this.proxiedCoords[c.id]=_.map(C=>new Oc(C,C.key,this.orthoMatrix)),this._assignTerrainTiles(_),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(x),this.renderingToTexture=!1,this._updateTimestamp=s.exported.now();const S={};this._visibleDemTiles=[];for(const C of this.proxyCoords){const z=this.terrainTileForTile[C.key];if(!z)continue;const P=z.tileID.key;P in S||(this._visibleDemTiles.push(z),S[P]=P)}}_assignTerrainTiles(o){this._initializing||o.forEach(c=>{if(this.terrainTileForTile[c.key])return;const f=this._findTileCoveringTileID(c,this.sourceCache);f&&(this.terrainTileForTile[c.key]=f)})}_prepareDEMTextures(){const o=this.painter.context,c=o.gl;for(const f in this.terrainTileForTile){const _=this.terrainTileForTile[f],x=_.dem;!x||_.demTexture&&!_.needsDEMTextureUpload||(o.activeTexture.set(c.TEXTURE1),Bh(this.painter,_,x))}}_prepareDemTileUniforms(o,c,f,_){if(!c||c.demTexture==null)return!1;const x=o.tileID.canonical,T=Math.pow(2,c.tileID.canonical.z-x.z),S=_||"";return f[`u_dem_tl${S}`]=[x.x*T%1,x.y*T%1],f[`u_dem_scale${S}`]=T,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const o=this.painter.context,c=o.gl;if(!this._emptyDepthBufferTexture){const f=new s.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new s.Texture(o,f,c.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let o=0;const c=this._visibleDemTiles.reduce((f,_)=>{if(!_.dem)return f;const x=_.dem.tree.minimums[0];return x>0&&o++,f+x},0);return o?c/o:0}_updateEmptyDEMTexture(){const o=this.painter.context,c=o.gl;o.activeTexture.set(c.TEXTURE2);const f=this._getLoadedAreaMinimum(),_=new s.RGBAImage({width:1,height:1},new Uint8Array(s.DEMData.pack(f,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let x=this._emptyDEMTexture;return x?x.update(_,{premultiply:!1}):x=this._emptyDEMTexture=new s.Texture(o,_,c.RGBA,{premultiply:!1}),x}setupElevationDraw(o,c,f){const _=this.painter.context,x=_.gl,T=(S=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:s.DEMData.getUnpackVector(S),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var S;T.u_dem_size=this.sourceCache.getSource().tileSize,T.u_exaggeration=this.exaggeration();let C=null,z=null,P=1;if(f&&f.morphing&&this._useVertexMorphing){const O=f.morphing.srcDemTile,j=f.morphing.dstDemTile;P=f.morphing.phase,O&&j&&(this._prepareDemTileUniforms(o,O,T,"_prev")&&(z=O),this._prepareDemTileUniforms(o,j,T)&&(C=j))}if(z&&C?(_.activeTexture.set(x.TEXTURE2),C.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),_.activeTexture.set(x.TEXTURE4),z.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),T.u_dem_lerp=P):(C=this.terrainTileForTile[o.tileID.key],_.activeTexture.set(x.TEXTURE2),(this._prepareDemTileUniforms(o,C,T)?C.demTexture:this.emptyDEMTexture).bind(x.NEAREST,x.CLAMP_TO_EDGE)),_.activeTexture.set(x.TEXTURE3),f&&f.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),this._depthFBO&&(T.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),T.u_depth_size_inv=[1,1]),f&&f.useMeterToDem&&C){const O=(1<{if(B===qe)return;const Be=[zs[qe],"PROJECTION_GLOBE_VIEW"];ee&&Be.push("CUSTOM_ANTIALIASING"),Se&&Be.push(zs[q]),X=z.useProgram("globeRaster",null,Be),B=qe},fe=z.colorModeForRenderPass(),pe=new s.DepthMode(Z.LEQUAL,s.DepthMode.ReadWrite,z.depthRangeFor3D);Co.update(W);const xe=s.calculateGlobeMercatorMatrix(Q),ye=[s.mercatorXfromLng(Q.center.lng),s.mercatorYfromLat(Q.center.lat)],Ae=q?[!1,!0]:[!1],We=z.globeSharedBuffers,Ee=[Q.width*s.exported.devicePixelRatio,Q.height*s.exported.devicePixelRatio],Fe=Float32Array.from(Q.globeMatrix),ke={useDenormalizedUpVectorScale:!0};if(Ae.forEach(qe=>{const Se=z.transform,Be=Rc(Se.zoom)*P.exaggeration();B=-1;const Xe=qe?Z.LINES:Z.TRIANGLES;for(const $e of j){const Ye=O.getTile($e),gt=s.StencilMode.disabled,Et=P.prevTerrainTileForTile[$e.key],pt=P.terrainTileForTile[$e.key];ya(Et,pt)&&Co.newMorphing($e.key,Et,pt,W,250),H.activeTexture.set(Z.TEXTURE0),Ye.texture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);const wt=Co.getMorphValuesForProxy($e.key),Ut=wt?1:0;wt&&s.extend$1(ke,{morphing:{srcDemTile:wt.from,dstDemTile:wt.to,phase:s.easeCubicInOut(wt.phase)}});const Ot=s.tileCornersToBounds($e.canonical),mt=s.getLatitudinalLod(Ot.getCenter().lat),en=s.getGridMatrix($e.canonical,Ot,mt,Se.worldSize/Se._pixelsPerMercatorPixel),rn=s.globeNormalizeECEF(s.globeTileBounds($e.canonical)),on=Lc(Se.projMatrix,Fe,xe,rn,s.globeToMercatorTransition(Se.zoom),ye,Se.frustumCorners.TL,Se.frustumCorners.TR,Se.frustumCorners.BR,Se.frustumCorners.BL,Se.globeCenterInViewSpace,Se.globeRadius,Ee,Be,en);if(de(Ut,qe),P.setupElevationDraw(Ye,X,ke),z.prepareDrawProgram(H,X,$e.toUnwrapped()),We){const[sn,Mr,fr]=qe?We.getWirefameBuffers(z.context,mt):We.getGridBuffers(mt,Be!==0);X.draw(H,Xe,pe,gt,fe,s.CullFaceMode.backCCW,on,"globe_raster",sn,Mr,fr)}}}),We){const qe=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];ee&&qe.push("CUSTOM_ANTIALIASING"),X=z.useProgram("globeRaster",null,qe);for(const Se of j){const{x:Be,y:Xe,z:$e}=Se.canonical,Ye=Xe===0,gt=Xe===(1<<$e)-1,[Et,pt,wt,Ut]=We.getPoleBuffers($e);if(Ut&&(Ye||gt)){const Ot=O.getTile(Se);H.activeTexture.set(Z.TEXTURE0),Ot.texture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);let mt=s.globePoleMatrixForTile($e,Be,Q);const en=s.globeNormalizeECEF(s.globeTileBounds(Se.canonical)),rn=(on,sn)=>on.draw(H,Z.TRIANGLES,pe,s.StencilMode.disabled,fe,s.CullFaceMode.disabled,Lc(Q.projMatrix,mt,mt,en,0,ye,Q.frustumCorners.TL,Q.frustumCorners.TR,Q.frustumCorners.BR,Q.frustumCorners.BL,Q.globeCenterInViewSpace,Q.globeRadius,Ee,0),"globe_pole_raster",sn,wt,Ut);P.setupElevationDraw(Ot,X,ke),z.prepareDrawProgram(H,X,Se.toUnwrapped()),Ye&&rn(X,Et),gt&&(mt=s.scale(s.create(),mt,[1,-1,1]),rn(X,pt))}}}})(_,x,T,S,C);else{const z=_.context,P=z.gl;let O,j;const W=_.options.showTerrainWireframe?2:0,H=(Q,ee)=>{if(j===Q)return;const de=[zs[Q]];ee&&de.push(zs[W]),O=_.useProgram("terrainRaster",null,de),j=Q},Z=_.colorModeForRenderPass(),X=new s.DepthMode(P.LEQUAL,s.DepthMode.ReadWrite,_.depthRangeFor3D);Co.update(C);const B=_.transform,q=Rc(B.zoom)*x.exaggeration();(W?[!1,!0]:[!1]).forEach(Q=>{j=-1;const ee=Q?P.LINES:P.TRIANGLES,[de,fe]=Q?x.getWirefameBuffer():[x.gridIndexBuffer,x.gridSegments];for(const pe of S){const xe=T.getTile(pe),ye=s.StencilMode.disabled,Ae=x.prevTerrainTileForTile[pe.key],We=x.terrainTileForTile[pe.key];ya(Ae,We)&&Co.newMorphing(pe.key,Ae,We,C,250),z.activeTexture.set(P.TEXTURE0),xe.texture.bind(P.LINEAR,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST);const Ee=Co.getMorphValuesForProxy(pe.key),Fe=Ee?1:0;let ke;Ee&&(ke={morphing:{srcDemTile:Ee.from,dstDemTile:Ee.to,phase:s.easeCubicInOut(Ee.phase)}});const qe=_a(pe.projMatrix,_f(pe.canonical,B.renderWorldCopies)?q/10:q);H(Fe,Q),x.setupElevationDraw(xe,O,ke),_.prepareDrawProgram(z,O,pe.toUnwrapped()),O.draw(z,ee,X,ye,Z,s.CullFaceMode.backCCW,qe,"terrain_raster",x.gridBuffer,de,fe)}})}}(c,this,this.proxySourceCache,o,this._updateTimestamp),this.renderingToTexture=!0,c.gpuTimingDeferredRenderEnd(),o.splice(0,o.length))}renderBatch(o){if(this._drapedRenderBatches.length===0)return o+1;this.renderingToTexture=!0;const c=this.painter,f=this.painter.context,_=this.proxySourceCache,x=this.proxiedCoords[_.id],T=this._drapedRenderBatches.shift(),S=[],C=c.style.order;let z=0;for(const P of x){const O=_.getTileByID(P.proxyTileKey),j=_.proxyCachedFBO[P.key]?_.proxyCachedFBO[P.key][o]:void 0,W=j!==void 0?_.renderCache[j]:this.pool[z++],H=j!==void 0;if(O.texture=W.tex,H&&!W.dirty){S.push(O.tileID);continue}let Z;f.bindFramebuffer.set(W.fb.framebuffer),this.renderedToTile=!1,W.dirty&&(f.clear({color:s.Color.transparent,stencil:0}),W.dirty=!1);for(let X=T.start;X<=T.end;++X){const B=c.style._layers[C[X]];if(B.isHidden(c.transform.zoom))continue;const q=c.style._getLayerSourceCache(B),Q=q?this.proxyToSource[P.key][q.id]:[P];if(!Q)continue;const ee=Q;f.viewport.set([0,0,W.fb.width,W.fb.height]),Z!==(q?q.id:null)&&(this._setupStencil(W,Q,B,q),Z=q?q.id:null),c.renderLayer(c,q,B,ee)}this.renderedToTile?(W.dirty=!0,S.push(O.tileID)):H||--z,z===5&&(z=0,this.renderToBackBuffer(S))}return this.renderToBackBuffer(S),this.renderingToTexture=!1,f.bindFramebuffer.set(null),f.viewport.set([0,0,c.width,c.height]),T.end+1}postRender(){}renderCacheEfficiency(o){const c=o.order.length;if(c===0)return{efficiency:100};let f,_=0,x=0,T=!1;for(let S=0;Sc.dem).forEach(c=>{o=Math.min(o,c.dem.tree.minimums[0])}),o===0?o:(o-30)*this._exaggeration}raycast(o,c,f){if(!this._visibleDemTiles)return null;const _=this._visibleDemTiles.filter(x=>x.dem).map(x=>{const T=x.tileID,S=1<(x.t!==null?x.t:Number.MAX_VALUE)-(T.t!==null?T.t:Number.MAX_VALUE));for(const x of _){if(x.t==null)return null;const T=x.tile.dem.tree.raycast(x.minx,x.miny,x.maxx,x.maxy,o,c,f);if(T!=null)return T}return null}_createFBO(){const o=this.painter.context,c=o.gl,f=this.drapeBufferSize;o.activeTexture.set(c.TEXTURE0);const _=new s.Texture(o,{width:f[0],height:f[1],data:null},c.RGBA);_.bind(c.LINEAR,c.CLAMP_TO_EDGE);const x=o.createFramebuffer(f[0],f[1],!1);return x.colorAttachment.set(_.texture),x.depthAttachment=new ge(o,x.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=o.createRenderbuffer(o.gl.DEPTH_STENCIL,f[0],f[1]),this._stencilRef=0,x.depthAttachment.set(this._sharedDepthStencil),o.clear({stencil:0})):x.depthAttachment.set(this._sharedDepthStencil),o.extTextureFilterAnisotropic&&!o.extTextureFilterAnisotropicForceOff&&c.texParameterf(c.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax),{fb:x,tex:_,dirty:!1}}_initFBOPool(){for(;this.pool.length{const c=this._style._layers[o],f=c.isHidden(this.painter.transform.zoom);return c.type==="custom"?!f&&c.shouldRedrape():!f&&c.hasTransition()})}_clearLineLayersFromRenderCache(){let o=!1;for(const f of this._style._getSources())if(f instanceof rt){o=!0;break}if(!o)return;const c={};for(let f=0;fc.renderCachePool.length){const T=Object.values(c.proxyCachedFBO);c.proxyCachedFBO={};for(let S=0;S=0;T--){const S=f[T];if(c.getTileByID(S.key),c.proxyCachedFBO[S.key]!==void 0){const C=o[S.key],z=this.proxyToSource[S.key];let P=0;for(const O in z){const j=z[O],W=C[O];if(!W||W.length!==j.length||j.some((H,Z)=>H!==W[Z]||_[O]&&_[O].hasOwnProperty(H.key))){P=-1;break}++P}for(const O in c.proxyCachedFBO[S.key])c.renderCache[c.proxyCachedFBO[S.key][O]].dirty=P<0||P!==Object.values(C).length}}const x=[...this._drapedRenderBatches];x.sort((T,S)=>S.end-S.start-(T.end-T.start));for(const T of x)for(const S of f){if(c.proxyCachedFBO[S.key])continue;let C=c.renderCachePool.pop();C===void 0&&c.renderCache.length<50&&(C=c.renderCache.length,c.renderCache.push(this._createFBO())),C!==void 0&&(c.proxyCachedFBO[S.key]={},c.proxyCachedFBO[S.key][T.start]=C,c.renderCache[C].dirty=!0)}this._tilesDirty={}}_setupStencil(o,c,f,_){if(!_||!this._sourceTilesOverlap[_.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const x=this.painter.context,T=x.gl;if(c.length<=1)return void(this._overlapStencilType=!1);let S;if(f.isTileClipped())S=c.length,this._overlapStencilMode.test={func:T.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(c[0].overscaledZ>c[c.length-1].overscaledZ))return void(this._overlapStencilType=!1);S=1,this._overlapStencilMode.test={func:T.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+S>255&&(x.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=S,this._overlapStencilMode.ref=this._stencilRef,f.isTileClipped()&&this._renderTileClippingMasks(c,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(o){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[o.key]),this._overlapStencilMode):s.StencilMode.disabled}_renderTileClippingMasks(o,c){const f=this.painter,_=this.painter.context,x=_.gl;f._tileClippingMaskIDs={},_.setColorMode(s.ColorMode.disabled),_.setDepthMode(s.DepthMode.disabled);const T=f.useProgram("clippingMask");for(const S of o){const C=f._tileClippingMaskIDs[S.key]=--c;T.draw(_,x.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:x.ALWAYS,mask:0},C,255,x.KEEP,x.KEEP,x.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,kl(S.projMatrix),"$clipping",f.tileExtentBuffer,f.quadTriangleIndexBuffer,f.tileExtentSegments)}}pointCoordinate(o){const c=this.painter.transform;if(o.x<0||o.x>c.width||o.y<0||o.y>c.height)return null;const f=[o.x,o.y,1,1];s.transformMat4$1(f,f,c.pixelMatrixInverse),s.scale$1(f,f,1/f[3]),f[0]/=c.worldSize,f[1]/=c.worldSize;const _=c._camera.position,x=s.mercatorZfromAltitude(1,c.center.lat),T=[_[0],_[1],_[2]/x,0],S=s.subtract([],f.slice(0,3),T);s.normalize(S,S);const C=this.raycast(T,S,this._exaggeration);return C!==null&&C?(s.scaleAndAdd(T,T,S,C),T[3]=T[2],T[2]*=x,T):null}drawDepth(){const o=this.painter,c=o.context,f=this.proxySourceCache,_=Math.ceil(o.width),x=Math.ceil(o.height);if(!this._depthFBO||this._depthFBO.width===_&&this._depthFBO.height===x||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const T=c.gl,S=c.createFramebuffer(_,x,!0);c.activeTexture.set(T.TEXTURE0);const C=new s.Texture(c,{width:_,height:x,data:null},T.RGBA);C.bind(T.NEAREST,T.CLAMP_TO_EDGE),S.colorAttachment.set(C.texture);const z=c.createRenderbuffer(c.gl.DEPTH_COMPONENT16,_,x);S.depthAttachment.set(z),this._depthFBO=S,this._depthTexture=C}c.bindFramebuffer.set(this._depthFBO.framebuffer),c.viewport.set([0,0,_,x]),function(T,S,C,z){if(T.transform.projection.name==="globe")return;const P=T.context,O=P.gl;P.clear({depth:1});const j=T.useProgram("terrainDepth"),W=new s.DepthMode(O.LESS,s.DepthMode.ReadWrite,T.depthRangeFor3D);for(const H of z){const Z=C.getTile(H),X=_a(H.projMatrix,0);S.setupElevationDraw(Z,j),j.draw(P,O.TRIANGLES,W,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.backCCW,X,"terrain_depth",S.gridBuffer,S.gridIndexBuffer,S.gridNoSkirtSegments)}}(o,this,f,this.proxyCoords)}_setupProxiedCoordsForOrtho(o,c,f){if(o.getSource()instanceof Rt)return this._setupProxiedCoordsForImageSource(o,c,f);this._findCoveringTileCache[o.id]=this._findCoveringTileCache[o.id]||{};const _=this.proxiedCoords[o.id]=[],x=this.proxyCoords;for(let S=0;S(P.min.x=Math.min(P.min.x,O.x-S.x),P.min.y=Math.min(P.min.y,O.y-S.y),P.max.x=Math.max(P.max.x,O.x-S.x),P.max.y=Math.max(P.max.y,O.y-S.y),P),{min:new s.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new s.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),z=(P,O)=>{const j=P.wrap+P.canonical.x/(1<Z+C.max.x||W+HX+C.max.y};for(let P=0;PT.key===c.tileID.key);if(x)return x}if(c.tileID.key!==o.key){const x=o.canonical.z-c.tileID.canonical.z;let T,S,C;_=s.create();const z=c.tileID.wrap-o.wrap<0?(T=s.EXTENT>>x,S=T*((c.tileID.canonical.x<=O){const j=o.canonical.z-O;c.getSource().reparseOverscaled?(S=Math.max(o.canonical.z+2,c.transform.tileZoom),T=new s.OverscaledTileID(S,o.wrap,O,o.canonical.x>>j,o.canonical.y>>j)):j!==0&&(S=O,T=new s.OverscaledTileID(S,o.wrap,O,o.canonical.x>>j,o.canonical.y>>j))}T.key!==o.key&&(z.push(T.key),f=c.getTile(T))}const P=O=>{z.forEach(j=>{_[j]=O}),z.length=0};for(S-=1;S>=C&&(!f||!f.hasData());S--){f&&P(f.tileID.key);const O=T.calculateScaledKey(S);if(f=c.getTileByID(O),f&&f.hasData())break;const j=_[O];if(j===null)break;j===void 0?z.push(O):f=c.getTileByID(j)}return P(f?f.tileID.key:null),f&&f.hasData()?f:null}findDEMTileFor(o){return this.enabled?this._findTileCoveringTileID(o,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(o,c){let f=this._tilesDirty[o];f||(f=this._tilesDirty[o]={}),f[c.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const o=function(c){let f=0;const _=new s.StructArrayLayout2ui4,x=131;for(let T=1;T<129;T++){for(let S=1;S<129;S++)f=T*x+S,_.emplaceBack(f,f+1),_.emplaceBack(f,f+x),_.emplaceBack(f+1,f+x),T===128&&_.emplaceBack(f+x,f+x+1);_.emplaceBack(f+1,f+1+x)}return _}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(o),this.wireframeSegments=s.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,o.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class Wt{static cacheKey(o,c,f,_){let x=`${c}${_?_.cacheKey:""}`;for(const T of f)o.usedDefines.includes(T)&&(x+=`/${T}`);return x}constructor(o,c,f,_,x,T){const S=o.gl;this.program=S.createProgram();const C=function(B){const q=[];for(let Q=0;Q`#define ${B}`));const j=o.isWebGL2?`#version 300 es -`:"",W=j+O.concat(o.extStandardDerivatives&&j.length===0?`#extension GL_OES_standard_derivatives : enable -`.concat(Rh):Rh,Rh,zc,ff.fragmentSource,ma.fragmentSource,f.fragmentSource).join(` -`),H=j+O.concat(` -#ifdef GL_ES -precision highp float; -#else - -#if !defined(lowp) -#define lowp -#endif - -#if !defined(mediump) -#define mediump -#endif - -#if !defined(highp) -#define highp -#endif - -#endif`,zc,ff.vertexSource,ma.vertexSource,Pc.vertexSource,f.vertexSource).join(` -`),Z=S.createShader(S.FRAGMENT_SHADER);if(S.isContextLost())return void(this.failedToCreate=!0);S.shaderSource(Z,W),S.compileShader(Z),S.attachShader(this.program,Z);const X=S.createShader(S.VERTEX_SHADER);if(S.isContextLost())this.failedToCreate=!0;else{S.shaderSource(X,H),S.compileShader(X),S.attachShader(this.program,X),this.attributes={},this.numAttributes=P.length;for(let B=0;B({u_dem:new s.Uniform1i(B),u_dem_prev:new s.Uniform1i(B),u_dem_unpack:new s.Uniform4f(B),u_dem_tl:new s.Uniform2f(B),u_dem_scale:new s.Uniform1f(B),u_dem_tl_prev:new s.Uniform2f(B),u_dem_scale_prev:new s.Uniform1f(B),u_dem_size:new s.Uniform1f(B),u_dem_lerp:new s.Uniform1f(B),u_exaggeration:new s.Uniform1f(B),u_depth:new s.Uniform1i(B),u_depth_size_inv:new s.Uniform2f(B),u_meter_to_dem:new s.Uniform1f(B),u_label_plane_matrix_inv:new s.UniformMatrix4f(B)}))(o)),T.includes("GLOBE")&&(this.globeUniforms=(B=>({u_tile_tl_up:new s.Uniform3f(B),u_tile_tr_up:new s.Uniform3f(B),u_tile_br_up:new s.Uniform3f(B),u_tile_bl_up:new s.Uniform3f(B),u_tile_up_scale:new s.Uniform1f(B)}))(o)),T.includes("FOG")&&(this.fogUniforms=(B=>({u_fog_matrix:new s.UniformMatrix4f(B),u_fog_range:new s.Uniform2f(B),u_fog_color:new s.Uniform4f(B),u_fog_horizon_blend:new s.Uniform1f(B),u_fog_temporal_offset:new s.Uniform1f(B),u_frustum_tl:new s.Uniform3f(B),u_frustum_tr:new s.Uniform3f(B),u_frustum_br:new s.Uniform3f(B),u_frustum_bl:new s.Uniform3f(B),u_globe_pos:new s.Uniform3f(B),u_globe_radius:new s.Uniform1f(B),u_globe_transition:new s.Uniform1f(B),u_is_globe:new s.Uniform1i(B),u_viewport:new s.Uniform2f(B)}))(o))}}setTerrainUniformValues(o,c){if(!this.terrainUniforms)return;const f=this.terrainUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_]&&f[_].set(this.program,_,c[_])}}setGlobeUniformValues(o,c){if(!this.globeUniforms)return;const f=this.globeUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_]&&f[_].set(this.program,_,c[_])}}setFogUniformValues(o,c){if(!this.fogUniforms)return;const f=this.fogUniforms;if(!this.failedToCreate){o.program.set(this.program);for(const _ in c)f[_].set(this.program,_,c[_])}}draw(o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z){const X=o.gl;if(this.failedToCreate)return;o.program.set(this.program),o.setDepthMode(f),o.setStencilMode(_),o.setColorMode(x),o.setCullFace(T);for(const q of Object.keys(this.fixedUniforms))this.fixedUniforms[q].set(this.program,q,S[q]);H&&H.setUniforms(this.program,o,this.binderUniforms,j,{zoom:W});const B={[X.LINES]:2,[X.TRIANGLES]:3,[X.LINE_STRIP]:1}[c];for(const q of O.get()){const Q=q.vaos||(q.vaos={});(Q[C]||(Q[C]=new W_)).bind(o,this,z,H?H.getPaintVertexBuffers():[],P,q.vertexOffset,Z||[]),X.drawElements(c,q.primitiveLength*B,X.UNSIGNED_SHORT,q.primitiveOffset*B*2)}}}function Ml(d,o){const c=Math.pow(2,o.tileID.overscaledZ),f=o.tileSize*Math.pow(2,d.transform.tileZoom)/c,_=f*(o.tileID.canonical.x+o.tileID.wrap*c),x=f*o.tileID.canonical.y;return{u_image:0,u_texsize:o.imageAtlasTexture.size,u_tile_units_to_pixels:1/Bt(o,1,d.transform.tileZoom),u_pixel_coord_upper:[_>>16,x>>16],u_pixel_coord_lower:[65535&_,65535&x]}}const yf=s.create(),Vh=(d,o,c,f,_,x,T,S,C,z,P)=>{const O=o.style.light,j=O.properties.get("position"),W=[j.x,j.y,j.z],H=s.create$1();O.properties.get("anchor")==="viewport"&&(s.fromRotation(H,-o.transform.angle),s.transformMat3(W,W,H));const Z=O.properties.get("color"),X=o.transform,B={u_matrix:d,u_lightpos:W,u_lightintensity:O.properties.get("intensity"),u_lightcolor:[Z.r,Z.g,Z.b],u_vertical_gradient:+c,u_opacity:f,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:yf,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:_,u_edge_radius:x};return X.projection.name==="globe"&&(B.u_tile_id=[T.canonical.x,T.canonical.y,1<{const j=Vh(d,o,c,f,_,x,T,C,z,P,O),W={u_height_factor:-Math.pow(2,T.overscaledZ)/S.tileSize/8};return s.extend(j,Ml(o,S),W)},Ls=d=>({u_matrix:d}),$h=(d,o,c)=>s.extend(Ls(d),Ml(o,c)),Z_=(d,o)=>({u_matrix:d,u_world:o}),H_=(d,o,c,f)=>s.extend($h(d,o,c),{u_world:f}),X_=s.create(),Gh=(d,o,c,f,_,x)=>{const T=d.transform,S=T.projection.name==="globe";let C;if(x.paint.get("circle-pitch-alignment")==="map")if(S){const P=s.globePixelsToTileUnits(T.zoom,o.canonical)*T._pixelsPerMercatorPixel;C=Float32Array.from([P,0,0,P])}else C=T.calculatePixelsToTileUnitsMatrix(c);else C=new Float32Array([T.pixelsToGLUnits[0],0,0,T.pixelsToGLUnits[1]]);const z={u_camera_to_center_distance:T.cameraToCenterDistance,u_matrix:d.translatePosMatrix(o.projMatrix,c,x.paint.get("circle-translate"),x.paint.get("circle-translate-anchor")),u_device_pixel_ratio:s.exported.devicePixelRatio,u_extrude_scale:C,u_inv_rot_matrix:X_,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(S){z.u_inv_rot_matrix=f,z.u_merc_center=_,z.u_tile_id=[o.canonical.x,o.canonical.y,1<{const o=[];return d.paint.get("circle-pitch-alignment")==="map"&&o.push("PITCH_WITH_MAP"),d.paint.get("circle-pitch-scale")==="map"&&o.push("SCALE_WITH_MAP"),o},Wh=(d,o,c,f)=>{const _=s.EXTENT/c.tileSize;return{u_matrix:d,u_camera_to_center_distance:o.getCameraToCenterDistance(f),u_extrude_scale:[o.pixelsToGLUnits[0]/_,o.pixelsToGLUnits[1]/_]}},Bc=(d,o,c=1)=>({u_matrix:d,u_color:o,u_overlay:0,u_overlay_scale:c}),xf=s.create(),wf=(d,o,c,f,_,x,T)=>{const S=d.transform,C=S.projection.name==="globe",z=C?s.globePixelsToTileUnits(S.zoom,o.canonical)*S._pixelsPerMercatorPixel:Bt(c,1,x),P={u_matrix:o.projMatrix,u_extrude_scale:z,u_intensity:T,u_inv_rot_matrix:xf,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(C){P.u_inv_rot_matrix=f,P.u_merc_center=_,P.u_tile_id=[o.canonical.x,o.canonical.y,1<{const S=d.transform,C=S.calculatePixelsToTileUnitsMatrix(o);return{u_matrix:Zh(d,o,c,f),u_pixels_to_tile_units:C,u_device_pixel_ratio:x,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:_,u_texsize:zl(c)?o.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:va(o,d.transform),u_alpha_discard_threshold:0,u_trim_offset:T}},Pl=(d,o,c,f,_)=>{const x=d.transform;return{u_matrix:Zh(d,o,c,f),u_texsize:o.imageAtlasTexture.size,u_pixels_to_tile_units:x.calculatePixelsToTileUnitsMatrix(o),u_device_pixel_ratio:_,u_image:0,u_tile_units_to_pixels:va(o,x),u_units_to_pixels:[1/x.pixelsToGLUnits[0],1/x.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function va(d,o){return 1/Bt(d,1,o.tileZoom)}function Zh(d,o,c,f){return d.translatePosMatrix(f||o.tileID.projMatrix,o,c.paint.get("line-translate"),c.paint.get("line-translate-anchor"))}function zl(d){const o=d.paint.get("line-dasharray").value;return o.value||o.kind!=="constant"}const Hh=(d,o,c,f,_,x)=>{return{u_matrix:d,u_tl_parent:o,u_scale_parent:c,u_fade_t:f.mix,u_opacity:f.opacity*_.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:_.paint.get("raster-brightness-min"),u_brightness_high:_.paint.get("raster-brightness-max"),u_saturation_factor:(S=_.paint.get("raster-saturation"),S>0?1-1/(1.001-S):-S),u_contrast_factor:(T=_.paint.get("raster-contrast"),T>0?1/(1-T):1+T),u_spin_weights:no(_.paint.get("raster-hue-rotate")),u_perspective_transform:x};var T,S};function no(d){d*=Math.PI/180;const o=Math.sin(d),c=Math.cos(d);return[(2*c+1)/3,(-Math.sqrt(3)*o-c+1)/3,(Math.sqrt(3)*o-c+1)/3]}const Fc=s.create(),Xh=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z)=>{const X=_.transform,B={u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:X.cameraToCenterDistance,u_rotate_symbol:+c,u_aspect_ratio:X.width/X.height,u_fade_change:_.options.fadeDuration?_.symbolFadeChange:1,u_matrix:x,u_label_plane_matrix:T,u_coord_matrix:S,u_is_text:+C,u_pitch_with_map:+f,u_texsize:z,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Fc,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Fc,u_up_vector:[0,-1,0]};return Z.name==="globe"&&(B.u_tile_id=[P.canonical.x,P.canonical.y,1<s.extend(Xh(d,o,c,f,_,x,T,S,C,z,O,j,W,H,Z,X),{u_gamma_scale:f?_.transform.cameraToCenterDistance*Math.cos(_.terrain?0:_.transform._pitch):1,u_device_pixel_ratio:s.exported.devicePixelRatio,u_is_halo:+P}),bf=(d,o,c,f,_,x,T,S,C,z,P,O,j,W,H,Z)=>s.extend(Nc(d,o,c,f,_,x,T,S,!0,C,!0,P,O,j,W,H,Z),{u_texsize_icon:z,u_texture_icon:1}),Kh=(d,o,c)=>({u_matrix:d,u_opacity:o,u_color:c}),Y_=(d,o,c,f,_)=>s.extend(function(x,T,S){const C=T.imageManager.getPattern(x.toString()),{width:z,height:P}=T.imageManager.getPixelSize(),O=Math.pow(2,S.tileID.overscaledZ),j=S.tileSize*Math.pow(2,T.transform.tileZoom)/O,W=j*(S.tileID.canonical.x+S.tileID.wrap*O),H=j*S.tileID.canonical.y;return{u_image:0,u_pattern_tl:C.tl,u_pattern_br:C.br,u_texsize:[z,P],u_pattern_size:C.displaySize,u_tile_units_to_pixels:1/Bt(S,1,T.transform.tileZoom),u_pixel_coord_upper:[W>>16,H>>16],u_pixel_coord_lower:[65535&W,65535&H]}}(f,c,_),{u_matrix:d,u_opacity:o}),Yh={fillExtrusion:d=>({u_matrix:new s.UniformMatrix4f(d),u_lightpos:new s.Uniform3f(d),u_lightintensity:new s.Uniform1f(d),u_lightcolor:new s.Uniform3f(d),u_vertical_gradient:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_edge_radius:new s.Uniform1f(d),u_ao:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_up_dir:new s.Uniform3f(d),u_height_lift:new s.Uniform1f(d)}),fillExtrusionPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_lightpos:new s.Uniform3f(d),u_lightintensity:new s.Uniform1f(d),u_lightcolor:new s.Uniform3f(d),u_vertical_gradient:new s.Uniform1f(d),u_height_factor:new s.Uniform1f(d),u_edge_radius:new s.Uniform1f(d),u_ao:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_up_dir:new s.Uniform3f(d),u_height_lift:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d)}),fill:d=>({u_matrix:new s.UniformMatrix4f(d)}),fillPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),fillOutline:d=>({u_matrix:new s.UniformMatrix4f(d),u_world:new s.Uniform2f(d)}),fillOutlinePattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_world:new s.Uniform2f(d),u_image:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),circle:d=>({u_camera_to_center_distance:new s.Uniform1f(d),u_extrude_scale:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_up_dir:new s.Uniform3f(d)}),collisionBox:d=>({u_matrix:new s.UniformMatrix4f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_extrude_scale:new s.Uniform2f(d)}),collisionCircle:d=>({u_matrix:new s.UniformMatrix4f(d),u_inv_matrix:new s.UniformMatrix4f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_viewport_size:new s.Uniform2f(d)}),debug:d=>({u_color:new s.UniformColor(d),u_matrix:new s.UniformMatrix4f(d),u_overlay:new s.Uniform1i(d),u_overlay_scale:new s.Uniform1f(d)}),clippingMask:d=>({u_matrix:new s.UniformMatrix4f(d)}),heatmap:d=>({u_extrude_scale:new s.Uniform1f(d),u_intensity:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_up_dir:new s.Uniform3f(d)}),heatmapTexture:d=>({u_image:new s.Uniform1i(d),u_color_ramp:new s.Uniform1i(d),u_opacity:new s.Uniform1f(d)}),hillshade:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_latrange:new s.Uniform2f(d),u_light:new s.Uniform2f(d),u_shadow:new s.UniformColor(d),u_highlight:new s.UniformColor(d),u_accent:new s.UniformColor(d)}),hillshadePrepare:d=>({u_matrix:new s.UniformMatrix4f(d),u_image:new s.Uniform1i(d),u_dimension:new s.Uniform2f(d),u_zoom:new s.Uniform1f(d),u_unpack:new s.Uniform4f(d)}),line:d=>({u_matrix:new s.UniformMatrix4f(d),u_pixels_to_tile_units:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_units_to_pixels:new s.Uniform2f(d),u_dash_image:new s.Uniform1i(d),u_gradient_image:new s.Uniform1i(d),u_image_height:new s.Uniform1f(d),u_texsize:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_alpha_discard_threshold:new s.Uniform1f(d),u_trim_offset:new s.Uniform2f(d)}),linePattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_texsize:new s.Uniform2f(d),u_pixels_to_tile_units:new s.UniformMatrix2f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_units_to_pixels:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d),u_alpha_discard_threshold:new s.Uniform1f(d)}),raster:d=>({u_matrix:new s.UniformMatrix4f(d),u_tl_parent:new s.Uniform2f(d),u_scale_parent:new s.Uniform1f(d),u_fade_t:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_image0:new s.Uniform1i(d),u_image1:new s.Uniform1i(d),u_brightness_low:new s.Uniform1f(d),u_brightness_high:new s.Uniform1f(d),u_saturation_factor:new s.Uniform1f(d),u_contrast_factor:new s.Uniform1f(d),u_spin_weights:new s.Uniform3f(d),u_perspective_transform:new s.Uniform2f(d)}),symbolIcon:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_camera_forward:new s.Uniform3f(d),u_tile_matrix:new s.UniformMatrix4f(d),u_up_vector:new s.Uniform3f(d),u_ecef_origin:new s.Uniform3f(d),u_texture:new s.Uniform1i(d)}),symbolSDF:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_texture:new s.Uniform1i(d),u_gamma_scale:new s.Uniform1f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_tile_id:new s.Uniform3f(d),u_zoom_transition:new s.Uniform1f(d),u_inv_rot_matrix:new s.UniformMatrix4f(d),u_merc_center:new s.Uniform2f(d),u_camera_forward:new s.Uniform3f(d),u_tile_matrix:new s.UniformMatrix4f(d),u_up_vector:new s.Uniform3f(d),u_ecef_origin:new s.Uniform3f(d),u_is_halo:new s.Uniform1i(d)}),symbolTextAndIcon:d=>({u_is_size_zoom_constant:new s.Uniform1i(d),u_is_size_feature_constant:new s.Uniform1i(d),u_size_t:new s.Uniform1f(d),u_size:new s.Uniform1f(d),u_camera_to_center_distance:new s.Uniform1f(d),u_rotate_symbol:new s.Uniform1i(d),u_aspect_ratio:new s.Uniform1f(d),u_fade_change:new s.Uniform1f(d),u_matrix:new s.UniformMatrix4f(d),u_label_plane_matrix:new s.UniformMatrix4f(d),u_coord_matrix:new s.UniformMatrix4f(d),u_is_text:new s.Uniform1i(d),u_pitch_with_map:new s.Uniform1i(d),u_texsize:new s.Uniform2f(d),u_texsize_icon:new s.Uniform2f(d),u_texture:new s.Uniform1i(d),u_texture_icon:new s.Uniform1i(d),u_gamma_scale:new s.Uniform1f(d),u_device_pixel_ratio:new s.Uniform1f(d),u_is_halo:new s.Uniform1i(d)}),background:d=>({u_matrix:new s.UniformMatrix4f(d),u_opacity:new s.Uniform1f(d),u_color:new s.UniformColor(d)}),backgroundPattern:d=>({u_matrix:new s.UniformMatrix4f(d),u_opacity:new s.Uniform1f(d),u_image:new s.Uniform1i(d),u_pattern_tl:new s.Uniform2f(d),u_pattern_br:new s.Uniform2f(d),u_texsize:new s.Uniform2f(d),u_pattern_size:new s.Uniform2f(d),u_pixel_coord_upper:new s.Uniform2f(d),u_pixel_coord_lower:new s.Uniform2f(d),u_tile_units_to_pixels:new s.Uniform1f(d)}),terrainRaster:Fh,terrainDepth:Fh,skybox:d=>({u_matrix:new s.UniformMatrix4f(d),u_sun_direction:new s.Uniform3f(d),u_cubemap:new s.Uniform1i(d),u_opacity:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d)}),skyboxGradient:d=>({u_matrix:new s.UniformMatrix4f(d),u_color_ramp:new s.Uniform1i(d),u_center_direction:new s.Uniform3f(d),u_radius:new s.Uniform1f(d),u_opacity:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d)}),skyboxCapture:d=>({u_matrix_3f:new s.UniformMatrix3f(d),u_sun_direction:new s.Uniform3f(d),u_sun_intensity:new s.Uniform1f(d),u_color_tint_r:new s.Uniform4f(d),u_color_tint_m:new s.Uniform4f(d),u_luminance:new s.Uniform1f(d)}),globeRaster:d=>({u_proj_matrix:new s.UniformMatrix4f(d),u_globe_matrix:new s.UniformMatrix4f(d),u_normalize_matrix:new s.UniformMatrix4f(d),u_merc_matrix:new s.UniformMatrix4f(d),u_zoom_transition:new s.Uniform1f(d),u_merc_center:new s.Uniform2f(d),u_image0:new s.Uniform1i(d),u_grid_matrix:new s.UniformMatrix3f(d),u_skirt_height:new s.Uniform1f(d),u_frustum_tl:new s.Uniform3f(d),u_frustum_tr:new s.Uniform3f(d),u_frustum_br:new s.Uniform3f(d),u_frustum_bl:new s.Uniform3f(d),u_globe_pos:new s.Uniform3f(d),u_globe_radius:new s.Uniform1f(d),u_viewport:new s.Uniform2f(d)}),globeAtmosphere:d=>({u_frustum_tl:new s.Uniform3f(d),u_frustum_tr:new s.Uniform3f(d),u_frustum_br:new s.Uniform3f(d),u_frustum_bl:new s.Uniform3f(d),u_horizon:new s.Uniform1f(d),u_transition:new s.Uniform1f(d),u_fadeout_range:new s.Uniform1f(d),u_color:new s.Uniform4f(d),u_high_color:new s.Uniform4f(d),u_space_color:new s.Uniform4f(d),u_star_intensity:new s.Uniform1f(d),u_star_density:new s.Uniform1f(d),u_star_size:new s.Uniform1f(d),u_temporal_offset:new s.Uniform1f(d),u_horizon_angle:new s.Uniform1f(d),u_rotation_matrix:new s.UniformMatrix4f(d)})};let Uc;function Ll(d,o,c,f,_,x,T){const S=d.context,C=S.gl,z=d.transform,P=d.useProgram("collisionBox"),O=[];let j=0,W=0;for(let ee=0;ee0){const Ee=s.create(),Fe=ye;s.mul(Ee,pe.placementInvProjMatrix,z.glCoordMatrix),s.mul(Ee,Ee,pe.placementViewportMatrix),O.push({circleArray:We,circleOffset:W,transform:Fe,invTransform:Ee,projection:pe.getProjection()}),j+=We.length/4,W=j}Ae&&(d.terrain&&d.terrain.setupElevationDraw(fe,P),P.draw(S,C.LINES,s.DepthMode.disabled,s.StencilMode.disabled,d.colorModeForRenderPass(),s.CullFaceMode.disabled,Wh(ye,z,fe,pe.getProjection()),c.id,Ae.layoutVertexBuffer,Ae.indexBuffer,Ae.segments,null,z.zoom,null,[Ae.collisionVertexBuffer,Ae.collisionVertexBufferExt]))}if(!T||!O.length)return;const H=d.useProgram("collisionCircle"),Z=new s.StructArrayLayout2f1f2i16;Z.resize(4*j),Z._trim();let X=0;for(const ee of O)for(let de=0;de=0&&(H[ee.associatedIconIndex]={x:Ee,y:Fe,z:ke,angle:$e})}else Ri(pe,j)}if(P){W.clear();const Q=d.icon.placedSymbolArray;for(let ee=0;eeEe.sortKey-Fe.sortKey);for(const Ee of ye){const Fe=Ee.state;if(d.terrain&&d.terrain.setupElevationDraw(Fe.tile,Fe.program,{useDepthForOcclusion:!xe,labelPlaneMatrixInv:Fe.labelPlaneMatrixInv}),j.activeTexture.set(W.TEXTURE0),Fe.atlasTexture.bind(Fe.atlasInterpolation,W.CLAMP_TO_EDGE),Fe.atlasTextureIcon&&(j.activeTexture.set(W.TEXTURE1),Fe.atlasTextureIcon&&Fe.atlasTextureIcon.bind(Fe.atlasInterpolationIcon,W.CLAMP_TO_EDGE)),Fe.isSDF){const ke=Fe.uniformValues;Fe.hasHalo&&(ke.u_is_halo=1,Rl(Fe.buffers,Ee.segments,c,d,Fe.program,de,P,O,ke)),ke.u_is_halo=0}Rl(Fe.buffers,Ee.segments,c,d,Fe.program,de,P,O,Fe.uniformValues)}}function Rl(d,o,c,f,_,x,T,S,C){const z=f.context,P=[d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer,d.globeExtVertexBuffer];_.draw(z,z.gl.TRIANGLES,x,T,S,s.CullFaceMode.disabled,C,c.id,d.layoutVertexBuffer,d.indexBuffer,o,c.paint,f.transform.zoom,d.programConfigurations.get(c.id),P)}function Sf(d,o,c,f,_,x,T){const S=d.context.gl,C=c.paint.get("fill-pattern"),z=C&&C.constantOr(1);let P,O,j,W,H;T?(O=z&&!c.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",P=S.LINES):(O=z?"fillPattern":"fill",P=S.TRIANGLES);for(const Z of f){const X=o.getTile(Z);if(z&&!X.patternsLoaded())continue;const B=X.getBucket(c);if(!B)continue;d.prepareDrawTile();const q=B.programConfigurations.get(c.id),Q=d.useProgram(O,q);z&&(d.context.activeTexture.set(S.TEXTURE0),X.imageAtlasTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),q.updatePaintBuffers());const ee=C.constantOr(null);if(ee&&X.imageAtlas){const fe=X.imageAtlas.patternPositions[ee.toString()];fe&&q.setConstantPatternPositions(fe)}const de=d.translatePosMatrix(Z.projMatrix,X,c.paint.get("fill-translate"),c.paint.get("fill-translate-anchor"));if(T){W=B.indexBuffer2,H=B.segments2;const fe=d.terrain&&d.terrain.renderingToTexture?d.terrain.drapeBufferSize:[S.drawingBufferWidth,S.drawingBufferHeight];j=O==="fillOutlinePattern"&&z?H_(de,d,X,fe):Z_(de,fe)}else W=B.indexBuffer,H=B.segments,j=z?$h(de,d,X):Ls(de);d.prepareDrawProgram(d.context,Q,Z.toUnwrapped()),Q.draw(d.context,P,_,d.stencilModeForClipping(Z),x,s.CullFaceMode.disabled,j,c.id,B.layoutVertexBuffer,W,H,c.paint,d.transform.zoom,q)}}function jc(d,o,c,f,_,x,T){const S=d.context,C=S.gl,z=d.transform,P=c.paint.get("fill-extrusion-pattern"),O=P.constantOr(1),j=c.paint.get("fill-extrusion-opacity"),W=[c.paint.get("fill-extrusion-ambient-occlusion-intensity"),c.paint.get("fill-extrusion-ambient-occlusion-radius")],H=c.layout.get("fill-extrusion-edge-radius"),Z=H>0&&!c.paint.get("fill-extrusion-rounded-roof"),X=Z?0:H,B=z.projection.name==="globe"?s.fillExtrusionHeightLift():0,q=z.projection.name==="globe",Q=q?s.globeToMercatorTransition(z.zoom):0,ee=[s.mercatorXfromLng(z.center.lng),s.mercatorYfromLat(z.center.lat)],de=[];q&&de.push("PROJECTION_GLOBE_VIEW"),W[0]>0&&de.push("FAUX_AO"),Z&&de.push("ZERO_ROOF_RADIUS");for(const fe of f){const pe=o.getTile(fe),xe=pe.getBucket(c);if(!xe||xe.projection.name!==z.projection.name)continue;const ye=xe.programConfigurations.get(c.id),Ae=d.useProgram(O?"fillExtrusionPattern":"fillExtrusion",ye,de);if(d.terrain){const Be=d.terrain;if(d.style.terrainSetForDrapingOnly())Be.setupElevationDraw(pe,Ae,{useMeterToDem:!0});else{if(!xe.enableTerrain)continue;if(Be.setupElevationDraw(pe,Ae,{useMeterToDem:!0}),Af(S,o,fe,xe,c,Be),!xe.centroidVertexBuffer){const Xe=Ae.attributes.a_centroid_pos;Xe!==void 0&&C.vertexAttrib2f(Xe,0,0)}}}O&&(d.context.activeTexture.set(C.TEXTURE0),pe.imageAtlasTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),ye.updatePaintBuffers());const We=P.constantOr(null);if(We&&pe.imageAtlas){const Be=pe.imageAtlas.patternPositions[We.toString()];Be&&ye.setConstantPatternPositions(Be)}const Ee=d.translatePosMatrix(fe.projMatrix,pe,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),Fe=z.projection.createInversionMatrix(z,fe.canonical),ke=c.paint.get("fill-extrusion-vertical-gradient"),qe=O?vf(Ee,d,ke,j,W,X,fe,pe,B,Q,ee,Fe):Vh(Ee,d,ke,j,W,X,fe,B,Q,ee,Fe);d.prepareDrawProgram(S,Ae,fe.toUnwrapped());const Se=[];d.terrain&&Se.push(xe.centroidVertexBuffer),q&&Se.push(xe.layoutVertexExtBuffer),Ae.draw(S,S.gl.TRIANGLES,_,x,T,s.CullFaceMode.backCCW,qe,c.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,c.paint,d.transform.zoom,ye,Se)}}function Af(d,o,c,f,_,x){const T=[B=>{let q=B.canonical.x-1,Q=B.wrap;return q<0&&(q=(1<{let q=B.canonical.x+1,Q=B.wrap;return q===1<new s.OverscaledTileID(B.overscaledZ,B.wrap,B.canonical.z,B.canonical.x,(B.canonical.y===0?1<new s.OverscaledTileID(B.overscaledZ,B.wrap,B.canonical.z,B.canonical.x,B.canonical.y===(1<{const q=o.getSource().minzoom,Q=de=>{const fe=o.getTileByID(de);if(fe&&fe.hasData())return fe.getBucket(_)},ee=[0,-1,1];for(const de of ee){if(B.overscaledZ+de(C[0]=Math.min(B.min.y,q.min.y),C[1]=Math.max(B.max.y,q.max.y),C[2]=s.EXTENT-q.min.x>B.max.x?q.min.x-s.EXTENT:B.max.x,C),P=(B,q)=>(C[0]=Math.min(B.min.x,q.min.x),C[1]=Math.max(B.max.x,q.max.x),C[2]=s.EXTENT-q.min.y>B.max.y?q.min.y-s.EXTENT:B.max.y,C),O=[(B,q)=>z(B,q),(B,q)=>z(q,B),(B,q)=>P(B,q),(B,q)=>P(q,B)],j=new s.Point(0,0);let W,H,Z;const X=(B,q,Q,ee,de)=>{const fe=[[ee?Q:B,ee?B:Q,0],[ee?Q:q,ee?q:Q,0]],pe=de<0?s.EXTENT+de:de,xe=[ee?pe:(B+q)/2,ee?(B+q)/2:pe,0];return Q===0&&de<0||Q!==0&&de>0?x.getForTilePoints(Z,[xe],!0,H):fe.push(xe),x.getForTilePoints(c,fe,!0,W),Math.max(fe[0][2],fe[1][2],xe[2])/x.exaggeration()};for(let B=0;B<4;B++){const q=(B<2?1:5)-B,Q=f.borders[B];if(Q.length===0)continue;const ee=Z=T[B](c),de=S(ee);if(!(de&&de instanceof s.FillExtrusionBucket&&de.enableTerrain)||f.borderDoneWithNeighborZ[B]===de.canonical.z&&de.borderDoneWithNeighborZ[q]===f.canonical.z||(H=x.findDEMTileFor(ee),!H||!H.dem))continue;if(!W){const ye=x.findDEMTileFor(c);if(!ye||!ye.dem)return;W=ye}const fe=de.borders[q];let pe=0;const xe=de.borderDoneWithNeighborZ[q]!==f.canonical.z;if(f.canonical.z===de.canonical.z){for(let ye=0;yeWe[0]+3));)xe&&de.encodeCentroid(void 0,Ee,!1),pe++;if(Ee&&peWe[1]-3)&&(ke++,++pe!==fe.length);)Ee=de.featuresOnBorder[fe[pe]];if(Ee=de.featuresOnBorder[fe[Fe]],Ae.intersectsCount()>1||Ee.intersectsCount()>1||ke!==1){ke!==1&&(pe=Fe),f.encodeCentroid(void 0,Ae,!1),xe&&de.encodeCentroid(void 0,Ee,!1);continue}const qe=O[B](Ae,Ee),Se=B%2?s.EXTENT-1:0;j.x=X(qe[0],Math.min(s.EXTENT-1,qe[1]),Se,B<2,qe[2]),j.y=0,f.encodeCentroid(j,Ae,!1),xe&&de.encodeCentroid(j,Ee,!1)}else f.encodeCentroid(void 0,Ae,!1)}f.borderDoneWithNeighborZ[B]=de.canonical.z,f.needsCentroidUpdate=!0,xe&&(de.borderDoneWithNeighborZ[q]=f.canonical.z,de.needsCentroidUpdate=!0)}else{for(const ye of Q)f.encodeCentroid(void 0,f.featuresOnBorder[ye],!1);if(xe){for(const ye of fe)de.encodeCentroid(void 0,de.featuresOnBorder[ye],!1);de.borderDoneWithNeighborZ[q]=f.canonical.z,de.needsCentroidUpdate=!0}f.borderDoneWithNeighborZ[B]=de.canonical.z,f.needsCentroidUpdate=!0}}(f.needsCentroidUpdate||!f.centroidVertexBuffer&&f.centroidVertexArray.length!==0)&&f.uploadCentroid(d)}const xa=new s.Color(1,0,0,1),Q_=new s.Color(0,1,0,1),ey=new s.Color(0,0,1,1),ty=new s.Color(1,0,1,1),ny=new s.Color(0,1,1,1);function ry(d,o,c){const f=d.context,_=d.transform,x=f.gl,T=_.projection.name==="globe",S=T?["PROJECTION_GLOBE_VIEW"]:null;let C=c.projMatrix;if(T&&s.globeToMercatorTransition(_.zoom)>0){const Ae=s.transitionTileAABBinECEF(c.canonical,_),We=s.globeDenormalizeECEF(Ae);C=s.multiply(new Float32Array(16),_.globeMatrix,We),s.multiply(C,_.projMatrix,C)}const z=d.useProgram("debug",null,S),P=o.getTileByID(c.key);d.terrain&&d.terrain.setupElevationDraw(P,z);const O=s.DepthMode.disabled,j=s.StencilMode.disabled,W=d.colorModeForRenderPass(),H="$debug";f.activeTexture.set(x.TEXTURE0),d.emptyTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),T?P._makeGlobeTileDebugBuffers(d.context,_):P._makeDebugTileBoundsBuffers(d.context,_.projection);const Z=P._tileDebugBuffer||d.debugBuffer,X=P._tileDebugIndexBuffer||d.debugIndexBuffer,B=P._tileDebugSegments||d.debugSegments;z.draw(f,x.LINE_STRIP,O,j,W,s.CullFaceMode.disabled,Bc(C,s.Color.red),H,Z,X,B,null,null,null,[P._globeTileDebugBorderBuffer]);const q=P.latestRawTileData,Q=Math.floor((q&&q.byteLength||0)/1024),ee=o.getTile(c).tileSize,de=512/Math.min(ee,512)*(c.overscaledZ/_.zoom)*.5;let fe=c.canonical.toString();c.overscaledZ!==c.canonical.z&&(fe+=` => ${c.overscaledZ}`),fe+=` ${Q}kb`,function(Ae,We){Ae.initDebugOverlayCanvas();const Ee=Ae.debugOverlayCanvas,Fe=Ae.context.gl,ke=Ae.debugOverlayCanvas.getContext("2d");ke.clearRect(0,0,Ee.width,Ee.height),ke.shadowColor="white",ke.shadowBlur=2,ke.lineWidth=1.5,ke.strokeStyle="white",ke.textBaseline="top",ke.font="bold 36px Open Sans, sans-serif",ke.fillText(We,5,5),ke.strokeText(We,5,5),Ae.debugOverlayTexture.update(Ee),Ae.debugOverlayTexture.bind(Fe.LINEAR,Fe.CLAMP_TO_EDGE)}(d,fe);const pe=P._tileDebugTextBuffer||d.debugBuffer,xe=P._tileDebugTextIndexBuffer||d.quadTriangleIndexBuffer,ye=P._tileDebugTextSegments||d.debugSegments;z.draw(f,x.TRIANGLES,O,j,s.ColorMode.alphaBlended,s.CullFaceMode.disabled,Bc(C,s.Color.transparent,de),H,pe,xe,ye,null,null,null,[P._globeTileDebugTextBuffer])}function Cf(d,o,c,f){wa(d,0,o+c/2,d.transform.width,c,f)}function Vc(d,o,c,f){wa(d,o-c/2,0,c,d.transform.height,f)}function wa(d,o,c,f,_,x){const T=d.context,S=T.gl;S.enable(S.SCISSOR_TEST),S.scissor(o*s.exported.devicePixelRatio,c*s.exported.devicePixelRatio,f*s.exported.devicePixelRatio,_*s.exported.devicePixelRatio),T.clear({color:x}),S.disable(S.SCISSOR_TEST)}const If=s.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:kf}=If;function Io(d,o,c,f){d.emplaceBack(o,c,f)}class $c{constructor(o){this.vertexArray=new s.StructArrayLayout3f12,this.indices=new s.StructArrayLayout3ui6,Io(this.vertexArray,-1,-1,1),Io(this.vertexArray,1,-1,1),Io(this.vertexArray,-1,1,1),Io(this.vertexArray,1,1,1),Io(this.vertexArray,-1,-1,-1),Io(this.vertexArray,1,-1,-1),Io(this.vertexArray,-1,1,-1),Io(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=o.createVertexBuffer(this.vertexArray,kf),this.indexBuffer=o.createIndexBuffer(this.indices),this.segment=s.SegmentVector.simpleSegment(0,0,36,12)}}function _i(d,o,c,f,_,x){const T=d.gl,S=o.paint.get("sky-atmosphere-color"),C=o.paint.get("sky-atmosphere-halo-color"),z=o.paint.get("sky-atmosphere-sun-intensity"),P=((O,j,W,H,Z)=>({u_matrix_3f:O,u_sun_direction:j,u_sun_intensity:W,u_color_tint_r:[H.r,H.g,H.b,H.a],u_color_tint_m:[Z.r,Z.g,Z.b,Z.a],u_luminance:5e-5}))(s.fromMat4(s.create$1(),f),_,z,S,C);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+x,o.skyboxTexture,0),c.draw(d,T.TRIANGLES,s.DepthMode.disabled,s.StencilMode.disabled,s.ColorMode.unblended,s.CullFaceMode.frontCW,P,"skyboxCapture",o.skyboxGeometry.vertexBuffer,o.skyboxGeometry.indexBuffer,o.skyboxGeometry.segment)}const Dl=s.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Mf{constructor(o){const c=new s.StructArrayLayout5f20;c.emplaceBack(-1,1,1,0,0),c.emplaceBack(1,1,1,1,0),c.emplaceBack(1,-1,1,1,1),c.emplaceBack(-1,-1,1,0,1);const f=new s.StructArrayLayout3ui6;f.emplaceBack(0,1,2),f.emplaceBack(2,3,0),this.vertexBuffer=o.createVertexBuffer(c,Dl.members),this.indexBuffer=o.createIndexBuffer(f),this.segments=s.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Rs={symbol:function(d,o,c,f,_){if(d.renderPass!=="translucent")return;const x=s.StencilMode.disabled,T=d.colorModeForRenderPass();c.layout.get("text-variable-anchor")&&function(S,C,z,P,O,j,W){const H=C.transform,Z=O==="map",X=j==="map";for(const B of S){const q=P.getTile(B),Q=q.getBucket(z);if(!Q||!Q.text||!Q.text.segments.get().length)continue;const ee=s.evaluateSizeForZoom(Q.textSizeData,H.zoom),de=Sn(B,Q.getProjection(),H),fe=H.calculatePixelsToTileUnitsMatrix(q),pe=Re(de,q.tileID.canonical,X,Z,H,Q.getProjection(),fe),xe=z.layout.get("icon-text-fit")!=="none"&&Q.hasIconData();if(ee){const ye=Math.pow(2,H.zoom-q.tileID.overscaledZ);J_(Q,Z,X,W,s.symbolSize,H,pe,B,ye,ee,xe)}}}(f,d,c,o,c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),_),c.paint.get("icon-opacity").constantOr(1)!==0&&Tf(d,o,c,f,!1,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),c.layout.get("icon-rotation-alignment"),c.layout.get("icon-pitch-alignment"),c.layout.get("icon-keep-upright"),x,T),c.paint.get("text-opacity").constantOr(1)!==0&&Tf(d,o,c,f,!0,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),c.layout.get("text-keep-upright"),x,T),o.map.showCollisionBoxes&&(Ll(d,o,c,f,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),!0),Ll(d,o,c,f,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),!1))},circle:function(d,o,c,f){if(d.renderPass!=="translucent")return;const _=c.paint.get("circle-opacity"),x=c.paint.get("circle-stroke-width"),T=c.paint.get("circle-stroke-opacity"),S=c.layout.get("circle-sort-key").constantOr(1)!==void 0;if(_.constantOr(1)===0&&(x.constantOr(1)===0||T.constantOr(1)===0))return;const C=d.context,z=C.gl,P=d.transform,O=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),j=s.StencilMode.disabled,W=d.colorModeForRenderPass(),H=P.projection.name==="globe",Z=[s.mercatorXfromLng(P.center.lng),s.mercatorYfromLat(P.center.lat)],X=[];for(let q=0;qq.sortKey-Q.sortKey);const B={useDepthForOcclusion:!H};for(const q of X){const{programConfiguration:Q,program:ee,layoutVertexBuffer:de,globeExtVertexBuffer:fe,indexBuffer:pe,uniformValues:xe,tile:ye}=q.state,Ae=q.segments;d.terrain&&d.terrain.setupElevationDraw(ye,ee,B),d.prepareDrawProgram(C,ee,ye.tileID.toUnwrapped()),ee.draw(C,z.TRIANGLES,O,j,W,s.CullFaceMode.disabled,xe,c.id,de,pe,Ae,c.paint,P.zoom,Q,[fe])}},heatmap:function(d,o,c,f){if(c.paint.get("heatmap-opacity")!==0)if(d.renderPass==="offscreen"){const _=d.context,x=_.gl,T=s.StencilMode.disabled,S=new s.ColorMode([x.ONE,x.ONE],s.Color.transparent,[!0,!0,!0,!0]);(function(W,H,Z,X){const B=W.gl,q=H.width*X,Q=H.height*X;W.activeTexture.set(B.TEXTURE1),W.viewport.set([0,0,q,Q]);let ee=Z.heatmapFbo;if(!ee||ee&&(ee.width!==q||ee.height!==Q)){ee&&ee.destroy();const de=B.createTexture();B.bindTexture(B.TEXTURE_2D,de),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.LINEAR),ee=Z.heatmapFbo=W.createFramebuffer(q,Q,!1),function(fe,pe,xe,ye,Ae,We){const Ee=fe.gl;Ee.texImage2D(Ee.TEXTURE_2D,0,fe.isWebGL2&&fe.extRenderToTextureHalfFloat?Ee.RGBA16F:Ee.RGBA,Ae,We,0,Ee.RGBA,fe.extRenderToTextureHalfFloat?fe.isWebGL2?Ee.HALF_FLOAT:fe.extTextureHalfFloat.HALF_FLOAT_OES:Ee.UNSIGNED_BYTE,null),ye.colorAttachment.set(xe)}(W,0,de,ee,q,Q)}else B.bindTexture(B.TEXTURE_2D,ee.colorAttachment.get()),W.bindFramebuffer.set(ee.framebuffer)})(_,d,c,d.transform.projection.name==="globe"?.5:.25),_.clear({color:s.Color.transparent});const C=d.transform,z=C.projection.name==="globe",P=z?["PROJECTION_GLOBE_VIEW"]:null,O=z?s.CullFaceMode.frontCCW:s.CullFaceMode.disabled,j=[s.mercatorXfromLng(C.center.lng),s.mercatorYfromLat(C.center.lat)];for(let W=0;W({u_image:0,u_color_ramp:1,u_opacity:O.paint.get("heatmap-opacity")}))(0,x),x.id,_.viewportBuffer,_.quadTriangleIndexBuffer,_.viewportSegments,x.paint,_.transform.zoom)}(d,c))},line:function(d,o,c,f){if(d.renderPass!=="translucent")return;const _=c.paint.get("line-opacity"),x=c.paint.get("line-width");if(_.constantOr(1)===0||x.constantOr(1)===0)return;const T=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),S=d.colorModeForRenderPass(),C=d.terrain&&d.terrain.renderingToTexture?1:s.exported.devicePixelRatio,z=c.paint.get("line-dasharray"),P=z.constantOr(1),O=c.layout.get("line-cap"),j=c.paint.get("line-pattern"),W=j.constantOr(1),H=c.paint.get("line-gradient"),Z=W?"linePattern":"line",X=d.context,B=X.gl,q=(ee=>{const de=[];zl(ee)&&de.push("RENDER_LINE_DASH"),ee.paint.get("line-gradient")&&de.push("RENDER_LINE_GRADIENT");const fe=ee.paint.get("line-trim-offset");fe[0]===0&&fe[1]===0||de.push("RENDER_LINE_TRIM_OFFSET");const pe=ee.paint.get("line-pattern").constantOr(1),xe=ee.paint.get("line-opacity").constantOr(1)!==1;return!pe&&xe&&de.push("RENDER_LINE_ALPHA_DISCARD"),de})(c);let Q=q.includes("RENDER_LINE_ALPHA_DISCARD");d.terrain&&d.terrain.clipOrMaskOverlapStencilType()&&(Q=!1);for(const ee of f){const de=o.getTile(ee);if(W&&!de.patternsLoaded())continue;const fe=de.getBucket(c);if(!fe)continue;d.prepareDrawTile();const pe=fe.programConfigurations.get(c.id),xe=d.useProgram(Z,pe,q),ye=j.constantOr(null);if(ye&&de.imageAtlas){const Be=de.imageAtlas.patternPositions[ye.toString()];Be&&pe.setConstantPatternPositions(Be)}const Ae=z.constantOr(null),We=O.constantOr(null);if(!W&&Ae&&We&&de.lineAtlas){const Be=de.lineAtlas.getDash(Ae,We);Be&&pe.setConstantPatternPositions(Be)}let[Ee,Fe]=c.paint.get("line-trim-offset");(We==="round"||We==="square")&&Ee!==Fe&&(Ee===0&&(Ee-=1),Fe===1&&(Fe+=1));const ke=d.terrain?ee.projMatrix:null,qe=W?Pl(d,de,c,ke,C):K_(d,de,c,ke,fe.lineClipsArray.length,C,[Ee,Fe]);if(H){const Be=fe.gradients[c.id];let Xe=Be.texture;if(c.gradientVersion!==Be.version){let $e=256;if(c.stepInterpolant){const Ye=o.getSource().maxzoom,gt=ee.canonical.z===Ye?Math.ceil(1<{xe.draw(X,B.TRIANGLES,T,Be,S,s.CullFaceMode.disabled,qe,c.id,fe.layoutVertexBuffer,fe.indexBuffer,fe.segments,c.paint,d.transform.zoom,pe,[fe.layoutVertexBuffer2])};if(Q){const Be=d.stencilModeForClipping(ee).ref;Be===0&&d.terrain&&X.clear({stencil:0});const Xe={func:B.EQUAL,mask:255};qe.u_alpha_discard_threshold=.8,Se(new s.StencilMode(Xe,Be,255,B.KEEP,B.KEEP,B.INVERT)),qe.u_alpha_discard_threshold=0,Se(new s.StencilMode(Xe,Be,255,B.KEEP,B.KEEP,B.KEEP))}else Se(d.stencilModeForClipping(ee))}Q&&(d.resetStencilClippingMasks(),d.terrain&&X.clear({stencil:0}))},fill:function(d,o,c,f){const _=c.paint.get("fill-color"),x=c.paint.get("fill-opacity");if(x.constantOr(1)===0)return;const T=d.colorModeForRenderPass(),S=c.paint.get("fill-pattern"),C=d.opaquePassEnabledForLayer()&&!S.constantOr(1)&&_.constantOr(s.Color.transparent).a===1&&x.constantOr(0)===1?"opaque":"translucent";if(d.renderPass===C){const z=d.depthModeForSublayer(1,d.renderPass==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly);Sf(d,o,c,f,z,T,!1)}if(d.renderPass==="translucent"&&c.paint.get("fill-antialias")){const z=d.depthModeForSublayer(c.getPaintProperty("fill-outline-color")?2:0,s.DepthMode.ReadOnly);Sf(d,o,c,f,z,T,!0)}},"fill-extrusion":function(d,o,c,f){const _=c.paint.get("fill-extrusion-opacity");if(_!==0&&d.renderPass==="translucent"){const x=new s.DepthMode(d.context.gl.LEQUAL,s.DepthMode.ReadWrite,d.depthRangeFor3D);if(_!==1||c.paint.get("fill-extrusion-pattern").constantOr(1))jc(d,o,c,f,x,s.StencilMode.disabled,s.ColorMode.disabled),jc(d,o,c,f,x,d.stencilModeFor3D(),d.colorModeForRenderPass()),d.resetStencilClippingMasks();else{const T=d.colorModeForRenderPass();jc(d,o,c,f,x,s.StencilMode.disabled,T)}}},hillshade:function(d,o,c,f){if(d.renderPass!=="offscreen"&&d.renderPass!=="translucent")return;const _=d.context,x=d.depthModeForSublayer(0,s.DepthMode.ReadOnly),T=d.colorModeForRenderPass(),S=d.terrain&&d.terrain.renderingToTexture,[C,z]=d.renderPass!=="translucent"||S?[{},f]:d.stencilConfigForOverlap(f);for(const P of z){const O=o.getTile(P);if(O.needsHillshadePrepare&&d.renderPass==="offscreen")gf(d,O,c,x,s.StencilMode.disabled,T);else if(d.renderPass==="translucent"){const j=S&&d.terrain?d.terrain.stencilModeForRTTOverlap(P):C[P.overscaledZ];mf(d,P,O,c,x,j,T)}}_.viewport.set([0,0,d.width,d.height]),d.resetStencilClippingMasks()},raster:function(d,o,c,f,_,x){if(d.renderPass!=="translucent"||c.paint.get("raster-opacity")===0||!f.length)return;const T=d.context,S=T.gl,C=o.getSource(),z=d.useProgram("raster"),P=d.colorModeForRenderPass(),O=d.terrain&&d.terrain.renderingToTexture,[j,W]=C instanceof Rt||O?[{},f]:d.stencilConfigForOverlap(f),H=W[W.length-1].overscaledZ,Z=!d.options.moving;for(const X of W){const B=O?s.DepthMode.disabled:d.depthModeForSublayer(X.overscaledZ-H,c.paint.get("raster-opacity")===1?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly,S.LESS),q=X.toUnwrapped(),Q=o.getTile(X);if(O&&(!Q||!Q.hasData()))continue;const ee=O?X.projMatrix:d.transform.calculateProjMatrix(q,Z),de=d.terrain&&O?d.terrain.stencilModeForRTTOverlap(X):j[X.overscaledZ],fe=x?0:c.paint.get("raster-fade-duration");Q.registerFadeDuration(fe);const pe=o.findLoadedParent(X,0),xe=Nh(Q,pe,o,d.transform,fe);let ye,Ae;d.terrain&&d.terrain.prepareDrawTile();const We=c.paint.get("raster-resampling")==="nearest"?S.NEAREST:S.LINEAR;T.activeTexture.set(S.TEXTURE0),Q.texture.bind(We,S.CLAMP_TO_EDGE),T.activeTexture.set(S.TEXTURE1),pe?(pe.texture.bind(We,S.CLAMP_TO_EDGE),ye=Math.pow(2,pe.tileID.overscaledZ-Q.tileID.overscaledZ),Ae=[Q.tileID.canonical.x*ye%1,Q.tileID.canonical.y*ye%1]):Q.texture.bind(We,S.CLAMP_TO_EDGE),Q.texture.useMipmap&&T.extTextureFilterAnisotropic&&d.transform.pitch>20&&S.texParameterf(S.TEXTURE_2D,T.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,T.extTextureFilterAnisotropicMax);const Ee=Hh(ee,Ae||[0,0],ye||1,xe,c,C instanceof Rt?C.perspectiveTransform:[0,0]);if(d.prepareDrawProgram(T,z,q),C instanceof Rt)C.boundsBuffer&&C.boundsSegments&&z.draw(T,S.TRIANGLES,B,s.StencilMode.disabled,P,s.CullFaceMode.disabled,Ee,c.id,C.boundsBuffer,d.quadTriangleIndexBuffer,C.boundsSegments);else{const{tileBoundsBuffer:Fe,tileBoundsIndexBuffer:ke,tileBoundsSegments:qe}=d.getTileBoundsBuffers(Q);z.draw(T,S.TRIANGLES,B,de,P,s.CullFaceMode.disabled,Ee,c.id,Fe,ke,qe)}}d.resetStencilClippingMasks()},background:function(d,o,c,f){const _=c.paint.get("background-color"),x=c.paint.get("background-opacity");if(x===0)return;const T=d.context,S=T.gl,C=d.transform,z=C.tileSize,P=c.paint.get("background-pattern");if(d.isPatternMissing(P))return;const O=!P&&_.a===1&&x===1&&d.opaquePassEnabledForLayer()?"opaque":"translucent";if(d.renderPass!==O)return;const j=s.StencilMode.disabled,W=d.depthModeForSublayer(0,O==="opaque"?s.DepthMode.ReadWrite:s.DepthMode.ReadOnly),H=d.colorModeForRenderPass(),Z=d.useProgram(P?"backgroundPattern":"background");let X,B=f;B||(X=d.getBackgroundTiles(),B=Object.values(X).map(q=>q.tileID)),P&&(T.activeTexture.set(S.TEXTURE0),d.imageManager.bind(d.context));for(const q of B){const Q=q.toUnwrapped(),ee=f?q.projMatrix:d.transform.calculateProjMatrix(Q);d.prepareDrawTile();const de=o?o.getTile(q):X?X[q.key]:new s.Tile(q,z,C.zoom,d),fe=P?Y_(ee,x,d,P,{tileID:q,tileSize:z}):Kh(ee,x,_);d.prepareDrawProgram(T,Z,Q);const{tileBoundsBuffer:pe,tileBoundsIndexBuffer:xe,tileBoundsSegments:ye}=d.getTileBoundsBuffers(de);Z.draw(T,S.TRIANGLES,W,j,H,s.CullFaceMode.disabled,fe,c.id,pe,xe,ye)}},sky:function(d,o,c){const f=d.transform,_=f.projection.name==="mercator"||f.projection.name==="globe"?1:s.smoothstep(7,8,f.zoom),x=c.paint.get("sky-opacity")*_;if(x===0)return;const T=d.context,S=c.paint.get("sky-type"),C=new s.DepthMode(T.gl.LEQUAL,s.DepthMode.ReadOnly,[0,1]),z=d.frameCounter/1e3%1;S==="atmosphere"?d.renderPass==="offscreen"?c.needsSkyboxCapture(d)&&(function(P,O,j,W){const H=P.context,Z=H.gl;let X=O.skyboxFbo;if(!X){X=O.skyboxFbo=H.createFramebuffer(32,32,!1),O.skyboxGeometry=new $c(H),O.skyboxTexture=H.gl.createTexture(),Z.bindTexture(Z.TEXTURE_CUBE_MAP,O.skyboxTexture),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_WRAP_S,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_WRAP_T,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_MIN_FILTER,Z.LINEAR),Z.texParameteri(Z.TEXTURE_CUBE_MAP,Z.TEXTURE_MAG_FILTER,Z.LINEAR);for(let ee=0;ee<6;++ee)Z.texImage2D(Z.TEXTURE_CUBE_MAP_POSITIVE_X+ee,0,Z.RGBA,32,32,0,Z.RGBA,Z.UNSIGNED_BYTE,null)}H.bindFramebuffer.set(X.framebuffer),H.viewport.set([0,0,32,32]);const B=O.getCenter(P,!0),q=P.useProgram("skyboxCapture"),Q=new Float64Array(16);s.identity(Q),s.rotateY(Q,Q,.5*-Math.PI),_i(H,O,q,Q,B,0),s.identity(Q),s.rotateY(Q,Q,.5*Math.PI),_i(H,O,q,Q,B,1),s.identity(Q),s.rotateX(Q,Q,.5*-Math.PI),_i(H,O,q,Q,B,2),s.identity(Q),s.rotateX(Q,Q,.5*Math.PI),_i(H,O,q,Q,B,3),s.identity(Q),_i(H,O,q,Q,B,4),s.identity(Q),s.rotateY(Q,Q,Math.PI),_i(H,O,q,Q,B,5),H.viewport.set([0,0,P.width,P.height])}(d,c),c.markSkyboxValid(d)):d.renderPass==="sky"&&function(P,O,j,W,H){const Z=P.context,X=Z.gl,B=P.transform,q=P.useProgram("skybox");Z.activeTexture.set(X.TEXTURE0),X.bindTexture(X.TEXTURE_CUBE_MAP,O.skyboxTexture);const Q=((ee,de,fe,pe,xe)=>({u_matrix:ee,u_sun_direction:de,u_cubemap:0,u_opacity:pe,u_temporal_offset:xe}))(B.skyboxMatrix,O.getCenter(P,!1),0,W,H);P.prepareDrawProgram(Z,q),q.draw(Z,X.TRIANGLES,j,s.StencilMode.disabled,P.colorModeForRenderPass(),s.CullFaceMode.backCW,Q,"skybox",O.skyboxGeometry.vertexBuffer,O.skyboxGeometry.indexBuffer,O.skyboxGeometry.segment)}(d,c,C,x,z):S==="gradient"&&d.renderPass==="sky"&&function(P,O,j,W,H){const Z=P.context,X=Z.gl,B=P.transform,q=P.useProgram("skyboxGradient");O.skyboxGeometry||(O.skyboxGeometry=new $c(Z)),Z.activeTexture.set(X.TEXTURE0);let Q=O.colorRampTexture;Q||(Q=O.colorRampTexture=new s.Texture(Z,O.colorRamp,X.RGBA)),Q.bind(X.LINEAR,X.CLAMP_TO_EDGE);const ee=((de,fe,pe,xe,ye)=>({u_matrix:de,u_color_ramp:0,u_center_direction:fe,u_radius:s.degToRad(pe),u_opacity:xe,u_temporal_offset:ye}))(B.skyboxMatrix,O.getCenter(P,!1),O.paint.get("sky-gradient-radius"),W,H);P.prepareDrawProgram(Z,q),q.draw(Z,X.TRIANGLES,j,s.StencilMode.disabled,P.colorModeForRenderPass(),s.CullFaceMode.backCW,ee,"skyboxGradient",O.skyboxGeometry.vertexBuffer,O.skyboxGeometry.indexBuffer,O.skyboxGeometry.segment)}(d,c,C,x,z)},debug:function(d,o,c){for(let f=0;f_)return void(this.transform.fogCullDistSq=null);const x=f+.78*(_-f);this.transform.fogCullDistSq=x*x}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(o,c){if(this.width=o*s.exported.devicePixelRatio,this.height=c*s.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const f of this.style.order)this.style._layers[f].resize()}setup(){const o=this.context,c=new s.StructArrayLayout2i4;c.emplaceBack(0,0),c.emplaceBack(s.EXTENT,0),c.emplaceBack(0,s.EXTENT),c.emplaceBack(s.EXTENT,s.EXTENT),this.tileExtentBuffer=o.createVertexBuffer(c,s.posAttributes.members),this.tileExtentSegments=s.SegmentVector.simpleSegment(0,0,4,2);const f=new s.StructArrayLayout2i4;f.emplaceBack(0,0),f.emplaceBack(s.EXTENT,0),f.emplaceBack(0,s.EXTENT),f.emplaceBack(s.EXTENT,s.EXTENT),this.debugBuffer=o.createVertexBuffer(f,s.posAttributes.members),this.debugSegments=s.SegmentVector.simpleSegment(0,0,4,5);const _=new s.StructArrayLayout2i4;_.emplaceBack(-1,-1),_.emplaceBack(1,-1),_.emplaceBack(-1,1),_.emplaceBack(1,1),this.viewportBuffer=o.createVertexBuffer(_,s.posAttributes.members),this.viewportSegments=s.SegmentVector.simpleSegment(0,0,4,2);const x=new s.StructArrayLayout4i8;x.emplaceBack(0,0,0,0),x.emplaceBack(s.EXTENT,0,s.EXTENT,0),x.emplaceBack(0,s.EXTENT,0,s.EXTENT),x.emplaceBack(s.EXTENT,s.EXTENT,s.EXTENT,s.EXTENT),this.mercatorBoundsBuffer=o.createVertexBuffer(x,s.boundsAttributes.members),this.mercatorBoundsSegments=s.SegmentVector.simpleSegment(0,0,4,2);const T=new s.StructArrayLayout3ui6;T.emplaceBack(0,1,2),T.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(T);const S=new s.StructArrayLayout1ui2;for(const z of[0,1,3,2,0])S.emplaceBack(z);this.debugIndexBuffer=o.createIndexBuffer(S),this.emptyTexture=new s.Texture(o,new s.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),o.gl.RGBA),this.identityMat=s.create();const C=this.context.gl;this.stencilClearMode=new s.StencilMode({func:C.ALWAYS,mask:0},0,255,C.ZERO,C.ZERO,C.ZERO),this.loadTimeStamps.push(s.window.performance.now()),this.atmosphereBuffer=new Mf(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(o){return o._makeTileBoundsBuffers(this.context,this.transform.projection),o._tileBoundsBuffer?{tileBoundsBuffer:o._tileBoundsBuffer,tileBoundsIndexBuffer:o._tileBoundsIndexBuffer,tileBoundsSegments:o._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const o=this.context,c=o.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(o,c.TRIANGLES,s.DepthMode.disabled,this.stencilClearMode,s.ColorMode.disabled,s.CullFaceMode.disabled,kl(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(o,c,f){if(!c||this.currentStencilSource===c.id||!o.isTileClipped()||!f||f.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let S=!1;for(const C of f)if(this._tileClippingMaskIDs[C.key]===void 0){S=!0;break}if(!S)return}this.currentStencilSource=c.id;const _=this.context,x=_.gl;this.nextStencilID+f.length>256&&this.clearStencil(),_.setColorMode(s.ColorMode.disabled),_.setDepthMode(s.DepthMode.disabled);const T=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const S of f){const C=c.getTile(S),z=this._tileClippingMaskIDs[S.key]=this.nextStencilID++,{tileBoundsBuffer:P,tileBoundsIndexBuffer:O,tileBoundsSegments:j}=this.getTileBoundsBuffers(C);T.draw(_,x.TRIANGLES,s.DepthMode.disabled,new s.StencilMode({func:x.ALWAYS,mask:0},z,255,x.KEEP,x.KEEP,x.REPLACE),s.ColorMode.disabled,s.CullFaceMode.disabled,kl(S.projMatrix),"$clipping",P,O,j)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const o=this.nextStencilID++,c=this.context.gl;return new s.StencilMode({func:c.NOTEQUAL,mask:255},o,255,c.KEEP,c.KEEP,c.REPLACE)}stencilModeForClipping(o){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(o);const c=this.context.gl;return new s.StencilMode({func:c.EQUAL,mask:255},this._tileClippingMaskIDs[o.key],0,c.KEEP,c.KEEP,c.REPLACE)}stencilConfigForOverlap(o){const c=this.context.gl,f=o.sort((T,S)=>S.overscaledZ-T.overscaledZ),_=f[f.length-1].overscaledZ,x=f[0].overscaledZ-_+1;if(x>1){this.currentStencilSource=void 0,this.nextStencilID+x>256&&this.clearStencil();const T={};for(let S=0;S=0;this.currentLayer--){const z=this.style._layers[f[this.currentLayer]],P=o._getLayerSourceCache(z);if(z.isSky())continue;const O=P?T[P.id]:void 0;this._renderTileClippingMasks(z,P,O),this.renderLayer(this,P,z,O)}if(this.style.fog&&this.transform.projection.supportsFog&&function(z,P){const O=z.context,j=O.gl,W=z.transform,H=new s.DepthMode(j.LEQUAL,s.DepthMode.ReadOnly,[0,1]),Z=z.useProgram("globeAtmosphere",null,W.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),X=s.globeToMercatorTransition(W.zoom),B=P.properties.get("color").toArray01(),q=P.properties.get("high-color").toArray01(),Q=P.properties.get("space-color").toArray01PremultipliedAlpha(),ee=s.identity$1([]);s.rotateY$1(ee,ee,-s.degToRad(W._center.lng)),s.rotateX$1(ee,ee,s.degToRad(W._center.lat)),s.rotateZ$1(ee,ee,W.angle),s.rotateX$1(ee,ee,-W._pitch);const de=s.fromQuat(new Float32Array(16),ee),fe=s.mapValue(P.properties.get("star-intensity"),0,1,0,.25),pe=5e-4,xe=s.mapValue(P.properties.get("horizon-blend"),0,1,pe,.25),ye=s.globeUseCustomAntiAliasing(z,O,W)&&xe===pe?W.worldSize/(2*Math.PI*1.025)-1:W.globeRadius,Ae=z.frameCounter/1e3%1,We=s.length(W.globeCenterInViewSpace),Ee=Math.sqrt(Math.pow(We,2)-Math.pow(ye,2)),Fe=Math.acos(Ee/We),ke=((Se,Be,Xe,$e,Ye,gt,Et,pt,wt,Ut,Ot,mt,en,rn)=>({u_frustum_tl:Se,u_frustum_tr:Be,u_frustum_br:Xe,u_frustum_bl:$e,u_horizon:Ye,u_transition:gt,u_fadeout_range:Et,u_color:pt,u_high_color:wt,u_space_color:Ut,u_star_intensity:Ot,u_star_size:5*s.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:mt,u_horizon_angle:en,u_rotation_matrix:rn}))(W.frustumCorners.TL,W.frustumCorners.TR,W.frustumCorners.BR,W.frustumCorners.BL,W.frustumCorners.horizon,X,xe,B,q,Q,fe,Ae,Fe,de);z.prepareDrawProgram(O,Z);const qe=z.atmosphereBuffer;qe&&Z.draw(O,j.TRIANGLES,H,s.StencilMode.disabled,s.ColorMode.alphaBlended,s.CullFaceMode.backCW,ke,"skybox",qe.vertexBuffer,qe.indexBuffer,qe.segments)}(this,this.style.fog),this.renderPass="sky",(s.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer{const O=o._getLayerSourceCache(P);O&&!P.isHidden(this.transform.zoom)&&(!z||z.getSource().maxzoom0?c.pop():null}isPatternMissing(o){return o===null||o!==void 0&&!this.imageManager.getPattern(o.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const o=this.terrain&&this.terrain.renderingToTexture,c=this.terrain&&this.terrain.exaggeration()===0,f=this.style&&this.style.fog,_=[];return this.terrainRenderModeElevated()&&_.push("TERRAIN"),this.transform.projection.name==="globe"&&_.push("GLOBE"),c&&_.push("ZERO_EXAGGERATION"),f&&!o&&f.getOpacity(this.transform.pitch)!==0&&_.push("FOG"),o&&_.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&_.push("OVERDRAW_INSPECTOR"),_}useProgram(o,c,f){this.cache=this.cache||{};const _=f||[],x=this.currentGlobalDefines().concat(_),T=Wt.cacheKey(Dh[o],o,x,c);return this.cache[T]||(this.cache[T]=new Wt(this.context,o,Dh[o],c,Yh[o],x)),this.cache[T]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const o=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(o.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=s.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(o,c,f){if(this.terrain&&this.terrain.renderingToTexture)return;const _=this.style.fog;if(_){const x=_.getOpacity(this.transform.pitch),T=((S,C,z,P,O,j,W,H,Z,X,B)=>{const q=S.transform,Q=C.properties.get("color").toArray01();Q[3]=P;const ee=S.frameCounter/1e3%1;return{u_fog_matrix:z?q.calculateFogTileMatrix(z):S.identityMat,u_fog_range:C.getFovAdjustedRange(q._fov),u_fog_color:Q,u_fog_horizon_blend:C.properties.get("horizon-blend"),u_fog_temporal_offset:ee,u_frustum_tl:O,u_frustum_tr:j,u_frustum_br:W,u_frustum_bl:H,u_globe_pos:Z,u_globe_radius:X,u_viewport:B,u_globe_transition:s.globeToMercatorTransition(q.zoom),u_is_globe:+(q.projection.name==="globe")}})(this,_,f,x,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*s.exported.devicePixelRatio,this.transform.height*s.exported.devicePixelRatio]);c.setFogUniformValues(o,T)}}setTileLoadedFlag(o){this.tileLoaded=o}saveCanvasCopy(){const o=this.canvasCopy();o&&(this.frameCopies.push(o),this.tileLoaded=!1)}canvasCopy(){const o=this.context.gl,c=o.createTexture();return o.bindTexture(o.TEXTURE_2D,c),o.copyTexImage2D(o.TEXTURE_2D,0,o.RGBA,0,0,o.drawingBufferWidth,o.drawingBufferHeight,0),c}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const o=this.style&&this.style.fog;return!!o&&o.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const o=this._backgroundTiles,c=this._backgroundTiles={},f=this.transform.coveringTiles({tileSize:512});for(const _ of f)c[_.key]=o[_.key]||new s.Tile(_,512,this.transform.tileZoom,this);return c}clearBackgroundTiles(){this._backgroundTiles={}}}class Gc{constructor(o=0,c=0,f=0,_=0){if(isNaN(o)||o<0||isNaN(c)||c<0||isNaN(f)||f<0||isNaN(_)||_<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=o,this.bottom=c,this.left=f,this.right=_}interpolate(o,c,f){return c.top!=null&&o.top!=null&&(this.top=s.number(o.top,c.top,f)),c.bottom!=null&&o.bottom!=null&&(this.bottom=s.number(o.bottom,c.bottom,f)),c.left!=null&&o.left!=null&&(this.left=s.number(o.left,c.left,f)),c.right!=null&&o.right!=null&&(this.right=s.number(o.right,c.right,f)),this}getCenter(o,c){const f=s.clamp((this.left+o-this.right)/2,0,o),_=s.clamp((this.top+c-this.bottom)/2,0,c);return new s.Point(f,_)}equals(o){return this.top===o.top&&this.bottom===o.bottom&&this.left===o.left&&this.right===o.right}clone(){return new Gc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function qc(d,o){const c=s.getColumn(d,3);s.fromQuat(d,o),s.setColumn(d,3,c)}function Zt(d,o){const c=s.identity$1([]);return s.rotateZ$1(c,c,-o),s.rotateX$1(c,c,-d),c}function Ol(d,o){const c=[d[0],d[1],0],f=[o[0],o[1],0];if(s.length(c)>=1e-15){const T=s.normalize([],c);s.scale$2(f,T,s.dot(f,T)),o[0]=f[0],o[1]=f[1]}const _=s.cross([],o,d);if(s.len(_)<1e-15)return null;const x=Math.atan2(-_[1],_[0]);return Zt(Math.atan2(Math.sqrt(d[0]*d[0]+d[1]*d[1]),-d[2]),x)}class Pf{constructor(o,c){this.position=o,this.orientation=c}get position(){return this._position}set position(o){if(o){const c=o instanceof s.MercatorCoordinate?o:new s.MercatorCoordinate(o[0],o[1],o[2]);this._renderWorldCopies&&(c.x=s.wrap(c.x,0,1)),this._position=c}else this._position=null}lookAtPoint(o,c){if(this.orientation=null,!this.position)return;const f=this.position,_=this._elevation?this._elevation.getAtPointOrZero(s.MercatorCoordinate.fromLngLat(o)):0,x=s.MercatorCoordinate.fromLngLat(o,_),T=[x.x-f.x,x.y-f.y,x.z-f.z];c||(c=[0,0,1]),c[2]=Math.abs(c[2]),this.orientation=Ol(T,c)}setPitchBearing(o,c){this.orientation=Zt(s.degToRad(o),s.degToRad(-c))}}class Wc{constructor(o,c){this._transform=s.identity([]),this.orientation=c,this.position=o}get mercatorPosition(){const o=this.position;return new s.MercatorCoordinate(o[0],o[1],o[2])}get position(){const o=s.getColumn(this._transform,3);return[o[0],o[1],o[2]]}set position(o){var c;o&&s.setColumn(this._transform,3,[(c=o)[0],c[1],c[2],1])}get orientation(){return this._orientation}set orientation(o){this._orientation=o||s.identity$1([]),o&&qc(this._transform,this._orientation)}getPitchBearing(){const o=this.forward(),c=this.right();return{bearing:Math.atan2(-c[1],c[0]),pitch:Math.atan2(Math.sqrt(o[0]*o[0]+o[1]*o[1]),-o[2])}}setPitchBearing(o,c){this._orientation=Zt(o,c),qc(this._transform,this._orientation)}forward(){const o=s.getColumn(this._transform,2);return[-o[0],-o[1],-o[2]]}up(){const o=s.getColumn(this._transform,1);return[-o[0],-o[1],-o[2]]}right(){const o=s.getColumn(this._transform,0);return[o[0],o[1],o[2]]}getCameraToWorld(o,c){const f=new Float64Array(16);return s.invert(f,this.getWorldToCamera(o,c)),f}getWorldToCameraPosition(o,c,f){const _=this.position;s.scale$2(_,_,-o);const x=new Float64Array(16);return s.fromScaling(x,[f,f,f]),s.translate(x,x,_),x[10]*=c,x}getWorldToCamera(o,c){const f=new Float64Array(16),_=new Float64Array(4),x=this.position;return s.conjugate(_,this._orientation),s.scale$2(x,x,-o),s.fromQuat(f,_),s.translate(f,f,x),f[1]*=-1,f[5]*=-1,f[9]*=-1,f[13]*=-1,f[8]*=c,f[9]*=c,f[10]*=c,f[11]*=c,f}getCameraToClipPerspective(o,c,f,_){const x=new Float64Array(16);return s.perspective(x,o,c,f,_),x}getDistanceToElevation(o,c=!1){const f=o===0?0:s.mercatorZfromAltitude(o,c?s.latFromMercatorY(this.position[1]):this.position[1]),_=this.forward();return(f-this.position[2])/_[2]}clone(){return new Wc([...this.position],[...this.orientation])}}function Ea(d,o){const c=Zc(d.projection,d.zoom,d.width,d.height),f=function(x,T,S,C,z){const P=new s.LngLat(S.lng-180*ko,S.lat),O=new s.LngLat(S.lng+180*ko,S.lat),j=x.project(P.lng,P.lat),W=x.project(O.lng,O.lat),H=-Math.atan2(W.y-j.y,W.x-j.x),Z=s.MercatorCoordinate.fromLngLat(S);Z.y=s.clamp(Z.y,-1+ko,1-ko);const X=Z.toLngLat(),B=x.project(X.lng,X.lat),q=s.MercatorCoordinate.fromLngLat(X);q.x+=ko;const Q=q.toLngLat(),ee=x.project(Q.lng,Q.lat),de=Hc(ee.x-B.x,ee.y-B.y,H),fe=s.MercatorCoordinate.fromLngLat(X);fe.y+=ko;const pe=fe.toLngLat(),xe=x.project(pe.lng,pe.lat),ye=Hc(xe.x-B.x,xe.y-B.y,H),Ae=Math.abs(de.x)/Math.abs(ye.y),We=s.identity([]);s.rotateZ(We,We,-H*(1-(z?0:C)));const Ee=s.identity([]);return s.scale(Ee,Ee,[1,1-(1-Ae)*C,1]),Ee[4]=-ye.x/ye.y*C,s.rotateZ(Ee,Ee,H),s.multiply(Ee,We,Ee),Ee}(d.projection,0,d.center,c,o),_=zf(d);return s.scale(f,f,[_,_,1]),f}function zf(d){const o=d.projection,c=Zc(d.projection,d.zoom,d.width,d.height),f=Lf(o,d.center),_=Lf(o,s.LngLat.convert(o.center));return Math.pow(2,f*c+(1-c)*_)}function Zc(d,o,c,f,_=1/0){const x=d.range;if(!x)return 0;const T=Math.min(_,Math.max(c,f)),S=Math.log(T/1024)/Math.LN2;return s.smoothstep(x[0]+S,x[1]+S,o)}const ko=1/4e4;function Lf(d,o){const c=s.clamp(o.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),f=new s.LngLat(o.lng-180*ko,c),_=new s.LngLat(o.lng+180*ko,c),x=d.project(f.lng,c),T=d.project(_.lng,c),S=s.MercatorCoordinate.fromLngLat(f),C=s.MercatorCoordinate.fromLngLat(_),z=T.x-x.x,P=T.y-x.y,O=C.x-S.x,j=C.y-S.y,W=Math.sqrt((O*O+j*j)/(z*z+P*P));return Math.log(W)/Math.LN2}function Hc(d,o,c){const f=Math.cos(c),_=Math.sin(c);return{x:d*f-o*_,y:d*_+o*f}}class Ta{constructor(o,c,f,_,x,T,S){this.tileSize=512,this._renderWorldCopies=x===void 0||x,this._minZoom=o||0,this._maxZoom=c||22,this._minPitch=f??0,this._maxPitch=_??60,this.setProjection(T),this.setMaxBounds(S),this.width=0,this.height=0,this._center=new s.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Gc,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Wc,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const o=new Ta(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return o._elevation=this._elevation,o._centerAltitude=this._centerAltitude,o._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,o.tileSize=this.tileSize,o.mercatorFromTransition=this.mercatorFromTransition,o.width=this.width,o.height=this.height,o.cameraElevationReference=this.cameraElevationReference,o._center=this._center,o._setZoom(this.zoom),o._seaLevelZoom=this._seaLevelZoom,o.angle=this.angle,o._fov=this._fov,o._pitch=this._pitch,o._nearZ=this._nearZ,o._farZ=this._farZ,o._averageElevation=this._averageElevation,o._unmodified=this._unmodified,o._edgeInsets=this._edgeInsets.clone(),o._camera=this._camera.clone(),o._calcMatrices(),o.freezeTileCoverage=this.freezeTileCoverage,o.frustumCorners=this.frustumCorners,o}get elevation(){return this._elevation}set elevation(o){this._elevation!==o&&(this._elevation=o,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(o,c=!1){const f=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||f)&&this._updateCameraOnTerrain(),(o||f)&&this._constrainCamera(c),this._calcMatrices()}getProjection(){return s.pick(this.projection,["name","center","parallels"])}setProjection(o){this.projectionOptions=o||{name:"mercator"};const c=this.projection?this.getProjection():void 0;this.projection=s.getProjection(this.projectionOptions);const f=!k(c,this.getProjection());return f&&this._calcMatrices(),this.mercatorFromTransition=!1,f}setMercatorFromTransition(){const o=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=s.getProjection({name:"mercator"});const c=o!==this.projection.name;return c&&this._calcMatrices(),c}get minZoom(){return this._minZoom}set minZoom(o){this._minZoom!==o&&(this._minZoom=o,this.zoom=Math.max(this.zoom,o))}get maxZoom(){return this._maxZoom}set maxZoom(o){this._maxZoom!==o&&(this._maxZoom=o,this.zoom=Math.min(this.zoom,o))}get minPitch(){return this._minPitch}set minPitch(o){this._minPitch!==o&&(this._minPitch=o,this.pitch=Math.max(this.pitch,o))}get maxPitch(){return this._maxPitch}set maxPitch(o){this._maxPitch!==o&&(this._maxPitch=o,this.pitch=Math.min(this.pitch,o))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(o){o===void 0?o=!0:o===null&&(o=!1),this._renderWorldCopies=o}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get cameraWorldSize(){const o=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(o))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return s.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.Point(this.width,this.height)}get bearing(){return s.wrap(this.rotation,-180,180)}set bearing(o){this.rotation=o}get rotation(){return-this.angle/Math.PI*180}set rotation(o){const c=-o*Math.PI/180;var f;this.angle!==c&&(this._unmodified=!1,this.angle=c,this._calcMatrices(),this.rotationMatrix=(f=new s.ARRAY_TYPE(4),s.ARRAY_TYPE!=Float32Array&&(f[1]=0,f[2]=0),f[0]=1,f[3]=1,f),function(_,x,T){var S=x[0],C=x[1],z=x[2],P=x[3],O=Math.sin(T),j=Math.cos(T);_[0]=S*j+z*O,_[1]=C*j+P*O,_[2]=S*-O+z*j,_[3]=C*-O+P*j}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(o){const c=s.clamp(o,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==c&&(this._unmodified=!1,this._pitch=c,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const o=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/o)}set fov(o){o=Math.max(.01,Math.min(60,o)),this._fov!==o&&(this._unmodified=!1,this._fov=s.degToRad(o),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(o){this._averageElevation=o,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(o){const c=Math.min(Math.max(o,this.minZoom),this.maxZoom);this._zoom!==c&&(this._unmodified=!1,this._setZoom(c),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(o){this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const o=this._elevation;this._centerAltitude=o.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=o.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const o=this._elevation,c=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],f=this.horizonLineFromTop();let _=0,x=0;for(let T=0;To.maxzoom&&(c=o.maxzoom);const T=this.locationCoordinate(this.center),S=this.center.lat,C=1<{const Xe=new s.MercatorCoordinate(Se.x+25e-6,Se.y,Se.z),$e=new s.MercatorCoordinate(Se.x,Se.y+25e-6,Se.z),Ye=Se.toLngLat(),gt=Xe.toLngLat(),Et=$e.toLngLat(),pt=this.locationCoordinate(Ye),wt=this.locationCoordinate(gt),Ut=this.locationCoordinate(Et),Ot=Math.hypot(wt.x-pt.x,wt.y-pt.y),mt=Math.hypot(Ut.x-pt.x,Ut.y-pt.y);return Math.sqrt(Ot*mt)*de/25e-6},pe=Se=>{const Be=Q,Xe=ee;return{aabb:s.tileAABB(this,C,0,0,0,Se,Xe,Be,this.projection),zoom:0,x:0,y:0,minZ:Xe,maxZ:Be,wrap:Se,fullyVisible:!1}},xe=[];let ye=[];const Ae=c,We=o.reparseOverscaled?f:c,Ee=Se=>Se*Se,Fe=Ee((Z-this._centerAltitude)*H),ke=Se=>{if(!this._elevation||!Se.tileID||!x)return;const Be=this._elevation.getMinMaxForTile(Se.tileID),Xe=Se.aabb;Be?(Xe.min[2]=Be.min,Xe.max[2]=Be.max,Xe.center[2]=(Xe.min[2]+Xe.max[2])/2):(Se.shouldSplit=qe(Se),Se.shouldSplit||(Xe.min[2]=Xe.max[2]=Xe.center[2]=this._centerAltitude))},qe=Se=>{if(Se.zoom=.9)return!0}else if(_&&($e=Ee(Se.aabb.distanceZ(X)*H)),this.projection.isReprojectedInTileSpace&&f<=5){const pt=Math.pow(2,Se.zoom),wt=fe(new s.MercatorCoordinate((Se.x+.5)/pt,(Se.y+.5)/pt));Ye=wt>.85?1:wt}const gt=Be*Be+Xe*Xe+$e,Et=Ee((1<{if(wt*Ee(.707)0;){const Se=xe.pop(),Be=Se.x,Xe=Se.y;let $e=Se.fullyVisible;if(!$e){const Ye=Se.aabb.intersects(j);if(Ye===0)continue;$e=Ye===2}if(Se.zoom!==Ae&&qe(Se))for(let Ye=0;Ye<4;Ye++){const gt=(Be<<1)+Ye%2,Et=(Xe<<1)+(Ye>>1),pt={aabb:x?Se.aabb.quadrant(Ye):s.tileAABB(this,C,Se.zoom+1,gt,Et,Se.wrap,Se.minZ,Se.maxZ,this.projection),zoom:Se.zoom+1,x:gt,y:Et,wrap:Se.wrap,fullyVisible:$e,tileID:void 0,shouldSplit:void 0,minZ:Se.minZ,maxZ:Se.maxZ};_&&!P&&(pt.tileID=new s.OverscaledTileID(Se.zoom+1===Ae?We:Se.zoom+1,Se.wrap,Se.zoom+1,gt,Et),ke(pt)),xe.push(pt)}else{const Ye=Se.zoom===Ae?We:Se.zoom;if(o.minzoom&&o.minzoom>Ye)continue;const gt=z[0]-(.5+Be+(Se.wrap<{const $e=[0,0,0,1],Ye=[s.EXTENT,s.EXTENT,0,1],gt=this.calculateFogTileMatrix(Xe.tileID.toUnwrapped());s.transformMat4$1($e,$e,gt),s.transformMat4$1(Ye,Ye,gt);const Et=s.getAABBPointSquareDist($e,Ye);if(Et===0)return!0;let pt=!1;const wt=this._elevation;if(wt&&Et>Se&&Be!==0){const Ut=this.calculateProjMatrix(Xe.tileID.toUnwrapped());let Ot;o.isTerrainDEM||(Ot=wt.getMinMaxForTile(Xe.tileID)),Ot||(Ot={min:ee,max:Q});const mt=s.furthestTileCorner(this.rotation),en=[mt[0]*s.EXTENT,mt[1]*s.EXTENT,Ot.max];s.transformMat4(en,en,Ut),pt=(1-en[1])*this.height*.5Se.distanceSq-Be.distanceSq).map(Se=>Se.tileID)}resize(o,c){this.width=o,this.height=c,this.pixelsToGLUnits=[2/o,-2/c],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(o){return Math.pow(2,o)}scaleZoom(o){return Math.log(o)/Math.LN2}project(o){const c=s.clamp(o.lat,-s.MAX_MERCATOR_LATITUDE,s.MAX_MERCATOR_LATITUDE),f=this.projection.project(o.lng,c);return new s.Point(f.x*this.worldSize,f.y*this.worldSize)}unproject(o){return this.projection.unproject(o.x/this.worldSize,o.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/s.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(o,c){let f,_;const x=this.centerPoint;if(this.projection.name==="globe"){const S=this.worldSize;f=(c.x-x.x)/S,_=(c.y-x.y)/S}else{const S=this.pointCoordinate(c),C=this.pointCoordinate(x);f=S.x-C.x,_=S.y-C.y}const T=this.locationCoordinate(o);this.setLocation(new s.MercatorCoordinate(T.x-f,T.y-_))}setLocation(o){this.center=this.coordinateLocation(o),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(o){return this.projection.locationPoint(this,o)}locationPoint3D(o){return this.projection.locationPoint(this,o,!0)}pointLocation(o){return this.coordinateLocation(this.pointCoordinate(o))}pointLocation3D(o){return this.coordinateLocation(this.pointCoordinate3D(o))}locationCoordinate(o,c){const f=c?s.mercatorZfromAltitude(c,o.lat):void 0,_=this.projection.project(o.lng,o.lat);return new s.MercatorCoordinate(_.x,_.y,f)}coordinateLocation(o){return this.projection.unproject(o.x,o.y)}pointRayIntersection(o,c){const f=c??this._centerAltitude,_=[o.x,o.y,0,1],x=[o.x,o.y,1,1];s.transformMat4$1(_,_,this.pixelMatrixInverse),s.transformMat4$1(x,x,this.pixelMatrixInverse);const T=x[3];s.scale$1(_,_,1/_[3]),s.scale$1(x,x,1/T);const S=_[2],C=x[2];return{p0:_,p1:x,t:S===C?0:(f-S)/(C-S)}}screenPointToMercatorRay(o){const c=[o.x,o.y,0,1],f=[o.x,o.y,1,1];return s.transformMat4$1(c,c,this.pixelMatrixInverse),s.transformMat4$1(f,f,this.pixelMatrixInverse),s.scale$1(c,c,1/c[3]),s.scale$1(f,f,1/f[3]),c[2]=s.mercatorZfromAltitude(c[2],this._center.lat)*this.worldSize,f[2]=s.mercatorZfromAltitude(f[2],this._center.lat)*this.worldSize,s.scale$1(c,c,1/this.worldSize),s.scale$1(f,f,1/this.worldSize),new s.Ray([c[0],c[1],c[2]],s.normalize([],s.sub([],f,c)))}rayIntersectionCoordinate(o){const{p0:c,p1:f,t:_}=o,x=s.mercatorZfromAltitude(c[2],this._center.lat),T=s.mercatorZfromAltitude(f[2],this._center.lat);return new s.MercatorCoordinate(s.number(c[0],f[0],_)/this.worldSize,s.number(c[1],f[1],_)/this.worldSize,s.number(x,T,_))}pointCoordinate(o,c=this._centerAltitude){return this.projection.pointCoordinate(this,o.x,o.y,c)}pointCoordinate3D(o){if(!this.elevation)return this.pointCoordinate(o);let c=this.projection.pointCoordinate3D(this,o.x,o.y);if(c)return new s.MercatorCoordinate(c[0],c[1],c[2]);let f=0,_=this.horizonLineFromTop();if(o.y>_)return this.pointCoordinate(o);const x=.02*_,T=o.clone();for(let S=0;S<10&&_-f>x;S++){T.y=s.number(f,_,.66);const C=this.projection.pointCoordinate3D(this,T.x,T.y);C?(_=T.y,c=C):f=T.y}return c?new s.MercatorCoordinate(c[0],c[1],c[2]):this.pointCoordinate(o)}isPointAboveHorizon(o){return this.projection.isPointAboveHorizon(this,o)}isPointOnSurface(o){if(o.y<0||o.y>this.height||o.x<0||o.x>this.width)return!1;if(this.elevation||this.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(o);const c=this.pointCoordinate(o);return c.y>=0&&c.y<=1}_coordinatePoint(o,c){const f=c&&this.elevation?this.elevation.getAtPointOrZero(o,this._centerAltitude):this._centerAltitude,_=[o.x*this.worldSize,o.y*this.worldSize,f+o.toAltitude(),1];return s.transformMat4$1(_,_,this.pixelMatrix),_[3]>0?new s.Point(_[0]/_[3],_[1]/_[3]):new s.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:o,left:c}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,_=this.width-this._edgeInsets.right,x=this.pointLocation3D(new s.Point(c,o)),T=this.pointLocation3D(new s.Point(_,o)),S=this.pointLocation3D(new s.Point(_,f)),C=this.pointLocation3D(new s.Point(c,f));let z=Math.min(x.lng,T.lng,S.lng,C.lng),P=Math.max(x.lng,T.lng,S.lng,C.lng),O=Math.min(x.lat,T.lat,S.lat,C.lat),j=Math.max(x.lat,T.lat,S.lat,C.lat);const W=Math.pow(2,-this.zoom)/16*270,H=this.projection.name==="globe"?1:4,Z=(X,B,q,Q,ee)=>{const de=(X+q)/2,fe=(B+Q)/2,pe=new s.Point(de,fe),{lng:xe,lat:ye}=this.pointLocation3D(pe),Ae=Math.max(0,z-xe,O-ye,xe-P,ye-j);z=Math.min(z,xe),P=Math.max(P,xe),O=Math.min(O,ye),j=Math.max(j,ye),(eeW)&&(Z(X,B,de,fe,ee+1),Z(de,fe,q,Q,ee+1))};if(Z(c,o,_,o,1),Z(_,o,_,f,1),Z(_,f,c,f,1),Z(c,f,c,o,1),this.projection.name==="globe"){const[X,B]=s.polesInViewport(this);X?(j=90,P=180,z=-180):B&&(O=-90,P=180,z=-180)}return new s.LngLatBounds(new s.LngLat(z,O),new s.LngLat(P,j))}_getBoundsRectangular(o,c){const{top:f,left:_}=this._edgeInsets,x=this.height-this._edgeInsets.bottom,T=this.width-this._edgeInsets.right,S=new s.Point(_,f),C=new s.Point(T,f),z=new s.Point(T,x),P=new s.Point(_,x);let O=this.pointCoordinate(S,o),j=this.pointCoordinate(C,o);const W=this.pointCoordinate(z,c),H=this.pointCoordinate(P,c),Z=(X,B)=>(B.y-X.y)/(B.x-X.x);return O.y>1&&j.y>=0?O=new s.MercatorCoordinate((1-H.y)/Z(H,O)+H.x,1):O.y<0&&j.y<=1&&(O=new s.MercatorCoordinate(-H.y/Z(H,O)+H.x,0)),j.y>1&&O.y>=0?j=new s.MercatorCoordinate((1-W.y)/Z(W,j)+W.x,1):j.y<0&&O.y<=1&&(j=new s.MercatorCoordinate(-W.y/Z(W,j)+W.x,0)),new s.LngLatBounds().extend(this.coordinateLocation(O)).extend(this.coordinateLocation(j)).extend(this.coordinateLocation(H)).extend(this.coordinateLocation(W))}_getBoundsRectangularTerrain(){const o=this.elevation;if(!o.visibleDemTiles.length||o.isUsingMockSource())return this._getBoundsRectangular(0,0);const c=o.visibleDemTiles.reduce((f,_)=>{if(_.dem){const x=_.dem.tree;f.min=Math.min(f.min,x.minimums[0]),f.max=Math.max(f.max,x.maximums[0])}return f},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(c.min*o.exaggeration(),c.max*o.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(o=!0){const c=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,f=this.height/2-c*(1-this._horizonShift);return o?Math.max(0,f):f}getMaxBounds(){return this.maxBounds}setMaxBounds(o){this.maxBounds=o,this.minLat=-s.MAX_MERCATOR_LATITUDE,this.maxLat=s.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,o&&(this.minLat=o.getSouth(),this.maxLat=o.getNorth(),this.minLng=o.getWest(),this.maxLng=o.getEast(),this.maxLngO&&(S=O-z),O-PW&&(T=W-C),W-j.5?Q-1:Q,ee>.5?ee-1:ee,0]),this.alignedProjMatrix=de,S=s.create(),s.scale(S,S,[this.width/2,-this.height/2,1]),s.translate(S,S,[1,-1,0]),this.labelPlaneMatrix=S,S=s.create(),s.scale(S,S,[1,-1,1]),s.translate(S,S,[-1,-1,0]),s.scale(S,S,[2/this.width,2/this.height,1]),this.glCoordMatrix=S,this.pixelMatrix=s.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},S=s.invert(new Float64Array(16),this.pixelMatrix),!S)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=S,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=s.calculateGlobeMatrix(this);const fe=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=s.transformMat4(fe,fe,x),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=S;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const o=this.cameraWorldSizeForFog,c=this.cameraPixelsPerMeter,f=this._camera.position,_=1/this.height/this._pixelsPerMercatorPixel,x=[o,o,c];s.scale$2(x,x,_),s.scale$2(f,f,-1),s.multiply$2(f,f,x);const T=s.create();s.translate(T,T,f),s.scale(T,T,x),this.mercatorFogMatrix=T,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(o,c,_)}_computeCameraPosition(o){const c=(o=o||this.pixelsPerMeter)/this.pixelsPerMeter,f=this._camera.forward(),_=this.point,x=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*c-o/this.worldSize*this._centerAltitude;return[_.x/this.worldSize-f[0]*x,_.y/this.worldSize-f[1]*x,o/this.worldSize*this._centerAltitude-f[2]*x]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(o){const c=this._maxCameraBoundsDistance()*Math.cos(this._pitch),f=this._camera.position[2],_=o[2];let x=1;this.projection.wrap&&(this.center=this.center.wrap()),_>0&&(x=Math.min((c-f)/_,1)),this._camera.position=s.scaleAndAdd([],this._camera.position,o,x),this._updateStateFromCamera()}_updateStateFromCamera(){const o=this._camera.position,c=this._camera.forward(),{pitch:f,bearing:_}=this._camera.getPitchBearing(),x=s.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,T=this._mercatorZfromZoom(this._maxZoom)*Math.cos(s.degToRad(this._maxPitch)),S=Math.max((o[2]-x)/Math.cos(f),T),C=this._zoomFromMercatorZ(S);s.scaleAndAdd(o,o,c,S),this._pitch=s.clamp(f,s.degToRad(this.minPitch),s.degToRad(this.maxPitch)),this.angle=s.wrap(_,-Math.PI,Math.PI),this._setZoom(s.clamp(C,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new s.MercatorCoordinate(o[0],o[1],o[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(o){return Math.pow(2,o)*this.tileSize}_mercatorZfromZoom(o){return this.cameraToCenterDistance/this._worldSizeFromZoom(o)}_minimumHeightOverTerrain(){const o=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(o)}_zoomFromMercatorZ(o){return this.scaleZoom(this.cameraToCenterDistance/(o*this.tileSize))}zoomFromMercatorZAdjusted(o){let c=0,f=s.GLOBE_ZOOM_THRESHOLD_MAX,_=0,x=1/0;for(;f-c>1e-6&&f>c;){const T=c+.5*(f-c),S=this.tileSize*Math.pow(2,T),C=this.getCameraToCenterDistance(this.projection,T,S),z=this.scaleZoom(C/(o*this.tileSize)),P=Math.abs(T-z);Pz||j.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+s.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new s.Point(0,0),new s.Point(this.width,this.height))}zoomDeltaToMovement(o,c){const f=s.length(s.sub([],this._camera.position,o)),_=this._zoomFromMercatorZ(f)+c;return f-this._mercatorZfromZoom(_)}getCameraPoint(){if(this.projection.name==="globe"){const o=function([c,f,_],x){const T=[c,f,_,1];s.transformMat4$1(T,T,x);const S=T[3]=Math.max(T[3],1e-6);return T[0]/=S,T[1]/=S,T[2]/=S,T}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new s.Point(o[0],o[1])}{const o=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.Point(0,o))}}getCameraToCenterDistance(o,c=this.zoom,f=this.worldSize){const _=Zc(o,c,this.width,this.height,1024),x=o.pixelSpaceConversion(this.center.lat,f,_);return .5/Math.tan(.5*this._fov)*this.height*x}getWorldToCameraMatrix(){const o=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&s.multiply(o,o,this.globeMatrix),o}}function Sa(d,o){let c=!1,f=null;const _=()=>{f=null,c&&(d(),f=setTimeout(_,o),c=!1)};return()=>(c=!0,f||_(),f)}class ed{constructor(o){this._hashName=o&&encodeURIComponent(o),s.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Sa(this._updateHashUnthrottled.bind(this),300)}addTo(o){return this._map=o,s.window.addEventListener("hashchange",this._onHashChange,!1),o.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),s.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const o=this._map;if(!o)return"";const c=Bl(o);if(this._hashName){const f=this._hashName;let _=!1;const x=s.window.location.hash.slice(1).split("&").map(T=>{const S=T.split("=")[0];return S===f?(_=!0,`${S}=${c}`):T}).filter(T=>T);return _||x.push(`${f}=${c}`),`#${x.join("&")}`}return`#${c}`}_getCurrentHash(){const o=s.window.location.hash.replace("#","");if(this._hashName){let c;return o.split("&").map(f=>f.split("=")).forEach(f=>{f[0]===this._hashName&&(c=f)}),(c&&c[1]||"").split("/")}return o.split("/")}_onHashChange(){const o=this._map;if(!o)return!1;const c=this._getCurrentHash();if(c.length>=3&&!c.some(f=>isNaN(f))){const f=o.dragRotate.isEnabled()&&o.touchZoomRotate.isEnabled()?+(c[3]||0):o.getBearing();return o.jumpTo({center:[+c[2],+c[1]],zoom:+c[0],bearing:f,pitch:+(c[4]||0)}),!0}return!1}_updateHashUnthrottled(){const o=s.window.location.href.replace(/(#.+)?$/,this.getHashString());s.window.history.replaceState(s.window.history.state,null,o)}}function Bl(d,o){const c=d.getCenter(),f=Math.round(100*d.getZoom())/100,_=Math.ceil((f*Math.LN2+Math.log(512/360/.5))/Math.LN10),x=Math.pow(10,_),T=Math.round(c.lng*x)/x,S=Math.round(c.lat*x)/x,C=d.getBearing(),z=d.getPitch();let P=o?`/${T}/${S}/${f}`:`${f}/${S}/${T}`;return(C||z)&&(P+="/"+Math.round(10*C)/10),z&&(P+=`/${Math.round(z)}`),P}const Fl={linearity:.3,easing:s.bezier(0,0,.3,1)},Xc=s.extend({deceleration:2500,maxSpeed:1400},Fl),Kc=s.extend({deceleration:20,maxSpeed:1400},Fl),ct=s.extend({deceleration:1e3,maxSpeed:360},Fl),Di=s.extend({deceleration:1e3,maxSpeed:90},Fl);class Rf{constructor(o){this._map=o,this.clear()}clear(){this._inertiaBuffer=[]}record(o){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.exported.now(),settings:o})}_drainInertiaBuffer(){const o=this._inertiaBuffer,c=s.exported.now();for(;o.length>0&&c-o[0].time>160;)o.shift()}_onMoveEnd(o){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const c={zoom:0,bearing:0,pitch:0,pan:new s.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:x}of this._inertiaBuffer)c.zoom+=x.zoomDelta||0,c.bearing+=x.bearingDelta||0,c.pitch+=x.pitchDelta||0,x.panDelta&&c.pan._add(x.panDelta),x.around&&(c.around=x.around),x.pinchAround&&(c.pinchAround=x.pinchAround);const f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,_={};if(c.pan.mag()){const x=Ul(c.pan.mag(),f,s.extend({},Xc,o||{}));_.offset=c.pan.mult(x.amount/c.pan.mag()),_.center=this._map.transform.center,Nl(_,x)}if(c.zoom){const x=Ul(c.zoom,f,Kc);_.zoom=this._map.transform.zoom+x.amount,Nl(_,x)}if(c.bearing){const x=Ul(c.bearing,f,ct);_.bearing=this._map.transform.bearing+s.clamp(x.amount,-179,179),Nl(_,x)}if(c.pitch){const x=Ul(c.pitch,f,Di);_.pitch=this._map.transform.pitch+x.amount,Nl(_,x)}if(_.zoom||_.bearing){const x=c.pinchAround===void 0?c.around:c.pinchAround;_.around=x?this._map.unproject(x):this._map.getCenter()}return this.clear(),_.noMoveStart=!0,_}}function Nl(d,o){(!d.duration||d.durationc.unproject(C)),S=x.reduce((C,z,P,O)=>C.add(z.div(O.length)),new s.Point(0,0));super(o,{points:x,point:S,lngLats:T,lngLat:c.unproject(S),originalEvent:f}),this._defaultPrevented=!1}}class Yc extends s.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,c,f){super(o,{originalEvent:f}),this._defaultPrevented=!1}}class td{constructor(o,c){this._map=o,this._clickTolerance=c.clickTolerance}reset(){this._mousedownPos=void 0}wheel(o){return this._firePreventable(new Yc(o.type,this._map,o))}mousedown(o,c){return this._mousedownPos=c,this._firePreventable(new pr(o.type,this._map,o))}mouseup(o){this._map.fire(new pr(o.type,this._map,o))}preclick(o){const c=s.extend({},o);c.type="preclick",this._map.fire(new pr(c.type,this._map,c))}click(o,c){this._mousedownPos&&this._mousedownPos.dist(c)>=this._clickTolerance||(this.preclick(o),this._map.fire(new pr(o.type,this._map,o)))}dblclick(o){return this._firePreventable(new pr(o.type,this._map,o))}mouseover(o){this._map.fire(new pr(o.type,this._map,o))}mouseout(o){this._map.fire(new pr(o.type,this._map,o))}touchstart(o){return this._firePreventable(new jl(o.type,this._map,o))}touchmove(o){this._map.fire(new jl(o.type,this._map,o))}touchend(o){this._map.fire(new jl(o.type,this._map,o))}touchcancel(o){this._map.fire(new jl(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Jc{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(o){this._map.fire(new pr(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new pr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._map.fire(new pr(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Df{constructor(o,c){this._map=o,this._el=o.getCanvasContainer(),this._container=o.getContainer(),this._clickTolerance=c.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(o,c){this.isEnabled()&&o.shiftKey&&o.button===0&&(ie(),this._startPos=this._lastPos=c,this._active=!0)}mousemoveWindow(o,c){if(!this._active)return;const f=c,_=this._startPos,x=this._lastPos;if(!_||!x||x.equals(f)||!this._box&&f.dist(_){this._box&&(this._box.style.transform=`translate(${T}px,${C}px)`,this._box.style.width=S-T+"px",this._box.style.height=z-C+"px")})}mouseupWindow(o,c){if(!this._active)return;const f=this._startPos,_=c;if(f&&o.button===0){if(this.reset(),ze(),f.x!==_.x||f.y!==_.y)return this._map.fire(new s.Event("boxzoomend",{originalEvent:o})),{cameraAnimation:x=>x.fitScreenCoordinates(f,_,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",o)}}keydown(o){this._active&&o.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",o))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),te(),delete this._startPos,delete this._lastPos}_fireEvent(o,c){return this._map.fire(new s.Event(o,{originalEvent:c}))}}function Qc(d,o){const c={};for(let f=0;fthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=o.timeStamp),f.length===this.numTouches&&(this.centroid=function(_){const x=new s.Point(0,0);for(const T of _)x._add(T);return x.div(_.length)}(c),this.touches=Qc(f,c)))}touchmove(o,c,f){if(this.aborted||!this.centroid)return;const _=Qc(f,c);for(const x in this.touches){const T=_[x];(!T||T.dist(this.touches[x])>30)&&(this.aborted=!0)}}touchend(o,c,f){if((!this.centroid||o.timeStamp-this.startTime>500)&&(this.aborted=!0),f.length===0){const _=!this.aborted&&this.centroid;if(this.reset(),_)return _}}}class nd{constructor(o){this.singleTap=new Aa(o),this.numTaps=o.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(o,c,f){this.singleTap.touchstart(o,c,f)}touchmove(o,c,f){this.singleTap.touchmove(o,c,f)}touchend(o,c,f){const _=this.singleTap.touchend(o,c,f);if(_){const x=o.timeStamp-this.lastTime<500,T=!this.lastTap||this.lastTap.dist(_)<30;if(x&&T||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=_,this.count===this.numTaps)return this.reset(),_}}}class iy{constructor(){this._zoomIn=new nd({numTouches:1,numTaps:2}),this._zoomOut=new nd({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(o,c,f){this._zoomIn.touchstart(o,c,f),this._zoomOut.touchstart(o,c,f)}touchmove(o,c,f){this._zoomIn.touchmove(o,c,f),this._zoomOut.touchmove(o,c,f)}touchend(o,c,f){const _=this._zoomIn.touchend(o,c,f),x=this._zoomOut.touchend(o,c,f);return _?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()+1,around:T.unproject(_)},{originalEvent:o})}):x?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:T.getZoom()-1,around:T.unproject(x)},{originalEvent:o})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Of={0:1,2:2};class Ca{constructor(o){this.reset(),this._clickTolerance=o.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(o,c){return!1}_move(o,c){return{}}mousedown(o,c){if(this._lastPoint)return;const f=He(o);this._correctButton(o,f)&&(this._lastPoint=c,this._eventButton=f)}mousemoveWindow(o,c){const f=this._lastPoint;if(f){if(o.preventDefault(),this._eventButton!=null&&function(_,x){const T=Of[x];return _.buttons===void 0||(_.buttons&T)!==T}(o,this._eventButton))this.reset();else if(this._moved||!(c.dist(f)0&&(this._active=!0);const _=Qc(f,c),x=new s.Point(0,0),T=new s.Point(0,0);let S=0;for(const z in _){const P=_[z],O=this._touches[z];O&&(x._add(P),T._add(P.sub(O)),S++,_[z]=P)}if(this._touches=_,S{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class Vl{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(o){}_move(o,c,f){return{}}touchstart(o,c,f){this._firstTwoTouches||f.length<2||(this._firstTwoTouches=[f[0].identifier,f[1].identifier],this._start([c[0],c[1]]))}touchmove(o,c,f){const _=this._firstTwoTouches;if(!_)return;o.preventDefault();const[x,T]=_,S=$l(f,c,x),C=$l(f,c,T);if(!S||!C)return;const z=this._aroundCenter?null:S.add(C).div(2);return this._move([S,C],z,o)}touchend(o,c,f){if(!this._firstTwoTouches)return;const[_,x]=this._firstTwoTouches,T=$l(f,c,_),S=$l(f,c,x);T&&S||(this._active&&ze(),this.reset())}touchcancel(){this.reset()}enable(o){this._enabled=!0,this._aroundCenter=!!o&&o.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function $l(d,o,c){for(let f=0;fMath.abs(d.x)}class Nf extends Vl{constructor(o){super(),this._map=o}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(o){this._lastPoints=o,rs(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,c,f){const _=this._lastPoints;if(!_)return;const x=o[0].sub(_[0]),T=o[1].sub(_[1]);return this._map._cooperativeGestures&&!s.isFullscreen()&&f.touches.length<3||(this._valid=this.gestureBeginsVertically(x,T,f.timeStamp),!this._valid)?void 0:(this._lastPoints=o,this._active=!0,{pitchDelta:(x.y+T.y)/2*-.5})}gestureBeginsVertically(o,c,f){if(this._valid!==void 0)return this._valid;const _=o.mag()>=2,x=c.mag()>=2;if(!_&&!x)return;if(!_||!x)return this._firstMove==null&&(this._firstMove=f),f-this._firstMove<100&&void 0;const T=o.y>0==c.y>0;return rs(o)&&rs(c)&&T}}const Uf={panStep:100,bearingStep:15,pitchStep:10};class oy{constructor(){const o=Uf;this._panStep=o.panStep,this._bearingStep=o.bearingStep,this._pitchStep=o.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(o){if(o.altKey||o.ctrlKey||o.metaKey)return;let c=0,f=0,_=0,x=0,T=0;switch(o.keyCode){case 61:case 107:case 171:case 187:c=1;break;case 189:case 109:case 173:c=-1;break;case 37:o.shiftKey?f=-1:(o.preventDefault(),x=-1);break;case 39:o.shiftKey?f=1:(o.preventDefault(),x=1);break;case 38:o.shiftKey?_=1:(o.preventDefault(),T=-1);break;case 40:o.shiftKey?_=-1:(o.preventDefault(),T=1);break;default:return}return this._rotationDisabled&&(f=0,_=0),{cameraAnimation:S=>{const C=S.getZoom();S.easeTo({duration:300,easeId:"keyboardHandler",easing:jf,zoom:c?Math.round(C)+c*(o.shiftKey?2:1):C,bearing:S.getBearing()+f*this._bearingStep,pitch:S.getPitch()+_*this._pitchStep,offset:[-x*this._panStep,-T*this._panStep],center:S.getCenter()},{originalEvent:o})}}}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 jf(d){return d*(2-d)}const ld=4.000244140625;class Vf{constructor(o,c){this._map=o,this._el=o.getCanvasContainer(),this._handler=c,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,s.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(o){this._defaultZoomRate=o}setWheelZoomRate(o){this._wheelZoomRate=o}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(o){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!o&&o.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(o){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(o.ctrlKey||o.metaKey||this.isZooming()||s.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let c=o.deltaMode===s.window.WheelEvent.DOM_DELTA_LINE?40*o.deltaY:o.deltaY;const f=s.exported.now(),_=f-(this._lastWheelEventTime||0);this._lastWheelEventTime=f,c!==0&&c%ld==0?this._type="wheel":c!==0&&Math.abs(c)<4?this._type="trackpad":_>400?(this._type=null,this._lastValue=c,this._timeout=setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(_*c)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,c+=this._lastValue)),o.shiftKey&&c&&(c/=4),this._type&&(this._lastWheelEvent=o,this._delta-=c,this._active||this._start(o)),o.preventDefault()}_onTimeout(o){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)}_start(o){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 c=Oe(this._el,o);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:c,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const o=this._map.transform;this._type==="wheel"&&o.projection.wrap&&(o._center.lng>=180||o._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const c=()=>o._terrainEnabled()&&this._aroundCoord?o.computeZoomRelativeTo(this._aroundCoord):o.zoom;if(this._delta!==0){const C=this._type==="wheel"&&Math.abs(this._delta)>ld?this._wheelZoomRate:this._defaultZoomRate;let z=2/(1+Math.exp(-Math.abs(this._delta*C)));this._delta<0&&z!==0&&(z=1/z);const P=c(),O=Math.pow(2,P),j=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):O;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(j*z))),this._type==="wheel"&&(this._startZoom=P,this._easing=this._smoothOutEasing(200)),this._delta=0}const f=typeof this._targetZoom=="number"?this._targetZoom:c(),_=this._startZoom,x=this._easing;let T,S=!1;if(this._type==="wheel"&&_&&x){const C=Math.min((s.exported.now()-this._lastWheelEventTime)/200,1),z=x(C);T=s.number(_,f,z),C<1?this._frameId||(this._frameId=!0):S=!0}else T=f,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!S,zoomDelta:T-c(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let c=s.ease;if(this._prevEase){const f=this._prevEase,_=(s.exported.now()-f.start)/f.duration,x=f.easing(_+.01)-f.easing(_),T=.27/Math.sqrt(x*x+1e-4)*.01,S=Math.sqrt(.0729-T*T);c=s.bezier(T,S,.25,1)}return this._prevEase={start:s.exported.now(),duration:o,easing:c},c}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=J("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(s.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class $f{constructor(o,c){this._clickZoom=o,this._tapZoom=c}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 kr{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(o,c){return o.preventDefault(),{cameraAnimation:f=>{f.easeTo({duration:300,zoom:f.getZoom()+(o.shiftKey?-1:1),around:f.unproject(c)},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sy{constructor(){this._tap=new nd({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(o,c,f){this._swipePoint||(this._tapTime&&o.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?f.length>0&&(this._swipePoint=c[0],this._swipeTouch=f[0].identifier):this._tap.touchstart(o,c,f))}touchmove(o,c,f){if(this._tapTime){if(this._swipePoint){if(f[0].identifier!==this._swipeTouch)return;const _=c[0],x=_.y-this._swipePoint.y;return this._swipePoint=_,o.preventDefault(),this._active=!0,{zoomDelta:x/128}}}else this._tap.touchmove(o,c,f)}touchend(o,c,f){this._tapTime?this._swipePoint&&f.length===0&&this.reset():this._tap.touchend(o,c,f)&&(this._tapTime=o.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gf{constructor(o,c,f){this._el=o,this._mousePan=c,this._touchPan=f}enable(o){this._inertiaOptions=o||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ay{constructor(o,c,f){this._pitchWithRotate=o.pitchWithRotate,this._mouseRotate=c,this._mousePitch=f}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 ly{constructor(o,c,f,_){this._el=o,this._touchZoom=c,this._touchRotate=f,this._tapDragZoom=_,this._rotationDisabled=!1,this._enabled=!0}enable(o){this._touchZoom.enable(o),this._rotationDisabled||this._touchRotate.enable(o),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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 yi=d=>d.zoom||d.drag||d.pitch||d.rotate;class qf extends s.Event{}class cy{constructor(){this.constants=[1,1,.01],this.radius=0}setup(o,c){const f=s.sub([],c,o);this.radius=s.length(f[2]<0?s.div([],f,this.constants):[f[0],f[1],0])}projectRay(o){s.div(o,o,this.constants),s.normalize(o,o),s.mul$1(o,o,this.constants);const c=s.scale$2([],o,this.radius);if(c[2]>0){const f=s.scale$2([],[0,0,1],s.dot(c,[0,0,1])),_=s.scale$2([],s.normalize([],[c[0],c[1],0]),this.radius),x=s.add([],c,s.scale$2([],s.sub([],s.add([],_,f),c),2));c[0]=x[0],c[1]=x[1]}return c}}function Oi(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta}class ro{constructor(o,c){this._map=o,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rf(o),this._bearingSnap=c.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new cy,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(c),s.bindAll(["handleEvent","handleWindowEvent"],this);const f=this._el;this._listeners=[[f,"touchstart",{passive:!0}],[f,"touchmove",{passive:!1}],[f,"touchend",void 0],[f,"touchcancel",void 0],[f,"mousedown",void 0],[f,"mousemove",void 0],[f,"mouseup",void 0],[s.window.document,"mousemove",{capture:!0}],[s.window.document,"mouseup",void 0],[f,"mouseover",void 0],[f,"mouseout",void 0],[f,"dblclick",void 0],[f,"click",void 0],[f,"keydown",{capture:!1}],[f,"keyup",void 0],[f,"wheel",{passive:!1}],[f,"contextmenu",void 0],[s.window,"blur",void 0]];for(const[_,x,T]of this._listeners)_.addEventListener(x,_===s.window.document?this.handleWindowEvent:this.handleEvent,T)}destroy(){for(const[o,c,f]of this._listeners)o.removeEventListener(c,o===s.window.document?this.handleWindowEvent:this.handleEvent,f)}_addDefaultHandlers(o){const c=this._map,f=c.getCanvasContainer();this._add("mapEvent",new td(c,o));const _=c.boxZoom=new Df(c,o);this._add("boxZoom",_);const x=new iy,T=new kr;c.doubleClickZoom=new $f(T,x),this._add("tapZoom",x),this._add("clickZoom",T);const S=new sy;this._add("tapDragZoom",S);const C=c.touchPitch=new Nf(c);this._add("touchPitch",C);const z=new id(o),P=new od(o);c.dragRotate=new ay(o,z,P),this._add("mouseRotate",z,["mousePitch"]),this._add("mousePitch",P,["mouseRotate"]);const O=new rd(o),j=new eu(c,o);c.dragPan=new Gf(f,O,j),this._add("mousePan",O),this._add("touchPan",j,["touchZoom","touchRotate"]);const W=new Ff,H=new Bf;c.touchZoomRotate=new ly(f,H,W,S),this._add("touchRotate",W,["touchPan","touchZoom"]),this._add("touchZoom",H,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Jc(c));const Z=c.scrollZoom=new Vf(c,this);this._add("scrollZoom",Z,["mousePan"]);const X=c.keyboard=new oy;this._add("keyboard",X);for(const B of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])o.interactive&&o[B]&&c[B].enable(o[B])}_add(o,c,f){this._handlers.push({handlerName:o,handler:c,allowed:f}),this._handlersById[o]=c}stop(o){if(!this._updatingCamera){for(const{handler:c}of this._handlers)c.reset();this._inertia.clear(),this._fireEvents({},{},o),this._changes=[]}}isActive(){for(const{handler:o}of this._handlers)if(o.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!yi(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(o,c,f){for(const _ in o)if(_!==f&&(!c||c.indexOf(_)<0))return!0;return!1}handleWindowEvent(o){this.handleEvent(o,`${o.type}Window`)}_getMapTouches(o){const c=[];for(const f of o)this._el.contains(f.target)&&c.push(f);return c}handleEvent(o,c){this._updatingCamera=!0;const f=o.type==="renderFrame",_=f?void 0:o,x={needsRenderFrame:!1},T={},S={},C=o.touches?this._getMapTouches(o.touches):void 0,z=C?Ke(this._el,C):f?void 0:Oe(this._el,o);for(const{handlerName:j,handler:W,allowed:H}of this._handlers){if(!W.isEnabled())continue;let Z;this._blockedByActive(S,H,j)?W.reset():W[c||o.type]&&(Z=W[c||o.type](o,z,C),this.mergeHandlerResult(x,T,Z,j,_),Z&&Z.needsRenderFrame&&this._triggerRenderFrame()),(Z||W.isActive())&&(S[j]=W)}const P={};for(const j in this._previousActiveHandlers)S[j]||(P[j]=_);this._previousActiveHandlers=S,(Object.keys(P).length||Oi(x))&&(this._changes.push([x,T,P]),this._triggerRenderFrame()),(Object.keys(S).length||Oi(x))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:O}=x;O&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],O(this._map))}mergeHandlerResult(o,c,f,_,x){if(!f)return;s.extend(o,f);const T={handlerName:_,originalEvent:f.originalEvent||x};f.zoomDelta!==void 0&&(c.zoom=T),f.panDelta!==void 0&&(c.drag=T),f.pitchDelta!==void 0&&(c.pitch=T),f.bearingDelta!==void 0&&(c.rotate=T)}_applyChanges(){const o={},c={},f={};for(const[_,x,T]of this._changes)_.panDelta&&(o.panDelta=(o.panDelta||new s.Point(0,0))._add(_.panDelta)),_.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+_.zoomDelta),_.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+_.bearingDelta),_.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+_.pitchDelta),_.around!==void 0&&(o.around=_.around),_.aroundCoord!==void 0&&(o.aroundCoord=_.aroundCoord),_.pinchAround!==void 0&&(o.pinchAround=_.pinchAround),_.noInertia&&(o.noInertia=_.noInertia),s.extend(c,x),s.extend(f,T);this._updateMapTransform(o,c,f),this._changes=[]}_updateMapTransform(o,c,f){const _=this._map,x=_.transform,T=q=>[q.x,q.y,q.z];if((q=>{const Q=this._eventsInProgress.drag;return Q&&!this._handlersById[Q.handlerName].isActive()})()&&!Oi(o)){const q=x.zoom;x.cameraElevationReference="sea",x.recenterOnTerrain(),x.cameraElevationReference="ground",q!==x.zoom&&this._map._update(!0)}if(x._isCameraConstrained&&_._stop(!0),!Oi(o))return void this._fireEvents(c,f,!0);let{panDelta:S,zoomDelta:C,bearingDelta:z,pitchDelta:P,around:O,aroundCoord:j,pinchAround:W}=o;x._isCameraConstrained&&(C>0&&(C=0),x._isCameraConstrained=!1),W!==void 0&&(O=W),(C||(q=>c[q]&&!this._eventsInProgress[q])("drag"))&&O&&(this._dragOrigin=T(x.pointCoordinate3D(O)),this._trackingEllipsoid.setup(x._camera.position,this._dragOrigin)),x.cameraElevationReference="sea",_._stop(!0),O=O||_.transform.centerPoint,z&&(x.bearing+=z),P&&(x.pitch+=P),x._updateCameraState();const H=[0,0,0];if(S)if(x.projection.name==="mercator"){const q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(O).dir),Q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(O.sub(S)).dir);H[0]=Q[0]-q[0],H[1]=Q[1]-q[1]}else{const q=x.pointCoordinate(O);if(x.projection.name==="globe"){S=S.rotate(-x.angle);const Q=x._pixelsPerMercatorPixel/x.worldSize;H[0]=-S.x*s.mercatorScale(s.latFromMercatorY(q.y))*Q,H[1]=-S.y*s.mercatorScale(x.center.lat)*Q}else{const Q=x.pointCoordinate(O.sub(S));q&&Q&&(H[0]=Q.x-q.x,H[1]=Q.y-q.y)}}const Z=x.zoom,X=[0,0,0];if(C){const q=T(j||x.pointCoordinate3D(O)),Q={dir:s.normalize([],s.sub([],q,x._camera.position))};if(Q.dir[2]<0){const ee=x.zoomDeltaToMovement(q,C);s.scale$2(X,Q.dir,ee)}}const B=s.add(H,H,X);x._translateCameraConstrained(B),C&&Math.abs(x.zoom-Z)>1e-4&&x.recenterOnTerrain(),x.cameraElevationReference="ground",this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(c,f,!0)}_fireEvents(o,c,f){const _=yi(this._eventsInProgress),x=yi(o),T={};for(const P in o){const{originalEvent:O}=o[P];this._eventsInProgress[P]||(T[`${P}start`]=O),this._eventsInProgress[P]=o[P]}!_&&x&&this._fireEvent("movestart",x.originalEvent);for(const P in T)this._fireEvent(P,T[P]);x&&this._fireEvent("move",x.originalEvent);for(const P in o){const{originalEvent:O}=o[P];this._fireEvent(P,O)}const S={};let C;for(const P in this._eventsInProgress){const{handlerName:O,originalEvent:j}=this._eventsInProgress[P];this._handlersById[O].isActive()||(delete this._eventsInProgress[P],C=c[O]||j,S[`${P}end`]=C)}for(const P in S)this._fireEvent(P,S[P]);const z=yi(this._eventsInProgress);if(f&&(_||x)&&!z){this._updatingCamera=!0;const P=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=j=>j!==0&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new qf("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const Ds="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class tu extends s.Evented{constructor(o,c){super(),this._moving=!1,this._zooming=!1,this.transform=o,this._bearingSnap=c.bearingSnap,this._respectPrefersReducedMotion=c.respectPrefersReducedMotion!==!1,s.bindAll(["_renderFrameCallback"],this)}getCenter(){return new s.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(o,c){return this.jumpTo({center:o},c)}panBy(o,c,f){return o=s.Point.convert(o).mult(-1),this.panTo(this.transform.center,s.extend({offset:o},c),f)}panTo(o,c,f){return this.easeTo(s.extend({center:o},c),f)}getZoom(){return this.transform.zoom}setZoom(o,c){return this.jumpTo({zoom:o},c),this}zoomTo(o,c,f){return this.easeTo(s.extend({zoom:o},c),f)}zoomIn(o,c){return this.zoomTo(this.getZoom()+1,o,c),this}zoomOut(o,c){return this.zoomTo(this.getZoom()-1,o,c),this}getBearing(){return this.transform.bearing}setBearing(o,c){return this.jumpTo({bearing:o},c),this}getPadding(){return this.transform.padding}setPadding(o,c){return this.jumpTo({padding:o},c),this}rotateTo(o,c,f){return this.easeTo(s.extend({bearing:o},c),f)}resetNorth(o,c){return this.rotateTo(0,s.extend({duration:1e3},o),c),this}resetNorthPitch(o,c){return this.easeTo(s.extend({bearing:0,pitch:0,duration:1e3},o),c),this}snapToNorth(o,c){return Math.abs(this.getBearing())o.aspect?f/(2*Math.tan(.5*o.fovX)*o.aspect):_/(2*Math.tan(.5*o.fovY)*o.aspect)}_cameraForBoundsOnGlobe(o,c,f,_,x,T){const S=o.clone(),C=this._extendCameraOptions(T);S.bearing=_,S.pitch=x;const z=s.LngLat.convert(c),P=s.LngLat.convert(f),O=.5*(z.lat+P.lat),j=.5*(z.lng+P.lng),W=s.latLngToECEF(O,j),H=s.normalize([],W),Z=s.normalize([],s.cross([],H,[0,1,0])),X=s.cross([],Z,H),B=[Z[0],Z[1],Z[2],0,X[0],X[1],X[2],0,H[0],H[1],H[2],0,0,0,0,1],q=[W,s.latLngToECEF(z.lat,z.lng),s.latLngToECEF(P.lat,z.lng),s.latLngToECEF(P.lat,P.lng),s.latLngToECEF(z.lat,P.lng),s.latLngToECEF(O,z.lng),s.latLngToECEF(O,P.lng),s.latLngToECEF(z.lat,j),s.latLngToECEF(P.lat,j)];let Q=s.Aabb.fromPoints(q.map($e=>[s.dot(Z,$e),s.dot(X,$e),s.dot(H,$e)]));const ee=s.transformMat4([],Q.center,B);s.squaredLength(ee)===0&&s.set(ee,0,0,1),s.normalize(ee,ee),s.scale$2(ee,ee,s.GLOBE_RADIUS),S.center=s.ecefToLatLng(ee);const de=S.getWorldToCameraMatrix(),fe=s.invert(new Float64Array(16),de);Q=s.Aabb.applyTransform(Q,s.multiply([],de,B)),s.transformMat4(ee,ee,de);const pe=.5*(Q.max[2]-Q.min[2]),xe=this._minimumAABBFrustumDistance(S,Q),ye=s.scale$2([],[0,0,1],pe),Ae=s.add(ye,ee,ye),We=xe+(S.pitch===0?0:s.distance(ee,Ae)),Ee=S.globeCenterInViewSpace,Fe=s.sub([],ee,[Ee[0],Ee[1],Ee[2]]);s.normalize(Fe,Fe),s.scale$2(Fe,Fe,We);const ke=s.add([],ee,Fe);s.transformMat4(ke,ke,fe);const qe=s.earthRadius/s.GLOBE_RADIUS,Se=s.length(ke),Be=s.mercatorZfromAltitude(Math.max(Se*qe-s.earthRadius,Number.EPSILON),0),Xe=Math.min(S.zoomFromMercatorZAdjusted(Be),C.maxZoom);return Xe>.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(S.setProjection({name:"mercator"}),S.zoom=Xe,this._cameraForBounds(S,c,f,_,x,T)):{center:S.center,zoom:Xe,bearing:_,pitch:x}}queryTerrainElevation(o,c){const f=this.transform.elevation;return f?(c=s.extend({},{exaggerated:!0},c),f.getAtPoint(s.MercatorCoordinate.fromLngLat(o),null,c.exaggerated)):null}_cameraForBounds(o,c,f,_,x,T){if(o.projection.name==="globe")return this._cameraForBoundsOnGlobe(o,c,f,_,x,T);const S=o.clone(),C=this._extendCameraOptions(T),z=S.padding;S.bearing=_,S.pitch=x;const P=s.LngLat.convert(c),O=s.LngLat.convert(f),j=new s.LngLat(P.lng,O.lat),W=new s.LngLat(O.lng,P.lat),H=S.project(P),Z=S.project(O),X=this.queryTerrainElevation(P),B=this.queryTerrainElevation(O),q=this.queryTerrainElevation(j),Q=this.queryTerrainElevation(W),ee=[[H.x,H.y,Math.min(X||0,B||0,q||0,Q||0)],[Z.x,Z.y,Math.max(X||0,B||0,q||0,Q||0)]];let de=s.Aabb.fromPoints(ee);const fe=S.getWorldToCameraMatrix(),pe=s.invert(new Float64Array(16),fe);de=s.Aabb.applyTransform(de,fe);const xe=s.sub([],de.max,de.min),ye=z.left||0,Ae=z.right||0,We=z.bottom||0,Ee=z.top||0,{left:Fe,right:ke,top:qe,bottom:Se}=C.padding,Be=.5*(ye+Ae),Xe=.5*(Ee+We),$e=Math.min(S.scaleZoom(S.scale*Math.min((S.width-(ye+Ae+Fe+ke))/xe[0],(S.height-(We+Ee+Se+qe))/xe[1])),C.maxZoom),Ye=S.scale/S.zoomScale($e);de=new s.Aabb([de.min[0]-(Fe+Be)*Ye,de.min[1]-(Se+Xe)*Ye,de.min[2]],[de.max[0]+(ke+Be)*Ye,de.max[1]+(qe+Xe)*Ye,de.max[2]]);const gt=.5*xe[2],Et=this._minimumAABBFrustumDistance(S,de),pt=[0,0,1,0];s.transformMat4$1(pt,pt,fe),s.normalize$2(pt,pt);const wt=s.scale$2([],pt,Et+gt),Ut=s.add([],de.center,wt),Ot=(typeof C.offset.x=="number"&&typeof C.offset.y=="number"?new s.Point(C.offset.x,C.offset.y):s.Point.convert(C.offset)).rotate(-s.degToRad(_));de.center[0]-=Ot.x*Ye,de.center[1]+=Ot.y*Ye,s.transformMat4(de.center,de.center,pe),s.transformMat4(Ut,Ut,pe);const mt=[de.center[0],de.center[1],Ut[2]*S.pixelsPerMeter];s.scale$2(mt,mt,1/S.worldSize);const en=s.lngFromMercatorX(mt[0]),rn=s.latFromMercatorY(mt[1]),on=Math.min(S._zoomFromMercatorZ(mt[2]),C.maxZoom),sn=new s.LngLat(en,rn);return S.mercatorFromTransition&&on<.5*(s.GLOBE_ZOOM_THRESHOLD_MIN+s.GLOBE_ZOOM_THRESHOLD_MAX)?(S.setProjection({name:"globe"}),S.zoom=on,this._cameraForBounds(S,c,f,_,x,T)):{center:sn,zoom:on,bearing:_,pitch:x}}fitBounds(o,c,f){const _=this.cameraForBounds(o,c);return this._fitInternal(_,c,f)}fitScreenCoordinates(o,c,f,_,x){const T=s.Point.convert(o),S=s.Point.convert(c),C=new s.Point(Math.min(T.x,S.x),Math.min(T.y,S.y)),z=new s.Point(Math.max(T.x,S.x),Math.max(T.y,S.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(T,S))return this;const P=this.transform.pointLocation3D(C),O=this.transform.pointLocation3D(z),j=this.transform.pointLocation3D(new s.Point(C.x,z.y)),W=this.transform.pointLocation3D(new s.Point(z.x,C.y)),H=[Math.min(P.lng,O.lng,j.lng,W.lng),Math.min(P.lat,O.lat,j.lat,W.lat)],Z=[Math.max(P.lng,O.lng,j.lng,W.lng),Math.max(P.lat,O.lat,j.lat,W.lat)],X=_&&_.pitch?_.pitch:this.getPitch(),B=this._cameraForBounds(this.transform,H,Z,f,X,_);return this._fitInternal(B,_,x)}_fitInternal(o,c,f){return o?(delete(c=s.extend(o,c)).padding,c.linear?this.easeTo(c,f):this.flyTo(c,f)):this}jumpTo(o,c){this.stop();const f=o.preloadOnly?this.transform.clone():this.transform;let _=!1,x=!1,T=!1;return"zoom"in o&&f.zoom!==+o.zoom&&(_=!0,f.zoom=+o.zoom),o.center!==void 0&&(f.center=s.LngLat.convert(o.center)),"bearing"in o&&f.bearing!==+o.bearing&&(x=!0,f.bearing=+o.bearing),"pitch"in o&&f.pitch!==+o.pitch&&(T=!0,f.pitch=+o.pitch),o.padding==null||f.isPaddingEqual(o.padding)||(f.padding=o.padding),o.preloadOnly?(this._preloadTiles(f),this):(this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),_&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),x&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),T&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||s.warnOnce(Ds),this.transform.getFreeCameraOptions()}setFreeCameraOptions(o,c){const f=this.transform;if(!f.projection.supportsFreeCamera)return s.warnOnce(Ds),this;this.stop();const _=f.zoom,x=f.pitch,T=f.bearing;f.setFreeCameraOptions(o);const S=_!==f.zoom,C=x!==f.pitch,z=T!==f.bearing;return this.fire(new s.Event("movestart",c)).fire(new s.Event("move",c)),S&&this.fire(new s.Event("zoomstart",c)).fire(new s.Event("zoom",c)).fire(new s.Event("zoomend",c)),z&&this.fire(new s.Event("rotatestart",c)).fire(new s.Event("rotate",c)).fire(new s.Event("rotateend",c)),C&&this.fire(new s.Event("pitchstart",c)).fire(new s.Event("pitch",c)).fire(new s.Event("pitchend",c)),this.fire(new s.Event("moveend",c)),this}easeTo(o,c){this._stop(!1,o.easeId),((o=s.extend({offset:[0,0],duration:500,easing:s.ease},o)).animate===!1||this._prefersReducedMotion(o))&&(o.duration=0);const f=this.transform,_=this.getZoom(),x=this.getBearing(),T=this.getPitch(),S=this.getPadding(),C="zoom"in o?+o.zoom:_,z="bearing"in o?this._normalizeBearing(o.bearing,x):x,P="pitch"in o?+o.pitch:T,O="padding"in o?o.padding:f.padding,j=s.Point.convert(o.offset);let W,H,Z;if(f.projection.name==="globe"){const ye=s.MercatorCoordinate.fromLngLat(f.center),Ae=j.rotate(-f.angle);ye.x+=Ae.x/f.worldSize,ye.y+=Ae.y/f.worldSize;const We=ye.toLngLat(),Ee=s.LngLat.convert(o.center||We);this._normalizeCenter(Ee),W=f.centerPoint.add(Ae),H=new s.Point(ye.x,ye.y).mult(f.worldSize),Z=new s.Point(s.mercatorXfromLng(Ee.lng),s.mercatorYfromLat(Ee.lat)).mult(f.worldSize).sub(H)}else{W=f.centerPoint.add(j);const ye=f.pointLocation(W),Ae=s.LngLat.convert(o.center||ye);this._normalizeCenter(Ae),H=f.project(ye),Z=f.project(Ae).sub(H)}const X=f.zoomScale(C-_);let B,q;o.around&&(B=s.LngLat.convert(o.around),q=f.locationPoint(B));const Q=this._zooming||C!==_,ee=this._rotating||x!==z,de=this._pitching||P!==T,fe=!f.isPaddingEqual(O),pe=ye=>Ae=>{if(Q&&(ye.zoom=s.number(_,C,Ae)),ee&&(ye.bearing=s.number(x,z,Ae)),de&&(ye.pitch=s.number(T,P,Ae)),fe&&(ye.interpolatePadding(S,O,Ae),W=ye.centerPoint.add(j)),B)ye.setLocationAtPoint(B,q);else{const We=ye.zoomScale(ye.zoom-_),Ee=C>_?Math.min(2,X):Math.max(.5,X),Fe=Math.pow(Ee,1-Ae),ke=ye.unproject(H.add(Z.mult(Ae*Fe)).mult(We));ye.setLocationAtPoint(ye.renderWorldCopies?ke.wrap():ke,W)}return o.preloadOnly||this._fireMoveEvents(c),ye};if(o.preloadOnly){const ye=this._emulate(pe,o.duration,f);return this._preloadTiles(ye),this}const xe={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=Q,this._rotating=ee,this._pitching=de,this._padding=fe,this._easeId=o.easeId,this._prepareEase(c,o.noMoveStart,xe),this._ease(pe(f),ye=>{f.recenterOnTerrain(),this._afterEase(c,ye)},o),this}_prepareEase(o,c,f={}){this._moving=!0,this.transform.cameraElevationReference="sea",c||f.moving||this.fire(new s.Event("movestart",o)),this._zooming&&!f.zooming&&this.fire(new s.Event("zoomstart",o)),this._rotating&&!f.rotating&&this.fire(new s.Event("rotatestart",o)),this._pitching&&!f.pitching&&this.fire(new s.Event("pitchstart",o))}_fireMoveEvents(o){this.fire(new s.Event("move",o)),this._zooming&&this.fire(new s.Event("zoom",o)),this._rotating&&this.fire(new s.Event("rotate",o)),this._pitching&&this.fire(new s.Event("pitch",o))}_afterEase(o,c){if(this._easeId&&c&&this._easeId===c)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const f=this._zooming,_=this._rotating,x=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,f&&this.fire(new s.Event("zoomend",o)),_&&this.fire(new s.Event("rotateend",o)),x&&this.fire(new s.Event("pitchend",o)),this.fire(new s.Event("moveend",o))}flyTo(o,c){if(this._prefersReducedMotion(o)){const $e=s.pick(o,["center","zoom","bearing","pitch","around"]);return this.jumpTo($e,c)}this.stop(),o=s.extend({offset:[0,0],speed:1.2,curve:1.42,easing:s.ease},o);const f=this.transform,_=this.getZoom(),x=this.getBearing(),T=this.getPitch(),S=this.getPadding(),C="zoom"in o?s.clamp(+o.zoom,f.minZoom,f.maxZoom):_,z="bearing"in o?this._normalizeBearing(o.bearing,x):x,P="pitch"in o?+o.pitch:T,O="padding"in o?o.padding:f.padding,j=f.zoomScale(C-_),W=s.Point.convert(o.offset);let H=f.centerPoint.add(W);const Z=f.pointLocation(H),X=s.LngLat.convert(o.center||Z);this._normalizeCenter(X);const B=f.project(Z),q=f.project(X).sub(B);let Q=o.curve;const ee=Math.max(f.width,f.height),de=ee/j,fe=q.mag();if("minZoom"in o){const $e=s.clamp(Math.min(o.minZoom,_,C),f.minZoom,f.maxZoom),Ye=ee/f.zoomScale($e-_);Q=Math.sqrt(Ye/fe*2)}const pe=Q*Q;function xe($e){const Ye=(de*de-ee*ee+($e?-1:1)*pe*pe*fe*fe)/(2*($e?de:ee)*pe*fe);return Math.log(Math.sqrt(Ye*Ye+1)-Ye)}function ye($e){return(Math.exp($e)-Math.exp(-$e))/2}function Ae($e){return(Math.exp($e)+Math.exp(-$e))/2}const We=xe(0);let Ee=function($e){return Ae(We)/Ae(We+Q*$e)},Fe=function($e){return ee*((Ae(We)*(ye(Ye=We+Q*$e)/Ae(Ye))-ye(We))/pe)/fe;var Ye},ke=(xe(1)-We)/Q;if(Math.abs(fe)<1e-6||!isFinite(ke)){if(Math.abs(ee-de)<1e-6)return this.easeTo(o,c);const $e=deo.maxDuration&&(o.duration=0);const qe=x!==z,Se=P!==T,Be=!f.isPaddingEqual(O),Xe=$e=>Ye=>{const gt=Ye*ke,Et=1/Ee(gt);$e.zoom=Ye===1?C:_+$e.scaleZoom(Et),qe&&($e.bearing=s.number(x,z,Ye)),Se&&($e.pitch=s.number(T,P,Ye)),Be&&($e.interpolatePadding(S,O,Ye),H=$e.centerPoint.add(W));const pt=Ye===1?X:$e.unproject(B.add(q.mult(Fe(gt))).mult(Et));return $e.setLocationAtPoint($e.renderWorldCopies?pt.wrap():pt,H),$e._updateCameraOnTerrain(),o.preloadOnly||this._fireMoveEvents(c),$e};if(o.preloadOnly){const $e=this._emulate(Xe,o.duration,f);return this._preloadTiles($e),this}return this._zooming=!0,this._rotating=qe,this._pitching=Se,this._padding=Be,this._prepareEase(c,!1),this._ease(Xe(f),()=>this._afterEase(c),o),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(o,c){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const f=this._onEaseEnd;this._onEaseEnd=void 0,f.call(this,c)}if(!o){const f=this.handlers;f&&f.stop(!1)}return this}_ease(o,c,f){f.animate===!1||f.duration===0?(o(1),c()):(this._easeStart=s.exported.now(),this._easeOptions=f,this._onEaseFrame=o,this._onEaseEnd=c,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const o=Math.min((s.exported.now()-this._easeStart)/this._easeOptions.duration,1),c=this._onEaseFrame;c&&c(this._easeOptions.easing(o)),o<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(o,c){o=s.wrap(o,-180,180);const f=Math.abs(o-c);return Math.abs(o-360-c)180?-360:f<-180?360:0}_prefersReducedMotion(o){return this._respectPrefersReducedMotion&&s.exported.prefersReducedMotion&&!(o&&o.essential)}_emulate(o,c,f){const _=Math.ceil(15*c/1e3),x=[],T=o(f.clone());for(let S=0;S<=_;S++){const C=T(S/_);x.push(C.clone())}return x}}class dt{constructor(o={}){this.options=o,s.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(o){const c=this.options&&this.options.compact;return this._map=o,this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=J("button","mapboxgl-ctrl-attrib-button",this._container),J("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=J("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),c&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),c===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(o,c){const f=this._map._getUIString(`AttributionControl.${c}`);o.setAttribute("aria-label",f),o.removeAttribute("title"),o.firstElementChild&&o.firstElementChild.setAttribute("title",f)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let o=this._editLink;o||(o=this._editLink=this._container.querySelector(".mapbox-improve-map"));const c=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.config.ACCESS_TOKEN}];if(o){const f=c.reduce((_,x,T)=>(x.value&&(_+=`${x.key}=${x.value}${T_.length-x.length),o=o.filter((_,x)=>{for(let T=x+1;T=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?o=[...this.options.customAttribution,...o]:o.unshift(this.options.customAttribution));const f=o.join(" | ");f!==this._attribHTML&&(this._attribHTML=f,o.length?(this._innerContainer.innerHTML=f,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class cd{constructor(){s.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(o){this._map=o,this._container=J("div","mapboxgl-ctrl");const c=J("a","mapboxgl-ctrl-logo");return c.target="_blank",c.rel="noopener nofollow",c.href="https://www.mapbox.com/",c.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),c.setAttribute("rel","noopener nofollow"),this._container.appendChild(c),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(o){o&&o.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const o=this._map.style._sourceCaches;if(Object.entries(o).length===0)return!0;for(const c in o){const f=o[c].getSource();if(f.hasOwnProperty("mapbox_logo")&&!f.mapbox_logo)return!1}return!0}_updateCompact(){const o=this._container.children;if(o.length){const c=o[0];this._map.getCanvasContainer().offsetWidth<250?c.classList.add("mapboxgl-compact"):c.classList.remove("mapboxgl-compact")}}}class ud{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(o){const c=++this._id;return this._queue.push({callback:o,id:c,cancelled:!1}),c}remove(o){const c=this._currentlyRunning,f=c?this._queue.concat(c):this._queue;for(const _ of f)if(_.id===o)return void(_.cancelled=!0)}run(o=0){const c=this._currentlyRunning=this._queue;this._queue=[];for(const f of c)if(!f.cancelled&&(f.callback(o),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ia(d,o,c){if(d=new s.LngLat(d.lng,d.lat),o){const f=new s.LngLat(d.lng-360,d.lat),_=new s.LngLat(d.lng+360,d.lat),x=360*Math.ceil(Math.abs(d.lng-c.center.lng)/360),T=c.locationPoint(d).distSqr(o),S=o.x<0||o.y<0||o.x>c.width||o.y>c.height;c.locationPoint(f).distSqr(o)180;){const f=c.locationPoint(d);if(f.x>=0&&f.y>=0&&f.x<=c.width&&f.y<=c.height)break;d.lng>c.center.lng?d.lng-=360:d.lng+=360}return d}const Os={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%)"};class at extends s.Evented{constructor(o,c){if(super(),(o instanceof s.window.HTMLElement||c)&&(o=s.extend({element:o},c)),s.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=o&&o.anchor||"center",this._color=o&&o.color||"#3FB1CE",this._scale=o&&o.scale||1,this._draggable=o&&o.draggable||!1,this._clickTolerance=o&&o.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=o&&o.rotation||0,this._rotationAlignment=o&&o.rotationAlignment||"auto",this._pitchAlignment=o&&o.pitchAlignment&&o.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=o&&o.occludedOpacity||.2,o&&o.element)this._element=o.element,this._offset=s.Point.convert(o&&o.offset||[0,0]);else{this._defaultMarker=!0,this._element=J("div");const _=41,x=27,T=ve("svg",{display:"block",height:_*this._scale+"px",width:x*this._scale+"px",viewBox:`0 0 ${x} ${_}`},this._element),S=ve("radialGradient",{id:"shadowGradient"},ve("defs",{},T));ve("stop",{offset:"10%","stop-opacity":.4},S),ve("stop",{offset:"100%","stop-opacity":.05},S),ve("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},T),ve("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},T),ve("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},T),ve("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},T),this._offset=s.Point.convert(o&&o.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",_=>{_.preventDefault()}),this._element.addEventListener("mousedown",_=>{_.preventDefault()});const f=this._element.classList;for(const _ in Os)f.remove(`mapboxgl-marker-anchor-${_}`);f.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(o){return o===this._map||(this.remove(),this._map=o,o.getCanvasContainer().appendChild(this._element),o.on("move",this._updateMoving),o.on("moveend",this._update),o.on("remove",this._clearFadeTimer),o._addMarker(this),this.setDraggable(this._draggable),this._update(),o.on("click",this._onMapClick)),this}remove(){const o=this._map;return o&&(o.off("click",this._onMapClick),o.off("move",this._updateMoving),o.off("moveend",this._update),o.off("mousedown",this._addDragHandler),o.off("touchstart",this._addDragHandler),o.off("mouseup",this._onUp),o.off("touchend",this._onUp),o.off("mousemove",this._onMove),o.off("touchmove",this._onMove),o.off("remove",this._clearFadeTimer),o._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=s.LngLat.convert(o),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(o){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),o){if(!("offset"in o.options)){const _=Math.sqrt(Math.pow(13.5,2)/2);o.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[_,-1*(38.1-13.5+_)],"bottom-right":[-_,-1*(38.1-13.5+_)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,o._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(o){const c=o.code,f=o.charCode||o.keyCode;c!=="Space"&&c!=="Enter"&&f!==32&&f!==13||this.togglePopup()}_onMapClick(o){const c=o.originalEvent.target,f=this._element;this._popup&&(c===f||f.contains(c))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const o=this._popup;return o?(o.isOpen()?(o.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(o.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const o=this._map,c=this._pos;if(!o||!c)return!1;const f=o.unproject(c),_=o.getFreeCameraOptions();if(!_.position)return!1;const x=_.position.toLngLat();return x.distanceTo(f)<.9*x.distanceTo(this._lngLat)}_evaluateOpacity(){const o=this._map;if(!o)return;const c=this._pos;if(!c||c.x<0||c.x>o.transform.width||c.y<0||c.y>o.transform.height)return void this._clearFadeTimer();const f=o.unproject(c);let _;o._showingGlobe()&&s.isLngLatBehindGlobe(o.transform,this._lngLat)?_=0:(_=1-o._queryFogOpacity(f),o.transform._terrainEnabled()&&o.getTerrain()&&this._behindTerrain()&&(_*=this._occludedOpacity)),this._element.style.opacity=`${_}`,this._element.style.pointerEvents=_>0?"auto":"none",this._popup&&this._popup._setOpacity(_),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const o=this._pos;if(!o||!this._map)return;const c=this._offset.mult(this._scale);this._element.style.transform=` - translate(${o.x}px,${o.y}px) - ${Os[this._anchor]} - ${this._calculateXYTransform()} ${this._calculateZTransform()} - translate(${c.x}px,${c.y}px) - `}_calculateXYTransform(){const o=this._pos,c=this._map,f=this.getPitchAlignment();if(!c||!o||f!=="map")return"";if(!c._showingGlobe()){const C=c.getPitch();return C?`rotateX(${C}deg)`:""}const _=s.radToDeg(s.globeTiltAtLngLat(c.transform,this._lngLat)),x=o.sub(s.globeCenterToScreenPoint(c.transform)),T=Math.abs(x.x)+Math.abs(x.y);if(T===0)return"";const S=_/T;return`rotateX(${-x.y*S}deg) rotateY(${x.x*S}deg)`}_calculateZTransform(){const o=this._pos,c=this._map;if(!c||!o)return"";let f=0;const _=this.getRotationAlignment();if(_==="map")if(c._showingGlobe()){const x=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),T=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(x);f=s.radToDeg(Math.atan2(T.y,T.x))-90}else f=-c.getBearing();else if(_==="horizon"){const x=s.smoothstep(4,6,c.getZoom()),T=s.globeCenterToScreenPoint(c.transform);T.y+=x*c.transform.height;const S=o.sub(T),C=s.radToDeg(Math.atan2(S.y,S.x));f=(C>90?C-270:C+90)*(1-x)}return f+=this._rotation,f?`rotateZ(${f}deg)`:""}_update(o){s.window.cancelAnimationFrame(this._updateFrameId);const c=this._map;c&&(c.transform.renderWorldCopies&&(this._lngLat=Ia(this._lngLat,this._pos,c.transform)),this._pos=c.project(this._lngLat),o===!0?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),c._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(c._showingGlobe()||c.getTerrain()||c.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(o){return this._offset=s.Point.convert(o),this._update(),this}_onMove(o){const c=this._map;if(!c)return;const f=this._pointerdownPos,_=this._positionDelta;if(f&&_){if(!this._isDragging){const x=this._clickTolerance||c._clickTolerance;if(o.point.dist(f)=this._endTime)return this._end;const c=s.easeCubicInOut((o-this._startTime)/(this._endTime-this._startTime));return this._start*(1-c)+this._end*c}isEasing(o){return o>=this._startTime&&o<=this._endTime}jumpTo(o){this._startTime=-1/0,this._endTime=-1/0,this._start=o,this._end=o}easeTo(o,c,f){this._start=this.getValue(c),this._end=o,this._startTime=c,this._endTime=c+f}}const Zf={"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","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Hf={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},hy={showCompass:!0,showZoom:!0,visualizePitch:!1};class dy{constructor(o,c,f=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new id({clickTolerance:o.dragRotate._mouseRotate._clickTolerance}),this.map=o,f&&(this.mousePitch=new od({clickTolerance:o.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener("mousedown",this.mousedown),c.addEventListener("touchstart",this.touchstart,{passive:!1}),c.addEventListener("touchmove",this.touchmove),c.addEventListener("touchend",this.touchend),c.addEventListener("touchcancel",this.reset)}down(o,c){this.mouseRotate.mousedown(o,c),this.mousePitch&&this.mousePitch.mousedown(o,c),ie()}move(o,c){const f=this.map,_=this.mouseRotate.mousemoveWindow(o,c),x=_&&_.bearingDelta;if(x&&f.setBearing(f.getBearing()+x),this.mousePitch){const T=this.mousePitch.mousemoveWindow(o,c),S=T&&T.pitchDelta;S&&f.setPitch(f.getPitch()+S)}}off(){const o=this.element;o.removeEventListener("mousedown",this.mousedown),o.removeEventListener("touchstart",this.touchstart,{passive:!1}),o.removeEventListener("touchmove",this.touchmove),o.removeEventListener("touchend",this.touchend),o.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){te(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(o){this.down(s.extend({},o,{ctrlKey:!0,preventDefault:()=>o.preventDefault()}),Oe(this.element,o)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(o){this.move(o,Oe(this.element,o))}mouseup(o){this.mouseRotate.mouseupWindow(o),this.mousePitch&&this.mousePitch.mouseupWindow(o),this.offTemp()}touchstart(o){o.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Ke(this.element,o.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>o.preventDefault()},this._startPos))}touchmove(o){o.targetTouches.length!==1?this.reset():(this._lastPos=Ke(this.element,o.targetTouches)[0],this.move({preventDefault:()=>o.preventDefault()},this._lastPos))}touchend(o){o.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(d.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(d.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Ta(d.minZoom,d.maxZoom,d.minPitch,d.maxPitch,d.renderWorldCopies),d),this._interactive=d.interactive,this._minTileCacheSize=d.minTileCacheSize,this._maxTileCacheSize=d.maxTileCacheSize,this._failIfMajorPerformanceCaveat=d.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=d.preserveDrawingBuffer,this._antialias=d.antialias,this._useWebGL2=d.useWebGL2,this._trackResize=d.trackResize,this._bearingSnap=d.bearingSnap,this._refreshExpiredTiles=d.refreshExpiredTiles,this._fadeDuration=d.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=d.crossSourceCollisions,this._collectResourceTiming=d.collectResourceTiming,this._optimizeForTerrain=d.optimizeForTerrain,this._language=this._parseLanguage(d.language),this._worldview=d.worldview,this._renderTaskQueue=new ud,this._domRenderTaskQueue=new ud,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},Zf,d.locale),this._clickTolerance=d.clickTolerance,this._cooperativeGestures=d.cooperativeGestures,this._performanceMetricsCollection=d.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new dd(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(d.transformRequest,d.accessToken,d.testMode),this._silenceAuthErrors=!!d.testMode,typeof d.container=="string"){if(this._container=s.window.document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),d.maxBounds&&this.setMaxBounds(d.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),s.window!==void 0&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new ro(this,d),this._localFontFamily=d.localFontFamily,this._localIdeographFontFamily=d.localIdeographFontFamily,d.style&&this.setStyle(d.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),d.projection&&this.setProjection(d.projection),this._hash=d.hash&&new ed(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,s.extend({},d.fitBoundsOptions,{duration:0})))),this.resize(),d.attributionControl&&this.addControl(new dt({customAttribution:d.customAttribution})),this._logoControl=new cd,this.addControl(this._logoControl,d.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",o=>{this._update(o.dataType==="style"),this.fire(new s.Event(`${o.dataType}data`,o))}),this.on("dataloading",o=>{this.fire(new s.Event(`${o.dataType}dataloading`,o))})}_getMapId(){return this._mapId}addControl(d,o){if(o===void 0&&(o=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const c=d.onAdd(this);this._controls.push(d);const f=this._controlPositions[o];return o.indexOf("bottom")!==-1?f.insertBefore(c,f.firstChild):f.appendChild(c),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(d);return o>-1&&this._controls.splice(o,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(d){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const o=!this._moving;return o&&this.fire(new s.Event("movestart",d)).fire(new s.Event("move",d)),this.fire(new s.Event("resize",d)),o&&this.fire(new s.Event("moveend",d)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(d){return this.transform.setMaxBounds(s.LngLatBounds.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d?this.setZoom(d):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d?this.setPitch(d):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(d){return d==="auto"?s.window.navigator.language:Array.isArray(d)?d.length===0?void 0:d.map(o=>o==="auto"?s.window.navigator.language:o):d}setLanguage(d){const o=this._parseLanguage(d);if(!this.style||o===this._language)return this;this._language=o,this.style._reloadSources();for(const c of this._controls)c._setLanguage&&c._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(d){return this.style&&d!==this._worldview?(this._worldview=d,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(d){return this._lazyInitEmptyStyle(),d?typeof d=="string"&&(d={name:d}):d=null,this._useExplicitProjection=!!d,this._prioritizeAndUpdateProjection(d,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const d=this.transform,o=d.projection.name;let c;o==="globe"&&d.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(d.setMercatorFromTransition(),c=!0):o==="mercator"&&d.zoom=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(d),this.style.applyProjectionUpdate(),o){this.painter.clearBackgroundTiles();for(const c in this.style._sourceCaches)this.style._sourceCaches[c].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(d){return this.transform.locationPoint3D(s.LngLat.convert(d))}unproject(d){return this.transform.pointLocation3D(s.Point.convert(d))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(d,o,c){if(d==="mouseenter"||d==="mouseover"){let f=!1;const _=T=>{const S=o.filter(z=>this.getLayer(z)),C=S.length?this.queryRenderedFeatures(T.point,{layers:S}):[];C.length?f||(f=!0,c.call(this,new pr(d,this,T.originalEvent,{features:C}))):f=!1},x=()=>{f=!1};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:x}}}if(d==="mouseleave"||d==="mouseout"){let f=!1;const _=T=>{const S=o.filter(C=>this.getLayer(C));(S.length?this.queryRenderedFeatures(T.point,{layers:S}):[]).length?f=!0:f&&(f=!1,c.call(this,new pr(d,this,T.originalEvent)))},x=T=>{f&&(f=!1,c.call(this,new pr(d,this,T.originalEvent)))};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:x}}}{const f=_=>{const x=o.filter(S=>this.getLayer(S)),T=x.length?this.queryRenderedFeatures(_.point,{layers:x}):[];T.length&&(_.features=T,c.call(this,_),delete _.features)};return{layers:new Set(o),listener:c,delegates:{[d]:f}}}}on(d,o,c){if(c===void 0)return super.on(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(f);for(const _ in f.delegates)this.on(_,f.delegates[_]);return this}once(d,o,c){if(c===void 0)return super.once(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);for(const _ in f.delegates)this.once(_,f.delegates[_]);return this}off(d,o,c){if(c===void 0)return super.off(d,o);o=new Set(Array.isArray(o)?o:[o]);const f=(x,T)=>{if(x.size!==T.size)return!1;for(const S of x)if(!T.has(S))return!1;return!0},_=this._delegatedListeners?this._delegatedListeners[d]:void 0;return _&&(x=>{for(let T=0;T{_?this.fire(new s.ErrorEvent(_)):x&&this._updateDiff(x,o)})}else typeof d=="object"&&this._updateDiff(d,o)}_updateDiff(d,o){try{this.style.setState(d)&&this._update(!0)}catch(c){s.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(d,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(d,o){return this._lazyInitEmptyStyle(),this.style.addSource(d,o),this._update(!0)}isSourceLoaded(d){return!!this.style&&this.style._isSourceCacheLoaded(d)}areTilesLoaded(){const d=this.style&&this.style._sourceCaches;for(const o in d){const c=d[o]._tiles;for(const f in c){const _=c[f];if(_.state!=="loaded"&&_.state!=="errored")return!1}}return!0}addSourceType(d,o,c){this._lazyInitEmptyStyle(),this.style.addSourceType(d,o,c)}removeSource(d){return this.style.removeSource(d),this._updateTerrain(),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,o,{pixelRatio:c=1,sdf:f=!1,stretchX:_,stretchY:x,content:T}={}){if(this._lazyInitEmptyStyle(),o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap){const{width:S,height:C,data:z}=s.exported.getImageData(o);this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},z),pixelRatio:c,stretchX:_,stretchY:x,content:T,sdf:f,version:0})}else if(o.width===void 0||o.height===void 0)this.fire(new s.ErrorEvent(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`")));else{const{width:S,height:C}=o,z=o;this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},new Uint8Array(z.data)),pixelRatio:c,stretchX:_,stretchY:x,content:T,sdf:f,version:0,userImage:z}),z.onAdd&&z.onAdd(this,d)}}updateImage(d,o){const c=this.style.getImage(d);if(!c)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const f=o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap?s.exported.getImageData(o):o,{width:_,height:x}=f;_!==void 0&&x!==void 0?_===c.data.width&&x===c.data.height?(c.data.replace(f.data,!(o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap)),this.style.updateImage(d,c)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${_}, ${x}) - must be that same as the previous version of the image - (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,o){s.getImage(this._requestManager.transformRequest(d,s.ResourceType.Image),(c,f)=>{o(c,f instanceof s.window.HTMLImageElement?s.exported.getImageData(f):f)})}listImages(){return this.style.listImages()}addLayer(d,o){return this._lazyInitEmptyStyle(),this.style.addLayer(d,o),this._update(!0)}moveLayer(d,o){return this.style.moveLayer(d,o),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}setLayerZoomRange(d,o,c){return this.style.setLayerZoomRange(d,o,c),this._update(!0)}setFilter(d,o,c={}){return this.style.setFilter(d,o,c),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,o,c,f={}){return this.style.setPaintProperty(d,o,c,f),this._update(!0)}getPaintProperty(d,o){return this.style.getPaintProperty(d,o)}setLayoutProperty(d,o,c,f={}){return this.style.setLayoutProperty(d,o,c,f),this._update(!0)}getLayoutProperty(d,o){return this.style.getLayoutProperty(d,o)}setLight(d,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,o),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(d){return this._lazyInitEmptyStyle(),!d&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(d),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(d){return this._lazyInitEmptyStyle(),this.style.setFog(d),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(d){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(d),this.transform):0}setFeatureState(d,o){return this.style.setFeatureState(d,o),this._update()}removeFeatureState(d,o){return this.style.removeFeatureState(d,o),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}_updateContainerDimensions(){if(!this._container)return;const d=this._container.getBoundingClientRect().width||400,o=this._container.getBoundingClientRect().height||300;let c,f,_,x=this._container;for(;x&&(!f||!_);){const T=s.window.getComputedStyle(x).transform;T&&T!=="none"&&(c=T.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&c[0]!=="0"&&c[0]!=="1"&&(f=c[0]),c[3]&&c[3]!=="0"&&c[3]!=="1"&&(_=c[3])),x=x.parentElement}this._containerWidth=f?Math.abs(d/f):d,this._containerHeight=_?Math.abs(o/_):o}_detectMissingCSS(){s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const d=this._container;d.classList.add("mapboxgl-map"),(this._missingCSSCanary=J("div","mapboxgl-canary",d)).style.visibility="hidden",this._detectMissingCSS();const o=this._canvasContainer=J("div","mapboxgl-canvas-container",d);this._interactive&&o.classList.add("mapboxgl-interactive"),this._canvas=J("canvas","mapboxgl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=J("div","mapboxgl-control-container",d),f=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{f[_]=J("div",`mapboxgl-ctrl-${_}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,o){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(d),this._canvas.height=c*Math.ceil(o),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${o}px`}_addMarker(d){this._markers.push(d)}_removeMarker(d){const o=this._markers.indexOf(d);o!==-1&&this._markers.splice(o,1)}_addPopup(d){this._popups.push(d)}_removePopup(d){const o=this._popups.indexOf(d);o!==-1&&this._popups.splice(o,1)}_setupPainter(){const d=s.extend({},D.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),o=this._useWebGL2&&this._canvas.getContext("webgl2",d),c=o||this._canvas.getContext("webgl",d)||this._canvas.getContext("experimental-webgl",d);c?(this._useWebGL2&&!o&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new ba(c,this.transform,!!o),this.on("data",f=>{f.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(d){d.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:d}))}_contextRestored(d){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:d}))}_onMapScroll(d){if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_requestDomTask(d){!this.loaded()||this.loaded()&&!this.isMoving()?d():this._domRenderTaskQueue.add(d)}_render(d){let o;const c=this.painter.context.extTimerQuery,f=s.exported.now();if(this.listens("gpu-timing-frame")&&(o=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,o)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(d),this._domRenderTaskQueue.run(d),this._removed)return;this._updateProjectionTransition();const _=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,C=this.transform.pitch,z=s.exported.now(),P=new s.EvaluationParameters(S,{now:z,fadeDuration:_,pitch:C,transition:this.style.getTransition()});this.style.update(P)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let x=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),x=this._updateAverageElevation(f),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):x=this._updateAverageElevation(f),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,_,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:_,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),o){const S=s.exported.now()-f;c.endQueryEXT(c.TIME_ELAPSED_EXT,o),setTimeout(()=>{const C=c.getQueryObjectEXT(o,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(o),this.fire(new s.Event("gpu-timing-frame",{cpuTime:S,gpuTime:C})),s.window.performance.mark("frame-gpu",{startTime:f,detail:{gpuTime:C}})},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const C=this.painter.queryGpuTimers(S);this.fire(new s.Event("gpu-timing-layer",{layerTimes:C}))},50)}if(this.listens("gpu-timing-deferred-render")){const S=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const C=this.painter.queryGpuTimeDeferredRender(S);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:C}))},50)}const T=this._sourcesDirty||this._styleDirty||this._placementDirty||x;if(T||this._repaint)this.triggerRepaint();else{const S=!this.isMoving()&&this.loaded();if(S&&(x=this._updateAverageElevation(f,!0)),x)this.triggerRepaint();else if(this._triggerFrame(!1),S&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const C=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:C})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||T||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(d){for(const o of this._markers)d&&!this.getRenderWorldCopies()&&(o._lngLat=o._lngLat.wrap()),o._update();for(const o of this._popups)!d||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}_updateAverageElevation(d,o=!1){const c=f=>(this.transform.averageElevation=f,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&c(0);if((o||d-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(d)){const f=this.transform.averageElevation;let _=this.transform.sampleAverageElevation(),x=!1;this.transform.elevation&&(x=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(_)?_=0:this._averageElevationLastSampledAt=d;const T=Math.abs(f-_);if(T>1){if(this._isInitialLoad||x)return this._averageElevation.jumpTo(_),c(_);this._averageElevation.easeTo(_,d,300)}else if(T>1e-4)return this._averageElevation.jumpTo(_),c(_)}return!!this._averageElevation.isEasing(d)&&c(this._averageElevation.getValue(d))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,d=>{if(d&&(d.message===s.AUTH_ERR_MSG||d.status===401)){const o=this.painter.context.gl;s.storeAuthState(o,!1),this._logoControl instanceof cd&&this._logoControl._updateLogo(),o&&o.clear(o.DEPTH_BUFFER_BIT|o.COLOR_BUFFER_BIT|o.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const d=this._isDragging();this.painter.updateTerrain(this.style,d)}_calculateSpeedIndex(){const d=this.painter.canvasCopy(),o=this.painter.getCanvasCopiesAndTimestamps();o.timeStamps.push(performance.now());const c=this.painter.context.gl,f=c.createFramebuffer();function _(x){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,x,0);const T=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,T),T}return c.bindFramebuffer(c.FRAMEBUFFER,f),this._canvasPixelComparison(_(d),o.canvasCopies.map(_),o.timeStamps)}_canvasPixelComparison(d,o,c){let f=c[1]-c[0];const _=d.length/4;for(let x=0;x{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(o)}))}_preloadTiles(d){const o=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(o,(c,f)=>c._preloadTiles(d,f),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(d){this._trackResize&&this.resize({originalEvent:d})._update()}_onVisibilityChange(){s.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(d){this._showTerrainWireframe!==d&&(this._showTerrainWireframe=d,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(d){this._speedIndexTiming!==d&&(this._speedIndexTiming=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(d){this._showTileAABBs!==d&&(this._showTileAABBs=d,d&&this._update())}_setCacheLimits(d,o){s.setCacheLimits(d,o)}get version(){return s.version}},NavigationControl:class{constructor(d){this.options=s.extend({},hy,d),this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",o=>{this._map&&this._map.zoomIn({},{originalEvent:o})}),J("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",o=>{this._map&&this._map.zoomOut({},{originalEvent:o})}),J("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",o=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:o}):c.resetNorth({},{originalEvent:o}))}),this._compassIcon=J("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const d=this._map;if(!d)return;const o=d.getZoom(),c=o===d.getMaxZoom(),f=o===d.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const d=this._map;if(!d)return;const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(d.transform.pitch*(Math.PI/180)),.5)}) rotateX(${d.transform.pitch}deg) rotateZ(${d.transform.angle*(180/Math.PI)}deg)`:`rotate(${d.transform.angle*(180/Math.PI)}deg)`;d._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=o)})}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),d.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&d.on("pitch",this._rotateCompassArrow),d.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new dy(d,this._compass,this.options.visualizePitch)),this._container}onRemove(){const d=this._map;d&&(this._container.remove(),this.options.showZoom&&d.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&d.off("pitch",this._rotateCompassArrow),d.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(d,o){const c=J("button",d,this._container);return c.type="button",c.addEventListener("click",o),c}_setButtonTitle(d,o){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${o}`);d.setAttribute("aria-label",c),d.firstElementChild&&d.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(d){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},pd,d),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Sa(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(d){return this._map=d,this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(d){const o=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,d(c)};this._supportsGeolocation!==void 0?d(this._supportsGeolocation):s.window.navigator.permissions!==void 0?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>o(c.state!=="denied")).catch(()=>o()):o()}_isOutOfMapMaxBounds(d){const o=this._map.getMaxBounds(),c=d.coords;return!!o&&(c.longitudeo.getEast()||c.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",d)),this._finish()}}_updateCamera(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude),c=d.coords.accuracy,f=this._map.getBearing(),_=s.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(o.toBounds(c),_,{geolocateSource:!0})}_updateMarker(d){if(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const d=this._map.transform,o=s.mercatorZfromAltitude(1,d._center.lat)*d.worldSize,c=Math.ceil(2*this._accuracy*o);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",d)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(d){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=J("button","mapboxgl-ctrl-geolocate",this._container),J("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",d===!1){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=J("div","mapboxgl-user-location"),this._dotElement.appendChild(J("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(J("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new at({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=J("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new at({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",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(d){this._userLocationDotMarker&&(d.webkitCompassHeading?this._heading=d.webkitCompassHeading:d.absolute===!0&&(this._heading=-1*d.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(d={maximumAge:6e5,timeout:0},this._noTimeout=!0):(d=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,d),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const d=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};s.window.DeviceMotionEvent!==void 0&&typeof s.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&d()}).catch(console.error):d()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:dt,ScaleControl:class{constructor(d){this.options=s.extend({},fd,d),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const d=this.options.maxWidth||100,o=this._map,c=o._containerHeight/2,f=o._containerWidth/2-d/2,_=o.unproject([f,c]),x=o.unproject([f+d,c]),T=_.distanceTo(x);if(this.options.unit==="imperial"){const S=3.2808*T;S>5280?this._setScale(d,S/5280,"mile"):this._setScale(d,S,"foot")}else this.options.unit==="nautical"?this._setScale(d,T/1852,"nautical-mile"):T>=1e3?this._setScale(d,T/1e3,"kilometer"):this._setScale(d,T,"meter")}_setScale(d,o,c){this._map._requestDomTask(()=>{const f=function(x){const T=Math.pow(10,`${Math.floor(x)}`.length-1);let S=x/T;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:S>=1?1:function(C){const z=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*z)/z}(S),T*S}(o),_=f/o;this._container.innerHTML=this._isNumberFormatSupported&&c!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(f):`${f} ${md[c]}`,this._container.style.width=d*_+"px"})}onAdd(d){return this._map=d,this._language=d.getLanguage(),this._container=J("div","mapboxgl-ctrl mapboxgl-ctrl-scale",d.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(d){this._language=d,this._update()}setUnit(d){this.options.unit=d,this._update()}},FullscreenControl:class{constructor(d){this._fullscreen=!1,d&&d.container&&(d.container instanceof s.window.HTMLElement?this._container=d.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=J("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const d=this._fullscreenButton=J("button","mapboxgl-ctrl-fullscreen",this._controlContainer);J("span","mapboxgl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",d)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(d){super(),this.options=s.extend(Object.create(hd),d),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(d&&d.className?d.className.trim().split(/\s+/):[])}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&d.on("preclick",this._onClose),this.options.closeOnMove&&d.on("move",this._onClose),d.on("remove",this.remove),this._update(),d._addPopup(this),this._focusFirstElement(),this._trackPointer?(d.on("mousemove",this._onMouseEvent),d.on("mouseup",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")):d.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const d=this._map;return d&&(d.off("move",this._update),d.off("move",this._onClose),d.off("preclick",this._onClose),d.off("click",this._onClose),d.off("remove",this.remove),d.off("mousemove",this._onMouseEvent),d.off("mouseup",this._onMouseEvent),d.off("drag",this._onMouseEvent),d._canvasContainer&&d._canvasContainer.classList.remove("mapboxgl-track-pointer"),d._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(d){this._lngLat=s.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update();const o=this._map;return o&&(o.on("move",this._update),o.off("mousemove",this._onMouseEvent),o._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const d=this._map;return d&&(d.off("move",this._update),d.on("mousemove",this._onMouseEvent),d.on("drag",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(s.window.document.createTextNode(d))}setHTML(d){const o=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let f;for(c.innerHTML=d;f=c.firstChild,f;)o.appendChild(f);return this.setDOMContent(o)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){let o=this._content;if(o)for(;o.hasChildNodes();)o.firstChild&&o.removeChild(o.firstChild);else o=this._content=J("div","mapboxgl-popup-content",this._container||void 0);if(o.appendChild(d),this.options.closeButton){const c=this._closeButton=J("button","mapboxgl-popup-close-button",o);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(d){return this._classList.add(d),this._updateClassList(),this}removeClassName(d){return this._classList.delete(d),this._updateClassList(),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){let o;return this._classList.delete(d)?o=!1:(this._classList.add(d),o=!0),this._updateClassList(),o}_onMouseEvent(d){this._update(d.point)}_getAnchor(d){if(this.options.anchor)return this.options.anchor;const o=this._map,c=this._container,f=this._pos;if(!o||!c||!f)return"bottom";const _=c.offsetWidth,x=c.offsetHeight,T=f.x<_/2,S=f.x>o.transform.width-_/2;if(f.y+do.transform.height-x){if(T)return"bottom-left";if(S)return"bottom-right"}return T?"left":S?"right":"bottom"}_updateClassList(){const d=this._container;if(!d)return;const o=[...this._classList];o.push("mapboxgl-popup"),this._anchor&&o.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&o.push("mapboxgl-popup-track-pointer"),d.className=o.join(" ")}_update(d){const o=this._map,c=this._content;if(!o||!this._lngLat&&!this._trackPointer||!c)return;let f=this._container;if(f||(f=this._container=J("div","mapboxgl-popup",o.getContainer()),this._tip=J("div","mapboxgl-popup-tip",f),f.appendChild(c)),this.options.maxWidth&&f.style.maxWidth!==this.options.maxWidth&&(f.style.maxWidth=this.options.maxWidth),o.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ia(this._lngLat,this._pos,o.transform)),!this._trackPointer||d){const _=this._pos=this._trackPointer&&d?d:o.project(this._lngLat),x=Wf(this.options.offset),T=this._anchor=this._getAnchor(x.y),S=Wf(this.options.offset,T),C=_.add(S).round();o._requestDomTask(()=>{this._container&&T&&(this._container.style.transform=`${Os[T]} translate(${C.x}px,${C.y}px)`)})}if(!this._marker&&o._showingGlobe()){const _=s.isLngLatBehindGlobe(o.transform,this._lngLat)?0:1;this._setOpacity(_)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(uy);d&&d.focus()}_onClose(){this.remove()}_setOpacity(d){this._container&&(this._container.style.opacity=`${d}`),this._content&&(this._content.style.pointerEvents=d?"auto":"none")}},Marker:at,Style:to,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Pf,Evented:s.Evented,config:s.config,prewarm:function(){ha().acquire(Ji)},clearPrewarmedResources:function(){const d=Or;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Ji),Or=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(d){s.config.ACCESS_TOKEN=d},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(d){s.config.API_URL=d},get workerCount(){return hr.workerCount},set workerCount(d){hr.workerCount=d},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(d){s.config.MAX_PARALLEL_IMAGE_REQUESTS=d},clearStorage(d){s.clearTileCache(d)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return ka});var E=m;return E})})(rk);var Vx=rk.exports;const TU=g1(Vx),SU=LP({__proto__:null,default:TU},[Vx]);const lv="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA",HT="/examples/who-wins-b2s/rural_places_5000_plus.json",AU=wU({typography:{fontFamily:"Montserrat"},palette:{primary:{main:"#00835D",light:"#A3E2B5",dark:"#26535C",contrastText:"white"}}});function CU(){var m;const e=ut.useContext(QC),n=ut.useRef(null),l=ut.useMemo(()=>new Vx.Popup().setText("Hello world!"),[]);ut.useCallback(()=>{var v;(v=n.current)==null||v.togglePopup()},[]);let h=!1;return ut.useEffect(()=>{if(e&&!e.data.hasOwnProperty("placeData")&&!h){console.log("Initial place data fetch..."),console.log(HT),h=!0;const v=window.document.getElementById("info-wrapper");v!==null&&(v.style.opacity="1.0",v.style.position="absolute",v.style.background=`rgba(46, 60, 67, 0.5) url('${e.baseURL}/images/loading.gif') no-repeat fixed center`,v.style.backgroundSize="20px"),e.setData({...(e==null?void 0:e.data)||{},placeData:null}),e==null||e.apiClient.get(HT).then(E=>{E&&E.hasOwnProperty("data")&&(console.log("Data result:",E.data.features),e.setData({...e.data,placeData:E.data.features}),h=!1,v!==null&&(v.style.opacity="0.0",v.style.pointerEvents="none",setTimeout(()=>{v.style.background="transparent"},533)))}).catch(E=>{console.error("Error fetching data:",E),h=!1,v!==null&&(v.style.opacity="0.0",v.style.pointerEvents="none",setTimeout(()=>{v.style.background="transparent"},533))})}},[e==null?void 0:e.data]),ut.createElement(EU,{theme:AU},ut.createElement("div",{className:"slippy-map"},ut.createElement(QO,{mapboxAccessToken:lv,initialViewState:{latitude:40,longitude:-100,pitch:45,zoom:3.5},style:{width:600,height:400},mapStyle:`https://api.mapbox.com/styles/v1/ruralinno/cl010e7b7001p15pe3l0306hv?access_token=${lv}`},!!(e!=null&&e.data)&&!!((m=e==null?void 0:e.data)!=null&&m.placeData)&&e.data.placeData.length>0&&!!n&&typeof n!==void 0&&ut.createElement(eI,{longitude:-122.4,latitude:37.8,color:"red",popup:l,ref:n}),ut.createElement(uF,{mapboxAccessToken:lv,position:"top-right"}),ut.createElement(t4,{position:"top-right"}),ut.createElement(e4,{position:"top-right"}),ut.createElement(n4,{position:"bottom-left",unit:"imperial"}))),ut.createElement("div",{id:"info-wrapper",style:{pointerEvents:"none",position:"absolute",top:0,minWidth:"100vw",minHeight:"100vh",transition:"opacity 5.05s ease-in-out 0.025s",opacity:"initial",background:"transparent",backgroundSize:"20px",zIndex:100}}))}const IU="https://cori-risi-apps.s3.amazonaws.com";function kU(e){sC(e).render(ut.createElement(ut.StrictMode,null,ut.createElement(bO,{baseURL:IU},ut.createElement(CU,null))))}kU(document.getElementById("app")); diff --git a/assets/index-c844f23b.js b/docs/frontend/dist/assets/index-a6df8453.js similarity index 99% rename from assets/index-c844f23b.js rename to docs/frontend/dist/assets/index-a6df8453.js index b82986c..c03700b 100644 --- a/assets/index-c844f23b.js +++ b/docs/frontend/dist/assets/index-a6df8453.js @@ -1385,4 +1385,4 @@ precision highp float; translate(${c.x}px,${c.y}px) `}_calculateXYTransform(){const o=this._pos,c=this._map,f=this.getPitchAlignment();if(!c||!o||f!=="map")return"";if(!c._showingGlobe()){const C=c.getPitch();return C?`rotateX(${C}deg)`:""}const _=s.radToDeg(s.globeTiltAtLngLat(c.transform,this._lngLat)),v=o.sub(s.globeCenterToScreenPoint(c.transform)),E=Math.abs(v.x)+Math.abs(v.y);if(E===0)return"";const S=_/E;return`rotateX(${-v.y*S}deg) rotateY(${v.x*S}deg)`}_calculateZTransform(){const o=this._pos,c=this._map;if(!c||!o)return"";let f=0;const _=this.getRotationAlignment();if(_==="map")if(c._showingGlobe()){const v=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),E=c.project(new s.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(v);f=s.radToDeg(Math.atan2(E.y,E.x))-90}else f=-c.getBearing();else if(_==="horizon"){const v=s.smoothstep(4,6,c.getZoom()),E=s.globeCenterToScreenPoint(c.transform);E.y+=v*c.transform.height;const S=o.sub(E),C=s.radToDeg(Math.atan2(S.y,S.x));f=(C>90?C-270:C+90)*(1-v)}return f+=this._rotation,f?`rotateZ(${f}deg)`:""}_update(o){s.window.cancelAnimationFrame(this._updateFrameId);const c=this._map;c&&(c.transform.renderWorldCopies&&(this._lngLat=aa(this._lngLat,this._pos,c.transform)),this._pos=c.project(this._lngLat),o===!0?this._updateFrameId=s.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),c._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(c._showingGlobe()||c.getTerrain()||c.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(o){return this._offset=s.Point.convert(o),this._update(),this}_onMove(o){const c=this._map;if(!c)return;const f=this._pointerdownPos,_=this._positionDelta;if(f&&_){if(!this._isDragging){const v=this._clickTolerance||c._clickTolerance;if(o.point.dist(f)=this._endTime)return this._end;const c=s.easeCubicInOut((o-this._startTime)/(this._endTime-this._startTime));return this._start*(1-c)+this._end*c}isEasing(o){return o>=this._startTime&&o<=this._endTime}jumpTo(o){this._startTime=-1/0,this._endTime=-1/0,this._start=o,this._end=o}easeTo(o,c,f){this._start=this.getValue(c),this._end=o,this._startTime=c,this._endTime=c+f}}const nf={"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","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},rf={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},r_={showCompass:!0,showZoom:!0,visualizePitch:!1};class o_{constructor(o,c,f=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new Th({clickTolerance:o.dragRotate._mouseRotate._clickTolerance}),this.map=o,f&&(this.mousePitch=new Sh({clickTolerance:o.dragRotate._mousePitch._clickTolerance})),s.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener("mousedown",this.mousedown),c.addEventListener("touchstart",this.touchstart,{passive:!1}),c.addEventListener("touchmove",this.touchmove),c.addEventListener("touchend",this.touchend),c.addEventListener("touchcancel",this.reset)}down(o,c){this.mouseRotate.mousedown(o,c),this.mousePitch&&this.mousePitch.mousedown(o,c),ue()}move(o,c){const f=this.map,_=this.mouseRotate.mousemoveWindow(o,c),v=_&&_.bearingDelta;if(v&&f.setBearing(f.getBearing()+v),this.mousePitch){const E=this.mousePitch.mousemoveWindow(o,c),S=E&&E.pitchDelta;S&&f.setPitch(f.getPitch()+S)}}off(){const o=this.element;o.removeEventListener("mousedown",this.mousedown),o.removeEventListener("touchstart",this.touchstart,{passive:!1}),o.removeEventListener("touchmove",this.touchmove),o.removeEventListener("touchend",this.touchend),o.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){re(),s.window.removeEventListener("mousemove",this.mousemove),s.window.removeEventListener("mouseup",this.mouseup)}mousedown(o){this.down(s.extend({},o,{ctrlKey:!0,preventDefault:()=>o.preventDefault()}),je(this.element,o)),s.window.addEventListener("mousemove",this.mousemove),s.window.addEventListener("mouseup",this.mouseup)}mousemove(o){this.move(o,je(this.element,o))}mouseup(o){this.mouseRotate.mouseupWindow(o),this.mousePitch&&this.mousePitch.mouseupWindow(o),this.offTemp()}touchstart(o){o.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=tt(this.element,o.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>o.preventDefault()},this._startPos))}touchmove(o){o.targetTouches.length!==1?this.reset():(this._lastPos=tt(this.element,o.targetTouches)[0],this.move({preventDefault:()=>o.preventDefault()},this._lastPos))}touchend(o){o.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(d.antialias&&s.isSafariWithAntialiasingBug(s.window)&&(d.antialias=!1,s.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new ia(d.minZoom,d.maxZoom,d.minPitch,d.maxPitch,d.renderWorldCopies),d),this._interactive=d.interactive,this._minTileCacheSize=d.minTileCacheSize,this._maxTileCacheSize=d.maxTileCacheSize,this._failIfMajorPerformanceCaveat=d.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=d.preserveDrawingBuffer,this._antialias=d.antialias,this._useWebGL2=d.useWebGL2,this._trackResize=d.trackResize,this._bearingSnap=d.bearingSnap,this._refreshExpiredTiles=d.refreshExpiredTiles,this._fadeDuration=d.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=d.crossSourceCollisions,this._collectResourceTiming=d.collectResourceTiming,this._optimizeForTerrain=d.optimizeForTerrain,this._language=this._parseLanguage(d.language),this._worldview=d.worldview,this._renderTaskQueue=new kh,this._domRenderTaskQueue=new kh,this._controls=[],this._markers=[],this._popups=[],this._mapId=s.uniqueId(),this._locale=s.extend({},nf,d.locale),this._clickTolerance=d.clickTolerance,this._cooperativeGestures=d.cooperativeGestures,this._performanceMetricsCollection=d.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new zh(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new s.RequestManager(d.transformRequest,d.accessToken,d.testMode),this._silenceAuthErrors=!!d.testMode,typeof d.container=="string"){if(this._container=s.window.document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof s.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(this._container.childNodes.length>0&&s.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),d.maxBounds&&this.setMaxBounds(d.maxBounds),s.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),s.window!==void 0&&(s.window.addEventListener("online",this._onWindowOnline,!1),s.window.addEventListener("resize",this._onWindowResize,!1),s.window.addEventListener("orientationchange",this._onWindowResize,!1),s.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),s.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new Gr(this,d),this._localFontFamily=d.localFontFamily,this._localIdeographFontFamily=d.localIdeographFontFamily,d.style&&this.setStyle(d.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),d.projection&&this.setProjection(d.projection),this._hash=d.hash&&new xh(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,s.extend({},d.fitBoundsOptions,{duration:0})))),this.resize(),d.attributionControl&&this.addControl(new ht({customAttribution:d.customAttribution})),this._logoControl=new Mh,this.addControl(this._logoControl,d.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",o=>{this._update(o.dataType==="style"),this.fire(new s.Event(`${o.dataType}data`,o))}),this.on("dataloading",o=>{this.fire(new s.Event(`${o.dataType}dataloading`,o))})}_getMapId(){return this._mapId}addControl(d,o){if(o===void 0&&(o=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const c=d.onAdd(this);this._controls.push(d);const f=this._controlPositions[o];return o.indexOf("bottom")!==-1?f.insertBefore(c,f.firstChild):f.appendChild(c),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new s.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(d);return o>-1&&this._controls.splice(o,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(d){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const o=!this._moving;return o&&this.fire(new s.Event("movestart",d)).fire(new s.Event("move",d)),this.fire(new s.Event("resize",d)),o&&this.fire(new s.Event("moveend",d)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(d){return this.transform.setMaxBounds(s.LngLatBounds.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d?this.setZoom(d):this.fire(new s.Event("zoomstart")).fire(new s.Event("zoom")).fire(new s.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d?this.setPitch(d):this.fire(new s.Event("pitchstart")).fire(new s.Event("pitch")).fire(new s.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(d){return d==="auto"?s.window.navigator.language:Array.isArray(d)?d.length===0?void 0:d.map(o=>o==="auto"?s.window.navigator.language:o):d}setLanguage(d){const o=this._parseLanguage(d);if(!this.style||o===this._language)return this;this._language=o,this.style._reloadSources();for(const c of this._controls)c._setLanguage&&c._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(d){return this.style&&d!==this._worldview?(this._worldview=d,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(d){return this._lazyInitEmptyStyle(),d?typeof d=="string"&&(d={name:d}):d=null,this._useExplicitProjection=!!d,this._prioritizeAndUpdateProjection(d,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const d=this.transform,o=d.projection.name;let c;o==="globe"&&d.zoom>=s.GLOBE_ZOOM_THRESHOLD_MAX?(d.setMercatorFromTransition(),c=!0):o==="mercator"&&d.zoom=s.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(d),this.style.applyProjectionUpdate(),o){this.painter.clearBackgroundTiles();for(const c in this.style._sourceCaches)this.style._sourceCaches[c].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(d){return this.transform.locationPoint3D(s.LngLat.convert(d))}unproject(d){return this.transform.pointLocation3D(s.Point.convert(d))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(d,o,c){if(d==="mouseenter"||d==="mouseover"){let f=!1;const _=E=>{const S=o.filter(z=>this.getLayer(z)),C=S.length?this.queryRenderedFeatures(E.point,{layers:S}):[];C.length?f||(f=!0,c.call(this,new oi(d,this,E.originalEvent,{features:C}))):f=!1},v=()=>{f=!1};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:v}}}if(d==="mouseleave"||d==="mouseout"){let f=!1;const _=E=>{const S=o.filter(C=>this.getLayer(C));(S.length?this.queryRenderedFeatures(E.point,{layers:S}):[]).length?f=!0:f&&(f=!1,c.call(this,new oi(d,this,E.originalEvent)))},v=E=>{f&&(f=!1,c.call(this,new oi(d,this,E.originalEvent)))};return{layers:new Set(o),listener:c,delegates:{mousemove:_,mouseout:v}}}{const f=_=>{const v=o.filter(S=>this.getLayer(S)),E=v.length?this.queryRenderedFeatures(_.point,{layers:v}):[];E.length&&(_.features=E,c.call(this,_),delete _.features)};return{layers:new Set(o),listener:c,delegates:{[d]:f}}}}on(d,o,c){if(c===void 0)return super.on(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(f);for(const _ in f.delegates)this.on(_,f.delegates[_]);return this}once(d,o,c){if(c===void 0)return super.once(d,o);Array.isArray(o)||(o=[o]);const f=this._createDelegatedListener(d,o,c);for(const _ in f.delegates)this.once(_,f.delegates[_]);return this}off(d,o,c){if(c===void 0)return super.off(d,o);o=new Set(Array.isArray(o)?o:[o]);const f=(v,E)=>{if(v.size!==E.size)return!1;for(const S of v)if(!E.has(S))return!1;return!0},_=this._delegatedListeners?this._delegatedListeners[d]:void 0;return _&&(v=>{for(let E=0;E{_?this.fire(new s.ErrorEvent(_)):v&&this._updateDiff(v,o)})}else typeof d=="object"&&this._updateDiff(d,o)}_updateDiff(d,o){try{this.style.setState(d)&&this._update(!0)}catch(c){s.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(d,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(s.warnOnce("There is no style added to the map."),!1)}addSource(d,o){return this._lazyInitEmptyStyle(),this.style.addSource(d,o),this._update(!0)}isSourceLoaded(d){return!!this.style&&this.style._isSourceCacheLoaded(d)}areTilesLoaded(){const d=this.style&&this.style._sourceCaches;for(const o in d){const c=d[o]._tiles;for(const f in c){const _=c[f];if(_.state!=="loaded"&&_.state!=="errored")return!1}}return!0}addSourceType(d,o,c){this._lazyInitEmptyStyle(),this.style.addSourceType(d,o,c)}removeSource(d){return this.style.removeSource(d),this._updateTerrain(),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,o,{pixelRatio:c=1,sdf:f=!1,stretchX:_,stretchY:v,content:E}={}){if(this._lazyInitEmptyStyle(),o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap){const{width:S,height:C,data:z}=s.exported.getImageData(o);this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},z),pixelRatio:c,stretchX:_,stretchY:v,content:E,sdf:f,version:0})}else if(o.width===void 0||o.height===void 0)this.fire(new s.ErrorEvent(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`")));else{const{width:S,height:C}=o,z=o;this.style.addImage(d,{data:new s.RGBAImage({width:S,height:C},new Uint8Array(z.data)),pixelRatio:c,stretchX:_,stretchY:v,content:E,sdf:f,version:0,userImage:z}),z.onAdd&&z.onAdd(this,d)}}updateImage(d,o){const c=this.style.getImage(d);if(!c)return void this.fire(new s.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const f=o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap?s.exported.getImageData(o):o,{width:_,height:v}=f;_!==void 0&&v!==void 0?_===c.data.width&&v===c.data.height?(c.data.replace(f.data,!(o instanceof s.window.HTMLImageElement||s.window.ImageBitmap&&o instanceof s.window.ImageBitmap)),this.style.updateImage(d,c)):this.fire(new s.ErrorEvent(new Error(`The width and height of the updated image (${_}, ${v}) must be that same as the previous version of the image - (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,o){s.getImage(this._requestManager.transformRequest(d,s.ResourceType.Image),(c,f)=>{o(c,f instanceof s.window.HTMLImageElement?s.exported.getImageData(f):f)})}listImages(){return this.style.listImages()}addLayer(d,o){return this._lazyInitEmptyStyle(),this.style.addLayer(d,o),this._update(!0)}moveLayer(d,o){return this.style.moveLayer(d,o),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}setLayerZoomRange(d,o,c){return this.style.setLayerZoomRange(d,o,c),this._update(!0)}setFilter(d,o,c={}){return this.style.setFilter(d,o,c),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,o,c,f={}){return this.style.setPaintProperty(d,o,c,f),this._update(!0)}getPaintProperty(d,o){return this.style.getPaintProperty(d,o)}setLayoutProperty(d,o,c,f={}){return this.style.setLayoutProperty(d,o,c,f),this._update(!0)}getLayoutProperty(d,o){return this.style.getLayoutProperty(d,o)}setLight(d,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,o),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(d){return this._lazyInitEmptyStyle(),!d&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(d),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(d){return this._lazyInitEmptyStyle(),this.style.setFog(d),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(d){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(d),this.transform):0}setFeatureState(d,o){return this.style.setFeatureState(d,o),this._update()}removeFeatureState(d,o){return this.style.removeFeatureState(d,o),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}_updateContainerDimensions(){if(!this._container)return;const d=this._container.getBoundingClientRect().width||400,o=this._container.getBoundingClientRect().height||300;let c,f,_,v=this._container;for(;v&&(!f||!_);){const E=s.window.getComputedStyle(v).transform;E&&E!=="none"&&(c=E.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&c[0]!=="0"&&c[0]!=="1"&&(f=c[0]),c[3]&&c[3]!=="0"&&c[3]!=="1"&&(_=c[3])),v=v.parentElement}this._containerWidth=f?Math.abs(d/f):d,this._containerHeight=_?Math.abs(o/_):o}_detectMissingCSS(){s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const d=this._container;d.classList.add("mapboxgl-map"),(this._missingCSSCanary=oe("div","mapboxgl-canary",d)).style.visibility="hidden",this._detectMissingCSS();const o=this._canvasContainer=oe("div","mapboxgl-canvas-container",d);this._interactive&&o.classList.add("mapboxgl-interactive"),this._canvas=oe("canvas","mapboxgl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=oe("div","mapboxgl-control-container",d),f=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{f[_]=oe("div",`mapboxgl-ctrl-${_}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,o){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(d),this._canvas.height=c*Math.ceil(o),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${o}px`}_addMarker(d){this._markers.push(d)}_removeMarker(d){const o=this._markers.indexOf(d);o!==-1&&this._markers.splice(o,1)}_addPopup(d){this._popups.push(d)}_removePopup(d){const o=this._popups.indexOf(d);o!==-1&&this._popups.splice(o,1)}_setupPainter(){const d=s.extend({},F.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),o=this._useWebGL2&&this._canvas.getContext("webgl2",d),c=o||this._canvas.getContext("webgl",d)||this._canvas.getContext("experimental-webgl",d);c?(this._useWebGL2&&!o&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new ta(c,this.transform,!!o),this.on("data",f=>{f.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(d){d.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:d}))}_contextRestored(d){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:d}))}_onMapScroll(d){if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_requestDomTask(d){!this.loaded()||this.loaded()&&!this.isMoving()?d():this._domRenderTaskQueue.add(d)}_render(d){let o;const c=this.painter.context.extTimerQuery,f=s.exported.now();if(this.listens("gpu-timing-frame")&&(o=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,o)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(d),this._domRenderTaskQueue.run(d),this._removed)return;this._updateProjectionTransition();const _=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,C=this.transform.pitch,z=s.exported.now(),P=new s.EvaluationParameters(S,{now:z,fadeDuration:_,pitch:C,transition:this.style.getTransition()});this.style.update(P)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let v=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),v=this._updateAverageElevation(f),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):v=this._updateAverageElevation(f),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,_,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:_,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),o){const S=s.exported.now()-f;c.endQueryEXT(c.TIME_ELAPSED_EXT,o),setTimeout(()=>{const C=c.getQueryObjectEXT(o,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(o),this.fire(new s.Event("gpu-timing-frame",{cpuTime:S,gpuTime:C})),s.window.performance.mark("frame-gpu",{startTime:f,detail:{gpuTime:C}})},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const C=this.painter.queryGpuTimers(S);this.fire(new s.Event("gpu-timing-layer",{layerTimes:C}))},50)}if(this.listens("gpu-timing-deferred-render")){const S=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const C=this.painter.queryGpuTimeDeferredRender(S);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:C}))},50)}const E=this._sourcesDirty||this._styleDirty||this._placementDirty||v;if(E||this._repaint)this.triggerRepaint();else{const S=!this.isMoving()&&this.loaded();if(S&&(v=this._updateAverageElevation(f,!0)),v)this.triggerRepaint();else if(this._triggerFrame(!1),S&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const C=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:C})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||E||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(d){for(const o of this._markers)d&&!this.getRenderWorldCopies()&&(o._lngLat=o._lngLat.wrap()),o._update();for(const o of this._popups)!d||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}_updateAverageElevation(d,o=!1){const c=f=>(this.transform.averageElevation=f,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&c(0);if((o||d-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(d)){const f=this.transform.averageElevation;let _=this.transform.sampleAverageElevation(),v=!1;this.transform.elevation&&(v=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(_)?_=0:this._averageElevationLastSampledAt=d;const E=Math.abs(f-_);if(E>1){if(this._isInitialLoad||v)return this._averageElevation.jumpTo(_),c(_);this._averageElevation.easeTo(_,d,300)}else if(E>1e-4)return this._averageElevation.jumpTo(_),c(_)}return!!this._averageElevation.isEasing(d)&&c(this._averageElevation.getValue(d))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,d=>{if(d&&(d.message===s.AUTH_ERR_MSG||d.status===401)){const o=this.painter.context.gl;s.storeAuthState(o,!1),this._logoControl instanceof Mh&&this._logoControl._updateLogo(),o&&o.clear(o.DEPTH_BUFFER_BIT|o.COLOR_BUFFER_BIT|o.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const d=this._isDragging();this.painter.updateTerrain(this.style,d)}_calculateSpeedIndex(){const d=this.painter.canvasCopy(),o=this.painter.getCanvasCopiesAndTimestamps();o.timeStamps.push(performance.now());const c=this.painter.context.gl,f=c.createFramebuffer();function _(v){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,v,0);const E=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,E),E}return c.bindFramebuffer(c.FRAMEBUFFER,f),this._canvasPixelComparison(_(d),o.canvasCopies.map(_),o.timeStamps)}_canvasPixelComparison(d,o,c){let f=c[1]-c[0];const _=d.length/4;for(let v=0;v{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(o)}))}_preloadTiles(d){const o=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(o,(c,f)=>c._preloadTiles(d,f),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(d){this._trackResize&&this.resize({originalEvent:d})._update()}_onVisibilityChange(){s.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(d){this._showTerrainWireframe!==d&&(this._showTerrainWireframe=d,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(d){this._speedIndexTiming!==d&&(this._speedIndexTiming=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(d){this._showTileAABBs!==d&&(this._showTileAABBs=d,d&&this._update())}_setCacheLimits(d,o){s.setCacheLimits(d,o)}get version(){return s.version}},NavigationControl:class{constructor(d){this.options=s.extend({},r_,d),this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",o=>{this._map&&this._map.zoomIn({},{originalEvent:o})}),oe("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",o=>{this._map&&this._map.zoomOut({},{originalEvent:o})}),oe("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",o=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:o}):c.resetNorth({},{originalEvent:o}))}),this._compassIcon=oe("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const d=this._map;if(!d)return;const o=d.getZoom(),c=o===d.getMaxZoom(),f=o===d.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const d=this._map;if(!d)return;const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(d.transform.pitch*(Math.PI/180)),.5)}) rotateX(${d.transform.pitch}deg) rotateZ(${d.transform.angle*(180/Math.PI)}deg)`:`rotate(${d.transform.angle*(180/Math.PI)}deg)`;d._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=o)})}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),d.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&d.on("pitch",this._rotateCompassArrow),d.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new o_(d,this._compass,this.options.visualizePitch)),this._container}onRemove(){const d=this._map;d&&(this._container.remove(),this.options.showZoom&&d.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&d.off("pitch",this._rotateCompassArrow),d.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(d,o){const c=oe("button",d,this._container);return c.type="button",c.addEventListener("click",o),c}_setButtonTitle(d,o){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${o}`);d.setAttribute("aria-label",c),d.firstElementChild&&d.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(d){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},Lh,d),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=ra(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(d){return this._map=d,this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(d){const o=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,d(c)};this._supportsGeolocation!==void 0?d(this._supportsGeolocation):s.window.navigator.permissions!==void 0?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>o(c.state!=="denied")).catch(()=>o()):o()}_isOutOfMapMaxBounds(d){const o=this._map.getMaxBounds(),c=d.coords;return!!o&&(c.longitudeo.getEast()||c.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",d)),this._finish()}}_updateCamera(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude),c=d.coords.accuracy,f=this._map.getBearing(),_=s.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(o.toBounds(c),_,{geolocateSource:!0})}_updateMarker(d){if(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const d=this._map.transform,o=s.mercatorZfromAltitude(1,d._center.lat)*d.worldSize,c=Math.ceil(2*this._accuracy*o);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",d)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(d){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=oe("button","mapboxgl-ctrl-geolocate",this._container),oe("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",d===!1){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=oe("div","mapboxgl-user-location"),this._dotElement.appendChild(oe("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(oe("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new st({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=oe("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new st({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",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(d){this._userLocationDotMarker&&(d.webkitCompassHeading?this._heading=d.webkitCompassHeading:d.absolute===!0&&(this._heading=-1*d.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(d={maximumAge:6e5,timeout:0},this._noTimeout=!0):(d=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,d),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const d=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};s.window.DeviceMotionEvent!==void 0&&typeof s.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&d()}).catch(console.error):d()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:ht,ScaleControl:class{constructor(d){this.options=s.extend({},Rh,d),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const d=this.options.maxWidth||100,o=this._map,c=o._containerHeight/2,f=o._containerWidth/2-d/2,_=o.unproject([f,c]),v=o.unproject([f+d,c]),E=_.distanceTo(v);if(this.options.unit==="imperial"){const S=3.2808*E;S>5280?this._setScale(d,S/5280,"mile"):this._setScale(d,S,"foot")}else this.options.unit==="nautical"?this._setScale(d,E/1852,"nautical-mile"):E>=1e3?this._setScale(d,E/1e3,"kilometer"):this._setScale(d,E,"meter")}_setScale(d,o,c){this._map._requestDomTask(()=>{const f=function(v){const E=Math.pow(10,`${Math.floor(v)}`.length-1);let S=v/E;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:S>=1?1:function(C){const z=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*z)/z}(S),E*S}(o),_=f/o;this._container.innerHTML=this._isNumberFormatSupported&&c!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(f):`${f} ${Dh[c]}`,this._container.style.width=d*_+"px"})}onAdd(d){return this._map=d,this._language=d.getLanguage(),this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-scale",d.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(d){this._language=d,this._update()}setUnit(d){this.options.unit=d,this._update()}},FullscreenControl:class{constructor(d){this._fullscreen=!1,d&&d.container&&(d.container instanceof s.window.HTMLElement?this._container=d.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const d=this._fullscreenButton=oe("button","mapboxgl-ctrl-fullscreen",this._controlContainer);oe("span","mapboxgl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",d)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(d){super(),this.options=s.extend(Object.create(Ph),d),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(d&&d.className?d.className.trim().split(/\s+/):[])}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&d.on("preclick",this._onClose),this.options.closeOnMove&&d.on("move",this._onClose),d.on("remove",this.remove),this._update(),d._addPopup(this),this._focusFirstElement(),this._trackPointer?(d.on("mousemove",this._onMouseEvent),d.on("mouseup",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")):d.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const d=this._map;return d&&(d.off("move",this._update),d.off("move",this._onClose),d.off("preclick",this._onClose),d.off("click",this._onClose),d.off("remove",this.remove),d.off("mousemove",this._onMouseEvent),d.off("mouseup",this._onMouseEvent),d.off("drag",this._onMouseEvent),d._canvasContainer&&d._canvasContainer.classList.remove("mapboxgl-track-pointer"),d._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(d){this._lngLat=s.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update();const o=this._map;return o&&(o.on("move",this._update),o.off("mousemove",this._onMouseEvent),o._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const d=this._map;return d&&(d.off("move",this._update),d.on("mousemove",this._onMouseEvent),d.on("drag",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(s.window.document.createTextNode(d))}setHTML(d){const o=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let f;for(c.innerHTML=d;f=c.firstChild,f;)o.appendChild(f);return this.setDOMContent(o)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){let o=this._content;if(o)for(;o.hasChildNodes();)o.firstChild&&o.removeChild(o.firstChild);else o=this._content=oe("div","mapboxgl-popup-content",this._container||void 0);if(o.appendChild(d),this.options.closeButton){const c=this._closeButton=oe("button","mapboxgl-popup-close-button",o);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(d){return this._classList.add(d),this._updateClassList(),this}removeClassName(d){return this._classList.delete(d),this._updateClassList(),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){let o;return this._classList.delete(d)?o=!1:(this._classList.add(d),o=!0),this._updateClassList(),o}_onMouseEvent(d){this._update(d.point)}_getAnchor(d){if(this.options.anchor)return this.options.anchor;const o=this._map,c=this._container,f=this._pos;if(!o||!c||!f)return"bottom";const _=c.offsetWidth,v=c.offsetHeight,E=f.x<_/2,S=f.x>o.transform.width-_/2;if(f.y+do.transform.height-v){if(E)return"bottom-left";if(S)return"bottom-right"}return E?"left":S?"right":"bottom"}_updateClassList(){const d=this._container;if(!d)return;const o=[...this._classList];o.push("mapboxgl-popup"),this._anchor&&o.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&o.push("mapboxgl-popup-track-pointer"),d.className=o.join(" ")}_update(d){const o=this._map,c=this._content;if(!o||!this._lngLat&&!this._trackPointer||!c)return;let f=this._container;if(f||(f=this._container=oe("div","mapboxgl-popup",o.getContainer()),this._tip=oe("div","mapboxgl-popup-tip",f),f.appendChild(c)),this.options.maxWidth&&f.style.maxWidth!==this.options.maxWidth&&(f.style.maxWidth=this.options.maxWidth),o.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=aa(this._lngLat,this._pos,o.transform)),!this._trackPointer||d){const _=this._pos=this._trackPointer&&d?d:o.project(this._lngLat),v=tf(this.options.offset),E=this._anchor=this._getAnchor(v.y),S=tf(this.options.offset,E),C=_.add(S).round();o._requestDomTask(()=>{this._container&&E&&(this._container.style.transform=`${_s[E]} translate(${C.x}px,${C.y}px)`)})}if(!this._marker&&o._showingGlobe()){const _=s.isLngLatBehindGlobe(o.transform,this._lngLat)?0:1;this._setOpacity(_)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(i_);d&&d.focus()}_onClose(){this.remove()}_setOpacity(d){this._container&&(this._container.style.opacity=`${d}`),this._content&&(this._content.style.pointerEvents=d?"auto":"none")}},Marker:st,Style:jr,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Up,Evented:s.Evented,config:s.config,prewarm:function(){$s().acquire(Fr)},clearPrewarmedResources:function(){const d=Ci;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Fr),Ci=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(d){s.config.ACCESS_TOKEN=d},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(d){s.config.API_URL=d},get workerCount(){return ii.workerCount},set workerCount(d){ii.workerCount=d},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(d){s.config.MAX_PARALLEL_IMAGE_REQUESTS=d},clearStorage(d){s.clearTileCache(d)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return la});var T=g;return T})})(KA);var wx=KA.exports;const b4=sv(wx),E4=AM({__proto__:null,default:b4},[wx]);const e0="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA",p2="/examples/cori.data.rin/rin_service_areas.geojson";function T4(){var x;const t=ft.useContext(_A),i=ft.useRef(null),l=ft.useMemo(()=>(T,s,M,F)=>{console.log("Set popup: ",i.current);const q=new wx.Popup;return F.hasOwnProperty(M)?(q.setLngLat([T,s]),q.setText(F[M])):q.setText("Hello world!"),q},[]);let h=!1;function g(T,s,M,F,q,X,oe){return ft.createElement(yA,{ref:T,longitude:s,latitude:M,color:F,popup:q(s,M,X,oe),key:oe[X]+"-marker"})}return ft.useEffect(()=>{if(t&&!t.data.hasOwnProperty("placeData")&&!h){console.log("Initial place data fetch..."),console.log(p2),h=!0;const T=window.document.getElementById("info-wrapper");T!==null&&(T.style.opacity="1.0",T.style.position="absolute",T.style.background=`rgba(46, 60, 67, 0.5) url('${t.baseURL}/images/loading.gif') no-repeat fixed center`,T.style.backgroundSize="20px"),t.setData({...(t==null?void 0:t.data)||{},placeData:null}),t==null||t.apiClient.get(p2).then(s=>{s&&s.hasOwnProperty("data")&&(console.log("Data result:",s.data.features),t.setData({...t.data,placeData:s.data.features}),h=!1,T!==null&&(T.style.opacity="0.0",T.style.pointerEvents="none",setTimeout(()=>{T.style.background="transparent"},533)))}).catch(s=>{console.error("Error fetching data:",s),h=!1,T!==null&&(T.style.opacity="0.0",T.style.pointerEvents="none",setTimeout(()=>{T.style.background="transparent"},533))})}},[t==null?void 0:t.data]),ft.createElement(ft.Fragment,null,ft.createElement("div",{style:{position:"absolute",margin:"1em",zIndex:2}},ft.createElement("h3",null,"Amplify / React Frontend application template")),ft.createElement("div",{className:"slippy-map"},ft.createElement(Z3,{mapboxAccessToken:e0,initialViewState:{latitude:40,longitude:-100,pitch:45,zoom:3.5},style:{width:600,height:400},mapStyle:`https://api.mapbox.com/styles/v1/ruralinno/cl010e7b7001p15pe3l0306hv?access_token=${e0}`},!!(t!=null&&t.data)&&!!((x=t==null?void 0:t.data)!=null&&x.placeData)&&t.data.placeData.length>0&&!!i&&typeof i!==void 0&&t.data.placeData.map(T=>{console.log(T);const s=typeof T.geometry.coordinates[0]=="number"?T.geometry.coordinates[0]:0,M=typeof T.geometry.coordinates[1]=="number"?T.geometry.coordinates[1]:0;return g(i,s,M,"#247dc9",l,"rin_community",T.properties)}),ft.createElement(i4,{mapboxAccessToken:e0,position:"top-right"}),ft.createElement(H3,{position:"top-right"}),ft.createElement(W3,{position:"top-right"}),ft.createElement(X3,{position:"bottom-left",unit:"imperial"}))),ft.createElement("div",{id:"info-wrapper",style:{pointerEvents:"none",position:"absolute",top:0,minWidth:"100vw",minHeight:"100vh",transition:"opacity 5.05s ease-in-out 0.025s",opacity:"initial",background:"transparent",backgroundSize:"20px",zIndex:100}}))}const S4="https://cori-risi-apps.s3.amazonaws.com";function A4(t){TS(t).render(ft.createElement(ft.StrictMode,null,ft.createElement(m3,{baseURL:S4},ft.createElement(T4,null))))}A4(document.getElementById("app")); + (${c.data.width}, ${c.data.height})`))):this.fire(new s.ErrorEvent(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`")))}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new s.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,o){s.getImage(this._requestManager.transformRequest(d,s.ResourceType.Image),(c,f)=>{o(c,f instanceof s.window.HTMLImageElement?s.exported.getImageData(f):f)})}listImages(){return this.style.listImages()}addLayer(d,o){return this._lazyInitEmptyStyle(),this.style.addLayer(d,o),this._update(!0)}moveLayer(d,o){return this.style.moveLayer(d,o),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}setLayerZoomRange(d,o,c){return this.style.setLayerZoomRange(d,o,c),this._update(!0)}setFilter(d,o,c={}){return this.style.setFilter(d,o,c),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,o,c,f={}){return this.style.setPaintProperty(d,o,c,f),this._update(!0)}getPaintProperty(d,o){return this.style.getPaintProperty(d,o)}setLayoutProperty(d,o,c,f={}){return this.style.setLayoutProperty(d,o,c,f),this._update(!0)}getLayoutProperty(d,o){return this.style.getLayoutProperty(d,o)}setLight(d,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,o),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(d){return this._lazyInitEmptyStyle(),!d&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(d),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(d){return this._lazyInitEmptyStyle(),this.style.setFog(d),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(d){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(s.LngLat.convert(d),this.transform):0}setFeatureState(d,o){return this.style.setFeatureState(d,o),this._update()}removeFeatureState(d,o){return this.style.removeFeatureState(d,o),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}_updateContainerDimensions(){if(!this._container)return;const d=this._container.getBoundingClientRect().width||400,o=this._container.getBoundingClientRect().height||300;let c,f,_,v=this._container;for(;v&&(!f||!_);){const E=s.window.getComputedStyle(v).transform;E&&E!=="none"&&(c=E.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&c[0]!=="0"&&c[0]!=="1"&&(f=c[0]),c[3]&&c[3]!=="0"&&c[3]!=="1"&&(_=c[3])),v=v.parentElement}this._containerWidth=f?Math.abs(d/f):d,this._containerHeight=_?Math.abs(o/_):o}_detectMissingCSS(){s.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&s.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const d=this._container;d.classList.add("mapboxgl-map"),(this._missingCSSCanary=oe("div","mapboxgl-canary",d)).style.visibility="hidden",this._detectMissingCSS();const o=this._canvasContainer=oe("div","mapboxgl-canvas-container",d);this._interactive&&o.classList.add("mapboxgl-interactive"),this._canvas=oe("canvas","mapboxgl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=oe("div","mapboxgl-control-container",d),f=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{f[_]=oe("div",`mapboxgl-ctrl-${_}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,o){const c=s.exported.devicePixelRatio||1;this._canvas.width=c*Math.ceil(d),this._canvas.height=c*Math.ceil(o),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${o}px`}_addMarker(d){this._markers.push(d)}_removeMarker(d){const o=this._markers.indexOf(d);o!==-1&&this._markers.splice(o,1)}_addPopup(d){this._popups.push(d)}_removePopup(d){const o=this._popups.indexOf(d);o!==-1&&this._popups.splice(o,1)}_setupPainter(){const d=s.extend({},F.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),o=this._useWebGL2&&this._canvas.getContext("webgl2",d),c=o||this._canvas.getContext("webgl",d)||this._canvas.getContext("experimental-webgl",d);c?(this._useWebGL2&&!o&&s.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),s.storeAuthState(c,!0),this.painter=new ta(c,this.transform,!!o),this.on("data",f=>{f.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),s.exported$1.testSupport(c)):this.fire(new s.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(d){d.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new s.Event("webglcontextlost",{originalEvent:d}))}_contextRestored(d){this._setupPainter(),this.resize(),this._update(),this.fire(new s.Event("webglcontextrestored",{originalEvent:d}))}_onMapScroll(d){if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_requestDomTask(d){!this.loaded()||this.loaded()&&!this.isMoving()?d():this._domRenderTaskQueue.add(d)}_render(d){let o;const c=this.painter.context.extTimerQuery,f=s.exported.now();if(this.listens("gpu-timing-frame")&&(o=c.createQueryEXT(),c.beginQueryEXT(c.TIME_ELAPSED_EXT,o)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],s.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],s.window.performance.now())),this._renderTaskQueue.run(d),this._domRenderTaskQueue.run(d),this._removed)return;this._updateProjectionTransition();const _=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,C=this.transform.pitch,z=s.exported.now(),P=new s.EvaluationParameters(S,{now:z,fadeDuration:_,pitch:C,transition:this.style.getTransition()});this.style.update(P)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let v=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),v=this._updateAverageElevation(f),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):v=this._updateAverageElevation(f),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,_,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:_,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new s.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new s.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),o){const S=s.exported.now()-f;c.endQueryEXT(c.TIME_ELAPSED_EXT,o),setTimeout(()=>{const C=c.getQueryObjectEXT(o,c.QUERY_RESULT_EXT)/1e6;c.deleteQueryEXT(o),this.fire(new s.Event("gpu-timing-frame",{cpuTime:S,gpuTime:C})),s.window.performance.mark("frame-gpu",{startTime:f,detail:{gpuTime:C}})},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const C=this.painter.queryGpuTimers(S);this.fire(new s.Event("gpu-timing-layer",{layerTimes:C}))},50)}if(this.listens("gpu-timing-deferred-render")){const S=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const C=this.painter.queryGpuTimeDeferredRender(S);this.fire(new s.Event("gpu-timing-deferred-render",{gpuTime:C}))},50)}const E=this._sourcesDirty||this._styleDirty||this._placementDirty||v;if(E||this._repaint)this.triggerRepaint();else{const S=!this.isMoving()&&this.loaded();if(S&&(v=this._updateAverageElevation(f,!0)),v)this.triggerRepaint();else if(this._triggerFrame(!1),S&&(this.fire(new s.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const C=this._calculateSpeedIndex();this.fire(new s.Event("speedindexcompleted",{speedIndex:C})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||E||(this._fullyLoaded=!0,s.LivePerformanceUtils.mark(s.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&s.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(d){for(const o of this._markers)d&&!this.getRenderWorldCopies()&&(o._lngLat=o._lngLat.wrap()),o._update();for(const o of this._popups)!d||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}_updateAverageElevation(d,o=!1){const c=f=>(this.transform.averageElevation=f,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&c(0);if((o||d-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(d)){const f=this.transform.averageElevation;let _=this.transform.sampleAverageElevation(),v=!1;this.transform.elevation&&(v=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(_)?_=0:this._averageElevationLastSampledAt=d;const E=Math.abs(f-_);if(E>1){if(this._isInitialLoad||v)return this._averageElevation.jumpTo(_),c(_);this._averageElevation.easeTo(_,d,300)}else if(E>1e-4)return this._averageElevation.jumpTo(_),c(_)}return!!this._averageElevation.isEasing(d)&&c(this._averageElevation.getValue(d))}_authenticate(){s.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,d=>{if(d&&(d.message===s.AUTH_ERR_MSG||d.status===401)){const o=this.painter.context.gl;s.storeAuthState(o,!1),this._logoControl instanceof Mh&&this._logoControl._updateLogo(),o&&o.clear(o.DEPTH_BUFFER_BIT|o.COLOR_BUFFER_BIT|o.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new s.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),s.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const d=this._isDragging();this.painter.updateTerrain(this.style,d)}_calculateSpeedIndex(){const d=this.painter.canvasCopy(),o=this.painter.getCanvasCopiesAndTimestamps();o.timeStamps.push(performance.now());const c=this.painter.context.gl,f=c.createFramebuffer();function _(v){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,v,0);const E=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,E),E}return c.bindFramebuffer(c.FRAMEBUFFER,f),this._canvasPixelComparison(_(d),o.canvasCopies.map(_),o.timeStamps)}_canvasPixelComparison(d,o,c){let f=c[1]-c[0];const _=d.length/4;for(let v=0;v{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(o)}))}_preloadTiles(d){const o=this.style?Object.values(this.style._sourceCaches):[];return s.asyncAll(o,(c,f)=>c._preloadTiles(d,f),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(d){this._trackResize&&this.resize({originalEvent:d})._update()}_onVisibilityChange(){s.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(d){this._showTerrainWireframe!==d&&(this._showTerrainWireframe=d,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(d){this._speedIndexTiming!==d&&(this._speedIndexTiming=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(d){this._showTileAABBs!==d&&(this._showTileAABBs=d,d&&this._update())}_setCacheLimits(d,o){s.setCacheLimits(d,o)}get version(){return s.version}},NavigationControl:class{constructor(d){this.options=s.extend({},r_,d),this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(s.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",o=>{this._map&&this._map.zoomIn({},{originalEvent:o})}),oe("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",o=>{this._map&&this._map.zoomOut({},{originalEvent:o})}),oe("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(s.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",o=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:o}):c.resetNorth({},{originalEvent:o}))}),this._compassIcon=oe("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const d=this._map;if(!d)return;const o=d.getZoom(),c=o===d.getMaxZoom(),f=o===d.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const d=this._map;if(!d)return;const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(d.transform.pitch*(Math.PI/180)),.5)}) rotateX(${d.transform.pitch}deg) rotateZ(${d.transform.angle*(180/Math.PI)}deg)`:`rotate(${d.transform.angle*(180/Math.PI)}deg)`;d._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=o)})}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),d.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&d.on("pitch",this._rotateCompassArrow),d.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new o_(d,this._compass,this.options.visualizePitch)),this._container}onRemove(){const d=this._map;d&&(this._container.remove(),this.options.showZoom&&d.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&d.off("pitch",this._rotateCompassArrow),d.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(d,o){const c=oe("button",d,this._container);return c.type="button",c.addEventListener("click",o),c}_setButtonTitle(d,o){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${o}`);d.setAttribute("aria-label",c),d.firstElementChild&&d.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends s.Evented{constructor(d){super(),this.options=s.extend({geolocation:s.window.navigator.geolocation},Lh,d),s.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=ra(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(d){return this._map=d,this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(d){const o=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,d(c)};this._supportsGeolocation!==void 0?d(this._supportsGeolocation):s.window.navigator.permissions!==void 0?s.window.navigator.permissions.query({name:"geolocation"}).then(c=>o(c.state!=="denied")).catch(()=>o()):o()}_isOutOfMapMaxBounds(d){const o=this._map.getMaxBounds(),c=d.coords;return!!o&&(c.longitudeo.getEast()||c.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(d){if(this._map){if(this._isOutOfMapMaxBounds(d))return this._setErrorState(),this.fire(new s.Event("outofmaxbounds",d)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=d,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(d),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(d),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("geolocate",d)),this._finish()}}_updateCamera(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude),c=d.coords.accuracy,f=this._map.getBearing(),_=s.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(o.toBounds(c),_,{geolocateSource:!0})}_updateMarker(d){if(d){const o=new s.LngLat(d.coords.longitude,d.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=d.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const d=this._map.transform,o=s.mercatorZfromAltitude(1,d._center.lat)*d.worldSize,c=Math.ceil(2*this._accuracy*o);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(d){if(this._map){if(this.options.trackUserLocation)if(d.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(d.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new s.Event("error",d)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(d){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=oe("button","mapboxgl-ctrl-geolocate",this._container),oe("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",d===!1){s.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",o),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=oe("div","mapboxgl-user-location"),this._dotElement.appendChild(oe("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(oe("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new st({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=oe("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new st({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",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new s.Event("trackuserlocationend")))})}}_onDeviceOrientation(d){this._userLocationDotMarker&&(d.webkitCompassHeading?this._heading=d.webkitCompassHeading:d.absolute===!0&&(this._heading=-1*d.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return s.warnOnce("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 s.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new s.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(d={maximumAge:6e5,timeout:0},this._noTimeout=!0):(d=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,d),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const d=()=>{s.window.addEventListener("ondeviceorientationabsolute"in s.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};s.window.DeviceMotionEvent!==void 0&&typeof s.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&d()}).catch(console.error):d()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),s.window.removeEventListener("deviceorientation",this._onDeviceOrientation),s.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:ht,ScaleControl:class{constructor(d){this.options=s.extend({},Rh,d),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),s.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const d=this.options.maxWidth||100,o=this._map,c=o._containerHeight/2,f=o._containerWidth/2-d/2,_=o.unproject([f,c]),v=o.unproject([f+d,c]),E=_.distanceTo(v);if(this.options.unit==="imperial"){const S=3.2808*E;S>5280?this._setScale(d,S/5280,"mile"):this._setScale(d,S,"foot")}else this.options.unit==="nautical"?this._setScale(d,E/1852,"nautical-mile"):E>=1e3?this._setScale(d,E/1e3,"kilometer"):this._setScale(d,E,"meter")}_setScale(d,o,c){this._map._requestDomTask(()=>{const f=function(v){const E=Math.pow(10,`${Math.floor(v)}`.length-1);let S=v/E;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:S>=1?1:function(C){const z=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*z)/z}(S),E*S}(o),_=f/o;this._container.innerHTML=this._isNumberFormatSupported&&c!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(f):`${f} ${Dh[c]}`,this._container.style.width=d*_+"px"})}onAdd(d){return this._map=d,this._language=d.getLanguage(),this._container=oe("div","mapboxgl-ctrl mapboxgl-ctrl-scale",d.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(d){this._language=d,this._update()}setUnit(d){this.options.unit=d,this._update()}},FullscreenControl:class{constructor(d){this._fullscreen=!1,d&&d.container&&(d.container instanceof s.window.HTMLElement?this._container=d.container:s.warnOnce("Full screen control 'container' must be a DOM element.")),s.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in s.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in s.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=oe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",s.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,s.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!s.window.document.fullscreenEnabled&&!s.window.document.webkitFullscreenEnabled)}_setupUI(){const d=this._fullscreenButton=oe("button","mapboxgl-ctrl-fullscreen",this._controlContainer);oe("span","mapboxgl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),s.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",d)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(s.window.document.fullscreenElement||s.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?s.window.document.exitFullscreen?s.window.document.exitFullscreen():s.window.document.webkitCancelFullScreen&&s.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends s.Evented{constructor(d){super(),this.options=s.extend(Object.create(Ph),d),s.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(d&&d.className?d.className.trim().split(/\s+/):[])}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&d.on("preclick",this._onClose),this.options.closeOnMove&&d.on("move",this._onClose),d.on("remove",this.remove),this._update(),d._addPopup(this),this._focusFirstElement(),this._trackPointer?(d.on("mousemove",this._onMouseEvent),d.on("mouseup",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")):d.on("move",this._update),this.fire(new s.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const d=this._map;return d&&(d.off("move",this._update),d.off("move",this._onClose),d.off("preclick",this._onClose),d.off("click",this._onClose),d.off("remove",this.remove),d.off("mousemove",this._onMouseEvent),d.off("mouseup",this._onMouseEvent),d.off("drag",this._onMouseEvent),d._canvasContainer&&d._canvasContainer.classList.remove("mapboxgl-track-pointer"),d._removePopup(this),this._map=void 0),this.fire(new s.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(d){this._lngLat=s.LngLat.convert(d),this._pos=null,this._trackPointer=!1,this._update();const o=this._map;return o&&(o.on("move",this._update),o.off("mousemove",this._onMouseEvent),o._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const d=this._map;return d&&(d.off("move",this._update),d.on("mousemove",this._onMouseEvent),d.on("drag",this._onMouseEvent),d._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(s.window.document.createTextNode(d))}setHTML(d){const o=s.window.document.createDocumentFragment(),c=s.window.document.createElement("body");let f;for(c.innerHTML=d;f=c.firstChild,f;)o.appendChild(f);return this.setDOMContent(o)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){let o=this._content;if(o)for(;o.hasChildNodes();)o.firstChild&&o.removeChild(o.firstChild);else o=this._content=oe("div","mapboxgl-popup-content",this._container||void 0);if(o.appendChild(d),this.options.closeButton){const c=this._closeButton=oe("button","mapboxgl-popup-close-button",o);c.type="button",c.setAttribute("aria-label","Close popup"),c.setAttribute("aria-hidden","true"),c.innerHTML="×",c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(d){return this._classList.add(d),this._updateClassList(),this}removeClassName(d){return this._classList.delete(d),this._updateClassList(),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){let o;return this._classList.delete(d)?o=!1:(this._classList.add(d),o=!0),this._updateClassList(),o}_onMouseEvent(d){this._update(d.point)}_getAnchor(d){if(this.options.anchor)return this.options.anchor;const o=this._map,c=this._container,f=this._pos;if(!o||!c||!f)return"bottom";const _=c.offsetWidth,v=c.offsetHeight,E=f.x<_/2,S=f.x>o.transform.width-_/2;if(f.y+do.transform.height-v){if(E)return"bottom-left";if(S)return"bottom-right"}return E?"left":S?"right":"bottom"}_updateClassList(){const d=this._container;if(!d)return;const o=[...this._classList];o.push("mapboxgl-popup"),this._anchor&&o.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&o.push("mapboxgl-popup-track-pointer"),d.className=o.join(" ")}_update(d){const o=this._map,c=this._content;if(!o||!this._lngLat&&!this._trackPointer||!c)return;let f=this._container;if(f||(f=this._container=oe("div","mapboxgl-popup",o.getContainer()),this._tip=oe("div","mapboxgl-popup-tip",f),f.appendChild(c)),this.options.maxWidth&&f.style.maxWidth!==this.options.maxWidth&&(f.style.maxWidth=this.options.maxWidth),o.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=aa(this._lngLat,this._pos,o.transform)),!this._trackPointer||d){const _=this._pos=this._trackPointer&&d?d:o.project(this._lngLat),v=tf(this.options.offset),E=this._anchor=this._getAnchor(v.y),S=tf(this.options.offset,E),C=_.add(S).round();o._requestDomTask(()=>{this._container&&E&&(this._container.style.transform=`${_s[E]} translate(${C.x}px,${C.y}px)`)})}if(!this._marker&&o._showingGlobe()){const _=s.isLngLatBehindGlobe(o.transform,this._lngLat)?0:1;this._setOpacity(_)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(i_);d&&d.focus()}_onClose(){this.remove()}_setOpacity(d){this._container&&(this._container.style.opacity=`${d}`),this._content&&(this._content.style.pointerEvents=d?"auto":"none")}},Marker:st,Style:jr,LngLat:s.LngLat,LngLatBounds:s.LngLatBounds,Point:s.Point,MercatorCoordinate:s.MercatorCoordinate,FreeCameraOptions:Up,Evented:s.Evented,config:s.config,prewarm:function(){$s().acquire(Fr)},clearPrewarmedResources:function(){const d=Ci;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Fr),Ci=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()"))},get accessToken(){return s.config.ACCESS_TOKEN},set accessToken(d){s.config.ACCESS_TOKEN=d},get baseApiUrl(){return s.config.API_URL},set baseApiUrl(d){s.config.API_URL=d},get workerCount(){return ii.workerCount},set workerCount(d){ii.workerCount=d},get maxParallelImageRequests(){return s.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(d){s.config.MAX_PARALLEL_IMAGE_REQUESTS=d},clearStorage(d){s.clearTileCache(d)},workerUrl:"",workerClass:null,setNow:s.exported.setNow,restoreNow:s.exported.restoreNow};return la});var T=g;return T})})(KA);var wx=KA.exports;const b4=sv(wx),E4=AM({__proto__:null,default:b4},[wx]);const e0="pk.eyJ1IjoicnVyYWxpbm5vIiwiYSI6ImNqeHl0cW0xODBlMm0zY2x0dXltYzRuazUifQ.zZBovoCHzLIW0wCZveEKzA",p2="/examples/cori.data.rin/rin_service_areas.geojson";function T4(){var x;const t=ft.useContext(_A),i=ft.useRef(null),l=ft.useMemo(()=>(T,s,M,F)=>{console.log("Set popup: ",i.current);const q=new wx.Popup;return F.hasOwnProperty(M)?(q.setLngLat([T,s]),q.setText(F[M])):q.setText("Hello world!"),q},[]);let h=!1;function g(T,s,M,F,q,X,oe){return ft.createElement(yA,{ref:T,longitude:s,latitude:M,color:F,popup:q(s,M,X,oe),key:oe[X]+"-marker"})}return ft.useEffect(()=>{if(t&&!t.data.hasOwnProperty("placeData")&&!h){console.log("Initial place data fetch..."),console.log(p2),h=!0;const T=window.document.getElementById("info-wrapper");T!==null&&(T.style.opacity="1.0",T.style.position="absolute",T.style.background=`rgba(46, 60, 67, 0.5) url('${t.baseURL}/images/loading.gif') no-repeat fixed center`,T.style.backgroundSize="20px"),t.setData({...(t==null?void 0:t.data)||{},placeData:null}),t==null||t.apiClient.get(p2).then(s=>{s&&s.hasOwnProperty("data")&&(console.log("Data result:",s.data.features),t.setData({...t.data,placeData:s.data.features}),h=!1,T!==null&&(T.style.opacity="0.0",T.style.pointerEvents="none",setTimeout(()=>{T.style.background="transparent"},533)))}).catch(s=>{console.error("Error fetching data:",s),h=!1,T!==null&&(T.style.opacity="0.0",T.style.pointerEvents="none",setTimeout(()=>{T.style.background="transparent"},533))})}},[t==null?void 0:t.data]),ft.createElement(ft.Fragment,null,ft.createElement("div",{className:"slippy-map"},ft.createElement(Z3,{mapboxAccessToken:e0,initialViewState:{latitude:40,longitude:-99,pitch:45,zoom:4},style:{width:600,height:400},mapStyle:`https://api.mapbox.com/styles/v1/ruralinno/cl010e7b7001p15pe3l0306hv?access_token=${e0}`},!!(t!=null&&t.data)&&!!((x=t==null?void 0:t.data)!=null&&x.placeData)&&t.data.placeData.length>0&&!!i&&typeof i!==void 0&&t.data.placeData.map(T=>{console.log(T);const s=typeof T.geometry.coordinates[0]=="number"?T.geometry.coordinates[0]:0,M=typeof T.geometry.coordinates[1]=="number"?T.geometry.coordinates[1]:0;return g(i,s,M,"#16343e",l,"rin_community",T.properties)}),ft.createElement(i4,{mapboxAccessToken:e0,position:"top-right"}),ft.createElement(H3,{position:"top-right"}),ft.createElement(W3,{position:"top-right"}),ft.createElement(X3,{position:"bottom-left",unit:"imperial"}))),ft.createElement("div",{id:"info-wrapper",style:{pointerEvents:"none",position:"absolute",top:0,minWidth:"100vw",minHeight:"100vh",transition:"opacity 5.05s ease-in-out 0.025s",opacity:"initial",background:"transparent",backgroundSize:"20px",zIndex:100}}))}const S4="https://cori-risi-apps.s3.amazonaws.com";function A4(t){TS(t).render(ft.createElement(ft.StrictMode,null,ft.createElement(m3,{baseURL:S4},ft.createElement(T4,null))))}A4(document.getElementById("app")); diff --git a/docs/frontend/dist/assets/index-b3a314fc.css b/docs/frontend/dist/assets/index-a9a39f4f.css similarity index 98% rename from docs/frontend/dist/assets/index-b3a314fc.css rename to docs/frontend/dist/assets/index-a9a39f4f.css index 7734cba..1643090 100644 --- a/docs/frontend/dist/assets/index-b3a314fc.css +++ b/docs/frontend/dist/assets/index-a9a39f4f.css @@ -1 +1 @@ -.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}:root,[data-amplify-theme]{--amplify-components-button-link-color: #ffffff;--amplify-components-button-link-loading-background-color: #2c3e50;--amplify-components-button-link-loading-border-color: #1a242f;--amplify-components-button-link-disabled-background-color: #2c3e50;--amplify-components-button-link-disabled-border-color: #1a242f;--amplify-components-button-link-active-border-color: #1a242f;--amplify-components-button-link-focus-border-color: #1a242f;--amplify-components-button-link-hover-border-color: #1a242f;--amplify-components-button-link-border-color: #1a242f;--amplify-components-button-link-background-color: #2c3e50;--amplify-components-button-menu-background-color: #2c3e50;--amplify-components-button-primary-background-color: #2c3e50;--amplify-components-button-primary-active-background-color: #1a242f;--amplify-components-button-primary-active-border-color: #1a242f;--amplify-components-button-primary-focus-background-color: #1a242f;--amplify-components-button-primary-focus-border-color: #1a242f;--amplify-components-button-primary-hover-background-color: #1a242f;--amplify-components-button-primary-hover-border-color: #1a242f;--amplify-components-button-primary-loading-border-color: #1a242f;--amplify-components-button-primary-disabled-border-color: #1a242f;--amplify-components-button-primary-border-color: #1a242f;--amplify-components-button-disabled-background-color: #2c3e50;--amplify-components-button-loading-background-color: #2c3e50;--amplify-components-tabs-item-active-color: #18bc9c;--amplify-components-tabs-item-border-style: 4px solid #2c3e50;--amplify-components-tabs-item-active-border-color: #2c3e50}[data-amplify-theme=default-theme] [data-amplify-authenticator] [data-amplify-router]{background-color:var(--amplify-components-authenticator-router-background-color);box-shadow:var(--amplify-components-authenticator-router-box-shadow);border-color:transparent}.ApiContextProvider_amplify-button--primary__x3TB9{border-width:var(--amplify-components-button-primary-border-width);background-color:var(--amplify-components-button-primary-background-color);border-color:var(--amplify-components-button-primary-border-color);color:var(--amplify-components-button-primary-color);--amplify-internal-button-disabled-border-color: var( --amplify-components-button-primary-disabled-border-color );--amplify-internal-button-disabled-background-color: var( --amplify-components-button-primary-disabled-background-color );--amplify-internal-button-disabled-color: var( --amplify-components-button-primary-disabled-color );--amplify-internal-button-loading-background-color: var( --amplify-components-button-primary-loading-background-color );--amplify-internal-button-loading-border-color: var( --amplify-components-button-primary-loading-border-color );--amplify-internal-button-loading-color: var( --amplify-components-button-primary-loading-color )}.ApiContextProvider_amplify-button--primary__x3TB9:hover{background-color:var(--amplify-components-button-primary-hover-background-color);border-color:var(--amplify-components-button-primary-hover-border-color);color:var(--amplify-components-button-primary-hover-color)}.ApiContextProvider_amplify-button--primary__x3TB9:focus{background-color:var(--amplify-components-button-primary-focus-background-color);border-color:var(--amplify-components-button-primary-focus-border-color);color:var(--amplify-components-button-primary-focus-color);box-shadow:var(--amplify-components-button-primary-focus-box-shadow)}.ApiContextProvider_amplify-button--primary__x3TB9:active{background-color:var(--amplify-components-button-primary-active-background-color);border-color:var(--amplify-components-button-primary-active-border-color);color:var(--amplify-components-button-primary-active-color)}.ApiContextProvider_amplify-tabs-item__-6nTX[data-state=active]{color:var(--amplify-components-tabs-item-active-color);border-color:var(--amplify-components-tabs-item-active-border-color);background-color:var(--amplify-components-tabs-item-active-background-color);transition-property:none}.ApiContextProvider_amplify-input__ycAUW.ApiContextProvider_amplify-field-group__control__cRTcr{text-align:left}.CategoricalLegend-module_categorical-legend__KiFcS{display:flex;flex-wrap:wrap;margin:1.5rem 0px}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU{display:flex;justify-content:space-around;margin:0 20px 5px 0}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU .CategoricalLegend-module_key__1Hgb-{height:1rem;width:1rem;opacity:.9}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU p{line-height:1rem;font-size:1rem;margin:0 0 0 6px}.HoverInfo-module_tooltip__3wVpX{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.HoverInfo-module_tooltip__3wVpX h3{margin:.5rem 0rem}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_details__4eyQ7{margin:.1rem 0rem;line-height:1.6}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_prop-score__DKjwo{font-weight:400;margin:0}.slippy-map{position:relative;width:100vw;height:100vh}.slippy-map>*{overflow:hidden}.slippy-map>.mapboxgl-map{width:100%!important;height:100%!important}.tooltip{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.tooltip h3{margin:.5rem 0rem}.tooltip .details{margin:.1rem 0rem;line-height:1.6}.tooltip .prop-score{font-weight:400;margin:0}.tooltip .click-prompt{font-style:italic;font-weight:600;margin-top:5px}.tooltip p{margin:0}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body{font-family:Montserrat,Arial,Helvetica,sans-serif;overflow:none}h1{font-size:2rem}h2{font-size:1.8rem}h3{font-size:1.6rem}h4{font-size:1.4rem}h5{font-size:1.2rem}h6{font-size:1rem}h1,h2,h3,h4,h5,h6{font-family:Montserrat,Arial,Helvetica,sans-serif;margin-top:.5em;margin-bottom:.5em}p,a{font-family:Montserrat,Arial,Helvetica,sans-serif;line-height:1.4}a{margin-top:0;margin-bottom:0;color:#00835d;text-decoration:underline;font-weight:700}a:hover{text-decoration:underline;cursor:pointer}#map{display:flex} +.mapboxgl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}:root,[data-amplify-theme]{--amplify-components-button-link-color: #ffffff;--amplify-components-button-link-loading-background-color: #2c3e50;--amplify-components-button-link-loading-border-color: #1a242f;--amplify-components-button-link-disabled-background-color: #2c3e50;--amplify-components-button-link-disabled-border-color: #1a242f;--amplify-components-button-link-active-border-color: #1a242f;--amplify-components-button-link-focus-border-color: #1a242f;--amplify-components-button-link-hover-border-color: #1a242f;--amplify-components-button-link-border-color: #1a242f;--amplify-components-button-link-background-color: #2c3e50;--amplify-components-button-menu-background-color: #2c3e50;--amplify-components-button-primary-background-color: #2c3e50;--amplify-components-button-primary-active-background-color: #1a242f;--amplify-components-button-primary-active-border-color: #1a242f;--amplify-components-button-primary-focus-background-color: #1a242f;--amplify-components-button-primary-focus-border-color: #1a242f;--amplify-components-button-primary-hover-background-color: #1a242f;--amplify-components-button-primary-hover-border-color: #1a242f;--amplify-components-button-primary-loading-border-color: #1a242f;--amplify-components-button-primary-disabled-border-color: #1a242f;--amplify-components-button-primary-border-color: #1a242f;--amplify-components-button-disabled-background-color: #2c3e50;--amplify-components-button-loading-background-color: #2c3e50;--amplify-components-tabs-item-active-color: #18bc9c;--amplify-components-tabs-item-border-style: 4px solid #2c3e50;--amplify-components-tabs-item-active-border-color: #2c3e50}[data-amplify-theme=default-theme] [data-amplify-authenticator] [data-amplify-router]{background-color:var(--amplify-components-authenticator-router-background-color);box-shadow:var(--amplify-components-authenticator-router-box-shadow);border-color:transparent}.ApiContextProvider_amplify-button--primary__x3TB9{border-width:var(--amplify-components-button-primary-border-width);background-color:var(--amplify-components-button-primary-background-color);border-color:var(--amplify-components-button-primary-border-color);color:var(--amplify-components-button-primary-color);--amplify-internal-button-disabled-border-color: var( --amplify-components-button-primary-disabled-border-color );--amplify-internal-button-disabled-background-color: var( --amplify-components-button-primary-disabled-background-color );--amplify-internal-button-disabled-color: var( --amplify-components-button-primary-disabled-color );--amplify-internal-button-loading-background-color: var( --amplify-components-button-primary-loading-background-color );--amplify-internal-button-loading-border-color: var( --amplify-components-button-primary-loading-border-color );--amplify-internal-button-loading-color: var( --amplify-components-button-primary-loading-color )}.ApiContextProvider_amplify-button--primary__x3TB9:hover{background-color:var(--amplify-components-button-primary-hover-background-color);border-color:var(--amplify-components-button-primary-hover-border-color);color:var(--amplify-components-button-primary-hover-color)}.ApiContextProvider_amplify-button--primary__x3TB9:focus{background-color:var(--amplify-components-button-primary-focus-background-color);border-color:var(--amplify-components-button-primary-focus-border-color);color:var(--amplify-components-button-primary-focus-color);box-shadow:var(--amplify-components-button-primary-focus-box-shadow)}.ApiContextProvider_amplify-button--primary__x3TB9:active{background-color:var(--amplify-components-button-primary-active-background-color);border-color:var(--amplify-components-button-primary-active-border-color);color:var(--amplify-components-button-primary-active-color)}.ApiContextProvider_amplify-tabs-item__-6nTX[data-state=active]{color:var(--amplify-components-tabs-item-active-color);border-color:var(--amplify-components-tabs-item-active-border-color);background-color:var(--amplify-components-tabs-item-active-background-color);transition-property:none}.ApiContextProvider_amplify-input__ycAUW.ApiContextProvider_amplify-field-group__control__cRTcr{text-align:left}.CategoricalLegend-module_categorical-legend__KiFcS{display:flex;flex-wrap:wrap;margin:1.5rem 0px}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU{display:flex;justify-content:space-around;margin:0 20px 5px 0}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU .CategoricalLegend-module_key__1Hgb-{height:1rem;width:1rem;opacity:.9}.CategoricalLegend-module_categorical-legend__KiFcS .CategoricalLegend-module_entry__4zxZU p{line-height:1rem;font-size:1rem;margin:0 0 0 6px}.HoverInfo-module_tooltip__3wVpX{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.HoverInfo-module_tooltip__3wVpX h3{margin:.5rem 0rem}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_details__4eyQ7{margin:.1rem 0rem;line-height:1.6}.HoverInfo-module_tooltip__3wVpX .HoverInfo-module_prop-score__DKjwo{font-weight:400;margin:0}.slippy-map{position:relative;width:100vw;height:100vh}.slippy-map>*{overflow:hidden}.slippy-map>.mapboxgl-map{width:100%!important;height:100%!important}.tooltip{width:320px;border:1px solid black;background-color:#fff;padding:10px;position:absolute;z-index:10;pointer-events:none}.tooltip h3{margin:.5rem 0rem}.tooltip .details{margin:.1rem 0rem;line-height:1.6}.tooltip .prop-score{font-weight:400;margin:0}.tooltip .click-prompt{font-style:italic;font-weight:600;margin-top:5px}.tooltip p{margin:0}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}a{color:#00835d;margin-top:0;margin-bottom:0;text-decoration:underline}a:hover{text-decoration:underline;cursor:pointer}.control-panel{position:absolute;top:0;right:0;max-width:320px;background:#fff;box-shadow:0 2px 4px #0000004d;padding:12px 24px;margin:20px;font-size:13px;line-height:2;color:#6b6b76;text-transform:uppercase;outline:none;z-index:2}.mapboxgl-ctrl{font-family:Bitter,serif!important}.mapboxgl-ctrl .mapboxgl-ctrl-top-left{font-family:Bitter,monospace!important}.mapboxgl-popup{font-family:Bitter,serif}.mapboxgl-popup .mapboxgl-popup-content{font-family:Bitter,serif!important;font-size:12pt;color:#fff;background:#16343e;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:12px 20px;pointer-events:auto;position:relative}.mapboxgl-popup .mapboxgl-popup-content button{color:#16343e;background:#fff} diff --git a/docs/frontend/dist/assets/input.mmd b/docs/frontend/dist/assets/input.mmd new file mode 100644 index 0000000..0080176 --- /dev/null +++ b/docs/frontend/dist/assets/input.mmd @@ -0,0 +1,26 @@ +--- +title: Hello Mermaid +config: +# theme: neutral + theme: base + themeVariables: + primaryColor: "#00ff00" + primaryTextColor: '#000' + primaryBorderColor: '#7C0000' + lineColor: '#F8B229' + secondaryColor: '#006100' + tertiaryColor: '#fff' +--- +flowchart + subgraph hello + direction LR + Hello --> World + subgraph graph + direction LR + B --> C{Let me think} + C -->|One| D[Laptop] + C -->|Two| E[iPhone] + C -->|Three| F[(fa:fa-database Database)] + name + end + end diff --git a/docs/frontend/dist/assets/output.svg b/docs/frontend/dist/assets/output.svg new file mode 100644 index 0000000..57cb5eb --- /dev/null +++ b/docs/frontend/dist/assets/output.svg @@ -0,0 +1 @@ +Hello Mermaid
hello
World
Hello
graph
One
Two
Three
Let me think
B
Laptop
iPhone
Database
name
Hello Mermaid
\ No newline at end of file diff --git a/docs/frontend/dist/index.html b/docs/frontend/dist/index.html index fd42238..f6b03c1 100644 --- a/docs/frontend/dist/index.html +++ b/docs/frontend/dist/index.html @@ -23,8 +23,8 @@ - - + +
diff --git a/docs/index.html b/docs/index.html index f30e486..14068dd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -73,7 +73,7 @@