/*! For license information please see 2.e061cc64.chunk.js.LICENSE.txt */ (this["webpackJsonpefi-infrastructure-assessment-frontend"]=this["webpackJsonpefi-infrastructure-assessment-frontend"]||[]).push([[2],[function(t,e,r){"use strict";r.r(e);var n,i,o,a=r(8),s=0,u=[],c=a.i.__r,l=a.i.diffed,p=a.i.__c,f=a.i.unmount;function h(t,e){a.i.__h&&a.i.__h(i,t,s||e),s=0;var r=i.__H||(i.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function d(t){return s=1,m(C,t)}function m(t,e,r){var o=h(n++,2);return o.t=t,o.__c||(o.__c=i,o.__=[r?r(e):C(void 0,e),function(t){var e=o.t(o.__[0],t);o.__[0]!==e&&(o.__=[e,o.__[1]],o.__c.setState({}))}]),o.__}function y(t,e){var r=h(n++,3);!a.i.__s&&I(r.__H,e)&&(r.__=t,r.__H=e,i.__H.__h.push(r))}function v(t,e){var r=h(n++,4);!a.i.__s&&I(r.__H,e)&&(r.__=t,r.__H=e,i.__h.push(r))}function g(t){return s=5,b((function(){return{current:t}}),[])}function _(t,e,r){s=6,v((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==r?r:r.concat(t))}function b(t,e){var r=h(n++,7);return I(r.__H,e)?(r.__H=e,r.__h=t,r.__=t()):r.__}function x(t,e){return s=8,b((function(){return t}),e)}function w(t){var e=i.context[t.__c],r=h(n++,9);return r.__c=t,e?(null==r.__&&(r.__=!0,e.sub(i)),e.props.value):t.__}function S(t,e){a.i.useDebugValue&&a.i.useDebugValue(e?e(t):t)}function E(t){var e=h(n++,10),r=d();return e.__=t,i.componentDidCatch||(i.componentDidCatch=function(t){e.__&&e.__(t),r[1](t)}),[r[0],function(){r[1](void 0)}]}function O(){u.some((function(t){if(t.__P)try{t.__H.__h.forEach(A),t.__H.__h.forEach(k),t.__H.__h=[]}catch(e){return t.__H.__h=[],a.i.__e(e,t.__v),!0}})),u=[]}a.i.__r=function(t){c&&c(t),n=0;var e=(i=t.__c).__H;e&&(e.__h.forEach(A),e.__h.forEach(k),e.__h=[])},a.i.diffed=function(t){l&&l(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==u.push(e)&&o===a.i.requestAnimationFrame||((o=a.i.requestAnimationFrame)||function(t){var e,r=function(){clearTimeout(n),T&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);T&&(e=requestAnimationFrame(r))})(O))},a.i.__c=function(t,e){e.some((function(t){try{t.__h.forEach(A),t.__h=t.__h.filter((function(t){return!t.__||k(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],a.i.__e(r,t.__v)}})),p&&p(t,e)},a.i.unmount=function(t){f&&f(t);var e=t.__c;if(e&&e.__H)try{e.__H.__.forEach(A)}catch(t){a.i.__e(t,e.__v)}};var T="function"==typeof requestAnimationFrame;function A(t){"function"==typeof t.u&&t.u()}function k(t){t.u=t.__()}function I(t,e){return!t||e.some((function(e,r){return e!==t[r]}))}function C(t,e){return"function"==typeof e?e(t):e}function P(t,e){for(var r in e)t[r]=e[r];return t}function j(t,e){for(var r in t)if("__source"!==r&&!(r in e))return!0;for(var n in e)if("__source"!==n&&t[n]!==e[n])return!0;return!1}function M(t){this.props=t}function z(t,e){function r(t){var r=this.props.ref,n=r==t.ref;return!n&&r&&(r.call?r(null):r.current=null),e?!e(this.props,t)||!n:j(this.props,t)}function n(e){return this.shouldComponentUpdate=r,Object(a.f)(t,e)}return n.displayName="Memo("+(t.displayName||t.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}r.d(e,"version",(function(){return ut})),r.d(e,"Children",(function(){return B})),r.d(e,"render",(function(){return Q})),r.d(e,"hydrate",(function(){return tt})),r.d(e,"unmountComponentAtNode",(function(){return ft})),r.d(e,"createPortal",(function(){return Y})),r.d(e,"createFactory",(function(){return ct})),r.d(e,"cloneElement",(function(){return pt})),r.d(e,"isValidElement",(function(){return lt})),r.d(e,"findDOMNode",(function(){return ht})),r.d(e,"PureComponent",(function(){return M})),r.d(e,"memo",(function(){return z})),r.d(e,"forwardRef",(function(){return D})),r.d(e,"unstable_batchedUpdates",(function(){return dt})),r.d(e,"StrictMode",(function(){return mt})),r.d(e,"Suspense",(function(){return q})),r.d(e,"SuspenseList",(function(){return W})),r.d(e,"lazy",(function(){return G})),r.d(e,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return st})),r.d(e,"useState",(function(){return d})),r.d(e,"useReducer",(function(){return m})),r.d(e,"useEffect",(function(){return y})),r.d(e,"useLayoutEffect",(function(){return v})),r.d(e,"useRef",(function(){return g})),r.d(e,"useImperativeHandle",(function(){return _})),r.d(e,"useMemo",(function(){return b})),r.d(e,"useCallback",(function(){return x})),r.d(e,"useContext",(function(){return w})),r.d(e,"useDebugValue",(function(){return S})),r.d(e,"useErrorBoundary",(function(){return E})),r.d(e,"createElement",(function(){return a.f})),r.d(e,"createContext",(function(){return a.e})),r.d(e,"createRef",(function(){return a.g})),r.d(e,"Fragment",(function(){return a.b})),r.d(e,"Component",(function(){return a.a})),(M.prototype=new a.a).isPureReactComponent=!0,M.prototype.shouldComponentUpdate=function(t,e){return j(this.props,t)||j(this.state,e)};var L=a.i.__b;a.i.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),L&&L(t)};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function D(t){function e(e,r){var n=P({},e);return delete n.ref,t(n,(r=e.ref||r)&&("object"!=typeof r||"current"in r)?r:null)}return e.$$typeof=R,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var F=function(t,e){return t?Object(a.k)(Object(a.k)(t).map(e)):null},B={map:F,forEach:F,count:function(t){return t?Object(a.k)(t).length:0},only:function(t){var e=Object(a.k)(t);if(1!==e.length)throw"Children.only";return e[0]},toArray:a.k},N=a.i.__e;function U(t){return t&&((t=P({},t)).__c=null,t.__k=t.__k&&t.__k.map(U)),t}function V(t){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(V)),t}function q(){this.__u=0,this.t=null,this.__b=null}function Z(t){var e=t.__.__c;return e&&e.o&&e.o(t)}function G(t){var e,r,n;function i(i){if(e||(e=t()).then((function(t){r=t.default||t}),(function(t){n=t})),n)throw n;if(!r)throw e;return Object(a.f)(r,i)}return i.displayName="Lazy",i.__f=!0,i}function W(){this.u=null,this.i=null}a.i.__e=function(t,e,r){if(t.then)for(var n,i=e;i=i.__;)if((n=i.__c)&&n.__c)return null==e.__e&&(e.__e=r.__e,e.__k=r.__k),n.__c(t,e.__c);N(t,e,r)},(q.prototype=new a.a).__c=function(t,e){var r=this;null==r.t&&(r.t=[]),r.t.push(e);var n=Z(r.__v),i=!1,o=function(){i||(i=!0,e.componentWillUnmount=e.__c,n?n(a):a())};e.__c=e.componentWillUnmount,e.componentWillUnmount=function(){o(),e.__c&&e.__c()};var a=function(){var t;if(!--r.__u)for(r.__v.__k[0]=V(r.state.o),r.setState({o:r.__b=null});t=r.t.pop();)t.forceUpdate()};r.__u++||r.setState({o:r.__b=r.__v.__k[0]}),t.then(o,o)},q.prototype.componentWillUnmount=function(){this.t=[]},q.prototype.render=function(t,e){return this.__b&&(this.__v.__k&&(this.__v.__k[0]=U(this.__b)),this.__b=null),[Object(a.f)(a.b,null,e.o?null:t.children),e.o&&t.fallback]};var K=function(t,e,r){if(++r[1]===r[0]&&t.i.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.i.size))for(r=t.u;r;){for(;r.length>3;)r.pop()();if(r[1]3)for(r=[r],o=3;o1&&I(i,e,r),e=O(r,i,i,t.__k,null,i.__e,e),"function"==typeof t.type&&(t.__d=e)))}function C(t,e,r,i,o,a,s,u,c){var l,p,h,d,m,y,_,b,x,w,E,O=e.type;if(void 0!==e.constructor)return null;(l=n.__b)&&l(e);try{t:if("function"==typeof O){if(b=e.props,x=(l=O.contextType)&&i[l.__c],w=l?x?x.props.value:l.__:i,r.__c?_=(p=e.__c=r.__c).__=p.__E:("prototype"in O&&O.prototype.render?e.__c=p=new O(b,w):(e.__c=p=new g(b,w),p.constructor=O,p.render=L),x&&x.sub(p),p.props=b,p.state||(p.state={}),p.context=w,p.__n=i,h=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=O.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=f({},p.__s)),f(p.__s,O.getDerivedStateFromProps(b,p.__s))),d=p.props,m=p.state,h)null==O.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==O.getDerivedStateFromProps&&b!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,w),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,w)||e.__v===r.__v){p.props=b,p.state=p.__s,e.__v!==r.__v&&(p.__d=!1),p.__v=e,e.__e=r.__e,e.__k=r.__k,p.__h.length&&s.push(p),I(e,u,t);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(b,p.__s,w),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(d,m,y)}))}p.context=w,p.props=b,p.state=p.__s,(l=n.__r)&&l(e),p.__d=!1,p.__v=e,p.__P=t,l=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(i=f(f({},i),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(y=p.getSnapshotBeforeUpdate(d,m)),E=null!=l&&l.type==v&&null==l.key?l.props.children:l,S(t,Array.isArray(E)?E:[E],e,r,i,o,a,s,u,c),p.base=e.__e,p.__h.length&&s.push(p),_&&(p.__E=p.__=null),p.__e=!1}else null==a&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=j(r.__e,e,r,i,o,a,s,c);(l=n.diffed)&&l(e)}catch(t){e.__v=null,n.__e(t,e,r)}return e.__e}function P(t,e){n.__c&&n.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){n.__e(t,e.__v)}}))}function j(t,e,r,n,i,o,a,s){var u,p,f,h,d,m=r.props,y=e.props;if(i="svg"===e.type||i,null!=o)for(u=0;u3)for(r=[r],o=3;o1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(r&&"equal"===t)return"equal width";var n=i()(t);return"string"!==n&&"number"!==n||!e?Object(o.a)(t):"".concat(Object(o.a)(t)," ").concat(e)}},function(t,e,r){"use strict";var n=r(158);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(u){i=!0,o=u}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(t,e)||Object(n.a)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}r.d(e,"a",(function(){return i}))},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(27);function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;e"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"'],224:"Meta",225:"AltGraph",246:"Attn",247:"CrSel",248:"ExSel",249:"EraseEof",250:"Play",251:"ZoomOut"},o=0;o<24;o+=1)i[112+o]="F"+(o+1);for(var a=0;a<26;a+=1){var s=a+65;i[s]=[String.fromCharCode(s+32),String.fromCharCode(s)]}var u={codes:i,getCode:function(t){return n(t)?t.keyCode||t.which||this[t.key]:this[t]},getKey:function(t){var e=n(t);if(e&&t.key)return t.key;var r=i[e?t.keyCode||t.which:t];return Array.isArray(r)&&(r=e?r[t.shiftKey?1:0]:r[0]),r},Cancel:3,Help:6,Backspace:8,Tab:9,Clear:12,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,Convert:28,NonConvert:29,Accept:30,ModeChange:31," ":32,PageUp:33,PageDown:34,End:35,Home:36,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Select:41,Print:42,Execute:43,PrintScreen:44,Insert:45,Delete:46,0:48,")":48,1:49,"!":49,2:50,"@":50,3:51,"#":51,4:52,$:52,5:53,"%":53,6:54,"^":54,7:55,"&":55,8:56,"*":56,9:57,"(":57,a:65,A:65,b:66,B:66,c:67,C:67,d:68,D:68,e:69,E:69,f:70,F:70,g:71,G:71,h:72,H:72,i:73,I:73,j:74,J:74,k:75,K:75,l:76,L:76,m:77,M:77,n:78,N:78,o:79,O:79,p:80,P:80,q:81,Q:81,r:82,R:82,s:83,S:83,t:84,T:84,u:85,U:85,v:86,V:86,w:87,W:87,x:88,X:88,y:89,Y:89,z:90,Z:90,OS:91,ContextMenu:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,F20:131,F21:132,F22:133,F23:134,F24:135,NumLock:144,ScrollLock:145,VolumeMute:181,VolumeDown:182,VolumeUp:183,";":186,":":186,"=":187,"+":187,",":188,"<":188,"-":189,_:189,".":190,">":190,"/":191,"?":191,"`":192,"~":192,"[":219,"{":219,"\\":220,"|":220,"]":221,"}":221,"'":222,'"':222,Meta:224,AltGraph:225,Attn:246,CrSel:247,ExSel:248,EraseEof:249,Play:250,ZoomOut:251};u.Spacebar=u[" "],u.Digit0=u[0],u.Digit1=u[1],u.Digit2=u[2],u.Digit3=u[3],u.Digit4=u[4],u.Digit5=u[5],u.Digit6=u[6],u.Digit7=u[7],u.Digit8=u[8],u.Digit9=u[9],u.Tilde=u["~"],u.GraveAccent=u["`"],u.ExclamationPoint=u["!"],u.AtSign=u["@"],u.PoundSign=u["#"],u.PercentSign=u["%"],u.Caret=u["^"],u.Ampersand=u["&"],u.PlusSign=u["+"],u.MinusSign=u["-"],u.EqualsSign=u["="],u.DivisionSign=u["/"],u.MultiplicationSign=u["*"],u.Comma=u[","],u.Decimal=u["."],u.Colon=u[":"],u.Semicolon=u[";"],u.Pipe=u["|"],u.BackSlash=u["\\"],u.QuestionMark=u["?"],u.SingleQuote=u["'"],u.DoubleQuote=u['"'],u.LeftCurlyBrace=u["{"],u.RightCurlyBrace=u["}"],u.LeftParenthesis=u["("],u.RightParenthesis=u[")"],u.LeftAngleBracket=u["<"],u.RightAngleBracket=u[">"],u.LeftSquareBracket=u["["],u.RightSquareBracket=u["]"],t.exports=u},function(t,e,r){"use strict";e.a=function(t){return null!=t&&"object"==typeof t}},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";function n(){return(n=Object.assign||function(t){for(var e=1;e-1:!!l&&n(t,e,r)>-1}},function(t,e,r){"use strict";var n=r(29),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n.a?n.a.toStringTag:void 0;var u=function(t){var e=o.call(t,s),r=t[s];try{t[s]=void 0;var n=!0}catch(u){}var i=a.call(t);return n&&(e?t[s]=r:delete t[s]),i},c=Object.prototype.toString;var l=function(t){return c.call(t)},p=n.a?n.a.toStringTag:void 0;e.a=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":p&&p in Object(t)?u(t):l(t)}},function(t,e,r){var n=r(225),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();t.exports=o},function(t,e,r){var n=r(255),i=r(90),o=r(120),a=i((function(t,e){return o(t)?n(t,e):[]}));t.exports=a},function(t,e,r){"use strict";var n=r(162),i=r(24).a["__core-js_shared__"],o=function(){var t=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var a=function(t){return!!o&&o in t},s=r(43),u=r(61),c=/^\[object .+?Constructor\]$/,l=Function.prototype,p=Object.prototype,f=l.toString,h=p.hasOwnProperty,d=RegExp("^"+f.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var m=function(t){return!(!Object(s.a)(t)||a(t))&&(Object(n.a)(t)?d:c).test(Object(u.a)(t))};var y=function(t,e){return null==t?void 0:t[e]};e.a=function(t,e){var r=y(t,e);return m(r)?r:void 0}},function(t,e,r){"use strict";var n=r(268),i=Object.prototype.toString;function o(t){return"[object Array]"===i.call(t)}function a(t){return"undefined"===typeof t}function s(t){return null!==t&&"object"===typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!==t&&"undefined"!==typeof t)if("object"!==typeof t&&(t=[t]),o(t))for(var r=0,n=t.length;r=0;f--){var h=a[f];"."===h?o(a,f):".."===h?(o(a,f),p++):p&&(o(a,f),p--)}if(!c)for(;p--;p)a.unshift("..");!c||""===a[0]||a[0]&&i(a[0])||a.unshift("");var d=a.join("/");return r&&"/"!==d.substr(-1)&&(d+="/"),d};function s(t){return t.valueOf?t.valueOf():Object.prototype.valueOf.call(t)}var u=function t(e,r){if(e===r)return!0;if(null==e||null==r)return!1;if(Array.isArray(e))return Array.isArray(r)&&e.length===r.length&&e.every((function(e,n){return t(e,r[n])}));if("object"===typeof e||"object"===typeof r){var n=s(e),i=s(r);return n!==e||i!==r?t(n,i):Object.keys(Object.assign({},e,r)).every((function(n){return t(e[n],r[n])}))}return!1},c=r(40);function l(t){return"/"===t.charAt(0)?t:"/"+t}function p(t){return"/"===t.charAt(0)?t.substr(1):t}function f(t,e){return function(t,e){return 0===t.toLowerCase().indexOf(e.toLowerCase())&&-1!=="/?#".indexOf(t.charAt(e.length))}(t,e)?t.substr(e.length):t}function h(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t}function d(t){var e=t.pathname,r=t.search,n=t.hash,i=e||"/";return r&&"?"!==r&&(i+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(i+="#"===n.charAt(0)?n:"#"+n),i}function m(t,e,r,i){var o;"string"===typeof t?(o=function(t){var e=t||"/",r="",n="",i=e.indexOf("#");-1!==i&&(n=e.substr(i),e=e.substr(0,i));var o=e.indexOf("?");return-1!==o&&(r=e.substr(o),e=e.substr(0,o)),{pathname:e,search:"?"===r?"":r,hash:"#"===n?"":n}}(t)).state=e:(void 0===(o=Object(n.a)({},t)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==e&&void 0===o.state&&(o.state=e));try{o.pathname=decodeURI(o.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return r&&(o.key=r),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function y(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&u(t.state,e.state)}function v(){var t=null;var e=[];return{setPrompt:function(e){return t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,r,n,i){if(null!=t){var o="function"===typeof t?t(e,r):t;"string"===typeof o?"function"===typeof n?n(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(t){var r=!0;function n(){r&&t.apply(void 0,arguments)}return e.push(n),function(){r=!1,e=e.filter((function(t){return t!==n}))}},notifyListeners:function(){for(var t=arguments.length,r=new Array(t),n=0;ne?r.splice(e,r.length-e,n):r.push(n),p({action:"PUSH",location:n,index:e,entries:r})}}))},replace:function(t,e){var n=m(t,e,f(),b.location);l.confirmTransitionTo(n,"REPLACE",r,(function(t){t&&(b.entries[b.index]=n,p({action:"REPLACE",location:n}))}))},go:_,goBack:function(){_(-1)},goForward:function(){_(1)},canGo:function(t){var e=b.index+t;return e>=0&&e=this._maxSize&&this.clear(),t in this._values||this._size++,this._values[t]=e};var i=/[^.^\]^[]+|(?=\[\]|\.\.)/g,o=/^\d+$/,a=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,u=/^\s*(['"]?)(.*?)(\1)\s*$/,c=new n(512),l=new n(512),p=new n(512);function f(t){return c.get(t)||c.set(t,h(t).map((function(t){return t.replace(u,"$2")})))}function h(t){return t.match(i)}function d(t){return"string"===typeof t&&t&&-1!==["'",'"'].indexOf(t.charAt(0))}function m(t){return!d(t)&&(function(t){return t.match(a)&&!t.match(o)}(t)||function(t){return s.test(t)}(t))}t.exports={Cache:n,split:h,normalizePath:f,setter:function(t){var e=f(t);return l.get(t)||l.set(t,(function(t,r){for(var n=0,i=e.length;n-1};var l=function(t,e){var r=this.__data__,n=o(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function p(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e1&&void 0!==arguments[1]?arguments[1]:{},r=e.htmlProps,n=void 0===r?u:r,o=e.includeAria,s=void 0===o||o,c={},l={};return a()(t,(function(t,e){var r=s&&(/^aria-.*$/.test(e)||"role"===e);(i()(n,e)||r?c:l)[e]=t})),[c,l]}},function(t,e,r){"use strict";(function(t){var n=r(24),i=r(320),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===o?n.a.Buffer:void 0,u=(s?s.isBuffer:void 0)||i.a;e.a=u}).call(this,r(193)(t))},function(t,e,r){"use strict";var n=r(37),i=Object(n.a)(Object,"create");var o=function(){this.__data__=i?i(null):{},this.size=0};var a=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},s=Object.prototype.hasOwnProperty;var u=function(t){var e=this.__data__;if(i){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return s.call(e,t)?e[t]:void 0},c=Object.prototype.hasOwnProperty;var l=function(t){var e=this.__data__;return i?void 0!==e[t]:c.call(e,t)};var p=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=i&&void 0===e?"__lodash_hash_undefined__":e,this};function f(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=0||(i[r]=t[r]);return i}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";var n=r(3),i=r.n(n),o=r(10),a=r.n(o),s=r(11),u=r.n(s),c=r(13),l=r.n(c),p=r(12),f=r.n(p),h=r(2),d=r.n(h),m=r(14),y=r.n(m),v=r(1),g=r.n(v),_=r(6),b=r.n(_),x=r(9),w=r.n(x),S=(r(36),r(4)),E=r.n(S),O=(r(7),r(0)),T=r(16),A=r(109),k=r(110),I=r(160),C=r(5);function P(t){var e=t.children,r=t.className,n=t.content,o=t.size,a=E()(o,"icons",r),s=Object(A.a)(P,t),u=Object(k.a)(P,t);return O.default.createElement(u,i()({},s,{className:a}),C.a.isNil(e)?n:e)}P.handledProps=["as","children","className","content","size"],P.propTypes={},P.defaultProps={as:"i"};var j=P,M=function(t){function e(){var t,r;a()(this,e);for(var n=arguments.length,i=new Array(n),o=0;o-1&&t%1==0&&t<=9007199254740991}},function(t,e,r){"use strict";e.a=function(t){return function(e){return t(e)}}},function(t,e,r){"use strict";function n(t){return Array.prototype.slice.apply(t)}function i(t){this.status="pending",this._continuations=[],this._parent=null,this._paused=!1,t&&t.call(this,this._continueWith.bind(this),this._failWith.bind(this))}function o(t){return t&&"function"===typeof t.then}function a(t){return t}if(i.prototype={then:function(t,e){var r=i.unresolved()._setParent(this);if(this._isRejected()){if(this._paused)return this._continuations.push({promise:r,nextFn:t,catchFn:e}),r;if(e)try{var n=e(this._error);return o(n)?(this._chainPromiseData(n,r),r):i.resolve(n)._setParent(this)}catch(a){return i.reject(a)._setParent(this)}return i.reject(this._error)._setParent(this)}return this._continuations.push({promise:r,nextFn:t,catchFn:e}),this._runResolutions(),r},catch:function(t){if(this._isResolved())return i.resolve(this._data)._setParent(this);var e=i.unresolved()._setParent(this);return this._continuations.push({promise:e,catchFn:t}),this._runRejections(),e},finally:function(t){var e=!1;function r(r,n){if(!e){e=!0,t||(t=a);var i=t(r);return o(i)?i.then((function(){if(n)throw n;return r})):r}}return this.then((function(t){return r(t)})).catch((function(t){return r(null,t)}))},pause:function(){return this._paused=!0,this},resume:function(){var t=this._findFirstPaused();return t&&(t._paused=!1,t._runResolutions(),t._runRejections()),this},_findAncestry:function(){return this._continuations.reduce((function(t,e){if(e.promise){var r={promise:e.promise,children:e.promise._findAncestry()};t.push(r)}return t}),[])},_setParent:function(t){if(this._parent)throw new Error("parent already set");return this._parent=t,this},_continueWith:function(t){var e=this._findFirstPending();e&&(e._data=t,e._setResolved())},_findFirstPending:function(){return this._findFirstAncestor((function(t){return t._isPending&&t._isPending()}))},_findFirstPaused:function(){return this._findFirstAncestor((function(t){return t._paused}))},_findFirstAncestor:function(t){for(var e,r=this;r;)t(r)&&(e=r),r=r._parent;return e},_failWith:function(t){var e=this._findFirstPending();e&&(e._error=t,e._setRejected())},_takeContinuations:function(){return this._continuations.splice(0,this._continuations.length)},_runRejections:function(){if(!this._paused&&this._isRejected()){var t=this._error,e=this._takeContinuations(),r=this;e.forEach((function(e){if(e.catchFn)try{var n=e.catchFn(t);r._handleUserFunctionResult(n,e.promise)}catch(i){e.promise.reject(i)}else e.promise.reject(t)}))}},_runResolutions:function(){if(!this._paused&&this._isResolved()&&!this._isPending()){var t=this._takeContinuations();if(o(this._data))return this._handleWhenResolvedDataIsPromise(this._data);var e=this._data,r=this;t.forEach((function(t){if(t.nextFn)try{var n=t.nextFn(e);r._handleUserFunctionResult(n,t.promise)}catch(i){r._handleResolutionError(i,t)}else t.promise&&t.promise.resolve(e)}))}},_handleResolutionError:function(t,e){if(this._setRejected(),e.catchFn)try{return void e.catchFn(t)}catch(r){t=r}e.promise&&e.promise.reject(t)},_handleWhenResolvedDataIsPromise:function(t){var e=this;return t.then((function(t){e._data=t,e._runResolutions()})).catch((function(t){e._error=t,e._setRejected(),e._runRejections()}))},_handleUserFunctionResult:function(t,e){o(t)?this._chainPromiseData(t,e):e.resolve(t)},_chainPromiseData:function(t,e){t.then((function(t){e.resolve(t)})).catch((function(t){e.reject(t)}))},_setResolved:function(){this.status="resolved",this._paused||this._runResolutions()},_setRejected:function(){this.status="rejected",this._paused||this._runRejections()},_isPending:function(){return"pending"===this.status},_isResolved:function(){return"resolved"===this.status},_isRejected:function(){return"rejected"===this.status}},i.resolve=function(t){return new i((function(e,r){o(t)?t.then((function(t){e(t)})).catch((function(t){r(t)})):e(t)}))},i.reject=function(t){return new i((function(e,r){r(t)}))},i.unresolved=function(){return new i((function(t,e){this.resolve=t,this.reject=e}))},i.all=function(){var t=n(arguments);return Array.isArray(t[0])&&(t=t[0]),t.length?new i((function(e,r){var n=[],o=0,a=!1;t.forEach((function(s,u){i.resolve(s).then((function(r){n[u]=r,(o+=1)===t.length&&e(n)})).catch((function(t){!function(t){a||(a=!0,r(t))}(t)}))}))})):i.resolve([])},Promise===i)throw new Error("Please use SynchronousPromise.installGlobally() to install globally");var s=Promise;i.installGlobally=function(t){if(Promise===i)return t;var e=function(t){if("undefined"===typeof t||t.__patched)return t;var e=t;return(t=function(){e.apply(this,n(arguments))}).__patched=!0,t}(t);return Promise=i,e},i.uninstallGlobally=function(){Promise===i&&(Promise=s)},t.exports={SynchronousPromise:i}},function(t,e,r){"use strict";var n=r(76);var i=function(t,e){for(var r=-1,n=null==t?0:t.length;++r=0;l--)"."===(a=u[l])?u.splice(l,1):".."===a?c++:c>0&&(""===a?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return""===(r=u.join("/"))&&(r=s?"/":"."),n?(n.path=r,o(n)):r}e.urlParse=i,e.urlGenerate=o,e.normalize=a,e.join=function(t,e){""===t&&(t="."),""===e&&(e=".");var r=i(e),s=i(t);if(s&&(t=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||e.match(n))return e;if(s&&!s.host&&!s.path)return s.host=e,o(s);var u="/"===e.charAt(0)?e:a(t.replace(/\/+$/,"")+"/"+e);return s?(s.path=u,o(s)):u},e.isAbsolute=function(t){return"/"===t.charAt(0)||!!t.match(r)},e.relative=function(t,e){""===t&&(t="."),t=t.replace(/\/$/,"");for(var r=0;0!==e.indexOf(t+"/");){var n=t.lastIndexOf("/");if(n<0)return e;if((t=t.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)};var s=!("__proto__"in Object.create(null));function u(t){return t}function c(t){if(!t)return!1;var e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(var r=e-10;r>=0;r--)if(36!==t.charCodeAt(r))return!1;return!0}function l(t,e){return t===e?0:t>e?1:-1}e.toSetString=s?u:function(t){return c(t)?"$"+t:t},e.fromSetString=s?u:function(t){return c(t)?t.slice(1):t},e.compareByOriginalPositions=function(t,e,r){var n=t.source-e.source;return 0!==n||0!==(n=t.originalLine-e.originalLine)||0!==(n=t.originalColumn-e.originalColumn)||r||0!==(n=t.generatedColumn-e.generatedColumn)||0!==(n=t.generatedLine-e.generatedLine)?n:t.name-e.name},e.compareByGeneratedPositionsDeflated=function(t,e,r){var n=t.generatedLine-e.generatedLine;return 0!==n||0!==(n=t.generatedColumn-e.generatedColumn)||r||0!==(n=t.source-e.source)||0!==(n=t.originalLine-e.originalLine)||0!==(n=t.originalColumn-e.originalColumn)?n:t.name-e.name},e.compareByGeneratedPositionsInflated=function(t,e){var r=t.generatedLine-e.generatedLine;return 0!==r||0!==(r=t.generatedColumn-e.generatedColumn)||0!==(r=l(t.source,e.source))||0!==(r=t.originalLine-e.originalLine)||0!==(r=t.originalColumn-e.originalColumn)?r:l(t.name,e.name)}},function(t,e){t.exports=function(t,e){return t===e||t!==t&&e!==e}},function(t,e,r){var n=r(405),i=r(32),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},function(t,e,r){(function(t){var n=r(35),i=r(406),o=e&&!e.nodeType&&e,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===o?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u}).call(this,r(181)(t))},function(t,e){var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&r.test(t))&&t>-1&&t%1==0&&t2?arguments[2]:{},o=n(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;st.length)&&(e=t.length);for(var r=0,n=new Array(e);r(n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var a="undefined"!=typeof self?self:{};function s(t,e,n,i){var o=new r(t,e,n,i);return function(t){return o.solve(t)}}var u=s(.25,.1,.25,1);function c(t,e,r){return Math.min(r,Math.max(e,t))}function l(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function y(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function v(t,e){return-1!==t.indexOf(e,t.length-e.length)}function g(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function _(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?g(t,b):t}var x={};function w(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function S(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function E(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var A=null;function k(t){if(null==A){var e=t.navigator?t.navigator.userAgent:null;A=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return A}function I(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var C,P,j,M,z=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),L=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,R=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,D={now:z,frame:function(t){var e=L(t);return{cancel:function(){return R(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return C||(C=a.document.createElement("a")),C.href=t,C.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==P&&(P=a.matchMedia("(prefers-reduced-motion: reduce)")),P.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},B={supported:!1,testSupport:function(t){!N&&M&&(U?V(t):j=t)}},N=!1,U=!1;function V(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,M),t.isContextLost())return;B.supported=!0}catch(t){}t.deleteTexture(e),N=!0}a.document&&((M=a.document.createElement("img")).onload=function(){j&&V(j),j=null,U=!0},M.onerror=function(){N=!0,j=null},M.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var q="01",Z=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function G(t){return 0===t.indexOf("mapbox:")}Z.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",q,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},Z.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Z.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},Z.prototype.normalizeStyleURL=function(t,e){if(!G(t))return t;var r=H(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeGlyphsURL=function(t,e){if(!G(t))return t;var r=H(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeSourceURL=function(t,e){if(!G(t))return t;var r=H(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeSpriteURL=function(t,e,r,n){var i=H(t);return G(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,Y(i))},Z.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!G(t))return t;var r=H(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(D.devicePixelRatio>=2||512===e?"@2x":"")+(B.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,r,n){var i=this;if(F.EVENTS_URL){var o=H(F.EVENTS_URL);o.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.11.1",skuId:q,userId:this.anonId},s=e?p(a,e):a,u={url:Y(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Q,tt,et=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||K(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=d()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}($),rt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||K(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,i=n!==this.eventData.tokenU;m(this.anonId)||(this.anonId=d(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}($)),nt=rt.postTurnstileEvent.bind(rt),it=new et,ot=it.postMapLoadEvent.bind(it),at=500,st=50;function ut(){a.caches&&!Q&&(Q=a.caches.open("mapbox-tiles"))}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var lt,pt=1/0;function ft(){return null==lt&&(lt=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),lt}var ht={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ht);var dt,mt,yt=function(t){function e(e,r,n){401===r&&K(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),vt=O()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},gt=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(vt())&&!/^\w+:/.test(r))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:vt(),signal:n.signal}),o=!1,s=!1,u=(r=i.url).indexOf("sku=")>0&&K(r);"json"===t.type&&i.headers.set("Accept","application/json");var c=function(r,n,o){if(!s){if(r&&"SecurityError"!==r.message&&w(r),n&&o)return l(n);var c=Date.now();a.fetch(i).then((function(r){if(r.ok){var n=u?r.clone():null;return l(r,n,c)}return e(new yt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&u&&function(t,e,r){if(ut(),Q){var n={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=T(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===tt)try{new Response(new ReadableStream),tt=!0}catch(t){tt=!1}tt?e(t.body):t.blob().then(e)}(e,(function(e){var r=new a.Response(e,n);ut(),Q&&Q.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return w(t.message)}))})))}}(i,n,u),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(ut(),!Q)return e(null);var r=ct(t.url);Q.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=T(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}(i,c):c(null,null),{cancel:function(){s=!0,o||n.abort()}}}(t,e);if(O()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new a.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new yt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},_t=function(t,e){return gt(p(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return gt(p(t,{method:"POST"}),e)};function xt(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function wt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}dt=[],mt=0;var St=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t},Et=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",p({error:e},r))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(St),Ot=function(){};Ot.prototype.on=function(t,e){return this._listeners=this._listeners||{},xt(t,e,this._listeners),this},Ot.prototype.off=function(t,e){return wt(t,e,this._listeners),wt(t,e,this._oneTimeListeners),this},Ot.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},xt(t,e,this._oneTimeListeners),this},Ot.prototype.fire=function(t,e){"string"==typeof t&&(t=new St(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ot.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Tt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},At=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function kt(t){var e=t.value;return e?[new At(t.key,e,"constants have been deprecated as of v8")]:[]}function It(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Wt=[zt,Lt,Rt,Dt,Ft,Vt,Bt,Zt(Nt),qt];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Wt;r255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),c=s.indexOf(")");if(-1!==u&&c+1===s.length){var l=s.substr(0,u),p=s.substr(u+1,c-(u+1)).split(","),f=1;switch(l){case"rgba":if(4!==p.length)return null;f=o(p.pop());case"rgb":return 3!==p.length?null:[i(p[0]),i(p[1]),i(p[2]),f];case"hsla":if(4!==p.length)return null;f=o(p.pop());case"hsl":if(3!==p.length)return null;var h=(parseFloat(p[0])%360+360)%360/360,d=o(p[1]),m=o(p[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[n(255*a(v,y,h+1/3)),n(255*a(v,y,h)),n(255*a(v,y,h-1/3)),f];default:return null}}return null}}catch(t){}})).parseCSSColor,Jt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};Jt.parse=function(t){if(t){if(t instanceof Jt)return t;if("string"==typeof t){var e=Yt(t);if(e)return new Jt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Jt.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],n=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+n+")"},Jt.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},Jt.black=new Jt(0,0,0,1),Jt.white=new Jt(1,1,1,1),Jt.transparent=new Jt(0,0,0,0),Jt.red=new Jt(1,0,0,1);var $t=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};$t.prototype.compare=function(t,e){return this.collator.compare(t,e)},$t.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Qt=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},te=function(t){this.sections=t};te.fromString=function(t){return new te([new Qt(t,null,null,null,null)])},te.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},te.factory=function(t){return t instanceof te?t:te.fromString(t)},te.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},te.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ne(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Jt)return!0;if(t instanceof $t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in ue)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=ue[s],n++}else o=Nt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Zt(o,a)}else r=ue[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var le=function(t){this.type=Vt,this.sections=t};le.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Lt)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,Zt(Rt))))return null;var c=null;if(a["text-color"]&&!(c=e.parse(a["text-color"],1,Ft)))return null;var l=n[n.length-1];l.scale=s,l.font=u,l.textColor=c}else{var p=e.parse(t[o],1,Nt);if(!p)return null;var f=p.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:p,scale:null,font:null,textColor:null})}}return new le(n)},le.prototype.evaluate=function(t){return new te(this.sections.map((function(e){var r=e.content.evaluate(t);return ie(r)===qt?new Qt("",r,null,null,null):new Qt(oe(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},le.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},pe.prototype.eachChild=function(t){t(this.input)},pe.prototype.outputDefined=function(){return!1},pe.prototype.serialize=function(){return["image",this.input.serialize()]};var fe={"to-boolean":Dt,"to-color":Ft,"to-number":Lt,"to-string":Rt},he=function(t,e){this.type=t,this.args=e};he.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=fe[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":re(e[0],e[1],e[2],e[3])))return new Jt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new se(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function be(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*8192),Math.round(n*i*8192)]}function xe(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function we(t,e){for(var r,n,i,o,a,s,u,c=!1,l=0,p=e.length;l0&&s<0||a<0&&s>0}function Oe(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}ge(e,t)}function Pe(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Re(t,e)&&(r=!1)})),r}Me.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ne(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new se("Input is not a number.");o=a-1}return 0}Fe.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Fe.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ce(e,[t]):"coerce"===r?new he(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof ae)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof De)return t(e.boundExpression);if(e instanceof ye&&"error"===e.name)return!1;if(e instanceof ve)return!1;if(e instanceof Me)return!1;var r=e instanceof he||e instanceof ce,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ae})),!!n&&ze(e)&&Re(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new me;try{o=new ae(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Fe.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Fe(this.registry,n,e||null,i,this.errors)},Fe.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new jt(n,t))},Fe.prototype.checkSubtype=function(t,e){var r=Kt(t,e);return r&&this.error(r),r};var Ne=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var l=e.parse(s,c,i);if(!l)return null;i=i||l.type,n.push([a,l])}return new Ne(i,r,n)},Ne.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Be(e,n)].evaluate(t)},Ne.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ve=Object.freeze({__proto__:null,number:Ue,color:function(t,e,r){return new Jt(Ue(t.r,e.r,r),Ue(t.g,e.g,r),Ue(t.b,e.b,r),Ue(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ue(t,e[n],r)}))}}),qe=6/29*3*(6/29),Ze=Math.PI/180,Ge=180/Math.PI;function We(t){return t>.008856451679035631?Math.pow(t,1/3):t/qe+4/29}function Ke(t){return t>6/29?t*t*t:qe*(t-4/29)}function Xe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function He(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ye(t){var e=He(t.r),r=He(t.g),n=He(t.b),i=We((.4124564*e+.3575761*r+.1804375*n)/.95047),o=We((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-We((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function Je(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ke(e),r=.95047*Ke(r),n=1.08883*Ke(n),new Jt(Xe(3.2404542*r-1.5371385*e-.4985314*n),Xe(-.969266*r+1.8760108*e+.041556*n),Xe(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function $e(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Qe={forward:Ye,reverse:Je,interpolate:function(t,e,r){return{l:Ue(t.l,e.l,r),a:Ue(t.a,e.a,r),b:Ue(t.b,e.b,r),alpha:Ue(t.alpha,e.alpha,r)}}},tr={forward:function(t){var e=Ye(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*Ge;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Ze,r=t.c;return Je({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:$e(t.h,e.h,r),c:Ue(t.c,e.c,r),l:Ue(t.l,e.l,r),alpha:Ue(t.alpha,e.alpha,r)}}},er=Object.freeze({__proto__:null,lab:Qe,hcl:tr}),rr=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Lt)))return null;var u=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Ft:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var l=0;l=p)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);var m=e.parse(f,d,c);if(!m)return null;c=c||m.type,u.push([p,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new rr(c,r,n,i,u):e.error("Type "+Gt(c)+" is not interpolatable.")},rr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=Be(e,n),a=rr.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Ve[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?tr.reverse(tr.interpolate(tr.forward(s),tr.forward(u),a)):Qe.reverse(Qe.interpolate(Qe.forward(s),Qe.forward(u),a))},rr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new se("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new se("Array index must be an integer, but found "+e+" instead.");return r[e]},ar.prototype.eachChild=function(t){t(this.index),t(this.input)},ar.prototype.outputDefined=function(){return!1},ar.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var sr=function(t,e){this.type=Dt,this.needle=t,this.haystack=e};sr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Nt),n=e.parse(t[2],2,Nt);return r&&n?Xt(r.type,[Dt,Rt,Lt,zt,Nt])?new sr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Gt(r.type)+" instead"):null},sr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Ht(e,["boolean","string","number","null"]))throw new se("Expected first argument to be of type boolean, string, number or null, but found "+Gt(ie(e))+" instead.");if(!Ht(r,["string","array"]))throw new se("Expected second argument to be of type array or string, but found "+Gt(ie(r))+" instead.");return r.indexOf(e)>=0},sr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},sr.prototype.outputDefined=function(){return!0},sr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ur=function(t,e,r){this.type=Lt,this.needle=t,this.haystack=e,this.fromIndex=r};ur.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Nt),n=e.parse(t[2],2,Nt);if(!r||!n)return null;if(!Xt(r.type,[Dt,Rt,Lt,zt,Nt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Gt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Lt);return i?new ur(r,n,i):null}return new ur(r,n)},ur.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Ht(e,["boolean","string","number","null"]))throw new se("Expected first argument to be of type boolean, string, number or null, but found "+Gt(ie(e))+" instead.");if(!Ht(r,["string","array"]))throw new se("Expected second argument to be of type array or string, but found "+Gt(ie(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},ur.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ur.prototype.outputDefined=function(){return!1},ur.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var cr=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};cr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ie(f)))return null}else r=ie(f);if(void 0!==i[String(f)])return c.error("Branch labels must be unique.");i[String(f)]=o.length}var h=e.parse(u,a,n);if(!h)return null;n=n||h.type,o.push(h)}var d=e.parse(t[1],1,Nt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new cr(r,n,d,i,o,m):null},cr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ie(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},cr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},cr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},cr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Nt),n=e.parse(t[2],2,Lt);if(!r||!n)return null;if(!Xt(r.type,[Zt(Nt),Rt,Nt]))return e.error("Expected first argument to be of type array or string, but found "+Gt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Lt);return i?new pr(r.type,r,n,i):null}return new pr(r.type,r,n)},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Ht(e,["string","array"]))throw new se("Expected first argument to be of type array or string, but found "+Gt(ie(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},pr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},pr.prototype.outputDefined=function(){return!1},pr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var mr=dr("==",(function(t,e,r){return e===r}),hr),yr=dr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!hr(0,e,r,n)})),vr=dr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),_r=dr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),br=dr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),xr=function(t,e,r,n,i){this.type=Rt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};xr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Lt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Rt)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Rt)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Lt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Lt))?null:new xr(r,i,o,a,s)},xr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},xr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},xr.prototype.outputDefined=function(){return!1},xr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var wr=function(t){this.type=Lt,this.input=t};wr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Gt(r.type)+" instead."):new wr(r):null},wr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new se("Expected value to be of type string or array, but found "+Gt(ie(e))+" instead.")},wr.prototype.eachChild=function(t){t(this.input)},wr.prototype.outputDefined=function(){return!1},wr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Sr={"==":mr,"!=":yr,">":gr,"<":vr,">=":br,"<=":_r,array:ce,at:ar,boolean:ce,case:lr,coalesce:ir,collator:ve,format:le,image:pe,in:sr,"index-of":ur,interpolate:rr,"interpolate-hcl":rr,"interpolate-lab":rr,length:wr,let:or,literal:ae,match:cr,number:ce,"number-format":xr,object:ce,slice:pr,step:Ne,string:ce,"to-boolean":he,"to-color":he,"to-number":he,"to-string":he,var:De,within:Me};function Er(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=re(r,n,i,a);if(s)throw new se(s);return new Jt(r/255*a,n/255*a,i/255*a,a)}function Or(t,e){return t in e}function Tr(t,e){var r=e[t];return void 0===r?null:r}function Ar(t){return{type:t}}function kr(t){return{result:"success",value:t}}function Ir(t){return{result:"error",value:t}}function Cr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Pr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function jr(t){return!!t.expression&&t.expression.interpolated}function Mr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function zr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Lr(t){return t}function Rr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Dr(t,e,r,n,i){return Rr(typeof r===i?n[r]:void 0,t.default,e.default)}function Fr(t,e,r){if("number"!==Mr(r))return Rr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Be(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Br(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Mr(r))return Rr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=Be(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],c=Ve[e.type]||Lr;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=er[t.colorSpace];c=function(t,e){return l.reverse(l.interpolate(l.forward(t),l.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,a)}}:c(s,u,a)}function Nr(t,e,r){return"color"===e.type?r=Jt.parse(r):"formatted"===e.type?r=te.fromString(r.toString()):"resolvedImage"===e.type?r=ee.fromString(r.toString()):Mr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Rr(r,t.default,e.default)}ye.register(Sr,{error:[{kind:"error"},[Rt],function(t,e){throw new se(e[0].evaluate(t))}],typeof:[Rt,[Nt],function(t,e){return Gt(ie(e[0].evaluate(t)))}],"to-rgba":[Zt(Lt,4),[Ft],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ft,[Lt,Lt,Lt],Er],rgba:[Ft,[Lt,Lt,Lt,Lt],Er],has:{type:Dt,overloads:[[[Rt],function(t,e){return Or(e[0].evaluate(t),t.properties())}],[[Rt,Bt],function(t,e){var r=e[1];return Or(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:Nt,overloads:[[[Rt],function(t,e){return Tr(e[0].evaluate(t),t.properties())}],[[Rt,Bt],function(t,e){var r=e[1];return Tr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Nt,[Rt],function(t,e){return Tr(e[0].evaluate(t),t.featureState||{})}],properties:[Bt,[],function(t){return t.properties()}],"geometry-type":[Rt,[],function(t){return t.geometryType()}],id:[Nt,[],function(t){return t.id()}],zoom:[Lt,[],function(t){return t.globals.zoom}],"heatmap-density":[Lt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Lt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Nt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Lt,Ar(Lt),function(t,e){for(var r=0,n=0,i=e;n":[Dt,[Rt,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[Dt,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Dt,[Rt,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Dt,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Dt,[Rt,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Dt,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Dt,[Nt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Dt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Dt,[Zt(Rt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Dt,[Zt(Nt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Dt,[Rt,Zt(Nt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Dt,[Rt,Zt(Nt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Dt,overloads:[[[Dt,Dt],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Ar(Dt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Sr}function qr(t,e){var r=new Fe(Sr,[],e?function(t){var e={color:Ft,string:Rt,number:Lt,enum:Rt,boolean:Dt,formatted:Vt,resolvedImage:qt};return"array"===t.type?Zt(e[t.value]||Nt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?kr(new Ur(n,e)):Ir(r.errors)}Ur.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Ur.prototype.evaluate=function(t,e,r,n,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new se("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Zr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Le(e.expression)};Zr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},Zr.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var Gr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Le(e.expression),this.interpolationType=n};function Wr(t,e){if("error"===(t=qr(t,e)).result)return t;var r=t.value.expression,n=ze(r);if(!n&&!Cr(e))return Ir([new jt("","data expressions not supported")]);var i=Re(r,["zoom"]);if(!i&&!Pr(e))return Ir([new jt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof or)r=t(e.result);else if(e instanceof ir)for(var n=0,i=e.args;nn.maximum?[new At(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Jr(t){var e,r,n,i=t.valueSpec,o=Ct(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,c="array"===Mr(t.value.stops)&&"array"===Mr(t.value.stops[0])&&"object"===Mr(t.value.stops[0][0]),l=Xr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new At(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Hr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===Mr(r)&&0===r.length&&e.push(new At(t.key,r,"array must have at least one stop")),e},default:function(t){return bn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&l.push(new At(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||l.push(new At(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!jr(t.valueSpec)&&l.push(new At(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Cr(t.valueSpec)?l.push(new At(t.key,t.value,"property functions not supported")):s&&!Pr(t.valueSpec)&&l.push(new At(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||l.push(new At(t.key,t.value,'"property" property is required')),l;function p(t){var e=[],o=t.value,s=t.key;if("array"!==Mr(o))return[new At(s,o,"array expected, "+Mr(o)+" found")];if(2!==o.length)return[new At(s,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==Mr(o[0]))return[new At(s,o,"object expected, "+Mr(o[0])+" found")];if(void 0===o[0].zoom)return[new At(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new At(s,o,"object stop key must have value")];if(n&&n>Ct(o[0].zoom))return[new At(s,o[0].zoom,"stop zoom values must appear in ascending order")];Ct(o[0].zoom)!==n&&(n=Ct(o[0].zoom),r=void 0,a={}),e=e.concat(Xr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Yr,value:f}}))}else e=e.concat(f({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Vr(Pt(o[1]))?e.concat([new At(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(bn({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,n){var s=Mr(t.value),u=Ct(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new At(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new At(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var l="number expected, "+s+" found";return Cr(i)&&void 0===o&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new At(t.key,c,l)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function on(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?an(t[1],t[2],"=="):"!="===r?cn(an(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?an(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(on))):"all"===r?["all"].concat(t.slice(1).map(on)):"none"===r?["all"].concat(t.slice(1).map(on).map(cn)):"in"===r?sn(t[1],t.slice(2)):"!in"===r?cn(sn(t[1],t.slice(2))):"has"===r?un(t[1]):"!has"===r?cn(un(t[1])):"within"!==r||t}function an(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function sn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(nn)]]:["filter-in-small",t,["literal",e]]}}function un(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function cn(t){return["!",t]}function ln(t){return tn(Pt(t.value))?$r(It({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Mr(r))return[new At(n,r,"array expected, "+Mr(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new At(n,r,"filter array must have at least 1 element")];switch(a=a.concat(Qr({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ct(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Ct(r[1])&&a.push(new At(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new At(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Mr(r[1]))&&a.push(new At(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=l[h+0]&&n>=l[h+1])?(a[f]=!0,o.push(c[f])):a[f]=!1}}},Pn.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),c=this._convertToCellCoord(e),l=this._convertToCellCoord(r),p=this._convertToCellCoord(n),f=u;f<=l;f++)for(var h=c;h<=p;h++){var d=this.d*h+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(h),this._convertFromCellCoord(f+1),this._convertFromCellCoord(h+1)))&&i.call(this,t,e,r,n,d,o,a,s))return}},Pn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Pn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Pn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n=0)){var l=t[c];u[c]=zn[s].shallow.indexOf(c)>=0?l:Bn(l,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function Nn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Dn(t)||Fn(t)||ArrayBuffer.isView(t)||t instanceof jn)return t;if(Array.isArray(t))return t.map(Nn);if("object"==typeof t){var e=t.$name||"Object",r=zn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,o=Object.keys(t);i=0?s:Nn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Un=function(){this.first=!0};Un.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function qn(t){for(var e=0,r=t;e=65097&&t<=65103)||Vn["CJK Compatibility Ideographs"](t)||Vn["CJK Compatibility"](t)||Vn["CJK Radicals Supplement"](t)||Vn["CJK Strokes"](t)||!(!Vn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Vn["CJK Unified Ideographs Extension A"](t)||Vn["CJK Unified Ideographs"](t)||Vn["Enclosed CJK Letters and Months"](t)||Vn["Hangul Compatibility Jamo"](t)||Vn["Hangul Jamo Extended-A"](t)||Vn["Hangul Jamo Extended-B"](t)||Vn["Hangul Jamo"](t)||Vn["Hangul Syllables"](t)||Vn.Hiragana(t)||Vn["Ideographic Description Characters"](t)||Vn.Kanbun(t)||Vn["Kangxi Radicals"](t)||Vn["Katakana Phonetic Extensions"](t)||Vn.Katakana(t)&&12540!==t||!(!Vn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Vn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Vn["Unified Canadian Aboriginal Syllabics"](t)||Vn["Unified Canadian Aboriginal Syllabics Extended"](t)||Vn["Vertical Forms"](t)||Vn["Yijing Hexagram Symbols"](t)||Vn["Yi Syllables"](t)||Vn["Yi Radicals"](t))))}function Gn(t){return!(Zn(t)||function(t){return!!(Vn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Vn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Vn["Letterlike Symbols"](t)||Vn["Number Forms"](t)||Vn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Vn["Control Pictures"](t)&&9251!==t||Vn["Optical Character Recognition"](t)||Vn["Enclosed Alphanumerics"](t)||Vn["Geometric Shapes"](t)||Vn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Vn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Vn["CJK Symbols and Punctuation"](t)||Vn.Katakana(t)||Vn["Private Use Area"](t)||Vn["CJK Compatibility Forms"](t)||Vn["Small Form Variants"](t)||Vn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Wn(t){return t>=1424&&t<=2303||Vn["Arabic Presentation Forms-A"](t)||Vn["Arabic Presentation Forms-B"](t)}function Kn(t,e){return!(!e&&Wn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Vn.Khmer(t))}function Xn(t){for(var e=0,r=t;e-1&&(Yn="error"),Hn&&Hn(t)};function Qn(){ti.fire(new St("pluginStateChange",{pluginStatus:Yn,pluginURL:Jn}))}var ti=new Ot,ei=function(){return Yn},ri=function(){if("deferred"!==Yn||!Jn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Yn="loading",Qn(),Jn&&_t({url:Jn},(function(t){t?$n(t):(Yn="loaded",Qn())}))},ni={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Yn||null!=ni.applyArabicShaping},isLoading:function(){return"loading"===Yn},setState:function(t){Yn=t.pluginStatus,Jn=t.pluginURL},isParsed:function(){return null!=ni.applyArabicShaping&&null!=ni.processBidirectionalText&&null!=ni.processStyledBidirectionalText},getPluginURL:function(){return Jn}},ii=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Un,this.transition={})};ii.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var oi=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(zr(t))return new Kr(t,e);if(Vr(t)){var r=Wr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=Jt.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};oi.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},oi.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var ai=function(t){this.property=t,this.value=new oi(t,void 0)};ai.prototype.transitioned=function(t,e){return new ui(this.property,this.value,e,p({},t.transition,this.transition),t.now)},ai.prototype.untransitioned=function(){return new ui(this.property,this.value,null,{},0)};var si=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};si.prototype.getValue=function(t){return b(this._values[t].value.value)},si.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ai(this._values[t].property)),this._values[t].value=new oi(this._values[t].property,null===e?void 0:b(e))},si.prototype.getTransition=function(t){return b(this._values[t].transition)},si.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ai(this._values[t].property)),this._values[t].transition=b(e)||void 0},si.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return i};var ci=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};ci.prototype.possiblyEvaluate=function(t,e,r){for(var n=new fi(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(di),yi=function(t){this.specification=t};yi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new ii(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ii(Math.floor(e.zoom),e)),t.expression.evaluate(new ii(Math.floor(e.zoom+1),e)),e)}},yi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},yi.prototype.interpolate=function(t){return t};var vi=function(t){this.specification=t};vi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},vi.prototype.interpolate=function(){return!1};var gi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new oi(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new ai(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Ln("DataDrivenProperty",di),Ln("DataConstantProperty",hi),Ln("CrossFadedDataDrivenProperty",mi),Ln("CrossFadedProperty",yi),Ln("ColorRampProperty",vi);var _i=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new li(r.layout)),r.paint)){for(var n in this._transitionablePaint=new si(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new fi(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(kn,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return v(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(An,"layers."+this.id+".paint."+t,t,e,r))return!1;if(v(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),_(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&In(this,t.call(On,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Tt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof pi&&Cr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Ot),bi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},xi=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},wi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Si(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=bi[t.type].BYTES_PER_ELEMENT,o=r=Ei(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Ei(r,Math.max(n,e)),alignment:e}}function Ei(t,e){return Math.ceil(t/e)*e}wi.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},wi.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},wi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},wi.prototype.clear=function(){this.length=0},wi.prototype.resize=function(t){this.reserve(t),this.length=t},wi.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},wi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(wi);Oi.prototype.bytesPerElement=4,Ln("StructArrayLayout2i4",Oi);var Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(wi);Ti.prototype.bytesPerElement=8,Ln("StructArrayLayout4i8",Ti);var Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(wi);Ai.prototype.bytesPerElement=12,Ln("StructArrayLayout2i4i12",Ai);var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(wi);ki.prototype.bytesPerElement=8,Ln("StructArrayLayout2i4ub8",ki);var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u,c)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l){var p=10*t;return this.uint16[p+0]=e,this.uint16[p+1]=r,this.uint16[p+2]=n,this.uint16[p+3]=i,this.uint16[p+4]=o,this.uint16[p+5]=a,this.uint16[p+6]=s,this.uint16[p+7]=u,this.uint16[p+8]=c,this.uint16[p+9]=l,t},e}(wi);Ii.prototype.bytesPerElement=20,Ln("StructArrayLayout10ui20",Ii);var Ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,p){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,o,a,s,u,c,l,p)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,p,f){var h=12*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=i,this.uint16[h+4]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=u,this.int16[h+8]=c,this.int16[h+9]=l,this.int16[h+10]=p,this.int16[h+11]=f,t},e}(wi);Ci.prototype.bytesPerElement=24,Ln("StructArrayLayout4i4ui4i24",Ci);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(wi);Pi.prototype.bytesPerElement=12,Ln("StructArrayLayout3f12",Pi);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(wi);ji.prototype.bytesPerElement=4,Ln("StructArrayLayout1ul4",ji);var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c){var l=10*t,p=5*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+3]=i,this.int16[l+4]=o,this.int16[l+5]=a,this.uint32[p+3]=s,this.uint16[l+8]=u,this.uint16[l+9]=c,t},e}(wi);Mi.prototype.bytesPerElement=20,Ln("StructArrayLayout6i1ul2ui20",Mi);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(wi);zi.prototype.bytesPerElement=12,Ln("StructArrayLayout2i2i2i12",zi);var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(wi);Li.prototype.bytesPerElement=16,Ln("StructArrayLayout2f1f2i16",Li);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(wi);Ri.prototype.bytesPerElement=12,Ln("StructArrayLayout2ub2f12",Ri);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(wi);Di.prototype.bytesPerElement=6,Ln("StructArrayLayout3ui6",Di);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,p,f,h,d,m,y){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,o,a,s,u,c,l,p,f,h,d,m,y)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,p,f,h,d,m,y,v){var g=24*t,_=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[_+2]=o,this.uint32[_+3]=a,this.uint32[_+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=c,this.uint16[g+12]=l,this.float32[_+7]=p,this.float32[_+8]=f,this.uint8[b+36]=h,this.uint8[b+37]=d,this.uint8[b+38]=m,this.uint32[_+10]=y,this.int16[g+22]=v,t},e}(wi);Fi.prototype.bytesPerElement=48,Ln("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Fi);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,p,f,h,d,m,y,v,g,_,b,x,w,S,E,O,T,A){var k=this.length;return this.resize(k+1),this.emplace(k,t,e,r,n,i,o,a,s,u,c,l,p,f,h,d,m,y,v,g,_,b,x,w,S,E,O,T,A)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,p,f,h,d,m,y,v,g,_,b,x,w,S,E,O,T,A,k){var I=34*t,C=17*t;return this.int16[I+0]=e,this.int16[I+1]=r,this.int16[I+2]=n,this.int16[I+3]=i,this.int16[I+4]=o,this.int16[I+5]=a,this.int16[I+6]=s,this.int16[I+7]=u,this.uint16[I+8]=c,this.uint16[I+9]=l,this.uint16[I+10]=p,this.uint16[I+11]=f,this.uint16[I+12]=h,this.uint16[I+13]=d,this.uint16[I+14]=m,this.uint16[I+15]=y,this.uint16[I+16]=v,this.uint16[I+17]=g,this.uint16[I+18]=_,this.uint16[I+19]=b,this.uint16[I+20]=x,this.uint16[I+21]=w,this.uint16[I+22]=S,this.uint32[C+12]=E,this.float32[C+13]=O,this.float32[C+14]=T,this.float32[C+15]=A,this.float32[C+16]=k,t},e}(wi);Bi.prototype.bytesPerElement=68,Ln("StructArrayLayout8i15ui1ul4f68",Bi);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(wi);Ni.prototype.bytesPerElement=4,Ln("StructArrayLayout1f4",Ni);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(wi);Ui.prototype.bytesPerElement=6,Ln("StructArrayLayout3i6",Ui);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(wi);Vi.prototype.bytesPerElement=8,Ln("StructArrayLayout1ul2ui8",Vi);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(wi);qi.prototype.bytesPerElement=4,Ln("StructArrayLayout2ui4",qi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(wi);Zi.prototype.bytesPerElement=2,Ln("StructArrayLayout1ui2",Zi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(wi);Gi.prototype.bytesPerElement=8,Ln("StructArrayLayout2f8",Gi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(wi);Wi.prototype.bytesPerElement=16,Ln("StructArrayLayout4f16",Wi);var Ki=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(xi);Ki.prototype.size=20;var Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ki(this,t)},e}(Mi);Ln("CollisionBoxArray",Xi);var Hi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(xi);Hi.prototype.size=48;var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Hi(this,t)},e}(Fi);Ln("PlacedSymbolArray",Yi);var Ji=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(xi);Ji.prototype.size=68;var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ji(this,t)},e}(Bi);Ln("SymbolInstanceArray",$i);var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Ni);Ln("GlyphOffsetArray",Qi);var to=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ui);Ln("SymbolLineVertexArray",to);var eo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(xi);eo.prototype.size=8;var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new eo(this,t)},e}(Vi);Ln("FeatureIndexArray",ro);var no=Si([{name:"a_pos",components:2,type:"Int16"}],4).members,io=function(t){void 0===t&&(t=[]),this.segments=t};function oo(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}io.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>io.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+io.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>io.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},io.prototype.get=function(){return this.segments},io.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(c)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.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}})),uo=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.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&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),co=so,lo=uo;co.murmur3=so,co.murmur2=lo;var po=function(){this.ids=[],this.positions=[],this.indexed=!1};po.prototype.add=function(t,e,r,n){this.ids.push(ho(t)),this.positions.push(e,r,n)},po.prototype.getPositions=function(t){for(var e=ho(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},po.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n>1],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;mo(e,a,s),mo(r,3*a,3*s),mo(r,3*a+1,3*s+1),mo(r,3*a+2,3*s+2)}s-na.x+1||ua.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Fo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Bo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Oi,this.indexArray=new Di,this.segments=new io,this.programConfigurations=new jo(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function No(t,e){for(var r=0;r1){if(Zo(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Xo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function Ho(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Yo(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var o=S(t,e,r[0]);return o!==S(t,e,r[1])||o!==S(t,e,r[2])||o!==S(t,e,r[3])}function Jo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function $o(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Qo(t,e,r,n,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===r&&a._rotate(-n);for(var s=[],u=0;u=8192||l<0||l>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),f=p.vertexLength;Fo(this.layoutVertexArray,c,l,-1,-1),Fo(this.layoutVertexArray,c,l,1,-1),Fo(this.layoutVertexArray,c,l,1,1),Fo(this.layoutVertexArray,c,l,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Ln("CircleBucket",Bo,{omit:["layers"]});var ta=new gi({"circle-sort-key":new di(Tt.layout_circle["circle-sort-key"])}),ea={paint:new gi({"circle-radius":new di(Tt.paint_circle["circle-radius"]),"circle-color":new di(Tt.paint_circle["circle-color"]),"circle-blur":new di(Tt.paint_circle["circle-blur"]),"circle-opacity":new di(Tt.paint_circle["circle-opacity"]),"circle-translate":new hi(Tt.paint_circle["circle-translate"]),"circle-translate-anchor":new hi(Tt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new hi(Tt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new hi(Tt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new di(Tt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new di(Tt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new di(Tt.paint_circle["circle-stroke-opacity"])}),layout:ta},ra="undefined"!=typeof Float32Array?Float32Array:Array;function na(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ia(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],p=e[8],f=e[9],h=e[10],d=e[11],m=e[12],y=e[13],v=e[14],g=e[15],_=r[0],b=r[1],x=r[2],w=r[3];return t[0]=_*n+b*s+x*p+w*m,t[1]=_*i+b*u+x*f+w*y,t[2]=_*o+b*c+x*h+w*v,t[3]=_*a+b*l+x*d+w*g,t[4]=(_=r[4])*n+(b=r[5])*s+(x=r[6])*p+(w=r[7])*m,t[5]=_*i+b*u+x*f+w*y,t[6]=_*o+b*c+x*h+w*v,t[7]=_*a+b*l+x*d+w*g,t[8]=(_=r[8])*n+(b=r[9])*s+(x=r[10])*p+(w=r[11])*m,t[9]=_*i+b*u+x*f+w*y,t[10]=_*o+b*c+x*h+w*v,t[11]=_*a+b*l+x*d+w*g,t[12]=(_=r[12])*n+(b=r[13])*s+(x=r[14])*p+(w=r[15])*m,t[13]=_*i+b*u+x*f+w*y,t[14]=_*o+b*c+x*h+w*v,t[15]=_*a+b*l+x*d+w*g,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var oa,aa=ia;function sa(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}oa=new ra(3),ra!=Float32Array&&(oa[0]=0,oa[1]=0,oa[2]=0),function(){var t=new ra(4);ra!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var ua=(function(){var t=new ra(2);ra!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,ea)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Bo(t)},e.prototype.queryRadius=function(t){var e=t;return Jo("circle-radius",this,e)+Jo("circle-stroke-width",this,e)+$o(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=Qo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),l="map"===this.paint.get("circle-pitch-alignment"),p=l?u:function(t,e){return t.map((function(t){return ca(t,e)}))}(u,s),f=l?c*a:c,h=0,d=n;ht.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u80*r){n=o=t[0],i=a=t[1];for(var d=r;do&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-n,a-i))?1/c:0}return Aa(f,h,r,n,i,c),h}function Oa(t,e,r,n,i){var o,a;if(i===Ha(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Wa(o,t[o],t[o+1],a);return a&&Na(a,a.next)&&(Ka(a),a=a.next),a}function Ta(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Na(n,n.next)&&0!==Ba(n.prev,n,n.next))n=n.next;else{if(Ka(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Aa(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=La(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Ia(t,n,i,o):ka(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Ka(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?Aa(t=Ca(Ta(t),e,r),e,r,n,i,o,2):2===a&&Pa(t,e,r,n,i,o):Aa(Ta(t),e,r,n,i,o,1);break}}}function ka(t){var e=t.prev,r=t,n=t.next;if(Ba(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Da(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Ba(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ia(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Ba(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,c=La(i.x=c&&f&&f.z<=l;){if(p!==t.prev&&p!==t.next&&Da(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ba(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&Da(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ba(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&Da(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ba(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=l;){if(f!==t.prev&&f!==t.next&&Da(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ba(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Ca(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Na(i,o)&&Ua(i,n,n.next,o)&&Za(i,o)&&Za(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Ka(n),Ka(n.next),n=t=o),n=n.next}while(n!==t);return Ta(n)}function Pa(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Fa(a,s)){var u=Ga(a,s);return a=Ta(a,a.next),u=Ta(u,u.next),Aa(a,e,r,n,i,o),void Aa(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function ja(t,e){return t.x-e.x}function Ma(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&&Da(or.x||n.x===r.x&&za(r,n)))&&(r=n,f=u)),n=n.next}while(n!==c);return r}(t,e)){var r=Ga(e,t);Ta(e,e.next),Ta(r,r.next)}}function za(t,e){return Ba(t.prev,t,e.prev)<0&&Ba(e.next,t,t.next)<0}function La(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ra(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function Fa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Ua(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Za(t,e)&&Za(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.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!==t);return n}(t,e)&&(Ba(t.prev,t,e.prev)||Ba(t,e.prev,e))||Na(t,e)&&Ba(t.prev,t,t.next)>0&&Ba(e.prev,e,e.next)>0)}function Ba(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Na(t,e){return t.x===e.x&&t.y===e.y}function Ua(t,e,r,n){var i=qa(Ba(t,e,r)),o=qa(Ba(t,e,n)),a=qa(Ba(r,n,t)),s=qa(Ba(r,n,e));return i!==o&&a!==s||!(0!==i||!Va(t,r,e))||!(0!==o||!Va(t,n,e))||!(0!==a||!Va(r,t,n))||!(0!==s||!Va(r,e,n))}function Va(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function qa(t){return t>0?1:t<0?-1:0}function Za(t,e){return Ba(t.prev,t,t.next)<0?Ba(t,e,t.next)>=0&&Ba(t,t.prev,e)>=0:Ba(t,e,t.prev)<0||Ba(t,t.next,e)<0}function Ga(t,e){var r=new Xa(t.i,t.x,t.y),n=new Xa(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Wa(t,e,r,n){var i=new Xa(t,e,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 Ka(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Xa(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ha(t,e,r,n){for(var i=0,o=e,a=r-n;on;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*c/a+l)),Math.min(i,Math.floor(r+(a-s)*c/a+l)),o)}var p=e[r],f=n,h=i;for(Ja(e,n,r),o(e[i],p)>0&&Ja(e,n,i);f0;)h--}0===o(e[n],p)?Ja(e,n,h):Ja(e,++h,i),h<=r&&(n=h+1),r<=h&&(i=h-1)}}(t,e,r||0,n||t.length-1,i||$a)}function Ja(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function $a(t,e){return te?1:0}function Qa(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},wa.default=Sa;var ns=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Oi,this.indexArray=new Di,this.indexArray2=new qi,this.programConfigurations=new jo(t.layers,t.zoom),this.segments=new io,this.segments2=new io,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ns.prototype.populate=function(t,e,r){this.hasPattern=es("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(o--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},cs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,c]},cs.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),c=cs.types[this.type];function l(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function ms(t,e,r){if(3===t){var n=new fs(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}hs.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new us(this._pbf,e,this.extent,this._keys,this._values)};var ys={VectorTile:function(t,e){this.layers=t.readFields(ms,{},e)},VectorTileFeature:us,VectorTileLayer:fs},vs=ys.VectorTileFeature.types,gs=Math.pow(2,13);function _s(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*gs)+a,i*gs*2,o*gs*2,Math.round(s))}var bs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ai,this.indexArray=new Di,this.programConfigurations=new jo(t.layers,t.zoom),this.segments=new io,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function xs(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}bs.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=es("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||j.every((function(t){return t.y<0}))||j.every((function(t){return t.y>8192}))))for(var m=0,y=0;y=1){var g=d[y-1];if(!xs(v,g)){p.vertexLength+4>io.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=v.sub(g)._perp()._unit(),b=g.dist(v);m+b>32768&&(m=0),_s(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,m),_s(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,m),_s(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,0,m+=b),_s(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,1,m);var x=p.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+u>io.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===vs[t.type]){for(var w=[],S=[],E=p.vertexLength,O=0,T=s;O=2&&t[u-1].equals(t[u-2]);)u--;for(var c=0;c0;if(S&&v>c){var O=l.dist(h);if(O>2*p){var T=l.sub(l.sub(h)._mult(p/O)._round());this.updateDistance(h,T),this.addCurrentVertex(T,m,0,0,f),h=T}}var A=h&&d,k=A?r:s?"butt":n;if(A&&"round"===k&&(xi&&(k="bevel"),"bevel"===k&&(x>2&&(k="flipbevel"),x100)g=y.mult(-1);else{var I=x*m.add(y).mag()/m.sub(y).mag();g._perp()._mult(I*(E?-1:1))}this.addCurrentVertex(l,g,0,0,f),this.addCurrentVertex(l,g.mult(-1),0,0,f)}else if("bevel"===k||"fakeround"===k){var C=-Math.sqrt(x*x-1),P=E?C:0,j=E?0:C;if(h&&this.addCurrentVertex(l,m,P,j,f),"fakeround"===k)for(var M=Math.round(180*w/Math.PI/20),z=1;z2*p){var N=l.add(d.sub(l)._mult(p/B)._round());this.updateDistance(l,N),this.addCurrentVertex(N,y,0,0,f),l=N}}}}},Cs.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>Is/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Cs.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Cs.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Is-1):this.distance},Cs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Ln("LineBucket",Cs,{omit:["layers","patternFeatures"]});var Ps=new gi({"line-cap":new hi(Tt.layout_line["line-cap"]),"line-join":new di(Tt.layout_line["line-join"]),"line-miter-limit":new hi(Tt.layout_line["line-miter-limit"]),"line-round-limit":new hi(Tt.layout_line["line-round-limit"]),"line-sort-key":new di(Tt.layout_line["line-sort-key"])}),js={paint:new gi({"line-opacity":new di(Tt.paint_line["line-opacity"]),"line-color":new di(Tt.paint_line["line-color"]),"line-translate":new hi(Tt.paint_line["line-translate"]),"line-translate-anchor":new hi(Tt.paint_line["line-translate-anchor"]),"line-width":new di(Tt.paint_line["line-width"]),"line-gap-width":new di(Tt.paint_line["line-gap-width"]),"line-offset":new di(Tt.paint_line["line-offset"]),"line-blur":new di(Tt.paint_line["line-blur"]),"line-dasharray":new yi(Tt.paint_line["line-dasharray"]),"line-pattern":new mi(Tt.paint_line["line-pattern"]),"line-gradient":new vi(Tt.paint_line["line-gradient"])}),layout:Ps},Ms=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new ii(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(di))(js.paint.properties["line-width"].specification);Ms.useIntegerZoom=!0;var zs=function(t){function e(e){t.call(this,e,js)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){this.gradient=va(this._transitionablePaint._values["line-gradient"].value.expression,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Ms.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Cs(t)},e.prototype.queryRadius=function(t){var e=t,r=Ls(Jo("line-width",this,e),Jo("line-gap-width",this,e)),n=Jo("line-offset",this,e);return r/2+Math.abs(n)+$o(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s){var u=Qo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*Ls(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(n=function(t,e){for(var r=[],n=new i(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var Rs=Si([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ds=Si([{name:"a_projected_pos",components:3,type:"Float32"}],4),Fs=(Si([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Si([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Bs=(Si([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Si([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ns=Si([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Us(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ni.applyArabicShaping&&(t=ni.applyArabicShaping(t)),t}(t.text,e,r)})),t}Si([{name:"triangle",components:3,type:"Uint16"}]),Si([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Si([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Si([{type:"Float32",name:"offsetX"}]),Si([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Vs={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},qs=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,p=r?i-1:0,f=r?-1:1,h=t[e+p];for(p+=f,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+t[e+p],p+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+p],p+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},Zs=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+p>=1?f/u:f*Math.pow(2,1-p))*u>=2&&(a++,u/=2),a+p>=l?(s=0,a=l):a+p>=1?(s=(e*u-1)*Math.pow(2,i),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+h]=255&s,h+=d,s/=256,i-=8);for(a=a<0;t[r+h]=255&a,h+=d,a/=256,c-=8);t[r+h-d]|=128*m},Gs=Ws;function Ws(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ws.Varint=0,Ws.Fixed64=1,Ws.Bytes=2,Ws.Fixed32=5;var Ks="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Xs(t){return t.type===Ws.Bytes?t.readVarint()+t.pos:t.pos+1}function Hs(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ys(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Js(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function uu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function cu(t,e,r){1===t&&r.readMessage(lu,e)}function lu(t,e,r){if(3===t){var n=r.readMessage(pu,{}),i=n.width,o=n.height,a=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new da({width:i+6,height:o+6},n.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function pu(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function fu(t){for(var e=0,r=0,n=0,i=t;n=0;f--){var h=a[f];if(!(p.w>h.w||p.h>h.h)){if(p.x=h.x,p.y=h.y,u=Math.max(u,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===h.w&&p.h===h.h){var d=a.pop();f>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=au(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=uu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=au(this.buf,this.pos)+4294967296*au(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=au(this.buf,this.pos)+4294967296*uu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=qs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=qs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return Hs(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return Hs(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return Hs(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return Hs(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return Hs(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return Hs(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ks?function(t,e,r){return Ks.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ws.Bytes)return t.push(this.readVarint(e));var r=Xs(this);for(t=t||[];this.pos127;);else if(e===Ws.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ws.Fixed32)this.pos+=4;else{if(e!==Ws.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Ys(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Zs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Zs(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Ys(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Ws.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Js,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,$s,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,eu,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Qs,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,tu,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ou,e)},writeBytesField:function(t,e){this.writeTag(t,Ws.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ws.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ws.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ws.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ws.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ws.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ws.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ws.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ws.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ws.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var hu=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},du={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};du.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},du.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},du.tlbr.get=function(){return this.tl.concat(this.br)},du.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(hu.prototype,du);var mu=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=fu(i),a=new ma({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],c=r[s].paddedRect;ma.copy(u.data,a,{x:0,y:0},{x:c.x+1,y:c.y+1},u.data)}for(var l in e){var p=e[l],f=n[l].paddedRect,h=f.x+1,d=f.y+1,m=p.data.width,y=p.data.height;ma.copy(p.data,a,{x:0,y:0},{x:h,y:d},p.data),ma.copy(p.data,a,{x:0,y:y-1},{x:h,y:d-1},{width:m,height:1}),ma.copy(p.data,a,{x:0,y:0},{x:h,y:d+y},{width:m,height:1}),ma.copy(p.data,a,{x:m-1,y:0},{x:h-1,y:d},{width:1,height:y}),ma.copy(p.data,a,{x:0,y:0},{x:h+m,y:d},{width:1,height:y})}this.image=a,this.iconPositions=r,this.patternPositions=n};mu.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new hu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},mu.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},mu.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]})}},Ln("ImagePosition",hu),Ln("ImageAtlas",mu);var yu={horizontal:1,vertical:2,horizontalOnly:3},vu=function(){this.scale=1,this.fontStack="",this.imageName=null};vu.forText=function(t,e){var r=new vu;return r.scale=t||1,r.fontStack=e,r},vu.forImage=function(t){var e=new vu;return e.imageName=t,e};var gu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function _u(t,e,r,n,i,o,a,s,u,c,l,p,f,h,d,m){var y,v=gu.fromFeature(t,i);p===yu.vertical&&v.verticalizePunctuation();var g=ni.processBidirectionalText,_=ni.processStyledBidirectionalText;if(g&&1===v.sections.length){y=[];for(var b=0,x=g(v.toString(),Tu(v,c,o,e,n,h,d));b0&&F>O&&(O=F)}else{var B=r[A.fontStack],N=B&&B[I];if(N&&N.rect)j=N.rect,P=N.metrics;else{var U=e[A.fontStack],V=U&&U[I];if(!V)continue;P=V.metrics}C=24*(x-A.scale)}L?(t.verticalizable=!0,E.push({glyph:I,imageName:M,x:f,y:h+C,vertical:L,scale:A.scale,fontStack:A.fontStack,sectionIndex:k,metrics:P,rect:j}),f+=z*A.scale+c):(E.push({glyph:I,imageName:M,x:f,y:h+C,vertical:L,scale:A.scale,fontStack:A.fontStack,sectionIndex:k,metrics:P,rect:j}),f+=P.advance*A.scale+c)}0!==E.length&&(d=Math.max(f-c,d),ku(E,0,E.length-1,y,O)),f=0;var q=o*x+O;S.lineOffset=Math.max(O,w),h+=q,m=Math.max(q,m),++v}else h+=o,++v}var Z,G=h- -17,W=Au(a),K=W.horizontalAlign,X=W.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var c,l=(e-r)*i;c=o!==a?-s*n- -17:(-n*u+.5)*a;for(var p=0,f=t;p=0&&n>=t&&bu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},gu.prototype.substring=function(t,e){var r=new gu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},gu.prototype.toString=function(){return this.text},gu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},gu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(vu.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var bu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},xu={};function wu(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Su(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,p=0,f=0;f-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],c=0;sn;)c-=u.shift().angleDelta;if(c>i)return!1;a++,s+=l.dist(p)}return!0}function Ru(t){for(var e=0,r=0;rc){var d=(c-u)/h,m=Ue(p.x,f.x,d),y=Ue(p.y,f.y,d),v=new Cu(m,y,f.angleTo(p),l);return v._round(),!a||Lu(t,v,s,a,e)?v:void 0}u+=h}}function Nu(t,e,r,n,i,o,a,s,u){var c=Du(n,o,a),l=Fu(n,i),p=l*a,f=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-p=0&&x=0&&w=0&&h+l<=p){var S=new Cu(x,w,_,m);S._round(),i&&!Lu(e,S,a,i,o)||d.push(S)}}f+=g}return u||d.length||s||(d=t(e,f/2,n,i,o,a,s,!0,c)),d}(t,f?e/2*s%e:(l/2+2*o)*a*s%e,e,c,r,p,f,!1,u)}function Uu(t,e,r,n,o){for(var a=[],s=0;s=n&&f.x>=n||(p.x>=n?p=new i(n,p.y+(n-p.x)/(f.x-p.x)*(f.y-p.y))._round():f.x>=n&&(f=new i(n,p.y+(n-p.x)/(f.x-p.x)*(f.y-p.y))._round()),p.y>=o&&f.y>=o||(p.y>=o?p=new i(p.x+(o-p.y)/(f.y-p.y)*(f.x-p.x),o)._round():f.y>=o&&(f=new i(p.x+(o-p.y)/(f.y-p.y)*(f.x-p.x),o)._round()),c&&p.equals(c[c.length-1])||a.push(c=[p]),c.push(f)))))}return a}function Vu(t,e,r,n){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,c=a.paddedRect.h-2,l=t.right-t.left,p=t.bottom-t.top,f=a.stretchX||[[0,u]],h=a.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},m=f.reduce(d,0),y=h.reduce(d,0),v=u-m,g=c-y,_=0,b=m,x=0,w=y,S=0,E=v,O=0,T=g;if(a.content&&n){var A=a.content;_=qu(f,0,A[0]),x=qu(h,0,A[1]),b=qu(f,A[0],A[2]),w=qu(h,A[1],A[3]),S=A[0]-_,O=A[1]-x,E=A[2]-A[0]-b,T=A[3]-A[1]-w}var k=function(n,o,u,c){var f=Gu(n.stretch-_,b,l,t.left),h=Wu(n.fixed-S,E,n.stretch,m),d=Gu(o.stretch-x,w,p,t.top),v=Wu(o.fixed-O,T,o.stretch,y),g=Gu(u.stretch-_,b,l,t.left),A=Wu(u.fixed-S,E,u.stretch,m),k=Gu(c.stretch-x,w,p,t.top),I=Wu(c.fixed-O,T,c.stretch,y),C=new i(f,d),P=new i(g,d),j=new i(g,k),M=new i(f,k),z=new i(h/s,v/s),L=new i(A/s,I/s),R=e*Math.PI/180;if(R){var D=Math.sin(R),F=Math.cos(R),B=[F,-D,D,F];C._matMult(B),P._matMult(B),M._matMult(B),j._matMult(B)}var N=n.stretch+n.fixed,U=o.stretch+o.fixed;return{tl:C,tr:P,bl:M,br:j,tex:{x:a.paddedRect.x+1+N,y:a.paddedRect.y+1+U,w:u.stretch+u.fixed-N,h:c.stretch+c.fixed-U},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:L,minFontScaleX:E/s/l,minFontScaleY:T/s/p,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var I=Zu(f,v,m),C=Zu(h,g,y),P=0;P0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=a.top*s-u,y=a.bottom*s+u,v=a.left*s-u,g=a.right*s+u,_=a.collisionPadding;if(_&&(v-=_[0]*s,m-=_[1]*s,g+=_[2]*s,y+=_[3]*s),l){var b=new i(v,m),x=new i(g,m),w=new i(v,y),S=new i(g,y),E=l*Math.PI/180;b._rotate(E),x._rotate(E),w._rotate(E),S._rotate(E),v=Math.min(b.x,x.x,w.x,S.x),g=Math.max(b.x,x.x,w.x,S.x),m=Math.min(b.y,x.y,w.y,S.y),y=Math.max(b.y,x.y,w.y,S.y)}t.emplaceBack(e.x,e.y,v,m,g,y,r,n,o)}this.boxEndIndex=t.length},Xu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Hu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Hu(t,e){return te?1:0}function Yu(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],c=0;ca)&&(a=l.x),(!c||l.y>s)&&(s=l.y)}var p=Math.min(a-n,s-o),f=p/2,h=new Xu([],Ju);if(0===p)return new i(n,o);for(var d=n;dy.d||!y.d)&&(y=g,r&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-y.d<=e||(h.push(new $u(g.p.x-(f=g.h/2),g.p.y-f,f,t)),h.push(new $u(g.p.x+f,g.p.y-f,f,t)),h.push(new $u(g.p.x-f,g.p.y+f,f,t)),h.push(new $u(g.p.x+f,g.p.y+f,f,t)),v+=4)}return r&&(console.log("num probes: "+v),console.log("best distance: "+y.d)),y.p}function Ju(t,e){return e.max-t.max}function $u(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=l.y>t.y&&t.x<(l.x-c.x)*(t.y-c.y)/(l.y-c.y)+c.x&&(r=!r),n=Math.min(n,Ko(t,c,l))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Xu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Xu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Xu.prototype.peek=function(){return this.data[0]},Xu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},Xu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var Qu=Number.POSITIVE_INFINITY;function tc(t,e){return e[1]!==Qu?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function ec(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function rc(t,e,r,n,o,a,s,u,c,l,p,f,h,d,m){var y=function(t,e,r,n,o,a,s,u){for(var c=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,l=[],p=0,f=e.positionedLines;p32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((g=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||g[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,g,u,a,s,l,e,c.lineStartIndex,c.lineLength,h,m);for(var _=0,b=p;_=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,l=i.get("symbol-sort-key");if(this.features=[],u||c){for(var p=e.iconDependencies,f=e.glyphDependencies,h=e.availableImages,d=new ii(this.zoom),m=0,y=t;m=0;for(var M=0,z=E.sections;M=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u0},fc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},fc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},fc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},fc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},fc.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Ln("SymbolBucket",fc,{omit:["layers","collisionBoxArray","features","compareText"]}),fc.MAX_GLYPHS=65535,fc.addDynamicAttributes=uc;var hc=new gi({"symbol-placement":new hi(Tt.layout_symbol["symbol-placement"]),"symbol-spacing":new hi(Tt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new hi(Tt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new di(Tt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new hi(Tt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new hi(Tt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new hi(Tt.layout_symbol["icon-ignore-placement"]),"icon-optional":new hi(Tt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new hi(Tt.layout_symbol["icon-rotation-alignment"]),"icon-size":new di(Tt.layout_symbol["icon-size"]),"icon-text-fit":new hi(Tt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new hi(Tt.layout_symbol["icon-text-fit-padding"]),"icon-image":new di(Tt.layout_symbol["icon-image"]),"icon-rotate":new di(Tt.layout_symbol["icon-rotate"]),"icon-padding":new hi(Tt.layout_symbol["icon-padding"]),"icon-keep-upright":new hi(Tt.layout_symbol["icon-keep-upright"]),"icon-offset":new di(Tt.layout_symbol["icon-offset"]),"icon-anchor":new di(Tt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new hi(Tt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new hi(Tt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new hi(Tt.layout_symbol["text-rotation-alignment"]),"text-field":new di(Tt.layout_symbol["text-field"]),"text-font":new di(Tt.layout_symbol["text-font"]),"text-size":new di(Tt.layout_symbol["text-size"]),"text-max-width":new di(Tt.layout_symbol["text-max-width"]),"text-line-height":new hi(Tt.layout_symbol["text-line-height"]),"text-letter-spacing":new di(Tt.layout_symbol["text-letter-spacing"]),"text-justify":new di(Tt.layout_symbol["text-justify"]),"text-radial-offset":new di(Tt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new hi(Tt.layout_symbol["text-variable-anchor"]),"text-anchor":new di(Tt.layout_symbol["text-anchor"]),"text-max-angle":new hi(Tt.layout_symbol["text-max-angle"]),"text-writing-mode":new hi(Tt.layout_symbol["text-writing-mode"]),"text-rotate":new di(Tt.layout_symbol["text-rotate"]),"text-padding":new hi(Tt.layout_symbol["text-padding"]),"text-keep-upright":new hi(Tt.layout_symbol["text-keep-upright"]),"text-transform":new di(Tt.layout_symbol["text-transform"]),"text-offset":new di(Tt.layout_symbol["text-offset"]),"text-allow-overlap":new hi(Tt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new hi(Tt.layout_symbol["text-ignore-placement"]),"text-optional":new hi(Tt.layout_symbol["text-optional"])}),dc={paint:new gi({"icon-opacity":new di(Tt.paint_symbol["icon-opacity"]),"icon-color":new di(Tt.paint_symbol["icon-color"]),"icon-halo-color":new di(Tt.paint_symbol["icon-halo-color"]),"icon-halo-width":new di(Tt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new di(Tt.paint_symbol["icon-halo-blur"]),"icon-translate":new hi(Tt.paint_symbol["icon-translate"]),"icon-translate-anchor":new hi(Tt.paint_symbol["icon-translate-anchor"]),"text-opacity":new di(Tt.paint_symbol["text-opacity"]),"text-color":new di(Tt.paint_symbol["text-color"],{runtimeType:Ft,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new di(Tt.paint_symbol["text-halo-color"]),"text-halo-width":new di(Tt.paint_symbol["text-halo-width"]),"text-halo-blur":new di(Tt.paint_symbol["text-halo-blur"]),"text-translate":new hi(Tt.paint_symbol["text-translate"]),"text-translate-anchor":new hi(Tt.paint_symbol["text-translate-anchor"])}),layout:hc},mc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:zt,this.defaultValue=t};mc.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},mc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},mc.prototype.outputDefined=function(){return!1},mc.prototype.serialize=function(){return null},Ln("FormatSectionOverride",mc,{omit:["defaultValue"]});var yc=function(t){function e(e){t.call(this,e,dc)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"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")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;o",targetMapId:n,sourceMapId:o.mapId})}}},Cc.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else O()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Cc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Cc.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Nn(e.error)):n(null,Nn(e.data)))}else{var i=!1,o=k(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?Bn(e):null,data:Bn(n,o)},o)}:function(t){i=!0},s=null,u=Nn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],u.source)[c[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Cc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var jc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};jc.prototype.setNorthEast=function(t){return this._ne=t instanceof Mc?new Mc(t.lng,t.lat):Mc.convert(t),this},jc.prototype.setSouthWest=function(t){return this._sw=t instanceof Mc?new Mc(t.lng,t.lat):Mc.convert(t),this},jc.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Mc)e=t,r=t;else{if(!(t instanceof jc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(jc.convert(t)):this.extend(Mc.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Mc(e.lng,e.lat),this._ne=new Mc(r.lng,r.lat)),this},jc.prototype.getCenter=function(){return new Mc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},jc.prototype.getSouthWest=function(){return this._sw},jc.prototype.getNorthEast=function(){return this._ne},jc.prototype.getNorthWest=function(){return new Mc(this.getWest(),this.getNorth())},jc.prototype.getSouthEast=function(){return new Mc(this.getEast(),this.getSouth())},jc.prototype.getWest=function(){return this._sw.lng},jc.prototype.getSouth=function(){return this._sw.lat},jc.prototype.getEast=function(){return this._ne.lng},jc.prototype.getNorth=function(){return this._ne.lat},jc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},jc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},jc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},jc.prototype.contains=function(t){var e=Mc.convert(t),r=e.lng,n=e.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},jc.convert=function(t){return!t||t instanceof jc?t:new jc(t)};var Mc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Mc.prototype.wrap=function(){return new Mc(l(this.lng,-180,180),this.lat)},Mc.prototype.toArray=function(){return[this.lng,this.lat]},Mc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Mc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},Mc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new jc(new Mc(this.lng-r,this.lat-e),new Mc(this.lng+r,this.lat+e))},Mc.convert=function(t){if(t instanceof Mc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Mc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Mc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var zc=2*Math.PI*6371008.8;function Lc(t){return zc*Math.cos(t*Math.PI/180)}function Rc(t){return(180+t)/360}function Dc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Fc(t,e){return t/Lc(e)}function Bc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Nc=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Nc.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Mc.convert(t);return new Nc(Rc(r.lng),Dc(r.lat),Fc(e,r.lat))},Nc.prototype.toLngLat=function(){return new Mc(360*this.x-180,Bc(this.y))},Nc.prototype.toAltitude=function(){return this.z*Lc(Bc(this.y))},Nc.prototype.meterInMercatorCoordinateUnits=function(){return 1/zc*(t=Bc(this.y),1/Math.cos(t*Math.PI/180));var t};var Uc=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Zc(0,t,t,e,r)};Uc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Uc.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=Pc(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=Pc(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<this.canonical.z?new qc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new qc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},qc.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Zc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Zc(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},qc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},qc.prototype.children=function(t){if(this.overscaledZ>=t)return[new qc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new qc(e,this.wrap,e,r,n),new qc(e,this.wrap,e,r+1,n),new qc(e,this.wrap,e,r,n+1),new qc(e,this.wrap,e,r+1,n+1)]},qc.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Gc.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Gc.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Gc.prototype.getPixels=function(){return new ma({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Gc.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,c=o;c=0&&l[3]>=0&&s.insert(a,l[0],l[1],l[2],l[3])}},Yc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ys.VectorTile(new Gs(this.rawTileData)).layers,this.sourceLayerCoder=new Wc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Yc.prototype.query=function(t,e,r,n){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=rn(a.filter),c=t.queryGeometry,l=t.queryPadding*s,p=$c(c),f=this.grid.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l),h=$c(t.cameraQueryGeometry),d=0,m=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,(function(e,r,n,o){return function(t,e,r,n,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var c=[new i(e,r),new i(e,o),new i(n,o),new i(n,r)];if(t.length>2)for(var l=0,p=c;l=0)return!0;return!1}(o,p)){var f=this.sourceLayerCoder.decode(r),h=this.vtLayers[f].feature(n);if(i.filter(new ii(this.tileID.overscaledZ),h))for(var d=this.getId(h,f),m=0;mn)i=!1;else if(e)if(this.expirationTimest&&(t.getActor().send("enforceCacheSizeLimit",at),pt=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Uu,t.clone=function(t){var e=new ra(16);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},t.clone$1=b,t.clone$2=function(t){var e=new ra(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Ns,t.config=F,t.create=function(){var t=new ra(16);return ra!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new ra(9);return ra!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new ra(4);return ra!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=qr,t.createLayout=Si,t.createStyleLayer=function(t){return"custom"===t.type?new xc(t):new wc[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n=F.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:e,callback:r,cancelled:!1,cancel:function(){this.cancelled=!0}};return dt.push(n),n}mt++;var i=!1,o=function(){if(!i)for(i=!0,mt--;dt.length&&mt0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ue,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new Gs(t).readFields(cu,[])},t.pbf=Gs,t.performSymbolLayout=function(t,e,r,n,i,o,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var l=t.textSizeData,p=l.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new ii(l.minZoom),a),u["text-size"].possiblyEvaluate(new ii(p),a)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,h=f.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new ii(f.minZoom),a),u["icon-size"].possiblyEvaluate(new ii(h),a)]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new ii(t.zoom+1),a),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new ii(t.zoom+1),a),c.textMaxSize=u["text-size"].possiblyEvaluate(new ii(18));for(var d=24*s.get("text-line-height"),m="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),y=s.get("text-keep-upright"),v=s.get("text-size"),g=function(){var o=b[_],u=s.get("text-font").evaluate(o,{},a).join(","),l=v.evaluate(o,{},a),p=c.layoutTextSize.evaluate(o,{},a),f=c.layoutIconSize.evaluate(o,{},a),h={horizontal:{},vertical:void 0},g=o.text,x=[0,0];if(g){var S=g.toString(),E=24*s.get("text-letter-spacing").evaluate(o,{},a),O=function(t){for(var e=0,r=t;e=8192||p.y<0||p.y>=8192||function(t,e,r,n,i,o,a,s,u,c,l,p,f,h,d,m,y,v,g,_,b,x,S,E,O){var T,A,k,I,C,P=t.addToLineVertexArray(e,r),j=0,M=0,z=0,L=0,R=-1,D=-1,F={},B=co(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(T=s.layout.get("text-offset").evaluate(b,{},E).map((function(t){return 24*t})))[0],U=T[1]):(N=24*s.layout.get("text-radial-offset").evaluate(b,{},E),U=Qu),t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(b,{},E)+90;I=new Ku(u,e,c,l,p,n.vertical,f,h,d,V),a&&(C=new Ku(u,e,c,l,p,a,y,v,d,V))}if(i){var q=s.layout.get("icon-rotate").evaluate(b,{}),Z="none"!==s.layout.get("icon-text-fit"),G=Vu(i,q,S,Z),W=a?Vu(a,q,S,Z):void 0;k=new Ku(u,e,c,l,p,i,y,v,!1,q),j=4*G.length;var K=t.iconSizeData,X=null;"source"===K.kind?(X=[128*s.layout.get("icon-size").evaluate(b,{})])[0]>32640&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===K.kind&&((X=[128*x.compositeIconSizes[0].evaluate(b,{},E),128*x.compositeIconSizes[1].evaluate(b,{},E)])[0]>32640||X[1]>32640)&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,X,_,g,b,!1,e,P.lineStartIndex,P.lineLength,-1,E),R=t.icon.placedSymbolArray.length-1,W&&(M=4*W.length,t.addSymbols(t.icon,W,X,_,g,b,yu.vertical,e,P.lineStartIndex,P.lineLength,-1,E),D=t.icon.placedSymbolArray.length-1)}for(var H in n.horizontal){var Y=n.horizontal[H];if(!A){B=co(Y.text);var J=s.layout.get("text-rotate").evaluate(b,{},E);A=new Ku(u,e,c,l,p,Y,f,h,d,J)}var $=1===Y.positionedLines.length;if(z+=rc(t,e,Y,o,s,d,b,m,P,n.vertical?yu.horizontal:yu.horizontalOnly,$?Object.keys(n.horizontal):[H],F,R,x,E),$)break}n.vertical&&(L+=rc(t,e,n.vertical,o,s,d,b,m,P,yu.vertical,["vertical"],F,D,x,E));var Q=A?A.boxStartIndex:t.collisionBoxArray.length,tt=A?A.boxEndIndex:t.collisionBoxArray.length,et=I?I.boxStartIndex:t.collisionBoxArray.length,rt=I?I.boxEndIndex:t.collisionBoxArray.length,nt=k?k.boxStartIndex:t.collisionBoxArray.length,it=k?k.boxEndIndex:t.collisionBoxArray.length,ot=C?C.boxStartIndex:t.collisionBoxArray.length,at=C?C.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(A,st),st=ut(I,st),st=ut(k,st);var ct=(st=ut(C,st))>-1?1:0;ct&&(st*=O/24),t.glyphOffsetArray.length>=fc.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,R,D,B,Q,tt,et,rt,nt,it,ot,at,c,z,L,j,M,ct,0,f,N,U,st)}(t,p,s,r,n,i,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,x,O,u,_,S,T,d,e,o,c,l,a)};if("line"===A)for(var P=0,j=Uu(e.geometry,0,0,8192,8192);P1){var N=Bu(B,E,r.vertical||m,n,24,g);N&&C(B,N)}}else if("Polygon"===e.type)for(var U=0,V=Qa(e.geometry,0);U=k.maxzoom||"none"!==k.visibility&&(a(A,this.zoom,n),(m[k.id]=k.createBucket({index:l.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(x,y,this.tileID.canonical),l.bucketLayerIDs.push(A.map((function(t){return t.id}))))}}}var I=t.mapObject(y.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(I).length?o.send("getGlyphs",{uid:this.uid,stacks:I},(function(t,e){p||(p=t,f=e,j.call(u))})):f={};var C=Object.keys(y.iconDependencies);C.length?o.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){p||(p=t,h=e,j.call(u))})):h={};var P=Object.keys(y.patternDependencies);function j(){if(p)return s(p);if(f&&h&&d){var e=new i(f),r=new t.ImageAtlas(h,d);for(var o in m){var u=m[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,n),t.performSymbolLayout(u,f,e.positions,h,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,n),u.addFeatures(y,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?h:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?o.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){p||(p=t,d=e,j.call(u))})):d={},j.call(this)};var u=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};u.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete n.loading[i],e||!o)return s.status="done",n.loaded[i]=s,r(e);var u=o.rawData,c={};o.expires&&(c.expires=o.expires),o.cacheControl&&(c.cacheControl=o.cacheControl);var l={};if(a){var p=a.finish();p&&(l.resourceTiming=JSON.parse(JSON.stringify(p)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:u.slice(0)},n,c,l))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},u.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},u.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var c=t.window.ImageBitmap,l=function(){this.loaded={}};function p(t,e){if(0!==t.length){f(t[0],e);for(var r=1;r=0!=!!e&&t.reverse()}l.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,o=e.rawImageData,a=c&&o instanceof c?this.getImageData(o):o,s=new t.DEMData(n,a,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},l.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},l.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var h=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function k(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*l/s+p)),Math.min(o,Math.floor(n+(s-u)*l/s+p)),a)}var f=r[2*n+a],h=i,d=o;for(C(e,r,i,n),r[2*o+a]>f&&C(e,r,i,o);hf;)d--}r[2*i+a]===f?C(e,r,i,d):C(e,r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};L.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,c=[0,t.length-1,0],l=[];c.length;){var p=c.pop(),f=c.pop(),h=c.pop();if(f-h<=a)for(var d=h;d<=f;d++)u=e[2*d+1],(s=e[2*d])>=r&&s<=i&&u>=n&&u<=o&&l.push(t[d]);else{var m=Math.floor((h+f)/2);u=e[2*m+1],(s=e[2*m])>=r&&s<=i&&u>=n&&u<=o&&l.push(t[m]);var y=(p+1)%2;(0===p?r<=s:n<=u)&&(c.push(h),c.push(m-1),c.push(y)),(0===p?i>=s:o>=u)&&(c.push(m+1),c.push(f),c.push(y))}}return l}(this.ids,this.coords,t,e,r,n,this.nodeSize)},L.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var c=a.pop(),l=a.pop(),p=a.pop();if(l-p<=o)for(var f=p;f<=l;f++)j(e[2*f],e[2*f+1],r,n)<=u&&s.push(t[f]);else{var h=Math.floor((p+l)/2),d=e[2*h],m=e[2*h+1];j(d,m,r,n)<=u&&s.push(t[h]);var y=(c+1)%2;(0===c?r-i<=d:n-i<=m)&&(a.push(p),a.push(h-1),a.push(y)),(0===c?r+i>=d:n+i>=m)&&(a.push(h+1),a.push(l),a.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var R={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},D=function(t){this.options=Z(Object.create(R),t),this.trees=new Array(this.options.maxZoom+1)};function F(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function B(t,e){var r=t.geometry.coordinates,n=r[1];return{x:V(r[0]),y:q(n),zoom:1/0,index:e,parentId:-1}}function N(t){return{type:"Feature",id:t.id,properties:U(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function U(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return Z(Z({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function V(t){return t/360+.5}function q(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Z(t,e){for(var r in e)t[r]=e[r];return t}function G(t){return t.x}function W(t){return t.y}function K(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function X(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)H(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*c-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(c-o,2))),i=u,o=c}var l=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,c=e[r],l=e[r+1],p=e[n],f=e[n+1],h=r+3;ha)o=h,a=d;else if(d===a){var m=Math.abs(h-s);mi&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,l,r),e[l+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function Q(t,e,r,n){for(var i=0;i1?1:r}function rt(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],c=0;c=r&&d=n)){var m=[];if("Point"===f||"MultiPoint"===f)nt(p,m,r,n,i);else if("LineString"===f)it(p,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===f)at(p,m,r,n,i,!1);else if("Polygon"===f)at(p,m,r,n,i,!0);else if("MultiPolygon"===f)for(var y=0;y=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function it(t,e,r,n,i,o,a){for(var s,u,c=ot(t),l=0===i?ut:ct,p=t.start,f=0;fr&&(u=l(c,h,d,y,v,r),a&&(c.start=p+s*u)):g>n?_=r&&(u=l(c,h,d,y,v,r),b=!0),_>n&&g<=n&&(u=l(c,h,d,y,v,n),b=!0),!o&&b&&(a&&(c.end=p+s*u),e.push(c),c=ot(t)),a&&(p+=s)}var x=t.length-3;h=t[x],d=t[x+1],m=t[x+2],(g=0===i?h:d)>=r&&g<=n&&st(c,h,d,m),x=c.length-3,o&&x>=3&&(c[x]!==c[0]||c[x+1]!==c[1])&&st(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=l),p>a.maxY&&(a.maxY=p)}return a}function mt(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var l=+Date.now();s=this._cluster(s,c),this.trees[c]=new L(s,G,W,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-l)}return r&&console.timeEnd("total time"),this},D.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],c=[],l=0,p=u.range(V(r),q(o),V(i),q(n));le&&(f+=m.numPoints||1)}if(f>=o){for(var y=u.x*p,v=u.y*p,g=i&&p>1?this._map(u,!0):null,_=(s<<5)+(e+1)+this.points.length,b=0,x=l;b1)for(var E=0,O=l;E>5},D.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},D.prototype._map=function(t,e){if(t.numPoints)return e?Z({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?Z({},n):n},vt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},vt.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,c=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var l=1<1&&console.time("creation"),f=this.tiles[p]=dt(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var h="z"+e;this.stats[h]=(this.stats[h]||0)+1,this.total++}if(f.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var m,y,v,g,_,b,x=.5*u.buffer/u.extent,w=.5-x,S=.5+x,E=1+x;m=y=v=g=null,_=rt(t,l,r-x,r+S,0,f.minX,f.maxX,u),b=rt(t,l,r+w,r+E,0,f.minX,f.maxX,u),t=null,_&&(m=rt(_,l,n-x,n+S,1,f.minY,f.maxY,u),y=rt(_,l,n+w,n+E,1,f.minY,f.maxY,u),_=null),b&&(v=rt(b,l,n-x,n+S,1,f.minY,f.maxY,u),g=rt(b,l,n+w,n+E,1,f.minY,f.maxY,u),b=null),c>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(y||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(g||[],e+1,2*r+1,2*n+1)}}},vt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,c=t,l=e,p=r;!u&&c>0;)c--,l=Math.floor(l/2),p=Math.floor(p/2),u=this.tiles[gt(c,l,p)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,l,p),o>1&&console.time("drilling down"),this.splitTile(u.source,c,l,p,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?ft(this.tiles[s],i):null):null};var bt=function(e){function r(t,r,n,i){e.call(this,t,r,n,_t),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(o,a){if(o||!a)return r(o);if("object"!=typeof a)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var f=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function v(t,e,r,n,i,o,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:i,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],_.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var i=0,a=u;i1&&(s=t[++a]);var c=Math.abs(u-s.left),l=Math.abs(u-s.right),p=Math.min(c,l),f=void 0,h=i/r*(n+1);if(s.isDash){var d=n-Math.abs(h);f=Math.sqrt(p*p+d*d)}else f=n-Math.sqrt(p*p+h*h);this.data[o+u]=Math.max(0,Math.min(255,f+128))}},S.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],c=0;c1&&(u=t[++s]);var l=Math.abs(c-u.left),p=Math.abs(c-u.right),f=Math.min(l,p);this.data[a+c]=Math.max(0,Math.min(255,(u.isDash?f:-f)+128))}},S.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=n&&e.x=i&&e.y0&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),j=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,o){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):o&&(n.image=o,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,o=-1/0,a=0,s=e;ar.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(j),z=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},B.prototype.has=function(t){return t.wrapped().key in this.data},B.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},B.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},B.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},B.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},B.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},B.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},B.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var o=this._tiles[i];if(!(n[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){n[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),o=this._getLoadedTile(i);if(o)return o}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(e*r*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var n in this._tiles){var i=this._tiles[n];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}for(var o in this._tiles=r,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-r.maxOverzooming,this._source.minzoom),s=Math.max(o+r.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(jt(this._source.type)){for(var c={},l={},p=0,f=Object.keys(u);pthis._source.maxzoom){var y=d.children(this._source.maxzoom)[0],v=this.getTile(y);if(v&&v.hasData()){n[y.key]=y;continue}}else{var g=d.children(this._source.maxzoom);if(n[g[0].key]&&n[g[1].key]&&n[g[2].key]&&n[g[3].key])continue}for(var _=m.wasRequested(),b=d.overscaledZ-1;b>=o;--b){var x=d.scaledTo(b);if(i[x.key])break;if(i[x.key]=!0,!(m=this.getTile(x))&&_&&(m=this._addTile(x)),m&&(n[x.key]=x,_=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var o=0,a=e;o0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=n?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),c=s.map((function(t){return a.pointCoordinate(t)})),l=this.getIds(),p=1/0,f=1/0,h=-1/0,d=-1/0,m=0,y=c;m=0&&v[1].y+y>=0){var g=u.map((function(t){return s.getTilePoint(t)})),_=c.map((function(t){return s.getTilePoint(t)}));o.push({tile:n,tileID:s,queryGeometry:g,cameraQueryGeometry:_,scale:m})}}},_=0;_=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Pt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function jt(t){return"raster"===t||"image"===t||"video"===t}function Mt(){return new t.window.Worker(Xi.workerUrl)}Ct.maxOverzooming=10,Ct.maxUnderzooming=3;var zt="mapboxgl_preloaded_worker_pool",Lt=function(){this.active={}};Lt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-a)/s:0;return this.points[o].mult(1-u).add(this.points[r].mult(u))};var Yt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function re(e,r,n,i,o,a,s,u){var c=i?e.textSizeData:e.iconSizeData,l=t.evaluateSizeForZoom(c,n.transform.zoom),p=[256/n.width*2+1,256/n.height*2+1],f=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();for(var h=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,y=!1,v=0;vMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,o,a,s,u,c,l,p,f,h,d){var m,y=r/24,v=e.lineOffsetX*y,g=e.lineOffsetY*y;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,x=e.lineStartIndex+e.lineLength,w=ne(y,u,v,g,n,p,f,e,c,a,h);if(!w)return{notEnoughRoom:!0};var S=Qt(w.first.point,s).point,E=Qt(w.last.point,s).point;if(i&&!n){var O=ie(e.writingMode,S,E,d);if(O)return O}m=[w.first];for(var T=e.glyphStartIndex+1;T<_-1;T++)m.push(se(y*u.getoffsetX(T),v,g,n,p,f,e.segment,b,x,c,a,h));m.push(w.last)}else{if(i&&!n){var A=Qt(f,o).point,k=e.lineStartIndex+e.segment+1,I=new t.Point(c.getx(k),c.gety(k)),C=Qt(I,o),P=C.signedDistanceFromCamera>0?C.point:ae(f,I,A,1,o),j=ie(e.writingMode,A,P,d);if(j)return j}var M=se(y*u.getoffsetX(e.glyphStartIndex),v,g,n,p,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,h);if(!M)return{notEnoughRoom:!0};m=[M]}for(var z=0,L=m;z0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var y=d>0?u+s:u+s+1,v=o,g=o,_=0,b=0,x=Math.abs(h),w=[];_+b<=x;){if((y+=d)=c)return null;if(g=v,w.push(v),void 0===(v=f[y])){var S=new t.Point(l.getx(y),l.gety(y)),E=Qt(S,p);if(E.signedDistanceFromCamera>0)v=f[y]=E.point;else{var O=y-d;v=ae(0===_?a:new t.Point(l.getx(O),l.gety(O)),S,g,x-_+1,p)}}_+=b,b=g.dist(v)}var T=(x-_)/b,A=v.sub(g),k=A.mult(T)._add(g);k._add(A._unit()._perp()._mult(n*d));var I=m+Math.atan2(v.y-g.y,v.x-g.x);return w.push(k),{point:k,angle:I,path:w}}Yt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Yt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Yt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Yt.prototype._insertBoxCell=function(t,e,r,n,i,o){this.boxCells[i].push(o)},Yt.prototype._insertCircleCell=function(t,e,r,n,i,o){this.circleCells[i].push(o)},Yt.prototype._query=function(t,e,r,n,i,o){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:a},Yt.prototype._queryCircle=function(t,e,r,n,i){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!n&&[];var c=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,c,{hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),n?c.length>0:c},Yt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Yt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Yt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Yt.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=a.seenUids,c=this.boxCells[i];if(null!==c)for(var l=this.bboxes,p=0,f=c;p=l[d+0]&&n>=l[d+1]&&(!s||s(this.boxKeys[h]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[h],x1:l[d],y1:l[d+1],x2:l[d+2],y2:l[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var y=this.circles,v=0,g=m;va*a+s*s},Yt.prototype._circleAndRectCollide=function(t,e,r,n,i,o,a){var s=(o-n)/2,u=Math.abs(t-(n+s));if(u>s+r)return!1;var c=(a-i)/2,l=Math.abs(e-(i+c));if(l>c+r)return!1;if(u<=s||l<=c)return!0;var p=u-s,f=l-c;return p*p+f*f<=r*r};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ce(t,e){for(var r=0;r=1;P--)C.push(k.path[P]);for(var j=1;j0){for(var R=C[0].clone(),D=C[0].clone(),F=1;F=O.x&&D.x<=T.x&&R.y>=O.y&&D.y<=T.y?[C]:D.xT.x||D.yT.y?[]:t.clipLine([C],O.x,O.y,T.x,T.y)}for(var B=0,N=L;B=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},pe.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(m=this.prevPlacement.variableOffsets[p.crossTileID].anchor),this.variableOffsets[p.crossTileID]={textOffset:y,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(f,t,p,h),f.allowVerticalPlacement&&(this.markUsedOrientation(f,h,p),this.placedOrientations[p.crossTileID]=h),{shift:v,placedGlyphBoxes:g}):void 0},xe.prototype.placeLayerBucketPart=function(e,r,n){var i=this,o=e.parameters,a=o.bucket,s=o.layout,u=o.posMatrix,c=o.textLabelPlaneMatrix,l=o.labelToScreenMatrix,p=o.textPixelRatio,f=o.holdingForFade,h=o.collisionBoxArray,d=o.partiallyEvaluatedTextSize,m=o.collisionGroup,y=s.get("text-optional"),v=s.get("icon-optional"),g=s.get("text-allow-overlap"),_=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),x="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),S="viewport-y"===s.get("symbol-z-order"),E=g&&(_||!a.hasIconData()||v),O=_&&(g||!a.hasTextData()||y);!a.collisionArrays&&h&&a.deserializeCollisionBoxes(h);var T=function(e,o){if(!r[e.crossTileID])if(f)i.placements[e.crossTileID]=new me(!1,!1,!1);else{var h,S=!1,T=!1,A=!0,k=null,I={box:null,offscreen:null},C={box:null,offscreen:null},P=null,j=null,M=0,z=0,L=0;o.textFeatureIndex?M=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(M=e.featureIndex),o.verticalTextFeatureIndex&&(z=o.verticalTextFeatureIndex);var R=o.textBox;if(R){var D=function(r){var n=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,n=o,e))}return n},F=function(r,n){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i0&&(B=B.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var U=function(t,r,n){for(var o=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,l=w&&!_?r:null,f={box:[],offscreen:!1},h=g?2*B.length:B.length,d=0;d=B.length,e,a,n,l);if(y&&(f=y.placedGlyphBoxes)&&f.box&&f.box.length){S=!0,k=y.shift;break}}return f};F((function(){return U(R,o.iconBox,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&!(I&&I.box&&I.box.length)&&e.numVerticalGlyphVertices>0&&r?U(r,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),I&&(S=I.box,A=I.offscreen);var V=D(I&&I.box);if(!S&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[e.crossTileID];q&&(i.variableOffsets[e.crossTileID]=q,i.markUsedJustification(a,q.anchor,e,V))}}else{var Z=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,g,p,u,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(a,r,e),i.placedOrientations[e.crossTileID]=r),n};F((function(){return Z(R,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?Z(r,t.WritingMode.vertical):{box:null,offscreen:null}})),D(I&&I.box&&I.box.length)}}if(S=(h=I)&&h.box&&h.box.length>0,A=h&&h.offscreen,e.useRuntimeCollisionCircles){var G=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),W=t.evaluateSizeForFeature(a.textSizeData,d,G),K=s.get("text-padding");P=i.collisionIndex.placeCollisionCircles(g,G,a.lineVertexArray,a.glyphOffsetArray,W,u,c,l,n,x,m.predicate,e.collisionCircleDiameter,K),S=g||P.circles.length>0&&!P.collisionDetected,A=A&&P.offscreen}if(o.iconFeatureIndex&&(L=o.iconFeatureIndex),o.iconBox){var X=function(t){var e=w&&k?be(t,k.x,k.y,b,x,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,_,p,u,m.predicate)};T=C&&C.box&&C.box.length&&o.verticalIconBox?(j=X(o.verticalIconBox)).box.length>0:(j=X(o.iconBox)).box.length>0,A=A&&j.offscreen}var H=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,Y=v||0===e.numIconVertices;if(H||Y?Y?H||(T=T&&S):S=T&&S:T=S=T&&S,S&&h&&h.box&&i.collisionIndex.insertCollisionBox(h.box,s.get("text-ignore-placement"),a.bucketInstanceId,C&&C.box&&z?z:M,m.ID),T&&j&&i.collisionIndex.insertCollisionBox(j.box,s.get("icon-ignore-placement"),a.bucketInstanceId,L,m.ID),P&&(S&&i.collisionIndex.insertCollisionCircles(P.circles,s.get("text-ignore-placement"),a.bucketInstanceId,M,m.ID),n)){var J=a.bucketInstanceId,$=i.collisionCircleArrays[J];void 0===$&&($=i.collisionCircleArrays[J]=new ye);for(var Q=0;Q=0;--k){var I=A[k];T(a.symbolInstances.get(I),a.collisionArrays[I])}else for(var C=e.symbolInstanceStart;C=0&&(e.text.placedSymbolArray.get(u).crossTileID=o>=0&&u!==o?0:n.crossTileID)}},xe.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=r===t.WritingMode.vertical?r:0,a=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];a0,g=i.placedOrientations[o.crossTileID],_=g===t.WritingMode.vertical,b=g===t.WritingMode.horizontal||g===t.WritingMode.horizontalOnly;if(s>0||u>0){var x=Ce(y.text);d(e.text,s,_?Pe:x),d(e.text,u,b?Pe:x);var w=y.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||_?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=w||b?1:0);var S=i.variableOffsets[o.crossTileID];S&&i.markUsedJustification(e,S.anchor,o,g);var E=i.placedOrientations[o.crossTileID];E&&(i.markUsedJustification(e,"left",o,E),i.markUsedOrientation(e,E,o))}if(v){var O=Ce(y.icon),T=!(f&&o.verticalPlacedIconSymbolIndex&&_);o.placedIconSymbolIndex>=0&&(d(e.icon,o.numIconVertices,T?O:Pe),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=y.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,o.numVerticalIconVertices,T?Pe:O),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var A=e.collisionArrays[n];if(A){var k=new t.Point(0,0);if(A.textBox||A.verticalTextBox){var I=!0;if(c){var C=i.variableOffsets[m];C?(k=_e(C.anchor,C.width,C.height,C.textOffset,C.textBoxScale),l&&k._rotate(p?i.transform.angle:-i.transform.angle)):I=!1}A.textBox&&we(e.textCollisionBox.collisionVertexArray,y.text.placed,!I||_,k.x,k.y),A.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,y.text.placed,!I||b,k.x,k.y)}var P=Boolean(!b&&A.verticalIconBox);A.iconBox&&we(e.iconCollisionBox.collisionVertexArray,y.icon.placed,P,f?k.x:0,f?k.y:0),A.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!P,f?k.x:0,f?k.y:0)}}},y=0;yt},xe.prototype.setStale=function(){this.stale=!0};var Se=Math.pow(2,25),Ee=Math.pow(2,24),Oe=Math.pow(2,17),Te=Math.pow(2,16),Ae=Math.pow(2,9),ke=Math.pow(2,8),Ie=Math.pow(2,1);function Ce(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Se+e*Ee+r*Oe+e*Te+r*Ae+e*ke+r*Ie+e}var Pe=0,je=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};je.prototype.continuePlacement=function(t,e,r,n,i){for(var o=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new je(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Me.prototype.commit=function(t){return this.placement.commit(t),this.placement};var ze=512/t.EXTENT/2,Le=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var c=a[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var l=0;l1?"@2x":"",u=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,l())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,a||(a=t,o=e,l())}));function l(){if(a)n(a);else if(i&&o){var e=t.browser.getImageData(o),r={};for(var s in i){var u=i[s],c=u.width,l=u.height,p=u.x,f=u.y,h=u.sdf,d=u.pixelRatio,m=u.stretchX,y=u.stretchY,v=u.content,g=new t.RGBAImage({width:c,height:l});t.RGBAImage.copy(e,g,{x:p,y:f},{x:0,y:0},{width:c,height:l}),r[s]={data:g,pixelRatio:d,sdf:h,stretchX:m,stretchY:y,content:v}}n(null,r)}}return{cancel:function(){u&&(u.cancel(),u=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var o=this.sourceCaches[e]=new Ct(e,r,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(Be(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),n)||(o.setLayoutProperty(r,n,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),n)||(o.setPaintProperty(r,n,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,o=this.sourceCaches[n];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(a,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){n[a]=o;for(var s=0,u=t;s=0;h--){var d=this._order[h];if(r(d))for(var m=i.length-1;m>=0;m--){var y=i[m].feature;if(n[y.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Qe=vr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tr=vr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),er=vr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),rr=vr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),nr=vr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=vr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ar=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=vr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ur=vr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),cr=vr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),lr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),pr=vr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),fr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),hr=vr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),dr=vr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),mr=vr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),yr=vr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function vr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var o="float"===n?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:a}}var gr=Object.freeze({__proto__:null,prelude:Ge,background:We,backgroundPattern:Ke,circle:Xe,clippingMask:He,heatmap:Ye,heatmapTexture:Je,collisionBox:$e,collisionCircle:Qe,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:nr,fillPattern:ir,fillExtrusion:or,fillExtrusionPattern:ar,hillshadePrepare:sr,hillshade:ur,line:cr,lineGradient:lr,linePattern:pr,lineSDF:fr,raster:hr,symbolIcon:dr,symbolSDF:mr,symbolTextAndIcon:yr}),_r=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function br(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}xr.prototype.draw=function(t,e,r,n,i,o,a,s,u,c,l,p,f,h,d,m){var y,v=t.gl;if(!this.failedToCreate){for(var g in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[g].set(a[g]);h&&h.setUniforms(t,this.binderUniforms,p,{zoom:f});for(var _=(y={},y[v.LINES]=2,y[v.TRIANGLES]=3,y[v.LINE_STRIP]=1,y)[e],b=0,x=l.get();b0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Vr(i.paint.get("raster-hue-rotate"))};var o,a};function Vr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var qr,Zr=function(t,e,r,n,i,o,a,s,u,c){var l=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:l.cameraToCenterDistance,u_pitch:l.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:l.width/l.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Gr=function(e,r,n,i,o,a,s,u,c,l,p){var f=o.transform;return t.extend(Zr(e,r,n,i,o,a,s,u,c,l),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+p})},Wr=function(e,r,n,i,o,a,s,u,c,l){return t.extend(Gr(e,r,n,i,o,a,s,u,!0,c,!0),{u_texsize_icon:l,u_texture_icon:1})},Kr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Xr=function(e,r,n,i,o,a){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,u=a.height,c=Math.pow(2,n.tileID.overscaledZ),l=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,p=l*(n.tileID.canonical.x+n.tileID.wrap*c),f=l*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/fe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[p>>16,f>>16],u_pixel_coord_lower:[65535&p,65535&f]}}(i,a,n,o),{u_matrix:e,u_opacity:r})},Hr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Yr(e,r,n,i,o,a,s){for(var u=e.context,c=u.gl,l=e.useProgram("collisionBox"),p=[],f=0,h=0,d=0;d0){var x=t.create(),w=g;t.mul(x,v.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(x,x,v.placementViewportMatrix),p.push({circleArray:b,circleOffset:h,transform:w,invTransform:x}),h=f+=b.length/4}_&&l.draw(u,c.LINES,Ot.disabled,Tt.disabled,e.colorModeForRenderPass(),kt.disabled,Cr(g,e.transform,y),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,null,_.collisionVertexBuffer)}}if(s&&p.length){var S=e.useProgram("collisionCircle"),E=new t.StructArrayLayout2f1f2i16;E.resize(4*f),E._trim();for(var O=0,T=0,A=p;T=0&&(m[v.associatedIconIndex]={shiftedAnchor:E,angle:O})}else ce(v.numGlyphs,h)}if(p){d.clear();for(var A=e.icon.placedSymbolArray,k=0;k0){var s=t.browser.now(),u=(s-e.timeAdded)/a,c=r?(s-r.timeAdded)/a:-1,l=n.getSource(),p=o.coveringZoomLevel({tileSize:l.tileSize,roundZoom:l.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-p)>Math.abs(e.tileID.overscaledZ-p),h=f&&e.refreshedUponExpiration?1:t.clamp(f?u:1-c,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-h}:{opacity:h,mix:0}}return{opacity:1,mix:0}}var cn=new t.Color(1,0,0,1),ln=new t.Color(0,1,0,1),pn=new t.Color(0,0,1,1),fn=new t.Color(1,0,1,1),hn=new t.Color(0,1,1,1);function dn(t,e,r,n){yn(t,0,e+r/2,t.transform.width,r,n)}function mn(t,e,r,n){yn(t,e-r/2,0,r,t.transform.height,n)}function yn(e,r,n,i,o,a){var s=e.context,u=s.gl;u.enable(u.SCISSOR_TEST),u.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),u.disable(u.SCISSOR_TEST)}function vn(e,r,n){var i=e.context,o=i.gl,a=n.posMatrix,s=e.useProgram("debug"),u=Ot.disabled,c=Tt.disabled,l=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,u,c,l,kt.disabled,jr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var p=r.getTileByID(n.key).latestRawTileData,f=Math.floor((p&&p.byteLength||0)/1024),h=r.getTile(n).tileSize,d=512/Math.min(h,512)*(n.overscaledZ/e.transform.zoom)*.5,m=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(m+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,m+" "+f+"kb"),s.draw(i,o.TRIANGLES,u,c,At.alphaBlended,kt.disabled,jr(a,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var gn={symbol:function(e,r,n,i,o){if("translucent"===e.renderPass){var a=Tt.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,o,a,s){for(var u=r.transform,c="map"===o,l="map"===a,p=0,f=e;p256&&this.clearStencil(),r.setColorMode(At.disabled),r.setDepthMode(Ot.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Tt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Tt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,o=n[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s=0;this.currentLayer--){var b=this.style._layers[i[this.currentLayer]],x=o[b.source],w=l[b.source];this._renderTileClippingMasks(b,w),this.renderLayer(this,x,b,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},_n.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},_n.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new xr(this.context,t,gr[t],e,Hr[t],this._showOverdrawInspector)),this.cache[r]},_n.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},_n.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},_n.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},_n.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var bn=function(t,e){this.points=t,this.planes=e};bn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),o=[[-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((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),n=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],r,n)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new bn(o,a)};var xn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};xn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o=0;if(0===a)return 0;a!==r.length&&(n=!1)}if(n)return 2;for(var u=0;u<3;u++){for(var c=Number.MAX_VALUE,l=-Number.MAX_VALUE,p=0;pthis.max[u]-this.min[u])return 0}return 1};var wn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};wn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},wn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},wn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},wn.prototype.clone=function(){return new wn(this.top,this.bottom,this.left,this.right)},wn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Sn=function(e,r,n,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={}},En={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Sn.prototype.clone=function(){var t=new Sn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},En.minZoom.get=function(){return this._minZoom},En.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},En.maxZoom.get=function(){return this._maxZoom},En.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},En.minPitch.get=function(){return this._minPitch},En.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},En.maxPitch.get=function(){return this._maxPitch},En.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},En.renderWorldCopies.get=function(){return this._renderWorldCopies},En.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},En.worldSize.get=function(){return this.tileSize*this.scale},En.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},En.size.get=function(){return new t.Point(this.width,this.height)},En.bearing.get=function(){return-this.angle/Math.PI*180},En.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},En.pitch.get=function(){return this._pitch/Math.PI*180},En.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},En.fov.get=function(){return this._fov/Math.PI*180},En.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},En.zoom.get=function(){return this._zoom},En.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},En.center.get=function(){return this._center},En.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},En.padding.get=function(){return this._edgeInsets.toJSON()},En.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},En.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Sn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Sn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Sn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Sn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),u=Math.floor(Math.max(n.x,i.x,o.x,a.x)),c=s-1;c<=u+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},Sn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=[o*i.x,o*i.y,0],s=bn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),u=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(u=r);var c=function(t){return{aabb:new xn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},l=[],p=[],f=r,h=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)l.push(c(-d)),l.push(c(d));for(l.push(c(0));l.length>0;){var m=l.pop(),y=m.x,v=m.y,g=m.fullyVisible;if(!g){var _=m.aabb.intersects(s);if(0===_)continue;g=2===_}var b=m.aabb.distanceX(a),x=m.aabb.distanceY(a),w=Math.max(Math.abs(b),Math.abs(x));if(m.zoom===f||w>3+(1<=u)p.push({tileID:new t.OverscaledTileID(m.zoom===f?h:m.zoom,m.wrap,m.zoom,y,v),distanceSq:t.sqrLen([a[0]-.5-y,a[1]-.5-v])});else for(var S=0;S<4;S++){var E=(y<<1)+S%2,O=(v<<1)+(S>>1);l.push({aabb:m.aabb.quadrant(S),zoom:m.zoom+1,x:E,y:O,wrap:m.wrap,fullyVisible:g})}}return p.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Sn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},En.unmodified.get=function(){return this._unmodified},Sn.prototype.zoomScale=function(t){return Math.pow(2,t)},Sn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Sn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Sn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},En.point.get=function(){return this.project(this.center)},Sn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(n.x-i.x),o.y-(n.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},Sn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Sn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Sn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Sn.prototype.coordinateLocation=function(t){return t.toLngLat()},Sn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],o=n[3],a=r[1]/i,s=n[1]/o,u=r[2]/i,c=n[2]/o,l=u===c?0:(0-u)/(c-u);return new t.MercatorCoordinate(t.number(r[0]/i,n[0]/o,l)/this.worldSize,t.number(a,s,l)/this.worldSize)},Sn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Sn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Sn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Sn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Sn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,r?this.alignedProjMatrix:this.projMatrix,u),i[n]=new Float32Array(u),i[n]},Sn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Sn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,o=-90,a=90,s=-180,u=180,c=this.size,l=this._unmodified;if(this.latRange){var p=this.latRange;o=t.mercatorYfromLat(p[1])*this.worldSize,e=(a=t.mercatorYfromLat(p[0])*this.worldSize)-oa&&(i=a-y)}if(this.lngRange){var v=h.x,g=c.x/2;v-gu&&(n=u-g)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:h.x,void 0!==i?i:h.y))),this._unmodified=l,this._constraining=!1}},Sn.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,n=this._fov*(.5+e.y/this.height),i=Math.sin(n)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-n,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),c=this.height/50,l=new Float64Array(16);t.perspective(l,this._fov,this.width/this.height,c,u),l[8]=2*-e.x/this.width,l[9]=2*e.y/this.height,t.scale(l,l,[1,-1,1]),t.translate(l,l,[0,0,-this.cameraToCenterDistance]),t.rotateX(l,l,this._pitch),t.rotateZ(l,l,this.angle),t.translate(l,l,[-a,-s,0]),this.mercatorMatrix=t.scale([],l,[this.worldSize,this.worldSize,this.worldSize]),t.scale(l,l,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=l,this.invProjMatrix=t.invert([],this.projMatrix);var p=this.width%2/2,f=this.height%2/2,h=Math.cos(this.angle),d=Math.sin(this.angle),m=a-Math.round(a)+h*p+d*f,y=s-Math.round(s)+h*f+d*p,v=new Float64Array(l);if(t.translate(v,v,[m>.5?m-1:m,y>.5?y-1:y,0]),this.alignedProjMatrix=v,l=t.create(),t.scale(l,l,[this.width/2,-this.height/2,1]),t.translate(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=t.create(),t.scale(l,l,[1,-1,1]),t.translate(l,l,[-1,-1,0]),t.scale(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(l=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Sn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Sn.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},Sn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,o=r.x,a=r.y,s=0,u=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},On.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var Tn={linearity:.3,easing:t.bezier(0,0,.3,1)},An=t.extend({deceleration:2500,maxSpeed:1400},Tn),kn=t.extend({deceleration:20,maxSpeed:1400},Tn),In=t.extend({deceleration:1e3,maxSpeed:360},Tn),Cn=t.extend({deceleration:1e3,maxSpeed:90},Tn),Pn=function(t){this._map=t,this.clear()};function jn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Pn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new zn(t.type,this._map,t))},Dn.prototype.dblclick=function(t){return this._firePreventable(new zn(t.type,this._map,t))},Dn.prototype.mouseover=function(t){this._map.fire(new zn(t.type,this._map,t))},Dn.prototype.mouseout=function(t){this._map.fire(new zn(t.type,this._map,t))},Dn.prototype.touchstart=function(t){return this._firePreventable(new Ln(t.type,this._map,t))},Dn.prototype.touchmove=function(t){this._map.fire(new Ln(t.type,this._map,t))},Dn.prototype.touchend=function(t){this._map.fire(new Ln(t.type,this._map,t))},Dn.prototype.touchcancel=function(t){this._map.fire(new Ln(t.type,this._map,t))},Dn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Dn.prototype.isEnabled=function(){return!0},Dn.prototype.isActive=function(){return!1},Dn.prototype.enable=function(){},Dn.prototype.disable=function(){};var Fn=function(t){this._map=t};Fn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Fn.prototype.mousemove=function(t){this._map.fire(new zn(t.type,this._map,t))},Fn.prototype.mousedown=function(){this._delayContextMenu=!0},Fn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new zn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Fn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new zn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Fn.prototype.isEnabled=function(){return!0},Fn.prototype.isActive=function(){return!1},Fn.prototype.enable=function(){},Fn.prototype.disable=function(){};var Bn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Nn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Un.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Vn=function(t){this.singleTap=new Un(t),this.numTaps=t.numTaps,this.reset()};Vn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Vn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Vn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Vn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(n)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var qn=function(){this._zoomIn=new Vn({numTouches:1,numTaps:2}),this._zoomOut=new Vn({numTouches:2,numTaps:1}),this.reset()};qn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},qn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},qn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},qn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},qn.prototype.touchcancel=function(){this.reset()},qn.prototype.enable=function(){this._enabled=!0},qn.prototype.disable=function(){this._enabled=!1,this.reset()},qn.prototype.isEnabled=function(){return this._enabled},qn.prototype.isActive=function(){return this._active};var Zn={0:1,2:2},Gn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Gn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Gn.prototype._correctButton=function(t,e){return!1},Gn.prototype._move=function(t,e){return{}},Gn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Gn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=Zn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)0&&(this._active=!0);var i=Nn(n,r),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var u in i){var c=i[u],l=this._touches[u];l&&(o._add(c),a._add(c.sub(l)),s++,i[u]=c)}if(this._touches=i,!(sMath.abs(t.x)}var ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ri(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ri(t)&&ri(e)&&o}},e}(Yn),ii={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ii;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function ai(t){return t*(2-t)}oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ai,zoom:r?Math.round(u)+r*(t.shiftKey?2:1):u,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active};var si=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};si.prototype.setZoomRate=function(t){this._defaultZoomRate=t},si.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},si.prototype.isEnabled=function(){return!!this._enabled},si.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},si.prototype.isZooming=function(){return!!this._zooming},si.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},si.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},si.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},si.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},si.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},si.prototype.renderFrame=function(){return this._onScrollFrame()},si.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,u=this._startZoom,c=this._easing,l=!1;if("wheel"===this._type&&u&&c){var p=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),f=c(p);a=t.number(u,s,f),p<1?this._frameId||(this._frameId=!0):l=!0}else a=s,l=!0;return this._active=!0,l&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!l,zoomDelta:a-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},si.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},si.prototype.reset=function(){this._active=!1};var ui=function(t,e){this._clickZoom=t,this._tapZoom=e};ui.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ui.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ui.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ui.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ci=function(){this.reset()};ci.prototype.reset=function(){this._active=!1},ci.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},ci.prototype.enable=function(){this._enabled=!0},ci.prototype.disable=function(){this._enabled=!1,this.reset()},ci.prototype.isEnabled=function(){return this._enabled},ci.prototype.isActive=function(){return this._active};var li=function(){this._tap=new Vn({numTouches:1,numTaps:1}),this.reset()};li.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},li.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},li.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},li.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},li.prototype.touchcancel=function(){this.reset()},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var pi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};pi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},pi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},pi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},pi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var fi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};fi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},fi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},fi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},fi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var hi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};hi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},hi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},hi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},hi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},hi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},hi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var di=function(t){return t.zoom||t.drag||t.pitch||t.rotate},mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function yi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var vi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Pn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;oo?Math.min(2,x):Math.max(.5,x),w=Math.pow(y,1-e),S=i.unproject(_.add(b.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?S.wrap():S,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),c=this.getPadding(),l="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,p="bearing"in e?this._normalizeBearing(e.bearing,s):s,f="pitch"in e?+e.pitch:u,h="padding"in e?e.padding:o.padding,d=o.zoomScale(l-a),m=t.Point.convert(e.offset),y=o.centerPoint.add(m),v=o.pointLocation(y),g=t.LngLat.convert(e.center||v);this._normalizeCenter(g);var _=o.project(v),b=o.project(g).sub(_),x=e.curve,w=Math.max(o.width,o.height),S=w/d,E=b.mag();if("minZoom"in e){var O=t.clamp(Math.min(e.minZoom,a,l),o.minZoom,o.maxZoom),T=w/o.zoomScale(O-a);x=Math.sqrt(T/E*2)}var A=x*x;function k(t){var e=(S*S-w*w+(t?-1:1)*A*A*E*E)/(2*(t?S:w)*A*E);return Math.log(Math.sqrt(e*e+1)-e)}function I(t){return(Math.exp(t)-Math.exp(-t))/2}function C(t){return(Math.exp(t)+Math.exp(-t))/2}var P=k(0),j=function(t){return C(P)/C(P+x*t)},M=function(t){return w*((C(P)*(I(e=P+x*t)/C(e))-I(P))/A)/E;var e},z=(k(1)-P)/x;if(Math.abs(E)<1e-6||!isFinite(z)){if(Math.abs(w-S)<1e-6)return this.easeTo(e,r);var L=Se.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==p,this._pitching=f!==u,this._padding=!o.isPaddingEqual(h),this._prepareEase(r,!1),this._ease((function(e){var i=e*z,d=1/j(i);o.zoom=1===e?l:a+o.scaleZoom(d),n._rotating&&(o.bearing=t.number(s,p,e)),n._pitching&&(o.pitch=t.number(u,f,e)),n._padding&&(o.interpolatePadding(c,h,e),y=o.centerPoint.add(m));var v=1===e?g:o.unproject(_.add(b.mult(M(i))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?v.wrap():v,y),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),_i=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};_i.prototype.getDefaultPosition=function(){return"bottom-right"},_i.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},_i.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},_i.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},_i.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var bi=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};bi.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},bi.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},bi.prototype.getDefaultPosition=function(){return"bottom-left"},bi.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},bi.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},bi.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var xi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};xi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},xi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var i=new Sn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new xi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wi,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ei))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new vi(this,e),this._hash=e.hash&&new On("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new _i({customAttribution:e.customAttribution})),this.addControl(new bi,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var o=!this._moving;return o&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var a=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(i,new zn(t,i,n.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(i,new zn(t,i,n.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(i,new zn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in i.delegates)this.once(o,i.delegates[o]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var o=n[t],a=0;a180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Pi.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Pi.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Pi.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Pi.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Pi.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Pi.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Pi.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Pi.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Pi.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Pi.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)e.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Bi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ri(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ri({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Fi--,Bi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Fi>1?(e={maximumAge:6e5,timeout:0},Bi=!0):(e=this.options.positionOptions,Bi=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Ui={maxWidth:100,unit:"metric"},Vi=function(e){this.options=t.extend({},Ui,e),t.bindAll(["_onMove","setUnit"],this)};function qi(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([n,i]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){var u=3.2808*s;u>5280?Zi(e,n,u/5280,t._getUIString("ScaleControl.Miles")):Zi(e,n,u,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Zi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Zi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Zi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Zi(t,e,r,n){var i,o,a,s=(i=r,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/r)+"px",t.innerHTML=s+" "+n}Vi.prototype.getDefaultPosition=function(){return"bottom-left"},Vi.prototype._onMove=function(){qi(this._map,this._container,this.options)},Vi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Vi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Vi.prototype.setUnit=function(t){this.options.unit=t,qi(this._map,this._container,this.options)};var Gi=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Gi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Gi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Gi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Gi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Gi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Gi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Gi.prototype._isFullscreen=function(){return this._fullscreen},Gi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Gi.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Wi={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Ki=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Wi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ji(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,u=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+a.bottom.ythis._map.transform.height-c?["bottom"]:[],i.xthis._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var l=i.add(a[o]).round();r.setTransform(this._container,Mi[o]+" translate("+l.x+"px,"+l.y+"px)"),zi(this._container,o,"popup")}},n.prototype._onClose=function(){this.remove()},n}(t.Evented),Xi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ai,NavigationControl:Ci,GeolocateControl:Ni,AttributionControl:_i,ScaleControl:Vi,FullscreenControl:Gi,Popup:Ki,Marker:Ri,Style:qe,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Ft().acquire(zt)},clearPrewarmedResources:function(){var t=Rt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(zt),Rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Lt.workerCount},set workerCount(t){Lt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Xi})),r}()},function(t,e,r){"use strict";var n=r(3),i=r.n(n),o=r(10),a=r.n(o),s=r(11),u=r.n(s),c=r(13),l=r.n(c),p=r(12),f=r.n(p),h=r(2),d=r.n(h),m=r(14),y=r.n(m),v=r(1),g=r.n(v),_=r(93),b=r.n(_),x=r(6),w=r.n(x),S=r(4),E=r.n(S),O=(r(7),r(0)),T=r(16),A=r(109),k=r(110),I=r(5),C=r(160),P=r(86),j=r(338);function M(t){var e=t.children,r=t.className,n=t.content,o=E()("detail",r),a=Object(A.a)(M,t),s=Object(k.a)(M,t);return O.default.createElement(s,i()({},a,{className:o}),I.a.isNil(e)?n:e)}M.handledProps=["as","children","className","content"],M.propTypes={},M.create=Object(C.e)(M,(function(t){return{content:t}}));var z=M;function L(t){var e=t.children,r=t.circular,n=t.className,o=t.color,a=t.content,s=t.size,u=t.tag,c=E()("ui",o,s,Object(T.a)(r,"circular"),Object(T.a)(u,"tag"),"labels",n),l=Object(A.a)(L,t),p=Object(k.a)(L,t);return O.default.createElement(p,i()({},l,{className:c}),I.a.isNil(e)?a:e)}L.handledProps=["as","children","circular","className","color","content","size","tag"],L.propTypes={};var R=L;r.d(e,"a",(function(){return D}));var D=function(t){function e(){var t,r;a()(this,e);for(var n=arguments.length,i=new Array(n),o=0;o=0||(i[r]=t[r]);return i}var yt=r(106),vt=/\$\{\s*(\w+)\s*\}/g,gt=function(t){return function(e){return t.replace(vt,(function(t,r){return at(e[r])}))}};function _t(t,e,r,n){var i=this;this.name="ValidationError",this.value=e,this.path=r,this.type=n,this.errors=[],this.inner=[],t&&[].concat(t).forEach((function(t){i.errors=i.errors.concat(t.errors||t),t.inner&&(i.inner=i.inner.concat(t.inner.length?t.inner:t))})),this.message=this.errors.length>1?this.errors.length+" errors occurred":this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,_t)}_t.prototype=Object.create(Error.prototype),_t.prototype.constructor=_t,_t.isError=function(t){return t&&"ValidationError"===t.name},_t.formatError=function(t,e){"string"===typeof t&&(t=gt(t));var r=function(e){return e.path=e.label||e.path||"this","function"===typeof t?t(e):t};return 1===arguments.length?r:r(e)};var bt=function(t){return t?yt.SynchronousPromise:Promise};function xt(t,e){return t?null:function(t){return e.push(t),t.value}}function wt(t){var e=t.validations,r=t.value,n=t.path,i=t.sync,o=t.errors,a=t.sort;return o=function(t){return void 0===t&&(t=[]),t.inner&&t.inner.length?t.inner:[].concat(t)}(o),function(t,e){var r=bt(e);return r.all(t.map((function(t){return r.resolve(t).then((function(t){return{fulfilled:!0,value:t}}),(function(t){return{fulfilled:!1,value:t}}))})))}(e,i).then((function(t){var e=t.filter((function(t){return!t.fulfilled})).reduce((function(t,e){var r=e.value;if(!_t.isError(r))throw r;return t.concat(r)}),[]);if(a&&e.sort(a),(o=e.concat(o)).length)throw new _t(o,r,n);return r}))}function St(t){var e,r,n,i=t.endEarly,o=mt(t,["endEarly"]);return i?(e=o.validations,r=o.value,n=o.sync,bt(n).all(e).catch((function(t){throw"ValidationError"===t.name&&(t.value=r),t})).then((function(){return r}))):wt(o)}var Et=function(t){return"[object Object]"===Object.prototype.toString.call(t)};var Ot=r(71);var Tt=function(t){return function(e,r,n){for(var i=-1,o=Object(e),a=n(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===r(o[u],u,o))break}return e}}();var At=function(t,e){return t&&Tt(t,e,Y.a)},kt=r(76),It=r(84);var Ct=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var Pt=function(t){return this.__data__.has(t)};function jt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new It.a;++es))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var l=-1,p=!0,f=2&r?new Mt:void 0;for(o.set(t,e),o.set(e,t);++l=r.length)throw new Error("Yup.reach cannot resolve an array item at index: "+s+", in the path: "+e+". because there is no value at that index. ");i=r,r=r&&r[p],t=t.innerType}if(!c){if(!t.fields||!t.fields[l])throw new Error("The schema does not contain the path: "+e+". (failed at: "+a+' which is a type: "'+t._type+'")');i=r,r=r&&r[l],t=t.fields[l]}o=l,a=u?"["+s+"]":"."+s})),{schema:t,parent:i,parentPath:o}):{parent:i,parentPath:e,schema:t}}var we=function(){function t(){this.list=new Set,this.refs=new Map}var e,r,n,o=t.prototype;return o.describe=function(){var t=[],e=this.list,r=Array.isArray(e),n=0;for(e=r?e:e[Symbol.iterator]();;){var i;if(r){if(n>=e.length)break;i=e[n++]}else{if((n=e.next()).done)break;i=n.value}var o=i;t.push(o)}var a=this.refs,s=Array.isArray(a),u=0;for(a=s?a:a[Symbol.iterator]();;){var c;if(s){if(u>=a.length)break;c=a[u++]}else{if((u=a.next()).done)break;c=u.value}var l=c[1];t.push(l.describe())}return t},o.toArray=function(){return Q(this.list).concat(Q(this.refs.values()))},o.add=function(t){ve.isRef(t)?this.refs.set(t.key,t):this.list.add(t)},o.delete=function(t){ve.isRef(t)?this.refs.delete(t.key):this.list.delete(t)},o.has=function(t,e){if(this.list.has(t))return!0;for(var r,n=this.refs.values();!(r=n.next()).done;)if(e(r.value)===t)return!0;return!1},o.clone=function(){var e=new t;return e.list=new Set(this.list),e.refs=new Map(this.refs),e},o.merge=function(t,e){var r=this.clone();return t.list.forEach((function(t){return r.add(t)})),t.refs.forEach((function(t){return r.add(t)})),e.list.forEach((function(t){return r.delete(t)})),e.refs.forEach((function(t){return r.delete(t)})),r},e=t,(r=[{key:"size",get:function(){return this.list.size+this.refs.size}}])&&i(e.prototype,r),n&&i(e,n),t}();function Se(t){var e=this;if(void 0===t&&(t={}),!(this instanceof Se))return new Se;this._deps=[],this._conditions=[],this._options={abortEarly:!0,recursive:!0},this._exclusive=Object.create(null),this._whitelist=new we,this._blacklist=new we,this.tests=[],this.transforms=[],this.withMutation((function(){e.typeError(st.notType)})),b(t,"default")&&(this._defaultDefault=t.default),this.type=t.type||"mixed",this._type=t.type||"mixed"}for(var Ee=Se.prototype={__isYupSchema__:!0,constructor:Se,clone:function(){var t=this;return this._mutate?this:w(this,(function(e){if(ht(e)&&e!==t)return e}))},label:function(t){var e=this.clone();return e._label=t,e},meta:function(t){if(0===arguments.length)return this._meta;var e=this.clone();return e._meta=n(e._meta||{},t),e},withMutation:function(t){var e=this._mutate;this._mutate=!0;var r=t(this);return this._mutate=e,r},concat:function(t){if(!t||t===this)return this;if(t._type!==this._type&&"mixed"!==this._type)throw new TypeError("You cannot `concat()` schema's of different types: "+this._type+" and "+t._type);var e=function t(e,r){for(var n in r)if(b(r,n)){var i=r[n],o=e[n];if(void 0===o)e[n]=i;else{if(o===i)continue;ht(o)?ht(i)&&(e[n]=i.concat(o)):Et(o)?Et(i)&&(e[n]=t(o,i)):Array.isArray(o)&&Array.isArray(i)&&(e[n]=i.concat(o))}}return e}(t.clone(),this);return b(t,"_default")&&(e._default=t._default),e.tests=this.tests,e._exclusive=this._exclusive,e._whitelist=this._whitelist.merge(t._whitelist,t._blacklist),e._blacklist=this._blacklist.merge(t._blacklist,t._whitelist),e.withMutation((function(e){t.tests.forEach((function(t){e.test(t.OPTIONS)}))})),e},isType:function(t){return!(!this._nullable||null!==t)||(!this._typeCheck||this._typeCheck(t))},resolve:function(t){var e=this;if(e._conditions.length){var r=e._conditions;(e=e.clone())._conditions=[],e=(e=r.reduce((function(e,r){return r.resolve(e,t)}),e)).resolve(t)}return e},cast:function(t,e){void 0===e&&(e={});var r=this.resolve(n({},e,{value:t})),i=r._cast(t,e);if(void 0!==t&&!1!==e.assert&&!0!==r.isType(i)){var o=at(t),a=at(i);throw new TypeError("The value of "+(e.path||"field")+' could not be cast to a value that satisfies the schema type: "'+r._type+'". \n\nattempted value: '+o+" \n"+(a!==o?"result of cast: "+a:""))}return i},_cast:function(t){var e=this,r=void 0===t?t:this.transforms.reduce((function(r,n){return n.call(e,r,t)}),t);return void 0===r&&b(this,"_default")&&(r=this.default()),r},_validate:function(t,e){var r=this;void 0===e&&(e={});var i=t,o=null!=e.originalValue?e.originalValue:t,a=this._option("strict",e),s=this._option("abortEarly",e),u=e.sync,c=e.path,l=this._label;a||(i=this._cast(i,n({assert:!1},e)));var p={value:i,path:c,schema:this,options:e,label:l,originalValue:o,sync:u};e.from&&(p.from=e.from);var f=[];return this._typeError&&f.push(this._typeError(p)),this._whitelistError&&f.push(this._whitelistError(p)),this._blacklistError&&f.push(this._blacklistError(p)),St({validations:f,endEarly:s,value:i,path:c,sync:u}).then((function(t){return St({path:c,sync:u,value:t,endEarly:s,validations:r.tests.map((function(t){return t(p)}))})}))},validate:function(t,e){return void 0===e&&(e={}),this.resolve(n({},e,{value:t}))._validate(t,e)},validateSync:function(t,e){var r,i;if(void 0===e&&(e={}),this.resolve(n({},e,{value:t}))._validate(t,n({},e,{sync:!0})).then((function(t){return r=t})).catch((function(t){return i=t})),i)throw i;return r},isValid:function(t,e){return this.validate(t,e).then((function(){return!0})).catch((function(t){if("ValidationError"===t.name)return!1;throw t}))},isValidSync:function(t,e){try{return this.validateSync(t,e),!0}catch(r){if("ValidationError"===r.name)return!1;throw r}},getDefault:function(t){return void 0===t&&(t={}),this.resolve(t).default()},default:function(t){if(0===arguments.length){var e=b(this,"_default")?this._default:this._defaultDefault;return"function"===typeof e?e.call(this):w(e)}var r=this.clone();return r._default=t,r},strict:function(t){void 0===t&&(t=!0);var e=this.clone();return e._options.strict=t,e},_isPresent:function(t){return null!=t},required:function(t){return void 0===t&&(t=st.required),this.test({message:t,name:"required",exclusive:!0,test:function(t){return this.schema._isPresent(t)}})},notRequired:function(){var t=this.clone();return t.tests=t.tests.filter((function(t){return"required"!==t.OPTIONS.name})),t},nullable:function(t){void 0===t&&(t=!0);var e=this.clone();return e._nullable=t,e},transform:function(t){var e=this.clone();return e.transforms.push(t),e},test:function(){var t;if(void 0===(t=1===arguments.length?"function"===typeof(arguments.length<=0?void 0:arguments[0])?{test:arguments.length<=0?void 0:arguments[0]}:arguments.length<=0?void 0:arguments[0]:2===arguments.length?{name:arguments.length<=0?void 0:arguments[0],test:arguments.length<=1?void 0:arguments[1]}:{name:arguments.length<=0?void 0:arguments[0],message:arguments.length<=1?void 0:arguments[1],test:arguments.length<=2?void 0:arguments[2]}).message&&(t.message=st.default),"function"!==typeof t.test)throw new TypeError("`test` is a required parameters");var e=this.clone(),r=be(t),n=t.exclusive||t.name&&!0===e._exclusive[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return e._exclusive[t.name]=!!t.exclusive,e.tests=e.tests.filter((function(e){if(e.OPTIONS.name===t.name){if(n)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0})),e.tests.push(r),e},when:function(t,e){1===arguments.length&&(e=t,t=".");var r=this.clone(),n=[].concat(t).map((function(t){return new ve(t)}));return n.forEach((function(t){t.isSibling&&r._deps.push(t.key)})),r._conditions.push(new dt(n,e)),r},typeError:function(t){var e=this.clone();return e._typeError=be({message:t,name:"typeError",test:function(t){return!(void 0!==t&&!this.schema.isType(t))||this.createError({params:{type:this.schema._type}})}}),e},oneOf:function(t,e){void 0===e&&(e=st.oneOf);var r=this.clone();return t.forEach((function(t){r._whitelist.add(t),r._blacklist.delete(t)})),r._whitelistError=be({message:e,name:"oneOf",test:function(t){if(void 0===t)return!0;var e=this.schema._whitelist;return!!e.has(t,this.resolve)||this.createError({params:{values:e.toArray().join(", ")}})}}),r},notOneOf:function(t,e){void 0===e&&(e=st.notOneOf);var r=this.clone();return t.forEach((function(t){r._blacklist.add(t),r._whitelist.delete(t)})),r._blacklistError=be({message:e,name:"notOneOf",test:function(t){var e=this.schema._blacklist;return!e.has(t,this.resolve)||this.createError({params:{values:e.toArray().join(", ")}})}}),r},strip:function(t){void 0===t&&(t=!0);var e=this.clone();return e._strip=t,e},_option:function(t,e){return b(e,t)?e[t]:this._options[t]},describe:function(){var t=this.clone(),e={type:t._type,meta:t._meta,label:t._label,tests:t.tests.map((function(t){return{name:t.OPTIONS.name,params:t.OPTIONS.params}})).filter((function(t,e,r){return r.findIndex((function(e){return e.name===t.name}))===e}))};return t._whitelist.size&&(e.oneOf=t._whitelist.describe()),t._blacklist.size&&(e.notOneOf=t._blacklist.describe()),e},defined:function(t){return void 0===t&&(t=st.defined),this.nullable().test({message:t,name:"defined",exclusive:!0,test:function(t){return void 0!==t}})}},Oe=function(){var t=Ae[Te];Ee[t+"At"]=function(e,r,i){void 0===i&&(i={});var o=xe(this,e,r,i.context),a=o.parent,s=o.parentPath;return o.schema[t](a&&a[s],n({},i,{parent:a,path:e}))}},Te=0,Ae=["validate","validateSync"];Te0},length:function(t,e){return void 0===e&&(e=ut.length),this.test({message:e,name:"length",exclusive:!0,params:{length:t},test:function(e){return ze(e)||e.length===this.resolve(t)}})},min:function(t,e){return void 0===e&&(e=ut.min),this.test({message:e,name:"min",exclusive:!0,params:{min:t},test:function(e){return ze(e)||e.length>=this.resolve(t)}})},max:function(t,e){return void 0===e&&(e=ut.max),this.test({name:"max",exclusive:!0,message:e,params:{max:t},test:function(e){return ze(e)||e.length<=this.resolve(t)}})},matches:function(t,e){var r,n,i=!1;return e&&("object"===typeof e?(i=e.excludeEmptyString,r=e.message,n=e.name):r=e),this.test({name:n||"matches",message:r||ut.matches,params:{regex:t},test:function(e){return ze(e)||""===e&&i||-1!==e.search(t)}})},email:function(t){return void 0===t&&(t=ut.email),this.matches(Le,{name:"email",message:t,excludeEmptyString:!0})},url:function(t){return void 0===t&&(t=ut.url),this.matches(Re,{name:"url",message:t,excludeEmptyString:!0})},ensure:function(){return this.default("").transform((function(t){return null===t?"":t}))},trim:function(t){return void 0===t&&(t=ut.trim),this.transform((function(t){return null!=t?t.trim():t})).test({message:t,name:"trim",test:De})},lowercase:function(t){return void 0===t&&(t=ut.lowercase),this.transform((function(t){return ze(t)?t:t.toLowerCase()})).test({message:t,name:"string_case",exclusive:!0,test:function(t){return ze(t)||t===t.toLowerCase()}})},uppercase:function(t){return void 0===t&&(t=ut.uppercase),this.transform((function(t){return ze(t)?t:t.toUpperCase()})).test({message:t,name:"string_case",exclusive:!0,test:function(t){return ze(t)||t===t.toUpperCase()}})}});je((function t(){var e=this;if(!(this instanceof t))return new t;Se.call(this,{type:"number"}),this.withMutation((function(){e.transform((function(t){var e=t;if("string"===typeof e){if(""===(e=e.replace(/\s/g,"")))return NaN;e=+e}return this.isType(e)?e:parseFloat(e)}))}))}),Se,{_typeCheck:function(t){return t instanceof Number&&(t=t.valueOf()),"number"===typeof t&&!function(t){return t!=+t}(t)},min:function(t,e){return void 0===e&&(e=ct.min),this.test({message:e,name:"min",exclusive:!0,params:{min:t},test:function(e){return ze(e)||e>=this.resolve(t)}})},max:function(t,e){return void 0===e&&(e=ct.max),this.test({message:e,name:"max",exclusive:!0,params:{max:t},test:function(e){return ze(e)||e<=this.resolve(t)}})},lessThan:function(t,e){return void 0===e&&(e=ct.lessThan),this.test({message:e,name:"max",exclusive:!0,params:{less:t},test:function(e){return ze(e)||ethis.resolve(t)}})},positive:function(t){return void 0===t&&(t=ct.positive),this.moreThan(0,t)},negative:function(t){return void 0===t&&(t=ct.negative),this.lessThan(0,t)},integer:function(t){return void 0===t&&(t=ct.integer),this.test({name:"integer",message:t,test:function(t){return ze(t)||Number.isInteger(t)}})},truncate:function(){return this.transform((function(t){return ze(t)?t:0|t}))},round:function(t){var e=["ceil","floor","round","trunc"];if("trunc"===(t=t&&t.toLowerCase()||"round"))return this.truncate();if(-1===e.indexOf(t.toLowerCase()))throw new TypeError("Only valid options for round() are: "+e.join(", "));return this.transform((function(e){return ze(e)?e:Math[t](e)}))}});var Be=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;var Ne=new Date("");function Ue(){var t=this;if(!(this instanceof Ue))return new Ue;Se.call(this,{type:"date"}),this.withMutation((function(){t.transform((function(t){return this.isType(t)?t:(t=function(t){var e,r,n=[1,4,5,6,7,10,11],i=0;if(r=Be.exec(t)){for(var o,a=0;o=n[a];++a)r[o]=+r[o]||0;r[2]=(+r[2]||1)-1,r[3]=+r[3]||1,r[7]=r[7]?String(r[7]).substr(0,3):0,void 0!==r[8]&&""!==r[8]||void 0!==r[9]&&""!==r[9]?("Z"!==r[8]&&void 0!==r[9]&&(i=60*r[10]+r[11],"+"===r[9]&&(i=0-i)),e=Date.UTC(r[1],r[2],r[3],r[4],r[5]+i,r[6],r[7])):e=+new Date(r[1],r[2],r[3],r[4],r[5],r[6],r[7])}else e=Date.parse?Date.parse(t):NaN;return e}(t),isNaN(t)?Ne:new Date(t))}))}))}function Ve(t,e){return e||(e=t.slice(0)),t.raw=e,t}je(Ue,Se,{_typeCheck:function(t){return e=t,"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(t.getTime());var e},min:function(t,e){void 0===e&&(e=lt.min);var r=t;if(!ve.isRef(r)&&(r=this.cast(t),!this._typeCheck(r)))throw new TypeError("`min` must be a Date or a value that can be `cast()` to a Date");return this.test({message:e,name:"min",exclusive:!0,params:{min:t},test:function(t){return ze(t)||t>=this.resolve(r)}})},max:function(t,e){void 0===e&&(e=lt.max);var r=t;if(!ve.isRef(r)&&(r=this.cast(t),!this._typeCheck(r)))throw new TypeError("`max` must be a Date or a value that can be `cast()` to a Date");return this.test({message:e,name:"max",exclusive:!0,params:{max:t},test:function(t){return ze(t)||t<=this.resolve(r)}})}});var qe=function(t,e,r,n){var i=-1,o=null==t?0:t.length;for(n&&o&&(r=t[++i]);++ii?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n=n?t:gr(t,e,r)};var br=function(t){return function(e){e=Object(h.a)(e);var r=L(e)?K(e):void 0,n=r?r[0]:e.charAt(0),i=r?_r(r,1).join(""):e.slice(1);return n[t]()+i}}("toUpperCase");var xr=function(t){return br(Object(h.a)(t).toLowerCase())},wr=yr((function(t,e,r){return e=e.toLowerCase(),t+(r?xr(e):e)}));var Sr=function(t,e){var r={};return e=fe(e,3),At(t,(function(t,n,i){Object(Ot.a)(r,e(t,n,i),t)})),r},Er=r(322),Or=r.n(Er);function Tr(t,e){void 0===e&&(e=[]);var r=[],n=[];function i(t,i){var o=Object(de.split)(t)[0];~n.indexOf(o)||n.push(o),~e.indexOf(i+"-"+o)||r.push([i,o])}for(var o in t)if(b(t,o)){var a=t[o];~n.indexOf(o)||n.push(o),ve.isRef(a)&&a.isSibling?i(a.path,o):ht(a)&&a._deps&&a._deps.forEach((function(t){return i(t,o)}))}return Or.a.array(n,r).reverse()}function Ar(t,e){var r=1/0;return t.some((function(t,n){if(-1!==e.path.indexOf(t))return r=n,!0})),r}function kr(t){var e=Object.keys(t);return function(t,r){return Ar(e,t)-Ar(e,r)}}function Ir(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n0},of:function(t){var e=this.clone();if(!1!==t&&!ht(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema, or `false` to negate a current sub-schema. not: "+at(t));return e._subType=t,e.innerType=t,e},min:function(t,e){return e=e||ft.min,this.test({message:e,name:"min",exclusive:!0,params:{min:t},test:function(e){return ze(e)||e.length>=this.resolve(t)}})},max:function(t,e){return e=e||ft.max,this.test({message:e,name:"max",exclusive:!0,params:{max:t},test:function(e){return ze(e)||e.length<=this.resolve(t)}})},ensure:function(){var t=this;return this.default((function(){return[]})).transform((function(e,r){return t._typeCheck(e)?e:null==r?[]:[].concat(r)}))},compact:function(t){var e=t?function(e,r,n){return!t(e,r,n)}:function(t){return!!t};return this.transform((function(t){return null!=t?t.filter(e):t}))},describe:function(){var t=Se.prototype.describe.call(this);return this.innerType&&(t.innerType=this.innerType.describe()),t}});var Br=function(){function t(t){this._resolve=function(e,r){var n=t(e,r);if(!ht(n))throw new TypeError("lazy() functions must return a valid schema");return n.resolve(r)}}var e=t.prototype;return e.resolve=function(t){return this._resolve(t.value,t)},e.cast=function(t,e){return this._resolve(t,e).cast(t,e)},e.validate=function(t,e){return this._resolve(t,e).validate(t,e)},e.validateSync=function(t,e){return this._resolve(t,e).validateSync(t,e)},e.validateAt=function(t,e,r){return this._resolve(e,r).validateAt(t,e,r)},e.validateSyncAt=function(t,e,r){return this._resolve(e,r).validateSyncAt(t,e,r)},t}();Br.prototype.__isYupSchema__=!0;r.d(e,"c",(function(){return Fe})),r.d(e,"b",(function(){return zr})),r.d(e,"a",(function(){return Dr}))},function(t,e,r){var n=r(133),i=r(376),o=r(377),a=r(378),s=r(379),u=r(380);function c(t){var e=this.__data__=new n(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},function(t,e,r){var n=r(371),i=r(372),o=r(373),a=r(374),s=r(375);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1}},function(t,e){var r=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return r.test(t)}},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length;++r0&&o(l)?r>1?t(l,r-1,o,a,s):n(s,l):a||(s[s.length]=l)}return s}},function(t,e,r){var n=r(490),i=r(491),o=r(265),a=r(492);t.exports=function(t){return n(t)||i(t)||o(t)||a()}},function(t,e,r){var n=r(153),i=r(42);t.exports=function(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=n(t.prototype),o=t.apply(r,e);return i(o)?o:r}}},function(t,e,r){var n=r(42),i=Object.create,o=function(){function t(){}return function(e){if(!n(e))return{};if(i)return i(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();t.exports=o},function(t,e,r){"use strict";t.exports=r(423)},function(t,e){t.exports=function(){}},function(t,e,r){var n=r(48),i=r(189),o=r(32),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=n(t))return!1;var e=i(t);if(null===e)return!0;var r=c.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},function(t,e,r){var n=r(368)(r(203));t.exports=n},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(126);function i(t,e){if(t){if("string"===typeof t)return Object(n.a)(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(t,e):void 0}}},function(t,e,r){var n=r(433),i=r(66),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");t.exports=function(t){return(t=i(t))&&t.replace(o,n).replace(a,"")}},function(t,e,r){"use strict";r.d(e,"d",(function(){return E})),r.d(e,"e",(function(){return O})),r.d(e,"a",(function(){return T})),r.d(e,"b",(function(){return A})),r.d(e,"c",(function(){return k}));var n=r(15),i=r.n(n),o=(r(57),r(204)),a=r.n(o),s=r(18),u=r.n(s),c=r(156),l=r.n(c),p=r(56),f=r.n(p),h=r(309),d=r.n(h),m=r(124),y=r.n(m),v=r(310),g=r.n(v),_=r(9),b=r.n(_),x=r(4),w=r.n(x),S=r(0);function E(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("function"!==typeof t&&"string"!==typeof t)throw new Error("createShorthand() Component must be a string or function.");if(b()(r)||g()(r))return null;var o=y()(r),s=d()(r),c=f()(r),p=Object(S.isValidElement)(r),h=l()(r),m=o||s||u()(r);if(!c&&!p&&!h&&!m)return null;var v=n.defaultProps,_=void 0===v?{}:v,x=p&&r.props||h&&r||m&&e(r),E=n.overrideProps,O=void 0===E?{}:E;O=f()(O)?O(i()({},_,x)):O;var T=i()({},_,x,O);if(_.className||O.className||x.className){var A=w()(_.className,O.className,x.className);T.className=a()(A.split(" ")).join(" ")}if((_.style||O.style||x.style)&&(T.style=i()({},_.style,x.style,O.style)),b()(T.key)){var k=T.childKey,I=n.autoGenerateKey,C=void 0===I||I;b()(k)?C&&(o||s)&&(T.key=r):(T.key="function"===typeof k?k(T):k,delete T.childKey)}return p?Object(S.cloneElement)(r,T):m||h?S.default.createElement(t,T):c?r(t,T,T.children):void 0}function O(t,e){if("function"!==typeof t&&"string"!==typeof t)throw new Error("createShorthandFactory() Component must be a string or function.");return function(r,n){return E(t,e,r,n)}}E.handledProps=[];O("div",(function(t){return{children:t}})),O("iframe",(function(t){return{src:t}})),O("img",(function(t){return{src:t}}));var T=O("input",(function(t){return{type:t}})),A=O("label",(function(t){return{children:t}})),k=O("p",(function(t){return{children:t}}))},function(t,e,r){"use strict";(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.a=r}).call(this,r(51))},function(t,e,r){"use strict";var n=r(34),i=r(43);e.a=function(t){if(!Object(i.a)(t))return!1;var e=Object(n.a)(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,r){"use strict";e.a=function(t,e){return function(r){return t(e(r))}}},function(t,e,r){"use strict";e.a=function(){return[]}},function(t,e,r){"use strict";e.a=function(t,e){for(var r=-1,n=e.length,i=t.length;++r-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}},function(t,e,r){var n=r(18),i=r(119),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!i(t))||(a.test(t)||!o.test(t)||null!=e&&t in Object(e))}},function(t,e,r){var n=r(78),i=r(79),o=r(18),a=r(119),s=n?n.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return u?u.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}},function(t,e){t.exports=function(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?wt:xt)(t)},Et=Math.min,Ot=function(t){return t>0?Et(St(t),9007199254740991):0},Tt=Math.max,At=Math.min,kt=function(t){return function(e,r,n){var i,o=j(e),a=Ot(o.length),s=function(t,e){var r=St(t);return r<0?Tt(r+e,0):At(r,e)}(n,a);if(t&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((t||s in o)&&o[s]===r)return t||s||0;return!t&&-1}},It={includes:kt(!0),indexOf:kt(!1)},Ct=It.indexOf,Pt=function(t,e){var r,n=j(t),i=0,o=[];for(r in n)!R(ut,r)&&R(n,r)&&o.push(r);for(;e.length>i;)R(n,r=e[i++])&&(~Ct(o,r)||o.push(r));return o},jt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mt=jt.concat("length","prototype"),zt={f:Object.getOwnPropertyNames||function(t){return Pt(t,Mt)}},Lt={f:Object.getOwnPropertySymbols},Rt=bt("Reflect","ownKeys")||function(t){var e=zt.f(q(t)),r=Lt.f;return r?e.concat(r(t)):e},Dt=function(t,e){for(var r=Rt(e),n=G.f,i=V.f,o=0;o1?arguments[1]:void 0,e.length)),n=String(t);return ie?ie.call(e,n,r):e.slice(r,r+n.length)===n}});var ue,ce,le,pe=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},fe=function(t,e,r){if(pe(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}},he=Function.call,de=function(t,e,r){return fe(he,b[t].prototype[e],r)},me=(de("String","startsWith"),function(t){return function(e,r){var n,i,o=String(P(e)),a=St(r),s=o.length;return a<0||a>=s?t?"":void 0:(n=o.charCodeAt(a))<55296||n>56319||a+1===s||(i=o.charCodeAt(a+1))<56320||i>57343?t?o.charAt(a):n:t?o.slice(a,a+2):i-56320+(n-55296<<10)+65536}}),ye={codeAt:me(!1),charAt:me(!0)},ve=function(t){return Object(P(t))},ge=!x((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),_e=st("IE_PROTO"),be=Object.prototype,xe=ge?Object.getPrototypeOf:function(t){return t=ve(t),R(t,_e)?t[_e]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?be:null},we=$t("iterator"),Se=!1;[].keys&&("next"in(le=[].keys())?(ce=xe(xe(le)))!==Object.prototype&&(ue=ce):Se=!0),null==ue&&(ue={}),R(ue,we)||W(ue,we,(function(){return this}));var Ee,Oe={IteratorPrototype:ue,BUGGY_SAFARI_ITERATORS:Se},Te=Object.keys||function(t){return Pt(t,jt)},Ae=w?Object.defineProperties:function(t,e){q(t);for(var r,n=Te(e),i=n.length,o=0;i>o;)G.f(t,r=n[o++],e[r]);return t},ke=bt("document","documentElement"),Ie=st("IE_PROTO"),Ce=function(){},Pe=function(t){return"