searchsmartly-ui 0.0.140 → 0.0.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -30,7 +30,7 @@ object-assign
|
|
|
30
30
|
* Released under MIT license <https://lodash.com/license>
|
|
31
31
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
32
32
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
33
|
-
*/!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",s=16,a=32,l=64,c=128,u=256,h=1/0,d=9007199254740991,p=NaN,f=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",a],["partialRight",l],["rearg",u]],g="[object Arguments]",A="[object Array]",_="[object Boolean]",y="[object Date]",v="[object Error]",x="[object Function]",b="[object GeneratorFunction]",w="[object Map]",C="[object Number]",E="[object Object]",T="[object Promise]",S="[object RegExp]",M="[object Set]",I="[object String]",P="[object Symbol]",L="[object WeakMap]",O="[object ArrayBuffer]",D="[object DataView]",k="[object Float32Array]",z="[object Float64Array]",B="[object Int8Array]",R="[object Int16Array]",F="[object Int32Array]",j="[object Uint8Array]",N="[object Uint8ClampedArray]",V="[object Uint16Array]",U="[object Uint32Array]",H=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,Q=RegExp(W.source),X=RegExp(q.source),Y=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(re.source),ie=/^\s+/,oe=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,Ae=/^0o[0-7]+$/i,_e=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['’]",Pe="["+be+"]",Le="["+Me+"]",Oe="["+we+"]",De="\\d+",ke="["+Ce+"]",ze="["+Ee+"]",Be="[^"+be+Me+De+Ce+Ee+Te+"]",Re="\\ud83c[\\udffb-\\udfff]",Fe="[^"+be+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",Ne="[\\ud800-\\udbff][\\udc00-\\udfff]",Ve="["+Te+"]",Ue="\\u200d",He="(?:"+ze+"|"+Be+")",Ge="(?:"+Ve+"|"+Be+")",Ze="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Qe="(?:"+Oe+"|"+Re+")"+"?",Xe="["+Se+"]?",Ye=Xe+Qe+("(?:"+Ue+"(?:"+[Fe,je,Ne].join("|")+")"+Xe+Qe+")*"),$e="(?:"+[ke,je,Ne].join("|")+")"+Ye,Ke="(?:"+[Fe+Oe+"?",Oe,je,Ne,Pe].join("|")+")",Je=RegExp(Ie,"g"),et=RegExp(Oe,"g"),tt=RegExp(Re+"(?="+Re+")|"+Ke+Ye,"g"),rt=RegExp([Ve+"?"+ze+"+"+Ze+"(?="+[Le,Ve,"$"].join("|")+")",Ge+"+"+qe+"(?="+[Le,Ve+He,"$"].join("|")+")",Ve+"?"+He+"+"+Ze,Ve+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",De,$e].join("|"),"g"),nt=RegExp("["+Ue+be+we+Se+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,at={};at[k]=at[z]=at[B]=at[R]=at[F]=at[j]=at[N]=at[V]=at[U]=!0,at[g]=at[A]=at[O]=at[_]=at[D]=at[y]=at[v]=at[x]=at[w]=at[C]=at[E]=at[S]=at[M]=at[I]=at[L]=!1;var lt={};lt[g]=lt[A]=lt[O]=lt[D]=lt[_]=lt[y]=lt[k]=lt[z]=lt[B]=lt[R]=lt[F]=lt[w]=lt[C]=lt[E]=lt[S]=lt[M]=lt[I]=lt[P]=lt[j]=lt[N]=lt[V]=lt[U]=!0,lt[v]=lt[x]=lt[L]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,ht=parseInt,dt="object"==typeof We&&We&&We.Object===Object&&We,pt="object"==typeof self&&self&&self.Object===Object&&self,ft=dt||pt||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,At=gt&>.exports===mt,_t=At&&dt.process,yt=function(){try{var e=gt&>.require&>.require("util").types;return e||_t&&_t.binding&&_t.binding("util")}catch(e){}}(),vt=yt&&yt.isArrayBuffer,xt=yt&&yt.isDate,bt=yt&&yt.isMap,wt=yt&&yt.isRegExp,Ct=yt&&yt.isSet,Et=yt&&yt.isTypedArray;function Tt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function St(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n}function Mt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function It(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Pt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Lt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Ot(e,t){return!!(null==e?0:e.length)&&Ut(e,t,0)>-1}function Dt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function kt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function zt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Bt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Rt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Ft(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var jt=Wt("length");function Nt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Vt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ut(e,t,r){return t==t?function(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Vt(e,Gt,r)}function Ht(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Gt(e){return e!=e}function Zt(e,t){var r=null==e?0:e.length;return r?Xt(e,t)/r:p}function Wt(e){return function(t){return null==t?r:t[e]}}function qt(e){return function(t){return null==e?r:e[t]}}function Qt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Xt(e,t){for(var n,i=-1,o=e.length;++i<o;){var s=t(e[i]);s!==r&&(n=n===r?s:n+s)}return n}function Yt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function $t(e){return e?e.slice(0,fr(e)+1).replace(ie,""):e}function Kt(e){return function(t){return e(t)}}function Jt(e,t){return kt(t,(function(t){return e[t]}))}function er(e,t){return e.has(t)}function tr(e,t){for(var r=-1,n=e.length;++r<n&&Ut(t,e[r],0)>-1;);return r}function rr(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}var nr=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+ct[e]}function sr(e){return nt.test(e)}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function lr(e,t){return function(r){return e(t(r))}}function cr(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var a=e[r];a!==t&&a!==o||(e[r]=o,s[i++]=r)}return s}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function hr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function dr(e){return sr(e)?function(e){var t=tt.lastIndex=0;for(;tt.test(e);)++t;return t}(e):jt(e)}function pr(e){return sr(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.split("")}(e)}function fr(e){for(var t=e.length;t--&&oe.test(e.charAt(t)););return t}var mr=qt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var gr=function e(t){var oe,be=(t=null==t?ft:gr.defaults(ft.Object(),t,gr.pick(ft,ot))).Array,we=t.Date,Ce=t.Error,Ee=t.Function,Te=t.Math,Se=t.Object,Me=t.RegExp,Ie=t.String,Pe=t.TypeError,Le=be.prototype,Oe=Ee.prototype,De=Se.prototype,ke=t["__core-js_shared__"],ze=Oe.toString,Be=De.hasOwnProperty,Re=0,Fe=(oe=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||""))?"Symbol(src)_1."+oe:"",je=De.toString,Ne=ze.call(Se),Ve=ft._,Ue=Me("^"+ze.call(Be).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=At?t.Buffer:r,Ge=t.Symbol,Ze=t.Uint8Array,We=He?He.allocUnsafe:r,qe=lr(Se.getPrototypeOf,Se),Qe=Se.create,Xe=De.propertyIsEnumerable,Ye=Le.splice,$e=Ge?Ge.isConcatSpreadable:r,Ke=Ge?Ge.iterator:r,tt=Ge?Ge.toStringTag:r,nt=function(){try{var e=po(Se,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,dt=we&&we.now!==ft.Date.now&&we.now,pt=t.setTimeout!==ft.setTimeout&&t.setTimeout,mt=Te.ceil,gt=Te.floor,_t=Se.getOwnPropertySymbols,yt=He?He.isBuffer:r,jt=t.isFinite,qt=Le.join,Ar=lr(Se.keys,Se),_r=Te.max,yr=Te.min,vr=we.now,xr=t.parseInt,br=Te.random,wr=Le.reverse,Cr=po(t,"DataView"),Er=po(t,"Map"),Tr=po(t,"Promise"),Sr=po(t,"Set"),Mr=po(t,"WeakMap"),Ir=po(Se,"create"),Pr=Mr&&new Mr,Lr={},Or=jo(Cr),Dr=jo(Er),kr=jo(Tr),zr=jo(Sr),Br=jo(Mr),Rr=Ge?Ge.prototype:r,Fr=Rr?Rr.valueOf:r,jr=Rr?Rr.toString:r;function Nr(e){if(ra(e)&&!Zs(e)&&!(e instanceof Gr)){if(e instanceof Hr)return e;if(Be.call(e,"__wrapped__"))return No(e)}return new Hr(e)}var Vr=function(){function e(){}return function(t){if(!ta(t))return{};if(Qe)return Qe(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Ur(){}function Hr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Qr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new qr;++t<r;)this.add(e[t])}function Xr(e){var t=this.__data__=new Wr(e);this.size=t.size}function Yr(e,t){var r=Zs(e),n=!r&&Gs(e),i=!r&&!n&&Xs(e),o=!r&&!n&&!i&&ua(e),s=r||n||i||o,a=s?Yt(e.length,Ie):[],l=a.length;for(var c in e)!t&&!Be.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vo(c,l))||a.push(c);return a}function $r(e){var t=e.length;return t?e[Xn(0,t-1)]:r}function Kr(e,t){return Bo(Pi(e),ln(t,0,e.length))}function Jr(e){return Bo(Pi(e))}function en(e,t,n){(n!==r&&!Vs(e[t],n)||n===r&&!(t in e))&&sn(e,t,n)}function tn(e,t,n){var i=e[t];Be.call(e,t)&&Vs(i,n)&&(n!==r||t in e)||sn(e,t,n)}function rn(e,t){for(var r=e.length;r--;)if(Vs(e[r][0],t))return r;return-1}function nn(e,t,r,n){return pn(e,(function(e,i,o){t(n,e,r(e),o)})),n}function on(e,t){return e&&Li(t,Oa(t),e)}function sn(e,t,r){"__proto__"==t&&nt?nt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function an(e,t){for(var n=-1,i=t.length,o=be(i),s=null==e;++n<i;)o[n]=s?r:Sa(e,t[n]);return o}function ln(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function cn(e,t,n,i,o,s){var a,l=1&t,c=2&t,u=4&t;if(n&&(a=o?n(e,i,o,s):n(e)),a!==r)return a;if(!ta(e))return e;var h=Zs(e);if(h){if(a=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Be.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!l)return Pi(e,a)}else{var d=go(e),p=d==x||d==b;if(Xs(e))return Ci(e,l);if(d==E||d==g||p&&!o){if(a=c||p?{}:_o(e),!l)return c?function(e,t){return Li(e,mo(e),t)}(e,function(e,t){return e&&Li(t,Da(t),e)}(a,e)):function(e,t){return Li(e,fo(e),t)}(e,on(a,e))}else{if(!lt[d])return o?e:{};a=function(e,t,r){var n=e.constructor;switch(t){case O:return Ei(e);case _:case y:return new n(+e);case D:return function(e,t){var r=t?Ei(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case k:case z:case B:case R:case F:case j:case N:case V:case U:return Ti(e,r);case w:return new n;case C:case I:return new n(e);case S:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return new n;case P:return i=e,Fr?Se(Fr.call(i)):{}}var i}(e,d,l)}}s||(s=new Xr);var f=s.get(e);if(f)return f;s.set(e,a),aa(e)?e.forEach((function(r){a.add(cn(r,t,n,r,e,s))})):na(e)&&e.forEach((function(r,i){a.set(i,cn(r,t,n,i,e,s))}));var m=h?r:(u?c?oo:io:c?Da:Oa)(e);return Mt(m||e,(function(r,i){m&&(r=e[i=r]),tn(a,i,cn(r,t,n,i,e,s))})),a}function un(e,t,n){var i=n.length;if(null==e)return!i;for(e=Se(e);i--;){var o=n[i],s=t[o],a=e[o];if(a===r&&!(o in e)||!s(a))return!1}return!0}function hn(e,t,i){if("function"!=typeof e)throw new Pe(n);return Oo((function(){e.apply(r,i)}),t)}function dn(e,t,r,n){var i=-1,o=Ot,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;r&&(t=kt(t,Kt(r))),n?(o=Dt,s=!1):t.length>=200&&(o=er,s=!1,t=new Qr(t));e:for(;++i<a;){var u=e[i],h=null==r?u:r(u);if(u=n||0!==u?u:0,s&&h==h){for(var d=c;d--;)if(t[d]===h)continue e;l.push(u)}else o(t,h,n)||l.push(u)}return l}Nr.templateSettings={escape:Y,evaluate:$,interpolate:K,variable:"",imports:{_:Nr}},Nr.prototype=Ur.prototype,Nr.prototype.constructor=Nr,Hr.prototype=Vr(Ur.prototype),Hr.prototype.constructor=Hr,Gr.prototype=Vr(Ur.prototype),Gr.prototype.constructor=Gr,Zr.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},Zr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Zr.prototype.get=function(e){var t=this.__data__;if(Ir){var n=t[e];return n===i?r:n}return Be.call(t,e)?t[e]:r},Zr.prototype.has=function(e){var t=this.__data__;return Ir?t[e]!==r:Be.call(t,e)},Zr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ir&&t===r?i:t,this},Wr.prototype.clear=function(){this.__data__=[],this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=rn(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,!0)},Wr.prototype.get=function(e){var t=this.__data__,n=rn(t,e);return n<0?r:t[n][1]},Wr.prototype.has=function(e){return rn(this.__data__,e)>-1},Wr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},qr.prototype.clear=function(){this.size=0,this.__data__={hash:new Zr,map:new(Er||Wr),string:new Zr}},qr.prototype.delete=function(e){var t=uo(this,e).delete(e);return this.size-=t?1:0,t},qr.prototype.get=function(e){return uo(this,e).get(e)},qr.prototype.has=function(e){return uo(this,e).has(e)},qr.prototype.set=function(e,t){var r=uo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Qr.prototype.add=Qr.prototype.push=function(e){return this.__data__.set(e,i),this},Qr.prototype.has=function(e){return this.__data__.has(e)},Xr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Xr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Xr.prototype.get=function(e){return this.__data__.get(e)},Xr.prototype.has=function(e){return this.__data__.has(e)},Xr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!Er||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new qr(n)}return r.set(e,t),this.size=r.size,this};var pn=ki(xn),fn=ki(bn,!0);function mn(e,t){var r=!0;return pn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function gn(e,t,n){for(var i=-1,o=e.length;++i<o;){var s=e[i],a=t(s);if(null!=a&&(l===r?a==a&&!ca(a):n(a,l)))var l=a,c=s}return c}function An(e,t){var r=[];return pn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function _n(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=yo),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?_n(a,t-1,r,n,i):zt(i,a):n||(i[i.length]=a)}return i}var yn=zi(),vn=zi(!0);function xn(e,t){return e&&yn(e,t,Oa)}function bn(e,t){return e&&vn(e,t,Oa)}function wn(e,t){return Lt(t,(function(t){return Ks(e[t])}))}function Cn(e,t){for(var n=0,i=(t=vi(t,e)).length;null!=e&&n<i;)e=e[Fo(t[n++])];return n&&n==i?e:r}function En(e,t,r){var n=t(e);return Zs(e)?n:zt(n,r(e))}function Tn(e){return null==e?e===r?"[object Undefined]":"[object Null]":tt&&tt in Se(e)?function(e){var t=Be.call(e,tt),n=e[tt];try{e[tt]=r;var i=!0}catch(e){}var o=je.call(e);i&&(t?e[tt]=n:delete e[tt]);return o}(e):function(e){return je.call(e)}(e)}function Sn(e,t){return e>t}function Mn(e,t){return null!=e&&Be.call(e,t)}function In(e,t){return null!=e&&t in Se(e)}function Pn(e,t,n){for(var i=n?Dt:Ot,o=e[0].length,s=e.length,a=s,l=be(s),c=1/0,u=[];a--;){var h=e[a];a&&t&&(h=kt(h,Kt(t))),c=yr(h.length,c),l[a]=!n&&(t||o>=120&&h.length>=120)?new Qr(a&&h):r}h=e[0];var d=-1,p=l[0];e:for(;++d<o&&u.length<c;){var f=h[d],m=t?t(f):f;if(f=n||0!==f?f:0,!(p?er(p,m):i(u,m,n))){for(a=s;--a;){var g=l[a];if(!(g?er(g,m):i(e[a],m,n)))continue e}p&&p.push(m),u.push(f)}}return u}function Ln(e,t,n){var i=null==(e=Io(e,t=vi(t,e)))?e:e[Fo($o(t))];return null==i?r:Tt(i,e,n)}function On(e){return ra(e)&&Tn(e)==g}function Dn(e,t,n,i,o){return e===t||(null==e||null==t||!ra(e)&&!ra(t)?e!=e&&t!=t:function(e,t,n,i,o,s){var a=Zs(e),l=Zs(t),c=a?A:go(e),u=l?A:go(t),h=(c=c==g?E:c)==E,d=(u=u==g?E:u)==E,p=c==u;if(p&&Xs(e)){if(!Xs(t))return!1;a=!0,h=!1}if(p&&!h)return s||(s=new Xr),a||ua(e)?ro(e,t,n,i,o,s):function(e,t,r,n,i,o,s){switch(r){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!o(new Ze(e),new Ze(t)));case _:case y:case C:return Vs(+e,+t);case v:return e.name==t.name&&e.message==t.message;case S:case I:return e==t+"";case w:var a=ar;case M:var l=1&n;if(a||(a=ur),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;n|=2,s.set(e,t);var u=ro(a(e),a(t),n,i,o,s);return s.delete(e),u;case P:if(Fr)return Fr.call(e)==Fr.call(t)}return!1}(e,t,c,n,i,o,s);if(!(1&n)){var f=h&&Be.call(e,"__wrapped__"),m=d&&Be.call(t,"__wrapped__");if(f||m){var x=f?e.value():e,b=m?t.value():t;return s||(s=new Xr),o(x,b,n,i,s)}}if(!p)return!1;return s||(s=new Xr),function(e,t,n,i,o,s){var a=1&n,l=io(e),c=l.length,u=io(t),h=u.length;if(c!=h&&!a)return!1;var d=c;for(;d--;){var p=l[d];if(!(a?p in t:Be.call(t,p)))return!1}var f=s.get(e),m=s.get(t);if(f&&m)return f==t&&m==e;var g=!0;s.set(e,t),s.set(t,e);var A=a;for(;++d<c;){var _=e[p=l[d]],y=t[p];if(i)var v=a?i(y,_,p,t,e,s):i(_,y,p,e,t,s);if(!(v===r?_===y||o(_,y,n,i,s):v)){g=!1;break}A||(A="constructor"==p)}if(g&&!A){var x=e.constructor,b=t.constructor;x==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b||(g=!1)}return s.delete(e),s.delete(t),g}(e,t,n,i,o,s)}(e,t,n,i,Dn,o))}function kn(e,t,n,i){var o=n.length,s=o,a=!i;if(null==e)return!s;for(e=Se(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var c=(l=n[o])[0],u=e[c],h=l[1];if(a&&l[2]){if(u===r&&!(c in e))return!1}else{var d=new Xr;if(i)var p=i(u,h,c,e,t,d);if(!(p===r?Dn(h,u,3,i,d):p))return!1}}return!0}function zn(e){return!(!ta(e)||(t=e,Fe&&Fe in t))&&(Ks(e)?Ue:ge).test(jo(e));var t}function Bn(e){return"function"==typeof e?e:null==e?il:"object"==typeof e?Zs(e)?Un(e[0],e[1]):Vn(e):pl(e)}function Rn(e){if(!Eo(e))return Ar(e);var t=[];for(var r in Se(e))Be.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Fn(e){if(!ta(e))return function(e){var t=[];if(null!=e)for(var r in Se(e))t.push(r);return t}(e);var t=Eo(e),r=[];for(var n in e)("constructor"!=n||!t&&Be.call(e,n))&&r.push(n);return r}function jn(e,t){return e<t}function Nn(e,t){var r=-1,n=qs(e)?be(e.length):[];return pn(e,(function(e,i,o){n[++r]=t(e,i,o)})),n}function Vn(e){var t=ho(e);return 1==t.length&&t[0][2]?So(t[0][0],t[0][1]):function(r){return r===e||kn(r,e,t)}}function Un(e,t){return bo(e)&&To(t)?So(Fo(e),t):function(n){var i=Sa(n,e);return i===r&&i===t?Ma(n,e):Dn(t,i,3)}}function Hn(e,t,n,i,o){e!==t&&yn(t,(function(s,a){if(o||(o=new Xr),ta(s))!function(e,t,n,i,o,s,a){var l=Po(e,n),c=Po(t,n),u=a.get(c);if(u)return void en(e,n,u);var h=s?s(l,c,n+"",e,t,a):r,d=h===r;if(d){var p=Zs(c),f=!p&&Xs(c),m=!p&&!f&&ua(c);h=c,p||f||m?Zs(l)?h=l:Qs(l)?h=Pi(l):f?(d=!1,h=Ci(c,!0)):m?(d=!1,h=Ti(c,!0)):h=[]:oa(c)||Gs(c)?(h=l,Gs(l)?h=_a(l):ta(l)&&!Ks(l)||(h=_o(c))):d=!1}d&&(a.set(c,h),o(h,c,i,s,a),a.delete(c));en(e,n,h)}(e,t,a,n,Hn,i,o);else{var l=i?i(Po(e,a),s,a+"",e,t,o):r;l===r&&(l=s),en(e,a,l)}}),Da)}function Gn(e,t){var n=e.length;if(n)return vo(t+=t<0?n:0,n)?e[t]:r}function Zn(e,t,r){t=t.length?kt(t,(function(e){return Zs(e)?function(t){return Cn(t,1===e.length?e[0]:e)}:e})):[il];var n=-1;t=kt(t,Kt(co()));var i=Nn(e,(function(e,r,i){var o=kt(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function(e,t,r){var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;for(;++n<s;){var l=Si(i[n],o[n]);if(l)return n>=a?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Wn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=Cn(e,s);r(a,s)&&ei(o,vi(s,e),a)}return o}function qn(e,t,r,n){var i=n?Ht:Ut,o=-1,s=t.length,a=e;for(e===t&&(t=Pi(t)),r&&(a=kt(e,Kt(r)));++o<s;)for(var l=0,c=t[o],u=r?r(c):c;(l=i(a,u,l,n))>-1;)a!==e&&Ye.call(a,l,1),Ye.call(e,l,1);return e}function Qn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;vo(i)?Ye.call(e,i,1):di(e,i)}}return e}function Xn(e,t){return e+gt(br()*(t-e+1))}function Yn(e,t){var r="";if(!e||t<1||t>d)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function $n(e,t){return Do(Mo(e,t,il),e+"")}function Kn(e){return $r(Va(e))}function Jn(e,t){var r=Va(e);return Bo(r,ln(t,0,r.length))}function ei(e,t,n,i){if(!ta(e))return e;for(var o=-1,s=(t=vi(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var c=Fo(t[o]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var h=l[c];(u=i?i(h,c,l):r)===r&&(u=ta(h)?h:vo(t[o+1])?[]:{})}tn(l,c,u),l=l[c]}return e}var ti=Pr?function(e,t){return Pr.set(e,t),e}:il,ri=nt?function(e,t){return nt(e,"toString",{configurable:!0,enumerable:!1,value:tl(t),writable:!0})}:il;function ni(e){return Bo(Va(e))}function ii(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=be(i);++n<i;)o[n]=e[n+t];return o}function oi(e,t){var r;return pn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function si(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=e[o];null!==s&&!ca(s)&&(r?s<=t:s<t)?n=o+1:i=o}return i}return ai(e,t,il,r)}function ai(e,t,n,i){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,l=null===t,c=ca(t),u=t===r;o<s;){var h=gt((o+s)/2),d=n(e[h]),p=d!==r,f=null===d,m=d==d,g=ca(d);if(a)var A=i||m;else A=u?m&&(i||p):l?m&&p&&(i||!f):c?m&&p&&!f&&(i||!g):!f&&!g&&(i?d<=t:d<t);A?o=h+1:s=h}return yr(s,4294967294)}function li(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!Vs(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function ci(e){return"number"==typeof e?e:ca(e)?p:+e}function ui(e){if("string"==typeof e)return e;if(Zs(e))return kt(e,ui)+"";if(ca(e))return jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,r){var n=-1,i=Ot,o=e.length,s=!0,a=[],l=a;if(r)s=!1,i=Dt;else if(o>=200){var c=t?null:Yi(e);if(c)return ur(c);s=!1,i=er,l=new Qr}else l=t?[]:a;e:for(;++n<o;){var u=e[n],h=t?t(u):u;if(u=r||0!==u?u:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),a.push(u)}else i(l,h,r)||(l!==a&&l.push(h),a.push(u))}return a}function di(e,t){return null==(e=Io(e,t=vi(t,e)))||delete e[Fo($o(t))]}function pi(e,t,r,n){return ei(e,t,r(Cn(e,t)),n)}function fi(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ii(e,n?0:o,n?o+1:i):ii(e,n?o+1:0,n?i:o)}function mi(e,t){var r=e;return r instanceof Gr&&(r=r.value()),Bt(t,(function(e,t){return t.func.apply(t.thisArg,zt([e],t.args))}),r)}function gi(e,t,r){var n=e.length;if(n<2)return n?hi(e[0]):[];for(var i=-1,o=be(n);++i<n;)for(var s=e[i],a=-1;++a<n;)a!=i&&(o[i]=dn(o[i]||s,e[a],t,r));return hi(_n(o,1),t,r)}function Ai(e,t,n){for(var i=-1,o=e.length,s=t.length,a={};++i<o;){var l=i<s?t[i]:r;n(a,e[i],l)}return a}function _i(e){return Qs(e)?e:[]}function yi(e){return"function"==typeof e?e:il}function vi(e,t){return Zs(e)?e:bo(e,t)?[e]:Ro(ya(e))}var xi=$n;function bi(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ii(e,t,n)}var wi=ct||function(e){return ft.clearTimeout(e)};function Ci(e,t){if(t)return e.slice();var r=e.length,n=We?We(r):new e.constructor(r);return e.copy(n),n}function Ei(e){var t=new e.constructor(e.byteLength);return new Ze(t).set(new Ze(e)),t}function Ti(e,t){var r=t?Ei(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,s=ca(e),a=t!==r,l=null===t,c=t==t,u=ca(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||i&&a&&c||!n&&c||!o)return 1;if(!i&&!s&&!u&&e<t||u&&n&&o&&!i&&!s||l&&n&&o||!a&&o||!c)return-1}return 0}function Mi(e,t,r,n){for(var i=-1,o=e.length,s=r.length,a=-1,l=t.length,c=_r(o-s,0),u=be(l+c),h=!n;++a<l;)u[a]=t[a];for(;++i<s;)(h||i<o)&&(u[r[i]]=e[i]);for(;c--;)u[a++]=e[i++];return u}function Ii(e,t,r,n){for(var i=-1,o=e.length,s=-1,a=r.length,l=-1,c=t.length,u=_r(o-a,0),h=be(u+c),d=!n;++i<u;)h[i]=e[i];for(var p=i;++l<c;)h[p+l]=t[l];for(;++s<a;)(d||i<o)&&(h[p+r[s]]=e[i++]);return h}function Pi(e,t){var r=-1,n=e.length;for(t||(t=be(n));++r<n;)t[r]=e[r];return t}function Li(e,t,n,i){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var l=t[s],c=i?i(n[l],e[l],l,n,e):r;c===r&&(c=e[l]),o?sn(n,l,c):tn(n,l,c)}return n}function Oi(e,t){return function(r,n){var i=Zs(r)?St:nn,o=t?t():{};return i(r,e,co(n,2),o)}}function Di(e){return $n((function(t,n){var i=-1,o=n.length,s=o>1?n[o-1]:r,a=o>2?n[2]:r;for(s=e.length>3&&"function"==typeof s?(o--,s):r,a&&xo(n[0],n[1],a)&&(s=o<3?r:s,o=1),t=Se(t);++i<o;){var l=n[i];l&&e(t,l,i,s)}return t}))}function ki(e,t){return function(r,n){if(null==r)return r;if(!qs(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Se(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function zi(e){return function(t,r,n){for(var i=-1,o=Se(t),s=n(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===r(o[l],l,o))break}return t}}function Bi(e){return function(t){var n=sr(t=ya(t))?pr(t):r,i=n?n[0]:t.charAt(0),o=n?bi(n,1).join(""):t.slice(1);return i[e]()+o}}function Ri(e){return function(t){return Bt(Ka(Ga(t).replace(Je,"")),e,"")}}function Fi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Vr(e.prototype),n=e.apply(r,t);return ta(n)?n:r}}function ji(e){return function(t,n,i){var o=Se(t);if(!qs(t)){var s=co(n,3);t=Oa(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,i);return a>-1?o[s?t[a]:a]:r}}function Ni(e){return no((function(t){var i=t.length,o=i,s=Hr.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new Pe(n);if(s&&!l&&"wrapper"==ao(a))var l=new Hr([],!0)}for(o=l?o:i;++o<i;){var c=ao(a=t[o]),u="wrapper"==c?so(a):r;l=u&&wo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ao(u[0])].apply(l,u[3]):1==a.length&&wo(a)?l[c]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Zs(r))return l.plant(r).value();for(var n=0,o=i?t[n].apply(this,e):r;++n<i;)o=t[n].call(this,o);return o}}))}function Vi(e,t,n,i,o,s,a,l,u,h){var d=t&c,p=1&t,f=2&t,m=24&t,g=512&t,A=f?r:Fi(e);return function c(){for(var _=arguments.length,y=be(_),v=_;v--;)y[v]=arguments[v];if(m)var x=lo(c),b=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(y,x);if(i&&(y=Mi(y,i,o,m)),s&&(y=Ii(y,s,a,m)),_-=b,m&&_<h){var w=cr(y,x);return Qi(e,t,Vi,c.placeholder,n,y,w,l,u,h-_)}var C=p?n:this,E=f?C[e]:e;return _=y.length,l?y=function(e,t){var n=e.length,i=yr(t.length,n),o=Pi(e);for(;i--;){var s=t[i];e[i]=vo(s,n)?o[s]:r}return e}(y,l):g&&_>1&&y.reverse(),d&&u<_&&(y.length=u),this&&this!==ft&&this instanceof c&&(E=A||Fi(E)),E.apply(C,y)}}function Ui(e,t){return function(r,n){return function(e,t,r,n){return xn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function Hi(e,t){return function(n,i){var o;if(n===r&&i===r)return t;if(n!==r&&(o=n),i!==r){if(o===r)return i;"string"==typeof n||"string"==typeof i?(n=ui(n),i=ui(i)):(n=ci(n),i=ci(i)),o=e(n,i)}return o}}function Gi(e){return no((function(t){return t=kt(t,Kt(co())),$n((function(r){var n=this;return e(t,(function(e){return Tt(e,n,r)}))}))}))}function Zi(e,t){var n=(t=t===r?" ":ui(t)).length;if(n<2)return n?Yn(t,e):t;var i=Yn(t,mt(e/dr(t)));return sr(t)?bi(pr(i),0,e).join(""):i.slice(0,e)}function Wi(e){return function(t,n,i){return i&&"number"!=typeof i&&xo(t,n,i)&&(n=i=r),t=fa(t),n===r?(n=t,t=0):n=fa(n),function(e,t,r,n){for(var i=-1,o=_r(mt((t-e)/(r||1)),0),s=be(o);o--;)s[n?o:++i]=e,e+=r;return s}(t,n,i=i===r?t<n?1:-1:fa(i),e)}}function qi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=Aa(t),r=Aa(r)),e(t,r)}}function Qi(e,t,n,i,o,s,c,u,h,d){var p=8&t;t|=p?a:l,4&(t&=~(p?l:a))||(t&=-4);var f=[e,t,o,p?s:r,p?c:r,p?r:s,p?r:c,u,h,d],m=n.apply(r,f);return wo(e)&&Lo(m,f),m.placeholder=i,ko(m,e,t)}function Xi(e){var t=Te[e];return function(e,r){if(e=Aa(e),(r=null==r?0:yr(ma(r),292))&&jt(e)){var n=(ya(e)+"e").split("e");return+((n=(ya(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yi=Sr&&1/ur(new Sr([,-0]))[1]==h?function(e){return new Sr(e)}:cl;function $i(e){return function(t){var r=go(t);return r==w?ar(t):r==M?hr(t):function(e,t){return kt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ki(e,t,i,h,d,p,f,m){var g=2&t;if(!g&&"function"!=typeof e)throw new Pe(n);var A=h?h.length:0;if(A||(t&=-97,h=d=r),f=f===r?f:_r(ma(f),0),m=m===r?m:ma(m),A-=d?d.length:0,t&l){var _=h,y=d;h=d=r}var v=g?r:so(e),x=[e,t,i,h,d,_,y,p,f,m];if(v&&function(e,t){var r=e[1],n=t[1],i=r|n,s=i<131,a=n==c&&8==r||n==c&&r==u&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!s&&!a)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var l=t[3];if(l){var h=e[3];e[3]=h?Mi(h,l,t[4]):l,e[4]=h?cr(e[3],o):t[4]}(l=t[5])&&(h=e[5],e[5]=h?Ii(h,l,t[6]):l,e[6]=h?cr(e[5],o):t[6]);(l=t[7])&&(e[7]=l);n&c&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(x,v),e=x[0],t=x[1],i=x[2],h=x[3],d=x[4],!(m=x[9]=x[9]===r?g?0:e.length:_r(x[9]-A,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||t==s?function(e,t,n){var i=Fi(e);return function o(){for(var s=arguments.length,a=be(s),l=s,c=lo(o);l--;)a[l]=arguments[l];var u=s<3&&a[0]!==c&&a[s-1]!==c?[]:cr(a,c);return(s-=u.length)<n?Qi(e,t,Vi,o.placeholder,r,a,u,r,r,n-s):Tt(this&&this!==ft&&this instanceof o?i:e,this,a)}}(e,t,m):t!=a&&33!=t||d.length?Vi.apply(r,x):function(e,t,r,n){var i=1&t,o=Fi(e);return function t(){for(var s=-1,a=arguments.length,l=-1,c=n.length,u=be(c+a),h=this&&this!==ft&&this instanceof t?o:e;++l<c;)u[l]=n[l];for(;a--;)u[l++]=arguments[++s];return Tt(h,i?r:this,u)}}(e,t,i,h);else var b=function(e,t,r){var n=1&t,i=Fi(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return ko((v?ti:Lo)(b,x),e,t)}function Ji(e,t,n,i){return e===r||Vs(e,De[n])&&!Be.call(i,n)?t:e}function eo(e,t,n,i,o,s){return ta(e)&&ta(t)&&(s.set(t,e),Hn(e,t,r,eo,s),s.delete(t)),e}function to(e){return oa(e)?r:e}function ro(e,t,n,i,o,s){var a=1&n,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,p=!0,f=2&n?new Qr:r;for(s.set(e,t),s.set(t,e);++d<l;){var m=e[d],g=t[d];if(i)var A=a?i(g,m,d,t,e,s):i(m,g,d,e,t,s);if(A!==r){if(A)continue;p=!1;break}if(f){if(!Ft(t,(function(e,t){if(!er(f,t)&&(m===e||o(m,e,n,i,s)))return f.push(t)}))){p=!1;break}}else if(m!==g&&!o(m,g,n,i,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function no(e){return Do(Mo(e,r,Wo),e+"")}function io(e){return En(e,Oa,fo)}function oo(e){return En(e,Da,mo)}var so=Pr?function(e){return Pr.get(e)}:cl;function ao(e){for(var t=e.name+"",r=Lr[t],n=Be.call(Lr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function lo(e){return(Be.call(Nr,"placeholder")?Nr:e).placeholder}function co(){var e=Nr.iteratee||ol;return e=e===ol?Bn:e,arguments.length?e(arguments[0],arguments[1]):e}function uo(e,t){var r=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function ho(e){for(var t=Oa(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,To(i)]}return t}function po(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return zn(n)?n:r}var fo=_t?function(e){return null==e?[]:(e=Se(e),Lt(_t(e),(function(t){return Xe.call(e,t)})))}:gl,mo=_t?function(e){for(var t=[];e;)zt(t,fo(e)),e=qe(e);return t}:gl,go=Tn;function Ao(e,t,r){for(var n=-1,i=(t=vi(t,e)).length,o=!1;++n<i;){var s=Fo(t[n]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ea(i)&&vo(s,i)&&(Zs(e)||Gs(e))}function _o(e){return"function"!=typeof e.constructor||Eo(e)?{}:Vr(qe(e))}function yo(e){return Zs(e)||Gs(e)||!!($e&&e&&e[$e])}function vo(e,t){var r=typeof e;return!!(t=null==t?d:t)&&("number"==r||"symbol"!=r&&_e.test(e))&&e>-1&&e%1==0&&e<t}function xo(e,t,r){if(!ta(r))return!1;var n=typeof t;return!!("number"==n?qs(r)&&vo(t,r.length):"string"==n&&t in r)&&Vs(r[t],e)}function bo(e,t){if(Zs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ca(e))||(ee.test(e)||!J.test(e)||null!=t&&e in Se(t))}function wo(e){var t=ao(e),r=Nr[t];if("function"!=typeof r||!(t in Gr.prototype))return!1;if(e===r)return!0;var n=so(r);return!!n&&e===n[0]}(Cr&&go(new Cr(new ArrayBuffer(1)))!=D||Er&&go(new Er)!=w||Tr&&go(Tr.resolve())!=T||Sr&&go(new Sr)!=M||Mr&&go(new Mr)!=L)&&(go=function(e){var t=Tn(e),n=t==E?e.constructor:r,i=n?jo(n):"";if(i)switch(i){case Or:return D;case Dr:return w;case kr:return T;case zr:return M;case Br:return L}return t});var Co=ke?Ks:Al;function Eo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||De)}function To(e){return e==e&&!ta(e)}function So(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Se(n)))}}function Mo(e,t,n){return t=_r(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=_r(r.length-t,0),s=be(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=be(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),Tt(e,this,a)}}function Io(e,t){return t.length<2?e:Cn(e,ii(t,0,-1))}function Po(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Lo=zo(ti),Oo=pt||function(e,t){return ft.setTimeout(e,t)},Do=zo(ri);function ko(e,t,r){var n=t+"";return Do(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Mt(m,(function(r){var n="_."+r[0];t&r[1]&&!Ot(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(le):[]}(n),r)))}function zo(e){var t=0,n=0;return function(){var i=vr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Bo(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var s=Xn(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var Ro=function(e){var t=zs(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(te,(function(e,r,n,i){t.push(n?i.replace(he,"$1"):r||e)})),t}));function Fo(e){if("string"==typeof e||ca(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return ze.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof Gr)return e.clone();var t=new Hr(e.__wrapped__,e.__chain__);return t.__actions__=Pi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Vo=$n((function(e,t){return Qs(e)?dn(e,_n(t,1,Qs,!0)):[]})),Uo=$n((function(e,t){var n=$o(t);return Qs(n)&&(n=r),Qs(e)?dn(e,_n(t,1,Qs,!0),co(n,2)):[]})),Ho=$n((function(e,t){var n=$o(t);return Qs(n)&&(n=r),Qs(e)?dn(e,_n(t,1,Qs,!0),r,n):[]}));function Go(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ma(r);return i<0&&(i=_r(n+i,0)),Vt(e,co(t,3),i)}function Zo(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=ma(n),o=n<0?_r(i+o,0):yr(o,i-1)),Vt(e,co(t,3),o,!0)}function Wo(e){return(null==e?0:e.length)?_n(e,1):[]}function qo(e){return e&&e.length?e[0]:r}var Qo=$n((function(e){var t=kt(e,_i);return t.length&&t[0]===e[0]?Pn(t):[]})),Xo=$n((function(e){var t=$o(e),n=kt(e,_i);return t===$o(n)?t=r:n.pop(),n.length&&n[0]===e[0]?Pn(n,co(t,2)):[]})),Yo=$n((function(e){var t=$o(e),n=kt(e,_i);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?Pn(n,r,t):[]}));function $o(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ko=$n(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?qn(e,t):e}var es=no((function(e,t){var r=null==e?0:e.length,n=an(e,t);return Qn(e,kt(t,(function(e){return vo(e,r)?+e:e})).sort(Si)),n}));function ts(e){return null==e?e:wr.call(e)}var rs=$n((function(e){return hi(_n(e,1,Qs,!0))})),ns=$n((function(e){var t=$o(e);return Qs(t)&&(t=r),hi(_n(e,1,Qs,!0),co(t,2))})),is=$n((function(e){var t=$o(e);return t="function"==typeof t?t:r,hi(_n(e,1,Qs,!0),r,t)}));function os(e){if(!e||!e.length)return[];var t=0;return e=Lt(e,(function(e){if(Qs(e))return t=_r(e.length,t),!0})),Yt(t,(function(t){return kt(e,Wt(t))}))}function ss(e,t){if(!e||!e.length)return[];var n=os(e);return null==t?n:kt(n,(function(e){return Tt(t,r,e)}))}var as=$n((function(e,t){return Qs(e)?dn(e,t):[]})),ls=$n((function(e){return gi(Lt(e,Qs))})),cs=$n((function(e){var t=$o(e);return Qs(t)&&(t=r),gi(Lt(e,Qs),co(t,2))})),us=$n((function(e){var t=$o(e);return t="function"==typeof t?t:r,gi(Lt(e,Qs),r,t)})),hs=$n(os);var ds=$n((function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ss(e,n)}));function ps(e){var t=Nr(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var ms=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return an(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Gr&&vo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:r}),new Hr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var gs=Oi((function(e,t,r){Be.call(e,r)?++e[r]:sn(e,r,1)}));var As=ji(Go),_s=ji(Zo);function ys(e,t){return(Zs(e)?Mt:pn)(e,co(t,3))}function vs(e,t){return(Zs(e)?It:fn)(e,co(t,3))}var xs=Oi((function(e,t,r){Be.call(e,r)?e[r].push(t):sn(e,r,[t])}));var bs=$n((function(e,t,r){var n=-1,i="function"==typeof t,o=qs(e)?be(e.length):[];return pn(e,(function(e){o[++n]=i?Tt(t,e,r):Ln(e,t,r)})),o})),ws=Oi((function(e,t,r){sn(e,r,t)}));function Cs(e,t){return(Zs(e)?kt:Nn)(e,co(t,3))}var Es=Oi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ts=$n((function(e,t){if(null==e)return[];var r=t.length;return r>1&&xo(e,t[0],t[1])?t=[]:r>2&&xo(t[0],t[1],t[2])&&(t=[t[0]]),Zn(e,_n(t,1),[])})),Ss=dt||function(){return ft.Date.now()};function Ms(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Ki(e,c,r,r,r,r,t)}function Is(e,t){var i;if("function"!=typeof t)throw new Pe(n);return e=ma(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ps=$n((function(e,t,r){var n=1;if(r.length){var i=cr(r,lo(Ps));n|=a}return Ki(e,n,t,r,i)})),Ls=$n((function(e,t,r){var n=3;if(r.length){var i=cr(r,lo(Ls));n|=a}return Ki(t,n,e,r,i)}));function Os(e,t,i){var o,s,a,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new Pe(n);function m(t){var n=o,i=s;return o=s=r,h=t,l=e.apply(i,n)}function g(e){var n=e-u;return u===r||n>=t||n<0||p&&e-h>=a}function A(){var e=Ss();if(g(e))return _(e);c=Oo(A,function(e){var r=t-(e-u);return p?yr(r,a-(e-h)):r}(e))}function _(e){return c=r,f&&o?m(e):(o=s=r,l)}function y(){var e=Ss(),n=g(e);if(o=arguments,s=this,u=e,n){if(c===r)return function(e){return h=e,c=Oo(A,t),d?m(e):l}(u);if(p)return wi(c),c=Oo(A,t),m(u)}return c===r&&(c=Oo(A,t)),l}return t=Aa(t)||0,ta(i)&&(d=!!i.leading,a=(p="maxWait"in i)?_r(Aa(i.maxWait)||0,t):a,f="trailing"in i?!!i.trailing:f),y.cancel=function(){c!==r&&wi(c),h=0,o=u=s=c=r},y.flush=function(){return c===r?l:_(Ss())},y}var Ds=$n((function(e,t){return hn(e,1,t)})),ks=$n((function(e,t,r){return hn(e,Aa(t)||0,r)}));function zs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Pe(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(zs.Cache||qr),r}function Bs(e){if("function"!=typeof e)throw new Pe(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}zs.Cache=qr;var Rs=xi((function(e,t){var r=(t=1==t.length&&Zs(t[0])?kt(t[0],Kt(co())):kt(_n(t,1),Kt(co()))).length;return $n((function(n){for(var i=-1,o=yr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return Tt(e,this,n)}))})),Fs=$n((function(e,t){var n=cr(t,lo(Fs));return Ki(e,a,r,t,n)})),js=$n((function(e,t){var n=cr(t,lo(js));return Ki(e,l,r,t,n)})),Ns=no((function(e,t){return Ki(e,u,r,r,r,t)}));function Vs(e,t){return e===t||e!=e&&t!=t}var Us=qi(Sn),Hs=qi((function(e,t){return e>=t})),Gs=On(function(){return arguments}())?On:function(e){return ra(e)&&Be.call(e,"callee")&&!Xe.call(e,"callee")},Zs=be.isArray,Ws=vt?Kt(vt):function(e){return ra(e)&&Tn(e)==O};function qs(e){return null!=e&&ea(e.length)&&!Ks(e)}function Qs(e){return ra(e)&&qs(e)}var Xs=yt||Al,Ys=xt?Kt(xt):function(e){return ra(e)&&Tn(e)==y};function $s(e){if(!ra(e))return!1;var t=Tn(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!oa(e)}function Ks(e){if(!ta(e))return!1;var t=Tn(e);return t==x||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==ma(e)}function ea(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function ta(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ra(e){return null!=e&&"object"==typeof e}var na=bt?Kt(bt):function(e){return ra(e)&&go(e)==w};function ia(e){return"number"==typeof e||ra(e)&&Tn(e)==C}function oa(e){if(!ra(e)||Tn(e)!=E)return!1;var t=qe(e);if(null===t)return!0;var r=Be.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ze.call(r)==Ne}var sa=wt?Kt(wt):function(e){return ra(e)&&Tn(e)==S};var aa=Ct?Kt(Ct):function(e){return ra(e)&&go(e)==M};function la(e){return"string"==typeof e||!Zs(e)&&ra(e)&&Tn(e)==I}function ca(e){return"symbol"==typeof e||ra(e)&&Tn(e)==P}var ua=Et?Kt(Et):function(e){return ra(e)&&ea(e.length)&&!!at[Tn(e)]};var ha=qi(jn),da=qi((function(e,t){return e<=t}));function pa(e){if(!e)return[];if(qs(e))return la(e)?pr(e):Pi(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=go(e);return(t==w?ar:t==M?ur:Va)(e)}function fa(e){return e?(e=Aa(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ma(e){var t=fa(e),r=t%1;return t==t?r?t-r:t:0}function ga(e){return e?ln(ma(e),0,f):0}function Aa(e){if("number"==typeof e)return e;if(ca(e))return p;if(ta(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ta(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=$t(e);var r=me.test(e);return r||Ae.test(e)?ht(e.slice(2),r?2:8):fe.test(e)?p:+e}function _a(e){return Li(e,Da(e))}function ya(e){return null==e?"":ui(e)}var va=Di((function(e,t){if(Eo(t)||qs(t))Li(t,Oa(t),e);else for(var r in t)Be.call(t,r)&&tn(e,r,t[r])})),xa=Di((function(e,t){Li(t,Da(t),e)})),ba=Di((function(e,t,r,n){Li(t,Da(t),e,n)})),wa=Di((function(e,t,r,n){Li(t,Oa(t),e,n)})),Ca=no(an);var Ea=$n((function(e,t){e=Se(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&xo(t[0],t[1],o)&&(i=1);++n<i;)for(var s=t[n],a=Da(s),l=-1,c=a.length;++l<c;){var u=a[l],h=e[u];(h===r||Vs(h,De[u])&&!Be.call(e,u))&&(e[u]=s[u])}return e})),Ta=$n((function(e){return e.push(r,eo),Tt(za,r,e)}));function Sa(e,t,n){var i=null==e?r:Cn(e,t);return i===r?n:i}function Ma(e,t){return null!=e&&Ao(e,t,In)}var Ia=Ui((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r}),tl(il)),Pa=Ui((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Be.call(e,t)?e[t].push(r):e[t]=[r]}),co),La=$n(Ln);function Oa(e){return qs(e)?Yr(e):Rn(e)}function Da(e){return qs(e)?Yr(e,!0):Fn(e)}var ka=Di((function(e,t,r){Hn(e,t,r)})),za=Di((function(e,t,r,n){Hn(e,t,r,n)})),Ba=no((function(e,t){var r={};if(null==e)return r;var n=!1;t=kt(t,(function(t){return t=vi(t,e),n||(n=t.length>1),t})),Li(e,oo(e),r),n&&(r=cn(r,7,to));for(var i=t.length;i--;)di(r,t[i]);return r}));var Ra=no((function(e,t){return null==e?{}:function(e,t){return Wn(e,t,(function(t,r){return Ma(e,r)}))}(e,t)}));function Fa(e,t){if(null==e)return{};var r=kt(oo(e),(function(e){return[e]}));return t=co(t),Wn(e,r,(function(e,r){return t(e,r[0])}))}var ja=$i(Oa),Na=$i(Da);function Va(e){return null==e?[]:Jt(e,Oa(e))}var Ua=Ri((function(e,t,r){return t=t.toLowerCase(),e+(r?Ha(t):t)}));function Ha(e){return $a(ya(e).toLowerCase())}function Ga(e){return(e=ya(e))&&e.replace(ye,nr).replace(et,"")}var Za=Ri((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Wa=Ri((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),qa=Bi("toLowerCase");var Qa=Ri((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Xa=Ri((function(e,t,r){return e+(r?" ":"")+$a(t)}));var Ya=Ri((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),$a=Bi("toUpperCase");function Ka(e,t,n){return e=ya(e),(t=n?r:t)===r?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Ja=$n((function(e,t){try{return Tt(e,r,t)}catch(e){return $s(e)?e:new Ce(e)}})),el=no((function(e,t){return Mt(t,(function(t){t=Fo(t),sn(e,t,Ps(e[t],e))})),e}));function tl(e){return function(){return e}}var rl=Ni(),nl=Ni(!0);function il(e){return e}function ol(e){return Bn("function"==typeof e?e:cn(e,1))}var sl=$n((function(e,t){return function(r){return Ln(r,e,t)}})),al=$n((function(e,t){return function(r){return Ln(e,r,t)}}));function ll(e,t,r){var n=Oa(t),i=wn(t,n);null!=r||ta(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=wn(t,Oa(t)));var o=!(ta(r)&&"chain"in r&&!r.chain),s=Ks(e);return Mt(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Pi(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,zt([this.value()],arguments))})})),e}function cl(){}var ul=Gi(kt),hl=Gi(Pt),dl=Gi(Ft);function pl(e){return bo(e)?Wt(Fo(e)):function(e){return function(t){return Cn(t,e)}}(e)}var fl=Wi(),ml=Wi(!0);function gl(){return[]}function Al(){return!1}var _l=Hi((function(e,t){return e+t}),0),yl=Xi("ceil"),vl=Hi((function(e,t){return e/t}),1),xl=Xi("floor");var bl,wl=Hi((function(e,t){return e*t}),1),Cl=Xi("round"),El=Hi((function(e,t){return e-t}),0);return Nr.after=function(e,t){if("function"!=typeof t)throw new Pe(n);return e=ma(e),function(){if(--e<1)return t.apply(this,arguments)}},Nr.ary=Ms,Nr.assign=va,Nr.assignIn=xa,Nr.assignInWith=ba,Nr.assignWith=wa,Nr.at=Ca,Nr.before=Is,Nr.bind=Ps,Nr.bindAll=el,Nr.bindKey=Ls,Nr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Zs(e)?e:[e]},Nr.chain=ps,Nr.chunk=function(e,t,n){t=(n?xo(e,t,n):t===r)?1:_r(ma(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,s=0,a=be(mt(i/t));o<i;)a[s++]=ii(e,o,o+=t);return a},Nr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Nr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=be(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return zt(Zs(r)?Pi(r):[r],_n(t,1))},Nr.cond=function(e){var t=null==e?0:e.length,r=co();return e=t?kt(e,(function(e){if("function"!=typeof e[1])throw new Pe(n);return[r(e[0]),e[1]]})):[],$n((function(r){for(var n=-1;++n<t;){var i=e[n];if(Tt(i[0],this,r))return Tt(i[1],this,r)}}))},Nr.conforms=function(e){return function(e){var t=Oa(e);return function(r){return un(r,e,t)}}(cn(e,1))},Nr.constant=tl,Nr.countBy=gs,Nr.create=function(e,t){var r=Vr(e);return null==t?r:on(r,t)},Nr.curry=function e(t,n,i){var o=Ki(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Nr.curryRight=function e(t,n,i){var o=Ki(t,s,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Nr.debounce=Os,Nr.defaults=Ea,Nr.defaultsDeep=Ta,Nr.defer=Ds,Nr.delay=ks,Nr.difference=Vo,Nr.differenceBy=Uo,Nr.differenceWith=Ho,Nr.drop=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=n||t===r?1:ma(t))<0?0:t,i):[]},Nr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,0,(t=i-(t=n||t===r?1:ma(t)))<0?0:t):[]},Nr.dropRightWhile=function(e,t){return e&&e.length?fi(e,co(t,3),!0,!0):[]},Nr.dropWhile=function(e,t){return e&&e.length?fi(e,co(t,3),!0):[]},Nr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&xo(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=ma(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:ma(i))<0&&(i+=o),i=n>i?0:ga(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Nr.filter=function(e,t){return(Zs(e)?Lt:An)(e,co(t,3))},Nr.flatMap=function(e,t){return _n(Cs(e,t),1)},Nr.flatMapDeep=function(e,t){return _n(Cs(e,t),h)},Nr.flatMapDepth=function(e,t,n){return n=n===r?1:ma(n),_n(Cs(e,t),n)},Nr.flatten=Wo,Nr.flattenDeep=function(e){return(null==e?0:e.length)?_n(e,h):[]},Nr.flattenDepth=function(e,t){return(null==e?0:e.length)?_n(e,t=t===r?1:ma(t)):[]},Nr.flip=function(e){return Ki(e,512)},Nr.flow=rl,Nr.flowRight=nl,Nr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Nr.functions=function(e){return null==e?[]:wn(e,Oa(e))},Nr.functionsIn=function(e){return null==e?[]:wn(e,Da(e))},Nr.groupBy=xs,Nr.initial=function(e){return(null==e?0:e.length)?ii(e,0,-1):[]},Nr.intersection=Qo,Nr.intersectionBy=Xo,Nr.intersectionWith=Yo,Nr.invert=Ia,Nr.invertBy=Pa,Nr.invokeMap=bs,Nr.iteratee=ol,Nr.keyBy=ws,Nr.keys=Oa,Nr.keysIn=Da,Nr.map=Cs,Nr.mapKeys=function(e,t){var r={};return t=co(t,3),xn(e,(function(e,n,i){sn(r,t(e,n,i),e)})),r},Nr.mapValues=function(e,t){var r={};return t=co(t,3),xn(e,(function(e,n,i){sn(r,n,t(e,n,i))})),r},Nr.matches=function(e){return Vn(cn(e,1))},Nr.matchesProperty=function(e,t){return Un(e,cn(t,1))},Nr.memoize=zs,Nr.merge=ka,Nr.mergeWith=za,Nr.method=sl,Nr.methodOf=al,Nr.mixin=ll,Nr.negate=Bs,Nr.nthArg=function(e){return e=ma(e),$n((function(t){return Gn(t,e)}))},Nr.omit=Ba,Nr.omitBy=function(e,t){return Fa(e,Bs(co(t)))},Nr.once=function(e){return Is(2,e)},Nr.orderBy=function(e,t,n,i){return null==e?[]:(Zs(t)||(t=null==t?[]:[t]),Zs(n=i?r:n)||(n=null==n?[]:[n]),Zn(e,t,n))},Nr.over=ul,Nr.overArgs=Rs,Nr.overEvery=hl,Nr.overSome=dl,Nr.partial=Fs,Nr.partialRight=js,Nr.partition=Es,Nr.pick=Ra,Nr.pickBy=Fa,Nr.property=pl,Nr.propertyOf=function(e){return function(t){return null==e?r:Cn(e,t)}},Nr.pull=Ko,Nr.pullAll=Jo,Nr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?qn(e,t,co(r,2)):e},Nr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?qn(e,t,r,n):e},Nr.pullAt=es,Nr.range=fl,Nr.rangeRight=ml,Nr.rearg=Ns,Nr.reject=function(e,t){return(Zs(e)?Lt:An)(e,Bs(co(t,3)))},Nr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=co(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return Qn(e,i),r},Nr.rest=function(e,t){if("function"!=typeof e)throw new Pe(n);return $n(e,t=t===r?t:ma(t))},Nr.reverse=ts,Nr.sampleSize=function(e,t,n){return t=(n?xo(e,t,n):t===r)?1:ma(t),(Zs(e)?Kr:Jn)(e,t)},Nr.set=function(e,t,r){return null==e?e:ei(e,t,r)},Nr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ei(e,t,n,i)},Nr.shuffle=function(e){return(Zs(e)?Jr:ni)(e)},Nr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&xo(e,t,n)?(t=0,n=i):(t=null==t?0:ma(t),n=n===r?i:ma(n)),ii(e,t,n)):[]},Nr.sortBy=Ts,Nr.sortedUniq=function(e){return e&&e.length?li(e):[]},Nr.sortedUniqBy=function(e,t){return e&&e.length?li(e,co(t,2)):[]},Nr.split=function(e,t,n){return n&&"number"!=typeof n&&xo(e,t,n)&&(t=n=r),(n=n===r?f:n>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!sa(t))&&!(t=ui(t))&&sr(e)?bi(pr(e),0,n):e.split(t,n):[]},Nr.spread=function(e,t){if("function"!=typeof e)throw new Pe(n);return t=null==t?0:_r(ma(t),0),$n((function(r){var n=r[t],i=bi(r,0,t);return n&&zt(i,n),Tt(e,this,i)}))},Nr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},Nr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:ma(t))<0?0:t):[]},Nr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:ma(t)))<0?0:t,i):[]},Nr.takeRightWhile=function(e,t){return e&&e.length?fi(e,co(t,3),!1,!0):[]},Nr.takeWhile=function(e,t){return e&&e.length?fi(e,co(t,3)):[]},Nr.tap=function(e,t){return t(e),e},Nr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Pe(n);return ta(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Os(e,t,{leading:i,maxWait:t,trailing:o})},Nr.thru=fs,Nr.toArray=pa,Nr.toPairs=ja,Nr.toPairsIn=Na,Nr.toPath=function(e){return Zs(e)?kt(e,Fo):ca(e)?[e]:Pi(Ro(ya(e)))},Nr.toPlainObject=_a,Nr.transform=function(e,t,r){var n=Zs(e),i=n||Xs(e)||ua(e);if(t=co(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:ta(e)&&Ks(o)?Vr(qe(e)):{}}return(i?Mt:xn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Nr.unary=function(e){return Ms(e,1)},Nr.union=rs,Nr.unionBy=ns,Nr.unionWith=is,Nr.uniq=function(e){return e&&e.length?hi(e):[]},Nr.uniqBy=function(e,t){return e&&e.length?hi(e,co(t,2)):[]},Nr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?hi(e,r,t):[]},Nr.unset=function(e,t){return null==e||di(e,t)},Nr.unzip=os,Nr.unzipWith=ss,Nr.update=function(e,t,r){return null==e?e:pi(e,t,yi(r))},Nr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:pi(e,t,yi(n),i)},Nr.values=Va,Nr.valuesIn=function(e){return null==e?[]:Jt(e,Da(e))},Nr.without=as,Nr.words=Ka,Nr.wrap=function(e,t){return Fs(yi(t),e)},Nr.xor=ls,Nr.xorBy=cs,Nr.xorWith=us,Nr.zip=hs,Nr.zipObject=function(e,t){return Ai(e||[],t||[],tn)},Nr.zipObjectDeep=function(e,t){return Ai(e||[],t||[],ei)},Nr.zipWith=ds,Nr.entries=ja,Nr.entriesIn=Na,Nr.extend=xa,Nr.extendWith=ba,ll(Nr,Nr),Nr.add=_l,Nr.attempt=Ja,Nr.camelCase=Ua,Nr.capitalize=Ha,Nr.ceil=yl,Nr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=Aa(n))==n?n:0),t!==r&&(t=(t=Aa(t))==t?t:0),ln(Aa(e),t,n)},Nr.clone=function(e){return cn(e,4)},Nr.cloneDeep=function(e){return cn(e,5)},Nr.cloneDeepWith=function(e,t){return cn(e,5,t="function"==typeof t?t:r)},Nr.cloneWith=function(e,t){return cn(e,4,t="function"==typeof t?t:r)},Nr.conformsTo=function(e,t){return null==t||un(e,t,Oa(t))},Nr.deburr=Ga,Nr.defaultTo=function(e,t){return null==e||e!=e?t:e},Nr.divide=vl,Nr.endsWith=function(e,t,n){e=ya(e),t=ui(t);var i=e.length,o=n=n===r?i:ln(ma(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Nr.eq=Vs,Nr.escape=function(e){return(e=ya(e))&&X.test(e)?e.replace(q,ir):e},Nr.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(re,"\\$&"):e},Nr.every=function(e,t,n){var i=Zs(e)?Pt:mn;return n&&xo(e,t,n)&&(t=r),i(e,co(t,3))},Nr.find=As,Nr.findIndex=Go,Nr.findKey=function(e,t){return Nt(e,co(t,3),xn)},Nr.findLast=_s,Nr.findLastIndex=Zo,Nr.findLastKey=function(e,t){return Nt(e,co(t,3),bn)},Nr.floor=xl,Nr.forEach=ys,Nr.forEachRight=vs,Nr.forIn=function(e,t){return null==e?e:yn(e,co(t,3),Da)},Nr.forInRight=function(e,t){return null==e?e:vn(e,co(t,3),Da)},Nr.forOwn=function(e,t){return e&&xn(e,co(t,3))},Nr.forOwnRight=function(e,t){return e&&bn(e,co(t,3))},Nr.get=Sa,Nr.gt=Us,Nr.gte=Hs,Nr.has=function(e,t){return null!=e&&Ao(e,t,Mn)},Nr.hasIn=Ma,Nr.head=qo,Nr.identity=il,Nr.includes=function(e,t,r,n){e=qs(e)?e:Va(e),r=r&&!n?ma(r):0;var i=e.length;return r<0&&(r=_r(i+r,0)),la(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Ut(e,t,r)>-1},Nr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ma(r);return i<0&&(i=_r(n+i,0)),Ut(e,t,i)},Nr.inRange=function(e,t,n){return t=fa(t),n===r?(n=t,t=0):n=fa(n),function(e,t,r){return e>=yr(t,r)&&e<_r(t,r)}(e=Aa(e),t,n)},Nr.invoke=La,Nr.isArguments=Gs,Nr.isArray=Zs,Nr.isArrayBuffer=Ws,Nr.isArrayLike=qs,Nr.isArrayLikeObject=Qs,Nr.isBoolean=function(e){return!0===e||!1===e||ra(e)&&Tn(e)==_},Nr.isBuffer=Xs,Nr.isDate=Ys,Nr.isElement=function(e){return ra(e)&&1===e.nodeType&&!oa(e)},Nr.isEmpty=function(e){if(null==e)return!0;if(qs(e)&&(Zs(e)||"string"==typeof e||"function"==typeof e.splice||Xs(e)||ua(e)||Gs(e)))return!e.length;var t=go(e);if(t==w||t==M)return!e.size;if(Eo(e))return!Rn(e).length;for(var r in e)if(Be.call(e,r))return!1;return!0},Nr.isEqual=function(e,t){return Dn(e,t)},Nr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?Dn(e,t,r,n):!!i},Nr.isError=$s,Nr.isFinite=function(e){return"number"==typeof e&&jt(e)},Nr.isFunction=Ks,Nr.isInteger=Js,Nr.isLength=ea,Nr.isMap=na,Nr.isMatch=function(e,t){return e===t||kn(e,t,ho(t))},Nr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,kn(e,t,ho(t),n)},Nr.isNaN=function(e){return ia(e)&&e!=+e},Nr.isNative=function(e){if(Co(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return zn(e)},Nr.isNil=function(e){return null==e},Nr.isNull=function(e){return null===e},Nr.isNumber=ia,Nr.isObject=ta,Nr.isObjectLike=ra,Nr.isPlainObject=oa,Nr.isRegExp=sa,Nr.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=d},Nr.isSet=aa,Nr.isString=la,Nr.isSymbol=ca,Nr.isTypedArray=ua,Nr.isUndefined=function(e){return e===r},Nr.isWeakMap=function(e){return ra(e)&&go(e)==L},Nr.isWeakSet=function(e){return ra(e)&&"[object WeakSet]"==Tn(e)},Nr.join=function(e,t){return null==e?"":qt.call(e,t)},Nr.kebabCase=Za,Nr.last=$o,Nr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ma(n))<0?_r(i+o,0):yr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Vt(e,Gt,o,!0)},Nr.lowerCase=Wa,Nr.lowerFirst=qa,Nr.lt=ha,Nr.lte=da,Nr.max=function(e){return e&&e.length?gn(e,il,Sn):r},Nr.maxBy=function(e,t){return e&&e.length?gn(e,co(t,2),Sn):r},Nr.mean=function(e){return Zt(e,il)},Nr.meanBy=function(e,t){return Zt(e,co(t,2))},Nr.min=function(e){return e&&e.length?gn(e,il,jn):r},Nr.minBy=function(e,t){return e&&e.length?gn(e,co(t,2),jn):r},Nr.stubArray=gl,Nr.stubFalse=Al,Nr.stubObject=function(){return{}},Nr.stubString=function(){return""},Nr.stubTrue=function(){return!0},Nr.multiply=wl,Nr.nth=function(e,t){return e&&e.length?Gn(e,ma(t)):r},Nr.noConflict=function(){return ft._===this&&(ft._=Ve),this},Nr.noop=cl,Nr.now=Ss,Nr.pad=function(e,t,r){e=ya(e);var n=(t=ma(t))?dr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Zi(gt(i),r)+e+Zi(mt(i),r)},Nr.padEnd=function(e,t,r){e=ya(e);var n=(t=ma(t))?dr(e):0;return t&&n<t?e+Zi(t-n,r):e},Nr.padStart=function(e,t,r){e=ya(e);var n=(t=ma(t))?dr(e):0;return t&&n<t?Zi(t-n,r)+e:e},Nr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),xr(ya(e).replace(ie,""),t||0)},Nr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&xo(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=fa(e),t===r?(t=e,e=0):t=fa(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=br();return yr(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return Xn(e,t)},Nr.reduce=function(e,t,r){var n=Zs(e)?Bt:Qt,i=arguments.length<3;return n(e,co(t,4),r,i,pn)},Nr.reduceRight=function(e,t,r){var n=Zs(e)?Rt:Qt,i=arguments.length<3;return n(e,co(t,4),r,i,fn)},Nr.repeat=function(e,t,n){return t=(n?xo(e,t,n):t===r)?1:ma(t),Yn(ya(e),t)},Nr.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nr.result=function(e,t,n){var i=-1,o=(t=vi(t,e)).length;for(o||(o=1,e=r);++i<o;){var s=null==e?r:e[Fo(t[i])];s===r&&(i=o,s=n),e=Ks(s)?s.call(e):s}return e},Nr.round=Cl,Nr.runInContext=e,Nr.sample=function(e){return(Zs(e)?$r:Kn)(e)},Nr.size=function(e){if(null==e)return 0;if(qs(e))return la(e)?dr(e):e.length;var t=go(e);return t==w||t==M?e.size:Rn(e).length},Nr.snakeCase=Qa,Nr.some=function(e,t,n){var i=Zs(e)?Ft:oi;return n&&xo(e,t,n)&&(t=r),i(e,co(t,3))},Nr.sortedIndex=function(e,t){return si(e,t)},Nr.sortedIndexBy=function(e,t,r){return ai(e,t,co(r,2))},Nr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=si(e,t);if(n<r&&Vs(e[n],t))return n}return-1},Nr.sortedLastIndex=function(e,t){return si(e,t,!0)},Nr.sortedLastIndexBy=function(e,t,r){return ai(e,t,co(r,2),!0)},Nr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=si(e,t,!0)-1;if(Vs(e[r],t))return r}return-1},Nr.startCase=Xa,Nr.startsWith=function(e,t,r){return e=ya(e),r=null==r?0:ln(ma(r),0,e.length),t=ui(t),e.slice(r,r+t.length)==t},Nr.subtract=El,Nr.sum=function(e){return e&&e.length?Xt(e,il):0},Nr.sumBy=function(e,t){return e&&e.length?Xt(e,co(t,2)):0},Nr.template=function(e,t,n){var i=Nr.templateSettings;n&&xo(e,t,n)&&(t=r),e=ya(e),t=ba({},t,i,Ji);var o,s,a=ba({},t.imports,i.imports,Ji),l=Oa(a),c=Jt(a,l),u=0,h=t.interpolate||ve,d="__p += '",p=Me((t.escape||ve).source+"|"+h.source+"|"+(h===K?de:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),f="//# sourceURL="+(Be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++st+"]")+"\n";e.replace(p,(function(t,r,n,i,a,l){return n||(n=i),d+=e.slice(u,l).replace(xe,or),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),d+="';\n";var m=Be.call(t,"variable")&&t.variable;if(m){if(ue.test(m))throw new Ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(H,""):d).replace(G,"$1").replace(Z,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return Ee(l,f+"return "+d).apply(r,c)}));if(g.source=d,$s(g))throw g;return g},Nr.times=function(e,t){if((e=ma(e))<1||e>d)return[];var r=f,n=yr(e,f);t=co(t),e-=f;for(var i=Yt(n,t);++r<e;)t(r);return i},Nr.toFinite=fa,Nr.toInteger=ma,Nr.toLength=ga,Nr.toLower=function(e){return ya(e).toLowerCase()},Nr.toNumber=Aa,Nr.toSafeInteger=function(e){return e?ln(ma(e),-9007199254740991,d):0===e?e:0},Nr.toString=ya,Nr.toUpper=function(e){return ya(e).toUpperCase()},Nr.trim=function(e,t,n){if((e=ya(e))&&(n||t===r))return $t(e);if(!e||!(t=ui(t)))return e;var i=pr(e),o=pr(t);return bi(i,tr(i,o),rr(i,o)+1).join("")},Nr.trimEnd=function(e,t,n){if((e=ya(e))&&(n||t===r))return e.slice(0,fr(e)+1);if(!e||!(t=ui(t)))return e;var i=pr(e);return bi(i,0,rr(i,pr(t))+1).join("")},Nr.trimStart=function(e,t,n){if((e=ya(e))&&(n||t===r))return e.replace(ie,"");if(!e||!(t=ui(t)))return e;var i=pr(e);return bi(i,tr(i,pr(t))).join("")},Nr.truncate=function(e,t){var n=30,i="...";if(ta(t)){var o="separator"in t?t.separator:o;n="length"in t?ma(t.length):n,i="omission"in t?ui(t.omission):i}var s=(e=ya(e)).length;if(sr(e)){var a=pr(e);s=a.length}if(n>=s)return e;var l=n-dr(i);if(l<1)return i;var c=a?bi(a,0,l).join(""):e.slice(0,l);if(o===r)return c+i;if(a&&(l+=c.length-l),sa(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=Me(o.source,ya(pe.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===r?l:d)}}else if(e.indexOf(ui(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+i},Nr.unescape=function(e){return(e=ya(e))&&Q.test(e)?e.replace(W,mr):e},Nr.uniqueId=function(e){var t=++Re;return ya(e)+t},Nr.upperCase=Ya,Nr.upperFirst=$a,Nr.each=ys,Nr.eachRight=vs,Nr.first=qo,ll(Nr,(bl={},xn(Nr,(function(e,t){Be.call(Nr.prototype,t)||(bl[t]=e)})),bl),{chain:!1}),Nr.VERSION="4.17.21",Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Nr[e].placeholder=Nr})),Mt(["drop","take"],(function(e,t){Gr.prototype[e]=function(n){n=n===r?1:_r(ma(n),0);var i=this.__filtered__&&!t?new Gr(this):this.clone();return i.__filtered__?i.__takeCount__=yr(n,i.__takeCount__):i.__views__.push({size:yr(n,f),type:e+(i.__dir__<0?"Right":"")}),i},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Mt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:co(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Mt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),Mt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(il)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=$n((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return Ln(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(Bs(co(e)))},Gr.prototype.slice=function(e,t){e=ma(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ma(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(f)},xn(Gr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Nr[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);o&&(Nr.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,l=t instanceof Gr,c=a[0],u=l||Zs(t),h=function(e){var t=o.apply(Nr,zt([e],a));return i&&d?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=s&&!d,m=l&&!p;if(!s&&u){t=m?t:new Gr(this);var g=e.apply(t,a);return g.__actions__.push({func:fs,args:[h],thisArg:r}),new Hr(g,d)}return f&&m?e.apply(this,a):(g=this.thru(h),f?i?g.value()[0]:g.value():g)})})),Mt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Le[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Nr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Zs(i)?i:[],e)}return this[r]((function(r){return t.apply(Zs(r)?r:[],e)}))}})),xn(Gr.prototype,(function(e,t){var r=Nr[t];if(r){var n=r.name+"";Be.call(Lr,n)||(Lr[n]=[]),Lr[n].push({name:t,func:r})}})),Lr[Vi(r,2).name]=[{name:"wrapper",func:r}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=Pi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Pi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Pi(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Zs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yr(t,e+s);break;case"takeRight":e=_r(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,c=n?a:s-1,u=this.__iteratees__,h=u.length,d=0,p=yr(l,this.__takeCount__);if(!r||!n&&i==l&&p==l)return mi(e,this.__actions__);var f=[];e:for(;l--&&d<p;){for(var m=-1,g=e[c+=t];++m<h;){var A=u[m],_=A.iteratee,y=A.type,v=_(g);if(2==y)g=v;else if(!v){if(1==y)continue e;break e}}f[d++]=g}return f},Nr.prototype.at=ms,Nr.prototype.chain=function(){return ps(this)},Nr.prototype.commit=function(){return new Hr(this.value(),this.__chain__)},Nr.prototype.next=function(){this.__values__===r&&(this.__values__=pa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Nr.prototype.plant=function(e){for(var t,n=this;n instanceof Ur;){var i=No(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Nr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:fs,args:[ts],thisArg:r}),new Hr(t,this.__chain__)}return this.thru(ts)},Nr.prototype.toJSON=Nr.prototype.valueOf=Nr.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},Nr.prototype.first=Nr.prototype.head,Ke&&(Nr.prototype[Ke]=function(){return this}),Nr}();gt?((gt.exports=gr)._=gr,mt._=gr):ft._=gr}).call(We)}(Fa,Fa.exports);var ja=Fa.exports;function Na(e){let{name:t,label:r,disabled:n=!1,showTooltip:i=!1,openTooltip:o=!1,tooltipTitle:l,closeTooltip:c,width:u=300,placeholder:h="Please select",value:d,inputValue:p,onChange:f,toggleError:m,onNeedFetch:g,...A}=e;const _=le(!1),[y,v]=oe(!1),[x,b]=oe(null),[w,C]=oe([]),[E,S]=oe(null),[M,I]=oe(""),[P,L]=oe(!1),[O,k]=oe(""),[z,B]=oe(!1),R=y&&!P,F=e=>{let{search:t="",loadedOptions:r=[]}=e;g({search:t,loadedOptions:r}).then((e=>{let{options:t}=e;C(t),L(!0)}))},j=ue(ja.debounce((e=>{let{search:t,loadedOptions:r}=e;F({search:t,loadedOptions:r})}),600),[]);return se((()=>{if(i&&M&&0===w.length&&!z){const e=setTimeout((()=>{z||localStorage.getItem("tooltipShown")||B(!0)}),2e3);return()=>clearTimeout(e)}}),[i,M,w,z]),se((()=>{R&&F({search:"",loadedOptions:[]})}),[R]),se((()=>{"clear"===O&&L(!1),x||"selectOption"!==O||f&&f(E)}),[x,O,E]),se((()=>{y||(C([]),L(!1))}),[y]),se((()=>{d&&!E&&(S(d),I(p||""))}),[d,p]),se((()=>{_.current&&(M&&E||(b("Please select a city from the list"),m&&m(!0)),M&&E&&(b(null),m&&m(!1)))}),[_.current,E,M]),se((()=>{i&&z&&localStorage.setItem("tooltipShown","true")}),[i,z]),s(D,{openOnFocus:!0,open:y,disabled:n,onOpen:()=>v(!0),onClose:()=>v(!1),isOptionEqualToValue:(e,t)=>ja.isEqual(e,t),onInputChange:(e,t,r)=>{e&&(k("input"!==r?ja.isString(r)?r:"selectOption":""),"change"===e.type&&j({search:t}),I(t),_.current=!0)},onChange:(e,t,r)=>{k(r),S(t)},value:E,options:w,loading:R,inputValue:M,componentsProps:{paper:{sx:{borderRadius:"20px"}}},sx:{width:["100%",u,u],"&.MuiAutocomplete-root .MuiFormControl-root .MuiInputBase-root":{height:50,fontSize:"16px !important",fontFamily:"CircularStd, sans-serif",flexWrap:"nowrap",overflow:"hidden"}},renderInput:e=>s(Ra,{...e,name:t,value:d||E||null,label:r,tooltipTitle:l,showTooltip:i||z,openTooltip:o,closeTooltip:c,error:!!x,helperText:x||null,placeholder:h,InputProps:{...e.InputProps,endAdornment:a(pe,{children:[R?s(T,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})}}),...A})}const Va=fe(((e,t)=>{let{apiKey:r,location:n,onChange:i,city:o,disabled:l,reset:c,isInvalid:u,isDefault:h,restrictionOptions:d,showLocationIcon:p,helperText:f="Please select commute destination from the list",onPlaceClick:m,sx:g={},disableComponentRestrictions:A,...y}=e;const v=le(null),[x,b]=oe(n?.name||""),[w,C]=oe([]),E=le(null),T=le(null),[S,M]=oe(!1),[I,P]=oe(!1),L=()=>{E.current=new window.google.maps.places.AutocompleteService,T.current=new window.google.maps.places.PlacesService(document.createElement("div"))},O=Ve(((e,t)=>{E.current.getPlacePredictions({input:o&&o?.length>0&&e?.length>0?`${e} ${o}`:e,...A?{}:{componentRestrictions:{country:"ae"}},...d||{}},t)}),300),D=(e,t)=>{t===google.maps.places.PlacesServiceStatus.OK&&e?(C(e),!I&&h&&k(e[0])):C([])},k=e=>{e&&T.current?(e=>{T.current&&e&&e.place_id&&T.current.getDetails({placeId:e?.place_id},((t,r)=>{r===google.maps.places.PlacesServiceStatus.OK&&t&&(P(!0),i({lat:t?.geometry?.location?.lat()||0,lng:t?.geometry?.location?.lng()||0,name:e?.description||t.formatted_address||t.name}))}))})(e):i(void 0)},z=()=>{const e=v.current?.getElementsByClassName?.("MuiAutocomplete-clearIndicator")?.[0];b(""),k(null),C([]),O("",(()=>e?.click?.()))};return me(t,(()=>({reset:z}))),se((()=>{(()=>{if(window.google&&window.google.maps&&window.google.maps.places)return L(),void M(!0);const e="google-maps-script";if(document.getElementById(e))return;const t=document.createElement("script");t.id=e,t.src=`https://maps.googleapis.com/maps/api/js?key=${r}&libraries=places`,t.async=!0,document.head.appendChild(t),t.onload=()=>{M(!0)}})()}),[r]),se((()=>{S&&L()}),[S]),se((()=>{S&&x.length>1&&E.current&&O(x,D)}),[x,S,E.current]),se((()=>{S&&!I&&n?.name!==x&&b(n?.name||"")}),[n?.name,S]),se((()=>{c&&z()}),[c]),s(je,{freeSolo:!0,ref:v,disabled:l,options:w,getOptionLabel:e=>"string"==typeof e?e:e.description,inputValue:x,filterOptions:e=>e,filterSelectedOptions:!0,onInputChange:(e,t)=>{t||z(),b(t)},onChange:(e,t)=>k(t),renderInput:e=>s(Le,{...e,placeholder:"Enter your workplace, school, or station",error:u,helperText:u?f:" ",FormHelperTextProps:{sx:{textAlign:"center"}}}),renderOption:(e,t)=>ge("li",{...e,key:t.place_id,onClick:r=>{e?.onClick?.(r),m?.(t.description)}},a(_,{children:[p&&s(Ne,{sx:{color:"text.secondary"}}),a(Me,{component:"span",color:"text.secondary",fontWeight:"bold",children:[t.structured_formatting.main_text,","]}),s(Me,{component:"span",variant:"body2",ml:.5,color:"#767676",children:t.structured_formatting.secondary_text})]})),sx:g||{},...y})})),Ua=(e,t)=>{const r=e??0,n=r%60,i=n>0?` ${n} ${t?"mins":"minutes"}`:"";if(r<60)return t?`${i}`:`Under ${i}`;const o=Math.floor(r/60);return 1===o&&60===r?t?"1 h":`Under 1 hour${i}`:t?`${o} h ${i}`:`Under ${o} hours${i}`},Ha=e=>{let t=Math.floor(e/60),r=e%60;return r=r<10?`0${r}`:r,0!==t&&"00"!==r?t>1?`${t} hrs ${r} mins`:`${t} hr ${r} mins`:"00"!==r&&0===t?`${r} mins`:"00"===r&&0!==t?t>1?`${t} hours`:`${t} hour`:"-"},Ga=(e,t)=>{const r=e?.[t]?.split("|");return r?.reduce(((e,t)=>{const r=t?.split(":");return r&&2===r.length&&(e[r[0]]=r[1]),e}),{})};var Za;!function(e){e.public_transport="public_transport",e.driving="driving",e.walking="walking",e.cycling="cycling"}(Za||(Za={}));const Wa={public_transport:e=>{let{sx:t={},...r}=e;return s(d,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...r,children:a("g",{id:"icon",children:[s("path",{id:"Ellipse 287",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),a("g",{id:"icon_2",children:[s("path",{id:"Vector",d:"M7.91908 6.30424C8.28053 6.30424 8.64842 6.30424 9.00987 6.30424C9.37132 6.30424 9.8167 6.30424 10.2169 6.30424C10.4363 6.30424 10.3782 6.1687 10.3847 6.05252C10.3911 5.93634 10.3847 5.85242 10.2169 5.85242C9.45525 5.85242 8.68717 5.85242 7.91908 5.85242C7.69963 5.85242 7.75772 5.98797 7.75126 6.10415C7.74481 6.22033 7.75127 6.31069 7.91908 6.30424Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_2",d:"M6.69917 11.4097C6.7238 11.5121 6.7844 11.6022 6.86992 11.6636C6.95544 11.725 7.06017 11.7536 7.16503 11.7442C7.26989 11.7348 7.36788 11.688 7.44113 11.6124C7.51438 11.5368 7.55801 11.4374 7.56406 11.3323C7.56769 11.2693 7.55771 11.2063 7.53479 11.1476C7.51188 11.0888 7.47656 11.0357 7.43126 10.9918C7.38597 10.9479 7.33176 10.9143 7.2723 10.8933C7.21285 10.8722 7.14955 10.8643 7.08673 10.8699C7.02392 10.8755 6.96306 10.8946 6.9083 10.9259C6.85353 10.9571 6.80613 10.9998 6.76935 11.0511C6.73257 11.1023 6.70726 11.1608 6.69515 11.2227C6.68304 11.2846 6.68441 11.3484 6.69917 11.4097Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_3",d:"M10.6171 11.4032C10.6265 11.5179 10.681 11.6242 10.7688 11.6986C10.8566 11.7731 10.9703 11.8096 11.085 11.8002C11.1997 11.7908 11.3059 11.7362 11.3804 11.6484C11.4548 11.5607 11.4914 11.4469 11.482 11.3323C11.4773 11.2755 11.4615 11.2201 11.4354 11.1695C11.4094 11.1188 11.3736 11.0737 11.3302 11.0369C11.2867 11 11.2364 10.9721 11.1822 10.9546C11.1279 10.9372 11.0708 10.9306 11.014 10.9353C10.9572 10.94 10.9019 10.9558 10.8512 10.9818C10.8005 11.0078 10.7555 11.0436 10.7186 11.0871C10.6818 11.1305 10.6538 11.1808 10.6364 11.235C10.619 11.2893 10.6124 11.3465 10.6171 11.4032Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_4",d:"M10.2491 4.54216C10.5202 4.54216 10.6106 4.45827 10.6041 4.19363C10.5977 3.929 10.5009 3.88381 10.2685 3.88381C10.0361 3.88381 9.95224 3.98063 9.94579 4.20654C9.93933 4.43244 10.0297 4.53571 10.2491 4.54216Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_5",d:"M7.89967 4.54215C8.11266 4.54215 8.20303 4.41953 8.19012 4.18717C8.17722 3.95481 8.0804 3.87735 7.84804 3.88381C7.61568 3.89026 7.50596 4.00644 7.53178 4.26462C7.55759 4.5228 7.6673 4.55506 7.89967 4.54215Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_6",d:"M12.3597 5.54905C12.3662 5.34535 12.307 5.14499 12.1907 4.97759C12.0745 4.81019 11.9074 4.68468 11.7143 4.61963C11.5595 4.53254 11.3801 4.49982 11.2046 4.52673C11.0291 4.55364 10.8676 4.63862 10.7461 4.76807C10.6414 4.88671 10.4968 4.96278 10.3398 4.98182C10.1827 5.00086 10.0241 4.96154 9.89413 4.87134C9.83354 4.83215 9.78095 4.78176 9.73921 4.72288C9.61658 4.54861 9.26159 4.54216 9.26159 4.54216H8.99049C8.8672 4.52453 8.7415 4.53641 8.62369 4.5768C8.50587 4.6172 8.39932 4.68496 8.31278 4.77453C8.25775 4.84317 8.188 4.89859 8.10868 4.93666C8.02936 4.97473 7.9425 4.99449 7.85452 4.99449C7.76654 4.99449 7.67966 4.97473 7.60034 4.93666C7.52102 4.89859 7.45127 4.84317 7.39624 4.77453C7.31435 4.6873 7.21368 4.61987 7.10184 4.57738C6.99 4.53488 6.86994 4.51842 6.75079 4.52925C6.48589 4.53256 6.23267 4.63884 6.04474 4.82556C5.8568 5.01229 5.74891 5.26481 5.7439 5.52969V11.8873C5.74474 12.0184 5.77151 12.148 5.82265 12.2687C5.87379 12.3894 5.94829 12.4988 6.04188 12.5906C6.13547 12.6824 6.24628 12.7548 6.36795 12.8036C6.48962 12.8524 6.61972 12.8766 6.75079 12.8749H11.3012C11.4369 12.8784 11.572 12.8543 11.6981 12.804C11.8242 12.7537 11.9388 12.6782 12.0348 12.5822C12.1308 12.4862 12.2063 12.3716 12.2566 12.2455C12.3069 12.1194 12.331 11.9844 12.3275 11.8486L12.3597 5.54905ZM6.22154 11.3064C6.26027 10.1898 8.04169 10.306 7.9707 11.3516C7.94702 11.5707 7.84179 11.7729 7.6759 11.918C7.51002 12.0631 7.29563 12.1405 7.07531 12.1348C6.85499 12.1291 6.64486 12.0408 6.48669 11.8873C6.32852 11.7338 6.23387 11.5265 6.22154 11.3064ZM10.1717 11.3064C10.2104 10.1834 12.0112 10.3189 11.9208 11.3516C11.8972 11.5707 11.7919 11.7729 11.626 11.918C11.4601 12.0631 11.2458 12.1405 11.0254 12.1348C10.8051 12.1291 10.595 12.0408 10.4368 11.8873C10.2786 11.7338 10.184 11.5265 10.1717 11.3064ZM11.9208 8.64721C11.9331 8.74394 11.9233 8.84219 11.8921 8.93459C11.861 9.02699 11.8093 9.11113 11.741 9.18069C11.6727 9.25026 11.5895 9.30344 11.4977 9.33624C11.4058 9.36905 11.3078 9.38063 11.2108 9.3701C10.5008 9.3701 9.78439 9.3701 9.0744 9.3701H6.98962C6.46036 9.3701 6.22153 9.12484 6.21508 8.60848C6.20863 8.09212 6.21508 7.54995 6.21508 7.02069C6.20281 6.92396 6.21261 6.82568 6.24376 6.73328C6.2749 6.64088 6.32657 6.55675 6.3949 6.48718C6.46322 6.41762 6.54642 6.36444 6.63824 6.33163C6.73006 6.29883 6.82814 6.28725 6.92507 6.29777H7.14452C7.2478 6.29777 7.32526 6.29778 7.31235 6.16223C7.30913 6.10634 7.30913 6.0503 7.31235 5.99441C7.30833 5.91165 7.32289 5.82905 7.35497 5.75264C7.38705 5.67624 7.43584 5.60798 7.49774 5.55289C7.55964 5.4978 7.63309 5.45728 7.7127 5.43427C7.7923 5.41127 7.87605 5.40639 7.95779 5.41997C8.68715 5.41997 9.42295 5.41997 10.1523 5.41997C10.2455 5.40336 10.3414 5.40928 10.4319 5.43725C10.5223 5.46522 10.6048 5.51442 10.6724 5.58074C10.74 5.64707 10.7907 5.72861 10.8204 5.81853C10.8501 5.90846 10.8578 6.00416 10.8429 6.09769C10.8429 6.27196 10.8946 6.33005 11.0559 6.30423H11.2173C11.6691 6.35587 11.9144 6.50433 11.9337 7.01423C11.9531 7.52413 11.9273 8.10503 11.9208 8.64721Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_7",d:"M11.1786 6.73669H8.55161H6.69272L6.65399 8.6343C6.65399 8.90539 6.65399 8.91184 6.95735 8.91184H9.58432H11.4432L11.4819 7.01422C11.4819 6.74314 11.4755 6.73669 11.1786 6.73669Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_8",d:"M12.9923 14.0109C12.7664 13.8172 12.534 13.6301 12.3081 13.43C12.0822 13.2299 12.0176 13.1718 12.2564 12.933C12.3048 12.8782 12.3566 12.8264 12.4114 12.7781C12.5345 12.6557 12.6317 12.5097 12.6971 12.3489C12.7626 12.1881 12.7949 12.0158 12.7922 11.8422C12.7922 9.75737 12.7922 7.67904 12.7922 5.59424C12.7866 5.22734 12.6412 4.87641 12.3855 4.61317C12.0935 4.3087 11.6967 4.12645 11.2754 4.10326C11.1657 4.10326 11.0366 4.10327 10.9978 3.99355C10.9597 3.87059 10.8947 3.75761 10.8077 3.66275C10.7206 3.56789 10.6136 3.49349 10.4944 3.44491C10.3532 3.39014 10.1967 3.39014 10.0555 3.44491C9.93615 3.49033 9.82906 3.563 9.74278 3.65714C9.65649 3.75127 9.59337 3.86425 9.55849 3.98709C9.55849 4.04518 9.41649 4.08389 9.33904 4.0968C9.23156 4.10326 9.12379 4.10326 9.01631 4.0968C8.7775 4.0968 8.57742 4.09681 8.4806 3.80636C8.44258 3.72095 8.38744 3.64424 8.31861 3.58096C8.24978 3.51769 8.16873 3.46918 8.08043 3.43845C7.93862 3.38718 7.78332 3.38718 7.64151 3.43845C7.52227 3.48703 7.41529 3.56143 7.32824 3.65629C7.24119 3.75115 7.17623 3.86412 7.13806 3.98709C7.09933 4.10972 6.97025 4.09035 6.86052 4.0968C6.65085 4.10165 6.4443 4.14869 6.25319 4.23508C6.06208 4.32147 5.89032 4.44546 5.74817 4.59966C5.60601 4.75386 5.49638 4.93512 5.42578 5.13261C5.35518 5.3301 5.32509 5.53979 5.33728 5.74916C5.33728 7.63387 5.33728 9.51857 5.33728 11.3968C5.30208 11.703 5.3425 12.0132 5.45503 12.3001C5.56756 12.5871 5.74876 12.8421 5.98273 13.0427C5.98273 13.0427 6.04727 13.0879 6.06018 13.1202C6.07309 13.1524 6.0989 13.2492 5.99563 13.3202C5.67936 13.5461 5.38891 13.7979 5.08555 14.0431C4.99518 14.1206 4.95 14.198 5.08555 14.3078C5.22109 14.4175 5.27273 14.4433 5.39537 14.3078C5.518 14.1722 5.80199 13.9721 6.00853 13.8043C6.21507 13.6365 6.3829 13.4881 6.58299 13.3396C6.6454 13.3102 6.71419 13.2969 6.78307 13.3009H11.3916C11.4438 13.2994 11.4958 13.3083 11.5446 13.3272C11.5934 13.346 11.6379 13.3744 11.6756 13.4106C12.037 13.7204 12.4178 14.0044 12.7793 14.3142C12.9084 14.424 12.9794 14.411 13.0891 14.3142C13.1988 14.2174 13.0826 14.0883 12.9923 14.0109ZM10.2685 3.88381C10.5008 3.88381 10.5977 3.96773 10.6041 4.19363C10.6106 4.41954 10.5202 4.55507 10.2491 4.54216C9.97803 4.52925 9.9393 4.43244 9.94576 4.20654C9.95221 3.98063 10.0426 3.88381 10.2685 3.88381ZM7.84806 3.88381C8.08042 3.88381 8.17723 3.96772 8.19014 4.18717C8.20305 4.40663 8.11268 4.52925 7.89968 4.54216C7.68669 4.55507 7.55116 4.47117 7.53179 4.26462C7.51243 4.05808 7.60924 3.89027 7.84806 3.88381ZM11.3335 12.8813H6.78307C6.652 12.883 6.52188 12.8588 6.40021 12.81C6.27855 12.7612 6.16773 12.6889 6.07414 12.5971C5.98056 12.5053 5.90605 12.3959 5.85491 12.2752C5.80377 12.1545 5.77702 12.0249 5.77618 11.8938V5.53616C5.78119 5.27128 5.88907 5.01874 6.077 4.83201C6.26493 4.64528 6.51817 4.53903 6.78307 4.53572C6.90222 4.52488 7.02226 4.54134 7.1341 4.58384C7.24594 4.62634 7.34664 4.69376 7.42852 4.78099C7.48355 4.84964 7.55331 4.90503 7.63263 4.9431C7.71194 4.98118 7.7988 5.00096 7.88678 5.00096C7.97477 5.00096 8.06162 4.98118 8.14094 4.9431C8.22026 4.90503 8.29001 4.84964 8.34504 4.78099C8.43158 4.69143 8.53814 4.62366 8.65595 4.58327C8.77376 4.54288 8.89948 4.531 9.02277 4.54862H9.28095C9.28095 4.54862 9.63594 4.54862 9.75857 4.72935C9.80031 4.78822 9.8529 4.83861 9.91349 4.87781C10.0435 4.96801 10.2021 5.00733 10.3591 4.98829C10.5162 4.96925 10.6608 4.89318 10.7655 4.77453C10.887 4.64508 11.0484 4.56011 11.2239 4.5332C11.3995 4.50629 11.5789 4.53899 11.7336 4.62607C11.9268 4.69113 12.0939 4.81666 12.2101 4.98405C12.3263 5.15145 12.3856 5.35182 12.3791 5.55552V11.8615C12.3819 11.9984 12.3565 12.1344 12.3046 12.2611C12.2528 12.3878 12.1754 12.5025 12.0774 12.5981C11.9794 12.6937 11.8628 12.7682 11.7348 12.8169C11.6068 12.8656 11.4702 12.8876 11.3335 12.8813Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_9",d:"M11.2173 6.29777H11.0559C10.8946 6.29777 10.83 6.29778 10.843 6.09124C10.8578 5.99772 10.8501 5.90199 10.8204 5.81207C10.7907 5.72214 10.74 5.6406 10.6724 5.57428C10.6048 5.50795 10.5223 5.45877 10.4319 5.4308C10.3414 5.40283 10.2455 5.3969 10.1523 5.41351C9.42297 5.41351 8.68716 5.41351 7.95781 5.41351C7.87606 5.39992 7.79232 5.40481 7.71271 5.42781C7.6331 5.45081 7.55965 5.49136 7.49775 5.54645C7.43585 5.60154 7.38707 5.66978 7.35498 5.74618C7.3229 5.82258 7.30835 5.9052 7.31236 5.98797C7.30914 6.04386 7.30914 6.09988 7.31236 6.15577C7.31236 6.28486 7.24781 6.29778 7.14454 6.29133H6.92509C6.82815 6.2808 6.73008 6.29236 6.63825 6.32517C6.54643 6.35797 6.46323 6.41115 6.39491 6.48072C6.32659 6.55028 6.27492 6.63444 6.24377 6.72684C6.21263 6.81924 6.20282 6.91749 6.21509 7.01422C6.21509 7.54349 6.21509 8.07275 6.21509 8.60202C6.21509 9.11837 6.46037 9.35718 6.98964 9.36364H9.07442C9.78441 9.36364 10.5009 9.36364 11.2108 9.36364C11.3078 9.37416 11.4059 9.3626 11.4977 9.3298C11.5895 9.29699 11.6727 9.24381 11.741 9.17425C11.8093 9.10468 11.861 9.02053 11.8922 8.92813C11.9233 8.83573 11.9331 8.73747 11.9208 8.64074C11.9208 8.09857 11.9208 7.54993 11.9208 7.0013C11.9208 6.45267 11.6498 6.3494 11.2173 6.29777ZM7.93844 5.85241C8.70652 5.85241 9.4746 5.85241 10.2362 5.85241C10.404 5.85241 10.4105 5.92988 10.404 6.05251C10.3976 6.17515 10.4557 6.31068 10.2362 6.30423C9.83605 6.30423 9.42941 6.30423 9.02923 6.30423C8.62905 6.30423 8.29989 6.30423 7.93844 6.30423C7.77063 6.30423 7.76417 6.22678 7.77062 6.10414C7.77708 5.98151 7.69963 5.85241 7.91908 5.85241H7.93844ZM11.4626 8.91184H9.60369H6.95735C6.66045 8.91184 6.65399 8.91184 6.65399 8.6343L6.69272 6.73669H8.55161H11.1786C11.4755 6.73669 11.4819 6.73668 11.4819 7.01422L11.4626 8.91184Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_10",d:"M6.22153 11.3065C6.23386 11.5265 6.3285 11.7339 6.48667 11.8873C6.64485 12.0408 6.85498 12.1292 7.07529 12.1348C7.29561 12.1405 7.51 12.0631 7.67589 11.918C7.84177 11.7729 7.94701 11.5708 7.97068 11.3516C8.04168 10.306 6.26025 10.1898 6.22153 11.3065ZM6.66689 11.4097C6.6618 11.3529 6.66794 11.2957 6.68497 11.2413C6.702 11.1869 6.7296 11.1363 6.76616 11.0926C6.80272 11.0488 6.84754 11.0127 6.89806 10.9863C6.94858 10.9599 7.00381 10.9436 7.0606 10.9385C7.11739 10.9335 7.17462 10.9396 7.22903 10.9566C7.28345 10.9737 7.33398 11.0013 7.37773 11.0378C7.42148 11.0744 7.45761 11.1192 7.48404 11.1697C7.51047 11.2203 7.5267 11.2755 7.53178 11.3323C7.51606 11.4264 7.46962 11.5127 7.39971 11.5777C7.3298 11.6427 7.24035 11.6828 7.1453 11.6916C7.05025 11.7005 6.95494 11.6776 6.87424 11.6266C6.79354 11.5756 6.73197 11.4994 6.69915 11.4097H6.66689Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_11",d:"M10.1717 11.3064C10.184 11.5265 10.2786 11.7338 10.4368 11.8873C10.595 12.0408 10.8051 12.1291 11.0254 12.1348C11.2457 12.1405 11.4601 12.0631 11.626 11.918C11.7919 11.7729 11.8971 11.5707 11.9208 11.3516C12.0112 10.3189 10.2104 10.1834 10.1717 11.3064ZM10.617 11.4032C10.6124 11.3465 10.6189 11.2893 10.6363 11.2351C10.6538 11.1808 10.6817 11.1305 10.7186 11.0871C10.7554 11.0436 10.8005 11.0078 10.8512 10.9818C10.9019 10.9558 10.9572 10.94 11.014 10.9353C11.0708 10.9306 11.1279 10.9372 11.1822 10.9546C11.2364 10.9721 11.2867 11 11.3301 11.0369C11.3736 11.0737 11.4094 11.1188 11.4354 11.1695C11.4615 11.2201 11.4773 11.2755 11.4819 11.3323C11.4913 11.447 11.4548 11.5607 11.3804 11.6484C11.3059 11.7362 11.1997 11.7908 11.085 11.8002C10.9703 11.8096 10.8565 11.7731 10.7688 11.6987C10.681 11.6242 10.6264 11.5179 10.617 11.4032Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"})]})]})})},driving:e=>{let{sx:t={},...r}=e;return a(d,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...r,children:[s("path",{d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.40724 5.08476L4.8924 7.14411H13.2078L12.693 5.08476C12.6467 5.0708 12.5909 5.05428 12.5262 5.03582C12.3181 4.97634 12.0198 4.89678 11.6615 4.81718C10.9429 4.65748 9.99314 4.4999 9.05011 4.4999C8.10708 4.4999 7.15736 4.65748 6.43868 4.81718C6.08047 4.89678 5.78217 4.97634 5.57399 5.03582C5.50937 5.05428 5.45349 5.0708 5.40724 5.08476ZM12.9432 4.84874L13.0381 4.56414C13.1354 4.59657 13.2094 4.67647 13.2343 4.77598L13.8606 7.28141L14.664 7.9952C15.1083 8.38992 15.2968 9.00008 15.1523 9.57692M15.1523 9.57692L14.5409 12.0229V12.9593C14.5409 13.304 14.2612 13.5837 13.9165 13.5837H12.6188C12.274 13.5837 11.9944 13.304 11.9944 12.9593V12.286H6.10586V12.9593C6.10586 13.304 5.8262 13.5837 5.48144 13.5837H4.18374C3.83897 13.5837 3.55931 13.304 3.55931 12.9593V12.0229L2.94802 9.57713C2.80349 9.00029 2.99194 8.38992 3.4362 7.9952L4.2396 7.28141L4.86597 4.77598C4.89085 4.67647 4.96484 4.59657 5.06214 4.56414L5.15701 4.84874C5.06214 4.56414 5.06209 4.56416 5.06214 4.56414L5.06424 4.56344L5.06915 4.56183L5.08725 4.55594C5.10294 4.55088 5.12579 4.5436 5.15534 4.53441C5.21442 4.51603 5.3003 4.49001 5.40916 4.4589C5.62679 4.39673 5.93678 4.31407 6.30853 4.23147C7.04977 4.06675 8.04659 3.8999 9.05011 3.8999C10.0536 3.8999 11.0505 4.06675 11.7917 4.23147C12.1634 4.31407 12.4734 4.39673 12.6911 4.4589C12.7999 4.49001 12.8858 4.51603 12.9449 4.53441C12.9744 4.5436 12.9973 4.55088 13.013 4.55594L13.0311 4.56183L13.036 4.56344L13.0381 4.56414C13.0381 4.56416 13.0381 4.56414 12.9432 4.84874M4.62218 7.74411L3.83471 8.44374C3.55751 8.69003 3.43975 9.0712 3.53001 9.43122L4.09356 11.686H14.0067L14.5702 9.43143C14.6604 9.07141 14.5427 8.69003 14.2655 8.44374L13.478 7.74411H4.62218ZM4.15931 12.286V12.9593C4.15931 12.9726 4.17034 12.9837 4.18374 12.9837H5.48144C5.49484 12.9837 5.50586 12.9726 5.50586 12.9593V12.286H4.15931ZM12.5944 12.286V12.9593C12.5944 12.9726 12.6054 12.9837 12.6188 12.9837H13.9165C13.9299 12.9837 13.9409 12.9726 13.9409 12.9593V12.286H12.5944ZM5.00786 9.71462C5.00771 9.71708 5.0079 9.72058 5.01072 9.72622C5.21424 10.1322 5.62943 10.3883 6.08292 10.3883H6.45471C6.64784 10.3883 6.80356 10.2326 6.80356 10.0395C6.80356 9.84635 6.64784 9.69063 6.45471 9.69063H5.03308C5.02655 9.69063 5.02322 9.69208 5.02104 9.69334C5.01818 9.695 5.01479 9.69799 5.012 9.70249C5.00921 9.707 5.00806 9.71136 5.00786 9.71462ZM4.47407 9.99455C4.26656 9.57954 4.56884 9.09063 5.03308 9.09063H6.45471C6.97921 9.09063 7.40356 9.51497 7.40356 10.0395C7.40356 10.564 6.97921 10.9883 6.45471 10.9883H6.08292C5.40222 10.9883 4.77925 10.6034 4.47407 9.99455ZM11.6456 9.69063C11.4525 9.69063 11.2968 9.84635 11.2968 10.0395C11.2968 10.2326 11.4525 10.3883 11.6456 10.3883H12.0174C12.471 10.3883 12.8861 10.1319 13.089 9.72622C13.0918 9.72058 13.092 9.71706 13.0918 9.71456C13.0916 9.71126 13.0905 9.70687 13.0877 9.70233C13.0849 9.69779 13.0815 9.69483 13.0787 9.69321C13.0766 9.692 13.0735 9.69063 13.0673 9.69063H11.6456ZM10.6968 10.0395C10.6968 9.51497 11.1211 9.09063 11.6456 9.09063H13.0673C13.5314 9.09063 13.8329 9.57998 13.6256 9.99455C13.3211 10.6037 12.6981 10.9883 12.0174 10.9883H11.6456C11.1211 10.9883 10.6968 10.564 10.6968 10.0395Z",fill:"#2E3841"})]})},walking:e=>{let{sx:t={},...r}=e;return a(d,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...r,children:[s("path",{d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),s("path",{d:"M6.5 14L7.99995 12.5L8.49993 10.5M8.49993 10.5L8.99991 7M8.49993 10.5L9.99988 12L10.4999 14M8.99991 7L9.99988 9.5L11.4998 10M8.99991 7L7.49996 8.5L6.99998 10.5M10.4999 5C10.4999 5.552 10.0519 6 9.4999 6C8.94791 6 8.49993 5.552 8.49993 5C8.49993 4.448 8.94791 4 9.4999 4C10.0519 4 10.4999 4.448 10.4999 5Z",stroke:"#2E3841",strokeWidth:"0.65",strokeLinecap:"round",strokeLinejoin:"round"})]})},cycling:e=>{let{sx:t={},...r}=e;return s(d,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...r,children:a("g",{id:"Method/Cycling",children:[s("path",{id:"Ellipse 287",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),s("path",{id:"bike_icon (Stroke)",fillRule:"evenodd",clipRule:"evenodd",d:"M9.85001 5C9.85001 4.83432 9.98433 4.7 10.15 4.7H11.45C11.6157 4.7 11.75 4.83432 11.75 5V6.90132L12.3293 8.63925C12.4656 8.61348 12.6062 8.6 12.75 8.6C13.9927 8.6 15 9.60727 15 10.85C15 12.0927 13.9927 13.1 12.75 13.1C11.5073 13.1 10.5 12.0927 10.5 10.85C10.5 9.96249 11.0137 9.19508 11.7601 8.82887L11.3398 7.56801L9.08427 10.3874C9.0381 10.4451 8.97224 10.4838 8.89933 10.4959L7.19892 10.7793C7.19965 10.8028 7.20001 10.8264 7.20001 10.85C7.20001 12.0927 6.19275 13.1 4.95001 13.1C3.70728 13.1 2.70001 12.0927 2.70001 10.85C2.70001 9.60727 3.70728 8.6 4.95001 8.6C4.97366 8.6 4.99722 8.60037 5.02069 8.60109L5.30409 6.90068C5.3282 6.75602 5.45336 6.65 5.60001 6.65H11.15V5.3H10.15C9.98433 5.3 9.85001 5.16569 9.85001 5ZM10.8258 7.25H6.32428L8.82514 9.75086L10.8258 7.25ZM8.22567 9.99992L5.80009 7.57435L5.61263 8.69914C6.32244 8.91752 6.8825 9.47758 7.10088 10.1874L8.22567 9.99992ZM6.50159 10.2873C6.33525 9.82864 5.97137 9.46477 5.51275 9.29842L5.31498 10.485L6.50159 10.2873ZM4.92083 9.20025C4.02293 9.21582 3.30001 9.94838 3.30001 10.85C3.30001 11.7614 4.03865 12.5 4.95001 12.5C5.85163 12.5 6.58419 11.7771 6.59976 10.8792L4.99933 11.1459C4.90376 11.1618 4.80639 11.1306 4.73788 11.0621C4.66937 10.9936 4.63817 10.8962 4.65409 10.8007L4.92083 9.20025ZM11.9522 9.4053C11.444 9.68649 11.1 10.228 11.1 10.85C11.1 11.7614 11.8386 12.5 12.75 12.5C13.6614 12.5 14.4 11.7614 14.4 10.85C14.4 9.93864 13.6614 9.2 12.75 9.2C12.6725 9.2 12.5962 9.20535 12.5215 9.2157L13.0346 10.7551C13.087 10.9123 13.0021 11.0822 12.8449 11.1346C12.6877 11.187 12.5178 11.1021 12.4654 10.9449L11.9522 9.4053Z",fill:"#2E3841"})]})})}},qa=[{icon:Ft,id:Za.driving},{icon:Bt,id:Za.public_transport},{icon:jt,id:Za.walking},{icon:Rt,id:Za.cycling}],Qa=(e,t)=>{switch(e){case Za.cycling:case Za.driving:return{width:"35px",height:"auto",...t&&{path:{fill:"white"}}};case Za.public_transport:return{width:"auto",height:"36px",...t&&{"#Vector_8, #Vector_9, #Vector_10, #Vector_11":{fill:"white"},path:{stroke:"white"}}};case Za.walking:return{width:"auto",height:"31px",...t&&{path:{stroke:"white"}}};default:return}},Xa=e=>{let{disableCheck:t=!1,multiple:r=!1,commute:n,variant:i,isInvalid:o,googleAutocompleteApiKey:l,onChange:c}=e;const u=he((()=>Ua(n.time)),[n.time]),h=e=>()=>{if(!r)return c({...n,methods:[e.id]});const t=n.methods.includes(e.id);t&&1===n.methods.length||c({...n,methods:t?n.methods.filter((t=>t!==e.id)):n.methods.concat(e.id)})};return a(Se,{children:[s(Va,{location:n.location,isInvalid:o,apiKey:l,onChange:e=>{c({...n,location:e})}}),a(Se,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s(Me,{variant:"h4",mb:1,mt:2,children:"Commute Time"}),u]}),s(Ee,{sx:{px:2},children:s(Be,{value:n.time,onChange:(e,t)=>{c({...n,time:t})},min:10,max:120,step:10,color:"secondary"})}),s(Me,{variant:"h4",mb:1,mt:2,children:"Commute Method(s)"}),s(Se,{direction:"row",justifyContent:"space-between",gap:.5,children:qa.map((e=>a(Ee,{sx:{position:"relative"},children:[!t&&n.methods.includes(e.id)&&s(ze,{fontSize:"small",color:"primary",sx:{position:"absolute",right:"-8px",top:"-8px",backgroundColor:"white",zIndex:1}}),s(At,{shape:"square",variant:i&&n.methods.includes(e.id)?i:"outlined",color:i?"primary":n.methods.includes(e.id)?"success":"inherit",onClick:h(e),sx:n.methods.includes(e.id)?[e=>({"&&":{borderColor:e.palette.primary.main,"&:hover":{borderColor:e.palette.primary.main}}}),n.methods.includes(e.id)&&1===n.methods.length&&{cursor:"default"}]:void 0,children:s(e.icon,{sx:Qa(e.id,n.methods.includes(e.id))})})]},e.id)))})]})},Ya=e=>{let{scrollIntoSecondCommute:t,disableCheck:r,multiple:n=!1,commutes:i,googleAutocompleteApiKey:o,onChange:l,onAdd:c,variant:u,onRemove:h,boxProps:d={}}=e;return se((()=>{if(t){const e=document.getElementById("commute-title-2");e&&setTimeout((()=>{e?.scrollIntoView({inline:"center",block:"start",behavior:"smooth"})}),0)}}),[t]),a(_,{...d,children:[s(A,{gap:"50px",children:i.map(((e,t)=>a(pe,{children:[a(_,{children:[a(A,{id:`commute-title-${t+1}`,direction:"row",justifyContent:"space-between",children:[a(Me,{variant:"h4",mb:1,children:["Commute Location ",i.length>1?t+1:""]}),i.length>0&&t>0&&s(O,{onClick:h(e),size:"small",children:s(ke,{})})]}),s(Xa,{variant:u,multiple:n,disableCheck:r,commute:e,onChange:l(e),isInvalid:!1,googleAutocompleteApiKey:o})]}),i.length>1&&t!==i.length-1&&s(k,{})]},e.id)))}),i.length<2&&s(At,{onClick:c,startIcon:s(De,{}),variant:"outlined",shape:"mrect",sx:{mt:"30px"},children:"Second Commute"})]})},$a=e=>{let{areas:t,area:r,isInvalid:n,errorText:i="Please select an area from the list",onChange:o}=e;const[a,l]=oe("");return s(je,{value:r,disableClearable:0===r.length||0===a.length,onChange:(e,t)=>{o(t??"")},inputValue:a,onInputChange:(e,t)=>{l(t)},options:t,renderInput:e=>s(Le,{...e,placeholder:"Location, borough, neighborhood, etc.",error:n,helperText:n?i:" ",FormHelperTextProps:{sx:{textAlign:"center"}}})})},Ka=e=>{let{scrollIntoArea:t=!1,index:r=0,allAreas:n,areas:i,onRemove:o,onChange:l,onAdd:c,boxProps:u={}}=e;const h=e=>t=>{l(e)(t)},d=e=>n.filter((t=>!i.some(((r,n)=>n!==e&&r.name===t))));return se((()=>{if(t){const e=document.getElementById(`area-title-${r+1}`);e&&setTimeout((()=>{e?.scrollIntoView({inline:"center",block:"start",behavior:"smooth"})}),0)}}),[t]),a(_,{...u,children:[s(A,{gap:2.5,children:i.map(((e,t)=>a(pe,{children:[a(_,{children:[a(A,{id:`area-title-${t+1}`,direction:"row",justifyContent:"space-between",children:[a(Me,{variant:"h4",mb:1,children:["Area Name ",i.length>1?t+1:""]}),i.length>0&&t>0&&s(O,{onClick:o(e),size:"small",children:s(ke,{})})]}),s($a,{areas:d(t),area:e.name,onChange:h(e)})]}),i.length>1&&t!==i.length-1&&s(k,{sx:{mb:"10px"}})]},e.id)))}),i.length<4&&s(At,{onClick:c,startIcon:s(De,{}),variant:"outlined",shape:"srect",sx:{mt:"30px"},children:"Add Area"})]})},Ja=e=>{let{title:t="See My Matches",isValid:r=!0,isSubmitting:n=!1,onSubmit:i}=e;return a(A,{position:"sticky",sx:e=>({bottom:0,background:e.palette.background.paper,borderTop:`1px solid ${e.palette.grey[300]}`,py:2,px:1,zIndex:2}),children:[s(At,{fullWidth:!0,disabled:!r||n,onClick:i,children:n?s(T,{}):t}),s(A,{direction:"row",justifyContent:"center",pt:.5,children:s(Zt,{})})]})},el=e=>{let{DialogProps:t,handleModalReject:r,handleModalResolve:n,payload:{Form:i,filters:o,...l}}=e;const c=u((e=>e.breakpoints.down("sm")));return a(z,{scroll:"body",...t,fullScreen:c,PaperProps:{sx:{position:"relative",width:"100%",maxWidth:["unset",550],height:["unset",650,550],maxHeight:"100%",pb:0,overflow:"hidden",display:"flex",flexDirection:"column"}},children:[a(B,{sx:{position:"relative",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:["center","flex-end"],padding:0,px:[1,2],pt:[2,1]},children:[a(x,{component:"div",variant:"h3",display:["initial","none"],width:"100%",textAlign:"center",children:["Filters",s(k,{sx:{mt:2}})]}),s(O,{onClick:r,size:"small",sx:e=>({[e.breakpoints.up("sm")]:{mr:e.spacing(-2)},[e.breakpoints.down("sm")]:{position:"absolute",top:0,right:0}}),children:s(be,{})})]}),s(R,{sx:{position:"relative",p:0,px:[1,2],height:"100%"},children:s(A,{gap:5,pt:3,children:s(i,{filters:o,onSubmit:e=>{n?.(e)},...l,children:e=>s(Ja,{onSubmit:e.onSubmit})})})})]})},tl=e=>{let{loading:t=!1,render:r,color:n="#fff",sx:i={}}=e;return t?s(F,{sx:{color:n,backgroundColor:"transparent",zIndex:e=>e.zIndex.drawer+1,...i},open:t,children:s(T,{color:"primary"})}):s(l,{children:r()})};class rl extends Ae{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?a(_,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",width:"100%",p:3,children:[s(_,{pb:1,children:s(tl,{color:"error",render:()=>s(d,{color:"warning",fontSize:"large",children:s(Ue,{})})})}),s(x,{gutterBottom:!0,variant:"h3",color:"error",children:"Something went wrong."}),s(x,{variant:"subtitle1",color:"error",children:"We know about the error, and are already actively working on its solution."})]}):this.props.children}}const nl=fe((function(e,t){return s(j,{direction:"up",ref:t,...e})})),il=e=>{let{modalID:t,open:r,payload:n={},ModalComponent:i,DialogProps:o,onModalResolved:a=(()=>{}),onModalRejected:l=(()=>{}),onModalExited:h=(()=>{}),fullHeight:d}=e;const p=c(),f=u(p.breakpoints.down("sm")),[m,g]=oe(r),[A,_]=oe(!1),y=e=>{g(!1),_(!1),l(e),h(t)};return se((()=>{g(r)}),[r]),s(rl,{children:s(i,{isModalEntered:A,payload:n,DialogProps:{disableEscapeKeyDown:!0,TransitionComponent:f?nl:void 0,sx:{[p.breakpoints.up("sm")]:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column","& > .MuiDialog-container":{width:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},[p.breakpoints.down("sm")]:{"& > .MuiDialog-container > .MuiPaper-root":{position:"absolute",left:0,right:0,bottom:0,m:0,[p.breakpoints.down("sm")]:{height:"100%",maxHeight:d?"auto":400},"@media (max-width: 320px)":{minHeight:436}}}},PaperProps:{elevation:0,sx:{overflow:"hidden",[p.breakpoints.up("sm")]:{borderRadius:"20px",width:483,maxWidth:483}}},...o,open:m,onClose:y,onExited:()=>{h(t),_(!1)},onEntered:()=>{_(!0)}},handleModalResolve:e=>{g(!1),_(!1),a(e),h(t)},handleModalReject:y})})},ol=ce({globalValues:null,modals:[],setGlobalValues:e=>{},updateGlobalValues:e=>{},deleteModal:e=>{},addModal:e=>{},openModal:e=>{}}),sl=e=>{let{pathname:t,children:r}=e;const n=le(0),[i,o]=oe({}),[l,c]=oe([]),u=ue((e=>{c((t=>t.filter((t=>t?.modalID!==e)))),n.current--}),[]);se((()=>{c([])}),[t]);const h={modals:l,deleteModal:u,globalValues:i,setGlobalValues:o,updateGlobalValues:e=>{o(e)},addModal:e=>{c((t=>t.concat({...e,modalID:n.current++,onModalExited:u})))},openModal:e=>{c([{...e,modalID:n.current++,onModalExited:u}])}};return a(ol.Provider,{value:h,children:[r,l?.map((e=>s(il,{open:!0,...e},e?.modalID)))]})},al=()=>ie(ol),ll=e=>{let{disableTypography:t=!1,icon:r,sx:n={},children:i,onClose:o,iconFontSize:l=30}=e;return a(_,{display:"flex",alignItems:"center",pl:[2,3,3],pr:2,sx:n,...t?{}:{component:x,fontSize:23,fontWeight:500},children:[!!i&&a(_,{display:"flex",flexGrow:1,color:"inherit",mr:1,children:[r&&s(_,{display:"flex",alignItems:"center",mr:1,children:r}),i]}),!!o&&s(S,{title:"Close modal",children:s(O,{color:"inherit",edge:"end",onClick:o,children:s(ke,{color:"inherit",sx:{fontSize:l}})})})]})},cl=e=>{let{children:t,sx:r={}}=e;return s(A,{position:"sticky",sx:{bottom:0,backgroundColor:"white",zIndex:1,...r},children:s(A,{direction:"row",alignItems:"center",justifyContent:"flex-end",gap:[1,2],py:2,sx:e=>({px:[2,3,3],borderTop:`1px solid ${e.palette.divider}`}),children:t})})},ul=e=>{let{className:t="",component:r=_,children:n,...i}=e;return s(r,{className:t,sx:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},...i,children:n})},hl=e=>{let{message:t,open:r,onClose:n}=e;const i=u((e=>e.breakpoints.down("sm")));return s(N,{open:r,onClose:n,anchorOrigin:{vertical:"top",horizontal:i?"center":"right"},message:t,action:s(l,{children:s(O,{color:"inherit",sx:{p:.5},onClick:n,children:s(ke,{})})}),sx:e=>({".MuiSnackbarContent-root":{backgroundColor:e.palette.text.secondary,alignItems:"flex-start",flexWrap:"nowrap"}})})};var dl={exports:{}};dl.exports=function(){var e,t,r;function n(n,i){if(e)if(t){var o="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 = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",s={};e(s),r=i(s),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=i;else e=i}return n(["exports"],(function(e){var t="3.4.0";let r;const n={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==r){const e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{r=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):e}catch(t){r=e}}return r},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(!n.API_URL)return null;try{const e=new URL(n.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"};function i(e){return n.API_URL_REGEX.test(e)}function o(e){return 0===e.indexOf("mapbox:")}function s(e){return n.API_CDN_URL_REGEX.test(e)}function a(e){return n.API_SPRITE_REGEX.test(e)}function l(e){return n.API_STYLE_REGEX.test(e)&&!a(e)}const c={create:"create",load:"load",fullLoad:"fullLoad"};function u(e){const t=e.name.split("?")[0];return s(t)&&t.includes("mapbox-gl.js")?"javascript":s(t)&&t.includes("mapbox-gl.css")?"css":function(e){return n.API_FONTS_REGEX.test(e)}(t)?"fontRange":a(t)?"sprite":l(t)?"style":function(e){return n.API_TILEJSON_REGEX.test(e)}(t)?"tilejson":"other"}function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={},p={};Object.defineProperty(p,"__esModule",{value:!0}),p.setMatrixArrayType=function(e){p.ARRAY_TYPE=m=e},p.toRadian=function(e){return e*A},p.equals=function(e,t){return Math.abs(e-t)<=f*Math.max(1,Math.abs(e),Math.abs(t))},p.RANDOM=p.ARRAY_TYPE=p.EPSILON=void 0;var f=1e-6;p.EPSILON=f;var m="undefined"!=typeof Float32Array?Float32Array:Array;p.ARRAY_TYPE=m;var g=Math.random;p.RANDOM=g;var A=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var _={};function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}Object.defineProperty(_,"__esModule",{value:!0}),_.create=function(){var e=new v.ARRAY_TYPE(4);return v.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},_.clone=function(e){var t=new v.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},_.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},_.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},_.fromValues=function(e,t,r,n){var i=new v.ARRAY_TYPE(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i},_.set=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e},_.transpose=function(e,t){if(e===t){var r=t[1];e[1]=t[2],e[2]=r}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},_.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=r*o-i*n;return s?(e[0]=o*(s=1/s),e[1]=-n*s,e[2]=-i*s,e[3]=r*s,e):null},_.adjoint=function(e,t){var r=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=r,e},_.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},_.multiply=b,_.rotate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l+o*a,e[1]=i*l+s*a,e[2]=n*-a+o*l,e[3]=i*-a+s*l,e},_.scale=function(e,t,r){var n=t[1],i=t[2],o=t[3],s=r[0],a=r[1];return e[0]=t[0]*s,e[1]=n*s,e[2]=i*a,e[3]=o*a,e},_.fromRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e},_.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e},_.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},_.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},_.LDU=function(e,t,r,n){return e[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-e[2]*r[1],[e,t,r]},_.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},_.subtract=w,_.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},_.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=t[0],a=t[1],l=t[2],c=t[3];return Math.abs(r-s)<=v.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-a)<=v.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-l)<=v.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-c)<=v.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},_.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},_.multiplyScalarAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e},_.sub=_.mul=void 0;var v=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==y(e)&&"function"!=typeof e)return{default:e};var r=x(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(x=function(e){return e?r:t})(e)}function b(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*a+o*l,e[1]=i*a+s*l,e[2]=n*c+o*u,e[3]=i*c+s*u,e}function w(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}_.mul=b,_.sub=w;var C={};function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}Object.defineProperty(C,"__esModule",{value:!0}),C.create=function(){var e=new T.ARRAY_TYPE(6);return T.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e},C.clone=function(e){var t=new T.ARRAY_TYPE(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},C.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},C.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},C.fromValues=function(e,t,r,n,i,o){var s=new T.ARRAY_TYPE(6);return s[0]=e,s[1]=t,s[2]=r,s[3]=n,s[4]=i,s[5]=o,s},C.set=function(e,t,r,n,i,o,s){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=o,e[5]=s,e},C.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=r*o-n*i;return l?(e[0]=o*(l=1/l),e[1]=-n*l,e[2]=-i*l,e[3]=r*l,e[4]=(i*a-o*s)*l,e[5]=(n*s-r*a)*l,e):null},C.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},C.multiply=M,C.rotate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*c,e[1]=i*u+s*c,e[2]=n*-c+o*u,e[3]=i*-c+s*u,e[4]=a,e[5]=l,e},C.scale=function(e,t,r){var n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=r[0],c=r[1];return e[0]=t[0]*l,e[1]=n*l,e[2]=i*c,e[3]=o*c,e[4]=s,e[5]=a,e},C.translate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=r[0],u=r[1];return e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=n*c+o*u+a,e[5]=i*c+s*u+l,e},C.fromRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e[4]=0,e[5]=0,e},C.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e},C.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e},C.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},C.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)},C.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e},C.subtract=I,C.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e},C.multiplyScalarAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e},C.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]},C.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=t[0],c=t[1],u=t[2],h=t[3],d=t[4],p=t[5];return Math.abs(r-l)<=T.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-c)<=T.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=T.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=T.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=T.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-p)<=T.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))},C.sub=C.mul=void 0;var T=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==E(e)&&"function"!=typeof e)return{default:e};var r=S(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(S=function(e){return e?r:t})(e)}function M(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=r[0],u=r[1],h=r[2],d=r[3],p=r[4],f=r[5];return e[0]=n*c+o*u,e[1]=i*c+s*u,e[2]=n*h+o*d,e[3]=i*h+s*d,e[4]=n*p+o*f+a,e[5]=i*p+s*f+l,e}function I(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e}C.mul=M,C.sub=I;var P={};function L(e){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(e)}Object.defineProperty(P,"__esModule",{value:!0}),P.create=function(){var e=new O.ARRAY_TYPE(9);return O.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},P.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},P.clone=function(e){var t=new O.ARRAY_TYPE(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},P.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},P.fromValues=function(e,t,r,n,i,o,s,a,l){var c=new O.ARRAY_TYPE(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=n,c[4]=i,c[5]=o,c[6]=s,c[7]=a,c[8]=l,c},P.set=function(e,t,r,n,i,o,s,a,l,c){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e},P.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},P.transpose=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},P.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*s-a*c,d=-u*o+a*l,p=c*o-s*l,f=r*h+n*d+i*p;return f?(e[0]=h*(f=1/f),e[1]=(-u*n+i*c)*f,e[2]=(a*n-i*s)*f,e[3]=d*f,e[4]=(u*r-i*l)*f,e[5]=(-a*r+i*o)*f,e[6]=p*f,e[7]=(-c*r+n*l)*f,e[8]=(s*r-n*o)*f,e):null},P.adjoint=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e[0]=s*u-a*c,e[1]=i*c-n*u,e[2]=n*a-i*s,e[3]=a*l-o*u,e[4]=r*u-i*l,e[5]=i*o-r*a,e[6]=o*c-s*l,e[7]=n*l-r*c,e[8]=r*s-n*o,e},P.determinant=function(e){var t=e[3],r=e[4],n=e[5],i=e[6],o=e[7],s=e[8];return e[0]*(s*r-n*o)+e[1]*(-s*t+n*i)+e[2]*(o*t-r*i)},P.multiply=k,P.translate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=r[0],p=r[1];return e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=d*n+p*s+c,e[7]=d*i+p*a+u,e[8]=d*o+p*l+h,e},P.rotate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=Math.sin(r),p=Math.cos(r);return e[0]=p*n+d*s,e[1]=p*i+d*a,e[2]=p*o+d*l,e[3]=p*s-d*n,e[4]=p*a-d*i,e[5]=p*l-d*o,e[6]=c,e[7]=u,e[8]=h,e},P.scale=function(e,t,r){var n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},P.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},P.fromRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},P.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},P.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},P.fromQuat=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,l=i+i,c=r*s,u=n*s,h=n*a,d=i*s,p=i*a,f=i*l,m=o*s,g=o*a,A=o*l;return e[0]=1-h-f,e[3]=u-A,e[6]=d+g,e[1]=u+A,e[4]=1-c-f,e[7]=p-m,e[2]=d-g,e[5]=p+m,e[8]=1-c-h,e},P.normalFromMat4=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15],_=r*a-n*s,y=r*l-i*s,v=r*c-o*s,x=n*l-i*a,b=n*c-o*a,w=i*c-o*l,C=u*m-h*f,E=u*g-d*f,T=u*A-p*f,S=h*g-d*m,M=h*A-p*m,I=d*A-p*g,P=_*I-y*M+v*S+x*T-b*E+w*C;return P?(e[0]=(a*I-l*M+c*S)*(P=1/P),e[1]=(l*T-s*I-c*E)*P,e[2]=(s*M-a*T+c*C)*P,e[3]=(i*M-n*I-o*S)*P,e[4]=(r*I-i*T+o*E)*P,e[5]=(n*T-r*M-o*C)*P,e[6]=(m*w-g*b+A*x)*P,e[7]=(g*v-f*w-A*y)*P,e[8]=(f*b-m*v+A*_)*P,e):null},P.projection=function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},P.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},P.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},P.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},P.subtract=z,P.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},P.multiplyScalarAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e},P.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},P.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=t[0],d=t[1],p=t[2],f=t[3],m=t[4],g=t[5],A=t[6],_=t[7],y=t[8];return Math.abs(r-h)<=O.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-d)<=O.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-p)<=O.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-f)<=O.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-m)<=O.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-g)<=O.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(l-A)<=O.EPSILON*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(c-_)<=O.EPSILON*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-y)<=O.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))},P.sub=P.mul=void 0;var O=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==L(e)&&"function"!=typeof e)return{default:e};var r=D(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(D=function(e){return e?r:t})(e)}function k(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=r[0],p=r[1],f=r[2],m=r[3],g=r[4],A=r[5],_=r[6],y=r[7],v=r[8];return e[0]=d*n+p*s+f*c,e[1]=d*i+p*a+f*u,e[2]=d*o+p*l+f*h,e[3]=m*n+g*s+A*c,e[4]=m*i+g*a+A*u,e[5]=m*o+g*l+A*h,e[6]=_*n+y*s+v*c,e[7]=_*i+y*a+v*u,e[8]=_*o+y*l+v*h,e}function z(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}P.mul=k,P.sub=z;var B={};function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}Object.defineProperty(B,"__esModule",{value:!0}),B.create=function(){var e=new F.ARRAY_TYPE(16);return F.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},B.clone=function(e){var t=new F.ARRAY_TYPE(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},B.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},B.fromValues=function(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m){var g=new F.ARRAY_TYPE(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=i,g[5]=o,g[6]=s,g[7]=a,g[8]=l,g[9]=c,g[10]=u,g[11]=h,g[12]=d,g[13]=p,g[14]=f,g[15]=m,g},B.set=function(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e[9]=u,e[10]=h,e[11]=d,e[12]=p,e[13]=f,e[14]=m,e[15]=g,e},B.identity=N,B.transpose=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},B.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15],_=r*a-n*s,y=r*l-i*s,v=r*c-o*s,x=n*l-i*a,b=n*c-o*a,w=i*c-o*l,C=u*m-h*f,E=u*g-d*f,T=u*A-p*f,S=h*g-d*m,M=h*A-p*m,I=d*A-p*g,P=_*I-y*M+v*S+x*T-b*E+w*C;return P?(e[0]=(a*I-l*M+c*S)*(P=1/P),e[1]=(i*M-n*I-o*S)*P,e[2]=(m*w-g*b+A*x)*P,e[3]=(d*b-h*w-p*x)*P,e[4]=(l*T-s*I-c*E)*P,e[5]=(r*I-i*T+o*E)*P,e[6]=(g*v-f*w-A*y)*P,e[7]=(u*w-d*v+p*y)*P,e[8]=(s*M-a*T+c*C)*P,e[9]=(n*T-r*M-o*C)*P,e[10]=(f*b-m*v+A*_)*P,e[11]=(h*v-u*b-p*_)*P,e[12]=(a*E-s*S-l*C)*P,e[13]=(r*S-n*E+i*C)*P,e[14]=(m*y-f*x-g*_)*P,e[15]=(u*x-h*y+d*_)*P,e):null},B.adjoint=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15];return e[0]=a*(d*A-p*g)-h*(l*A-c*g)+m*(l*p-c*d),e[1]=-(n*(d*A-p*g)-h*(i*A-o*g)+m*(i*p-o*d)),e[2]=n*(l*A-c*g)-a*(i*A-o*g)+m*(i*c-o*l),e[3]=-(n*(l*p-c*d)-a*(i*p-o*d)+h*(i*c-o*l)),e[4]=-(s*(d*A-p*g)-u*(l*A-c*g)+f*(l*p-c*d)),e[5]=r*(d*A-p*g)-u*(i*A-o*g)+f*(i*p-o*d),e[6]=-(r*(l*A-c*g)-s*(i*A-o*g)+f*(i*c-o*l)),e[7]=r*(l*p-c*d)-s*(i*p-o*d)+u*(i*c-o*l),e[8]=s*(h*A-p*m)-u*(a*A-c*m)+f*(a*p-c*h),e[9]=-(r*(h*A-p*m)-u*(n*A-o*m)+f*(n*p-o*h)),e[10]=r*(a*A-c*m)-s*(n*A-o*m)+f*(n*c-o*a),e[11]=-(r*(a*p-c*h)-s*(n*p-o*h)+u*(n*c-o*a)),e[12]=-(s*(h*g-d*m)-u*(a*g-l*m)+f*(a*d-l*h)),e[13]=r*(h*g-d*m)-u*(n*g-i*m)+f*(n*d-i*h),e[14]=-(r*(a*g-l*m)-s*(n*g-i*m)+f*(n*l-i*a)),e[15]=r*(a*d-l*h)-s*(n*d-i*h)+u*(n*l-i*a),e},B.determinant=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15];return(t*s-r*o)*(h*g-d*m)-(t*a-n*o)*(u*g-d*f)+(t*l-i*o)*(u*m-h*f)+(r*a-n*s)*(c*g-d*p)-(r*l-i*s)*(c*m-h*p)+(n*l-i*a)*(c*f-u*p)},B.multiply=V,B.translate=function(e,t,r){var n,i,o,s,a,l,c,u,h,d,p,f,m=r[0],g=r[1],A=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*A+t[12],e[13]=t[1]*m+t[5]*g+t[9]*A+t[13],e[14]=t[2]*m+t[6]*g+t[10]*A+t[14],e[15]=t[3]*m+t[7]*g+t[11]*A+t[15]):(i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=n=t[0],e[1]=i,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=n*m+a*g+h*A+t[12],e[13]=i*m+l*g+d*A+t[13],e[14]=o*m+c*g+p*A+t[14],e[15]=s*m+u*g+f*A+t[15]),e},B.scale=function(e,t,r){var n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},B.rotate=function(e,t,r,n){var i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x,b,w,C,E,T,S,M=n[0],I=n[1],P=n[2],L=Math.hypot(M,I,P);return L<F.EPSILON?null:(M*=L=1/L,I*=L,P*=L,i=Math.sin(r),o=Math.cos(r),l=t[1],c=t[2],u=t[3],d=t[5],p=t[6],f=t[7],g=t[9],A=t[10],_=t[11],y=M*M*(s=1-o)+o,b=M*I*s-P*i,w=I*I*s+o,C=P*I*s+M*i,E=M*P*s+I*i,T=I*P*s-M*i,S=P*P*s+o,e[0]=(a=t[0])*y+(h=t[4])*(v=I*M*s+P*i)+(m=t[8])*(x=P*M*s-I*i),e[1]=l*y+d*v+g*x,e[2]=c*y+p*v+A*x,e[3]=u*y+f*v+_*x,e[4]=a*b+h*w+m*C,e[5]=l*b+d*w+g*C,e[6]=c*b+p*w+A*C,e[7]=u*b+f*w+_*C,e[8]=a*E+h*T+m*S,e[9]=l*E+d*T+g*S,e[10]=c*E+p*T+A*S,e[11]=u*E+f*T+_*S,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},B.rotateX=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*n,e[5]=s*i+u*n,e[6]=a*i+h*n,e[7]=l*i+d*n,e[8]=c*i-o*n,e[9]=u*i-s*n,e[10]=h*i-a*n,e[11]=d*i-l*n,e},B.rotateY=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*n,e[1]=s*i-u*n,e[2]=a*i-h*n,e[3]=l*i-d*n,e[8]=o*n+c*i,e[9]=s*n+u*i,e[10]=a*n+h*i,e[11]=l*n+d*i,e},B.rotateZ=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*n,e[1]=s*i+u*n,e[2]=a*i+h*n,e[3]=l*i+d*n,e[4]=c*i-o*n,e[5]=u*i-s*n,e[6]=h*i-a*n,e[7]=d*i-l*n,e},B.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e},B.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromRotation=function(e,t,r){var n,i,o,s=r[0],a=r[1],l=r[2],c=Math.hypot(s,a,l);return c<F.EPSILON?null:(s*=c=1/c,a*=c,l*=c,n=Math.sin(t),i=Math.cos(t),e[0]=s*s*(o=1-i)+i,e[1]=a*s*o+l*n,e[2]=l*s*o-a*n,e[3]=0,e[4]=s*a*o-l*n,e[5]=a*a*o+i,e[6]=l*a*o+s*n,e[7]=0,e[8]=s*l*o+a*n,e[9]=a*l*o-s*n,e[10]=l*l*o+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)},B.fromXRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromYRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromZRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromRotationTranslation=U,B.fromQuat2=function(e,t){var r=new F.ARRAY_TYPE(3),n=-t[0],i=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=n*n+i*i+o*o+s*s;return h>0?(r[0]=2*(a*s+u*n+l*o-c*i)/h,r[1]=2*(l*s+u*i+c*n-a*o)/h,r[2]=2*(c*s+u*o+a*i-l*n)/h):(r[0]=2*(a*s+u*n+l*o-c*i),r[1]=2*(l*s+u*i+c*n-a*o),r[2]=2*(c*s+u*o+a*i-l*n)),U(e,t,r),e},B.getTranslation=function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e},B.getScaling=H,B.getRotation=function(e,t){var r=new F.ARRAY_TYPE(3);H(r,t);var n=1/r[0],i=1/r[1],o=1/r[2],s=t[0]*n,a=t[1]*i,l=t[2]*o,c=t[4]*n,u=t[5]*i,h=t[6]*o,d=t[8]*n,p=t[9]*i,f=t[10]*o,m=s+u+f,g=0;return m>0?(g=2*Math.sqrt(m+1),e[3]=.25*g,e[0]=(h-p)/g,e[1]=(d-l)/g,e[2]=(a-c)/g):s>u&&s>f?(g=2*Math.sqrt(1+s-u-f),e[3]=(h-p)/g,e[0]=.25*g,e[1]=(a+c)/g,e[2]=(d+l)/g):u>f?(g=2*Math.sqrt(1+u-s-f),e[3]=(d-l)/g,e[0]=(a+c)/g,e[1]=.25*g,e[2]=(h+p)/g):(g=2*Math.sqrt(1+f-s-u),e[3]=(a-c)/g,e[0]=(d+l)/g,e[1]=(h+p)/g,e[2]=.25*g),e},B.fromRotationTranslationScale=function(e,t,r,n){var i=t[0],o=t[1],s=t[2],a=t[3],l=i+i,c=o+o,u=s+s,h=i*l,d=i*c,p=i*u,f=o*c,m=o*u,g=s*u,A=a*l,_=a*c,y=a*u,v=n[0],x=n[1],b=n[2];return e[0]=(1-(f+g))*v,e[1]=(d+y)*v,e[2]=(p-_)*v,e[3]=0,e[4]=(d-y)*x,e[5]=(1-(h+g))*x,e[6]=(m+A)*x,e[7]=0,e[8]=(p+_)*b,e[9]=(m-A)*b,e[10]=(1-(h+f))*b,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e},B.fromRotationTranslationScaleOrigin=function(e,t,r,n,i){var o=t[0],s=t[1],a=t[2],l=t[3],c=o+o,u=s+s,h=a+a,d=o*c,p=o*u,f=o*h,m=s*u,g=s*h,A=a*h,_=l*c,y=l*u,v=l*h,x=n[0],b=n[1],w=n[2],C=i[0],E=i[1],T=i[2],S=(1-(m+A))*x,M=(p+v)*x,I=(f-y)*x,P=(p-v)*b,L=(1-(d+A))*b,O=(g+_)*b,D=(f+y)*w,k=(g-_)*w,z=(1-(d+m))*w;return e[0]=S,e[1]=M,e[2]=I,e[3]=0,e[4]=P,e[5]=L,e[6]=O,e[7]=0,e[8]=D,e[9]=k,e[10]=z,e[11]=0,e[12]=r[0]+C-(S*C+P*E+D*T),e[13]=r[1]+E-(M*C+L*E+k*T),e[14]=r[2]+T-(I*C+O*E+z*T),e[15]=1,e},B.fromQuat=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,l=i+i,c=r*s,u=n*s,h=n*a,d=i*s,p=i*a,f=i*l,m=o*s,g=o*a,A=o*l;return e[0]=1-h-f,e[1]=u+A,e[2]=d-g,e[3]=0,e[4]=u-A,e[5]=1-c-f,e[6]=p+m,e[7]=0,e[8]=d+g,e[9]=p-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.frustum=function(e,t,r,n,i,o,s){var a=1/(r-t),l=1/(i-n),c=1/(o-s);return e[0]=2*o*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(i+n)*l,e[10]=(s+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*c,e[15]=0,e},B.perspectiveNO=G,B.perspectiveZO=function(e,t,r,n,i){var o,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=i*(o=1/(n-i)),e[14]=i*n*o):(e[10]=-1,e[14]=-n),e},B.perspectiveFromFieldOfView=function(e,t,r,n){var i=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),l=2/(s+a),c=2/(i+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(s-a)*l*.5,e[9]=(i-o)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e},B.orthoNO=Z,B.orthoZO=function(e,t,r,n,i,o,s){var a=1/(t-r),l=1/(n-i),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+r)*a,e[13]=(i+n)*l,e[14]=o*c,e[15]=1,e},B.lookAt=function(e,t,r,n){var i,o,s,a,l,c,u,h,d,p,f=t[0],m=t[1],g=t[2],A=n[0],_=n[1],y=n[2],v=r[0],x=r[1],b=r[2];return Math.abs(f-v)<F.EPSILON&&Math.abs(m-x)<F.EPSILON&&Math.abs(g-b)<F.EPSILON?N(e):(u=f-v,h=m-x,d=g-b,i=_*(d*=p=1/Math.hypot(u,h,d))-y*(h*=p),o=y*(u*=p)-A*d,s=A*h-_*u,(p=Math.hypot(i,o,s))?(i*=p=1/p,o*=p,s*=p):(i=0,o=0,s=0),a=h*s-d*o,l=d*i-u*s,c=u*o-h*i,(p=Math.hypot(a,l,c))?(a*=p=1/p,l*=p,c*=p):(a=0,l=0,c=0),e[0]=i,e[1]=a,e[2]=u,e[3]=0,e[4]=o,e[5]=l,e[6]=h,e[7]=0,e[8]=s,e[9]=c,e[10]=d,e[11]=0,e[12]=-(i*f+o*m+s*g),e[13]=-(a*f+l*m+c*g),e[14]=-(u*f+h*m+d*g),e[15]=1,e)},B.targetTo=function(e,t,r,n){var i=t[0],o=t[1],s=t[2],a=n[0],l=n[1],c=n[2],u=i-r[0],h=o-r[1],d=s-r[2],p=u*u+h*h+d*d;p>0&&(u*=p=1/Math.sqrt(p),h*=p,d*=p);var f=l*d-c*h,m=c*u-a*d,g=a*h-l*u;return(p=f*f+m*m+g*g)>0&&(f*=p=1/Math.sqrt(p),m*=p,g*=p),e[0]=f,e[1]=m,e[2]=g,e[3]=0,e[4]=h*g-d*m,e[5]=d*f-u*g,e[6]=u*m-h*f,e[7]=0,e[8]=u,e[9]=h,e[10]=d,e[11]=0,e[12]=i,e[13]=o,e[14]=s,e[15]=1,e},B.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},B.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},B.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e},B.subtract=W,B.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e},B.multiplyScalarAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e},B.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},B.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],A=e[15],_=t[0],y=t[1],v=t[2],x=t[3],b=t[4],w=t[5],C=t[6],E=t[7],T=t[8],S=t[9],M=t[10],I=t[11],P=t[12],L=t[13],O=t[14],D=t[15];return Math.abs(r-_)<=F.EPSILON*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(n-y)<=F.EPSILON*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-v)<=F.EPSILON*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(o-x)<=F.EPSILON*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(s-b)<=F.EPSILON*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-w)<=F.EPSILON*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(l-C)<=F.EPSILON*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(c-E)<=F.EPSILON*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(u-T)<=F.EPSILON*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(h-S)<=F.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(d-M)<=F.EPSILON*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(p-I)<=F.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(f-P)<=F.EPSILON*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(m-L)<=F.EPSILON*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(g-O)<=F.EPSILON*Math.max(1,Math.abs(g),Math.abs(O))&&Math.abs(A-D)<=F.EPSILON*Math.max(1,Math.abs(A),Math.abs(D))},B.sub=B.mul=B.ortho=B.perspective=void 0;var F=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==R(e)&&"function"!=typeof e)return{default:e};var r=j(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function j(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(j=function(e){return e?r:t})(e)}function N(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function V(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],m=t[12],g=t[13],A=t[14],_=t[15],y=r[0],v=r[1],x=r[2],b=r[3];return e[0]=y*n+v*a+x*h+b*m,e[1]=y*i+v*l+x*d+b*g,e[2]=y*o+v*c+x*p+b*A,e[3]=y*s+v*u+x*f+b*_,e[4]=(y=r[4])*n+(v=r[5])*a+(x=r[6])*h+(b=r[7])*m,e[5]=y*i+v*l+x*d+b*g,e[6]=y*o+v*c+x*p+b*A,e[7]=y*s+v*u+x*f+b*_,e[8]=(y=r[8])*n+(v=r[9])*a+(x=r[10])*h+(b=r[11])*m,e[9]=y*i+v*l+x*d+b*g,e[10]=y*o+v*c+x*p+b*A,e[11]=y*s+v*u+x*f+b*_,e[12]=(y=r[12])*n+(v=r[13])*a+(x=r[14])*h+(b=r[15])*m,e[13]=y*i+v*l+x*d+b*g,e[14]=y*o+v*c+x*p+b*A,e[15]=y*s+v*u+x*f+b*_,e}function U(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=n+n,l=i+i,c=o+o,u=n*a,h=n*l,d=n*c,p=i*l,f=i*c,m=o*c,g=s*a,A=s*l,_=s*c;return e[0]=1-(p+m),e[1]=h+_,e[2]=d-A,e[3]=0,e[4]=h-_,e[5]=1-(u+m),e[6]=f+g,e[7]=0,e[8]=d+A,e[9]=f-g,e[10]=1-(u+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function H(e,t){var r=t[4],n=t[5],i=t[6],o=t[8],s=t[9],a=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(r,n,i),e[2]=Math.hypot(o,s,a),e}function G(e,t,r,n,i){var o,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+n)*(o=1/(n-i)),e[14]=2*i*n*o):(e[10]=-1,e[14]=-2*n),e}function Z(e,t,r,n,i,o,s){var a=1/(t-r),l=1/(n-i),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*a,e[13]=(i+n)*l,e[14]=(s+o)*c,e[15]=1,e}function W(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}B.perspective=G,B.ortho=Z,B.mul=V,B.sub=W;var q={},Q={};function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}Object.defineProperty(Q,"__esModule",{value:!0}),Q.create=K,Q.clone=function(e){var t=new Y.ARRAY_TYPE(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},Q.length=J,Q.fromValues=function(e,t,r){var n=new Y.ARRAY_TYPE(3);return n[0]=e,n[1]=t,n[2]=r,n},Q.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},Q.set=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e},Q.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},Q.subtract=ee,Q.multiply=te,Q.divide=re,Q.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},Q.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},Q.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e},Q.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e},Q.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},Q.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},Q.scaleAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e},Q.distance=ne,Q.squaredDistance=ie,Q.squaredLength=oe,Q.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},Q.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},Q.normalize=function(e,t){var r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e},Q.dot=se,Q.cross=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=r[0],a=r[1],l=r[2];return e[0]=i*l-o*a,e[1]=o*s-n*l,e[2]=n*a-i*s,e},Q.lerp=function(e,t,r,n){var i=t[0],o=t[1],s=t[2];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=s+n*(r[2]-s),e},Q.hermite=function(e,t,r,n,i,o){var s=o*o,a=s*(2*o-3)+1,l=s*(o-2)+o,c=s*(o-1),u=s*(3-2*o);return e[0]=t[0]*a+r[0]*l+n[0]*c+i[0]*u,e[1]=t[1]*a+r[1]*l+n[1]*c+i[1]*u,e[2]=t[2]*a+r[2]*l+n[2]*c+i[2]*u,e},Q.bezier=function(e,t,r,n,i,o){var s=1-o,a=s*s,l=o*o,c=a*s,u=3*o*a,h=3*l*s,d=l*o;return e[0]=t[0]*c+r[0]*u+n[0]*h+i[0]*d,e[1]=t[1]*c+r[1]*u+n[1]*h+i[1]*d,e[2]=t[2]*c+r[2]*u+n[2]*h+i[2]*d,e},Q.random=function(e,t){t=t||1;var r=2*Y.RANDOM()*Math.PI,n=2*Y.RANDOM()-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e},Q.transformMat4=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/(s=s||1),e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,e},Q.transformMat3=function(e,t,r){var n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e},Q.transformQuat=function(e,t,r){var n=r[0],i=r[1],o=r[2],s=t[0],a=t[1],l=t[2],c=i*l-o*a,u=o*s-n*l,h=n*a-i*s,d=i*h-o*u,p=o*c-n*h,f=n*u-i*c,m=2*r[3];return u*=m,h*=m,p*=2,f*=2,e[0]=s+(c*=m)+(d*=2),e[1]=a+u+p,e[2]=l+h+f,e},Q.rotateX=function(e,t,r,n){var i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},Q.rotateY=function(e,t,r,n){var i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},Q.rotateZ=function(e,t,r,n){var i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},Q.angle=function(e,t){var r=e[0],n=e[1],i=e[2],o=t[0],s=t[1],a=t[2],l=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+s*s+a*a),c=l&&se(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))},Q.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e},Q.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},Q.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},Q.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=t[0],s=t[1],a=t[2];return Math.abs(r-o)<=Y.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=Y.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-a)<=Y.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))},Q.forEach=Q.sqrLen=Q.len=Q.sqrDist=Q.dist=Q.div=Q.mul=Q.sub=void 0;var Y=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==X(e)&&"function"!=typeof e)return{default:e};var r=$(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function $(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return($=function(e){return e?r:t})(e)}function K(){var e=new Y.ARRAY_TYPE(3);return Y.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function J(e){return Math.hypot(e[0],e[1],e[2])}function ee(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function te(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function re(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function ne(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])}function ie(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function oe(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function se(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}Q.sub=ee,Q.mul=te,Q.div=re,Q.dist=ne,Q.sqrDist=ie,Q.len=J,Q.sqrLen=oe;var ae,le=(ae=K(),function(e,t,r,n,i,o){var s,a;for(t||(t=3),r||(r=0),a=n?Math.min(n*t+r,e.length):e.length,s=r;s<a;s+=t)ae[0]=e[s],ae[1]=e[s+1],ae[2]=e[s+2],i(ae,ae,o),e[s]=ae[0],e[s+1]=ae[1],e[s+2]=ae[2];return e});Q.forEach=le;var ce={};function ue(e){return ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(e)}Object.defineProperty(ce,"__esModule",{value:!0}),ce.create=pe,ce.clone=function(e){var t=new he.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ce.fromValues=function(e,t,r,n){var i=new he.ARRAY_TYPE(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i},ce.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},ce.set=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e},ce.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},ce.subtract=fe,ce.multiply=me,ce.divide=ge,ce.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},ce.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},ce.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e},ce.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e},ce.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e},ce.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},ce.scaleAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e},ce.distance=Ae,ce.squaredDistance=_e,ce.length=ye,ce.squaredLength=ve,ce.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},ce.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},ce.normalize=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=n*s,e[2]=i*s,e[3]=o*s,e},ce.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},ce.cross=function(e,t,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],s=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],l=r[1]*n[3]-r[3]*n[1],c=r[2]*n[3]-r[3]*n[2],u=t[0],h=t[1],d=t[2],p=t[3];return e[0]=h*c-d*l+p*a,e[1]=-u*c+d*s-p*o,e[2]=u*l-h*s+p*i,e[3]=-u*a+h*o-d*i,e},ce.lerp=function(e,t,r,n){var i=t[0],o=t[1],s=t[2],a=t[3];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=s+n*(r[2]-s),e[3]=a+n*(r[3]-a),e},ce.random=function(e,t){var r,n,i,o,s,a;t=t||1;do{s=(r=2*he.RANDOM()-1)*r+(n=2*he.RANDOM()-1)*n}while(s>=1);do{a=(i=2*he.RANDOM()-1)*i+(o=2*he.RANDOM()-1)*o}while(a>=1);var l=Math.sqrt((1-s)/a);return e[0]=t*r,e[1]=t*n,e[2]=t*i*l,e[3]=t*o*l,e},ce.transformMat4=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,e},ce.transformQuat=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=r[0],a=r[1],l=r[2],c=r[3],u=c*n+a*o-l*i,h=c*i+l*n-s*o,d=c*o+s*i-a*n,p=-s*n-a*i-l*o;return e[0]=u*c+p*-s+h*-l-d*-a,e[1]=h*c+p*-a+d*-s-u*-l,e[2]=d*c+p*-l+u*-a-h*-s,e[3]=t[3],e},ce.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},ce.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},ce.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},ce.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=t[0],a=t[1],l=t[2],c=t[3];return Math.abs(r-s)<=he.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-a)<=he.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-l)<=he.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-c)<=he.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},ce.forEach=ce.sqrLen=ce.len=ce.sqrDist=ce.dist=ce.div=ce.mul=ce.sub=void 0;var he=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==ue(e)&&"function"!=typeof e)return{default:e};var r=de(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function de(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(de=function(e){return e?r:t})(e)}function pe(){var e=new he.ARRAY_TYPE(4);return he.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function fe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function me(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function ge(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function Ae(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2],t[3]-e[3])}function _e(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return r*r+n*n+i*i+o*o}function ye(e){return Math.hypot(e[0],e[1],e[2],e[3])}function ve(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}ce.sub=fe,ce.mul=me,ce.div=ge,ce.dist=Ae,ce.sqrDist=_e,ce.len=ye,ce.sqrLen=ve;var xe=function(){var e=pe();return function(t,r,n,i,o,s){var a,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,t.length):t.length,a=n;a<l;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();function be(e){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(e)}ce.forEach=xe,Object.defineProperty(q,"__esModule",{value:!0}),q.create=Ie,q.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},q.setAxisAngle=Pe,q.getAxisAngle=function(e,t){var r=2*Math.acos(t[3]),n=Math.sin(r/2);return n>we.EPSILON?(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n):(e[0]=1,e[1]=0,e[2]=0),r},q.getAngle=function(e,t){var r=Re(e,t);return Math.acos(2*r*r-1)},q.multiply=Le,q.rotateX=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l+s*a,e[1]=i*l+o*a,e[2]=o*l-i*a,e[3]=s*l-n*a,e},q.rotateY=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l-o*a,e[1]=i*l+s*a,e[2]=o*l+n*a,e[3]=s*l-i*a,e},q.rotateZ=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l+i*a,e[1]=i*l-n*a,e[2]=o*l+s*a,e[3]=s*l-o*a,e},q.calculateW=function(e,t){var r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e},q.exp=Oe,q.ln=De,q.pow=function(e,t,r){return De(e,t),Be(e,e,r),Oe(e,e),e},q.slerp=ke,q.random=function(e){var t=we.RANDOM(),r=we.RANDOM(),n=we.RANDOM(),i=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=i*Math.sin(2*Math.PI*r),e[1]=i*Math.cos(2*Math.PI*r),e[2]=o*Math.sin(2*Math.PI*n),e[3]=o*Math.cos(2*Math.PI*n),e},q.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-i*a,e[3]=o*a,e},q.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},q.fromMat3=ze,q.fromEuler=function(e,t,r,n){var i=.5*Math.PI/180;t*=i,r*=i,n*=i;var o=Math.sin(t),s=Math.cos(t),a=Math.sin(r),l=Math.cos(r),c=Math.sin(n),u=Math.cos(n);return e[0]=o*l*u-s*a*c,e[1]=s*a*u+o*l*c,e[2]=s*l*c-o*a*u,e[3]=s*l*u+o*a*c,e},q.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},q.setAxes=q.sqlerp=q.rotationTo=q.equals=q.exactEquals=q.normalize=q.sqrLen=q.squaredLength=q.len=q.length=q.lerp=q.dot=q.scale=q.mul=q.add=q.set=q.copy=q.fromValues=q.clone=void 0;var we=Me(p),Ce=Me(P),Ee=Me(Q),Te=Me(ce);function Se(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(Se=function(e){return e?r:t})(e)}function Me(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==be(e)&&"function"!=typeof e)return{default:e};var r=Se(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function Ie(){var e=new we.ARRAY_TYPE(4);return we.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Pe(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Le(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*u+s*a+i*c-o*l,e[1]=i*u+s*l+o*a-n*c,e[2]=o*u+s*c+n*l-i*a,e[3]=s*u-n*a-i*l-o*c,e}function Oe(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=Math.sqrt(r*r+n*n+i*i),a=Math.exp(o),l=s>0?a*Math.sin(s)/s:0;return e[0]=r*l,e[1]=n*l,e[2]=i*l,e[3]=a*Math.cos(s),e}function De(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=Math.sqrt(r*r+n*n+i*i),a=s>0?Math.atan2(s,o)/s:0;return e[0]=r*a,e[1]=n*a,e[2]=i*a,e[3]=.5*Math.log(r*r+n*n+i*i+o*o),e}function ke(e,t,r,n){var i,o,s,a,l,c=t[0],u=t[1],h=t[2],d=t[3],p=r[0],f=r[1],m=r[2],g=r[3];return(o=c*p+u*f+h*m+d*g)<0&&(o=-o,p=-p,f=-f,m=-m,g=-g),1-o>we.EPSILON?(i=Math.acos(o),s=Math.sin(i),a=Math.sin((1-n)*i)/s,l=Math.sin(n*i)/s):(a=1-n,l=n),e[0]=a*c+l*p,e[1]=a*u+l*f,e[2]=a*h+l*m,e[3]=a*d+l*g,e}function ze(e,t){var r,n=t[0]+t[4]+t[8];if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,e[0]=(t[5]-t[7])*(r=.5/r),e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var o=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[3*i+i]-t[3*o+o]-t[3*s+s]+1),e[i]=.5*r,e[3]=(t[3*o+s]-t[3*s+o])*(r=.5/r),e[o]=(t[3*o+i]+t[3*i+o])*r,e[s]=(t[3*s+i]+t[3*i+s])*r}return e}q.clone=Te.clone,q.fromValues=Te.fromValues,q.copy=Te.copy,q.set=Te.set,q.add=Te.add,q.mul=Le;var Be=Te.scale;q.scale=Be;var Re=Te.dot;q.dot=Re,q.lerp=Te.lerp;var Fe=Te.length;q.length=Fe,q.len=Fe;var je=Te.squaredLength;q.squaredLength=je,q.sqrLen=je;var Ne=Te.normalize;q.normalize=Ne,q.exactEquals=Te.exactEquals,q.equals=Te.equals;var Ve,Ue,He,Ge=(Ve=Ee.create(),Ue=Ee.fromValues(1,0,0),He=Ee.fromValues(0,1,0),function(e,t,r){var n=Ee.dot(t,r);return n<-.999999?(Ee.cross(Ve,Ue,t),Ee.len(Ve)<1e-6&&Ee.cross(Ve,He,t),Ee.normalize(Ve,Ve),Pe(e,Ve,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Ee.cross(Ve,t,r),e[0]=Ve[0],e[1]=Ve[1],e[2]=Ve[2],e[3]=1+n,Ne(e,e))});q.rotationTo=Ge;var Ze,We,qe=(Ze=Ie(),We=Ie(),function(e,t,r,n,i,o){return ke(Ze,t,i,o),ke(We,r,n,o),ke(e,Ze,We,2*o*(1-o)),e});q.sqlerp=qe;var Qe,Xe=(Qe=Ce.create(),function(e,t,r,n){return Qe[0]=r[0],Qe[3]=r[1],Qe[6]=r[2],Qe[1]=n[0],Qe[4]=n[1],Qe[7]=n[2],Qe[2]=-t[0],Qe[5]=-t[1],Qe[8]=-t[2],Ne(e,ze(e,Qe))});q.setAxes=Xe;var Ye={};function $e(e){return $e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$e(e)}Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.create=function(){var e=new Ke.ARRAY_TYPE(8);return Ke.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e},Ye.clone=function(e){var t=new Ke.ARRAY_TYPE(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t},Ye.fromValues=function(e,t,r,n,i,o,s,a){var l=new Ke.ARRAY_TYPE(8);return l[0]=e,l[1]=t,l[2]=r,l[3]=n,l[4]=i,l[5]=o,l[6]=s,l[7]=a,l},Ye.fromRotationTranslationValues=function(e,t,r,n,i,o,s){var a=new Ke.ARRAY_TYPE(8);a[0]=e,a[1]=t,a[2]=r,a[3]=n;var l=.5*i,c=.5*o,u=.5*s;return a[4]=l*n+c*r-u*t,a[5]=c*n+u*e-l*r,a[6]=u*n+l*t-c*e,a[7]=-l*e-c*t-u*r,a},Ye.fromRotationTranslation=nt,Ye.fromTranslation=function(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*t[0],e[5]=.5*t[1],e[6]=.5*t[2],e[7]=0,e},Ye.fromRotation=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},Ye.fromMat4=function(e,t){var r=Je.create();et.getRotation(r,t);var n=new Ke.ARRAY_TYPE(3);return et.getTranslation(n,t),nt(e,r,n),e},Ye.copy=it,Ye.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},Ye.set=function(e,t,r,n,i,o,s,a,l){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e},Ye.getDual=function(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e},Ye.setDual=function(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e},Ye.getTranslation=function(e,t){var r=t[4],n=t[5],i=t[6],o=t[7],s=-t[0],a=-t[1],l=-t[2],c=t[3];return e[0]=2*(r*c+o*s+n*l-i*a),e[1]=2*(n*c+o*a+i*s-r*l),e[2]=2*(i*c+o*l+r*a-n*s),e},Ye.translate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=.5*r[0],l=.5*r[1],c=.5*r[2],u=t[4],h=t[5],d=t[6],p=t[7];return e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=s*a+i*c-o*l+u,e[5]=s*l+o*a-n*c+h,e[6]=s*c+n*l-i*a+d,e[7]=-n*a-i*l-o*c+p,e},Ye.rotateX=function(e,t,r){var n=-t[0],i=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*n+l*o-c*i,d=l*s+u*i+c*n-a*o,p=c*s+u*o+a*i-l*n,f=u*s-a*n-l*i-c*o;return Je.rotateX(e,t,r),e[4]=h*(s=e[3])+f*(n=e[0])+d*(o=e[2])-p*(i=e[1]),e[5]=d*s+f*i+p*n-h*o,e[6]=p*s+f*o+h*i-d*n,e[7]=f*s-h*n-d*i-p*o,e},Ye.rotateY=function(e,t,r){var n=-t[0],i=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*n+l*o-c*i,d=l*s+u*i+c*n-a*o,p=c*s+u*o+a*i-l*n,f=u*s-a*n-l*i-c*o;return Je.rotateY(e,t,r),e[4]=h*(s=e[3])+f*(n=e[0])+d*(o=e[2])-p*(i=e[1]),e[5]=d*s+f*i+p*n-h*o,e[6]=p*s+f*o+h*i-d*n,e[7]=f*s-h*n-d*i-p*o,e},Ye.rotateZ=function(e,t,r){var n=-t[0],i=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*n+l*o-c*i,d=l*s+u*i+c*n-a*o,p=c*s+u*o+a*i-l*n,f=u*s-a*n-l*i-c*o;return Je.rotateZ(e,t,r),e[4]=h*(s=e[3])+f*(n=e[0])+d*(o=e[2])-p*(i=e[1]),e[5]=d*s+f*i+p*n-h*o,e[6]=p*s+f*o+h*i-d*n,e[7]=f*s-h*n-d*i-p*o,e},Ye.rotateByQuatAppend=function(e,t,r){var n=r[0],i=r[1],o=r[2],s=r[3],a=t[0],l=t[1],c=t[2],u=t[3];return e[0]=a*s+u*n+l*o-c*i,e[1]=l*s+u*i+c*n-a*o,e[2]=c*s+u*o+a*i-l*n,e[3]=u*s-a*n-l*i-c*o,e[4]=(a=t[4])*s+(u=t[7])*n+(l=t[5])*o-(c=t[6])*i,e[5]=l*s+u*i+c*n-a*o,e[6]=c*s+u*o+a*i-l*n,e[7]=u*s-a*n-l*i-c*o,e},Ye.rotateByQuatPrepend=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*u+s*a+i*c-o*l,e[1]=i*u+s*l+o*a-n*c,e[2]=o*u+s*c+n*l-i*a,e[3]=s*u-n*a-i*l-o*c,e[4]=n*(u=r[7])+s*(a=r[4])+i*(c=r[6])-o*(l=r[5]),e[5]=i*u+s*l+o*a-n*c,e[6]=o*u+s*c+n*l-i*a,e[7]=s*u-n*a-i*l-o*c,e},Ye.rotateAroundAxis=function(e,t,r,n){if(Math.abs(n)<Ke.EPSILON)return it(e,t);var i=Math.hypot(r[0],r[1],r[2]);n*=.5;var o=Math.sin(n),s=o*r[0]/i,a=o*r[1]/i,l=o*r[2]/i,c=Math.cos(n),u=t[0],h=t[1],d=t[2],p=t[3];e[0]=u*c+p*s+h*l-d*a,e[1]=h*c+p*a+d*s-u*l,e[2]=d*c+p*l+u*a-h*s,e[3]=p*c-u*s-h*a-d*l;var f=t[4],m=t[5],g=t[6],A=t[7];return e[4]=f*c+A*s+m*l-g*a,e[5]=m*c+A*a+g*s-f*l,e[6]=g*c+A*l+f*a-m*s,e[7]=A*c-f*s-m*a-g*l,e},Ye.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e},Ye.multiply=ot,Ye.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e},Ye.lerp=function(e,t,r,n){var i=1-n;return st(t,r)<0&&(n=-n),e[0]=t[0]*i+r[0]*n,e[1]=t[1]*i+r[1]*n,e[2]=t[2]*i+r[2]*n,e[3]=t[3]*i+r[3]*n,e[4]=t[4]*i+r[4]*n,e[5]=t[5]*i+r[5]*n,e[6]=t[6]*i+r[6]*n,e[7]=t[7]*i+r[7]*n,e},Ye.invert=function(e,t){var r=lt(t);return e[0]=-t[0]/r,e[1]=-t[1]/r,e[2]=-t[2]/r,e[3]=t[3]/r,e[4]=-t[4]/r,e[5]=-t[5]/r,e[6]=-t[6]/r,e[7]=t[7]/r,e},Ye.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e},Ye.normalize=function(e,t){var r=lt(t);if(r>0){r=Math.sqrt(r);var n=t[0]/r,i=t[1]/r,o=t[2]/r,s=t[3]/r,a=t[4],l=t[5],c=t[6],u=t[7],h=n*a+i*l+o*c+s*u;e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=(a-n*h)/r,e[5]=(l-i*h)/r,e[6]=(c-o*h)/r,e[7]=(u-s*h)/r}return e},Ye.str=function(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"},Ye.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]},Ye.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=t[0],h=t[1],d=t[2],p=t[3],f=t[4],m=t[5],g=t[6],A=t[7];return Math.abs(r-u)<=Ke.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-h)<=Ke.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=Ke.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=Ke.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-f)<=Ke.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-m)<=Ke.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(l-g)<=Ke.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-A)<=Ke.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))},Ye.sqrLen=Ye.squaredLength=Ye.len=Ye.length=Ye.dot=Ye.mul=Ye.setReal=Ye.getReal=void 0;var Ke=rt(p),Je=rt(q),et=rt(B);function tt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(tt=function(e){return e?r:t})(e)}function rt(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==$e(e)&&"function"!=typeof e)return{default:e};var r=tt(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function nt(e,t,r){var n=.5*r[0],i=.5*r[1],o=.5*r[2],s=t[0],a=t[1],l=t[2],c=t[3];return e[0]=s,e[1]=a,e[2]=l,e[3]=c,e[4]=n*c+i*l-o*a,e[5]=i*c+o*s-n*l,e[6]=o*c+n*a-i*s,e[7]=-n*s-i*a-o*l,e}function it(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function ot(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=r[4],l=r[5],c=r[6],u=r[7],h=t[4],d=t[5],p=t[6],f=t[7],m=r[0],g=r[1],A=r[2],_=r[3];return e[0]=n*_+s*m+i*A-o*g,e[1]=i*_+s*g+o*m-n*A,e[2]=o*_+s*A+n*g-i*m,e[3]=s*_-n*m-i*g-o*A,e[4]=n*u+s*a+i*c-o*l+h*_+f*m+d*A-p*g,e[5]=i*u+s*l+o*a-n*c+d*_+f*g+p*m-h*A,e[6]=o*u+s*c+n*l-i*a+p*_+f*A+h*g-d*m,e[7]=s*u-n*a-i*l-o*c+f*_-h*m-d*g-p*A,e}Ye.getReal=Je.copy,Ye.setReal=Je.copy,Ye.mul=ot;var st=Je.dot;Ye.dot=st;var at=Je.length;Ye.length=at,Ye.len=at;var lt=Je.squaredLength;Ye.squaredLength=lt,Ye.sqrLen=lt;var ct={};function ut(e){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ut(e)}Object.defineProperty(ct,"__esModule",{value:!0}),ct.create=pt,ct.clone=function(e){var t=new ht.ARRAY_TYPE(2);return t[0]=e[0],t[1]=e[1],t},ct.fromValues=function(e,t){var r=new ht.ARRAY_TYPE(2);return r[0]=e,r[1]=t,r},ct.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},ct.set=function(e,t,r){return e[0]=t,e[1]=r,e},ct.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e},ct.subtract=ft,ct.multiply=mt,ct.divide=gt,ct.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e},ct.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e},ct.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e},ct.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e},ct.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e},ct.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e},ct.scaleAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e},ct.distance=At,ct.squaredDistance=_t,ct.length=yt,ct.squaredLength=vt,ct.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},ct.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},ct.normalize=function(e,t){var r=t[0],n=t[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e},ct.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},ct.cross=function(e,t,r){var n=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=n,e},ct.lerp=function(e,t,r,n){var i=t[0],o=t[1];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e},ct.random=function(e,t){t=t||1;var r=2*ht.RANDOM()*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e},ct.transformMat2=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e},ct.transformMat2d=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e},ct.transformMat3=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e},ct.transformMat4=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e},ct.rotate=function(e,t,r,n){var i=t[0]-r[0],o=t[1]-r[1],s=Math.sin(n),a=Math.cos(n);return e[0]=i*a-o*s+r[0],e[1]=i*s+o*a+r[1],e},ct.angle=function(e,t){var r=e[0],n=e[1],i=t[0],o=t[1],s=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+o*o);return Math.acos(Math.min(Math.max(s&&(r*i+n*o)/s,-1),1))},ct.zero=function(e){return e[0]=0,e[1]=0,e},ct.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},ct.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ct.equals=function(e,t){var r=e[0],n=e[1],i=t[0],o=t[1];return Math.abs(r-i)<=ht.EPSILON*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-o)<=ht.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))},ct.forEach=ct.sqrLen=ct.sqrDist=ct.dist=ct.div=ct.mul=ct.sub=ct.len=void 0;var ht=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==ut(e)&&"function"!=typeof e)return{default:e};var r=dt(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function dt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(dt=function(e){return e?r:t})(e)}function pt(){var e=new ht.ARRAY_TYPE(2);return ht.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function ft(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function mt(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}function gt(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}function At(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function _t(e,t){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function yt(e){return Math.hypot(e[0],e[1])}function vt(e){var t=e[0],r=e[1];return t*t+r*r}ct.len=yt,ct.sub=ft,ct.mul=mt,ct.div=gt,ct.dist=At,ct.sqrDist=_t,ct.sqrLen=vt;var xt=function(){var e=pt();return function(t,r,n,i,o,s){var a,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,t.length):t.length,a=n;a<l;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,s),t[a]=e[0],t[a+1]=e[1];return t}}();function bt(e){return bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bt(e)}ct.forEach=xt,Object.defineProperty(d,"__esModule",{value:!0}),e.aa=d.vec4=e.Q=d.vec3=d.vec2=d.quat2=e.bl=d.quat=e.a9=d.mat4=e.ct=d.mat3=d.mat2d=e.b7=d.mat2=d.glMatrix=void 0;var wt=kt(p);d.glMatrix=wt;var Ct=kt(_);e.b7=d.mat2=Ct;var Et=kt(C);d.mat2d=Et;var Tt=kt(P);e.ct=d.mat3=Tt;var St=kt(B);e.a9=d.mat4=St;var Mt=kt(q);e.bl=d.quat=Mt;var It=kt(Ye);d.quat2=It;var Pt=kt(ct);d.vec2=Pt;var Lt=kt(Q);e.Q=d.vec3=Lt;var Ot=kt(ce);function Dt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(Dt=function(e){return e?r:t})(e)}function kt(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==bt(e)&&"function"!=typeof e)return{default:e};var r=Dt(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}e.aa=d.vec4=Ot;var zt=Bt;function Bt(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}Bt.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)<t)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r-=i/o}var s=0,a=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?s=r:a=r,r=.5*(a-s)+s;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var Rt=h(zt),Ft=jt;function jt(e,t){this.x=e,this.y=t}jt.prototype={clone:function(){return new jt(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=n,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-n*(this.y-t.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},jt.convert=function(e){return e instanceof jt?e:Array.isArray(e)?new jt(e[0],e[1]):e};var Nt=h(Ft);const Vt=Math.PI/180,Ut=180/Math.PI;function Ht(e){return e*Vt}function Gt(e){return e*Ut}const Zt=[[0,0],[1,0],[1,1],[0,1]];function Wt(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function qt(e,t,r,n){const i=new Rt(e,t,r,n);return function(e){return i.solve(e)}}const Qt=qt(.25,.1,.25,1);function Xt(e,t,r){return Math.min(r,Math.max(t,e))}function Yt(e,t,r){return(r=Xt((r-e)/(t-e),0,1))*r*(3-2*r)}function $t(e,t,r){const n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function Kt(e,t,r){if(!e.length)return r(null,[]);let n=e.length;const i=new Array(e.length);let o=null;e.forEach(((e,s)=>{t(e,((e,t)=>{e&&(o=e),i[s]=t,0==--n&&r(o,i)}))}))}function Jt(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}let er=1;function tr(){return er++}function rr(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function nr(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function ir(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function or(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function sr(e,t){return-1!==e.indexOf(t,e.length-t.length)}function ar(e,t,r){const n={};for(const r in e)n[r]=t.call(this,e[r],r,e);return n}function lr(e,t,r){const n={};for(const r in e)t.call(this,e[r],r,e)&&(n[r]=e[r]);return n}function cr(e){return Array.isArray(e)?e.map(cr):"object"==typeof e&&e?ar(e,cr):e}const ur={};function hr(e){ur[e]||("undefined"!=typeof console&&console.warn(e),ur[e]=!0)}function dr(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function pr(e){let t=0;for(let r,n,i=0,o=e.length,s=o-1;i<o;s=i++)r=e[i],n=e[s],t+=(n.x-r.x)*(r.y+n.y);return t}function fr([e,t,r]){const n=Ht(t+90),i=Ht(r);return{x:e*Math.cos(n)*Math.sin(i),y:e*Math.sin(n)*Math.sin(i),z:e*Math.cos(i),azimuthal:t,polar:r}}function mr(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function gr(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,n,i)=>{const o=n||i;return t[r]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let Ar,_r,yr,vr,xr,br,wr=null;function Cr(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function Er(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function Tr(e,t,r,n){for(;t<r;){const i=t+r>>1;e[i]<n?t=i+1:r=i}return t}function Sr(e,t,r,n){for(;t<r;){const i=t+r>>1;e[i]<=n?t=i+1:r=i}return t}function Mr(e){return e>0?1/(1.001-e):1+e}function Ir(e){return e>0?1-1/(1.001-e):-e}function Pr(){return null==Ar&&(Ar=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),Ar}const Lr={now:()=>void 0!==vr?vr:performance.now(),setNow(e){vr=e},restoreNow(){vr=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:r,height:n}=e;xr||(xr=document.createElement("canvas"));const i=xr.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return(r>xr.width||n>xr.height)&&(xr.width=r,xr.height=n),i.clearRect(-t,-t,r+2*t,n+2*t),i.drawImage(e,0,0,r,n),i.getImageData(-t,-t,r+2*t,n+2*t)},resolveURL:e=>(_r||(_r=document.createElement("a")),_r.href=e,_r.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==yr&&(yr=window.matchMedia("(prefers-reduced-motion: reduce)")),yr.matches)},hasCanvasFingerprintNoise(){if(void 0!==br)return br;if(!Pr())return br=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let r=0;for(let n=0;n<e.width;++n)t.fillStyle=`rgba(${r++},${r++},${r++}, 255)`,t.fillRect(n,0,1,1);const n=t.getImageData(0,0,e.width,e.height);r=0;for(let e=0;e<n.data.length;++e)if(e%4!=3&&r++!==n.data[e])return br=!0,!0;return br=!1,!1}};function Or(e,t){const r=e.indexOf("?");if(r<0)return`${e}?${new URLSearchParams(t).toString()}`;const n=new URLSearchParams(e.slice(r));for(const e in t)n.set(e,t[e]);return`${e.slice(0,r)}?${n.toString()}`}function Dr(e,t={persistentParams:[]}){const r=e.indexOf("?");if(r<0)return e;const n=new URLSearchParams,i=new URLSearchParams(e.slice(r));for(const e of t.persistentParams){const t=i.get(e);t&&n.set(e,t)}const o=n.toString();return`${e.slice(0,r)}${o.length>0?`?${o}`:""}`}const kr="mapbox-tiles";let zr,Br,Rr=500,Fr=50;function jr(){try{return caches}catch(e){}}function Nr(){const e=jr();e&&!zr&&(zr=e.open(kr))}let Vr=1/0;const Ur={supported:!1,testSupport:function(e){!Zr&&Gr&&(Wr?Qr(e):Hr=e)}};let Hr,Gr,Zr=!1,Wr=!1;const qr="undefined"!=typeof self?self:{};function Qr(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Gr),e.isContextLost())return;Ur.supported=!0}catch(e){}e.deleteTexture(t),Zr=!0}qr.document&&(Gr=qr.document.createElement("img"),Gr.onload=function(){Hr&&Qr(Hr),Hr=null,Wr=!0},Gr.onerror=function(){Zr=!0,Hr=null},Gr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Xr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(Xr);class Yr extends Error{constructor(e,t,r){401===t&&i(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=r}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const $r=mr()?()=>self.worker&&self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,Kr=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test($r())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(e,t){const r=new AbortController,n=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:$r(),referrerPolicy:e.referrerPolicy,signal:r.signal});let o=!1,s=!1;const a=(l=n.url).indexOf("sku=")>0&&i(l);var l;"json"===e.type&&n.headers.set("Accept","application/json");const c=(r,i,o)=>{if(s)return;if(r&&"SecurityError"!==r.message&&hr(r.toString()),i&&o)return u(i);const l=Date.now();fetch(n).then((r=>{if(r.ok){const e=a?r.clone():null;return u(r,e,l)}return t(new Yr(r.statusText,r.status,e.url))})).catch((r=>{"AbortError"!==r.name&&t(new Error(`${r.message} ${e.url}`))}))},u=(r,i,a)=>{("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((e=>{s||(i&&a&&function(e,t,r){if(Nr(),!zr)return;const n=gr(t.headers.get("Cache-Control")||"");if(n["no-store"])return;const i={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach(((e,t)=>i.headers.set(t,e))),n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString());const o=i.headers.get("Expires");if(!o)return;if(new Date(o).getTime()-r<42e4)return;let s=Dr(e.url,{persistentParams:["language","worldview"]});if(206===t.status){const t=e.headers.get("Range");if(!t)return;i.status=200,s=Or(s,{range:t})}!function(e,t){if(void 0===Br)try{new Response(new ReadableStream),Br=!0}catch(e){Br=!1}Br?t(e.body):e.blob().then(t)}(t,(e=>{const t=new Response(e,i);Nr(),zr&&zr.then((e=>e.put(s,t))).catch((e=>hr(e.message)))}))}(n,i,a),o=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((e=>{s||t(new Error(e.message))}))};return a?function(e,t){if(Nr(),!zr)return t(null);zr.then((r=>{let n=Dr(e.url,{persistentParams:["language","worldview"]});const i=e.headers.get("Range");i&&(n=Or(n,{range:i})),r.match(n).then((e=>{const i=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),r=gr(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}(e);r.delete(n),i&&r.put(n,e.clone()),t(null,e,i)})).catch(t)})).catch(t)}(n,c):c(null,null),{cancel:()=>{s=!0,o||r.abort()}}}(e,t);if(mr()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(e,t){const r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer");for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{t(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(e){return t(e)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new Yr(r.statusText,r.status,e.url))},r.send(e.body),{cancel:()=>r.abort()}}(e,t)},Jr=function(e,t){return Kr(Jt(e,{type:"arrayBuffer"}),t)};function en(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}const tn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let rn,nn;rn=[],nn=0;const on=function(e,t){if(Ur.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),nn>=n.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return rn.push(r),r}nn++;let r=!1;const i=()=>{if(!r)for(r=!0,nn--;rn.length&&nn<n.MAX_PARALLEL_IMAGE_REQUESTS;){const e=rn.shift(),{requestParameters:t,callback:r,cancelled:n}=e;n||(e.cancel=on(t,r).cancel)}},o=Jr(e,((e,r,n,o)=>{i(),e?t(e):r&&(self.createImageBitmap?function(e,t){const r=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(r).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(r,((e,r)=>t(e,r,n,o))):function(e,t){const r=new Image;r.onload=()=>{t(null,r),URL.revokeObjectURL(r.src),r.onload=null,requestAnimationFrame((()=>{r.src=tn}))},r.onerror=()=>t(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 n=new Blob([new Uint8Array(e)],{type:"image/png"});r.src=e.byteLength?URL.createObjectURL(n):tn}(r,((e,r)=>t(e,r,n,o))))}));return{cancel:()=>{o.cancel(),i()}}},sn="01",an="NO_ACCESS_TOKEN",ln=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function cn(e){const t=e.match(ln);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 un(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const hn="mapbox.eventData";function dn(e){if(!e)return null;const t=e.split(".");if(!t||3!==t.length)return null;try{return JSON.parse(decodeURIComponent(atob(t[1]).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(e){return null}}class pn{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const t=dn(n.ACCESS_TOKEN);let r="";return r=t&&t.u?btoa(encodeURIComponent(t.u).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t))))):n.ACCESS_TOKEN||"",e?`${hn}.${e}:${r}`:`${hn}:${r}`}fetchEventData(){const e=Cr("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{const e=localStorage.getItem(t);e&&(this.eventData=JSON.parse(e));const n=localStorage.getItem(r);n&&(this.anonId=n)}catch(e){hr("Unable to read from LocalStorage")}}saveEventData(){const e=Cr("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid"),n=this.anonId;if(e&&n)try{localStorage.setItem(r,n),Object.keys(this.eventData).length>=1&&localStorage.setItem(t,JSON.stringify(this.eventData))}catch(e){hr("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,t,r,i){if(!n.EVENTS_URL)return;const o=cn(n.EVENTS_URL);o.params.push(`access_token=${i||n.ACCESS_TOKEN||""}`);const s={event:this.type,created:new Date(e).toISOString()},a=t?Jt(s,t):s,l={url:un(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=function(e,t){return Kr(Jt(e,{method:"POST"}),t)}(l,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(i)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const fn=new class extends pn{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,t){n.EVENTS_URL&&n.ACCESS_TOKEN&&Array.isArray(e)&&e.some((e=>o(e)||i(e)))&&this.queueRequest(Date.now(),t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const r=dn(n.ACCESS_TOKEN),i=r?r.u:n.ACCESS_TOKEN;let o=i!==this.eventData.tokenU;ir(this.anonId)||(this.anonId=rr(),o=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(s),r=(s-this.eventData.lastSuccess)/864e5;o=o||r>=1||r<-1||e.getDate()!==t.getDate()}else o=!0;o?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:sn,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=s,this.eventData.tokenU=i)}),e):this.processRequests()}},mn=fn.postTurnstileEvent.bind(fn),gn=new class extends pn{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(e,t,r,i){this.skuToken=t,this.errorCb=i,n.EVENTS_URL&&(r||n.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},r):this.errorCb(new Error(an)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:r,timestamp:n}=this.queue.shift();r&&this.success[r]||(this.anonId||this.fetchEventData(),ir(this.anonId)||(this.anonId=rr()),this.postEvent(n,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:sn,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):r&&(this.success[r]=!0)}),e))}remove(){this.errorCb=null}},An=gn.postMapLoadEvent.bind(gn),_n=new class extends pn{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(e){let t=this.mapInstanceIdMap.get(e);return t||(t=rr(),this.mapInstanceIdMap.set(e,t)),t}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(e,t){const{map:r,style:i,importedStyles:o}=t;if(!n.EVENTS_URL||!e&&!n.ACCESS_TOKEN)return;const s=this.getMapInstanceId(r),a={mapInstanceId:s,eventId:this.getEventId(s),style:i};o.length&&(a.importedStyles=o),this.queueRequest({timestamp:Date.now(),payload:a},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:r}=this.queue.shift();this.postEvent(t,r,(()=>{}),e)}},yn=_n.postStyleLoadEvent.bind(_n),vn=new class extends pn{constructor(){super("gljs.performance")}postPerformanceEvent(e,t){n.EVENTS_URL&&(e||n.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:r,performanceData:n}=this.queue.shift(),i=function(e){const r=performance.getEntriesByType("resource"),n=performance.getEntriesByType("mark"),i=function(e){const t={};if(e)for(const r in e)if("other"!==r)for(const n of e[r]){const e=`${r}ResolveRangeMin`,i=`${r}ResolveRangeMax`,o=`${r}RequestCount`,s=`${r}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,n.startTime),t[i]=Math.max(t[i]||-1/0,n.responseEnd);const a=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==n.transferSize&&0===n.transferSize&&a(s),a(o)}return t}(function(e,t){const r={};if(e)for(const n of e){const e=t(n);void 0===r[e]&&(r[e]=[]),r[e].push(n)}return r}(r,u)),o=window.devicePixelRatio,s=navigator.connection||navigator.mozConnection||navigator.webkitConnection,a=s?s.effectiveType:void 0,h={counters:[],metadata:[],attributes:[]},d=(e,t,r)=>{null!=r&&e.push({name:t,value:r.toString()})};for(const e in i)d(h.counters,e,i[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(d(h.counters,"interactionRangeMin",e.interactionRange[0]),d(h.counters,"interactionRangeMax",e.interactionRange[1])),n)for(const e of Object.keys(c)){const t=c[e],r=n.find((e=>e.name===t));r&&d(h.counters,t,r.startTime)}return d(h.counters,"visibilityHidden",e.visibilityHidden),d(h.attributes,"style",function(e){if(e)for(const t of e){const e=t.name.split("?")[0];if(l(e)){const t=e.split("/").slice(-2);if(2===t.length)return`mapbox://styles/${t[0]}/${t[1]}`}}}(r)),d(h.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),d(h.attributes,"fogEnabled",e.fogEnabled?"true":"false"),d(h.attributes,"projection",e.projection),d(h.attributes,"zoom",e.zoom),d(h.metadata,"devicePixelRatio",o),d(h.metadata,"connectionEffectiveType",a),d(h.metadata,"navigatorUserAgent",navigator.userAgent),d(h.metadata,"screenWidth",window.screen.width),d(h.metadata,"screenHeight",window.screen.height),d(h.metadata,"windowWidth",window.innerWidth),d(h.metadata,"windowHeight",window.innerHeight),d(h.metadata,"mapWidth",e.width/o),d(h.metadata,"mapHeight",e.height/o),d(h.metadata,"webglRenderer",e.renderer),d(h.metadata,"webglVendor",e.vendor),d(h.metadata,"sdkVersion",t),d(h.metadata,"sdkIdentifier","mapbox-gl-js"),h}(n);for(const e of i.metadata);for(const e of i.counters);for(const e of i.attributes);this.postEvent(r,i,(()=>{}),e)}},xn=vn.postPerformanceEvent.bind(vn),bn=new class extends pn{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,t,r,i){if(!n.API_URL||!n.SESSION_PATH)return;const o=cn(n.API_URL+n.SESSION_PATH);o.params.push(`sku=${t||""}`),o.params.push(`access_token=${i||n.ACCESS_TOKEN||""}`);const s={url:un(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(e,t){return Kr(Jt(e,{method:"GET"}),t)}(s,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(i)}))}getSessionAPI(e,t,r,i){this.skuToken=t,this.errorCb=i,n.SESSION_PATH&&n.API_URL&&(r||n.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},r):this.errorCb(new Error(an)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:r}=this.queue.shift();t&&this.success[t]||this.getSession(r,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}remove(){this.errorCb=null}},wn=bn.getSessionAPI.bind(bn),Cn=new Set;var En={exports:{}},Tn={exports:{}};Tn.exports=function(e,t){var r,n,i,o,s,a,l,c;for(n=e.length-(r=3&e.length),i=t,s=3432918353,a=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(o=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};var Sn=Tn.exports,Mn={exports:{}};Mn.exports=function(e,t){for(var r,n=e.length,i=t^n,o=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var In=Sn,Pn=Mn.exports;En.exports=In,En.exports.murmur3=In,En.exports.murmur2=Pn;var Ln=h(En.exports);function On(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function Dn(e,t,r){if(r&&r[e]){const n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}class kn{constructor(e,t={}){Jt(this,t),this.type=e}}class zn extends kn{constructor(e,t={}){super("error",Jt({error:e},t))}}class Bn{on(e,t){return this._listeners=this._listeners||{},On(e,t,this._listeners),this}off(e,t){return Dn(e,t,this._listeners),Dn(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},On(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new kn(e,t||{}));const r=e.type;if(this.listens(r)){e.target=this;const t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of t)r.call(this,e);const n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const t of n)Dn(r,t,this._oneTimeListeners),t.call(this,e);const i=this._eventedParent;i&&(Jt(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(e))}else e instanceof zn&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}e.z=void 0;var Rn={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 Fn(e){return(e=Math.round(e))<0?0:e>255?255:e}function jn(e){return Fn("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function Nn(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function Vn(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{e.z={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in Rn)return Rn[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var o=r.substr(0,n),s=r.substr(n+1,i-(n+1)).split(","),a=1;switch(o){case"rgba":if(4!==s.length)return null;a=Nn(s.pop());case"rgb":return 3!==s.length?null:[jn(s[0]),jn(s[1]),jn(s[2]),a];case"hsla":if(4!==s.length)return null;a=Nn(s.pop());case"hsl":if(3!==s.length)return null;var l=(parseFloat(s[0])%360+360)%360/360,c=Nn(s[1]),u=Nn(s[2]),h=u<=.5?u*(c+1):u+c-u*c,d=2*u-h;return[Fn(255*Vn(d,h,l+1/3)),Fn(255*Vn(d,h,l)),Fn(255*Vn(d,h,l-1/3)),a];default:return null}}return null}}catch(e){}class Un{constructor(e,t,r,n=1){this.r=e,this.g=t,this.b=r,this.a=n}static parse(t){if(!t)return;if(t instanceof Un)return t;if("string"!=typeof t)return;const r=e.z(t);return r?new Un(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toString(){const[e,t,r,n]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(r)},${n})`}toArray(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[255*e/n,255*t/n,255*r/n,n]}toArray01(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[e/n,t/n,r/n,n]}toArray01Scaled(e){const{r:t,g:r,b:n,a:i}=this;return 0===i?[0,0,0]:[t/i*e,r/i*e,n/i*e]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:r,a:n}=this;return[e,t,r,n]}toArray01Linear(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[Math.pow(e/n,2.2),Math.pow(t/n,2.2),Math.pow(r/n,2.2),n]}}function Hn(e,t,r){return e*(1-r)+t*r}function Gn(e,t,r){return e.map(((e,n)=>Hn(e,t[n],r)))}Un.black=new Un(0,0,0,1),Un.white=new Un(1,1,1,1),Un.transparent=new Un(0,0,0,0),Un.red=new Un(1,0,0,1),Un.blue=new Un(0,0,1,1);var Zn=Object.freeze({__proto__:null,array:Gn,color:function(e,t,r){return new Un(Hn(e.r,t.r,r),Hn(e.g,t.g,r),Hn(e.b,t.b,r),Hn(e.a,t.a,r))},number:Hn});function Wn(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}class qn extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class Qn{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new Qn(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Xn={kind:"null"},Yn={kind:"number"},$n={kind:"string"},Kn={kind:"boolean"},Jn={kind:"color"},ei={kind:"object"},ti={kind:"value"},ri={kind:"collator"},ni={kind:"formatted"},ii={kind:"resolvedImage"};function oi(e,t){return{kind:"array",itemType:e,N:t}}function si(e){if("array"===e.kind){const t=si(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const ai=[Xn,Yn,$n,Kn,Jn,ni,ei,oi(ti),ii];function li(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!li(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of ai)if(!li(e,t))return null}return`Expected ${si(e)} but found ${si(t)} instead.`}function ci(e,t){return t.some((t=>t.kind===e.kind))}function ui(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}class hi{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class di{constructor(e,t,r,n,i){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class pi{constructor(e){this.sections=e}static fromString(e){return new pi([new di(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.namePrimary.length))}static factory(e){return e instanceof pi?e:pi.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.namePrimary]);continue}e.push(t.text);const r={};t.fontStack&&(r["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(r["font-scale"]=t.scale),t.textColor&&(r["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(r)}return e}}class fi{constructor(e){this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),this.available=e.available}toString(){return this.nameSecondary?`[${this.namePrimary},${this.nameSecondary}]`:this.namePrimary}static fromString(e,t){return e?new fi({namePrimary:e,nameSecondary:t,available:!1}):null}serialize(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}function mi(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function gi(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Un)return!0;if(e instanceof hi)return!0;if(e instanceof pi)return!0;if(e instanceof fi)return!0;if(Array.isArray(e)){for(const t of e)if(!gi(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!gi(e[t]))return!1;return!0}return!1}function Ai(e){if(null===e)return Xn;if("string"==typeof e)return $n;if("boolean"==typeof e)return Kn;if("number"==typeof e)return Yn;if(e instanceof Un)return Jn;if(e instanceof hi)return ri;if(e instanceof pi)return ni;if(e instanceof fi)return ii;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=Ai(t);if(r){if(r===e)continue;r=ti;break}r=e}return oi(r||ti,t)}return ei}function _i(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Un||e instanceof pi||e instanceof fi?e.toString():JSON.stringify(e)}class yi{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!gi(e[1]))return t.error("invalid value");const r=e[1];let n=Ai(r);const i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new yi(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Un?["rgba"].concat(this.value.toArray()):this.value instanceof pi?this.value.serialize():this.value}}class vi{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const xi={string:$n,number:Yn,boolean:Kn,object:ei};class bi{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const i=e[0];if("array"===i){let i,o;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in xi)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=xi[r],n++}else i=ti;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=oi(i,o)}else r=xi[i];const o=[];for(;n<e.length;n++){const r=t.parse(e[n],n,ti);if(!r)return null;o.push(r)}return new bi(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!li(this.type,Ai(r)))return r;if(t===this.args.length-1)throw new vi(`Expected value to be of type ${si(this.type)}, but found ${si(Ai(r))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);const n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map((e=>e.serialize())))}}class wi{constructor(e){this.type=ni,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=e.length-1;++r){const o=e[r];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;let e=null;if(o["font-scale"]&&(e=t.parse(o["font-scale"],1,Yn),!e))return null;let r=null;if(o["text-font"]&&(r=t.parse(o["text-font"],1,oi($n)),!r))return null;let s=null;if(o["text-color"]&&(s=t.parse(o["text-color"],1,Jn),!s))return null;const a=n[n.length-1];a.scale=e,a.font=r,a.textColor=s}else{const o=t.parse(e[r],1,ti);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new wi(n)}evaluate(e){return new pi(this.sections.map((t=>{const r=t.content.evaluate(e);return Ai(r)===ii?new di("",r,null,null,null):new di(_i(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const r={};t.scale&&(r["font-scale"]=t.scale.serialize()),t.font&&(r["text-font"]=t.font.serialize()),t.textColor&&(r["text-color"]=t.textColor.serialize()),e.push(r)}return e}}class Ci{constructor(e,t){this.type=ii,this.inputPrimary=e,this.inputSecondary=t}static parse(e,t){if(e.length<2)return t.error("Expected two or more arguments.");const r=t.parse(e[1],1,$n);if(!r)return t.error("No image name provided.");if(2===e.length)return new Ci(r);const n=t.parse(e[2],1,$n);return n?new Ci(r,n):t.error("Secondary image variant is not a string.")}evaluate(e){const t=fi.fromString(this.inputPrimary.evaluate(e),this.inputSecondary?this.inputSecondary.evaluate(e):void 0);return t&&e.availableImages&&(t.available=e.availableImages.indexOf(t.namePrimary)>-1,t.nameSecondary&&t.available&&e.availableImages&&(t.available=e.availableImages.indexOf(t.nameSecondary)>-1)),t}eachChild(e){e(this.inputPrimary),this.inputSecondary&&e(this.inputSecondary)}outputDefined(){return!1}serialize(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}function Ei(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}const Ti={"to-boolean":Kn,"to-color":Jn,"to-number":Yn,"to-string":$n};class Si{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0],n=[];let i=Xn;if("to-array"===r){if(!Array.isArray(e[1]))return null;const r=e[1].length;if(t.expectedType){if("array"!==t.expectedType.kind)return t.error(`Expected ${t.expectedType.kind} but found array.`);i=oi(t.expectedType.itemType,r)}else{if(!(r>0&&gi(e[1][0])))return null;i=oi(Ai(e[1][0]),r)}for(let o=0;o<r;o++){const r=e[1][o];let s;if("array"===Ei(r))s=t.parse(r,void 0,i.itemType);else{const e=Ei(r);if(e!==i.itemType.kind)return t.error(`Expected ${i.itemType.kind} but found ${e}.`);s=t.registry.literal.parse(["literal",void 0===r?null:r],t)}if(!s)return null;n.push(s)}}else{if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");i=Ti[r];for(let r=1;r<e.length;r++){const i=t.parse(e[r],r,ti);if(!i)return null;n.push(i)}}return new Si(i,n)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof Un)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:mi(t[0],t[1],t[2],t[3]),!r))return new Un(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new vi(r||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new vi(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?pi.fromString(_i(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?fi.fromString(_i(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map((t=>t.evaluate(e))):_i(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new wi([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ci(this.args[0]).serialize();const e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}const Mi=["Unknown","Point","LineString","Polygon"];class Ii{constructor(e,t){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,this.scope=e,this.options=t}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Mi[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||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:r,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(r*t-e[0])+this.featureDistanceData.bearing[1]*(n*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Un.parse(e)),t}getConfig(e){return this.options?this.options.get(e):null}}class Pi{constructor(e,t,r,n,i){this.name=e,this.type=t,this._evaluate=r,this.args=n,this._overloadIndex=i}evaluate(e){if(!this._evaluate){const e=Pi.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const r=e[0],n=Pi.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=[];let a=null,l=-1;for(const[n,c]of o){if(Array.isArray(n)&&n.length!==e.length-1)continue;s.push(n),l++,a=new Go(t.registry,t.path,null,t.scope,void 0,t._scope,t.options);const o=[];let u=!1;for(let t=1;t<e.length;t++){const r=e[t],i=Array.isArray(n)?n[t-1]:n.type,s=a.parse(r,1+o.length,i);if(!s){u=!0;break}o.push(s)}if(!u)if(Array.isArray(n)&&n.length!==o.length)a.error(`Expected ${n.length} arguments, but found ${o.length} instead.`);else{for(let e=0;e<o.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=o[e];a.concat(e+1).checkSubtype(t,r.type)}if(0===a.errors.length)return new Pi(r,i,c,o,l)}}if(1===s.length)t.errors.push(...a.errors);else{const r=(s.length?s:o.map((([e])=>e))).map(Li).join(" | "),n=[];for(let r=1;r<e.length;r++){const i=t.parse(e[r],1+n.length);if(!i)return null;n.push(si(i.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Pi.definitions=t;for(const r in t)e[r]=Pi}}function Li(e){return Array.isArray(e)?`(${e.map(si).join(", ")})`:`(${si(e.type)}...)`}class Oi{constructor(e,t,r){this.type=ri,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Kn);if(!n)return null;const i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Kn);if(!i)return null;let o=null;return r.locale&&(o=t.parse(r.locale,1,$n),!o)?null:new Oi(n,i,o)}evaluate(e){return new hi(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}var Di={exports:{}};Di.exports=function(){function e(r,n,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=n-i+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);e(r,n,Math.max(i,Math.floor(n-l*u/a+h)),Math.min(o,Math.floor(n+(a-l)*u/a+h)),s)}var d=r[n],p=i,f=o;for(t(r,i,n),s(r[o],d)>0&&t(r,i,o);p<f;){for(t(r,p,f),p++,f--;s(r[p],d)<0;)p++;for(;s(r[f],d)>0;)f--}0===s(r[i],d)?t(r,i,f):t(r,++f,o),f<=n&&(i=f+1),n<=f&&(o=f-1)}}function t(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function r(e,t){return e<t?-1:e>t?1:0}return function(t,n,i,o,s){e(t,n,i||0,o||t.length-1,s||r)}}();var ki=h(Di.exports);function zi(e){let t=0;for(let r,n,i=0,o=e.length,s=o-1;i<o;s=i++)r=e[i],n=e[s],t+=(n.x-r.x)*(r.y+n.y);return t}function Bi(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Ri(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Fi(e,t,r){const n=e[0]-t[0],i=e[1]-t[1],o=e[0]-r[0],s=e[1]-r[1];return n*s-o*i==0&&n*o<=0&&i*s<=0}function ji(e,t,r=!1){let n=!1;for(let a=0,l=t.length;a<l;a++){const l=t[a];for(let t=0,a=l.length,c=a-1;t<a;c=t++){const a=l[c],u=l[t];if(Fi(e,a,u))return r;(o=a)[1]>(i=e)[1]!=(s=u)[1]>i[1]&&i[0]<(s[0]-o[0])*(i[1]-o[1])/(s[1]-o[1])+o[0]&&(n=!n)}}var i,o,s;return n}function Ni(e,t,r,n){const i=n[0]-r[0],o=n[1]-r[1],s=(e[0]-r[0])*o-i*(e[1]-r[1]),a=(t[0]-r[0])*o-i*(t[1]-r[1]);return s>0&&a<0||s<0&&a>0}function Vi(e,t,r,n){return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(o=[t[0]-e[0],t[1]-e[1]])[1]-i[1]*o[0]&&!(!Ni(e,t,r,n)||!Ni(r,n,e,t));var i,o}const Ui=8192;function Hi(e,t){const r=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(r*i*Ui),Math.round(n*i*Ui)]}function Gi(e,t){for(let r=0;r<t.length;r++)if(ji(e,t[r]))return!0;return!1}function Zi(e,t,r){for(const n of r)for(let r=0,i=n.length,o=i-1;r<i;o=r++)if(Vi(e,t,n[o],n[r]))return!0;return!1}function Wi(e,t){for(let r=0;r<e.length;++r)if(!ji(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if(Zi(e[r],e[r+1],t))return!1;return!0}function qi(e,t){for(let r=0;r<t.length;r++)if(Wi(e,t[r]))return!0;return!1}function Qi(e,t,r){const n=[];for(let i=0;i<e.length;i++){const o=[];for(let n=0;n<e[i].length;n++){const s=Hi(e[i][n],r);Bi(t,s),o.push(s)}n.push(o)}return n}function Xi(e,t,r){const n=[];for(let i=0;i<e.length;i++){const o=Qi(e[i],t,r);n.push(o)}return n}function Yi(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let i=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===i&&(i=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=i}Bi(t,e)}function $i(e,t,r,n){const i=Math.pow(2,n.z)*Ui,o=[n.x*Ui,n.y*Ui],s=[];if(!e)return s;for(const n of e)for(const e of n){const n=[e.x+o[0],e.y+o[1]];Yi(n,t,r,i),s.push(n)}return s}function Ki(e,t,r,n){const i=Math.pow(2,n.z)*Ui,o=[n.x*Ui,n.y*Ui],s=[];if(!e)return s;for(const r of e){const e=[];for(const n of r){const r=[n.x+o[0],n.y+o[1]];Bi(t,r),e.push(r)}s.push(e)}if(t[2]-t[0]<=i/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const e of s)for(const n of e)Yi(n,t,r,i)}var a;return s}class Ji{constructor(e,t){this.type=Kn,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(gi(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const r=t.features[e].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new Ji(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new Ji(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new Ji(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){const o=Qi(t.coordinates,n,i),s=$i(e.geometry(),r,n,i);if(!Ri(r,n))return!1;for(const e of s)if(!ji(e,o))return!1}if("MultiPolygon"===t.type){const o=Xi(t.coordinates,n,i),s=$i(e.geometry(),r,n,i);if(!Ri(r,n))return!1;for(const e of s)if(!Gi(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){const o=Qi(t.coordinates,n,i),s=Ki(e.geometry(),r,n,i);if(!Ri(r,n))return!1;for(const e of s)if(!Wi(e,o))return!1}if("MultiPolygon"===t.type){const o=Xi(t.coordinates,n,i),s=Ki(e.geometry(),r,n,i);if(!Ri(r,n))return!1;for(const e of s)if(!qi(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var eo={exports:{}};!function(e,t){e.exports=function(){var e={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},t=1/298.257223563,r=t*(2-t),n=Math.PI/180,i=function(t,i){if(void 0===t)throw new Error("No latitude given.");if(i&&!e[i])throw new Error("Unknown unit "+i+". Use one of: "+Object.keys(e).join(", "));var o=6378.137*n*(i?e[i]:1),s=Math.cos(t*n),a=1/(1-r*(1-s*s)),l=Math.sqrt(a);this.kx=o*l*s,this.ky=o*l*a*(1-r)},o={units:{configurable:!0}};function s(e,t){return e[0]===t[0]&&e[1]===t[1]}function a(e,t,r){var n=l(t[0]-e[0]);return[e[0]+n*r,e[1]+(t[1]-e[1])*r]}function l(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}return i.fromTile=function(e,t,r){var o=Math.PI*(1-2*(e+.5)/Math.pow(2,t)),s=Math.atan(.5*(Math.exp(o)-Math.exp(-o)))/n;return new i(s,r)},o.units.get=function(){return e},i.prototype.distance=function(e,t){var r=l(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)},i.prototype.bearing=function(e,t){var r=l(t[0]-e[0])*this.kx;return Math.atan2(r,(t[1]-e[1])*this.ky)/n},i.prototype.destination=function(e,t,r){var i=r*n;return this.offset(e,Math.sin(i)*t,Math.cos(i)*t)},i.prototype.offset=function(e,t,r){return[e[0]+t/this.kx,e[1]+r/this.ky]},i.prototype.lineDistance=function(e){for(var t=0,r=0;r<e.length-1;r++)t+=this.distance(e[r],e[r+1]);return t},i.prototype.area=function(e){for(var t=0,r=0;r<e.length;r++)for(var n=e[r],i=0,o=n.length,s=o-1;i<o;s=i++)t+=l(n[i][0]-n[s][0])*(n[i][1]+n[s][1])*(r?-1:1);return Math.abs(t)/2*this.kx*this.ky},i.prototype.along=function(e,t){var r=0;if(t<=0)return e[0];for(var n=0;n<e.length-1;n++){var i=e[n],o=e[n+1],s=this.distance(i,o);if((r+=s)>t)return a(i,o,(t-(r-s))/s)}return e[e.length-1]},i.prototype.pointToSegmentDistance=function(e,t,r){var n=t[0],i=t[1],o=l(r[0]-n)*this.kx,s=(r[1]-i)*this.ky,a=0;return 0===o&&0===s||((a=(l(e[0]-n)*this.kx*o+(e[1]-i)*this.ky*s)/(o*o+s*s))>1?(n=r[0],i=r[1]):a>0&&(n+=o/this.kx*a,i+=s/this.ky*a)),o=l(e[0]-n)*this.kx,s=(e[1]-i)*this.ky,Math.sqrt(o*o+s*s)},i.prototype.pointOnLine=function(e,t){for(var r,n,i,o,s=1/0,a=0;a<e.length-1;a++){var c=e[a][0],u=e[a][1],h=l(e[a+1][0]-c)*this.kx,d=(e[a+1][1]-u)*this.ky,p=0;0===h&&0===d||((p=(l(t[0]-c)*this.kx*h+(t[1]-u)*this.ky*d)/(h*h+d*d))>1?(c=e[a+1][0],u=e[a+1][1]):p>0&&(c+=h/this.kx*p,u+=d/this.ky*p));var f=(h=l(t[0]-c)*this.kx)*h+(d=(t[1]-u)*this.ky)*d;f<s&&(s=f,r=c,n=u,i=a,o=p)}return{point:[r,n],index:i,t:Math.max(0,Math.min(1,o))}},i.prototype.lineSlice=function(e,t,r){var n=this.pointOnLine(r,e),i=this.pointOnLine(r,t);if(n.index>i.index||n.index===i.index&&n.t>i.t){var o=n;n=i,i=o}var a=[n.point],l=n.index+1,c=i.index;!s(r[l],a[0])&&l<=c&&a.push(r[l]);for(var u=l+1;u<=c;u++)a.push(r[u]);return s(r[c],i.point)||a.push(i.point),a},i.prototype.lineSliceAlong=function(e,t,r){for(var n=0,i=[],o=0;o<r.length-1;o++){var s=r[o],l=r[o+1],c=this.distance(s,l);if((n+=c)>e&&0===i.length&&i.push(a(s,l,(e-(n-c))/c)),n>=t)return i.push(a(s,l,(t-(n-c))/c)),i;n>e&&i.push(l)}return i},i.prototype.bufferPoint=function(e,t){var r=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-r,e[0]+n,e[1]+r]},i.prototype.bufferBBox=function(e,t){var r=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-r,e[2]+n,e[3]+r]},i.prototype.insideBBox=function(e,t){return l(e[0]-t[0])>=0&&l(e[0]-t[2])<=0&&e[1]>=t[1]&&e[1]<=t[3]},Object.defineProperties(i,o),i}()}(eo);var to=h(eo.exports),ro={exports:{}};!function(e,t){e.exports=function(){var e=function(e,r){if(void 0===e&&(e=[]),void 0===r&&(r=t),this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function t(e,t){return e<t?-1:e>t?1:0}return e.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},e.prototype.pop=function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},e.prototype.peek=function(){return this.data[0]},e.prototype._up=function(e){for(var t=this.data,r=this.compare,n=t[e];e>0;){var i=e-1>>1,o=t[i];if(r(n,o)>=0)break;t[e]=o,e=i}t[e]=n},e.prototype._down=function(e){for(var t=this.data,r=this.compare,n=this.length>>1,i=t[e];e<n;){var o=1+(e<<1),s=t[o],a=o+1;if(a<this.length&&r(t[a],s)<0&&(o=a,s=t[a]),r(s,i)>=0)break;t[e]=s,e=o}t[e]=i},e}()}(ro);var no=h(ro.exports),io=8192;function oo(e,t){return t.dist-e.dist}const so=100,ao=50;function lo(e){const t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function co(e){return e[1]-e[0]+1}function uo(e,t){const r=e[1]>=e[0]&&e[1]<t;return r||console.warn("Distance Expression: Index is out of range"),r}function ho(e,t){if(e[0]>e[1])return[null,null];const r=co(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}{if(1===r)return[e,null];const t=Math.floor(r/2)-1;return[[e[0],e[0]+t],[e[0]+t+1,e[1]]]}}function po(e,t){const r=[1/0,1/0,-1/0,-1/0];if(!uo(t,e.length))return r;for(let n=t[0];n<=t[1];++n)Bi(r,e[n]);return r}function fo(e){const t=[1/0,1/0,-1/0,-1/0];for(let r=0;r<e.length;++r)for(let n=0;n<e[r].length;++n)Bi(t,e[r][n]);return t}function mo(e,t,r){if(lo(e)||lo(t))return NaN;let n=0,i=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),r.distance([0,0],[n,i])}function go(e){return 360*e-180}function Ao(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function _o(e,t){const r=Math.pow(2,t.z),n=(e.y/io+t.y)/r;return[go((e.x/io+t.x)/r),Ao(n)]}function yo(e,t){const r=[];for(let n=0;n<e.length;++n)r.push(_o(e[n],t));return r}function vo(e,t,r){const n=r.pointOnLine(t,e).point;return r.distance(e,n)}function xo(e,t,r,n,i){const o=r.slice(n[0],n[1]+1);let s=1/0;for(let r=t[0];r<=t[1];++r)if(0===(s=Math.min(s,vo(e[r],o,i))))return 0;return s}function bo(e,t,r,n,i){const o=Math.min(i.pointToSegmentDistance(e,r,n),i.pointToSegmentDistance(t,r,n)),s=Math.min(i.pointToSegmentDistance(r,e,t),i.pointToSegmentDistance(n,e,t));return Math.min(o,s)}function wo(e,t,r,n,i){if(!uo(t,e.length)||!uo(n,r.length))return NaN;let o=1/0;for(let s=t[0];s<t[1];++s)for(let t=n[0];t<n[1];++t){if(Vi(e[s],e[s+1],r[t],r[t+1]))return 0;o=Math.min(o,bo(e[s],e[s+1],r[t],r[t+1],i))}return o}function Co(e,t,r,n,i){if(!uo(t,e.length)||!uo(n,r.length))return NaN;let o=1/0;for(let s=t[0];s<=t[1];++s)for(let t=n[0];t<=n[1];++t)if(0===(o=Math.min(o,i.distance(e[s],r[t]))))return o;return o}function Eo(e,t,r){if(ji(e,t,!0))return 0;let n=1/0;for(const i of t){const t=i.length;if(t<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(i[0]!==i[t-1]&&0===(n=Math.min(n,r.pointToSegmentDistance(e,i[t-1],i[0]))))return n;if(0===(n=Math.min(n,vo(e,i,r))))return n}return n}function To(e,t,r,n){if(!uo(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(ji(e[n],r,!0))return 0;let i=1/0;for(let o=t[0];o<t[1];++o)for(const t of r)for(let r=0,s=t.length,a=s-1;r<s;a=r++){if(Vi(e[o],e[o+1],t[a],t[r]))return 0;i=Math.min(i,bo(e[o],e[o+1],t[a],t[r],n))}return i}function So(e,t){for(const r of e)for(let e=0;e<=r.length-1;++e)if(ji(r[e],t,!0))return!0;return!1}function Mo(e,t,r,n=1/0){const i=fo(e),o=fo(t);if(n!==1/0&&mo(i,o,r)>=n)return n;if(Ri(i,o)){if(So(e,t))return 0}else if(So(t,e))return 0;let s=n;for(const n of e)for(let e=0,i=n.length,o=i-1;e<i;o=e++)for(const i of t)for(let t=0,a=i.length,l=a-1;t<a;l=t++){if(Vi(n[o],n[e],i[l],i[t]))return 0;s=Math.min(s,bo(n[o],n[e],i[l],i[t],r))}return s}function Io(e,t,r,n,i,o,s){if(null===o||null===s)return;const a=mo(po(n,o),po(i,s),r);a<t&&e.push({dist:a,range1:o,range2:s})}function Po(e,t,r,n,i=1/0){let o=Math.min(n.distance(e[0],r[0][0]),i);if(0===o)return o;const s=new no([{dist:0,range1:[0,e.length-1],range2:[0,0]}],oo),a=t?ao:so,l=fo(r);for(;s.length;){const i=s.pop();if(i.dist>=o)continue;const c=i.range1;if(co(c)<=a){if(!uo(c,e.length))return NaN;if(t){const t=To(e,c,r,n);if(0===(o=Math.min(o,t)))return o}else for(let t=c[0];t<=c[1];++t){const i=Eo(e[t],r,n);if(0===(o=Math.min(o,i)))return o}}else{const r=ho(c,t);if(null!==r[0]){const t=mo(po(e,r[0]),l,n);t<o&&s.push({dist:t,range1:r[0],range2:[0,0]})}if(null!==r[1]){const t=mo(po(e,r[1]),l,n);t<o&&s.push({dist:t,range1:r[1],range2:[0,0]})}}}return o}function Lo(e,t,r,n,i,o=1/0){let s=Math.min(o,i.distance(e[0],r[0]));if(0===s)return s;const a=new no([{dist:0,range1:[0,e.length-1],range2:[0,r.length-1]}],oo),l=t?ao:so,c=n?ao:so;for(;a.length;){const o=a.pop();if(o.dist>=s)continue;const u=o.range1,h=o.range2;if(co(u)<=l&&co(h)<=c){if(!uo(u,e.length)||!uo(h,r.length))return NaN;if(t&&n?s=Math.min(s,wo(e,u,r,h,i)):t||n?t&&!n?s=Math.min(s,xo(r,h,e,u,i)):!t&&n&&(s=Math.min(s,xo(e,u,r,h,i))):s=Math.min(s,Co(e,u,r,h,i)),0===s)return s}else{const o=ho(u,t),l=ho(h,n);Io(a,s,i,e,r,o[0],l[0]),Io(a,s,i,e,r,o[0],l[1]),Io(a,s,i,e,r,o[1],l[0]),Io(a,s,i,e,r,o[1],l[1])}}return s}function Oo(e,t,r,n,i=1/0){let o=i;const s=po(e,[0,e.length-1]);for(const i of r)if(!(o!==1/0&&mo(s,po(i,[0,i.length-1]),n)>=o)&&(o=Math.min(o,Lo(e,t,i,!0,n,o)),0===o))return o;return o}function Do(e,t,r,n,i=1/0){let o=i;const s=po(e,[0,e.length-1]);for(const i of r){if(o!==1/0&&mo(s,fo(i),n)>=o)continue;const r=Po(e,t,i,n,o);if(isNaN(r))return r;if(0===(o=Math.min(o,r)))return o}return o}function ko(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}class zo{constructor(e,t){this.type=Yn,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(gi(e[1])){const t=e[1];if("FeatureCollection"===t.type){for(let e=0;e<t.features.length;++e)if(ko(t.features[e].geometry.type))return new zo(t,t.features[e].geometry)}else if("Feature"===t.type){if(ko(t.geometry.type))return new zo(t,t.geometry)}else if(ko(t.type))return new zo(t,t)}return t.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(e){const t=e.geometry(),r=e.canonicalID();if(null!=t&&null!=r){if("Point"===e.geometryType())return function(e,t,r){const n=[];for(const r of e)for(const e of r)n.push(_o(e,t));const i=new to(n[0][1],"meters");return"Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type?Lo(n,!1,"Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,i):"MultiLineString"===r.type?Oo(n,!1,r.coordinates,i):"Polygon"===r.type||"MultiPolygon"===r.type?Do(n,!1,"Polygon"===r.type?[r.coordinates]:r.coordinates,i):null}(t,r,this.geometries);if("LineString"===e.geometryType())return function(e,t,r){const n=[];for(const r of e){const e=[];for(const n of r)e.push(_o(n,t));n.push(e)}const i=new to(n[0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return Oo("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,n,i);if("MultiLineString"===r.type){let e=1/0;for(let t=0;t<r.coordinates.length;t++){const o=Oo(r.coordinates[t],!0,n,i,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}if("Polygon"===r.type||"MultiPolygon"===r.type){let e=1/0;for(let t=0;t<n.length;t++){const o=Do(n[t],!0,"Polygon"===r.type?[r.coordinates]:r.coordinates,i,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return null}(t,r,this.geometries);if("Polygon"===e.geometryType())return function(e,t,r){const n=[];for(const r of function(e,t){const r=e.length;if(r<=1)return[e];const n=[];let i,o;for(let t=0;t<r;t++){const r=zi(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(i&&n.push(i),i=[e[t]]):i.push(e[t]))}return i&&n.push(i),n}(e)){const e=[];for(let n=0;n<r.length;++n)e.push(yo(r[n],t));n.push(e)}const i=new to(n[0][0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return Do("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,n,i);if("MultiLineString"===r.type){let e=1/0;for(let t=0;t<r.coordinates.length;t++){const o=Do(r.coordinates[t],!0,n,i,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return"Polygon"===r.type||"MultiPolygon"===r.type?function(e,t,r){let n=1/0;for(const i of e)for(const e of t){const t=Mo(i,e,r,n);if(isNaN(t))return t;if(0===(n=Math.min(n,t)))return n}return n}("Polygon"===r.type?[r.coordinates]:r.coordinates,n,i):null}(t,r,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function Bo(e,t){switch(e){case"string":return _i(t);case"number":return+t;case"boolean":return!!t;case"color":return Un.parse(t);case"formatted":return pi.fromString(_i(t));case"resolvedImage":return fi.fromString(_i(t))}return t}function Ro(e,t,r,n){return void 0!==n&&(e=n*Math.round(e/n)),void 0!==t&&e<t&&(e=t),void 0!==r&&e>r&&(e=r),e}class Fo{constructor(e,t,r){this.type=e,this.key=t,this.scope=r}static parse(e,t){let r=t.expectedType;if(null==r&&(r=ti),e.length<2||e.length>3)return t.error("Invalid number of arguments for 'config' expression.");const n=t.parse(e[1],1);if(!(n instanceof yi))return t.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){const i=t.parse(e[2],2);return i instanceof yi?new Fo(r,_i(n.value),_i(i.value)):t.error("Scope of 'config' expression must be a string literal.")}return new Fo(r,_i(n.value))}evaluate(e){const t=[this.key,this.scope,e.scope].filter(Boolean).join(""),r=e.getConfig(t);if(!r)return null;const{type:n,value:i,values:o,minValue:s,maxValue:a,stepValue:l}=r,c=r.default.evaluate(e);let u=c;if(i){const t=e.scope;e.scope=(t||"").split("").slice(1).join(""),u=i.evaluate(e),e.scope=t}return n&&(u=Bo(n,u)),void 0===u||void 0===s&&void 0===a&&void 0===l||("number"==typeof u?u=Ro(u,s,a,l):Array.isArray(u)&&(u=u.map((e=>"number"==typeof e?Ro(e,s,a,l):e)))),void 0!==i&&void 0!==u&&o&&!o.includes(u)&&(u=c,n&&(u=Bo(n,u))),(n&&n!==this.type||void 0!==u&&Ai(u)!==this.type)&&(u=Bo(this.type.kind,u)),u}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.key),e}}function jo(e){if(e instanceof Pi){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Ji)return!1;if(e instanceof zo)return!1;let t=!0;return e.eachChild((e=>{t&&!jo(e)&&(t=!1)})),t}function No(e){if(e instanceof Pi&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!No(e)&&(t=!1)})),t}function Vo(e){if(e instanceof Fo)return!1;let t=!0;return e.eachChild((e=>{t&&!Vo(e)&&(t=!1)})),t}function Uo(e,t){if(e instanceof Pi&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!Uo(e,t)&&(r=!1)})),r}class Ho{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new Ho(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Go{constructor(e,t=[],r,n=new Qn,i=[],o,s){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=n,this.errors=i,this.expectedType=r,this._scope=o,this.options=s}parse(e,t,r,n,i={}){return t||r?this.concat(t,r,n)._parse(e,i):this._parse(e,i)}_parse(e,t){function r(e,t,r){return"assert"===r?new bi(t,[e]):"coerce"===r?new Si(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n="string"==typeof e[0]?this.registry[e[0]]:void 0;if(n){let i=n.parse(e,this);if(!i)return null;if(this.expectedType){const e=this.expectedType,n=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(e,n))return null}else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof yi)&&"resolvedImage"!==i.type.kind&&Zo(i)){const t=new Ii(this._scope,this.options);try{i=new yi(i.type,i.evaluate(t))}catch(e){return this.error(e.message),null}}return i}return Si.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new Go(this.registry,n,t||null,i,this.errors,this._scope,this.options)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new qn(r,e))}checkSubtype(e,t){const r=li(e,t);return r&&this.error(r),r}}function Zo(e){if(e instanceof Ho)return Zo(e.boundExpression);if(e instanceof Pi&&"error"===e.name)return!1;if(e instanceof Oi)return!1;if(e instanceof Ji)return!1;if(e instanceof zo)return!1;if(e instanceof Fo)return!1;const t=e instanceof Si||e instanceof bi;let r=!0;return e.eachChild((e=>{r=t?r&&Zo(e):r&&e instanceof yi})),!!r&&jo(e)&&Uo(e,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function Wo(e,t){const r=e.length-1;let n,i,o=0,s=r,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=e[a],i=e[a+1],n<=t){if(a===r||t<i)return a;o=a+1}else{if(!(n>t))throw new vi("Input is not a number.");s=a-1}return 0}class qo{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,Yn);if(!r)return null;const n=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let r=1;r<e.length;r+=2){const o=1===r?-1/0:e[r],s=e[r+1],a=r,l=r+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=t.parse(s,l,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new qo(i,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Wo(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}const Qo=.95047,Xo=1.08883,Yo=4/29,$o=6/29,Ko=3*$o*$o,Jo=$o*$o*$o,es=Math.PI/180,ts=180/Math.PI;function rs(e){return e>Jo?Math.pow(e,1/3):e/Ko+Yo}function ns(e){return e>$o?e*e*e:Ko*(e-Yo)}function is(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function os(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ss(e){const t=os(e.r),r=os(e.g),n=os(e.b),i=rs((.4124564*t+.3575761*r+.1804375*n)/Qo),o=rs((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-rs((.0193339*t+.119192*r+.9503041*n)/Xo)),alpha:e.a}}function as(e){let t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*ns(t),r=Qo*ns(r),n=Xo*ns(n),new Un(is(3.2404542*r-1.5371385*t-.4985314*n),is(-.969266*r+1.8760108*t+.041556*n),is(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function ls(e,t,r){const n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}const cs={forward:ss,reverse:as,interpolate:function(e,t,r){return{l:Hn(e.l,t.l,r),a:Hn(e.a,t.a,r),b:Hn(e.b,t.b,r),alpha:Hn(e.alpha,t.alpha,r)}}},us={forward:function(e){const{l:t,a:r,b:n}=ss(e),i=Math.atan2(n,r)*ts;return{h:i<0?i+360:i,c:Math.sqrt(r*r+n*n),l:t,alpha:e.a}},reverse:function(e){const t=e.h*es,r=e.c;return as({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:ls(e.h,t.h,r),c:Hn(e.c,t.c,r),l:Hn(e.l,t.l,r),alpha:Hn(e.alpha,t.alpha,r)}}};var hs=Object.freeze({__proto__:null,hcl:us,lab:cs});class ds{constructor(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let i=0;if("exponential"===e.name)i=ps(t,e.base,r,n);else if("linear"===e.name)i=ps(t,1,r,n);else if("cubic-bezier"===e.name){const o=e.controlPoints;i=new Rt(o[0],o[1],o[2],o[3]).solve(ps(t,1,r,n))}return i}static parse(e,t){let[r,n,i,...o]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,Yn),!i)return null;const s=[];let a=null;"interpolate-hcl"===r||"interpolate-lab"===r?a=Jn:t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let e=0;e<o.length;e+=2){const r=o[e],n=o[e+1],i=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(s.length&&s[s.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const c=t.parse(n,l,a);if(!c)return null;a=a||c.type,s.push([r,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new ds(a,r,n,i,s):t.error(`Type ${si(a)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);const o=Wo(t,n),s=ds.interpolationFactor(this.interpolation,n,t[o],t[o+1]),a=r[o].evaluate(e),l=r[o+1].evaluate(e);return"interpolate"===this.operator?Zn[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?us.reverse(us.interpolate(us.forward(a),us.forward(l),s)):cs.reverse(cs.interpolate(cs.forward(a),cs.forward(l),s))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function ps(e,t,r,n){const i=n-r,o=e-r;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}class fs{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const n of e.slice(1)){const e=t.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,i.push(e)}const o=n&&i.some((e=>li(n,e.type)));return new fs(o?ti:r,i)}evaluate(e){let t,r=null,n=0;for(const i of this.args){if(n++,r=i.evaluate(e),r&&r instanceof fi&&!r.available&&(t||(t=r),r=null,n===this.args.length))return t;if(null!==r)break}return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class ms{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n<e.length-1;n+=2){const i=e[n];if("string"!=typeof i)return t.error(`Expected string, but found ${typeof i} instead.`,n);if(/[^a-zA-Z0-9_]/.test(i))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const o=t.parse(e[n+1],n+1);if(!o)return null;r.push([i,o])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new ms(r,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,r]of this.bindings)e.push(t,r.serialize());return e.push(this.result.serialize()),e}}class gs{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,Yn),n=t.parse(e[2],2,oi(t.expectedType||ti));return r&&n?new gs(n.type.itemType,r,n):null}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new vi(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new vi(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new vi(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class As{constructor(e,t){this.type=Kn,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ti),n=t.parse(e[2],2,ti);return r&&n?ci(r.type,[Kn,$n,Yn,Xn,ti])?new As(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${si(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!ui(t,["boolean","string","number","null"]))throw new vi(`Expected first argument to be of type boolean, string, number or null, but found ${si(Ai(t))} instead.`);if(!ui(r,["string","array"]))throw new vi(`Expected second argument to be of type array or string, but found ${si(Ai(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class _s{constructor(e,t,r){this.type=Yn,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ti),n=t.parse(e[2],2,ti);if(!r||!n)return null;if(!ci(r.type,[Kn,$n,Yn,Xn,ti]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${si(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,Yn);return i?new _s(r,n,i):null}return new _s(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!ui(t,["boolean","string","number","null"]))throw new vi(`Expected first argument to be of type boolean, string, number or null, but found ${si(Ai(t))} instead.`);if(!ui(r,["string","array"]))throw new vi(`Expected second argument to be of type array or string, but found ${si(Ai(r))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class ys{constructor(e,t,r,n,i,o){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const i={},o=[];for(let s=2;s<e.length-1;s+=2){let a=e[s];const l=e[s+1];Array.isArray(a)||(a=[a]);const c=t.concat(s);if(0===a.length)return c.error("Expected at least one branch label.");for(const e of a){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,Ai(e)))return null}else r=Ai(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=o.length}const u=t.parse(l,s,n);if(!u)return null;n=n||u.type,o.push(u)}const s=t.parse(e[1],1,ti);if(!s)return null;const a=t.parse(e[e.length-1],e.length-1,n);return a?"value"!==s.type.kind&&t.concat(1).checkSubtype(r,s.type)?null:new ys(r,n,s,i,o,a):null}evaluate(e){const t=this.input.evaluate(e);return(Ai(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),r=[],n={};for(const e of t){const t=n[this.cases[e]];void 0===t?(n[this.cases[e]]=r.length,r.push([this.cases[e],[e]])):r[t][1].push(e)}const i=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,n]of r)e.push(1===n.length?i(n[0]):n.map(i)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}class vs{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let i=1;i<e.length-1;i+=2){const o=t.parse(e[i],i,Kn);if(!o)return null;const s=t.parse(e[i+1],i+1,r);if(!s)return null;n.push([o,s]),r=r||s.type}const i=t.parse(e[e.length-1],e.length-1,r);return i?new vs(r,n,i):null}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class xs{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ti),n=t.parse(e[2],2,Yn);if(!r||!n)return null;if(!ci(r.type,[oi(ti),$n,ti]))return t.error(`Expected first argument to be of type array or string, but found ${si(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,Yn);return i?new xs(r.type,r,n,i):null}return new xs(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!ui(t,["string","array"]))throw new vi(`Expected first argument to be of type array or string, but found ${si(Ai(t))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function bs(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function ws(e,t,r,n){return 0===n.compare(t,r)}function Cs(e,t,r){const n="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=Kn,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let o=t.parse(e[1],1,ti);if(!o)return null;if(!bs(r,o.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${si(o.type)}'.`);let s=t.parse(e[2],2,ti);if(!s)return null;if(!bs(r,s.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${si(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${si(o.type)}' and '${si(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new bi(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new bi(o.type,[s])));let a=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(a=t.parse(e[3],3,ri),!a)return null}return new i(o,s,a)}evaluate(i){const o=this.lhs.evaluate(i),s=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const t=Ai(o),r=Ai(s);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new vi(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=Ai(o),r=Ai(s);if("string"!==e.kind||"string"!==r.kind)return t(i,o,s)}return this.collator?r(i,o,s,this.collator.evaluate(i)):t(i,o,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const Es=Cs("==",(function(e,t,r){return t===r}),ws),Ts=Cs("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!ws(0,t,r,n)})),Ss=Cs("<",(function(e,t,r){return t<r}),(function(e,t,r,n){return n.compare(t,r)<0})),Ms=Cs(">",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),Is=Cs("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Ps=Cs(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class Ls{constructor(e,t,r,n,i,o){this.type=$n,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Yn);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=t.parse(n.locale,1,$n),!i))return null;let o=null;if(n.currency&&(o=t.parse(n.currency,1,$n),!o))return null;let s=null;if(n.unit&&(s=t.parse(n.unit,1,$n),!s))return null;let a=null;if(n["min-fraction-digits"]&&(a=t.parse(n["min-fraction-digits"],1,Yn),!a))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,Yn),!l)?null:new Ls(r,i,o,s,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class Os{constructor(e){this.type=Yn,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${si(r.type)} instead.`):new Os(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new vi(`Expected value to be of type string or array, but found ${si(Ai(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}function Ds(e){return function(){e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const ks={"==":Es,"!=":Ts,">":Ms,"<":Ss,">=":Ps,"<=":Is,array:bi,at:gs,boolean:bi,case:vs,coalesce:fs,collator:Oi,format:wi,image:Ci,in:As,"index-of":_s,interpolate:ds,"interpolate-hcl":ds,"interpolate-lab":ds,length:Os,let:ms,literal:yi,match:ys,number:bi,"number-format":Ls,object:bi,slice:xs,step:qo,string:bi,"to-boolean":Si,"to-color":Si,"to-number":Si,"to-string":Si,var:Ho,within:Ji,distance:zo,config:Fo};function zs(e,[t,r,n,i]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const o=i?i.evaluate(e):1,s=mi(t,r,n,o);if(s)throw new vi(s);return new Un(t/255*o,r/255*o,n/255*o,o)}function Bs(e,[t,r,n,i]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const o=i?i.evaluate(e):1,s=function(e,t,r,n){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof r&&r>=0&&r<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid hsla value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'h' must be between 0 and 360.`}(t,r,n,o);if(s)throw new vi(s);const a=`hsla(${t}, ${r}%, ${n}%, ${o})`,l=Un.parse(a);if(!l)throw new vi(`Failed to parse HSLA color: ${a}`);return l}function Rs(e,t){return e in t}function Fs(e,t){const r=t[e];return void 0===r?null:r}function js(e){return{type:e}}function Ns(e){return{result:"success",value:e}}function Vs(e){return{result:"error",value:e}}function Us(e,t){return!!e&&!!e.parameters&&e.parameters.indexOf(t)>-1}function Hs(e){return"data-driven"===e["property-type"]}function Gs(e){return Us(e.expression,"measure-light")}function Zs(e){return Us(e.expression,"zoom")}function Ws(e){return!!e.expression&&e.expression.interpolated}function qs(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Qs(e){return e}function Xs(e,t){const r="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],i=n||!(n||void 0!==e.property),o=e.type||(Ws(t)?"exponential":"interval");if(r&&((e=Wn({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],Un.parse(e[1])]))),e.default=Un.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!hs[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let s,a,l;if("exponential"===o)s=Js;else if("interval"===o)s=Ks;else if("categorical"===o){s=$s,a=Object.create(null);for(const t of e.stops)a[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);s=ea}if(n){const r={},n=[];for(let t=0;t<e.stops.length;t++){const i=e.stops[t],o=i[0].zoom;void 0===r[o]&&(r[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},n.push(o)),r[o].stops.push([i[0].value,i[1]])}const i=[];for(const e of n)i.push([r[e].zoom,Xs(r[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:ds.interpolationFactor.bind(void 0,o),zoomStops:i.map((e=>e[0])),evaluate:({zoom:r},n)=>Js({stops:i,base:e.base},t,r).evaluate(r,n)}}if(i){const r="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:ds.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>s(e,t,r,a,l)}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[e.property]:void 0;return void 0===i?Ys(e.default,t.default):s(e,t,i,a,l)}}}function Ys(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function $s(e,t,r,n,i){return Ys(typeof r===i?n[r]:void 0,e.default,t.default)}function Ks(e,t,r){if("number"!==Ei(r))return Ys(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const i=Wo(e.stops.map((e=>e[0])),r);return e.stops[i][1]}function Js(e,t,r){const n=void 0!==e.base?e.base:1;if("number"!==Ei(r))return Ys(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const o=Wo(e.stops.map((e=>e[0])),r),s=function(e,t,r,n){const i=n-r,o=e-r;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[o][0],e.stops[o+1][0]),a=e.stops[o][1],l=e.stops[o+1][1];let c=Zn[t.type]||Qs;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=hs[e.colorSpace];c=(e,r)=>t.reverse(t.interpolate(t.forward(e),t.forward(r),s))}return"function"==typeof a.evaluate?{evaluate(...e){const t=a.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==r)return c(t,r,s)}}:c(a,l,s)}function ea(e,t,r){return"color"===t.type?r=Un.parse(r):"formatted"===t.type?r=pi.fromString(r.toString()):"resolvedImage"===t.type?r=fi.fromString(r.toString()):Ei(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),Ys(r,e.default,t.default)}Pi.register(ks,{error:[{kind:"error"},[$n],(e,[t])=>{throw new vi(t.evaluate(e))}],typeof:[$n,[ti],(e,[t])=>si(Ai(t.evaluate(e)))],"to-rgba":[oi(Yn,4),[Jn],(e,[t])=>t.evaluate(e).toArray()],rgb:[Jn,[Yn,Yn,Yn],zs],rgba:[Jn,[Yn,Yn,Yn,Yn],zs],hsl:[Jn,[Yn,Yn,Yn],Bs],hsla:[Jn,[Yn,Yn,Yn,Yn],Bs],has:{type:Kn,overloads:[[[$n],(e,[t])=>Rs(t.evaluate(e),e.properties())],[[$n,ei],(e,[t,r])=>Rs(t.evaluate(e),r.evaluate(e))]]},get:{type:ti,overloads:[[[$n],(e,[t])=>Fs(t.evaluate(e),e.properties())],[[$n,ei],(e,[t,r])=>Fs(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ti,[$n],(e,[t])=>Fs(t.evaluate(e),e.featureState||{})],properties:[ei,[],e=>e.properties()],"geometry-type":[$n,[],e=>e.geometryType()],id:[ti,[],e=>e.id()],zoom:[Yn,[],e=>e.globals.zoom],pitch:[Yn,[],e=>e.globals.pitch||0],"distance-from-center":[Yn,[],e=>e.distanceFromCenter()],"measure-light":[Yn,[$n],(e,[t])=>e.measureLight(t.evaluate(e))],"heatmap-density":[Yn,[],e=>e.globals.heatmapDensity||0],"line-progress":[Yn,[],e=>e.globals.lineProgress||0],"raster-value":[Yn,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[Yn,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[Yn,[],e=>e.globals.skyRadialProgress||0],accumulated:[ti,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Yn,js(Yn),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[Yn,js(Yn),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:Yn,overloads:[[[Yn,Yn],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[Yn],(e,[t])=>-t.evaluate(e)]]},"/":[Yn,[Yn,Yn],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[Yn,[Yn,Yn],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[Yn,[],()=>Math.LN2],pi:[Yn,[],()=>Math.PI],e:[Yn,[],()=>Math.E],"^":[Yn,[Yn,Yn],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[Yn,[Yn],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[Yn,[Yn],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[Yn,[Yn],(e,[t])=>Math.log(t.evaluate(e))],log2:[Yn,[Yn],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[Yn,[Yn],(e,[t])=>Math.sin(t.evaluate(e))],cos:[Yn,[Yn],(e,[t])=>Math.cos(t.evaluate(e))],tan:[Yn,[Yn],(e,[t])=>Math.tan(t.evaluate(e))],asin:[Yn,[Yn],(e,[t])=>Math.asin(t.evaluate(e))],acos:[Yn,[Yn],(e,[t])=>Math.acos(t.evaluate(e))],atan:[Yn,[Yn],(e,[t])=>Math.atan(t.evaluate(e))],min:[Yn,js(Yn),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[Yn,js(Yn),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[Yn,[Yn],(e,[t])=>Math.abs(t.evaluate(e))],round:[Yn,[Yn],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Yn,[Yn],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[Yn,[Yn],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[Kn,[$n,ti],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[Kn,[ti],(e,[t])=>e.id()===t.value],"filter-type-==":[Kn,[$n],(e,[t])=>e.geometryType()===t.value],"filter-<":[Kn,[$n,ti],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[Kn,[ti],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[Kn,[$n,ti],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[Kn,[ti],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[Kn,[$n,ti],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[Kn,[ti],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[Kn,[$n,ti],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[Kn,[ti],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[Kn,[ti],(e,[t])=>t.value in e.properties()],"filter-has-id":[Kn,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[Kn,[oi($n)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[Kn,[oi(ti)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[Kn,[$n,oi(ti)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[Kn,[$n,oi(ti)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Kn,overloads:[[[Kn,Kn],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[js(Kn),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:Kn,overloads:[[[Kn,Kn],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[js(Kn),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[Kn,[Kn],(e,[t])=>!t.evaluate(e)],"is-supported-script":[Kn,[$n],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[$n,[$n],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[$n,[$n],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[$n,js(ti),(e,t)=>t.map((t=>_i(t.evaluate(e)))).join("")],"resolved-locale":[$n,[ri],(e,[t])=>t.evaluate(e).resolvedLocale()],random:[Yn,[Yn,Yn,ti],(e,t)=>{const[r,n,i]=t.map((t=>t.evaluate(e)));if(r>n)return r;if(r===n)return r;let o;if("string"==typeof i)o=function(e){let t=0;if(0===e.length)return t;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}(i);else{if("number"!=typeof i)throw new vi(`Invalid seed input: ${i}`);o=i}return r+Ds(o)()*(n-r)}]});class ta{constructor(e,t,r,n){this.expression=e,this._warningHistory={},this._evaluator=new Ii(r,n),this._defaultValue=t?function(e){return"color"===e.type&&(qs(e.default)||Array.isArray(e.default))?new Un(0,0,0,0):"color"===e.type?Un.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,i,o,s,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,o,s,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new vi(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function ra(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in ks}function na(e,t,r,n){const i=new Go(ks,[],t?function(e){const t={color:Jn,string:$n,number:Yn,enum:$n,boolean:Kn,formatted:ni,resolvedImage:ii};return"array"===e.type?oi(t[e.value]||ti,e.length):t[e.type]}(t):void 0,void 0,void 0,r,n),o=i.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Ns(new ta(o,t,r,n)):Vs(i.errors)}class ia{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isLightConstant=r,this.isStateDependent="constant"!==e&&!No(t.expression),this.isConfigDependent=!Vo(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,o)}evaluate(e,t,r,n,i,o){return this._styleExpression.evaluate(e,t,r,n,i,o)}}class oa{constructor(e,t,r,n,i){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!No(t.expression),this.isLightConstant=i,this.isConfigDependent=!Vo(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,o)}evaluate(e,t,r,n,i,o){return this._styleExpression.evaluate(e,t,r,n,i,o)}interpolationFactor(e,t,r){return this.interpolationType?ds.interpolationFactor(this.interpolationType,e,t,r):0}}function sa(e,t,r,n){if("error"===(e=na(e,t,r,n)).result)return e;const i=e.value.expression,o=jo(i);if(!o&&!Hs(t))return Vs([new qn("","data expressions not supported")]);const s=Uo(i,["zoom","pitch","distance-from-center"]);if(!s&&!Zs(t))return Vs([new qn("","zoom expressions not supported")]);const a=Uo(i,["measure-light"]);if(!a&&!Gs(t))return Vs([new qn("","measure-light expression not supported")]);const l=t.expression&&t.expression.relaxZoomRestriction,c=la(i);return c||s||l?c instanceof qn?Vs([c]):c instanceof ds&&!Ws(t)?Vs([new qn("",'"interpolate" expressions cannot be used with this property')]):Ns(c?new oa(o?"camera":"composite",e.value,c.labels,c instanceof ds?c.interpolation:void 0,a):new ia(o?"constant":"source",e.value,a)):Vs([new qn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class aa{constructor(e,t){this._parameters=e,this._specification=t,Wn(this,Xs(this._parameters,this._specification))}static deserialize(e){return new aa(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function la(e){let t=null;if(e instanceof ms)t=la(e.result);else if(e instanceof fs){for(const r of e.args)if(t=la(r),t)break}else(e instanceof qo||e instanceof ds)&&e.input instanceof Pi&&"zoom"===e.input.name&&(t=e);return t instanceof qn||e.eachChild((e=>{const r=la(e);r instanceof qn?t=r:t&&r&&t!==r&&(t=new qn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}var ca=ha,ua=3;function ha(e,t,r){var n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var i=new Int32Array(this.arrayBuffer);e=i[0],this.d=(t=i[1])+2*(r=i[2]);for(var o=0;o<this.d*this.d;o++){var s=i[ua+o],a=i[ua+o+1];n.push(s===a?null:i.subarray(s,a))}var l=i[ua+n.length+1];this.keys=i.subarray(i[ua+n.length],l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var u=r/t*e;this.min=-u,this.max=e+u}ha.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},ha.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ha.prototype._insertCell=function(e,t,r,n,i,o){this.cells[i].push(o)},ha.prototype.query=function(e,t,r,n,i){var o=this.min,s=this.max;if(e<=o&&t<=o&&s<=r&&s<=n&&!i)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(e,t,r,n,this._queryCell,a,{},i),a},ha.prototype._queryCell=function(e,t,r,n,i,o,s,a){var l=this.cells[i];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===s[d]){var p=4*d;(a?a(u[p+0],u[p+1],u[p+2],u[p+3]):e<=u[p+2]&&t<=u[p+3]&&r>=u[p+0]&&n>=u[p+1])?(s[d]=!0,o.push(c[d])):s[d]=!1}}},ha.prototype._forEachCell=function(e,t,r,n,i,o,s,a){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),d=l;d<=u;d++)for(var p=c;p<=h;p++){var f=this.d*p+d;if((!a||a(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&i.call(this,e,t,r,n,f,o,s,a))return}},ha.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},ha.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},ha.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=ua+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(t+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=t,s=0;s<e.length;s++){var a=e[s];i[ua+s]=o,i.set(a,o),o+=a.length}return i[ua+e.length]=o,i.set(this.keys,o),i[ua+e.length+1]=o+=this.keys.length,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var da=h(ca);const pa={};function fa(e,t,r={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),pa[t]={klass:e,omit:r.omit||[]}}fa(Object,"Object"),da.serialize=function(e,t){const r=e.toArrayBuffer();return t&&t.add(r),{buffer:r}},da.deserialize=function(e){return new da(e.buffer)},Object.defineProperty(da,"name",{value:"Grid"}),fa(da,"Grid"),fa(Un,"Color"),fa(Error,"Error"),fa(pi,"Formatted"),fa(di,"FormattedSection"),fa(Yr,"AJAXError"),fa(fi,"ResolvedImage"),fa(aa,"StylePropertyFunction"),fa(ta,"StyleExpression",{omit:["_evaluator"]}),fa(oa,"ZoomDependentExpression"),fa(ia,"ZoomConstantExpression"),fa(Pi,"CompoundExpression",{omit:["_evaluate"]});for(const e in ks)pa[ks[e]._classRegistryKey]||fa(ks[e],`Expression${e}`);function ma(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function ga(e){return self.ImageBitmap&&e instanceof ImageBitmap}function Aa(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(ma(e)||ga(e))return t&&t.add(e),e;if(ArrayBuffer.isView(e)){const r=e;return t&&t.add(r.buffer),r}if(e instanceof ImageData)return t&&t.add(e.data.buffer),e;if(Array.isArray(e)){const r=[];for(const n of e)r.push(Aa(n,t));return r}if(e instanceof Map){const t={$name:"Map"};for(const[r,n]of e.entries())t[r]=Aa(n);return t}if("object"==typeof e){const r=e.constructor,n=r._classRegistryKey;if(!n)throw new Error(`can't serialize object of unregistered class ${n}`);const i=r.serialize?r.serialize(e,t):{};if(!r.serialize){for(const r in e)e.hasOwnProperty(r)&&(pa[n].omit.indexOf(r)>=0||(i[r]=Aa(e[r],t)));e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(i.$name=n),i}throw new Error("can't serialize object of type "+typeof e)}function _a(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||ma(e)||ga(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(_a);if("object"==typeof e){const t=e.$name||"Object";if("Map"===t){const t=new Map;for(const r of Object.keys(e))"$name"!==r&&t.set(r,_a(e[r]));return t}const{klass:r}=pa[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);const n=Object.create(r.prototype);for(const t of Object.keys(e))"$name"!==t&&(n[t]=_a(e[t]));return n}throw new Error("can't deserialize object of type "+typeof e)}const ya={"Latin-1 Supplement":e=>e>=128&&e<=255,Arabic:e=>e>=1536&&e<=1791,"Arabic Supplement":e=>e>=1872&&e<=1919,"Arabic Extended-A":e=>e>=2208&&e<=2303,"Hangul Jamo":e=>e>=4352&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>e>=5120&&e<=5759,Khmer:e=>e>=6016&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>e>=6320&&e<=6399,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"CJK Radicals Supplement":e=>e>=11904&&e<=12031,"Kangxi Radicals":e=>e>=12032&&e<=12255,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Bopomofo:e=>e>=12544&&e<=12591,"Hangul Compatibility Jamo":e=>e>=12592&&e<=12687,Kanbun:e=>e>=12688&&e<=12703,"Bopomofo Extended":e=>e>=12704&&e<=12735,"CJK Strokes":e=>e>=12736&&e<=12783,"Katakana Phonetic Extensions":e=>e>=12784&&e<=12799,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"CJK Unified Ideographs Extension A":e=>e>=13312&&e<=19903,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Yi Syllables":e=>e>=40960&&e<=42127,"Yi Radicals":e=>e>=42128&&e<=42191,"Hangul Jamo Extended-A":e=>e>=43360&&e<=43391,"Hangul Syllables":e=>e>=44032&&e<=55215,"Hangul Jamo Extended-B":e=>e>=55216&&e<=55295,"Private Use Area":e=>e>=57344&&e<=63743,"CJK Compatibility Ideographs":e=>e>=63744&&e<=64255,"Arabic Presentation Forms-A":e=>e>=64336&&e<=65023,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Arabic Presentation Forms-B":e=>e>=65136&&e<=65279,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519,"CJK Unified Ideographs Extension B":e=>e>=131072&&e<=173791};function va(e){for(const t of e)if(wa(t.charCodeAt(0)))return!0;return!1}function xa(e){for(const t of e)if(!ba(t.charCodeAt(0)))return!1;return!0}function ba(e){return!(ya.Arabic(e)||ya["Arabic Supplement"](e)||ya["Arabic Extended-A"](e)||ya["Arabic Presentation Forms-A"](e)||ya["Arabic Presentation Forms-B"](e))}function wa(e){return!(746!==e&&747!==e&&(e<4352||!(ya["Bopomofo Extended"](e)||ya.Bopomofo(e)||ya["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||ya["CJK Compatibility Ideographs"](e)||ya["CJK Compatibility"](e)||ya["CJK Radicals Supplement"](e)||ya["CJK Strokes"](e)||!(!ya["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||ya["CJK Unified Ideographs Extension A"](e)||ya["CJK Unified Ideographs"](e)||ya["Enclosed CJK Letters and Months"](e)||ya["Hangul Compatibility Jamo"](e)||ya["Hangul Jamo Extended-A"](e)||ya["Hangul Jamo Extended-B"](e)||ya["Hangul Jamo"](e)||ya["Hangul Syllables"](e)||ya.Hiragana(e)||ya["Ideographic Description Characters"](e)||ya.Kanbun(e)||ya["Kangxi Radicals"](e)||ya["Katakana Phonetic Extensions"](e)||ya.Katakana(e)&&12540!==e||!(!ya["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!ya["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||ya["Unified Canadian Aboriginal Syllabics"](e)||ya["Unified Canadian Aboriginal Syllabics Extended"](e)||ya["Vertical Forms"](e)||ya["Yijing Hexagram Symbols"](e)||ya["Yi Syllables"](e)||ya["Yi Radicals"](e))))}function Ca(e){return!(wa(e)||function(e){return!!(ya["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||ya["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||ya["Letterlike Symbols"](e)||ya["Number Forms"](e)||ya["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||ya["Control Pictures"](e)&&9251!==e||ya["Optical Character Recognition"](e)||ya["Enclosed Alphanumerics"](e)||ya["Geometric Shapes"](e)||ya["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||ya["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ya["CJK Symbols and Punctuation"](e)||ya.Katakana(e)||ya["Private Use Area"](e)||ya["CJK Compatibility Forms"](e)||ya["Small Form Variants"](e)||ya["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function Ea(e){return e>=1424&&e<=2303||ya["Arabic Presentation Forms-A"](e)||ya["Arabic Presentation Forms-B"](e)}function Ta(e,t){return!(!t&&Ea(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||ya.Khmer(e))}function Sa(e){for(const t of e)if(Ea(t.charCodeAt(0)))return!0;return!1}const Ma="deferred",Ia="loading",Pa="loaded";let La=null,Oa="unavailable",Da=null;const ka=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(Oa="error"),La&&La(e)};function za(){Ba.fire(new kn("pluginStateChange",{pluginStatus:Oa,pluginURL:Da}))}const Ba=new Bn,Ra=function(){return Oa},Fa=function(){if(Oa!==Ma||!Da)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Oa=Ia,za(),Da&&Jr({url:Da},(e=>{e?ka(e):(Oa=Pa,za())}))},ja={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Oa===Pa||null!=ja.applyArabicShaping,isLoading:()=>Oa===Ia,setState(e){Oa=e.pluginStatus,Da=e.pluginURL},isParsed:()=>null!=ja.applyArabicShaping&&null!=ja.processBidirectionalText&&null!=ja.processStyledBidirectionalText,getPluginURL:()=>Da};class Na{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch,this.brightness=t.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(e,t){for(const r of e)if(!Ta(r.charCodeAt(0),t))return!1;return!0}(e,ja.isLoaded())}}class Va{constructor(e,t,r,n){this.property=e,this.value=t,this.expression=function(e,t,r,n){if(qs(e))return new aa(e,t);if(ra(e)||Array.isArray(e)&&e.length>0){const i=sa(e,t,r,n);if("error"===i.result)throw new Error(i.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return i.value}{let r=e;return"string"==typeof e&&"color"===t.type&&(r=Un.parse(e)),{kind:"constant",isConfigDependent:!1,evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification,r,n)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class Ua{constructor(e,t,r){this.property=e,this.value=new Va(e,void 0,t,r)}transitioned(e,t){return new Ga(this.property,this.value,t,Jt({},e.transition,this.transition),e.now)}untransitioned(){return new Ga(this.property,this.value,null,{},0)}}class Ha{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=t,this._options=r,this.isConfigDependent=!1}getValue(e){return cr(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ua(this._values[e].property,this._scope,this._options)),this._values[e].value=new Va(this._values[e].property,null===t?void 0:cr(t),this._scope,this._options),this.isConfigDependent=this.isConfigDependent||this._values[e].value.expression.isConfigDependent}setTransitionOrValue(e,t){t&&(this._options=t);const r=this._properties.properties;if(e)for(const t in e){const n=e[t];if(sr(t,"-transition")){const e=t.slice(0,-11);r[e]&&this.setTransition(e,n)}else r[t]&&this.setValue(t,n)}}getTransition(e){return cr(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ua(this._values[e].property)),this._values[e].transition=cr(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r);const n=this.getTransition(t);void 0!==n&&(e[`${t}-transition`]=n)}return e}transitioned(e,t){const r=new Za(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(e,t._values[n]);return r}untransitioned(){const e=new Za(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Ga{constructor(e,t,r,n,i){const o=n.delay||0,s=n.duration||0;i=i||0,this.property=e,this.value=t,this.begin=i+o,this.end=this.begin+s,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){const n=e.now||0,i=this.value.possiblyEvaluate(e,t,r),o=this.prior;if(o){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return o.possiblyEvaluate(e,t,r);{const s=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,r),i,Wt(s))}}return i}}class Za{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){const n=new Qa(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Wa{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=t,this._options=r,this.isConfigDependent=!1}getValue(e){return cr(this._values[e].value)}setValue(e,t){this._values[e]=new Va(this._values[e].property,null===t?void 0:cr(t),this._scope,this._options),this.isConfigDependent=this.isConfigDependent||this._values[e].expression.isConfigDependent}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){const n=new Qa(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}}class qa{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n)}}class Qa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Xa{constructor(e){this.specification=e}possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,r){const n=Zn[this.specification.type];return n?n(e,t,r):e}}class Ya{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,n){return new qa(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)}:e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new qa(this,{kind:"constant",value:void 0},e.parameters);const n=Zn[this.specification.type];return n?new qa(this,{kind:"constant",value:n(e.value.value,t.value.value,r)},e.parameters):e}evaluate(e,t,r,n,i,o){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,o)}}class $a{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)}interpolate(){return!1}}class Ka{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new Na(0,{});for(const r in e){const n=e[r];n.specification.overridable&&this.overridableProperties.push(r);const i=this.defaultPropertyValues[r]=new Va(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new Ua(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate(t)}}}function Ja(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function el(e){if(Array.isArray(e))return e.map(el);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=el(e[r]);return t}return Ja(e)}fa(Ya,"DataDrivenProperty"),fa(Xa,"DataConstantProperty"),fa($a,"ColorRampProperty");var tl=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"required":false,"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"camera":{"type":"camera"},"imports":{"type":"array","value":"import"},"schema":{"type":"schema"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"},"models":{"type":"models"}},"model":{"type":"string","required":true},"import":{"id":{"type":"string","required":true},"url":{"type":"string","required":true},"config":{"type":"config"},"data":{"type":"$root"}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","required":true},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"id":{"type":"string","required":true},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"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},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false,"expression":{},"property-type":"data-constant"},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"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}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"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}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":1}},"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":1,"tms":1},"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":1}},"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},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":1}},"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},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"required":true,"type":"enum","values":{"raster-array":1}},"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},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"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"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":1}},"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":1}},"url":{"required":false,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"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_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"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":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"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","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"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","measure-light"],"relaxZoomRestriction":true},"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","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"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":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"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}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"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","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"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,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"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},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"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","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","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],"property-type":"constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"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","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"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"],"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,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"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-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"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":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"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","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"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"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","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"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"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 rl(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!rl(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function nl(e,t="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};rl(e)||(e=ul(e));const r=e;let n=!0;try{n=function(e){if(!sl(e))return e;let t=el(e);return ol(t),t=il(t),t}(r)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}const i=tl[`filter_${t}`],o=na(n,i);let s=null;if("error"===o.result)throw new Error(o.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s=(e,t,r)=>o.value.evaluate(e,t,{},r);let a=null,l=null;if(n!==r){const e=na(r,i);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a=(t,r,n,i,o)=>e.value.evaluate(t,r,{},n,void 0,void 0,i,o),l=!jo(e.value.expression)}return{filter:s,dynamicFilter:a||void 0,needGeometry:cl(n),needFeature:!!l}}function il(e){if(!Array.isArray(e))return e;const t=function(e){if(al.has(e[0]))for(let t=1;t<e.length;t++)if(sl(e[t]))return!0;return e}(e);return!0===t?t:t.map((e=>il(e)))}function ol(e){let t=!1;const r=[];if("case"===e[0]){for(let n=1;n<e.length-1;n+=2)t=t||sl(e[n]),r.push(e[n+1]);r.push(e[e.length-1])}else if("match"===e[0]){t=t||sl(e[1]);for(let t=2;t<e.length-1;t+=2)r.push(e[t+1]);r.push(e[e.length-1])}else if("step"===e[0]){t=t||sl(e[1]);for(let t=1;t<e.length-1;t+=2)r.push(e[t+1])}t&&(e.length=0,e.push("any",...r));for(let t=1;t<e.length;t++)ol(e[t])}function sl(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(sl(e[t]))return!0;return!1}const al=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function ll(e,t){return e<t?-1:e>t?1:0}function cl(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(cl(e[t]))return!0;return!1}function ul(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?hl(e[1],e[2],"=="):"!="===t?fl(hl(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?hl(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(ul))):"all"===t?["all"].concat(e.slice(1).map(ul)):"none"===t?["all"].concat(e.slice(1).map(ul).map(fl)):"in"===t?dl(e[1],e.slice(2)):"!in"===t?fl(dl(e[1],e.slice(2))):"has"===t?pl(e[1]):"!has"!==t||fl(pl(e[1]));var r}function hl(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function dl(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(ll)]]:["filter-in-small",e,["literal",t]]}}function pl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function fl(e){return["!",e]}const ml="";function gl(e,t){return t?`${e}${ml}${t}`:e}const Al="-transition",_l=new Set(["fill","line","background","hillshade","raster"]);class yl extends Bn{constructor(e,t,r,n){if(super(),this.id=e.id,this.fqid=gl(this.id,r),this.type=e.type,this.scope=r,this.options=n,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.isConfigDependent=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),e.slot&&(this.slot=e.slot),t.layout&&(this._unevaluatedLayout=new Wa(t.layout,this.scope,n),this.isConfigDependent=this.isConfigDependent||this._unevaluatedLayout.isConfigDependent),t.paint)){this._transitionablePaint=new Ha(t.paint,this.scope,n);for(const t in e.paint)this.setPaintProperty(t,e.paint[t]);for(const t in e.layout)this.setLayoutProperty(t,e.layout[t]);this.isConfigDependent=this.isConfigDependent||this._transitionablePaint.isConfigDependent,this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Qa(t.paint)}}onAdd(e){}onRemove(e){}isDraped(e){return _l.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){if("custom"===this.type&&"visibility"===e)return void(this.visibility=t);const r=this._unevaluatedLayout;r._properties.properties[e]&&(r.setValue(e,t),this.isConfigDependent=this.isConfigDependent||r.isConfigDependent,"visibility"===e&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0})}getPaintProperty(e){return sr(e,Al)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){const r=this._transitionablePaint,n=r._properties.properties;if(sr(e,Al)){const i=e.slice(0,-11);return n[i]&&r.setTransition(i,t||void 0),!1}if(!n[e])return!1;const i=r._values[e],o=i.value.isDataDriven(),s=i.value;r.setValue(e,t),this.isConfigDependent=this.isConfigDependent||r.isConfigDependent,this._handleSpecialPaintPropertyUpdate(e);const a=r._values[e].value,l=a.isDataDriven(),c=sr(e,"pattern")||"line-dasharray"===e;return l||o||c||this._handleOverridablePaintPropertyUpdate(e,s,a)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,t){return null}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){return lr({id:this.id,type:this.type,slot:this.slot,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()},((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof qa&&Hs(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=nl(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,t,r,n,i,o,s,a,l){}queryIntersectsMatchingFeature(e,t,r,n){}}const vl={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class xl{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class bl{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.add(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() 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 wl(e,t=1){let r=0,n=0;return{members:e.map((e=>{const i=vl[e.type].BYTES_PER_ELEMENT,o=r=Cl(r,Math.max(t,i)),s=e.components||1;return n=Math.max(n,i),r+=i*s,{name:e.name,type:e.type,components:s,offset:o}})),size:Cl(r,Math.max(n,t)),alignment:t}}function Cl(e,t){return Math.ceil(e/t)*t}class El extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e}}El.prototype.bytesPerElement=4,fa(El,"StructArrayLayout2i4");class Tl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e}}Tl.prototype.bytesPerElement=6,fa(Tl,"StructArrayLayout3i6");class Sl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,e}}Sl.prototype.bytesPerElement=8,fa(Sl,"StructArrayLayout4i8");class Ml extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const s=5*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,e}}Ml.prototype.bytesPerElement=10,fa(Ml,"StructArrayLayout5i10");class Il extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o,s)}emplace(e,t,r,n,i,o,s,a){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.uint8[c+4]=n,this.uint8[c+5]=i,this.uint8[c+6]=o,this.uint8[c+7]=s,this.float32[u+2]=a,e}}Il.prototype.bytesPerElement=12,fa(Il,"StructArrayLayout2i4ub1f12");class Pl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,e}}Pl.prototype.bytesPerElement=16,fa(Pl,"StructArrayLayout4f16");class Ll extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e}}Ll.prototype.bytesPerElement=8,fa(Ll,"StructArrayLayout2f8");class Ol extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const s=6*e,a=3*e;return this.uint16[s+0]=t,this.uint16[s+1]=r,this.uint16[s+2]=n,this.uint16[s+3]=i,this.float32[a+2]=o,e}}Ol.prototype.bytesPerElement=12,fa(Ol,"StructArrayLayout4ui1f12");class Dl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=r,this.uint16[o+2]=n,this.uint16[o+3]=i,e}}Dl.prototype.bytesPerElement=8,fa(Dl,"StructArrayLayout4ui8");class kl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,o)}emplace(e,t,r,n,i,o,s){const a=6*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,this.int16[a+4]=o,this.int16[a+5]=s,e}}kl.prototype.bytesPerElement=12,fa(kl,"StructArrayLayout6i12");class zl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s,a,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,r,n,i,o,s,a,l,c,u,h)}emplace(e,t,r,n,i,o,s,a,l,c,u,h,d){const p=12*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=o,this.uint16[p+5]=s,this.uint16[p+6]=a,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=d,e}}zl.prototype.bytesPerElement=24,fa(zl,"StructArrayLayout4i4ui4i24");class Bl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,o)}emplace(e,t,r,n,i,o,s){const a=10*e,l=5*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.float32[l+2]=i,this.float32[l+3]=o,this.float32[l+4]=s,e}}Bl.prototype.bytesPerElement=20,fa(Bl,"StructArrayLayout3i3f20");class Rl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}Rl.prototype.bytesPerElement=4,fa(Rl,"StructArrayLayout1ul4");class Fl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e}}Fl.prototype.bytesPerElement=4,fa(Fl,"StructArrayLayout2ui4");class jl extends bl{_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(e,t,r,n,i,o,s,a,l,c,u,h,d){const p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,n,i,o,s,a,l,c,u,h,d)}emplace(e,t,r,n,i,o,s,a,l,c,u,h,d,p){const f=20*e,m=10*e;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.int16[f+4]=o,this.float32[m+3]=s,this.float32[m+4]=a,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[f+14]=u,this.uint32[m+8]=h,this.uint16[f+18]=d,this.uint16[f+19]=p,e}}jl.prototype.bytesPerElement=40,fa(jl,"StructArrayLayout5i4f1i1ul2ui40");class Nl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o,s)}emplace(e,t,r,n,i,o,s,a){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+4]=i,this.int16[l+5]=o,this.int16[l+6]=s,this.int16[l+7]=a,e}}Nl.prototype.bytesPerElement=16,fa(Nl,"StructArrayLayout3i2i2i16");class Vl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const s=4*e,a=8*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=n,this.int16[a+6]=i,this.int16[a+7]=o,e}}Vl.prototype.bytesPerElement=16,fa(Vl,"StructArrayLayout2f1f2i16");class Ul extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=12*e,s=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[s+1]=n,this.float32[s+2]=i,e}}Ul.prototype.bytesPerElement=12,fa(Ul,"StructArrayLayout2ub2f12");class Hl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e}}Hl.prototype.bytesPerElement=6,fa(Hl,"StructArrayLayout3ui6");class Gl extends bl{_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(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v){const x=this.length;return this.resize(x+1),this.emplace(x,e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v)}emplace(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x){const b=30*e,w=15*e,C=60*e;return this.int16[b+0]=t,this.int16[b+1]=r,this.int16[b+2]=n,this.float32[w+2]=i,this.float32[w+3]=o,this.uint16[b+8]=s,this.uint16[b+9]=a,this.uint32[w+5]=l,this.uint32[w+6]=c,this.uint32[w+7]=u,this.uint16[b+16]=h,this.uint16[b+17]=d,this.uint16[b+18]=p,this.float32[w+10]=f,this.float32[w+11]=m,this.uint8[C+48]=g,this.uint8[C+49]=A,this.uint8[C+50]=_,this.uint32[w+13]=y,this.int16[b+28]=v,this.uint8[C+58]=x,e}}Gl.prototype.bytesPerElement=60,fa(Gl,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Zl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x,b,w,C,E,T,S,M,I,P,L){const O=this.length;return this.resize(O+1),this.emplace(O,e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x,b,w,C,E,T,S,M,I,P,L)}emplace(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x,b,w,C,E,T,S,M,I,P,L,O){const D=20*e,k=40*e,z=80*e;return this.float32[D+0]=t,this.float32[D+1]=r,this.int16[k+4]=n,this.int16[k+5]=i,this.int16[k+6]=o,this.int16[k+7]=s,this.int16[k+8]=a,this.int16[k+9]=l,this.int16[k+10]=c,this.int16[k+11]=u,this.int16[k+12]=h,this.uint16[k+13]=d,this.uint16[k+14]=p,this.uint16[k+15]=f,this.uint16[k+16]=m,this.uint16[k+17]=g,this.uint16[k+18]=A,this.uint16[k+19]=_,this.uint16[k+20]=y,this.uint16[k+21]=v,this.uint16[k+22]=x,this.uint16[k+23]=b,this.uint16[k+24]=w,this.uint16[k+25]=C,this.uint16[k+26]=E,this.uint16[k+27]=T,this.uint32[D+14]=S,this.float32[D+15]=M,this.float32[D+16]=I,this.float32[D+17]=P,this.float32[D+18]=L,this.uint8[z+76]=O,e}}Zl.prototype.bytesPerElement=80,fa(Zl,"StructArrayLayout2f9i15ui1ul4f1ub80");class Wl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}Wl.prototype.bytesPerElement=4,fa(Wl,"StructArrayLayout1f4");class ql extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const s=5*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=n,this.float32[s+3]=i,this.float32[s+4]=o,e}}ql.prototype.bytesPerElement=20,fa(ql,"StructArrayLayout5f20");class Ql extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o,s)}emplace(e,t,r,n,i,o,s,a){const l=7*e;return this.float32[l+0]=t,this.float32[l+1]=r,this.float32[l+2]=n,this.float32[l+3]=i,this.float32[l+4]=o,this.float32[l+5]=s,this.float32[l+6]=a,e}}Ql.prototype.bytesPerElement=28,fa(Ql,"StructArrayLayout7f28");class Xl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=r,this.uint16[o+3]=n,this.uint16[o+4]=i,e}}Xl.prototype.bytesPerElement=12,fa(Xl,"StructArrayLayout1ul3ui12");class Yl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}Yl.prototype.bytesPerElement=2,fa(Yl,"StructArrayLayout1ui2");class $l extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}$l.prototype.bytesPerElement=12,fa($l,"StructArrayLayout3f12");class Kl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m)}emplace(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g){const A=16*e;return this.float32[A+0]=t,this.float32[A+1]=r,this.float32[A+2]=n,this.float32[A+3]=i,this.float32[A+4]=o,this.float32[A+5]=s,this.float32[A+6]=a,this.float32[A+7]=l,this.float32[A+8]=c,this.float32[A+9]=u,this.float32[A+10]=h,this.float32[A+11]=d,this.float32[A+12]=p,this.float32[A+13]=f,this.float32[A+14]=m,this.float32[A+15]=g,e}}Kl.prototype.bytesPerElement=64,fa(Kl,"StructArrayLayout16f64");class Jl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o,s)}emplace(e,t,r,n,i,o,s,a){const l=10*e,c=5*e;return this.uint16[l+0]=t,this.uint16[l+1]=r,this.uint16[l+2]=n,this.uint16[l+3]=i,this.float32[c+2]=o,this.float32[c+3]=s,this.float32[c+4]=a,e}}Jl.prototype.bytesPerElement=20,fa(Jl,"StructArrayLayout4ui3f20");class ec extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.int16[1*e+0]=t,e}}ec.prototype.bytesPerElement=2,fa(ec,"StructArrayLayout1i2");class tc extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint8[1*e+0]=t,e}}tc.prototype.bytesPerElement=1,fa(tc,"StructArrayLayout1ub1");class rc extends xl{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]}}rc.prototype.size=40;class nc extends jl{get(e){return new rc(this,e)}}fa(nc,"CollisionBoxArray");class ic extends xl{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(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}ic.prototype.size=60;class oc extends Gl{get(e){return new ic(this,e)}}fa(oc,"PlacedSymbolArray");class sc extends xl{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}}sc.prototype.size=80;class ac extends Zl{get(e){return new sc(this,e)}}fa(ac,"SymbolInstanceArray");class lc extends Wl{getoffsetX(e){return this.float32[1*e+0]}}fa(lc,"GlyphOffsetArray");class cc extends El{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}fa(cc,"SymbolLineVertexArray");class uc extends xl{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]}}uc.prototype.size=12;class hc extends Xl{get(e){return new uc(this,e)}}fa(hc,"FeatureIndexArray");class dc extends Fl{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}fa(dc,"FillExtrusionCentroidArray");const pc=wl([{name:"a_pos",components:2,type:"Int16"}],4),fc=wl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class mc{constructor(e=[]){this.segments=e}_prepareSegment(e,t,r,n){let i=this.segments[this.segments.length-1];return e>mc.MAX_VERTEX_ARRAY_LENGTH&&hr(`Max vertices per segment is ${mc.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>mc.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t,primitiveOffset:r,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}prepareSegment(e,t,r,n){return this._prepareSegment(e,t.length,r.length,n)}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,r,n){return new mc([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function gc(e,t){return 256*(e=Xt(Math.floor(e),0,255))+Xt(Math.floor(t),0,255)}mc.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,fa(mc,"SegmentVector");const Ac=wl([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),_c=wl([{name:"a_dash",components:4,type:"Uint16"}]);class yc{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,t,r,n){this.ids.push(vc(e)),this.positions.push(t,r,n)}eachPosition(e,t){const r=vc(e);let n=0,i=this.ids.length-1;for(;n<i;){const e=n+i>>1;this.ids[e]>=r?i=e:n=e+1}for(;this.ids[n]===r;)t(this.positions[3*n],this.positions[3*n+1],this.positions[3*n+2]),n++}static serialize(e,t){const r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return xc(r,n,0,r.length-1),t&&(t.add(r.buffer),t.add(n.buffer)),{ids:r,positions:n}}static deserialize(e){const t=new yc;let r;t.ids=e.ids,t.positions=e.positions;for(const e of t.ids)e!==r&&t.uniqueIds.push(e),r=e;return t.indexed=!0,t}}function vc(e){const t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:Ln(String(e))}function xc(e,t,r,n){for(;r<n;){const i=e[r+n>>1];let o=r-1,s=n+1;for(;;){do{o++}while(e[o]<i);do{s--}while(e[s]>i);if(o>=s)break;bc(e,o,s),bc(t,3*o,3*s),bc(t,3*o+1,3*s+1),bc(t,3*o+2,3*s+2)}s-r<n-s?(xc(e,t,r,s),r=s+1):(xc(e,t,s+1,n),n=s)}}function bc(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}fa(yc,"FeaturePositionMap");class wc{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}set(e,t,r){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class Cc extends wc{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}}class Ec extends wc{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))}}class Tc extends wc{constructor(e){super(e),this.current=[0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1])))}}class Sc extends wc{constructor(e){super(e),this.current=[0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2])))}}class Mc extends wc{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3])))}}class Ic extends wc{constructor(e){super(e),this.current=Un.transparent}set(e,t,r){this.fetchUniformLocation(e,t)&&(r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a)))}}const Pc=new Float32Array(16);class Lc extends wc{constructor(e){super(e),this.current=Pc}set(e,t,r){if(this.fetchUniformLocation(e,t)){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let e=1;e<16;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}}}const Oc=new Float32Array(9),Dc=new Float32Array(4);class kc extends wc{constructor(e){super(e),this.current=Dc}set(e,t,r){if(this.fetchUniformLocation(e,t))for(let e=0;e<4;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix2fv(this.location,!1,r);break}}}function zc(e){return[gc(255*e.r,255*e.g),gc(255*e.b,255*e.a)]}class Bc{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r}setUniform(e,t,r,n,i){t.set(e,i,n.constantOr(this.value))}getBinding(e,t){return"color"===this.type?new Ic(e):new Ec(e)}}class Rc{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,t,r,n,i){const o="u_pattern"===i||"u_dash"===i?this.pattern:"u_pixel_ratio"===i?this.pixelRatio:null;o&&t.set(e,i,o)}getBinding(e,t){return"u_pattern"===t||"u_dash"===t?new Mc(e):new Ec(e)}}class Fc{constructor(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(e,t,r,n,i,o,s){const a=this.paintVertexArray.length,l=this.expression.evaluate(new Na(0,{brightness:o}),t,{},i,n,s);this.paintVertexArray.resize(e),this._setPaintValue(a,e,l)}updatePaintArray(e,t,r,n,i,o,s){const a=this.expression.evaluate({zoom:0,brightness:s},r,n,void 0,i);this._setPaintValue(e,t,a)}_setPaintValue(e,t,r){if("color"===this.type){const n=zc(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class jc{constructor(e,t,r,n,i,o){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,r,n,i,o,s){const a=this.expression.evaluate(new Na(this.zoom,{brightness:o}),t,{},i,n,s),l=this.expression.evaluate(new Na(this.zoom+1,{brightness:o}),t,{},i,n,s),c=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(c,e,a,l)}updatePaintArray(e,t,r,n,i,o,s){const a=this.expression.evaluate({zoom:this.zoom,brightness:s},r,n,void 0,i),l=this.expression.evaluate({zoom:this.zoom+1,brightness:s},r,n,void 0,i);this._setPaintValue(e,t,a,l)}_setPaintValue(e,t,r,n){if("color"===this.type){const i=zc(r),o=zc(n);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1],o[0],o[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,r,n,i){const o=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,s=Xt(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);t.set(e,i,s)}getBinding(e,t){return new Ec(e)}}class Nc{constructor(e,t,r,n,i){this.expression=e,this.layerId=i,this.paintVertexAttributes=("array"===r?_c:Ac).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new n}populatePaintArray(e,t,r){const n=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(n,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,n,i,o,s){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],o)}_setPaintValues(e,t,r,n){if(!n||!r)return;const i=n[r];if(!i)return;const{tl:o,br:s,pixelRatio:a}=i;for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,o[0],o[1],s[0],s[1],a)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Vc{constructor(e,t,r=(()=>!0)){this.binders={},this._buffers=[];const n=[];for(const i in e.paint._values){const o=e.paint.get(i);if(!r(i))continue;if(!(o instanceof qa&&Hs(o.property.specification)))continue;const s=Gc(i,e.type),a=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,u="line-dasharray"===i||i.endsWith("pattern"),h="line-dasharray"===i&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==a.kind||h)if("source"===a.kind||h||u){const t=qc(i,l,"source");this.binders[i]=u?new Nc(a,s,l,t,e.id):new Fc(a,s,l,t),n.push(`/a_${i}`)}else{const e=qc(i,l,"composite");this.binders[i]=new jc(a,s,l,c,t,e),n.push(`/z_${i}`)}else this.binders[i]=u?new Rc(a.value,s):new Bc(a.value,s,l),n.push(`/u_${i}`)}this.cacheKey=n.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof Fc||t instanceof jc?t.maxValue:0}populatePaintArrays(e,t,r,n,i,o,s){for(const a in this.binders){const l=this.binders[a];(l instanceof Fc||l instanceof jc||l instanceof Nc)&&l.populatePaintArray(e,t,r,n,i,o,s)}}setConstantPatternPositions(e){for(const t in this.binders){const r=this.binders[t];r instanceof Rc&&r.setConstantPatternPositions(e)}}updatePaintArrays(e,t,r,n,i,o,s,a){let l=!1;const c=Object.keys(e),u=0!==c.length,h=u?c:t.uniqueIds;for(const c in this.binders){const d=this.binders[c];if((d instanceof Fc||d instanceof jc||d instanceof Nc)&&(!0===d.expression.isStateDependent||!1===d.expression.isLightConstant)){const p=i.paint.get(c);d.expression=p.value;for(const r of h){const i=e[r.toString()];t.eachPosition(r,((e,t,r)=>{const l=n.feature(e);d.updatePaintArray(t,r,l,i,o,s,a)}))}if(!u)for(const t of r.uniqueIds){const i=e[t.toString()];r.eachPosition(t,((e,t,r)=>{const l=n.feature(e);d.updatePaintArray(t,r,l,i,o,s,a)}))}l=!0}}return l}defines(){const e=[];for(const t in this.binders){const r=this.binders[t];(r instanceof Bc||r instanceof Rc)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Fc||r instanceof jc||r instanceof Nc)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Bc||r instanceof Rc||r instanceof jc)for(const t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const r in this.binders){const n=this.binders[r];if(n instanceof Bc||n instanceof Rc||n instanceof jc)for(const i of n.uniformNames)t.push({name:i,property:r,binding:n.getBinding(e,i)})}return t}setUniforms(e,t,r,n,i){for(const{name:t,property:o,binding:s}of r)this.binders[o].setUniform(e,s,i,n.get(o),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof Fc||t instanceof jc||t instanceof Nc)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer)}}upload(e){for(const t in this.binders){const r=this.binders[t];(r instanceof Fc||r instanceof jc||r instanceof Nc)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof Fc||t instanceof jc||t instanceof Nc)&&t.destroy()}}}class Uc{constructor(e,t,r=(()=>!0)){this.programConfigurations={};for(const n of e)this.programConfigurations[n.id]=new Vc(n,t,r);this.needsUpload=!1,this._featureMap=new yc,this._featureMapWithoutIds=new yc,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,t,r,n,i,o,s,a){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,n,i,o,s,a);void 0!==t.id?this._featureMap.add(t.id,r,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,r,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,n,i,o){for(const s of r)this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,t,s,n,i,o||0)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Hc={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"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 Gc(e,t){return Hc[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const Zc={"line-pattern":{source:Ol,composite:Ol},"fill-pattern":{source:Ol,composite:Ol},"fill-extrusion-pattern":{source:Ol,composite:Ol},"line-dasharray":{source:Dl,composite:Dl}},Wc={color:{source:Ll,composite:Pl},number:{source:Wl,composite:Ll}};function qc(e,t,r){const n=Zc[e];return n&&n[r]||Wc[t][r]}fa(Bc,"ConstantBinder"),fa(Rc,"PatternConstantBinder"),fa(Fc,"SourceExpressionBinder"),fa(Nc,"PatternCompositeBinder"),fa(jc,"CompositeExpressionBinder"),fa(Vc,"ProgramConfiguration",{omit:["_buffers"]}),fa(Uc,"ProgramConfigurationSet");const Qc=io/Math.PI/2,Xc=5,Yc=6,$c=16383,Kc=64,Jc=[Kc,32,16],eu=-Qc,tu=Qc;function ru(e,t,r,n=Qc){return r=Ht(r),[e*Math.sin(r)*n,-t*n,e*Math.cos(r)*n]}function nu(e,t,r){return ru(Math.cos(Ht(e)),Math.sin(Ht(e)),t,r)}const iu=6371008.8,ou=2*Math.PI*iu;class su{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new su($t(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return iu*Math.acos(Math.min(i,1))}toBounds(e=0){const t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new au({lng:this.lng-r,lat:this.lat-t},{lng:this.lng+r,lat:this.lat+t})}toEcef(e){return nu(this.lat,this.lng,Qc+e*Qc/iu)}static convert(e){if(e instanceof su)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new su(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new su(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class au{constructor(e,t){if(e)if(t)this.setSouthWest(e).setNorthEast(t);else if(4===e.length){const t=e;this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]])}else{const t=e;this.setSouthWest(t[0]).setNorthEast(t[1])}}setNorthEast(e){return this._ne=e instanceof su?new su(e.lng,e.lat):su.convert(e),this}setSouthWest(e){return this._sw=e instanceof su?new su(e.lng,e.lat):su.convert(e),this}extend(e){const t=this._sw,r=this._ne;let n,i;if(e instanceof su)n=e,i=e;else{if(!(e instanceof au))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(au.convert(e)):this.extend(su.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(su.convert(e)):this;if(n=e._sw,i=e._ne,!n||!i)return this}return t||r?(t.lng=Math.min(n.lng,t.lng),t.lat=Math.min(n.lat,t.lat),r.lng=Math.max(i.lng,r.lng),r.lat=Math.max(i.lat,r.lat)):(this._sw=new su(n.lng,n.lat),this._ne=new su(i.lng,i.lat)),this}getCenter(){return new su((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 su(this.getWest(),this.getNorth())}getSouthEast(){return new su(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(e){const{lng:t,lat:r}=su.convert(e);let n=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n}static convert(e){return!e||e instanceof au?e:new au(e)}}var lu={};!function(e,t){!function(e){function t(e,t,n){var i=r(256*e,256*(t=Math.pow(2,n)-t-1),n),o=r(256*(e+1),256*(t+1),n);return i[0]+","+i[1]+","+o[0]+","+o[1]}function r(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}e.getURL=function(e,r,n,i,o,s){return s=s||{},e+"?"+["bbox="+t(n,i,o),"format="+(s.format||"image/png"),"service="+(s.service||"WMS"),"version="+(s.version||"1.1.1"),"request="+(s.request||"GetMap"),"srs="+(s.srs||"EPSG:3857"),"width="+(s.width||256),"height="+(s.height||256),"layers="+r].join("&")},e.getTileBBox=t,e.getMercCoords=r,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,lu);var cu=lu;class uu{constructor(e,t,r){this.z=e,this.x=t,this.y=r,this.key=pu(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t){const r=cu.getTileBBox(this.x,this.y,this.z),n=function(e,t,r){let n,i="";for(let o=e;o>0;o--)n=1<<o-1,i+=(t&n?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)}toString(){return`${this.z}/${this.x}/${this.y}`}}class hu{constructor(e,t){this.wrap=e,this.canonical=t,this.key=pu(e,t.z,t.z,t.x,t.y)}}class du{constructor(e,t,r,n,i){this.overscaledZ=e,this.wrap=t,this.canonical=new uu(r,+n,+i),this.key=0===t&&e===r?this.canonical.key:pu(t,e,r,n,i)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new du(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new du(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return pu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const r=this.canonical.z-e;return pu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new du(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new du(t,this.wrap,t,r,n),new du(t,this.wrap,t,r+1,n),new du(t,this.wrap,t,r,n+1),new du(t,this.wrap,t,r+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new du(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new du(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new hu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function pu(e,t,r,n,i){const o=1<<Math.min(r,22);let s=o*(i%o)+n%o;return e&&r<22&&(s+=o*o*((e<0?-2*e-1:2*e)%(1<<2*(22-r)))),16*(32*s+r)+(t-r)}const fu=[e=>{let t=e.canonical.x-1,r=e.wrap;return t<0&&(t=(1<<e.canonical.z)-1,r--),new du(e.overscaledZ,r,e.canonical.z,t,e.canonical.y)},e=>{let t=e.canonical.x+1,r=e.wrap;return t===1<<e.canonical.z&&(t=0,r++),new du(e.overscaledZ,r,e.canonical.z,t,e.canonical.y)},e=>new du(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new du(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)];fa(uu,"CanonicalTileID"),fa(du,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const mu=0,gu=25.5;function Au(e){return ou*Math.cos(e*Math.PI/180)}function _u(e){return(180+e)/360}function yu(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function vu(e,t){return e/Au(t)}function xu(e){return 360*e-180}function bu(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function wu(e,t){return e*Au(bu(t))}const Cu=85.051129;function Eu(e){return Math.cos(Ht(Xt(e,-Cu,Cu)))}function Tu(e,t){const r=Xt(t,mu,gu),n=Math.pow(2,r);return Eu(e)*ou/(512*n)}function Su(e){return 1/Math.cos(e*Math.PI/180)}function Mu(e,t=0){const r=Math.exp(Math.PI*(1-(e.y+t/io)/(1<<e.z)*2));return 80150034*r/(r*r+1)/io/(1<<e.z)}class Iu{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e,t=0){const r=su.convert(e);return new Iu(_u(r.lng),yu(r.lat),vu(t,r.lat))}toLngLat(){return new su(xu(this.x),bu(this.y))}toAltitude(){return wu(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/ou*Su(bu(this.y))}}function Pu(e,t,r,n,i,o,s,a,l){const c=(t+n)/2,u=(r+i)/2,h=new Nt(c,u);a(h),function(e,t,r,n,i,o){const s=r-i,a=n-o;return Math.abs((n-t)*s-(r-e)*a)/Math.hypot(s,a)}(h.x,h.y,o.x,o.y,s.x,s.y)>=l?(Pu(e,t,r,c,u,o,h,a,l),Pu(e,c,u,n,i,h,s,a,l)):e.push(s)}function Lu(e,t,r){let n=e[0],i=n.x,o=n.y;t(n);const s=[n];for(let a=1;a<e.length;a++){const l=e[a],{x:c,y:u}=l;t(l),Pu(s,i,o,c,u,n,l,t,r),i=c,o=u,n=l}return s}function Ou(e,t,r,n){if(n(t,r)){const i=t.add(r)._mult(.5);Ou(e,t,i,n),Ou(e,i,r,n)}else e.push(r)}function Du(e,t){let r=e[0];const n=[r];for(let i=1;i<e.length;i++){const o=e[i];Ou(n,r,o,t),r=o}return n}const ku=Math.pow(2,14)-1,zu=-ku-1;function Bu(e,t){const r=Math.round(e.x*t),n=Math.round(e.y*t);return e.x=Xt(r,zu,ku),e.y=Xt(n,zu,ku),(r<e.x||r>e.x+1||n<e.y||n>e.y+1)&&hr("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function Ru(e,t,r){const n=e.loadGeometry(),i=e.extent,o=io/i;if(t&&r&&r.projection.isReprojectedInTileSpace){const o=1<<t.z,{scale:s,x:a,y:l,projection:c}=r,u=e=>{const r=xu((t.x+e.x/i)/o),n=bu((t.y+e.y/i)/o),u=c.project(r,n);e.x=(u.x*s-a)*i,e.y=(u.y*s-l)*i};for(let t=0;t<n.length;t++)if(1!==e.type)n[t]=Lu(n[t],u,1);else{const e=[];for(const r of n[t])r.x<0||r.x>=i||r.y<0||r.y>=i||(u(r),e.push(r));n[t]=e}}for(const e of n)for(const t of e)Bu(t,o);return n}function Fu(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Ru(e):[]}}function ju(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}function Nu(e,t,r){const n=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*n,r[1]*n,r[2]*n)}class Vu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new El,this.indexArray=new Hl,this.segments=new mc,this.programConfigurations=new Uc(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r,n){const i=this.layers[0],o=[];let s=null;"circle"===i.type&&(s=i.layout.get("circle-sort-key"));for(const{feature:t,id:i,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Fu(t,e);if(!this.layers[0]._featureFilter.filter(new Na(this.zoom),c,r))continue;const u=s?s.evaluate(c,{},r):void 0,h={id:i,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Ru(t,r,n),patterns:{},sortKey:u};o.push(h)}s&&o.sort(((e,t)=>e.sortKey-t.sortKey));let a=null;"globe"===n.projection.name&&(this.globeExtVertexArray=new kl,a=n.projection);for(const n of o){const{geometry:i,index:o,sourceLayerIndex:s}=n,l=e[o].feature;this.addFeature(n,i,o,t.availableImages,r,a,t.brightness),t.featureIndex.insert(l,i,o,s,this.index)}}update(e,t,r,n,i){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,n,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,pc.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,fc.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,t,r,n,i,o,s){for(const r of t)for(const t of r){const r=t.x,n=t.y;if(r<0||r>=io||n<0||n>=io)continue;if(o){const e=o.projectTilePoint(r,n,i),t=o.upVector(i,r,n),s=this.globeExtVertexArray;Nu(s,e,t),Nu(s,e,t),Nu(s,e,t),Nu(s,e,t)}const s=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=s.vertexLength;ju(this.layoutVertexArray,r,n,-1,-1),ju(this.layoutVertexArray,r,n,1,-1),ju(this.layoutVertexArray,r,n,1,1),ju(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+2,a+3),s.vertexLength+=4,s.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n,i,s)}}function Uu(e,t){for(let r=0;r<e.length;r++)if($u(t,e[r]))return!0;for(let r=0;r<t.length;r++)if($u(e,t[r]))return!0;return!!Wu(e,t)}function Hu(e,t,r){return!!$u(e,t)||!!Qu(t,e,r)}function Gu(e,t){if(1===e.length)return Yu(t,e[0]);for(let r=0;r<t.length;r++){const n=t[r];for(let t=0;t<n.length;t++)if($u(e,n[t]))return!0}for(let r=0;r<e.length;r++)if(Yu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Wu(e,t[r]))return!0;return!1}function Zu(e,t,r){if(e.length>1){if(Wu(e,t))return!0;for(let n=0;n<t.length;n++)if(Qu(t[n],e,r))return!0}for(let n=0;n<e.length;n++)if(Qu(e[n],t,r))return!0;return!1}function Wu(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){const n=e[r],i=e[r+1];for(let e=0;e<t.length-1;e++)if(qu(n,i,t[e],t[e+1]))return!0}return!1}function qu(e,t,r,n){return dr(e,r,n)!==dr(t,r,n)&&dr(e,t,r)!==dr(e,t,n)}function Qu(e,t,r){const n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(let r=1;r<t.length;r++)if(Xu(e,t[r-1],t[r])<n)return!0;return!1}function Xu(e,t,r){const n=t.distSqr(r);if(0===n)return e.distSqr(t);const i=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return e.distSqr(i<0?t:i>1?r:r.sub(t)._mult(i)._add(t))}function Yu(e,t){let r,n,i,o=!1;for(let s=0;s<e.length;s++){r=e[s];for(let e=0,s=r.length-1;e<r.length;s=e++)n=r[e],i=r[s],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(o=!o)}return o}function $u(e,t){let r=!1;for(let n=0,i=e.length-1;n<e.length;i=n++){const o=e[n],s=e[i];o.y>t.y!=s.y>t.y&&t.x<(s.x-o.x)*(t.y-o.y)/(s.y-o.y)+o.x&&(r=!r)}return r}function Ku(e,t,r,n,i){for(const o of e)if(t<=o.x&&r<=o.y&&n>=o.x&&i>=o.y)return!0;const o=[new Nt(t,r),new Nt(t,i),new Nt(n,i),new Nt(n,r)];if(e.length>2)for(const t of o)if($u(e,t))return!0;for(let t=0;t<e.length-1;t++)if(Ju(e[t],e[t+1],o))return!0;return!1}function Ju(e,t,r){const n=r[0],i=r[2];if(e.x<n.x&&t.x<n.x||e.x>i.x&&t.x>i.x||e.y<n.y&&t.y<n.y||e.y>i.y&&t.y>i.y)return!1;const o=dr(e,t,r[0]);return o!==dr(e,t,r[1])||o!==dr(e,t,r[2])||o!==dr(e,t,r[3])}function eh(e,t,r,n,i,o){let s=t.y-e.y,a=e.x-t.x;if(o=o||0){const e=s*s+a*a;if(0===e)return!0;const t=Math.sqrt(e);s/=t,a/=t}return!((r.x-e.x)*s+(r.y-e.y)*a-o<0||(n.x-e.x)*s+(n.y-e.y)*a-o<0||(i.x-e.x)*s+(i.y-e.y)*a-o<0)}function th(e,t,r,n,i,o,s){return!(eh(e,t,n,i,o,s)||eh(t,r,n,i,o,s)||eh(r,e,n,i,o,s)||eh(n,i,e,t,r,s)||eh(i,o,e,t,r,s)||eh(o,n,e,t,r,s))}function rh(e,t,r){const n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function nh(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function ih(e,t,r,n,i){if(!t[0]&&!t[1])return e;const o=Nt.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);const s=[];for(let t=0;t<e.length;t++)s.push(e[t].sub(o));return s}function oh(e,t,r,n){const i=Nt.convert(e)._mult(n);return"viewport"===t&&i._rotate(-r),i}fa(Vu,"CircleBucket",{omit:["layers"]});const sh=new Ka({"circle-sort-key":new Ya(tl.layout_circle["circle-sort-key"]),visibility:new Xa(tl.layout_circle.visibility)});var ah={paint:new Ka({"circle-radius":new Ya(tl.paint_circle["circle-radius"]),"circle-color":new Ya(tl.paint_circle["circle-color"]),"circle-blur":new Ya(tl.paint_circle["circle-blur"]),"circle-opacity":new Ya(tl.paint_circle["circle-opacity"]),"circle-translate":new Xa(tl.paint_circle["circle-translate"]),"circle-translate-anchor":new Xa(tl.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Xa(tl.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Xa(tl.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ya(tl.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ya(tl.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ya(tl.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new Xa(tl.paint_circle["circle-emissive-strength"])}),layout:sh};class lh{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(t,r,n){const i=e.Q.dot(r,this.dir);if(Math.abs(i)<1e-6)return!1;const o=((t[0]-this.pos[0])*r[0]+(t[1]-this.pos[1])*r[1]+(t[2]-this.pos[2])*r[2])/i;return n[0]=this.pos[0]+this.dir[0]*o,n[1]=this.pos[1]+this.dir[1]*o,n[2]=this.pos[2]+this.dir[2]*o,!0}closestPointOnSphere(t,r,n){if(e.Q.equals(this.pos,t)||0===r)return n[0]=n[1]=n[2]=0,!1;const[i,o,s]=this.dir,a=this.pos[0]-t[0],l=this.pos[1]-t[1],c=this.pos[2]-t[2],u=i*i+o*o+s*s,h=2*(a*i+l*o+c*s),d=h*h-4*u*(a*a+l*l+c*c-r*r);if(d<0){const e=Math.max(-h/2,0),t=a+i*e,u=l+o*e,d=c+s*e,p=Math.hypot(t,u,d);return n[0]=t*r/p,n[1]=u*r/p,n[2]=d*r/p,!1}{const e=(-h-Math.sqrt(d))/(2*u);if(e<0){const e=Math.hypot(a,l,c);return n[0]=a*r/e,n[1]=l*r/e,n[2]=c*r/e,!1}return n[0]=a+i*e,n[1]=l+o*e,n[2]=c+s*e,!0}}}class ch{constructor(e,t,r,n,i){this.TL=e,this.TR=t,this.BR=r,this.BL=n,this.horizon=i}static fromInvProjectionMatrix(t,r,n){const i=[-1,1,1],o=[1,1,1],s=[1,-1,1],a=[-1,-1,1],l=e.Q.transformMat4(i,i,t),c=e.Q.transformMat4(o,o,t),u=e.Q.transformMat4(s,s,t),h=e.Q.transformMat4(a,a,t);return new ch(l,c,u,h,r/n)}}function uh(t,r,n){let i=1/0,o=-1/0;const s=[];for(const a of t){e.Q.sub(s,a,r);const t=e.Q.dot(s,n);i=Math.min(i,t),o=Math.max(o,t)}return[i,o]}function hh(t,r){let n=!0;for(let i=0;i<t.planes.length;i++){const o=t.planes[i];let s=0;for(let t=0;t<r.length;t++)s+=e.Q.dot(o,r[t])+o[3]>=0;if(0===s)return 0;s!==r.length&&(n=!1)}return n?2:1}function dh(e,t){for(const r of e.projections){const n=uh(t,e.points[0],r.axis);if(r.projection[1]<n[0]||r.projection[0]>n[1])return 0}return 1}function ph(t,r){let n=0;const i=[0,0,0,0];for(let o=0;o<t.length;o++)i[0]=t[o][0],i[1]=t[o][1],i[2]=t[o][2],i[3]=1,e.aa.dot(i,r)>=0&&n++;return n}class fh{constructor(t,r){this.points=t||new Array(8).fill([0,0,0]),this.planes=r||new Array(6).fill([0,0,0,0]),this.bounds=mh.fromPoints(this.points),this.projections=[],this.frustumEdges=[e.Q.sub([],this.points[2],this.points[3]),e.Q.sub([],this.points[0],this.points[3]),e.Q.sub([],this.points[4],this.points[0]),e.Q.sub([],this.points[5],this.points[1]),e.Q.sub([],this.points[6],this.points[2]),e.Q.sub([],this.points[7],this.points[3])];for(const e of this.frustumEdges){const t=[0,-e[2],e[1]],r=[e[2],0,-e[0]];this.projections.push({axis:t,projection:uh(this.points,this.points[0],t)}),this.projections.push({axis:r,projection:uh(this.points,this.points[0],r)})}}static fromInvProjectionMatrix(t,r,n,i){const o=Math.pow(2,n),s=[[-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((n=>{const s=e.aa.transformMat4([],n,t),a=1/s[3]/r*o;return e.aa.mul(s,s,[a,a,i?1/s[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const r=e.Q.sub([],s[t[0]],s[t[1]]),n=e.Q.sub([],s[t[2]],s[t[1]]),i=e.Q.normalize([],e.Q.cross([],r,n)),o=-e.Q.dot(i,s[t[1]]);return i.concat(o)})),l=[];for(let e=0;e<s.length;e++)l.push([s[e][0],s[e][1],s[e][2]]);return new fh(l,a)}intersectsPrecise(t,r,n){for(let e=0;e<r.length;e++)if(!ph(t,r[e]))return 0;for(let e=0;e<this.planes.length;e++)if(!ph(t,this.planes[e]))return 0;for(const r of n)for(const n of this.frustumEdges){const i=e.Q.cross([],r,n),o=e.Q.length(i);if(0===o)continue;e.Q.scale(i,i,1/o);const s=uh(this.points,this.points[0],i),a=uh(t,this.points[0],i);if(s[0]>a[1]||a[0]>s[1])return 0}return 1}}class mh{static fromPoints(t){const r=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(const i of t)e.Q.min(r,r,i),e.Q.max(n,n,i);return new mh(r,n)}static fromTileIdAndHeight(e,t,r){const n=1<<e.canonical.z,i=e.canonical.x,o=e.canonical.y;return new mh([i/n,o/n,t],[(i+1)/n,(o+1)/n,r])}static applyTransform(t,r){const n=t.getCorners();for(let t=0;t<n.length;++t)e.Q.transformMat4(n[t],n[t],r);return mh.fromPoints(n)}static projectAabbCorners(t,r){const n=t.getCorners();for(let t=0;t<n.length;++t)e.Q.transformMat4(n[t],n[t],r);return n}constructor(t,r){this.min=t,this.max=r,this.center=e.Q.scale([],e.Q.add([],this.min,this.max),.5)}quadrant(t){const r=[t%2==0,t<2],n=e.Q.clone(this.min),i=e.Q.clone(this.max);for(let e=0;e<r.length;e++)n[e]=r[e]?this.min[e]:this.center[e],i[e]=r[e]?this.center[e]:this.max[e];return i[2]=this.max[2],new mh(n,i)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?hh(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?hh(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(e,t){return t||this.intersects(e)?dh(e,this.getCorners()):0}intersectsPreciseFlat(e,t){return t||this.intersectsFlat(e)?dh(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(e){for(let t=0;t<3;++t)if(this.min[t]>e.max[t]||e.min[t]>this.max[t])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e.min[t]),this.max[t]=Math.max(this.max[t],e.max[t])}encapsulatePoint(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e[t]),this.max[t]=Math.max(this.max[t],e[t])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}fa(mh,"Aabb");const gh=wl([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Ah}=gh,_h=wl([{name:"a_pos_3",components:3,type:"Int16"}]);var yh=wl([{name:"a_pos",type:"Int16",components:2}]);function vh(e){return e*Qc/iu}const xh=[new mh([eu,eu,eu],[tu,tu,tu]),new mh([eu,eu,eu],[0,0,tu]),new mh([0,eu,eu],[tu,0,tu]),new mh([eu,0,eu],[0,tu,tu]),new mh([0,0,eu],[tu,tu,tu])];function bh(t,r,n,i=!0){const o=e.Q.scale([],t._camera.position,t.worldSize),s=[r,n,1,1];e.aa.transformMat4(s,s,t.pixelMatrixInverse),e.aa.scale(s,s,1/s[3]);const a=e.Q.sub([],s,o),l=e.Q.normalize([],a),c=t.globeMatrix,u=[c[12],c[13],c[14]],h=e.Q.sub([],u,o),d=e.Q.length(h),p=e.Q.normalize([],h),f=t.worldSize/(2*Math.PI),m=e.Q.dot(p,l),g=Math.asin(f/d);if(g<Math.acos(m)){if(!i)return null;const t=[],r=[];e.Q.scale(t,l,d/m),e.Q.normalize(r,e.Q.sub(r,t,h)),e.Q.normalize(l,e.Q.add(l,h,e.Q.scale(l,r,Math.tan(g)*d)))}const A=[];new lh(o,l).closestPointOnSphere(u,f,A);const _=e.Q.normalize([],Er(c,0)),y=e.Q.normalize([],Er(c,1)),v=e.Q.normalize([],Er(c,2)),x=e.Q.dot(_,A),b=e.Q.dot(y,A),w=e.Q.dot(v,A),C=Gt(Math.asin(-b/f));let E=Gt(Math.atan2(x,w));E=t.center.lng+function(e,t){const r=(t-e+180)%360-180;return r<-180?r+360:r}(t.center.lng,E);const T=_u(E),S=Xt(yu(C),0,1);return new Iu(T,S)}class wh{constructor(t,r,n){this.a=e.Q.sub([],t,n),this.b=e.Q.sub([],r,n),this.center=n;const i=e.Q.normalize([],this.a),o=e.Q.normalize([],this.b);this.angle=Math.acos(e.Q.dot(i,o))}}function Ch(e,t){if(0===e.angle)return null;let r;return r=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),r<0||r>1?null:function(e,t,r,n){const i=Math.sin(r);return e*(Math.sin((1-n)*r)/i)+t*(Math.sin(n*r)/i)}(e.a[t],e.b[t],e.angle,Xt(r,0,1))+e.center[t]}function Eh(e){if(e.z<=1)return xh[e.z+2*e.y+e.x];const t=Ph(Ih(e));return mh.fromPoints(t)}function Th(t,r,n){return e.Q.scale(t,t,1-n),e.Q.scaleAndAdd(t,t,r,n)}function Sh(t,r,n){for(const i of t)e.Q.transformMat4(i,i,r),e.Q.scale(i,i,n)}function Mh(t,r,n,i){const o=r/t.worldSize,s=t.globeMatrix;if(n.z<=1){const e=Eh(n).getCorners();return Sh(e,s,o),mh.fromPoints(e)}const a=Ih(n,i),l=Ph(a,Qc+vh(t._tileCoverLift));Sh(l,s,o);const c=Number.MAX_VALUE,u=[-c,-c,-c],h=[c,c,c];if(a.contains(t.center)){for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);u[2]=0;const r=t.point,n=[r.x*o,r.y*o,0];return e.Q.min(h,h,n),e.Q.max(u,u,n),new mh(h,u)}if(t._tileCoverLift>0){for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);return new mh(h,u)}const d=[s[12]*o,s[13]*o,s[14]*o],p=a.getCenter(),f=Xt(t.center.lat,-Cu,Cu),m=Xt(p.lat,-Cu,Cu),g=_u(t.center.lng),A=yu(f);let _=g-_u(p.lng);const y=A-yu(m);_>.5?_-=1:_<-.5&&(_+=1);let v=0;if(Math.abs(_)>Math.abs(y))v=_>=0?1:3;else{v=y>=0?0:2;const t=[s[4]*o,s[5]*o,s[6]*o],r=-Math.sin(Ht(y>=0?a.getSouth():a.getNorth()))*Qc;e.Q.scaleAndAdd(d,d,t,r)}const x=l[v],b=l[(v+1)%4],w=new wh(x,b,d),C=[Ch(w,0)||x[0],Ch(w,1)||x[1],Ch(w,2)||x[2]],E=jh(t.zoom);if(E>0){const i=function({x:e,y:t,z:r},n,i,o,s){const a=1/(1<<r);let l=e*a,c=l+a,u=t*a,h=u+a,d=0;const p=(l+c)/2-o;return p>.5?d=-1:p<-.5&&(d=1),l=((l+d)*n-(o*=n))*i+o,c=((c+d)*n-o)*i+o,u=(u*n-(s*=n))*i+s,h=(h*n-s)*i+s,[[l,h,0],[c,h,0],[c,u,0],[l,u,0]]}(n,r,t._pixelsPerMercatorPixel,g,A);for(let e=0;e<l.length;e++)Th(l[e],i[e],E);const o=e.Q.add([],i[v],i[(v+1)%4]);e.Q.scale(o,o,.5),Th(C,o,E)}for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);return h[2]=Math.min(x[2],b[2]),e.Q.min(h,h,C),e.Q.max(u,u,C),new mh(h,u)}function Ih({x:e,y:t,z:r},n=!1){const i=1/(1<<r),o=new su(xu(e*i),t===(1<<r)-1&&n?-90:bu((t+1)*i)),s=new su(xu((e+1)*i),0===t&&n?90:bu(t*i));return new au(o,s)}function Ph(e,t=Qc){const r=Ht(e.getNorth()),n=Ht(e.getSouth()),i=Math.cos(r),o=Math.cos(n),s=Math.sin(r),a=Math.sin(n),l=e.getWest(),c=e.getEast();return[ru(o,a,l,t),ru(o,a,c,t),ru(i,s,c,t),ru(i,s,l,t)]}function Lh(e,t,r,n){const i=1<<r.z,o=(e/io+r.x)/i;return nu(bu((t/io+r.y)/i),xu(o),n)}function Oh({min:e,max:t}){return $c/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const Dh=new Float64Array(16);function kh(t){const r=Oh(t),n=e.a9.fromScaling(Dh,[r,r,r]);return e.a9.translate(n,n,e.Q.negate([],t.min))}function zh(t){const r=e.a9.fromTranslation(Dh,t.min),n=1/Oh(t);return e.a9.scale(r,r,[n,n,n])}function Bh(e){const t=io/(2*Math.PI);return e/(2*Math.PI)/t}function Rh(e,t){return io/(512*Math.pow(2,e))*Oh(Eh(t))}function Fh(t,r,n,i,o){const s=Bh(n),a=[t,r,-n/(2*Math.PI)],l=e.a9.identity(new Float64Array(16));return e.a9.translate(l,l,a),e.a9.scale(l,l,[s,s,s]),e.a9.rotateX(l,l,Ht(-o)),e.a9.rotateY(l,l,Ht(-i)),l}function jh(e){return Yt(Xc,Yc,e)}function Nh(t,r){const n=nu(r.lat,r.lng),i=function(t){const r=nu(t._center.lat,t._center.lng),n=e.Q.fromValues(0,1,0);let i=e.Q.cross([],n,r);const o=e.a9.fromRotation([],-t.angle,r);i=e.Q.transformMat4(i,i,o),e.a9.fromRotation(o,-t._pitch,i);const s=e.Q.normalize([],r);return e.Q.scale(s,s,vh(t.cameraToCenterDistance/t.pixelsPerMeter)),e.Q.transformMat4(s,s,o),e.Q.add([],r,s)}(t),o=e.Q.subtract([],i,n);return e.Q.angle(o,n)}function Vh(e,t){return Nh(e,t)>Math.PI/2*1.01}const Uh=Ht(85),Hh=Math.cos(Uh),Gh=Math.sin(Uh),Zh=e.a9.create(),Wh=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t};function qh(t,r,n,i,o,s,a,l,c){if(s&&t.queryGeometry.isAboveHorizon)return!1;s&&(c*=t.pixelToTileUnitsFactor);const u=t.tileID.canonical,h=n.projection.upVectorScale(u,n.center.lat,n.worldSize).metersToTile;for(const d of r)for(const r of d){const d=r.add(l),p=o&&n.elevation?n.elevation.exaggeration()*o.getElevationAt(d.x,d.y,!0):0,f=n.projection.projectTilePoint(d.x,d.y,u);if(p>0){const e=n.projection.upVector(u,d.x,d.y);f.x+=e[0]*h*p,f.y+=e[1]*h*p,f.z+=e[2]*h*p}const m=s?d:Qh(f.x,f.y,f.z,i),g=s?t.tilespaceRays.map((e=>$h(e,p))):t.queryGeometry.screenGeometry,A=e.aa.transformMat4([],[f.x,f.y,f.z,1],i);if(!a&&s?c*=A[3]/n.cameraToCenterDistance:a&&!s&&(c*=n.cameraToCenterDistance/A[3]),s){const e=bu((r.y/io+u.y)/(1<<u.z));c/=n.projection.pixelsPerMeter(e,1)/vu(1,e)}if(Hu(g,m,c))return!0}return!1}function Qh(t,r,n,i){const o=e.aa.transformMat4([],[t,r,n,1],i);return new Nt(o[0]/o[3],o[1]/o[3])}const Xh=e.Q.fromValues(0,0,0),Yh=e.Q.fromValues(0,0,1);function $h(t,r){const n=e.Q.create();return Xh[2]=r,t.intersectsPlane(Xh,Yh,n),new Nt(n[0],n[1])}class Kh extends Vu{}function Jh(e,{width:t,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*r*n)throw new RangeError("mismatched image size")}else i=new Uint8Array(t*r*n);return e.width=t,e.height=r,e.data=i,e}function ed(e,t,r){const{width:n,height:i}=t;n===e.width&&i===e.height||(td(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,i)},r),e.width=n,e.height=i,e.data=t.data)}function td(e,t,r,n,i,o,s){if(0===i.width||0===i.height)return t;if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const a=e.data,l=t.data,c=4===o&&s;for(let s=0;s<i.height;s++){const u=((r.y+s)*e.width+r.x)*o,h=((n.y+s)*t.width+n.x)*o;if(c)for(let e=0;e<i.width;e++){const t=u+e*o+3,r=h+e*o;l[r+0]=255,l[r+1]=255,l[r+2]=255,l[r+3]=a[t]}else for(let e=0;e<i.width*o;e++)l[h+e]=a[u+e]}return t}fa(Kh,"HeatmapBucket",{omit:["layers"]});class rd{constructor(e,t){Jh(this,e,1,t)}resize(e){ed(this,new rd(e),1)}clone(){return new rd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){td(e,t,r,n,i,1)}}class nd{constructor(e,t){Jh(this,e,4,t)}resize(e){ed(this,new nd(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new nd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i,o){td(e,t,r,n,i,4,o)}}class id{constructor(e,t){this.width=e.width,this.height=e.height,this.data=t instanceof Uint8Array?new Float32Array(t.buffer):t}}fa(rd,"AlphaImage"),fa(nd,"RGBAImage");const od=new Ka({visibility:new Xa(tl.layout_heatmap.visibility)});var sd={paint:new Ka({"heatmap-radius":new Ya(tl.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ya(tl.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Xa(tl.paint_heatmap["heatmap-intensity"]),"heatmap-color":new $a(tl.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Xa(tl.paint_heatmap["heatmap-opacity"])}),layout:od};function ad(e){const t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new nd({width:r,height:n}),o=(r,n,o)=>{t[e.evaluationKey]=o;const s=e.expression.evaluate(t);s&&(i.data[r+n+0]=Math.floor(255*s.r/s.a),i.data[r+n+1]=Math.floor(255*s.g/s.a),i.data[r+n+2]=Math.floor(255*s.b/s.a),i.data[r+n+3]=Math.floor(255*s.a))};if(e.clips)for(let t=0,i=0;t<n;++t,i+=4*r)for(let n=0,s=0;n<r;n++,s+=4){const a=n/(r-1),{start:l,end:c}=e.clips[t];o(i,s,l*(1-a)+c*a)}else for(let e=0,t=0;e<r;e++,t+=4)o(0,t,e/(r-1));return i}const ld=new Ka({visibility:new Xa(tl.layout_hillshade.visibility)});var cd={paint:new Ka({"hillshade-illumination-direction":new Xa(tl.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Xa(tl.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Xa(tl.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Xa(tl.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Xa(tl.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Xa(tl.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new Xa(tl.paint_hillshade["hillshade-emissive-strength"])}),layout:ld};const ud=wl([{name:"a_pos",components:2,type:"Int16"}],4),{members:hd}=ud;var dd={exports:{}};function pd(e,t,r){r=r||2;var n,i,o,s,a,l,c,u=t&&t.length,h=u?t[0]*r:e.length,d=fd(e,0,h,r,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(e,t,r,n){var i,o,s,a=[];for(i=0,o=t.length;i<o;i++)(s=fd(e,t[i]*n,i<o-1?t[i+1]*n:e.length,n,!1))===s.next&&(s.steiner=!0),a.push(Ed(s));for(a.sort(xd),i=0;i<a.length;i++)r=bd(a[i],r);return r}(e,t,d,r)),e.length>80*r){n=o=e[0],i=s=e[1];for(var f=r;f<h;f+=r)(a=e[f])<n&&(n=a),(l=e[f+1])<i&&(i=l),a>o&&(o=a),l>s&&(s=l);c=0!==(c=Math.max(o-n,s-i))?32767/c:0}return gd(d,p,r,n,i,c,0),p}function fd(e,t,r,n,i){var o,s;if(i===Fd(e,t,r,n)>0)for(o=t;o<r;o+=n)s=zd(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=zd(o,e[o],e[o+1],s);return s&&Id(s,s.next)&&(Bd(s),s=s.next),s}function md(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!Id(n,n.next)&&0!==Md(n.prev,n,n.next))n=n.next;else{if(Bd(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function gd(e,t,r,n,i,o,s){if(e){!s&&o&&function(e,t,r,n){var i=e;do{0===i.z&&(i.z=Cd(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,s,a,l,c=1;do{for(r=e,e=null,o=null,s=0;r;){for(s++,n=r,a=0,t=0;t<c&&(a++,n=n.nextZ);t++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(s>1)}(i)}(e,n,i,o);for(var a,l,c=e;e.prev!==e.next;)if(a=e.prev,l=e.next,o?_d(e,n,i,o):Ad(e))t.push(a.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),Bd(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?gd(e=yd(md(e),t,r),t,r,n,i,o,2):2===s&&vd(e,t,r,n,i,o):gd(md(e),t,r,n,i,o,1);break}}}function Ad(e){var t=e.prev,r=e,n=e.next;if(Md(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,s=n.x,a=t.y,l=r.y,c=n.y,u=i<o?i<s?i:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=i>o?i>s?i:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c,f=n.next;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&Td(i,a,o,l,s,c,f.x,f.y)&&Md(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function _d(e,t,r,n){var i=e.prev,o=e,s=e.next;if(Md(i,o,s)>=0)return!1;for(var a=i.x,l=o.x,c=s.x,u=i.y,h=o.y,d=s.y,p=a<l?a<c?a:c:l<c?l:c,f=u<h?u<d?u:d:h<d?h:d,m=a>l?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,A=Cd(p,f,t,r,n),_=Cd(m,g,t,r,n),y=e.prevZ,v=e.nextZ;y&&y.z>=A&&v&&v.z<=_;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==s&&Td(a,u,l,h,c,d,y.x,y.y)&&Md(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==s&&Td(a,u,l,h,c,d,v.x,v.y)&&Md(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;y&&y.z>=A;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==s&&Td(a,u,l,h,c,d,y.x,y.y)&&Md(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;v&&v.z<=_;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==s&&Td(a,u,l,h,c,d,v.x,v.y)&&Md(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function yd(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!Id(i,o)&&Pd(i,n,n.next,o)&&Dd(i,o)&&Dd(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),Bd(n),Bd(n.next),n=e=o),n=n.next}while(n!==e);return md(n)}function vd(e,t,r,n,i,o){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Sd(s,a)){var l=kd(s,a);return s=md(s,s.next),l=md(l,l.next),gd(s,t,r,n,i,o,0),void gd(l,t,r,n,i,o,0)}a=a.next}s=s.next}while(s!==e)}function xd(e,t){return e.x-t.x}function bd(e,t){var r=function(e,t){var r,n=t,i=e.x,o=e.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>s&&(s=a,r=n.x<n.next.x?n:n.next,a===i))return r}n=n.next}while(n!==t);if(!r)return null;var l,c=r,u=r.x,h=r.y,d=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&Td(o<h?i:s,o,u,h,o<h?s:i,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(i-n.x),Dd(n,e)&&(l<d||l===d&&(n.x>r.x||n.x===r.x&&wd(r,n)))&&(r=n,d=l)),n=n.next}while(n!==c);return r}(e,t);if(!r)return t;var n=kd(r,e);return md(n,n.next),md(r,r.next)}function wd(e,t){return Md(e.prev,e,t.prev)<0&&Md(t.next,e,e.next)<0}function Cd(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Ed(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function Td(e,t,r,n,i,o,s,a){return(i-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(n-a)>=(r-s)*(t-a)&&(r-s)*(o-a)>=(i-s)*(n-a)}function Sd(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Pd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Dd(e,t)&&Dd(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Md(e.prev,e,t.prev)||Md(e,t.prev,t))||Id(e,t)&&Md(e.prev,e,e.next)>0&&Md(t.prev,t,t.next)>0)}function Md(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Id(e,t){return e.x===t.x&&e.y===t.y}function Pd(e,t,r,n){var i=Od(Md(e,t,r)),o=Od(Md(e,t,n)),s=Od(Md(r,n,e)),a=Od(Md(r,n,t));return i!==o&&s!==a||!(0!==i||!Ld(e,r,t))||!(0!==o||!Ld(e,n,t))||!(0!==s||!Ld(r,e,n))||!(0!==a||!Ld(r,t,n))}function Ld(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Od(e){return e>0?1:e<0?-1:0}function Dd(e,t){return Md(e.prev,e,e.next)<0?Md(e,t,e.next)>=0&&Md(e,e.prev,t)>=0:Md(e,t,e.prev)<0||Md(e,e.next,t)<0}function kd(e,t){var r=new Rd(e.i,e.x,e.y),n=new Rd(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function zd(e,t,r,n){var i=new Rd(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Bd(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Rd(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Fd(e,t,r,n){for(var i=0,o=t,s=r-n;o<r;o+=n)i+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return i}dd.exports=pd,dd.exports.default=pd,pd.deviation=function(e,t,r,n){var i=t&&t.length,o=Math.abs(Fd(e,0,i?t[0]*r:e.length,r));if(i)for(var s=0,a=t.length;s<a;s++)o-=Math.abs(Fd(e,t[s]*r,s<a-1?t[s+1]*r:e.length,r));var l=0;for(s=0;s<n.length;s+=3){var c=n[s]*r,u=n[s+1]*r,h=n[s+2]*r;l+=Math.abs((e[c]-e[h])*(e[u+1]-e[c+1])-(e[c]-e[u])*(e[h+1]-e[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},pd.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var s=0;s<t;s++)r.vertices.push(e[i][o][s]);i>0&&r.holes.push(n+=e[i-1].length)}return r};var jd=h(dd.exports);function Nd(e,t){const r=e.length;if(r<=1)return[e];const n=[];let i,o;for(let t=0;t<r;t++){const r=pr(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(i&&n.push(i),i=[e[t]]):i.push(e[t]))}if(i&&n.push(i),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(ki(n[e],t,1,n[e].length-1,Vd),n[e]=n[e].slice(0,t));return n}function Vd(e,t){return t.area-e.area}function Ud(e,t,r){const n=r.patternDependencies;let i=!1;for(const r of t){const t=r.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);const o=t.constantOr(null);o&&(i=!0,n[o]=!0)}return i}function Hd(e,t,r,n,i){const o=i.patternDependencies;for(const s of t){const t=s.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n},r,{},i.availableImages);e=e&&e.name?e.name:e,o[e]=!0,r.patterns[s.id]=e}}return r}class Gd{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new El,this.indexArray=new Hl,this.indexArray2=new Fl,this.programConfigurations=new Uc(e.layers,e.zoom),this.segments=new mc,this.segments2=new mc,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection}populate(e,t,r,n){this.hasPattern=Ud("fill",this.layers,t);const i=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:s,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Fu(s,e);if(!this.layers[0]._featureFilter.filter(new Na(this.zoom),u,r))continue;const h=i?i.evaluate(u,{},r,t.availableImages):void 0,d={id:a,properties:s.properties,type:s.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Ru(s,r,n),patterns:{},sortKey:h};o.push(d)}i&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const n of o){const{geometry:i,index:o,sourceLayerIndex:s}=n;if(this.hasPattern){const e=Hd("fill",this.layers,n,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(n,i,o,r,{},t.availableImages,t.brightness);t.featureIndex.insert(e[o].feature,i,o,s,this.index)}}update(e,t,r,n,i){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,n,i)}addFeatures(e,t,r,n,i,o){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r,n,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,n,i,o=[],s){for(const e of Nd(t,500)){let t=0;for(const r of e)t+=r.length;const r=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),n=r.vertexLength,i=[],o=[];for(const t of e){if(0===t.length)continue;t!==e[0]&&o.push(i.length/2);const r=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),n=r.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(n+t.length-1,n),i.push(t[0].x),i.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(n+e-1,n+e),i.push(t[e].x),i.push(t[e].y);r.vertexLength+=t.length,r.primitiveLength+=t.length}const s=jd(i,o);for(let e=0;e<s.length;e+=3)this.indexArray.emplaceBack(n+s[e],n+s[e+1],n+s[e+2]);r.vertexLength+=t,r.primitiveLength+=s.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,o,n,s)}}fa(Gd,"FillBucket",{omit:["layers","patternFeatures"]});const Zd=new Ka({"fill-sort-key":new Ya(tl.layout_fill["fill-sort-key"]),visibility:new Xa(tl.layout_fill.visibility)});var Wd={paint:new Ka({"fill-antialias":new Xa(tl.paint_fill["fill-antialias"]),"fill-opacity":new Ya(tl.paint_fill["fill-opacity"]),"fill-color":new Ya(tl.paint_fill["fill-color"]),"fill-outline-color":new Ya(tl.paint_fill["fill-outline-color"]),"fill-translate":new Xa(tl.paint_fill["fill-translate"]),"fill-translate-anchor":new Xa(tl.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ya(tl.paint_fill["fill-pattern"]),"fill-emissive-strength":new Xa(tl.paint_fill["fill-emissive-strength"])}),layout:Zd};const qd=wl([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Qd=wl([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),Xd=wl([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Yd=wl([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),$d=wl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Kd}=qd;var Jd={},ep=Ft,tp=rp;function rp(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields(np,this,t)}function np(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function ip(e){for(var t,r,n=0,i=0,o=e.length,s=o-1;i<o;s=i++)n+=((r=e[s]).x-(t=e[i]).x)*(t.y+r.y);return n}rp.types=["Unknown","Point","LineString","Polygon"],rp.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,a=[];e.pos<r;){if(i<=0){var l=e.readVarint();n=7&l,i=l>>3}if(i--,1===n||2===n)o+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&a.push(t),t=[]),t.push(new ep(o,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&a.push(t),a},rp.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;e.pos<t;){if(n<=0){var u=e.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<s&&(s=i),i>a&&(a=i),(o+=e.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[s,l,a,c]},rp.prototype.toGeoJSON=function(e,t,r){var n,i,o=this.extent*Math.pow(2,r),s=this.extent*e,a=this.extent*t,l=this.loadGeometry(),c=rp.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t];e[t]=[360*(r.x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+a)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],o=0;o<t;o++){var s=ip(e[o]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(r&&i.push(r),r=[e[o]]):r.push(e[o]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var op=tp,sp=ap;function ap(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(lp,this,t),this.length=this._features.length}function lp(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}ap.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new op(this._pbf,t,this.extent,this._keys,this._values)};var cp=sp;function up(e,t,r){if(3===e){var n=new cp(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}var hp=Jd.VectorTile=function(e,t){this.layers=e.readFields(up,{},t)},dp=Jd.VectorTileFeature=tp;function pp(e,t,r,n){const i=[],o=0===n?(e,t,r,n,i,o)=>{e.push(new Nt(o,r+(o-t)/(n-t)*(i-r)))}:(e,t,r,n,i,o)=>{e.push(new Nt(t+(o-r)/(i-r)*(n-t),o))};for(const s of e){const e=[];for(const i of s){if(i.length<=2)continue;const s=[];for(let e=0;e<i.length-1;e++){const a=i[e].x,l=i[e].y,c=i[e+1].x,u=i[e+1].y,h=0===n?a:l,d=0===n?c:u;h<t?d>t&&o(s,a,l,c,u,t):h>r?d<r&&o(s,a,l,c,u,r):s.push(i[e]),d<t&&h>=t&&o(s,a,l,c,u,t),d>r&&h<=r&&o(s,a,l,c,u,r)}let a=i[i.length-1];const l=0===n?a.x:a.y;l>=t&&l<=r&&s.push(a),s.length&&(a=s[s.length-1],s[0].x===a.x&&s[0].y===a.y||s.push(s[0]),e.push(s))}e.length&&i.push(e)}return i}function fp(e,t){return e.x-t.x||e.y-t.y}function mp(e,t){return 0===fp(e.min,t.min)&&0===fp(e.max,t.max)}function gp(e,t){return!(e.min.x>t.max.x||e.max.x<t.min.x||e.min.y>t.max.y||e.max.y<t.min.y)}function Ap(e,t,r){const n=1/io,i=1/(1<<r.canonical.z),o=(t.x*n+r.canonical.x)*i+r.wrap,s=(t.y*n+r.canonical.y)*i;return{min:new Nt((e.x*n+r.canonical.x)*i+r.wrap,(e.y*n+r.canonical.y)*i),max:new Nt(o,s)}}function _p(e,t,r){const n=1<<r.canonical.z,i=((t.x-r.wrap)*n-r.canonical.x)*io,o=(t.y*n-r.canonical.y)*io;return{min:new Nt(((e.x-r.wrap)*n-r.canonical.x)*io,(e.y*n-r.canonical.y)*io),max:new Nt(i,o)}}function yp(e,t,r,n,i,o,s){const a=e.indices,l=e.vertices,c=[];for(let u=n;u<n+i;u+=3){const n=t[r[u+0]+o],i=t[r[u+1]+o],h=t[r[u+2]+o],d=Math.min(n.x,i.x,h.x),p=Math.max(n.x,i.x,h.x),f=Math.min(n.y,i.y,h.y),m=Math.max(n.y,i.y,h.y);c.length=0,e.grid.query(new Nt(d,f),new Nt(p,m),c);for(let e=0;e<c.length;e++){const t=c[e];if(th(l[a[3*t+0]],l[a[3*t+1]],l[a[3*t+2]],n,i,h,s))return!0}}return!1}function vp(e,t,r,n){if(!e||!r)return!1;let i=e.vertices;if(!t.canonical.equals(n.canonical)||t.wrap!==n.wrap){if(r.vertices.length<e.vertices.length)return vp(r,n,e,t);const o=t.canonical,s=n.canonical,a=Math.pow(2,s.z-o.z);i=e.vertices.map((e=>new Nt((e.x+o.x*io)*a-s.x*io,(e.y+o.y*io)*a-s.y*io)))}return yp(r,i,e.indices,0,e.indices.length,0,0)}Jd.VectorTileLayer=sp;class xp{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const r=this.toIdx(e,t);return{min:this.minimums[r],max:this.maximums[r]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function bp(e,t,r,n){let i=0,o=Number.MAX_VALUE;for(let s=0;s<3;s++)if(Math.abs(n[s])<1e-15){if(r[s]<e[s]||r[s]>t[s])return null}else{const a=1/n[s];let l=(e[s]-r[s])*a,c=(t[s]-r[s])*a;if(l>c){const e=l;l=c,c=e}if(l>i&&(i=l),c<o&&(o=c),i>o)return null}return i}function wp(e,t,r,n,i,o,s,a,l,c,u){const h=n-e,d=i-t,p=o-r,f=s-e,m=a-t,g=l-r,A=u[1]*g-u[2]*m,_=u[2]*f-u[0]*g,y=u[0]*m-u[1]*f,v=h*A+d*_+p*y;if(Math.abs(v)<1e-15)return null;const x=1/v,b=c[0]-e,w=c[1]-t,C=c[2]-r,E=(b*A+w*_+C*y)*x;if(E<0||E>1)return null;const T=w*p-C*d,S=C*h-b*p,M=b*d-w*h,I=(u[0]*T+u[1]*S+u[2]*M)*x;return I<0||E+I>1?null:(f*T+m*S+g*M)*x}function Cp(e,t,r){return(e-t)/(r-t)}function Ep(e,t,r,n,i,o,s,a,l){const c=1<<r,u=o-n,h=s-i,d=(e+1)/c*u+n,p=(t+0)/c*h+i,f=(t+1)/c*h+i;a[0]=(e+0)/c*u+n,a[1]=p,l[0]=d,l[1]=f}class Tp{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=Math.ceil(Math.log2(e.dim/8)),r=[];let n=Math.ceil(Math.pow(2,t));const i=1/n,o=(e,t,r,n,i)=>{const o=n?1:0,s=(e+1)*r-o,a=t*r,l=(t+1)*r-o;i[0]=e*r,i[1]=a,i[2]=s,i[3]=l};let s=new xp(n);const a=[];for(let t=0;t<n*n;t++){o(t%n,Math.floor(t/n),i,!1,a);const r=Mp(a[0],a[1],e),l=Mp(a[2],a[1],e),c=Mp(a[2],a[3],e),u=Mp(a[0],a[3],e);s.minimums.push(Math.min(r,l,c,u)),s.maximums.push(Math.max(r,l,c,u)),s.leaves.push(1)}for(r.push(s),n/=2;n>=1;n/=2){const e=r[r.length-1];s=new xp(n);for(let t=0;t<n*n;t++){o(t%n,Math.floor(t/n),2,!0,a);const r=e.getElevation(a[0],a[1]),i=e.getElevation(a[2],a[1]),l=e.getElevation(a[2],a[3]),c=e.getElevation(a[0],a[3]),u=e.isLeaf(a[0],a[1]),h=e.isLeaf(a[2],a[1]),d=e.isLeaf(a[2],a[3]),p=e.isLeaf(a[0],a[3]),f=Math.min(r.min,i.min,l.min,c.min),m=Math.max(r.max,i.max,l.max,c.max),g=u&&h&&d&&p;s.maximums.push(m),s.minimums.push(f),s.leaves.push(m-f<=5&&g?1:0)}r.push(s)}return r}(this.dem),r=t.length-1,n=t[r];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(t,0,0,r,0)}raycastRoot(e,t,r,n,i,o,s=1){return bp([e,t,-100],[r,n,this.maximums[0]*s],i,o)}raycast(t,r,n,i,o,s,a=1){if(!this.nodeCount)return null;const l=this.raycastRoot(t,r,n,i,o,s,a);if(null==l)return null;const c=[],u=[],h=[],d=[],p=[{idx:0,t:l,nodex:0,nodey:0,depth:0}];for(;p.length>0;){const{idx:l,t:f,nodex:m,nodey:g,depth:A}=p.pop();if(this.leaves[l]){Ep(m,g,A,t,r,n,i,h,d);const l=1<<A,c=(m+0)/l,u=(m+1)/l,p=(g+0)/l,_=(g+1)/l,y=Mp(c,p,this.dem)*a,v=Mp(u,p,this.dem)*a,x=Mp(u,_,this.dem)*a,b=Mp(c,_,this.dem)*a,w=wp(h[0],h[1],y,d[0],h[1],v,d[0],d[1],x,o,s),C=wp(d[0],d[1],x,h[0],d[1],b,h[0],h[1],y,o,s),E=Math.min(null!==w?w:Number.MAX_VALUE,null!==C?C:Number.MAX_VALUE);if(E!==Number.MAX_VALUE)return E;{const t=e.Q.scaleAndAdd([],o,s,f);if(Sp(y,v,b,x,Cp(t[0],h[0],d[0]),Cp(t[1],h[1],d[1]))>=t[2])return f}continue}let _=0;for(let e=0;e<this._siblingOffset.length;e++){Ep((m<<1)+this._siblingOffset[e][0],(g<<1)+this._siblingOffset[e][1],A+1,t,r,n,i,h,d),h[2]=-100,d[2]=this.maximums[this.childOffsets[l]+e]*a;const p=bp(h,d,o,s);if(null!=p){const t=p;c[e]=t;let r=!1;for(let n=0;n<_&&!r;n++)t>=c[u[n]]&&(u.splice(n,0,e),r=!0);r||(u[_]=e),_++}}for(let e=0;e<_;e++){const t=u[e];p.push({idx:this.childOffsets[l]+t,t:c[t],nodex:(m<<1)+this._siblingOffset[t][0],nodey:(g<<1)+this._siblingOffset[t][1],depth:A+1})}}return null}_addNode(e,t,r){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(r),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,r,n,i){if(1===e[n].isLeaf(t,r))return;this.childOffsets[i]||(this.childOffsets[i]=this.nodeCount);const o=n-1,s=e[o];let a=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const n=2*t+this._siblingOffset[e][0],i=2*r+this._siblingOffset[e][1],o=s.getElevation(n,i),c=s.isLeaf(n,i),u=this._addNode(o.min,o.max,c);c&&(a|=1<<e),l||(l=u)}for(let n=0;n<this._siblingOffset.length;n++)a&1<<n||this._construct(e,2*t+this._siblingOffset[n][0],2*r+this._siblingOffset[n][1],o,l+n)}}function Sp(e,t,r,n,i,o){return Hn(Hn(e,r,o),Hn(t,n,o),i)}function Mp(e,t,r){const n=r.dim,i=Xt(e*n-.5,0,n-1),o=Xt(t*n-.5,0,n-1),s=Math.floor(i),a=Math.floor(o),l=Math.min(s+1,n-1),c=Math.min(a+1,n-1);return Sp(r.get(s,a),r.get(l,a),r.get(s,c),r.get(l,c),i-s,o-a)}const Ip={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function Pp(e,t,r){return(256*e*256+256*t+r)/10-1e4}function Lp(e,t,r){return 256*e+t+r/256-32768}class Op{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,r,n=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return hr(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const i=this.dim=t.height-2,o=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.floatView=new Float32Array(t.data.buffer),this.borderReady=n,this._modifiedForSources={},!n){for(let e=0;e<i;e++)o[this._idx(-1,e)]=o[this._idx(0,e)],o[this._idx(i,e)]=o[this._idx(i-1,e)],o[this._idx(e,-1)]=o[this._idx(e,0)],o[this._idx(e,i)]=o[this._idx(e,i-1)];o[this._idx(-1,-1)]=o[this._idx(0,0)],o[this._idx(i,-1)]=o[this._idx(i-1,0)],o[this._idx(-1,i)]=o[this._idx(0,i-1)],o[this._idx(i,i)]=o[this._idx(i-1,i-1)]}const s="terrarium"===r?Lp:Pp;for(let e=0;e<o.length;++e){const t=4*e;this.floatView[e]=s(this.pixels[t],this.pixels[t+1],this.pixels[t+2])}this._timestamp=Lr.now()}_buildQuadTree(){this._tree=new Tp(this)}get(e,t,r=!1){r&&(e=Xt(e,-1,this.dim),t=Xt(t,-1,this.dim));const n=this._idx(e,t);return this.floatView[n]}set(e,t,r){const n=this._idx(e,t),i=this.floatView[n];return this.floatView[n]=r,r-i}static getUnpackVector(e){return Ip[e]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const r=[0,0,0,0],n=Op.getUnpackVector(t);let i=Math.floor((e+n[3])/n[2]);return r[2]=i%256,i=Math.floor(i/256),r[1]=i%256,i=Math.floor(i/256),r[0]=i,r}getPixels(){return new id({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,i=t*this.dim+this.dim,o=r*this.dim,s=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=s-1;break;case 1:s=o+1}const a=-t*this.dim,l=-r*this.dim;for(let t=o;t<s;t++)for(let r=n;r<i;r++){const n=4*this._idx(r,t),i=4*this._idx(r+a,t+l);this.pixels[n+0]=e.pixels[i+0],this.pixels[n+1]=e.pixels[i+1],this.pixels[n+2]=e.pixels[i+2],this.pixels[n+3]=e.pixels[i+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}fa(Op,"DEMData"),fa(Tp,"DemMinMaxQuadTree",{omit:["dem"]});class Dp{constructor(e,t,r){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=r}static create(e,t,r){const n=r||e.findDEMTileFor(t);if(!n||!n.dem)return;const i=n.dem,o=n.tileID,s=1<<t.canonical.z-o.canonical.z;return new Dp(n,i.dim/io/s,[(t.canonical.x/s-o.canonical.x)*i.dim,(t.canonical.y/s-o.canonical.y)*i.dim])}tileCoordToPixel(e,t){const r=t*this._scale+this._offset[1],n=Math.floor(e*this._scale+this._offset[0]),i=Math.floor(r);return new Nt(n,i)}getElevationAt(e,t,r,n){const i=e*this._scale+this._offset[0],o=t*this._scale+this._offset[1],s=Math.floor(i),a=Math.floor(o),l=this._dem;return n=!!n,r?Hn(Hn(l.get(s,a,n),l.get(s,a+1,n),o-a),Hn(l.get(s+1,a,n),l.get(s+1,a+1,n),o-a),i-s):l.get(s,a,n)}getElevationAtPixel(e,t,r){return this._dem.get(e,t,!!r)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*vu(1,e)*this._dem.stride}}const kp=dp.types,zp=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius"],Bp=["fill-extrusion-flood-light-ground-radius"],Rp=Math.pow(2,13),Fp=Math.pow(2,15)-1,jp=new Nt(0,1),Np=2147483648;function Vp(e,t,r,n,i,o,s,a){e.emplaceBack((t<<1)+s,(r<<1)+o,(Math.floor(n*Rp)<<1)+i,Math.round(a))}function Up(e,t,r,n,i,o){e.emplaceBack(t.x,t.y,(r.x<<1)+n,(r.y<<1)+i,o)}function Hp(e,t,r){const n=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*n,r[1]*n,r[2]*n)}class Gp{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class Zp{constructor(){this.centroidXY=new Nt(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new Nt(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new Nt(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new Nt(this.max.x-this.min.x,this.max.y-this.min.y)}}class Wp{constructor(){this.acc=new Nt(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,t){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=t.x,e.min.y=e.max.y=t.y)}appendEdge(e,t,r){this.accCount++,this.acc._add(t);let n=!!this.borders;t.x<e.min.x?(e.min.x=t.x,n=!0):t.x>e.max.x&&(e.max.x=t.x,n=!0),t.y<e.min.y?(e.min.y=t.y,n=!0):t.y>e.max.y&&(e.max.y=t.y,n=!0),((0===t.x||t.x===io)&&t.x===r.x)!=((0===t.y||t.y===io)&&t.y===r.y)&&this.processBorderOverlap(t,r),n&&this.checkBorderIntersection(t,r)}checkBorderIntersection(e,t){t.x<0!=e.x<0&&this.addBorderIntersection(0,Hn(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>io!=e.x>io&&this.addBorderIntersection(1,Hn(t.y,e.y,(io-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,Hn(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>io!=e.y>io&&this.addBorderIntersection(3,Hn(t.x,e.x,(io-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){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 r=this.borders[e];t<r[0]&&(r[0]=t),t>r[1]&&(r[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const r=0===e.x?0:1;this.addBorderIntersection(r,t.y),this.addBorderIntersection(r,e.y)}else{const r=0===e.y?2:3;this.addBorderIntersection(r,t.x),this.addBorderIntersection(r,e.x)}}centroid(){return 0===this.accCount?new Nt(0,0):new Nt(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce(((e,t)=>e+ +(t[0]!==Number.MAX_VALUE)),0):0}}function qp(e,t){const r=e.add(t)._unit(),n=Xt(e.x*r.x+e.y*r.y,-1,1);var i,o,s;return i=Math.acos(n),Math.min(4,Math.max(-4,Math.tan(i)))/4*Fp*((o=e).x*(s=t).y-o.y*s.x<0?-1:1)}const Qp=[e=>e.x<0,e=>e.x>io,e=>e.y<0,e=>e.y>io];function Xp(e,t,r,n){const i=[4];if(0===n)return i;r._mult(n);const o=e.sub(r),s=t.sub(r),a=[e,t,o,s];for(let e=0;e<4;e++)for(const t of a)if(Qp[e](t)){i.push(e);break}return i}class Yp{constructor(e){this.vertexArray=new Ml,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom,(e=>Bp.includes(e))),this._segments=new mc,this.hiddenByLandmarkVertexArray=new tc,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new mc}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,t,r,n=!1){const i=e.length;if(i>2){let o=Math.max(0,this._segments.get().length-1);const s=this._segments._prepareSegment(4*i,this.vertexArray.length,2*this._segmentToGroundQuads[o].length);let a;o!==this._segments.get().length-1&&(o++,this._segmentToGroundQuads[o]=[],this._segmentToRegionTriCounts[o]=[0,0,0,0,0]);{const t=e[0],r=e[1];a=qp(t.sub(e[i-1])._perp()._unit(),r.sub(t)._perp()._unit())}for(let l=0;l<i;l++){const c=l===i-1?0:l+1,u=e[l],h=e[c],d=e[c===i-1?0:c+1],p=h.sub(u)._perp()._unit(),f=qp(p,d.sub(h)._perp()._unit()),m=a,g=f;if(tf(u,h,t)||n&&rf(u,t)&&rf(h,t)){a=f;continue}const A=s.vertexLength;Up(this.vertexArray,u,h,1,1,m),Up(this.vertexArray,u,h,1,0,m),Up(this.vertexArray,u,h,0,1,g),Up(this.vertexArray,u,h,0,0,g),s.vertexLength+=4;const _=Xp(u,h,p,r);for(const e of _)this._segmentToGroundQuads[o].push({id:A,region:e}),this._segmentToRegionTriCounts[o][e]+=2,s.primitiveLength+=2;a=f}}}prepareBorderSegments(){if(!this.hasData())return;const e=this._segments.get(),t=e.length;for(let e=0;e<t;e++)this._segmentToGroundQuads[e].sort(((e,t)=>e.region-t.region));for(let r=0;r<t;r++){const t=this._segmentToGroundQuads[r],n=e[r],i=this._segmentToRegionTriCounts[r];i.reduce(((e,t)=>e+t),0);let o=0;for(let e=0;e<=4;e++){const t=i[e];if(0!==t){let r=this.regionSegments[e];r||(r=this.regionSegments[e]=new mc);const i={vertexOffset:n.vertexOffset,primitiveOffset:n.primitiveOffset+o,vertexLength:n.vertexLength,primitiveLength:t};r.get().push(i)}o+=t}for(let e=0;e<t.length;e++){const r=t[e].id;this.indexArray.emplaceBack(r,r+1,r+3),this.indexArray.emplaceBack(r,r+3,r+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,t,r,n,i,o){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,t,r,n,i,o)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,Qd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,t,r,n,i,o){this.hasData()&&this.programConfigurations.updatePaintArrays(e,t,r,n,i,o)}updateHiddenByLandmark(e){if(!this.hasData())return;const t=e.groundVertexCount+e.groundVertexArrayOffset;if(0===e.groundVertexCount)return;const r=e.flags&Np?1:0;for(let n=e.groundVertexArrayOffset;n<t;++n)this.hiddenByLandmarkVertexArray.emplace(n,r);this._needsHiddenByLandmarkUpdate=!0}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,Yd.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const t=this.regionSegments[e];t&&t.destroy()}}}}class $p{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new Hl,this.footprintVertices=new El,this.footprintSegments=[],this.layoutVertexArray=new Sl,this.centroidVertexArray=new dc,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom,(e=>zp.includes(e))),this.segments=new mc,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.groundEffect=new Yp(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}populate(e,t,r,n){this.features=[],this.hasPattern=Ud("fill-extrusion",this.layers,t),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=Mu(r),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:i,id:o,index:s,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,l=Fu(i,e);if(!this.layers[0]._featureFilter.filter(new Na(this.zoom),l,r))continue;const c={id:o,sourceLayerIndex:a,index:s,geometry:e?l.geometry:Ru(i,r,n),properties:i.properties,type:i.type,patterns:{}},u=this.layoutVertexArray.length;this.hasPattern?this.features.push(Hd("fill-extrusion",this.layers,c,this.zoom,t)):this.addFeature(c,c.geometry,s,r,{},t.availableImages,n,t.brightness),t.featureIndex.insert(i,c.geometry,s,a,this.index,u)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,t,r,n,i,o){for(const e of this.features){const{geometry:s}=e;this.addFeature(e,s,e.index,t,r,n,i,o)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,t,r,n,i){const o=0!==Object.keys(e).length;if(o&&!this.stateDependentLayers.length)return;const s=o?this.stateDependentLayers:this.layers;this.programConfigurations.updatePaintArrays(e,t,s,r,n,i),this.groundEffect.update(e,t,s,r,n,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Kd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,$d.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Xd.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,n,i,o,s,a){const l=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(e,{})/this.tileToMeter,c=[new Nt(0,0),new Nt(io,io)],u=s.projection,h="globe"===u.name,d="Polygon"===kp[e.type],p=new Wp;p.centroidDataIndex=this.centroidData.length;const f=new Zp,m=this.layers[0].paint.get("fill-extrusion-base").evaluate(e,{},n)<=0,g=this.layers[0].paint.get("fill-extrusion-height").evaluate(e,{},n);f.height=g,f.vertexArrayOffset=this.layoutVertexArray.length,f.groundVertexArrayOffset=this.groundEffect.vertexArray.length,h&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new kl);const A=Nd(t,500);for(let e=A.length-1;e>=0;e--){const t=A[e];(0===t.length||(_=t[0]).every((e=>e.x<=0))||_.every((e=>e.x>=io))||_.every((e=>e.y<=0))||_.every((e=>e.y>=io)))&&A.splice(e,1)}var _;let y;if(h)y=af(A,c,n);else{y=[];for(const e of A)y.push({polygon:e,bounds:c})}const v=d?this.edgeRadius:0,x=v>0&&this.zoom<17,b=(e,t)=>{if(0===e.length)return!1;const r=e[e.length-1];return t.x===r.x&&t.y===r.y};for(const{polygon:e,bounds:t}of y){let r=0,i=0;for(const t of e)d&&!t[0].equals(t[t.length-1])&&t.push(t[0]),i+=d?t.length-1:t.length;const o=this.segments.prepareSegment((d?5:4)*i,this.layoutVertexArray,this.indexArray);f.footprintSegIdx<0&&(f.footprintSegIdx=this.footprintSegments.length),f.polygonSegIdx<0&&(f.polygonSegIdx=this.polygonSegments.length);const s={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},a=new Gp;if(a.vertexOffset=this.footprintVertices.length,a.indexOffset=3*this.footprintIndices.length,a.ringIndices=[],d){const i=[],s=[];r=o.vertexLength;for(let r=0;r<e.length;r++){const c=e[r];c.length&&0!==r&&s.push(i.length/2);const d=[];let p,f;p=c[1].sub(c[0])._perp()._unit(),a.ringIndices.push(c.length-1);for(let e=1;e<c.length;e++){const t=c[e],r=c[e===c.length-1?1:e+1],s=t.clone();if(v){f=r.sub(t)._perp()._unit();const e=p.add(f)._unit(),n=v*Math.min(4,1/(p.x*e.x+p.y*e.y));s.x+=n*e.x,s.y+=n*e.y,s.x=Math.round(s.x),s.y=Math.round(s.y),p=f}!m||0!==v&&!x||b(d,s)||d.push(s),Vp(this.layoutVertexArray,s.x,s.y,0,0,1,1,0),o.vertexLength++,this.footprintVertices.emplaceBack(t.x,t.y),i.push(t.x,t.y),h&&Hp(this.layoutVertexExtArray,u.projectTilePoint(s.x,s.y,n),u.upVector(n,s.x,s.y))}m&&(0===v||x)&&(0!==d.length&&b(d,d[0])&&d.pop(),this.groundEffect.addData(d,t,l))}const c=jd(i,s);for(let e=0;e<c.length;e+=3)this.footprintIndices.emplaceBack(a.vertexOffset+c[e+0],a.vertexOffset+c[e+1],a.vertexOffset+c[e+2]),this.indexArray.emplaceBack(r+c[e],r+c[e+2],r+c[e+1]),o.primitiveLength++;a.indexCount+=c.length,a.vertexCount+=this.footprintVertices.length-a.vertexOffset}for(let i=0;i<e.length;i++){const s=e[i];p.startRing(f,s[0]);let a=s.length>4&&nf(s[s.length-2],s[0],s[1]),c=v?Jp(s[s.length-2],s[0],s[1],v):0;const g=[];let A,_,y;_=s[1].sub(s[0])._perp()._unit();let x=!0;for(let e=1,i=0;e<s.length;e++){let l=s[e-1],d=s[e];const w=s[e===s.length-1?1:e+1];if(p.appendEdge(f,d,l),tf(d,l,t)){v&&(_=w.sub(d)._perp()._unit(),x=!x);continue}const C=d.sub(l)._perp(),E=C.x/(Math.abs(C.x)+Math.abs(C.y)),T=C.y>0?1:0,S=l.dist(d);if(i+S>32768&&(i=0),v){y=w.sub(d)._perp()._unit();let e=ef(l,d,w,Kp(_,y),v);isNaN(e)&&(e=0);const t=d.sub(l)._unit();l=l.add(t.mult(c))._round(),d=d.add(t.mult(-e))._round(),c=e,_=y,m&&this.zoom>=17&&(b(g,l)||g.push(l),b(g,d)||g.push(d))}const M=o.vertexLength,I=s.length>4&&nf(l,d,w);let P=of(i,a,x);if(Vp(this.layoutVertexArray,l.x,l.y,E,T,0,0,P),Vp(this.layoutVertexArray,l.x,l.y,E,T,0,1,P),i+=S,P=of(i,I,!x),a=I,Vp(this.layoutVertexArray,d.x,d.y,E,T,0,0,P),Vp(this.layoutVertexArray,d.x,d.y,E,T,0,1,P),o.vertexLength+=4,this.indexArray.emplaceBack(M+0,M+1,M+2),this.indexArray.emplaceBack(M+1,M+3,M+2),o.primitiveLength+=2,v){const n=r+(1===e?s.length-2:e-2),i=1===e?r:n+1;if(this.indexArray.emplaceBack(M+1,n,M+3),this.indexArray.emplaceBack(n,i,M+3),o.primitiveLength+=2,void 0===A&&(A=M),!tf(w,s[e],t)){const t=e===s.length-1?A:o.vertexLength;this.indexArray.emplaceBack(M+2,M+3,t),this.indexArray.emplaceBack(M+3,t+1,t),this.indexArray.emplaceBack(M+3,i,t+1),o.primitiveLength+=3}x=!x}if(h){const e=this.layoutVertexExtArray,t=u.projectTilePoint(l.x,l.y,n),r=u.projectTilePoint(d.x,d.y,n),i=u.upVector(n,l.x,l.y),o=u.upVector(n,d.x,d.y);Hp(e,t,i),Hp(e,t,i),Hp(e,r,o),Hp(e,r,o)}}d&&(r+=s.length-1),m&&v&&this.zoom>=17&&(0!==g.length&&b(g,g[0])&&g.pop(),this.groundEffect.addData(g,t,l,v>0))}this.footprintSegments.push(a),s.triangleCount=this.indexArray.length-s.triangleArrayOffset,this.polygonSegments.push(s),++f.footprintSegLen,++f.polygonSegLen}if(f.vertexCount=this.layoutVertexArray.length-f.vertexArrayOffset,f.groundVertexCount=this.groundEffect.vertexArray.length-f.groundVertexArrayOffset,0!==f.vertexCount){if(f.centroidXY=p.borders?jp:this.encodeCentroid(p,f),this.centroidData.push(f),p.borders){this.featuresOnBorder.push(p);const e=this.featuresOnBorder.length-1;for(let t=0;t<p.borders.length;t++)p.borders[t][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[t].push(e)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,o,n,a),this.groundEffect.addPaintPropertiesData(e,r,i,o,n,a),this.maxHeight=Math.max(this.maxHeight,g)}}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort(((t,r)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[r].borders[e][0]))}splitToSubtiles(){const e=[];for(let t=0;t<this.centroidData.length;t++){const r=this.centroidData[t],n=+(r.min.y+r.max.y>io),i=2*n+(+(r.min.x+r.max.x>io)^n);for(let n=0;n<r.polygonSegLen;n++){const o=r.polygonSegIdx+n;e.push({centroidIdx:t,subtile:i,polygonSegmentIdx:o,triangleSegmentIdx:this.polygonSegments[o].triangleSegIdx})}}const t=new Hl;e.sort(((e,t)=>e.triangleSegmentIdx===t.triangleSegmentIdx?e.subtile-t.subtile:e.triangleSegmentIdx-t.triangleSegmentIdx));let r=0,n=0,i=0;for(const t of e){if(t.triangleSegmentIdx!==r)break;i++}const o=e.length;for(;n!==e.length;){r=e[n].triangleSegmentIdx;let s=0,a=n,l=n;for(let t=a;t<i&&e[t].subtile===s;t++)l++;for(;a!==i;){const n=e[a];s=n.subtile;const o=this.centroidData[n.centroidIdx].min.clone(),c=this.centroidData[n.centroidIdx].max.clone(),u={vertexOffset:this.segments.segments[r].vertexOffset,primitiveOffset:t.length,vertexLength:this.segments.segments[r].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let r=a;r<l;r++){const n=e[r],i=this.polygonSegments[n.polygonSegmentIdx],s=this.centroidData[n.centroidIdx].min,a=this.centroidData[n.centroidIdx].max,l=this.indexArray.uint16;for(let e=i.triangleArrayOffset;e<i.triangleArrayOffset+i.triangleCount;e++)t.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);u.primitiveLength+=i.triangleCount,o.x=Math.min(o.x,s.x),o.y=Math.min(o.y,s.y),c.x=Math.max(c.x,a.x),c.y=Math.max(c.y,a.y)}u.primitiveLength>0&&this.triangleSubSegments.push({segment:u,min:o,max:c}),a=l;for(let t=a;t<i&&e[t].subtile===e[a].subtile;t++)l++}n=i;for(let t=n;t<o&&e[t].triangleSegmentIdx===e[n].triangleSegmentIdx;t++)i++}t._trim(),this.indexArray=t}getVisibleSegments(e,t,r){let n=0,i=0;const o=1<<e.canonical.z;if(t){const r=t.getMinMaxForTile(e);r&&(n=r.min,i=r.max)}i+=this.maxHeight;const s=e.toUnwrapped();let a;const l=[s.canonical.x/o+s.wrap,s.canonical.y/o],c=[(s.canonical.x+1)/o+s.wrap,(s.canonical.y+1)/o],u=new mc,h=(e,t,r)=>[e[0]*(1-r[0])+t[0]*r[0],e[1]*(1-r[1])+t[1]*r[1]],d=[],p=[];for(const e of this.triangleSubSegments){d[0]=e.min.x/io,d[1]=e.min.y/io,p[0]=e.max.x/io,p[1]=e.max.y/io;const t=h(l,c,d),o=h(l,c,p);if(0===new mh([t[0],t[1],n],[o[0],o[1],i]).intersectsPrecise(r)){a&&(u.segments.push(a),a=void 0);continue}const s=e.segment;a&&a.vertexOffset!==s.vertexOffset&&(u.segments.push(a),a=void 0),a?(a.vertexLength+=s.vertexLength,a.primitiveLength+=s.primitiveLength):a={vertexOffset:s.vertexOffset,primitiveLength:s.primitiveLength,vertexLength:s.vertexLength,primitiveOffset:s.primitiveOffset,sortKey:void 0,vaos:{}}}return a&&u.segments.push(a),u}encodeCentroid(e,t){const r=e.centroid(),n=t.span(),i=Math.min(7,Math.round(n.x*this.tileToMeter/10)),o=Math.min(7,Math.round(n.y*this.tileToMeter/10));return new Nt(Xt(r.x,1,io-1)<<3|i,Xt(r.y,1,io-1)<<3|o)}encodeBorderCentroid(e){if(!e.borders)return new Nt(0,0);const t=e.borders,r=Number.MAX_VALUE;if(t[0][0]!==r||t[1][0]!==r){const e=t[0][0]!==r?0:1;return new Nt(6|(t[0][0]!==r?0:65528),(t[e][0]+t[e][1])/2<<3|6)}{const e=t[2][0]!==r?2:3;return new Nt((t[e][0]+t[e][1])/2<<3|6,6|(t[2][0]!==r?0:65528))}}showCentroid(e){const t=this.centroidData[e.centroidDataIndex];t.flags&=Np,t.centroidXY.x=0,t.centroidXY.y=0,this.writeCentroidToBuffer(t)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const t=e.vertexArrayOffset,r=e.vertexCount+e.vertexArrayOffset,n=e.flags&Np?jp:e.centroidXY,i=this.centroidVertexArray.geta_centroid_pos0(t);if(this.centroidVertexArray.geta_centroid_pos1(t)!==n.y||i!==n.x){for(let e=t;e<r;++e)this.centroidVertexArray.emplace(e,n.x,n.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.centroidData)this.writeCentroidToBuffer(e)}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped());if(function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].sourceId!==t[r].sourceId||!mp(e[r],t[r]))return!1;return!0}(this.activeReplacements,r))return;if(this.activeReplacements=r,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(const e of this.centroidData)e.flags&=2147483647;const n=[];for(const t of this.activeReplacements){const r=Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z);for(const i of this.centroidData)if(!(i.flags&Np||t.min.x>i.max.x||i.min.x>t.max.x||t.min.y>i.max.y||i.min.y>t.max.y))for(let o=0;o<i.footprintSegLen;o++){const s=this.footprintSegments[i.footprintSegIdx+o];if(n.length=0,lf(this.footprintVertices,s.vertexOffset,s.vertexCount,t.footprintTileId.canonical,e.canonical,n),yp(t.footprint,n,this.footprintIndices.uint16,s.indexOffset,s.indexCount,-s.vertexOffset,-r)){i.flags|=Np;break}}}for(const e of this.centroidData)this.writeCentroidToBuffer(e);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,t,r){let n=!1;for(let i=0;i<r.footprintSegLen;i++){const o=this.footprintSegments[r.footprintSegIdx+i];let s=0;for(const r of o.ringIndices){for(let i=s,a=r+s-1;i<r+s;a=i++){const r=this.footprintVertices.int16[2*(i+o.vertexOffset)+0],s=this.footprintVertices.int16[2*(i+o.vertexOffset)+1],l=this.footprintVertices.int16[2*(a+o.vertexOffset)+1];s>t!=l>t&&e<(this.footprintVertices.int16[2*(a+o.vertexOffset)+0]-r)*(t-s)/(l-s)+r&&(n=!n)}s=r}}return n}getHeightAtTileCoord(e,t){let r=Number.NEGATIVE_INFINITY,n=!0;const i=4*(e+io)*io+(t+io);if(this.partLookup.hasOwnProperty(i)){const e=this.partLookup[i];return e?{height:e.height,hidden:!!(e.flags&Np)}:void 0}for(const o of this.centroidData)e>o.max.x||o.min.x>e||t>o.max.y||o.min.y>t||this.footprintContainsPoint(e,t,o)&&o&&o.height>r&&(r=o.height,this.partLookup[i]=o,n=!!(o.flags&Np));if(r!==Number.NEGATIVE_INFINITY)return{height:r,hidden:n};this.partLookup[i]=void 0}}function Kp(e,t){const r=e.add(t)._unit();return e.x*r.x+e.y*r.y}function Jp(e,t,r,n){const i=t.sub(e)._perp()._unit(),o=r.sub(t)._perp()._unit();return ef(e,t,r,Kp(i,o),n)}function ef(e,t,r,n,i){const o=Math.sqrt(1-n*n);return Math.min(e.dist(t)/3,t.dist(r)/3,i*o/n)}function tf(e,t,r){return e.x<r[0].x&&t.x<r[0].x||e.x>r[1].x&&t.x>r[1].x||e.y<r[0].y&&t.y<r[0].y||e.y>r[1].y&&t.y>r[1].y}function rf(e,t){return e.x<t[0].x||e.x>t[1].x||e.y<t[0].y||e.y>t[1].y}function nf(e,t,r){if(e.x<0||e.x>=io||t.x<0||t.x>=io||r.x<0||r.x>=io)return!1;const n=r.sub(t),i=n.perp(),o=e.sub(t);return(n.x*o.x+n.y*o.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(o.x*o.x+o.y*o.y))>-.866&&i.x*o.x+i.y*o.y<0}function of(e,t,r){const n=t?2|e:-3&e;return r?1|n:-2&n}function sf(){const e=Math.PI/32,t=Math.tan(e),r=iu;return r*Math.sqrt(1+2*t*t)-r}function af(e,t,r){const n=1<<r.z,i=xu(r.x/n),o=xu((r.x+1)/n),s=bu(r.y/n),a=bu((r.y+1)/n);return function(e,t,r,n,i=0,o){const s=[];if(!e.length||!r||!n)return s;const a=(e,t)=>{for(const r of e)s.push({polygon:r,bounds:t})},l=Math.ceil(Math.log2(r)),c=Math.ceil(Math.log2(n)),u=l-c,h=[];for(let e=0;e<Math.abs(u);e++)h.push(u>0?0:1);for(let e=0;e<Math.min(l,c);e++)h.push(0),h.push(1);let d=e;if(d=pp(d,t[0].y-i,t[1].y+i,1),d=pp(d,t[0].x-i,t[1].x+i,0),!d.length)return s;const p=[];for(h.length?p.push({polygons:d,bounds:t,depth:0}):a(d,t);p.length;){const e=p.pop(),t=e.depth,r=h[t],n=e.bounds[0],s=e.bounds[1],l=0===r?n.x:n.y,c=0===r?s.x:s.y,u=o?o(r,l,c):.5*(l+c),d=pp(e.polygons,l-i,u+i,r),f=pp(e.polygons,u-i,c+i,r);if(d.length){const e=[n,new Nt(0===r?u:s.x,1===r?u:s.y)];h.length>t+1?p.push({polygons:d,bounds:e,depth:t+1}):a(d,e)}if(f.length){const e=[new Nt(0===r?u:n.x,1===r?u:n.y),s];h.length>t+1?p.push({polygons:f,bounds:e,depth:t+1}):a(f,e)}}return s}(e,t,Math.ceil((o-i)/11.25),Math.ceil((s-a)/11.25),1,((e,t,i)=>{if(0===e)return.5*(t+i);{const e=bu((r.y+t/io)/n);return(yu(.5*(bu((r.y+i/io)/n)+e))*n-r.y)*io}}))}function lf(e,t,r,n,i,o){const s=Math.pow(2,n.z-i.z);for(let a=0;a<r;a++){let r=e.int16[2*(a+t)+0],l=e.int16[2*(a+t)+1];r=(r+i.x*io)*s-n.x*io,l=(l+i.y*io)*s-n.y*io,o.push(new Nt(r,l))}}fa($p,"FillExtrusionBucket",{omit:["layers","features"]}),fa(Zp,"PartData"),fa(Gp,"FootprintSegment"),fa(Wp,"BorderCentroidData"),fa(Yp,"GroundEffect");const cf=new Ka({visibility:new Xa(tl["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new Xa(tl["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var uf={paint:new Ka({"fill-extrusion-opacity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-emissive-strength"])}),layout:cf};class hf extends Nt{constructor(e,t,r){super(e,t),this.z=r}}function df(e,t){return e.x*t.x+e.y*t.y}function pf(e,t){if(1===e.length){let r=0;const n=t[r++];let i;for(;!i||n.equals(i);)if(i=t[r++],!i)return 1/0;for(;r<t.length;r++){const o=t[r],s=e[0],a=i.sub(n),l=o.sub(n),c=s.sub(n),u=df(a,a),h=df(a,l),d=df(l,l),p=df(c,a),f=df(c,l),m=u*d-h*h,g=(d*p-h*f)/m,A=(u*f-h*p)/m,_=n.z*(1-g-A)+i.z*g+o.z*A;if(isFinite(_))return _}return 1/0}{let e=1/0;for(const r of t)e=Math.min(e,r.z);return e}}function ff(e,t,r,n,i,o,s,a){const l=s*i.getElevationAt(e,t,!0,!0),c=0!==o[0],u=c?0===o[1]?s*(o[0]/7-450):s*function(e,t,r){const n=Math.floor(t[0]/8),i=Math.floor(t[1]/8),o=10*(t[0]-8*n),s=10*(t[1]-8*i),a=e.getElevationAt(n,i,!0,!0),l=e.getMeterToDEM(r),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(s*l-1)),h=e.tileCoordToPixel(n,i),d=2*c+1,p=2*u+1,f=function(e,t,r,n,i){return[e.getElevationAtPixel(t,r,!0),e.getElevationAtPixel(t+i,r,!0),e.getElevationAtPixel(t,r+i,!0),e.getElevationAtPixel(t+n,r+i,!0)]}(e,h.x-c,h.y-u,d,p),m=Math.abs(f[0]-f[1]),g=Math.abs(f[2]-f[3]),A=Math.abs(f[0]-f[2])+Math.abs(f[1]-f[3]),_=Math.min(.25,.5*l*(m+g)/d),y=Math.min(.25,.5*l*A/p);return a+Math.max(_*o,y*s)}(i,o,a):l;return{base:l+(0===r)?-1:r,top:c?Math.max(u+n,l+r+2):l+n}}const mf=wl([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:gf}=mf,Af=wl([{name:"a_packed",components:4,type:"Float32"}]),{members:_f}=Af,yf=wl([{name:"a_pattern_data",components:2,type:"Float32"}]),{members:vf}=yf;class xf{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new rd({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const r=this.getKey(e,t);return this.positions[r]}trim(){const e=this.width,t=this.height=nr(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,r){const n=[];let i=e.length%2==1?-e[e.length-1]*r:0,o=e[0]*r,s=!0;n.push({left:i,right:o,isDash:s,zeroLength:0===e[0]});let a=e[0];for(let t=1;t<e.length;t++){s=!s;const l=e[t];i=a*r,a+=l,o=a*r,n.push({left:i,right:o,isDash:s,zeroLength:0===l})}return n}addRoundDash(e,t,r){const n=t/2;for(let t=-r;t<=r;t++){const i=this.width*(this.nextRow+r+t);let o=0,s=e[o];for(let a=0;a<this.width;a++){a/s.right>1&&(s=e[++o]);const l=Math.abs(a-s.left),c=Math.abs(a-s.right),u=Math.min(l,c);let h;const d=t/r*(n+1);if(s.isDash){const e=n-Math.abs(d);h=Math.sqrt(u*u+e*e)}else h=n-Math.sqrt(u*u+d*d);this.image.data[i+a]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}const r=e[0],n=e[e.length-1];r.isDash===n.isDash&&(r.left=n.left-this.width,n.right=r.right+this.width);const i=this.width*this.nextRow;let o=0,s=e[o];for(let r=0;r<this.width;r++){r/s.right>1&&(s=e[++o]);const n=Math.abs(r-s.left),a=Math.abs(r-s.right),l=Math.min(n,a);this.image.data[i+r]=Math.max(0,Math.min(255,(s.isDash?l:-l)+t+128))}}addDash(e,t){const r=this.getKey(e,t);if(this.positions[r])return this.positions[r];const n="round"===t,i=n?7:0,o=2*i+1;if(this.nextRow+o>this.height)return hr("LineAtlas out of space"),null;0===e.length&&e.push(1);let s=0;for(let t=0;t<e.length;t++)e[t]<0&&(hr("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),s+=e[t];if(0!==s){const r=this.width/s,o=this.getDashRanges(e,this.width,r);n?this.addRoundDash(o,r,i):this.addRegularDash(o,"square"===t?.5*r:0)}const a=this.nextRow+i;this.nextRow+=o;const l={tl:[a,i],br:[s,0]};return this.positions[r]=l,l}}fa(xf,"LineAtlas");const bf=dp.types,wf=Math.cos(Math.PI/180*37.5),Cf=Math.cos(Math.PI/180*5);class Ef{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Il,this.layoutVertexArray2=new Pl,this.patternVertexArray=new Ll,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom),this.segments=new mc,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r,n){this.hasPattern=Ud("line",this.layers,t);const i=this.layers[0].layout.get("line-sort-key"),o=[];for(const{feature:t,id:s,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Fu(t,e);if(!this.layers[0]._featureFilter.filter(new Na(this.zoom),c,r))continue;const u=i?i.evaluate(c,{},r):void 0,h={id:s,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Ru(t,r,n),patterns:{},sortKey:u};o.push(h)}i&&o.sort(((e,t)=>e.sortKey-t.sortKey));const{lineAtlas:s,featureIndex:a}=t,l=this.addConstantDashes(s);for(const n of o){const{geometry:i,index:o,sourceLayerIndex:c}=n;if(l&&this.addFeatureDashes(n,s),this.hasPattern){const e=Hd("line",this.layers,n,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(n,i,o,r,s.positions,t.availableImages,t.brightness);a.insert(e[o].feature,i,o,c,this.index)}}addConstantDashes(e){let t=!1;for(const r of this.layers){const n=r.paint.get("line-dasharray").value,i=r.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==i.kind)t=!0;else{const t=i.value,r=n.value;if(!r)continue;e.addDash(r,t)}}return t}addFeatureDashes(e,t){const r=this.zoom;for(const n of this.layers){const i=n.paint.get("line-dasharray").value,o=n.layout.get("line-cap").value;if("constant"===i.kind&&"constant"===o.kind)continue;let s,a;if("constant"===i.kind){if(s=i.value,!s)continue}else s=i.evaluate({zoom:r},e);a="constant"===o.kind?o.value:o.evaluate({zoom:r},e),t.addDash(s,a),e.patterns[n.id]=t.getKey(s,a)}}update(e,t,r,n,i){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,n,i)}addFeatures(e,t,r,n,i,o){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r,n,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,_f)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,vf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,gf),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,r,n,i,o,s){const a=this.layers[0].layout,l=a.get("line-join").evaluate(e,{}),c=a.get("line-cap").evaluate(e,{}),u=a.get("line-miter-limit"),h=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const r of t)this.addLine(r,e,l,c,u,h);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,o,n,s)}addLine(e,t,r,n,i,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0;const s="none"===r;if(this.patternJoinNone=this.hasPattern&&s,this.segmentStart=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===bf[t.type];let l=e.length;for(;l>=2&&e[l-1].equals(e[l-2]);)l--;let c=0;for(;c<l-1&&e[c].equals(e[c+1]);)c++;if(l<(a?3:2))return;"bevel"===r&&(i=1.05);const u=this.overscaling<=16?15*io/(512*this.overscaling):0,h=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray);let d,p,f,m,g;this.e1=this.e2=-1,a&&(d=e[l-2],g=e[c].sub(d)._unit()._perp());for(let t=c;t<l;t++){if(f=t===l-1?a?e[c+1]:void 0:e[t+1],f&&e[t].equals(f))continue;g&&(m=g),d&&(p=d),d=e[t],g=f?f.sub(d)._unit()._perp():m,m=m||g;const A=p&&f;let _=A?r:a||s?"butt":n;const y=m.x*g.x+m.y*g.y;if(s){const e=function(e){if(e.patternJoinNone){const t=e.segmentPoints.length/2,r=e.lineSoFar-e.segmentStart;for(let n=0;n<t;++n){const t=e.segmentPoints[2*n+1],i=Math.round(e.segmentPoints[2*n])+.5+.25*t;e.patternVertexArray.emplaceBack(i,r),e.patternVertexArray.emplaceBack(i,r)}e.segmentPoints=[],e.segmentStart=e.lineSoFar}e.e1=e.e2=-1};if(A&&y<Cf){this.updateDistance(p,d),this.addCurrentVertex(d,m,1,1,h),e(this),this.addCurrentVertex(d,g,-1,-1,h);continue}if(p){if(!f){this.updateDistance(p,d),this.addCurrentVertex(d,m,1,1,h),e(this);continue}_="miter"}}let v=m.add(g);0===v.x&&0===v.y||v._unit();const x=v.x*g.x+v.y*g.y,b=0!==x?1/x:1/0,w=2*Math.sqrt(2-2*x),C=x<wf&&p&&f,E=m.x*g.y-m.y*g.x>0;if(C&&t>c){const e=d.dist(p);if(e>2*u){const t=d.sub(d.sub(p)._mult(u/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,m,0,0,h),p=t}}if(A&&"round"===_&&(b<o?_="miter":b<=2&&(_="fakeround")),"miter"===_&&b>i&&(_="bevel"),"bevel"===_&&(b>2&&(_="flipbevel"),b<i&&(_="miter")),p&&this.updateDistance(p,d),"miter"===_)v._mult(b),this.addCurrentVertex(d,v,0,0,h);else if("flipbevel"===_){if(b>100)v=g.mult(-1);else{const e=b*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(e*(E?-1:1))}this.addCurrentVertex(d,v,0,0,h),this.addCurrentVertex(d,v.mult(-1),0,0,h)}else if("bevel"===_||"fakeround"===_){const e=-Math.sqrt(b*b-1),t=E?e:0,r=E?0:e;if(p&&this.addCurrentVertex(d,m,t,r,h),"fakeround"===_){const e=Math.round(180*w/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){const e=r-.5;r+=r*e*(r-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*e*e+(.848013+y*(.215638*y-1.06021)))}const n=g.sub(m)._mult(r)._add(m)._unit()._mult(E?-1:1);this.addHalfVertex(d,n.x,n.y,!1,E,0,h)}}f&&this.addCurrentVertex(d,g,-t,-r,h)}else"butt"===_?this.addCurrentVertex(d,v,0,0,h):"square"===_?(p||this.addCurrentVertex(d,v,-1,-1,h),this.addCurrentVertex(d,v,0,0,h),p&&this.addCurrentVertex(d,v,1,1,h)):"round"===_&&(p&&(this.addCurrentVertex(d,m,0,0,h),this.addCurrentVertex(d,m,1,1,h,!0)),f&&(this.addCurrentVertex(d,g,-1,-1,h,!0),this.addCurrentVertex(d,g,0,0,h)));if(C&&t<l-1){const e=d.dist(f);if(e>2*u){const t=d.add(f.sub(d)._mult(u/e)._round());this.updateDistance(d,t),this.addCurrentVertex(t,g,0,0,h),d=t}}}}addCurrentVertex(e,t,r,n,i,o=!1){const s=t.y*n-t.x,a=-t.y-t.x*n;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,o,!1,r,i),this.addHalfVertex(e,s,a,o,!0,-n,i),this.patternJoinNone&&this.segmentPoints.push(this.lineSoFar-this.segmentStart,r)}addHalfVertex({x:e,y:t},r,n,i,o,s,a){this.layoutVertexArray.emplaceBack((e<<1)+(i?1:0),(t<<1)+(o?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===s?0:s<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),o?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}fa(Ef,"LineBucket",{omit:["layers","patternFeatures"]});const Tf=new Ka({"line-cap":new Ya(tl.layout_line["line-cap"]),"line-join":new Ya(tl.layout_line["line-join"]),"line-miter-limit":new Xa(tl.layout_line["line-miter-limit"]),"line-round-limit":new Xa(tl.layout_line["line-round-limit"]),"line-sort-key":new Ya(tl.layout_line["line-sort-key"]),visibility:new Xa(tl.layout_line.visibility)});var Sf={paint:new Ka({"line-opacity":new Ya(tl.paint_line["line-opacity"]),"line-color":new Ya(tl.paint_line["line-color"]),"line-translate":new Xa(tl.paint_line["line-translate"]),"line-translate-anchor":new Xa(tl.paint_line["line-translate-anchor"]),"line-width":new Ya(tl.paint_line["line-width"]),"line-gap-width":new Ya(tl.paint_line["line-gap-width"]),"line-offset":new Ya(tl.paint_line["line-offset"]),"line-blur":new Ya(tl.paint_line["line-blur"]),"line-dasharray":new Ya(tl.paint_line["line-dasharray"]),"line-pattern":new Ya(tl.paint_line["line-pattern"]),"line-gradient":new $a(tl.paint_line["line-gradient"]),"line-trim-offset":new Xa(tl.paint_line["line-trim-offset"]),"line-emissive-strength":new Xa(tl.paint_line["line-emissive-strength"]),"line-border-width":new Ya(tl.paint_line["line-border-width"]),"line-border-color":new Ya(tl.paint_line["line-border-color"])}),layout:Tf};function Mf(e,t,r){return t*(io/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}function If(e,t){return 1/Mf(e,1,t.tileZoom)}function Pf(e,t,r,n){return e.translatePosMatrix(n||t.tileID.projMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Lf=e=>{const t=[];Of(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const r=e.paint.get("line-trim-offset");0===r[0]&&0===r[1]||t.push("RENDER_LINE_TRIM_OFFSET"),0!==e.paint.get("line-border-width").constantOr(1)&&t.push("RENDER_LINE_BORDER");const n="none"===e.layout.get("line-join").constantOr("miter"),i=!!e.paint.get("line-pattern").constantOr(1);return n&&i&&t.push("LINE_JOIN_NONE"),t};function Of(e){const t=e.paint.get("line-dasharray").value;return t.value||"constant"!==t.kind}const Df=new class extends Ya{possiblyEvaluate(e,t){return t=new Na(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,n){return t=Jt({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,n)}}(Sf.paint.properties["line-width"].specification);function kf(e,t){return t>0?t+2*e:e}Df.useIntegerZoom=!0;const zf=wl([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Bf=wl([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Rf=wl([{name:"a_projected_pos",components:4,type:"Float32"}],4);wl([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ff=wl([{name:"a_z_offset",components:1,type:"Float32"}],4),jf=wl([{name:"a_texb",components:2,type:"Uint16"}]),Nf=wl([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Vf=wl([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_z_offset",components:1,type:"Float32"}]);wl([{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 Uf=wl([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Hf=wl([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);wl([{name:"triangle",components:3,type:"Uint16"}]),wl([{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"}]),wl([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{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"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"}]),wl([{type:"Float32",name:"offsetX"}]),wl([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Gf=24;const Zf=128;function Wf(e,t){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Na(e+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:n}=r;let i=0;for(;i<t.length&&t[i]<=e;)i++;i=Math.max(0,i-1);let o=i;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const s=t[i],a=t[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:a,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:a,minSize:r.evaluate(new Na(s)),maxSize:r.evaluate(new Na(a)),interpolationType:n}}}function qf(e,{uSize:t,uSizeT:r},{lowerSize:n,upperSize:i}){return"source"===e.kind?n/Zf:"composite"===e.kind?Hn(n/Zf,i/Zf,r):t}function Qf(e,t){let r=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){const{interpolationType:i,minZoom:o,maxZoom:s}=e,a=i?Xt(ds.interpolationFactor(i,t,o,s),0,1):0;"camera"===e.kind?n=Hn(e.minSize,e.maxSize,a):r=a}return{uSizeT:r,uSize:n}}var Xf=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:Zf,evaluateSizeForFeature:qf,evaluateSizeForZoom:Qf,getSizeData:Wf});function Yf(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){const n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),ja.applyArabicShaping&&(e=ja.applyArabicShaping(e)),e}(e.text,t,r)})),e}const $f={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function Kf(e){return"︶"===e||"﹈"===e||"︸"===e||"﹄"===e||"﹂"===e||"︾"===e||"︼"===e||"︺"===e||"︘"===e||"﹀"===e||"︐"===e||"︓"===e||"︔"===e||"`"===e||" ̄"===e||"︑"===e||"︒"===e}function Jf(e){return"︵"===e||"﹇"===e||"︷"===e||"﹃"===e||"﹁"===e||"︽"===e||"︻"===e||"︹"===e||"︗"===e||"︿"===e}var em={
|
|
33
|
+
*/!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",s=16,a=32,l=64,c=128,u=256,h=1/0,d=9007199254740991,p=NaN,f=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",a],["partialRight",l],["rearg",u]],g="[object Arguments]",A="[object Array]",_="[object Boolean]",y="[object Date]",v="[object Error]",x="[object Function]",b="[object GeneratorFunction]",w="[object Map]",C="[object Number]",E="[object Object]",T="[object Promise]",S="[object RegExp]",M="[object Set]",I="[object String]",P="[object Symbol]",L="[object WeakMap]",O="[object ArrayBuffer]",D="[object DataView]",k="[object Float32Array]",z="[object Float64Array]",B="[object Int8Array]",R="[object Int16Array]",F="[object Int32Array]",j="[object Uint8Array]",N="[object Uint8ClampedArray]",V="[object Uint16Array]",U="[object Uint32Array]",H=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,Q=RegExp(W.source),X=RegExp(q.source),Y=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(re.source),ie=/^\s+/,oe=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,Ae=/^0o[0-7]+$/i,_e=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['’]",Pe="["+be+"]",Le="["+Me+"]",Oe="["+we+"]",De="\\d+",ke="["+Ce+"]",ze="["+Ee+"]",Be="[^"+be+Me+De+Ce+Ee+Te+"]",Re="\\ud83c[\\udffb-\\udfff]",Fe="[^"+be+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",Ne="[\\ud800-\\udbff][\\udc00-\\udfff]",Ve="["+Te+"]",Ue="\\u200d",He="(?:"+ze+"|"+Be+")",Ge="(?:"+Ve+"|"+Be+")",Ze="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Qe="(?:"+Oe+"|"+Re+")"+"?",Xe="["+Se+"]?",Ye=Xe+Qe+("(?:"+Ue+"(?:"+[Fe,je,Ne].join("|")+")"+Xe+Qe+")*"),$e="(?:"+[ke,je,Ne].join("|")+")"+Ye,Ke="(?:"+[Fe+Oe+"?",Oe,je,Ne,Pe].join("|")+")",Je=RegExp(Ie,"g"),et=RegExp(Oe,"g"),tt=RegExp(Re+"(?="+Re+")|"+Ke+Ye,"g"),rt=RegExp([Ve+"?"+ze+"+"+Ze+"(?="+[Le,Ve,"$"].join("|")+")",Ge+"+"+qe+"(?="+[Le,Ve+He,"$"].join("|")+")",Ve+"?"+He+"+"+Ze,Ve+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",De,$e].join("|"),"g"),nt=RegExp("["+Ue+be+we+Se+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,at={};at[k]=at[z]=at[B]=at[R]=at[F]=at[j]=at[N]=at[V]=at[U]=!0,at[g]=at[A]=at[O]=at[_]=at[D]=at[y]=at[v]=at[x]=at[w]=at[C]=at[E]=at[S]=at[M]=at[I]=at[L]=!1;var lt={};lt[g]=lt[A]=lt[O]=lt[D]=lt[_]=lt[y]=lt[k]=lt[z]=lt[B]=lt[R]=lt[F]=lt[w]=lt[C]=lt[E]=lt[S]=lt[M]=lt[I]=lt[P]=lt[j]=lt[N]=lt[V]=lt[U]=!0,lt[v]=lt[x]=lt[L]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,ht=parseInt,dt="object"==typeof We&&We&&We.Object===Object&&We,pt="object"==typeof self&&self&&self.Object===Object&&self,ft=dt||pt||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,At=gt&>.exports===mt,_t=At&&dt.process,yt=function(){try{var e=gt&>.require&>.require("util").types;return e||_t&&_t.binding&&_t.binding("util")}catch(e){}}(),vt=yt&&yt.isArrayBuffer,xt=yt&&yt.isDate,bt=yt&&yt.isMap,wt=yt&&yt.isRegExp,Ct=yt&&yt.isSet,Et=yt&&yt.isTypedArray;function Tt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function St(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n}function Mt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function It(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Pt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Lt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Ot(e,t){return!!(null==e?0:e.length)&&Ut(e,t,0)>-1}function Dt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function kt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function zt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Bt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Rt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Ft(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var jt=Wt("length");function Nt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Vt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ut(e,t,r){return t==t?function(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Vt(e,Gt,r)}function Ht(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Gt(e){return e!=e}function Zt(e,t){var r=null==e?0:e.length;return r?Xt(e,t)/r:p}function Wt(e){return function(t){return null==t?r:t[e]}}function qt(e){return function(t){return null==e?r:e[t]}}function Qt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Xt(e,t){for(var n,i=-1,o=e.length;++i<o;){var s=t(e[i]);s!==r&&(n=n===r?s:n+s)}return n}function Yt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function $t(e){return e?e.slice(0,fr(e)+1).replace(ie,""):e}function Kt(e){return function(t){return e(t)}}function Jt(e,t){return kt(t,(function(t){return e[t]}))}function er(e,t){return e.has(t)}function tr(e,t){for(var r=-1,n=e.length;++r<n&&Ut(t,e[r],0)>-1;);return r}function rr(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}var nr=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+ct[e]}function sr(e){return nt.test(e)}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function lr(e,t){return function(r){return e(t(r))}}function cr(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var a=e[r];a!==t&&a!==o||(e[r]=o,s[i++]=r)}return s}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function hr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function dr(e){return sr(e)?function(e){var t=tt.lastIndex=0;for(;tt.test(e);)++t;return t}(e):jt(e)}function pr(e){return sr(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.split("")}(e)}function fr(e){for(var t=e.length;t--&&oe.test(e.charAt(t)););return t}var mr=qt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var gr=function e(t){var oe,be=(t=null==t?ft:gr.defaults(ft.Object(),t,gr.pick(ft,ot))).Array,we=t.Date,Ce=t.Error,Ee=t.Function,Te=t.Math,Se=t.Object,Me=t.RegExp,Ie=t.String,Pe=t.TypeError,Le=be.prototype,Oe=Ee.prototype,De=Se.prototype,ke=t["__core-js_shared__"],ze=Oe.toString,Be=De.hasOwnProperty,Re=0,Fe=(oe=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||""))?"Symbol(src)_1."+oe:"",je=De.toString,Ne=ze.call(Se),Ve=ft._,Ue=Me("^"+ze.call(Be).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=At?t.Buffer:r,Ge=t.Symbol,Ze=t.Uint8Array,We=He?He.allocUnsafe:r,qe=lr(Se.getPrototypeOf,Se),Qe=Se.create,Xe=De.propertyIsEnumerable,Ye=Le.splice,$e=Ge?Ge.isConcatSpreadable:r,Ke=Ge?Ge.iterator:r,tt=Ge?Ge.toStringTag:r,nt=function(){try{var e=po(Se,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,dt=we&&we.now!==ft.Date.now&&we.now,pt=t.setTimeout!==ft.setTimeout&&t.setTimeout,mt=Te.ceil,gt=Te.floor,_t=Se.getOwnPropertySymbols,yt=He?He.isBuffer:r,jt=t.isFinite,qt=Le.join,Ar=lr(Se.keys,Se),_r=Te.max,yr=Te.min,vr=we.now,xr=t.parseInt,br=Te.random,wr=Le.reverse,Cr=po(t,"DataView"),Er=po(t,"Map"),Tr=po(t,"Promise"),Sr=po(t,"Set"),Mr=po(t,"WeakMap"),Ir=po(Se,"create"),Pr=Mr&&new Mr,Lr={},Or=jo(Cr),Dr=jo(Er),kr=jo(Tr),zr=jo(Sr),Br=jo(Mr),Rr=Ge?Ge.prototype:r,Fr=Rr?Rr.valueOf:r,jr=Rr?Rr.toString:r;function Nr(e){if(ra(e)&&!Zs(e)&&!(e instanceof Gr)){if(e instanceof Hr)return e;if(Be.call(e,"__wrapped__"))return No(e)}return new Hr(e)}var Vr=function(){function e(){}return function(t){if(!ta(t))return{};if(Qe)return Qe(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Ur(){}function Hr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Qr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new qr;++t<r;)this.add(e[t])}function Xr(e){var t=this.__data__=new Wr(e);this.size=t.size}function Yr(e,t){var r=Zs(e),n=!r&&Gs(e),i=!r&&!n&&Xs(e),o=!r&&!n&&!i&&ua(e),s=r||n||i||o,a=s?Yt(e.length,Ie):[],l=a.length;for(var c in e)!t&&!Be.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vo(c,l))||a.push(c);return a}function $r(e){var t=e.length;return t?e[Xn(0,t-1)]:r}function Kr(e,t){return Bo(Pi(e),ln(t,0,e.length))}function Jr(e){return Bo(Pi(e))}function en(e,t,n){(n!==r&&!Vs(e[t],n)||n===r&&!(t in e))&&sn(e,t,n)}function tn(e,t,n){var i=e[t];Be.call(e,t)&&Vs(i,n)&&(n!==r||t in e)||sn(e,t,n)}function rn(e,t){for(var r=e.length;r--;)if(Vs(e[r][0],t))return r;return-1}function nn(e,t,r,n){return pn(e,(function(e,i,o){t(n,e,r(e),o)})),n}function on(e,t){return e&&Li(t,Oa(t),e)}function sn(e,t,r){"__proto__"==t&&nt?nt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function an(e,t){for(var n=-1,i=t.length,o=be(i),s=null==e;++n<i;)o[n]=s?r:Sa(e,t[n]);return o}function ln(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function cn(e,t,n,i,o,s){var a,l=1&t,c=2&t,u=4&t;if(n&&(a=o?n(e,i,o,s):n(e)),a!==r)return a;if(!ta(e))return e;var h=Zs(e);if(h){if(a=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Be.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!l)return Pi(e,a)}else{var d=go(e),p=d==x||d==b;if(Xs(e))return Ci(e,l);if(d==E||d==g||p&&!o){if(a=c||p?{}:_o(e),!l)return c?function(e,t){return Li(e,mo(e),t)}(e,function(e,t){return e&&Li(t,Da(t),e)}(a,e)):function(e,t){return Li(e,fo(e),t)}(e,on(a,e))}else{if(!lt[d])return o?e:{};a=function(e,t,r){var n=e.constructor;switch(t){case O:return Ei(e);case _:case y:return new n(+e);case D:return function(e,t){var r=t?Ei(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case k:case z:case B:case R:case F:case j:case N:case V:case U:return Ti(e,r);case w:return new n;case C:case I:return new n(e);case S:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return new n;case P:return i=e,Fr?Se(Fr.call(i)):{}}var i}(e,d,l)}}s||(s=new Xr);var f=s.get(e);if(f)return f;s.set(e,a),aa(e)?e.forEach((function(r){a.add(cn(r,t,n,r,e,s))})):na(e)&&e.forEach((function(r,i){a.set(i,cn(r,t,n,i,e,s))}));var m=h?r:(u?c?oo:io:c?Da:Oa)(e);return Mt(m||e,(function(r,i){m&&(r=e[i=r]),tn(a,i,cn(r,t,n,i,e,s))})),a}function un(e,t,n){var i=n.length;if(null==e)return!i;for(e=Se(e);i--;){var o=n[i],s=t[o],a=e[o];if(a===r&&!(o in e)||!s(a))return!1}return!0}function hn(e,t,i){if("function"!=typeof e)throw new Pe(n);return Oo((function(){e.apply(r,i)}),t)}function dn(e,t,r,n){var i=-1,o=Ot,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;r&&(t=kt(t,Kt(r))),n?(o=Dt,s=!1):t.length>=200&&(o=er,s=!1,t=new Qr(t));e:for(;++i<a;){var u=e[i],h=null==r?u:r(u);if(u=n||0!==u?u:0,s&&h==h){for(var d=c;d--;)if(t[d]===h)continue e;l.push(u)}else o(t,h,n)||l.push(u)}return l}Nr.templateSettings={escape:Y,evaluate:$,interpolate:K,variable:"",imports:{_:Nr}},Nr.prototype=Ur.prototype,Nr.prototype.constructor=Nr,Hr.prototype=Vr(Ur.prototype),Hr.prototype.constructor=Hr,Gr.prototype=Vr(Ur.prototype),Gr.prototype.constructor=Gr,Zr.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},Zr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Zr.prototype.get=function(e){var t=this.__data__;if(Ir){var n=t[e];return n===i?r:n}return Be.call(t,e)?t[e]:r},Zr.prototype.has=function(e){var t=this.__data__;return Ir?t[e]!==r:Be.call(t,e)},Zr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ir&&t===r?i:t,this},Wr.prototype.clear=function(){this.__data__=[],this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=rn(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,!0)},Wr.prototype.get=function(e){var t=this.__data__,n=rn(t,e);return n<0?r:t[n][1]},Wr.prototype.has=function(e){return rn(this.__data__,e)>-1},Wr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},qr.prototype.clear=function(){this.size=0,this.__data__={hash:new Zr,map:new(Er||Wr),string:new Zr}},qr.prototype.delete=function(e){var t=uo(this,e).delete(e);return this.size-=t?1:0,t},qr.prototype.get=function(e){return uo(this,e).get(e)},qr.prototype.has=function(e){return uo(this,e).has(e)},qr.prototype.set=function(e,t){var r=uo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Qr.prototype.add=Qr.prototype.push=function(e){return this.__data__.set(e,i),this},Qr.prototype.has=function(e){return this.__data__.has(e)},Xr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Xr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Xr.prototype.get=function(e){return this.__data__.get(e)},Xr.prototype.has=function(e){return this.__data__.has(e)},Xr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!Er||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new qr(n)}return r.set(e,t),this.size=r.size,this};var pn=ki(xn),fn=ki(bn,!0);function mn(e,t){var r=!0;return pn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function gn(e,t,n){for(var i=-1,o=e.length;++i<o;){var s=e[i],a=t(s);if(null!=a&&(l===r?a==a&&!ca(a):n(a,l)))var l=a,c=s}return c}function An(e,t){var r=[];return pn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function _n(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=yo),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?_n(a,t-1,r,n,i):zt(i,a):n||(i[i.length]=a)}return i}var yn=zi(),vn=zi(!0);function xn(e,t){return e&&yn(e,t,Oa)}function bn(e,t){return e&&vn(e,t,Oa)}function wn(e,t){return Lt(t,(function(t){return Ks(e[t])}))}function Cn(e,t){for(var n=0,i=(t=vi(t,e)).length;null!=e&&n<i;)e=e[Fo(t[n++])];return n&&n==i?e:r}function En(e,t,r){var n=t(e);return Zs(e)?n:zt(n,r(e))}function Tn(e){return null==e?e===r?"[object Undefined]":"[object Null]":tt&&tt in Se(e)?function(e){var t=Be.call(e,tt),n=e[tt];try{e[tt]=r;var i=!0}catch(e){}var o=je.call(e);i&&(t?e[tt]=n:delete e[tt]);return o}(e):function(e){return je.call(e)}(e)}function Sn(e,t){return e>t}function Mn(e,t){return null!=e&&Be.call(e,t)}function In(e,t){return null!=e&&t in Se(e)}function Pn(e,t,n){for(var i=n?Dt:Ot,o=e[0].length,s=e.length,a=s,l=be(s),c=1/0,u=[];a--;){var h=e[a];a&&t&&(h=kt(h,Kt(t))),c=yr(h.length,c),l[a]=!n&&(t||o>=120&&h.length>=120)?new Qr(a&&h):r}h=e[0];var d=-1,p=l[0];e:for(;++d<o&&u.length<c;){var f=h[d],m=t?t(f):f;if(f=n||0!==f?f:0,!(p?er(p,m):i(u,m,n))){for(a=s;--a;){var g=l[a];if(!(g?er(g,m):i(e[a],m,n)))continue e}p&&p.push(m),u.push(f)}}return u}function Ln(e,t,n){var i=null==(e=Io(e,t=vi(t,e)))?e:e[Fo($o(t))];return null==i?r:Tt(i,e,n)}function On(e){return ra(e)&&Tn(e)==g}function Dn(e,t,n,i,o){return e===t||(null==e||null==t||!ra(e)&&!ra(t)?e!=e&&t!=t:function(e,t,n,i,o,s){var a=Zs(e),l=Zs(t),c=a?A:go(e),u=l?A:go(t),h=(c=c==g?E:c)==E,d=(u=u==g?E:u)==E,p=c==u;if(p&&Xs(e)){if(!Xs(t))return!1;a=!0,h=!1}if(p&&!h)return s||(s=new Xr),a||ua(e)?ro(e,t,n,i,o,s):function(e,t,r,n,i,o,s){switch(r){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!o(new Ze(e),new Ze(t)));case _:case y:case C:return Vs(+e,+t);case v:return e.name==t.name&&e.message==t.message;case S:case I:return e==t+"";case w:var a=ar;case M:var l=1&n;if(a||(a=ur),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;n|=2,s.set(e,t);var u=ro(a(e),a(t),n,i,o,s);return s.delete(e),u;case P:if(Fr)return Fr.call(e)==Fr.call(t)}return!1}(e,t,c,n,i,o,s);if(!(1&n)){var f=h&&Be.call(e,"__wrapped__"),m=d&&Be.call(t,"__wrapped__");if(f||m){var x=f?e.value():e,b=m?t.value():t;return s||(s=new Xr),o(x,b,n,i,s)}}if(!p)return!1;return s||(s=new Xr),function(e,t,n,i,o,s){var a=1&n,l=io(e),c=l.length,u=io(t),h=u.length;if(c!=h&&!a)return!1;var d=c;for(;d--;){var p=l[d];if(!(a?p in t:Be.call(t,p)))return!1}var f=s.get(e),m=s.get(t);if(f&&m)return f==t&&m==e;var g=!0;s.set(e,t),s.set(t,e);var A=a;for(;++d<c;){var _=e[p=l[d]],y=t[p];if(i)var v=a?i(y,_,p,t,e,s):i(_,y,p,e,t,s);if(!(v===r?_===y||o(_,y,n,i,s):v)){g=!1;break}A||(A="constructor"==p)}if(g&&!A){var x=e.constructor,b=t.constructor;x==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b||(g=!1)}return s.delete(e),s.delete(t),g}(e,t,n,i,o,s)}(e,t,n,i,Dn,o))}function kn(e,t,n,i){var o=n.length,s=o,a=!i;if(null==e)return!s;for(e=Se(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var c=(l=n[o])[0],u=e[c],h=l[1];if(a&&l[2]){if(u===r&&!(c in e))return!1}else{var d=new Xr;if(i)var p=i(u,h,c,e,t,d);if(!(p===r?Dn(h,u,3,i,d):p))return!1}}return!0}function zn(e){return!(!ta(e)||(t=e,Fe&&Fe in t))&&(Ks(e)?Ue:ge).test(jo(e));var t}function Bn(e){return"function"==typeof e?e:null==e?il:"object"==typeof e?Zs(e)?Un(e[0],e[1]):Vn(e):pl(e)}function Rn(e){if(!Eo(e))return Ar(e);var t=[];for(var r in Se(e))Be.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Fn(e){if(!ta(e))return function(e){var t=[];if(null!=e)for(var r in Se(e))t.push(r);return t}(e);var t=Eo(e),r=[];for(var n in e)("constructor"!=n||!t&&Be.call(e,n))&&r.push(n);return r}function jn(e,t){return e<t}function Nn(e,t){var r=-1,n=qs(e)?be(e.length):[];return pn(e,(function(e,i,o){n[++r]=t(e,i,o)})),n}function Vn(e){var t=ho(e);return 1==t.length&&t[0][2]?So(t[0][0],t[0][1]):function(r){return r===e||kn(r,e,t)}}function Un(e,t){return bo(e)&&To(t)?So(Fo(e),t):function(n){var i=Sa(n,e);return i===r&&i===t?Ma(n,e):Dn(t,i,3)}}function Hn(e,t,n,i,o){e!==t&&yn(t,(function(s,a){if(o||(o=new Xr),ta(s))!function(e,t,n,i,o,s,a){var l=Po(e,n),c=Po(t,n),u=a.get(c);if(u)return void en(e,n,u);var h=s?s(l,c,n+"",e,t,a):r,d=h===r;if(d){var p=Zs(c),f=!p&&Xs(c),m=!p&&!f&&ua(c);h=c,p||f||m?Zs(l)?h=l:Qs(l)?h=Pi(l):f?(d=!1,h=Ci(c,!0)):m?(d=!1,h=Ti(c,!0)):h=[]:oa(c)||Gs(c)?(h=l,Gs(l)?h=_a(l):ta(l)&&!Ks(l)||(h=_o(c))):d=!1}d&&(a.set(c,h),o(h,c,i,s,a),a.delete(c));en(e,n,h)}(e,t,a,n,Hn,i,o);else{var l=i?i(Po(e,a),s,a+"",e,t,o):r;l===r&&(l=s),en(e,a,l)}}),Da)}function Gn(e,t){var n=e.length;if(n)return vo(t+=t<0?n:0,n)?e[t]:r}function Zn(e,t,r){t=t.length?kt(t,(function(e){return Zs(e)?function(t){return Cn(t,1===e.length?e[0]:e)}:e})):[il];var n=-1;t=kt(t,Kt(co()));var i=Nn(e,(function(e,r,i){var o=kt(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function(e,t,r){var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;for(;++n<s;){var l=Si(i[n],o[n]);if(l)return n>=a?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Wn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=Cn(e,s);r(a,s)&&ei(o,vi(s,e),a)}return o}function qn(e,t,r,n){var i=n?Ht:Ut,o=-1,s=t.length,a=e;for(e===t&&(t=Pi(t)),r&&(a=kt(e,Kt(r)));++o<s;)for(var l=0,c=t[o],u=r?r(c):c;(l=i(a,u,l,n))>-1;)a!==e&&Ye.call(a,l,1),Ye.call(e,l,1);return e}function Qn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;vo(i)?Ye.call(e,i,1):di(e,i)}}return e}function Xn(e,t){return e+gt(br()*(t-e+1))}function Yn(e,t){var r="";if(!e||t<1||t>d)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function $n(e,t){return Do(Mo(e,t,il),e+"")}function Kn(e){return $r(Va(e))}function Jn(e,t){var r=Va(e);return Bo(r,ln(t,0,r.length))}function ei(e,t,n,i){if(!ta(e))return e;for(var o=-1,s=(t=vi(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var c=Fo(t[o]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var h=l[c];(u=i?i(h,c,l):r)===r&&(u=ta(h)?h:vo(t[o+1])?[]:{})}tn(l,c,u),l=l[c]}return e}var ti=Pr?function(e,t){return Pr.set(e,t),e}:il,ri=nt?function(e,t){return nt(e,"toString",{configurable:!0,enumerable:!1,value:tl(t),writable:!0})}:il;function ni(e){return Bo(Va(e))}function ii(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=be(i);++n<i;)o[n]=e[n+t];return o}function oi(e,t){var r;return pn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function si(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=e[o];null!==s&&!ca(s)&&(r?s<=t:s<t)?n=o+1:i=o}return i}return ai(e,t,il,r)}function ai(e,t,n,i){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,l=null===t,c=ca(t),u=t===r;o<s;){var h=gt((o+s)/2),d=n(e[h]),p=d!==r,f=null===d,m=d==d,g=ca(d);if(a)var A=i||m;else A=u?m&&(i||p):l?m&&p&&(i||!f):c?m&&p&&!f&&(i||!g):!f&&!g&&(i?d<=t:d<t);A?o=h+1:s=h}return yr(s,4294967294)}function li(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!Vs(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function ci(e){return"number"==typeof e?e:ca(e)?p:+e}function ui(e){if("string"==typeof e)return e;if(Zs(e))return kt(e,ui)+"";if(ca(e))return jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,r){var n=-1,i=Ot,o=e.length,s=!0,a=[],l=a;if(r)s=!1,i=Dt;else if(o>=200){var c=t?null:Yi(e);if(c)return ur(c);s=!1,i=er,l=new Qr}else l=t?[]:a;e:for(;++n<o;){var u=e[n],h=t?t(u):u;if(u=r||0!==u?u:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),a.push(u)}else i(l,h,r)||(l!==a&&l.push(h),a.push(u))}return a}function di(e,t){return null==(e=Io(e,t=vi(t,e)))||delete e[Fo($o(t))]}function pi(e,t,r,n){return ei(e,t,r(Cn(e,t)),n)}function fi(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ii(e,n?0:o,n?o+1:i):ii(e,n?o+1:0,n?i:o)}function mi(e,t){var r=e;return r instanceof Gr&&(r=r.value()),Bt(t,(function(e,t){return t.func.apply(t.thisArg,zt([e],t.args))}),r)}function gi(e,t,r){var n=e.length;if(n<2)return n?hi(e[0]):[];for(var i=-1,o=be(n);++i<n;)for(var s=e[i],a=-1;++a<n;)a!=i&&(o[i]=dn(o[i]||s,e[a],t,r));return hi(_n(o,1),t,r)}function Ai(e,t,n){for(var i=-1,o=e.length,s=t.length,a={};++i<o;){var l=i<s?t[i]:r;n(a,e[i],l)}return a}function _i(e){return Qs(e)?e:[]}function yi(e){return"function"==typeof e?e:il}function vi(e,t){return Zs(e)?e:bo(e,t)?[e]:Ro(ya(e))}var xi=$n;function bi(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ii(e,t,n)}var wi=ct||function(e){return ft.clearTimeout(e)};function Ci(e,t){if(t)return e.slice();var r=e.length,n=We?We(r):new e.constructor(r);return e.copy(n),n}function Ei(e){var t=new e.constructor(e.byteLength);return new Ze(t).set(new Ze(e)),t}function Ti(e,t){var r=t?Ei(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,s=ca(e),a=t!==r,l=null===t,c=t==t,u=ca(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||i&&a&&c||!n&&c||!o)return 1;if(!i&&!s&&!u&&e<t||u&&n&&o&&!i&&!s||l&&n&&o||!a&&o||!c)return-1}return 0}function Mi(e,t,r,n){for(var i=-1,o=e.length,s=r.length,a=-1,l=t.length,c=_r(o-s,0),u=be(l+c),h=!n;++a<l;)u[a]=t[a];for(;++i<s;)(h||i<o)&&(u[r[i]]=e[i]);for(;c--;)u[a++]=e[i++];return u}function Ii(e,t,r,n){for(var i=-1,o=e.length,s=-1,a=r.length,l=-1,c=t.length,u=_r(o-a,0),h=be(u+c),d=!n;++i<u;)h[i]=e[i];for(var p=i;++l<c;)h[p+l]=t[l];for(;++s<a;)(d||i<o)&&(h[p+r[s]]=e[i++]);return h}function Pi(e,t){var r=-1,n=e.length;for(t||(t=be(n));++r<n;)t[r]=e[r];return t}function Li(e,t,n,i){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var l=t[s],c=i?i(n[l],e[l],l,n,e):r;c===r&&(c=e[l]),o?sn(n,l,c):tn(n,l,c)}return n}function Oi(e,t){return function(r,n){var i=Zs(r)?St:nn,o=t?t():{};return i(r,e,co(n,2),o)}}function Di(e){return $n((function(t,n){var i=-1,o=n.length,s=o>1?n[o-1]:r,a=o>2?n[2]:r;for(s=e.length>3&&"function"==typeof s?(o--,s):r,a&&xo(n[0],n[1],a)&&(s=o<3?r:s,o=1),t=Se(t);++i<o;){var l=n[i];l&&e(t,l,i,s)}return t}))}function ki(e,t){return function(r,n){if(null==r)return r;if(!qs(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Se(r);(t?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function zi(e){return function(t,r,n){for(var i=-1,o=Se(t),s=n(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===r(o[l],l,o))break}return t}}function Bi(e){return function(t){var n=sr(t=ya(t))?pr(t):r,i=n?n[0]:t.charAt(0),o=n?bi(n,1).join(""):t.slice(1);return i[e]()+o}}function Ri(e){return function(t){return Bt(Ka(Ga(t).replace(Je,"")),e,"")}}function Fi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Vr(e.prototype),n=e.apply(r,t);return ta(n)?n:r}}function ji(e){return function(t,n,i){var o=Se(t);if(!qs(t)){var s=co(n,3);t=Oa(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,i);return a>-1?o[s?t[a]:a]:r}}function Ni(e){return no((function(t){var i=t.length,o=i,s=Hr.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new Pe(n);if(s&&!l&&"wrapper"==ao(a))var l=new Hr([],!0)}for(o=l?o:i;++o<i;){var c=ao(a=t[o]),u="wrapper"==c?so(a):r;l=u&&wo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ao(u[0])].apply(l,u[3]):1==a.length&&wo(a)?l[c]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Zs(r))return l.plant(r).value();for(var n=0,o=i?t[n].apply(this,e):r;++n<i;)o=t[n].call(this,o);return o}}))}function Vi(e,t,n,i,o,s,a,l,u,h){var d=t&c,p=1&t,f=2&t,m=24&t,g=512&t,A=f?r:Fi(e);return function c(){for(var _=arguments.length,y=be(_),v=_;v--;)y[v]=arguments[v];if(m)var x=lo(c),b=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(y,x);if(i&&(y=Mi(y,i,o,m)),s&&(y=Ii(y,s,a,m)),_-=b,m&&_<h){var w=cr(y,x);return Qi(e,t,Vi,c.placeholder,n,y,w,l,u,h-_)}var C=p?n:this,E=f?C[e]:e;return _=y.length,l?y=function(e,t){var n=e.length,i=yr(t.length,n),o=Pi(e);for(;i--;){var s=t[i];e[i]=vo(s,n)?o[s]:r}return e}(y,l):g&&_>1&&y.reverse(),d&&u<_&&(y.length=u),this&&this!==ft&&this instanceof c&&(E=A||Fi(E)),E.apply(C,y)}}function Ui(e,t){return function(r,n){return function(e,t,r,n){return xn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function Hi(e,t){return function(n,i){var o;if(n===r&&i===r)return t;if(n!==r&&(o=n),i!==r){if(o===r)return i;"string"==typeof n||"string"==typeof i?(n=ui(n),i=ui(i)):(n=ci(n),i=ci(i)),o=e(n,i)}return o}}function Gi(e){return no((function(t){return t=kt(t,Kt(co())),$n((function(r){var n=this;return e(t,(function(e){return Tt(e,n,r)}))}))}))}function Zi(e,t){var n=(t=t===r?" ":ui(t)).length;if(n<2)return n?Yn(t,e):t;var i=Yn(t,mt(e/dr(t)));return sr(t)?bi(pr(i),0,e).join(""):i.slice(0,e)}function Wi(e){return function(t,n,i){return i&&"number"!=typeof i&&xo(t,n,i)&&(n=i=r),t=fa(t),n===r?(n=t,t=0):n=fa(n),function(e,t,r,n){for(var i=-1,o=_r(mt((t-e)/(r||1)),0),s=be(o);o--;)s[n?o:++i]=e,e+=r;return s}(t,n,i=i===r?t<n?1:-1:fa(i),e)}}function qi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=Aa(t),r=Aa(r)),e(t,r)}}function Qi(e,t,n,i,o,s,c,u,h,d){var p=8&t;t|=p?a:l,4&(t&=~(p?l:a))||(t&=-4);var f=[e,t,o,p?s:r,p?c:r,p?r:s,p?r:c,u,h,d],m=n.apply(r,f);return wo(e)&&Lo(m,f),m.placeholder=i,ko(m,e,t)}function Xi(e){var t=Te[e];return function(e,r){if(e=Aa(e),(r=null==r?0:yr(ma(r),292))&&jt(e)){var n=(ya(e)+"e").split("e");return+((n=(ya(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yi=Sr&&1/ur(new Sr([,-0]))[1]==h?function(e){return new Sr(e)}:cl;function $i(e){return function(t){var r=go(t);return r==w?ar(t):r==M?hr(t):function(e,t){return kt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ki(e,t,i,h,d,p,f,m){var g=2&t;if(!g&&"function"!=typeof e)throw new Pe(n);var A=h?h.length:0;if(A||(t&=-97,h=d=r),f=f===r?f:_r(ma(f),0),m=m===r?m:ma(m),A-=d?d.length:0,t&l){var _=h,y=d;h=d=r}var v=g?r:so(e),x=[e,t,i,h,d,_,y,p,f,m];if(v&&function(e,t){var r=e[1],n=t[1],i=r|n,s=i<131,a=n==c&&8==r||n==c&&r==u&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!s&&!a)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var l=t[3];if(l){var h=e[3];e[3]=h?Mi(h,l,t[4]):l,e[4]=h?cr(e[3],o):t[4]}(l=t[5])&&(h=e[5],e[5]=h?Ii(h,l,t[6]):l,e[6]=h?cr(e[5],o):t[6]);(l=t[7])&&(e[7]=l);n&c&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(x,v),e=x[0],t=x[1],i=x[2],h=x[3],d=x[4],!(m=x[9]=x[9]===r?g?0:e.length:_r(x[9]-A,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||t==s?function(e,t,n){var i=Fi(e);return function o(){for(var s=arguments.length,a=be(s),l=s,c=lo(o);l--;)a[l]=arguments[l];var u=s<3&&a[0]!==c&&a[s-1]!==c?[]:cr(a,c);return(s-=u.length)<n?Qi(e,t,Vi,o.placeholder,r,a,u,r,r,n-s):Tt(this&&this!==ft&&this instanceof o?i:e,this,a)}}(e,t,m):t!=a&&33!=t||d.length?Vi.apply(r,x):function(e,t,r,n){var i=1&t,o=Fi(e);return function t(){for(var s=-1,a=arguments.length,l=-1,c=n.length,u=be(c+a),h=this&&this!==ft&&this instanceof t?o:e;++l<c;)u[l]=n[l];for(;a--;)u[l++]=arguments[++s];return Tt(h,i?r:this,u)}}(e,t,i,h);else var b=function(e,t,r){var n=1&t,i=Fi(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return ko((v?ti:Lo)(b,x),e,t)}function Ji(e,t,n,i){return e===r||Vs(e,De[n])&&!Be.call(i,n)?t:e}function eo(e,t,n,i,o,s){return ta(e)&&ta(t)&&(s.set(t,e),Hn(e,t,r,eo,s),s.delete(t)),e}function to(e){return oa(e)?r:e}function ro(e,t,n,i,o,s){var a=1&n,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,p=!0,f=2&n?new Qr:r;for(s.set(e,t),s.set(t,e);++d<l;){var m=e[d],g=t[d];if(i)var A=a?i(g,m,d,t,e,s):i(m,g,d,e,t,s);if(A!==r){if(A)continue;p=!1;break}if(f){if(!Ft(t,(function(e,t){if(!er(f,t)&&(m===e||o(m,e,n,i,s)))return f.push(t)}))){p=!1;break}}else if(m!==g&&!o(m,g,n,i,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function no(e){return Do(Mo(e,r,Wo),e+"")}function io(e){return En(e,Oa,fo)}function oo(e){return En(e,Da,mo)}var so=Pr?function(e){return Pr.get(e)}:cl;function ao(e){for(var t=e.name+"",r=Lr[t],n=Be.call(Lr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function lo(e){return(Be.call(Nr,"placeholder")?Nr:e).placeholder}function co(){var e=Nr.iteratee||ol;return e=e===ol?Bn:e,arguments.length?e(arguments[0],arguments[1]):e}function uo(e,t){var r=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function ho(e){for(var t=Oa(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,To(i)]}return t}function po(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return zn(n)?n:r}var fo=_t?function(e){return null==e?[]:(e=Se(e),Lt(_t(e),(function(t){return Xe.call(e,t)})))}:gl,mo=_t?function(e){for(var t=[];e;)zt(t,fo(e)),e=qe(e);return t}:gl,go=Tn;function Ao(e,t,r){for(var n=-1,i=(t=vi(t,e)).length,o=!1;++n<i;){var s=Fo(t[n]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ea(i)&&vo(s,i)&&(Zs(e)||Gs(e))}function _o(e){return"function"!=typeof e.constructor||Eo(e)?{}:Vr(qe(e))}function yo(e){return Zs(e)||Gs(e)||!!($e&&e&&e[$e])}function vo(e,t){var r=typeof e;return!!(t=null==t?d:t)&&("number"==r||"symbol"!=r&&_e.test(e))&&e>-1&&e%1==0&&e<t}function xo(e,t,r){if(!ta(r))return!1;var n=typeof t;return!!("number"==n?qs(r)&&vo(t,r.length):"string"==n&&t in r)&&Vs(r[t],e)}function bo(e,t){if(Zs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ca(e))||(ee.test(e)||!J.test(e)||null!=t&&e in Se(t))}function wo(e){var t=ao(e),r=Nr[t];if("function"!=typeof r||!(t in Gr.prototype))return!1;if(e===r)return!0;var n=so(r);return!!n&&e===n[0]}(Cr&&go(new Cr(new ArrayBuffer(1)))!=D||Er&&go(new Er)!=w||Tr&&go(Tr.resolve())!=T||Sr&&go(new Sr)!=M||Mr&&go(new Mr)!=L)&&(go=function(e){var t=Tn(e),n=t==E?e.constructor:r,i=n?jo(n):"";if(i)switch(i){case Or:return D;case Dr:return w;case kr:return T;case zr:return M;case Br:return L}return t});var Co=ke?Ks:Al;function Eo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||De)}function To(e){return e==e&&!ta(e)}function So(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Se(n)))}}function Mo(e,t,n){return t=_r(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=_r(r.length-t,0),s=be(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=be(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),Tt(e,this,a)}}function Io(e,t){return t.length<2?e:Cn(e,ii(t,0,-1))}function Po(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Lo=zo(ti),Oo=pt||function(e,t){return ft.setTimeout(e,t)},Do=zo(ri);function ko(e,t,r){var n=t+"";return Do(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Mt(m,(function(r){var n="_."+r[0];t&r[1]&&!Ot(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(le):[]}(n),r)))}function zo(e){var t=0,n=0;return function(){var i=vr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Bo(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var s=Xn(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var Ro=function(e){var t=zs(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(te,(function(e,r,n,i){t.push(n?i.replace(he,"$1"):r||e)})),t}));function Fo(e){if("string"==typeof e||ca(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return ze.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof Gr)return e.clone();var t=new Hr(e.__wrapped__,e.__chain__);return t.__actions__=Pi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Vo=$n((function(e,t){return Qs(e)?dn(e,_n(t,1,Qs,!0)):[]})),Uo=$n((function(e,t){var n=$o(t);return Qs(n)&&(n=r),Qs(e)?dn(e,_n(t,1,Qs,!0),co(n,2)):[]})),Ho=$n((function(e,t){var n=$o(t);return Qs(n)&&(n=r),Qs(e)?dn(e,_n(t,1,Qs,!0),r,n):[]}));function Go(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ma(r);return i<0&&(i=_r(n+i,0)),Vt(e,co(t,3),i)}function Zo(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=ma(n),o=n<0?_r(i+o,0):yr(o,i-1)),Vt(e,co(t,3),o,!0)}function Wo(e){return(null==e?0:e.length)?_n(e,1):[]}function qo(e){return e&&e.length?e[0]:r}var Qo=$n((function(e){var t=kt(e,_i);return t.length&&t[0]===e[0]?Pn(t):[]})),Xo=$n((function(e){var t=$o(e),n=kt(e,_i);return t===$o(n)?t=r:n.pop(),n.length&&n[0]===e[0]?Pn(n,co(t,2)):[]})),Yo=$n((function(e){var t=$o(e),n=kt(e,_i);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?Pn(n,r,t):[]}));function $o(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ko=$n(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?qn(e,t):e}var es=no((function(e,t){var r=null==e?0:e.length,n=an(e,t);return Qn(e,kt(t,(function(e){return vo(e,r)?+e:e})).sort(Si)),n}));function ts(e){return null==e?e:wr.call(e)}var rs=$n((function(e){return hi(_n(e,1,Qs,!0))})),ns=$n((function(e){var t=$o(e);return Qs(t)&&(t=r),hi(_n(e,1,Qs,!0),co(t,2))})),is=$n((function(e){var t=$o(e);return t="function"==typeof t?t:r,hi(_n(e,1,Qs,!0),r,t)}));function os(e){if(!e||!e.length)return[];var t=0;return e=Lt(e,(function(e){if(Qs(e))return t=_r(e.length,t),!0})),Yt(t,(function(t){return kt(e,Wt(t))}))}function ss(e,t){if(!e||!e.length)return[];var n=os(e);return null==t?n:kt(n,(function(e){return Tt(t,r,e)}))}var as=$n((function(e,t){return Qs(e)?dn(e,t):[]})),ls=$n((function(e){return gi(Lt(e,Qs))})),cs=$n((function(e){var t=$o(e);return Qs(t)&&(t=r),gi(Lt(e,Qs),co(t,2))})),us=$n((function(e){var t=$o(e);return t="function"==typeof t?t:r,gi(Lt(e,Qs),r,t)})),hs=$n(os);var ds=$n((function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ss(e,n)}));function ps(e){var t=Nr(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var ms=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return an(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Gr&&vo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:r}),new Hr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var gs=Oi((function(e,t,r){Be.call(e,r)?++e[r]:sn(e,r,1)}));var As=ji(Go),_s=ji(Zo);function ys(e,t){return(Zs(e)?Mt:pn)(e,co(t,3))}function vs(e,t){return(Zs(e)?It:fn)(e,co(t,3))}var xs=Oi((function(e,t,r){Be.call(e,r)?e[r].push(t):sn(e,r,[t])}));var bs=$n((function(e,t,r){var n=-1,i="function"==typeof t,o=qs(e)?be(e.length):[];return pn(e,(function(e){o[++n]=i?Tt(t,e,r):Ln(e,t,r)})),o})),ws=Oi((function(e,t,r){sn(e,r,t)}));function Cs(e,t){return(Zs(e)?kt:Nn)(e,co(t,3))}var Es=Oi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ts=$n((function(e,t){if(null==e)return[];var r=t.length;return r>1&&xo(e,t[0],t[1])?t=[]:r>2&&xo(t[0],t[1],t[2])&&(t=[t[0]]),Zn(e,_n(t,1),[])})),Ss=dt||function(){return ft.Date.now()};function Ms(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Ki(e,c,r,r,r,r,t)}function Is(e,t){var i;if("function"!=typeof t)throw new Pe(n);return e=ma(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ps=$n((function(e,t,r){var n=1;if(r.length){var i=cr(r,lo(Ps));n|=a}return Ki(e,n,t,r,i)})),Ls=$n((function(e,t,r){var n=3;if(r.length){var i=cr(r,lo(Ls));n|=a}return Ki(t,n,e,r,i)}));function Os(e,t,i){var o,s,a,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new Pe(n);function m(t){var n=o,i=s;return o=s=r,h=t,l=e.apply(i,n)}function g(e){var n=e-u;return u===r||n>=t||n<0||p&&e-h>=a}function A(){var e=Ss();if(g(e))return _(e);c=Oo(A,function(e){var r=t-(e-u);return p?yr(r,a-(e-h)):r}(e))}function _(e){return c=r,f&&o?m(e):(o=s=r,l)}function y(){var e=Ss(),n=g(e);if(o=arguments,s=this,u=e,n){if(c===r)return function(e){return h=e,c=Oo(A,t),d?m(e):l}(u);if(p)return wi(c),c=Oo(A,t),m(u)}return c===r&&(c=Oo(A,t)),l}return t=Aa(t)||0,ta(i)&&(d=!!i.leading,a=(p="maxWait"in i)?_r(Aa(i.maxWait)||0,t):a,f="trailing"in i?!!i.trailing:f),y.cancel=function(){c!==r&&wi(c),h=0,o=u=s=c=r},y.flush=function(){return c===r?l:_(Ss())},y}var Ds=$n((function(e,t){return hn(e,1,t)})),ks=$n((function(e,t,r){return hn(e,Aa(t)||0,r)}));function zs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Pe(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(zs.Cache||qr),r}function Bs(e){if("function"!=typeof e)throw new Pe(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}zs.Cache=qr;var Rs=xi((function(e,t){var r=(t=1==t.length&&Zs(t[0])?kt(t[0],Kt(co())):kt(_n(t,1),Kt(co()))).length;return $n((function(n){for(var i=-1,o=yr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return Tt(e,this,n)}))})),Fs=$n((function(e,t){var n=cr(t,lo(Fs));return Ki(e,a,r,t,n)})),js=$n((function(e,t){var n=cr(t,lo(js));return Ki(e,l,r,t,n)})),Ns=no((function(e,t){return Ki(e,u,r,r,r,t)}));function Vs(e,t){return e===t||e!=e&&t!=t}var Us=qi(Sn),Hs=qi((function(e,t){return e>=t})),Gs=On(function(){return arguments}())?On:function(e){return ra(e)&&Be.call(e,"callee")&&!Xe.call(e,"callee")},Zs=be.isArray,Ws=vt?Kt(vt):function(e){return ra(e)&&Tn(e)==O};function qs(e){return null!=e&&ea(e.length)&&!Ks(e)}function Qs(e){return ra(e)&&qs(e)}var Xs=yt||Al,Ys=xt?Kt(xt):function(e){return ra(e)&&Tn(e)==y};function $s(e){if(!ra(e))return!1;var t=Tn(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!oa(e)}function Ks(e){if(!ta(e))return!1;var t=Tn(e);return t==x||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==ma(e)}function ea(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function ta(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ra(e){return null!=e&&"object"==typeof e}var na=bt?Kt(bt):function(e){return ra(e)&&go(e)==w};function ia(e){return"number"==typeof e||ra(e)&&Tn(e)==C}function oa(e){if(!ra(e)||Tn(e)!=E)return!1;var t=qe(e);if(null===t)return!0;var r=Be.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ze.call(r)==Ne}var sa=wt?Kt(wt):function(e){return ra(e)&&Tn(e)==S};var aa=Ct?Kt(Ct):function(e){return ra(e)&&go(e)==M};function la(e){return"string"==typeof e||!Zs(e)&&ra(e)&&Tn(e)==I}function ca(e){return"symbol"==typeof e||ra(e)&&Tn(e)==P}var ua=Et?Kt(Et):function(e){return ra(e)&&ea(e.length)&&!!at[Tn(e)]};var ha=qi(jn),da=qi((function(e,t){return e<=t}));function pa(e){if(!e)return[];if(qs(e))return la(e)?pr(e):Pi(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=go(e);return(t==w?ar:t==M?ur:Va)(e)}function fa(e){return e?(e=Aa(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ma(e){var t=fa(e),r=t%1;return t==t?r?t-r:t:0}function ga(e){return e?ln(ma(e),0,f):0}function Aa(e){if("number"==typeof e)return e;if(ca(e))return p;if(ta(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ta(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=$t(e);var r=me.test(e);return r||Ae.test(e)?ht(e.slice(2),r?2:8):fe.test(e)?p:+e}function _a(e){return Li(e,Da(e))}function ya(e){return null==e?"":ui(e)}var va=Di((function(e,t){if(Eo(t)||qs(t))Li(t,Oa(t),e);else for(var r in t)Be.call(t,r)&&tn(e,r,t[r])})),xa=Di((function(e,t){Li(t,Da(t),e)})),ba=Di((function(e,t,r,n){Li(t,Da(t),e,n)})),wa=Di((function(e,t,r,n){Li(t,Oa(t),e,n)})),Ca=no(an);var Ea=$n((function(e,t){e=Se(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&xo(t[0],t[1],o)&&(i=1);++n<i;)for(var s=t[n],a=Da(s),l=-1,c=a.length;++l<c;){var u=a[l],h=e[u];(h===r||Vs(h,De[u])&&!Be.call(e,u))&&(e[u]=s[u])}return e})),Ta=$n((function(e){return e.push(r,eo),Tt(za,r,e)}));function Sa(e,t,n){var i=null==e?r:Cn(e,t);return i===r?n:i}function Ma(e,t){return null!=e&&Ao(e,t,In)}var Ia=Ui((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r}),tl(il)),Pa=Ui((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Be.call(e,t)?e[t].push(r):e[t]=[r]}),co),La=$n(Ln);function Oa(e){return qs(e)?Yr(e):Rn(e)}function Da(e){return qs(e)?Yr(e,!0):Fn(e)}var ka=Di((function(e,t,r){Hn(e,t,r)})),za=Di((function(e,t,r,n){Hn(e,t,r,n)})),Ba=no((function(e,t){var r={};if(null==e)return r;var n=!1;t=kt(t,(function(t){return t=vi(t,e),n||(n=t.length>1),t})),Li(e,oo(e),r),n&&(r=cn(r,7,to));for(var i=t.length;i--;)di(r,t[i]);return r}));var Ra=no((function(e,t){return null==e?{}:function(e,t){return Wn(e,t,(function(t,r){return Ma(e,r)}))}(e,t)}));function Fa(e,t){if(null==e)return{};var r=kt(oo(e),(function(e){return[e]}));return t=co(t),Wn(e,r,(function(e,r){return t(e,r[0])}))}var ja=$i(Oa),Na=$i(Da);function Va(e){return null==e?[]:Jt(e,Oa(e))}var Ua=Ri((function(e,t,r){return t=t.toLowerCase(),e+(r?Ha(t):t)}));function Ha(e){return $a(ya(e).toLowerCase())}function Ga(e){return(e=ya(e))&&e.replace(ye,nr).replace(et,"")}var Za=Ri((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Wa=Ri((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),qa=Bi("toLowerCase");var Qa=Ri((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Xa=Ri((function(e,t,r){return e+(r?" ":"")+$a(t)}));var Ya=Ri((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),$a=Bi("toUpperCase");function Ka(e,t,n){return e=ya(e),(t=n?r:t)===r?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Ja=$n((function(e,t){try{return Tt(e,r,t)}catch(e){return $s(e)?e:new Ce(e)}})),el=no((function(e,t){return Mt(t,(function(t){t=Fo(t),sn(e,t,Ps(e[t],e))})),e}));function tl(e){return function(){return e}}var rl=Ni(),nl=Ni(!0);function il(e){return e}function ol(e){return Bn("function"==typeof e?e:cn(e,1))}var sl=$n((function(e,t){return function(r){return Ln(r,e,t)}})),al=$n((function(e,t){return function(r){return Ln(e,r,t)}}));function ll(e,t,r){var n=Oa(t),i=wn(t,n);null!=r||ta(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=wn(t,Oa(t)));var o=!(ta(r)&&"chain"in r&&!r.chain),s=Ks(e);return Mt(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Pi(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,zt([this.value()],arguments))})})),e}function cl(){}var ul=Gi(kt),hl=Gi(Pt),dl=Gi(Ft);function pl(e){return bo(e)?Wt(Fo(e)):function(e){return function(t){return Cn(t,e)}}(e)}var fl=Wi(),ml=Wi(!0);function gl(){return[]}function Al(){return!1}var _l=Hi((function(e,t){return e+t}),0),yl=Xi("ceil"),vl=Hi((function(e,t){return e/t}),1),xl=Xi("floor");var bl,wl=Hi((function(e,t){return e*t}),1),Cl=Xi("round"),El=Hi((function(e,t){return e-t}),0);return Nr.after=function(e,t){if("function"!=typeof t)throw new Pe(n);return e=ma(e),function(){if(--e<1)return t.apply(this,arguments)}},Nr.ary=Ms,Nr.assign=va,Nr.assignIn=xa,Nr.assignInWith=ba,Nr.assignWith=wa,Nr.at=Ca,Nr.before=Is,Nr.bind=Ps,Nr.bindAll=el,Nr.bindKey=Ls,Nr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Zs(e)?e:[e]},Nr.chain=ps,Nr.chunk=function(e,t,n){t=(n?xo(e,t,n):t===r)?1:_r(ma(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,s=0,a=be(mt(i/t));o<i;)a[s++]=ii(e,o,o+=t);return a},Nr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Nr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=be(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return zt(Zs(r)?Pi(r):[r],_n(t,1))},Nr.cond=function(e){var t=null==e?0:e.length,r=co();return e=t?kt(e,(function(e){if("function"!=typeof e[1])throw new Pe(n);return[r(e[0]),e[1]]})):[],$n((function(r){for(var n=-1;++n<t;){var i=e[n];if(Tt(i[0],this,r))return Tt(i[1],this,r)}}))},Nr.conforms=function(e){return function(e){var t=Oa(e);return function(r){return un(r,e,t)}}(cn(e,1))},Nr.constant=tl,Nr.countBy=gs,Nr.create=function(e,t){var r=Vr(e);return null==t?r:on(r,t)},Nr.curry=function e(t,n,i){var o=Ki(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Nr.curryRight=function e(t,n,i){var o=Ki(t,s,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Nr.debounce=Os,Nr.defaults=Ea,Nr.defaultsDeep=Ta,Nr.defer=Ds,Nr.delay=ks,Nr.difference=Vo,Nr.differenceBy=Uo,Nr.differenceWith=Ho,Nr.drop=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=n||t===r?1:ma(t))<0?0:t,i):[]},Nr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,0,(t=i-(t=n||t===r?1:ma(t)))<0?0:t):[]},Nr.dropRightWhile=function(e,t){return e&&e.length?fi(e,co(t,3),!0,!0):[]},Nr.dropWhile=function(e,t){return e&&e.length?fi(e,co(t,3),!0):[]},Nr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&xo(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=ma(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:ma(i))<0&&(i+=o),i=n>i?0:ga(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Nr.filter=function(e,t){return(Zs(e)?Lt:An)(e,co(t,3))},Nr.flatMap=function(e,t){return _n(Cs(e,t),1)},Nr.flatMapDeep=function(e,t){return _n(Cs(e,t),h)},Nr.flatMapDepth=function(e,t,n){return n=n===r?1:ma(n),_n(Cs(e,t),n)},Nr.flatten=Wo,Nr.flattenDeep=function(e){return(null==e?0:e.length)?_n(e,h):[]},Nr.flattenDepth=function(e,t){return(null==e?0:e.length)?_n(e,t=t===r?1:ma(t)):[]},Nr.flip=function(e){return Ki(e,512)},Nr.flow=rl,Nr.flowRight=nl,Nr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Nr.functions=function(e){return null==e?[]:wn(e,Oa(e))},Nr.functionsIn=function(e){return null==e?[]:wn(e,Da(e))},Nr.groupBy=xs,Nr.initial=function(e){return(null==e?0:e.length)?ii(e,0,-1):[]},Nr.intersection=Qo,Nr.intersectionBy=Xo,Nr.intersectionWith=Yo,Nr.invert=Ia,Nr.invertBy=Pa,Nr.invokeMap=bs,Nr.iteratee=ol,Nr.keyBy=ws,Nr.keys=Oa,Nr.keysIn=Da,Nr.map=Cs,Nr.mapKeys=function(e,t){var r={};return t=co(t,3),xn(e,(function(e,n,i){sn(r,t(e,n,i),e)})),r},Nr.mapValues=function(e,t){var r={};return t=co(t,3),xn(e,(function(e,n,i){sn(r,n,t(e,n,i))})),r},Nr.matches=function(e){return Vn(cn(e,1))},Nr.matchesProperty=function(e,t){return Un(e,cn(t,1))},Nr.memoize=zs,Nr.merge=ka,Nr.mergeWith=za,Nr.method=sl,Nr.methodOf=al,Nr.mixin=ll,Nr.negate=Bs,Nr.nthArg=function(e){return e=ma(e),$n((function(t){return Gn(t,e)}))},Nr.omit=Ba,Nr.omitBy=function(e,t){return Fa(e,Bs(co(t)))},Nr.once=function(e){return Is(2,e)},Nr.orderBy=function(e,t,n,i){return null==e?[]:(Zs(t)||(t=null==t?[]:[t]),Zs(n=i?r:n)||(n=null==n?[]:[n]),Zn(e,t,n))},Nr.over=ul,Nr.overArgs=Rs,Nr.overEvery=hl,Nr.overSome=dl,Nr.partial=Fs,Nr.partialRight=js,Nr.partition=Es,Nr.pick=Ra,Nr.pickBy=Fa,Nr.property=pl,Nr.propertyOf=function(e){return function(t){return null==e?r:Cn(e,t)}},Nr.pull=Ko,Nr.pullAll=Jo,Nr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?qn(e,t,co(r,2)):e},Nr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?qn(e,t,r,n):e},Nr.pullAt=es,Nr.range=fl,Nr.rangeRight=ml,Nr.rearg=Ns,Nr.reject=function(e,t){return(Zs(e)?Lt:An)(e,Bs(co(t,3)))},Nr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=co(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return Qn(e,i),r},Nr.rest=function(e,t){if("function"!=typeof e)throw new Pe(n);return $n(e,t=t===r?t:ma(t))},Nr.reverse=ts,Nr.sampleSize=function(e,t,n){return t=(n?xo(e,t,n):t===r)?1:ma(t),(Zs(e)?Kr:Jn)(e,t)},Nr.set=function(e,t,r){return null==e?e:ei(e,t,r)},Nr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ei(e,t,n,i)},Nr.shuffle=function(e){return(Zs(e)?Jr:ni)(e)},Nr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&xo(e,t,n)?(t=0,n=i):(t=null==t?0:ma(t),n=n===r?i:ma(n)),ii(e,t,n)):[]},Nr.sortBy=Ts,Nr.sortedUniq=function(e){return e&&e.length?li(e):[]},Nr.sortedUniqBy=function(e,t){return e&&e.length?li(e,co(t,2)):[]},Nr.split=function(e,t,n){return n&&"number"!=typeof n&&xo(e,t,n)&&(t=n=r),(n=n===r?f:n>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!sa(t))&&!(t=ui(t))&&sr(e)?bi(pr(e),0,n):e.split(t,n):[]},Nr.spread=function(e,t){if("function"!=typeof e)throw new Pe(n);return t=null==t?0:_r(ma(t),0),$n((function(r){var n=r[t],i=bi(r,0,t);return n&&zt(i,n),Tt(e,this,i)}))},Nr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},Nr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:ma(t))<0?0:t):[]},Nr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:ma(t)))<0?0:t,i):[]},Nr.takeRightWhile=function(e,t){return e&&e.length?fi(e,co(t,3),!1,!0):[]},Nr.takeWhile=function(e,t){return e&&e.length?fi(e,co(t,3)):[]},Nr.tap=function(e,t){return t(e),e},Nr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Pe(n);return ta(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Os(e,t,{leading:i,maxWait:t,trailing:o})},Nr.thru=fs,Nr.toArray=pa,Nr.toPairs=ja,Nr.toPairsIn=Na,Nr.toPath=function(e){return Zs(e)?kt(e,Fo):ca(e)?[e]:Pi(Ro(ya(e)))},Nr.toPlainObject=_a,Nr.transform=function(e,t,r){var n=Zs(e),i=n||Xs(e)||ua(e);if(t=co(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:ta(e)&&Ks(o)?Vr(qe(e)):{}}return(i?Mt:xn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Nr.unary=function(e){return Ms(e,1)},Nr.union=rs,Nr.unionBy=ns,Nr.unionWith=is,Nr.uniq=function(e){return e&&e.length?hi(e):[]},Nr.uniqBy=function(e,t){return e&&e.length?hi(e,co(t,2)):[]},Nr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?hi(e,r,t):[]},Nr.unset=function(e,t){return null==e||di(e,t)},Nr.unzip=os,Nr.unzipWith=ss,Nr.update=function(e,t,r){return null==e?e:pi(e,t,yi(r))},Nr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:pi(e,t,yi(n),i)},Nr.values=Va,Nr.valuesIn=function(e){return null==e?[]:Jt(e,Da(e))},Nr.without=as,Nr.words=Ka,Nr.wrap=function(e,t){return Fs(yi(t),e)},Nr.xor=ls,Nr.xorBy=cs,Nr.xorWith=us,Nr.zip=hs,Nr.zipObject=function(e,t){return Ai(e||[],t||[],tn)},Nr.zipObjectDeep=function(e,t){return Ai(e||[],t||[],ei)},Nr.zipWith=ds,Nr.entries=ja,Nr.entriesIn=Na,Nr.extend=xa,Nr.extendWith=ba,ll(Nr,Nr),Nr.add=_l,Nr.attempt=Ja,Nr.camelCase=Ua,Nr.capitalize=Ha,Nr.ceil=yl,Nr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=Aa(n))==n?n:0),t!==r&&(t=(t=Aa(t))==t?t:0),ln(Aa(e),t,n)},Nr.clone=function(e){return cn(e,4)},Nr.cloneDeep=function(e){return cn(e,5)},Nr.cloneDeepWith=function(e,t){return cn(e,5,t="function"==typeof t?t:r)},Nr.cloneWith=function(e,t){return cn(e,4,t="function"==typeof t?t:r)},Nr.conformsTo=function(e,t){return null==t||un(e,t,Oa(t))},Nr.deburr=Ga,Nr.defaultTo=function(e,t){return null==e||e!=e?t:e},Nr.divide=vl,Nr.endsWith=function(e,t,n){e=ya(e),t=ui(t);var i=e.length,o=n=n===r?i:ln(ma(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Nr.eq=Vs,Nr.escape=function(e){return(e=ya(e))&&X.test(e)?e.replace(q,ir):e},Nr.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(re,"\\$&"):e},Nr.every=function(e,t,n){var i=Zs(e)?Pt:mn;return n&&xo(e,t,n)&&(t=r),i(e,co(t,3))},Nr.find=As,Nr.findIndex=Go,Nr.findKey=function(e,t){return Nt(e,co(t,3),xn)},Nr.findLast=_s,Nr.findLastIndex=Zo,Nr.findLastKey=function(e,t){return Nt(e,co(t,3),bn)},Nr.floor=xl,Nr.forEach=ys,Nr.forEachRight=vs,Nr.forIn=function(e,t){return null==e?e:yn(e,co(t,3),Da)},Nr.forInRight=function(e,t){return null==e?e:vn(e,co(t,3),Da)},Nr.forOwn=function(e,t){return e&&xn(e,co(t,3))},Nr.forOwnRight=function(e,t){return e&&bn(e,co(t,3))},Nr.get=Sa,Nr.gt=Us,Nr.gte=Hs,Nr.has=function(e,t){return null!=e&&Ao(e,t,Mn)},Nr.hasIn=Ma,Nr.head=qo,Nr.identity=il,Nr.includes=function(e,t,r,n){e=qs(e)?e:Va(e),r=r&&!n?ma(r):0;var i=e.length;return r<0&&(r=_r(i+r,0)),la(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Ut(e,t,r)>-1},Nr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ma(r);return i<0&&(i=_r(n+i,0)),Ut(e,t,i)},Nr.inRange=function(e,t,n){return t=fa(t),n===r?(n=t,t=0):n=fa(n),function(e,t,r){return e>=yr(t,r)&&e<_r(t,r)}(e=Aa(e),t,n)},Nr.invoke=La,Nr.isArguments=Gs,Nr.isArray=Zs,Nr.isArrayBuffer=Ws,Nr.isArrayLike=qs,Nr.isArrayLikeObject=Qs,Nr.isBoolean=function(e){return!0===e||!1===e||ra(e)&&Tn(e)==_},Nr.isBuffer=Xs,Nr.isDate=Ys,Nr.isElement=function(e){return ra(e)&&1===e.nodeType&&!oa(e)},Nr.isEmpty=function(e){if(null==e)return!0;if(qs(e)&&(Zs(e)||"string"==typeof e||"function"==typeof e.splice||Xs(e)||ua(e)||Gs(e)))return!e.length;var t=go(e);if(t==w||t==M)return!e.size;if(Eo(e))return!Rn(e).length;for(var r in e)if(Be.call(e,r))return!1;return!0},Nr.isEqual=function(e,t){return Dn(e,t)},Nr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?Dn(e,t,r,n):!!i},Nr.isError=$s,Nr.isFinite=function(e){return"number"==typeof e&&jt(e)},Nr.isFunction=Ks,Nr.isInteger=Js,Nr.isLength=ea,Nr.isMap=na,Nr.isMatch=function(e,t){return e===t||kn(e,t,ho(t))},Nr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,kn(e,t,ho(t),n)},Nr.isNaN=function(e){return ia(e)&&e!=+e},Nr.isNative=function(e){if(Co(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return zn(e)},Nr.isNil=function(e){return null==e},Nr.isNull=function(e){return null===e},Nr.isNumber=ia,Nr.isObject=ta,Nr.isObjectLike=ra,Nr.isPlainObject=oa,Nr.isRegExp=sa,Nr.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=d},Nr.isSet=aa,Nr.isString=la,Nr.isSymbol=ca,Nr.isTypedArray=ua,Nr.isUndefined=function(e){return e===r},Nr.isWeakMap=function(e){return ra(e)&&go(e)==L},Nr.isWeakSet=function(e){return ra(e)&&"[object WeakSet]"==Tn(e)},Nr.join=function(e,t){return null==e?"":qt.call(e,t)},Nr.kebabCase=Za,Nr.last=$o,Nr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ma(n))<0?_r(i+o,0):yr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Vt(e,Gt,o,!0)},Nr.lowerCase=Wa,Nr.lowerFirst=qa,Nr.lt=ha,Nr.lte=da,Nr.max=function(e){return e&&e.length?gn(e,il,Sn):r},Nr.maxBy=function(e,t){return e&&e.length?gn(e,co(t,2),Sn):r},Nr.mean=function(e){return Zt(e,il)},Nr.meanBy=function(e,t){return Zt(e,co(t,2))},Nr.min=function(e){return e&&e.length?gn(e,il,jn):r},Nr.minBy=function(e,t){return e&&e.length?gn(e,co(t,2),jn):r},Nr.stubArray=gl,Nr.stubFalse=Al,Nr.stubObject=function(){return{}},Nr.stubString=function(){return""},Nr.stubTrue=function(){return!0},Nr.multiply=wl,Nr.nth=function(e,t){return e&&e.length?Gn(e,ma(t)):r},Nr.noConflict=function(){return ft._===this&&(ft._=Ve),this},Nr.noop=cl,Nr.now=Ss,Nr.pad=function(e,t,r){e=ya(e);var n=(t=ma(t))?dr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Zi(gt(i),r)+e+Zi(mt(i),r)},Nr.padEnd=function(e,t,r){e=ya(e);var n=(t=ma(t))?dr(e):0;return t&&n<t?e+Zi(t-n,r):e},Nr.padStart=function(e,t,r){e=ya(e);var n=(t=ma(t))?dr(e):0;return t&&n<t?Zi(t-n,r)+e:e},Nr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),xr(ya(e).replace(ie,""),t||0)},Nr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&xo(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=fa(e),t===r?(t=e,e=0):t=fa(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=br();return yr(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return Xn(e,t)},Nr.reduce=function(e,t,r){var n=Zs(e)?Bt:Qt,i=arguments.length<3;return n(e,co(t,4),r,i,pn)},Nr.reduceRight=function(e,t,r){var n=Zs(e)?Rt:Qt,i=arguments.length<3;return n(e,co(t,4),r,i,fn)},Nr.repeat=function(e,t,n){return t=(n?xo(e,t,n):t===r)?1:ma(t),Yn(ya(e),t)},Nr.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nr.result=function(e,t,n){var i=-1,o=(t=vi(t,e)).length;for(o||(o=1,e=r);++i<o;){var s=null==e?r:e[Fo(t[i])];s===r&&(i=o,s=n),e=Ks(s)?s.call(e):s}return e},Nr.round=Cl,Nr.runInContext=e,Nr.sample=function(e){return(Zs(e)?$r:Kn)(e)},Nr.size=function(e){if(null==e)return 0;if(qs(e))return la(e)?dr(e):e.length;var t=go(e);return t==w||t==M?e.size:Rn(e).length},Nr.snakeCase=Qa,Nr.some=function(e,t,n){var i=Zs(e)?Ft:oi;return n&&xo(e,t,n)&&(t=r),i(e,co(t,3))},Nr.sortedIndex=function(e,t){return si(e,t)},Nr.sortedIndexBy=function(e,t,r){return ai(e,t,co(r,2))},Nr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=si(e,t);if(n<r&&Vs(e[n],t))return n}return-1},Nr.sortedLastIndex=function(e,t){return si(e,t,!0)},Nr.sortedLastIndexBy=function(e,t,r){return ai(e,t,co(r,2),!0)},Nr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=si(e,t,!0)-1;if(Vs(e[r],t))return r}return-1},Nr.startCase=Xa,Nr.startsWith=function(e,t,r){return e=ya(e),r=null==r?0:ln(ma(r),0,e.length),t=ui(t),e.slice(r,r+t.length)==t},Nr.subtract=El,Nr.sum=function(e){return e&&e.length?Xt(e,il):0},Nr.sumBy=function(e,t){return e&&e.length?Xt(e,co(t,2)):0},Nr.template=function(e,t,n){var i=Nr.templateSettings;n&&xo(e,t,n)&&(t=r),e=ya(e),t=ba({},t,i,Ji);var o,s,a=ba({},t.imports,i.imports,Ji),l=Oa(a),c=Jt(a,l),u=0,h=t.interpolate||ve,d="__p += '",p=Me((t.escape||ve).source+"|"+h.source+"|"+(h===K?de:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),f="//# sourceURL="+(Be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++st+"]")+"\n";e.replace(p,(function(t,r,n,i,a,l){return n||(n=i),d+=e.slice(u,l).replace(xe,or),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),d+="';\n";var m=Be.call(t,"variable")&&t.variable;if(m){if(ue.test(m))throw new Ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(H,""):d).replace(G,"$1").replace(Z,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return Ee(l,f+"return "+d).apply(r,c)}));if(g.source=d,$s(g))throw g;return g},Nr.times=function(e,t){if((e=ma(e))<1||e>d)return[];var r=f,n=yr(e,f);t=co(t),e-=f;for(var i=Yt(n,t);++r<e;)t(r);return i},Nr.toFinite=fa,Nr.toInteger=ma,Nr.toLength=ga,Nr.toLower=function(e){return ya(e).toLowerCase()},Nr.toNumber=Aa,Nr.toSafeInteger=function(e){return e?ln(ma(e),-9007199254740991,d):0===e?e:0},Nr.toString=ya,Nr.toUpper=function(e){return ya(e).toUpperCase()},Nr.trim=function(e,t,n){if((e=ya(e))&&(n||t===r))return $t(e);if(!e||!(t=ui(t)))return e;var i=pr(e),o=pr(t);return bi(i,tr(i,o),rr(i,o)+1).join("")},Nr.trimEnd=function(e,t,n){if((e=ya(e))&&(n||t===r))return e.slice(0,fr(e)+1);if(!e||!(t=ui(t)))return e;var i=pr(e);return bi(i,0,rr(i,pr(t))+1).join("")},Nr.trimStart=function(e,t,n){if((e=ya(e))&&(n||t===r))return e.replace(ie,"");if(!e||!(t=ui(t)))return e;var i=pr(e);return bi(i,tr(i,pr(t))).join("")},Nr.truncate=function(e,t){var n=30,i="...";if(ta(t)){var o="separator"in t?t.separator:o;n="length"in t?ma(t.length):n,i="omission"in t?ui(t.omission):i}var s=(e=ya(e)).length;if(sr(e)){var a=pr(e);s=a.length}if(n>=s)return e;var l=n-dr(i);if(l<1)return i;var c=a?bi(a,0,l).join(""):e.slice(0,l);if(o===r)return c+i;if(a&&(l+=c.length-l),sa(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=Me(o.source,ya(pe.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===r?l:d)}}else if(e.indexOf(ui(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+i},Nr.unescape=function(e){return(e=ya(e))&&Q.test(e)?e.replace(W,mr):e},Nr.uniqueId=function(e){var t=++Re;return ya(e)+t},Nr.upperCase=Ya,Nr.upperFirst=$a,Nr.each=ys,Nr.eachRight=vs,Nr.first=qo,ll(Nr,(bl={},xn(Nr,(function(e,t){Be.call(Nr.prototype,t)||(bl[t]=e)})),bl),{chain:!1}),Nr.VERSION="4.17.21",Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Nr[e].placeholder=Nr})),Mt(["drop","take"],(function(e,t){Gr.prototype[e]=function(n){n=n===r?1:_r(ma(n),0);var i=this.__filtered__&&!t?new Gr(this):this.clone();return i.__filtered__?i.__takeCount__=yr(n,i.__takeCount__):i.__views__.push({size:yr(n,f),type:e+(i.__dir__<0?"Right":"")}),i},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Mt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:co(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Mt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),Mt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(il)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=$n((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return Ln(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(Bs(co(e)))},Gr.prototype.slice=function(e,t){e=ma(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ma(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(f)},xn(Gr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Nr[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);o&&(Nr.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,l=t instanceof Gr,c=a[0],u=l||Zs(t),h=function(e){var t=o.apply(Nr,zt([e],a));return i&&d?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=s&&!d,m=l&&!p;if(!s&&u){t=m?t:new Gr(this);var g=e.apply(t,a);return g.__actions__.push({func:fs,args:[h],thisArg:r}),new Hr(g,d)}return f&&m?e.apply(this,a):(g=this.thru(h),f?i?g.value()[0]:g.value():g)})})),Mt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Le[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Nr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Zs(i)?i:[],e)}return this[r]((function(r){return t.apply(Zs(r)?r:[],e)}))}})),xn(Gr.prototype,(function(e,t){var r=Nr[t];if(r){var n=r.name+"";Be.call(Lr,n)||(Lr[n]=[]),Lr[n].push({name:t,func:r})}})),Lr[Vi(r,2).name]=[{name:"wrapper",func:r}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=Pi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Pi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Pi(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Zs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yr(t,e+s);break;case"takeRight":e=_r(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,c=n?a:s-1,u=this.__iteratees__,h=u.length,d=0,p=yr(l,this.__takeCount__);if(!r||!n&&i==l&&p==l)return mi(e,this.__actions__);var f=[];e:for(;l--&&d<p;){for(var m=-1,g=e[c+=t];++m<h;){var A=u[m],_=A.iteratee,y=A.type,v=_(g);if(2==y)g=v;else if(!v){if(1==y)continue e;break e}}f[d++]=g}return f},Nr.prototype.at=ms,Nr.prototype.chain=function(){return ps(this)},Nr.prototype.commit=function(){return new Hr(this.value(),this.__chain__)},Nr.prototype.next=function(){this.__values__===r&&(this.__values__=pa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Nr.prototype.plant=function(e){for(var t,n=this;n instanceof Ur;){var i=No(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Nr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:fs,args:[ts],thisArg:r}),new Hr(t,this.__chain__)}return this.thru(ts)},Nr.prototype.toJSON=Nr.prototype.valueOf=Nr.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},Nr.prototype.first=Nr.prototype.head,Ke&&(Nr.prototype[Ke]=function(){return this}),Nr}();gt?((gt.exports=gr)._=gr,mt._=gr):ft._=gr}).call(We)}(Fa,Fa.exports);var ja=Fa.exports;function Na(e){let{name:t,label:r,disabled:n=!1,showTooltip:i=!1,openTooltip:o=!1,tooltipTitle:l,closeTooltip:c,width:u=300,placeholder:h="Please select",value:d,inputValue:p,onChange:f,toggleError:m,onNeedFetch:g,...A}=e;const _=le(!1),[y,v]=oe(!1),[x,b]=oe(null),[w,C]=oe([]),[E,S]=oe(null),[M,I]=oe(""),[P,L]=oe(!1),[O,k]=oe(""),[z,B]=oe(o),R=y&&!P,F=e=>{let{search:t="",loadedOptions:r=[]}=e;g({search:t,loadedOptions:r}).then((e=>{let{options:r}=e;if(C(r),L(!0),t&&0===r.length&&!z){const e=setTimeout((()=>{z||localStorage.getItem("tooltipShown")||B(!0)}),500);return()=>clearTimeout(e)}}))},j=ue(ja.debounce((e=>{let{search:t,loadedOptions:r}=e;F({search:t,loadedOptions:r})}),600),[]);return se((()=>{z&&localStorage.setItem("tooltipShown","true")}),[z]),se((()=>{R&&F({search:"",loadedOptions:[]})}),[R]),se((()=>{"clear"===O&&L(!1),x||"selectOption"!==O||f&&f(E)}),[x,O,E]),se((()=>{y||(C([]),L(!1))}),[y]),se((()=>{d&&!E&&(S(d),I(p||""))}),[d,p]),se((()=>{_.current&&(M&&E||(b("Please select a city from the list"),m&&m(!0)),M&&E&&(b(null),m&&m(!1)))}),[_.current,E,M]),s(D,{openOnFocus:!0,open:y,disabled:n,onOpen:()=>v(!0),onClose:()=>v(!1),isOptionEqualToValue:(e,t)=>ja.isEqual(e,t),onInputChange:(e,t,r)=>{e&&(k("input"!==r?ja.isString(r)?r:"selectOption":""),"change"===e.type&&j({search:t}),I(t),_.current=!0)},onChange:(e,t,r)=>{k(r),S(t)},value:E,options:w,loading:R,inputValue:M,componentsProps:{paper:{sx:{borderRadius:"20px"}}},sx:{width:["100%",u,u],"&.MuiAutocomplete-root .MuiFormControl-root .MuiInputBase-root":{height:50,fontSize:"16px !important",fontFamily:"CircularStd, sans-serif",flexWrap:"nowrap",overflow:"hidden"}},renderInput:e=>s(Ra,{...e,name:t,value:d||E||null,label:r,tooltipTitle:l,showTooltip:i,openTooltip:o||z,closeTooltip:c,error:!!x,helperText:x||null,placeholder:h,InputProps:{...e.InputProps,endAdornment:a(pe,{children:[R?s(T,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})}}),...A})}const Va=fe(((e,t)=>{let{apiKey:r,location:n,onChange:i,city:o,disabled:l,reset:c,isInvalid:u,isDefault:h,restrictionOptions:d,showLocationIcon:p,helperText:f="Please select commute destination from the list",onPlaceClick:m,sx:g={},disableComponentRestrictions:A,...y}=e;const v=le(null),[x,b]=oe(n?.name||""),[w,C]=oe([]),E=le(null),T=le(null),[S,M]=oe(!1),[I,P]=oe(!1),L=()=>{E.current=new window.google.maps.places.AutocompleteService,T.current=new window.google.maps.places.PlacesService(document.createElement("div"))},O=Ve(((e,t)=>{E.current.getPlacePredictions({input:o&&o?.length>0&&e?.length>0?`${e} ${o}`:e,...A?{}:{componentRestrictions:{country:"ae"}},...d||{}},t)}),300),D=(e,t)=>{t===google.maps.places.PlacesServiceStatus.OK&&e?(C(e),!I&&h&&k(e[0])):C([])},k=e=>{e&&T.current?(e=>{T.current&&e&&e.place_id&&T.current.getDetails({placeId:e?.place_id},((t,r)=>{r===google.maps.places.PlacesServiceStatus.OK&&t&&(P(!0),i({lat:t?.geometry?.location?.lat()||0,lng:t?.geometry?.location?.lng()||0,name:e?.description||t.formatted_address||t.name}))}))})(e):i(void 0)},z=()=>{const e=v.current?.getElementsByClassName?.("MuiAutocomplete-clearIndicator")?.[0];b(""),k(null),C([]),O("",(()=>e?.click?.()))};return me(t,(()=>({reset:z}))),se((()=>{(()=>{if(window.google&&window.google.maps&&window.google.maps.places)return L(),void M(!0);const e="google-maps-script";if(document.getElementById(e))return;const t=document.createElement("script");t.id=e,t.src=`https://maps.googleapis.com/maps/api/js?key=${r}&libraries=places`,t.async=!0,document.head.appendChild(t),t.onload=()=>{M(!0)}})()}),[r]),se((()=>{S&&L()}),[S]),se((()=>{S&&x.length>1&&E.current&&O(x,D)}),[x,S,E.current]),se((()=>{S&&!I&&n?.name!==x&&b(n?.name||"")}),[n?.name,S]),se((()=>{c&&z()}),[c]),s(je,{freeSolo:!0,ref:v,disabled:l,options:w,getOptionLabel:e=>"string"==typeof e?e:e.description,inputValue:x,filterOptions:e=>e,filterSelectedOptions:!0,onInputChange:(e,t)=>{t||z(),b(t)},onChange:(e,t)=>k(t),renderInput:e=>s(Le,{...e,placeholder:"Enter your workplace, school, or station",error:u,helperText:u?f:" ",FormHelperTextProps:{sx:{textAlign:"center"}}}),renderOption:(e,t)=>ge("li",{...e,key:t.place_id,onClick:r=>{e?.onClick?.(r),m?.(t.description)}},a(_,{children:[p&&s(Ne,{sx:{color:"text.secondary"}}),a(Me,{component:"span",color:"text.secondary",fontWeight:"bold",children:[t.structured_formatting.main_text,","]}),s(Me,{component:"span",variant:"body2",ml:.5,color:"#767676",children:t.structured_formatting.secondary_text})]})),sx:g||{},...y})})),Ua=(e,t)=>{const r=e??0,n=r%60,i=n>0?` ${n} ${t?"mins":"minutes"}`:"";if(r<60)return t?`${i}`:`Under ${i}`;const o=Math.floor(r/60);return 1===o&&60===r?t?"1 h":`Under 1 hour${i}`:t?`${o} h ${i}`:`Under ${o} hours${i}`},Ha=e=>{let t=Math.floor(e/60),r=e%60;return r=r<10?`0${r}`:r,0!==t&&"00"!==r?t>1?`${t} hrs ${r} mins`:`${t} hr ${r} mins`:"00"!==r&&0===t?`${r} mins`:"00"===r&&0!==t?t>1?`${t} hours`:`${t} hour`:"-"},Ga=(e,t)=>{const r=e?.[t]?.split("|");return r?.reduce(((e,t)=>{const r=t?.split(":");return r&&2===r.length&&(e[r[0]]=r[1]),e}),{})};var Za;!function(e){e.public_transport="public_transport",e.driving="driving",e.walking="walking",e.cycling="cycling"}(Za||(Za={}));const Wa={public_transport:e=>{let{sx:t={},...r}=e;return s(d,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...r,children:a("g",{id:"icon",children:[s("path",{id:"Ellipse 287",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),a("g",{id:"icon_2",children:[s("path",{id:"Vector",d:"M7.91908 6.30424C8.28053 6.30424 8.64842 6.30424 9.00987 6.30424C9.37132 6.30424 9.8167 6.30424 10.2169 6.30424C10.4363 6.30424 10.3782 6.1687 10.3847 6.05252C10.3911 5.93634 10.3847 5.85242 10.2169 5.85242C9.45525 5.85242 8.68717 5.85242 7.91908 5.85242C7.69963 5.85242 7.75772 5.98797 7.75126 6.10415C7.74481 6.22033 7.75127 6.31069 7.91908 6.30424Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_2",d:"M6.69917 11.4097C6.7238 11.5121 6.7844 11.6022 6.86992 11.6636C6.95544 11.725 7.06017 11.7536 7.16503 11.7442C7.26989 11.7348 7.36788 11.688 7.44113 11.6124C7.51438 11.5368 7.55801 11.4374 7.56406 11.3323C7.56769 11.2693 7.55771 11.2063 7.53479 11.1476C7.51188 11.0888 7.47656 11.0357 7.43126 10.9918C7.38597 10.9479 7.33176 10.9143 7.2723 10.8933C7.21285 10.8722 7.14955 10.8643 7.08673 10.8699C7.02392 10.8755 6.96306 10.8946 6.9083 10.9259C6.85353 10.9571 6.80613 10.9998 6.76935 11.0511C6.73257 11.1023 6.70726 11.1608 6.69515 11.2227C6.68304 11.2846 6.68441 11.3484 6.69917 11.4097Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_3",d:"M10.6171 11.4032C10.6265 11.5179 10.681 11.6242 10.7688 11.6986C10.8566 11.7731 10.9703 11.8096 11.085 11.8002C11.1997 11.7908 11.3059 11.7362 11.3804 11.6484C11.4548 11.5607 11.4914 11.4469 11.482 11.3323C11.4773 11.2755 11.4615 11.2201 11.4354 11.1695C11.4094 11.1188 11.3736 11.0737 11.3302 11.0369C11.2867 11 11.2364 10.9721 11.1822 10.9546C11.1279 10.9372 11.0708 10.9306 11.014 10.9353C10.9572 10.94 10.9019 10.9558 10.8512 10.9818C10.8005 11.0078 10.7555 11.0436 10.7186 11.0871C10.6818 11.1305 10.6538 11.1808 10.6364 11.235C10.619 11.2893 10.6124 11.3465 10.6171 11.4032Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_4",d:"M10.2491 4.54216C10.5202 4.54216 10.6106 4.45827 10.6041 4.19363C10.5977 3.929 10.5009 3.88381 10.2685 3.88381C10.0361 3.88381 9.95224 3.98063 9.94579 4.20654C9.93933 4.43244 10.0297 4.53571 10.2491 4.54216Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_5",d:"M7.89967 4.54215C8.11266 4.54215 8.20303 4.41953 8.19012 4.18717C8.17722 3.95481 8.0804 3.87735 7.84804 3.88381C7.61568 3.89026 7.50596 4.00644 7.53178 4.26462C7.55759 4.5228 7.6673 4.55506 7.89967 4.54215Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_6",d:"M12.3597 5.54905C12.3662 5.34535 12.307 5.14499 12.1907 4.97759C12.0745 4.81019 11.9074 4.68468 11.7143 4.61963C11.5595 4.53254 11.3801 4.49982 11.2046 4.52673C11.0291 4.55364 10.8676 4.63862 10.7461 4.76807C10.6414 4.88671 10.4968 4.96278 10.3398 4.98182C10.1827 5.00086 10.0241 4.96154 9.89413 4.87134C9.83354 4.83215 9.78095 4.78176 9.73921 4.72288C9.61658 4.54861 9.26159 4.54216 9.26159 4.54216H8.99049C8.8672 4.52453 8.7415 4.53641 8.62369 4.5768C8.50587 4.6172 8.39932 4.68496 8.31278 4.77453C8.25775 4.84317 8.188 4.89859 8.10868 4.93666C8.02936 4.97473 7.9425 4.99449 7.85452 4.99449C7.76654 4.99449 7.67966 4.97473 7.60034 4.93666C7.52102 4.89859 7.45127 4.84317 7.39624 4.77453C7.31435 4.6873 7.21368 4.61987 7.10184 4.57738C6.99 4.53488 6.86994 4.51842 6.75079 4.52925C6.48589 4.53256 6.23267 4.63884 6.04474 4.82556C5.8568 5.01229 5.74891 5.26481 5.7439 5.52969V11.8873C5.74474 12.0184 5.77151 12.148 5.82265 12.2687C5.87379 12.3894 5.94829 12.4988 6.04188 12.5906C6.13547 12.6824 6.24628 12.7548 6.36795 12.8036C6.48962 12.8524 6.61972 12.8766 6.75079 12.8749H11.3012C11.4369 12.8784 11.572 12.8543 11.6981 12.804C11.8242 12.7537 11.9388 12.6782 12.0348 12.5822C12.1308 12.4862 12.2063 12.3716 12.2566 12.2455C12.3069 12.1194 12.331 11.9844 12.3275 11.8486L12.3597 5.54905ZM6.22154 11.3064C6.26027 10.1898 8.04169 10.306 7.9707 11.3516C7.94702 11.5707 7.84179 11.7729 7.6759 11.918C7.51002 12.0631 7.29563 12.1405 7.07531 12.1348C6.85499 12.1291 6.64486 12.0408 6.48669 11.8873C6.32852 11.7338 6.23387 11.5265 6.22154 11.3064ZM10.1717 11.3064C10.2104 10.1834 12.0112 10.3189 11.9208 11.3516C11.8972 11.5707 11.7919 11.7729 11.626 11.918C11.4601 12.0631 11.2458 12.1405 11.0254 12.1348C10.8051 12.1291 10.595 12.0408 10.4368 11.8873C10.2786 11.7338 10.184 11.5265 10.1717 11.3064ZM11.9208 8.64721C11.9331 8.74394 11.9233 8.84219 11.8921 8.93459C11.861 9.02699 11.8093 9.11113 11.741 9.18069C11.6727 9.25026 11.5895 9.30344 11.4977 9.33624C11.4058 9.36905 11.3078 9.38063 11.2108 9.3701C10.5008 9.3701 9.78439 9.3701 9.0744 9.3701H6.98962C6.46036 9.3701 6.22153 9.12484 6.21508 8.60848C6.20863 8.09212 6.21508 7.54995 6.21508 7.02069C6.20281 6.92396 6.21261 6.82568 6.24376 6.73328C6.2749 6.64088 6.32657 6.55675 6.3949 6.48718C6.46322 6.41762 6.54642 6.36444 6.63824 6.33163C6.73006 6.29883 6.82814 6.28725 6.92507 6.29777H7.14452C7.2478 6.29777 7.32526 6.29778 7.31235 6.16223C7.30913 6.10634 7.30913 6.0503 7.31235 5.99441C7.30833 5.91165 7.32289 5.82905 7.35497 5.75264C7.38705 5.67624 7.43584 5.60798 7.49774 5.55289C7.55964 5.4978 7.63309 5.45728 7.7127 5.43427C7.7923 5.41127 7.87605 5.40639 7.95779 5.41997C8.68715 5.41997 9.42295 5.41997 10.1523 5.41997C10.2455 5.40336 10.3414 5.40928 10.4319 5.43725C10.5223 5.46522 10.6048 5.51442 10.6724 5.58074C10.74 5.64707 10.7907 5.72861 10.8204 5.81853C10.8501 5.90846 10.8578 6.00416 10.8429 6.09769C10.8429 6.27196 10.8946 6.33005 11.0559 6.30423H11.2173C11.6691 6.35587 11.9144 6.50433 11.9337 7.01423C11.9531 7.52413 11.9273 8.10503 11.9208 8.64721Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_7",d:"M11.1786 6.73669H8.55161H6.69272L6.65399 8.6343C6.65399 8.90539 6.65399 8.91184 6.95735 8.91184H9.58432H11.4432L11.4819 7.01422C11.4819 6.74314 11.4755 6.73669 11.1786 6.73669Z",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_8",d:"M12.9923 14.0109C12.7664 13.8172 12.534 13.6301 12.3081 13.43C12.0822 13.2299 12.0176 13.1718 12.2564 12.933C12.3048 12.8782 12.3566 12.8264 12.4114 12.7781C12.5345 12.6557 12.6317 12.5097 12.6971 12.3489C12.7626 12.1881 12.7949 12.0158 12.7922 11.8422C12.7922 9.75737 12.7922 7.67904 12.7922 5.59424C12.7866 5.22734 12.6412 4.87641 12.3855 4.61317C12.0935 4.3087 11.6967 4.12645 11.2754 4.10326C11.1657 4.10326 11.0366 4.10327 10.9978 3.99355C10.9597 3.87059 10.8947 3.75761 10.8077 3.66275C10.7206 3.56789 10.6136 3.49349 10.4944 3.44491C10.3532 3.39014 10.1967 3.39014 10.0555 3.44491C9.93615 3.49033 9.82906 3.563 9.74278 3.65714C9.65649 3.75127 9.59337 3.86425 9.55849 3.98709C9.55849 4.04518 9.41649 4.08389 9.33904 4.0968C9.23156 4.10326 9.12379 4.10326 9.01631 4.0968C8.7775 4.0968 8.57742 4.09681 8.4806 3.80636C8.44258 3.72095 8.38744 3.64424 8.31861 3.58096C8.24978 3.51769 8.16873 3.46918 8.08043 3.43845C7.93862 3.38718 7.78332 3.38718 7.64151 3.43845C7.52227 3.48703 7.41529 3.56143 7.32824 3.65629C7.24119 3.75115 7.17623 3.86412 7.13806 3.98709C7.09933 4.10972 6.97025 4.09035 6.86052 4.0968C6.65085 4.10165 6.4443 4.14869 6.25319 4.23508C6.06208 4.32147 5.89032 4.44546 5.74817 4.59966C5.60601 4.75386 5.49638 4.93512 5.42578 5.13261C5.35518 5.3301 5.32509 5.53979 5.33728 5.74916C5.33728 7.63387 5.33728 9.51857 5.33728 11.3968C5.30208 11.703 5.3425 12.0132 5.45503 12.3001C5.56756 12.5871 5.74876 12.8421 5.98273 13.0427C5.98273 13.0427 6.04727 13.0879 6.06018 13.1202C6.07309 13.1524 6.0989 13.2492 5.99563 13.3202C5.67936 13.5461 5.38891 13.7979 5.08555 14.0431C4.99518 14.1206 4.95 14.198 5.08555 14.3078C5.22109 14.4175 5.27273 14.4433 5.39537 14.3078C5.518 14.1722 5.80199 13.9721 6.00853 13.8043C6.21507 13.6365 6.3829 13.4881 6.58299 13.3396C6.6454 13.3102 6.71419 13.2969 6.78307 13.3009H11.3916C11.4438 13.2994 11.4958 13.3083 11.5446 13.3272C11.5934 13.346 11.6379 13.3744 11.6756 13.4106C12.037 13.7204 12.4178 14.0044 12.7793 14.3142C12.9084 14.424 12.9794 14.411 13.0891 14.3142C13.1988 14.2174 13.0826 14.0883 12.9923 14.0109ZM10.2685 3.88381C10.5008 3.88381 10.5977 3.96773 10.6041 4.19363C10.6106 4.41954 10.5202 4.55507 10.2491 4.54216C9.97803 4.52925 9.9393 4.43244 9.94576 4.20654C9.95221 3.98063 10.0426 3.88381 10.2685 3.88381ZM7.84806 3.88381C8.08042 3.88381 8.17723 3.96772 8.19014 4.18717C8.20305 4.40663 8.11268 4.52925 7.89968 4.54216C7.68669 4.55507 7.55116 4.47117 7.53179 4.26462C7.51243 4.05808 7.60924 3.89027 7.84806 3.88381ZM11.3335 12.8813H6.78307C6.652 12.883 6.52188 12.8588 6.40021 12.81C6.27855 12.7612 6.16773 12.6889 6.07414 12.5971C5.98056 12.5053 5.90605 12.3959 5.85491 12.2752C5.80377 12.1545 5.77702 12.0249 5.77618 11.8938V5.53616C5.78119 5.27128 5.88907 5.01874 6.077 4.83201C6.26493 4.64528 6.51817 4.53903 6.78307 4.53572C6.90222 4.52488 7.02226 4.54134 7.1341 4.58384C7.24594 4.62634 7.34664 4.69376 7.42852 4.78099C7.48355 4.84964 7.55331 4.90503 7.63263 4.9431C7.71194 4.98118 7.7988 5.00096 7.88678 5.00096C7.97477 5.00096 8.06162 4.98118 8.14094 4.9431C8.22026 4.90503 8.29001 4.84964 8.34504 4.78099C8.43158 4.69143 8.53814 4.62366 8.65595 4.58327C8.77376 4.54288 8.89948 4.531 9.02277 4.54862H9.28095C9.28095 4.54862 9.63594 4.54862 9.75857 4.72935C9.80031 4.78822 9.8529 4.83861 9.91349 4.87781C10.0435 4.96801 10.2021 5.00733 10.3591 4.98829C10.5162 4.96925 10.6608 4.89318 10.7655 4.77453C10.887 4.64508 11.0484 4.56011 11.2239 4.5332C11.3995 4.50629 11.5789 4.53899 11.7336 4.62607C11.9268 4.69113 12.0939 4.81666 12.2101 4.98405C12.3263 5.15145 12.3856 5.35182 12.3791 5.55552V11.8615C12.3819 11.9984 12.3565 12.1344 12.3046 12.2611C12.2528 12.3878 12.1754 12.5025 12.0774 12.5981C11.9794 12.6937 11.8628 12.7682 11.7348 12.8169C11.6068 12.8656 11.4702 12.8876 11.3335 12.8813Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_9",d:"M11.2173 6.29777H11.0559C10.8946 6.29777 10.83 6.29778 10.843 6.09124C10.8578 5.99772 10.8501 5.90199 10.8204 5.81207C10.7907 5.72214 10.74 5.6406 10.6724 5.57428C10.6048 5.50795 10.5223 5.45877 10.4319 5.4308C10.3414 5.40283 10.2455 5.3969 10.1523 5.41351C9.42297 5.41351 8.68716 5.41351 7.95781 5.41351C7.87606 5.39992 7.79232 5.40481 7.71271 5.42781C7.6331 5.45081 7.55965 5.49136 7.49775 5.54645C7.43585 5.60154 7.38707 5.66978 7.35498 5.74618C7.3229 5.82258 7.30835 5.9052 7.31236 5.98797C7.30914 6.04386 7.30914 6.09988 7.31236 6.15577C7.31236 6.28486 7.24781 6.29778 7.14454 6.29133H6.92509C6.82815 6.2808 6.73008 6.29236 6.63825 6.32517C6.54643 6.35797 6.46323 6.41115 6.39491 6.48072C6.32659 6.55028 6.27492 6.63444 6.24377 6.72684C6.21263 6.81924 6.20282 6.91749 6.21509 7.01422C6.21509 7.54349 6.21509 8.07275 6.21509 8.60202C6.21509 9.11837 6.46037 9.35718 6.98964 9.36364H9.07442C9.78441 9.36364 10.5009 9.36364 11.2108 9.36364C11.3078 9.37416 11.4059 9.3626 11.4977 9.3298C11.5895 9.29699 11.6727 9.24381 11.741 9.17425C11.8093 9.10468 11.861 9.02053 11.8922 8.92813C11.9233 8.83573 11.9331 8.73747 11.9208 8.64074C11.9208 8.09857 11.9208 7.54993 11.9208 7.0013C11.9208 6.45267 11.6498 6.3494 11.2173 6.29777ZM7.93844 5.85241C8.70652 5.85241 9.4746 5.85241 10.2362 5.85241C10.404 5.85241 10.4105 5.92988 10.404 6.05251C10.3976 6.17515 10.4557 6.31068 10.2362 6.30423C9.83605 6.30423 9.42941 6.30423 9.02923 6.30423C8.62905 6.30423 8.29989 6.30423 7.93844 6.30423C7.77063 6.30423 7.76417 6.22678 7.77062 6.10414C7.77708 5.98151 7.69963 5.85241 7.91908 5.85241H7.93844ZM11.4626 8.91184H9.60369H6.95735C6.66045 8.91184 6.65399 8.91184 6.65399 8.6343L6.69272 6.73669H8.55161H11.1786C11.4755 6.73669 11.4819 6.73668 11.4819 7.01422L11.4626 8.91184Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_10",d:"M6.22153 11.3065C6.23386 11.5265 6.3285 11.7339 6.48667 11.8873C6.64485 12.0408 6.85498 12.1292 7.07529 12.1348C7.29561 12.1405 7.51 12.0631 7.67589 11.918C7.84177 11.7729 7.94701 11.5708 7.97068 11.3516C8.04168 10.306 6.26025 10.1898 6.22153 11.3065ZM6.66689 11.4097C6.6618 11.3529 6.66794 11.2957 6.68497 11.2413C6.702 11.1869 6.7296 11.1363 6.76616 11.0926C6.80272 11.0488 6.84754 11.0127 6.89806 10.9863C6.94858 10.9599 7.00381 10.9436 7.0606 10.9385C7.11739 10.9335 7.17462 10.9396 7.22903 10.9566C7.28345 10.9737 7.33398 11.0013 7.37773 11.0378C7.42148 11.0744 7.45761 11.1192 7.48404 11.1697C7.51047 11.2203 7.5267 11.2755 7.53178 11.3323C7.51606 11.4264 7.46962 11.5127 7.39971 11.5777C7.3298 11.6427 7.24035 11.6828 7.1453 11.6916C7.05025 11.7005 6.95494 11.6776 6.87424 11.6266C6.79354 11.5756 6.73197 11.4994 6.69915 11.4097H6.66689Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),s("path",{id:"Vector_11",d:"M10.1717 11.3064C10.184 11.5265 10.2786 11.7338 10.4368 11.8873C10.595 12.0408 10.8051 12.1291 11.0254 12.1348C11.2457 12.1405 11.4601 12.0631 11.626 11.918C11.7919 11.7729 11.8971 11.5707 11.9208 11.3516C12.0112 10.3189 10.2104 10.1834 10.1717 11.3064ZM10.617 11.4032C10.6124 11.3465 10.6189 11.2893 10.6363 11.2351C10.6538 11.1808 10.6817 11.1305 10.7186 11.0871C10.7554 11.0436 10.8005 11.0078 10.8512 10.9818C10.9019 10.9558 10.9572 10.94 11.014 10.9353C11.0708 10.9306 11.1279 10.9372 11.1822 10.9546C11.2364 10.9721 11.2867 11 11.3301 11.0369C11.3736 11.0737 11.4094 11.1188 11.4354 11.1695C11.4615 11.2201 11.4773 11.2755 11.4819 11.3323C11.4913 11.447 11.4548 11.5607 11.3804 11.6484C11.3059 11.7362 11.1997 11.7908 11.085 11.8002C10.9703 11.8096 10.8565 11.7731 10.7688 11.6987C10.681 11.6242 10.6264 11.5179 10.617 11.4032Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"})]})]})})},driving:e=>{let{sx:t={},...r}=e;return a(d,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...r,children:[s("path",{d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.40724 5.08476L4.8924 7.14411H13.2078L12.693 5.08476C12.6467 5.0708 12.5909 5.05428 12.5262 5.03582C12.3181 4.97634 12.0198 4.89678 11.6615 4.81718C10.9429 4.65748 9.99314 4.4999 9.05011 4.4999C8.10708 4.4999 7.15736 4.65748 6.43868 4.81718C6.08047 4.89678 5.78217 4.97634 5.57399 5.03582C5.50937 5.05428 5.45349 5.0708 5.40724 5.08476ZM12.9432 4.84874L13.0381 4.56414C13.1354 4.59657 13.2094 4.67647 13.2343 4.77598L13.8606 7.28141L14.664 7.9952C15.1083 8.38992 15.2968 9.00008 15.1523 9.57692M15.1523 9.57692L14.5409 12.0229V12.9593C14.5409 13.304 14.2612 13.5837 13.9165 13.5837H12.6188C12.274 13.5837 11.9944 13.304 11.9944 12.9593V12.286H6.10586V12.9593C6.10586 13.304 5.8262 13.5837 5.48144 13.5837H4.18374C3.83897 13.5837 3.55931 13.304 3.55931 12.9593V12.0229L2.94802 9.57713C2.80349 9.00029 2.99194 8.38992 3.4362 7.9952L4.2396 7.28141L4.86597 4.77598C4.89085 4.67647 4.96484 4.59657 5.06214 4.56414L5.15701 4.84874C5.06214 4.56414 5.06209 4.56416 5.06214 4.56414L5.06424 4.56344L5.06915 4.56183L5.08725 4.55594C5.10294 4.55088 5.12579 4.5436 5.15534 4.53441C5.21442 4.51603 5.3003 4.49001 5.40916 4.4589C5.62679 4.39673 5.93678 4.31407 6.30853 4.23147C7.04977 4.06675 8.04659 3.8999 9.05011 3.8999C10.0536 3.8999 11.0505 4.06675 11.7917 4.23147C12.1634 4.31407 12.4734 4.39673 12.6911 4.4589C12.7999 4.49001 12.8858 4.51603 12.9449 4.53441C12.9744 4.5436 12.9973 4.55088 13.013 4.55594L13.0311 4.56183L13.036 4.56344L13.0381 4.56414C13.0381 4.56416 13.0381 4.56414 12.9432 4.84874M4.62218 7.74411L3.83471 8.44374C3.55751 8.69003 3.43975 9.0712 3.53001 9.43122L4.09356 11.686H14.0067L14.5702 9.43143C14.6604 9.07141 14.5427 8.69003 14.2655 8.44374L13.478 7.74411H4.62218ZM4.15931 12.286V12.9593C4.15931 12.9726 4.17034 12.9837 4.18374 12.9837H5.48144C5.49484 12.9837 5.50586 12.9726 5.50586 12.9593V12.286H4.15931ZM12.5944 12.286V12.9593C12.5944 12.9726 12.6054 12.9837 12.6188 12.9837H13.9165C13.9299 12.9837 13.9409 12.9726 13.9409 12.9593V12.286H12.5944ZM5.00786 9.71462C5.00771 9.71708 5.0079 9.72058 5.01072 9.72622C5.21424 10.1322 5.62943 10.3883 6.08292 10.3883H6.45471C6.64784 10.3883 6.80356 10.2326 6.80356 10.0395C6.80356 9.84635 6.64784 9.69063 6.45471 9.69063H5.03308C5.02655 9.69063 5.02322 9.69208 5.02104 9.69334C5.01818 9.695 5.01479 9.69799 5.012 9.70249C5.00921 9.707 5.00806 9.71136 5.00786 9.71462ZM4.47407 9.99455C4.26656 9.57954 4.56884 9.09063 5.03308 9.09063H6.45471C6.97921 9.09063 7.40356 9.51497 7.40356 10.0395C7.40356 10.564 6.97921 10.9883 6.45471 10.9883H6.08292C5.40222 10.9883 4.77925 10.6034 4.47407 9.99455ZM11.6456 9.69063C11.4525 9.69063 11.2968 9.84635 11.2968 10.0395C11.2968 10.2326 11.4525 10.3883 11.6456 10.3883H12.0174C12.471 10.3883 12.8861 10.1319 13.089 9.72622C13.0918 9.72058 13.092 9.71706 13.0918 9.71456C13.0916 9.71126 13.0905 9.70687 13.0877 9.70233C13.0849 9.69779 13.0815 9.69483 13.0787 9.69321C13.0766 9.692 13.0735 9.69063 13.0673 9.69063H11.6456ZM10.6968 10.0395C10.6968 9.51497 11.1211 9.09063 11.6456 9.09063H13.0673C13.5314 9.09063 13.8329 9.57998 13.6256 9.99455C13.3211 10.6037 12.6981 10.9883 12.0174 10.9883H11.6456C11.1211 10.9883 10.6968 10.564 10.6968 10.0395Z",fill:"#2E3841"})]})},walking:e=>{let{sx:t={},...r}=e;return a(d,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...r,children:[s("path",{d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),s("path",{d:"M6.5 14L7.99995 12.5L8.49993 10.5M8.49993 10.5L8.99991 7M8.49993 10.5L9.99988 12L10.4999 14M8.99991 7L9.99988 9.5L11.4998 10M8.99991 7L7.49996 8.5L6.99998 10.5M10.4999 5C10.4999 5.552 10.0519 6 9.4999 6C8.94791 6 8.49993 5.552 8.49993 5C8.49993 4.448 8.94791 4 9.4999 4C10.0519 4 10.4999 4.448 10.4999 5Z",stroke:"#2E3841",strokeWidth:"0.65",strokeLinecap:"round",strokeLinejoin:"round"})]})},cycling:e=>{let{sx:t={},...r}=e;return s(d,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...r,children:a("g",{id:"Method/Cycling",children:[s("path",{id:"Ellipse 287",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),s("path",{id:"bike_icon (Stroke)",fillRule:"evenodd",clipRule:"evenodd",d:"M9.85001 5C9.85001 4.83432 9.98433 4.7 10.15 4.7H11.45C11.6157 4.7 11.75 4.83432 11.75 5V6.90132L12.3293 8.63925C12.4656 8.61348 12.6062 8.6 12.75 8.6C13.9927 8.6 15 9.60727 15 10.85C15 12.0927 13.9927 13.1 12.75 13.1C11.5073 13.1 10.5 12.0927 10.5 10.85C10.5 9.96249 11.0137 9.19508 11.7601 8.82887L11.3398 7.56801L9.08427 10.3874C9.0381 10.4451 8.97224 10.4838 8.89933 10.4959L7.19892 10.7793C7.19965 10.8028 7.20001 10.8264 7.20001 10.85C7.20001 12.0927 6.19275 13.1 4.95001 13.1C3.70728 13.1 2.70001 12.0927 2.70001 10.85C2.70001 9.60727 3.70728 8.6 4.95001 8.6C4.97366 8.6 4.99722 8.60037 5.02069 8.60109L5.30409 6.90068C5.3282 6.75602 5.45336 6.65 5.60001 6.65H11.15V5.3H10.15C9.98433 5.3 9.85001 5.16569 9.85001 5ZM10.8258 7.25H6.32428L8.82514 9.75086L10.8258 7.25ZM8.22567 9.99992L5.80009 7.57435L5.61263 8.69914C6.32244 8.91752 6.8825 9.47758 7.10088 10.1874L8.22567 9.99992ZM6.50159 10.2873C6.33525 9.82864 5.97137 9.46477 5.51275 9.29842L5.31498 10.485L6.50159 10.2873ZM4.92083 9.20025C4.02293 9.21582 3.30001 9.94838 3.30001 10.85C3.30001 11.7614 4.03865 12.5 4.95001 12.5C5.85163 12.5 6.58419 11.7771 6.59976 10.8792L4.99933 11.1459C4.90376 11.1618 4.80639 11.1306 4.73788 11.0621C4.66937 10.9936 4.63817 10.8962 4.65409 10.8007L4.92083 9.20025ZM11.9522 9.4053C11.444 9.68649 11.1 10.228 11.1 10.85C11.1 11.7614 11.8386 12.5 12.75 12.5C13.6614 12.5 14.4 11.7614 14.4 10.85C14.4 9.93864 13.6614 9.2 12.75 9.2C12.6725 9.2 12.5962 9.20535 12.5215 9.2157L13.0346 10.7551C13.087 10.9123 13.0021 11.0822 12.8449 11.1346C12.6877 11.187 12.5178 11.1021 12.4654 10.9449L11.9522 9.4053Z",fill:"#2E3841"})]})})}},qa=[{icon:Ft,id:Za.driving},{icon:Bt,id:Za.public_transport},{icon:jt,id:Za.walking},{icon:Rt,id:Za.cycling}],Qa=(e,t)=>{switch(e){case Za.cycling:case Za.driving:return{width:"35px",height:"auto",...t&&{path:{fill:"white"}}};case Za.public_transport:return{width:"auto",height:"36px",...t&&{"#Vector_8, #Vector_9, #Vector_10, #Vector_11":{fill:"white"},path:{stroke:"white"}}};case Za.walking:return{width:"auto",height:"31px",...t&&{path:{stroke:"white"}}};default:return}},Xa=e=>{let{disableCheck:t=!1,multiple:r=!1,commute:n,variant:i,isInvalid:o,googleAutocompleteApiKey:l,onChange:c}=e;const u=he((()=>Ua(n.time)),[n.time]),h=e=>()=>{if(!r)return c({...n,methods:[e.id]});const t=n.methods.includes(e.id);t&&1===n.methods.length||c({...n,methods:t?n.methods.filter((t=>t!==e.id)):n.methods.concat(e.id)})};return a(Se,{children:[s(Va,{location:n.location,isInvalid:o,apiKey:l,onChange:e=>{c({...n,location:e})}}),a(Se,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s(Me,{variant:"h4",mb:1,mt:2,children:"Commute Time"}),u]}),s(Ee,{sx:{px:2},children:s(Be,{value:n.time,onChange:(e,t)=>{c({...n,time:t})},min:10,max:120,step:10,color:"secondary"})}),s(Me,{variant:"h4",mb:1,mt:2,children:"Commute Method(s)"}),s(Se,{direction:"row",justifyContent:"space-between",gap:.5,children:qa.map((e=>a(Ee,{sx:{position:"relative"},children:[!t&&n.methods.includes(e.id)&&s(ze,{fontSize:"small",color:"primary",sx:{position:"absolute",right:"-8px",top:"-8px",backgroundColor:"white",zIndex:1}}),s(At,{shape:"square",variant:i&&n.methods.includes(e.id)?i:"outlined",color:i?"primary":n.methods.includes(e.id)?"success":"inherit",onClick:h(e),sx:n.methods.includes(e.id)?[e=>({"&&":{borderColor:e.palette.primary.main,"&:hover":{borderColor:e.palette.primary.main}}}),n.methods.includes(e.id)&&1===n.methods.length&&{cursor:"default"}]:void 0,children:s(e.icon,{sx:Qa(e.id,n.methods.includes(e.id))})})]},e.id)))})]})},Ya=e=>{let{scrollIntoSecondCommute:t,disableCheck:r,multiple:n=!1,commutes:i,googleAutocompleteApiKey:o,onChange:l,onAdd:c,variant:u,onRemove:h,boxProps:d={}}=e;return se((()=>{if(t){const e=document.getElementById("commute-title-2");e&&setTimeout((()=>{e?.scrollIntoView({inline:"center",block:"start",behavior:"smooth"})}),0)}}),[t]),a(_,{...d,children:[s(A,{gap:"50px",children:i.map(((e,t)=>a(pe,{children:[a(_,{children:[a(A,{id:`commute-title-${t+1}`,direction:"row",justifyContent:"space-between",children:[a(Me,{variant:"h4",mb:1,children:["Commute Location ",i.length>1?t+1:""]}),i.length>0&&t>0&&s(O,{onClick:h(e),size:"small",children:s(ke,{})})]}),s(Xa,{variant:u,multiple:n,disableCheck:r,commute:e,onChange:l(e),isInvalid:!1,googleAutocompleteApiKey:o})]}),i.length>1&&t!==i.length-1&&s(k,{})]},e.id)))}),i.length<2&&s(At,{onClick:c,startIcon:s(De,{}),variant:"outlined",shape:"mrect",sx:{mt:"30px"},children:"Second Commute"})]})},$a=e=>{let{areas:t,area:r,isInvalid:n,errorText:i="Please select an area from the list",onChange:o}=e;const[a,l]=oe("");return s(je,{value:r,disableClearable:0===r.length||0===a.length,onChange:(e,t)=>{o(t??"")},inputValue:a,onInputChange:(e,t)=>{l(t)},options:t,renderInput:e=>s(Le,{...e,placeholder:"Location, borough, neighborhood, etc.",error:n,helperText:n?i:" ",FormHelperTextProps:{sx:{textAlign:"center"}}})})},Ka=e=>{let{scrollIntoArea:t=!1,index:r=0,allAreas:n,areas:i,onRemove:o,onChange:l,onAdd:c,boxProps:u={}}=e;const h=e=>t=>{l(e)(t)},d=e=>n.filter((t=>!i.some(((r,n)=>n!==e&&r.name===t))));return se((()=>{if(t){const e=document.getElementById(`area-title-${r+1}`);e&&setTimeout((()=>{e?.scrollIntoView({inline:"center",block:"start",behavior:"smooth"})}),0)}}),[t]),a(_,{...u,children:[s(A,{gap:2.5,children:i.map(((e,t)=>a(pe,{children:[a(_,{children:[a(A,{id:`area-title-${t+1}`,direction:"row",justifyContent:"space-between",children:[a(Me,{variant:"h4",mb:1,children:["Area Name ",i.length>1?t+1:""]}),i.length>0&&t>0&&s(O,{onClick:o(e),size:"small",children:s(ke,{})})]}),s($a,{areas:d(t),area:e.name,onChange:h(e)})]}),i.length>1&&t!==i.length-1&&s(k,{sx:{mb:"10px"}})]},e.id)))}),i.length<4&&s(At,{onClick:c,startIcon:s(De,{}),variant:"outlined",shape:"srect",sx:{mt:"30px"},children:"Add Area"})]})},Ja=e=>{let{title:t="See My Matches",isValid:r=!0,isSubmitting:n=!1,onSubmit:i}=e;return a(A,{position:"sticky",sx:e=>({bottom:0,background:e.palette.background.paper,borderTop:`1px solid ${e.palette.grey[300]}`,py:2,px:1,zIndex:2}),children:[s(At,{fullWidth:!0,disabled:!r||n,onClick:i,children:n?s(T,{}):t}),s(A,{direction:"row",justifyContent:"center",pt:.5,children:s(Zt,{})})]})},el=e=>{let{DialogProps:t,handleModalReject:r,handleModalResolve:n,payload:{Form:i,filters:o,...l}}=e;const c=u((e=>e.breakpoints.down("sm")));return a(z,{scroll:"body",...t,fullScreen:c,PaperProps:{sx:{position:"relative",width:"100%",maxWidth:["unset",550],height:["unset",650,550],maxHeight:"100%",pb:0,overflow:"hidden",display:"flex",flexDirection:"column"}},children:[a(B,{sx:{position:"relative",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:["center","flex-end"],padding:0,px:[1,2],pt:[2,1]},children:[a(x,{component:"div",variant:"h3",display:["initial","none"],width:"100%",textAlign:"center",children:["Filters",s(k,{sx:{mt:2}})]}),s(O,{onClick:r,size:"small",sx:e=>({[e.breakpoints.up("sm")]:{mr:e.spacing(-2)},[e.breakpoints.down("sm")]:{position:"absolute",top:0,right:0}}),children:s(be,{})})]}),s(R,{sx:{position:"relative",p:0,px:[1,2],height:"100%"},children:s(A,{gap:5,pt:3,children:s(i,{filters:o,onSubmit:e=>{n?.(e)},...l,children:e=>s(Ja,{onSubmit:e.onSubmit})})})})]})},tl=e=>{let{loading:t=!1,render:r,color:n="#fff",sx:i={}}=e;return t?s(F,{sx:{color:n,backgroundColor:"transparent",zIndex:e=>e.zIndex.drawer+1,...i},open:t,children:s(T,{color:"primary"})}):s(l,{children:r()})};class rl extends Ae{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?a(_,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",width:"100%",p:3,children:[s(_,{pb:1,children:s(tl,{color:"error",render:()=>s(d,{color:"warning",fontSize:"large",children:s(Ue,{})})})}),s(x,{gutterBottom:!0,variant:"h3",color:"error",children:"Something went wrong."}),s(x,{variant:"subtitle1",color:"error",children:"We know about the error, and are already actively working on its solution."})]}):this.props.children}}const nl=fe((function(e,t){return s(j,{direction:"up",ref:t,...e})})),il=e=>{let{modalID:t,open:r,payload:n={},ModalComponent:i,DialogProps:o,onModalResolved:a=(()=>{}),onModalRejected:l=(()=>{}),onModalExited:h=(()=>{}),fullHeight:d}=e;const p=c(),f=u(p.breakpoints.down("sm")),[m,g]=oe(r),[A,_]=oe(!1),y=e=>{g(!1),_(!1),l(e),h(t)};return se((()=>{g(r)}),[r]),s(rl,{children:s(i,{isModalEntered:A,payload:n,DialogProps:{disableEscapeKeyDown:!0,TransitionComponent:f?nl:void 0,sx:{[p.breakpoints.up("sm")]:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column","& > .MuiDialog-container":{width:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},[p.breakpoints.down("sm")]:{"& > .MuiDialog-container > .MuiPaper-root":{position:"absolute",left:0,right:0,bottom:0,m:0,[p.breakpoints.down("sm")]:{height:"100%",maxHeight:d?"auto":400},"@media (max-width: 320px)":{minHeight:436}}}},PaperProps:{elevation:0,sx:{overflow:"hidden",[p.breakpoints.up("sm")]:{borderRadius:"20px",width:483,maxWidth:483}}},...o,open:m,onClose:y,onExited:()=>{h(t),_(!1)},onEntered:()=>{_(!0)}},handleModalResolve:e=>{g(!1),_(!1),a(e),h(t)},handleModalReject:y})})},ol=ce({globalValues:null,modals:[],setGlobalValues:e=>{},updateGlobalValues:e=>{},deleteModal:e=>{},addModal:e=>{},openModal:e=>{}}),sl=e=>{let{pathname:t,children:r}=e;const n=le(0),[i,o]=oe({}),[l,c]=oe([]),u=ue((e=>{c((t=>t.filter((t=>t?.modalID!==e)))),n.current--}),[]);se((()=>{c([])}),[t]);const h={modals:l,deleteModal:u,globalValues:i,setGlobalValues:o,updateGlobalValues:e=>{o(e)},addModal:e=>{c((t=>t.concat({...e,modalID:n.current++,onModalExited:u})))},openModal:e=>{c([{...e,modalID:n.current++,onModalExited:u}])}};return a(ol.Provider,{value:h,children:[r,l?.map((e=>s(il,{open:!0,...e},e?.modalID)))]})},al=()=>ie(ol),ll=e=>{let{disableTypography:t=!1,icon:r,sx:n={},children:i,onClose:o,iconFontSize:l=30}=e;return a(_,{display:"flex",alignItems:"center",pl:[2,3,3],pr:2,sx:n,...t?{}:{component:x,fontSize:23,fontWeight:500},children:[!!i&&a(_,{display:"flex",flexGrow:1,color:"inherit",mr:1,children:[r&&s(_,{display:"flex",alignItems:"center",mr:1,children:r}),i]}),!!o&&s(S,{title:"Close modal",children:s(O,{color:"inherit",edge:"end",onClick:o,children:s(ke,{color:"inherit",sx:{fontSize:l}})})})]})},cl=e=>{let{children:t,sx:r={}}=e;return s(A,{position:"sticky",sx:{bottom:0,backgroundColor:"white",zIndex:1,...r},children:s(A,{direction:"row",alignItems:"center",justifyContent:"flex-end",gap:[1,2],py:2,sx:e=>({px:[2,3,3],borderTop:`1px solid ${e.palette.divider}`}),children:t})})},ul=e=>{let{className:t="",component:r=_,children:n,...i}=e;return s(r,{className:t,sx:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},...i,children:n})},hl=e=>{let{message:t,open:r,onClose:n}=e;const i=u((e=>e.breakpoints.down("sm")));return s(N,{open:r,onClose:n,anchorOrigin:{vertical:"top",horizontal:i?"center":"right"},message:t,action:s(l,{children:s(O,{color:"inherit",sx:{p:.5},onClick:n,children:s(ke,{})})}),sx:e=>({".MuiSnackbarContent-root":{backgroundColor:e.palette.text.secondary,alignItems:"flex-start",flexWrap:"nowrap"}})})};var dl={exports:{}};dl.exports=function(){var e,t,r;function n(n,i){if(e)if(t){var o="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 = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",s={};e(s),r=i(s),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=i;else e=i}return n(["exports"],(function(e){var t="3.4.0";let r;const n={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==r){const e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{r=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):e}catch(t){r=e}}return r},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(!n.API_URL)return null;try{const e=new URL(n.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"};function i(e){return n.API_URL_REGEX.test(e)}function o(e){return 0===e.indexOf("mapbox:")}function s(e){return n.API_CDN_URL_REGEX.test(e)}function a(e){return n.API_SPRITE_REGEX.test(e)}function l(e){return n.API_STYLE_REGEX.test(e)&&!a(e)}const c={create:"create",load:"load",fullLoad:"fullLoad"};function u(e){const t=e.name.split("?")[0];return s(t)&&t.includes("mapbox-gl.js")?"javascript":s(t)&&t.includes("mapbox-gl.css")?"css":function(e){return n.API_FONTS_REGEX.test(e)}(t)?"fontRange":a(t)?"sprite":l(t)?"style":function(e){return n.API_TILEJSON_REGEX.test(e)}(t)?"tilejson":"other"}function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={},p={};Object.defineProperty(p,"__esModule",{value:!0}),p.setMatrixArrayType=function(e){p.ARRAY_TYPE=m=e},p.toRadian=function(e){return e*A},p.equals=function(e,t){return Math.abs(e-t)<=f*Math.max(1,Math.abs(e),Math.abs(t))},p.RANDOM=p.ARRAY_TYPE=p.EPSILON=void 0;var f=1e-6;p.EPSILON=f;var m="undefined"!=typeof Float32Array?Float32Array:Array;p.ARRAY_TYPE=m;var g=Math.random;p.RANDOM=g;var A=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var _={};function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}Object.defineProperty(_,"__esModule",{value:!0}),_.create=function(){var e=new v.ARRAY_TYPE(4);return v.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},_.clone=function(e){var t=new v.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},_.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},_.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},_.fromValues=function(e,t,r,n){var i=new v.ARRAY_TYPE(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i},_.set=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e},_.transpose=function(e,t){if(e===t){var r=t[1];e[1]=t[2],e[2]=r}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},_.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=r*o-i*n;return s?(e[0]=o*(s=1/s),e[1]=-n*s,e[2]=-i*s,e[3]=r*s,e):null},_.adjoint=function(e,t){var r=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=r,e},_.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},_.multiply=b,_.rotate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l+o*a,e[1]=i*l+s*a,e[2]=n*-a+o*l,e[3]=i*-a+s*l,e},_.scale=function(e,t,r){var n=t[1],i=t[2],o=t[3],s=r[0],a=r[1];return e[0]=t[0]*s,e[1]=n*s,e[2]=i*a,e[3]=o*a,e},_.fromRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e},_.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e},_.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},_.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},_.LDU=function(e,t,r,n){return e[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-e[2]*r[1],[e,t,r]},_.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},_.subtract=w,_.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},_.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=t[0],a=t[1],l=t[2],c=t[3];return Math.abs(r-s)<=v.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-a)<=v.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-l)<=v.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-c)<=v.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},_.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},_.multiplyScalarAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e},_.sub=_.mul=void 0;var v=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==y(e)&&"function"!=typeof e)return{default:e};var r=x(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(x=function(e){return e?r:t})(e)}function b(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*a+o*l,e[1]=i*a+s*l,e[2]=n*c+o*u,e[3]=i*c+s*u,e}function w(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}_.mul=b,_.sub=w;var C={};function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}Object.defineProperty(C,"__esModule",{value:!0}),C.create=function(){var e=new T.ARRAY_TYPE(6);return T.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e},C.clone=function(e){var t=new T.ARRAY_TYPE(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},C.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},C.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},C.fromValues=function(e,t,r,n,i,o){var s=new T.ARRAY_TYPE(6);return s[0]=e,s[1]=t,s[2]=r,s[3]=n,s[4]=i,s[5]=o,s},C.set=function(e,t,r,n,i,o,s){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=o,e[5]=s,e},C.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=r*o-n*i;return l?(e[0]=o*(l=1/l),e[1]=-n*l,e[2]=-i*l,e[3]=r*l,e[4]=(i*a-o*s)*l,e[5]=(n*s-r*a)*l,e):null},C.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},C.multiply=M,C.rotate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*c,e[1]=i*u+s*c,e[2]=n*-c+o*u,e[3]=i*-c+s*u,e[4]=a,e[5]=l,e},C.scale=function(e,t,r){var n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=r[0],c=r[1];return e[0]=t[0]*l,e[1]=n*l,e[2]=i*c,e[3]=o*c,e[4]=s,e[5]=a,e},C.translate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=r[0],u=r[1];return e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=n*c+o*u+a,e[5]=i*c+s*u+l,e},C.fromRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e[4]=0,e[5]=0,e},C.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e},C.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e},C.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},C.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)},C.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e},C.subtract=I,C.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e},C.multiplyScalarAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e},C.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]},C.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=t[0],c=t[1],u=t[2],h=t[3],d=t[4],p=t[5];return Math.abs(r-l)<=T.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-c)<=T.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-u)<=T.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=T.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=T.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-p)<=T.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))},C.sub=C.mul=void 0;var T=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==E(e)&&"function"!=typeof e)return{default:e};var r=S(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(S=function(e){return e?r:t})(e)}function M(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=r[0],u=r[1],h=r[2],d=r[3],p=r[4],f=r[5];return e[0]=n*c+o*u,e[1]=i*c+s*u,e[2]=n*h+o*d,e[3]=i*h+s*d,e[4]=n*p+o*f+a,e[5]=i*p+s*f+l,e}function I(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e}C.mul=M,C.sub=I;var P={};function L(e){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(e)}Object.defineProperty(P,"__esModule",{value:!0}),P.create=function(){var e=new O.ARRAY_TYPE(9);return O.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},P.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},P.clone=function(e){var t=new O.ARRAY_TYPE(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},P.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},P.fromValues=function(e,t,r,n,i,o,s,a,l){var c=new O.ARRAY_TYPE(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=n,c[4]=i,c[5]=o,c[6]=s,c[7]=a,c[8]=l,c},P.set=function(e,t,r,n,i,o,s,a,l,c){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e},P.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},P.transpose=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},P.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*s-a*c,d=-u*o+a*l,p=c*o-s*l,f=r*h+n*d+i*p;return f?(e[0]=h*(f=1/f),e[1]=(-u*n+i*c)*f,e[2]=(a*n-i*s)*f,e[3]=d*f,e[4]=(u*r-i*l)*f,e[5]=(-a*r+i*o)*f,e[6]=p*f,e[7]=(-c*r+n*l)*f,e[8]=(s*r-n*o)*f,e):null},P.adjoint=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e[0]=s*u-a*c,e[1]=i*c-n*u,e[2]=n*a-i*s,e[3]=a*l-o*u,e[4]=r*u-i*l,e[5]=i*o-r*a,e[6]=o*c-s*l,e[7]=n*l-r*c,e[8]=r*s-n*o,e},P.determinant=function(e){var t=e[3],r=e[4],n=e[5],i=e[6],o=e[7],s=e[8];return e[0]*(s*r-n*o)+e[1]*(-s*t+n*i)+e[2]*(o*t-r*i)},P.multiply=k,P.translate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=r[0],p=r[1];return e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=d*n+p*s+c,e[7]=d*i+p*a+u,e[8]=d*o+p*l+h,e},P.rotate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=Math.sin(r),p=Math.cos(r);return e[0]=p*n+d*s,e[1]=p*i+d*a,e[2]=p*o+d*l,e[3]=p*s-d*n,e[4]=p*a-d*i,e[5]=p*l-d*o,e[6]=c,e[7]=u,e[8]=h,e},P.scale=function(e,t,r){var n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},P.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},P.fromRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},P.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},P.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},P.fromQuat=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,l=i+i,c=r*s,u=n*s,h=n*a,d=i*s,p=i*a,f=i*l,m=o*s,g=o*a,A=o*l;return e[0]=1-h-f,e[3]=u-A,e[6]=d+g,e[1]=u+A,e[4]=1-c-f,e[7]=p-m,e[2]=d-g,e[5]=p+m,e[8]=1-c-h,e},P.normalFromMat4=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15],_=r*a-n*s,y=r*l-i*s,v=r*c-o*s,x=n*l-i*a,b=n*c-o*a,w=i*c-o*l,C=u*m-h*f,E=u*g-d*f,T=u*A-p*f,S=h*g-d*m,M=h*A-p*m,I=d*A-p*g,P=_*I-y*M+v*S+x*T-b*E+w*C;return P?(e[0]=(a*I-l*M+c*S)*(P=1/P),e[1]=(l*T-s*I-c*E)*P,e[2]=(s*M-a*T+c*C)*P,e[3]=(i*M-n*I-o*S)*P,e[4]=(r*I-i*T+o*E)*P,e[5]=(n*T-r*M-o*C)*P,e[6]=(m*w-g*b+A*x)*P,e[7]=(g*v-f*w-A*y)*P,e[8]=(f*b-m*v+A*_)*P,e):null},P.projection=function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},P.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},P.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},P.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},P.subtract=z,P.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},P.multiplyScalarAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e},P.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},P.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=t[0],d=t[1],p=t[2],f=t[3],m=t[4],g=t[5],A=t[6],_=t[7],y=t[8];return Math.abs(r-h)<=O.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-d)<=O.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-p)<=O.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-f)<=O.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-m)<=O.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-g)<=O.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(l-A)<=O.EPSILON*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(c-_)<=O.EPSILON*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-y)<=O.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))},P.sub=P.mul=void 0;var O=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==L(e)&&"function"!=typeof e)return{default:e};var r=D(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(D=function(e){return e?r:t})(e)}function k(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=r[0],p=r[1],f=r[2],m=r[3],g=r[4],A=r[5],_=r[6],y=r[7],v=r[8];return e[0]=d*n+p*s+f*c,e[1]=d*i+p*a+f*u,e[2]=d*o+p*l+f*h,e[3]=m*n+g*s+A*c,e[4]=m*i+g*a+A*u,e[5]=m*o+g*l+A*h,e[6]=_*n+y*s+v*c,e[7]=_*i+y*a+v*u,e[8]=_*o+y*l+v*h,e}function z(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}P.mul=k,P.sub=z;var B={};function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}Object.defineProperty(B,"__esModule",{value:!0}),B.create=function(){var e=new F.ARRAY_TYPE(16);return F.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},B.clone=function(e){var t=new F.ARRAY_TYPE(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},B.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},B.fromValues=function(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m){var g=new F.ARRAY_TYPE(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=i,g[5]=o,g[6]=s,g[7]=a,g[8]=l,g[9]=c,g[10]=u,g[11]=h,g[12]=d,g[13]=p,g[14]=f,g[15]=m,g},B.set=function(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e[9]=u,e[10]=h,e[11]=d,e[12]=p,e[13]=f,e[14]=m,e[15]=g,e},B.identity=N,B.transpose=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},B.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15],_=r*a-n*s,y=r*l-i*s,v=r*c-o*s,x=n*l-i*a,b=n*c-o*a,w=i*c-o*l,C=u*m-h*f,E=u*g-d*f,T=u*A-p*f,S=h*g-d*m,M=h*A-p*m,I=d*A-p*g,P=_*I-y*M+v*S+x*T-b*E+w*C;return P?(e[0]=(a*I-l*M+c*S)*(P=1/P),e[1]=(i*M-n*I-o*S)*P,e[2]=(m*w-g*b+A*x)*P,e[3]=(d*b-h*w-p*x)*P,e[4]=(l*T-s*I-c*E)*P,e[5]=(r*I-i*T+o*E)*P,e[6]=(g*v-f*w-A*y)*P,e[7]=(u*w-d*v+p*y)*P,e[8]=(s*M-a*T+c*C)*P,e[9]=(n*T-r*M-o*C)*P,e[10]=(f*b-m*v+A*_)*P,e[11]=(h*v-u*b-p*_)*P,e[12]=(a*E-s*S-l*C)*P,e[13]=(r*S-n*E+i*C)*P,e[14]=(m*y-f*x-g*_)*P,e[15]=(u*x-h*y+d*_)*P,e):null},B.adjoint=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15];return e[0]=a*(d*A-p*g)-h*(l*A-c*g)+m*(l*p-c*d),e[1]=-(n*(d*A-p*g)-h*(i*A-o*g)+m*(i*p-o*d)),e[2]=n*(l*A-c*g)-a*(i*A-o*g)+m*(i*c-o*l),e[3]=-(n*(l*p-c*d)-a*(i*p-o*d)+h*(i*c-o*l)),e[4]=-(s*(d*A-p*g)-u*(l*A-c*g)+f*(l*p-c*d)),e[5]=r*(d*A-p*g)-u*(i*A-o*g)+f*(i*p-o*d),e[6]=-(r*(l*A-c*g)-s*(i*A-o*g)+f*(i*c-o*l)),e[7]=r*(l*p-c*d)-s*(i*p-o*d)+u*(i*c-o*l),e[8]=s*(h*A-p*m)-u*(a*A-c*m)+f*(a*p-c*h),e[9]=-(r*(h*A-p*m)-u*(n*A-o*m)+f*(n*p-o*h)),e[10]=r*(a*A-c*m)-s*(n*A-o*m)+f*(n*c-o*a),e[11]=-(r*(a*p-c*h)-s*(n*p-o*h)+u*(n*c-o*a)),e[12]=-(s*(h*g-d*m)-u*(a*g-l*m)+f*(a*d-l*h)),e[13]=r*(h*g-d*m)-u*(n*g-i*m)+f*(n*d-i*h),e[14]=-(r*(a*g-l*m)-s*(n*g-i*m)+f*(n*l-i*a)),e[15]=r*(a*d-l*h)-s*(n*d-i*h)+u*(n*l-i*a),e},B.determinant=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15];return(t*s-r*o)*(h*g-d*m)-(t*a-n*o)*(u*g-d*f)+(t*l-i*o)*(u*m-h*f)+(r*a-n*s)*(c*g-d*p)-(r*l-i*s)*(c*m-h*p)+(n*l-i*a)*(c*f-u*p)},B.multiply=V,B.translate=function(e,t,r){var n,i,o,s,a,l,c,u,h,d,p,f,m=r[0],g=r[1],A=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*A+t[12],e[13]=t[1]*m+t[5]*g+t[9]*A+t[13],e[14]=t[2]*m+t[6]*g+t[10]*A+t[14],e[15]=t[3]*m+t[7]*g+t[11]*A+t[15]):(i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=n=t[0],e[1]=i,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=n*m+a*g+h*A+t[12],e[13]=i*m+l*g+d*A+t[13],e[14]=o*m+c*g+p*A+t[14],e[15]=s*m+u*g+f*A+t[15]),e},B.scale=function(e,t,r){var n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},B.rotate=function(e,t,r,n){var i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x,b,w,C,E,T,S,M=n[0],I=n[1],P=n[2],L=Math.hypot(M,I,P);return L<F.EPSILON?null:(M*=L=1/L,I*=L,P*=L,i=Math.sin(r),o=Math.cos(r),l=t[1],c=t[2],u=t[3],d=t[5],p=t[6],f=t[7],g=t[9],A=t[10],_=t[11],y=M*M*(s=1-o)+o,b=M*I*s-P*i,w=I*I*s+o,C=P*I*s+M*i,E=M*P*s+I*i,T=I*P*s-M*i,S=P*P*s+o,e[0]=(a=t[0])*y+(h=t[4])*(v=I*M*s+P*i)+(m=t[8])*(x=P*M*s-I*i),e[1]=l*y+d*v+g*x,e[2]=c*y+p*v+A*x,e[3]=u*y+f*v+_*x,e[4]=a*b+h*w+m*C,e[5]=l*b+d*w+g*C,e[6]=c*b+p*w+A*C,e[7]=u*b+f*w+_*C,e[8]=a*E+h*T+m*S,e[9]=l*E+d*T+g*S,e[10]=c*E+p*T+A*S,e[11]=u*E+f*T+_*S,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},B.rotateX=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*n,e[5]=s*i+u*n,e[6]=a*i+h*n,e[7]=l*i+d*n,e[8]=c*i-o*n,e[9]=u*i-s*n,e[10]=h*i-a*n,e[11]=d*i-l*n,e},B.rotateY=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*n,e[1]=s*i-u*n,e[2]=a*i-h*n,e[3]=l*i-d*n,e[8]=o*n+c*i,e[9]=s*n+u*i,e[10]=a*n+h*i,e[11]=l*n+d*i,e},B.rotateZ=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*n,e[1]=s*i+u*n,e[2]=a*i+h*n,e[3]=l*i+d*n,e[4]=c*i-o*n,e[5]=u*i-s*n,e[6]=h*i-a*n,e[7]=d*i-l*n,e},B.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e},B.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromRotation=function(e,t,r){var n,i,o,s=r[0],a=r[1],l=r[2],c=Math.hypot(s,a,l);return c<F.EPSILON?null:(s*=c=1/c,a*=c,l*=c,n=Math.sin(t),i=Math.cos(t),e[0]=s*s*(o=1-i)+i,e[1]=a*s*o+l*n,e[2]=l*s*o-a*n,e[3]=0,e[4]=s*a*o-l*n,e[5]=a*a*o+i,e[6]=l*a*o+s*n,e[7]=0,e[8]=s*l*o+a*n,e[9]=a*l*o-s*n,e[10]=l*l*o+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)},B.fromXRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromYRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromZRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromRotationTranslation=U,B.fromQuat2=function(e,t){var r=new F.ARRAY_TYPE(3),n=-t[0],i=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=n*n+i*i+o*o+s*s;return h>0?(r[0]=2*(a*s+u*n+l*o-c*i)/h,r[1]=2*(l*s+u*i+c*n-a*o)/h,r[2]=2*(c*s+u*o+a*i-l*n)/h):(r[0]=2*(a*s+u*n+l*o-c*i),r[1]=2*(l*s+u*i+c*n-a*o),r[2]=2*(c*s+u*o+a*i-l*n)),U(e,t,r),e},B.getTranslation=function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e},B.getScaling=H,B.getRotation=function(e,t){var r=new F.ARRAY_TYPE(3);H(r,t);var n=1/r[0],i=1/r[1],o=1/r[2],s=t[0]*n,a=t[1]*i,l=t[2]*o,c=t[4]*n,u=t[5]*i,h=t[6]*o,d=t[8]*n,p=t[9]*i,f=t[10]*o,m=s+u+f,g=0;return m>0?(g=2*Math.sqrt(m+1),e[3]=.25*g,e[0]=(h-p)/g,e[1]=(d-l)/g,e[2]=(a-c)/g):s>u&&s>f?(g=2*Math.sqrt(1+s-u-f),e[3]=(h-p)/g,e[0]=.25*g,e[1]=(a+c)/g,e[2]=(d+l)/g):u>f?(g=2*Math.sqrt(1+u-s-f),e[3]=(d-l)/g,e[0]=(a+c)/g,e[1]=.25*g,e[2]=(h+p)/g):(g=2*Math.sqrt(1+f-s-u),e[3]=(a-c)/g,e[0]=(d+l)/g,e[1]=(h+p)/g,e[2]=.25*g),e},B.fromRotationTranslationScale=function(e,t,r,n){var i=t[0],o=t[1],s=t[2],a=t[3],l=i+i,c=o+o,u=s+s,h=i*l,d=i*c,p=i*u,f=o*c,m=o*u,g=s*u,A=a*l,_=a*c,y=a*u,v=n[0],x=n[1],b=n[2];return e[0]=(1-(f+g))*v,e[1]=(d+y)*v,e[2]=(p-_)*v,e[3]=0,e[4]=(d-y)*x,e[5]=(1-(h+g))*x,e[6]=(m+A)*x,e[7]=0,e[8]=(p+_)*b,e[9]=(m-A)*b,e[10]=(1-(h+f))*b,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e},B.fromRotationTranslationScaleOrigin=function(e,t,r,n,i){var o=t[0],s=t[1],a=t[2],l=t[3],c=o+o,u=s+s,h=a+a,d=o*c,p=o*u,f=o*h,m=s*u,g=s*h,A=a*h,_=l*c,y=l*u,v=l*h,x=n[0],b=n[1],w=n[2],C=i[0],E=i[1],T=i[2],S=(1-(m+A))*x,M=(p+v)*x,I=(f-y)*x,P=(p-v)*b,L=(1-(d+A))*b,O=(g+_)*b,D=(f+y)*w,k=(g-_)*w,z=(1-(d+m))*w;return e[0]=S,e[1]=M,e[2]=I,e[3]=0,e[4]=P,e[5]=L,e[6]=O,e[7]=0,e[8]=D,e[9]=k,e[10]=z,e[11]=0,e[12]=r[0]+C-(S*C+P*E+D*T),e[13]=r[1]+E-(M*C+L*E+k*T),e[14]=r[2]+T-(I*C+O*E+z*T),e[15]=1,e},B.fromQuat=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,l=i+i,c=r*s,u=n*s,h=n*a,d=i*s,p=i*a,f=i*l,m=o*s,g=o*a,A=o*l;return e[0]=1-h-f,e[1]=u+A,e[2]=d-g,e[3]=0,e[4]=u-A,e[5]=1-c-f,e[6]=p+m,e[7]=0,e[8]=d+g,e[9]=p-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.frustum=function(e,t,r,n,i,o,s){var a=1/(r-t),l=1/(i-n),c=1/(o-s);return e[0]=2*o*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(i+n)*l,e[10]=(s+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*c,e[15]=0,e},B.perspectiveNO=G,B.perspectiveZO=function(e,t,r,n,i){var o,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=i*(o=1/(n-i)),e[14]=i*n*o):(e[10]=-1,e[14]=-n),e},B.perspectiveFromFieldOfView=function(e,t,r,n){var i=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),l=2/(s+a),c=2/(i+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(s-a)*l*.5,e[9]=(i-o)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e},B.orthoNO=Z,B.orthoZO=function(e,t,r,n,i,o,s){var a=1/(t-r),l=1/(n-i),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+r)*a,e[13]=(i+n)*l,e[14]=o*c,e[15]=1,e},B.lookAt=function(e,t,r,n){var i,o,s,a,l,c,u,h,d,p,f=t[0],m=t[1],g=t[2],A=n[0],_=n[1],y=n[2],v=r[0],x=r[1],b=r[2];return Math.abs(f-v)<F.EPSILON&&Math.abs(m-x)<F.EPSILON&&Math.abs(g-b)<F.EPSILON?N(e):(u=f-v,h=m-x,d=g-b,i=_*(d*=p=1/Math.hypot(u,h,d))-y*(h*=p),o=y*(u*=p)-A*d,s=A*h-_*u,(p=Math.hypot(i,o,s))?(i*=p=1/p,o*=p,s*=p):(i=0,o=0,s=0),a=h*s-d*o,l=d*i-u*s,c=u*o-h*i,(p=Math.hypot(a,l,c))?(a*=p=1/p,l*=p,c*=p):(a=0,l=0,c=0),e[0]=i,e[1]=a,e[2]=u,e[3]=0,e[4]=o,e[5]=l,e[6]=h,e[7]=0,e[8]=s,e[9]=c,e[10]=d,e[11]=0,e[12]=-(i*f+o*m+s*g),e[13]=-(a*f+l*m+c*g),e[14]=-(u*f+h*m+d*g),e[15]=1,e)},B.targetTo=function(e,t,r,n){var i=t[0],o=t[1],s=t[2],a=n[0],l=n[1],c=n[2],u=i-r[0],h=o-r[1],d=s-r[2],p=u*u+h*h+d*d;p>0&&(u*=p=1/Math.sqrt(p),h*=p,d*=p);var f=l*d-c*h,m=c*u-a*d,g=a*h-l*u;return(p=f*f+m*m+g*g)>0&&(f*=p=1/Math.sqrt(p),m*=p,g*=p),e[0]=f,e[1]=m,e[2]=g,e[3]=0,e[4]=h*g-d*m,e[5]=d*f-u*g,e[6]=u*m-h*f,e[7]=0,e[8]=u,e[9]=h,e[10]=d,e[11]=0,e[12]=i,e[13]=o,e[14]=s,e[15]=1,e},B.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},B.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},B.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e},B.subtract=W,B.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e},B.multiplyScalarAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e},B.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},B.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],A=e[15],_=t[0],y=t[1],v=t[2],x=t[3],b=t[4],w=t[5],C=t[6],E=t[7],T=t[8],S=t[9],M=t[10],I=t[11],P=t[12],L=t[13],O=t[14],D=t[15];return Math.abs(r-_)<=F.EPSILON*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(n-y)<=F.EPSILON*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-v)<=F.EPSILON*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(o-x)<=F.EPSILON*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(s-b)<=F.EPSILON*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-w)<=F.EPSILON*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(l-C)<=F.EPSILON*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(c-E)<=F.EPSILON*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(u-T)<=F.EPSILON*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(h-S)<=F.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(d-M)<=F.EPSILON*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(p-I)<=F.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(f-P)<=F.EPSILON*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(m-L)<=F.EPSILON*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(g-O)<=F.EPSILON*Math.max(1,Math.abs(g),Math.abs(O))&&Math.abs(A-D)<=F.EPSILON*Math.max(1,Math.abs(A),Math.abs(D))},B.sub=B.mul=B.ortho=B.perspective=void 0;var F=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==R(e)&&"function"!=typeof e)return{default:e};var r=j(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function j(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(j=function(e){return e?r:t})(e)}function N(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function V(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],m=t[12],g=t[13],A=t[14],_=t[15],y=r[0],v=r[1],x=r[2],b=r[3];return e[0]=y*n+v*a+x*h+b*m,e[1]=y*i+v*l+x*d+b*g,e[2]=y*o+v*c+x*p+b*A,e[3]=y*s+v*u+x*f+b*_,e[4]=(y=r[4])*n+(v=r[5])*a+(x=r[6])*h+(b=r[7])*m,e[5]=y*i+v*l+x*d+b*g,e[6]=y*o+v*c+x*p+b*A,e[7]=y*s+v*u+x*f+b*_,e[8]=(y=r[8])*n+(v=r[9])*a+(x=r[10])*h+(b=r[11])*m,e[9]=y*i+v*l+x*d+b*g,e[10]=y*o+v*c+x*p+b*A,e[11]=y*s+v*u+x*f+b*_,e[12]=(y=r[12])*n+(v=r[13])*a+(x=r[14])*h+(b=r[15])*m,e[13]=y*i+v*l+x*d+b*g,e[14]=y*o+v*c+x*p+b*A,e[15]=y*s+v*u+x*f+b*_,e}function U(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=n+n,l=i+i,c=o+o,u=n*a,h=n*l,d=n*c,p=i*l,f=i*c,m=o*c,g=s*a,A=s*l,_=s*c;return e[0]=1-(p+m),e[1]=h+_,e[2]=d-A,e[3]=0,e[4]=h-_,e[5]=1-(u+m),e[6]=f+g,e[7]=0,e[8]=d+A,e[9]=f-g,e[10]=1-(u+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function H(e,t){var r=t[4],n=t[5],i=t[6],o=t[8],s=t[9],a=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(r,n,i),e[2]=Math.hypot(o,s,a),e}function G(e,t,r,n,i){var o,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+n)*(o=1/(n-i)),e[14]=2*i*n*o):(e[10]=-1,e[14]=-2*n),e}function Z(e,t,r,n,i,o,s){var a=1/(t-r),l=1/(n-i),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*a,e[13]=(i+n)*l,e[14]=(s+o)*c,e[15]=1,e}function W(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}B.perspective=G,B.ortho=Z,B.mul=V,B.sub=W;var q={},Q={};function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}Object.defineProperty(Q,"__esModule",{value:!0}),Q.create=K,Q.clone=function(e){var t=new Y.ARRAY_TYPE(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},Q.length=J,Q.fromValues=function(e,t,r){var n=new Y.ARRAY_TYPE(3);return n[0]=e,n[1]=t,n[2]=r,n},Q.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},Q.set=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e},Q.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},Q.subtract=ee,Q.multiply=te,Q.divide=re,Q.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},Q.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},Q.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e},Q.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e},Q.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},Q.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},Q.scaleAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e},Q.distance=ne,Q.squaredDistance=ie,Q.squaredLength=oe,Q.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},Q.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},Q.normalize=function(e,t){var r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e},Q.dot=se,Q.cross=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=r[0],a=r[1],l=r[2];return e[0]=i*l-o*a,e[1]=o*s-n*l,e[2]=n*a-i*s,e},Q.lerp=function(e,t,r,n){var i=t[0],o=t[1],s=t[2];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=s+n*(r[2]-s),e},Q.hermite=function(e,t,r,n,i,o){var s=o*o,a=s*(2*o-3)+1,l=s*(o-2)+o,c=s*(o-1),u=s*(3-2*o);return e[0]=t[0]*a+r[0]*l+n[0]*c+i[0]*u,e[1]=t[1]*a+r[1]*l+n[1]*c+i[1]*u,e[2]=t[2]*a+r[2]*l+n[2]*c+i[2]*u,e},Q.bezier=function(e,t,r,n,i,o){var s=1-o,a=s*s,l=o*o,c=a*s,u=3*o*a,h=3*l*s,d=l*o;return e[0]=t[0]*c+r[0]*u+n[0]*h+i[0]*d,e[1]=t[1]*c+r[1]*u+n[1]*h+i[1]*d,e[2]=t[2]*c+r[2]*u+n[2]*h+i[2]*d,e},Q.random=function(e,t){t=t||1;var r=2*Y.RANDOM()*Math.PI,n=2*Y.RANDOM()-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e},Q.transformMat4=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/(s=s||1),e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,e},Q.transformMat3=function(e,t,r){var n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e},Q.transformQuat=function(e,t,r){var n=r[0],i=r[1],o=r[2],s=t[0],a=t[1],l=t[2],c=i*l-o*a,u=o*s-n*l,h=n*a-i*s,d=i*h-o*u,p=o*c-n*h,f=n*u-i*c,m=2*r[3];return u*=m,h*=m,p*=2,f*=2,e[0]=s+(c*=m)+(d*=2),e[1]=a+u+p,e[2]=l+h+f,e},Q.rotateX=function(e,t,r,n){var i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},Q.rotateY=function(e,t,r,n){var i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},Q.rotateZ=function(e,t,r,n){var i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},Q.angle=function(e,t){var r=e[0],n=e[1],i=e[2],o=t[0],s=t[1],a=t[2],l=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+s*s+a*a),c=l&&se(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))},Q.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e},Q.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},Q.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},Q.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=t[0],s=t[1],a=t[2];return Math.abs(r-o)<=Y.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=Y.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-a)<=Y.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))},Q.forEach=Q.sqrLen=Q.len=Q.sqrDist=Q.dist=Q.div=Q.mul=Q.sub=void 0;var Y=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==X(e)&&"function"!=typeof e)return{default:e};var r=$(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function $(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return($=function(e){return e?r:t})(e)}function K(){var e=new Y.ARRAY_TYPE(3);return Y.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function J(e){return Math.hypot(e[0],e[1],e[2])}function ee(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function te(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function re(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function ne(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])}function ie(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function oe(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function se(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}Q.sub=ee,Q.mul=te,Q.div=re,Q.dist=ne,Q.sqrDist=ie,Q.len=J,Q.sqrLen=oe;var ae,le=(ae=K(),function(e,t,r,n,i,o){var s,a;for(t||(t=3),r||(r=0),a=n?Math.min(n*t+r,e.length):e.length,s=r;s<a;s+=t)ae[0]=e[s],ae[1]=e[s+1],ae[2]=e[s+2],i(ae,ae,o),e[s]=ae[0],e[s+1]=ae[1],e[s+2]=ae[2];return e});Q.forEach=le;var ce={};function ue(e){return ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(e)}Object.defineProperty(ce,"__esModule",{value:!0}),ce.create=pe,ce.clone=function(e){var t=new he.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ce.fromValues=function(e,t,r,n){var i=new he.ARRAY_TYPE(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i},ce.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},ce.set=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e},ce.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},ce.subtract=fe,ce.multiply=me,ce.divide=ge,ce.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},ce.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},ce.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e},ce.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e},ce.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e},ce.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},ce.scaleAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e},ce.distance=Ae,ce.squaredDistance=_e,ce.length=ye,ce.squaredLength=ve,ce.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},ce.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},ce.normalize=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=n*s,e[2]=i*s,e[3]=o*s,e},ce.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},ce.cross=function(e,t,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],s=r[0]*n[3]-r[3]*n[0],a=r[1]*n[2]-r[2]*n[1],l=r[1]*n[3]-r[3]*n[1],c=r[2]*n[3]-r[3]*n[2],u=t[0],h=t[1],d=t[2],p=t[3];return e[0]=h*c-d*l+p*a,e[1]=-u*c+d*s-p*o,e[2]=u*l-h*s+p*i,e[3]=-u*a+h*o-d*i,e},ce.lerp=function(e,t,r,n){var i=t[0],o=t[1],s=t[2],a=t[3];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=s+n*(r[2]-s),e[3]=a+n*(r[3]-a),e},ce.random=function(e,t){var r,n,i,o,s,a;t=t||1;do{s=(r=2*he.RANDOM()-1)*r+(n=2*he.RANDOM()-1)*n}while(s>=1);do{a=(i=2*he.RANDOM()-1)*i+(o=2*he.RANDOM()-1)*o}while(a>=1);var l=Math.sqrt((1-s)/a);return e[0]=t*r,e[1]=t*n,e[2]=t*i*l,e[3]=t*o*l,e},ce.transformMat4=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,e},ce.transformQuat=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=r[0],a=r[1],l=r[2],c=r[3],u=c*n+a*o-l*i,h=c*i+l*n-s*o,d=c*o+s*i-a*n,p=-s*n-a*i-l*o;return e[0]=u*c+p*-s+h*-l-d*-a,e[1]=h*c+p*-a+d*-s-u*-l,e[2]=d*c+p*-l+u*-a-h*-s,e[3]=t[3],e},ce.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},ce.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},ce.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},ce.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=t[0],a=t[1],l=t[2],c=t[3];return Math.abs(r-s)<=he.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-a)<=he.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-l)<=he.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-c)<=he.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},ce.forEach=ce.sqrLen=ce.len=ce.sqrDist=ce.dist=ce.div=ce.mul=ce.sub=void 0;var he=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==ue(e)&&"function"!=typeof e)return{default:e};var r=de(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function de(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(de=function(e){return e?r:t})(e)}function pe(){var e=new he.ARRAY_TYPE(4);return he.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function fe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function me(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function ge(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function Ae(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2],t[3]-e[3])}function _e(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return r*r+n*n+i*i+o*o}function ye(e){return Math.hypot(e[0],e[1],e[2],e[3])}function ve(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}ce.sub=fe,ce.mul=me,ce.div=ge,ce.dist=Ae,ce.sqrDist=_e,ce.len=ye,ce.sqrLen=ve;var xe=function(){var e=pe();return function(t,r,n,i,o,s){var a,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,t.length):t.length,a=n;a<l;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();function be(e){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(e)}ce.forEach=xe,Object.defineProperty(q,"__esModule",{value:!0}),q.create=Ie,q.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},q.setAxisAngle=Pe,q.getAxisAngle=function(e,t){var r=2*Math.acos(t[3]),n=Math.sin(r/2);return n>we.EPSILON?(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n):(e[0]=1,e[1]=0,e[2]=0),r},q.getAngle=function(e,t){var r=Re(e,t);return Math.acos(2*r*r-1)},q.multiply=Le,q.rotateX=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l+s*a,e[1]=i*l+o*a,e[2]=o*l-i*a,e[3]=s*l-n*a,e},q.rotateY=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l-o*a,e[1]=i*l+s*a,e[2]=o*l+n*a,e[3]=s*l-i*a,e},q.rotateZ=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l+i*a,e[1]=i*l-n*a,e[2]=o*l+s*a,e[3]=s*l-o*a,e},q.calculateW=function(e,t){var r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e},q.exp=Oe,q.ln=De,q.pow=function(e,t,r){return De(e,t),Be(e,e,r),Oe(e,e),e},q.slerp=ke,q.random=function(e){var t=we.RANDOM(),r=we.RANDOM(),n=we.RANDOM(),i=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=i*Math.sin(2*Math.PI*r),e[1]=i*Math.cos(2*Math.PI*r),e[2]=o*Math.sin(2*Math.PI*n),e[3]=o*Math.cos(2*Math.PI*n),e},q.invert=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-i*a,e[3]=o*a,e},q.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},q.fromMat3=ze,q.fromEuler=function(e,t,r,n){var i=.5*Math.PI/180;t*=i,r*=i,n*=i;var o=Math.sin(t),s=Math.cos(t),a=Math.sin(r),l=Math.cos(r),c=Math.sin(n),u=Math.cos(n);return e[0]=o*l*u-s*a*c,e[1]=s*a*u+o*l*c,e[2]=s*l*c-o*a*u,e[3]=s*l*u+o*a*c,e},q.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},q.setAxes=q.sqlerp=q.rotationTo=q.equals=q.exactEquals=q.normalize=q.sqrLen=q.squaredLength=q.len=q.length=q.lerp=q.dot=q.scale=q.mul=q.add=q.set=q.copy=q.fromValues=q.clone=void 0;var we=Me(p),Ce=Me(P),Ee=Me(Q),Te=Me(ce);function Se(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(Se=function(e){return e?r:t})(e)}function Me(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==be(e)&&"function"!=typeof e)return{default:e};var r=Se(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function Ie(){var e=new we.ARRAY_TYPE(4);return we.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Pe(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Le(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*u+s*a+i*c-o*l,e[1]=i*u+s*l+o*a-n*c,e[2]=o*u+s*c+n*l-i*a,e[3]=s*u-n*a-i*l-o*c,e}function Oe(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=Math.sqrt(r*r+n*n+i*i),a=Math.exp(o),l=s>0?a*Math.sin(s)/s:0;return e[0]=r*l,e[1]=n*l,e[2]=i*l,e[3]=a*Math.cos(s),e}function De(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],s=Math.sqrt(r*r+n*n+i*i),a=s>0?Math.atan2(s,o)/s:0;return e[0]=r*a,e[1]=n*a,e[2]=i*a,e[3]=.5*Math.log(r*r+n*n+i*i+o*o),e}function ke(e,t,r,n){var i,o,s,a,l,c=t[0],u=t[1],h=t[2],d=t[3],p=r[0],f=r[1],m=r[2],g=r[3];return(o=c*p+u*f+h*m+d*g)<0&&(o=-o,p=-p,f=-f,m=-m,g=-g),1-o>we.EPSILON?(i=Math.acos(o),s=Math.sin(i),a=Math.sin((1-n)*i)/s,l=Math.sin(n*i)/s):(a=1-n,l=n),e[0]=a*c+l*p,e[1]=a*u+l*f,e[2]=a*h+l*m,e[3]=a*d+l*g,e}function ze(e,t){var r,n=t[0]+t[4]+t[8];if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,e[0]=(t[5]-t[7])*(r=.5/r),e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var o=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[3*i+i]-t[3*o+o]-t[3*s+s]+1),e[i]=.5*r,e[3]=(t[3*o+s]-t[3*s+o])*(r=.5/r),e[o]=(t[3*o+i]+t[3*i+o])*r,e[s]=(t[3*s+i]+t[3*i+s])*r}return e}q.clone=Te.clone,q.fromValues=Te.fromValues,q.copy=Te.copy,q.set=Te.set,q.add=Te.add,q.mul=Le;var Be=Te.scale;q.scale=Be;var Re=Te.dot;q.dot=Re,q.lerp=Te.lerp;var Fe=Te.length;q.length=Fe,q.len=Fe;var je=Te.squaredLength;q.squaredLength=je,q.sqrLen=je;var Ne=Te.normalize;q.normalize=Ne,q.exactEquals=Te.exactEquals,q.equals=Te.equals;var Ve,Ue,He,Ge=(Ve=Ee.create(),Ue=Ee.fromValues(1,0,0),He=Ee.fromValues(0,1,0),function(e,t,r){var n=Ee.dot(t,r);return n<-.999999?(Ee.cross(Ve,Ue,t),Ee.len(Ve)<1e-6&&Ee.cross(Ve,He,t),Ee.normalize(Ve,Ve),Pe(e,Ve,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Ee.cross(Ve,t,r),e[0]=Ve[0],e[1]=Ve[1],e[2]=Ve[2],e[3]=1+n,Ne(e,e))});q.rotationTo=Ge;var Ze,We,qe=(Ze=Ie(),We=Ie(),function(e,t,r,n,i,o){return ke(Ze,t,i,o),ke(We,r,n,o),ke(e,Ze,We,2*o*(1-o)),e});q.sqlerp=qe;var Qe,Xe=(Qe=Ce.create(),function(e,t,r,n){return Qe[0]=r[0],Qe[3]=r[1],Qe[6]=r[2],Qe[1]=n[0],Qe[4]=n[1],Qe[7]=n[2],Qe[2]=-t[0],Qe[5]=-t[1],Qe[8]=-t[2],Ne(e,ze(e,Qe))});q.setAxes=Xe;var Ye={};function $e(e){return $e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$e(e)}Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.create=function(){var e=new Ke.ARRAY_TYPE(8);return Ke.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e},Ye.clone=function(e){var t=new Ke.ARRAY_TYPE(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t},Ye.fromValues=function(e,t,r,n,i,o,s,a){var l=new Ke.ARRAY_TYPE(8);return l[0]=e,l[1]=t,l[2]=r,l[3]=n,l[4]=i,l[5]=o,l[6]=s,l[7]=a,l},Ye.fromRotationTranslationValues=function(e,t,r,n,i,o,s){var a=new Ke.ARRAY_TYPE(8);a[0]=e,a[1]=t,a[2]=r,a[3]=n;var l=.5*i,c=.5*o,u=.5*s;return a[4]=l*n+c*r-u*t,a[5]=c*n+u*e-l*r,a[6]=u*n+l*t-c*e,a[7]=-l*e-c*t-u*r,a},Ye.fromRotationTranslation=nt,Ye.fromTranslation=function(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*t[0],e[5]=.5*t[1],e[6]=.5*t[2],e[7]=0,e},Ye.fromRotation=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},Ye.fromMat4=function(e,t){var r=Je.create();et.getRotation(r,t);var n=new Ke.ARRAY_TYPE(3);return et.getTranslation(n,t),nt(e,r,n),e},Ye.copy=it,Ye.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},Ye.set=function(e,t,r,n,i,o,s,a,l){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e},Ye.getDual=function(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e},Ye.setDual=function(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e},Ye.getTranslation=function(e,t){var r=t[4],n=t[5],i=t[6],o=t[7],s=-t[0],a=-t[1],l=-t[2],c=t[3];return e[0]=2*(r*c+o*s+n*l-i*a),e[1]=2*(n*c+o*a+i*s-r*l),e[2]=2*(i*c+o*l+r*a-n*s),e},Ye.translate=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=.5*r[0],l=.5*r[1],c=.5*r[2],u=t[4],h=t[5],d=t[6],p=t[7];return e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=s*a+i*c-o*l+u,e[5]=s*l+o*a-n*c+h,e[6]=s*c+n*l-i*a+d,e[7]=-n*a-i*l-o*c+p,e},Ye.rotateX=function(e,t,r){var n=-t[0],i=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*n+l*o-c*i,d=l*s+u*i+c*n-a*o,p=c*s+u*o+a*i-l*n,f=u*s-a*n-l*i-c*o;return Je.rotateX(e,t,r),e[4]=h*(s=e[3])+f*(n=e[0])+d*(o=e[2])-p*(i=e[1]),e[5]=d*s+f*i+p*n-h*o,e[6]=p*s+f*o+h*i-d*n,e[7]=f*s-h*n-d*i-p*o,e},Ye.rotateY=function(e,t,r){var n=-t[0],i=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*n+l*o-c*i,d=l*s+u*i+c*n-a*o,p=c*s+u*o+a*i-l*n,f=u*s-a*n-l*i-c*o;return Je.rotateY(e,t,r),e[4]=h*(s=e[3])+f*(n=e[0])+d*(o=e[2])-p*(i=e[1]),e[5]=d*s+f*i+p*n-h*o,e[6]=p*s+f*o+h*i-d*n,e[7]=f*s-h*n-d*i-p*o,e},Ye.rotateZ=function(e,t,r){var n=-t[0],i=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*n+l*o-c*i,d=l*s+u*i+c*n-a*o,p=c*s+u*o+a*i-l*n,f=u*s-a*n-l*i-c*o;return Je.rotateZ(e,t,r),e[4]=h*(s=e[3])+f*(n=e[0])+d*(o=e[2])-p*(i=e[1]),e[5]=d*s+f*i+p*n-h*o,e[6]=p*s+f*o+h*i-d*n,e[7]=f*s-h*n-d*i-p*o,e},Ye.rotateByQuatAppend=function(e,t,r){var n=r[0],i=r[1],o=r[2],s=r[3],a=t[0],l=t[1],c=t[2],u=t[3];return e[0]=a*s+u*n+l*o-c*i,e[1]=l*s+u*i+c*n-a*o,e[2]=c*s+u*o+a*i-l*n,e[3]=u*s-a*n-l*i-c*o,e[4]=(a=t[4])*s+(u=t[7])*n+(l=t[5])*o-(c=t[6])*i,e[5]=l*s+u*i+c*n-a*o,e[6]=c*s+u*o+a*i-l*n,e[7]=u*s-a*n-l*i-c*o,e},Ye.rotateByQuatPrepend=function(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=n*u+s*a+i*c-o*l,e[1]=i*u+s*l+o*a-n*c,e[2]=o*u+s*c+n*l-i*a,e[3]=s*u-n*a-i*l-o*c,e[4]=n*(u=r[7])+s*(a=r[4])+i*(c=r[6])-o*(l=r[5]),e[5]=i*u+s*l+o*a-n*c,e[6]=o*u+s*c+n*l-i*a,e[7]=s*u-n*a-i*l-o*c,e},Ye.rotateAroundAxis=function(e,t,r,n){if(Math.abs(n)<Ke.EPSILON)return it(e,t);var i=Math.hypot(r[0],r[1],r[2]);n*=.5;var o=Math.sin(n),s=o*r[0]/i,a=o*r[1]/i,l=o*r[2]/i,c=Math.cos(n),u=t[0],h=t[1],d=t[2],p=t[3];e[0]=u*c+p*s+h*l-d*a,e[1]=h*c+p*a+d*s-u*l,e[2]=d*c+p*l+u*a-h*s,e[3]=p*c-u*s-h*a-d*l;var f=t[4],m=t[5],g=t[6],A=t[7];return e[4]=f*c+A*s+m*l-g*a,e[5]=m*c+A*a+g*s-f*l,e[6]=g*c+A*l+f*a-m*s,e[7]=A*c-f*s-m*a-g*l,e},Ye.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e},Ye.multiply=ot,Ye.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e},Ye.lerp=function(e,t,r,n){var i=1-n;return st(t,r)<0&&(n=-n),e[0]=t[0]*i+r[0]*n,e[1]=t[1]*i+r[1]*n,e[2]=t[2]*i+r[2]*n,e[3]=t[3]*i+r[3]*n,e[4]=t[4]*i+r[4]*n,e[5]=t[5]*i+r[5]*n,e[6]=t[6]*i+r[6]*n,e[7]=t[7]*i+r[7]*n,e},Ye.invert=function(e,t){var r=lt(t);return e[0]=-t[0]/r,e[1]=-t[1]/r,e[2]=-t[2]/r,e[3]=t[3]/r,e[4]=-t[4]/r,e[5]=-t[5]/r,e[6]=-t[6]/r,e[7]=t[7]/r,e},Ye.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e},Ye.normalize=function(e,t){var r=lt(t);if(r>0){r=Math.sqrt(r);var n=t[0]/r,i=t[1]/r,o=t[2]/r,s=t[3]/r,a=t[4],l=t[5],c=t[6],u=t[7],h=n*a+i*l+o*c+s*u;e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=(a-n*h)/r,e[5]=(l-i*h)/r,e[6]=(c-o*h)/r,e[7]=(u-s*h)/r}return e},Ye.str=function(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"},Ye.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]},Ye.equals=function(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=t[0],h=t[1],d=t[2],p=t[3],f=t[4],m=t[5],g=t[6],A=t[7];return Math.abs(r-u)<=Ke.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-h)<=Ke.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=Ke.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=Ke.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-f)<=Ke.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-m)<=Ke.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(l-g)<=Ke.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-A)<=Ke.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))},Ye.sqrLen=Ye.squaredLength=Ye.len=Ye.length=Ye.dot=Ye.mul=Ye.setReal=Ye.getReal=void 0;var Ke=rt(p),Je=rt(q),et=rt(B);function tt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(tt=function(e){return e?r:t})(e)}function rt(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==$e(e)&&"function"!=typeof e)return{default:e};var r=tt(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function nt(e,t,r){var n=.5*r[0],i=.5*r[1],o=.5*r[2],s=t[0],a=t[1],l=t[2],c=t[3];return e[0]=s,e[1]=a,e[2]=l,e[3]=c,e[4]=n*c+i*l-o*a,e[5]=i*c+o*s-n*l,e[6]=o*c+n*a-i*s,e[7]=-n*s-i*a-o*l,e}function it(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function ot(e,t,r){var n=t[0],i=t[1],o=t[2],s=t[3],a=r[4],l=r[5],c=r[6],u=r[7],h=t[4],d=t[5],p=t[6],f=t[7],m=r[0],g=r[1],A=r[2],_=r[3];return e[0]=n*_+s*m+i*A-o*g,e[1]=i*_+s*g+o*m-n*A,e[2]=o*_+s*A+n*g-i*m,e[3]=s*_-n*m-i*g-o*A,e[4]=n*u+s*a+i*c-o*l+h*_+f*m+d*A-p*g,e[5]=i*u+s*l+o*a-n*c+d*_+f*g+p*m-h*A,e[6]=o*u+s*c+n*l-i*a+p*_+f*A+h*g-d*m,e[7]=s*u-n*a-i*l-o*c+f*_-h*m-d*g-p*A,e}Ye.getReal=Je.copy,Ye.setReal=Je.copy,Ye.mul=ot;var st=Je.dot;Ye.dot=st;var at=Je.length;Ye.length=at,Ye.len=at;var lt=Je.squaredLength;Ye.squaredLength=lt,Ye.sqrLen=lt;var ct={};function ut(e){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ut(e)}Object.defineProperty(ct,"__esModule",{value:!0}),ct.create=pt,ct.clone=function(e){var t=new ht.ARRAY_TYPE(2);return t[0]=e[0],t[1]=e[1],t},ct.fromValues=function(e,t){var r=new ht.ARRAY_TYPE(2);return r[0]=e,r[1]=t,r},ct.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},ct.set=function(e,t,r){return e[0]=t,e[1]=r,e},ct.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e},ct.subtract=ft,ct.multiply=mt,ct.divide=gt,ct.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e},ct.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e},ct.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e},ct.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e},ct.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e},ct.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e},ct.scaleAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e},ct.distance=At,ct.squaredDistance=_t,ct.length=yt,ct.squaredLength=vt,ct.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},ct.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},ct.normalize=function(e,t){var r=t[0],n=t[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e},ct.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},ct.cross=function(e,t,r){var n=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=n,e},ct.lerp=function(e,t,r,n){var i=t[0],o=t[1];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e},ct.random=function(e,t){t=t||1;var r=2*ht.RANDOM()*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e},ct.transformMat2=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e},ct.transformMat2d=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e},ct.transformMat3=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e},ct.transformMat4=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e},ct.rotate=function(e,t,r,n){var i=t[0]-r[0],o=t[1]-r[1],s=Math.sin(n),a=Math.cos(n);return e[0]=i*a-o*s+r[0],e[1]=i*s+o*a+r[1],e},ct.angle=function(e,t){var r=e[0],n=e[1],i=t[0],o=t[1],s=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+o*o);return Math.acos(Math.min(Math.max(s&&(r*i+n*o)/s,-1),1))},ct.zero=function(e){return e[0]=0,e[1]=0,e},ct.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},ct.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ct.equals=function(e,t){var r=e[0],n=e[1],i=t[0],o=t[1];return Math.abs(r-i)<=ht.EPSILON*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-o)<=ht.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))},ct.forEach=ct.sqrLen=ct.sqrDist=ct.dist=ct.div=ct.mul=ct.sub=ct.len=void 0;var ht=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==ut(e)&&"function"!=typeof e)return{default:e};var r=dt(void 0);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(p);function dt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(dt=function(e){return e?r:t})(e)}function pt(){var e=new ht.ARRAY_TYPE(2);return ht.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function ft(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function mt(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}function gt(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}function At(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function _t(e,t){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function yt(e){return Math.hypot(e[0],e[1])}function vt(e){var t=e[0],r=e[1];return t*t+r*r}ct.len=yt,ct.sub=ft,ct.mul=mt,ct.div=gt,ct.dist=At,ct.sqrDist=_t,ct.sqrLen=vt;var xt=function(){var e=pt();return function(t,r,n,i,o,s){var a,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,t.length):t.length,a=n;a<l;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,s),t[a]=e[0],t[a+1]=e[1];return t}}();function bt(e){return bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bt(e)}ct.forEach=xt,Object.defineProperty(d,"__esModule",{value:!0}),e.aa=d.vec4=e.Q=d.vec3=d.vec2=d.quat2=e.bl=d.quat=e.a9=d.mat4=e.ct=d.mat3=d.mat2d=e.b7=d.mat2=d.glMatrix=void 0;var wt=kt(p);d.glMatrix=wt;var Ct=kt(_);e.b7=d.mat2=Ct;var Et=kt(C);d.mat2d=Et;var Tt=kt(P);e.ct=d.mat3=Tt;var St=kt(B);e.a9=d.mat4=St;var Mt=kt(q);e.bl=d.quat=Mt;var It=kt(Ye);d.quat2=It;var Pt=kt(ct);d.vec2=Pt;var Lt=kt(Q);e.Q=d.vec3=Lt;var Ot=kt(ce);function Dt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(Dt=function(e){return e?r:t})(e)}function kt(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==bt(e)&&"function"!=typeof e)return{default:e};var r=Dt(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}e.aa=d.vec4=Ot;var zt=Bt;function Bt(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}Bt.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)<t)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r-=i/o}var s=0,a=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?s=r:a=r,r=.5*(a-s)+s;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var Rt=h(zt),Ft=jt;function jt(e,t){this.x=e,this.y=t}jt.prototype={clone:function(){return new jt(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=n,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-n*(this.y-t.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},jt.convert=function(e){return e instanceof jt?e:Array.isArray(e)?new jt(e[0],e[1]):e};var Nt=h(Ft);const Vt=Math.PI/180,Ut=180/Math.PI;function Ht(e){return e*Vt}function Gt(e){return e*Ut}const Zt=[[0,0],[1,0],[1,1],[0,1]];function Wt(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function qt(e,t,r,n){const i=new Rt(e,t,r,n);return function(e){return i.solve(e)}}const Qt=qt(.25,.1,.25,1);function Xt(e,t,r){return Math.min(r,Math.max(t,e))}function Yt(e,t,r){return(r=Xt((r-e)/(t-e),0,1))*r*(3-2*r)}function $t(e,t,r){const n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function Kt(e,t,r){if(!e.length)return r(null,[]);let n=e.length;const i=new Array(e.length);let o=null;e.forEach(((e,s)=>{t(e,((e,t)=>{e&&(o=e),i[s]=t,0==--n&&r(o,i)}))}))}function Jt(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}let er=1;function tr(){return er++}function rr(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function nr(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function ir(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function or(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function sr(e,t){return-1!==e.indexOf(t,e.length-t.length)}function ar(e,t,r){const n={};for(const r in e)n[r]=t.call(this,e[r],r,e);return n}function lr(e,t,r){const n={};for(const r in e)t.call(this,e[r],r,e)&&(n[r]=e[r]);return n}function cr(e){return Array.isArray(e)?e.map(cr):"object"==typeof e&&e?ar(e,cr):e}const ur={};function hr(e){ur[e]||("undefined"!=typeof console&&console.warn(e),ur[e]=!0)}function dr(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function pr(e){let t=0;for(let r,n,i=0,o=e.length,s=o-1;i<o;s=i++)r=e[i],n=e[s],t+=(n.x-r.x)*(r.y+n.y);return t}function fr([e,t,r]){const n=Ht(t+90),i=Ht(r);return{x:e*Math.cos(n)*Math.sin(i),y:e*Math.sin(n)*Math.sin(i),z:e*Math.cos(i),azimuthal:t,polar:r}}function mr(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function gr(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,n,i)=>{const o=n||i;return t[r]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let Ar,_r,yr,vr,xr,br,wr=null;function Cr(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function Er(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function Tr(e,t,r,n){for(;t<r;){const i=t+r>>1;e[i]<n?t=i+1:r=i}return t}function Sr(e,t,r,n){for(;t<r;){const i=t+r>>1;e[i]<=n?t=i+1:r=i}return t}function Mr(e){return e>0?1/(1.001-e):1+e}function Ir(e){return e>0?1-1/(1.001-e):-e}function Pr(){return null==Ar&&(Ar=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),Ar}const Lr={now:()=>void 0!==vr?vr:performance.now(),setNow(e){vr=e},restoreNow(){vr=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:r,height:n}=e;xr||(xr=document.createElement("canvas"));const i=xr.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return(r>xr.width||n>xr.height)&&(xr.width=r,xr.height=n),i.clearRect(-t,-t,r+2*t,n+2*t),i.drawImage(e,0,0,r,n),i.getImageData(-t,-t,r+2*t,n+2*t)},resolveURL:e=>(_r||(_r=document.createElement("a")),_r.href=e,_r.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==yr&&(yr=window.matchMedia("(prefers-reduced-motion: reduce)")),yr.matches)},hasCanvasFingerprintNoise(){if(void 0!==br)return br;if(!Pr())return br=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let r=0;for(let n=0;n<e.width;++n)t.fillStyle=`rgba(${r++},${r++},${r++}, 255)`,t.fillRect(n,0,1,1);const n=t.getImageData(0,0,e.width,e.height);r=0;for(let e=0;e<n.data.length;++e)if(e%4!=3&&r++!==n.data[e])return br=!0,!0;return br=!1,!1}};function Or(e,t){const r=e.indexOf("?");if(r<0)return`${e}?${new URLSearchParams(t).toString()}`;const n=new URLSearchParams(e.slice(r));for(const e in t)n.set(e,t[e]);return`${e.slice(0,r)}?${n.toString()}`}function Dr(e,t={persistentParams:[]}){const r=e.indexOf("?");if(r<0)return e;const n=new URLSearchParams,i=new URLSearchParams(e.slice(r));for(const e of t.persistentParams){const t=i.get(e);t&&n.set(e,t)}const o=n.toString();return`${e.slice(0,r)}${o.length>0?`?${o}`:""}`}const kr="mapbox-tiles";let zr,Br,Rr=500,Fr=50;function jr(){try{return caches}catch(e){}}function Nr(){const e=jr();e&&!zr&&(zr=e.open(kr))}let Vr=1/0;const Ur={supported:!1,testSupport:function(e){!Zr&&Gr&&(Wr?Qr(e):Hr=e)}};let Hr,Gr,Zr=!1,Wr=!1;const qr="undefined"!=typeof self?self:{};function Qr(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Gr),e.isContextLost())return;Ur.supported=!0}catch(e){}e.deleteTexture(t),Zr=!0}qr.document&&(Gr=qr.document.createElement("img"),Gr.onload=function(){Hr&&Qr(Hr),Hr=null,Wr=!0},Gr.onerror=function(){Zr=!0,Hr=null},Gr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Xr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(Xr);class Yr extends Error{constructor(e,t,r){401===t&&i(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=r}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const $r=mr()?()=>self.worker&&self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,Kr=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test($r())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(e,t){const r=new AbortController,n=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:$r(),referrerPolicy:e.referrerPolicy,signal:r.signal});let o=!1,s=!1;const a=(l=n.url).indexOf("sku=")>0&&i(l);var l;"json"===e.type&&n.headers.set("Accept","application/json");const c=(r,i,o)=>{if(s)return;if(r&&"SecurityError"!==r.message&&hr(r.toString()),i&&o)return u(i);const l=Date.now();fetch(n).then((r=>{if(r.ok){const e=a?r.clone():null;return u(r,e,l)}return t(new Yr(r.statusText,r.status,e.url))})).catch((r=>{"AbortError"!==r.name&&t(new Error(`${r.message} ${e.url}`))}))},u=(r,i,a)=>{("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((e=>{s||(i&&a&&function(e,t,r){if(Nr(),!zr)return;const n=gr(t.headers.get("Cache-Control")||"");if(n["no-store"])return;const i={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach(((e,t)=>i.headers.set(t,e))),n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString());const o=i.headers.get("Expires");if(!o)return;if(new Date(o).getTime()-r<42e4)return;let s=Dr(e.url,{persistentParams:["language","worldview"]});if(206===t.status){const t=e.headers.get("Range");if(!t)return;i.status=200,s=Or(s,{range:t})}!function(e,t){if(void 0===Br)try{new Response(new ReadableStream),Br=!0}catch(e){Br=!1}Br?t(e.body):e.blob().then(t)}(t,(e=>{const t=new Response(e,i);Nr(),zr&&zr.then((e=>e.put(s,t))).catch((e=>hr(e.message)))}))}(n,i,a),o=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((e=>{s||t(new Error(e.message))}))};return a?function(e,t){if(Nr(),!zr)return t(null);zr.then((r=>{let n=Dr(e.url,{persistentParams:["language","worldview"]});const i=e.headers.get("Range");i&&(n=Or(n,{range:i})),r.match(n).then((e=>{const i=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),r=gr(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}(e);r.delete(n),i&&r.put(n,e.clone()),t(null,e,i)})).catch(t)})).catch(t)}(n,c):c(null,null),{cancel:()=>{s=!0,o||r.abort()}}}(e,t);if(mr()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(e,t){const r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer");for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{t(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(e){return t(e)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new Yr(r.statusText,r.status,e.url))},r.send(e.body),{cancel:()=>r.abort()}}(e,t)},Jr=function(e,t){return Kr(Jt(e,{type:"arrayBuffer"}),t)};function en(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}const tn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let rn,nn;rn=[],nn=0;const on=function(e,t){if(Ur.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),nn>=n.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return rn.push(r),r}nn++;let r=!1;const i=()=>{if(!r)for(r=!0,nn--;rn.length&&nn<n.MAX_PARALLEL_IMAGE_REQUESTS;){const e=rn.shift(),{requestParameters:t,callback:r,cancelled:n}=e;n||(e.cancel=on(t,r).cancel)}},o=Jr(e,((e,r,n,o)=>{i(),e?t(e):r&&(self.createImageBitmap?function(e,t){const r=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(r).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(r,((e,r)=>t(e,r,n,o))):function(e,t){const r=new Image;r.onload=()=>{t(null,r),URL.revokeObjectURL(r.src),r.onload=null,requestAnimationFrame((()=>{r.src=tn}))},r.onerror=()=>t(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 n=new Blob([new Uint8Array(e)],{type:"image/png"});r.src=e.byteLength?URL.createObjectURL(n):tn}(r,((e,r)=>t(e,r,n,o))))}));return{cancel:()=>{o.cancel(),i()}}},sn="01",an="NO_ACCESS_TOKEN",ln=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function cn(e){const t=e.match(ln);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 un(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const hn="mapbox.eventData";function dn(e){if(!e)return null;const t=e.split(".");if(!t||3!==t.length)return null;try{return JSON.parse(decodeURIComponent(atob(t[1]).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(e){return null}}class pn{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const t=dn(n.ACCESS_TOKEN);let r="";return r=t&&t.u?btoa(encodeURIComponent(t.u).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t))))):n.ACCESS_TOKEN||"",e?`${hn}.${e}:${r}`:`${hn}:${r}`}fetchEventData(){const e=Cr("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{const e=localStorage.getItem(t);e&&(this.eventData=JSON.parse(e));const n=localStorage.getItem(r);n&&(this.anonId=n)}catch(e){hr("Unable to read from LocalStorage")}}saveEventData(){const e=Cr("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid"),n=this.anonId;if(e&&n)try{localStorage.setItem(r,n),Object.keys(this.eventData).length>=1&&localStorage.setItem(t,JSON.stringify(this.eventData))}catch(e){hr("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,t,r,i){if(!n.EVENTS_URL)return;const o=cn(n.EVENTS_URL);o.params.push(`access_token=${i||n.ACCESS_TOKEN||""}`);const s={event:this.type,created:new Date(e).toISOString()},a=t?Jt(s,t):s,l={url:un(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=function(e,t){return Kr(Jt(e,{method:"POST"}),t)}(l,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(i)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const fn=new class extends pn{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,t){n.EVENTS_URL&&n.ACCESS_TOKEN&&Array.isArray(e)&&e.some((e=>o(e)||i(e)))&&this.queueRequest(Date.now(),t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const r=dn(n.ACCESS_TOKEN),i=r?r.u:n.ACCESS_TOKEN;let o=i!==this.eventData.tokenU;ir(this.anonId)||(this.anonId=rr(),o=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(s),r=(s-this.eventData.lastSuccess)/864e5;o=o||r>=1||r<-1||e.getDate()!==t.getDate()}else o=!0;o?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:sn,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=s,this.eventData.tokenU=i)}),e):this.processRequests()}},mn=fn.postTurnstileEvent.bind(fn),gn=new class extends pn{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(e,t,r,i){this.skuToken=t,this.errorCb=i,n.EVENTS_URL&&(r||n.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},r):this.errorCb(new Error(an)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:r,timestamp:n}=this.queue.shift();r&&this.success[r]||(this.anonId||this.fetchEventData(),ir(this.anonId)||(this.anonId=rr()),this.postEvent(n,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:sn,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):r&&(this.success[r]=!0)}),e))}remove(){this.errorCb=null}},An=gn.postMapLoadEvent.bind(gn),_n=new class extends pn{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(e){let t=this.mapInstanceIdMap.get(e);return t||(t=rr(),this.mapInstanceIdMap.set(e,t)),t}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(e,t){const{map:r,style:i,importedStyles:o}=t;if(!n.EVENTS_URL||!e&&!n.ACCESS_TOKEN)return;const s=this.getMapInstanceId(r),a={mapInstanceId:s,eventId:this.getEventId(s),style:i};o.length&&(a.importedStyles=o),this.queueRequest({timestamp:Date.now(),payload:a},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:r}=this.queue.shift();this.postEvent(t,r,(()=>{}),e)}},yn=_n.postStyleLoadEvent.bind(_n),vn=new class extends pn{constructor(){super("gljs.performance")}postPerformanceEvent(e,t){n.EVENTS_URL&&(e||n.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:r,performanceData:n}=this.queue.shift(),i=function(e){const r=performance.getEntriesByType("resource"),n=performance.getEntriesByType("mark"),i=function(e){const t={};if(e)for(const r in e)if("other"!==r)for(const n of e[r]){const e=`${r}ResolveRangeMin`,i=`${r}ResolveRangeMax`,o=`${r}RequestCount`,s=`${r}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,n.startTime),t[i]=Math.max(t[i]||-1/0,n.responseEnd);const a=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==n.transferSize&&0===n.transferSize&&a(s),a(o)}return t}(function(e,t){const r={};if(e)for(const n of e){const e=t(n);void 0===r[e]&&(r[e]=[]),r[e].push(n)}return r}(r,u)),o=window.devicePixelRatio,s=navigator.connection||navigator.mozConnection||navigator.webkitConnection,a=s?s.effectiveType:void 0,h={counters:[],metadata:[],attributes:[]},d=(e,t,r)=>{null!=r&&e.push({name:t,value:r.toString()})};for(const e in i)d(h.counters,e,i[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(d(h.counters,"interactionRangeMin",e.interactionRange[0]),d(h.counters,"interactionRangeMax",e.interactionRange[1])),n)for(const e of Object.keys(c)){const t=c[e],r=n.find((e=>e.name===t));r&&d(h.counters,t,r.startTime)}return d(h.counters,"visibilityHidden",e.visibilityHidden),d(h.attributes,"style",function(e){if(e)for(const t of e){const e=t.name.split("?")[0];if(l(e)){const t=e.split("/").slice(-2);if(2===t.length)return`mapbox://styles/${t[0]}/${t[1]}`}}}(r)),d(h.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),d(h.attributes,"fogEnabled",e.fogEnabled?"true":"false"),d(h.attributes,"projection",e.projection),d(h.attributes,"zoom",e.zoom),d(h.metadata,"devicePixelRatio",o),d(h.metadata,"connectionEffectiveType",a),d(h.metadata,"navigatorUserAgent",navigator.userAgent),d(h.metadata,"screenWidth",window.screen.width),d(h.metadata,"screenHeight",window.screen.height),d(h.metadata,"windowWidth",window.innerWidth),d(h.metadata,"windowHeight",window.innerHeight),d(h.metadata,"mapWidth",e.width/o),d(h.metadata,"mapHeight",e.height/o),d(h.metadata,"webglRenderer",e.renderer),d(h.metadata,"webglVendor",e.vendor),d(h.metadata,"sdkVersion",t),d(h.metadata,"sdkIdentifier","mapbox-gl-js"),h}(n);for(const e of i.metadata);for(const e of i.counters);for(const e of i.attributes);this.postEvent(r,i,(()=>{}),e)}},xn=vn.postPerformanceEvent.bind(vn),bn=new class extends pn{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,t,r,i){if(!n.API_URL||!n.SESSION_PATH)return;const o=cn(n.API_URL+n.SESSION_PATH);o.params.push(`sku=${t||""}`),o.params.push(`access_token=${i||n.ACCESS_TOKEN||""}`);const s={url:un(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(e,t){return Kr(Jt(e,{method:"GET"}),t)}(s,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(i)}))}getSessionAPI(e,t,r,i){this.skuToken=t,this.errorCb=i,n.SESSION_PATH&&n.API_URL&&(r||n.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},r):this.errorCb(new Error(an)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:r}=this.queue.shift();t&&this.success[t]||this.getSession(r,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}remove(){this.errorCb=null}},wn=bn.getSessionAPI.bind(bn),Cn=new Set;var En={exports:{}},Tn={exports:{}};Tn.exports=function(e,t){var r,n,i,o,s,a,l,c;for(n=e.length-(r=3&e.length),i=t,s=3432918353,a=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(o=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};var Sn=Tn.exports,Mn={exports:{}};Mn.exports=function(e,t){for(var r,n=e.length,i=t^n,o=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var In=Sn,Pn=Mn.exports;En.exports=In,En.exports.murmur3=In,En.exports.murmur2=Pn;var Ln=h(En.exports);function On(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function Dn(e,t,r){if(r&&r[e]){const n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}class kn{constructor(e,t={}){Jt(this,t),this.type=e}}class zn extends kn{constructor(e,t={}){super("error",Jt({error:e},t))}}class Bn{on(e,t){return this._listeners=this._listeners||{},On(e,t,this._listeners),this}off(e,t){return Dn(e,t,this._listeners),Dn(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},On(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new kn(e,t||{}));const r=e.type;if(this.listens(r)){e.target=this;const t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of t)r.call(this,e);const n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const t of n)Dn(r,t,this._oneTimeListeners),t.call(this,e);const i=this._eventedParent;i&&(Jt(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(e))}else e instanceof zn&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}e.z=void 0;var Rn={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 Fn(e){return(e=Math.round(e))<0?0:e>255?255:e}function jn(e){return Fn("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function Nn(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function Vn(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{e.z={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in Rn)return Rn[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var o=r.substr(0,n),s=r.substr(n+1,i-(n+1)).split(","),a=1;switch(o){case"rgba":if(4!==s.length)return null;a=Nn(s.pop());case"rgb":return 3!==s.length?null:[jn(s[0]),jn(s[1]),jn(s[2]),a];case"hsla":if(4!==s.length)return null;a=Nn(s.pop());case"hsl":if(3!==s.length)return null;var l=(parseFloat(s[0])%360+360)%360/360,c=Nn(s[1]),u=Nn(s[2]),h=u<=.5?u*(c+1):u+c-u*c,d=2*u-h;return[Fn(255*Vn(d,h,l+1/3)),Fn(255*Vn(d,h,l)),Fn(255*Vn(d,h,l-1/3)),a];default:return null}}return null}}catch(e){}class Un{constructor(e,t,r,n=1){this.r=e,this.g=t,this.b=r,this.a=n}static parse(t){if(!t)return;if(t instanceof Un)return t;if("string"!=typeof t)return;const r=e.z(t);return r?new Un(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toString(){const[e,t,r,n]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(r)},${n})`}toArray(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[255*e/n,255*t/n,255*r/n,n]}toArray01(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[e/n,t/n,r/n,n]}toArray01Scaled(e){const{r:t,g:r,b:n,a:i}=this;return 0===i?[0,0,0]:[t/i*e,r/i*e,n/i*e]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:r,a:n}=this;return[e,t,r,n]}toArray01Linear(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[Math.pow(e/n,2.2),Math.pow(t/n,2.2),Math.pow(r/n,2.2),n]}}function Hn(e,t,r){return e*(1-r)+t*r}function Gn(e,t,r){return e.map(((e,n)=>Hn(e,t[n],r)))}Un.black=new Un(0,0,0,1),Un.white=new Un(1,1,1,1),Un.transparent=new Un(0,0,0,0),Un.red=new Un(1,0,0,1),Un.blue=new Un(0,0,1,1);var Zn=Object.freeze({__proto__:null,array:Gn,color:function(e,t,r){return new Un(Hn(e.r,t.r,r),Hn(e.g,t.g,r),Hn(e.b,t.b,r),Hn(e.a,t.a,r))},number:Hn});function Wn(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}class qn extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class Qn{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new Qn(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Xn={kind:"null"},Yn={kind:"number"},$n={kind:"string"},Kn={kind:"boolean"},Jn={kind:"color"},ei={kind:"object"},ti={kind:"value"},ri={kind:"collator"},ni={kind:"formatted"},ii={kind:"resolvedImage"};function oi(e,t){return{kind:"array",itemType:e,N:t}}function si(e){if("array"===e.kind){const t=si(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const ai=[Xn,Yn,$n,Kn,Jn,ni,ei,oi(ti),ii];function li(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!li(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of ai)if(!li(e,t))return null}return`Expected ${si(e)} but found ${si(t)} instead.`}function ci(e,t){return t.some((t=>t.kind===e.kind))}function ui(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}class hi{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class di{constructor(e,t,r,n,i){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class pi{constructor(e){this.sections=e}static fromString(e){return new pi([new di(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.namePrimary.length))}static factory(e){return e instanceof pi?e:pi.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.namePrimary]);continue}e.push(t.text);const r={};t.fontStack&&(r["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(r["font-scale"]=t.scale),t.textColor&&(r["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(r)}return e}}class fi{constructor(e){this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),this.available=e.available}toString(){return this.nameSecondary?`[${this.namePrimary},${this.nameSecondary}]`:this.namePrimary}static fromString(e,t){return e?new fi({namePrimary:e,nameSecondary:t,available:!1}):null}serialize(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}function mi(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function gi(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Un)return!0;if(e instanceof hi)return!0;if(e instanceof pi)return!0;if(e instanceof fi)return!0;if(Array.isArray(e)){for(const t of e)if(!gi(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!gi(e[t]))return!1;return!0}return!1}function Ai(e){if(null===e)return Xn;if("string"==typeof e)return $n;if("boolean"==typeof e)return Kn;if("number"==typeof e)return Yn;if(e instanceof Un)return Jn;if(e instanceof hi)return ri;if(e instanceof pi)return ni;if(e instanceof fi)return ii;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=Ai(t);if(r){if(r===e)continue;r=ti;break}r=e}return oi(r||ti,t)}return ei}function _i(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Un||e instanceof pi||e instanceof fi?e.toString():JSON.stringify(e)}class yi{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!gi(e[1]))return t.error("invalid value");const r=e[1];let n=Ai(r);const i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new yi(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Un?["rgba"].concat(this.value.toArray()):this.value instanceof pi?this.value.serialize():this.value}}class vi{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const xi={string:$n,number:Yn,boolean:Kn,object:ei};class bi{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const i=e[0];if("array"===i){let i,o;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in xi)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=xi[r],n++}else i=ti;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=oi(i,o)}else r=xi[i];const o=[];for(;n<e.length;n++){const r=t.parse(e[n],n,ti);if(!r)return null;o.push(r)}return new bi(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!li(this.type,Ai(r)))return r;if(t===this.args.length-1)throw new vi(`Expected value to be of type ${si(this.type)}, but found ${si(Ai(r))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);const n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map((e=>e.serialize())))}}class wi{constructor(e){this.type=ni,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=e.length-1;++r){const o=e[r];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;let e=null;if(o["font-scale"]&&(e=t.parse(o["font-scale"],1,Yn),!e))return null;let r=null;if(o["text-font"]&&(r=t.parse(o["text-font"],1,oi($n)),!r))return null;let s=null;if(o["text-color"]&&(s=t.parse(o["text-color"],1,Jn),!s))return null;const a=n[n.length-1];a.scale=e,a.font=r,a.textColor=s}else{const o=t.parse(e[r],1,ti);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new wi(n)}evaluate(e){return new pi(this.sections.map((t=>{const r=t.content.evaluate(e);return Ai(r)===ii?new di("",r,null,null,null):new di(_i(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const r={};t.scale&&(r["font-scale"]=t.scale.serialize()),t.font&&(r["text-font"]=t.font.serialize()),t.textColor&&(r["text-color"]=t.textColor.serialize()),e.push(r)}return e}}class Ci{constructor(e,t){this.type=ii,this.inputPrimary=e,this.inputSecondary=t}static parse(e,t){if(e.length<2)return t.error("Expected two or more arguments.");const r=t.parse(e[1],1,$n);if(!r)return t.error("No image name provided.");if(2===e.length)return new Ci(r);const n=t.parse(e[2],1,$n);return n?new Ci(r,n):t.error("Secondary image variant is not a string.")}evaluate(e){const t=fi.fromString(this.inputPrimary.evaluate(e),this.inputSecondary?this.inputSecondary.evaluate(e):void 0);return t&&e.availableImages&&(t.available=e.availableImages.indexOf(t.namePrimary)>-1,t.nameSecondary&&t.available&&e.availableImages&&(t.available=e.availableImages.indexOf(t.nameSecondary)>-1)),t}eachChild(e){e(this.inputPrimary),this.inputSecondary&&e(this.inputSecondary)}outputDefined(){return!1}serialize(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}function Ei(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}const Ti={"to-boolean":Kn,"to-color":Jn,"to-number":Yn,"to-string":$n};class Si{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0],n=[];let i=Xn;if("to-array"===r){if(!Array.isArray(e[1]))return null;const r=e[1].length;if(t.expectedType){if("array"!==t.expectedType.kind)return t.error(`Expected ${t.expectedType.kind} but found array.`);i=oi(t.expectedType.itemType,r)}else{if(!(r>0&&gi(e[1][0])))return null;i=oi(Ai(e[1][0]),r)}for(let o=0;o<r;o++){const r=e[1][o];let s;if("array"===Ei(r))s=t.parse(r,void 0,i.itemType);else{const e=Ei(r);if(e!==i.itemType.kind)return t.error(`Expected ${i.itemType.kind} but found ${e}.`);s=t.registry.literal.parse(["literal",void 0===r?null:r],t)}if(!s)return null;n.push(s)}}else{if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");i=Ti[r];for(let r=1;r<e.length;r++){const i=t.parse(e[r],r,ti);if(!i)return null;n.push(i)}}return new Si(i,n)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof Un)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:mi(t[0],t[1],t[2],t[3]),!r))return new Un(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new vi(r||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new vi(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?pi.fromString(_i(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?fi.fromString(_i(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map((t=>t.evaluate(e))):_i(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new wi([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ci(this.args[0]).serialize();const e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}const Mi=["Unknown","Point","LineString","Polygon"];class Ii{constructor(e,t){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,this.scope=e,this.options=t}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Mi[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||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:r,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(r*t-e[0])+this.featureDistanceData.bearing[1]*(n*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Un.parse(e)),t}getConfig(e){return this.options?this.options.get(e):null}}class Pi{constructor(e,t,r,n,i){this.name=e,this.type=t,this._evaluate=r,this.args=n,this._overloadIndex=i}evaluate(e){if(!this._evaluate){const e=Pi.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const r=e[0],n=Pi.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=[];let a=null,l=-1;for(const[n,c]of o){if(Array.isArray(n)&&n.length!==e.length-1)continue;s.push(n),l++,a=new Go(t.registry,t.path,null,t.scope,void 0,t._scope,t.options);const o=[];let u=!1;for(let t=1;t<e.length;t++){const r=e[t],i=Array.isArray(n)?n[t-1]:n.type,s=a.parse(r,1+o.length,i);if(!s){u=!0;break}o.push(s)}if(!u)if(Array.isArray(n)&&n.length!==o.length)a.error(`Expected ${n.length} arguments, but found ${o.length} instead.`);else{for(let e=0;e<o.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=o[e];a.concat(e+1).checkSubtype(t,r.type)}if(0===a.errors.length)return new Pi(r,i,c,o,l)}}if(1===s.length)t.errors.push(...a.errors);else{const r=(s.length?s:o.map((([e])=>e))).map(Li).join(" | "),n=[];for(let r=1;r<e.length;r++){const i=t.parse(e[r],1+n.length);if(!i)return null;n.push(si(i.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Pi.definitions=t;for(const r in t)e[r]=Pi}}function Li(e){return Array.isArray(e)?`(${e.map(si).join(", ")})`:`(${si(e.type)}...)`}class Oi{constructor(e,t,r){this.type=ri,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Kn);if(!n)return null;const i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Kn);if(!i)return null;let o=null;return r.locale&&(o=t.parse(r.locale,1,$n),!o)?null:new Oi(n,i,o)}evaluate(e){return new hi(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}var Di={exports:{}};Di.exports=function(){function e(r,n,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=n-i+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);e(r,n,Math.max(i,Math.floor(n-l*u/a+h)),Math.min(o,Math.floor(n+(a-l)*u/a+h)),s)}var d=r[n],p=i,f=o;for(t(r,i,n),s(r[o],d)>0&&t(r,i,o);p<f;){for(t(r,p,f),p++,f--;s(r[p],d)<0;)p++;for(;s(r[f],d)>0;)f--}0===s(r[i],d)?t(r,i,f):t(r,++f,o),f<=n&&(i=f+1),n<=f&&(o=f-1)}}function t(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function r(e,t){return e<t?-1:e>t?1:0}return function(t,n,i,o,s){e(t,n,i||0,o||t.length-1,s||r)}}();var ki=h(Di.exports);function zi(e){let t=0;for(let r,n,i=0,o=e.length,s=o-1;i<o;s=i++)r=e[i],n=e[s],t+=(n.x-r.x)*(r.y+n.y);return t}function Bi(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Ri(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Fi(e,t,r){const n=e[0]-t[0],i=e[1]-t[1],o=e[0]-r[0],s=e[1]-r[1];return n*s-o*i==0&&n*o<=0&&i*s<=0}function ji(e,t,r=!1){let n=!1;for(let a=0,l=t.length;a<l;a++){const l=t[a];for(let t=0,a=l.length,c=a-1;t<a;c=t++){const a=l[c],u=l[t];if(Fi(e,a,u))return r;(o=a)[1]>(i=e)[1]!=(s=u)[1]>i[1]&&i[0]<(s[0]-o[0])*(i[1]-o[1])/(s[1]-o[1])+o[0]&&(n=!n)}}var i,o,s;return n}function Ni(e,t,r,n){const i=n[0]-r[0],o=n[1]-r[1],s=(e[0]-r[0])*o-i*(e[1]-r[1]),a=(t[0]-r[0])*o-i*(t[1]-r[1]);return s>0&&a<0||s<0&&a>0}function Vi(e,t,r,n){return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(o=[t[0]-e[0],t[1]-e[1]])[1]-i[1]*o[0]&&!(!Ni(e,t,r,n)||!Ni(r,n,e,t));var i,o}const Ui=8192;function Hi(e,t){const r=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(r*i*Ui),Math.round(n*i*Ui)]}function Gi(e,t){for(let r=0;r<t.length;r++)if(ji(e,t[r]))return!0;return!1}function Zi(e,t,r){for(const n of r)for(let r=0,i=n.length,o=i-1;r<i;o=r++)if(Vi(e,t,n[o],n[r]))return!0;return!1}function Wi(e,t){for(let r=0;r<e.length;++r)if(!ji(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if(Zi(e[r],e[r+1],t))return!1;return!0}function qi(e,t){for(let r=0;r<t.length;r++)if(Wi(e,t[r]))return!0;return!1}function Qi(e,t,r){const n=[];for(let i=0;i<e.length;i++){const o=[];for(let n=0;n<e[i].length;n++){const s=Hi(e[i][n],r);Bi(t,s),o.push(s)}n.push(o)}return n}function Xi(e,t,r){const n=[];for(let i=0;i<e.length;i++){const o=Qi(e[i],t,r);n.push(o)}return n}function Yi(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let i=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===i&&(i=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=i}Bi(t,e)}function $i(e,t,r,n){const i=Math.pow(2,n.z)*Ui,o=[n.x*Ui,n.y*Ui],s=[];if(!e)return s;for(const n of e)for(const e of n){const n=[e.x+o[0],e.y+o[1]];Yi(n,t,r,i),s.push(n)}return s}function Ki(e,t,r,n){const i=Math.pow(2,n.z)*Ui,o=[n.x*Ui,n.y*Ui],s=[];if(!e)return s;for(const r of e){const e=[];for(const n of r){const r=[n.x+o[0],n.y+o[1]];Bi(t,r),e.push(r)}s.push(e)}if(t[2]-t[0]<=i/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const e of s)for(const n of e)Yi(n,t,r,i)}var a;return s}class Ji{constructor(e,t){this.type=Kn,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(gi(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const r=t.features[e].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new Ji(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new Ji(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new Ji(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){const o=Qi(t.coordinates,n,i),s=$i(e.geometry(),r,n,i);if(!Ri(r,n))return!1;for(const e of s)if(!ji(e,o))return!1}if("MultiPolygon"===t.type){const o=Xi(t.coordinates,n,i),s=$i(e.geometry(),r,n,i);if(!Ri(r,n))return!1;for(const e of s)if(!Gi(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){const o=Qi(t.coordinates,n,i),s=Ki(e.geometry(),r,n,i);if(!Ri(r,n))return!1;for(const e of s)if(!Wi(e,o))return!1}if("MultiPolygon"===t.type){const o=Xi(t.coordinates,n,i),s=Ki(e.geometry(),r,n,i);if(!Ri(r,n))return!1;for(const e of s)if(!qi(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var eo={exports:{}};!function(e,t){e.exports=function(){var e={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},t=1/298.257223563,r=t*(2-t),n=Math.PI/180,i=function(t,i){if(void 0===t)throw new Error("No latitude given.");if(i&&!e[i])throw new Error("Unknown unit "+i+". Use one of: "+Object.keys(e).join(", "));var o=6378.137*n*(i?e[i]:1),s=Math.cos(t*n),a=1/(1-r*(1-s*s)),l=Math.sqrt(a);this.kx=o*l*s,this.ky=o*l*a*(1-r)},o={units:{configurable:!0}};function s(e,t){return e[0]===t[0]&&e[1]===t[1]}function a(e,t,r){var n=l(t[0]-e[0]);return[e[0]+n*r,e[1]+(t[1]-e[1])*r]}function l(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}return i.fromTile=function(e,t,r){var o=Math.PI*(1-2*(e+.5)/Math.pow(2,t)),s=Math.atan(.5*(Math.exp(o)-Math.exp(-o)))/n;return new i(s,r)},o.units.get=function(){return e},i.prototype.distance=function(e,t){var r=l(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)},i.prototype.bearing=function(e,t){var r=l(t[0]-e[0])*this.kx;return Math.atan2(r,(t[1]-e[1])*this.ky)/n},i.prototype.destination=function(e,t,r){var i=r*n;return this.offset(e,Math.sin(i)*t,Math.cos(i)*t)},i.prototype.offset=function(e,t,r){return[e[0]+t/this.kx,e[1]+r/this.ky]},i.prototype.lineDistance=function(e){for(var t=0,r=0;r<e.length-1;r++)t+=this.distance(e[r],e[r+1]);return t},i.prototype.area=function(e){for(var t=0,r=0;r<e.length;r++)for(var n=e[r],i=0,o=n.length,s=o-1;i<o;s=i++)t+=l(n[i][0]-n[s][0])*(n[i][1]+n[s][1])*(r?-1:1);return Math.abs(t)/2*this.kx*this.ky},i.prototype.along=function(e,t){var r=0;if(t<=0)return e[0];for(var n=0;n<e.length-1;n++){var i=e[n],o=e[n+1],s=this.distance(i,o);if((r+=s)>t)return a(i,o,(t-(r-s))/s)}return e[e.length-1]},i.prototype.pointToSegmentDistance=function(e,t,r){var n=t[0],i=t[1],o=l(r[0]-n)*this.kx,s=(r[1]-i)*this.ky,a=0;return 0===o&&0===s||((a=(l(e[0]-n)*this.kx*o+(e[1]-i)*this.ky*s)/(o*o+s*s))>1?(n=r[0],i=r[1]):a>0&&(n+=o/this.kx*a,i+=s/this.ky*a)),o=l(e[0]-n)*this.kx,s=(e[1]-i)*this.ky,Math.sqrt(o*o+s*s)},i.prototype.pointOnLine=function(e,t){for(var r,n,i,o,s=1/0,a=0;a<e.length-1;a++){var c=e[a][0],u=e[a][1],h=l(e[a+1][0]-c)*this.kx,d=(e[a+1][1]-u)*this.ky,p=0;0===h&&0===d||((p=(l(t[0]-c)*this.kx*h+(t[1]-u)*this.ky*d)/(h*h+d*d))>1?(c=e[a+1][0],u=e[a+1][1]):p>0&&(c+=h/this.kx*p,u+=d/this.ky*p));var f=(h=l(t[0]-c)*this.kx)*h+(d=(t[1]-u)*this.ky)*d;f<s&&(s=f,r=c,n=u,i=a,o=p)}return{point:[r,n],index:i,t:Math.max(0,Math.min(1,o))}},i.prototype.lineSlice=function(e,t,r){var n=this.pointOnLine(r,e),i=this.pointOnLine(r,t);if(n.index>i.index||n.index===i.index&&n.t>i.t){var o=n;n=i,i=o}var a=[n.point],l=n.index+1,c=i.index;!s(r[l],a[0])&&l<=c&&a.push(r[l]);for(var u=l+1;u<=c;u++)a.push(r[u]);return s(r[c],i.point)||a.push(i.point),a},i.prototype.lineSliceAlong=function(e,t,r){for(var n=0,i=[],o=0;o<r.length-1;o++){var s=r[o],l=r[o+1],c=this.distance(s,l);if((n+=c)>e&&0===i.length&&i.push(a(s,l,(e-(n-c))/c)),n>=t)return i.push(a(s,l,(t-(n-c))/c)),i;n>e&&i.push(l)}return i},i.prototype.bufferPoint=function(e,t){var r=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-r,e[0]+n,e[1]+r]},i.prototype.bufferBBox=function(e,t){var r=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-r,e[2]+n,e[3]+r]},i.prototype.insideBBox=function(e,t){return l(e[0]-t[0])>=0&&l(e[0]-t[2])<=0&&e[1]>=t[1]&&e[1]<=t[3]},Object.defineProperties(i,o),i}()}(eo);var to=h(eo.exports),ro={exports:{}};!function(e,t){e.exports=function(){var e=function(e,r){if(void 0===e&&(e=[]),void 0===r&&(r=t),this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function t(e,t){return e<t?-1:e>t?1:0}return e.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},e.prototype.pop=function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},e.prototype.peek=function(){return this.data[0]},e.prototype._up=function(e){for(var t=this.data,r=this.compare,n=t[e];e>0;){var i=e-1>>1,o=t[i];if(r(n,o)>=0)break;t[e]=o,e=i}t[e]=n},e.prototype._down=function(e){for(var t=this.data,r=this.compare,n=this.length>>1,i=t[e];e<n;){var o=1+(e<<1),s=t[o],a=o+1;if(a<this.length&&r(t[a],s)<0&&(o=a,s=t[a]),r(s,i)>=0)break;t[e]=s,e=o}t[e]=i},e}()}(ro);var no=h(ro.exports),io=8192;function oo(e,t){return t.dist-e.dist}const so=100,ao=50;function lo(e){const t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function co(e){return e[1]-e[0]+1}function uo(e,t){const r=e[1]>=e[0]&&e[1]<t;return r||console.warn("Distance Expression: Index is out of range"),r}function ho(e,t){if(e[0]>e[1])return[null,null];const r=co(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}{if(1===r)return[e,null];const t=Math.floor(r/2)-1;return[[e[0],e[0]+t],[e[0]+t+1,e[1]]]}}function po(e,t){const r=[1/0,1/0,-1/0,-1/0];if(!uo(t,e.length))return r;for(let n=t[0];n<=t[1];++n)Bi(r,e[n]);return r}function fo(e){const t=[1/0,1/0,-1/0,-1/0];for(let r=0;r<e.length;++r)for(let n=0;n<e[r].length;++n)Bi(t,e[r][n]);return t}function mo(e,t,r){if(lo(e)||lo(t))return NaN;let n=0,i=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),r.distance([0,0],[n,i])}function go(e){return 360*e-180}function Ao(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function _o(e,t){const r=Math.pow(2,t.z),n=(e.y/io+t.y)/r;return[go((e.x/io+t.x)/r),Ao(n)]}function yo(e,t){const r=[];for(let n=0;n<e.length;++n)r.push(_o(e[n],t));return r}function vo(e,t,r){const n=r.pointOnLine(t,e).point;return r.distance(e,n)}function xo(e,t,r,n,i){const o=r.slice(n[0],n[1]+1);let s=1/0;for(let r=t[0];r<=t[1];++r)if(0===(s=Math.min(s,vo(e[r],o,i))))return 0;return s}function bo(e,t,r,n,i){const o=Math.min(i.pointToSegmentDistance(e,r,n),i.pointToSegmentDistance(t,r,n)),s=Math.min(i.pointToSegmentDistance(r,e,t),i.pointToSegmentDistance(n,e,t));return Math.min(o,s)}function wo(e,t,r,n,i){if(!uo(t,e.length)||!uo(n,r.length))return NaN;let o=1/0;for(let s=t[0];s<t[1];++s)for(let t=n[0];t<n[1];++t){if(Vi(e[s],e[s+1],r[t],r[t+1]))return 0;o=Math.min(o,bo(e[s],e[s+1],r[t],r[t+1],i))}return o}function Co(e,t,r,n,i){if(!uo(t,e.length)||!uo(n,r.length))return NaN;let o=1/0;for(let s=t[0];s<=t[1];++s)for(let t=n[0];t<=n[1];++t)if(0===(o=Math.min(o,i.distance(e[s],r[t]))))return o;return o}function Eo(e,t,r){if(ji(e,t,!0))return 0;let n=1/0;for(const i of t){const t=i.length;if(t<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(i[0]!==i[t-1]&&0===(n=Math.min(n,r.pointToSegmentDistance(e,i[t-1],i[0]))))return n;if(0===(n=Math.min(n,vo(e,i,r))))return n}return n}function To(e,t,r,n){if(!uo(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(ji(e[n],r,!0))return 0;let i=1/0;for(let o=t[0];o<t[1];++o)for(const t of r)for(let r=0,s=t.length,a=s-1;r<s;a=r++){if(Vi(e[o],e[o+1],t[a],t[r]))return 0;i=Math.min(i,bo(e[o],e[o+1],t[a],t[r],n))}return i}function So(e,t){for(const r of e)for(let e=0;e<=r.length-1;++e)if(ji(r[e],t,!0))return!0;return!1}function Mo(e,t,r,n=1/0){const i=fo(e),o=fo(t);if(n!==1/0&&mo(i,o,r)>=n)return n;if(Ri(i,o)){if(So(e,t))return 0}else if(So(t,e))return 0;let s=n;for(const n of e)for(let e=0,i=n.length,o=i-1;e<i;o=e++)for(const i of t)for(let t=0,a=i.length,l=a-1;t<a;l=t++){if(Vi(n[o],n[e],i[l],i[t]))return 0;s=Math.min(s,bo(n[o],n[e],i[l],i[t],r))}return s}function Io(e,t,r,n,i,o,s){if(null===o||null===s)return;const a=mo(po(n,o),po(i,s),r);a<t&&e.push({dist:a,range1:o,range2:s})}function Po(e,t,r,n,i=1/0){let o=Math.min(n.distance(e[0],r[0][0]),i);if(0===o)return o;const s=new no([{dist:0,range1:[0,e.length-1],range2:[0,0]}],oo),a=t?ao:so,l=fo(r);for(;s.length;){const i=s.pop();if(i.dist>=o)continue;const c=i.range1;if(co(c)<=a){if(!uo(c,e.length))return NaN;if(t){const t=To(e,c,r,n);if(0===(o=Math.min(o,t)))return o}else for(let t=c[0];t<=c[1];++t){const i=Eo(e[t],r,n);if(0===(o=Math.min(o,i)))return o}}else{const r=ho(c,t);if(null!==r[0]){const t=mo(po(e,r[0]),l,n);t<o&&s.push({dist:t,range1:r[0],range2:[0,0]})}if(null!==r[1]){const t=mo(po(e,r[1]),l,n);t<o&&s.push({dist:t,range1:r[1],range2:[0,0]})}}}return o}function Lo(e,t,r,n,i,o=1/0){let s=Math.min(o,i.distance(e[0],r[0]));if(0===s)return s;const a=new no([{dist:0,range1:[0,e.length-1],range2:[0,r.length-1]}],oo),l=t?ao:so,c=n?ao:so;for(;a.length;){const o=a.pop();if(o.dist>=s)continue;const u=o.range1,h=o.range2;if(co(u)<=l&&co(h)<=c){if(!uo(u,e.length)||!uo(h,r.length))return NaN;if(t&&n?s=Math.min(s,wo(e,u,r,h,i)):t||n?t&&!n?s=Math.min(s,xo(r,h,e,u,i)):!t&&n&&(s=Math.min(s,xo(e,u,r,h,i))):s=Math.min(s,Co(e,u,r,h,i)),0===s)return s}else{const o=ho(u,t),l=ho(h,n);Io(a,s,i,e,r,o[0],l[0]),Io(a,s,i,e,r,o[0],l[1]),Io(a,s,i,e,r,o[1],l[0]),Io(a,s,i,e,r,o[1],l[1])}}return s}function Oo(e,t,r,n,i=1/0){let o=i;const s=po(e,[0,e.length-1]);for(const i of r)if(!(o!==1/0&&mo(s,po(i,[0,i.length-1]),n)>=o)&&(o=Math.min(o,Lo(e,t,i,!0,n,o)),0===o))return o;return o}function Do(e,t,r,n,i=1/0){let o=i;const s=po(e,[0,e.length-1]);for(const i of r){if(o!==1/0&&mo(s,fo(i),n)>=o)continue;const r=Po(e,t,i,n,o);if(isNaN(r))return r;if(0===(o=Math.min(o,r)))return o}return o}function ko(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}class zo{constructor(e,t){this.type=Yn,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(gi(e[1])){const t=e[1];if("FeatureCollection"===t.type){for(let e=0;e<t.features.length;++e)if(ko(t.features[e].geometry.type))return new zo(t,t.features[e].geometry)}else if("Feature"===t.type){if(ko(t.geometry.type))return new zo(t,t.geometry)}else if(ko(t.type))return new zo(t,t)}return t.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(e){const t=e.geometry(),r=e.canonicalID();if(null!=t&&null!=r){if("Point"===e.geometryType())return function(e,t,r){const n=[];for(const r of e)for(const e of r)n.push(_o(e,t));const i=new to(n[0][1],"meters");return"Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type?Lo(n,!1,"Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,i):"MultiLineString"===r.type?Oo(n,!1,r.coordinates,i):"Polygon"===r.type||"MultiPolygon"===r.type?Do(n,!1,"Polygon"===r.type?[r.coordinates]:r.coordinates,i):null}(t,r,this.geometries);if("LineString"===e.geometryType())return function(e,t,r){const n=[];for(const r of e){const e=[];for(const n of r)e.push(_o(n,t));n.push(e)}const i=new to(n[0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return Oo("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,n,i);if("MultiLineString"===r.type){let e=1/0;for(let t=0;t<r.coordinates.length;t++){const o=Oo(r.coordinates[t],!0,n,i,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}if("Polygon"===r.type||"MultiPolygon"===r.type){let e=1/0;for(let t=0;t<n.length;t++){const o=Do(n[t],!0,"Polygon"===r.type?[r.coordinates]:r.coordinates,i,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return null}(t,r,this.geometries);if("Polygon"===e.geometryType())return function(e,t,r){const n=[];for(const r of function(e,t){const r=e.length;if(r<=1)return[e];const n=[];let i,o;for(let t=0;t<r;t++){const r=zi(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(i&&n.push(i),i=[e[t]]):i.push(e[t]))}return i&&n.push(i),n}(e)){const e=[];for(let n=0;n<r.length;++n)e.push(yo(r[n],t));n.push(e)}const i=new to(n[0][0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return Do("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,n,i);if("MultiLineString"===r.type){let e=1/0;for(let t=0;t<r.coordinates.length;t++){const o=Do(r.coordinates[t],!0,n,i,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return"Polygon"===r.type||"MultiPolygon"===r.type?function(e,t,r){let n=1/0;for(const i of e)for(const e of t){const t=Mo(i,e,r,n);if(isNaN(t))return t;if(0===(n=Math.min(n,t)))return n}return n}("Polygon"===r.type?[r.coordinates]:r.coordinates,n,i):null}(t,r,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function Bo(e,t){switch(e){case"string":return _i(t);case"number":return+t;case"boolean":return!!t;case"color":return Un.parse(t);case"formatted":return pi.fromString(_i(t));case"resolvedImage":return fi.fromString(_i(t))}return t}function Ro(e,t,r,n){return void 0!==n&&(e=n*Math.round(e/n)),void 0!==t&&e<t&&(e=t),void 0!==r&&e>r&&(e=r),e}class Fo{constructor(e,t,r){this.type=e,this.key=t,this.scope=r}static parse(e,t){let r=t.expectedType;if(null==r&&(r=ti),e.length<2||e.length>3)return t.error("Invalid number of arguments for 'config' expression.");const n=t.parse(e[1],1);if(!(n instanceof yi))return t.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){const i=t.parse(e[2],2);return i instanceof yi?new Fo(r,_i(n.value),_i(i.value)):t.error("Scope of 'config' expression must be a string literal.")}return new Fo(r,_i(n.value))}evaluate(e){const t=[this.key,this.scope,e.scope].filter(Boolean).join(""),r=e.getConfig(t);if(!r)return null;const{type:n,value:i,values:o,minValue:s,maxValue:a,stepValue:l}=r,c=r.default.evaluate(e);let u=c;if(i){const t=e.scope;e.scope=(t||"").split("").slice(1).join(""),u=i.evaluate(e),e.scope=t}return n&&(u=Bo(n,u)),void 0===u||void 0===s&&void 0===a&&void 0===l||("number"==typeof u?u=Ro(u,s,a,l):Array.isArray(u)&&(u=u.map((e=>"number"==typeof e?Ro(e,s,a,l):e)))),void 0!==i&&void 0!==u&&o&&!o.includes(u)&&(u=c,n&&(u=Bo(n,u))),(n&&n!==this.type||void 0!==u&&Ai(u)!==this.type)&&(u=Bo(this.type.kind,u)),u}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.key),e}}function jo(e){if(e instanceof Pi){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Ji)return!1;if(e instanceof zo)return!1;let t=!0;return e.eachChild((e=>{t&&!jo(e)&&(t=!1)})),t}function No(e){if(e instanceof Pi&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!No(e)&&(t=!1)})),t}function Vo(e){if(e instanceof Fo)return!1;let t=!0;return e.eachChild((e=>{t&&!Vo(e)&&(t=!1)})),t}function Uo(e,t){if(e instanceof Pi&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!Uo(e,t)&&(r=!1)})),r}class Ho{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new Ho(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Go{constructor(e,t=[],r,n=new Qn,i=[],o,s){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=n,this.errors=i,this.expectedType=r,this._scope=o,this.options=s}parse(e,t,r,n,i={}){return t||r?this.concat(t,r,n)._parse(e,i):this._parse(e,i)}_parse(e,t){function r(e,t,r){return"assert"===r?new bi(t,[e]):"coerce"===r?new Si(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n="string"==typeof e[0]?this.registry[e[0]]:void 0;if(n){let i=n.parse(e,this);if(!i)return null;if(this.expectedType){const e=this.expectedType,n=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(e,n))return null}else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof yi)&&"resolvedImage"!==i.type.kind&&Zo(i)){const t=new Ii(this._scope,this.options);try{i=new yi(i.type,i.evaluate(t))}catch(e){return this.error(e.message),null}}return i}return Si.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new Go(this.registry,n,t||null,i,this.errors,this._scope,this.options)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new qn(r,e))}checkSubtype(e,t){const r=li(e,t);return r&&this.error(r),r}}function Zo(e){if(e instanceof Ho)return Zo(e.boundExpression);if(e instanceof Pi&&"error"===e.name)return!1;if(e instanceof Oi)return!1;if(e instanceof Ji)return!1;if(e instanceof zo)return!1;if(e instanceof Fo)return!1;const t=e instanceof Si||e instanceof bi;let r=!0;return e.eachChild((e=>{r=t?r&&Zo(e):r&&e instanceof yi})),!!r&&jo(e)&&Uo(e,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function Wo(e,t){const r=e.length-1;let n,i,o=0,s=r,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=e[a],i=e[a+1],n<=t){if(a===r||t<i)return a;o=a+1}else{if(!(n>t))throw new vi("Input is not a number.");s=a-1}return 0}class qo{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,Yn);if(!r)return null;const n=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let r=1;r<e.length;r+=2){const o=1===r?-1/0:e[r],s=e[r+1],a=r,l=r+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=t.parse(s,l,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new qo(i,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Wo(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}const Qo=.95047,Xo=1.08883,Yo=4/29,$o=6/29,Ko=3*$o*$o,Jo=$o*$o*$o,es=Math.PI/180,ts=180/Math.PI;function rs(e){return e>Jo?Math.pow(e,1/3):e/Ko+Yo}function ns(e){return e>$o?e*e*e:Ko*(e-Yo)}function is(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function os(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ss(e){const t=os(e.r),r=os(e.g),n=os(e.b),i=rs((.4124564*t+.3575761*r+.1804375*n)/Qo),o=rs((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-rs((.0193339*t+.119192*r+.9503041*n)/Xo)),alpha:e.a}}function as(e){let t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*ns(t),r=Qo*ns(r),n=Xo*ns(n),new Un(is(3.2404542*r-1.5371385*t-.4985314*n),is(-.969266*r+1.8760108*t+.041556*n),is(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function ls(e,t,r){const n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}const cs={forward:ss,reverse:as,interpolate:function(e,t,r){return{l:Hn(e.l,t.l,r),a:Hn(e.a,t.a,r),b:Hn(e.b,t.b,r),alpha:Hn(e.alpha,t.alpha,r)}}},us={forward:function(e){const{l:t,a:r,b:n}=ss(e),i=Math.atan2(n,r)*ts;return{h:i<0?i+360:i,c:Math.sqrt(r*r+n*n),l:t,alpha:e.a}},reverse:function(e){const t=e.h*es,r=e.c;return as({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:ls(e.h,t.h,r),c:Hn(e.c,t.c,r),l:Hn(e.l,t.l,r),alpha:Hn(e.alpha,t.alpha,r)}}};var hs=Object.freeze({__proto__:null,hcl:us,lab:cs});class ds{constructor(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let i=0;if("exponential"===e.name)i=ps(t,e.base,r,n);else if("linear"===e.name)i=ps(t,1,r,n);else if("cubic-bezier"===e.name){const o=e.controlPoints;i=new Rt(o[0],o[1],o[2],o[3]).solve(ps(t,1,r,n))}return i}static parse(e,t){let[r,n,i,...o]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,Yn),!i)return null;const s=[];let a=null;"interpolate-hcl"===r||"interpolate-lab"===r?a=Jn:t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let e=0;e<o.length;e+=2){const r=o[e],n=o[e+1],i=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(s.length&&s[s.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const c=t.parse(n,l,a);if(!c)return null;a=a||c.type,s.push([r,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new ds(a,r,n,i,s):t.error(`Type ${si(a)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);const o=Wo(t,n),s=ds.interpolationFactor(this.interpolation,n,t[o],t[o+1]),a=r[o].evaluate(e),l=r[o+1].evaluate(e);return"interpolate"===this.operator?Zn[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?us.reverse(us.interpolate(us.forward(a),us.forward(l),s)):cs.reverse(cs.interpolate(cs.forward(a),cs.forward(l),s))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function ps(e,t,r,n){const i=n-r,o=e-r;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}class fs{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const n of e.slice(1)){const e=t.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,i.push(e)}const o=n&&i.some((e=>li(n,e.type)));return new fs(o?ti:r,i)}evaluate(e){let t,r=null,n=0;for(const i of this.args){if(n++,r=i.evaluate(e),r&&r instanceof fi&&!r.available&&(t||(t=r),r=null,n===this.args.length))return t;if(null!==r)break}return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class ms{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n<e.length-1;n+=2){const i=e[n];if("string"!=typeof i)return t.error(`Expected string, but found ${typeof i} instead.`,n);if(/[^a-zA-Z0-9_]/.test(i))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const o=t.parse(e[n+1],n+1);if(!o)return null;r.push([i,o])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new ms(r,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,r]of this.bindings)e.push(t,r.serialize());return e.push(this.result.serialize()),e}}class gs{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,Yn),n=t.parse(e[2],2,oi(t.expectedType||ti));return r&&n?new gs(n.type.itemType,r,n):null}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new vi(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new vi(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new vi(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class As{constructor(e,t){this.type=Kn,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ti),n=t.parse(e[2],2,ti);return r&&n?ci(r.type,[Kn,$n,Yn,Xn,ti])?new As(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${si(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!ui(t,["boolean","string","number","null"]))throw new vi(`Expected first argument to be of type boolean, string, number or null, but found ${si(Ai(t))} instead.`);if(!ui(r,["string","array"]))throw new vi(`Expected second argument to be of type array or string, but found ${si(Ai(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class _s{constructor(e,t,r){this.type=Yn,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ti),n=t.parse(e[2],2,ti);if(!r||!n)return null;if(!ci(r.type,[Kn,$n,Yn,Xn,ti]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${si(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,Yn);return i?new _s(r,n,i):null}return new _s(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!ui(t,["boolean","string","number","null"]))throw new vi(`Expected first argument to be of type boolean, string, number or null, but found ${si(Ai(t))} instead.`);if(!ui(r,["string","array"]))throw new vi(`Expected second argument to be of type array or string, but found ${si(Ai(r))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class ys{constructor(e,t,r,n,i,o){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const i={},o=[];for(let s=2;s<e.length-1;s+=2){let a=e[s];const l=e[s+1];Array.isArray(a)||(a=[a]);const c=t.concat(s);if(0===a.length)return c.error("Expected at least one branch label.");for(const e of a){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,Ai(e)))return null}else r=Ai(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=o.length}const u=t.parse(l,s,n);if(!u)return null;n=n||u.type,o.push(u)}const s=t.parse(e[1],1,ti);if(!s)return null;const a=t.parse(e[e.length-1],e.length-1,n);return a?"value"!==s.type.kind&&t.concat(1).checkSubtype(r,s.type)?null:new ys(r,n,s,i,o,a):null}evaluate(e){const t=this.input.evaluate(e);return(Ai(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),r=[],n={};for(const e of t){const t=n[this.cases[e]];void 0===t?(n[this.cases[e]]=r.length,r.push([this.cases[e],[e]])):r[t][1].push(e)}const i=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,n]of r)e.push(1===n.length?i(n[0]):n.map(i)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}class vs{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let i=1;i<e.length-1;i+=2){const o=t.parse(e[i],i,Kn);if(!o)return null;const s=t.parse(e[i+1],i+1,r);if(!s)return null;n.push([o,s]),r=r||s.type}const i=t.parse(e[e.length-1],e.length-1,r);return i?new vs(r,n,i):null}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class xs{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ti),n=t.parse(e[2],2,Yn);if(!r||!n)return null;if(!ci(r.type,[oi(ti),$n,ti]))return t.error(`Expected first argument to be of type array or string, but found ${si(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,Yn);return i?new xs(r.type,r,n,i):null}return new xs(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!ui(t,["string","array"]))throw new vi(`Expected first argument to be of type array or string, but found ${si(Ai(t))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function bs(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function ws(e,t,r,n){return 0===n.compare(t,r)}function Cs(e,t,r){const n="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=Kn,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let o=t.parse(e[1],1,ti);if(!o)return null;if(!bs(r,o.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${si(o.type)}'.`);let s=t.parse(e[2],2,ti);if(!s)return null;if(!bs(r,s.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${si(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${si(o.type)}' and '${si(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new bi(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new bi(o.type,[s])));let a=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(a=t.parse(e[3],3,ri),!a)return null}return new i(o,s,a)}evaluate(i){const o=this.lhs.evaluate(i),s=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const t=Ai(o),r=Ai(s);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new vi(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=Ai(o),r=Ai(s);if("string"!==e.kind||"string"!==r.kind)return t(i,o,s)}return this.collator?r(i,o,s,this.collator.evaluate(i)):t(i,o,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const Es=Cs("==",(function(e,t,r){return t===r}),ws),Ts=Cs("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!ws(0,t,r,n)})),Ss=Cs("<",(function(e,t,r){return t<r}),(function(e,t,r,n){return n.compare(t,r)<0})),Ms=Cs(">",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),Is=Cs("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Ps=Cs(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class Ls{constructor(e,t,r,n,i,o){this.type=$n,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Yn);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=t.parse(n.locale,1,$n),!i))return null;let o=null;if(n.currency&&(o=t.parse(n.currency,1,$n),!o))return null;let s=null;if(n.unit&&(s=t.parse(n.unit,1,$n),!s))return null;let a=null;if(n["min-fraction-digits"]&&(a=t.parse(n["min-fraction-digits"],1,Yn),!a))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,Yn),!l)?null:new Ls(r,i,o,s,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class Os{constructor(e){this.type=Yn,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${si(r.type)} instead.`):new Os(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new vi(`Expected value to be of type string or array, but found ${si(Ai(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}function Ds(e){return function(){e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const ks={"==":Es,"!=":Ts,">":Ms,"<":Ss,">=":Ps,"<=":Is,array:bi,at:gs,boolean:bi,case:vs,coalesce:fs,collator:Oi,format:wi,image:Ci,in:As,"index-of":_s,interpolate:ds,"interpolate-hcl":ds,"interpolate-lab":ds,length:Os,let:ms,literal:yi,match:ys,number:bi,"number-format":Ls,object:bi,slice:xs,step:qo,string:bi,"to-boolean":Si,"to-color":Si,"to-number":Si,"to-string":Si,var:Ho,within:Ji,distance:zo,config:Fo};function zs(e,[t,r,n,i]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const o=i?i.evaluate(e):1,s=mi(t,r,n,o);if(s)throw new vi(s);return new Un(t/255*o,r/255*o,n/255*o,o)}function Bs(e,[t,r,n,i]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const o=i?i.evaluate(e):1,s=function(e,t,r,n){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof r&&r>=0&&r<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid hsla value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'h' must be between 0 and 360.`}(t,r,n,o);if(s)throw new vi(s);const a=`hsla(${t}, ${r}%, ${n}%, ${o})`,l=Un.parse(a);if(!l)throw new vi(`Failed to parse HSLA color: ${a}`);return l}function Rs(e,t){return e in t}function Fs(e,t){const r=t[e];return void 0===r?null:r}function js(e){return{type:e}}function Ns(e){return{result:"success",value:e}}function Vs(e){return{result:"error",value:e}}function Us(e,t){return!!e&&!!e.parameters&&e.parameters.indexOf(t)>-1}function Hs(e){return"data-driven"===e["property-type"]}function Gs(e){return Us(e.expression,"measure-light")}function Zs(e){return Us(e.expression,"zoom")}function Ws(e){return!!e.expression&&e.expression.interpolated}function qs(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Qs(e){return e}function Xs(e,t){const r="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],i=n||!(n||void 0!==e.property),o=e.type||(Ws(t)?"exponential":"interval");if(r&&((e=Wn({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],Un.parse(e[1])]))),e.default=Un.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!hs[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let s,a,l;if("exponential"===o)s=Js;else if("interval"===o)s=Ks;else if("categorical"===o){s=$s,a=Object.create(null);for(const t of e.stops)a[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);s=ea}if(n){const r={},n=[];for(let t=0;t<e.stops.length;t++){const i=e.stops[t],o=i[0].zoom;void 0===r[o]&&(r[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},n.push(o)),r[o].stops.push([i[0].value,i[1]])}const i=[];for(const e of n)i.push([r[e].zoom,Xs(r[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:ds.interpolationFactor.bind(void 0,o),zoomStops:i.map((e=>e[0])),evaluate:({zoom:r},n)=>Js({stops:i,base:e.base},t,r).evaluate(r,n)}}if(i){const r="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:ds.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>s(e,t,r,a,l)}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[e.property]:void 0;return void 0===i?Ys(e.default,t.default):s(e,t,i,a,l)}}}function Ys(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function $s(e,t,r,n,i){return Ys(typeof r===i?n[r]:void 0,e.default,t.default)}function Ks(e,t,r){if("number"!==Ei(r))return Ys(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const i=Wo(e.stops.map((e=>e[0])),r);return e.stops[i][1]}function Js(e,t,r){const n=void 0!==e.base?e.base:1;if("number"!==Ei(r))return Ys(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const o=Wo(e.stops.map((e=>e[0])),r),s=function(e,t,r,n){const i=n-r,o=e-r;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[o][0],e.stops[o+1][0]),a=e.stops[o][1],l=e.stops[o+1][1];let c=Zn[t.type]||Qs;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=hs[e.colorSpace];c=(e,r)=>t.reverse(t.interpolate(t.forward(e),t.forward(r),s))}return"function"==typeof a.evaluate?{evaluate(...e){const t=a.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==r)return c(t,r,s)}}:c(a,l,s)}function ea(e,t,r){return"color"===t.type?r=Un.parse(r):"formatted"===t.type?r=pi.fromString(r.toString()):"resolvedImage"===t.type?r=fi.fromString(r.toString()):Ei(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),Ys(r,e.default,t.default)}Pi.register(ks,{error:[{kind:"error"},[$n],(e,[t])=>{throw new vi(t.evaluate(e))}],typeof:[$n,[ti],(e,[t])=>si(Ai(t.evaluate(e)))],"to-rgba":[oi(Yn,4),[Jn],(e,[t])=>t.evaluate(e).toArray()],rgb:[Jn,[Yn,Yn,Yn],zs],rgba:[Jn,[Yn,Yn,Yn,Yn],zs],hsl:[Jn,[Yn,Yn,Yn],Bs],hsla:[Jn,[Yn,Yn,Yn,Yn],Bs],has:{type:Kn,overloads:[[[$n],(e,[t])=>Rs(t.evaluate(e),e.properties())],[[$n,ei],(e,[t,r])=>Rs(t.evaluate(e),r.evaluate(e))]]},get:{type:ti,overloads:[[[$n],(e,[t])=>Fs(t.evaluate(e),e.properties())],[[$n,ei],(e,[t,r])=>Fs(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ti,[$n],(e,[t])=>Fs(t.evaluate(e),e.featureState||{})],properties:[ei,[],e=>e.properties()],"geometry-type":[$n,[],e=>e.geometryType()],id:[ti,[],e=>e.id()],zoom:[Yn,[],e=>e.globals.zoom],pitch:[Yn,[],e=>e.globals.pitch||0],"distance-from-center":[Yn,[],e=>e.distanceFromCenter()],"measure-light":[Yn,[$n],(e,[t])=>e.measureLight(t.evaluate(e))],"heatmap-density":[Yn,[],e=>e.globals.heatmapDensity||0],"line-progress":[Yn,[],e=>e.globals.lineProgress||0],"raster-value":[Yn,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[Yn,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[Yn,[],e=>e.globals.skyRadialProgress||0],accumulated:[ti,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Yn,js(Yn),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[Yn,js(Yn),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:Yn,overloads:[[[Yn,Yn],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[Yn],(e,[t])=>-t.evaluate(e)]]},"/":[Yn,[Yn,Yn],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[Yn,[Yn,Yn],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[Yn,[],()=>Math.LN2],pi:[Yn,[],()=>Math.PI],e:[Yn,[],()=>Math.E],"^":[Yn,[Yn,Yn],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[Yn,[Yn],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[Yn,[Yn],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[Yn,[Yn],(e,[t])=>Math.log(t.evaluate(e))],log2:[Yn,[Yn],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[Yn,[Yn],(e,[t])=>Math.sin(t.evaluate(e))],cos:[Yn,[Yn],(e,[t])=>Math.cos(t.evaluate(e))],tan:[Yn,[Yn],(e,[t])=>Math.tan(t.evaluate(e))],asin:[Yn,[Yn],(e,[t])=>Math.asin(t.evaluate(e))],acos:[Yn,[Yn],(e,[t])=>Math.acos(t.evaluate(e))],atan:[Yn,[Yn],(e,[t])=>Math.atan(t.evaluate(e))],min:[Yn,js(Yn),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[Yn,js(Yn),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[Yn,[Yn],(e,[t])=>Math.abs(t.evaluate(e))],round:[Yn,[Yn],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Yn,[Yn],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[Yn,[Yn],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[Kn,[$n,ti],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[Kn,[ti],(e,[t])=>e.id()===t.value],"filter-type-==":[Kn,[$n],(e,[t])=>e.geometryType()===t.value],"filter-<":[Kn,[$n,ti],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[Kn,[ti],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[Kn,[$n,ti],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[Kn,[ti],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[Kn,[$n,ti],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[Kn,[ti],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[Kn,[$n,ti],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[Kn,[ti],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[Kn,[ti],(e,[t])=>t.value in e.properties()],"filter-has-id":[Kn,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[Kn,[oi($n)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[Kn,[oi(ti)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[Kn,[$n,oi(ti)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[Kn,[$n,oi(ti)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Kn,overloads:[[[Kn,Kn],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[js(Kn),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:Kn,overloads:[[[Kn,Kn],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[js(Kn),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[Kn,[Kn],(e,[t])=>!t.evaluate(e)],"is-supported-script":[Kn,[$n],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[$n,[$n],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[$n,[$n],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[$n,js(ti),(e,t)=>t.map((t=>_i(t.evaluate(e)))).join("")],"resolved-locale":[$n,[ri],(e,[t])=>t.evaluate(e).resolvedLocale()],random:[Yn,[Yn,Yn,ti],(e,t)=>{const[r,n,i]=t.map((t=>t.evaluate(e)));if(r>n)return r;if(r===n)return r;let o;if("string"==typeof i)o=function(e){let t=0;if(0===e.length)return t;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}(i);else{if("number"!=typeof i)throw new vi(`Invalid seed input: ${i}`);o=i}return r+Ds(o)()*(n-r)}]});class ta{constructor(e,t,r,n){this.expression=e,this._warningHistory={},this._evaluator=new Ii(r,n),this._defaultValue=t?function(e){return"color"===e.type&&(qs(e.default)||Array.isArray(e.default))?new Un(0,0,0,0):"color"===e.type?Un.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,i,o,s,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,o,s,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new vi(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function ra(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in ks}function na(e,t,r,n){const i=new Go(ks,[],t?function(e){const t={color:Jn,string:$n,number:Yn,enum:$n,boolean:Kn,formatted:ni,resolvedImage:ii};return"array"===e.type?oi(t[e.value]||ti,e.length):t[e.type]}(t):void 0,void 0,void 0,r,n),o=i.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Ns(new ta(o,t,r,n)):Vs(i.errors)}class ia{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isLightConstant=r,this.isStateDependent="constant"!==e&&!No(t.expression),this.isConfigDependent=!Vo(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,o)}evaluate(e,t,r,n,i,o){return this._styleExpression.evaluate(e,t,r,n,i,o)}}class oa{constructor(e,t,r,n,i){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!No(t.expression),this.isLightConstant=i,this.isConfigDependent=!Vo(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,o)}evaluate(e,t,r,n,i,o){return this._styleExpression.evaluate(e,t,r,n,i,o)}interpolationFactor(e,t,r){return this.interpolationType?ds.interpolationFactor(this.interpolationType,e,t,r):0}}function sa(e,t,r,n){if("error"===(e=na(e,t,r,n)).result)return e;const i=e.value.expression,o=jo(i);if(!o&&!Hs(t))return Vs([new qn("","data expressions not supported")]);const s=Uo(i,["zoom","pitch","distance-from-center"]);if(!s&&!Zs(t))return Vs([new qn("","zoom expressions not supported")]);const a=Uo(i,["measure-light"]);if(!a&&!Gs(t))return Vs([new qn("","measure-light expression not supported")]);const l=t.expression&&t.expression.relaxZoomRestriction,c=la(i);return c||s||l?c instanceof qn?Vs([c]):c instanceof ds&&!Ws(t)?Vs([new qn("",'"interpolate" expressions cannot be used with this property')]):Ns(c?new oa(o?"camera":"composite",e.value,c.labels,c instanceof ds?c.interpolation:void 0,a):new ia(o?"constant":"source",e.value,a)):Vs([new qn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class aa{constructor(e,t){this._parameters=e,this._specification=t,Wn(this,Xs(this._parameters,this._specification))}static deserialize(e){return new aa(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function la(e){let t=null;if(e instanceof ms)t=la(e.result);else if(e instanceof fs){for(const r of e.args)if(t=la(r),t)break}else(e instanceof qo||e instanceof ds)&&e.input instanceof Pi&&"zoom"===e.input.name&&(t=e);return t instanceof qn||e.eachChild((e=>{const r=la(e);r instanceof qn?t=r:t&&r&&t!==r&&(t=new qn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}var ca=ha,ua=3;function ha(e,t,r){var n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var i=new Int32Array(this.arrayBuffer);e=i[0],this.d=(t=i[1])+2*(r=i[2]);for(var o=0;o<this.d*this.d;o++){var s=i[ua+o],a=i[ua+o+1];n.push(s===a?null:i.subarray(s,a))}var l=i[ua+n.length+1];this.keys=i.subarray(i[ua+n.length],l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var u=r/t*e;this.min=-u,this.max=e+u}ha.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},ha.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ha.prototype._insertCell=function(e,t,r,n,i,o){this.cells[i].push(o)},ha.prototype.query=function(e,t,r,n,i){var o=this.min,s=this.max;if(e<=o&&t<=o&&s<=r&&s<=n&&!i)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(e,t,r,n,this._queryCell,a,{},i),a},ha.prototype._queryCell=function(e,t,r,n,i,o,s,a){var l=this.cells[i];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===s[d]){var p=4*d;(a?a(u[p+0],u[p+1],u[p+2],u[p+3]):e<=u[p+2]&&t<=u[p+3]&&r>=u[p+0]&&n>=u[p+1])?(s[d]=!0,o.push(c[d])):s[d]=!1}}},ha.prototype._forEachCell=function(e,t,r,n,i,o,s,a){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),d=l;d<=u;d++)for(var p=c;p<=h;p++){var f=this.d*p+d;if((!a||a(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&i.call(this,e,t,r,n,f,o,s,a))return}},ha.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},ha.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},ha.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=ua+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(t+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=t,s=0;s<e.length;s++){var a=e[s];i[ua+s]=o,i.set(a,o),o+=a.length}return i[ua+e.length]=o,i.set(this.keys,o),i[ua+e.length+1]=o+=this.keys.length,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var da=h(ca);const pa={};function fa(e,t,r={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),pa[t]={klass:e,omit:r.omit||[]}}fa(Object,"Object"),da.serialize=function(e,t){const r=e.toArrayBuffer();return t&&t.add(r),{buffer:r}},da.deserialize=function(e){return new da(e.buffer)},Object.defineProperty(da,"name",{value:"Grid"}),fa(da,"Grid"),fa(Un,"Color"),fa(Error,"Error"),fa(pi,"Formatted"),fa(di,"FormattedSection"),fa(Yr,"AJAXError"),fa(fi,"ResolvedImage"),fa(aa,"StylePropertyFunction"),fa(ta,"StyleExpression",{omit:["_evaluator"]}),fa(oa,"ZoomDependentExpression"),fa(ia,"ZoomConstantExpression"),fa(Pi,"CompoundExpression",{omit:["_evaluate"]});for(const e in ks)pa[ks[e]._classRegistryKey]||fa(ks[e],`Expression${e}`);function ma(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function ga(e){return self.ImageBitmap&&e instanceof ImageBitmap}function Aa(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(ma(e)||ga(e))return t&&t.add(e),e;if(ArrayBuffer.isView(e)){const r=e;return t&&t.add(r.buffer),r}if(e instanceof ImageData)return t&&t.add(e.data.buffer),e;if(Array.isArray(e)){const r=[];for(const n of e)r.push(Aa(n,t));return r}if(e instanceof Map){const t={$name:"Map"};for(const[r,n]of e.entries())t[r]=Aa(n);return t}if("object"==typeof e){const r=e.constructor,n=r._classRegistryKey;if(!n)throw new Error(`can't serialize object of unregistered class ${n}`);const i=r.serialize?r.serialize(e,t):{};if(!r.serialize){for(const r in e)e.hasOwnProperty(r)&&(pa[n].omit.indexOf(r)>=0||(i[r]=Aa(e[r],t)));e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(i.$name=n),i}throw new Error("can't serialize object of type "+typeof e)}function _a(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||ma(e)||ga(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(_a);if("object"==typeof e){const t=e.$name||"Object";if("Map"===t){const t=new Map;for(const r of Object.keys(e))"$name"!==r&&t.set(r,_a(e[r]));return t}const{klass:r}=pa[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);const n=Object.create(r.prototype);for(const t of Object.keys(e))"$name"!==t&&(n[t]=_a(e[t]));return n}throw new Error("can't deserialize object of type "+typeof e)}const ya={"Latin-1 Supplement":e=>e>=128&&e<=255,Arabic:e=>e>=1536&&e<=1791,"Arabic Supplement":e=>e>=1872&&e<=1919,"Arabic Extended-A":e=>e>=2208&&e<=2303,"Hangul Jamo":e=>e>=4352&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>e>=5120&&e<=5759,Khmer:e=>e>=6016&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>e>=6320&&e<=6399,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"CJK Radicals Supplement":e=>e>=11904&&e<=12031,"Kangxi Radicals":e=>e>=12032&&e<=12255,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Bopomofo:e=>e>=12544&&e<=12591,"Hangul Compatibility Jamo":e=>e>=12592&&e<=12687,Kanbun:e=>e>=12688&&e<=12703,"Bopomofo Extended":e=>e>=12704&&e<=12735,"CJK Strokes":e=>e>=12736&&e<=12783,"Katakana Phonetic Extensions":e=>e>=12784&&e<=12799,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"CJK Unified Ideographs Extension A":e=>e>=13312&&e<=19903,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Yi Syllables":e=>e>=40960&&e<=42127,"Yi Radicals":e=>e>=42128&&e<=42191,"Hangul Jamo Extended-A":e=>e>=43360&&e<=43391,"Hangul Syllables":e=>e>=44032&&e<=55215,"Hangul Jamo Extended-B":e=>e>=55216&&e<=55295,"Private Use Area":e=>e>=57344&&e<=63743,"CJK Compatibility Ideographs":e=>e>=63744&&e<=64255,"Arabic Presentation Forms-A":e=>e>=64336&&e<=65023,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Arabic Presentation Forms-B":e=>e>=65136&&e<=65279,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519,"CJK Unified Ideographs Extension B":e=>e>=131072&&e<=173791};function va(e){for(const t of e)if(wa(t.charCodeAt(0)))return!0;return!1}function xa(e){for(const t of e)if(!ba(t.charCodeAt(0)))return!1;return!0}function ba(e){return!(ya.Arabic(e)||ya["Arabic Supplement"](e)||ya["Arabic Extended-A"](e)||ya["Arabic Presentation Forms-A"](e)||ya["Arabic Presentation Forms-B"](e))}function wa(e){return!(746!==e&&747!==e&&(e<4352||!(ya["Bopomofo Extended"](e)||ya.Bopomofo(e)||ya["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||ya["CJK Compatibility Ideographs"](e)||ya["CJK Compatibility"](e)||ya["CJK Radicals Supplement"](e)||ya["CJK Strokes"](e)||!(!ya["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||ya["CJK Unified Ideographs Extension A"](e)||ya["CJK Unified Ideographs"](e)||ya["Enclosed CJK Letters and Months"](e)||ya["Hangul Compatibility Jamo"](e)||ya["Hangul Jamo Extended-A"](e)||ya["Hangul Jamo Extended-B"](e)||ya["Hangul Jamo"](e)||ya["Hangul Syllables"](e)||ya.Hiragana(e)||ya["Ideographic Description Characters"](e)||ya.Kanbun(e)||ya["Kangxi Radicals"](e)||ya["Katakana Phonetic Extensions"](e)||ya.Katakana(e)&&12540!==e||!(!ya["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!ya["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||ya["Unified Canadian Aboriginal Syllabics"](e)||ya["Unified Canadian Aboriginal Syllabics Extended"](e)||ya["Vertical Forms"](e)||ya["Yijing Hexagram Symbols"](e)||ya["Yi Syllables"](e)||ya["Yi Radicals"](e))))}function Ca(e){return!(wa(e)||function(e){return!!(ya["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||ya["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||ya["Letterlike Symbols"](e)||ya["Number Forms"](e)||ya["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||ya["Control Pictures"](e)&&9251!==e||ya["Optical Character Recognition"](e)||ya["Enclosed Alphanumerics"](e)||ya["Geometric Shapes"](e)||ya["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||ya["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ya["CJK Symbols and Punctuation"](e)||ya.Katakana(e)||ya["Private Use Area"](e)||ya["CJK Compatibility Forms"](e)||ya["Small Form Variants"](e)||ya["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function Ea(e){return e>=1424&&e<=2303||ya["Arabic Presentation Forms-A"](e)||ya["Arabic Presentation Forms-B"](e)}function Ta(e,t){return!(!t&&Ea(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||ya.Khmer(e))}function Sa(e){for(const t of e)if(Ea(t.charCodeAt(0)))return!0;return!1}const Ma="deferred",Ia="loading",Pa="loaded";let La=null,Oa="unavailable",Da=null;const ka=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(Oa="error"),La&&La(e)};function za(){Ba.fire(new kn("pluginStateChange",{pluginStatus:Oa,pluginURL:Da}))}const Ba=new Bn,Ra=function(){return Oa},Fa=function(){if(Oa!==Ma||!Da)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Oa=Ia,za(),Da&&Jr({url:Da},(e=>{e?ka(e):(Oa=Pa,za())}))},ja={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Oa===Pa||null!=ja.applyArabicShaping,isLoading:()=>Oa===Ia,setState(e){Oa=e.pluginStatus,Da=e.pluginURL},isParsed:()=>null!=ja.applyArabicShaping&&null!=ja.processBidirectionalText&&null!=ja.processStyledBidirectionalText,getPluginURL:()=>Da};class Na{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch,this.brightness=t.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(e,t){for(const r of e)if(!Ta(r.charCodeAt(0),t))return!1;return!0}(e,ja.isLoaded())}}class Va{constructor(e,t,r,n){this.property=e,this.value=t,this.expression=function(e,t,r,n){if(qs(e))return new aa(e,t);if(ra(e)||Array.isArray(e)&&e.length>0){const i=sa(e,t,r,n);if("error"===i.result)throw new Error(i.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return i.value}{let r=e;return"string"==typeof e&&"color"===t.type&&(r=Un.parse(e)),{kind:"constant",isConfigDependent:!1,evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification,r,n)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class Ua{constructor(e,t,r){this.property=e,this.value=new Va(e,void 0,t,r)}transitioned(e,t){return new Ga(this.property,this.value,t,Jt({},e.transition,this.transition),e.now)}untransitioned(){return new Ga(this.property,this.value,null,{},0)}}class Ha{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=t,this._options=r,this.isConfigDependent=!1}getValue(e){return cr(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ua(this._values[e].property,this._scope,this._options)),this._values[e].value=new Va(this._values[e].property,null===t?void 0:cr(t),this._scope,this._options),this.isConfigDependent=this.isConfigDependent||this._values[e].value.expression.isConfigDependent}setTransitionOrValue(e,t){t&&(this._options=t);const r=this._properties.properties;if(e)for(const t in e){const n=e[t];if(sr(t,"-transition")){const e=t.slice(0,-11);r[e]&&this.setTransition(e,n)}else r[t]&&this.setValue(t,n)}}getTransition(e){return cr(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ua(this._values[e].property)),this._values[e].transition=cr(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r);const n=this.getTransition(t);void 0!==n&&(e[`${t}-transition`]=n)}return e}transitioned(e,t){const r=new Za(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(e,t._values[n]);return r}untransitioned(){const e=new Za(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Ga{constructor(e,t,r,n,i){const o=n.delay||0,s=n.duration||0;i=i||0,this.property=e,this.value=t,this.begin=i+o,this.end=this.begin+s,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){const n=e.now||0,i=this.value.possiblyEvaluate(e,t,r),o=this.prior;if(o){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return o.possiblyEvaluate(e,t,r);{const s=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,r),i,Wt(s))}}return i}}class Za{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){const n=new Qa(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Wa{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=t,this._options=r,this.isConfigDependent=!1}getValue(e){return cr(this._values[e].value)}setValue(e,t){this._values[e]=new Va(this._values[e].property,null===t?void 0:cr(t),this._scope,this._options),this.isConfigDependent=this.isConfigDependent||this._values[e].expression.isConfigDependent}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){const n=new Qa(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}}class qa{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n)}}class Qa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Xa{constructor(e){this.specification=e}possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,r){const n=Zn[this.specification.type];return n?n(e,t,r):e}}class Ya{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,n){return new qa(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)}:e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new qa(this,{kind:"constant",value:void 0},e.parameters);const n=Zn[this.specification.type];return n?new qa(this,{kind:"constant",value:n(e.value.value,t.value.value,r)},e.parameters):e}evaluate(e,t,r,n,i,o){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,o)}}class $a{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)}interpolate(){return!1}}class Ka{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new Na(0,{});for(const r in e){const n=e[r];n.specification.overridable&&this.overridableProperties.push(r);const i=this.defaultPropertyValues[r]=new Va(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new Ua(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate(t)}}}function Ja(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function el(e){if(Array.isArray(e))return e.map(el);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=el(e[r]);return t}return Ja(e)}fa(Ya,"DataDrivenProperty"),fa(Xa,"DataConstantProperty"),fa($a,"ColorRampProperty");var tl=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"required":false,"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"camera":{"type":"camera"},"imports":{"type":"array","value":"import"},"schema":{"type":"schema"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"},"models":{"type":"models"}},"model":{"type":"string","required":true},"import":{"id":{"type":"string","required":true},"url":{"type":"string","required":true},"config":{"type":"config"},"data":{"type":"$root"}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","required":true},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"id":{"type":"string","required":true},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"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},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false,"expression":{},"property-type":"data-constant"},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"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}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"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}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":1}},"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":1,"tms":1},"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":1}},"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},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":1}},"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},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"required":true,"type":"enum","values":{"raster-array":1}},"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},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"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"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":1}},"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":1}},"url":{"required":false,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"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_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"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":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"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","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"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","measure-light"],"relaxZoomRestriction":true},"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","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"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":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"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}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"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","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"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,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"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},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"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","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","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],"property-type":"constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"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","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"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"],"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,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"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-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"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":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"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","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"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"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","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"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"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 rl(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!rl(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function nl(e,t="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};rl(e)||(e=ul(e));const r=e;let n=!0;try{n=function(e){if(!sl(e))return e;let t=el(e);return ol(t),t=il(t),t}(r)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}const i=tl[`filter_${t}`],o=na(n,i);let s=null;if("error"===o.result)throw new Error(o.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s=(e,t,r)=>o.value.evaluate(e,t,{},r);let a=null,l=null;if(n!==r){const e=na(r,i);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a=(t,r,n,i,o)=>e.value.evaluate(t,r,{},n,void 0,void 0,i,o),l=!jo(e.value.expression)}return{filter:s,dynamicFilter:a||void 0,needGeometry:cl(n),needFeature:!!l}}function il(e){if(!Array.isArray(e))return e;const t=function(e){if(al.has(e[0]))for(let t=1;t<e.length;t++)if(sl(e[t]))return!0;return e}(e);return!0===t?t:t.map((e=>il(e)))}function ol(e){let t=!1;const r=[];if("case"===e[0]){for(let n=1;n<e.length-1;n+=2)t=t||sl(e[n]),r.push(e[n+1]);r.push(e[e.length-1])}else if("match"===e[0]){t=t||sl(e[1]);for(let t=2;t<e.length-1;t+=2)r.push(e[t+1]);r.push(e[e.length-1])}else if("step"===e[0]){t=t||sl(e[1]);for(let t=1;t<e.length-1;t+=2)r.push(e[t+1])}t&&(e.length=0,e.push("any",...r));for(let t=1;t<e.length;t++)ol(e[t])}function sl(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(sl(e[t]))return!0;return!1}const al=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function ll(e,t){return e<t?-1:e>t?1:0}function cl(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(cl(e[t]))return!0;return!1}function ul(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?hl(e[1],e[2],"=="):"!="===t?fl(hl(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?hl(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(ul))):"all"===t?["all"].concat(e.slice(1).map(ul)):"none"===t?["all"].concat(e.slice(1).map(ul).map(fl)):"in"===t?dl(e[1],e.slice(2)):"!in"===t?fl(dl(e[1],e.slice(2))):"has"===t?pl(e[1]):"!has"!==t||fl(pl(e[1]));var r}function hl(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function dl(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(ll)]]:["filter-in-small",e,["literal",t]]}}function pl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function fl(e){return["!",e]}const ml="";function gl(e,t){return t?`${e}${ml}${t}`:e}const Al="-transition",_l=new Set(["fill","line","background","hillshade","raster"]);class yl extends Bn{constructor(e,t,r,n){if(super(),this.id=e.id,this.fqid=gl(this.id,r),this.type=e.type,this.scope=r,this.options=n,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.isConfigDependent=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),e.slot&&(this.slot=e.slot),t.layout&&(this._unevaluatedLayout=new Wa(t.layout,this.scope,n),this.isConfigDependent=this.isConfigDependent||this._unevaluatedLayout.isConfigDependent),t.paint)){this._transitionablePaint=new Ha(t.paint,this.scope,n);for(const t in e.paint)this.setPaintProperty(t,e.paint[t]);for(const t in e.layout)this.setLayoutProperty(t,e.layout[t]);this.isConfigDependent=this.isConfigDependent||this._transitionablePaint.isConfigDependent,this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Qa(t.paint)}}onAdd(e){}onRemove(e){}isDraped(e){return _l.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){if("custom"===this.type&&"visibility"===e)return void(this.visibility=t);const r=this._unevaluatedLayout;r._properties.properties[e]&&(r.setValue(e,t),this.isConfigDependent=this.isConfigDependent||r.isConfigDependent,"visibility"===e&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0})}getPaintProperty(e){return sr(e,Al)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){const r=this._transitionablePaint,n=r._properties.properties;if(sr(e,Al)){const i=e.slice(0,-11);return n[i]&&r.setTransition(i,t||void 0),!1}if(!n[e])return!1;const i=r._values[e],o=i.value.isDataDriven(),s=i.value;r.setValue(e,t),this.isConfigDependent=this.isConfigDependent||r.isConfigDependent,this._handleSpecialPaintPropertyUpdate(e);const a=r._values[e].value,l=a.isDataDriven(),c=sr(e,"pattern")||"line-dasharray"===e;return l||o||c||this._handleOverridablePaintPropertyUpdate(e,s,a)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,t){return null}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){return lr({id:this.id,type:this.type,slot:this.slot,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()},((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof qa&&Hs(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=nl(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,t,r,n,i,o,s,a,l){}queryIntersectsMatchingFeature(e,t,r,n){}}const vl={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class xl{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class bl{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.add(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() 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 wl(e,t=1){let r=0,n=0;return{members:e.map((e=>{const i=vl[e.type].BYTES_PER_ELEMENT,o=r=Cl(r,Math.max(t,i)),s=e.components||1;return n=Math.max(n,i),r+=i*s,{name:e.name,type:e.type,components:s,offset:o}})),size:Cl(r,Math.max(n,t)),alignment:t}}function Cl(e,t){return Math.ceil(e/t)*t}class El extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e}}El.prototype.bytesPerElement=4,fa(El,"StructArrayLayout2i4");class Tl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e}}Tl.prototype.bytesPerElement=6,fa(Tl,"StructArrayLayout3i6");class Sl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,e}}Sl.prototype.bytesPerElement=8,fa(Sl,"StructArrayLayout4i8");class Ml extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const s=5*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,e}}Ml.prototype.bytesPerElement=10,fa(Ml,"StructArrayLayout5i10");class Il extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o,s)}emplace(e,t,r,n,i,o,s,a){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.uint8[c+4]=n,this.uint8[c+5]=i,this.uint8[c+6]=o,this.uint8[c+7]=s,this.float32[u+2]=a,e}}Il.prototype.bytesPerElement=12,fa(Il,"StructArrayLayout2i4ub1f12");class Pl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,e}}Pl.prototype.bytesPerElement=16,fa(Pl,"StructArrayLayout4f16");class Ll extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e}}Ll.prototype.bytesPerElement=8,fa(Ll,"StructArrayLayout2f8");class Ol extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const s=6*e,a=3*e;return this.uint16[s+0]=t,this.uint16[s+1]=r,this.uint16[s+2]=n,this.uint16[s+3]=i,this.float32[a+2]=o,e}}Ol.prototype.bytesPerElement=12,fa(Ol,"StructArrayLayout4ui1f12");class Dl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=r,this.uint16[o+2]=n,this.uint16[o+3]=i,e}}Dl.prototype.bytesPerElement=8,fa(Dl,"StructArrayLayout4ui8");class kl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,o)}emplace(e,t,r,n,i,o,s){const a=6*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,this.int16[a+4]=o,this.int16[a+5]=s,e}}kl.prototype.bytesPerElement=12,fa(kl,"StructArrayLayout6i12");class zl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s,a,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,r,n,i,o,s,a,l,c,u,h)}emplace(e,t,r,n,i,o,s,a,l,c,u,h,d){const p=12*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=o,this.uint16[p+5]=s,this.uint16[p+6]=a,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=d,e}}zl.prototype.bytesPerElement=24,fa(zl,"StructArrayLayout4i4ui4i24");class Bl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,o)}emplace(e,t,r,n,i,o,s){const a=10*e,l=5*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.float32[l+2]=i,this.float32[l+3]=o,this.float32[l+4]=s,e}}Bl.prototype.bytesPerElement=20,fa(Bl,"StructArrayLayout3i3f20");class Rl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}Rl.prototype.bytesPerElement=4,fa(Rl,"StructArrayLayout1ul4");class Fl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e}}Fl.prototype.bytesPerElement=4,fa(Fl,"StructArrayLayout2ui4");class jl extends bl{_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(e,t,r,n,i,o,s,a,l,c,u,h,d){const p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,n,i,o,s,a,l,c,u,h,d)}emplace(e,t,r,n,i,o,s,a,l,c,u,h,d,p){const f=20*e,m=10*e;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.int16[f+4]=o,this.float32[m+3]=s,this.float32[m+4]=a,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[f+14]=u,this.uint32[m+8]=h,this.uint16[f+18]=d,this.uint16[f+19]=p,e}}jl.prototype.bytesPerElement=40,fa(jl,"StructArrayLayout5i4f1i1ul2ui40");class Nl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o,s)}emplace(e,t,r,n,i,o,s,a){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+4]=i,this.int16[l+5]=o,this.int16[l+6]=s,this.int16[l+7]=a,e}}Nl.prototype.bytesPerElement=16,fa(Nl,"StructArrayLayout3i2i2i16");class Vl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const s=4*e,a=8*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=n,this.int16[a+6]=i,this.int16[a+7]=o,e}}Vl.prototype.bytesPerElement=16,fa(Vl,"StructArrayLayout2f1f2i16");class Ul extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=12*e,s=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[s+1]=n,this.float32[s+2]=i,e}}Ul.prototype.bytesPerElement=12,fa(Ul,"StructArrayLayout2ub2f12");class Hl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e}}Hl.prototype.bytesPerElement=6,fa(Hl,"StructArrayLayout3ui6");class Gl extends bl{_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(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v){const x=this.length;return this.resize(x+1),this.emplace(x,e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v)}emplace(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x){const b=30*e,w=15*e,C=60*e;return this.int16[b+0]=t,this.int16[b+1]=r,this.int16[b+2]=n,this.float32[w+2]=i,this.float32[w+3]=o,this.uint16[b+8]=s,this.uint16[b+9]=a,this.uint32[w+5]=l,this.uint32[w+6]=c,this.uint32[w+7]=u,this.uint16[b+16]=h,this.uint16[b+17]=d,this.uint16[b+18]=p,this.float32[w+10]=f,this.float32[w+11]=m,this.uint8[C+48]=g,this.uint8[C+49]=A,this.uint8[C+50]=_,this.uint32[w+13]=y,this.int16[b+28]=v,this.uint8[C+58]=x,e}}Gl.prototype.bytesPerElement=60,fa(Gl,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Zl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x,b,w,C,E,T,S,M,I,P,L){const O=this.length;return this.resize(O+1),this.emplace(O,e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x,b,w,C,E,T,S,M,I,P,L)}emplace(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x,b,w,C,E,T,S,M,I,P,L,O){const D=20*e,k=40*e,z=80*e;return this.float32[D+0]=t,this.float32[D+1]=r,this.int16[k+4]=n,this.int16[k+5]=i,this.int16[k+6]=o,this.int16[k+7]=s,this.int16[k+8]=a,this.int16[k+9]=l,this.int16[k+10]=c,this.int16[k+11]=u,this.int16[k+12]=h,this.uint16[k+13]=d,this.uint16[k+14]=p,this.uint16[k+15]=f,this.uint16[k+16]=m,this.uint16[k+17]=g,this.uint16[k+18]=A,this.uint16[k+19]=_,this.uint16[k+20]=y,this.uint16[k+21]=v,this.uint16[k+22]=x,this.uint16[k+23]=b,this.uint16[k+24]=w,this.uint16[k+25]=C,this.uint16[k+26]=E,this.uint16[k+27]=T,this.uint32[D+14]=S,this.float32[D+15]=M,this.float32[D+16]=I,this.float32[D+17]=P,this.float32[D+18]=L,this.uint8[z+76]=O,e}}Zl.prototype.bytesPerElement=80,fa(Zl,"StructArrayLayout2f9i15ui1ul4f1ub80");class Wl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}Wl.prototype.bytesPerElement=4,fa(Wl,"StructArrayLayout1f4");class ql extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const s=5*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=n,this.float32[s+3]=i,this.float32[s+4]=o,e}}ql.prototype.bytesPerElement=20,fa(ql,"StructArrayLayout5f20");class Ql extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o,s)}emplace(e,t,r,n,i,o,s,a){const l=7*e;return this.float32[l+0]=t,this.float32[l+1]=r,this.float32[l+2]=n,this.float32[l+3]=i,this.float32[l+4]=o,this.float32[l+5]=s,this.float32[l+6]=a,e}}Ql.prototype.bytesPerElement=28,fa(Ql,"StructArrayLayout7f28");class Xl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=r,this.uint16[o+3]=n,this.uint16[o+4]=i,e}}Xl.prototype.bytesPerElement=12,fa(Xl,"StructArrayLayout1ul3ui12");class Yl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}Yl.prototype.bytesPerElement=2,fa(Yl,"StructArrayLayout1ui2");class $l extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}$l.prototype.bytesPerElement=12,fa($l,"StructArrayLayout3f12");class Kl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m)}emplace(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g){const A=16*e;return this.float32[A+0]=t,this.float32[A+1]=r,this.float32[A+2]=n,this.float32[A+3]=i,this.float32[A+4]=o,this.float32[A+5]=s,this.float32[A+6]=a,this.float32[A+7]=l,this.float32[A+8]=c,this.float32[A+9]=u,this.float32[A+10]=h,this.float32[A+11]=d,this.float32[A+12]=p,this.float32[A+13]=f,this.float32[A+14]=m,this.float32[A+15]=g,e}}Kl.prototype.bytesPerElement=64,fa(Kl,"StructArrayLayout16f64");class Jl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o,s)}emplace(e,t,r,n,i,o,s,a){const l=10*e,c=5*e;return this.uint16[l+0]=t,this.uint16[l+1]=r,this.uint16[l+2]=n,this.uint16[l+3]=i,this.float32[c+2]=o,this.float32[c+3]=s,this.float32[c+4]=a,e}}Jl.prototype.bytesPerElement=20,fa(Jl,"StructArrayLayout4ui3f20");class ec extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.int16[1*e+0]=t,e}}ec.prototype.bytesPerElement=2,fa(ec,"StructArrayLayout1i2");class tc extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint8[1*e+0]=t,e}}tc.prototype.bytesPerElement=1,fa(tc,"StructArrayLayout1ub1");class rc extends xl{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]}}rc.prototype.size=40;class nc extends jl{get(e){return new rc(this,e)}}fa(nc,"CollisionBoxArray");class ic extends xl{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(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}ic.prototype.size=60;class oc extends Gl{get(e){return new ic(this,e)}}fa(oc,"PlacedSymbolArray");class sc extends xl{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}}sc.prototype.size=80;class ac extends Zl{get(e){return new sc(this,e)}}fa(ac,"SymbolInstanceArray");class lc extends Wl{getoffsetX(e){return this.float32[1*e+0]}}fa(lc,"GlyphOffsetArray");class cc extends El{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}fa(cc,"SymbolLineVertexArray");class uc extends xl{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]}}uc.prototype.size=12;class hc extends Xl{get(e){return new uc(this,e)}}fa(hc,"FeatureIndexArray");class dc extends Fl{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}fa(dc,"FillExtrusionCentroidArray");const pc=wl([{name:"a_pos",components:2,type:"Int16"}],4),fc=wl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class mc{constructor(e=[]){this.segments=e}_prepareSegment(e,t,r,n){let i=this.segments[this.segments.length-1];return e>mc.MAX_VERTEX_ARRAY_LENGTH&&hr(`Max vertices per segment is ${mc.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>mc.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t,primitiveOffset:r,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}prepareSegment(e,t,r,n){return this._prepareSegment(e,t.length,r.length,n)}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,r,n){return new mc([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function gc(e,t){return 256*(e=Xt(Math.floor(e),0,255))+Xt(Math.floor(t),0,255)}mc.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,fa(mc,"SegmentVector");const Ac=wl([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),_c=wl([{name:"a_dash",components:4,type:"Uint16"}]);class yc{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,t,r,n){this.ids.push(vc(e)),this.positions.push(t,r,n)}eachPosition(e,t){const r=vc(e);let n=0,i=this.ids.length-1;for(;n<i;){const e=n+i>>1;this.ids[e]>=r?i=e:n=e+1}for(;this.ids[n]===r;)t(this.positions[3*n],this.positions[3*n+1],this.positions[3*n+2]),n++}static serialize(e,t){const r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return xc(r,n,0,r.length-1),t&&(t.add(r.buffer),t.add(n.buffer)),{ids:r,positions:n}}static deserialize(e){const t=new yc;let r;t.ids=e.ids,t.positions=e.positions;for(const e of t.ids)e!==r&&t.uniqueIds.push(e),r=e;return t.indexed=!0,t}}function vc(e){const t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:Ln(String(e))}function xc(e,t,r,n){for(;r<n;){const i=e[r+n>>1];let o=r-1,s=n+1;for(;;){do{o++}while(e[o]<i);do{s--}while(e[s]>i);if(o>=s)break;bc(e,o,s),bc(t,3*o,3*s),bc(t,3*o+1,3*s+1),bc(t,3*o+2,3*s+2)}s-r<n-s?(xc(e,t,r,s),r=s+1):(xc(e,t,s+1,n),n=s)}}function bc(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}fa(yc,"FeaturePositionMap");class wc{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}set(e,t,r){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class Cc extends wc{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}}class Ec extends wc{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))}}class Tc extends wc{constructor(e){super(e),this.current=[0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1])))}}class Sc extends wc{constructor(e){super(e),this.current=[0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2])))}}class Mc extends wc{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3])))}}class Ic extends wc{constructor(e){super(e),this.current=Un.transparent}set(e,t,r){this.fetchUniformLocation(e,t)&&(r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a)))}}const Pc=new Float32Array(16);class Lc extends wc{constructor(e){super(e),this.current=Pc}set(e,t,r){if(this.fetchUniformLocation(e,t)){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let e=1;e<16;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}}}const Oc=new Float32Array(9),Dc=new Float32Array(4);class kc extends wc{constructor(e){super(e),this.current=Dc}set(e,t,r){if(this.fetchUniformLocation(e,t))for(let e=0;e<4;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix2fv(this.location,!1,r);break}}}function zc(e){return[gc(255*e.r,255*e.g),gc(255*e.b,255*e.a)]}class Bc{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r}setUniform(e,t,r,n,i){t.set(e,i,n.constantOr(this.value))}getBinding(e,t){return"color"===this.type?new Ic(e):new Ec(e)}}class Rc{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,t,r,n,i){const o="u_pattern"===i||"u_dash"===i?this.pattern:"u_pixel_ratio"===i?this.pixelRatio:null;o&&t.set(e,i,o)}getBinding(e,t){return"u_pattern"===t||"u_dash"===t?new Mc(e):new Ec(e)}}class Fc{constructor(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(e,t,r,n,i,o,s){const a=this.paintVertexArray.length,l=this.expression.evaluate(new Na(0,{brightness:o}),t,{},i,n,s);this.paintVertexArray.resize(e),this._setPaintValue(a,e,l)}updatePaintArray(e,t,r,n,i,o,s){const a=this.expression.evaluate({zoom:0,brightness:s},r,n,void 0,i);this._setPaintValue(e,t,a)}_setPaintValue(e,t,r){if("color"===this.type){const n=zc(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class jc{constructor(e,t,r,n,i,o){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,r,n,i,o,s){const a=this.expression.evaluate(new Na(this.zoom,{brightness:o}),t,{},i,n,s),l=this.expression.evaluate(new Na(this.zoom+1,{brightness:o}),t,{},i,n,s),c=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(c,e,a,l)}updatePaintArray(e,t,r,n,i,o,s){const a=this.expression.evaluate({zoom:this.zoom,brightness:s},r,n,void 0,i),l=this.expression.evaluate({zoom:this.zoom+1,brightness:s},r,n,void 0,i);this._setPaintValue(e,t,a,l)}_setPaintValue(e,t,r,n){if("color"===this.type){const i=zc(r),o=zc(n);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1],o[0],o[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,r,n,i){const o=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,s=Xt(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);t.set(e,i,s)}getBinding(e,t){return new Ec(e)}}class Nc{constructor(e,t,r,n,i){this.expression=e,this.layerId=i,this.paintVertexAttributes=("array"===r?_c:Ac).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new n}populatePaintArray(e,t,r){const n=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(n,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,n,i,o,s){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],o)}_setPaintValues(e,t,r,n){if(!n||!r)return;const i=n[r];if(!i)return;const{tl:o,br:s,pixelRatio:a}=i;for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,o[0],o[1],s[0],s[1],a)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Vc{constructor(e,t,r=(()=>!0)){this.binders={},this._buffers=[];const n=[];for(const i in e.paint._values){const o=e.paint.get(i);if(!r(i))continue;if(!(o instanceof qa&&Hs(o.property.specification)))continue;const s=Gc(i,e.type),a=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,u="line-dasharray"===i||i.endsWith("pattern"),h="line-dasharray"===i&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==a.kind||h)if("source"===a.kind||h||u){const t=qc(i,l,"source");this.binders[i]=u?new Nc(a,s,l,t,e.id):new Fc(a,s,l,t),n.push(`/a_${i}`)}else{const e=qc(i,l,"composite");this.binders[i]=new jc(a,s,l,c,t,e),n.push(`/z_${i}`)}else this.binders[i]=u?new Rc(a.value,s):new Bc(a.value,s,l),n.push(`/u_${i}`)}this.cacheKey=n.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof Fc||t instanceof jc?t.maxValue:0}populatePaintArrays(e,t,r,n,i,o,s){for(const a in this.binders){const l=this.binders[a];(l instanceof Fc||l instanceof jc||l instanceof Nc)&&l.populatePaintArray(e,t,r,n,i,o,s)}}setConstantPatternPositions(e){for(const t in this.binders){const r=this.binders[t];r instanceof Rc&&r.setConstantPatternPositions(e)}}updatePaintArrays(e,t,r,n,i,o,s,a){let l=!1;const c=Object.keys(e),u=0!==c.length,h=u?c:t.uniqueIds;for(const c in this.binders){const d=this.binders[c];if((d instanceof Fc||d instanceof jc||d instanceof Nc)&&(!0===d.expression.isStateDependent||!1===d.expression.isLightConstant)){const p=i.paint.get(c);d.expression=p.value;for(const r of h){const i=e[r.toString()];t.eachPosition(r,((e,t,r)=>{const l=n.feature(e);d.updatePaintArray(t,r,l,i,o,s,a)}))}if(!u)for(const t of r.uniqueIds){const i=e[t.toString()];r.eachPosition(t,((e,t,r)=>{const l=n.feature(e);d.updatePaintArray(t,r,l,i,o,s,a)}))}l=!0}}return l}defines(){const e=[];for(const t in this.binders){const r=this.binders[t];(r instanceof Bc||r instanceof Rc)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Fc||r instanceof jc||r instanceof Nc)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Bc||r instanceof Rc||r instanceof jc)for(const t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const r in this.binders){const n=this.binders[r];if(n instanceof Bc||n instanceof Rc||n instanceof jc)for(const i of n.uniformNames)t.push({name:i,property:r,binding:n.getBinding(e,i)})}return t}setUniforms(e,t,r,n,i){for(const{name:t,property:o,binding:s}of r)this.binders[o].setUniform(e,s,i,n.get(o),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof Fc||t instanceof jc||t instanceof Nc)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer)}}upload(e){for(const t in this.binders){const r=this.binders[t];(r instanceof Fc||r instanceof jc||r instanceof Nc)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof Fc||t instanceof jc||t instanceof Nc)&&t.destroy()}}}class Uc{constructor(e,t,r=(()=>!0)){this.programConfigurations={};for(const n of e)this.programConfigurations[n.id]=new Vc(n,t,r);this.needsUpload=!1,this._featureMap=new yc,this._featureMapWithoutIds=new yc,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,t,r,n,i,o,s,a){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,n,i,o,s,a);void 0!==t.id?this._featureMap.add(t.id,r,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,r,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,n,i,o){for(const s of r)this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,t,s,n,i,o||0)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Hc={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"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 Gc(e,t){return Hc[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const Zc={"line-pattern":{source:Ol,composite:Ol},"fill-pattern":{source:Ol,composite:Ol},"fill-extrusion-pattern":{source:Ol,composite:Ol},"line-dasharray":{source:Dl,composite:Dl}},Wc={color:{source:Ll,composite:Pl},number:{source:Wl,composite:Ll}};function qc(e,t,r){const n=Zc[e];return n&&n[r]||Wc[t][r]}fa(Bc,"ConstantBinder"),fa(Rc,"PatternConstantBinder"),fa(Fc,"SourceExpressionBinder"),fa(Nc,"PatternCompositeBinder"),fa(jc,"CompositeExpressionBinder"),fa(Vc,"ProgramConfiguration",{omit:["_buffers"]}),fa(Uc,"ProgramConfigurationSet");const Qc=io/Math.PI/2,Xc=5,Yc=6,$c=16383,Kc=64,Jc=[Kc,32,16],eu=-Qc,tu=Qc;function ru(e,t,r,n=Qc){return r=Ht(r),[e*Math.sin(r)*n,-t*n,e*Math.cos(r)*n]}function nu(e,t,r){return ru(Math.cos(Ht(e)),Math.sin(Ht(e)),t,r)}const iu=6371008.8,ou=2*Math.PI*iu;class su{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new su($t(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return iu*Math.acos(Math.min(i,1))}toBounds(e=0){const t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new au({lng:this.lng-r,lat:this.lat-t},{lng:this.lng+r,lat:this.lat+t})}toEcef(e){return nu(this.lat,this.lng,Qc+e*Qc/iu)}static convert(e){if(e instanceof su)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new su(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new su(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class au{constructor(e,t){if(e)if(t)this.setSouthWest(e).setNorthEast(t);else if(4===e.length){const t=e;this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]])}else{const t=e;this.setSouthWest(t[0]).setNorthEast(t[1])}}setNorthEast(e){return this._ne=e instanceof su?new su(e.lng,e.lat):su.convert(e),this}setSouthWest(e){return this._sw=e instanceof su?new su(e.lng,e.lat):su.convert(e),this}extend(e){const t=this._sw,r=this._ne;let n,i;if(e instanceof su)n=e,i=e;else{if(!(e instanceof au))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(au.convert(e)):this.extend(su.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(su.convert(e)):this;if(n=e._sw,i=e._ne,!n||!i)return this}return t||r?(t.lng=Math.min(n.lng,t.lng),t.lat=Math.min(n.lat,t.lat),r.lng=Math.max(i.lng,r.lng),r.lat=Math.max(i.lat,r.lat)):(this._sw=new su(n.lng,n.lat),this._ne=new su(i.lng,i.lat)),this}getCenter(){return new su((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 su(this.getWest(),this.getNorth())}getSouthEast(){return new su(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(e){const{lng:t,lat:r}=su.convert(e);let n=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n}static convert(e){return!e||e instanceof au?e:new au(e)}}var lu={};!function(e,t){!function(e){function t(e,t,n){var i=r(256*e,256*(t=Math.pow(2,n)-t-1),n),o=r(256*(e+1),256*(t+1),n);return i[0]+","+i[1]+","+o[0]+","+o[1]}function r(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}e.getURL=function(e,r,n,i,o,s){return s=s||{},e+"?"+["bbox="+t(n,i,o),"format="+(s.format||"image/png"),"service="+(s.service||"WMS"),"version="+(s.version||"1.1.1"),"request="+(s.request||"GetMap"),"srs="+(s.srs||"EPSG:3857"),"width="+(s.width||256),"height="+(s.height||256),"layers="+r].join("&")},e.getTileBBox=t,e.getMercCoords=r,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,lu);var cu=lu;class uu{constructor(e,t,r){this.z=e,this.x=t,this.y=r,this.key=pu(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t){const r=cu.getTileBBox(this.x,this.y,this.z),n=function(e,t,r){let n,i="";for(let o=e;o>0;o--)n=1<<o-1,i+=(t&n?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)}toString(){return`${this.z}/${this.x}/${this.y}`}}class hu{constructor(e,t){this.wrap=e,this.canonical=t,this.key=pu(e,t.z,t.z,t.x,t.y)}}class du{constructor(e,t,r,n,i){this.overscaledZ=e,this.wrap=t,this.canonical=new uu(r,+n,+i),this.key=0===t&&e===r?this.canonical.key:pu(t,e,r,n,i)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new du(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new du(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return pu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const r=this.canonical.z-e;return pu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new du(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new du(t,this.wrap,t,r,n),new du(t,this.wrap,t,r+1,n),new du(t,this.wrap,t,r,n+1),new du(t,this.wrap,t,r+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new du(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new du(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new hu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function pu(e,t,r,n,i){const o=1<<Math.min(r,22);let s=o*(i%o)+n%o;return e&&r<22&&(s+=o*o*((e<0?-2*e-1:2*e)%(1<<2*(22-r)))),16*(32*s+r)+(t-r)}const fu=[e=>{let t=e.canonical.x-1,r=e.wrap;return t<0&&(t=(1<<e.canonical.z)-1,r--),new du(e.overscaledZ,r,e.canonical.z,t,e.canonical.y)},e=>{let t=e.canonical.x+1,r=e.wrap;return t===1<<e.canonical.z&&(t=0,r++),new du(e.overscaledZ,r,e.canonical.z,t,e.canonical.y)},e=>new du(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new du(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)];fa(uu,"CanonicalTileID"),fa(du,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const mu=0,gu=25.5;function Au(e){return ou*Math.cos(e*Math.PI/180)}function _u(e){return(180+e)/360}function yu(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function vu(e,t){return e/Au(t)}function xu(e){return 360*e-180}function bu(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function wu(e,t){return e*Au(bu(t))}const Cu=85.051129;function Eu(e){return Math.cos(Ht(Xt(e,-Cu,Cu)))}function Tu(e,t){const r=Xt(t,mu,gu),n=Math.pow(2,r);return Eu(e)*ou/(512*n)}function Su(e){return 1/Math.cos(e*Math.PI/180)}function Mu(e,t=0){const r=Math.exp(Math.PI*(1-(e.y+t/io)/(1<<e.z)*2));return 80150034*r/(r*r+1)/io/(1<<e.z)}class Iu{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e,t=0){const r=su.convert(e);return new Iu(_u(r.lng),yu(r.lat),vu(t,r.lat))}toLngLat(){return new su(xu(this.x),bu(this.y))}toAltitude(){return wu(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/ou*Su(bu(this.y))}}function Pu(e,t,r,n,i,o,s,a,l){const c=(t+n)/2,u=(r+i)/2,h=new Nt(c,u);a(h),function(e,t,r,n,i,o){const s=r-i,a=n-o;return Math.abs((n-t)*s-(r-e)*a)/Math.hypot(s,a)}(h.x,h.y,o.x,o.y,s.x,s.y)>=l?(Pu(e,t,r,c,u,o,h,a,l),Pu(e,c,u,n,i,h,s,a,l)):e.push(s)}function Lu(e,t,r){let n=e[0],i=n.x,o=n.y;t(n);const s=[n];for(let a=1;a<e.length;a++){const l=e[a],{x:c,y:u}=l;t(l),Pu(s,i,o,c,u,n,l,t,r),i=c,o=u,n=l}return s}function Ou(e,t,r,n){if(n(t,r)){const i=t.add(r)._mult(.5);Ou(e,t,i,n),Ou(e,i,r,n)}else e.push(r)}function Du(e,t){let r=e[0];const n=[r];for(let i=1;i<e.length;i++){const o=e[i];Ou(n,r,o,t),r=o}return n}const ku=Math.pow(2,14)-1,zu=-ku-1;function Bu(e,t){const r=Math.round(e.x*t),n=Math.round(e.y*t);return e.x=Xt(r,zu,ku),e.y=Xt(n,zu,ku),(r<e.x||r>e.x+1||n<e.y||n>e.y+1)&&hr("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function Ru(e,t,r){const n=e.loadGeometry(),i=e.extent,o=io/i;if(t&&r&&r.projection.isReprojectedInTileSpace){const o=1<<t.z,{scale:s,x:a,y:l,projection:c}=r,u=e=>{const r=xu((t.x+e.x/i)/o),n=bu((t.y+e.y/i)/o),u=c.project(r,n);e.x=(u.x*s-a)*i,e.y=(u.y*s-l)*i};for(let t=0;t<n.length;t++)if(1!==e.type)n[t]=Lu(n[t],u,1);else{const e=[];for(const r of n[t])r.x<0||r.x>=i||r.y<0||r.y>=i||(u(r),e.push(r));n[t]=e}}for(const e of n)for(const t of e)Bu(t,o);return n}function Fu(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Ru(e):[]}}function ju(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}function Nu(e,t,r){const n=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*n,r[1]*n,r[2]*n)}class Vu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new El,this.indexArray=new Hl,this.segments=new mc,this.programConfigurations=new Uc(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r,n){const i=this.layers[0],o=[];let s=null;"circle"===i.type&&(s=i.layout.get("circle-sort-key"));for(const{feature:t,id:i,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Fu(t,e);if(!this.layers[0]._featureFilter.filter(new Na(this.zoom),c,r))continue;const u=s?s.evaluate(c,{},r):void 0,h={id:i,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Ru(t,r,n),patterns:{},sortKey:u};o.push(h)}s&&o.sort(((e,t)=>e.sortKey-t.sortKey));let a=null;"globe"===n.projection.name&&(this.globeExtVertexArray=new kl,a=n.projection);for(const n of o){const{geometry:i,index:o,sourceLayerIndex:s}=n,l=e[o].feature;this.addFeature(n,i,o,t.availableImages,r,a,t.brightness),t.featureIndex.insert(l,i,o,s,this.index)}}update(e,t,r,n,i){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,n,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,pc.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,fc.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,t,r,n,i,o,s){for(const r of t)for(const t of r){const r=t.x,n=t.y;if(r<0||r>=io||n<0||n>=io)continue;if(o){const e=o.projectTilePoint(r,n,i),t=o.upVector(i,r,n),s=this.globeExtVertexArray;Nu(s,e,t),Nu(s,e,t),Nu(s,e,t),Nu(s,e,t)}const s=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=s.vertexLength;ju(this.layoutVertexArray,r,n,-1,-1),ju(this.layoutVertexArray,r,n,1,-1),ju(this.layoutVertexArray,r,n,1,1),ju(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+2,a+3),s.vertexLength+=4,s.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n,i,s)}}function Uu(e,t){for(let r=0;r<e.length;r++)if($u(t,e[r]))return!0;for(let r=0;r<t.length;r++)if($u(e,t[r]))return!0;return!!Wu(e,t)}function Hu(e,t,r){return!!$u(e,t)||!!Qu(t,e,r)}function Gu(e,t){if(1===e.length)return Yu(t,e[0]);for(let r=0;r<t.length;r++){const n=t[r];for(let t=0;t<n.length;t++)if($u(e,n[t]))return!0}for(let r=0;r<e.length;r++)if(Yu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Wu(e,t[r]))return!0;return!1}function Zu(e,t,r){if(e.length>1){if(Wu(e,t))return!0;for(let n=0;n<t.length;n++)if(Qu(t[n],e,r))return!0}for(let n=0;n<e.length;n++)if(Qu(e[n],t,r))return!0;return!1}function Wu(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){const n=e[r],i=e[r+1];for(let e=0;e<t.length-1;e++)if(qu(n,i,t[e],t[e+1]))return!0}return!1}function qu(e,t,r,n){return dr(e,r,n)!==dr(t,r,n)&&dr(e,t,r)!==dr(e,t,n)}function Qu(e,t,r){const n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(let r=1;r<t.length;r++)if(Xu(e,t[r-1],t[r])<n)return!0;return!1}function Xu(e,t,r){const n=t.distSqr(r);if(0===n)return e.distSqr(t);const i=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return e.distSqr(i<0?t:i>1?r:r.sub(t)._mult(i)._add(t))}function Yu(e,t){let r,n,i,o=!1;for(let s=0;s<e.length;s++){r=e[s];for(let e=0,s=r.length-1;e<r.length;s=e++)n=r[e],i=r[s],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(o=!o)}return o}function $u(e,t){let r=!1;for(let n=0,i=e.length-1;n<e.length;i=n++){const o=e[n],s=e[i];o.y>t.y!=s.y>t.y&&t.x<(s.x-o.x)*(t.y-o.y)/(s.y-o.y)+o.x&&(r=!r)}return r}function Ku(e,t,r,n,i){for(const o of e)if(t<=o.x&&r<=o.y&&n>=o.x&&i>=o.y)return!0;const o=[new Nt(t,r),new Nt(t,i),new Nt(n,i),new Nt(n,r)];if(e.length>2)for(const t of o)if($u(e,t))return!0;for(let t=0;t<e.length-1;t++)if(Ju(e[t],e[t+1],o))return!0;return!1}function Ju(e,t,r){const n=r[0],i=r[2];if(e.x<n.x&&t.x<n.x||e.x>i.x&&t.x>i.x||e.y<n.y&&t.y<n.y||e.y>i.y&&t.y>i.y)return!1;const o=dr(e,t,r[0]);return o!==dr(e,t,r[1])||o!==dr(e,t,r[2])||o!==dr(e,t,r[3])}function eh(e,t,r,n,i,o){let s=t.y-e.y,a=e.x-t.x;if(o=o||0){const e=s*s+a*a;if(0===e)return!0;const t=Math.sqrt(e);s/=t,a/=t}return!((r.x-e.x)*s+(r.y-e.y)*a-o<0||(n.x-e.x)*s+(n.y-e.y)*a-o<0||(i.x-e.x)*s+(i.y-e.y)*a-o<0)}function th(e,t,r,n,i,o,s){return!(eh(e,t,n,i,o,s)||eh(t,r,n,i,o,s)||eh(r,e,n,i,o,s)||eh(n,i,e,t,r,s)||eh(i,o,e,t,r,s)||eh(o,n,e,t,r,s))}function rh(e,t,r){const n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function nh(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function ih(e,t,r,n,i){if(!t[0]&&!t[1])return e;const o=Nt.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);const s=[];for(let t=0;t<e.length;t++)s.push(e[t].sub(o));return s}function oh(e,t,r,n){const i=Nt.convert(e)._mult(n);return"viewport"===t&&i._rotate(-r),i}fa(Vu,"CircleBucket",{omit:["layers"]});const sh=new Ka({"circle-sort-key":new Ya(tl.layout_circle["circle-sort-key"]),visibility:new Xa(tl.layout_circle.visibility)});var ah={paint:new Ka({"circle-radius":new Ya(tl.paint_circle["circle-radius"]),"circle-color":new Ya(tl.paint_circle["circle-color"]),"circle-blur":new Ya(tl.paint_circle["circle-blur"]),"circle-opacity":new Ya(tl.paint_circle["circle-opacity"]),"circle-translate":new Xa(tl.paint_circle["circle-translate"]),"circle-translate-anchor":new Xa(tl.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Xa(tl.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Xa(tl.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ya(tl.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ya(tl.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ya(tl.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new Xa(tl.paint_circle["circle-emissive-strength"])}),layout:sh};class lh{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(t,r,n){const i=e.Q.dot(r,this.dir);if(Math.abs(i)<1e-6)return!1;const o=((t[0]-this.pos[0])*r[0]+(t[1]-this.pos[1])*r[1]+(t[2]-this.pos[2])*r[2])/i;return n[0]=this.pos[0]+this.dir[0]*o,n[1]=this.pos[1]+this.dir[1]*o,n[2]=this.pos[2]+this.dir[2]*o,!0}closestPointOnSphere(t,r,n){if(e.Q.equals(this.pos,t)||0===r)return n[0]=n[1]=n[2]=0,!1;const[i,o,s]=this.dir,a=this.pos[0]-t[0],l=this.pos[1]-t[1],c=this.pos[2]-t[2],u=i*i+o*o+s*s,h=2*(a*i+l*o+c*s),d=h*h-4*u*(a*a+l*l+c*c-r*r);if(d<0){const e=Math.max(-h/2,0),t=a+i*e,u=l+o*e,d=c+s*e,p=Math.hypot(t,u,d);return n[0]=t*r/p,n[1]=u*r/p,n[2]=d*r/p,!1}{const e=(-h-Math.sqrt(d))/(2*u);if(e<0){const e=Math.hypot(a,l,c);return n[0]=a*r/e,n[1]=l*r/e,n[2]=c*r/e,!1}return n[0]=a+i*e,n[1]=l+o*e,n[2]=c+s*e,!0}}}class ch{constructor(e,t,r,n,i){this.TL=e,this.TR=t,this.BR=r,this.BL=n,this.horizon=i}static fromInvProjectionMatrix(t,r,n){const i=[-1,1,1],o=[1,1,1],s=[1,-1,1],a=[-1,-1,1],l=e.Q.transformMat4(i,i,t),c=e.Q.transformMat4(o,o,t),u=e.Q.transformMat4(s,s,t),h=e.Q.transformMat4(a,a,t);return new ch(l,c,u,h,r/n)}}function uh(t,r,n){let i=1/0,o=-1/0;const s=[];for(const a of t){e.Q.sub(s,a,r);const t=e.Q.dot(s,n);i=Math.min(i,t),o=Math.max(o,t)}return[i,o]}function hh(t,r){let n=!0;for(let i=0;i<t.planes.length;i++){const o=t.planes[i];let s=0;for(let t=0;t<r.length;t++)s+=e.Q.dot(o,r[t])+o[3]>=0;if(0===s)return 0;s!==r.length&&(n=!1)}return n?2:1}function dh(e,t){for(const r of e.projections){const n=uh(t,e.points[0],r.axis);if(r.projection[1]<n[0]||r.projection[0]>n[1])return 0}return 1}function ph(t,r){let n=0;const i=[0,0,0,0];for(let o=0;o<t.length;o++)i[0]=t[o][0],i[1]=t[o][1],i[2]=t[o][2],i[3]=1,e.aa.dot(i,r)>=0&&n++;return n}class fh{constructor(t,r){this.points=t||new Array(8).fill([0,0,0]),this.planes=r||new Array(6).fill([0,0,0,0]),this.bounds=mh.fromPoints(this.points),this.projections=[],this.frustumEdges=[e.Q.sub([],this.points[2],this.points[3]),e.Q.sub([],this.points[0],this.points[3]),e.Q.sub([],this.points[4],this.points[0]),e.Q.sub([],this.points[5],this.points[1]),e.Q.sub([],this.points[6],this.points[2]),e.Q.sub([],this.points[7],this.points[3])];for(const e of this.frustumEdges){const t=[0,-e[2],e[1]],r=[e[2],0,-e[0]];this.projections.push({axis:t,projection:uh(this.points,this.points[0],t)}),this.projections.push({axis:r,projection:uh(this.points,this.points[0],r)})}}static fromInvProjectionMatrix(t,r,n,i){const o=Math.pow(2,n),s=[[-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((n=>{const s=e.aa.transformMat4([],n,t),a=1/s[3]/r*o;return e.aa.mul(s,s,[a,a,i?1/s[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const r=e.Q.sub([],s[t[0]],s[t[1]]),n=e.Q.sub([],s[t[2]],s[t[1]]),i=e.Q.normalize([],e.Q.cross([],r,n)),o=-e.Q.dot(i,s[t[1]]);return i.concat(o)})),l=[];for(let e=0;e<s.length;e++)l.push([s[e][0],s[e][1],s[e][2]]);return new fh(l,a)}intersectsPrecise(t,r,n){for(let e=0;e<r.length;e++)if(!ph(t,r[e]))return 0;for(let e=0;e<this.planes.length;e++)if(!ph(t,this.planes[e]))return 0;for(const r of n)for(const n of this.frustumEdges){const i=e.Q.cross([],r,n),o=e.Q.length(i);if(0===o)continue;e.Q.scale(i,i,1/o);const s=uh(this.points,this.points[0],i),a=uh(t,this.points[0],i);if(s[0]>a[1]||a[0]>s[1])return 0}return 1}}class mh{static fromPoints(t){const r=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(const i of t)e.Q.min(r,r,i),e.Q.max(n,n,i);return new mh(r,n)}static fromTileIdAndHeight(e,t,r){const n=1<<e.canonical.z,i=e.canonical.x,o=e.canonical.y;return new mh([i/n,o/n,t],[(i+1)/n,(o+1)/n,r])}static applyTransform(t,r){const n=t.getCorners();for(let t=0;t<n.length;++t)e.Q.transformMat4(n[t],n[t],r);return mh.fromPoints(n)}static projectAabbCorners(t,r){const n=t.getCorners();for(let t=0;t<n.length;++t)e.Q.transformMat4(n[t],n[t],r);return n}constructor(t,r){this.min=t,this.max=r,this.center=e.Q.scale([],e.Q.add([],this.min,this.max),.5)}quadrant(t){const r=[t%2==0,t<2],n=e.Q.clone(this.min),i=e.Q.clone(this.max);for(let e=0;e<r.length;e++)n[e]=r[e]?this.min[e]:this.center[e],i[e]=r[e]?this.center[e]:this.max[e];return i[2]=this.max[2],new mh(n,i)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?hh(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?hh(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(e,t){return t||this.intersects(e)?dh(e,this.getCorners()):0}intersectsPreciseFlat(e,t){return t||this.intersectsFlat(e)?dh(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(e){for(let t=0;t<3;++t)if(this.min[t]>e.max[t]||e.min[t]>this.max[t])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e.min[t]),this.max[t]=Math.max(this.max[t],e.max[t])}encapsulatePoint(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e[t]),this.max[t]=Math.max(this.max[t],e[t])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}fa(mh,"Aabb");const gh=wl([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Ah}=gh,_h=wl([{name:"a_pos_3",components:3,type:"Int16"}]);var yh=wl([{name:"a_pos",type:"Int16",components:2}]);function vh(e){return e*Qc/iu}const xh=[new mh([eu,eu,eu],[tu,tu,tu]),new mh([eu,eu,eu],[0,0,tu]),new mh([0,eu,eu],[tu,0,tu]),new mh([eu,0,eu],[0,tu,tu]),new mh([0,0,eu],[tu,tu,tu])];function bh(t,r,n,i=!0){const o=e.Q.scale([],t._camera.position,t.worldSize),s=[r,n,1,1];e.aa.transformMat4(s,s,t.pixelMatrixInverse),e.aa.scale(s,s,1/s[3]);const a=e.Q.sub([],s,o),l=e.Q.normalize([],a),c=t.globeMatrix,u=[c[12],c[13],c[14]],h=e.Q.sub([],u,o),d=e.Q.length(h),p=e.Q.normalize([],h),f=t.worldSize/(2*Math.PI),m=e.Q.dot(p,l),g=Math.asin(f/d);if(g<Math.acos(m)){if(!i)return null;const t=[],r=[];e.Q.scale(t,l,d/m),e.Q.normalize(r,e.Q.sub(r,t,h)),e.Q.normalize(l,e.Q.add(l,h,e.Q.scale(l,r,Math.tan(g)*d)))}const A=[];new lh(o,l).closestPointOnSphere(u,f,A);const _=e.Q.normalize([],Er(c,0)),y=e.Q.normalize([],Er(c,1)),v=e.Q.normalize([],Er(c,2)),x=e.Q.dot(_,A),b=e.Q.dot(y,A),w=e.Q.dot(v,A),C=Gt(Math.asin(-b/f));let E=Gt(Math.atan2(x,w));E=t.center.lng+function(e,t){const r=(t-e+180)%360-180;return r<-180?r+360:r}(t.center.lng,E);const T=_u(E),S=Xt(yu(C),0,1);return new Iu(T,S)}class wh{constructor(t,r,n){this.a=e.Q.sub([],t,n),this.b=e.Q.sub([],r,n),this.center=n;const i=e.Q.normalize([],this.a),o=e.Q.normalize([],this.b);this.angle=Math.acos(e.Q.dot(i,o))}}function Ch(e,t){if(0===e.angle)return null;let r;return r=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),r<0||r>1?null:function(e,t,r,n){const i=Math.sin(r);return e*(Math.sin((1-n)*r)/i)+t*(Math.sin(n*r)/i)}(e.a[t],e.b[t],e.angle,Xt(r,0,1))+e.center[t]}function Eh(e){if(e.z<=1)return xh[e.z+2*e.y+e.x];const t=Ph(Ih(e));return mh.fromPoints(t)}function Th(t,r,n){return e.Q.scale(t,t,1-n),e.Q.scaleAndAdd(t,t,r,n)}function Sh(t,r,n){for(const i of t)e.Q.transformMat4(i,i,r),e.Q.scale(i,i,n)}function Mh(t,r,n,i){const o=r/t.worldSize,s=t.globeMatrix;if(n.z<=1){const e=Eh(n).getCorners();return Sh(e,s,o),mh.fromPoints(e)}const a=Ih(n,i),l=Ph(a,Qc+vh(t._tileCoverLift));Sh(l,s,o);const c=Number.MAX_VALUE,u=[-c,-c,-c],h=[c,c,c];if(a.contains(t.center)){for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);u[2]=0;const r=t.point,n=[r.x*o,r.y*o,0];return e.Q.min(h,h,n),e.Q.max(u,u,n),new mh(h,u)}if(t._tileCoverLift>0){for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);return new mh(h,u)}const d=[s[12]*o,s[13]*o,s[14]*o],p=a.getCenter(),f=Xt(t.center.lat,-Cu,Cu),m=Xt(p.lat,-Cu,Cu),g=_u(t.center.lng),A=yu(f);let _=g-_u(p.lng);const y=A-yu(m);_>.5?_-=1:_<-.5&&(_+=1);let v=0;if(Math.abs(_)>Math.abs(y))v=_>=0?1:3;else{v=y>=0?0:2;const t=[s[4]*o,s[5]*o,s[6]*o],r=-Math.sin(Ht(y>=0?a.getSouth():a.getNorth()))*Qc;e.Q.scaleAndAdd(d,d,t,r)}const x=l[v],b=l[(v+1)%4],w=new wh(x,b,d),C=[Ch(w,0)||x[0],Ch(w,1)||x[1],Ch(w,2)||x[2]],E=jh(t.zoom);if(E>0){const i=function({x:e,y:t,z:r},n,i,o,s){const a=1/(1<<r);let l=e*a,c=l+a,u=t*a,h=u+a,d=0;const p=(l+c)/2-o;return p>.5?d=-1:p<-.5&&(d=1),l=((l+d)*n-(o*=n))*i+o,c=((c+d)*n-o)*i+o,u=(u*n-(s*=n))*i+s,h=(h*n-s)*i+s,[[l,h,0],[c,h,0],[c,u,0],[l,u,0]]}(n,r,t._pixelsPerMercatorPixel,g,A);for(let e=0;e<l.length;e++)Th(l[e],i[e],E);const o=e.Q.add([],i[v],i[(v+1)%4]);e.Q.scale(o,o,.5),Th(C,o,E)}for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);return h[2]=Math.min(x[2],b[2]),e.Q.min(h,h,C),e.Q.max(u,u,C),new mh(h,u)}function Ih({x:e,y:t,z:r},n=!1){const i=1/(1<<r),o=new su(xu(e*i),t===(1<<r)-1&&n?-90:bu((t+1)*i)),s=new su(xu((e+1)*i),0===t&&n?90:bu(t*i));return new au(o,s)}function Ph(e,t=Qc){const r=Ht(e.getNorth()),n=Ht(e.getSouth()),i=Math.cos(r),o=Math.cos(n),s=Math.sin(r),a=Math.sin(n),l=e.getWest(),c=e.getEast();return[ru(o,a,l,t),ru(o,a,c,t),ru(i,s,c,t),ru(i,s,l,t)]}function Lh(e,t,r,n){const i=1<<r.z,o=(e/io+r.x)/i;return nu(bu((t/io+r.y)/i),xu(o),n)}function Oh({min:e,max:t}){return $c/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const Dh=new Float64Array(16);function kh(t){const r=Oh(t),n=e.a9.fromScaling(Dh,[r,r,r]);return e.a9.translate(n,n,e.Q.negate([],t.min))}function zh(t){const r=e.a9.fromTranslation(Dh,t.min),n=1/Oh(t);return e.a9.scale(r,r,[n,n,n])}function Bh(e){const t=io/(2*Math.PI);return e/(2*Math.PI)/t}function Rh(e,t){return io/(512*Math.pow(2,e))*Oh(Eh(t))}function Fh(t,r,n,i,o){const s=Bh(n),a=[t,r,-n/(2*Math.PI)],l=e.a9.identity(new Float64Array(16));return e.a9.translate(l,l,a),e.a9.scale(l,l,[s,s,s]),e.a9.rotateX(l,l,Ht(-o)),e.a9.rotateY(l,l,Ht(-i)),l}function jh(e){return Yt(Xc,Yc,e)}function Nh(t,r){const n=nu(r.lat,r.lng),i=function(t){const r=nu(t._center.lat,t._center.lng),n=e.Q.fromValues(0,1,0);let i=e.Q.cross([],n,r);const o=e.a9.fromRotation([],-t.angle,r);i=e.Q.transformMat4(i,i,o),e.a9.fromRotation(o,-t._pitch,i);const s=e.Q.normalize([],r);return e.Q.scale(s,s,vh(t.cameraToCenterDistance/t.pixelsPerMeter)),e.Q.transformMat4(s,s,o),e.Q.add([],r,s)}(t),o=e.Q.subtract([],i,n);return e.Q.angle(o,n)}function Vh(e,t){return Nh(e,t)>Math.PI/2*1.01}const Uh=Ht(85),Hh=Math.cos(Uh),Gh=Math.sin(Uh),Zh=e.a9.create(),Wh=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t};function qh(t,r,n,i,o,s,a,l,c){if(s&&t.queryGeometry.isAboveHorizon)return!1;s&&(c*=t.pixelToTileUnitsFactor);const u=t.tileID.canonical,h=n.projection.upVectorScale(u,n.center.lat,n.worldSize).metersToTile;for(const d of r)for(const r of d){const d=r.add(l),p=o&&n.elevation?n.elevation.exaggeration()*o.getElevationAt(d.x,d.y,!0):0,f=n.projection.projectTilePoint(d.x,d.y,u);if(p>0){const e=n.projection.upVector(u,d.x,d.y);f.x+=e[0]*h*p,f.y+=e[1]*h*p,f.z+=e[2]*h*p}const m=s?d:Qh(f.x,f.y,f.z,i),g=s?t.tilespaceRays.map((e=>$h(e,p))):t.queryGeometry.screenGeometry,A=e.aa.transformMat4([],[f.x,f.y,f.z,1],i);if(!a&&s?c*=A[3]/n.cameraToCenterDistance:a&&!s&&(c*=n.cameraToCenterDistance/A[3]),s){const e=bu((r.y/io+u.y)/(1<<u.z));c/=n.projection.pixelsPerMeter(e,1)/vu(1,e)}if(Hu(g,m,c))return!0}return!1}function Qh(t,r,n,i){const o=e.aa.transformMat4([],[t,r,n,1],i);return new Nt(o[0]/o[3],o[1]/o[3])}const Xh=e.Q.fromValues(0,0,0),Yh=e.Q.fromValues(0,0,1);function $h(t,r){const n=e.Q.create();return Xh[2]=r,t.intersectsPlane(Xh,Yh,n),new Nt(n[0],n[1])}class Kh extends Vu{}function Jh(e,{width:t,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*r*n)throw new RangeError("mismatched image size")}else i=new Uint8Array(t*r*n);return e.width=t,e.height=r,e.data=i,e}function ed(e,t,r){const{width:n,height:i}=t;n===e.width&&i===e.height||(td(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,i)},r),e.width=n,e.height=i,e.data=t.data)}function td(e,t,r,n,i,o,s){if(0===i.width||0===i.height)return t;if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const a=e.data,l=t.data,c=4===o&&s;for(let s=0;s<i.height;s++){const u=((r.y+s)*e.width+r.x)*o,h=((n.y+s)*t.width+n.x)*o;if(c)for(let e=0;e<i.width;e++){const t=u+e*o+3,r=h+e*o;l[r+0]=255,l[r+1]=255,l[r+2]=255,l[r+3]=a[t]}else for(let e=0;e<i.width*o;e++)l[h+e]=a[u+e]}return t}fa(Kh,"HeatmapBucket",{omit:["layers"]});class rd{constructor(e,t){Jh(this,e,1,t)}resize(e){ed(this,new rd(e),1)}clone(){return new rd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){td(e,t,r,n,i,1)}}class nd{constructor(e,t){Jh(this,e,4,t)}resize(e){ed(this,new nd(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new nd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i,o){td(e,t,r,n,i,4,o)}}class id{constructor(e,t){this.width=e.width,this.height=e.height,this.data=t instanceof Uint8Array?new Float32Array(t.buffer):t}}fa(rd,"AlphaImage"),fa(nd,"RGBAImage");const od=new Ka({visibility:new Xa(tl.layout_heatmap.visibility)});var sd={paint:new Ka({"heatmap-radius":new Ya(tl.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ya(tl.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Xa(tl.paint_heatmap["heatmap-intensity"]),"heatmap-color":new $a(tl.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Xa(tl.paint_heatmap["heatmap-opacity"])}),layout:od};function ad(e){const t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new nd({width:r,height:n}),o=(r,n,o)=>{t[e.evaluationKey]=o;const s=e.expression.evaluate(t);s&&(i.data[r+n+0]=Math.floor(255*s.r/s.a),i.data[r+n+1]=Math.floor(255*s.g/s.a),i.data[r+n+2]=Math.floor(255*s.b/s.a),i.data[r+n+3]=Math.floor(255*s.a))};if(e.clips)for(let t=0,i=0;t<n;++t,i+=4*r)for(let n=0,s=0;n<r;n++,s+=4){const a=n/(r-1),{start:l,end:c}=e.clips[t];o(i,s,l*(1-a)+c*a)}else for(let e=0,t=0;e<r;e++,t+=4)o(0,t,e/(r-1));return i}const ld=new Ka({visibility:new Xa(tl.layout_hillshade.visibility)});var cd={paint:new Ka({"hillshade-illumination-direction":new Xa(tl.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Xa(tl.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Xa(tl.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Xa(tl.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Xa(tl.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Xa(tl.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new Xa(tl.paint_hillshade["hillshade-emissive-strength"])}),layout:ld};const ud=wl([{name:"a_pos",components:2,type:"Int16"}],4),{members:hd}=ud;var dd={exports:{}};function pd(e,t,r){r=r||2;var n,i,o,s,a,l,c,u=t&&t.length,h=u?t[0]*r:e.length,d=fd(e,0,h,r,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(e,t,r,n){var i,o,s,a=[];for(i=0,o=t.length;i<o;i++)(s=fd(e,t[i]*n,i<o-1?t[i+1]*n:e.length,n,!1))===s.next&&(s.steiner=!0),a.push(Ed(s));for(a.sort(xd),i=0;i<a.length;i++)r=bd(a[i],r);return r}(e,t,d,r)),e.length>80*r){n=o=e[0],i=s=e[1];for(var f=r;f<h;f+=r)(a=e[f])<n&&(n=a),(l=e[f+1])<i&&(i=l),a>o&&(o=a),l>s&&(s=l);c=0!==(c=Math.max(o-n,s-i))?32767/c:0}return gd(d,p,r,n,i,c,0),p}function fd(e,t,r,n,i){var o,s;if(i===Fd(e,t,r,n)>0)for(o=t;o<r;o+=n)s=zd(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=zd(o,e[o],e[o+1],s);return s&&Id(s,s.next)&&(Bd(s),s=s.next),s}function md(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!Id(n,n.next)&&0!==Md(n.prev,n,n.next))n=n.next;else{if(Bd(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function gd(e,t,r,n,i,o,s){if(e){!s&&o&&function(e,t,r,n){var i=e;do{0===i.z&&(i.z=Cd(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,s,a,l,c=1;do{for(r=e,e=null,o=null,s=0;r;){for(s++,n=r,a=0,t=0;t<c&&(a++,n=n.nextZ);t++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(s>1)}(i)}(e,n,i,o);for(var a,l,c=e;e.prev!==e.next;)if(a=e.prev,l=e.next,o?_d(e,n,i,o):Ad(e))t.push(a.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),Bd(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?gd(e=yd(md(e),t,r),t,r,n,i,o,2):2===s&&vd(e,t,r,n,i,o):gd(md(e),t,r,n,i,o,1);break}}}function Ad(e){var t=e.prev,r=e,n=e.next;if(Md(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,s=n.x,a=t.y,l=r.y,c=n.y,u=i<o?i<s?i:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=i>o?i>s?i:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c,f=n.next;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&Td(i,a,o,l,s,c,f.x,f.y)&&Md(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function _d(e,t,r,n){var i=e.prev,o=e,s=e.next;if(Md(i,o,s)>=0)return!1;for(var a=i.x,l=o.x,c=s.x,u=i.y,h=o.y,d=s.y,p=a<l?a<c?a:c:l<c?l:c,f=u<h?u<d?u:d:h<d?h:d,m=a>l?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,A=Cd(p,f,t,r,n),_=Cd(m,g,t,r,n),y=e.prevZ,v=e.nextZ;y&&y.z>=A&&v&&v.z<=_;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==s&&Td(a,u,l,h,c,d,y.x,y.y)&&Md(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==s&&Td(a,u,l,h,c,d,v.x,v.y)&&Md(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;y&&y.z>=A;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==i&&y!==s&&Td(a,u,l,h,c,d,y.x,y.y)&&Md(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;v&&v.z<=_;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==s&&Td(a,u,l,h,c,d,v.x,v.y)&&Md(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function yd(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!Id(i,o)&&Pd(i,n,n.next,o)&&Dd(i,o)&&Dd(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),Bd(n),Bd(n.next),n=e=o),n=n.next}while(n!==e);return md(n)}function vd(e,t,r,n,i,o){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Sd(s,a)){var l=kd(s,a);return s=md(s,s.next),l=md(l,l.next),gd(s,t,r,n,i,o,0),void gd(l,t,r,n,i,o,0)}a=a.next}s=s.next}while(s!==e)}function xd(e,t){return e.x-t.x}function bd(e,t){var r=function(e,t){var r,n=t,i=e.x,o=e.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>s&&(s=a,r=n.x<n.next.x?n:n.next,a===i))return r}n=n.next}while(n!==t);if(!r)return null;var l,c=r,u=r.x,h=r.y,d=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&Td(o<h?i:s,o,u,h,o<h?s:i,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(i-n.x),Dd(n,e)&&(l<d||l===d&&(n.x>r.x||n.x===r.x&&wd(r,n)))&&(r=n,d=l)),n=n.next}while(n!==c);return r}(e,t);if(!r)return t;var n=kd(r,e);return md(n,n.next),md(r,r.next)}function wd(e,t){return Md(e.prev,e,t.prev)<0&&Md(t.next,e,e.next)<0}function Cd(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Ed(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function Td(e,t,r,n,i,o,s,a){return(i-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(n-a)>=(r-s)*(t-a)&&(r-s)*(o-a)>=(i-s)*(n-a)}function Sd(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Pd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Dd(e,t)&&Dd(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Md(e.prev,e,t.prev)||Md(e,t.prev,t))||Id(e,t)&&Md(e.prev,e,e.next)>0&&Md(t.prev,t,t.next)>0)}function Md(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Id(e,t){return e.x===t.x&&e.y===t.y}function Pd(e,t,r,n){var i=Od(Md(e,t,r)),o=Od(Md(e,t,n)),s=Od(Md(r,n,e)),a=Od(Md(r,n,t));return i!==o&&s!==a||!(0!==i||!Ld(e,r,t))||!(0!==o||!Ld(e,n,t))||!(0!==s||!Ld(r,e,n))||!(0!==a||!Ld(r,t,n))}function Ld(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Od(e){return e>0?1:e<0?-1:0}function Dd(e,t){return Md(e.prev,e,e.next)<0?Md(e,t,e.next)>=0&&Md(e,e.prev,t)>=0:Md(e,t,e.prev)<0||Md(e,e.next,t)<0}function kd(e,t){var r=new Rd(e.i,e.x,e.y),n=new Rd(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function zd(e,t,r,n){var i=new Rd(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Bd(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Rd(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Fd(e,t,r,n){for(var i=0,o=t,s=r-n;o<r;o+=n)i+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return i}dd.exports=pd,dd.exports.default=pd,pd.deviation=function(e,t,r,n){var i=t&&t.length,o=Math.abs(Fd(e,0,i?t[0]*r:e.length,r));if(i)for(var s=0,a=t.length;s<a;s++)o-=Math.abs(Fd(e,t[s]*r,s<a-1?t[s+1]*r:e.length,r));var l=0;for(s=0;s<n.length;s+=3){var c=n[s]*r,u=n[s+1]*r,h=n[s+2]*r;l+=Math.abs((e[c]-e[h])*(e[u+1]-e[c+1])-(e[c]-e[u])*(e[h+1]-e[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},pd.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var s=0;s<t;s++)r.vertices.push(e[i][o][s]);i>0&&r.holes.push(n+=e[i-1].length)}return r};var jd=h(dd.exports);function Nd(e,t){const r=e.length;if(r<=1)return[e];const n=[];let i,o;for(let t=0;t<r;t++){const r=pr(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(i&&n.push(i),i=[e[t]]):i.push(e[t]))}if(i&&n.push(i),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(ki(n[e],t,1,n[e].length-1,Vd),n[e]=n[e].slice(0,t));return n}function Vd(e,t){return t.area-e.area}function Ud(e,t,r){const n=r.patternDependencies;let i=!1;for(const r of t){const t=r.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);const o=t.constantOr(null);o&&(i=!0,n[o]=!0)}return i}function Hd(e,t,r,n,i){const o=i.patternDependencies;for(const s of t){const t=s.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n},r,{},i.availableImages);e=e&&e.name?e.name:e,o[e]=!0,r.patterns[s.id]=e}}return r}class Gd{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new El,this.indexArray=new Hl,this.indexArray2=new Fl,this.programConfigurations=new Uc(e.layers,e.zoom),this.segments=new mc,this.segments2=new mc,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection}populate(e,t,r,n){this.hasPattern=Ud("fill",this.layers,t);const i=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:s,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Fu(s,e);if(!this.layers[0]._featureFilter.filter(new Na(this.zoom),u,r))continue;const h=i?i.evaluate(u,{},r,t.availableImages):void 0,d={id:a,properties:s.properties,type:s.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Ru(s,r,n),patterns:{},sortKey:h};o.push(d)}i&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const n of o){const{geometry:i,index:o,sourceLayerIndex:s}=n;if(this.hasPattern){const e=Hd("fill",this.layers,n,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(n,i,o,r,{},t.availableImages,t.brightness);t.featureIndex.insert(e[o].feature,i,o,s,this.index)}}update(e,t,r,n,i){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,n,i)}addFeatures(e,t,r,n,i,o){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r,n,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,n,i,o=[],s){for(const e of Nd(t,500)){let t=0;for(const r of e)t+=r.length;const r=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),n=r.vertexLength,i=[],o=[];for(const t of e){if(0===t.length)continue;t!==e[0]&&o.push(i.length/2);const r=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),n=r.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(n+t.length-1,n),i.push(t[0].x),i.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(n+e-1,n+e),i.push(t[e].x),i.push(t[e].y);r.vertexLength+=t.length,r.primitiveLength+=t.length}const s=jd(i,o);for(let e=0;e<s.length;e+=3)this.indexArray.emplaceBack(n+s[e],n+s[e+1],n+s[e+2]);r.vertexLength+=t,r.primitiveLength+=s.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,o,n,s)}}fa(Gd,"FillBucket",{omit:["layers","patternFeatures"]});const Zd=new Ka({"fill-sort-key":new Ya(tl.layout_fill["fill-sort-key"]),visibility:new Xa(tl.layout_fill.visibility)});var Wd={paint:new Ka({"fill-antialias":new Xa(tl.paint_fill["fill-antialias"]),"fill-opacity":new Ya(tl.paint_fill["fill-opacity"]),"fill-color":new Ya(tl.paint_fill["fill-color"]),"fill-outline-color":new Ya(tl.paint_fill["fill-outline-color"]),"fill-translate":new Xa(tl.paint_fill["fill-translate"]),"fill-translate-anchor":new Xa(tl.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ya(tl.paint_fill["fill-pattern"]),"fill-emissive-strength":new Xa(tl.paint_fill["fill-emissive-strength"])}),layout:Zd};const qd=wl([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Qd=wl([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),Xd=wl([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Yd=wl([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),$d=wl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Kd}=qd;var Jd={},ep=Ft,tp=rp;function rp(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields(np,this,t)}function np(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function ip(e){for(var t,r,n=0,i=0,o=e.length,s=o-1;i<o;s=i++)n+=((r=e[s]).x-(t=e[i]).x)*(t.y+r.y);return n}rp.types=["Unknown","Point","LineString","Polygon"],rp.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,a=[];e.pos<r;){if(i<=0){var l=e.readVarint();n=7&l,i=l>>3}if(i--,1===n||2===n)o+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&a.push(t),t=[]),t.push(new ep(o,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&a.push(t),a},rp.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;e.pos<t;){if(n<=0){var u=e.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<s&&(s=i),i>a&&(a=i),(o+=e.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[s,l,a,c]},rp.prototype.toGeoJSON=function(e,t,r){var n,i,o=this.extent*Math.pow(2,r),s=this.extent*e,a=this.extent*t,l=this.loadGeometry(),c=rp.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t];e[t]=[360*(r.x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+a)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],o=0;o<t;o++){var s=ip(e[o]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(r&&i.push(r),r=[e[o]]):r.push(e[o]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var op=tp,sp=ap;function ap(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(lp,this,t),this.length=this._features.length}function lp(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}ap.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new op(this._pbf,t,this.extent,this._keys,this._values)};var cp=sp;function up(e,t,r){if(3===e){var n=new cp(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}var hp=Jd.VectorTile=function(e,t){this.layers=e.readFields(up,{},t)},dp=Jd.VectorTileFeature=tp;function pp(e,t,r,n){const i=[],o=0===n?(e,t,r,n,i,o)=>{e.push(new Nt(o,r+(o-t)/(n-t)*(i-r)))}:(e,t,r,n,i,o)=>{e.push(new Nt(t+(o-r)/(i-r)*(n-t),o))};for(const s of e){const e=[];for(const i of s){if(i.length<=2)continue;const s=[];for(let e=0;e<i.length-1;e++){const a=i[e].x,l=i[e].y,c=i[e+1].x,u=i[e+1].y,h=0===n?a:l,d=0===n?c:u;h<t?d>t&&o(s,a,l,c,u,t):h>r?d<r&&o(s,a,l,c,u,r):s.push(i[e]),d<t&&h>=t&&o(s,a,l,c,u,t),d>r&&h<=r&&o(s,a,l,c,u,r)}let a=i[i.length-1];const l=0===n?a.x:a.y;l>=t&&l<=r&&s.push(a),s.length&&(a=s[s.length-1],s[0].x===a.x&&s[0].y===a.y||s.push(s[0]),e.push(s))}e.length&&i.push(e)}return i}function fp(e,t){return e.x-t.x||e.y-t.y}function mp(e,t){return 0===fp(e.min,t.min)&&0===fp(e.max,t.max)}function gp(e,t){return!(e.min.x>t.max.x||e.max.x<t.min.x||e.min.y>t.max.y||e.max.y<t.min.y)}function Ap(e,t,r){const n=1/io,i=1/(1<<r.canonical.z),o=(t.x*n+r.canonical.x)*i+r.wrap,s=(t.y*n+r.canonical.y)*i;return{min:new Nt((e.x*n+r.canonical.x)*i+r.wrap,(e.y*n+r.canonical.y)*i),max:new Nt(o,s)}}function _p(e,t,r){const n=1<<r.canonical.z,i=((t.x-r.wrap)*n-r.canonical.x)*io,o=(t.y*n-r.canonical.y)*io;return{min:new Nt(((e.x-r.wrap)*n-r.canonical.x)*io,(e.y*n-r.canonical.y)*io),max:new Nt(i,o)}}function yp(e,t,r,n,i,o,s){const a=e.indices,l=e.vertices,c=[];for(let u=n;u<n+i;u+=3){const n=t[r[u+0]+o],i=t[r[u+1]+o],h=t[r[u+2]+o],d=Math.min(n.x,i.x,h.x),p=Math.max(n.x,i.x,h.x),f=Math.min(n.y,i.y,h.y),m=Math.max(n.y,i.y,h.y);c.length=0,e.grid.query(new Nt(d,f),new Nt(p,m),c);for(let e=0;e<c.length;e++){const t=c[e];if(th(l[a[3*t+0]],l[a[3*t+1]],l[a[3*t+2]],n,i,h,s))return!0}}return!1}function vp(e,t,r,n){if(!e||!r)return!1;let i=e.vertices;if(!t.canonical.equals(n.canonical)||t.wrap!==n.wrap){if(r.vertices.length<e.vertices.length)return vp(r,n,e,t);const o=t.canonical,s=n.canonical,a=Math.pow(2,s.z-o.z);i=e.vertices.map((e=>new Nt((e.x+o.x*io)*a-s.x*io,(e.y+o.y*io)*a-s.y*io)))}return yp(r,i,e.indices,0,e.indices.length,0,0)}Jd.VectorTileLayer=sp;class xp{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const r=this.toIdx(e,t);return{min:this.minimums[r],max:this.maximums[r]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function bp(e,t,r,n){let i=0,o=Number.MAX_VALUE;for(let s=0;s<3;s++)if(Math.abs(n[s])<1e-15){if(r[s]<e[s]||r[s]>t[s])return null}else{const a=1/n[s];let l=(e[s]-r[s])*a,c=(t[s]-r[s])*a;if(l>c){const e=l;l=c,c=e}if(l>i&&(i=l),c<o&&(o=c),i>o)return null}return i}function wp(e,t,r,n,i,o,s,a,l,c,u){const h=n-e,d=i-t,p=o-r,f=s-e,m=a-t,g=l-r,A=u[1]*g-u[2]*m,_=u[2]*f-u[0]*g,y=u[0]*m-u[1]*f,v=h*A+d*_+p*y;if(Math.abs(v)<1e-15)return null;const x=1/v,b=c[0]-e,w=c[1]-t,C=c[2]-r,E=(b*A+w*_+C*y)*x;if(E<0||E>1)return null;const T=w*p-C*d,S=C*h-b*p,M=b*d-w*h,I=(u[0]*T+u[1]*S+u[2]*M)*x;return I<0||E+I>1?null:(f*T+m*S+g*M)*x}function Cp(e,t,r){return(e-t)/(r-t)}function Ep(e,t,r,n,i,o,s,a,l){const c=1<<r,u=o-n,h=s-i,d=(e+1)/c*u+n,p=(t+0)/c*h+i,f=(t+1)/c*h+i;a[0]=(e+0)/c*u+n,a[1]=p,l[0]=d,l[1]=f}class Tp{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=Math.ceil(Math.log2(e.dim/8)),r=[];let n=Math.ceil(Math.pow(2,t));const i=1/n,o=(e,t,r,n,i)=>{const o=n?1:0,s=(e+1)*r-o,a=t*r,l=(t+1)*r-o;i[0]=e*r,i[1]=a,i[2]=s,i[3]=l};let s=new xp(n);const a=[];for(let t=0;t<n*n;t++){o(t%n,Math.floor(t/n),i,!1,a);const r=Mp(a[0],a[1],e),l=Mp(a[2],a[1],e),c=Mp(a[2],a[3],e),u=Mp(a[0],a[3],e);s.minimums.push(Math.min(r,l,c,u)),s.maximums.push(Math.max(r,l,c,u)),s.leaves.push(1)}for(r.push(s),n/=2;n>=1;n/=2){const e=r[r.length-1];s=new xp(n);for(let t=0;t<n*n;t++){o(t%n,Math.floor(t/n),2,!0,a);const r=e.getElevation(a[0],a[1]),i=e.getElevation(a[2],a[1]),l=e.getElevation(a[2],a[3]),c=e.getElevation(a[0],a[3]),u=e.isLeaf(a[0],a[1]),h=e.isLeaf(a[2],a[1]),d=e.isLeaf(a[2],a[3]),p=e.isLeaf(a[0],a[3]),f=Math.min(r.min,i.min,l.min,c.min),m=Math.max(r.max,i.max,l.max,c.max),g=u&&h&&d&&p;s.maximums.push(m),s.minimums.push(f),s.leaves.push(m-f<=5&&g?1:0)}r.push(s)}return r}(this.dem),r=t.length-1,n=t[r];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(t,0,0,r,0)}raycastRoot(e,t,r,n,i,o,s=1){return bp([e,t,-100],[r,n,this.maximums[0]*s],i,o)}raycast(t,r,n,i,o,s,a=1){if(!this.nodeCount)return null;const l=this.raycastRoot(t,r,n,i,o,s,a);if(null==l)return null;const c=[],u=[],h=[],d=[],p=[{idx:0,t:l,nodex:0,nodey:0,depth:0}];for(;p.length>0;){const{idx:l,t:f,nodex:m,nodey:g,depth:A}=p.pop();if(this.leaves[l]){Ep(m,g,A,t,r,n,i,h,d);const l=1<<A,c=(m+0)/l,u=(m+1)/l,p=(g+0)/l,_=(g+1)/l,y=Mp(c,p,this.dem)*a,v=Mp(u,p,this.dem)*a,x=Mp(u,_,this.dem)*a,b=Mp(c,_,this.dem)*a,w=wp(h[0],h[1],y,d[0],h[1],v,d[0],d[1],x,o,s),C=wp(d[0],d[1],x,h[0],d[1],b,h[0],h[1],y,o,s),E=Math.min(null!==w?w:Number.MAX_VALUE,null!==C?C:Number.MAX_VALUE);if(E!==Number.MAX_VALUE)return E;{const t=e.Q.scaleAndAdd([],o,s,f);if(Sp(y,v,b,x,Cp(t[0],h[0],d[0]),Cp(t[1],h[1],d[1]))>=t[2])return f}continue}let _=0;for(let e=0;e<this._siblingOffset.length;e++){Ep((m<<1)+this._siblingOffset[e][0],(g<<1)+this._siblingOffset[e][1],A+1,t,r,n,i,h,d),h[2]=-100,d[2]=this.maximums[this.childOffsets[l]+e]*a;const p=bp(h,d,o,s);if(null!=p){const t=p;c[e]=t;let r=!1;for(let n=0;n<_&&!r;n++)t>=c[u[n]]&&(u.splice(n,0,e),r=!0);r||(u[_]=e),_++}}for(let e=0;e<_;e++){const t=u[e];p.push({idx:this.childOffsets[l]+t,t:c[t],nodex:(m<<1)+this._siblingOffset[t][0],nodey:(g<<1)+this._siblingOffset[t][1],depth:A+1})}}return null}_addNode(e,t,r){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(r),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,r,n,i){if(1===e[n].isLeaf(t,r))return;this.childOffsets[i]||(this.childOffsets[i]=this.nodeCount);const o=n-1,s=e[o];let a=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const n=2*t+this._siblingOffset[e][0],i=2*r+this._siblingOffset[e][1],o=s.getElevation(n,i),c=s.isLeaf(n,i),u=this._addNode(o.min,o.max,c);c&&(a|=1<<e),l||(l=u)}for(let n=0;n<this._siblingOffset.length;n++)a&1<<n||this._construct(e,2*t+this._siblingOffset[n][0],2*r+this._siblingOffset[n][1],o,l+n)}}function Sp(e,t,r,n,i,o){return Hn(Hn(e,r,o),Hn(t,n,o),i)}function Mp(e,t,r){const n=r.dim,i=Xt(e*n-.5,0,n-1),o=Xt(t*n-.5,0,n-1),s=Math.floor(i),a=Math.floor(o),l=Math.min(s+1,n-1),c=Math.min(a+1,n-1);return Sp(r.get(s,a),r.get(l,a),r.get(s,c),r.get(l,c),i-s,o-a)}const Ip={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function Pp(e,t,r){return(256*e*256+256*t+r)/10-1e4}function Lp(e,t,r){return 256*e+t+r/256-32768}class Op{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,r,n=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return hr(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const i=this.dim=t.height-2,o=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.floatView=new Float32Array(t.data.buffer),this.borderReady=n,this._modifiedForSources={},!n){for(let e=0;e<i;e++)o[this._idx(-1,e)]=o[this._idx(0,e)],o[this._idx(i,e)]=o[this._idx(i-1,e)],o[this._idx(e,-1)]=o[this._idx(e,0)],o[this._idx(e,i)]=o[this._idx(e,i-1)];o[this._idx(-1,-1)]=o[this._idx(0,0)],o[this._idx(i,-1)]=o[this._idx(i-1,0)],o[this._idx(-1,i)]=o[this._idx(0,i-1)],o[this._idx(i,i)]=o[this._idx(i-1,i-1)]}const s="terrarium"===r?Lp:Pp;for(let e=0;e<o.length;++e){const t=4*e;this.floatView[e]=s(this.pixels[t],this.pixels[t+1],this.pixels[t+2])}this._timestamp=Lr.now()}_buildQuadTree(){this._tree=new Tp(this)}get(e,t,r=!1){r&&(e=Xt(e,-1,this.dim),t=Xt(t,-1,this.dim));const n=this._idx(e,t);return this.floatView[n]}set(e,t,r){const n=this._idx(e,t),i=this.floatView[n];return this.floatView[n]=r,r-i}static getUnpackVector(e){return Ip[e]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const r=[0,0,0,0],n=Op.getUnpackVector(t);let i=Math.floor((e+n[3])/n[2]);return r[2]=i%256,i=Math.floor(i/256),r[1]=i%256,i=Math.floor(i/256),r[0]=i,r}getPixels(){return new id({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,i=t*this.dim+this.dim,o=r*this.dim,s=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=s-1;break;case 1:s=o+1}const a=-t*this.dim,l=-r*this.dim;for(let t=o;t<s;t++)for(let r=n;r<i;r++){const n=4*this._idx(r,t),i=4*this._idx(r+a,t+l);this.pixels[n+0]=e.pixels[i+0],this.pixels[n+1]=e.pixels[i+1],this.pixels[n+2]=e.pixels[i+2],this.pixels[n+3]=e.pixels[i+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}fa(Op,"DEMData"),fa(Tp,"DemMinMaxQuadTree",{omit:["dem"]});class Dp{constructor(e,t,r){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=r}static create(e,t,r){const n=r||e.findDEMTileFor(t);if(!n||!n.dem)return;const i=n.dem,o=n.tileID,s=1<<t.canonical.z-o.canonical.z;return new Dp(n,i.dim/io/s,[(t.canonical.x/s-o.canonical.x)*i.dim,(t.canonical.y/s-o.canonical.y)*i.dim])}tileCoordToPixel(e,t){const r=t*this._scale+this._offset[1],n=Math.floor(e*this._scale+this._offset[0]),i=Math.floor(r);return new Nt(n,i)}getElevationAt(e,t,r,n){const i=e*this._scale+this._offset[0],o=t*this._scale+this._offset[1],s=Math.floor(i),a=Math.floor(o),l=this._dem;return n=!!n,r?Hn(Hn(l.get(s,a,n),l.get(s,a+1,n),o-a),Hn(l.get(s+1,a,n),l.get(s+1,a+1,n),o-a),i-s):l.get(s,a,n)}getElevationAtPixel(e,t,r){return this._dem.get(e,t,!!r)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*vu(1,e)*this._dem.stride}}const kp=dp.types,zp=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius"],Bp=["fill-extrusion-flood-light-ground-radius"],Rp=Math.pow(2,13),Fp=Math.pow(2,15)-1,jp=new Nt(0,1),Np=2147483648;function Vp(e,t,r,n,i,o,s,a){e.emplaceBack((t<<1)+s,(r<<1)+o,(Math.floor(n*Rp)<<1)+i,Math.round(a))}function Up(e,t,r,n,i,o){e.emplaceBack(t.x,t.y,(r.x<<1)+n,(r.y<<1)+i,o)}function Hp(e,t,r){const n=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*n,r[1]*n,r[2]*n)}class Gp{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class Zp{constructor(){this.centroidXY=new Nt(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new Nt(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new Nt(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new Nt(this.max.x-this.min.x,this.max.y-this.min.y)}}class Wp{constructor(){this.acc=new Nt(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,t){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=t.x,e.min.y=e.max.y=t.y)}appendEdge(e,t,r){this.accCount++,this.acc._add(t);let n=!!this.borders;t.x<e.min.x?(e.min.x=t.x,n=!0):t.x>e.max.x&&(e.max.x=t.x,n=!0),t.y<e.min.y?(e.min.y=t.y,n=!0):t.y>e.max.y&&(e.max.y=t.y,n=!0),((0===t.x||t.x===io)&&t.x===r.x)!=((0===t.y||t.y===io)&&t.y===r.y)&&this.processBorderOverlap(t,r),n&&this.checkBorderIntersection(t,r)}checkBorderIntersection(e,t){t.x<0!=e.x<0&&this.addBorderIntersection(0,Hn(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>io!=e.x>io&&this.addBorderIntersection(1,Hn(t.y,e.y,(io-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,Hn(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>io!=e.y>io&&this.addBorderIntersection(3,Hn(t.x,e.x,(io-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){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 r=this.borders[e];t<r[0]&&(r[0]=t),t>r[1]&&(r[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const r=0===e.x?0:1;this.addBorderIntersection(r,t.y),this.addBorderIntersection(r,e.y)}else{const r=0===e.y?2:3;this.addBorderIntersection(r,t.x),this.addBorderIntersection(r,e.x)}}centroid(){return 0===this.accCount?new Nt(0,0):new Nt(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce(((e,t)=>e+ +(t[0]!==Number.MAX_VALUE)),0):0}}function qp(e,t){const r=e.add(t)._unit(),n=Xt(e.x*r.x+e.y*r.y,-1,1);var i,o,s;return i=Math.acos(n),Math.min(4,Math.max(-4,Math.tan(i)))/4*Fp*((o=e).x*(s=t).y-o.y*s.x<0?-1:1)}const Qp=[e=>e.x<0,e=>e.x>io,e=>e.y<0,e=>e.y>io];function Xp(e,t,r,n){const i=[4];if(0===n)return i;r._mult(n);const o=e.sub(r),s=t.sub(r),a=[e,t,o,s];for(let e=0;e<4;e++)for(const t of a)if(Qp[e](t)){i.push(e);break}return i}class Yp{constructor(e){this.vertexArray=new Ml,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom,(e=>Bp.includes(e))),this._segments=new mc,this.hiddenByLandmarkVertexArray=new tc,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new mc}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,t,r,n=!1){const i=e.length;if(i>2){let o=Math.max(0,this._segments.get().length-1);const s=this._segments._prepareSegment(4*i,this.vertexArray.length,2*this._segmentToGroundQuads[o].length);let a;o!==this._segments.get().length-1&&(o++,this._segmentToGroundQuads[o]=[],this._segmentToRegionTriCounts[o]=[0,0,0,0,0]);{const t=e[0],r=e[1];a=qp(t.sub(e[i-1])._perp()._unit(),r.sub(t)._perp()._unit())}for(let l=0;l<i;l++){const c=l===i-1?0:l+1,u=e[l],h=e[c],d=e[c===i-1?0:c+1],p=h.sub(u)._perp()._unit(),f=qp(p,d.sub(h)._perp()._unit()),m=a,g=f;if(tf(u,h,t)||n&&rf(u,t)&&rf(h,t)){a=f;continue}const A=s.vertexLength;Up(this.vertexArray,u,h,1,1,m),Up(this.vertexArray,u,h,1,0,m),Up(this.vertexArray,u,h,0,1,g),Up(this.vertexArray,u,h,0,0,g),s.vertexLength+=4;const _=Xp(u,h,p,r);for(const e of _)this._segmentToGroundQuads[o].push({id:A,region:e}),this._segmentToRegionTriCounts[o][e]+=2,s.primitiveLength+=2;a=f}}}prepareBorderSegments(){if(!this.hasData())return;const e=this._segments.get(),t=e.length;for(let e=0;e<t;e++)this._segmentToGroundQuads[e].sort(((e,t)=>e.region-t.region));for(let r=0;r<t;r++){const t=this._segmentToGroundQuads[r],n=e[r],i=this._segmentToRegionTriCounts[r];i.reduce(((e,t)=>e+t),0);let o=0;for(let e=0;e<=4;e++){const t=i[e];if(0!==t){let r=this.regionSegments[e];r||(r=this.regionSegments[e]=new mc);const i={vertexOffset:n.vertexOffset,primitiveOffset:n.primitiveOffset+o,vertexLength:n.vertexLength,primitiveLength:t};r.get().push(i)}o+=t}for(let e=0;e<t.length;e++){const r=t[e].id;this.indexArray.emplaceBack(r,r+1,r+3),this.indexArray.emplaceBack(r,r+3,r+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,t,r,n,i,o){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,t,r,n,i,o)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,Qd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,t,r,n,i,o){this.hasData()&&this.programConfigurations.updatePaintArrays(e,t,r,n,i,o)}updateHiddenByLandmark(e){if(!this.hasData())return;const t=e.groundVertexCount+e.groundVertexArrayOffset;if(0===e.groundVertexCount)return;const r=e.flags&Np?1:0;for(let n=e.groundVertexArrayOffset;n<t;++n)this.hiddenByLandmarkVertexArray.emplace(n,r);this._needsHiddenByLandmarkUpdate=!0}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,Yd.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const t=this.regionSegments[e];t&&t.destroy()}}}}class $p{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new Hl,this.footprintVertices=new El,this.footprintSegments=[],this.layoutVertexArray=new Sl,this.centroidVertexArray=new dc,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom,(e=>zp.includes(e))),this.segments=new mc,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.groundEffect=new Yp(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}populate(e,t,r,n){this.features=[],this.hasPattern=Ud("fill-extrusion",this.layers,t),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=Mu(r),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:i,id:o,index:s,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,l=Fu(i,e);if(!this.layers[0]._featureFilter.filter(new Na(this.zoom),l,r))continue;const c={id:o,sourceLayerIndex:a,index:s,geometry:e?l.geometry:Ru(i,r,n),properties:i.properties,type:i.type,patterns:{}},u=this.layoutVertexArray.length;this.hasPattern?this.features.push(Hd("fill-extrusion",this.layers,c,this.zoom,t)):this.addFeature(c,c.geometry,s,r,{},t.availableImages,n,t.brightness),t.featureIndex.insert(i,c.geometry,s,a,this.index,u)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,t,r,n,i,o){for(const e of this.features){const{geometry:s}=e;this.addFeature(e,s,e.index,t,r,n,i,o)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,t,r,n,i){const o=0!==Object.keys(e).length;if(o&&!this.stateDependentLayers.length)return;const s=o?this.stateDependentLayers:this.layers;this.programConfigurations.updatePaintArrays(e,t,s,r,n,i),this.groundEffect.update(e,t,s,r,n,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Kd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,$d.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Xd.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,n,i,o,s,a){const l=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(e,{})/this.tileToMeter,c=[new Nt(0,0),new Nt(io,io)],u=s.projection,h="globe"===u.name,d="Polygon"===kp[e.type],p=new Wp;p.centroidDataIndex=this.centroidData.length;const f=new Zp,m=this.layers[0].paint.get("fill-extrusion-base").evaluate(e,{},n)<=0,g=this.layers[0].paint.get("fill-extrusion-height").evaluate(e,{},n);f.height=g,f.vertexArrayOffset=this.layoutVertexArray.length,f.groundVertexArrayOffset=this.groundEffect.vertexArray.length,h&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new kl);const A=Nd(t,500);for(let e=A.length-1;e>=0;e--){const t=A[e];(0===t.length||(_=t[0]).every((e=>e.x<=0))||_.every((e=>e.x>=io))||_.every((e=>e.y<=0))||_.every((e=>e.y>=io)))&&A.splice(e,1)}var _;let y;if(h)y=af(A,c,n);else{y=[];for(const e of A)y.push({polygon:e,bounds:c})}const v=d?this.edgeRadius:0,x=v>0&&this.zoom<17,b=(e,t)=>{if(0===e.length)return!1;const r=e[e.length-1];return t.x===r.x&&t.y===r.y};for(const{polygon:e,bounds:t}of y){let r=0,i=0;for(const t of e)d&&!t[0].equals(t[t.length-1])&&t.push(t[0]),i+=d?t.length-1:t.length;const o=this.segments.prepareSegment((d?5:4)*i,this.layoutVertexArray,this.indexArray);f.footprintSegIdx<0&&(f.footprintSegIdx=this.footprintSegments.length),f.polygonSegIdx<0&&(f.polygonSegIdx=this.polygonSegments.length);const s={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},a=new Gp;if(a.vertexOffset=this.footprintVertices.length,a.indexOffset=3*this.footprintIndices.length,a.ringIndices=[],d){const i=[],s=[];r=o.vertexLength;for(let r=0;r<e.length;r++){const c=e[r];c.length&&0!==r&&s.push(i.length/2);const d=[];let p,f;p=c[1].sub(c[0])._perp()._unit(),a.ringIndices.push(c.length-1);for(let e=1;e<c.length;e++){const t=c[e],r=c[e===c.length-1?1:e+1],s=t.clone();if(v){f=r.sub(t)._perp()._unit();const e=p.add(f)._unit(),n=v*Math.min(4,1/(p.x*e.x+p.y*e.y));s.x+=n*e.x,s.y+=n*e.y,s.x=Math.round(s.x),s.y=Math.round(s.y),p=f}!m||0!==v&&!x||b(d,s)||d.push(s),Vp(this.layoutVertexArray,s.x,s.y,0,0,1,1,0),o.vertexLength++,this.footprintVertices.emplaceBack(t.x,t.y),i.push(t.x,t.y),h&&Hp(this.layoutVertexExtArray,u.projectTilePoint(s.x,s.y,n),u.upVector(n,s.x,s.y))}m&&(0===v||x)&&(0!==d.length&&b(d,d[0])&&d.pop(),this.groundEffect.addData(d,t,l))}const c=jd(i,s);for(let e=0;e<c.length;e+=3)this.footprintIndices.emplaceBack(a.vertexOffset+c[e+0],a.vertexOffset+c[e+1],a.vertexOffset+c[e+2]),this.indexArray.emplaceBack(r+c[e],r+c[e+2],r+c[e+1]),o.primitiveLength++;a.indexCount+=c.length,a.vertexCount+=this.footprintVertices.length-a.vertexOffset}for(let i=0;i<e.length;i++){const s=e[i];p.startRing(f,s[0]);let a=s.length>4&&nf(s[s.length-2],s[0],s[1]),c=v?Jp(s[s.length-2],s[0],s[1],v):0;const g=[];let A,_,y;_=s[1].sub(s[0])._perp()._unit();let x=!0;for(let e=1,i=0;e<s.length;e++){let l=s[e-1],d=s[e];const w=s[e===s.length-1?1:e+1];if(p.appendEdge(f,d,l),tf(d,l,t)){v&&(_=w.sub(d)._perp()._unit(),x=!x);continue}const C=d.sub(l)._perp(),E=C.x/(Math.abs(C.x)+Math.abs(C.y)),T=C.y>0?1:0,S=l.dist(d);if(i+S>32768&&(i=0),v){y=w.sub(d)._perp()._unit();let e=ef(l,d,w,Kp(_,y),v);isNaN(e)&&(e=0);const t=d.sub(l)._unit();l=l.add(t.mult(c))._round(),d=d.add(t.mult(-e))._round(),c=e,_=y,m&&this.zoom>=17&&(b(g,l)||g.push(l),b(g,d)||g.push(d))}const M=o.vertexLength,I=s.length>4&&nf(l,d,w);let P=of(i,a,x);if(Vp(this.layoutVertexArray,l.x,l.y,E,T,0,0,P),Vp(this.layoutVertexArray,l.x,l.y,E,T,0,1,P),i+=S,P=of(i,I,!x),a=I,Vp(this.layoutVertexArray,d.x,d.y,E,T,0,0,P),Vp(this.layoutVertexArray,d.x,d.y,E,T,0,1,P),o.vertexLength+=4,this.indexArray.emplaceBack(M+0,M+1,M+2),this.indexArray.emplaceBack(M+1,M+3,M+2),o.primitiveLength+=2,v){const n=r+(1===e?s.length-2:e-2),i=1===e?r:n+1;if(this.indexArray.emplaceBack(M+1,n,M+3),this.indexArray.emplaceBack(n,i,M+3),o.primitiveLength+=2,void 0===A&&(A=M),!tf(w,s[e],t)){const t=e===s.length-1?A:o.vertexLength;this.indexArray.emplaceBack(M+2,M+3,t),this.indexArray.emplaceBack(M+3,t+1,t),this.indexArray.emplaceBack(M+3,i,t+1),o.primitiveLength+=3}x=!x}if(h){const e=this.layoutVertexExtArray,t=u.projectTilePoint(l.x,l.y,n),r=u.projectTilePoint(d.x,d.y,n),i=u.upVector(n,l.x,l.y),o=u.upVector(n,d.x,d.y);Hp(e,t,i),Hp(e,t,i),Hp(e,r,o),Hp(e,r,o)}}d&&(r+=s.length-1),m&&v&&this.zoom>=17&&(0!==g.length&&b(g,g[0])&&g.pop(),this.groundEffect.addData(g,t,l,v>0))}this.footprintSegments.push(a),s.triangleCount=this.indexArray.length-s.triangleArrayOffset,this.polygonSegments.push(s),++f.footprintSegLen,++f.polygonSegLen}if(f.vertexCount=this.layoutVertexArray.length-f.vertexArrayOffset,f.groundVertexCount=this.groundEffect.vertexArray.length-f.groundVertexArrayOffset,0!==f.vertexCount){if(f.centroidXY=p.borders?jp:this.encodeCentroid(p,f),this.centroidData.push(f),p.borders){this.featuresOnBorder.push(p);const e=this.featuresOnBorder.length-1;for(let t=0;t<p.borders.length;t++)p.borders[t][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[t].push(e)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,o,n,a),this.groundEffect.addPaintPropertiesData(e,r,i,o,n,a),this.maxHeight=Math.max(this.maxHeight,g)}}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort(((t,r)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[r].borders[e][0]))}splitToSubtiles(){const e=[];for(let t=0;t<this.centroidData.length;t++){const r=this.centroidData[t],n=+(r.min.y+r.max.y>io),i=2*n+(+(r.min.x+r.max.x>io)^n);for(let n=0;n<r.polygonSegLen;n++){const o=r.polygonSegIdx+n;e.push({centroidIdx:t,subtile:i,polygonSegmentIdx:o,triangleSegmentIdx:this.polygonSegments[o].triangleSegIdx})}}const t=new Hl;e.sort(((e,t)=>e.triangleSegmentIdx===t.triangleSegmentIdx?e.subtile-t.subtile:e.triangleSegmentIdx-t.triangleSegmentIdx));let r=0,n=0,i=0;for(const t of e){if(t.triangleSegmentIdx!==r)break;i++}const o=e.length;for(;n!==e.length;){r=e[n].triangleSegmentIdx;let s=0,a=n,l=n;for(let t=a;t<i&&e[t].subtile===s;t++)l++;for(;a!==i;){const n=e[a];s=n.subtile;const o=this.centroidData[n.centroidIdx].min.clone(),c=this.centroidData[n.centroidIdx].max.clone(),u={vertexOffset:this.segments.segments[r].vertexOffset,primitiveOffset:t.length,vertexLength:this.segments.segments[r].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let r=a;r<l;r++){const n=e[r],i=this.polygonSegments[n.polygonSegmentIdx],s=this.centroidData[n.centroidIdx].min,a=this.centroidData[n.centroidIdx].max,l=this.indexArray.uint16;for(let e=i.triangleArrayOffset;e<i.triangleArrayOffset+i.triangleCount;e++)t.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);u.primitiveLength+=i.triangleCount,o.x=Math.min(o.x,s.x),o.y=Math.min(o.y,s.y),c.x=Math.max(c.x,a.x),c.y=Math.max(c.y,a.y)}u.primitiveLength>0&&this.triangleSubSegments.push({segment:u,min:o,max:c}),a=l;for(let t=a;t<i&&e[t].subtile===e[a].subtile;t++)l++}n=i;for(let t=n;t<o&&e[t].triangleSegmentIdx===e[n].triangleSegmentIdx;t++)i++}t._trim(),this.indexArray=t}getVisibleSegments(e,t,r){let n=0,i=0;const o=1<<e.canonical.z;if(t){const r=t.getMinMaxForTile(e);r&&(n=r.min,i=r.max)}i+=this.maxHeight;const s=e.toUnwrapped();let a;const l=[s.canonical.x/o+s.wrap,s.canonical.y/o],c=[(s.canonical.x+1)/o+s.wrap,(s.canonical.y+1)/o],u=new mc,h=(e,t,r)=>[e[0]*(1-r[0])+t[0]*r[0],e[1]*(1-r[1])+t[1]*r[1]],d=[],p=[];for(const e of this.triangleSubSegments){d[0]=e.min.x/io,d[1]=e.min.y/io,p[0]=e.max.x/io,p[1]=e.max.y/io;const t=h(l,c,d),o=h(l,c,p);if(0===new mh([t[0],t[1],n],[o[0],o[1],i]).intersectsPrecise(r)){a&&(u.segments.push(a),a=void 0);continue}const s=e.segment;a&&a.vertexOffset!==s.vertexOffset&&(u.segments.push(a),a=void 0),a?(a.vertexLength+=s.vertexLength,a.primitiveLength+=s.primitiveLength):a={vertexOffset:s.vertexOffset,primitiveLength:s.primitiveLength,vertexLength:s.vertexLength,primitiveOffset:s.primitiveOffset,sortKey:void 0,vaos:{}}}return a&&u.segments.push(a),u}encodeCentroid(e,t){const r=e.centroid(),n=t.span(),i=Math.min(7,Math.round(n.x*this.tileToMeter/10)),o=Math.min(7,Math.round(n.y*this.tileToMeter/10));return new Nt(Xt(r.x,1,io-1)<<3|i,Xt(r.y,1,io-1)<<3|o)}encodeBorderCentroid(e){if(!e.borders)return new Nt(0,0);const t=e.borders,r=Number.MAX_VALUE;if(t[0][0]!==r||t[1][0]!==r){const e=t[0][0]!==r?0:1;return new Nt(6|(t[0][0]!==r?0:65528),(t[e][0]+t[e][1])/2<<3|6)}{const e=t[2][0]!==r?2:3;return new Nt((t[e][0]+t[e][1])/2<<3|6,6|(t[2][0]!==r?0:65528))}}showCentroid(e){const t=this.centroidData[e.centroidDataIndex];t.flags&=Np,t.centroidXY.x=0,t.centroidXY.y=0,this.writeCentroidToBuffer(t)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const t=e.vertexArrayOffset,r=e.vertexCount+e.vertexArrayOffset,n=e.flags&Np?jp:e.centroidXY,i=this.centroidVertexArray.geta_centroid_pos0(t);if(this.centroidVertexArray.geta_centroid_pos1(t)!==n.y||i!==n.x){for(let e=t;e<r;++e)this.centroidVertexArray.emplace(e,n.x,n.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.centroidData)this.writeCentroidToBuffer(e)}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped());if(function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].sourceId!==t[r].sourceId||!mp(e[r],t[r]))return!1;return!0}(this.activeReplacements,r))return;if(this.activeReplacements=r,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(const e of this.centroidData)e.flags&=2147483647;const n=[];for(const t of this.activeReplacements){const r=Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z);for(const i of this.centroidData)if(!(i.flags&Np||t.min.x>i.max.x||i.min.x>t.max.x||t.min.y>i.max.y||i.min.y>t.max.y))for(let o=0;o<i.footprintSegLen;o++){const s=this.footprintSegments[i.footprintSegIdx+o];if(n.length=0,lf(this.footprintVertices,s.vertexOffset,s.vertexCount,t.footprintTileId.canonical,e.canonical,n),yp(t.footprint,n,this.footprintIndices.uint16,s.indexOffset,s.indexCount,-s.vertexOffset,-r)){i.flags|=Np;break}}}for(const e of this.centroidData)this.writeCentroidToBuffer(e);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,t,r){let n=!1;for(let i=0;i<r.footprintSegLen;i++){const o=this.footprintSegments[r.footprintSegIdx+i];let s=0;for(const r of o.ringIndices){for(let i=s,a=r+s-1;i<r+s;a=i++){const r=this.footprintVertices.int16[2*(i+o.vertexOffset)+0],s=this.footprintVertices.int16[2*(i+o.vertexOffset)+1],l=this.footprintVertices.int16[2*(a+o.vertexOffset)+1];s>t!=l>t&&e<(this.footprintVertices.int16[2*(a+o.vertexOffset)+0]-r)*(t-s)/(l-s)+r&&(n=!n)}s=r}}return n}getHeightAtTileCoord(e,t){let r=Number.NEGATIVE_INFINITY,n=!0;const i=4*(e+io)*io+(t+io);if(this.partLookup.hasOwnProperty(i)){const e=this.partLookup[i];return e?{height:e.height,hidden:!!(e.flags&Np)}:void 0}for(const o of this.centroidData)e>o.max.x||o.min.x>e||t>o.max.y||o.min.y>t||this.footprintContainsPoint(e,t,o)&&o&&o.height>r&&(r=o.height,this.partLookup[i]=o,n=!!(o.flags&Np));if(r!==Number.NEGATIVE_INFINITY)return{height:r,hidden:n};this.partLookup[i]=void 0}}function Kp(e,t){const r=e.add(t)._unit();return e.x*r.x+e.y*r.y}function Jp(e,t,r,n){const i=t.sub(e)._perp()._unit(),o=r.sub(t)._perp()._unit();return ef(e,t,r,Kp(i,o),n)}function ef(e,t,r,n,i){const o=Math.sqrt(1-n*n);return Math.min(e.dist(t)/3,t.dist(r)/3,i*o/n)}function tf(e,t,r){return e.x<r[0].x&&t.x<r[0].x||e.x>r[1].x&&t.x>r[1].x||e.y<r[0].y&&t.y<r[0].y||e.y>r[1].y&&t.y>r[1].y}function rf(e,t){return e.x<t[0].x||e.x>t[1].x||e.y<t[0].y||e.y>t[1].y}function nf(e,t,r){if(e.x<0||e.x>=io||t.x<0||t.x>=io||r.x<0||r.x>=io)return!1;const n=r.sub(t),i=n.perp(),o=e.sub(t);return(n.x*o.x+n.y*o.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(o.x*o.x+o.y*o.y))>-.866&&i.x*o.x+i.y*o.y<0}function of(e,t,r){const n=t?2|e:-3&e;return r?1|n:-2&n}function sf(){const e=Math.PI/32,t=Math.tan(e),r=iu;return r*Math.sqrt(1+2*t*t)-r}function af(e,t,r){const n=1<<r.z,i=xu(r.x/n),o=xu((r.x+1)/n),s=bu(r.y/n),a=bu((r.y+1)/n);return function(e,t,r,n,i=0,o){const s=[];if(!e.length||!r||!n)return s;const a=(e,t)=>{for(const r of e)s.push({polygon:r,bounds:t})},l=Math.ceil(Math.log2(r)),c=Math.ceil(Math.log2(n)),u=l-c,h=[];for(let e=0;e<Math.abs(u);e++)h.push(u>0?0:1);for(let e=0;e<Math.min(l,c);e++)h.push(0),h.push(1);let d=e;if(d=pp(d,t[0].y-i,t[1].y+i,1),d=pp(d,t[0].x-i,t[1].x+i,0),!d.length)return s;const p=[];for(h.length?p.push({polygons:d,bounds:t,depth:0}):a(d,t);p.length;){const e=p.pop(),t=e.depth,r=h[t],n=e.bounds[0],s=e.bounds[1],l=0===r?n.x:n.y,c=0===r?s.x:s.y,u=o?o(r,l,c):.5*(l+c),d=pp(e.polygons,l-i,u+i,r),f=pp(e.polygons,u-i,c+i,r);if(d.length){const e=[n,new Nt(0===r?u:s.x,1===r?u:s.y)];h.length>t+1?p.push({polygons:d,bounds:e,depth:t+1}):a(d,e)}if(f.length){const e=[new Nt(0===r?u:n.x,1===r?u:n.y),s];h.length>t+1?p.push({polygons:f,bounds:e,depth:t+1}):a(f,e)}}return s}(e,t,Math.ceil((o-i)/11.25),Math.ceil((s-a)/11.25),1,((e,t,i)=>{if(0===e)return.5*(t+i);{const e=bu((r.y+t/io)/n);return(yu(.5*(bu((r.y+i/io)/n)+e))*n-r.y)*io}}))}function lf(e,t,r,n,i,o){const s=Math.pow(2,n.z-i.z);for(let a=0;a<r;a++){let r=e.int16[2*(a+t)+0],l=e.int16[2*(a+t)+1];r=(r+i.x*io)*s-n.x*io,l=(l+i.y*io)*s-n.y*io,o.push(new Nt(r,l))}}fa($p,"FillExtrusionBucket",{omit:["layers","features"]}),fa(Zp,"PartData"),fa(Gp,"FootprintSegment"),fa(Wp,"BorderCentroidData"),fa(Yp,"GroundEffect");const cf=new Ka({visibility:new Xa(tl["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new Xa(tl["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var uf={paint:new Ka({"fill-extrusion-opacity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-emissive-strength"])}),layout:cf};class hf extends Nt{constructor(e,t,r){super(e,t),this.z=r}}function df(e,t){return e.x*t.x+e.y*t.y}function pf(e,t){if(1===e.length){let r=0;const n=t[r++];let i;for(;!i||n.equals(i);)if(i=t[r++],!i)return 1/0;for(;r<t.length;r++){const o=t[r],s=e[0],a=i.sub(n),l=o.sub(n),c=s.sub(n),u=df(a,a),h=df(a,l),d=df(l,l),p=df(c,a),f=df(c,l),m=u*d-h*h,g=(d*p-h*f)/m,A=(u*f-h*p)/m,_=n.z*(1-g-A)+i.z*g+o.z*A;if(isFinite(_))return _}return 1/0}{let e=1/0;for(const r of t)e=Math.min(e,r.z);return e}}function ff(e,t,r,n,i,o,s,a){const l=s*i.getElevationAt(e,t,!0,!0),c=0!==o[0],u=c?0===o[1]?s*(o[0]/7-450):s*function(e,t,r){const n=Math.floor(t[0]/8),i=Math.floor(t[1]/8),o=10*(t[0]-8*n),s=10*(t[1]-8*i),a=e.getElevationAt(n,i,!0,!0),l=e.getMeterToDEM(r),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(s*l-1)),h=e.tileCoordToPixel(n,i),d=2*c+1,p=2*u+1,f=function(e,t,r,n,i){return[e.getElevationAtPixel(t,r,!0),e.getElevationAtPixel(t+i,r,!0),e.getElevationAtPixel(t,r+i,!0),e.getElevationAtPixel(t+n,r+i,!0)]}(e,h.x-c,h.y-u,d,p),m=Math.abs(f[0]-f[1]),g=Math.abs(f[2]-f[3]),A=Math.abs(f[0]-f[2])+Math.abs(f[1]-f[3]),_=Math.min(.25,.5*l*(m+g)/d),y=Math.min(.25,.5*l*A/p);return a+Math.max(_*o,y*s)}(i,o,a):l;return{base:l+(0===r)?-1:r,top:c?Math.max(u+n,l+r+2):l+n}}const mf=wl([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:gf}=mf,Af=wl([{name:"a_packed",components:4,type:"Float32"}]),{members:_f}=Af,yf=wl([{name:"a_pattern_data",components:2,type:"Float32"}]),{members:vf}=yf;class xf{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new rd({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const r=this.getKey(e,t);return this.positions[r]}trim(){const e=this.width,t=this.height=nr(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,r){const n=[];let i=e.length%2==1?-e[e.length-1]*r:0,o=e[0]*r,s=!0;n.push({left:i,right:o,isDash:s,zeroLength:0===e[0]});let a=e[0];for(let t=1;t<e.length;t++){s=!s;const l=e[t];i=a*r,a+=l,o=a*r,n.push({left:i,right:o,isDash:s,zeroLength:0===l})}return n}addRoundDash(e,t,r){const n=t/2;for(let t=-r;t<=r;t++){const i=this.width*(this.nextRow+r+t);let o=0,s=e[o];for(let a=0;a<this.width;a++){a/s.right>1&&(s=e[++o]);const l=Math.abs(a-s.left),c=Math.abs(a-s.right),u=Math.min(l,c);let h;const d=t/r*(n+1);if(s.isDash){const e=n-Math.abs(d);h=Math.sqrt(u*u+e*e)}else h=n-Math.sqrt(u*u+d*d);this.image.data[i+a]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}const r=e[0],n=e[e.length-1];r.isDash===n.isDash&&(r.left=n.left-this.width,n.right=r.right+this.width);const i=this.width*this.nextRow;let o=0,s=e[o];for(let r=0;r<this.width;r++){r/s.right>1&&(s=e[++o]);const n=Math.abs(r-s.left),a=Math.abs(r-s.right),l=Math.min(n,a);this.image.data[i+r]=Math.max(0,Math.min(255,(s.isDash?l:-l)+t+128))}}addDash(e,t){const r=this.getKey(e,t);if(this.positions[r])return this.positions[r];const n="round"===t,i=n?7:0,o=2*i+1;if(this.nextRow+o>this.height)return hr("LineAtlas out of space"),null;0===e.length&&e.push(1);let s=0;for(let t=0;t<e.length;t++)e[t]<0&&(hr("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),s+=e[t];if(0!==s){const r=this.width/s,o=this.getDashRanges(e,this.width,r);n?this.addRoundDash(o,r,i):this.addRegularDash(o,"square"===t?.5*r:0)}const a=this.nextRow+i;this.nextRow+=o;const l={tl:[a,i],br:[s,0]};return this.positions[r]=l,l}}fa(xf,"LineAtlas");const bf=dp.types,wf=Math.cos(Math.PI/180*37.5),Cf=Math.cos(Math.PI/180*5);class Ef{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Il,this.layoutVertexArray2=new Pl,this.patternVertexArray=new Ll,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom),this.segments=new mc,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r,n){this.hasPattern=Ud("line",this.layers,t);const i=this.layers[0].layout.get("line-sort-key"),o=[];for(const{feature:t,id:s,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Fu(t,e);if(!this.layers[0]._featureFilter.filter(new Na(this.zoom),c,r))continue;const u=i?i.evaluate(c,{},r):void 0,h={id:s,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Ru(t,r,n),patterns:{},sortKey:u};o.push(h)}i&&o.sort(((e,t)=>e.sortKey-t.sortKey));const{lineAtlas:s,featureIndex:a}=t,l=this.addConstantDashes(s);for(const n of o){const{geometry:i,index:o,sourceLayerIndex:c}=n;if(l&&this.addFeatureDashes(n,s),this.hasPattern){const e=Hd("line",this.layers,n,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(n,i,o,r,s.positions,t.availableImages,t.brightness);a.insert(e[o].feature,i,o,c,this.index)}}addConstantDashes(e){let t=!1;for(const r of this.layers){const n=r.paint.get("line-dasharray").value,i=r.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==i.kind)t=!0;else{const t=i.value,r=n.value;if(!r)continue;e.addDash(r,t)}}return t}addFeatureDashes(e,t){const r=this.zoom;for(const n of this.layers){const i=n.paint.get("line-dasharray").value,o=n.layout.get("line-cap").value;if("constant"===i.kind&&"constant"===o.kind)continue;let s,a;if("constant"===i.kind){if(s=i.value,!s)continue}else s=i.evaluate({zoom:r},e);a="constant"===o.kind?o.value:o.evaluate({zoom:r},e),t.addDash(s,a),e.patterns[n.id]=t.getKey(s,a)}}update(e,t,r,n,i){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,n,i)}addFeatures(e,t,r,n,i,o){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r,n,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,_f)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,vf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,gf),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,r,n,i,o,s){const a=this.layers[0].layout,l=a.get("line-join").evaluate(e,{}),c=a.get("line-cap").evaluate(e,{}),u=a.get("line-miter-limit"),h=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const r of t)this.addLine(r,e,l,c,u,h);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,o,n,s)}addLine(e,t,r,n,i,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0;const s="none"===r;if(this.patternJoinNone=this.hasPattern&&s,this.segmentStart=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===bf[t.type];let l=e.length;for(;l>=2&&e[l-1].equals(e[l-2]);)l--;let c=0;for(;c<l-1&&e[c].equals(e[c+1]);)c++;if(l<(a?3:2))return;"bevel"===r&&(i=1.05);const u=this.overscaling<=16?15*io/(512*this.overscaling):0,h=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray);let d,p,f,m,g;this.e1=this.e2=-1,a&&(d=e[l-2],g=e[c].sub(d)._unit()._perp());for(let t=c;t<l;t++){if(f=t===l-1?a?e[c+1]:void 0:e[t+1],f&&e[t].equals(f))continue;g&&(m=g),d&&(p=d),d=e[t],g=f?f.sub(d)._unit()._perp():m,m=m||g;const A=p&&f;let _=A?r:a||s?"butt":n;const y=m.x*g.x+m.y*g.y;if(s){const e=function(e){if(e.patternJoinNone){const t=e.segmentPoints.length/2,r=e.lineSoFar-e.segmentStart;for(let n=0;n<t;++n){const t=e.segmentPoints[2*n+1],i=Math.round(e.segmentPoints[2*n])+.5+.25*t;e.patternVertexArray.emplaceBack(i,r),e.patternVertexArray.emplaceBack(i,r)}e.segmentPoints=[],e.segmentStart=e.lineSoFar}e.e1=e.e2=-1};if(A&&y<Cf){this.updateDistance(p,d),this.addCurrentVertex(d,m,1,1,h),e(this),this.addCurrentVertex(d,g,-1,-1,h);continue}if(p){if(!f){this.updateDistance(p,d),this.addCurrentVertex(d,m,1,1,h),e(this);continue}_="miter"}}let v=m.add(g);0===v.x&&0===v.y||v._unit();const x=v.x*g.x+v.y*g.y,b=0!==x?1/x:1/0,w=2*Math.sqrt(2-2*x),C=x<wf&&p&&f,E=m.x*g.y-m.y*g.x>0;if(C&&t>c){const e=d.dist(p);if(e>2*u){const t=d.sub(d.sub(p)._mult(u/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,m,0,0,h),p=t}}if(A&&"round"===_&&(b<o?_="miter":b<=2&&(_="fakeround")),"miter"===_&&b>i&&(_="bevel"),"bevel"===_&&(b>2&&(_="flipbevel"),b<i&&(_="miter")),p&&this.updateDistance(p,d),"miter"===_)v._mult(b),this.addCurrentVertex(d,v,0,0,h);else if("flipbevel"===_){if(b>100)v=g.mult(-1);else{const e=b*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(e*(E?-1:1))}this.addCurrentVertex(d,v,0,0,h),this.addCurrentVertex(d,v.mult(-1),0,0,h)}else if("bevel"===_||"fakeround"===_){const e=-Math.sqrt(b*b-1),t=E?e:0,r=E?0:e;if(p&&this.addCurrentVertex(d,m,t,r,h),"fakeround"===_){const e=Math.round(180*w/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){const e=r-.5;r+=r*e*(r-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*e*e+(.848013+y*(.215638*y-1.06021)))}const n=g.sub(m)._mult(r)._add(m)._unit()._mult(E?-1:1);this.addHalfVertex(d,n.x,n.y,!1,E,0,h)}}f&&this.addCurrentVertex(d,g,-t,-r,h)}else"butt"===_?this.addCurrentVertex(d,v,0,0,h):"square"===_?(p||this.addCurrentVertex(d,v,-1,-1,h),this.addCurrentVertex(d,v,0,0,h),p&&this.addCurrentVertex(d,v,1,1,h)):"round"===_&&(p&&(this.addCurrentVertex(d,m,0,0,h),this.addCurrentVertex(d,m,1,1,h,!0)),f&&(this.addCurrentVertex(d,g,-1,-1,h,!0),this.addCurrentVertex(d,g,0,0,h)));if(C&&t<l-1){const e=d.dist(f);if(e>2*u){const t=d.add(f.sub(d)._mult(u/e)._round());this.updateDistance(d,t),this.addCurrentVertex(t,g,0,0,h),d=t}}}}addCurrentVertex(e,t,r,n,i,o=!1){const s=t.y*n-t.x,a=-t.y-t.x*n;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,o,!1,r,i),this.addHalfVertex(e,s,a,o,!0,-n,i),this.patternJoinNone&&this.segmentPoints.push(this.lineSoFar-this.segmentStart,r)}addHalfVertex({x:e,y:t},r,n,i,o,s,a){this.layoutVertexArray.emplaceBack((e<<1)+(i?1:0),(t<<1)+(o?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===s?0:s<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),o?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}fa(Ef,"LineBucket",{omit:["layers","patternFeatures"]});const Tf=new Ka({"line-cap":new Ya(tl.layout_line["line-cap"]),"line-join":new Ya(tl.layout_line["line-join"]),"line-miter-limit":new Xa(tl.layout_line["line-miter-limit"]),"line-round-limit":new Xa(tl.layout_line["line-round-limit"]),"line-sort-key":new Ya(tl.layout_line["line-sort-key"]),visibility:new Xa(tl.layout_line.visibility)});var Sf={paint:new Ka({"line-opacity":new Ya(tl.paint_line["line-opacity"]),"line-color":new Ya(tl.paint_line["line-color"]),"line-translate":new Xa(tl.paint_line["line-translate"]),"line-translate-anchor":new Xa(tl.paint_line["line-translate-anchor"]),"line-width":new Ya(tl.paint_line["line-width"]),"line-gap-width":new Ya(tl.paint_line["line-gap-width"]),"line-offset":new Ya(tl.paint_line["line-offset"]),"line-blur":new Ya(tl.paint_line["line-blur"]),"line-dasharray":new Ya(tl.paint_line["line-dasharray"]),"line-pattern":new Ya(tl.paint_line["line-pattern"]),"line-gradient":new $a(tl.paint_line["line-gradient"]),"line-trim-offset":new Xa(tl.paint_line["line-trim-offset"]),"line-emissive-strength":new Xa(tl.paint_line["line-emissive-strength"]),"line-border-width":new Ya(tl.paint_line["line-border-width"]),"line-border-color":new Ya(tl.paint_line["line-border-color"])}),layout:Tf};function Mf(e,t,r){return t*(io/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}function If(e,t){return 1/Mf(e,1,t.tileZoom)}function Pf(e,t,r,n){return e.translatePosMatrix(n||t.tileID.projMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Lf=e=>{const t=[];Of(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const r=e.paint.get("line-trim-offset");0===r[0]&&0===r[1]||t.push("RENDER_LINE_TRIM_OFFSET"),0!==e.paint.get("line-border-width").constantOr(1)&&t.push("RENDER_LINE_BORDER");const n="none"===e.layout.get("line-join").constantOr("miter"),i=!!e.paint.get("line-pattern").constantOr(1);return n&&i&&t.push("LINE_JOIN_NONE"),t};function Of(e){const t=e.paint.get("line-dasharray").value;return t.value||"constant"!==t.kind}const Df=new class extends Ya{possiblyEvaluate(e,t){return t=new Na(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,n){return t=Jt({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,n)}}(Sf.paint.properties["line-width"].specification);function kf(e,t){return t>0?t+2*e:e}Df.useIntegerZoom=!0;const zf=wl([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Bf=wl([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Rf=wl([{name:"a_projected_pos",components:4,type:"Float32"}],4);wl([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ff=wl([{name:"a_z_offset",components:1,type:"Float32"}],4),jf=wl([{name:"a_texb",components:2,type:"Uint16"}]),Nf=wl([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Vf=wl([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_z_offset",components:1,type:"Float32"}]);wl([{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 Uf=wl([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Hf=wl([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);wl([{name:"triangle",components:3,type:"Uint16"}]),wl([{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"}]),wl([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{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"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"}]),wl([{type:"Float32",name:"offsetX"}]),wl([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Gf=24;const Zf=128;function Wf(e,t){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Na(e+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:n}=r;let i=0;for(;i<t.length&&t[i]<=e;)i++;i=Math.max(0,i-1);let o=i;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const s=t[i],a=t[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:a,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:a,minSize:r.evaluate(new Na(s)),maxSize:r.evaluate(new Na(a)),interpolationType:n}}}function qf(e,{uSize:t,uSizeT:r},{lowerSize:n,upperSize:i}){return"source"===e.kind?n/Zf:"composite"===e.kind?Hn(n/Zf,i/Zf,r):t}function Qf(e,t){let r=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){const{interpolationType:i,minZoom:o,maxZoom:s}=e,a=i?Xt(ds.interpolationFactor(i,t,o,s),0,1):0;"camera"===e.kind?n=Hn(e.minSize,e.maxSize,a):r=a}return{uSizeT:r,uSize:n}}var Xf=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:Zf,evaluateSizeForFeature:qf,evaluateSizeForZoom:Qf,getSizeData:Wf});function Yf(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){const n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),ja.applyArabicShaping&&(e=ja.applyArabicShaping(e)),e}(e.text,t,r)})),e}const $f={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function Kf(e){return"︶"===e||"﹈"===e||"︸"===e||"﹄"===e||"﹂"===e||"︾"===e||"︼"===e||"︺"===e||"︘"===e||"﹀"===e||"︐"===e||"︓"===e||"︔"===e||"`"===e||" ̄"===e||"︑"===e||"︒"===e}function Jf(e){return"︵"===e||"﹇"===e||"︷"===e||"﹃"===e||"﹁"===e||"︽"===e||"︻"===e||"︹"===e||"︗"===e||"︿"===e}var em={
|
|
34
34
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
35
35
|
read:function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=f,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=f,s/=256,c-=8);e[r+p-f]|=128*m}},tm=nm,rm=em;function nm(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}nm.Varint=0,nm.Fixed64=1,nm.Bytes=2,nm.Fixed32=5;var im=4294967296,om=1/im,sm="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function am(e){return e.type===nm.Bytes?e.readVarint()+e.pos:e.pos+1}function lm(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function cm(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function um(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function hm(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function dm(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function pm(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function fm(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function mm(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function gm(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Am(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function _m(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function ym(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function vm(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function xm(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}nm.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=ym(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=xm(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=ym(this.buf,this.pos)+ym(this.buf,this.pos+4)*im;return this.pos+=8,e},readSFixed64:function(){var e=ym(this.buf,this.pos)+xm(this.buf,this.pos+4)*im;return this.pos+=8,e},readFloat:function(){var e=rm.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=rm.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return lm(e,n,t);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return lm(e,n,t);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return lm(e,n,t);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return lm(e,n,t);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return lm(e,n,t);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return lm(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&sm?function(e,t,r){return sm.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){for(var n="",i=t;i<r;){var o,s,a,l=e[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(o=e[i+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(s=e[i+2],128==(192&(o=e[i+1]))&&128==(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(s=e[i+2],a=e[i+3],128==(192&(o=e[i+1]))&&128==(192&s)&&128==(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==nm.Bytes)return e.push(this.readVarint(t));var r=am(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==nm.Bytes)return e.push(this.readSVarint());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==nm.Bytes)return e.push(this.readBoolean());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==nm.Bytes)return e.push(this.readFloat());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==nm.Bytes)return e.push(this.readDouble());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==nm.Bytes)return e.push(this.readFixed32());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==nm.Bytes)return e.push(this.readSFixed32());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==nm.Bytes)return e.push(this.readFixed64());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==nm.Bytes)return e.push(this.readSFixed64());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===nm.Varint)for(;this.buf[this.pos++]>127;);else if(t===nm.Bytes)this.pos=this.readVarint()+this.pos;else if(t===nm.Fixed32)this.pos+=4;else{if(t!==nm.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),vm(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),vm(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),vm(this.buf,-1&e,this.pos),vm(this.buf,Math.floor(e*om),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),vm(this.buf,-1&e,this.pos),vm(this.buf,Math.floor(e*om),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,r.buf[r.pos]=127&(e>>>=7)}(r,0,t),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,o=0;o<t.length;o++){if((n=t.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&cm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),rm.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),rm.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&cm(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,nm.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,um,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,hm,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,fm,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,dm,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,pm,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,mm,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,gm,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Am,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,_m,t)},writeBytesField:function(e,t){this.writeTag(e,nm.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,nm.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,nm.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,nm.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,nm.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,nm.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,nm.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,nm.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,nm.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,nm.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var bm=h(tm);const wm=3;function Cm(e,t,r){t.glyphs=[],1===e&&r.readMessage(Em,t)}function Em(e,t,r){if(3===e){const{id:e,bitmap:n,width:i,height:o,left:s,top:a,advance:l}=r.readMessage(Tm,{});t.glyphs.push({id:e,bitmap:new rd({width:i+2*wm,height:o+2*wm},n),metrics:{width:i,height:o,left:s,top:a,advance:l}})}else 4===e?t.ascender=r.readSVarint():5===e&&(t.descender=r.readSVarint())}function Tm(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}const Sm=wm,Mm={horizontal:1,vertical:2,horizontalOnly:3};class Im{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const r=new Im;return r.scale=e||1,r.fontStack=t,r}static forImage(e){const t=new Im;return t.imageName=e,t}}class Pm{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const r=new Pm;for(let n=0;n<e.sections.length;n++){const i=e.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,t)}return r}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCodePoint(e){return this.text.codePointAt(e)}verticalizePunctuation(e){this.text=function(e,t){let r="";for(let n=0;n<e.length;n++){const i=e.charCodeAt(n+1)||null,o=e.charCodeAt(n-1)||null;r+=!t&&(i&&Ca(i)&&!$f[e[n+1]]||o&&Ca(o)&&!$f[e[n-1]])||!$f[e[n]]?e[n]:$f[e[n]]}return r}(this.text,e)}trim(){let e=0;for(let t=0;t<this.text.length&&Om[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&Om[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const r=new Pm;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(Im.forText(e.scale,e.fontStack||t));const r=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(r)}addImageSection(e){const t=e.image?e.image.namePrimary:"";if(0===t.length)return void hr("Can't add FormattedSection with an empty image.");const r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCodePoint(r),this.sections.push(Im.forImage(t)),this.sectionIndex.push(this.sections.length-1)):hr("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Lm(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f){const m=Pm.fromFeature(e,i);h===Mm.vertical&&m.verticalizePunctuation(d);let g=[];const A=function(e,t,r,n,i,o){if(!e)return[];const s=[],a=function(e,t,r,n,i,o){let s=0;for(let r=0;r<e.length();r++){const a=e.getSection(r);s+=km(e.getCodePoint(r),a,n,i,t,o)}return s/Math.max(1,Math.ceil(s/r))}(e,t,r,n,i,o),l=e.text.indexOf("")>=0;let c=0;for(let r=0;r<e.length();r++){const h=e.getSection(r),d=e.getCodePoint(r);if(Om[d]||(c+=km(d,h,n,i,t,o)),r<e.length()-1){const t=!((u=d)<11904||!(ya["Bopomofo Extended"](u)||ya.Bopomofo(u)||ya["CJK Compatibility Forms"](u)||ya["CJK Compatibility Ideographs"](u)||ya["CJK Compatibility"](u)||ya["CJK Radicals Supplement"](u)||ya["CJK Strokes"](u)||ya["CJK Symbols and Punctuation"](u)||ya["CJK Unified Ideographs Extension A"](u)||ya["CJK Unified Ideographs"](u)||ya["Enclosed CJK Letters and Months"](u)||ya["Halfwidth and Fullwidth Forms"](u)||ya.Hiragana(u)||ya["Ideographic Description Characters"](u)||ya["Kangxi Radicals"](u)||ya["Katakana Phonetic Extensions"](u)||ya.Katakana(u)||ya["Vertical Forms"](u)||ya["Yi Radicals"](u)||ya["Yi Syllables"](u)));(Dm[d]||t||h.imageName)&&s.push(Rm(r+1,c,a,s,Bm(d,e.getCodePoint(r+1),t&&l),!1))}}var u;return Fm(Rm(e.length(),c,a,s,0,!0))}(m,c,o,t,n,p),{processBidirectionalText:_,processStyledBidirectionalText:y}=ja;if(_&&1===m.sections.length){const e=_(m.toString(),A);for(const t of e){const e=new Pm;e.text=t,e.sections=m.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);g.push(e)}}else if(y){const e=y(m.text,m.sectionIndex,A);for(const t of e){const e=new Pm;e.text=t[0],e.sectionIndex=t[1],e.sections=m.sections,g.push(e)}}else g=function(e,t){const r=[],n=e.text;let i=0;for(const n of t)r.push(e.substring(i,n)),i=n;return i<n.length&&r.push(e.substring(i,n.length)),r}(m,A);const v=[],x={positionedLines:v,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(e,t,r,n,i,o,s,a,l,c,u,h){let d=0,p=0,f=0;const m="right"===a?1:"left"===a?0:.5;let g=!1;for(const e of i){const r=e.getSections();for(const e of r){if(e.imageName)continue;const r=t[e.fontStack];if(r&&(g=void 0!==r.ascender&&void 0!==r.descender,!g))break}if(!g)break}let A=0;for(const s of i){s.trim();const i=s.getMaxScale(),a=(i-1)*Gf,y={positionedGlyphs:[],lineOffset:0};e.positionedLines[A]=y;const v=y.positionedGlyphs;let x=0;if(!s.length()){p+=o,++A;continue}let b=0,w=0;for(let o=0;o<s.length();o++){const a=s.getSection(o),f=s.getSectionIndex(o),m=s.getCodePoint(o);let A=a.scale,y=null,C=null,E=null,T=Gf,S=0;const M=!(l===Mm.horizontal||!u&&!wa(m)||u&&(Om[m]||(_=m,ya.Arabic(_)||ya["Arabic Supplement"](_)||ya["Arabic Extended-A"](_)||ya["Arabic Presentation Forms-A"](_)||ya["Arabic Presentation Forms-B"](_))));if(a.imageName){const t=n[a.imageName];if(!t)continue;E=a.imageName,e.iconsInText=e.iconsInText||!0,C=t.paddedRect;const r=t.displaySize;A=A*Gf/h,y={width:r[0],height:r[1],left:0,top:-Sm,advance:M?r[1]:r[0],localGlyph:!1},S=g?-y.height*A:i*Gf-17-r[1]*A,T=y.advance;const o=(M?r[0]:r[1])*A-Gf*i;o>0&&o>x&&(x=o)}else{const e=r[a.fontStack];if(!e)continue;e[m]&&(C=e[m]);const n=t[a.fontStack];if(!n)continue;const o=n.glyphs[m];if(!o)continue;if(y=o.metrics,T=8203!==m?Gf:0,g){const e=void 0!==n.ascender?Math.abs(n.ascender):0,t=void 0!==n.descender?Math.abs(n.descender):0,r=(e+t)*A;b<r&&(b=r,w=(e-t)/2*A),S=-e*A}else S=(i-A)*Gf-17}M?(e.verticalizable=!0,v.push({glyph:m,imageName:E,x:d,y:p+S,vertical:M,scale:A,localGlyph:y.localGlyph,fontStack:a.fontStack,sectionIndex:f,metrics:y,rect:C}),d+=T*A+c):(v.push({glyph:m,imageName:E,x:d,y:p+S,vertical:M,scale:A,localGlyph:y.localGlyph,fontStack:a.fontStack,sectionIndex:f,metrics:y,rect:C}),d+=y.advance*A+c)}0!==v.length&&(f=Math.max(d-c,f),g?Nm(v,m,x,w,o*i/2):Nm(v,m,x,0,o/2)),d=0;const C=o*i+x;y.lineOffset=Math.max(x,a),p+=C,++A}var _;const y=p,{horizontalAlign:v,verticalAlign:x}=jm(s);(function(e,t,r,n,i,o){const s=(t-r)*i,a=-o*n;for(const t of e)for(const e of t.positionedGlyphs)e.x+=s,e.y+=a})(e.positionedLines,m,v,x,f,y),e.top+=-x*y,e.bottom=e.top+y,e.left+=-v*f,e.right=e.left+f,e.hasBaseline=g}(x,t,r,n,g,s,a,l,h,c,d,f),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(v)&&x}const Om={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Dm={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function km(e,t,r,n,i,o){if(t.imageName){const e=n[t.imageName];return e?e.displaySize[0]*t.scale*Gf/o+i:0}{const n=r[t.fontStack],o=n&&n.glyphs[e];return o?o.metrics.advance*t.scale+i:0}}function zm(e,t,r,n){const i=Math.pow(e-t,2);return n?e<t?i/2:2*i:i+Math.abs(r)*r}function Bm(e,t,r){let n=0;return 10===e&&(n-=1e4),r&&(n+=150),40!==e&&65288!==e||(n+=50),41!==t&&65289!==t||(n+=50),n}function Rm(e,t,r,n,i,o){let s=null,a=zm(t,r,i,o);for(const e of n){const n=zm(t-e.x,r,i,o)+e.badness;n<=a&&(s=e,a=n)}return{index:e,x:t,priorBreak:s,badness:a}}function Fm(e){return e?Fm(e.priorBreak).concat(e.index):[]}function jm(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Nm(e,t,r,n,i){if(!(t||r||n||i))return;const o=e.length-1,s=e[o],a=(s.x+s.metrics.advance*s.scale)*t;for(let t=0;t<=o;t++)e[t].x-=a,e[t].y+=r+n+i}function Vm(e,t,r,n){const{horizontalAlign:i,verticalAlign:o}=jm(n),s=r[0]-e.displaySize[0]*i,a=r[1]-e.displaySize[1]*o;return{imagePrimary:e,imageSecondary:t,top:a,bottom:a+e.displaySize[1],left:s,right:s+e.displaySize[0]}}function Um(e,t,r,n,i,o){const s=e.imagePrimary;let a;if(s.content){const e=s.content,t=s.pixelRatio||1;a=[e[0]/t,e[1]/t,s.displaySize[0]-e[2]/t,s.displaySize[1]-e[3]/t]}const l=t.left*o,c=t.right*o;let u,h,d,p;"width"===r||"both"===r?(p=i[0]+l-n[3],h=i[0]+c+n[1]):(p=i[0]+(l+c-s.displaySize[0])/2,h=p+s.displaySize[0]);const f=t.top*o,m=t.bottom*o;return"height"===r||"both"===r?(u=i[1]+f-n[0],d=i[1]+m+n[2]):(u=i[1]+(f+m-s.displaySize[1])/2,d=u+s.displaySize[1]),{imagePrimary:s,imageSecondary:void 0,top:u,right:h,bottom:d,left:p,collisionPadding:a}}class Hm extends Nt{constructor(e,t,r,n,i){super(e,t),this.angle=n,this.z=r,void 0!==i&&(this.segment=i)}clone(){return new Hm(this.x,this.y,this.z,this.angle,this.segment)}}function Gm(e,t,r,n,i){if(void 0===t.segment)return!0;let o=t,s=t.segment+1,a=0;for(;a>-r/2;){if(s--,s<0)return!1;a-=e[s].dist(o),o=e[s]}a+=e[s].dist(e[s+1]),s++;const l=[];let c=0;for(;a<r/2;){const t=e[s],r=e[s+1];if(!r)return!1;let o=e[s-1].angleTo(t)-t.angleTo(r);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:o}),c+=o;a-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;s++,a+=t.dist(r)}return!0}function Zm(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Wm(e,t,r){return e?.6*t*r:0}function qm(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Qm(e,t,r,n,i,o){const s=Wm(r,i,o),a=qm(r,n)*o;let l=0;const c=Zm(e)/2;for(let r=0;r<e.length-1;r++){const n=e[r],i=e[r+1],o=n.dist(i);if(l+o>c){const u=(c-l)/o,h=Hn(n.x,i.x,u),d=Hn(n.y,i.y,u),p=new Hm(h,d,0,i.angleTo(n),r);return!s||Gm(e,p,a,s,t)?p:void 0}l+=o}}function Xm(e,t,r,n,i,o,s,a,l){const c=Wm(n,o,s),u=qm(n,i),h=u*s,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),Ym(e,d?t/2*a%t:(u/2+2*o)*s*a%t,t,c,r,h,d,!1,l)}function Ym(e,t,r,n,i,o,s,a,l){const c=o/2,u=Zm(e);let h=0,d=t-r,p=[];for(let t=0;t<e.length-1;t++){const s=e[t],a=e[t+1],f=s.dist(a),m=a.angleTo(s);for(;d+r<h+f;){d+=r;const g=(d-h)/f,A=Hn(s.x,a.x,g),_=Hn(s.y,a.y,g);if(A>=0&&A<l&&_>=0&&_<l&&d-c>=0&&d+c<=u){const r=new Hm(A,_,0,m,t);n&&!Gm(e,r,o,n,i)||p.push(r)}}h+=f}return a||p.length||s||(p=Ym(e,h/2,r,n,i,o,s,!0,l)),p}function $m(e,t,r,n,i){const o=[];for(let s=0;s<e.length;s++){const a=e[s];let l;for(let e=0;e<a.length-1;e++){let s=a[e],c=a[e+1];s.x<t&&c.x<t||(s.x<t?s=new Nt(t,s.y+(t-s.x)/(c.x-s.x)*(c.y-s.y))._round():c.x<t&&(c=new Nt(t,s.y+(t-s.x)/(c.x-s.x)*(c.y-s.y))._round()),s.y<r&&c.y<r||(s.y<r?s=new Nt(s.x+(r-s.y)/(c.y-s.y)*(c.x-s.x),r)._round():c.y<r&&(c=new Nt(s.x+(r-s.y)/(c.y-s.y)*(c.x-s.x),r)._round()),s.x>=n&&c.x>=n||(s.x>=n?s=new Nt(n,s.y+(n-s.x)/(c.x-s.x)*(c.y-s.y))._round():c.x>=n&&(c=new Nt(n,s.y+(n-s.x)/(c.x-s.x)*(c.y-s.y))._round()),s.y>=i&&c.y>=i||(s.y>=i?s=new Nt(s.x+(i-s.y)/(c.y-s.y)*(c.x-s.x),i)._round():c.y>=i&&(c=new Nt(s.x+(i-s.y)/(c.y-s.y)*(c.x-s.x),i)._round()),l&&s.equals(l[l.length-1])||(l=[s],o.push(l)),l.push(c)))))}}return o}function Km(e){let t=0,r=0;for(const n of e)t+=n.w*n.h,r=Math.max(r,n.w);e.sort(((e,t)=>t.h-e.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let i=0,o=0;for(const t of e)for(let e=n.length-1;e>=0;e--){const r=n[e];if(!(t.w>r.w||t.h>r.h)){if(t.x=r.x,t.y=r.y,o=Math.max(o,t.y+t.h),i=Math.max(i,t.x+t.w),t.w===r.w&&t.h===r.h){const t=n.pop();e<n.length&&(n[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):t.w===r.w?(r.y+=t.h,r.h-=t.h):(n.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:i,h:o,fill:t/(i*o)||0}}fa(Hm,"Anchor");const Jm=1;class eg{constructor(e,{pixelRatio:t,version:r,stretchX:n,stretchY:i,content:o}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=n,this.stretchY=i,this.content=o,this.version=r}get tl(){return[this.paddedRect.x+Jm,this.paddedRect.y+Jm]}get br(){return[this.paddedRect.x+this.paddedRect.w-Jm,this.paddedRect.y+this.paddedRect.h-Jm]}get displaySize(){return[(this.paddedRect.w-2*Jm)/this.pixelRatio,(this.paddedRect.h-2*Jm)/this.pixelRatio]}}class tg{constructor(e,t){const r={},n={};this.haveRenderCallbacks=[];const i=[];this.addImages(e,r,i),this.addImages(t,n,i);const{w:o,h:s}=Km(i),a=new nd({width:o||1,height:s||1});for(const t in e){const n=e[t],i=r[t].paddedRect;nd.copy(n.data,a,{x:0,y:0},{x:i.x+Jm,y:i.y+Jm},n.data,n.sdf)}for(const e in t){const r=t[e],i=n[e].paddedRect,o=i.x+Jm,s=i.y+Jm,l=r.data.width,c=r.data.height;nd.copy(r.data,a,{x:0,y:0},{x:o,y:s},r.data),nd.copy(r.data,a,{x:0,y:c-1},{x:o,y:s-1},{width:l,height:1}),nd.copy(r.data,a,{x:0,y:0},{x:o,y:s+c},{width:l,height:1}),nd.copy(r.data,a,{x:l-1,y:0},{x:o-1,y:s},{width:1,height:c}),nd.copy(r.data,a,{x:0,y:0},{x:o+l,y:s},{width:1,height:c})}this.image=a,this.iconPositions=r,this.patternPositions=n}addImages(e,t,r){for(const n in e){const i=e[n],o={x:0,y:0,w:i.data.width+2*Jm,h:i.data.height+2*Jm};r.push(o),t[n]=new eg(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(e,t,r){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((t=>e.hasImage(t,r))),e.dispatchRenderCallbacks(this.haveRenderCallbacks,r);for(const n in e.getUpdatedImages(r))this.patchUpdatedImage(this.iconPositions[n],e.getImage(n,r),t),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n,r),t)}patchUpdatedImage(e,t,r){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[n,i]=e.tl,o=!!Object.keys(this.patternPositions).length;r.update(t.data,{useMipmap:o},{x:n,y:i})}}fa(eg,"ImagePosition"),fa(tg,"ImageAtlas");const rg=1e20;function ng(e,t,r,n,i,o,s,a,l){for(let c=t;c<t+n;c++)ig(e,r*o+c,o,i,s,a,l);for(let c=r;c<r+i;c++)ig(e,c*o+t,1,n,s,a,l)}function ig(e,t,r,n,i,o,s){o[0]=0,s[0]=-rg,s[1]=rg,i[0]=e[t];for(let a=1,l=0,c=0;a<n;a++){i[a]=e[t+a*r];const n=a*a;do{const e=o[l];c=(i[a]-i[e]+n-e*e)/(a-e)/2}while(c<=s[l]&&--l>-1);l++,o[l]=a,s[l]=c,s[l+1]=rg}for(let a=0,l=0;a<n;a++){for(;s[l+1]<a;)l++;const n=o[l],c=a-n;e[t+a*r]=i[n]+c*c}}const og=2,sg={none:0,ideographs:1,all:2};class ag{constructor(e,t,r){this.requestManager=e,this.localGlyphMode=t,this.localFontFamily=r,this.urls={},this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e,t){this.urls[t]=e}getGlyphs(e,t,r){const i=[],o=this.urls[t]||n.GLYPHS_URL;for(const t in e)for(const r of e[t])i.push({stack:t,id:r});Kt(i,(({stack:e,id:t},r)=>{let n=this.entries[e];n||(n=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let i=n.glyphs[t];if(void 0!==i)return void r(null,{stack:e,id:t,glyph:i});if(i=this._tinySDF(n,e,t),i)return n.glyphs[t]=i,void r(null,{stack:e,id:t,glyph:i});const s=Math.floor(t/256);if(256*s>65535)return void r(new Error("glyphs > 65535 not supported"));if(n.ranges[s])return void r(null,{stack:e,id:t,glyph:i});let a=n.requests[s];a||(a=n.requests[s]=[],ag.loadGlyphRange(e,s,o,this.requestManager,((e,t)=>{if(t){n.ascender=t.ascender,n.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(n.glyphs[+e]=t.glyphs[+e]);n.ranges[s]=!0}for(const r of a)r(e,t);delete n.requests[s]}))),a.push(((n,i)=>{n?r(n):i&&r(null,{stack:e,id:t,glyph:i.glyphs[t]||null})}))}),((e,t)=>{if(e)r(e);else if(t){const e={};for(const{stack:r,id:n,glyph:i}of t)void 0===e[r]&&(e[r]={}),void 0===e[r].glyphs&&(e[r].glyphs={}),e[r].glyphs[n]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics},e[r].ascender=this.entries[r].ascender,e[r].descender=this.entries[r].descender;r(null,e)}}))}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==sg.none&&(this.localGlyphMode===sg.all?!!this.localFontFamily:!!this.localFontFamily&&(ya["CJK Unified Ideographs"](e)||ya["Hangul Syllables"](e)||ya.Hiragana(e)||ya.Katakana(e)||ya["CJK Symbols and Punctuation"](e)||ya["CJK Unified Ideographs Extension A"](e)||ya["CJK Unified Ideographs Extension B"](e)))}_tinySDF(e,t,r){const n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(r))return;let i=e.tinySDF;if(!i){let r="400";/bold/i.test(t)?r="900":/medium/i.test(t)?r="500":/light/i.test(t)&&(r="200"),i=e.tinySDF=new ag.TinySDF({fontFamily:n,fontWeight:r,fontSize:24*og,buffer:3*og,radius:8*og}),i.fontWeight=r}if(this.localGlyphs[i.fontWeight][r])return this.localGlyphs[i.fontWeight][r];const o=String.fromCodePoint(r),{data:s,width:a,height:l,glyphWidth:c,glyphHeight:u,glyphLeft:h,glyphTop:d,glyphAdvance:p}=i.draw(o);return this.localGlyphs[i.fontWeight][r]={id:r,bitmap:new rd({width:a,height:l},s),metrics:{width:c/og,height:u/og,left:h/og,top:d/og-27,advance:p/og,localGlyph:!0}}}}ag.loadGlyphRange=function(e,t,r,n,i){const o=256*t,s=o+255,a=n.transformRequest(n.normalizeGlyphsURL(r).replace("{fontstack}",e).replace("{range}",`${o}-${s}`),Xr.Glyphs);Jr(a,((e,t)=>{if(e)i(e);else if(t){const e={},r=function(e){return new bm(e).readFields(Cm,{})}(t);for(const t of r.glyphs)e[t.id]=t;i(null,{glyphs:e,ascender:r.ascender,descender:r.descender})}}))},ag.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:o="normal",fontStyle:s="normal"}={}){this.buffer=t,this.cutoff=n,this.radius=r;const a=this.size=e+4*t,l=this._createCanvas(a),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${s} ${o} ${e}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:o}=this.ctx.measureText(e),s=Math.ceil(r),a=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-i))),l=Math.min(this.size-this.buffer,s+Math.ceil(n)),c=a+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),d=new Uint8ClampedArray(h),p={data:d,width:c,height:u,glyphWidth:a,glyphHeight:l,glyphTop:s,glyphLeft:0,glyphAdvance:t};if(0===a||0===l)return p;const{ctx:f,buffer:m,gridInner:g,gridOuter:A}=this;f.clearRect(m,m,a,l),f.fillText(e,m,m+s);const _=f.getImageData(m,m,a,l);A.fill(rg,0,h),g.fill(0,0,h);for(let e=0;e<l;e++)for(let t=0;t<a;t++){const r=_.data[4*(e*a+t)+3]/255;if(0===r)continue;const n=(e+m)*c+t+m;if(1===r)A[n]=0,g[n]=rg;else{const e=.5-r;A[n]=e>0?e*e:0,g[n]=e<0?e*e:0}}ng(A,0,0,c,u,c,this.f,this.v,this.z),ng(g,m,m,a,l,c,this.f,this.v,this.z);for(let e=0;e<h;e++){const t=Math.sqrt(A[e])-Math.sqrt(g[e]);d[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return p}};const lg=Jm;function cg(e,t,r,n){const i=[],o=e.imagePrimary,s=o.pixelRatio,a=o.paddedRect.w-2*lg,l=o.paddedRect.h-2*lg,c=e.right-e.left,u=e.bottom-e.top,h=o.stretchX||[[0,a]],d=o.stretchY||[[0,l]],p=(e,t)=>e+t[1]-t[0],f=h.reduce(p,0),m=d.reduce(p,0),g=a-f,A=l-m;let _=0,y=f,v=0,x=m,b=0,w=g,C=0,E=A;if(o.content&&n){const e=o.content;_=ug(h,0,e[0]),v=ug(d,0,e[1]),y=ug(h,e[0],e[2]),x=ug(d,e[1],e[3]),b=e[0]-_,C=e[1]-v,w=e[2]-e[0]-y,E=e[3]-e[1]-x}const T=(n,i,a,l)=>{const h=dg(n.stretch-_,y,c,e.left),d=pg(n.fixed-b,w,n.stretch,f),p=dg(i.stretch-v,x,u,e.top),g=pg(i.fixed-C,E,i.stretch,m),A=dg(a.stretch-_,y,c,e.left),T=pg(a.fixed-b,w,a.stretch,f),S=dg(l.stretch-v,x,u,e.top),M=pg(l.fixed-C,E,l.stretch,m),I=new Nt(h,p),P=new Nt(A,p),L=new Nt(A,S),O=new Nt(h,S),D=new Nt(d/s,g/s),k=new Nt(T/s,M/s),z=t*Math.PI/180;if(z){const e=Math.sin(z),t=Math.cos(z),r=[t,-e,e,t];I._matMult(r),P._matMult(r),O._matMult(r),L._matMult(r)}const B=n.stretch+n.fixed,R=a.stretch+a.fixed,F=i.stretch+i.fixed,j=l.stretch+l.fixed,N=e.imageSecondary;return{tl:I,tr:P,bl:O,br:L,texPrimary:{x:o.paddedRect.x+lg+B,y:o.paddedRect.y+lg+F,w:R-B,h:j-F},texSecondary:N?{x:N.paddedRect.x+lg+B,y:N.paddedRect.y+lg+F,w:R-B,h:j-F}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:k,minFontScaleX:w/s/c,minFontScaleY:E/s/u,isSDF:r}};if(n&&(o.stretchX||o.stretchY)){const e=hg(h,g,f),t=hg(d,A,m);for(let r=0;r<e.length-1;r++){const n=e[r],o=e[r+1];for(let e=0;e<t.length-1;e++)i.push(T(n,t[e],o,t[e+1]))}}else i.push(T({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:a+1},{fixed:0,stretch:l+1}));return i}function ug(e,t,r){let n=0;for(const i of e)n+=Math.max(t,Math.min(r,i[1]))-Math.max(t,Math.min(r,i[0]));return n}function hg(e,t,r){const n=[{fixed:-lg,stretch:0}];for(const[t,r]of e){const e=n[n.length-1];n.push({fixed:t-e.stretch,stretch:e.stretch}),n.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return n.push({fixed:t+lg,stretch:r}),n}function dg(e,t,r,n){return e/t*r+n}function pg(e,t,r,n){return e-t*r/n}function fg(e,t,r,n){const i=t+e.positionedLines[n].lineOffset;return 0===n?r+i/2:r+(i+(t+e.positionedLines[n-1].lineOffset))/2}function mg(e,t=1,r=!1){let n=1/0,i=1/0,o=-1/0,s=-1/0;const a=e[0];for(let e=0;e<a.length;e++){const t=a[e];(!e||t.x<n)&&(n=t.x),(!e||t.y<i)&&(i=t.y),(!e||t.x>o)&&(o=t.x),(!e||t.y>s)&&(s=t.y)}const l=Math.min(o-n,s-i);let c=l/2;const u=new no([],gg);if(0===l)return new Nt(n,i);for(let t=n;t<o;t+=l)for(let r=i;r<s;r+=l)u.push(new Ag(t+c,r+c,c,e));let h=function(e){let t=0,r=0,n=0;const i=e[0];for(let e=0,o=i.length,s=o-1;e<o;s=e++){const o=i[e],a=i[s],l=o.x*a.y-a.x*o.y;r+=(o.x+a.x)*l,n+=(o.y+a.y)*l,t+=3*l}return new Ag(r/t,n/t,0,e)}(e),d=u.length;for(;u.length;){const n=u.pop();(n.d>h.d||!h.d)&&(h=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,d)),n.max-h.d<=t||(c=n.h/2,u.push(new Ag(n.p.x-c,n.p.y-c,c,e)),u.push(new Ag(n.p.x+c,n.p.y-c,c,e)),u.push(new Ag(n.p.x-c,n.p.y+c,c,e)),u.push(new Ag(n.p.x+c,n.p.y+c,c,e)),d+=4)}return r&&(console.log(`num probes: ${d}`),console.log(`best distance: ${h.d}`)),h.p}function gg(e,t){return t.max-e.max}class Ag{constructor(e,t,r,n){this.p=new Nt(e,t),this.h=r,this.d=function(e,t){let r=!1,n=1/0;for(let i=0;i<t.length;i++){const o=t[i];for(let t=0,i=o.length,s=i-1;t<i;s=t++){const i=o[t],a=o[s];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(r=!r),n=Math.min(n,Xu(e,i,a))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}}const _g=Number.POSITIVE_INFINITY,yg=Math.sqrt(2);function vg(e,[t,r]){let n=0,i=0;if(r===_g){t<0&&(t=0);const r=t/yg;switch(e){case"top-right":case"top-left":i=r-7;break;case"bottom-right":case"bottom-left":i=7-r;break;case"bottom":i=7-t;break;case"top":i=t-7}switch(e){case"top-right":case"bottom-right":n=-r;break;case"top-left":case"bottom-left":n=r;break;case"left":n=t;break;case"right":n=-t}}else{switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}}return[n,i]}function xg(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function bg(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f){let m=o.textMaxSize.evaluate(t,{},h);void 0===m&&(m=s);const g=e.layers[0].layout,A=g.get("icon-offset").evaluate(t,{},h),_=Tg(r.horizontal)||r.vertical,y="globe"===d.name,v=Gf,x=s/v,b=e.tilePixelRatio*m/v,w=(L=e.overscaling,e.zoom>18&&L>2&&(L>>=1),Math.max(io/(512*L),1)*g.get("symbol-spacing")),C=g.get("text-padding")*e.tilePixelRatio,E=g.get("icon-padding")*e.tilePixelRatio,T=Ht(g.get("text-max-angle")),S="map"===g.get("text-rotation-alignment")&&"point"!==g.get("symbol-placement"),M="map"===g.get("icon-rotation-alignment")&&"point"!==g.get("symbol-placement"),I=g.get("symbol-placement"),P=w/2;var L;const O=g.get("icon-text-fit").evaluate(t,{},h),D=g.get("icon-text-fit-padding").evaluate(t,{},h),k="none"!==O;let z;!1===e.hasAnyIconTextFit&&k&&(e.hasAnyIconTextFit=!0),n&&k&&(e.allowVerticalPlacement&&r.vertical&&(z=Um(n,r.vertical,O,D,A,x)),_&&(n=Um(n,_,O,D,A,x)));const B=(s,a,m)=>{if(a.x<0||a.x>=io||a.y<0||a.y>=io)return;let g=null;if(y){const{x:e,y:t,z:r}=d.projectTilePoint(a.x,a.y,m);g={anchor:new Hm(e,t,r,0,void 0),up:d.upVector(m,a.x,a.y)}}!function(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,v,x,b,w,C,E,T){const S=e.addToLineVertexArray(t,n);let M,I,P,L,O,D,k,z=0,B=0,R=0,F=0,j=-1,N=-1;const V={};let U=Ln("");const H=r?r.anchor:t,G="none"!==l.layout.get("icon-text-fit").evaluate(v,{},C);let Z=0,W=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[Z,W]=l.layout.get("text-offset").evaluate(v,{},C).map((e=>e*Gf)):(Z=l.layout.get("text-radial-offset").evaluate(v,{},C)*Gf,W=_g),e.allowVerticalPlacement&&i.vertical){const e=i.vertical;if(f)D=Mg(e),a&&(k=Mg(a));else{const r=l.layout.get("text-rotate").evaluate(v,{},C)+90;P=Sg(c,H,t,u,h,d,e,p,r,m),a&&(L=Sg(c,H,t,u,h,d,a,A,r))}}if(o){const n=l.layout.get("icon-rotate").evaluate(v,{},C),i=cg(o,n,b,G),s=a?cg(a,n,b,G):void 0;I=Sg(c,H,t,u,h,d,o,A,n),z=4*i.length;const p=e.iconSizeData;let f=null;"source"===p.kind?(f=[Zf*l.layout.get("icon-size").evaluate(v,{},C)],f[0]>Cg&&hr(`${e.layerIds[0]}: Value for "icon-size" is >= ${wg}. Reduce your "icon-size".`)):"composite"===p.kind&&(f=[Zf*x.compositeIconSizes[0].evaluate(v,{},C),Zf*x.compositeIconSizes[1].evaluate(v,{},C)],(f[0]>Cg||f[1]>Cg)&&hr(`${e.layerIds[0]}: Value for "icon-size" is >= ${wg}. Reduce your "icon-size".`)),e.addSymbols(e.icon,i,f,y,_,v,!1,r,t,S.lineStartIndex,S.lineLength,-1,w,C,E,T),j=e.icon.placedSymbolArray.length-1,s&&(B=4*s.length,e.addSymbols(e.icon,s,f,y,_,v,Mm.vertical,r,t,S.lineStartIndex,S.lineLength,-1,w,C,E,T),N=e.icon.placedSymbolArray.length-1)}for(const n in i.horizontal){const o=i.horizontal[n];M||(U=Ln(o.text),f?O=Mg(o):M=Sg(c,H,t,u,h,d,o,p,l.layout.get("text-rotate").evaluate(v,{},C),m));const a=1===o.positionedLines.length;if(R+=Eg(e,r,t,o,s,l,f,v,m,S,i.vertical?Mm.horizontal:Mm.horizontalOnly,a?Object.keys(i.horizontal):[n],V,j,x,w,C,E),a)break}i.vertical&&(F+=Eg(e,r,t,i.vertical,s,l,f,v,m,S,Mm.vertical,["vertical"],V,N,x,w,C,E));let q=-1;const Q=(e,t)=>e?Math.max(e,t):t;q=Q(O,q),q=Q(D,q),q=Q(k,q);const X=q>-1?1:0;e.glyphOffsetArray.length>=65535&&hr("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==v.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,v.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,H.x,H.y,H.z,V.right>=0?V.right:-1,V.center>=0?V.center:-1,V.left>=0?V.left:-1,V.vertical>=0?V.vertical:-1,j,N,U,void 0!==M?M:e.collisionBoxArray.length,void 0!==M?M+1:e.collisionBoxArray.length,void 0!==P?P:e.collisionBoxArray.length,void 0!==P?P+1:e.collisionBoxArray.length,void 0!==I?I:e.collisionBoxArray.length,void 0!==I?I+1:e.collisionBoxArray.length,L||e.collisionBoxArray.length,L?L+1:e.collisionBoxArray.length,u,R,F,z,B,X,0,Z,W,q,0,G?1:0)}(e,a,g,s,r,n,i,z,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,C,S,l,0,E,M,A,t,o,c,u,h,p,f)};if("line"===I)for(const i of $m(t.geometry,0,0,io,io)){const t=Xm(i,w,T,r.vertical||_,n,v,b,e.overscaling,io);for(const r of t)_&&Ig(e,_.text,P,r)||B(i,r,h)}else if("line-center"===I){for(const e of t.geometry)if(e.length>1){const t=Qm(e,T,r.vertical||_,n,v,b);t&&B(e,t,h)}}else if("Polygon"===t.type)for(const e of Nd(t.geometry,0)){const t=mg(e,16);B(e[0],new Hm(t.x,t.y,0,0,void 0),h)}else if("LineString"===t.type)for(const e of t.geometry)B(e,new Hm(e[0].x,e[0].y,0,0,void 0),h);else if("Point"===t.type)for(const e of t.geometry)for(const t of e)B([t],new Hm(t.x,t.y,0,0,void 0),h)}const wg=255,Cg=wg*Zf;function Eg(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m,g,A){const _=function(e,t,r,n,i,o,s,a){const l=[];if(0===t.positionedLines.length)return l;const c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=function(e){const t=e[0],r=e[1],n=t*r;return n>0?[t,-r]:n<0?[-t,r]:0===t?[r,t]:[r,-t]}(r);let h=Math.abs(t.top-t.bottom);for(const e of t.positionedLines)h-=e.lineOffset;const d=t.positionedLines.length,p=h/d;let f=t.top-r[1];for(let e=0;e<d;++e){const n=t.positionedLines[e];f=fg(t,p,f,e);for(const e of n.positionedGlyphs){if(!e.rect)continue;const n=e.rect||{};let o=Sm+1,h=!0,d=1,p=0;if(e.imageName){const t=s[e.imageName];if(!t)continue;if(t.sdf){hr("SDF images are not supported in formatted text and will be ignored.");continue}h=!1,d=t.pixelRatio,o=Jm/d}const m=(i||a)&&e.vertical,g=e.metrics.advance*e.scale/2,A=e.metrics,_=e.rect;if(null===_)continue;a&&t.verticalizable&&(p=e.imageName?g-e.metrics.width*e.scale/2:0);const y=i?[e.x+g,e.y]:[0,0];let v=[0,0],x=[0,0],b=!1;i||(m?(x=[e.x+g+u[0],e.y+u[1]-p],b=!0):v=[e.x+g+r[0],e.y+r[1]-p]);const w=_.w*e.scale/(d*(e.localGlyph?og:1)),C=_.h*e.scale/(d*(e.localGlyph?og:1));let E,T,S,M;if(m){const t=e.y-f,r=new Nt(-g,g-t),n=-Math.PI/2,i=new Nt(...x);E=new Nt(-g+v[0],v[1]),E._rotateAround(n,r)._add(i),E.x+=-t+g,E.y-=(A.left-o)*e.scale;const s=e.imageName?A.advance*e.scale:Gf*e.scale,a=String.fromCodePoint(e.glyph);Kf(a)?E.x+=(1-o)*e.scale:Jf(a)?E.x+=s-A.height*e.scale+(-o-1)*e.scale:E.x+=e.imageName||A.width+2*o===_.w&&A.height+2*o===_.h?(s-C)/2:(s-(A.height+2*o)*e.scale)/2,T=new Nt(E.x,E.y-w),S=new Nt(E.x+C,E.y),M=new Nt(E.x+C,E.y-w)}else{const t=(A.left-o)*e.scale-g+v[0],r=(-A.top-o)*e.scale+v[1],n=t+w,i=r+C;E=new Nt(t,r),T=new Nt(n,r),S=new Nt(t,i),M=new Nt(n,i)}if(c){let e;e=i?new Nt(0,0):b?new Nt(u[0],u[1]):new Nt(r[0],r[1]),E._rotateAround(c,e),T._rotateAround(c,e),S._rotateAround(c,e),M._rotateAround(c,e)}const I=new Nt(0,0),P=new Nt(0,0);l.push({tl:E,tr:T,bl:S,br:M,texPrimary:n,texSecondary:void 0,writingMode:t.writingMode,glyphOffset:y,sectionIndex:e.sectionIndex,isSDF:h,pixelOffsetTL:I,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}}return l}(0,n,l,o,s,a,i,e.allowVerticalPlacement),y=e.textSizeData;let v=null;"source"===y.kind?(v=[Zf*o.layout.get("text-size").evaluate(a,{},g)],v[0]>Cg&&hr(`${e.layerIds[0]}: Value for "text-size" is >= ${wg}. Reduce your "text-size".`)):"composite"===y.kind&&(v=[Zf*f.compositeTextSizes[0].evaluate(a,{},g),Zf*f.compositeTextSizes[1].evaluate(a,{},g)],(v[0]>Cg||v[1]>Cg)&&hr(`${e.layerIds[0]}: Value for "text-size" is >= ${wg}. Reduce your "text-size".`)),e.addSymbols(e.text,_,v,l,s,a,u,t,r,c.lineStartIndex,c.lineLength,p,m,g,A,!1);for(const t of h)d[t]=e.text.placedSymbolArray.length-1;return 4*_.length}function Tg(e){for(const t in e)return e[t];return null}function Sg(e,t,r,n,i,o,s,a,l,c){let u=s.top,h=s.bottom,d=s.left,p=s.right;const f=s.collisionPadding;if(f&&(d-=f[0],u-=f[1],p+=f[2],h+=f[3]),l){const e=new Nt(d,u),t=new Nt(p,u),r=new Nt(d,h),n=new Nt(p,h),i=Ht(l);let o=new Nt(0,0);c&&(o=new Nt(c[0],c[1])),e._rotateAround(i,o),t._rotateAround(i,o),r._rotateAround(i,o),n._rotateAround(i,o),d=Math.min(e.x,t.x,r.x,n.x),p=Math.max(e.x,t.x,r.x,n.x),u=Math.min(e.y,t.y,r.y,n.y),h=Math.max(e.y,t.y,r.y,n.y)}return e.emplaceBack(t.x,t.y,t.z,r.x,r.y,d,u,p,h,a,n,i,o),e.length-1}function Mg(e){e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function Ig(e,t,r,n){const i=e.compareText;if(t in i){const e=i[t];for(let t=e.length-1;t>=0;t--)if(n.dist(e[t])<r)return!0}else i[t]=[];return i[t].push(n),!1}function Pg(e,t){const r=e.fovAboveCenter,n=e.elevation?e.elevation.getMinElevationBelowMSL()*t:0,i=(e._camera.position[2]*e.worldSize-n)/Math.cos(e._pitch),o=Math.sin(r)*i/Math.sin(Math.max(Math.PI/2-e._pitch-r,.01)),s=Math.sin(e._pitch)*o+i;return Math.min(1.01*s,i*(1/e._horizonShift))}function Lg(e,t){if(!t.isReprojectedInTileSpace)return{scale:1<<e.z,x:e.x,y:e.y,x2:e.x+1,y2:e.y+1,projection:t};const r=Math.pow(2,-e.z),n=e.x*r,i=(e.x+1)*r,o=e.y*r,s=(e.y+1)*r,a=xu(n),l=xu(i),c=bu(o),u=bu(s),h=t.project(a,c),d=t.project(l,c),p=t.project(l,u),f=t.project(a,u);let m=Math.min(h.x,d.x,p.x,f.x),g=Math.min(h.y,d.y,p.y,f.y),A=Math.max(h.x,d.x,p.x,f.x),_=Math.max(h.y,d.y,p.y,f.y);const y=r/16;function v(e,r,n,i,o,s){const a=(n+o)/2,l=(i+s)/2,c=t.project(xu(a),bu(l)),u=Math.max(0,m-c.x,g-c.y,c.x-A,c.y-_);m=Math.min(m,c.x),A=Math.max(A,c.x),g=Math.min(g,c.y),_=Math.max(_,c.y),u>y&&(v(e,c,n,i,a,l),v(c,r,a,l,o,s))}v(h,d,n,o,i,o),v(d,p,i,o,i,s),v(p,f,i,s,n,s),v(f,h,n,s,n,o),m-=y,g-=y,A+=y,_+=y;const x=1/Math.max(A-m,_-g);return{scale:x,x:m*x,y:g*x,x2:A*x,y2:_*x,projection:t}}function Og(e,{x:t,y:r},n=0){return new Nt(((t-n)*e.scale-e.x)*io,(r*e.scale-e.y)*io)}const Dg=e.a9.identity(new Float32Array(16));class kg{constructor(e){this.spec=e,this.name=e.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(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new su(0,0)}projectTilePoint(e,t,r){return{x:e,y:t,z:0}}locationPoint(e,t,r=!0){return e._coordinatePoint(e.locationCoordinate(t),r)}pixelsPerMeter(e,t){return vu(1,e)*t}pixelSpaceConversion(e,t,r){return 1}farthestPixelDistance(e){return Pg(e,e.pixelsPerMeter)}pointCoordinate(e,t,r,n){const i=e.horizonLineFromTop(!1),o=new Nt(t,Math.max(i,r));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,n))}pointCoordinate3D(e,t,r){const n=new Nt(t,r);if(e.elevation)return e.elevation.pointCoordinate(n);{const t=this.pointCoordinate(e,n.x,n.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation)return!this.pointCoordinate3D(e,t.x,t.y);const r=e.horizonLineFromTop();return t.y<r}createInversionMatrix(e,t){return Dg}createTileMatrix(t,r,n){let i,o,s;const a=n.canonical,l=e.a9.identity(new Float64Array(16));if(this.isReprojectedInTileSpace){const c=Lg(a,this);i=1,o=c.x+n.wrap*c.scale,s=c.y,e.a9.scale(l,l,[i/c.scale,i/c.scale,t.pixelsPerMeter/r])}else i=r/t.zoomScale(a.z),o=(a.x+Math.pow(2,a.z)*n.wrap)*i,s=a.y*i;return e.a9.translate(l,l,[o,s,0]),e.a9.scale(l,l,[i/io,i/io,1]),l}upVector(e,t,r){return[0,0,1]}upVectorScale(e,t,r){return{metersToTile:1}}}class zg extends kg{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[t,r]=this.parallels=e.parallels||[29.5,45.5],n=Math.sin(Ht(t));this.n=(n+Math.sin(Ht(r)))/2,this.c=1+n*(2*this.n-n),this.r0=Math.sqrt(this.c)/this.n}project(e,t){const{n:r,c:n,r0:i}=this,o=Ht(e-this.center[0]),s=Ht(t),a=Math.sqrt(n-2*r*Math.sin(s))/r;return{x:a*Math.sin(o*r),y:a*Math.cos(o*r)-i,z:0}}unproject(e,t){const{n:r,c:n,r0:i}=this,o=i+t;let s=Math.atan2(e,Math.abs(o))*Math.sign(o);o*r<0&&(s-=Math.PI*Math.sign(e)*Math.sign(o));const a=Ht(this.center[0])*r;s=$t(s,-Math.PI-a,Math.PI-a);const l=Xt(Gt(s/r)+this.center[0],-180,180),c=Math.asin(Xt((n-(e*e+o*o)*r*r)/(2*r),-1,1)),u=Xt(Gt(c),-Cu,Cu);return new su(l,u)}}const Bg=1.340264,Rg=-.081106,Fg=893e-6,jg=.003796,Ng=Math.sqrt(3)/2;class Vg extends kg{project(e,t){t=t/180*Math.PI,e=e/180*Math.PI;const r=Math.asin(Ng*Math.sin(t)),n=r*r,i=n*n*n;return{x:.5*(e*Math.cos(r)/(Ng*(Bg+3*Rg*n+i*(7*Fg+9*jg*n)))/Math.PI+.5),y:1-.5*(r*(Bg+Rg*n+i*(Fg+jg*n))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let r=t=(2*(1-t)-1)*Math.PI,n=r*r,i=n*n*n;for(let e,o,s,a=0;a<12&&(o=r*(Bg+Rg*n+i*(Fg+jg*n))-t,s=Bg+3*Rg*n+i*(7*Fg+9*jg*n),e=o/s,r=Xt(r-e,-Math.PI/3,Math.PI/3),n=r*r,i=n*n*n,!(Math.abs(e)<1e-12));++a);const o=Ng*e*(Bg+3*Rg*n+i*(7*Fg+9*jg*n))/Math.cos(r),s=Math.asin(Math.sin(r)/Ng),a=Xt(180*o/Math.PI,-180,180),l=Xt(180*s/Math.PI,-Cu,Cu);return new su(a,l)}}class Ug extends kg{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){return{x:.5+e/360,y:.5-t/360,z:0}}unproject(e,t){const r=360*(e-.5),n=Xt(360*(.5-t),-Cu,Cu);return new su(r,n)}}const Hg=Math.PI/2;function Gg(e){return Math.tan((Hg+e)/2)}class Zg extends kg{constructor(e){super(e),this.center=e.center||[0,30];const[t,r]=this.parallels=e.parallels||[30,30];let n=Ht(t),i=Ht(r);this.southernCenter=n+i<0,this.southernCenter&&(n=-n,i=-i);const o=Math.cos(n),s=Gg(n);this.n=n===i?Math.sin(n):Math.log(o/Math.cos(i))/Math.log(Gg(i)/s),this.f=o*Math.pow(Gg(n),this.n)/this.n}project(e,t){t=Ht(t),this.southernCenter&&(t=-t),e=Ht(e-this.center[0]);const r=1e-6,{n:n,f:i}=this;i>0?t<-Hg+r&&(t=-Hg+r):t>Hg-r&&(t=Hg-r);const o=i/Math.pow(Gg(t),n);let s=o*Math.sin(n*e),a=i-o*Math.cos(n*e);return s=.5*(s/Math.PI+.5),a=.5*(a/Math.PI+.5),{x:s,y:this.southernCenter?a:1-a,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n:r,f:n}=this,i=n-t,o=Math.sign(i),s=Math.sign(r)*Math.sqrt(e*e+i*i);let a=Math.atan2(e,Math.abs(i))*o;i*r<0&&(a-=Math.PI*Math.sign(e)*o);const l=Xt(Gt(a/r)+this.center[0],-180,180),c=Xt(Gt(2*Math.atan(Math.pow(n/s,1/r))-Hg),-Cu,Cu);return new su(l,this.southernCenter?-c:c)}}class Wg extends kg{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:_u(e),y:yu(t),z:0}}unproject(e,t){const r=xu(e),n=bu(t);return new su(r,n)}}const qg=Ht(Cu);class Qg extends kg{project(e,t){const r=(t=Ht(t))*t,n=r*r;return{x:.5*((e=Ht(e))*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let r=t=(2*(1-t)-1)*Math.PI,n=25,i=0,o=r*r;do{o=r*r;const e=o*o;i=(r*(1.007226+o*(.015085+e*(.028874*o-.044475-.005916*e)))-t)/(1.007226+o*(.045255+e*(.259866*o-.311325-.005916*11*e))),r=Xt(r-i,-qg,qg)}while(Math.abs(i)>1e-6&&--n>0);o=r*r;const s=Xt(Gt(e/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),a=Gt(r);return new su(s,a)}}const Xg=Ht(Cu);class Yg extends kg{project(e,t){t=Ht(t),e=Ht(e);const r=Math.cos(t),n=2/Math.PI,i=Math.acos(r*Math.cos(e/2)),o=Math.sin(i)/i,s=.5*(e*n+2*r*Math.sin(e/2)/o)||0,a=.5*(t+Math.sin(t)/o)||0;return{x:.5*(s/Math.PI+.5),y:1-.5*(a/Math.PI+1),z:0}}unproject(e,t){let r=e=(2*e-.5)*Math.PI,n=t=(2*(1-t)-1)*Math.PI,i=25;const o=1e-6;let s=0,a=0;do{const i=Math.cos(n),o=Math.sin(n),l=2*o*i,c=o*o,u=i*i,h=Math.cos(r/2),d=Math.sin(r/2),p=2*h*d,f=d*d,m=1-u*h*h,g=m?1/m:0,A=m?Math.acos(i*h)*Math.sqrt(1/m):0,_=.5*(2*A*i*d+2*r/Math.PI)-e,y=.5*(A*o+n)-t,v=.5*g*(u*f+A*i*h*c)+1/Math.PI,x=g*(p*l/4-A*o*d),b=.125*g*(l*d-A*o*u*p),w=.5*g*(c*h+A*f*i)+.5,C=x*b-w*v;s=(y*x-_*w)/C,a=(_*b-y*v)/C,r=Xt(r-s,-Math.PI,Math.PI),n=Xt(n-a,-Xg,Xg)}while((Math.abs(s)>o||Math.abs(a)>o)&&--i>0);return new su(Gt(r),Gt(n))}}class $g extends kg{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Ht(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:r,cosPhi:n}=this;return{x:Ht(e)*n*r+.5,y:-Math.sin(Ht(t))/n*r+.5,z:0}}unproject(e,t){const{scale:r,cosPhi:n}=this,i=-(t-.5)/r,o=Xt(Gt((e-.5)/r)/n,-180,180),s=Math.asin(Xt(i*n,-1,1)),a=Xt(Gt(s),-Cu,Cu);return new su(o,a)}}class Kg extends Wg{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(t,r,n){const i=Lh(t,r,n),o=kh(Eh(n));return e.Q.transformMat4(i,i,o),{x:i[0],y:i[1],z:i[2]}}locationPoint(t,r){const n=nu(r.lat,r.lng),i=e.Q.normalize([],n),o=t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(r),t._centerAltitude):t._centerAltitude,s=vu(1,0)*io*o;e.Q.scaleAndAdd(n,n,i,s);const a=e.a9.identity(new Float64Array(16));return e.a9.multiply(a,t.pixelMatrix,t.globeMatrix),e.Q.transformMat4(n,n,a),new Nt(n[0],n[1])}pixelsPerMeter(e,t){return vu(1,0)*t}pixelSpaceConversion(e,t,r){const n=vu(1,e)*t,i=Hn(vu(1,45)*t,n,r);return this.pixelsPerMeter(e,t)/i}createTileMatrix(t,r,n){const i=zh(Eh(n.canonical));return e.a9.multiply(new Float64Array(16),t.globeMatrix,i)}createInversionMatrix(t,r){const{center:n}=t,i=kh(Eh(r));return e.a9.rotateY(i,i,Ht(n.lng)),e.a9.rotateX(i,i,Ht(n.lat)),e.a9.scale(i,i,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(i)}pointCoordinate(e,t,r,n){return bh(e,t,r,!0)||new Iu(0,0)}pointCoordinate3D(e,t,r){const n=this.pointCoordinate(e,t,r,0);return[n.x,n.y,n.z]}isPointAboveHorizon(e,t){return!bh(e,t.x,t.y,!1)}farthestPixelDistance(t){const r=function(t,r){const n=t.cameraToCenterDistance,i=t._centerAltitude*r,o=t._camera,s=t._camera.forward(),a=e.Q.add([],e.Q.scale([],s,-n),[0,0,i]),l=t.worldSize/(2*Math.PI),c=[0,0,-l],u=t.width/t.height,h=Math.tan(t.fovAboveCenter),d=e.Q.scale([],o.up(),h),p=e.Q.scale([],o.right(),h*u),f=e.Q.normalize([],e.Q.add([],e.Q.add([],s,d),p)),m=[];let g;if(new lh(a,f).closestPointOnSphere(c,l,m)){const r=e.Q.add([],m,c),n=e.Q.sub([],r,a);g=Math.cos(t.fovAboveCenter)*e.Q.length(n)}else{const t=e.Q.sub([],a,c),r=e.Q.sub([],c,a);e.Q.normalize(r,r);const n=e.Q.length(t)-l;g=Math.sqrt(n*(n+2*l));const i=Math.acos(g/(l+n))-Math.acos(e.Q.dot(s,r));g*=Math.cos(i)}return 1.01*g}(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),n=jh(t.zoom);if(n>0){const e=Pg(t,vu(1,t.center.lat)*t.worldSize),i=t.worldSize/(2*Math.PI),o=Math.max(t.width,t.height)/t.worldSize*Math.PI;return Hn(r,e+i*(1-Math.cos(o)),Math.pow(n,10))}return r}upVector(e,t,r){return Lh(t,r,e,1)}upVectorScale(e){return{metersToTile:vh(Oh(Eh(e)))}}}function Jg(e){const t=e.parallels,r=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new Wg(e);case"equirectangular":return new Ug(e);case"naturalEarth":return new Qg(e);case"equalEarth":return new Vg(e);case"winkelTripel":return new Yg(e);case"albers":return r?new $g(e):new zg(e);case"lambertConformalConic":return r?new $g(e):new Zg(e);case"globe":return new Kg(e)}throw new Error(`Invalid projection name: ${e.name}`)}const eA=dp.types,tA=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function rA(e,t,r,n,i,o,s,a,l,c,u,h,d){const p=a?Math.min(Cg,Math.round(a[0])):0,f=a?Math.min(Cg,Math.round(a[1])):0;e.emplaceBack(t,r,Math.round(32*n),Math.round(32*i),o,s,(p<<1)+(l?1:0),f,16*c,16*u,256*h,256*d)}function nA(e,t,r){e.emplaceBack(t,r)}function iA(e,t,r,n,i,o,s){e.emplaceBack(t,r,n,i,o,s)}function oA(e,t,r,n,i){e.emplaceBack(t,r,n,i),e.emplaceBack(t,r,n,i),e.emplaceBack(t,r,n,i),e.emplaceBack(t,r,n,i)}function sA(e){for(const t of e.sections)if(Sa(t.text))return!0;return!1}class aA{constructor(e){this.layoutVertexArray=new zl,this.indexArray=new Hl,this.programConfigurations=e,this.segments=new mc,this.dynamicLayoutVertexArray=new Pl,this.opacityVertexArray=new Rl,this.placedSymbolArray=new oc,this.iconTransitioningVertexArray=new Fl,this.globeExtVertexArray=new Bl,this.zOffsetVertexArray=new Wl}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}upload(e,t,r,n,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Rf.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,tA,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,jf.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Bf.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||i)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Ff.members,!0)),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy())}}fa(aA,"SymbolBuffers");class lA{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new mc,this.collisionVertexArray=new Ul,this.collisionVertexArrayExt=new Pl}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Nf.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Vf.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}fa(lA,"CollisionBuffers");class cA{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=e.a9.identity([]),this.placementViewportMatrix=e.a9.identity([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Wf(this.zoom,r["text-size"]),this.iconSizeData=Wf(this.zoom,r["icon-size"]);const n=this.layers[0].layout,i=n.get("symbol-sort-key"),o=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==o&&void 0!==i.constantOr(1),this.sortFeaturesByY=("viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map((e=>Mm[e])),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=t.sourceID,this.projection=t.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=n.get("symbol-z-elevate")}createArrays(){this.text=new aA(new Uc(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new aA(new Uc(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new lc,this.lineVertexArray=new cc,this.symbolInstances=new ac}calculateGlyphDependencies(e,t,r,n,i){for(let r=0;r<e.length;r++){const o=e.codePointAt(r);if(void 0===o)break;if(t[o]=!0,n&&i&&o<=65535){const n=$f[e.charAt(r)];n&&(t[n.charCodeAt(0)]=!0)}}}populate(t,r,n,i){const o=this.layers[0],s=o.layout,a="globe"===this.projection.name,l=s.get("text-font"),c=s.get("text-field"),u=s.get("icon-image"),h=("constant"!==c.value.kind||c.value.value instanceof pi&&!c.value.value.isEmpty()||c.value.value.toString().length>0)&&("constant"!==l.value.kind||l.value.value.length>0),d="constant"!==u.value.kind||!!u.value.value||Object.keys(u.parameters).length>0,p=s.get("symbol-sort-key");if(this.features=[],!h&&!d)return;const f=r.iconDependencies,m=r.glyphDependencies,g=r.availableImages,A=new Na(this.zoom);for(const{feature:r,id:c,index:u,sourceLayerIndex:_}of t){const t=o._featureFilter.needGeometry,y=Fu(r,t);if(!o._featureFilter.filter(A,y,n))continue;if(t||(y.geometry=Ru(r,n,i)),a&&1!==r.type&&n.z<=5){const t=y.geometry,r=.98078528056,i=(t,i)=>{const o=Lh(t.x,t.y,n,1),s=Lh(i.x,i.y,n,1);return e.Q.dot(o,s)<r};for(let e=0;e<t.length;e++)t[e]=Du(t[e],i)}let v,x;if(h){const e=o.getValueAndResolveTokens("text-field",y,n,g),t=pi.factory(e);sA(t)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Ra()||this.hasRTLText&&ja.isParsed())&&(v=Yf(t,o,y))}if(d){const e=o.getValueAndResolveTokens("icon-image",y,n,g);x=e instanceof fi?e:fi.fromString(e)}if(!v&&!x)continue;const b=this.sortFeaturesByKey?p.evaluate(y,{},n):void 0;if(this.features.push({id:c,text:v,icon:x,index:u,sourceLayerIndex:_,geometry:y.geometry,properties:r.properties,type:eA[r.type],sortKey:b}),x&&(f[x.namePrimary]=!0,x.nameSecondary&&(f[x.nameSecondary]=!0)),v){const e=l.evaluate(y,{},n).join(","),t="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Mm.vertical)>=0;for(const r of v.sections)if(r.image)f[r.image.namePrimary]=!0;else{const n=va(v.toString()),i=r.fontStack||e,o=m[i]=m[i]||{};this.calculateGlyphDependencies(r.text,o,t,this.allowVerticalPlacement,n)}}}"line"===s.get("symbol-placement")&&(this.features=function(e){const t={},r={},n=[];let i=0;function o(t){n.push(e[t]),i++}function s(e,t,i){const o=r[e];return delete r[e],r[t]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(i[0]),o}function a(e,r,i){const o=t[r];return delete t[r],t[e]=o,n[o].geometry[0].shift(),n[o].geometry[0]=i[0].concat(n[o].geometry[0]),o}function l(e,t,r){const n=r?t[0][t[0].length-1]:t[0][0];return`${e}:${n.x}:${n.y}`}for(let c=0;c<e.length;c++){const u=e[c],h=u.geometry,d=u.text?u.text.toString():null;if(!d){o(c);continue}const p=l(d,h),f=l(d,h,!0);if(p in r&&f in t&&r[p]!==t[f]){const e=a(p,f,h),i=s(p,f,n[e].geometry);delete t[p],delete r[f],r[l(d,n[i].geometry,!0)]=i,n[e].geometry=null}else p in r?s(p,f,h):f in t?a(p,f,h):(o(c),t[p]=i-1,r[f]=i-1)}return n.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r,n,i){const o=0!==Object.keys(e).length;if(o&&!this.stateDependentLayers.length)return;const s=o?this.stateDependentLayers:this.layers;this.text.programConfigurations.updatePaintArrays(e,t,s,r,n,i),this.icon.programConfigurations.updatePaintArrays(e,t,s,r,n,i)}updateZOffset(){const e=(e,t,n)=>{r+=t,r>e.length&&e.resize(r);for(let i=-t;i<0;i++)e.emplace(i+r,n)},t=(e,t,r)=>{n+=t,n>e.length&&e.resize(n);for(let i=-t;i<0;i++)e.emplace(i+n,r)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let r=0,n=0;for(let r=0;r<this.symbolInstances.length;r++){const n=this.symbolInstances.get(r),{numHorizontalGlyphVertices:i,numVerticalGlyphVertices:o,numIconVertices:s}=n,a=n.zOffset,l=s>0;if((i>0||o>0)&&(e(this.text.zOffsetVertexArray,i,a),e(this.text.zOffsetVertexArray,o,a)),l){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:r}=n;e>=0&&t(this.icon.zOffsetVertexArray,s,a),r>=0&&t(this.icon.zOffsetVertexArray,n.numVerticalIconVertices,a)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Jg(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const r=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:e,y:r}of t)this.lineVertexArray.emplaceBack(e,r);return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,t,r,n,i,o,s,a,l,c,u,h,d,p,f,m){const g=e.indexArray,A=e.layoutVertexArray,_=e.globeExtVertexArray,y=e.segments.prepareSegment(4*t.length,A,g,this.canOverlap?o.sortKey:void 0),v=this.glyphOffsetArray.length,x=y.vertexLength,b=this.allowVerticalPlacement&&s===Mm.vertical?Math.PI/2:0,w=o.text&&o.text.sections;for(let n=0;n<t.length;n++){const{tl:i,tr:s,bl:c,br:u,texPrimary:h,texSecondary:v,pixelOffsetTL:x,pixelOffsetBR:C,minFontScaleX:E,minFontScaleY:T,glyphOffset:S,isSDF:M,sectionIndex:I}=t[n],P=y.vertexLength,L=S[1];if(rA(A,l.x,l.y,i.x,L+i.y,h.x,h.y,r,M,x.x,x.y,E,T),rA(A,l.x,l.y,s.x,L+s.y,h.x+h.w,h.y,r,M,C.x,x.y,E,T),rA(A,l.x,l.y,c.x,L+c.y,h.x,h.y+h.h,r,M,x.x,C.y,E,T),rA(A,l.x,l.y,u.x,L+u.y,h.x+h.w,h.y+h.h,r,M,C.x,C.y,E,T),a){const{x:t,y:r,z:n}=a.anchor,[i,o,s]=a.up;iA(_,t,r,n,i,o,s),iA(_,t,r,n,i,o,s),iA(_,t,r,n,i,o,s),iA(_,t,r,n,i,o,s),oA(e.dynamicLayoutVertexArray,t,r,n,b)}else oA(e.dynamicLayoutVertexArray,l.x,l.y,l.z,b);if(m){const t=v||h;nA(e.iconTransitioningVertexArray,t.x,t.y),nA(e.iconTransitioningVertexArray,t.x+t.w,t.y),nA(e.iconTransitioningVertexArray,t.x,t.y+t.h),nA(e.iconTransitioningVertexArray,t.x+t.w,t.y+t.h)}g.emplaceBack(P,P+1,P+2),g.emplaceBack(P+1,P+2,P+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(S[0]),n!==t.length-1&&I===t[n+1].sectionIndex||e.programConfigurations.populatePaintArrays(A.length,o,o.index,{},d,p,f,w&&w[I])}const C=a?a.anchor:l;e.placedSymbolArray.emplaceBack(C.x,C.y,C.z,l.x,l.y,v,this.glyphOffsetArray.length-v,x,c,u,l.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],s,0,!1,0,h,0)}_commitLayoutVertex(e,t,r,n,i,o,s){e.emplaceBack(t,r,n,i,o,Math.round(s.x),Math.round(s.y))}_addCollisionDebugVertices(e,t,r,n,i,o,s){const a=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),l=a.vertexLength,c=s.tileAnchorX,u=s.tileAnchorY;for(let e=0;e<4;e++)r.collisionVertexArray.emplaceBack(0,0,0,0);this._commitDebugCollisionVertexUpdate(r.collisionVertexArrayExt,t,e.padding,s.zOffset),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new Nt(e.x1,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new Nt(e.x2,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new Nt(e.x2,e.y2)),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new Nt(e.x1,e.y2)),a.vertexLength+=4;const h=r.indexArray;h.emplaceBack(l,l+1),h.emplaceBack(l+1,l+2),h.emplaceBack(l+2,l+3),h.emplaceBack(l+3,l),a.primitiveLength+=4}_addTextDebugCollisionBoxes(e,t,r,n,i,o){for(let s=n;s<i;s++){const n=r.get(s),i=this.getSymbolInstanceTextSize(e,o,t,s);this._addCollisionDebugVertices(n,i,this.textCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}_addIconDebugCollisionBoxes(e,t,r,n,i,o){for(let s=n;s<i;s++){const n=r.get(s),i=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._addCollisionDebugVertices(n,i,this.iconCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}generateCollisionDebugBuffers(e,t){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new lA(Nl,Uf.members,Fl),this.iconCollisionBox=new lA(Nl,Uf.members,Fl);const r=Qf(this.iconSizeData,e),n=Qf(this.textSizeData,e);for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this._addTextDebugCollisionBoxes(n,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(n,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(r,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(r,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}getSymbolInstanceTextSize(e,t,r,n){const i=this.text.placedSymbolArray.get(t.rightJustifiedTextSymbolIndex>=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:n),o=qf(this.textSizeData,e,i)/Gf;return this.tilePixelRatio*o}getSymbolInstanceIconSize(e,t,r){const n=this.icon.placedSymbolArray.get(r),i=qf(this.iconSizeData,e,n);return this.tilePixelRatio*i}_commitDebugCollisionVertexUpdate(e,t,r,n){e.emplaceBack(t,-r,-r,n),e.emplaceBack(t,r,-r,n),e.emplaceBack(t,r,r,n),e.emplaceBack(t,-r,r,n)}_updateTextDebugCollisionBoxes(e,t,r,n,i,o){for(let s=n;s<i;s++){const n=r.get(s),i=this.getSymbolInstanceTextSize(e,o,t,s);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,i,n.padding,o.zOffset)}}_updateIconDebugCollisionBoxes(e,t,r,n,i,o){for(let s=n;s<i;s++){const n=r.get(s),i=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,i,n.padding,o.zOffset)}}updateCollisionDebugBuffers(e,t){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const r=Qf(this.iconSizeData,e),n=Qf(this.textSizeData,e);for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this._updateTextDebugCollisionBoxes(n,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._updateTextDebugCollisionBoxes(n,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._updateIconDebugCollisionBoxes(r,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._updateIconDebugCollisionBoxes(r,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,t,r,n,i,o,s,a,l){const c={};if(t<r){const{x1:r,y1:n,x2:i,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:p}=e.get(t);c.textBox={x1:r,y1:n,x2:i,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.textFeatureIndex=p}if(n<i){const{x1:t,y1:r,x2:i,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:p}=e.get(n);c.verticalTextBox={x1:t,y1:r,x2:i,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalTextFeatureIndex=p}if(o<s){const{x1:t,y1:r,x2:n,y2:i,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:p}=e.get(o);c.iconBox={x1:t,y1:r,x2:n,y2:i,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.iconFeatureIndex=p}if(a<l){const{x1:t,y1:r,x2:n,y2:i,padding:o,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:p}=e.get(a);c.verticalIconBox={x1:t,y1:r,x2:n,y2:i,padding:o,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalIconFeatureIndex=p}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,t){const r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<n;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),r=Math.cos(e),n=[],i=[],o=[];for(let e=0;e<this.symbolInstances.length;++e){o.push(e);const s=this.symbolInstances.get(e);n.push(0|Math.round(t*s.tileAnchorX+r*s.tileAnchorY)),i.push(s.featureIndex)}return o.sort(((e,t)=>n[e]-n[t]||i[t]-i[e])),o}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;e<this.symbolInstances.length;++e)this.symbolInstanceIndexesSortedZOffset.push(e)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort(((e,t)=>this.symbolInstances.get(t).zOffset-this.symbolInstances.get(e).zOffset))}addToSortKeyRanges(e,t){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:i,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:s,verticalPlacedIconSymbolIndex:a}=t;r>=0&&this.addIndicesForPlacedSymbol(this.text,r),n>=0&&n!==r&&this.addIndicesForPlacedSymbol(this.text,n),i>=0&&i!==n&&i!==r&&this.addIndicesForPlacedSymbol(this.text,i),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}fa(cA,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),cA.addDynamicAttributes=oA;const uA=new Ka({"symbol-placement":new Xa(tl.layout_symbol["symbol-placement"]),"symbol-spacing":new Xa(tl.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Xa(tl.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ya(tl.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Xa(tl.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new Xa(tl.layout_symbol["symbol-z-elevate"]),"icon-allow-overlap":new Xa(tl.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Xa(tl.layout_symbol["icon-ignore-placement"]),"icon-optional":new Xa(tl.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Xa(tl.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ya(tl.layout_symbol["icon-size"]),"icon-text-fit":new Ya(tl.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ya(tl.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ya(tl.layout_symbol["icon-image"]),"icon-rotate":new Ya(tl.layout_symbol["icon-rotate"]),"icon-padding":new Xa(tl.layout_symbol["icon-padding"]),"icon-keep-upright":new Xa(tl.layout_symbol["icon-keep-upright"]),"icon-offset":new Ya(tl.layout_symbol["icon-offset"]),"icon-anchor":new Ya(tl.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Xa(tl.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Xa(tl.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Xa(tl.layout_symbol["text-rotation-alignment"]),"text-field":new Ya(tl.layout_symbol["text-field"]),"text-font":new Ya(tl.layout_symbol["text-font"]),"text-size":new Ya(tl.layout_symbol["text-size"]),"text-max-width":new Ya(tl.layout_symbol["text-max-width"]),"text-line-height":new Ya(tl.layout_symbol["text-line-height"]),"text-letter-spacing":new Ya(tl.layout_symbol["text-letter-spacing"]),"text-justify":new Ya(tl.layout_symbol["text-justify"]),"text-radial-offset":new Ya(tl.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Xa(tl.layout_symbol["text-variable-anchor"]),"text-anchor":new Ya(tl.layout_symbol["text-anchor"]),"text-max-angle":new Xa(tl.layout_symbol["text-max-angle"]),"text-writing-mode":new Xa(tl.layout_symbol["text-writing-mode"]),"text-rotate":new Ya(tl.layout_symbol["text-rotate"]),"text-padding":new Xa(tl.layout_symbol["text-padding"]),"text-keep-upright":new Xa(tl.layout_symbol["text-keep-upright"]),"text-transform":new Ya(tl.layout_symbol["text-transform"]),"text-offset":new Ya(tl.layout_symbol["text-offset"]),"text-allow-overlap":new Xa(tl.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Xa(tl.layout_symbol["text-ignore-placement"]),"text-optional":new Xa(tl.layout_symbol["text-optional"]),visibility:new Xa(tl.layout_symbol.visibility)});var hA={paint:new Ka({"icon-opacity":new Ya(tl.paint_symbol["icon-opacity"]),"icon-emissive-strength":new Ya(tl.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Ya(tl.paint_symbol["text-emissive-strength"]),"icon-color":new Ya(tl.paint_symbol["icon-color"]),"icon-halo-color":new Ya(tl.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ya(tl.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ya(tl.paint_symbol["icon-halo-blur"]),"icon-translate":new Xa(tl.paint_symbol["icon-translate"]),"icon-translate-anchor":new Xa(tl.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new Ya(tl.paint_symbol["icon-image-cross-fade"]),"text-opacity":new Ya(tl.paint_symbol["text-opacity"]),"text-color":new Ya(tl.paint_symbol["text-color"],{runtimeType:Jn,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Ya(tl.paint_symbol["text-halo-color"]),"text-halo-width":new Ya(tl.paint_symbol["text-halo-width"]),"text-halo-blur":new Ya(tl.paint_symbol["text-halo-blur"]),"text-translate":new Xa(tl.paint_symbol["text-translate"]),"text-translate-anchor":new Xa(tl.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new Xa(tl.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new Xa(tl.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new Xa(tl.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new Xa(tl.paint_symbol["icon-color-brightness-max"])}),layout:uA};class dA{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Xn,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}fa(dA,"FormatSectionOverride",{omit:["defaultValue"]});class pA extends yl{constructor(t,r,n){super(t,hA,r,n),this._colorAdjustmentMatrix=e.a9.identity([])}recalculate(e,t){super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const r=this.layout.get("text-writing-mode");if(r){const e=[];for(const t of r)e.indexOf(t)<0&&e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(t,r,n,i){return this._saturation===t&&this._contrast===r&&this._brightnessMin===n&&this._brightnessMax===i||(this._colorAdjustmentMatrix=function(t,r,n,i){t=Ir(t),r=Mr(r);const o=e.a9.create(),s=t/3,a=1-2*s,l=[a,s,s,0,s,a,s,0,s,s,a,0,0,0,0,1],c=.5-.5*r,u=i-n;return e.a9.multiply(o,[u,0,0,0,0,u,0,0,0,0,u,0,n,n,n,1],[r,0,0,0,0,r,0,0,0,0,r,0,c,c,c,1]),e.a9.multiply(o,o,l),o}(t,r,n,i),this._saturation=t,this._contrast=r,this._brightnessMin=n,this._brightnessMax=i),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,t,r,n){const i=this.layout.get(e).evaluate(t,{},r,n),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||ra(o.value)||!i?i:function(e,t){return t.replace(/{([^{}]+)}/g,((t,r)=>r in e?String(e[r]):""))}(t.properties,i)}createBucket(e){return new cA(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of hA.paint.overridableProperties){if(!pA.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),r=new dA(t),n=new ta(r,t.property.specification,this.scope,this.options);let i=null;i="constant"===t.value.kind||"source"===t.value.kind?new ia("source",n):new oa("composite",n,t.value.zoomStops,t.value._interpolationType),this.paint._values[e]=new qa(t.property,i,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&pA.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const r=e.get("text-field"),n=hA.paint.properties[t];let i=!1;const o=e=>{for(const t of e)if(n.overrides&&n.overrides.hasOverride(t))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof pi)o(r.value.value.sections);else if("source"===r.value.kind){const e=t=>{i||(t instanceof yi&&Ai(t.value)===ni?o(t.value.sections):t instanceof wi?o(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return i}getProgramIds(){const e=0!==this.paint.get("icon-opacity").constantOr(1),t=0!==this.paint.get("text-opacity").constantOr(1),r=[];return e&&r.push("symbolIcon"),t&&r.push("symbolSDF"),r}getDefaultProgramParams(e,t){return{config:new Vc(this,t),overrideFog:!1}}}const fA=new Ka({visibility:new Xa(tl.layout_background.visibility)});var mA={paint:new Ka({"background-color":new Xa(tl.paint_background["background-color"]),"background-pattern":new Xa(tl.paint_background["background-pattern"]),"background-opacity":new Xa(tl.paint_background["background-opacity"]),"background-emissive-strength":new Xa(tl.paint_background["background-emissive-strength"])}),layout:fA};const gA=new Ka({visibility:new Xa(tl.layout_raster.visibility)});var AA={paint:new Ka({"raster-opacity":new Xa(tl.paint_raster["raster-opacity"]),"raster-color":new $a(tl.paint_raster["raster-color"]),"raster-color-mix":new Xa(tl.paint_raster["raster-color-mix"]),"raster-color-range":new Xa(tl.paint_raster["raster-color-range"]),"raster-hue-rotate":new Xa(tl.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Xa(tl.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Xa(tl.paint_raster["raster-brightness-max"]),"raster-saturation":new Xa(tl.paint_raster["raster-saturation"]),"raster-contrast":new Xa(tl.paint_raster["raster-contrast"]),"raster-resampling":new Xa(tl.paint_raster["raster-resampling"]),"raster-fade-duration":new Xa(tl.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new Xa(tl.paint_raster["raster-emissive-strength"]),"raster-array-band":new Xa(tl.paint_raster["raster-array-band"]),"raster-elevation":new Xa(tl.paint_raster["raster-elevation"])}),layout:gA},_A=wl([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class yA{constructor(e,t,r,n){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,n)}update(e,t,r){const{width:n,height:i}=e,{context:o}=this,{gl:s}=o;if(s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!t||!1!==t.premultiply)),r||this.size&&this.size[0]===n&&this.size[1]===i){const{x:t,y:o}=r||{x:0,y:0};if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap)s.texSubImage2D(s.TEXTURE_2D,0,t,o,s.RGBA,s.UNSIGNED_BYTE,e);else{let r=this.format,a=s.UNSIGNED_BYTE;this.format===s.R32F&&(r=s.RED,a=s.FLOAT),s.texSubImage2D(s.TEXTURE_2D,0,t,o,n,i,r,a,e.data)}}else if(this.size=[n,i],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap){let t=this.format;this.format===s.R8&&(t=s.RED),s.texImage2D(s.TEXTURE_2D,0,this.format,t,s.UNSIGNED_BYTE,e)}else{let t=this.format,r=this.format,o=s.UNSIGNED_BYTE;this.format===s.DEPTH_COMPONENT&&(t=s.DEPTH_COMPONENT16,o=s.UNSIGNED_SHORT),this.format===s.R8&&(r=s.RED),this.format===s.R32F&&(o=s.FLOAT,r=s.RED),s.texImage2D(s.TEXTURE_2D,0,t,n,i,0,r,o,e.data)}this.useMipmap=Boolean(t&&t.useMipmap),this.useMipmap&&s.generateMipmap(s.TEXTURE_2D)}bind(e,t,r=!1){const{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),e!==this.minFilter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,this.useMipmap&&!r?e===i.NEAREST?i.NEAREST_MIPMAP_NEAREST:i.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),t!==this.wrapS&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrapS=t)}bindExtraParam(e,t,r,n){const{context:i}=this,{gl:o}=i;o.bindTexture(o.TEXTURE_2D,this.texture),t!==this.magFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,t),this.magFilter=t),e!==this.minFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,this.useMipmap?e===o.NEAREST?o.NEAREST_MIPMAP_NEAREST:o.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),r!==this.wrapS&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,r),this.wrapS=r),n!==this.wrapT&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,n),this.wrapT=n)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class vA{constructor(e,t){this.context=e,this.texture=t}bind(e,t){const{context:r}=this,{gl:n}=r;n.bindTexture(n.TEXTURE_2D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}}function xA(t,r,n,i,o,s,a,l){const c=[t,r,1,n,i,1,o,s,1],u=[a,l,1],h=e.ct.adjoint([],c),[d,p,f]=e.Q.transformMat3(u,u,h);return e.ct.multiply(c,c,[d,0,0,0,p,0,0,0,f])}function bA(t,r,n,i,o,s,a,l){const c=function(t,r,n,i,o,s,a,l){const c=xA(0,0,1,0,1,1,0,1),u=xA(t,r,n,i,o,s,a,l),h=e.ct.adjoint([],c);return e.ct.multiply(u,u,h)}(t,r,n,i,o,s,a,l);return[c[2]/c[8]/io,c[5]/c[8]/io]}function wA(e){return[e[0],Math.min(Math.max(e[1],-Cu),Cu)]}class CA extends Bn{constructor(e,t,r,n){super(),this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(n),this.options=t,this._dirty=!1}load(e,t){if(this._loaded=t||!1,this.fire(new kn("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return e&&(this.coordinates=e),this._loaded=!0,void this._finishLoading();this._imageRequest=on(this.map._requestManager.transformRequest(this.url,Xr.Image),((t,r)=>{this._imageRequest=null,this._loaded=!0,t?this.fire(new zn(t)):r&&(this.image=r instanceof HTMLImageElement?Lr.getImageData(r):r,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}setTexture(e){if(!(e.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new vA(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new kn("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof vA||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let t=e[0][1],r=e[0][1];for(const n of e)n[1]>r&&(r=n[1]),n[1]<t&&(t=n[1]);const n=(r+t)/2;if(n>Cu?this.onNorthPole=!0:n<-Cu&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const t=e.map(Iu.fromLngLat);this.tileID=function(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const o of e)t=Math.min(t,o.x),r=Math.min(r,o.y),n=Math.max(n,o.x),i=Math.max(i,o.y);const o=Math.max(n-t,i-r),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),a=Math.pow(2,s);let l=Math.floor((t+n)/2*a);return l>1&&(l-=1),new uu(s,l,Math.floor((r+i)/2*a))}(t),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new kn("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(t){for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const r=Lg(new uu(0,0,0),this.map.transform.projection),n=[r.projection.project(this.coordinates[0][0],this.coordinates[0][1]),r.projection.project(this.coordinates[1][0],this.coordinates[1][1]),r.projection.project(this.coordinates[2][0],this.coordinates[2][1]),r.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(e){const t=e[1].x-e[0].x,r=e[1].y-e[0].y,n=e[2].x-e[1].x,i=e[2].y-e[1].y,o=e[3].x-e[2].x,s=e[3].y-e[2].y,a=e[0].x-e[3].x,l=e[0].y-e[3].y,c=t*i-n*r,u=n*s-o*i,h=o*l-a*s,d=a*r-t*l;return c>0&&u>0&&h>0&&d>0||c<0&&u<0&&h<0&&d<0}(n))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const i=Lg(this.tileID,this.map.transform.projection),[o,s,a,l]=this.coordinates.map((e=>{const t=i.projection.project(e[0],e[1]);return Og(i,t)._round()}));this.perspectiveTransform=bA(o.x,o.y,s.x,s.y,a.x,a.y,l.x,l.y);const c=this._boundsArray=new Sl;c.emplaceBack(o.x,o.y,0,0),c.emplaceBack(s.x,s.y,io,0),c.emplaceBack(l.x,l.y,0,io),c.emplaceBack(a.x,a.y,io,io),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=t.createVertexBuffer(c,_A.members),this.boundsSegments=mc.simpleSegment(0,0,4,2);const u=[],h=[wA((d=this.coordinates)[0]),wA(d[1]),wA(d[2]),wA(d[3])];var d;const[p,f,m,g]=function(e){let t=e[0][0],r=t,n=e[0][1],i=n;for(let o=1;o<e.length;o++)e[o][0]<t?t=e[o][0]:e[o][0]>r&&(r=e[o][0]),e[o][1]<n?n=e[o][1]:e[o][1]>i&&(i=e[o][1]);return[t,n,r-t,i-n]}(h);{const i=new Sl,[o,s,a,l]=function(e){let t=e[0].x,r=t,n=e[0].y,i=n;for(let o=1;o<e.length;o++)e[o].x<t?t=e[o].x:e[o].x>r&&(r=e[o].x),e[o].y<n?n=e[o].y:e[o].y>i&&(i=e[o].y);return[t,n,r-t,i-n]}(n),c=e=>[(e.x-o)/a,(e.y-s)/l],[h,d,A,_]=n.map(c),y=function(t,r,n,i,o,s,a,l){const c=xA(0,0,1,0,1,1,0,1),u=xA(t,r,n,i,o,s,a,l),h=e.ct.adjoint([],u);return e.ct.multiply(c,c,h)}(h[0],h[1],d[0],d[1],A[0],A[1],_[0],_[1]);this.elevatedGlobePerspectiveTransform=bA(h[0],h[1],d[0],d[1],A[0],A[1],_[0],_[1]);const v=(t,r)=>{u.push(t.lng);const n=Math.round((t.lng-p)/m*io),o=Math.round((t.lat-f)/g*io),s=c(r),a=e.Q.transformMat3([],[s[0],s[1],1],y),l=Math.round(a[0]/a[2]*io),h=Math.round(a[1]/a[2]*io);i.emplaceBack(n,o,l,h)},x=n[3].x-n[0].x,b=n[3].y-n[0].y,w=n[2].x-n[1].x,C=n[2].y-n[1].y;for(let e=0;e<65;e++){const t=e/64,i=[n[0].x+t*x,n[0].y+t*b],o=[n[1].x+t*w,n[1].y+t*C],s=o[0]-i[0],a=o[1]-i[1];for(let e=0;e<65;e++){const t=e/64,n={x:i[0]+s*t,y:i[1]+a*t,z:0};v(r.projection.unproject(n.x,n.y),n)}}this.elevatedGlobeVertexBuffer=t.createVertexBuffer(i,_A.members)}{this.maxLongitudeTriangleSize=0;let e=[],r=new Hl;const n=(t,n,i)=>{r.emplaceBack(t,n,i);const o=u[t],s=u[n],a=u[i],l=Math.min(Math.min(o,s),a),c=Math.max(Math.max(o,s),a)-l;c>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=c),e.push(l+c/2)};for(let e=0;e<64;e++)for(let t=0;t<64;t++){const r=65*e+t,i=r+1,o=r+65,s=o+1;n(r,o,i),n(i,o,s)}[e,r]=function(e,t){const r=Array.from({length:e.length},((e,t)=>t));r.sort(((t,r)=>e[t]-e[r]));const n=[],i=new Hl;for(let o=0;o<r.length;o++){const s=r[o];n.push(e[s]);const a=3*s,l=a+1;i.emplaceBack(t.uint16[a],t.uint16[l],t.uint16[l+1])}return[n,i]}(e,r),this.elevatedGlobeTrianglesCenterLongitudes=e,this.elevatedGlobeIndexBuffer=t.createIndexBuffer(r)}this.elevatedGlobeSegments=mc.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,m/io,0,g/io,0,0,f,p,0])}prepare(){const e=0!==Object.keys(this.tiles).length;if(this.tileID&&!e)return;const t=this.map.painter.context,r=t.gl;!this._dirty||this.texture instanceof vA||(this.texture?this.texture.update(this.image):(this.texture=new yA(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this._dirty=!1),e&&this._prepareData(t)}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(e){const t=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!t)return null;const r=this.elevatedGlobeTrianglesCenterLongitudes;let n=((e,t)=>e+360*Math.round((t-e)/360))(e+180,r[0]);const i=new mc,o=(e,r)=>{i.segments.push({vertexOffset:0,primitiveOffset:e,vertexLength:t.segments[0].vertexLength,primitiveLength:r,sortKey:void 0,vaos:{}})},s=.51*this.maxLongitudeTriangleSize;if(Math.abs(r[0]-n)<=s){const e=Sr(r,0,r.length,n+s);return e===r.length||o(e,Tr(r,e+1,r.length,n+360-s)-e),i}n<r[0]&&(n+=360);const a=Tr(r,0,r.length,n-s);if(a===r.length)return o(0,r.length),i;o(0,a-0);const l=Sr(r,a+1,r.length,n+s);return l!==r.length&&o(l,r.length-l),i}}const EA=(Math.pow(256,2)-1)/16907520;class TA extends yl{constructor(e,t,r){super(e,AA,t,r),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(e){return!(e&&e._source instanceof CA&&(e._source.onNorthPole||e._source.onSouthPole))&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(e){"raster-color"!==e&&"raster-color-range"!==e||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}updateColorRamp(e){if(!this.hasColorMap())return;if(!this._curRampRange)return;const t=this._transitionablePaint._values["raster-color"].value.expression,[r,n]=e||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(r)&&isNaN(n)||r===this._curRampRange[0]&&n===this._curRampRange[1]||(this.colorRamp=ad({expression:t,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:r,end:n}],resolution:256}),this.colorRampTexture=null,this._curRampRange=[r,n])}}const SA=new Ka({visibility:new Xa(tl["layout_raster-particle"].visibility)});var MA={paint:new Ka({"raster-particle-array-band":new Xa(tl["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new Xa(tl["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new $a(tl["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new Xa(tl["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new Xa(tl["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new Xa(tl["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new Xa(tl["paint_raster-particle"]["raster-particle-reset-rate-factor"])}),layout:SA};class IA extends yl{constructor(e,t,r){super(e,MA,t,r),this._updateColorRamp(),this.lastInvalidatedAt=Lr.now()}onRemove(e){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return"none"!==this.visibility}isDraped(e){return!1}_handleSpecialPaintPropertyUpdate(e){"raster-particle-color"!==e&&"raster-particle-max-speed"!==e||(this._updateColorRamp(),this._invalidateAnimationState()),"raster-particle-count"===e&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;const e=this._transitionablePaint._values["raster-particle-color"].value.expression,t=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=ad({expression:e,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:t}],resolution:256}),this.colorRampTexture=null}_invalidateAnimationState(){this.lastInvalidatedAt=Lr.now()}}class PA extends yl{constructor(e,t){super(e,{},t),this.implementation=e,e.slot&&(this.slot=e.slot)}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isDraped(e){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}const LA=new Ka({visibility:new Xa(tl.layout_sky.visibility)});var OA={paint:new Ka({"sky-type":new Xa(tl.paint_sky["sky-type"]),"sky-atmosphere-sun":new Xa(tl.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Xa(tl.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Xa(tl.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Xa(tl.paint_sky["sky-gradient-radius"]),"sky-gradient":new $a(tl.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Xa(tl.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Xa(tl.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Xa(tl.paint_sky["sky-opacity"])}),layout:LA};function DA(t,r,n){const i=[0,0,1],o=e.bl.identity([]);return e.bl.rotateY(o,o,n?-Ht(t)+Math.PI:Ht(t)),e.bl.rotateX(o,o,-Ht(r)),e.Q.transformQuat(i,i,o),e.Q.normalize(i,i)}var kA={paint:new Ka({})};function zA(t,r){const n=RA(t.projection,t.zoom,t.width,t.height),i=function(t,r,n,i,o){const s=new su(n.lng-180*FA,n.lat),a=new su(n.lng+180*FA,n.lat),l=t.project(s.lng,s.lat),c=t.project(a.lng,a.lat),u=-Math.atan2(c.y-l.y,c.x-l.x),h=Iu.fromLngLat(n);h.y=Xt(h.y,-1+FA,1-FA);const d=h.toLngLat(),p=t.project(d.lng,d.lat),f=Iu.fromLngLat(d);f.x+=FA;const m=f.toLngLat(),g=t.project(m.lng,m.lat),A=NA(g.x-p.x,g.y-p.y,u),_=Iu.fromLngLat(d);_.y+=FA;const y=_.toLngLat(),v=t.project(y.lng,y.lat),x=NA(v.x-p.x,v.y-p.y,u),b=Math.abs(A.x)/Math.abs(x.y),w=e.a9.identity([]);e.a9.rotateZ(w,w,-u*(1-(o?0:i)));const C=e.a9.identity([]);return e.a9.scale(C,C,[1,1-(1-b)*i,1]),C[4]=-x.x/x.y*i,e.a9.rotateZ(C,C,u),e.a9.multiply(C,w,C),C}(t.projection,0,t.center,n,r),o=BA(t);return e.a9.scale(i,i,[o,o,1]),i}function BA(e){const t=e.projection,r=RA(e.projection,e.zoom,e.width,e.height),n=jA(t,e.center),i=jA(t,su.convert(t.center));return Math.pow(2,n*r+(1-r)*i)}function RA(e,t,r,n,i=1/0){const o=e.range;if(!o)return 0;const s=Math.min(i,Math.max(r,n)),a=Math.log(s/1024)/Math.LN2;return Yt(o[0]+a,o[1]+a,t)}const FA=1/4e4;function jA(e,t){const r=Xt(t.lat,-Cu,Cu),n=new su(t.lng-180*FA,r),i=new su(t.lng+180*FA,r),o=e.project(n.lng,r),s=e.project(i.lng,r),a=Iu.fromLngLat(n),l=Iu.fromLngLat(i),c=s.x-o.x,u=s.y-o.y,h=l.x-a.x,d=l.y-a.y,p=Math.sqrt((h*h+d*d)/(c*c+u*u));return Math.log(p)/Math.LN2}function NA(e,t,r){const n=Math.cos(r),i=Math.sin(r);return{x:e*n-t*i,y:e*i+t*n}}function VA(t,r,n){e.a9.identity(t),e.a9.rotateZ(t,t,Ht(r[2])),e.a9.rotateX(t,t,Ht(r[0])),e.a9.rotateY(t,t,Ht(r[1])),e.a9.scale(t,t,n),e.a9.multiply(t,t,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1])}function UA(t,r,n,i,o,s,a,l){const c=[n[0]-r[0],n[1]-r[1],0],u=[i[0]-r[0],i[1]-r[1],0];if(e.Q.length(c)<1e-12||e.Q.length(u)<1e-12)return e.bl.identity(t);const h=e.Q.cross([],c,u);e.Q.normalize(h,h),e.Q.subtract(u,i,r),c[2]=(s-o)*l,u[2]=(a-o)*l;const d=c;return e.Q.cross(d,c,u),e.Q.normalize(d,d),e.bl.rotationTo(t,h,d)}function HA(t,r,n=!1){const i=jh(r.zoom),o=function(t,r,n){const i=r.worldSize,o=[t[12],t[13],t[14]],s=bu(o[1]/i),a=xu(o[0]/i),l=e.a9.identity([]),c=vu(1,s)*i,u=vu(1,0)*i*Tu(s,r.zoom),h=1/Bh(i);let d=u*h;if(n){const e=RA(r.projection,r.zoom,r.width,r.height,1024);d=h*r.projection.pixelSpaceConversion(r.center.lat,i,e)}const p=nu(s,a);e.Q.add(p,p,e.Q.scale([],e.Q.normalize([],p),c*d*o[2]));const f=function(t){const r=[t[0],t[1],t[2]];let n=[0,1,0];const i=e.Q.cross([],n,r);return e.Q.cross(n,r,i),0===e.Q.squaredLength(n)&&(n=[0,1,0],e.Q.cross(i,r,n)),e.Q.normalize(i,i),e.Q.normalize(n,n),e.Q.normalize(r,r),[i[0],i[1],i[2],0,n[0],n[1],n[2],0,r[0],r[1],r[2],0,t[0],t[1],t[2],1]}(p);e.a9.scale(l,l,[d,d,d*c]),e.a9.translate(l,l,[-o[0],-o[1],-o[2]]);const m=e.a9.multiply([],r.globeMatrix,f);return e.a9.multiply(m,m,l),e.a9.multiply(m,m,t),m}(t,r,n);if(i>0){const n=function(t,r){const n=r.worldSize,i=vu(1,0)*n*Tu(r.center.lat,r.zoom)/Bh(n),o=vu(1,r.center.lat)*n,s=e.a9.identity([]);return e.a9.rotateY(s,s,Ht(r.center.lng)),e.a9.rotateX(s,s,Ht(r.center.lat)),e.a9.translate(s,s,[0,0,Qc]),e.a9.scale(s,s,[i,i,i*o]),e.a9.translate(s,s,[r.point.x-.5*n,r.point.y-.5*n,0]),e.a9.multiply(s,s,t),e.a9.multiply(s,r.globeMatrix,s)}(t,r);return function(t,r,n){const i=(t,r,n)=>{const i=e.Q.length(t),o=e.Q.length(r),s=Th(t,r,n);return e.Q.scale(s,s,1/e.Q.length(s)*Hn(i,o,n))},o=i([t[0],t[1],t[2]],[r[0],r[1],r[2]],n),s=i([t[4],t[5],t[6]],[r[4],r[5],r[6]],n),a=i([t[8],t[9],t[10]],[r[8],r[9],r[10]],n),l=Th([t[12],t[13],t[14]],[r[12],r[13],r[14]],n);return[o[0],o[1],o[2],0,s[0],s[1],s[2],0,a[0],a[1],a[2],0,l[0],l[1],l[2],1]}(o,n,i)}return o}function GA(e,t,r,n){const i=mh.projectAabbCorners(n,r);let o=Number.MAX_VALUE,s=-1;for(let e=0;e<i.length;++e){const r=i[e];r[0]=(.5*r[0]+.5)*t.width,r[1]=(.5-.5*r[1])*t.height,r[2]<o&&(s=e,o=r[2])}const a=e=>new Nt(i[e][0],i[e][1]);let l;switch(s){case 0:case 6:l=[a(1),a(5),a(4),a(7),a(3),a(2),a(1)];break;case 1:case 7:l=[a(0),a(4),a(5),a(6),a(2),a(3),a(0)];break;case 3:case 5:l=[a(1),a(0),a(4),a(7),a(6),a(2),a(1)];break;default:l=[a(1),a(5),a(6),a(7),a(3),a(0),a(1)]}if(Uu(e,l))return o}const ZA=wl([{name:"a_pos_3f",components:3,type:"Float32"}]),WA=wl([{name:"a_color_3f",components:3,type:"Float32"}]),qA=wl([{name:"a_color_4f",components:4,type:"Float32"}]),QA=wl([{name:"a_uv_2f",components:2,type:"Float32"}]),XA=wl([{name:"a_normal_3f",components:3,type:"Float32"}]),YA=wl([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),$A=wl([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]);class KA{constructor(e,t,r,n){this.message=(e?`${e}: `:"")+r,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}function JA(e,t){const r=-1===e.indexOf("://");try{return new URL(e,r&&t?"http://example.com":void 0),!0}catch(e){return!1}}class e_{constructor(e,t){this.feature=e,this.instancedDataOffset=t,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class t_{constructor(){this.instancedDataArray=new Kl,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class r_{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.projection=e.projection,this.index=e.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1}populate(e,t,r,n){this.tileToMeter=Mu(r);const i=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:o,id:s,index:a,sourceLayerIndex:l}of e){const e=null!=s?s:o.properties&&o.properties.hasOwnProperty("id")?o.properties.id:void 0,c=Fu(o,i);if(!this.layers[0]._featureFilter.filter(new Na(this.zoom),c,r))continue;const u={id:e,sourceLayerIndex:l,index:a,geometry:i?c.geometry:Ru(o,r,n),properties:o.properties,type:o.type,patterns:{}},h=this.addFeature(u,u.geometry,c);h&&t.featureIndex.insert(o,u.geometry,a,l,this.index,this.instancesPerModel[h].instancedDataArray.length,io/32)}this.lookup=null}update(e,t,r,n){for(const t in this.instancesPerModel){const r=this.instancesPerModel[t];for(const t in e)r.idToFeaturesIndex.hasOwnProperty(t)&&(this.evaluate(r.features[r.idToFeaturesIndex[t]],e[t],r,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let t=!1;for(const r in this.instancesPerModel){const n=this.instancesPerModel[r];for(const r of n.features){const i=this.layers[0],o=r.feature,s=this.canonical,a=i.paint.get("model-rotation").evaluate(o,{},s),l=i.paint.get("model-scale").evaluate(o,{},s),c=i.paint.get("model-translation").evaluate(o,{},s);e.Q.exactEquals(r.rotation,a)&&e.Q.exactEquals(r.scale,l)&&e.Q.exactEquals(r.translation,c)||(this.evaluate(r,r.featureStates,n,!0),t=!0)}}return t}isEmpty(){for(const e in this.instancesPerModel)if(0!==this.instancesPerModel[e].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const t in this.instancesPerModel){const r=this.instancesPerModel[t];r.instancedDataArray.length<0||0===r.instancedDataArray.length||(r.instancedDataBuffer?r.instancedDataBuffer.updateData(r.instancedDataArray):r.instancedDataBuffer=e.createVertexBuffer(r.instancedDataArray,YA.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(const e in this.instancesPerModel){const t=this.instancesPerModel[e];0!==t.instancedDataArray.length&&t.instancedDataBuffer&&t.instancedDataBuffer.destroy()}const e=this.layers[0].modelManager;if(e&&this.modelUris)for(const t of this.modelUris)e.removeModel(t,"")}addFeature(e,t,r){const n=this.layers[0],i=n.layout.get("model-id").evaluate(r,{},this.canonical);if(!i)return hr(`modelId is not evaluated for layer ${n.id} and it is not going to get rendered.`),i;JA(i,!1)&&(this.modelUris.includes(i)||this.modelUris.push(i)),this.instancesPerModel[i]||(this.instancesPerModel[i]=new t_);const o=this.instancesPerModel[i],s=o.instancedDataArray,a=new e_(r,s.length);for(const e of t)for(const t of e){if(t.x<0||t.x>=io||t.y<0||t.y>=io)continue;const e=(this.lookupDim-1)/io,r=this.lookupDim*(t.y*e|0)+t.x*e|0;if(this.lookup){if(0!==this.lookup[r])continue;this.lookup[r]=1}this.instanceCount++;const n=s.length;s.resize(n+1),o.instancesEvaluatedElevation.push(0),s.float32[16*n]=t.x,s.float32[16*n+1]=t.y}return a.instancedDataCount=o.instancedDataArray.length-a.instancedDataOffset,a.instancedDataCount>0&&(e.id&&(o.idToFeaturesIndex[e.id]=o.features.length),o.features.push(a),this.evaluate(a,{},o,!1)),i}getModelUris(){return this.modelUris}evaluate(e,t,r,n){const i=this.layers[0],o=e.feature,s=this.canonical,a=e.rotation=i.paint.get("model-rotation").evaluate(o,t,s),l=e.scale=i.paint.get("model-scale").evaluate(o,t,s),c=e.translation=i.paint.get("model-translation").evaluate(o,t,s),u=i.paint.get("model-color").evaluate(o,t,s);u.a=i.paint.get("model-color-mix-intensity").evaluate(o,t,s);const h=[];this.maxVerticalOffset<c[2]&&(this.maxVerticalOffset=c[2]),this.maxScale=Math.max(Math.max(this.maxScale,l[0]),Math.max(l[1],l[2])),VA(h,a,l);const d=Math.round(100*u.a)+u.b/1.05;for(let t=0;t<e.instancedDataCount;++t){const i=e.instancedDataOffset+t,o=16*i,a=r.instancedDataArray.float32;let l=0;n&&(l=a[o+6]-r.instancesEvaluatedElevation[i]);const p=0|a[o+1];a[o]=(0|a[o])+u.r/1.05,a[o+1]=p+u.g/1.05,a[o+2]=d,a[o+3]=1/(s.z>10?this.tileToMeter:Mu(s,p)),a[o+4]=c[0],a[o+5]=c[1],a[o+6]=c[2]+l,a[o+7]=h[0],a[o+8]=h[1],a[o+9]=h[2],a[o+10]=h[4],a[o+11]=h[5],a[o+12]=h[6],a[o+13]=h[8],a[o+14]=h[9],a[o+15]=h[10],r.instancesEvaluatedElevation[i]=c[2]}}}fa(r_,"ModelBucket",{omit:["layers"]}),fa(t_,"PerModelAttributes"),fa(e_,"ModelFeature");const n_=new Ka({visibility:new Xa(tl.layout_model.visibility),"model-id":new Ya(tl.layout_model["model-id"])});var i_={paint:new Ka({"model-opacity":new Xa(tl.paint_model["model-opacity"]),"model-rotation":new Ya(tl.paint_model["model-rotation"]),"model-scale":new Ya(tl.paint_model["model-scale"]),"model-translation":new Ya(tl.paint_model["model-translation"]),"model-color":new Ya(tl.paint_model["model-color"]),"model-color-mix-intensity":new Ya(tl.paint_model["model-color-mix-intensity"]),"model-type":new Xa(tl.paint_model["model-type"]),"model-cast-shadows":new Xa(tl.paint_model["model-cast-shadows"]),"model-receive-shadows":new Xa(tl.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new Xa(tl.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new Ya(tl.paint_model["model-emissive-strength"]),"model-roughness":new Ya(tl.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new Ya(tl.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new Xa(tl.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new Xa(tl.paint_model["model-front-cutoff"])}),layout:n_};const o_=64,s_={CoordinateSpaceTile:1,CoordinateSpaceYUp:2,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function a_(t,r,n,i,o,s,a,l,c,u=!1){const h=n.zoom,d=n.project(i),p=Tu(i.lat,h),f=1/p;e.a9.identity(t),e.a9.translate(t,t,[d.x+a[0]*f,d.y+a[1]*f,a[2]]);let m=1,g=1;const A=n.worldSize;if(u){if("mercator"===n.projection.name){let t=0;n.elevation&&(t=n.elevation.getAtPointOrZero(new Iu(d.x/A,d.y/A),0));const r=e.aa.transformMat4([],[d.x,d.y,t,1],n.projMatrix)[3]/n.cameraToCenterDistance;m=r,g=r*Tu(n.center.lat,h)}else if("globe"===n.projection.name){const r=HA(t,n),o=e.a9.multiply([],n.projMatrix,r),s=[0,0,0,1];e.aa.transformMat4(s,s,o);const a=s[3]/n.cameraToCenterDistance,l=jh(h),c=n.projection.pixelsPerMeter(i.lat,A)*Tu(i.lat,h),u=n.projection.pixelsPerMeter(n.center.lat,A)*Tu(n.center.lat,h);m=a/Hn(c,Eu(n.center.lat),l),g=a*p/c,m*=u,g*=u}}else m=f;e.a9.scale(t,t,[m,m,g]);const _=[...t],y=r.orientation,v=[];if(VA(v,[y[0]+o[0],y[1]+o[1],y[2]+o[2]],s),e.a9.multiply(t,_,v),l&&n.elevation){let o=0;const s=[];if(c&&n.elevation){o=function(t,r,n,i,o){const s=r.elevation;if(!s)return 0;const a=mh.projectAabbCorners(n,i),l=vu(1,o.lat)*r.worldSize,c=function(t,r){const n=[0,0,1],i=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const o of i){const i=t[o.corners[0]],s=t[o.corners[1]],a=t[o.corners[2]],l=[s[0]-i[0],s[1]-i[1],r*(s[2]-i[2])],c=e.Q.cross(l,l,[a[0]-i[0],a[1]-i[1],r*(a[2]-i[2])]);e.Q.normalize(c,c),o.dotProductWithUp=e.Q.dot(c,n)}return i.sort(((e,t)=>e.dotProductWithUp-t.dotProductWithUp)),i[0].corners}(a,l),u=a[c[0]],h=a[c[1]],d=a[c[2]],p=a[c[3]],f=s.getAtPointOrZero(new Iu(u[0]/r.worldSize,u[1]/r.worldSize),0),m=s.getAtPointOrZero(new Iu(h[0]/r.worldSize,h[1]/r.worldSize),0),g=s.getAtPointOrZero(new Iu(d[0]/r.worldSize,d[1]/r.worldSize),0),A=s.getAtPointOrZero(new Iu(p[0]/r.worldSize,p[1]/r.worldSize),0),_=(f+A)/2,y=(m+g)/2;return _>y?m<g?UA(t,h,p,u,m,A,f,l):UA(t,d,u,p,g,f,A,l):f<A?UA(t,u,h,d,f,m,g,l):UA(t,p,d,h,A,g,m,l),Math.max(_,y)}(s,n,r.aabb,t,i);const a=e.a9.fromQuat([],s),l=e.a9.multiply([],a,v);e.a9.multiply(t,_,l)}else o=n.elevation.getAtPointOrZero(new Iu(d.x/A,d.y/A),0);0!==o&&(t[14]+=o)}}function l_(e,t,r=!1){e.uploaded||(e.gfxTexture=new yA(t,e.image,r?t.gl.R8:t.gl.RGBA,{useMipmap:e.sampler.minFilter>=t.gl.NEAREST_MIPMAP_NEAREST}),e.uploaded=!0,e.image=null)}function c_(e,t,r){e.indexBuffer=t.createIndexBuffer(e.indexArray,!1,!0),e.vertexBuffer=t.createVertexBuffer(e.vertexArray,ZA.members,!1,!0),e.normalArray&&(e.normalBuffer=t.createVertexBuffer(e.normalArray,XA.members,!1,!0)),e.texcoordArray&&(e.texcoordBuffer=t.createVertexBuffer(e.texcoordArray,QA.members,!1,!0)),e.colorArray&&(e.colorBuffer=t.createVertexBuffer(e.colorArray,(12===e.colorArray.bytesPerElement?WA:qA).members,!1,!0)),e.featureArray&&(e.pbrBuffer=t.createVertexBuffer(e.featureArray,$A.members,!0)),e.segments=mc.simpleSegment(0,0,e.vertexArray.length,e.indexArray.length);const n=e.material;n.pbrMetallicRoughness.baseColorTexture&&l_(n.pbrMetallicRoughness.baseColorTexture,t),n.pbrMetallicRoughness.metallicRoughnessTexture&&l_(n.pbrMetallicRoughness.metallicRoughnessTexture,t),n.normalTexture&&l_(n.normalTexture,t),n.occlusionTexture&&l_(n.occlusionTexture,t,r),n.emissionTexture&&l_(n.emissionTexture,t)}function u_(e,t,r){if(e.meshes)for(const n of e.meshes)c_(n,t,r);if(e.children)for(const n of e.children)u_(n,t,r)}function h_(e){if(e.meshes)for(const t of e.meshes)t.indexArray.destroy(),t.vertexArray.destroy(),t.colorArray&&t.colorArray.destroy(),t.normalArray&&t.normalArray.destroy(),t.texcoordArray&&t.texcoordArray.destroy(),t.featureArray&&t.featureArray.destroy();if(e.children)for(const t of e.children)h_(t)}function d_(e){if(e.meshes)for(const r of e.meshes)r.vertexBuffer&&(r.vertexBuffer.destroy(),r.indexBuffer.destroy(),r.normalBuffer&&r.normalBuffer.destroy(),r.texcoordBuffer&&r.texcoordBuffer.destroy(),r.colorBuffer&&r.colorBuffer.destroy(),r.pbrBuffer&&r.pbrBuffer.destroy(),r.segments.destroy(),r.material&&((t=r.material).pbrMetallicRoughness.baseColorTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),t.pbrMetallicRoughness.metallicRoughnessTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),t.normalTexture&&t.normalTexture.gfxTexture&&t.normalTexture.gfxTexture.destroy(),t.emissionTexture&&t.emissionTexture.gfxTexture&&t.emissionTexture.gfxTexture.destroy(),t.occlusionTexture&&t.occlusionTexture.gfxTexture&&t.occlusionTexture.gfxTexture.destroy()));var t;if(e.children)for(const t of e.children)d_(t)}class p_{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){this._channel=void 0,this._callback=()=>{}}}class f_{constructor(){this.tasks={},this.taskQueue=[],or(["process"],this),this.invoker=new p_(this.process),this.nextId=0}add(e,t){const r=this.nextId++,n=function({type:e,isSymbolTile:t,zoom:r}){return r=r||0,"message"===e?0:"maybePrepare"!==e||t?"parseTile"!==e||t?"parseTile"===e&&t?300-r:"maybePrepare"===e&&t?400-r:500:200-r:100-r}(t);if(0===n){mr();try{e()}finally{}return null}return this.tasks[r]={fn:e,metadata:t,priority:n,id:r},this.taskQueue.push(r),this.invoker.trigger(),{cancel:()=>{delete this.tasks[r]}}}process(){mr();try{if(this.taskQueue=this.taskQueue.filter((e=>!!this.tasks[e])),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!t)return;t.fn()}finally{}}pick(){let e=null,t=1/0;for(let r=0;r<this.taskQueue.length;r++){const n=this.tasks[this.taskQueue[r]];n.priority<t&&(t=n.priority,e=r)}if(null===e)return null;const r=this.taskQueue[e];return this.taskQueue.splice(e,1),r}remove(){this.invoker.remove()}}class m_{constructor(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.cancelCallbacks={},or(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler=new f_}send(e,t,r,n,i=!1,o){const s=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(r.metadata=o,this.callbacks[s]=r);const a=new Set;return this.target.postMessage({id:s,type:e,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:Aa(t,a)},a),{cancel:()=>{r&&delete this.callbacks[s],this.target.postMessage({id:s,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}receive(e){const t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){const e=this.cancelCallbacks[r];delete this.cancelCallbacks[r],e&&e.cancel()}else if(t.mustQueue||mr()){const e=this.callbacks[r],n=this.scheduler.add((()=>this.processTask(r,t)),e&&e.metadata||{type:"message"});n&&(this.cancelCallbacks[r]=n)}else this.processTask(r,t)}processTask(e,t){if(delete this.cancelCallbacks[e],"<response>"===t.type){const r=this.callbacks[e];delete this.callbacks[e],r&&(t.error?r(_a(t.error)):r(null,_a(t.data)))}else{const r=new Set,n=t.hasCallback?(t,n)=>{this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?Aa(t):null,data:Aa(n,r)},r)}:e=>{},i=_a(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,i,n);else if(this.parent.getWorkerSource){const e=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,e[0],i.source,i.scope)[e[1]](i,n)}else n(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}class g_{constructor(e,t){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=tr();const r=this.workerPool.acquire(this.id);for(let e=0;e<r.length;e++){const n=new g_.Actor(r[e],t,this.id);n.name=`Worker ${e}`,this.actors.push(n)}this.ready=!1,this.broadcast("checkIfReady",null,(()=>{this.ready=!0}))}broadcast(e,t,r){Kt(this.actors,((r,n)=>{r.send(e,t,n)}),r=r||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((e=>{e.remove()})),this.actors=[],this.workerPool.release(this.id)}}g_.Actor=m_;var A_={workerUrl:"",workerClass:null,workerParams:void 0};function __(){return null!=A_.workerClass?new A_.workerClass:new self.Worker(A_.workerUrl,A_.workerParams)}const y_="mapboxgl_preloaded_worker_pool";class v_{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<v_.workerCount;)this.workers.push(new __);return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.workers&&0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[y_]}numActive(){return Object.keys(this.active).length}}let x_;function b_(){return x_||(x_=new v_),x_}v_.workerCount=2;let w_,C_,E_,T_,S_,M_=null;function I_(){return mr()&&self.worker&&self.worker.dracoUrl?self.worker.dracoUrl:C_||n.DRACO_URL}function P_(){if(mr()&&self.worker&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(T_)return T_;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return T_=WebAssembly.validate(e)?n.MESHOPT_SIMD_URL:n.MESHOPT_URL,T_}const L_={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},O_={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},D_={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function k_(e,t,r){const n=r.json.bufferViews.length,i=r.buffers.length;t.bufferView=n,r.json.bufferViews[n]={buffer:i,byteLength:e.byteLength},r.buffers[i]=e}const z_="KHR_draco_mesh_compression";function B_(e,t){const r=e.extensions&&e.extensions[z_];if(!r)return;const n=new E_.Decoder,i=H_(t,r.bufferView),o=new E_.Mesh;if(!n.DecodeArrayToMesh(i,i.byteLength,o))throw new Error("Failed to decode Draco mesh");const s=t.json.accessors[e.indices],a=L_[s.componentType],l=s.count*a.BYTES_PER_ELEMENT,c=E_._malloc(l);a===Uint16Array?n.GetTrianglesUInt16Array(o,l,c):n.GetTrianglesUInt32Array(o,l,c),k_(E_.memory.buffer.slice(c,c+l),s,t),E_._free(c);for(const i of Object.keys(r.attributes)){const s=n.GetAttributeByUniqueId(o,r.attributes[i]),a=t.json.accessors[e.attributes[i]],l=O_[a.componentType],c=a.count*D_[a.type]*L_[a.componentType].BYTES_PER_ELEMENT,u=E_._malloc(c);n.GetAttributeDataArrayForAllPoints(o,s,E_[l],c,u),k_(E_.memory.buffer.slice(u,u+c),a,t),E_._free(u)}n.destroy(),o.destroy(),delete e.extensions[z_]}const R_="EXT_meshopt_compression";function F_(e,t){if(!e.extensions||!e.extensions[R_])return;const r=e.extensions[R_],n=new Uint8Array(t.buffers[r.buffer],r.byteOffset||0,r.byteLength||0),i=new Uint8Array(r.count*r.byteStride);S_.decodeGltfBuffer(i,r.count,r.byteStride,n,r.mode,r.filter),e.buffer=t.buffers.length,e.byteOffset=0,t.buffers[e.buffer]=i.buffer,delete e.extensions[R_]}const j_=1179937895,N_=new TextDecoder("utf8");function V_(e,t){return new URL(e,t).href}function U_(e,t,r,n){return fetch(V_(e.uri,n)).then((e=>e.arrayBuffer())).then((e=>{t.buffers[r]=e}))}function H_(e,t){const r=e.json.bufferViews[t];return new Uint8Array(e.buffers[r.buffer],r.byteOffset||0,r.byteLength)}function G_(e,t,r,n){if(e.uri){const i=V_(e.uri,n);return fetch(i).then((e=>e.blob())).then((e=>createImageBitmap(e))).then((e=>{t.images[r]=e}))}if(void 0!==e.bufferView){const n=H_(t,e.bufferView),i=new Blob([n],{type:e.mimeType});return createImageBitmap(i).then((e=>{t.images[r]=e}))}}function Z_(e,t=0,r){const n={json:null,images:[],buffers:[]};if(new Uint32Array(e,t,1)[0]===j_){const r=new Uint32Array(e,t);let i=2;const o=(r[i++]>>2)-3,s=r[i++]>>2;if(i++,n.json=JSON.parse(N_.decode(r.subarray(i,i+s))),i+=s,i<o){const o=r[i++];i++;const s=t+(i<<2);n.buffers[0]=e.slice(s,s+o)}}else n.json=JSON.parse(N_.decode(new Uint8Array(e,t)));const{buffers:i,images:o,meshes:s,extensionsUsed:a,bufferViews:l}=n.json;let c=Promise.resolve();if(i){const e=[];for(let t=0;t<i.length;t++){const o=i[t];o.uri?e.push(U_(o,n,t,r)):n.buffers[t]||(n.buffers[t]=null)}c=Promise.all(e)}return c.then((()=>{const e=[],t=a&&a.includes(z_),i=a&&a.includes(R_);if(t&&e.push(function(){if(!E_)return w_||(w_=function(e){let t,r=null;function n(){t=new Uint8Array(r.buffer)}function i(){throw new Error("Unexpected Draco error.")}const o={a:{a:i,d:function(e,r,n){return t.copyWithin(e,r,r+n)},c:function(e){const i=t.length,o=Math.max(e>>>0,Math.ceil(1.2*i)),s=Math.ceil((o-i)/65536);try{return r.grow(s),n(),!0}catch(e){return!1}},b:i}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,o):e.then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,o)))).then((e=>{const{Rb:i,Qb:o,P:s,T:a,X:l,Ja:c,La:u,Qa:h,Va:d,Wa:p,eb:f,jb:m,f:g,e:A,yb:_,zb:y,Ab:v,Bb:x,Db:b,Gb:w}=e.instance.exports;r=A;const C=(()=>{let e=0,r=0,n=0,s=0;return a=>{n&&(i(s),i(e),r+=n,n=e=0),e||(r+=128,e=o(r));const l=a.length+7&-8;let c=e;l>=r&&(n=l,c=s=o(l));for(let e=0;e<a.length;e++)t[c+e]=a[e];return c}})();return n(),g(),{memory:A,_free:i,_malloc:o,Mesh:class{constructor(){this.ptr=s()}destroy(){a(this.ptr)}},Decoder:class{constructor(){this.ptr=c()}destroy(){m(this.ptr)}DecodeArrayToMesh(e,t,r){const n=C(e),i=u(this.ptr,n,t,r.ptr);return!!l(i)}GetAttributeByUniqueId(e,t){return{ptr:h(this.ptr,e.ptr,t)}}GetTrianglesUInt16Array(e,t,r){d(this.ptr,e.ptr,t,r)}GetTrianglesUInt32Array(e,t,r){p(this.ptr,e.ptr,t,r)}GetAttributeDataArrayForAllPoints(e,t,r,n,i){f(this.ptr,e.ptr,t.ptr,r,n,i)}},DT_INT8:_(),DT_UINT8:y(),DT_INT16:v(),DT_UINT16:x(),DT_UINT32:b(),DT_FLOAT32:w()}}))}(fetch(I_())),w_.then((e=>{E_=e,w_=void 0})))}()),i&&e.push(function(){if(S_)return;const e=function(e){let t;const r=WebAssembly.instantiateStreaming(e,{}).then((e=>{t=e.instance,t.exports.__wasm_call_ctors()})),n={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},i={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:r,supported:!0,decodeGltfBuffer(e,r,o,s,a,l){!function(e,t,r,n,i,o,s){const a=e.exports.sbrk,l=n+3&-4,c=a(l*i),u=a(o.length),h=new Uint8Array(e.exports.memory.buffer);h.set(o,u);const d=t(c,n,i,u,o.length);if(0===d&&s&&s(c,l,i),r.set(h.subarray(c,c+n*i)),a(c-a(0)),0!==d)throw new Error(`Malformed buffer data: ${d}`)}(t,t.exports[i[a]],e,r,o,s,t.exports[n[l]])}}}(fetch(P_()));return e.ready.then((()=>{S_=e}))}()),o)for(let t=0;t<o.length;t++)e.push(G_(o[t],n,t,r));return(e.length?Promise.all(e):Promise.resolve()).then((()=>{if(t&&s)for(const{primitives:e}of s)for(const t of e)B_(t,n);if(i&&s&&l)for(const e of l)F_(e,n);return n}))}))}class W_{constructor(e,t,r,n){if(this.triangleCount=t.length/3,this.min=new Nt(0,0),this.max=new Nt(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],0===this.triangleCount||0===e.length)return;const[i,o]=[e[0].clone(),e[0].clone()];for(let t=1;t<e.length;++t){const r=e[t];i.x=Math.min(i.x,r.x),i.y=Math.min(i.y,r.y),o.x=Math.max(o.x,r.x),o.y=Math.max(o.y,r.y)}if(n){const e=Math.ceil(Math.max(o.x-i.x,o.y-i.y)/n);r=Math.max(r,e)}if(0===r)return;this.min=i,this.max=o;const s=this.max.sub(this.min);s.x=Math.max(s.x,1),s.y=Math.max(s.y,1);const a=Math.max(s.x,s.y)/r;this.cellsX=Math.max(1,Math.ceil(s.x/a)),this.cellsY=Math.max(1,Math.ceil(s.y/a)),this.xScale=1/a,this.yScale=1/a;const l=[];for(let r=0;r<this.triangleCount;r++){const n=e[t[3*r+0]].sub(this.min),i=e[t[3*r+1]].sub(this.min),o=e[t[3*r+2]].sub(this.min),s=q_(Math.floor(Math.min(n.x,i.x,o.x)),this.xScale,this.cellsX),c=q_(Math.floor(Math.max(n.x,i.x,o.x)),this.xScale,this.cellsX),u=q_(Math.floor(Math.min(n.y,i.y,o.y)),this.yScale,this.cellsY),h=q_(Math.floor(Math.max(n.y,i.y,o.y)),this.yScale,this.cellsY),d=new Nt(0,0),p=new Nt(0,0),f=new Nt(0,0),m=new Nt(0,0);for(let e=u;e<=h;++e){d.y=p.y=e*a,f.y=m.y=(e+1)*a;for(let t=s;t<=c;++t)d.x=f.x=t*a,p.x=m.x=(t+1)*a,(th(n,i,o,d,p,m)||th(n,i,o,d,m,f))&&l.push({cellIdx:e*this.cellsX+t,triIdx:r})}}if(0===l.length)return;l.sort(((e,t)=>e.cellIdx-t.cellIdx||e.triIdx-t.triIdx));let c=0;for(;c<l.length;){const e=l[c].cellIdx,t={start:this.payload.length,len:0};for(;c<l.length&&l[c].cellIdx===e;)++t.len,this.payload.push(l[c++].triIdx);this.cells[e]=t}}query(e,t,r){if(0===this.triangleCount||0===this.cells.length)return;if(e.x>this.max.x||this.min.x>t.x)return;if(e.y>this.max.y||this.min.y>t.y)return;this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8)));for(let e=0;e<this.lookup.length;e++)this.lookup[e]=0;const n=q_(e.x-this.min.x,this.xScale,this.cellsX),i=q_(t.x-this.min.x,this.xScale,this.cellsX),o=q_(e.y-this.min.y,this.yScale,this.cellsY),s=q_(t.y-this.min.y,this.yScale,this.cellsY);for(let e=o;e<=s;e++)for(let t=n;t<=i;t++){const n=this.cells[e*this.cellsX+t];if(n)for(let e=0;e<n.len;e++){const t=this.payload[n.start+e],i=Math.floor(t/8),o=1<<t%8;if(!(this.lookup[i]&o)&&(this.lookup[i]|=o,r.push(t),r.length===this.triangleCount))return}}}}function q_(e,t,r){return Math.max(0,Math.min(r-1,Math.floor(e*t)))}function Q_(e,t){const r=e.json.bufferViews[t.bufferView],n=L_[t.componentType];return new n(e.buffers[r.buffer],(t.byteOffset||0)+(r.byteOffset||0),t.count*(r.byteStride&&r.byteStride!==D_[t.type]*n.BYTES_PER_ELEMENT?r.byteStride/n.BYTES_PER_ELEMENT:D_[t.type]))}function X_(e,t,r,n){const i=L_[t.componentType],o=function(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(i),s=e.json.bufferViews[t.bufferView],a=s.byteStride?s.byteStride/i.BYTES_PER_ELEMENT:D_[t.type],l=r.float32,c=l.length/r.capacity;for(let e=0,r=0;e<t.count*a;e+=a,r+=c)for(let t=0;t<c;t++)l[r+t]=n[e+t]*o;r._trim()}function Y_(e,t,r){const n=e.indices,i=e.attributes,o={};o.indexArray=new Hl;const s=t.json.accessors[n],a=s.count/3;o.indexArray.reserve(a);const l=Q_(t,s);for(let e=0;e<a;e++)o.indexArray.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);o.indexArray._trim(),o.vertexArray=new $l;const c=t.json.accessors[i.POSITION];o.vertexArray.reserve(c.count);const u=Q_(t,c);for(let e=0;e<c.count;e++)o.vertexArray.emplaceBack(u[3*e],u[3*e+1],u[3*e+2]);if(o.vertexArray._trim(),o.aabb=new mh(c.min,c.max),o.centroid=function(e,t){const r=[0,0,0],n=e.length;if(n>0){for(let i=0;i<n;i++){const n=3*e[i];r[0]+=t[n],r[1]+=t[n+1],r[2]+=t[n+2]}r[0]/=n,r[1]/=n,r[2]/=n}return r}(l,u),void 0!==i.COLOR_0){const e=t.json.accessors[i.COLOR_0],r=D_[e.type],n=Q_(t,e);o.colorArray=3===r?new $l:new Pl,o.colorArray.resize(e.count),X_(t,e,o.colorArray,n)}if(void 0!==i.NORMAL){o.normalArray=new $l;const e=t.json.accessors[i.NORMAL];o.normalArray.resize(e.count);const r=Q_(t,e);X_(t,e,o.normalArray,r)}if(void 0!==i.TEXCOORD_0&&r.length>0){o.texcoordArray=new Ll;const e=t.json.accessors[i.TEXCOORD_0];o.texcoordArray.resize(e.count);const r=Q_(t,e);X_(t,e,o.texcoordArray,r)}if(void 0!==i._FEATURE_ID_RGBA4444){const e=t.json.accessors[i._FEATURE_ID_RGBA4444];t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression")&&(o.featureData=Q_(t,e))}void 0!==i._FEATURE_RGBA4444&&(o.featureData=new Uint32Array(Q_(t,t.json.accessors[i._FEATURE_RGBA4444]).buffer));const h=e.material;return o.material=function(e,t){const{emissiveFactor:r=[0,0,0],alphaMode:n="OPAQUE",alphaCutoff:i=.5,normalTexture:o,occlusionTexture:s,emissiveTexture:a,doubleSided:l}=e,{baseColorFactor:c=[1,1,1,1],metallicFactor:u=1,roughnessFactor:h=1,baseColorTexture:d,metallicRoughnessTexture:p}=e.pbrMetallicRoughness||{},f=s?t[s.index]:void 0;if(s&&s.extensions&&s.extensions.KHR_texture_transform&&f){const e=s.extensions.KHR_texture_transform;f.offsetScale=[e.offset[0],e.offset[1],e.scale[0],e.scale[1]]}return{pbrMetallicRoughness:{baseColorFactor:new Un(...c),metallicFactor:u,roughnessFactor:h,baseColorTexture:d?t[d.index]:void 0,metallicRoughnessTexture:p?t[p.index]:void 0},doubleSided:l,emissiveFactor:r,alphaMode:n,alphaCutoff:i,normalTexture:o?t[o.index]:void 0,occlusionTexture:f,emissionTexture:a?t[a.index]:void 0,defined:void 0===e.defined}}(void 0!==h?t.json.materials[h]:{defined:!1},r),o}function $_(t,r,n){const{matrix:i,rotation:o,translation:s,scale:a,mesh:l,extras:c,children:u}=t,h={};if(h.matrix=i||e.a9.fromRotationTranslationScale([],o||[0,0,0,1],s||[0,0,0],a||[1,1,1]),void 0!==l){h.meshes=n[l];const e=h.anchor=[0,0];for(const t of h.meshes){const{min:r,max:n}=t.aabb;e[0]+=r[0]+n[0],e[1]+=r[1]+n[1]}e[0]=Math.floor(e[0]/h.meshes.length/2),e[1]=Math.floor(e[1]/h.meshes.length/2)}if(c&&(c.id&&(h.id=c.id),c.lights&&(h.lights=function(e){if(!e.length)return[];const t=function(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.codePointAt(e);return r}(e),r=[],n=t.length/24,i=new Uint16Array(t.buffer),o=new Float32Array(t.buffer);for(let e=0;e<n;e++){const t=i[2*e*6]/30,n=i[2*e*6+1]/30,s=i[2*e*6+10]/100,a=o[6*e+1],l=o[6*e+2],c=o[6*e+3],u=o[6*e+4],h=c-a,d=u-l,p=Math.hypot(h,d);r.push({pos:[a+.5*h,l+.5*d,n],normal:[d/p,-h/p,0],width:p,height:t,depth:s,points:[a,l,c,u]})}return r}(c.lights))),u){const e=[];for(const t of u)e.push($_(r.json.nodes[t],r,n));h.children=e}return h}function K_(e){if(0===e.vertices.length||0===e.indices.length)return null;const t=new W_(e.vertices,e.indices,8,256),[r,n]=[t.min.clone(),t.max.clone()];return{vertices:e.vertices,indices:e.indices,grid:t,min:r,max:n}}function J_(e){if(!e.extras||!e.extras.ground)return null;const t=e.extras.ground;if(!t||!Array.isArray(t)||0===t.length)return null;const r=t[0];if(!r||!Array.isArray(r)||0===r.length)return null;const n=[];for(const e of r){if(!Array.isArray(e)||2!==e.length)continue;const t=e[0],r=e[1];"number"==typeof t&&"number"==typeof r&&n.push(new Nt(t,r))}if(n.length<3)return null;n.length>1&&n[n.length-1].equals(n[0])&&n.pop();let i=0;for(let e=0;e<n.length;e++){const t=n[e],r=n[(e+1)%n.length],o=n[(e+2)%n.length];i+=(t.x-r.x)*(o.y-r.y)-(o.x-r.x)*(t.y-r.y)}i>0&&n.reverse();const o=jd(n.flatMap((e=>[e.x,e.y])),[]);return 0===o.length?null:{vertices:n,indices:o}}function ey(t,r){const n=[],i=[];let o=0;const s=[];for(const a of t){o=n.length;const t=a.vertexArray.float32,l=a.indexArray.uint16;for(let i=0;i<a.vertexArray.length;i++)s[0]=t[3*i+0],s[1]=t[3*i+1],s[2]=t[3*i+2],e.Q.transformMat4(s,s,r),n.push(new Nt(s[0],s[1]));for(let e=0;e<3*a.indexArray.length;e++)i.push(l[e]+o)}if(i.length%3!=0)return null;for(let e=0;e<i.length;e+=3){const t=n[i[e+0]],r=n[i[e+1]],o=n[i[e+2]];(t.x-r.x)*(o.y-r.y)-(o.x-r.x)*(t.y-r.y)>0&&([i[e+1],i[e+2]]=[i[e+2],i[e+1]])}return{vertices:n,indices:i}}function ty(e){const t=function(e,t){const r=[],n=WebGL2RenderingContext;if(e.json.textures)for(const i of e.json.textures){const o={magFilter:n.LINEAR,minFilter:n.NEAREST,wrapS:n.REPEAT,wrapT:n.REPEAT};void 0!==i.sampler&&Object.assign(o,e.json.samplers[i.sampler]),r.push({image:t[i.source],sampler:o,uploaded:!1})}return r}(e,e.images),r=function(e,t){const r=[];for(const n of e.json.meshes){const i=[];for(const r of n.primitives)i.push(Y_(r,e,t));r.push(i)}return r}(e,t),{scenes:n,scene:i,nodes:o}=e.json,s=n?n[i||0].nodes:o,a=[];for(const t of s)a.push($_(o[t],e,r));return function(e,t,r){const n={},i=new Set;for(let o=0;o<e.length;o++){const e=r[t[o]];if(!e.extras)continue;const s=e.extras["mapbox:footprint:version"],a=e.extras["mapbox:footprint:id"];(s||a)&&i.add(o),"1.0.0"===s&&a&&(n[a]=o)}for(let o=0;o<e.length;o++){if(i.has(o))continue;const s=e[o],a=r[t[o]];if(!a.extras)continue;let l=null;s.id in n&&(l=ey(e[n[s.id]].meshes,s.matrix)),l||(l=J_(a)),l&&(s.footprint=K_(l))}if(i.size>0){const t=Array.from(i.values()).sort(((e,t)=>e-t));for(let r=t.length-1;r>=0;r--)e.splice(t[r],1)}}(a,s,e.json.nodes),a}function ry(e){e.heightmap=new Float32Array(4096),e.heightmap.fill(-1);const t=e.vertexArray.float32,r=e.aabb.min[0]-1,n=e.aabb.min[1]-1,i=o_/(e.aabb.max[0]-r+2),o=o_/(e.aabb.max[1]-n+2);for(let s=0;s<t.length;s+=3){const a=t[s+2],l=(t[s+0]-r)*i|0,c=(t[s+1]-n)*o|0;a>e.heightmap[c*o_+l]&&(e.heightmap[c*o_+l]=a)}}function ny(t,r){const n={};n.indexArray=new Hl,n.indexArray.reserve(4*t.length),n.vertexArray=new $l,n.vertexArray.reserve(10*t.length),n.colorArray=new Pl,n.vertexArray.reserve(10*t.length);let i=0;for(const o of t){const t=Math.min(10,Math.max(4,1.3*o.height))*r,s=[-o.normal[1],o.normal[0],0],a=Math.min(.29,.1*o.width/o.depth),l=o.width-2*o.depth*r*(a+.01),c=e.Q.scaleAndAdd([],o.pos,s,l/2),u=e.Q.scaleAndAdd([],o.pos,s,-l/2),h=[c[0],c[1],c[2]+o.height],d=[u[0],u[1],u[2]+o.height],p=e.Q.scaleAndAdd([],o.normal,s,a);e.Q.scale(p,p,t);const f=e.Q.scaleAndAdd([],o.normal,s,-a);e.Q.scale(f,f,t),e.Q.add(p,c,p),e.Q.add(f,u,f),c[2]+=.1,u[2]+=.1,n.vertexArray.emplaceBack(p[0],p[1],p[2]),n.vertexArray.emplaceBack(f[0],f[1],f[2]),n.vertexArray.emplaceBack(c[0],c[1],c[2]),n.vertexArray.emplaceBack(u[0],u[1],u[2]),n.vertexArray.emplaceBack(h[0],h[1],h[2]),n.vertexArray.emplaceBack(d[0],d[1],d[2]),n.vertexArray.emplaceBack(c[0],c[1],c[2]),n.vertexArray.emplaceBack(u[0],u[1],u[2]),n.vertexArray.emplaceBack(p[0],p[1],p[2]),n.vertexArray.emplaceBack(f[0],f[1],f[2]);const m=l/t/2;n.colorArray.emplaceBack(-m-a,-1,m,.8),n.colorArray.emplaceBack(m+a,-1,m,.8),n.colorArray.emplaceBack(-m,0,m,1.3),n.colorArray.emplaceBack(m,0,m,1.3),n.colorArray.emplaceBack(m+a,-.8,m,.7),n.colorArray.emplaceBack(m+a,-.8,m,.7),n.colorArray.emplaceBack(0,0,m,1.3),n.colorArray.emplaceBack(0,0,m,1.3),n.colorArray.emplaceBack(m+a,-1.2,m,.8),n.colorArray.emplaceBack(m+a,-1.2,m,.8),n.indexArray.emplaceBack(6+i,4+i,8+i),n.indexArray.emplaceBack(7+i,9+i,5+i),n.indexArray.emplaceBack(0+i,1+i,2+i),n.indexArray.emplaceBack(1+i,3+i,2+i),i+=10}const o={defined:!0,emissiveFactor:[0,0,0]},s={};return s.baseColorFactor=Un.white,o.pbrMetallicRoughness=s,n.material=o,n.aabb=new mh([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),n}fa(W_,"TriangleGridIndex");class iy{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const oy=["tile","layer","source","sourceLayer","state"];class sy{constructor(e,t,r,n,i){this.type="Feature",this._vectorTileFeature=e,this._z=t,this._x=r,this._y=n,this.properties=e.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};void 0!==this.id&&(e.id=this.id);for(const t of oy)void 0!==this[t]&&(e[t]=this[t]);return e}}class ay{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new da(io,16,0),this.featureIndexArray=new hc,this.promoteId=t,this.is3DTile=!1}insert(e,t,r,n,i,o=0,s=0){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i,o);const l=this.grid;for(let e=0;e<t.length;e++){const r=t[e],n=[1/0,1/0,-1/0,-1/0];for(let e=0;e<r.length;e++){const t=r[e];n[0]=Math.min(n[0],t.x),n[1]=Math.min(n[1],t.y),n[2]=Math.max(n[2],t.x),n[3]=Math.max(n[3],t.y)}0!==s&&(n[0]-=s,n[1]-=s,n[2]+=s,n[3]+=s),n[0]<io&&n[1]<io&&n[2]>=0&&n[3]>=0&&l.insert(a,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new hp(new bm(this.rawTileData)).layers,this.sourceLayerCoder=new iy(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t,r,n){this.loadVTLayers();const i=e.params||{},o=nl(i.filter),s=e.tileResult,a=e.transform,l=s.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,((e,t,r,n)=>Ku(s.bufferedTilespaceGeometry,e,t,r,n)));c.sort(cy);let u=null;a.elevation&&c.length>0&&(u=Dp.create(a.elevation,this.tileID));const h={};let d;for(let l=0;l<c.length;l++){const p=c[l];if(p===d)continue;d=p;const f=this.featureIndexArray.get(p);let m=null;if(this.is3DTile){const e=this.bucketLayerIDs[0][0],r=t[e];if("model"!==r.type)continue;const{queryFeature:n,intersectionZ:i}=r.queryIntersectsMatchingFeature(s,f.featureIndex,o,a);n&&this.appendToResult(h,e,f.featureIndex,n,i)}else this.loadMatchingFeature(h,f,o,i.layers,i.availableImages,t,r,n,((t,r,n,i=0)=>(m||(m=Ru(t,this.tileID.canonical,e.tileTransform)),r.queryIntersectsFeature(s,t,n,m,this.z,e.transform,e.pixelPosMatrix,u,i))))}return h}loadMatchingFeature(e,t,r,n,i,o,s,a,l){const{featureIndex:c,bucketIndex:u,sourceLayerIndex:h,layoutVertexArrayOffset:d}=t,p=this.bucketLayerIDs[u];if(n&&!function(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(n,p))return;const f=this.sourceLayerCoder.decode(h),m=this.vtLayers[f].feature(c);if(r.needGeometry){const e=Fu(m,!0);if(!r.filter(new Na(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!r.filter(new Na(this.tileID.overscaledZ),m))return;const g=this.getId(m,f);for(let t=0;t<p.length;t++){const r=p[t];if(n&&n.indexOf(r)<0)continue;const u=o[r];if(!u)continue;let h={};void 0!==g&&a&&(h=a.getState(u.sourceLayer||"_geojsonTileLayer",g));const f=!l||l(m,u,h,d);if(!f)continue;const A=new sy(m,this.z,this.x,this.y,g),_=Jt({},s[r]);_.paint=ly(_.paint,u.paint,m,h,i),_.layout=ly(_.layout,u.layout,m,h,i),A.layer=_,this.appendToResult(e,r,c,A,f)}}appendToResult(e,t,r,n,i){let o=e[t];void 0===o&&(o=e[t]=[]),o.push({featureIndex:r,feature:n,intersectionZ:i})}lookupSymbolFeatures(e,t,r,n,i,o,s,a){const l={};this.loadVTLayers();const c=nl(i);for(const i of e)this.loadMatchingFeature(l,{bucketIndex:r,sourceLayerIndex:n,featureIndex:i,layoutVertexArrayOffset:0},c,o,s,a,t);return l}loadFeature(e){const{featureIndex:t,sourceLayerIndex:r}=e;this.loadVTLayers();const n=this.sourceLayerCoder.decode(r),i=this.vtFeatures[n];if(i[t])return i[t];const o=this.vtLayers[n].feature(t);return i[t]=o,o}hasLayer(e){for(const t of this.bucketLayerIDs)for(const r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;if(this.promoteId){const n="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];null!=n&&(r=e.properties[n]),"boolean"==typeof r&&(r=Number(r))}return r}}function ly(e,t,r,n,i){return ar(e,((e,o)=>{const s=t instanceof Qa?t.get(o):null;return s&&s.evaluate?s.evaluate(r,n,i):s}))}function cy(e,t){return t-e}fa(ay,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const uy=new Float32Array(262144),hy=new Uint8Array(262144);function dy(e){let t=0;if(e.meshes)for(const r of e.meshes)t=Math.max(t,r.aabb.max[2]);if(e.children)for(const r of e.children)t=Math.max(t,dy(r));return t}function py(e,t,r){if(e.meshes)for(const n of e.meshes)n.aabb.min[0]!==1/0&&r.insert(t,n.aabb.min[0],n.aabb.min[1],n.aabb.max[0],n.aabb.max[1]);if(e.children)for(const n of e.children)py(n,t,r)}const fy=["","wall","door","roof","window","lamp","logo"];class my{constructor(e){this.node=e,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.feature={type:"Point",id:e.id,geometry:[],properties:{height:dy(e)}}}getLocalBounds(){if(!this.node.meshes)return new mh([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let e=0;const t=new mh([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const r of this.node.meshes)this.node.lightMeshIndex!==e&&t.encapsulate(r.aabb),e++;this.aabb=mh.applyTransform(t,this.node.matrix)}return this.aabb}}class gy{constructor(e,t,r,n,i,o){this.id=t,this.modelTraits|=s_.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,r&&(this.modelTraits|=s_.HasMapboxMeshFeatures),n&&(this.modelTraits|=s_.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=i,this.dirty=!0,this.needsUpload=!1,this.nodesInfo=[];for(const t of e)this.nodesInfo.push(new my(t)),py(t,o.featureIndexArray.length,o.grid),o.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,o.bucketLayerIDs.length-1,0)}update(){console.log("Update 3D model bucket")}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(e){if(!this.needsUpload)return;const t=this.getNodesInfo();for(const r of t){const t=r.node;this.uploaded?this.updatePbrBuffer(t):u_(t,e,!0)}for(const e of t)h_(e.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(e){let t=!1;if(!e.meshes)return t;for(const r of e.meshes)r.pbrBuffer&&(r.pbrBuffer.updateData(r.featureArray),t=!0);return t}needsReEvaluation(e,t,r){const n=e.transform.projectionOptions,i=e.style.getBrightness(),o=this.brightness!==i;return!!(!this.uploaded||this.dirty||n.name!==this.projection.name||Ay(r.paint.get("model-color").value,o)||Ay(r.paint.get("model-color-mix-intensity").value,o)||Ay(r.paint.get("model-roughness").value,o)||Ay(r.paint.get("model-emissive-strength").value,o)||Ay(r.paint.get("model-height-based-emissive-strength-multiplier").value,o))&&(this.projection=n,this.brightness=i,!0)}evaluateScale(e,t){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;const r=this.getNodesInfo(),n=this.id.canonical;for(const e of r){const r=e.feature;e.evaluatedScale=t.paint.get("model-scale").evaluate(r,{},n)}}evaluate(e){const t=this.getNodesInfo();for(const r of t){if(!r.node.meshes)continue;const t=r.feature,n=r.node.meshes&&r.node.meshes[0].featureData,i=r.evaluatedColor[2],o=r.evaluatedRMEA[2],s=this.id.canonical;if(r.hasTranslucentParts=!1,n){for(let n=0;n<fy.length;n++){const i=fy[n];i.length&&(t.properties.part=i);const o=e.paint.get("model-color").evaluate(t,{},s),a=e.paint.get("model-color-mix-intensity").evaluate(t,{},s);r.evaluatedColor[n]=[o.r,o.g,o.b,a],r.evaluatedRMEA[n][0]=e.paint.get("model-roughness").evaluate(t,{},s),r.evaluatedRMEA[n][2]=e.paint.get("model-emissive-strength").evaluate(t,{},s),r.evaluatedRMEA[n][3]=o.a,r.emissionHeightBasedParams[n]=e.paint.get("model-height-based-emissive-strength-multiplier").evaluate(t,{},s),!r.hasTranslucentParts&&o.a<1&&(r.hasTranslucentParts=!0)}delete t.properties.part,yy(r,i!==r.evaluatedColor[2]||o!==r.evaluatedRMEA[2],this.modelTraits)}else r.evaluatedRMEA[0][2]=e.paint.get("model-emissive-strength").evaluate(t,{},s);r.evaluatedScale=e.paint.get("model-scale").evaluate(t,{},s),this.updatePbrBuffer(r.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(e,t,r,n){const i=e.findDEMTileFor(r);if(i&&(i.tileID.canonical!==this.terrainTile||t!==this.terrainExaggeration)){if(i.dem&&i.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=i.tileID.overscaledZ;const t=Dp.create(e,r,i);if(!t)return;this.modelTraits&s_.HasMapboxMeshFeatures&&this.updateDEM(e,t,r,n);for(const e of this.getNodesInfo()){const r=e.node;if(!r.footprint||!r.footprint.vertices||!r.footprint.vertices.length)continue;const n=r.footprint.vertices;let i=t.getElevationAt(n[0].x,n[0].y,!0,!0);for(let e=1;e<n.length;e++)i=Math.min(i,t.getElevationAt(n[e].x,n[e].y,!0,!0));r.elevation=i}}this.terrainTile=i.tileID.canonical,this.terrainExaggeration=t}}updateDEM(e,t,r,n){let i=t._dem._modifiedForSources[n];if(void 0===i&&(t._dem._modifiedForSources[n]=[],i=t._dem._modifiedForSources[n]),i.includes(r.canonical))return;const o=t._dem.dim;i.push(r.canonical);let s=!1;for(const e of this.getNodesInfo()){const r=e.node;if(!r.footprint||!r.footprint.grid)continue;const n=r.footprint.grid,i=t.tileCoordToPixel(n.min.x,n.min.y),a=t.tileCoordToPixel(n.max.x,n.max.y),l=Math.min(Math.min(o-a.y,i.x),Math.min(i.y,o-a.x));if(l<0)continue;const c=Xt(l,2,5);let u=Math.max(0,i.x-c),h=Math.max(0,i.y-c),d=Math.min(a.x+c,o-1),p=Math.min(a.y+c,o-1);for(let e=h;e<=p;++e)for(let t=u;t<=d;++t)hy[e*o+t]=255;let f=0,m=0;for(let e=0;e<n.cellsY;++e)for(let r=0;r<n.cellsX;++r){if(!n.cells[e*n.cellsX+r])continue;const i=t.tileCoordToPixel(n.min.x+r/n.xScale,n.min.y+e/n.yScale),s=t.tileCoordToPixel(n.min.x+(r+1)/n.xScale,n.min.y+(e+1)/n.yScale);for(let e=i.y;e<=Math.min(s.y+1,o-1);++e)for(let r=i.x;r<=Math.min(s.x+1,o-1);++r)255===hy[e*o+r]&&(hy[e*o+r]=0,f+=t.getElevationAtPixel(r,e),m++)}const g=f/m;u=Math.max(1,i.x-c),h=Math.max(1,i.y-c),d=Math.min(a.x+c,o-2),p=Math.min(a.y+c,o-2),s=!0;for(let e=h;e<=p;++e)for(let r=u;r<=d;++r)0===hy[e*o+r]&&(uy[e*o+r]=t._dem.set(r,e,g));for(let e=1;e<c;++e){u=Math.max(1,i.x-e),h=Math.max(1,i.y-e),d=Math.min(a.x+e,o-2),p=Math.min(a.y+e,o-2);for(let r=h;r<=p;++r)for(let n=u;n<=d;++n){const i=r*o+n;if(255===hy[i]){let s=0,a=0,l=-1,u=-1;for(let t=-1;t<=1;++t)for(let i=-1;i<=1;++i){const c=(r+t)*o+n+i;if(hy[c]>=e)continue;const h=uy[c],d=Math.abs(h);d>a&&(s=h,a=d,l=i,u=t)}if(a>.1){const o=1-(e+.5*Math.abs(l*u))/c;let a=t._dem.get(n,r)+s*o;const h=t._dem.get(n+l,r+u),d=t._dem.get(n-l,r-u,!0);(a-h)*(a-d)>0&&(a=(h+d)/2),uy[i]=t._dem.set(n,r,a),hy[i]=e}}}}}s&&(t._demTile.needsDEMTextureUpload=!0,t._dem._timestamp=Lr.now())}getNodesInfo(){return this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const t of e)h_(t.node),d_(t.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped()),n=this.getNodesInfo();for(let e=0;e<this.nodesInfo.length;e++){const t=n[e].node;n[e].hiddenByReplacement=!!t.footprint&&!r.find((e=>e.footprint===t.footprint))}}getHeightAtTileCoord(t,r){const n=this.getNodesInfo(),i=[],o=[0,0,0];for(let s=0;s<this.nodesInfo.length;s++){const a=n[s],l=a.node.meshes[0],c=mh.applyTransform(l.aabb,a.node.matrix);if(t<c.min[0]||r<c.min[1]||t>c.max[0]||r>c.max[1])continue;const u=(t-l.aabb.min[0])/(l.aabb.max[0]-l.aabb.min[0])*o_|0,h=Math.min(63,(r-l.aabb.min[1])/(l.aabb.max[1]-l.aabb.min[1])*o_|0)*o_+Math.min(63,u);if(o[2]=l.heightmap[h],e.Q.transformMat4(o,o,a.node.matrix),!(l.heightmap[h]<0&&a.node.footprint)){if(a.hiddenByReplacement)return;return{height:o[2],maxHeight:a.feature.properties.height,hidden:!1,verticalScale:a.evaluatedScale[2]}}if(a.node.footprint.grid.query(new Nt(t,r),new Nt(t,r),i),i.length>0)return{height:void 0,maxHeight:a.feature.properties.height,hidden:a.hiddenByReplacement,verticalScale:a.evaluatedScale[2]}}}}function Ay(e,t){return!e.isLightConstant&&t}function _y(e,t,r,n,i,o,s,a){let l=(61440&t|(61440&t)>>4)>>8,c=(3840&t|(3840&t)>>4)>>4,u=240&t|(240&t)>>4;r[3]>0&&(l=Hn(l,255*r[0],r[3]),c=Hn(c,255*r[1],r[3]),u=Hn(u,255*r[2],r[3]));const h=l<<8|c,d=u<<8|Math.floor(255*n[3]),p=function(e){const t=Xt(e,0,2);return Math.min(Math.round(.5*t*255),255)}(n[2])<<8|15*n[0]<<4|15*n[1],f=Xt(i[0],0,1),m=Xt(i[1],0,1),g=Xt(i[2],0,1),A=Xt(i[3],0,1);let _,y,v,x;if(f!==m&&s!==o&&m!==f){const e=s-o;y=1/(e*(m-f)),v=-(o+e*f)/(e*(m-f));const t=Xt(i[4],-1,1);x=Math.pow(10,t),_=255*g<<8|255*A}else _=65535,y=0,v=1,x=1;if(e.emplaceBack(h,d,p,_,y,v,x),a){const e=a.length;a.clear();for(let t=0;t<e;t++)a.emplaceBack(h,d,p,_,y,v,x)}}function yy(e,t,r){const n=e.node;let i=0;const o=r&s_.HasMeshoptCompression;for(const r of n.meshes){if(n.lights&&n.lightMeshIndex===i)continue;if(!r.featureData)continue;r.featureArray=new Jl,r.featureArray.reserve(r.featureData.length);let s=t;for(const t of r.featureData){const i=o?65535&t:t>>16&65535,a=o?t>>16&65535:65535&t,l=(15&a)<8?15&a:0,c=e.evaluatedRMEA[l],u=e.evaluatedColor[l],h=e.emissionHeightBasedParams[l];let d;if(s&&2===l&&n.lights&&(d=new Jl,d.resize(10*n.lights.length)),_y(r.featureArray,i,u,c,h,r.aabb.min[2],r.aabb.max[2],d),d&&s){s=!1;const e=n.meshes[n.lightMeshIndex];e.featureArray=d,e.featureArray._trim()}}r.featureArray._trim(),i++}}function vy(e,t,r,n){const i=1<<e.z;t.lat=bu((n/io+e.y)/i),t.lng=xu((r/io+e.x)/i)}fa(gy,"Tiled3dModelBucket",{omit:["layers"]}),fa(my,"Tiled3dModelFeature");const xy={circle:class extends yl{constructor(e,t,r){super(e,ah,t,r)}createBucket(e){return new Vu(e)}queryRadius(e){const t=e;return rh("circle-radius",this,t)+rh("circle-stroke-width",this,t)+nh(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,r,n,i,o,s,a){const l=oh(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r);return qh(e,n,o,s,a,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getDefaultProgramParams(e,t){const r=Wh(this);return{config:new Vc(this,t),defines:r,overrideFog:!1}}},heatmap:class extends yl{createBucket(e){return new Kh(e)}constructor(e,t,r){super(e,sd,t,r),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=ad({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(e){return rh("heatmap-radius",this,e)}queryIntersectsFeature(e,t,r,n,i,o,s,a){const l=this.paint.get("heatmap-radius").evaluate(t,r);return qh(e,n,o,s,a,!0,!0,new Nt(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(e,t){return"heatmap"===e?{config:new Vc(this,t),overrideFog:!1}:{}}},hillshade:class extends yl{constructor(e,t,r){super(e,cd,t,r)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(e,t){return{overrideFog:!1}}},fill:class extends yl{constructor(e,t,r){super(e,Wd,t,r)}getProgramIds(){const e=this.paint.get("fill-pattern"),t=e&&e.constantOr(1),r=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&r.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),r}getDefaultProgramParams(e,t){return{config:new Vc(this,t),overrideFog:!1}}recalculate(e,t){super.recalculate(e,t);const r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Gd(e)}queryRadius(){return nh(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,r,n,i,o){return!e.queryGeometry.isAboveHorizon&&Gu(ih(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends yl{constructor(e,t,r){super(e,uf,t,r),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new $p(e)}queryRadius(){return nh(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}hasShadowPass(){return!0}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(t,r,n,i,o,s,a,l,c){const u=oh(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),h=this.paint.get("fill-extrusion-height").evaluate(r,n),d=this.paint.get("fill-extrusion-base").evaluate(r,n),p=[0,0],f=l&&s.elevation,m=s.elevation?s.elevation.exaggeration():1,g=t.tile.getBucket(this);if(f&&g instanceof $p){const e=g.centroidVertexArray,t=c+1;t<e.length&&(p[0]=e.geta_centroid_pos0(t),p[1]=e.geta_centroid_pos1(t))}if(0===p[0]&&1===p[1])return!1;"globe"===s.projection.name&&(i=af([i],[new Nt(0,0),new Nt(io,io)],t.tileID.canonical).map((e=>e.polygon)).flat());const A=f?l:null,[_,y]=function(t,r,n,i,o,s,a,l,c,u,h){return"globe"===t.projection.name?function(t,r,n,i,o,s,a,l,c,u,h){const d=[],p=[],f=t.projection.upVectorScale(h,t.center.lat,t.worldSize).metersToTile,m=[0,0,0,1],g=[0,0,0,1],A=(e,t,r,n)=>{e[0]=t,e[1]=r,e[2]=n,e[3]=1},_=sf();n>0&&(n+=_),i+=_;for(const _ of r){const r=[],y=[];for(const d of _){const p=d.x+o.x,_=d.y+o.y,v=t.projection.projectTilePoint(p,_,h),x=t.projection.upVector(h,d.x,d.y);let b=n,w=i;if(a){const e=ff(p,_,n,i,a,l,c,u);b+=e.base,w+=e.top}0!==n?A(m,v.x+x[0]*f*b,v.y+x[1]*f*b,v.z+x[2]*f*b):A(m,v.x,v.y,v.z),A(g,v.x+x[0]*f*w,v.y+x[1]*f*w,v.z+x[2]*f*w),e.Q.transformMat4(m,m,s),e.Q.transformMat4(g,g,s),r.push(new hf(m[0],m[1],m[2])),y.push(new hf(g[0],g[1],g[2]))}d.push(r),p.push(y)}return[d,p]}(t,r,n,i,o,s,a,l,c,u,h):a?function(t,r,n,i,o,s,a,l,c){const u=[],h=[],d=[0,0,0,1];for(const p of t){const t=[],f=[];for(const u of p){const h=u.x+i.x,p=u.y+i.y,m=ff(h,p,r,n,s,a,l,c);d[0]=h,d[1]=p,d[2]=m.base,d[3]=1,e.aa.transformMat4(d,d,o),d[3]=Math.max(d[3],1e-5);const g=new hf(d[0]/d[3],d[1]/d[3],d[2]/d[3]);d[0]=h,d[1]=p,d[2]=m.top,d[3]=1,e.aa.transformMat4(d,d,o),d[3]=Math.max(d[3],1e-5);const A=new hf(d[0]/d[3],d[1]/d[3],d[2]/d[3]);t.push(g),f.push(A)}u.push(t),h.push(f)}return[u,h]}(r,n,i,o,s,a,l,c,u):function(e,t,r,n,i){const o=[],s=[],a=i[8]*t,l=i[9]*t,c=i[10]*t,u=i[11]*t,h=i[8]*r,d=i[9]*r,p=i[10]*r,f=i[11]*r;for(const t of e){const e=[],r=[];for(const o of t){const t=o.x+n.x,s=o.y+n.y,m=i[0]*t+i[4]*s+i[12],g=i[1]*t+i[5]*s+i[13],A=i[2]*t+i[6]*s+i[14],_=i[3]*t+i[7]*s+i[15],y=m+a,v=g+l,x=A+c,b=Math.max(_+u,1e-5),w=m+h,C=g+d,E=A+p,T=Math.max(_+f,1e-5);e.push(new hf(y/b,v/b,x/b)),r.push(new hf(w/T,C/T,E/T))}o.push(e),s.push(r)}return[o,s]}(r,n,i,o,s)}(s,i,d,h,u,a,A,p,m,s.center.lat,t.tileID.canonical),v=t.queryGeometry;return function(e,t,r){let n=1/0;Gu(r,t)&&(n=pf(r,t[0]));for(let i=0;i<t.length;i++){const o=t[i],s=e[i];for(let e=0;e<o.length-1;e++){const t=o[e],i=[t,o[e+1],s[e+1],s[e],t];Uu(r,i)&&(n=Math.min(n,pf(r,i)))}}return n!==1/0&&n}(_,y,v.isPointQuery()?v.screenBounds:v.screenGeometry)}},line:class extends yl{constructor(e,t,r){super(e,Sf,t,r),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof qo,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Df.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Ef(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(e,t){const r=Lf(this);return{config:new Vc(this,t),defines:r,overrideFog:!1}}queryRadius(e){const t=e,r=kf(rh("line-width",this,t),rh("line-gap-width",this,t)),n=rh("line-offset",this,t);return r/2+Math.abs(n)+nh(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,n,i,o){if(e.queryGeometry.isAboveHorizon)return!1;const s=ih(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),a=e.pixelToTileUnitsFactor/2*kf(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),l=this.paint.get("line-offset").evaluate(t,r);return l&&(n=function(e,t){const r=[],n=new Nt(0,0);for(let i=0;i<e.length;i++){const o=e[i],s=[];for(let e=0;e<o.length;e++){const r=o[e],i=o[e+1],a=0===e?n:r.sub(o[e-1])._unit()._perp(),l=e===o.length-1?n:i.sub(r)._unit()._perp(),c=a._add(l)._unit();c._mult(1/(c.x*l.x+c.y*l.y)),s.push(c._mult(t)._add(r))}r.push(s)}return r}(n,l*e.pixelToTileUnitsFactor)),function(e,t,r){for(let n=0;n<t.length;n++){const i=t[n];if(e.length>=3)for(let t=0;t<i.length;t++)if($u(e,i[t]))return!0;if(Zu(e,i,r))return!0}return!1}(s,n,a)}isTileClipped(){return!0}},symbol:pA,background:class extends yl{constructor(e,t,r){super(e,mA,t,r)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(e,t){return{overrideFog:!1}}},raster:TA,"raster-particle":IA,sky:class extends yl{constructor(e,t,r){super(e,OA,t,r),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"sky-gradient"===e?this._updateColorRamp():"sky-atmosphere-sun"!==e&&"sky-atmosphere-halo-color"!==e&&"sky-atmosphere-color"!==e&&"sky-atmosphere-sun-intensity"!==e||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=ad({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(e){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const t=e.style.light.properties.get("position");return this._lightPosition.azimuthal!==t.azimuthal||this._lightPosition.polar!==t.polar}return!1}getCenter(e,t){if("atmosphere"===this.paint.get("sky-type")){const r=this.paint.get("sky-atmosphere-sun"),n=!r,i=e.style.light,o=i.properties.get("position");return n&&"viewport"===i.properties.get("anchor")&&hr("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),n?DA(o.azimuthal,90-o.polar,t):DA(r[0],90-r[1],t)}const r=this.paint.get("sky-gradient-center");return DA(r[0],90-r[1],t)}isSky(){return!0}markSkyboxValid(e){this._skyboxInvalidated=!1,this._lightPosition=e.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const e=this.paint.get("sky-type");return"atmosphere"===e?["skyboxCapture","skybox"]:"gradient"===e?["skyboxGradient"]:null}},slot:class extends yl{constructor(e,t,r){super(e,kA,t)}},model:class extends yl{constructor(e,t,r){super(e,i_,t,r),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new r_(e)}getProgramIds(){return["model"]}is3D(){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(e){return e instanceof gy?io-1:0}queryIntersectsFeature(t,r,n,i,o,s){if(!this.modelManager)return!1;const a=this.modelManager,l=t.tile.getBucket(this);if(!(l&&l instanceof r_))return!1;const c=l;for(const n in c.instancesPerModel){const i=c.instancesPerModel[n],o=void 0!==r.id?r.id:r.properties&&r.properties.hasOwnProperty("id")?r.properties.id:void 0;if(i.idToFeaturesIndex.hasOwnProperty(o)){const r=i.features[i.idToFeaturesIndex[o]],l=a.getModel(n,this.scope);if(!l)return!1;let u=e.a9.create();const h=new su(0,0),d=c.canonical;let p=Number.MAX_VALUE;for(let n=0;n<r.instancedDataCount;++n){const o=16*(r.instancedDataOffset+n),a=i.instancedDataArray.float32,c=[a[o+4],a[o+5],a[o+6]];vy(d,h,a[o],0|a[o+1]),a_(u,l,s,h,r.rotation,r.scale,c,!1,!1,!1),"globe"===s.projection.name&&(u=HA(u,s));const f=e.a9.multiply([],s.projMatrix,u),m=t.queryGeometry,g=GA(m.isPointQuery()?m.screenBounds:m.screenGeometry,s,f,l.aabb);null!=g&&(p=Math.min(g,p))}return p!==Number.MAX_VALUE&&p}}return!1}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven()||"model-color"!==e&&"model-color-mix-intensity"!==e&&"model-rotation"!==e&&"model-scale"!==e&&"model-translation"!==e&&"model-emissive-strength"!==e)}_isPropertyZoomDependent(e){const t=this._transitionablePaint._values[e];return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof oa}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}queryIntersectsMatchingFeature(t,r,n,i){const o=t.tile,s=o.getBucket(this);let a=null,l=Number.MAX_VALUE;if(!(s&&s instanceof gy))return{queryFeature:a,intersectionZ:l};const c=s.getNodesInfo()[r];if(c.hiddenByReplacement||!c.node.meshes||!n.filter(new Na(o.tileID.overscaledZ),c.feature,o.tileID.canonical))return{queryFeature:a,intersectionZ:l};const u=c.node,h=i.calculatePosMatrix(o.tileID.toUnwrapped(),i.worldSize),d=c.evaluatedScale;let p=0;i.elevation&&u.elevation&&(p=u.elevation*i.elevation.exaggeration()),e.a9.translate(h,h,[(u.anchor?u.anchor[0]:0)*(d[0]-1),(u.anchor?u.anchor[1]:0)*(d[1]-1),p]),e.a9.scale(h,h,d),e.a9.multiply(h,h,u.matrix);const f=t.queryGeometry,m=f.isPointQuery()?f.screenBounds:f.screenGeometry,g=function(t){const r=e.a9.multiply([],h,t.matrix),n=e.a9.multiply(r,i.expandedFarZProjMatrix,r);for(let e=0;e<t.meshes.length;++e){const r=t.meshes[e];if(e===t.lightMeshIndex)continue;const o=GA(m,i,n,r.aabb);null!=o&&(l=Math.min(o,l))}if(t.children)for(const e of t.children)g(e)};if(g(u),l===Number.MAX_VALUE)return{queryFeature:a,intersectionZ:l};const A=new su(0,0);return vy(o.tileID.canonical,A,c.node.anchor[0],c.node.anchor[1]),a={type:"Feature",geometry:{type:"Point",coordinates:[A.lng,A.lat]},properties:c.feature.properties,id:c.feature.id,state:{},layer:this.serialize()},{queryFeature:a,intersectionZ:l}}}},by={read:function(e,t){return e.readFields(by._readField,{header_length:0,x:0,y:0,z:0,layers:[]},t)},_readField:function(e,t,r){1===e?t.header_length=r.readFixed32():2===e?t.x=r.readVarint():3===e?t.y=r.readVarint():4===e?t.z=r.readVarint():5===e&&t.layers.push(by.Layer.read(r,r.readVarint()+r.pos))},PixelFormat:{PIXEL_FORMAT_UNKNOWN:{value:0,options:{}},PIXEL_FORMAT_UINT32:{value:1,options:{}},PIXEL_FORMAT_UINT16:{value:2,options:{}},PIXEL_FORMAT_UINT8:{value:3,options:{}}},Filter:{}};by.Filter.read=function(e,t){return e.readFields(by.Filter._readField,{delta_filter:null,filter:null,zigzag_filter:null,bitshuffle_filter:null,byteshuffle_filter:null},t)},by.Filter._readField=function(e,t,r){1===e?(t.delta_filter=by.Filter.Delta.read(r,r.readVarint()+r.pos),t.filter="delta_filter"):2===e?(t.zigzag_filter=by.Filter.Zigzag.read(r,r.readVarint()+r.pos),t.filter="zigzag_filter"):3===e?(t.bitshuffle_filter=by.Filter.BitShuffle.read(r,r.readVarint()+r.pos),t.filter="bitshuffle_filter"):4===e&&(t.byteshuffle_filter=by.Filter.ByteShuffle.read(r,r.readVarint()+r.pos),t.filter="byteshuffle_filter")},by.Filter.Delta={},by.Filter.Delta.read=function(e,t){return e.readFields(by.Filter.Delta._readField,{block_size:0},t)},by.Filter.Delta._readField=function(e,t,r){1===e&&(t.block_size=r.readVarint())},by.Filter.Zigzag={},by.Filter.Zigzag.read=function(e,t){return e.readFields(by.Filter.Zigzag._readField,{},t)},by.Filter.Zigzag._readField=function(e,t,r){},by.Filter.BitShuffle={},by.Filter.BitShuffle.read=function(e,t){return e.readFields(by.Filter.BitShuffle._readField,{},t)},by.Filter.BitShuffle._readField=function(e,t,r){},by.Filter.ByteShuffle={},by.Filter.ByteShuffle.read=function(e,t){return e.readFields(by.Filter.ByteShuffle._readField,{},t)},by.Filter.ByteShuffle._readField=function(e,t,r){},by.Codec={},by.Codec.read=function(e,t){return e.readFields(by.Codec._readField,{gzip_data:null,codec:null,jpeg_image:null,webp_image:null,png_image:null},t)},by.Codec._readField=function(e,t,r){1===e?(t.gzip_data=by.Codec.GzipData.read(r,r.readVarint()+r.pos),t.codec="gzip_data"):2===e?(t.jpeg_image=by.Codec.JpegImage.read(r,r.readVarint()+r.pos),t.codec="jpeg_image"):3===e?(t.webp_image=by.Codec.WebpImage.read(r,r.readVarint()+r.pos),t.codec="webp_image"):4===e&&(t.png_image=by.Codec.PngImage.read(r,r.readVarint()+r.pos),t.codec="png_image")},by.Codec.GzipData={},by.Codec.GzipData.read=function(e,t){return e.readFields(by.Codec.GzipData._readField,{},t)},by.Codec.GzipData._readField=function(e,t,r){},by.Codec.JpegImage={},by.Codec.JpegImage.read=function(e,t){return e.readFields(by.Codec.JpegImage._readField,{},t)},by.Codec.JpegImage._readField=function(e,t,r){},by.Codec.WebpImage={},by.Codec.WebpImage.read=function(e,t){return e.readFields(by.Codec.WebpImage._readField,{},t)},by.Codec.WebpImage._readField=function(e,t,r){},by.Codec.PngImage={},by.Codec.PngImage.read=function(e,t){return e.readFields(by.Codec.PngImage._readField,{},t)},by.Codec.PngImage._readField=function(e,t,r){},by.DataIndexEntry={},by.DataIndexEntry.read=function(e,t){return e.readFields(by.DataIndexEntry._readField,{first_byte:0,last_byte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},t)},by.DataIndexEntry._readField=function(e,t,r){1===e?t.first_byte=r.readFixed64():2===e?t.last_byte=r.readFixed64():3===e?t.filters.push(by.Filter.read(r,r.readVarint()+r.pos)):4===e?t.codec=by.Codec.read(r,r.readVarint()+r.pos):5===e?t.offset=r.readFloat():6===e?t.scale=r.readFloat():7===e&&t.bands.push(r.readString())},by.Layer={},by.Layer.read=function(e,t){return e.readFields(by.Layer._readField,{version:0,name:"",units:"",tilesize:0,buffer:0,pixel_format:0,data_index:[]},t)},by.Layer._readField=function(e,t,r){1===e?t.version=r.readVarint():2===e?t.name=r.readString():3===e?t.units=r.readString():4===e?t.tilesize=r.readVarint():5===e?t.buffer=r.readVarint():6===e?t.pixel_format=r.readVarint():7===e&&t.data_index.push(by.DataIndexEntry.read(r,r.readVarint()+r.pos))};const wy={read:function(e,t){return e.readFields(wy._readField,{uint32_values:null,values:null,fixed32_values:null},t)},_readField:function(e,t,r){2===e?(t.uint32_values=wy.Uint32Values.read(r,r.readVarint()+r.pos),t.values="uint32_values"):3===e&&(t.fixed32_values=wy.Fixed32Values.read(r,r.readVarint()+r.pos),t.values="fixed32_values")},Uint32Values:{}};wy.Uint32Values.read=function(e,t){return e.readFields(wy.Uint32Values._readField,{values:[]},t)},wy.Uint32Values._readField=function(e,t,r){1===e&&(t.readValuesInto=function(e){if(2!==e.type)throw new Error(`Unsupported pbf type "${e.type}"`);const t=function(e){return 2===e.type?e.readVarint()+e.pos:e.pos+1}(e),r=e.pos;return e.pos=t,function(n){e.pos=r;let i=0;for(;e.pos<t;){const t=e.readVarint();n[i++]=t}return n}}(r))},wy.Fixed32Values={},wy.Fixed32Values.read=function(e,t){return e.readFields(wy.Fixed32Values._readField,{values:[]},t)},wy.Fixed32Values._readField=function(e,t,r){throw new Error("Not implemented")};
|
|
36
36
|
/**
|