diff --git a/asset-manifest.json b/asset-manifest.json new file mode 100644 index 0000000..c2a2718 --- /dev/null +++ b/asset-manifest.json @@ -0,0 +1,20 @@ +{ + "files": { + "main.css": "/mapc.github.io/60th-site/static/css/main.562c4255.css", + "main.js": "/mapc.github.io/60th-site/static/js/main.7baa0e95.js", + "static/js/787.2898c687.chunk.js": "/mapc.github.io/60th-site/static/js/787.2898c687.chunk.js", + "static/media/timeline.png": "/mapc.github.io/60th-site/static/media/timeline.7e712a9c0e532f1497d7.png", + "static/media/60th-timeline.pdf": "/mapc.github.io/60th-site/static/media/60th-timeline.b359e4a8e192f115a15e.pdf", + "static/media/mapc-fullcolor.png": "/mapc.github.io/60th-site/static/media/mapc-fullcolor.192d955d847e7e316d17.png", + "static/media/mapc-duotone.svg": "/mapc.github.io/60th-site/static/media/mapc-duotone.b8494c38f300fbf5f9eafb9ddbb28f58.svg", + "static/media/mapc-semitransparent.svg": "/mapc.github.io/60th-site/static/media/mapc-semitransparent.67de706a3feb52b3a3937517efa25bd5.svg", + "index.html": "/mapc.github.io/60th-site/index.html", + "main.562c4255.css.map": "/mapc.github.io/60th-site/static/css/main.562c4255.css.map", + "main.7baa0e95.js.map": "/mapc.github.io/60th-site/static/js/main.7baa0e95.js.map", + "787.2898c687.chunk.js.map": "/mapc.github.io/60th-site/static/js/787.2898c687.chunk.js.map" + }, + "entrypoints": [ + "static/css/main.562c4255.css", + "static/js/main.7baa0e95.js" + ] +} \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..aabbf2a Binary files /dev/null and b/favicon.ico differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..f971fc0 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +60th Anniversary Timeline
\ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/static/css/main.562c4255.css b/static/css/main.562c4255.css new file mode 100644 index 0000000..fb8d2df --- /dev/null +++ b/static/css/main.562c4255.css @@ -0,0 +1,2 @@ +body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:#00332d;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0;overflow:hidden}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.App{text-align:center}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion:no-preference){.App-logo{-webkit-animation:App-logo-spin 20s linear infinite;animation:App-logo-spin 20s linear infinite}}.App-header{align-items:center;background-color:#282c34;color:#fff;display:flex;flex-direction:column;font-size:calc(10px + 2vmin);justify-content:center;min-height:100vh}.App-link{color:#61dafb}@-webkit-keyframes App-logo-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes App-logo-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}#timeline{overflow-x:hidden;overflow-y:hidden;width:100vw}#nav{background-color:#efefe7;height:3.25rem;margin-bottom:1rem;padding:.5rem}#nav,#title{color:#00332d}#title{font-size:20px;font-weight:700;padding-left:1rem;position:absolute}.NavButton{background-color:#efefe7;cursor:pointer;float:right;font-size:large;margin-right:.25rem;padding:.75rem}.NavButton:hover{background-color:#dddcd1} +/*# sourceMappingURL=main.562c4255.css.map*/ \ No newline at end of file diff --git a/static/css/main.562c4255.css.map b/static/css/main.562c4255.css.map new file mode 100644 index 0000000..0b41802 --- /dev/null +++ b/static/css/main.562c4255.css.map @@ -0,0 +1 @@ +{"version":3,"file":"static/css/main.562c4255.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAClC,wBAAyB,CAJzB,mIAC4C,CAF5C,QAAS,CADT,eAOF,CAEA,KACE,uEACF,CCZA,KACE,iBACF,CAEA,UACE,aAAc,CACd,mBACF,CAEA,8CACE,UACE,mDAA4C,CAA5C,2CACF,CACF,CAEA,YAKE,kBAAmB,CAJnB,wBAAyB,CAOzB,UAAY,CALZ,YAAa,CACb,qBAAsB,CAGtB,4BAA6B,CAD7B,sBAAuB,CAJvB,gBAOF,CAEA,UACE,aACF,CAEA,iCACE,GACE,8BAAuB,CAAvB,sBACF,CACA,GACE,+BAAyB,CAAzB,uBACF,CACF,CAPA,yBACE,GACE,8BAAuB,CAAvB,sBACF,CACA,GACE,+BAAyB,CAAzB,uBACF,CACF,CAEA,UAGE,iBAAkB,CAClB,iBAAkB,CAHlB,WAIF,CAEA,KACE,wBAAyB,CAEzB,cAAe,CACf,kBAAmB,CACnB,aACF,CAEA,YANE,aAYF,CANA,OAGE,cAAe,CADf,eAAiB,CAGjB,iBAAkB,CADlB,iBAEF,CAEA,WAIE,wBAAyB,CAEzB,cAAe,CALf,WAAY,CAIZ,eAAgB,CAFhB,mBAAqB,CADrB,cAKF,CAEA,iBACE,wBACF","sources":["index.css","App.css"],"sourcesContent":["body {\n overflow: hidden;\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\",\n \"Droid Sans\", \"Helvetica Neue\", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background-color: #00332d;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\n",".App {\n text-align: center;\n}\n\n.App-logo {\n height: 40vmin;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n }\n}\n\n.App-header {\n background-color: #282c34;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: calc(10px + 2vmin);\n color: white;\n}\n\n.App-link {\n color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n#timeline {\n width: 100vw;\n\n overflow-x: hidden;\n overflow-y: hidden;\n}\n\n#nav {\n background-color: #efefe7;\n color: #00332d;\n height: 3.25rem;\n margin-bottom: 1rem;\n padding: 0.5rem;\n}\n\n#title {\n color: #00332d;\n font-weight: bold;\n font-size: 20px;\n position: absolute;\n padding-left: 1rem;\n}\n\n.NavButton {\n float: right;\n padding: 0.75rem;\n margin-right: 0.25rem;\n background-color: #efefe7;\n font-size: large;\n cursor: pointer;\n}\n\n.NavButton:hover {\n background-color: #dddcd1;\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/static/js/787.2898c687.chunk.js b/static/js/787.2898c687.chunk.js new file mode 100644 index 0000000..ad61eae --- /dev/null +++ b/static/js/787.2898c687.chunk.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunk_60th_site=self.webpackChunk_60th_site||[]).push([[787],{787:function(e,t,n){n.r(t),n.d(t,{getCLS:function(){return y},getFCP:function(){return h},getFID:function(){return C},getLCP:function(){return P},getTTFB:function(){return D}});var i,r,a,o,u=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},c=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},f=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},s=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},m=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},v=-1,p=function(){return"hidden"===document.visibilityState?0:1/0},d=function(){f((function(e){var t=e.timeStamp;v=t}),!0)},l=function(){return v<0&&(v=p(),d(),s((function(){setTimeout((function(){v=p(),d()}),0)}))),{get firstHiddenTime(){return v}}},h=function(e,t){var n,i=l(),r=u("FCP"),a=function(e){"first-contentful-paint"===e.name&&(f&&f.disconnect(),e.startTime-1&&e(t)},r=u("CLS",0),a=0,o=[],v=function(e){if(!e.hadRecentInput){var t=o[0],i=o[o.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,o.push(e)):(a=e.value,o=[e]),a>r.value&&(r.value=a,r.entries=o,n())}},p=c("layout-shift",v);p&&(n=m(i,r,t),f((function(){p.takeRecords().map(v),n(!0)})),s((function(){a=0,T=-1,r=u("CLS",0),n=m(i,r,t)})))},E={passive:!0,capture:!0},w=new Date,L=function(e,t){i||(i=t,r=e,a=new Date,F(removeEventListener),S())},S=function(){if(r>=0&&r1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){L(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,E),removeEventListener("pointercancel",i,E)};addEventListener("pointerup",n,E),addEventListener("pointercancel",i,E)}(t,e):L(t,e)}},F=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,E)}))},C=function(e,t){var n,a=l(),v=u("FID"),p=function(e){e.startTimeperformance.now())return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("load",(function(){return setTimeout(t,0)}))}}}]); +//# sourceMappingURL=787.2898c687.chunk.js.map \ No newline at end of file diff --git a/static/js/787.2898c687.chunk.js.map b/static/js/787.2898c687.chunk.js.map new file mode 100644 index 0000000..351697b --- /dev/null +++ b/static/js/787.2898c687.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"static/js/787.2898c687.chunk.js","mappings":"yQAAA,IAAIA,EAAEC,EAAEC,EAAEC,EAAEC,EAAE,SAASJ,EAAEC,GAAG,MAAM,CAACI,KAAKL,EAAEM,WAAM,IAASL,GAAG,EAAEA,EAAEM,MAAM,EAAEC,QAAQ,GAAGC,GAAG,MAAMC,OAAOC,KAAKC,MAAM,KAAKF,OAAOG,KAAKC,MAAM,cAAcD,KAAKE,UAAU,MAAM,EAAEC,EAAE,SAAShB,EAAEC,GAAG,IAAI,GAAGgB,oBAAoBC,oBAAoBC,SAASnB,GAAG,CAAC,GAAG,gBAAgBA,KAAK,2BAA2BoB,MAAM,OAAO,IAAIlB,EAAE,IAAIe,qBAAqB,SAASjB,GAAG,OAAOA,EAAEqB,aAAaC,IAAIrB,EAAE,IAAI,OAAOC,EAAEqB,QAAQ,CAACC,KAAKxB,EAAEyB,UAAS,IAAKvB,CAAC,CAAC,CAAC,MAAMF,GAAG,CAAC,EAAE0B,EAAE,SAAS1B,EAAEC,GAAG,IAAIC,EAAE,SAASA,EAAEC,GAAG,aAAaA,EAAEqB,MAAM,WAAWG,SAASC,kBAAkB5B,EAAEG,GAAGF,IAAI4B,oBAAoB,mBAAmB3B,GAAE,GAAI2B,oBAAoB,WAAW3B,GAAE,IAAK,EAAE4B,iBAAiB,mBAAmB5B,GAAE,GAAI4B,iBAAiB,WAAW5B,GAAE,EAAG,EAAE6B,EAAE,SAAS/B,GAAG8B,iBAAiB,YAAY,SAAS7B,GAAGA,EAAE+B,WAAWhC,EAAEC,EAAE,IAAG,EAAG,EAAEgC,EAAE,SAASjC,EAAEC,EAAEC,GAAG,IAAIC,EAAE,OAAO,SAASC,GAAGH,EAAEK,OAAO,IAAIF,GAAGF,KAAKD,EAAEM,MAAMN,EAAEK,OAAOH,GAAG,IAAIF,EAAEM,YAAO,IAASJ,KAAKA,EAAEF,EAAEK,MAAMN,EAAEC,IAAI,CAAC,EAAEiC,GAAG,EAAEC,EAAE,WAAW,MAAM,WAAWR,SAASC,gBAAgB,EAAE,GAAG,EAAEQ,EAAE,WAAWV,GAAG,SAAS1B,GAAG,IAAIC,EAAED,EAAEqC,UAAUH,EAAEjC,CAAC,IAAG,EAAG,EAAEqC,EAAE,WAAW,OAAOJ,EAAE,IAAIA,EAAEC,IAAIC,IAAIL,GAAG,WAAWQ,YAAY,WAAWL,EAAEC,IAAIC,GAAG,GAAG,EAAE,KAAK,CAAC,mBAAII,GAAkB,OAAON,CAAC,EAAE,EAAEO,EAAE,SAASzC,EAAEC,GAAG,IAAIC,EAAEC,EAAEmC,IAAIZ,EAAEtB,EAAE,OAAO8B,EAAE,SAASlC,GAAG,2BAA2BA,EAAEK,OAAO+B,GAAGA,EAAEM,aAAa1C,EAAE2C,UAAUxC,EAAEqC,kBAAkBd,EAAEpB,MAAMN,EAAE2C,UAAUjB,EAAElB,QAAQoC,KAAK5C,GAAGE,GAAE,IAAK,EAAEiC,EAAEU,OAAOC,aAAaA,YAAYC,kBAAkBD,YAAYC,iBAAiB,0BAA0B,GAAGX,EAAED,EAAE,KAAKnB,EAAE,QAAQkB,IAAIC,GAAGC,KAAKlC,EAAE+B,EAAEjC,EAAE0B,EAAEzB,GAAGkC,GAAGD,EAAEC,GAAGJ,GAAG,SAAS5B,GAAGuB,EAAEtB,EAAE,OAAOF,EAAE+B,EAAEjC,EAAE0B,EAAEzB,GAAG+C,uBAAuB,WAAWA,uBAAuB,WAAWtB,EAAEpB,MAAMwC,YAAYlC,MAAMT,EAAEkC,UAAUnC,GAAE,EAAG,GAAG,GAAG,IAAI,EAAE+C,GAAE,EAAGC,GAAG,EAAEC,EAAE,SAASnD,EAAEC,GAAGgD,IAAIR,GAAG,SAASzC,GAAGkD,EAAElD,EAAEM,KAAK,IAAI2C,GAAE,GAAI,IAAI/C,EAAEC,EAAE,SAASF,GAAGiD,GAAG,GAAGlD,EAAEC,EAAE,EAAEiC,EAAE9B,EAAE,MAAM,GAAG+B,EAAE,EAAEC,EAAE,GAAGE,EAAE,SAAStC,GAAG,IAAIA,EAAEoD,eAAe,CAAC,IAAInD,EAAEmC,EAAE,GAAGjC,EAAEiC,EAAEA,EAAEiB,OAAO,GAAGlB,GAAGnC,EAAE2C,UAAUxC,EAAEwC,UAAU,KAAK3C,EAAE2C,UAAU1C,EAAE0C,UAAU,KAAKR,GAAGnC,EAAEM,MAAM8B,EAAEQ,KAAK5C,KAAKmC,EAAEnC,EAAEM,MAAM8B,EAAE,CAACpC,IAAImC,EAAED,EAAE5B,QAAQ4B,EAAE5B,MAAM6B,EAAED,EAAE1B,QAAQ4B,EAAElC,IAAI,CAAC,EAAEiD,EAAEnC,EAAE,eAAesB,GAAGa,IAAIjD,EAAE+B,EAAE9B,EAAE+B,EAAEjC,GAAGyB,GAAG,WAAWyB,EAAEG,cAAchC,IAAIgB,GAAGpC,GAAE,EAAG,IAAI6B,GAAG,WAAWI,EAAE,EAAEe,GAAG,EAAEhB,EAAE9B,EAAE,MAAM,GAAGF,EAAE+B,EAAE9B,EAAE+B,EAAEjC,EAAE,IAAI,EAAEsD,EAAE,CAACC,SAAQ,EAAGC,SAAQ,GAAIC,EAAE,IAAI/C,KAAKgD,EAAE,SAASxD,EAAEC,GAAGJ,IAAIA,EAAEI,EAAEH,EAAEE,EAAED,EAAE,IAAIS,KAAKiD,EAAE/B,qBAAqBgC,IAAI,EAAEA,EAAE,WAAW,GAAG5D,GAAG,GAAGA,EAAEC,EAAEwD,EAAE,CAAC,IAAItD,EAAE,CAAC0D,UAAU,cAAczD,KAAKL,EAAEwB,KAAKuC,OAAO/D,EAAE+D,OAAOC,WAAWhE,EAAEgE,WAAWrB,UAAU3C,EAAEqC,UAAU4B,gBAAgBjE,EAAEqC,UAAUpC,GAAGE,EAAE+D,SAAS,SAASlE,GAAGA,EAAEI,EAAE,IAAID,EAAE,EAAE,CAAC,EAAEgE,EAAE,SAASnE,GAAG,GAAGA,EAAEgE,WAAW,CAAC,IAAI/D,GAAGD,EAAEqC,UAAU,KAAK,IAAI1B,KAAKmC,YAAYlC,OAAOZ,EAAEqC,UAAU,eAAerC,EAAEwB,KAAK,SAASxB,EAAEC,GAAG,IAAIC,EAAE,WAAWyD,EAAE3D,EAAEC,GAAGG,GAAG,EAAED,EAAE,WAAWC,GAAG,EAAEA,EAAE,WAAWyB,oBAAoB,YAAY3B,EAAEqD,GAAG1B,oBAAoB,gBAAgB1B,EAAEoD,EAAE,EAAEzB,iBAAiB,YAAY5B,EAAEqD,GAAGzB,iBAAiB,gBAAgB3B,EAAEoD,EAAE,CAAhO,CAAkOtD,EAAED,GAAG2D,EAAE1D,EAAED,EAAE,CAAC,EAAE4D,EAAE,SAAS5D,GAAG,CAAC,YAAY,UAAU,aAAa,eAAekE,SAAS,SAASjE,GAAG,OAAOD,EAAEC,EAAEkE,EAAEZ,EAAE,GAAG,EAAEa,EAAE,SAASlE,EAAEgC,GAAG,IAAIC,EAAEC,EAAEE,IAAIG,EAAErC,EAAE,OAAO6C,EAAE,SAASjD,GAAGA,EAAE2C,UAAUP,EAAEI,kBAAkBC,EAAEnC,MAAMN,EAAEiE,gBAAgBjE,EAAE2C,UAAUF,EAAEjC,QAAQoC,KAAK5C,GAAGmC,GAAE,GAAI,EAAEe,EAAElC,EAAE,cAAciC,GAAGd,EAAEF,EAAE/B,EAAEuC,EAAEP,GAAGgB,GAAGxB,GAAG,WAAWwB,EAAEI,cAAchC,IAAI2B,GAAGC,EAAER,YAAY,IAAG,GAAIQ,GAAGnB,GAAG,WAAW,IAAIf,EAAEyB,EAAErC,EAAE,OAAO+B,EAAEF,EAAE/B,EAAEuC,EAAEP,GAAG/B,EAAE,GAAGF,GAAG,EAAED,EAAE,KAAK4D,EAAE9B,kBAAkBd,EAAEiC,EAAE9C,EAAEyC,KAAK5B,GAAG6C,GAAG,GAAG,EAAEQ,EAAE,CAAC,EAAEC,EAAE,SAAStE,EAAEC,GAAG,IAAIC,EAAEC,EAAEmC,IAAIJ,EAAE9B,EAAE,OAAO+B,EAAE,SAASnC,GAAG,IAAIC,EAAED,EAAE2C,UAAU1C,EAAEE,EAAEqC,kBAAkBN,EAAE5B,MAAML,EAAEiC,EAAE1B,QAAQoC,KAAK5C,GAAGE,IAAI,EAAEkC,EAAEpB,EAAE,2BAA2BmB,GAAG,GAAGC,EAAE,CAAClC,EAAE+B,EAAEjC,EAAEkC,EAAEjC,GAAG,IAAIwC,EAAE,WAAW4B,EAAEnC,EAAEzB,MAAM2B,EAAEkB,cAAchC,IAAIa,GAAGC,EAAEM,aAAa2B,EAAEnC,EAAEzB,KAAI,EAAGP,GAAE,GAAI,EAAE,CAAC,UAAU,SAASgE,SAAS,SAASlE,GAAG8B,iBAAiB9B,EAAEyC,EAAE,CAAC8B,MAAK,EAAGd,SAAQ,GAAI,IAAI/B,EAAEe,GAAE,GAAIV,GAAG,SAAS5B,GAAG+B,EAAE9B,EAAE,OAAOF,EAAE+B,EAAEjC,EAAEkC,EAAEjC,GAAG+C,uBAAuB,WAAWA,uBAAuB,WAAWd,EAAE5B,MAAMwC,YAAYlC,MAAMT,EAAEkC,UAAUgC,EAAEnC,EAAEzB,KAAI,EAAGP,GAAE,EAAG,GAAG,GAAG,GAAG,CAAC,EAAEsE,EAAE,SAASxE,GAAG,IAAIC,EAAEC,EAAEE,EAAE,QAAQH,EAAE,WAAW,IAAI,IAAIA,EAAE6C,YAAY2B,iBAAiB,cAAc,IAAI,WAAW,IAAIzE,EAAE8C,YAAY4B,OAAOzE,EAAE,CAAC6D,UAAU,aAAanB,UAAU,GAAG,IAAI,IAAIzC,KAAKF,EAAE,oBAAoBE,GAAG,WAAWA,IAAID,EAAEC,GAAGW,KAAK8D,IAAI3E,EAAEE,GAAGF,EAAE4E,gBAAgB,IAAI,OAAO3E,CAAC,CAAjL,GAAqL,GAAGC,EAAEI,MAAMJ,EAAEK,MAAMN,EAAE4E,cAAc3E,EAAEI,MAAM,GAAGJ,EAAEI,MAAMwC,YAAYlC,MAAM,OAAOV,EAAEM,QAAQ,CAACP,GAAGD,EAAEE,EAAE,CAAC,MAAMF,GAAG,CAAC,EAAE,aAAa2B,SAASmD,WAAWvC,WAAWtC,EAAE,GAAG6B,iBAAiB,QAAQ,WAAW,OAAOS,WAAWtC,EAAE,EAAE,GAAG,C","sources":["../node_modules/web-vitals/dist/web-vitals.js"],"sourcesContent":["var e,t,n,i,r=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:\"v2-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12)}},a=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if(\"first-input\"===e&&!(\"PerformanceEventTiming\"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},o=function(e,t){var n=function n(i){\"pagehide\"!==i.type&&\"hidden\"!==document.visibilityState||(e(i),t&&(removeEventListener(\"visibilitychange\",n,!0),removeEventListener(\"pagehide\",n,!0)))};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},u=function(e){addEventListener(\"pageshow\",(function(t){t.persisted&&e(t)}),!0)},c=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},f=-1,s=function(){return\"hidden\"===document.visibilityState?0:1/0},m=function(){o((function(e){var t=e.timeStamp;f=t}),!0)},v=function(){return f<0&&(f=s(),m(),u((function(){setTimeout((function(){f=s(),m()}),0)}))),{get firstHiddenTime(){return f}}},d=function(e,t){var n,i=v(),o=r(\"FCP\"),f=function(e){\"first-contentful-paint\"===e.name&&(m&&m.disconnect(),e.startTime-1&&e(t)},f=r(\"CLS\",0),s=0,m=[],v=function(e){if(!e.hadRecentInput){var t=m[0],i=m[m.length-1];s&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(s+=e.value,m.push(e)):(s=e.value,m=[e]),s>f.value&&(f.value=s,f.entries=m,n())}},h=a(\"layout-shift\",v);h&&(n=c(i,f,t),o((function(){h.takeRecords().map(v),n(!0)})),u((function(){s=0,l=-1,f=r(\"CLS\",0),n=c(i,f,t)})))},T={passive:!0,capture:!0},y=new Date,g=function(i,r){e||(e=r,t=i,n=new Date,w(removeEventListener),E())},E=function(){if(t>=0&&t1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,t){var n=function(){g(e,t),r()},i=function(){r()},r=function(){removeEventListener(\"pointerup\",n,T),removeEventListener(\"pointercancel\",i,T)};addEventListener(\"pointerup\",n,T),addEventListener(\"pointercancel\",i,T)}(t,e):g(t,e)}},w=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,S,T)}))},L=function(n,f){var s,m=v(),d=r(\"FID\"),p=function(e){e.startTimeperformance.now())return;n.entries=[t],e(n)}catch(e){}},\"complete\"===document.readyState?setTimeout(t,0):addEventListener(\"load\",(function(){return setTimeout(t,0)}))};export{h as getCLS,d as getFCP,L as getFID,F as getLCP,P as getTTFB};\n"],"names":["e","t","n","i","r","name","value","delta","entries","id","concat","Date","now","Math","floor","random","a","PerformanceObserver","supportedEntryTypes","includes","self","getEntries","map","observe","type","buffered","o","document","visibilityState","removeEventListener","addEventListener","u","persisted","c","f","s","m","timeStamp","v","setTimeout","firstHiddenTime","d","disconnect","startTime","push","window","performance","getEntriesByName","requestAnimationFrame","p","l","h","hadRecentInput","length","takeRecords","T","passive","capture","y","g","w","E","entryType","target","cancelable","processingStart","forEach","S","L","b","F","once","P","getEntriesByType","timing","max","navigationStart","responseStart","readyState"],"sourceRoot":""} \ No newline at end of file diff --git a/static/js/main.7baa0e95.js b/static/js/main.7baa0e95.js new file mode 100644 index 0000000..541b074 --- /dev/null +++ b/static/js/main.7baa0e95.js @@ -0,0 +1,3 @@ +/*! For license information please see main.7baa0e95.js.LICENSE.txt */ +!function(){var e={3514:function(e,t,n){"use strict";n.r(t),n.d(t,{ReactComponent:function(){return c}});var r,i=n(1748),a=["title","titleId"];function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e,t){var n=e.title,l=e.titleId,c=s(e,a);return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:100.855,height:50,viewBox:"0 0 100.855 50",ref:t,"aria-labelledby":l},c),n?i.createElement("title",{id:l},n):null,r||(r=i.createElement("path",{id:"Path_216","data-name":"Path 216",d:"M100.839,165.623l-.382-4.666L98.9,156.8l-2.887-3.559-3.8-1.074-1.454,1.006,2.095,2.708.191-1.82,2.477,1.329.218,3.775.674.175.718-1.128.67,1.391-.2,2.638-5.272,1.609L91,164.846l-.865.1,1-.925-3.887.2-3.5-1.928-.622-4.436-3.038-.639-.674-.791,1.7-.718-1.455-2.143-2.3-4.056-1.609-1.609-2.526-1.071-.918-1.071-1.455.459,1.071.459.382.842-1.455.153-.382-.842-.459.459-.765-.611.536-.612-1.225-.073.842-1.071,1.3-.536-.689-1.914.612-1.148.23.919h1.225l-.536-.842.153-.612h1.071l.382-.689,1.148-.612-1.3-1.3,4.209-1.378,1.071-1.148v.917l.842-.23.382-1.3,1-.612v-1.075l-1,.306v-.84H78.431l-.689,1.148-2.063.306.612-.689-.422-.141.394-.385-1.917-4.535.376-.144-.358-1.666h-1.03l-1.126-.723-4.2,1.318-.794,1.372-1.3-.137-2.129.8-.185,1.661-.549-.4-2.108,1.542H5.431L-.016,156.16H58.842l-.153,4.271h1.85v2.618l.731-1.295V159.7H59.448l.138-3.856,1.625-.826.842.689,6.048-2.756-.537-1.075.766-.612.843.842,1.3-.689h1L73,153.407l.842-.306.459,2.143,3.732.569.279.437,1.382,1.626,2.78.585.6,4.29,4,2.205,2.084-.107-.334.311.289.631,2.167-.241,1.33-1.017L98.3,162.8l.256-3.332-1.325-2.752-.816,1.281-.176-3.054-3.459-1.855,2.819.8,2.644,3.232,1.491,3.952L99.89,163l-.191-.522-1.359,2.477,1.293,1.294c-.031.254-.1.763-.209,1.352-.114.913-.271,1.953-.342,2.419l-.269.058.609-2.778-.881-.882-10,1.348-.61.991-.5.059.21-.49-.586-.41L85.692,169.2l-.566,1.7L81,171.259l-.691.36.219-.549.251-3.2.664-1.823-1.694-2.19L75.8,168.3l-2.734.379-2.185,2,1.376,1.572.712-.3L71.9,170.734l1.49-1.365,2.776-.385L79.714,165l.908,1.174-.543,1.493-.247,3.179-.591,1.478.522.452,1.385-.8,4.521-.4.633-1.9,2.068-.243.614-1,9.3-1.254.343.344-.768,3.5,1.872-.4.039-.248s.23-1.46.38-2.669c.157-.846.231-1.53.234-1.559l.019-.173-.211-.211ZM66.727,135.957H65.42l-.842-.306-.689,1.071-1,.689v1.455l-1.837-.23-.918-1h-1.3l-.766,1H57L55.777,136.8l-1.451,1.148.153,1.531-.765.612.382.842L52.871,141l-1.38-.685-.382,2.3,1.531.919-.459,1.455,1.837,2.3-1,.766v1.914l.842.23.153,1.914,1.914,1.914.19,1.406H.9l5.115-22.551H61.177l1.871-1.368,1.135.826.275-2.466,1.548-.583,1.6.168.889-1.537,3.6-1.13,1.018.655h.653l.1.476-.986.379.3,1.64.782-.432,1.427,3.376-.306.3-.177-.059-.306-.842-.612.23-.385-.842-3.75,1.76-.073,1.837-1.378-.459Zm7.27-7.3-.272.15-.007-.042Zm4.9,27.158-.019-.03.4-.925.842.612-.788.848Zm13.427-1.822-.508-.656.537-.372.076.022Zm6.922,10.83.321-.586.525,1.431ZM43.761,175.683v0h0ZM9.32,166.112l-5.511-8.5H.441v18.063H3.579V162.745l5.664,8.419h.073l5.664-8.5V175.6h3.138V157.613H14.827Zm20.205-8.649-7.96,18.216h3.217l1.837-4.363h8.492l1.837,4.363h3.368l-7.883-18.216Zm-1.684,11.021L30.9,161.29l3.138,7.194Zm36.708-2.14-.306.255.031.6,2.182,2.963.28,1.466.833.474-.41-2.158a.357.357,0,0,0-.065-.148ZM50.882,157.62H43.761v18.059h3.217v-5.817h3.6c3.98,0,7.194-2.143,7.194-6.123v-.073C57.77,160.069,55.091,157.62,50.882,157.62Zm3.674,6.122c0,1.914-1.531,3.218-3.9,3.218l-3.674-.006v-6.5h3.674c2.372,0,3.9,1.071,3.9,3.217Zm15.23,9.331a6.136,6.136,0,0,1-5.969-6.429v-.073a6.07,6.07,0,0,1,5.969-6.353,7.329,7.329,0,0,1,5.052,2.219l2.067-2.372a9.349,9.349,0,0,0-7.044-2.832,9.182,9.182,0,0,0-9.338,9.023q0,.157,0,.314v.073a9.1,9.1,0,0,0,8.86,9.338q.162,0,.324,0h0a9.343,9.343,0,0,0,7.347-3.218L74.99,170.7A7.079,7.079,0,0,1,69.785,173.073Z",transform:"translate(0.016 -125.99)",fill:"#fff"})))}var c=i.forwardRef(l);t.default=n.p+"static/media/mapc-duotone.b8494c38f300fbf5f9eafb9ddbb28f58.svg"},9554:function(e,t,n){"use strict";n.r(t),n.d(t,{ReactComponent:function(){return u}});var r,i,a=n(1748),o=["title","titleId"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c(e,t){var n=e.title,c=e.titleId,u=l(e,o);return a.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 92.94 46.013",ref:t,"aria-labelledby":c},u),n?a.createElement("title",{id:c},n):null,r||(r=a.createElement("defs",null,a.createElement("style",null,"\n .cls-1, .cls-2 {\n fill: #fff;\n }\n .cls-1 {\n opacity: 0.6;\n }\n "))),i||(i=a.createElement("g",{id:"mapc-logo",transform:"translate(0 0)"},a.createElement("path",{id:"Trac\\xE9_1","data-name":"Trac\\xE9 1",className:"cls-1",d:"M5.041,5.68H56.375l1.846-1.349L59,4.9l.213-1.914,1.705-.642,1.349.142.781-1.349L66.67,0l.994.639h.781l.213.994-.923.355.142.781.642-.355,1.56,3.692-9.23,10.864,8.8,5.825,2.985,4.686,1.207,1.42,2.7.568.568,4.047,3.479,1.917,2.769-.142-.994.923L84.281,36l1.207-.923,5.112-1.56.213-2.769-.926-1.922-.994,1.56-.213-3.692-2.911-1.56-.142,1.349-1.207-1.56.923-.639,3.266.923,2.556,3.124,1.42,3.763.354,4.329-.781-2.13-.779,1.42,1.136,1.136s-.068.639-.213,1.42c-.142,1.136-.355,2.485-.355,2.485l-.994.213.639-2.911-.568-.568L82.077,38.7l-.568.923L80.3,39.76l.427-.994L79.522,39.9l-.568,1.7-4.047.355-1.349.781.568-1.42.213-2.911.568-1.56L73.7,35.291l-3.479,3.9-2.556.355-1.7,1.56.994,1.136L65.25,43.6l-2.911.213L61.7,40.472l-3.765-5.114-1.7-.353V31.24h-1.7l.142-3.337H0Z"}),a.createElement("path",{id:"Trac\\xE9_2","data-name":"Trac\\xE9 2",className:"cls-2",d:"M66.755,14.923l-.355,2.13,1.42.852-.426,1.349,1.7,2.13-.923.711v1.775l.781.213L69.1,25.86l1.775,1.775.213,1.917,2.7.213,1.988-1.207.781.639,5.61-2.556-.5-1,.71-.568.782.781,1.207-.639h.923l1.42,1.846.781-.284.426,1.988,4.189.639.426-.994.781.568-.923.994,1.846-.781-1.349-1.988-2.13-3.763L89.26,21.95l-2.343-.994-.852-.994-1.349.426.994.426.355.781-1.349.142-.355-.781-.426.426-.71-.566.5-.568-1.136-.068.781-.994,1.207-.5-.639-1.775.568-1.065.213.852h1.136l-.5-.781.142-.568h.994l.355-.639,1.065-.568-1.2-1.208,3.9-1.278.994-1.065v.851l.781-.213.355-1.207.923-.568v-1l-.923.284V7.965h-.994L91.108,9.03l-1.914.284.568-.639-1.278-.426L88.2,7.468l-.568.213L87.274,6.9,83.8,8.533l-.068,1.7L82.45,9.811l-1.56,1.065H79.677l-.781-.284-.639.994-.923.639v1.349l-1.7-.213-.851-.923H73.571l-.71.923h-.994l-1.136-1.7-1.346,1.065.142,1.42-.71.568.355.781-1.136.068Z",transform:"translate(-19.256 -2.001)"}),a.createElement("path",{id:"Trac\\xE9_3","data-name":"Trac\\xE9 3",className:"cls-2",d:"M.2,57.409H3.111v-12l5.254,7.81h.068l5.254-7.881v12H16.6V40.649H13.545L8.436,48.534,3.324,40.652H.2Zm19.6,0h2.985l1.7-4.047h7.878l1.7,4.047h3.124l-7.313-16.9h-2.7Zm5.822-6.674,2.84-6.674,2.911,6.674Zm14.768,6.674h2.985v-5.4h3.337c3.692,0,6.674-1.988,6.674-5.68v-.068c0-3.337-2.485-5.609-6.39-5.609H40.387V57.412Zm2.985-8.094V43.282h3.408c2.2,0,3.621.994,3.621,2.985v.068c0,1.775-1.42,2.985-3.621,2.985Zm21.087,8.378a8.667,8.667,0,0,0,6.816-2.985l-1.917-1.917a6.566,6.566,0,0,1-4.828,2.2,5.692,5.692,0,0,1-5.538-5.964V48.96a5.631,5.631,0,0,1,5.538-5.893,6.8,6.8,0,0,1,4.686,2.059l1.917-2.2A8.673,8.673,0,0,0,64.6,40.3a8.518,8.518,0,0,0-8.662,8.662v.068a8.444,8.444,0,0,0,8.52,8.665Z",transform:"translate(-0.058 -11.684)"}))))}var u=a.forwardRef(c);t.default=n.p+"static/media/mapc-semitransparent.67de706a3feb52b3a3937517efa25bd5.svg"},2858:function(e,t,n){"use strict";n.r(t),n.d(t,{CacheProvider:function(){return Pe},ClassNames:function(){return Ye},Global:function(){return Ze},ThemeContext:function(){return Re},ThemeProvider:function(){return Ne},__unsafe_useEmotionCache:function(){return Le},createElement:function(){return He},css:function(){return Ge},jsx:function(){return He},keyframes:function(){return qe},useTheme:function(){return Oe},withEmotionCache:function(){return De},withTheme:function(){return Fe}});var r=n(2791),i=n.t(r,2);var a=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?h(w,--x):0,g--,10===b&&(g=1,y--),b}function T(){return b=x<_?h(w,x++):0,g++,10===b&&(g=1,y++),b}function S(){return h(w,x)}function E(){return x}function C(e,t){return d(w,e,t)}function A(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function I(e){return y=g=1,_=p(w=e),x=0,[]}function P(e){return w="",e}function L(e){return c(C(x-1,O(91===e?e+2:40===e?e+1:e)))}function D(e){for(;(b=S())&&b<33;)T();return A(e)>2||A(b)>3?"":" "}function R(e,t){for(;--t&&T()&&!(b<48||b>102||b>57&&b<65||b>70&&b<97););return C(e,E()+(t<6&&32==S()&&32==T()))}function O(e){for(;T();)switch(b){case e:return x;case 34:case 39:34!==e&&39!==e&&O(b);break;case 40:41===e&&O(e);break;case 92:T()}return x}function B(e,t){for(;T()&&e+b!==57&&(e+b!==84||47!==S()););return"/*"+C(t,x-1)+"*"+s(47===e?e:T())}function N(e){for(;!A(S());)T();return C(e,x)}var F="-ms-",V="-moz-",j="-webkit-",U="comm",H="rule",Z="decl",G="@keyframes";function q(e,t){for(var n="",r=m(e),i=0;i0&&p(O)-y&&v(_>32?J(O+";",r,n,y-1):J(u(O," ","")+";",r,n,y-2),c);break;case 59:O+=";";default:if(v(P=K(O,t,n,d,m,i,l,C,A=[],I=[],y),a),123===z)if(0===m)Y(O,t,P,P,A,a,y,l,I);else switch(99===g&&110===h(O,3)?100:g){case 100:case 108:case 109:case 115:Y(e,P,P,r&&v(K(e,P,P,0,0,i,l,C,i,A=[],y),I),i,I,y,l,r?A:I);break;default:Y(O,P,P,P,[""],I,0,l,I)}}d=m=_=0,b=k=1,C=O="",y=o;break;case 58:y=1+p(O),_=x;default:if(b<1)if(123==z)--b;else if(125==z&&0==b++&&125==M())continue;switch(O+=s(z),z*b){case 38:k=m>0?1:(O+="\f",-1);break;case 44:l[d++]=(p(O)-1)*k,k=1;break;case 64:45===S()&&(O+=L(T())),g=S(),m=y=p(C=O+=N(E())),z++;break;case 45:45===x&&2==p(O)&&(b=0)}}return a}function K(e,t,n,r,i,a,s,l,f,h,p){for(var v=i-1,y=0===i?a:[""],g=m(y),_=0,x=0,b=0;_0?y[w]+" "+z:u(z,/&\f/g,y[w])))&&(f[b++]=M);return k(e,t,n,0===i?H:l,f,h,p)}function $(e,t,n){return k(e,t,n,U,s(b),d(e,2,-2),0)}function J(e,t,n,r){return k(e,t,n,Z,d(e,0,r),d(e,r+1,-1),r)}var Q=function(e,t,n){for(var r=0,i=0;r=i,i=S(),38===r&&12===i&&(t[n]=1),!A(i);)T();return C(e,x)},ee=function(e,t){return P(function(e,t){var n=-1,r=44;do{switch(A(r)){case 0:38===r&&12===S()&&(t[n]=1),e[n]+=Q(x-1,t,n);break;case 2:e[n]+=L(r);break;case 4:if(44===r){e[++n]=58===S()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=s(r)}}while(r=T());return e}(I(e),t))},te=new WeakMap,ne=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||te.get(n))&&!r){te.set(e,!0);for(var i=[],a=ee(t,i),o=n.props,s=0,l=0;s6)switch(h(e,t+1)){case 109:if(45!==h(e,t+4))break;case 102:return u(e,/(.+:)(.+)-([^]+)/,"$1"+j+"$2-$3$1"+V+(108==h(e,t+3)?"$3":"$2-$3"))+e;case 115:return~f(e,"stretch")?ie(u(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==h(e,t+1))break;case 6444:switch(h(e,p(e)-3-(~f(e,"!important")&&10))){case 107:return u(e,":",":"+j)+e;case 101:return u(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+j+(45===h(e,14)?"inline-":"")+"box$3$1"+j+"$2$3$1"+F+"$2box$3")+e}break;case 5936:switch(h(e,t+11)){case 114:return j+e+F+u(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return j+e+F+u(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return j+e+F+u(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return j+e+F+e+e}return e}var ae=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Z:e.return=ie(e.value,e.length);break;case G:return q([z(e,{value:u(e.value,"@","@"+j)})],r);case H:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return q([z(e,{props:[u(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return q([z(e,{props:[u(t,/:(plac\w+)/,":"+j+"input-$1")]}),z(e,{props:[u(t,/:(plac\w+)/,":-moz-$1")]}),z(e,{props:[u(t,/:(plac\w+)/,F+"input-$1")]})],r)}return""}))}}],oe=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r=e.stylisPlugins||ae;var i,o,s={},l=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+l;return{name:c,styles:i,next:ze}},Se=!!i.useInsertionEffect&&i.useInsertionEffect,Ee=Se||function(e){return e()},Ce=Se||r.useLayoutEffect,Ae={}.hasOwnProperty,Ie=r.createContext("undefined"!==typeof HTMLElement?oe({key:"css"}):null);var Pe=Ie.Provider,Le=function(){return(0,r.useContext)(Ie)},De=function(e){return(0,r.forwardRef)((function(t,n){var i=(0,r.useContext)(Ie);return e(t,i,n)}))};var Re=r.createContext({});var Oe=function(){return r.useContext(Re)},Be=le((function(e){return le((function(t){return function(e,t){return"function"===typeof t?t(e):se({},e,t)}(e,t)}))})),Ne=function(e){var t=r.useContext(Re);return e.theme!==t&&(t=Be(t)(e.theme)),r.createElement(Re.Provider,{value:t},e.children)};function Fe(e){var t=e.displayName||e.name||"Component",n=function(t,n){var i=r.useContext(Re);return r.createElement(e,se({theme:i,ref:n},t))},i=r.forwardRef(n);return i.displayName="WithTheme("+t+")",fe(i,e)}var Ve="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",je=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return de(t,n,r),Ee((function(){return pe(t,n,r)})),null};var Ue=De((function(e,t,n){var i=e.css;"string"===typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var a=e[Ve],o=[i],s="";"string"===typeof e.className?s=he(t.registered,o,e.className):null!=e.className&&(s=e.className+" ");var l=Te(o,void 0,r.useContext(Re));s+=t.key+"-"+l.name;var c={};for(var u in e)Ae.call(e,u)&&"css"!==u&&u!==Ve&&(c[u]=e[u]);return c.ref=n,c.className=s,r.createElement(r.Fragment,null,r.createElement(je,{cache:t,serialized:l,isStringTag:"string"===typeof a}),r.createElement(a,c))})),He=function(e,t){var n=arguments;if(null==t||!Ae.call(t,"css"))return r.createElement.apply(void 0,n);var i=n.length,a=new Array(i);a[0]=Ue,a[1]=function(e,t){var n={};for(var r in t)Ae.call(t,r)&&(n[r]=t[r]);return n[Ve]=e,n}(e,t);for(var o=2;o-1;i--){var a=n[i],o=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(r=a)}return m.head.insertBefore(t,r),e}}var ee="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function te(){for(var e=12,t="";e-- >0;)t+=ee[62*Math.random()|0];return t}function ne(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function re(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,": ").concat(e[n],";")}),"")}function ie(e){return e.size!==J.size||e.x!==J.x||e.y!==J.y||e.rotate!==J.rotate||e.flipX||e.flipY}function ae(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(32*t.x,", ").concat(32*t.y,") "),o="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)");return{outer:i,inner:{transform:"".concat(a," ").concat(o," ").concat(s)},path:{transform:"translate(".concat(r/2*-1," -256)")}}}var oe={x:0,y:0,width:"100%",height:"100%"};function se(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function le(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,a=e.iconName,s=e.transform,l=e.symbol,c=e.title,u=e.maskId,f=e.titleId,h=e.extra,d=e.watchable,p=void 0!==d&&d,m=r.found?r:n,v=m.width,y=m.height,g="fak"===i,_=g?"":"fa-w-".concat(Math.ceil(v/y*16)),x=[S.replacementClass,a?"".concat(S.familyPrefix,"-").concat(a):"",_].filter((function(e){return-1===h.classes.indexOf(e)})).filter((function(e){return""!==e||!!e})).concat(h.classes).join(" "),w={children:[],attributes:o({},h.attributes,{"data-prefix":i,"data-icon":a,class:x,role:h.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(v," ").concat(y)})},k=g&&!~h.classes.indexOf("fa-fw")?{width:"".concat(v/y*16*.0625,"em")}:{};p&&(w.attributes[b]=""),c&&w.children.push({tag:"title",attributes:{id:w.attributes["aria-labelledby"]||"title-".concat(f||te())},children:[c]});var z=o({},w,{prefix:i,iconName:a,main:n,mask:r,maskId:u,transform:s,symbol:l,styles:o({},k,h.styles)}),M=r.found&&n.found?function(e){var t,n=e.children,r=e.attributes,i=e.main,a=e.mask,s=e.maskId,l=e.transform,c=i.width,u=i.icon,f=a.width,h=a.icon,d=ae({transform:l,containerWidth:f,iconWidth:c}),p={tag:"rect",attributes:o({},oe,{fill:"white"})},m=u.children?{children:u.children.map(se)}:{},v={tag:"g",attributes:o({},d.inner),children:[se(o({tag:u.tag,attributes:o({},u.attributes,d.path)},m))]},y={tag:"g",attributes:o({},d.outer),children:[v]},g="mask-".concat(s||te()),_="clip-".concat(s||te()),x={tag:"mask",attributes:o({},oe,{id:g,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[p,y]},b={tag:"defs",children:[{tag:"clipPath",attributes:{id:_},children:(t=h,"g"===t.tag?t.children:[t])},x]};return n.push(b,{tag:"rect",attributes:o({fill:"currentColor","clip-path":"url(#".concat(_,")"),mask:"url(#".concat(g,")")},oe)}),{children:n,attributes:r}}(z):function(e){var t=e.children,n=e.attributes,r=e.main,i=e.transform,a=re(e.styles);if(a.length>0&&(n.style=a),ie(i)){var s=ae({transform:i,containerWidth:r.width,iconWidth:r.width});t.push({tag:"g",attributes:o({},s.outer),children:[{tag:"g",attributes:o({},s.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:o({},r.icon.attributes,s.path)}]}]})}else t.push(r.icon);return{children:t,attributes:n}}(z),T=M.children,E=M.attributes;return z.children=T,z.attributes=E,l?function(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,a=e.symbol;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:o({},i,{id:!0===a?"".concat(t,"-").concat(S.familyPrefix,"-").concat(n):a}),children:r}]}]}(z):function(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,a=e.styles,s=e.transform;if(ie(s)&&n.found&&!r.found){var l={x:n.width/n.height/2,y:.5};i.style=re(o({},a,{"transform-origin":"".concat(l.x+s.x/16,"em ").concat(l.y+s.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}(z)}var ce=function(){},ue=(S.measurePerformance&&v&&v.mark&&v.measure,function(e,t,n,r){var i,a,o,s=Object.keys(e),l=s.length,c=void 0!==r?function(e,t){return function(n,r,i,a){return e.call(t,n,r,i,a)}}(t,r):t;for(void 0===n?(i=1,o=e[s[0]]):(i=0,o=n);i2&&void 0!==arguments[2]?arguments[2]:{}).skipHooks,r=void 0!==n&&n,i=Object.keys(t).reduce((function(e,n){var r=t[n];return!!r.icon?e[r.iconName]=r.icon:e[n]=r,e}),{});"function"!==typeof C.hooks.addPack||r?C.styles[e]=o({},C.styles[e]||{},i):C.hooks.addPack(e,i),"fas"===e&&fe("fa",t)}var he=C.styles,de=C.shims,pe=function(){var e=function(e){return ue(he,(function(t,n,r){return t[r]=ue(n,e,{}),t}),{})};e((function(e,t,n){return t[3]&&(e[t[3]]=n),e})),e((function(e,t,n){var r=t[2];return e[n]=n,r.forEach((function(t){e[t]=n})),e}));var t="far"in he;ue(de,(function(e,n){var r=n[0],i=n[1],a=n[2];return"far"!==i||t||(i="fas"),e[r]={prefix:i,iconName:a},e}),{})};pe();C.styles;function me(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}function ve(e){var t=e.tag,n=e.attributes,r=void 0===n?{}:n,i=e.children,a=void 0===i?[]:i;return"string"===typeof e?ne(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,'="').concat(ne(e[n]),'" ')}),"").trim()}(r),">").concat(a.map(ve).join(""),"")}var ye=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e?e.toLowerCase().split(" ").reduce((function(e,t){var n=t.toLowerCase().split("-"),r=n[0],i=n.slice(1).join("-");if(r&&"h"===i)return e.flipX=!0,e;if(r&&"v"===i)return e.flipY=!0,e;if(i=parseFloat(i),isNaN(i))return e;switch(r){case"grow":e.size=e.size+i;break;case"shrink":e.size=e.size-i;break;case"left":e.x=e.x-i;break;case"right":e.x=e.x+i;break;case"up":e.y=e.y-i;break;case"down":e.y=e.y+i;break;case"rotate":e.rotate=e.rotate+i}return e}),t):t};function ge(e){this.name="MissingIcon",this.message=e||"Icon unavailable",this.stack=(new Error).stack}ge.prototype=Object.create(Error.prototype),ge.prototype.constructor=ge;var _e={fill:"currentColor"},xe={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},be={tag:"path",attributes:o({},_e,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})},we=o({},xe,{attributeName:"opacity"});o({},_e,{cx:"256",cy:"364",r:"28"}),o({},xe,{attributeName:"r",values:"28;14;28;28;14;28;"}),o({},we,{values:"1;0;1;1;0;1;"}),o({},_e,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),o({},we,{values:"1;0;0;0;0;1;"}),o({},_e,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),o({},we,{values:"0;0;1;1;0;0;"}),C.styles;function ke(e){var t=e[0],n=e[1],r=s(e.slice(4),1)[0];return{found:!0,width:t,height:n,icon:Array.isArray(r)?{tag:"g",attributes:{class:"".concat(S.familyPrefix,"-").concat(z.GROUP)},children:[{tag:"path",attributes:{class:"".concat(S.familyPrefix,"-").concat(z.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(S.familyPrefix,"-").concat(z.PRIMARY),fill:"currentColor",d:r[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:r}}}}C.styles;var ze='svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: 0.25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse {\n color: #fff;\n}';function Me(){var e=_,t=x,n=S.familyPrefix,r=S.replacementClass,i=ze;if(n!==e||r!==t){var a=new RegExp("\\.".concat(e,"\\-"),"g"),o=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");i=i.replace(a,".".concat(n,"-")).replace(o,"--".concat(n,"-")).replace(s,".".concat(r))}return i}var Te=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.definitions={}}var t,n,r;return t=e,n=[{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=void 0===n?J:n,i=t.symbol,a=void 0!==i&&i,s=t.mask,l=void 0===s?null:s,c=t.maskId,u=void 0===c?null:c,f=t.title,h=void 0===f?null:f,d=t.titleId,p=void 0===d?null:d,m=t.classes,v=void 0===m?[]:m,y=t.attributes,g=void 0===y?{}:y,_=t.styles,x=void 0===_?{}:_;if(e){var b=e.prefix,w=e.iconName,k=e.icon;return Ee(o({type:"icon"},e),(function(){return Se(),S.autoA11y&&(h?g["aria-labelledby"]="".concat(S.replacementClass,"-title-").concat(p||te()):(g["aria-hidden"]="true",g.focusable="false")),le({icons:{main:ke(k),mask:l?ke(l.icon):{found:!1,width:null,height:null,icon:{}}},prefix:b,iconName:w,transform:o({},J,r),symbol:a,title:h,maskId:u,titleId:p,extra:{attributes:g,styles:x,classes:v}})}))}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e||{}).icon?e:Ce(e||{}),r=t.mask;return r&&(r=(r||{}).icon?r:Ce(r||{})),Ae(n,o({},t,{mask:r}))}),Re=n(2007),Oe=n.n(Re),Be=n(2791);function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function He(e){return function(e){if(Array.isArray(e))return Ze(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0||!Array.isArray(t)&&t?je({},e,t):{}}var Ke=["forwardedRef"];function $e(e){var t=e.forwardedRef,n=Ue(e,Ke),r=n.icon,i=n.mask,a=n.symbol,o=n.className,s=n.title,l=n.titleId,c=n.maskId,u=Xe(r),f=Ye("classes",[].concat(He(function(e){var t,n=e.beat,r=e.fade,i=e.beatFade,a=e.bounce,o=e.shake,s=e.flash,l=e.spin,c=e.spinPulse,u=e.spinReverse,f=e.pulse,h=e.fixedWidth,d=e.inverse,p=e.border,m=e.listItem,v=e.flip,y=e.size,g=e.rotation,_=e.pull,x=(je(t={"fa-beat":n,"fa-fade":r,"fa-beat-fade":i,"fa-bounce":a,"fa-shake":o,"fa-flash":s,"fa-spin":l,"fa-spin-reverse":u,"fa-spin-pulse":c,"fa-pulse":f,"fa-fw":h,"fa-inverse":d,"fa-border":p,"fa-li":m,"fa-flip":!0===v,"fa-flip-horizontal":"horizontal"===v||"both"===v,"fa-flip-vertical":"vertical"===v||"both"===v},"fa-".concat(y),"undefined"!==typeof y&&null!==y),je(t,"fa-rotate-".concat(g),"undefined"!==typeof g&&null!==g&&0!==g),je(t,"fa-pull-".concat(_),"undefined"!==typeof _&&null!==_),je(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(x).map((function(e){return x[e]?e:null})).filter((function(e){return e}))}(n)),He(o.split(" ")))),h=Ye("transform","string"===typeof n.transform?Le.transform(n.transform):n.transform),d=Ye("mask",Xe(i)),p=De(u,Fe(Fe(Fe(Fe({},f),h),d),{},{symbol:a,title:s,titleId:l,maskId:c}));if(!p)return function(){var e;!We&&console&&"function"===typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",u),null;var m=p.abstract,v={ref:t};return Object.keys(n).forEach((function(e){$e.defaultProps.hasOwnProperty(e)||(v[e]=n[e])})),Je(m[0],v)}$e.displayName="FontAwesomeIcon",$e.propTypes={beat:Oe().bool,border:Oe().bool,beatFade:Oe().bool,bounce:Oe().bool,className:Oe().string,fade:Oe().bool,flash:Oe().bool,mask:Oe().oneOfType([Oe().object,Oe().array,Oe().string]),maskId:Oe().string,fixedWidth:Oe().bool,inverse:Oe().bool,flip:Oe().oneOf([!0,!1,"horizontal","vertical","both"]),icon:Oe().oneOfType([Oe().object,Oe().array,Oe().string]),listItem:Oe().bool,pull:Oe().oneOf(["right","left"]),pulse:Oe().bool,rotation:Oe().oneOf([0,90,180,270]),shake:Oe().bool,size:Oe().oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:Oe().bool,spinPulse:Oe().bool,spinReverse:Oe().bool,symbol:Oe().oneOfType([Oe().bool,Oe().string]),title:Oe().string,titleId:Oe().string,transform:Oe().oneOfType([Oe().string,Oe().object]),swapOpacity:Oe().bool},$e.defaultProps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1};var Je=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"===typeof n)return n;var i=(n.children||[]).map((function(n){return e(t,n)})),a=Object.keys(n.attributes||{}).reduce((function(e,t){var r=n.attributes[t];switch(t){case"class":e.attrs.className=r,delete n.attributes.class;break;case"style":e.attrs.style=r.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n,r=t.indexOf(":"),i=Ge(t.slice(0,r)),a=t.slice(r+1).trim();return i.startsWith("webkit")?e[(n=i,n.charAt(0).toUpperCase()+n.slice(1))]=a:e[i]=a,e}),{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=r:e.attrs[Ge(t)]=r}return e}),{attrs:{}}),o=r.style,s=void 0===o?{}:o,l=Ue(r,qe);return a.attrs.style=Fe(Fe({},a.attrs.style),s),t.apply(void 0,[n.tag,Fe(Fe({},a.attrs),l)].concat(He(i)))}.bind(null,Be.createElement)},1694:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t1)return 1;for(var n=e,r=0;r<8;r++){var i=this.sampleCurveX(n)-e;if(Math.abs(i)i?o=n:s=n,n=.5*(s-o)+o;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var C=T(S),A=I;function I(e,t){this.x=e,this.y=t}I.prototype={clone:function(){return new I(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=n*this.x+t*this.y;return this.x=t*this.x-n*this.y,this.y=r,this},_rotateAround:function(e,t){var n=Math.cos(e),r=Math.sin(e),i=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=t.x+n*(this.x-t.x)-r*(this.y-t.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},I.convert=function(e){return e instanceof I?e:Array.isArray(e)?new I(e[0],e[1]):e};var P=T(A),L=Math.PI/180,D=180/Math.PI;function R(e){return e*L}function O(e){return e*D}var B=[[0,0],[1,0],[1,1],[0,1]];function N(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function F(e,t,n,r){var i=new C(e,t,n,r);return function(e){return i.solve(e)}}var V=F(.25,.1,.25,1);function j(e,t,n){return Math.min(n,Math.max(t,e))}function U(e,t,n){return(n=j((n-e)/(t-e),0,1))*n*(3-2*n)}function H(e,t,n){var r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}function Z(e,t,n){if(!e.length)return n(null,[]);var r=e.length,i=new Array(e.length),a=null;e.forEach((function(e,o){t(e,(function(e,t){e&&(a=e),i[o]=t,0==--r&&n(a,i)}))}))}function G(e){var t=[];for(var n in e)t.push(e[n]);return t}function q(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function K(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function $(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function J(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function Q(e,t){return-1!==e.indexOf(t,e.length-t.length)}function ee(e,t,n){var r={};for(var i in e)r[i]=t.call(n||this,e[i],i,e);return r}function te(e,t,n){var r={};for(var i in e)t.call(n||this,e[i],i,e)&&(r[i]=e[i]);return r}function ne(e){return Array.isArray(e)?e.map(ne):"object"==typeof e&&e?ee(e,ne):e}var re={};function ie(e){re[e]||("undefined"!=typeof console&&console.warn(e),re[e]=!0)}function ae(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}function oe(e){for(var t,n,r=0,i=0,a=e.length,o=a-1;i@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(e,n,r,i){var a=r||i;return t[n]=!a||a.toLowerCase(),""})),t["max-age"]){var n=parseInt(t["max-age"],10);isNaN(n)?delete t["max-age"]:t["max-age"]=n}return t}var ce=null;function ue(e){if(null==ce){var t=e.navigator?e.navigator.userAgent:null;ce=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return ce}function fe(e){try{var t=g[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function he(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}var de,pe,me="mapbox-tiles",ve=500,ye=50;function ge(){try{return g.caches}catch(e){}}function _e(){ge()&&!de&&(de=g.caches.open(me))}function xe(e){var t=e.indexOf("?");if(t<0)return e;var n=function(e){var t=e.indexOf("?");return t>0?e.slice(t+1).split("&"):[]}(e),r=n.filter((function(e){var t=e.split("=");return"language"===t[0]||"worldview"===t[0]}));return r.length?"".concat(e.slice(0,t),"?").concat(r.join("&")):e.slice(0,t)}var be=1/0,we={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(we);var ke=function(e){m(n,e);var t=v(n);function n(e,r,i){var a;return d(this,n),401===r&&De(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),(a=t.call(this,e)).status=r,a.url=i,a}return p(n,[{key:"toString",value:function(){return"".concat(this.name,": ").concat(this.message," (").concat(this.status,"): ").concat(this.url)}}]),n}(y(Error)),ze=se()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===g.location.protocol?g.parent:g).location.href},Me=function(e,t){if(!(/^file:/.test(n=e.url)||/^file:/.test(ze())&&!/^\w+:/.test(n))){if(g.fetch&&g.Request&&g.AbortController&&g.Request.prototype.hasOwnProperty("signal"))return function(e,t){var n,r=new g.AbortController,i=new g.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:ze(),referrerPolicy:e.referrerPolicy,signal:r.signal}),a=!1,o=!1,s=(n=i.url).indexOf("sku=")>0&&De(n);"json"===e.type&&i.headers.set("Accept","application/json");var l=function(n,r,a){if(!o){if(n&&"SecurityError"!==n.message&&ie(n.toString()),r&&a)return c(r);var l=Date.now();g.fetch(i).then((function(n){if(n.ok){var r=s?n.clone():null;return c(n,r,l)}return t(new ke(n.statusText,n.status,e.url))})).catch((function(n){"AbortError"!==n.name&&t(new Error("".concat(n.message," ").concat(e.url)))}))}},c=function(n,r,s){("arrayBuffer"===e.type?n.arrayBuffer():"json"===e.type?n.json():n.text()).then((function(e){o||(r&&s&&function(e,t,n){if(_e(),de){var r={status:t.status,statusText:t.statusText,headers:new g.Headers};t.headers.forEach((function(e,t){return r.headers.set(t,e)}));var i=le(t.headers.get("Cache-Control")||"");if(!i["no-store"]){i["max-age"]&&r.headers.set("Expires",new Date(n+1e3*i["max-age"]).toUTCString());var a=r.headers.get("Expires");a&&(new Date(a).getTime()-n<42e4||function(e,t){if(void 0===pe)try{new Response(new ReadableStream),pe=!0}catch(e){pe=!1}pe?t(e.body):e.blob().then(t)}(t,(function(t){var n=new g.Response(t,r);_e(),de&&de.then((function(t){return t.put(xe(e.url),n)})).catch((function(e){return ie(e.message)}))})))}}}(i,r,s),a=!0,t(null,e,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((function(e){o||t(new Error(e.message))}))};return s?function(e,t){if(_e(),!de)return t(null);var n=xe(e.url);de.then((function(e){e.match(n).then((function(r){var i=function(e){if(!e)return!1;var t=new Date(e.headers.get("Expires")||0),n=le(e.headers.get("Cache-Control")||"");return t>Date.now()&&!n["no-cache"]}(r);e.delete(n),i&&e.put(n,r.clone()),t(null,r,i)})).catch(t)})).catch(t)}(i,l):l(null,null),{cancel:function(){o=!0,a||r.abort()}}}(e,t);if(se()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var n;return function(e,t){var n=new g.XMLHttpRequest;for(var r in n.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(n.responseType="arraybuffer"),e.headers)n.setRequestHeader(r,e.headers[r]);return"json"===e.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===e.credentials,n.onerror=function(){t(new Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){var r=n.response;if("json"===e.type)try{r=JSON.parse(n.response)}catch(e){return t(e)}t(null,r,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else t(new ke(n.statusText,n.status,e.url))},n.send(e.body),{cancel:function(){return n.abort()}}}(e,t)},Te=function(e,t){return Me(q(e,{type:"arrayBuffer"}),t)};function Se(e){var t=g.document.createElement("a");return t.href=e,t.protocol===g.document.location.protocol&&t.host===g.document.location.host}var Ee,Ce,Ae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Ee=[],Ce=0;var Ie=function e(t,n){if(b.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Ce>=x.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:n,cancelled:!1,cancel:function(){this.cancelled=!0}};return Ee.push(r),r}Ce++;var i=!1,a=function(){if(!i)for(i=!0,Ce--;Ee.length&&Ce=1&&g.localStorage.setItem(t,JSON.stringify(this.eventData))}catch(e){ie("Unable to write to LocalStorage")}}},{key:"processRequests",value:function(e){}},{key:"postEvent",value:function(e,t,n,r){var i=this;if(x.EVENTS_URL){var a=Fe(x.EVENTS_URL);a.params.push("access_token=".concat(r||x.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(e).toISOString()},s=t?q(o,t):o,l={url:Ve(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=function(e,t){return Me(q(e,{method:"POST"}),t)}(l,(function(e){i.pendingRequest=null,n(e),i.saveEventData(),i.processRequests(r)}))}}},{key:"queueRequest",value:function(e,t){this.queue.push(e),this.processRequests(t)}}]),e}(),Ze=new(function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,"appUserTurnstile"))._customAccessToken=e,r}return p(n,[{key:"postTurnstileEvent",value:function(e,t){x.EVENTS_URL&&x.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return Le(e)||De(e)}))&&this.queueRequest(Date.now(),t)}},{key:"processRequests",value:function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var n=Ue(x.ACCESS_TOKEN),r=n?n.u:x.ACCESS_TOKEN,i=r!==this.eventData.tokenU;$(this.anonId)||(this.anonId=Y(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;i?this.postEvent(a,{sdkIdentifier:"mapbox-gl-js",sdkVersion:_,skuId:M,"enabled.telemetry":!1,userId:this.anonId},(function(e){e||(t.eventData.lastSuccess=a,t.eventData.tokenU=r)}),e):this.processRequests()}}}]),n}(He)),Ge=Ze.postTurnstileEvent.bind(Ze),qe=new(function(e){m(n,e);var t=v(n);function n(){var e;return d(this,n),(e=t.call(this,"map.load")).success={},e.skuToken="",e}return p(n,[{key:"postMapLoadEvent",value:function(e,t,n,r){this.skuToken=t,this.errorCb=r,x.EVENTS_URL&&(n||x.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},n):this.errorCb(new Error(Pe)))}},{key:"processRequests",value:function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var n=this.queue.shift(),r=n.id,i=n.timestamp;r&&this.success[r]||(this.anonId||this.fetchEventData(),$(this.anonId)||(this.anonId=Y()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:_,skuId:M,skuToken:this.skuToken,userId:this.anonId},(function(e){e?t.errorCb(e):r&&(t.success[r]=!0)}),e))}}}]),n}(He)),We=qe.postMapLoadEvent.bind(qe),Xe=new(function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.call(this,"gljs.performance")}return p(n,[{key:"postPerformanceEvent",value:function(e,t){x.EVENTS_URL&&(e||x.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}},{key:"processRequests",value:function(e){if(!this.pendingRequest&&0!==this.queue.length){var t,n=this.queue.shift(),r=n.timestamp,i=function(e){var t=g.performance.getEntriesByType("resource"),n=g.performance.getEntriesByType("mark"),r=function(e){var t={};if(e)for(var n in e)if("other"!==n){var r,i=h(e[n]);try{for(i.s();!(r=i.n()).done;){var a=r.value,o="".concat(n,"ResolveRangeMin"),s="".concat(n,"ResolveRangeMax"),l="".concat(n,"RequestCount"),c="".concat(n,"RequestCachedCount");t[o]=Math.min(t[o]||1/0,a.startTime),t[s]=Math.max(t[s]||-1/0,a.responseEnd);var u=function(e){void 0===t[e]&&(t[e]=0),++t[e]};void 0!==a.transferSize&&0===a.transferSize&&u(c),u(l)}}catch(f){i.e(f)}finally{i.f()}}return t}(function(e,t){var n={};if(e){var r,i=h(e);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=t(a);void 0===n[o]&&(n[o]=[]),n[o].push(a)}}catch(s){i.e(s)}finally{i.f()}}return n}(t,tt)),i=g.devicePixelRatio,a=g.navigator.connection||g.navigator.mozConnection||g.navigator.webkitConnection,o={counters:[],metadata:[],attributes:[]},s=function(e,t,n){null!=n&&e.push({name:t,value:n.toString()})};for(var l in r)s(o.counters,l,r[l]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(s(o.counters,"interactionRangeMin",e.interactionRange[0]),s(o.counters,"interactionRangeMax",e.interactionRange[1])),n)for(var c=function(){var e=f[u],t=Qe[e],r=n.find((function(e){return e.name===t}));r&&s(o.counters,t,r.startTime)},u=0,f=Object.keys(Qe);u1&&void 0!==arguments[1]?arguments[1]:0,n=e.width,r=e.height;at||(at=g.document.createElement("canvas"));var i=at.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return(n>at.width||r>at.height)&&(at.width=n,at.height=r),i.clearRect(-t,-t,n+2*t,r+2*t),i.drawImage(e,0,0,n,r),i.getImageData(-t,-t,n+2*t,r+2*t)},resolveURL:function(e){return nt||(nt=g.document.createElement("a")),nt.href=e,nt.href},get devicePixelRatio(){return g.devicePixelRatio},get prefersReducedMotion(){return!!g.matchMedia&&(null==rt&&(rt=g.matchMedia("(prefers-reduced-motion: reduce)")),rt.matches)}};function ct(e,t,n){n[e]&&-1!==n[e].indexOf(t)||(n[e]=n[e]||[],n[e].push(t))}function ut(e,t,n){if(n&&n[e]){var r=n[e].indexOf(t);-1!==r&&n[e].splice(r,1)}}var ft=p((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};d(this,e),q(this,n),this.type=t})),ht=function(e){m(n,e);var t=v(n);function n(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return d(this,n),t.call(this,"error",q({error:e},r))}return p(n)}(ft),dt=function(){function e(){d(this,e)}return p(e,[{key:"on",value:function(e,t){return this._listeners=this._listeners||{},ct(e,t,this._listeners),this}},{key:"off",value:function(e,t){return ut(e,t,this._listeners),ut(e,t,this._oneTimeListeners),this}},{key:"once",value:function(e,t){var n=this;return t?(this._oneTimeListeners=this._oneTimeListeners||{},ct(e,t,this._oneTimeListeners),this):new Promise((function(t){return n.once(e,t)}))}},{key:"fire",value:function(e,t){"string"==typeof e&&(e=new ft(e,t||{}));var n=e.type;if(this.listens(n)){e.target=this;var r,i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[],a=h(i);try{for(a.s();!(r=a.n()).done;)r.value.call(this,e)}catch(f){a.e(f)}finally{a.f()}var o,s=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[],l=h(s);try{for(l.s();!(o=l.n()).done;){var c=o.value;ut(n,c,this._oneTimeListeners),c.call(this,e)}}catch(f){l.e(f)}finally{l.f()}var u=this._eventedParent;u&&(q(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof ht&&console.error(e.error);return this}},{key:"listens",value:function(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}},{key:"setEventedParent",value:function(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}]),e}(),pt=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":{},"mapbox":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{},"line":{},"line-center":{}},"default":"point","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{},"width":{},"height":{},"both":{}},"default":"none","requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["text-field",{"!":"text-variable-anchor"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","requires":["text-field",{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"geometry_type":{"type":"enum","values":{"Point":{},"LineString":{},"Polygon":{}}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":{},"exponential":{},"interval":{},"categorical":{}},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{},"lab":{},"hcl":{}},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds"},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds"}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function mt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:[];d(this,e),this.parent=t,this.bindings={};var r,i=h(n);try{for(i.s();!(r=i.n()).done;){var a=f(r.value,2),o=a[0],s=a[1];this.bindings[o]=s}}catch(l){i.e(l)}finally{i.f()}}return p(e,[{key:"concat",value:function(t){return new e(this,t)}},{key:"get",value:function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error("".concat(e," not found in scope."))}},{key:"has",value:function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}]),e}(),bt=xt,wt={kind:"null"},kt={kind:"number"},zt={kind:"string"},Mt={kind:"boolean"},Tt={kind:"color"},St={kind:"object"},Et={kind:"value"},Ct={kind:"collator"},At={kind:"formatted"},It={kind:"resolvedImage"};function Pt(e,t){return{kind:"array",itemType:e,N:t}}function Lt(e){if("array"===e.kind){var t=Lt(e.itemType);return"number"==typeof e.N?"array<".concat(t,", ").concat(e.N,">"):"value"===e.itemType.kind?"array":"array<".concat(t,">")}return e.kind}var Dt=[wt,kt,zt,Mt,Tt,At,St,Pt(Et),It];function Rt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Rt(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var n=0,r=Dt;n255?255:e}function jt(e){return Vt("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function Ut(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function Ht(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}try{Nt={}.parseCSSColor=function(e){var t,n=e.replace(/ /g,"").toLowerCase();if(n in Ft)return Ft[n].slice();if("#"===n[0])return 4===n.length?(t=parseInt(n.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===n.length&&(t=parseInt(n.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var r=n.indexOf("("),i=n.indexOf(")");if(-1!==r&&i+1===n.length){var a=n.substr(0,r),o=n.substr(r+1,i-(r+1)).split(","),s=1;switch(a){case"rgba":if(4!==o.length)return null;s=Ut(o.pop());case"rgb":return 3!==o.length?null:[jt(o[0]),jt(o[1]),jt(o[2]),s];case"hsla":if(4!==o.length)return null;s=Ut(o.pop());case"hsl":if(3!==o.length)return null;var l=(parseFloat(o[0])%360+360)%360/360,c=Ut(o[1]),u=Ut(o[2]),f=u<=.5?u*(c+1):u+c-u*c,h=2*u-f;return[Vt(255*Ht(h,f,l+1/3)),Vt(255*Ht(h,f,l)),Vt(255*Ht(h,f,l-1/3)),s];default:return null}}return null}}catch(e){}var Zt=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;d(this,e),this.r=t,this.g=n,this.b=r,this.a=i}return p(e,[{key:"toString",value:function(){var e=this.toArray(),t=f(e,4),n=t[0],r=t[1],i=t[2],a=t[3];return"rgba(".concat(Math.round(n),",").concat(Math.round(r),",").concat(Math.round(i),",").concat(a,")")}},{key:"toArray",value:function(){var e=this.r,t=this.g,n=this.b,r=this.a;return 0===r?[0,0,0,0]:[255*e/r,255*t/r,255*n/r,r]}},{key:"toArray01",value:function(){var e=this.r,t=this.g,n=this.b,r=this.a;return 0===r?[0,0,0,0]:[e/r,t/r,n/r,r]}},{key:"toArray01PremultipliedAlpha",value:function(){return[this.r,this.g,this.b,this.a]}}],[{key:"parse",value:function(t){if(t){if(t instanceof e)return t;if("string"==typeof t){var n=Nt(t);return n?new e(n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3]):void 0}}}}]),e}();Zt.black=new Zt(0,0,0,1),Zt.white=new Zt(1,1,1,1),Zt.transparent=new Zt(0,0,0,0),Zt.red=new Zt(1,0,0,1),Zt.blue=new Zt(0,0,1,1);var Gt=Zt,qt=function(){function e(t,n,r){d(this,e),this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}return p(e,[{key:"compare",value:function(e,t){return this.collator.compare(e,t)}},{key:"resolvedLocale",value:function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}]),e}(),Wt=p((function e(t,n,r,i,a){d(this,e),this.text=t.normalize?t.normalize():t,this.image=n,this.scale=r,this.fontStack=i,this.textColor=a})),Xt=function(){function e(t){d(this,e),this.sections=t}return p(e,[{key:"isEmpty",value:function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))}},{key:"toString",value:function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")}},{key:"serialize",value:function(){var e,t=["format"],n=h(this.sections);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.image)t.push(["image",r.image.name]);else{t.push(r.text);var i={};r.fontStack&&(i["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(i["font-scale"]=r.scale),r.textColor&&(i["text-color"]=["rgba"].concat(r.textColor.toArray())),t.push(i)}}}catch(a){n.e(a)}finally{n.f()}return t}}],[{key:"fromString",value:function(t){return new e([new Wt(t,null,null,null,null)])}},{key:"factory",value:function(t){return t instanceof e?t:e.fromString(t)}}]),e}(),Yt=function(){function e(t){d(this,e),this.name=t.name,this.available=t.available}return p(e,[{key:"toString",value:function(){return this.name}},{key:"serialize",value:function(){return["image",this.name]}}],[{key:"fromString",value:function(t){return t?new e({name:t,available:!1}):null}}]),e}();function Kt(e,t,n,r){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value [".concat([e,t,n,r].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof r?[e,t,n,r]:[e,t,n]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function $t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Gt)return!0;if(e instanceof qt)return!0;if(e instanceof Xt)return!0;if(e instanceof Yt)return!0;if(Array.isArray(e)){var t,n=h(e);try{for(n.s();!(t=n.n()).done;)if(!$t(t.value))return!1}catch(i){n.e(i)}finally{n.f()}return!0}if("object"==typeof e){for(var r in e)if(!$t(e[r]))return!1;return!0}return!1}function Jt(e){if(null===e)return wt;if("string"==typeof e)return zt;if("boolean"==typeof e)return Mt;if("number"==typeof e)return kt;if(e instanceof Gt)return Tt;if(e instanceof qt)return Ct;if(e instanceof Xt)return At;if(e instanceof Yt)return It;if(Array.isArray(e)){var t,n,r=e.length,i=h(e);try{for(i.s();!(n=i.n()).done;){var a=Jt(n.value);if(t){if(t===a)continue;t=Et;break}t=a}}catch(o){i.e(o)}finally{i.f()}return Pt(t||Et,r)}return St}function Qt(e){var t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Gt||e instanceof Xt||e instanceof Yt?e.toString():JSON.stringify(e)}var en=function(){function e(t,n){d(this,e),this.type=t,this.value=n}return p(e,[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Gt?["rgba"].concat(this.value.toArray()):this.value instanceof Xt?this.value.serialize():this.value}}],[{key:"parse",value:function(t,n){if(2!==t.length)return n.error("'literal' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(!$t(t[1]))return n.error("invalid value");var r=t[1],i=Jt(r),a=n.expectedType;return"array"!==i.kind||0!==i.N||!a||"array"!==a.kind||"number"==typeof a.N&&0!==a.N||(i=a),new e(i,r)}}]),e}(),tn=en,nn=function(){function e(t){d(this,e),this.name="ExpressionEvaluationError",this.message=t}return p(e,[{key:"toJSON",value:function(){return this.message}}]),e}(),rn={string:zt,number:kt,boolean:Mt,object:St},an=function(){function e(t,n){d(this,e),this.type=t,this.args=n}return p(e,[{key:"evaluate",value:function(e){for(var t=0;t1)&&t.push(r)}}return t.concat(this.args.map((function(e){return e.serialize()})))}}],[{key:"parse",value:function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var r,i=1,a=t[0];if("array"===a){var o,s;if(t.length>2){var l=t[1];if("string"!=typeof l||!(l in rn)||"object"===l)return n.error('The item type argument of "array" must be one of string, number, boolean',1);o=rn[l],i++}else o=Et;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return n.error('The length argument to "array" must be a positive integer literal',2);s=t[2],i++}r=Pt(o,s)}else r=rn[a];for(var c=[];i-1),n}},{key:"eachChild",value:function(e){e(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["image",this.input.serialize()]}}],[{key:"parse",value:function(t,n){if(2!==t.length)return n.error("Expected two arguments.");var r=n.parse(t[1],1,zt);return r?new e(r):n.error("No image name provided.")}}]),e}(),cn={"to-boolean":Mt,"to-color":Tt,"to-number":kt,"to-string":zt},un=function(){function e(t,n){d(this,e),this.type=t,this.args=n}return p(e,[{key:"evaluate",value:function(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){var t,n,r,i=h(this.args);try{for(i.s();!(r=i.n()).done;){if(t=r.value.evaluate(e),n=null,t instanceof Gt)return t;if("string"==typeof t){var a=e.parseColor(t);if(a)return a}else if(Array.isArray(t)&&!(n=t.length<3||t.length>4?"Invalid rbga value ".concat(JSON.stringify(t),": expected an array containing either three or four numeric values."):Kt(t[0],t[1],t[2],t[3])))return new Gt(t[0]/255,t[1]/255,t[2]/255,t[3])}}catch(u){i.e(u)}finally{i.f()}throw new nn(n||"Could not parse color from value '".concat("string"==typeof t?t:String(JSON.stringify(t)),"'"))}if("number"===this.type.kind){var o,s=null,l=h(this.args);try{for(l.s();!(o=l.n()).done;){if(null===(s=o.value.evaluate(e)))return 0;var c=Number(s);if(!isNaN(c))return c}}catch(u){l.e(u)}finally{l.f()}throw new nn("Could not convert ".concat(JSON.stringify(s)," to number."))}return"formatted"===this.type.kind?Xt.fromString(Qt(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Yt.fromString(Qt(this.args[0].evaluate(e))):Qt(this.args[0].evaluate(e))}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"outputDefined",value:function(){return this.args.every((function(e){return e.outputDefined()}))}},{key:"serialize",value:function(){if("formatted"===this.type.kind)return new sn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new ln(this.args[0]).serialize();var e=["to-".concat(this.type.kind)];return this.eachChild((function(t){e.push(t.serialize())})),e}}],[{key:"parse",value:function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return n.error("Expected one argument.");for(var i=cn[r],a=[],o=1;o=t[2]||e[1]<=t[1]||e[3]>=t[3])}function xn(e,t){var n=(180+e[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(n*i*yn),Math.round(r*i*yn)]}function bn(e,t,n){var r=e[0]-t[0],i=e[1]-t[1],a=e[0]-n[0],o=e[1]-n[1];return r*o-a*i==0&&r*a<=0&&i*o<=0}function wn(e,t){for(var n,r,i,a=!1,o=0,s=t.length;o(n=e)[1]!=(i=l[c+1])[1]>n[1]&&n[0]<(i[0]-r[0])*(n[1]-r[1])/(i[1]-r[1])+r[0]&&(a=!a)}return a}function kn(e,t){for(var n=0;n0&&s<0||o<0&&s>0}function Mn(e,t,n){var r,i,a,o,s,l,c,u=h(n);try{for(u.s();!(r=u.n()).done;)for(var f=r.value,d=0;dn[2]){var i=.5*r,a=e[0]-n[0]>i?-r:n[0]-e[0]>i?r:0;0===a&&(a=e[0]-n[2]>i?-r:n[2]-e[0]>i?r:0),e[0]+=a}gn(t,e)}function In(e,t,n,r){var i=Math.pow(2,r.z)*yn,a=[r.x*yn,r.y*yn],o=[];if(!e)return o;var s,l=h(e);try{for(l.s();!(s=l.n()).done;){var c,u=s.value,f=h(u);try{for(f.s();!(c=f.n()).done;){var d=c.value,p=[d.x+a[0],d.y+a[1]];An(p,t,n,i),o.push(p)}}catch(m){f.e(m)}finally{f.f()}}}catch(m){l.e(m)}finally{l.f()}return o}function Pn(e,t,n,r){var i=Math.pow(2,r.z)*yn,a=[r.x*yn,r.y*yn],o=[];if(!e)return o;var s,l,c=h(e);try{for(c.s();!(s=c.n()).done;){var u,f=s.value,d=[],p=h(f);try{for(p.s();!(u=p.n()).done;){var m=u.value,v=[m.x+a[0],m.y+a[1]];gn(t,v),d.push(v)}}catch(w){p.e(w)}finally{p.f()}o.push(d)}}catch(w){c.e(w)}finally{c.f()}if(t[2]-t[0]<=i/2){(l=t)[0]=l[1]=1/0,l[2]=l[3]=-1/0;var y,g=h(o);try{for(g.s();!(y=g.n()).done;){var _,x=y.value,b=h(x);try{for(b.s();!(_=b.n()).done;)An(_.value,t,n,i)}catch(w){b.e(w)}finally{b.f()}}}catch(w){g.e(w)}finally{g.f()}}return o}var Ln=function(){function e(t,n){d(this,e),this.type=Mt,this.geojson=t,this.geometries=n}return p(e,[{key:"evaluate",value:function(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){var n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){var a=En(t.coordinates,r,i),o=In(e.geometry(),n,r,i);if(!_n(n,r))return!1;var s,l=h(o);try{for(l.s();!(s=l.n()).done;)if(!wn(s.value,a))return!1}catch(p){l.e(p)}finally{l.f()}}if("MultiPolygon"===t.type){var c=Cn(t.coordinates,r,i),u=In(e.geometry(),n,r,i);if(!_n(n,r))return!1;var f,d=h(u);try{for(d.s();!(f=d.n()).done;)if(!kn(f.value,c))return!1}catch(p){d.e(p)}finally{d.f()}}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){var n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){var a=En(t.coordinates,r,i),o=Pn(e.geometry(),n,r,i);if(!_n(n,r))return!1;var s,l=h(o);try{for(l.s();!(s=l.n()).done;)if(!Tn(s.value,a))return!1}catch(p){l.e(p)}finally{l.f()}}if("MultiPolygon"===t.type){var c=Cn(t.coordinates,r,i),u=Pn(e.geometry(),n,r,i);if(!_n(n,r))return!1;var f,d=h(u);try{for(d.s();!(f=d.n()).done;)if(!Sn(f.value,c))return!1}catch(p){d.e(p)}finally{d.f()}}return!0}(e,this.geometries)}return!1}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["within",this.geojson]}}],[{key:"parse",value:function(t,n){if(2!==t.length)return n.error("'within' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if($t(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;i=0)return!1;var n=!0;return e.eachChild((function(e){n&&!Bn(e,t)&&(n=!1)})),n}var Nn=function(){function e(t,n){d(this,e),this.type=n.type,this.name=t,this.boundExpression=n}return p(e,[{key:"evaluate",value:function(e){return this.boundExpression.evaluate(e)}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["var",this.name]}}],[{key:"parse",value:function(t,n){if(2!==t.length||"string"!=typeof t[1])return n.error("'var' expression requires exactly one string literal argument.");var r=t[1];return n.scope.has(r)?new e(r,n.scope.get(r)):n.error('Unknown variable "'.concat(r,'". Make sure "').concat(r,'" has been bound in an enclosing "let" expression before using it.'),1)}}]),e}(),Fn=Nn,Vn=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new bt,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];d(this,e),this.registry=t,this.path=n,this.key=n.map((function(e){return"[".concat(e,"]")})).join(""),this.scope=i,this.errors=a,this.expectedType=r}return p(e,[{key:"parse",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)}},{key:"_parse",value:function(e,t){function n(e,t,n){return"assert"===n?new on(t,[e]):"coerce"===n?new fn(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=e[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found ".concat(typeof r,' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;var i=this.registry[r];if(i){var a=i.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=n(a,o,t.typeAnnotation||"coerce");else a=n(a,o,t.typeAnnotation||"assert")}if(!(a instanceof tn)&&"resolvedImage"!==a.type.kind&&Un(a)){var l=new dn;try{a=new tn(a.type,a.evaluate(l))}catch(e){return this.error(e.message),null}}return a}return this.error('Unknown expression "'.concat(r,'". If you wanted a literal array, use ["literal", [...]].'),0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found ".concat(typeof e," instead."))}},{key:"concat",value:function(t,n,r){var i="number"==typeof t?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new e(this.registry,i,n||null,a,this.errors)}},{key:"error",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rt))throw new nn("Input is not a number.");o=s-1}return 0}var Zn=function(){function e(t,n,r){d(this,e),this.type=t,this.input=n,this.labels=[],this.outputs=[];var i,a=h(r);try{for(a.s();!(i=a.n()).done;){var o=f(i.value,2),s=o[0],l=o[1];this.labels.push(s),this.outputs.push(l)}}catch(c){a.e(c)}finally{a.f()}}return p(e,[{key:"evaluate",value:function(e){var t=this.labels,n=this.outputs;if(1===t.length)return n[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);var i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[Hn(t,r)].evaluate(e)}},{key:"eachChild",value:function(e){e(this.input);var t,n=h(this.outputs);try{for(n.s();!(t=n.n()).done;)e(t.value)}catch(r){n.e(r)}finally{n.f()}}},{key:"outputDefined",value:function(){return this.outputs.every((function(e){return e.outputDefined()}))}},{key:"serialize",value:function(){for(var e=["step",this.input.serialize()],t=0;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}],[{key:"parse",value:function(t,n){if(t.length-1<4)return n.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");var r=n.parse(t[1],1,kt);if(!r)return null;var i=[],a=null;n.expectedType&&"value"!==n.expectedType.kind&&(a=n.expectedType);for(var o=1;o=s)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);var f=n.parse(l,u,a);if(!f)return null;a=a||f.type,i.push([s,f])}return new e(a,r,i)}}]),e}(),Gn=Zn;function qn(e,t,n){return e*(1-n)+t*n}var Wn=Object.freeze({__proto__:null,array:function(e,t,n){return e.map((function(e,r){return qn(e,t[r],n)}))},color:function(e,t,n){return new Gt(qn(e.r,t.r,n),qn(e.g,t.g,n),qn(e.b,t.b,n),qn(e.a,t.a,n))},number:qn}),Xn=.95047,Yn=1.08883,Kn=4/29,$n=6/29,Jn=3*$n*$n,Qn=$n*$n*$n,er=Math.PI/180,tr=180/Math.PI;function nr(e){return e>Qn?Math.pow(e,1/3):e/Jn+Kn}function rr(e){return e>$n?e*e*e:Jn*(e-Kn)}function ir(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ar(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function or(e){var t=ar(e.r),n=ar(e.g),r=ar(e.b),i=nr((.4124564*t+.3575761*n+.1804375*r)/Xn),a=nr((.2126729*t+.7151522*n+.072175*r)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-nr((.0193339*t+.119192*n+.9503041*r)/Yn)),alpha:e.a}}function sr(e){var t=(e.l+16)/116,n=isNaN(e.a)?t:t+e.a/500,r=isNaN(e.b)?t:t-e.b/200;return t=1*rr(t),n=Xn*rr(n),r=Yn*rr(r),new Gt(ir(3.2404542*n-1.5371385*t-.4985314*r),ir(-.969266*n+1.8760108*t+.041556*r),ir(.0556434*n-.2040259*t+1.0572252*r),e.alpha)}function lr(e,t,n){var r=t-e;return e+n*(r>180||r<-180?r-360*Math.round(r/360):r)}var cr={forward:or,reverse:sr,interpolate:function(e,t,n){return{l:qn(e.l,t.l,n),a:qn(e.a,t.a,n),b:qn(e.b,t.b,n),alpha:qn(e.alpha,t.alpha,n)}}},ur={forward:function(e){var t=or(e),n=t.l,r=t.a,i=t.b,a=Math.atan2(i,r)*tr;return{h:a<0?a+360:a,c:Math.sqrt(r*r+i*i),l:n,alpha:e.a}},reverse:function(e){var t=e.h*er,n=e.c;return sr({l:e.l,a:Math.cos(t)*n,b:Math.sin(t)*n,alpha:e.alpha})},interpolate:function(e,t,n){return{h:lr(e.h,t.h,n),c:qn(e.c,t.c,n),l:qn(e.l,t.l,n),alpha:qn(e.alpha,t.alpha,n)}}},fr=Object.freeze({__proto__:null,hcl:ur,lab:cr}),hr=function(){function e(t,n,r,i,a){d(this,e),this.type=t,this.operator=n,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];var o,s=h(a);try{for(s.s();!(o=s.n()).done;){var l=f(o.value,2),c=l[0],u=l[1];this.labels.push(c),this.outputs.push(u)}}catch(p){s.e(p)}finally{s.f()}}return p(e,[{key:"evaluate",value:function(t){var n=this.labels,r=this.outputs;if(1===n.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=n[0])return r[0].evaluate(t);var a=n.length;if(i>=n[a-1])return r[a-1].evaluate(t);var o=Hn(n,i),s=e.interpolationFactor(this.interpolation,i,n[o],n[o+1]),l=r[o].evaluate(t),c=r[o+1].evaluate(t);return"interpolate"===this.operator?Wn[this.type.kind.toLowerCase()](l,c,s):"interpolate-hcl"===this.operator?ur.reverse(ur.interpolate(ur.forward(l),ur.forward(c),s)):cr.reverse(cr.interpolate(cr.forward(l),cr.forward(c),s))}},{key:"eachChild",value:function(e){e(this.input);var t,n=h(this.outputs);try{for(n.s();!(t=n.n()).done;)e(t.value)}catch(r){n.e(r)}finally{n.f()}}},{key:"outputDefined",value:function(){return this.outputs.every((function(e){return e.outputDefined()}))}},{key:"serialize",value:function(){var e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],n=0;n1})))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:u}}if(t.length-1<4)return n.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(!(o=n.parse(o,2,kt)))return null;var f=[],h=null;"interpolate-hcl"===i||"interpolate-lab"===i?h=Tt:n.expectedType&&"value"!==n.expectedType.kind&&(h=n.expectedType);for(var d=0;d=p)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',v);var g=n.parse(m,y,h);if(!g)return null;h=h||g.type,f.push([p,g])}return"number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new e(h,i,a,o,f):n.error("Type ".concat(Lt(h)," is not interpolatable."))}}]),e}();function dr(e,t,n,r){var i=r-n,a=e-n;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}var pr=hr,mr=function(){function e(t,n){d(this,e),this.type=t,this.args=n}return p(e,[{key:"evaluate",value:function(e){var t,n,r=null,i=0,a=h(this.args);try{for(a.s();!(n=a.n()).done;){var o=n.value;if(i++,(r=o.evaluate(e))&&r instanceof Yt&&!r.available&&(t||(t=r),r=null,i===this.args.length))return t;if(null!==r)break}}catch(s){a.e(s)}finally{a.f()}return r}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"outputDefined",value:function(){return this.args.every((function(e){return e.outputDefined()}))}},{key:"serialize",value:function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e}}],[{key:"parse",value:function(t,n){if(t.length<2)return n.error("Expectected at least one argument.");var r=null,i=n.expectedType;i&&"value"!==i.kind&&(r=i);var a,o=[],s=h(t.slice(1));try{for(s.s();!(a=s.n()).done;){var l=a.value,c=n.parse(l,1+o.length,r,void 0,{typeAnnotation:"omit"});if(!c)return null;r=r||c.type,o.push(c)}}catch(f){s.e(f)}finally{s.f()}var u=i&&o.some((function(e){return Rt(i,e.type)}));return new e(u?Et:r,o)}}]),e}(),vr=mr,yr=function(){function e(t,n){d(this,e),this.type=n.type,this.bindings=[].concat(t),this.result=n}return p(e,[{key:"evaluate",value:function(e){return this.result.evaluate(e)}},{key:"eachChild",value:function(e){var t,n=h(this.bindings);try{for(n.s();!(t=n.n()).done;)e(t.value[1])}catch(r){n.e(r)}finally{n.f()}e(this.result)}},{key:"outputDefined",value:function(){return this.result.outputDefined()}},{key:"serialize",value:function(){var e,t=["let"],n=h(this.bindings);try{for(n.s();!(e=n.n()).done;){var r=f(e.value,2),i=r[0],a=r[1];t.push(i,a.serialize())}}catch(o){n.e(o)}finally{n.f()}return t.push(this.result.serialize()),t}}],[{key:"parse",value:function(t,n){if(t.length<4)return n.error("Expected at least 3 arguments, but found ".concat(t.length-1," instead."));for(var r=[],i=1;i=n.length)throw new nn("Array index out of bounds: ".concat(t," > ").concat(n.length-1,"."));if(t!==Math.floor(t))throw new nn("Array index must be an integer, but found ".concat(t," instead."));return n[t]}},{key:"eachChild",value:function(e){e(this.index),e(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["at",this.index.serialize(),this.input.serialize()]}}],[{key:"parse",value:function(t,n){if(3!==t.length)return n.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));var r=n.parse(t[1],1,kt),i=n.parse(t[2],2,Pt(n.expectedType||Et));return r&&i?new e(i.type.itemType,r,i):null}}]),e}(),xr=_r,br=function(){function e(t,n){d(this,e),this.type=Mt,this.needle=t,this.haystack=n}return p(e,[{key:"evaluate",value:function(e){var t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(null==n)return!1;if(!Bt(t,["boolean","string","number","null"]))throw new nn("Expected first argument to be of type boolean, string, number or null, but found ".concat(Lt(Jt(t))," instead."));if(!Bt(n,["string","array"]))throw new nn("Expected second argument to be of type array or string, but found ".concat(Lt(Jt(n))," instead."));return n.indexOf(t)>=0}},{key:"eachChild",value:function(e){e(this.needle),e(this.haystack)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["in",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(t,n){if(3!==t.length)return n.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));var r=n.parse(t[1],1,Et),i=n.parse(t[2],2,Et);return r&&i?Ot(r.type,[Mt,zt,kt,wt,Et])?new e(r,i):n.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Lt(r.type)," instead")):null}}]),e}(),wr=br,kr=function(){function e(t,n,r){d(this,e),this.type=kt,this.needle=t,this.haystack=n,this.fromIndex=r}return p(e,[{key:"evaluate",value:function(e){var t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Bt(t,["boolean","string","number","null"]))throw new nn("Expected first argument to be of type boolean, string, number or null, but found ".concat(Lt(Jt(t))," instead."));if(!Bt(n,["string","array"]))throw new nn("Expected second argument to be of type array or string, but found ".concat(Lt(Jt(n))," instead."));if(this.fromIndex){var r=this.fromIndex.evaluate(e);return n.indexOf(t,r)}return n.indexOf(t)}},{key:"eachChild",value:function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(t,n){if(t.length<=2||t.length>=5)return n.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));var r=n.parse(t[1],1,Et),i=n.parse(t[2],2,Et);if(!r||!i)return null;if(!Ot(r.type,[Mt,zt,kt,wt,Et]))return n.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Lt(r.type)," instead"));if(4===t.length){var a=n.parse(t[3],3,kt);return a?new e(r,i,a):null}return new e(r,i)}}]),e}(),zr=kr,Mr=function(){function e(t,n,r,i,a,o){d(this,e),this.inputType=t,this.type=n,this.input=r,this.cases=i,this.outputs=a,this.otherwise=o}return p(e,[{key:"evaluate",value:function(e){var t=this.input.evaluate(e);return(Jt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}},{key:"eachChild",value:function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}},{key:"outputDefined",value:function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var e,t=this,n=["match",this.input.serialize()],r=Object.keys(this.cases).sort(),i=[],a={},o=h(r);try{for(o.s();!(e=o.n()).done;){var s=e.value,l=a[this.cases[s]];void 0===l?(a[this.cases[s]]=i.length,i.push([this.cases[s],[s]])):i[l][1].push(s)}}catch(y){o.e(y)}finally{o.f()}for(var c=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,d=i;uNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,Jt(p)))return null}else r=Jt(p);if(void 0!==a[String(p)])return u.error("Branch labels must be unique.");a[String(p)]=o.length}}catch(g){d.e(g)}finally{d.f()}var m=n.parse(c,s,i);if(!m)return null;i=i||m.type,o.push(m)}var v=n.parse(t[1],1,Et);if(!v)return null;var y=n.parse(t[t.length-1],t.length-1,i);return y?"value"!==v.type.kind&&n.concat(1).checkSubtype(r,v.type)?null:new e(r,i,v,a,o,y):null}}]),e}(),Tr=Mr,Sr=function(){function e(t,n,r){d(this,e),this.type=t,this.branches=n,this.otherwise=r}return p(e,[{key:"evaluate",value:function(e){var t,n=h(this.branches);try{for(n.s();!(t=n.n()).done;){var r=f(t.value,2),i=r[0],a=r[1];if(i.evaluate(e))return a.evaluate(e)}}catch(o){n.e(o)}finally{n.f()}return this.otherwise.evaluate(e)}},{key:"eachChild",value:function(e){var t,n=h(this.branches);try{for(n.s();!(t=n.n()).done;){var r=f(t.value,2),i=r[0],a=r[1];e(i),e(a)}}catch(o){n.e(o)}finally{n.f()}e(this.otherwise)}},{key:"outputDefined",value:function(){return this.branches.every((function(e){var t=f(e,2);return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e}}],[{key:"parse",value:function(t,n){if(t.length<4)return n.error("Expected at least 3 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=0)return n.error("Expected an odd number of arguments.");var r;n.expectedType&&"value"!==n.expectedType.kind&&(r=n.expectedType);for(var i=[],a=1;a=5)return n.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));var r=n.parse(t[1],1,Et),i=n.parse(t[2],2,kt);if(!r||!i)return null;if(!Ot(r.type,[Pt(Et),zt,Et]))return n.error("Expected first argument to be of type array or string, but found ".concat(Lt(r.type)," instead"));if(4===t.length){var a=n.parse(t[3],3,kt);return a?new e(r.type,r,i,a):null}return new e(r.type,r,i)}}]),e}(),Ar=Cr;function Ir(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Pr(e,t,n,r){return 0===r.compare(t,n)}function Lr(e,t,n){var r="=="!==e&&"!="!==e;return function(){function i(e,t,n){d(this,i),this.type=Mt,this.lhs=e,this.rhs=t,this.collator=n,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return p(i,[{key:"evaluate",value:function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){var s=Jt(a),l=Jt(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new nn('Expected arguments for "'.concat(e,'" to be (string, string) or (number, number), but found (').concat(s.kind,", ").concat(l.kind,") instead."))}if(this.collator&&!r&&this.hasUntypedArgument){var c=Jt(a),u=Jt(o);if("string"!==c.kind||"string"!==u.kind)return t(i,a,o)}return this.collator?n(i,a,o,this.collator.evaluate(i)):t(i,a,o)}},{key:"eachChild",value:function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t}}],[{key:"parse",value:function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var n=e[0],a=t.parse(e[1],1,Et);if(!a)return null;if(!Ir(n,a.type))return t.concat(1).error('"'.concat(n,"\" comparisons are not supported for type '").concat(Lt(a.type),"'."));var o=t.parse(e[2],2,Et);if(!o)return null;if(!Ir(n,o.type))return t.concat(2).error('"'.concat(n,"\" comparisons are not supported for type '").concat(Lt(o.type),"'."));if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '".concat(Lt(a.type),"' and '").concat(Lt(o.type),"'."));r&&("value"===a.type.kind&&"value"!==o.type.kind?a=new on(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new on(a.type,[o])));var s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,Ct)))return null}return new i(a,o,s)}}]),i}()}var Dr=Lr("==",(function(e,t,n){return t===n}),Pr),Rr=Lr("!=",(function(e,t,n){return t!==n}),(function(e,t,n,r){return!Pr(0,t,n,r)})),Or=Lr("<",(function(e,t,n){return t",(function(e,t,n){return t>n}),(function(e,t,n,r){return r.compare(t,n)>0})),Nr=Lr("<=",(function(e,t,n){return t<=n}),(function(e,t,n,r){return r.compare(t,n)<=0})),Fr=Lr(">=",(function(e,t,n){return t>=n}),(function(e,t,n,r){return r.compare(t,n)>=0})),Vr=function(){function e(t,n,r,i,a,o){d(this,e),this.type=zt,this.number=t,this.locale=n,this.currency=r,this.unit=i,this.minFractionDigits=a,this.maxFractionDigits=o}return p(e,[{key:"evaluate",value:function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}},{key:"eachChild",value:function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}],[{key:"parse",value:function(t,n){if(3!==t.length)return n.error("Expected two arguments.");var r=n.parse(t[1],1,kt);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return n.error("NumberFormat options argument must be an object.");var a=null;if(i.locale&&!(a=n.parse(i.locale,1,zt)))return null;var o=null;if(i.currency&&!(o=n.parse(i.currency,1,zt)))return null;var s=null;if(i.unit&&!(s=n.parse(i.unit,1,zt)))return null;var l=null;if(i["min-fraction-digits"]&&!(l=n.parse(i["min-fraction-digits"],1,kt)))return null;var c=null;return i["max-fraction-digits"]&&!(c=n.parse(i["max-fraction-digits"],1,kt))?null:new e(r,a,o,s,l,c)}}]),e}(),jr=function(){function e(t){d(this,e),this.type=kt,this.input=t}return p(e,[{key:"evaluate",value:function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new nn("Expected value to be of type string or array, but found ".concat(Lt(Jt(t))," instead."))}},{key:"eachChild",value:function(e){e(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e}}],[{key:"parse",value:function(t,n){if(2!==t.length)return n.error("Expected 1 argument, but found ".concat(t.length-1," instead."));var r=n.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?n.error("Expected argument of type string or array, but found ".concat(Lt(r.type)," instead.")):new e(r):null}}]),e}(),Ur={"==":Dr,"!=":Rr,">":Br,"<":Or,">=":Fr,"<=":Nr,array:on,at:xr,boolean:on,case:Er,coalesce:vr,collator:vn,format:sn,image:ln,in:wr,"index-of":zr,interpolate:pr,"interpolate-hcl":pr,"interpolate-lab":pr,length:jr,let:gr,literal:tn,match:Tr,number:on,"number-format":Vr,object:on,slice:Ar,step:Gn,string:on,"to-boolean":fn,"to-color":fn,"to-number":fn,"to-string":fn,var:Fn,within:Dn};function Hr(e,t){var n=f(t,4),r=n[0],i=n[1],a=n[2],o=n[3];r=r.evaluate(e),i=i.evaluate(e),a=a.evaluate(e);var s=o?o.evaluate(e):1,l=Kt(r,i,a,s);if(l)throw new nn(l);return new Gt(r/255*s,i/255*s,a/255*s,s)}function Zr(e,t){return e in t}function Gr(e,t){var n=t[e];return void 0===n?null:n}function qr(e){return{type:e}}mn.register(Ur,{error:[{kind:"error"},[zt],function(e,t){var n=f(t,1)[0];throw new nn(n.evaluate(e))}],typeof:[zt,[Et],function(e,t){return Lt(Jt(f(t,1)[0].evaluate(e)))}],"to-rgba":[Pt(kt,4),[Tt],function(e,t){return f(t,1)[0].evaluate(e).toArray()}],rgb:[Tt,[kt,kt,kt],Hr],rgba:[Tt,[kt,kt,kt,kt],Hr],has:{type:Mt,overloads:[[[zt],function(e,t){return Zr(f(t,1)[0].evaluate(e),e.properties())}],[[zt,St],function(e,t){var n=f(t,2),r=n[0],i=n[1];return Zr(r.evaluate(e),i.evaluate(e))}]]},get:{type:Et,overloads:[[[zt],function(e,t){return Gr(f(t,1)[0].evaluate(e),e.properties())}],[[zt,St],function(e,t){var n=f(t,2),r=n[0],i=n[1];return Gr(r.evaluate(e),i.evaluate(e))}]]},"feature-state":[Et,[zt],function(e,t){return Gr(f(t,1)[0].evaluate(e),e.featureState||{})}],properties:[St,[],function(e){return e.properties()}],"geometry-type":[zt,[],function(e){return e.geometryType()}],id:[Et,[],function(e){return e.id()}],zoom:[kt,[],function(e){return e.globals.zoom}],pitch:[kt,[],function(e){return e.globals.pitch||0}],"distance-from-center":[kt,[],function(e){return e.distanceFromCenter()}],"heatmap-density":[kt,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[kt,[],function(e){return e.globals.lineProgress||0}],"sky-radial-progress":[kt,[],function(e){return e.globals.skyRadialProgress||0}],accumulated:[Et,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[kt,qr(kt),function(e,t){var n,r=0,i=h(t);try{for(i.s();!(n=i.n()).done;)r+=n.value.evaluate(e)}catch(a){i.e(a)}finally{i.f()}return r}],"*":[kt,qr(kt),function(e,t){var n,r=1,i=h(t);try{for(i.s();!(n=i.n()).done;)r*=n.value.evaluate(e)}catch(a){i.e(a)}finally{i.f()}return r}],"-":{type:kt,overloads:[[[kt,kt],function(e,t){var n=f(t,2),r=n[0],i=n[1];return r.evaluate(e)-i.evaluate(e)}],[[kt],function(e,t){return-f(t,1)[0].evaluate(e)}]]},"/":[kt,[kt,kt],function(e,t){var n=f(t,2),r=n[0],i=n[1];return r.evaluate(e)/i.evaluate(e)}],"%":[kt,[kt,kt],function(e,t){var n=f(t,2),r=n[0],i=n[1];return r.evaluate(e)%i.evaluate(e)}],ln2:[kt,[],function(){return Math.LN2}],pi:[kt,[],function(){return Math.PI}],e:[kt,[],function(){return Math.E}],"^":[kt,[kt,kt],function(e,t){var n=f(t,2),r=n[0],i=n[1];return Math.pow(r.evaluate(e),i.evaluate(e))}],sqrt:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.sqrt(n.evaluate(e))}],log10:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.log(n.evaluate(e))/Math.LN10}],ln:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.log(n.evaluate(e))}],log2:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.log(n.evaluate(e))/Math.LN2}],sin:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.sin(n.evaluate(e))}],cos:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.cos(n.evaluate(e))}],tan:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.tan(n.evaluate(e))}],asin:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.asin(n.evaluate(e))}],acos:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.acos(n.evaluate(e))}],atan:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.atan(n.evaluate(e))}],min:[kt,qr(kt),function(e,t){return Math.min.apply(Math,u(t.map((function(t){return t.evaluate(e)}))))}],max:[kt,qr(kt),function(e,t){return Math.max.apply(Math,u(t.map((function(t){return t.evaluate(e)}))))}],abs:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.abs(n.evaluate(e))}],round:[kt,[kt],function(e,t){var n=f(t,1)[0].evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.floor(n.evaluate(e))}],ceil:[kt,[kt],function(e,t){var n=f(t,1)[0];return Math.ceil(n.evaluate(e))}],"filter-==":[Mt,[zt,Et],function(e,t){var n=f(t,2),r=n[0],i=n[1];return e.properties()[r.value]===i.value}],"filter-id-==":[Mt,[Et],function(e,t){var n=f(t,1)[0];return e.id()===n.value}],"filter-type-==":[Mt,[zt],function(e,t){var n=f(t,1)[0];return e.geometryType()===n.value}],"filter-<":[Mt,[zt,Et],function(e,t){var n=f(t,2),r=n[0],i=n[1],a=e.properties()[r.value],o=i.value;return typeof a==typeof o&&a":[Mt,[zt,Et],function(e,t){var n=f(t,2),r=n[0],i=n[1],a=e.properties()[r.value],o=i.value;return typeof a==typeof o&&a>o}],"filter-id->":[Mt,[Et],function(e,t){var n=f(t,1)[0],r=e.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[Mt,[zt,Et],function(e,t){var n=f(t,2),r=n[0],i=n[1],a=e.properties()[r.value],o=i.value;return typeof a==typeof o&&a<=o}],"filter-id-<=":[Mt,[Et],function(e,t){var n=f(t,1)[0],r=e.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[Mt,[zt,Et],function(e,t){var n=f(t,2),r=n[0],i=n[1],a=e.properties()[r.value],o=i.value;return typeof a==typeof o&&a>=o}],"filter-id->=":[Mt,[Et],function(e,t){var n=f(t,1)[0],r=e.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[Mt,[Et],function(e,t){return f(t,1)[0].value in e.properties()}],"filter-has-id":[Mt,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[Mt,[Pt(zt)],function(e,t){return f(t,1)[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Mt,[Pt(Et)],function(e,t){return f(t,1)[0].value.indexOf(e.id())>=0}],"filter-in-small":[Mt,[zt,Pt(Et)],function(e,t){var n=f(t,2),r=n[0];return n[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Mt,[zt,Pt(Et)],function(e,t){var n=f(t,2),r=n[0],i=n[1];return function(e,t,n,r){for(;n<=r;){var i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}(e.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:Mt,overloads:[[[Mt,Mt],function(e,t){var n=f(t,2),r=n[0],i=n[1];return r.evaluate(e)&&i.evaluate(e)}],[qr(Mt),function(e,t){var n,r=h(t);try{for(r.s();!(n=r.n()).done;)if(!n.value.evaluate(e))return!1}catch(i){r.e(i)}finally{r.f()}return!0}]]},any:{type:Mt,overloads:[[[Mt,Mt],function(e,t){var n=f(t,2),r=n[0],i=n[1];return r.evaluate(e)||i.evaluate(e)}],[qr(Mt),function(e,t){var n,r=h(t);try{for(r.s();!(n=r.n()).done;)if(n.value.evaluate(e))return!0}catch(i){r.e(i)}finally{r.f()}return!1}]]},"!":[Mt,[Mt],function(e,t){return!f(t,1)[0].evaluate(e)}],"is-supported-script":[Mt,[zt],function(e,t){var n=f(t,1)[0],r=e.globals&&e.globals.isSupportedScript;return!r||r(n.evaluate(e))}],upcase:[zt,[zt],function(e,t){return f(t,1)[0].evaluate(e).toUpperCase()}],downcase:[zt,[zt],function(e,t){return f(t,1)[0].evaluate(e).toLowerCase()}],concat:[zt,qr(Et),function(e,t){return t.map((function(t){return Qt(t.evaluate(e))})).join("")}],"resolved-locale":[zt,[Ct],function(e,t){return f(t,1)[0].evaluate(e).resolvedLocale()}]});var Wr=Ur;function Xr(e){return{result:"success",value:e}}function Yr(e){return{result:"error",value:e}}function Kr(e){return"data-driven"===e["property-type"]}function $r(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Jr(e){return!!e.expression&&e.expression.interpolated}function Qr(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function ei(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ti(e){return e}function ni(e,t){var n,r,i,a="color"===t.type,o=e.stops&&"object"==typeof e.stops[0][0],s=o||!(o||void 0!==e.property),l=e.type||(Jr(t)?"exponential":"interval");if(a&&((e=mt({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],Gt.parse(e[1])]}))),e.default=Gt.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!fr[e.colorSpace])throw new Error("Unknown color space: ".concat(e.colorSpace));if("exponential"===l)n=oi;else if("interval"===l)n=ai;else if("categorical"===l){n=ii,r=Object.create(null);var c,u=h(e.stops);try{for(u.s();!(c=u.n()).done;){var f=c.value;r[f[0]]=f[1]}}catch(z){u.e(z)}finally{u.f()}i=typeof e.stops[0][0]}else{if("identity"!==l)throw new Error('Unknown function type "'.concat(l,'"'));n=si}if(o){for(var d={},p=[],m=0;m=e.stops[r-1][0])return e.stops[r-1][1];var i=Hn(e.stops.map((function(e){return e[0]})),n);return e.stops[i][1]}function oi(e,t,n){var r=void 0!==e.base?e.base:1;if("number"!==Qr(n))return ri(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];var a=Hn(e.stops.map((function(e){return e[0]})),n),o=function(e,t,n,r){var i=r-n,a=e-n;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}(n,r,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],c=Wn[t.type]||ti;if(e.colorSpace&&"rgb"!==e.colorSpace){var u=fr[e.colorSpace];c=function(e,t){return u.reverse(u.interpolate(u.forward(e),u.forward(t),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&"string"==typeof e[0]&&e[0]in Wr}function ui(e,t){var n=new jn(Wr,[],t?function(e){var t={color:Tt,string:zt,number:kt,enum:zt,boolean:Mt,formatted:At,resolvedImage:It};return"array"===e.type?Pt(t[e.value]||Et,e.length):t[e.type]}(t):void 0),r=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return r?Xr(new li(r,t)):Yr(n.errors)}var fi=function(){function e(t,n){d(this,e),this.kind=t,this._styleExpression=n,this.isStateDependent="constant"!==t&&!On(n.expression)}return p(e,[{key:"evaluateWithoutErrorHandling",value:function(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}},{key:"evaluate",value:function(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)}}]),e}(),hi=function(){function e(t,n,r,i){d(this,e),this.kind=t,this.zoomStops=r,this._styleExpression=n,this.isStateDependent="camera"!==t&&!On(n.expression),this.interpolationType=i}return p(e,[{key:"evaluateWithoutErrorHandling",value:function(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}},{key:"evaluate",value:function(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)}},{key:"interpolationFactor",value:function(e,t,n){return this.interpolationType?pr.interpolationFactor(this.interpolationType,e,t,n):0}}]),e}();function di(e,t){if("error"===(e=ui(e,t)).result)return e;var n=e.value.expression,r=Rn(n);if(!r&&!Kr(t))return Yr([new _t("","data expressions not supported")]);var i=Bn(n,["zoom","pitch","distance-from-center"]);if(!i&&!$r(t))return Yr([new _t("","zoom expressions not supported")]);var a=mi(n);return a||i?a instanceof _t?Yr([a]):a instanceof pr&&!Jr(t)?Yr([new _t("",'"interpolate" expressions cannot be used with this property')]):Xr(a?new hi(r?"camera":"composite",e.value,a.labels,a instanceof pr?a.interpolation:void 0):new fi(r?"constant":"source",e.value)):Yr([new _t("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}var pi=function(){function e(t,n){d(this,e),this._parameters=t,this._specification=n,mt(this,ni(this._parameters,this._specification))}return p(e,null,[{key:"deserialize",value:function(t){return new e(t._parameters,t._specification)}},{key:"serialize",value:function(e){return{_parameters:e._parameters,_specification:e._specification}}}]),e}();function mi(e){var t=null;if(e instanceof gr)t=mi(e.result);else if(e instanceof vr){var n,r=h(e.args);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t=mi(i))break}}catch(a){r.e(a)}finally{r.f()}}else(e instanceof Gn||e instanceof pr)&&e.input instanceof mn&&"zoom"===e.input.name&&(t=e);return t instanceof _t||e.eachChild((function(e){var n=mi(e);n instanceof _t?t=n:!t&&n?t=new _t("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&n&&t!==n&&(t=new _t("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}var vi=p((function e(t,n,r,i){d(this,e),this.message=(t?"".concat(t,": "):"")+r,i&&(this.identifier=i),null!=n&&n.__line__&&(this.line=n.__line__)}));function yi(e){var t=e.key,n=e.value,r=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=[],l=Qr(n);if("object"!==l)return[new vi(t,n,"object expected, ".concat(l," found"))];for(var c in n){var u=c.split(".")[0],f=void 0;i[u]?f=i[u]:r[u]?f=$i:i["*"]?f=i["*"]:r["*"]&&(f=$i),f?s=s.concat(f({key:(t?"".concat(t,"."):t)+c,value:n[c],valueSpec:r[u]||r["*"],style:a,styleSpec:o,object:n,objectKey:c},n)):s.push(new vi(t,n[c],'unknown property "'.concat(c,'"')))}for(var h in r)i[h]||r[h].required&&void 0===r[h].default&&void 0===n[h]&&s.push(new vi(t,n,'missing required property "'.concat(h,'"')));return s}function gi(e){var t=e.value,n=e.valueSpec,r=e.style,i=e.styleSpec,a=e.key,o=e.arrayElementValidator||$i;if("array"!==Qr(t))return[new vi(a,t,"array expected, ".concat(Qr(t)," found"))];if(n.length&&t.length!==n.length)return[new vi(a,t,"array length ".concat(n.length," expected, length ").concat(t.length," found"))];if(n["min-length"]&&t.lengtho)return[new vi(t,n,"".concat(n," is greater than the maximum value ").concat(o))]}return[]}function xi(e){var t,n,r,i=e.valueSpec,a=vt(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,c="array"===Qr(e.value.stops)&&"array"===Qr(e.value.stops[0])&&"object"===Qr(e.value.stops[0][0]),u=yi({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===a)return[new vi(e.key,e.value,'identity function may not have a "stops" property')];var t=[],n=e.value;return t=t.concat(gi({key:e.key,value:n,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:f})),"array"===Qr(n)&&0===n.length&&t.push(new vi(e.key,n,"array must have at least one stop")),t},default:function(e){return $i({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===a&&s&&u.push(new vi(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||u.push(new vi(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!Jr(e.valueSpec)&&u.push(new vi(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Kr(e.valueSpec)?u.push(new vi(e.key,e.value,"property functions not supported")):s&&!$r(e.valueSpec)&&u.push(new vi(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==e.value.property||u.push(new vi(e.key,e.value,'"property" property is required')),u;function f(e){var t=[],a=e.value,s=e.key;if("array"!==Qr(a))return[new vi(s,a,"array expected, ".concat(Qr(a)," found"))];if(2!==a.length)return[new vi(s,a,"array length 2 expected, length ".concat(a.length," found"))];if(c){if("object"!==Qr(a[0]))return[new vi(s,a,"object expected, ".concat(Qr(a[0])," found"))];if(void 0===a[0].zoom)return[new vi(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new vi(s,a,"object stop key must have value")];var l=vt(a[0].zoom);if("number"!=typeof l)return[new vi(s,a[0].zoom,"stop zoom values must be numbers")];if(r&&r>l)return[new vi(s,a[0].zoom,"stop zoom values must appear in ascending order")];l!==r&&(r=l,n=void 0,o={}),t=t.concat(yi({key:"".concat(s,"[0]"),value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:_i,value:h}}))}else t=t.concat(h({key:"".concat(s,"[0]"),value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return ci(yt(a[1]))?t.concat([new vi("".concat(s,"[1]"),a[1],"expressions are not allowed in function stops.")]):t.concat($i({key:"".concat(s,"[1]"),value:a[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function h(e,r){var s=Qr(e.value),l=vt(e.value),c=null!==e.value?e.value:r;if(t){if(s!==t)return[new vi(e.key,c,"".concat(s," stop domain type must match previous stop domain type ").concat(t))]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s&&"number"!=typeof l&&"string"!=typeof l&&"boolean"!=typeof l)return[new vi(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, ".concat(s," found");return Kr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new vi(e.key,c,u)]}return"categorical"!==a||"number"!==s||"number"==typeof l&&isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&"number"==typeof l&&"number"==typeof n&&void 0!==n&&l=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":var t,n=h(e.slice(1));try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!zi(r)&&"boolean"!=typeof r)return!1}}catch(i){n.e(i)}finally{n.f()}return!0;default:return!0}}function Mi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill";if(null==e)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};zi(e)||(e=Pi(e));var n=e,r=!0;try{r=function(e){if(!Ei(e))return e;var t=yt(e);return Si(t),t=Ti(t)}(n)}catch(e){console.warn("Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n".concat(JSON.stringify(n,null,2),"\n "))}var i=pt["filter_".concat(t)],a=ui(r,i),o=null;if("error"===a.result)throw new Error(a.value.map((function(e){return"".concat(e.key,": ").concat(e.message)})).join(", "));o=function(e,t,n){return a.value.evaluate(e,t,{},n)};var s=null,l=null;if(r!==n){var c=ui(n,i);if("error"===c.result)throw new Error(c.value.map((function(e){return"".concat(e.key,": ").concat(e.message)})).join(", "));s=function(e,t,n,r,i){return c.value.evaluate(e,t,{},n,void 0,void 0,r,i)},l=!Rn(c.value.expression)}return{filter:o,dynamicFilter:s||void 0,needGeometry:Ii(r),needFeature:!!l}}function Ti(e){if(!Array.isArray(e))return e;var t=function(e){if(Ci.has(e[0]))for(var t=1;t",">=","<","<=","to-boolean"]);function Ai(e,t){return et?1:0}function Ii(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t"===n||"<="===n||">="===n?Li(e[1],e[2],n):"any"===n?(t=e.slice(1),["any"].concat(t.map(Pi))):"all"===n?["all"].concat(e.slice(1).map(Pi)):"none"===n?["all"].concat(e.slice(1).map(Pi).map(Oi)):"in"===n?Di(e[1],e.slice(2)):"!in"===n?Oi(Di(e[1],e.slice(2))):"has"===n?Ri(e[1]):"!has"===n?Oi(Ri(e[1])):"within"!==n||e}function Li(e,t,n){switch(e){case"$type":return["filter-type-".concat(n),t];case"$id":return["filter-id-".concat(n),t];default:return["filter-".concat(n),e,t]}}function Di(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Ai)]]:["filter-in-small",e,["literal",t]]}}function Ri(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Oi(e){return["!",e]}function Bi(e){return zi(yt(e.value))?bi(mt({},e,{expressionContext:"filter",valueSpec:e.styleSpec["filter_".concat(e.layerType||"fill")]})):Ni(e)}function Ni(e){var t=e.value,n=e.key;if("array"!==Qr(t))return[new vi(n,t,"array expected, ".concat(Qr(t)," found"))];var r,i=e.styleSpec,a=[];if(t.length<1)return[new vi(n,t,"filter array must have at least 1 element")];switch(a=a.concat(ki({key:"".concat(n,"[0]"),value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),vt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===vt(t[1])&&a.push(new vi(n,t,'"$type" cannot be use with operator "'.concat(t[0],'"')));case"==":case"!=":3!==t.length&&a.push(new vi(n,t,'filter array for operator "'.concat(t[0],'" must have 3 elements')));case"in":case"!in":t.length>=2&&"string"!==(r=Qr(t[1]))&&a.push(new vi("".concat(n,"[1]"),t[1],"string expected, ".concat(r," found")));for(var o=2;o1&&void 0!==arguments[1]?arguments[1]:pt;return na($i({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:Ji,"*":function(){return[]}}}))}var ea=function(e){return na(Vi(e))},ta=function(e){return na(ji(e))};function na(e){return e.slice().sort((function(e,t){return e.line&&t.line?e.line-t.line:0}))}function ra(e,t){var n=!1;if(t&&t.length){var r,i=h(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;e.fire(new ht(new Error(a.message))),n=!0}}catch(o){i.e(o)}finally{i.f()}}return n}var ia=oa,aa=3;function oa(e,t,n){var r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var i=new Int32Array(this.arrayBuffer);e=i[0],this.d=(t=i[1])+2*(n=i[2]);for(var a=0;a=u[d+0]&&r>=u[d+1])?(o[h]=!0,a.push(c[h])):o[h]=!1}}},oa.prototype._forEachCell=function(e,t,n,r,i,a,o,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(n),f=this._convertToCellCoord(r),h=l;h<=u;h++)for(var d=c;d<=f;d++){var p=this.d*d+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(d),this._convertFromCellCoord(h+1),this._convertFromCellCoord(d+1)))&&i.call(this,e,t,n,r,p,a,o,s))return}},oa.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},oa.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},oa.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=aa+this.cells.length+1+1,n=0,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),la[t]={klass:e,omit:n.omit||[]}}for(var ua in ca(Object,"Object"),sa.serialize=function(e,t){var n=e.toArrayBuffer();return t&&t.push(n),{buffer:n}},sa.deserialize=function(e){return new sa(e.buffer)},Object.defineProperty(sa,"name",{value:"Grid"}),ca(sa,"Grid"),ca(Gt,"Color"),ca(Error,"Error"),ca(ke,"AJAXError"),ca(Yt,"ResolvedImage"),ca(pi,"StylePropertyFunction"),ca(li,"StyleExpression",{omit:["_evaluator"]}),ca(hi,"ZoomDependentExpression"),ca(fi,"ZoomConstantExpression"),ca(mn,"CompoundExpression",{omit:["_evaluate"]}),Wr)la[Wr[ua]._classRegistryKey]||ca(Wr[ua],"Expression".concat(ua));function fa(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function ha(e){return g.ImageBitmap&&e instanceof g.ImageBitmap}function da(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(fa(e)||ha(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var n=e;return t&&t.push(n.buffer),n}if(e instanceof g.ImageData)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){var r,i=[],a=h(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i.push(da(o,t))}}catch(f){a.e(f)}finally{a.f()}return i}if("object"==typeof e){var s=e.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class ".concat(l));var c=s.serialize?s.serialize(e,t):{};if(!s.serialize){for(var u in e)e.hasOwnProperty(u)&&(la[l].omit.indexOf(u)>=0||(c[u]=da(e[u],t)));e instanceof Error&&(c.message=e.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof e)}function pa(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||fa(e)||ha(e)||ArrayBuffer.isView(e)||e instanceof g.ImageData)return e;if(Array.isArray(e))return e.map(pa);if("object"==typeof e){var t=e.$name||"Object",n=la[t].klass;if(!n)throw new Error("can't deserialize unregistered class ".concat(t));if(n.deserialize)return n.deserialize(e);for(var r=Object.create(n.prototype),i=0,a=Object.keys(e);i=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function va(e){var t,n=h(e);try{for(n.s();!(t=n.n()).done;)if(_a(t.value.charCodeAt(0)))return!0}catch(r){n.e(r)}finally{n.f()}return!1}function ya(e){var t,n=h(e);try{for(n.s();!(t=n.n()).done;)if(!ga(t.value.charCodeAt(0)))return!1}catch(r){n.e(r)}finally{n.f()}return!0}function ga(e){return!(ma.Arabic(e)||ma["Arabic Supplement"](e)||ma["Arabic Extended-A"](e)||ma["Arabic Presentation Forms-A"](e)||ma["Arabic Presentation Forms-B"](e))}function _a(e){return!(746!==e&&747!==e&&(e<4352||!(ma["Bopomofo Extended"](e)||ma.Bopomofo(e)||ma["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||ma["CJK Compatibility Ideographs"](e)||ma["CJK Compatibility"](e)||ma["CJK Radicals Supplement"](e)||ma["CJK Strokes"](e)||!(!ma["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||ma["CJK Unified Ideographs Extension A"](e)||ma["CJK Unified Ideographs"](e)||ma["Enclosed CJK Letters and Months"](e)||ma["Hangul Compatibility Jamo"](e)||ma["Hangul Jamo Extended-A"](e)||ma["Hangul Jamo Extended-B"](e)||ma["Hangul Jamo"](e)||ma["Hangul Syllables"](e)||ma.Hiragana(e)||ma["Ideographic Description Characters"](e)||ma.Kanbun(e)||ma["Kangxi Radicals"](e)||ma["Katakana Phonetic Extensions"](e)||ma.Katakana(e)&&12540!==e||!(!ma["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!ma["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||ma["Unified Canadian Aboriginal Syllabics"](e)||ma["Unified Canadian Aboriginal Syllabics Extended"](e)||ma["Vertical Forms"](e)||ma["Yijing Hexagram Symbols"](e)||ma["Yi Syllables"](e)||ma["Yi Radicals"](e))))}function xa(e){return!(_a(e)||function(e){return!!(ma["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||ma["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||ma["Letterlike Symbols"](e)||ma["Number Forms"](e)||ma["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||ma["Control Pictures"](e)&&9251!==e||ma["Optical Character Recognition"](e)||ma["Enclosed Alphanumerics"](e)||ma["Geometric Shapes"](e)||ma["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||ma["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ma["CJK Symbols and Punctuation"](e)||ma.Katakana(e)||ma["Private Use Area"](e)||ma["CJK Compatibility Forms"](e)||ma["Small Form Variants"](e)||ma["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function ba(e){return e>=1424&&e<=2303||ma["Arabic Presentation Forms-A"](e)||ma["Arabic Presentation Forms-B"](e)}function wa(e,t){return!(!t&&ba(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||ma.Khmer(e))}function ka(e){var t,n=h(e);try{for(n.s();!(t=n.n()).done;)if(ba(t.value.charCodeAt(0)))return!0}catch(r){n.e(r)}finally{n.f()}return!1}var za="deferred",Ma="loading",Ta="loaded",Sa=null,Ea="unavailable",Ca=null,Aa=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(Ea="error"),Sa&&Sa(e)};function Ia(){Pa.fire(new ft("pluginStateChange",{pluginStatus:Ea,pluginURL:Ca}))}var Pa=new dt,La=function(){return Ea},Da=function(){if(Ea!==za||!Ca)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ea=Ma,Ia(),Ca&&Te({url:Ca},(function(e){e?Aa(e):(Ea=Ta,Ia())}))},Ra={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ea===Ta||null!=Ra.applyArabicShaping},isLoading:function(){return Ea===Ma},setState:function(e){Ea=e.pluginStatus,Ca=e.pluginURL},isParsed:function(){return null!=Ra.applyArabicShaping&&null!=Ra.processBidirectionalText&&null!=Ra.processStyledBidirectionalText},getPluginURL:function(){return Ca}},Oa=function(){function e(t,n){d(this,e),this.zoom=t,n?(this.now=n.now,this.fadeDuration=n.fadeDuration,this.transition=n.transition,this.pitch=n.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}return p(e,[{key:"isSupportedScript",value:function(e){return function(e,t){var n,r=h(e);try{for(r.s();!(n=r.n()).done;)if(!wa(n.value.charCodeAt(0),t))return!1}catch(i){r.e(i)}finally{r.f()}return!0}(e,Ra.isLoaded())}}]),e}(),Ba=function(){function e(t,n){d(this,e),this.property=t,this.value=n,this.expression=function(e,t){if(ei(e))return new pi(e,t);if(ci(e)){var n=di(e,t);if("error"===n.result)throw new Error(n.value.map((function(e){return"".concat(e.key,": ").concat(e.message)})).join(", "));return n.value}var r=e;return"string"==typeof e&&"color"===t.type&&(r=Gt.parse(e)),{kind:"constant",evaluate:function(){return r}}}(void 0===n?t.specification.default:n,t.specification)}return p(e,[{key:"isDataDriven",value:function(){return"source"===this.expression.kind||"composite"===this.expression.kind}},{key:"possiblyEvaluate",value:function(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)}}]),e}(),Na=function(){function e(t){d(this,e),this.property=t,this.value=new Ba(t,void 0)}return p(e,[{key:"transitioned",value:function(e,t){return new Va(this.property,this.value,t,q({},e.transition,this.transition),e.now)}},{key:"untransitioned",value:function(){return new Va(this.property,this.value,null,{},0)}}]),e}(),Fa=function(){function e(t){d(this,e),this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}return p(e,[{key:"getValue",value:function(e){return ne(this._values[e].value.value)}},{key:"setValue",value:function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Na(this._values[e].property)),this._values[e].value=new Ba(this._values[e].property,null===t?void 0:ne(t))}},{key:"getTransition",value:function(e){return ne(this._values[e].transition)}},{key:"setTransition",value:function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Na(this._values[e].property)),this._values[e].transition=ne(t)||void 0}},{key:"serialize",value:function(){for(var e={},t=0,n=Object.keys(this._values);tthis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(rthis.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}},{key:"_refreshViews",value:function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}},{key:"destroy",value:function(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}],[{key:"serialize",value:function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}},{key:"deserialize",value:function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}}]),e}();function Qa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=0,r=0;return{members:e.map((function(e){var i=Ka[e.type].BYTES_PER_ELEMENT,a=n=eo(n,Math.max(t,i)),o=e.components||1;return r=Math.max(r,i),n+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:eo(n,Math.max(r,t)),alignment:t}}function eo(e,t){return Math.ceil(e/t)*t}var to=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)}},{key:"emplace",value:function(e,t,n){var r=2*e;return this.int16[r+0]=t,this.int16[r+1]=n,e}}]),n}(Ja);to.prototype.bytesPerElement=4,ca(to,"StructArrayLayout2i4");var no=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}},{key:"emplace",value:function(e,t,n,r){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=n,this.int16[i+2]=r,e}}]),n}(Ja);no.prototype.bytesPerElement=6,ca(no,"StructArrayLayout3i6");var ro=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}},{key:"emplace",value:function(e,t,n,r,i){var a=4*e;return this.int16[a+0]=t,this.int16[a+1]=n,this.int16[a+2]=r,this.int16[a+3]=i,e}}]),n}(Ja);ro.prototype.bytesPerElement=8,ca(ro,"StructArrayLayout4i8");var io=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i,a,o){var s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,r,i,a,o)}},{key:"emplace",value:function(e,t,n,r,i,a,o,s){var l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=n,this.uint8[c+4]=r,this.uint8[c+5]=i,this.uint8[c+6]=a,this.uint8[c+7]=o,this.float32[u+2]=s,e}}]),n}(Ja);io.prototype.bytesPerElement=12,ca(io,"StructArrayLayout2i4ub1f12");var ao=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}},{key:"emplace",value:function(e,t,n,r,i){var a=4*e;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,this.float32[a+3]=i,e}}]),n}(Ja);ao.prototype.bytesPerElement=16,ca(ao,"StructArrayLayout4f16");var oo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i)}},{key:"emplace",value:function(e,t,n,r,i,a){var o=6*e,s=3*e;return this.uint16[o+0]=t,this.uint16[o+1]=n,this.uint16[o+2]=r,this.uint16[o+3]=i,this.float32[s+2]=a,e}}]),n}(Ja);oo.prototype.bytesPerElement=12,ca(oo,"StructArrayLayout4ui1f12");var so=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}},{key:"emplace",value:function(e,t,n,r,i){var a=4*e;return this.uint16[a+0]=t,this.uint16[a+1]=n,this.uint16[a+2]=r,this.uint16[a+3]=i,e}}]),n}(Ja);so.prototype.bytesPerElement=8,ca(so,"StructArrayLayout4ui8");var lo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}},{key:"emplace",value:function(e,t,n,r,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}]),n}(Ja);lo.prototype.bytesPerElement=12,ca(lo,"StructArrayLayout6i12");var co=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i,a,o,s,l,c,u,f){var h=this.length;return this.resize(h+1),this.emplace(h,e,t,n,r,i,a,o,s,l,c,u,f)}},{key:"emplace",value:function(e,t,n,r,i,a,o,s,l,c,u,f,h){var d=12*e;return this.int16[d+0]=t,this.int16[d+1]=n,this.int16[d+2]=r,this.int16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=c,this.int16[d+9]=u,this.int16[d+10]=f,this.int16[d+11]=h,e}}]),n}(Ja);co.prototype.bytesPerElement=24,ca(co,"StructArrayLayout4i4ui4i24");var uo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}},{key:"emplace",value:function(e,t,n,r,i,a,o){var s=10*e,l=5*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.float32[l+2]=i,this.float32[l+3]=a,this.float32[l+4]=o,e}}]),n}(Ja);uo.prototype.bytesPerElement=20,ca(uo,"StructArrayLayout3i3f20");var fo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)}},{key:"emplace",value:function(e,t){return this.uint32[1*e+0]=t,e}}]),n}(Ja);fo.prototype.bytesPerElement=4,ca(fo,"StructArrayLayout1ul4");var ho=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i,a,o,s,l,c,u,f,h){var d=this.length;return this.resize(d+1),this.emplace(d,e,t,n,r,i,a,o,s,l,c,u,f,h)}},{key:"emplace",value:function(e,t,n,r,i,a,o,s,l,c,u,f,h,d){var p=20*e,m=10*e;return this.int16[p+0]=t,this.int16[p+1]=n,this.int16[p+2]=r,this.int16[p+3]=i,this.int16[p+4]=a,this.float32[m+3]=o,this.float32[m+4]=s,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[p+14]=u,this.uint32[m+8]=f,this.uint16[p+18]=h,this.uint16[p+19]=d,e}}]),n}(Ja);ho.prototype.bytesPerElement=40,ca(ho,"StructArrayLayout5i4f1i1ul2ui40");var po=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i,a,o){var s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,r,i,a,o)}},{key:"emplace",value:function(e,t,n,r,i,a,o,s){var l=8*e;return this.int16[l+0]=t,this.int16[l+1]=n,this.int16[l+2]=r,this.int16[l+4]=i,this.int16[l+5]=a,this.int16[l+6]=o,this.int16[l+7]=s,e}}]),n}(Ja);po.prototype.bytesPerElement=16,ca(po,"StructArrayLayout3i2i2i16");var mo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i)}},{key:"emplace",value:function(e,t,n,r,i,a){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=r,this.int16[s+6]=i,this.int16[s+7]=a,e}}]),n}(Ja);mo.prototype.bytesPerElement=16,ca(mo,"StructArrayLayout2f1f2i16");var vo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}},{key:"emplace",value:function(e,t,n,r,i){var a=12*e,o=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=n,this.float32[o+1]=r,this.float32[o+2]=i,e}}]),n}(Ja);vo.prototype.bytesPerElement=12,ca(vo,"StructArrayLayout2ub2f12");var yo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}},{key:"emplace",value:function(e,t,n,r){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e}}]),n}(Ja);yo.prototype.bytesPerElement=12,ca(yo,"StructArrayLayout3f12");var go=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}},{key:"emplace",value:function(e,t,n,r){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=n,this.uint16[i+2]=r,e}}]),n}(Ja);go.prototype.bytesPerElement=6,ca(go,"StructArrayLayout3ui6");var _o=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i,a,o,s,l,c,u,f,h,d,p,m,v,y,g,_,x){var b=this.length;return this.resize(b+1),this.emplace(b,e,t,n,r,i,a,o,s,l,c,u,f,h,d,p,m,v,y,g,_,x)}},{key:"emplace",value:function(e,t,n,r,i,a,o,s,l,c,u,f,h,d,p,m,v,y,g,_,x,b){var w=30*e,k=15*e,z=60*e;return this.int16[w+0]=t,this.int16[w+1]=n,this.int16[w+2]=r,this.float32[k+2]=i,this.float32[k+3]=a,this.uint16[w+8]=o,this.uint16[w+9]=s,this.uint32[k+5]=l,this.uint32[k+6]=c,this.uint32[k+7]=u,this.uint16[w+16]=f,this.uint16[w+17]=h,this.uint16[w+18]=d,this.float32[k+10]=p,this.float32[k+11]=m,this.uint8[z+48]=v,this.uint8[z+49]=y,this.uint8[z+50]=g,this.uint32[k+13]=_,this.int16[w+28]=x,this.uint8[z+58]=b,e}}]),n}(Ja);_o.prototype.bytesPerElement=60,ca(_o,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");var xo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i,a,o,s,l,c,u,f,h,d,p,m,v,y,g,_,x,b,w,k,z,M,T,S,E,C){var A=this.length;return this.resize(A+1),this.emplace(A,e,t,n,r,i,a,o,s,l,c,u,f,h,d,p,m,v,y,g,_,x,b,w,k,z,M,T,S,E,C)}},{key:"emplace",value:function(e,t,n,r,i,a,o,s,l,c,u,f,h,d,p,m,v,y,g,_,x,b,w,k,z,M,T,S,E,C,A){var I=38*e,P=19*e;return this.int16[I+0]=t,this.int16[I+1]=n,this.int16[I+2]=r,this.float32[P+2]=i,this.float32[P+3]=a,this.int16[I+8]=o,this.int16[I+9]=s,this.int16[I+10]=l,this.int16[I+11]=c,this.int16[I+12]=u,this.int16[I+13]=f,this.uint16[I+14]=h,this.uint16[I+15]=d,this.uint16[I+16]=p,this.uint16[I+17]=m,this.uint16[I+18]=v,this.uint16[I+19]=y,this.uint16[I+20]=g,this.uint16[I+21]=_,this.uint16[I+22]=x,this.uint16[I+23]=b,this.uint16[I+24]=w,this.uint16[I+25]=k,this.uint16[I+26]=z,this.uint16[I+27]=M,this.uint16[I+28]=T,this.uint32[P+15]=S,this.float32[P+16]=E,this.float32[P+17]=C,this.float32[P+18]=A,e}}]),n}(Ja);xo.prototype.bytesPerElement=76,ca(xo,"StructArrayLayout3i2f6i15ui1ul3f76");var bo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)}},{key:"emplace",value:function(e,t){return this.float32[1*e+0]=t,e}}]),n}(Ja);bo.prototype.bytesPerElement=4,ca(bo,"StructArrayLayout1f4");var wo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i)}},{key:"emplace",value:function(e,t,n,r,i,a){var o=5*e;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=r,this.float32[o+3]=i,this.float32[o+4]=a,e}}]),n}(Ja);wo.prototype.bytesPerElement=20,ca(wo,"StructArrayLayout5f20");var ko=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}},{key:"emplace",value:function(e,t,n,r,i){var a=6*e;return this.uint32[3*e+0]=t,this.uint16[a+2]=n,this.uint16[a+3]=r,this.uint16[a+4]=i,e}}]),n}(Ja);ko.prototype.bytesPerElement=12,ca(ko,"StructArrayLayout1ul3ui12");var zo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)}},{key:"emplace",value:function(e,t,n){var r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=n,e}}]),n}(Ja);zo.prototype.bytesPerElement=4,ca(zo,"StructArrayLayout2ui4");var Mo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)}},{key:"emplace",value:function(e,t){return this.uint16[1*e+0]=t,e}}]),n}(Ja);Mo.prototype.bytesPerElement=2,ca(Mo,"StructArrayLayout1ui2");var To=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)}},{key:"emplace",value:function(e,t,n){var r=2*e;return this.float32[r+0]=t,this.float32[r+1]=n,e}}]),n}(Ja);To.prototype.bytesPerElement=8,ca(To,"StructArrayLayout2f8");var So=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"projectedAnchorX",get:function(){return this._structArray.int16[this._pos2+0]}},{key:"projectedAnchorY",get:function(){return this._structArray.int16[this._pos2+1]}},{key:"projectedAnchorZ",get:function(){return this._structArray.int16[this._pos2+2]}},{key:"tileAnchorX",get:function(){return this._structArray.int16[this._pos2+3]}},{key:"tileAnchorY",get:function(){return this._structArray.int16[this._pos2+4]}},{key:"x1",get:function(){return this._structArray.float32[this._pos4+3]}},{key:"y1",get:function(){return this._structArray.float32[this._pos4+4]}},{key:"x2",get:function(){return this._structArray.float32[this._pos4+5]}},{key:"y2",get:function(){return this._structArray.float32[this._pos4+6]}},{key:"padding",get:function(){return this._structArray.int16[this._pos2+14]}},{key:"featureIndex",get:function(){return this._structArray.uint32[this._pos4+8]}},{key:"sourceLayerIndex",get:function(){return this._structArray.uint16[this._pos2+18]}},{key:"bucketIndex",get:function(){return this._structArray.uint16[this._pos2+19]}}]),n}($a);So.prototype.size=40;var Eo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"get",value:function(e){return new So(this,e)}}]),n}(ho);ca(Eo,"CollisionBoxArray");var Co=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"projectedAnchorX",get:function(){return this._structArray.int16[this._pos2+0]}},{key:"projectedAnchorY",get:function(){return this._structArray.int16[this._pos2+1]}},{key:"projectedAnchorZ",get:function(){return this._structArray.int16[this._pos2+2]}},{key:"tileAnchorX",get:function(){return this._structArray.float32[this._pos4+2]}},{key:"tileAnchorY",get:function(){return this._structArray.float32[this._pos4+3]}},{key:"glyphStartIndex",get:function(){return this._structArray.uint16[this._pos2+8]}},{key:"numGlyphs",get:function(){return this._structArray.uint16[this._pos2+9]}},{key:"vertexStartIndex",get:function(){return this._structArray.uint32[this._pos4+5]}},{key:"lineStartIndex",get:function(){return this._structArray.uint32[this._pos4+6]}},{key:"lineLength",get:function(){return this._structArray.uint32[this._pos4+7]}},{key:"segment",get:function(){return this._structArray.uint16[this._pos2+16]}},{key:"lowerSize",get:function(){return this._structArray.uint16[this._pos2+17]}},{key:"upperSize",get:function(){return this._structArray.uint16[this._pos2+18]}},{key:"lineOffsetX",get:function(){return this._structArray.float32[this._pos4+10]}},{key:"lineOffsetY",get:function(){return this._structArray.float32[this._pos4+11]}},{key:"writingMode",get:function(){return this._structArray.uint8[this._pos1+48]}},{key:"placedOrientation",get:function(){return this._structArray.uint8[this._pos1+49]},set:function(e){this._structArray.uint8[this._pos1+49]=e}},{key:"hidden",get:function(){return this._structArray.uint8[this._pos1+50]},set:function(e){this._structArray.uint8[this._pos1+50]=e}},{key:"crossTileID",get:function(){return this._structArray.uint32[this._pos4+13]},set:function(e){this._structArray.uint32[this._pos4+13]=e}},{key:"associatedIconIndex",get:function(){return this._structArray.int16[this._pos2+28]}},{key:"flipState",get:function(){return this._structArray.uint8[this._pos1+58]},set:function(e){this._structArray.uint8[this._pos1+58]=e}}]),n}($a);Co.prototype.size=60;var Ao=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"get",value:function(e){return new Co(this,e)}}]),n}(_o);ca(Ao,"PlacedSymbolArray");var Io=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"projectedAnchorX",get:function(){return this._structArray.int16[this._pos2+0]}},{key:"projectedAnchorY",get:function(){return this._structArray.int16[this._pos2+1]}},{key:"projectedAnchorZ",get:function(){return this._structArray.int16[this._pos2+2]}},{key:"tileAnchorX",get:function(){return this._structArray.float32[this._pos4+2]}},{key:"tileAnchorY",get:function(){return this._structArray.float32[this._pos4+3]}},{key:"rightJustifiedTextSymbolIndex",get:function(){return this._structArray.int16[this._pos2+8]}},{key:"centerJustifiedTextSymbolIndex",get:function(){return this._structArray.int16[this._pos2+9]}},{key:"leftJustifiedTextSymbolIndex",get:function(){return this._structArray.int16[this._pos2+10]}},{key:"verticalPlacedTextSymbolIndex",get:function(){return this._structArray.int16[this._pos2+11]}},{key:"placedIconSymbolIndex",get:function(){return this._structArray.int16[this._pos2+12]}},{key:"verticalPlacedIconSymbolIndex",get:function(){return this._structArray.int16[this._pos2+13]}},{key:"key",get:function(){return this._structArray.uint16[this._pos2+14]}},{key:"textBoxStartIndex",get:function(){return this._structArray.uint16[this._pos2+15]}},{key:"textBoxEndIndex",get:function(){return this._structArray.uint16[this._pos2+16]}},{key:"verticalTextBoxStartIndex",get:function(){return this._structArray.uint16[this._pos2+17]}},{key:"verticalTextBoxEndIndex",get:function(){return this._structArray.uint16[this._pos2+18]}},{key:"iconBoxStartIndex",get:function(){return this._structArray.uint16[this._pos2+19]}},{key:"iconBoxEndIndex",get:function(){return this._structArray.uint16[this._pos2+20]}},{key:"verticalIconBoxStartIndex",get:function(){return this._structArray.uint16[this._pos2+21]}},{key:"verticalIconBoxEndIndex",get:function(){return this._structArray.uint16[this._pos2+22]}},{key:"featureIndex",get:function(){return this._structArray.uint16[this._pos2+23]}},{key:"numHorizontalGlyphVertices",get:function(){return this._structArray.uint16[this._pos2+24]}},{key:"numVerticalGlyphVertices",get:function(){return this._structArray.uint16[this._pos2+25]}},{key:"numIconVertices",get:function(){return this._structArray.uint16[this._pos2+26]}},{key:"numVerticalIconVertices",get:function(){return this._structArray.uint16[this._pos2+27]}},{key:"useRuntimeCollisionCircles",get:function(){return this._structArray.uint16[this._pos2+28]}},{key:"crossTileID",get:function(){return this._structArray.uint32[this._pos4+15]},set:function(e){this._structArray.uint32[this._pos4+15]=e}},{key:"textOffset0",get:function(){return this._structArray.float32[this._pos4+16]}},{key:"textOffset1",get:function(){return this._structArray.float32[this._pos4+17]}},{key:"collisionCircleDiameter",get:function(){return this._structArray.float32[this._pos4+18]}}]),n}($a);Io.prototype.size=76;var Po=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"get",value:function(e){return new Io(this,e)}}]),n}(xo);ca(Po,"SymbolInstanceArray");var Lo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"getoffsetX",value:function(e){return this.float32[1*e+0]}}]),n}(bo);ca(Lo,"GlyphOffsetArray");var Do=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"getx",value:function(e){return this.int16[2*e+0]}},{key:"gety",value:function(e){return this.int16[2*e+1]}}]),n}(to);ca(Do,"SymbolLineVertexArray");var Ro=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"featureIndex",get:function(){return this._structArray.uint32[this._pos4+0]}},{key:"sourceLayerIndex",get:function(){return this._structArray.uint16[this._pos2+2]}},{key:"bucketIndex",get:function(){return this._structArray.uint16[this._pos2+3]}},{key:"layoutVertexArrayOffset",get:function(){return this._structArray.uint16[this._pos2+4]}}]),n}($a);Ro.prototype.size=12;var Oo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"get",value:function(e){return new Ro(this,e)}}]),n}(ko);ca(Oo,"FeatureIndexArray");var Bo=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"geta_centroid_pos0",value:function(e){return this.uint16[2*e+0]}},{key:"geta_centroid_pos1",value:function(e){return this.uint16[2*e+1]}}]),n}(zo);ca(Bo,"FillExtrusionCentroidArray");var No=Qa([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Fo=Qa([{name:"a_dash",components:4,type:"Uint16"}]),Vo={exports:{}},jo={exports:{}};jo.exports=function(e,t){var n,r,i,a,o,s,l,c;for(r=e.length-(n=3&e.length),i=t,o=3432918353,s=461845907,c=0;c>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,n){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};var Uo=jo.exports,Ho={exports:{}};Ho.exports=function(e,t){for(var n,r=e.length,i=t^r,a=0;r>=4;)n=1540483477*(65535&(n=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++a;switch(r){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var Zo=Uo,Go=Ho.exports;Vo.exports=Zo,Vo.exports.murmur3=Zo,Vo.exports.murmur2=Go;var qo=T(Vo.exports),Wo=function(){function e(){d(this,e),this.ids=[],this.positions=[],this.indexed=!1}return p(e,[{key:"add",value:function(e,t,n,r){this.ids.push(Xo(e)),this.positions.push(t,n,r)}},{key:"getPositions",value:function(e){for(var t=Xo(e),n=0,r=this.ids.length-1;n>1;this.ids[i]>=t?r=i:n=i+1}for(var a=[];this.ids[n]===t;)a.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return a}}],[{key:"serialize",value:function(e,t){var n=new Float64Array(e.ids),r=new Uint32Array(e.positions);return Yo(n,r,0,n.length-1),t&&t.push(n.buffer,r.buffer),{ids:n,positions:r}}},{key:"deserialize",value:function(t){var n=new e;return n.ids=t.ids,n.positions=t.positions,n.indexed=!0,n}}]),e}();function Xo(e){var t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:qo(String(e))}function Yo(e,t,n,r){for(;n>1],a=n-1,o=r+1;;){do{a++}while(e[a]i);if(a>=o)break;Ko(e,a,o),Ko(t,3*a,3*o),Ko(t,3*a+1,3*o+1),Ko(t,3*a+2,3*o+2)}o-n2&&void 0!==arguments[2]?arguments[2]:function(){return!0};d(this,e),this.binders={},this._buffers=[];var i=[];for(var a in t.paint._values)if(r(a)){var o=t.paint.get(a);if(o instanceof Ha&&Kr(o.property.specification)){var s=ds(a,t.type),l=o.value,c=o.property.specification.type,u=!!o.property.useIntegerZoom,f="line-dasharray"===a||a.endsWith("pattern"),h="line-dasharray"===a&&"constant"!==t.layout.get("line-cap").value.kind;if("constant"!==l.kind||h)if("source"===l.kind||h||f){var p=vs(a,c,"source");this.binders[a]=f?new cs(l,s,c,p,t.id):new ss(l,s,c,p),i.push("/a_".concat(a))}else{var m=vs(a,c,"composite");this.binders[a]=new ls(l,s,c,u,n,m),i.push("/z_".concat(a))}else this.binders[a]=f?new os(l.value,s):new as(l.value,s,c),i.push("/u_".concat(a))}}this.cacheKey=i.sort().join("")}return p(e,[{key:"getMaxValue",value:function(e){var t=this.binders[e];return t instanceof ss||t instanceof ls?t.maxValue:0}},{key:"populatePaintArrays",value:function(e,t,n,r,i,a){for(var o in this.binders){var s=this.binders[o];(s instanceof ss||s instanceof ls||s instanceof cs)&&s.populatePaintArray(e,t,n,r,i,a)}}},{key:"setConstantPatternPositions",value:function(e){for(var t in this.binders){var n=this.binders[t];n instanceof os&&n.setConstantPatternPositions(e)}}},{key:"updatePaintArrays",value:function(e,t,n,r,i,a){var o=!1;for(var s in e){var l,c=t.getPositions(s),u=h(c);try{for(u.s();!(l=u.n()).done;){var f=l.value,d=n.feature(f.index);for(var p in this.binders){var m=this.binders[p];if((m instanceof ss||m instanceof ls||m instanceof cs)&&!0===m.expression.isStateDependent){var v=r.paint.get(p);m.expression=v.value,m.updatePaintArray(f.start,f.end,d,e[s],i,a),o=!0}}}}catch(y){u.e(y)}finally{u.f()}}return o}},{key:"defines",value:function(){var e=[];for(var t in this.binders){var n=this.binders[t];(n instanceof as||n instanceof os)&&e.push.apply(e,u(n.uniformNames.map((function(e){return"#define HAS_UNIFORM_".concat(e)}))))}return e}},{key:"getBinderAttributes",value:function(){var e=[];for(var t in this.binders){var n=this.binders[t];if(n instanceof ss||n instanceof ls||n instanceof cs)for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:function(){return!0};d(this,e),this.programConfigurations={};var i,a=h(t);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.programConfigurations[o.id]=new us(o,n,r)}}catch(s){a.e(s)}finally{a.f()}this.needsUpload=!1,this._featureMap=new Wo,this._bufferOffset=0}return p(e,[{key:"populatePaintArrays",value:function(e,t,n,r,i,a,o){for(var s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(e,t,r,i,a,o);void 0!==t.id&&this._featureMap.add(t.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}},{key:"updatePaintArrays",value:function(e,t,n,r,i){var a,o=h(n);try{for(o.s();!(a=o.n()).done;){var s=a.value;this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(e,this._featureMap,t,s,r,i)||this.needsUpload}}catch(l){o.e(l)}finally{o.f()}}},{key:"get",value:function(e){return this.programConfigurations[e]}},{key:"upload",value:function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}},{key:"destroy",value:function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()}}]),e}(),hs={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function ds(e,t){return hs[e]||[e.replace("".concat(t,"-"),"").replace(/-/g,"_")]}var ps={"line-pattern":{source:oo,composite:oo},"fill-pattern":{source:oo,composite:oo},"fill-extrusion-pattern":{source:oo,composite:oo},"line-dasharray":{source:so,composite:so}},ms={color:{source:To,composite:ao},number:{source:bo,composite:To}};function vs(e,t,n){var r=ps[e];return r&&r[n]||ms[t][n]}ca(as,"ConstantBinder"),ca(os,"PatternConstantBinder"),ca(ss,"SourceExpressionBinder"),ca(cs,"PatternCompositeBinder"),ca(ls,"CompositeExpressionBinder"),ca(us,"ProgramConfiguration",{omit:["_buffers"]}),ca(fs,"ProgramConfigurationSet");var ys="-transition",gs=function(e){m(n,e);var t=v(n);function n(e,r){var i;if(d(this,n),(i=t.call(this)).id=e.id,i.type=e.type,i._featureFilter={filter:function(){return!0},needGeometry:!1,needFeature:!1},i._filterCompiled=!1,"custom"!==e.type&&(i.metadata=e.metadata,i.minzoom=e.minzoom,i.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&(i.source=e.source,i.sourceLayer=e["source-layer"],i.filter=e.filter),r.layout&&(i._unevaluatedLayout=new Ua(r.layout)),r.paint)){for(var a in i._transitionablePaint=new Fa(r.paint),e.paint)i.setPaintProperty(a,e.paint[a],{validate:!1});for(var o in e.layout)i.setLayoutProperty(o,e.layout[o],{validate:!1});i._transitioningPaint=i._transitionablePaint.untransitioned(),i.paint=new Za(r.paint)}return l(i)}return p(n,[{key:"getLayoutProperty",value:function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}},{key:"setLayoutProperty",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};null!=t&&this._validate(ta,"layers.".concat(this.id,".layout.").concat(e),e,t,n)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}},{key:"getPaintProperty",value:function(e){return Q(e,ys)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}},{key:"setPaintProperty",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=t&&this._validate(ea,"layers.".concat(this.id,".paint.").concat(e),e,t,n))return!1;if(Q(e,ys))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;var r=this._transitionablePaint._values[e],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var o=this._transitionablePaint._values[e].value,s=o.isDataDriven(),l=Q(e,"pattern")||"line-dasharray"===e;return s||i||l||this._handleOverridablePaintPropertyUpdate(e,a,o)}},{key:"_handleSpecialPaintPropertyUpdate",value:function(e){}},{key:"getProgramIds",value:function(){return null}},{key:"getProgramConfiguration",value:function(e){return null}},{key:"_handleOverridablePaintPropertyUpdate",value:function(e,t,n){return!1}},{key:"isHidden",value:function(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility}},{key:"updateTransitions",value:function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}},{key:"hasTransition",value:function(){return this._transitioningPaint.hasTransition()}},{key:"recalculate",value:function(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}},{key:"serialize",value:function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),te(e,(function(e,t){return!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)}))}},{key:"_validate",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!i||!1!==i.validate)&&ra(this,e.call(Qi,{key:t,layerType:this.type,objectKey:n,value:r,styleSpec:pt,style:{glyphs:!0,sprite:!0}}))}},{key:"is3D",value:function(){return!1}},{key:"isSky",value:function(){return!1}},{key:"isTileClipped",value:function(){return!1}},{key:"hasOffscreenPass",value:function(){return!1}},{key:"resize",value:function(){}},{key:"isStateDependent",value:function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof Ha&&Kr(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}},{key:"compileFilter",value:function(){this._filterCompiled||(this._featureFilter=Mi(this.filter),this._filterCompiled=!0)}},{key:"invalidateCompiledFilter",value:function(){this._filterCompiled=!1}},{key:"dynamicFilter",value:function(){return this._featureFilter.dynamicFilter}},{key:"dynamicFilterNeedsFeature",value:function(){return this._featureFilter.needFeature}}]),n}(dt),_s=Qa([{name:"a_pos",components:2,type:"Int16"}],4),xs=Qa([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),bs=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];d(this,e),this.segments=t}return p(e,[{key:"prepareSegment",value:function(t,n,r,i){var a=this.segments[this.segments.length-1];return t>e.MAX_VERTEX_ARRAY_LENGTH&&ie("Max vertices per segment is ".concat(e.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(t)),(!a||a.vertexLength+t>e.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==i)&&(a={vertexOffset:n.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(a.sortKey=i),this.segments.push(a)),a}},{key:"get",value:function(){return this.segments}},{key:"destroy",value:function(){var e,t=h(this.segments);try{for(t.s();!(e=t.n()).done;){var n=e.value;for(var r in n.vaos)n.vaos[r].destroy()}}catch(i){t.e(i)}finally{t.f()}}}],[{key:"simpleSegment",value:function(t,n,r,i){return new e([{vertexOffset:t,primitiveOffset:n,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])}}]),e}();bs.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ca(bs,"SegmentVector");var ws=8192,ks=function(){function e(t,n){d(this,e),t&&(n?this.setSouthWest(t).setNorthEast(n):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))}return p(e,[{key:"setNorthEast",value:function(e){return this._ne=e instanceof nc?new nc(e.lng,e.lat):nc.convert(e),this}},{key:"setSouthWest",value:function(e){return this._sw=e instanceof nc?new nc(e.lng,e.lat):nc.convert(e),this}},{key:"extend",value:function(t){var n,r,i=this._sw,a=this._ne;if(t instanceof nc)n=t,r=t;else{if(!(t instanceof e))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(e.convert(t)):this.extend(nc.convert(t)):"object"==typeof t&&null!==t&&t.hasOwnProperty("lat")&&(t.hasOwnProperty("lon")||t.hasOwnProperty("lng"))?this.extend(nc.convert(t)):this;if(n=t._sw,r=t._ne,!n||!r)return this}return i||a?(i.lng=Math.min(n.lng,i.lng),i.lat=Math.min(n.lat,i.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new nc(n.lng,n.lat),this._ne=new nc(r.lng,r.lat)),this}},{key:"getCenter",value:function(){return new nc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}},{key:"getSouthWest",value:function(){return this._sw}},{key:"getNorthEast",value:function(){return this._ne}},{key:"getNorthWest",value:function(){return new nc(this.getWest(),this.getNorth())}},{key:"getSouthEast",value:function(){return new nc(this.getEast(),this.getSouth())}},{key:"getWest",value:function(){return this._sw.lng}},{key:"getSouth",value:function(){return this._sw.lat}},{key:"getEast",value:function(){return this._ne.lng}},{key:"getNorth",value:function(){return this._ne.lat}},{key:"toArray",value:function(){return[this._sw.toArray(),this._ne.toArray()]}},{key:"toString",value:function(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}},{key:"isEmpty",value:function(){return!(this._sw&&this._ne)}},{key:"contains",value:function(e){var t=nc.convert(e),n=t.lng,r=t.lat,i=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&i}}],[{key:"convert",value:function(t){return!t||t instanceof e?t:new e(t)}}]),e}(),zs=1e-6,Ms="undefined"!=typeof Float32Array?Float32Array:Array;function Ts(){var e=new Ms(9);return Ms!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Ss(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],h=n[0],d=n[1],p=n[2],m=n[3],v=n[4],y=n[5],g=n[6],_=n[7],x=n[8];return e[0]=h*r+d*o+p*c,e[1]=h*i+d*s+p*u,e[2]=h*a+d*l+p*f,e[3]=m*r+v*o+y*c,e[4]=m*i+v*s+y*u,e[5]=m*a+v*l+y*f,e[6]=g*r+_*o+x*c,e[7]=g*i+_*s+x*u,e[8]=g*a+_*l+x*f,e}function Es(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Cs(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],m=t[13],v=t[14],y=t[15],g=n*s-r*o,_=n*l-i*o,x=n*c-a*o,b=r*l-i*s,w=r*c-a*s,k=i*c-a*l,z=u*m-f*p,M=u*v-h*p,T=u*y-d*p,S=f*v-h*m,E=f*y-d*m,C=h*y-d*v,A=g*C-_*E+x*S+b*T-w*M+k*z;return A?(e[0]=(s*C-l*E+c*S)*(A=1/A),e[1]=(i*E-r*C-a*S)*A,e[2]=(m*k-v*w+y*b)*A,e[3]=(h*w-f*k-d*b)*A,e[4]=(l*T-o*C-c*M)*A,e[5]=(n*C-i*T+a*M)*A,e[6]=(v*x-p*k-y*_)*A,e[7]=(u*k-h*x+d*_)*A,e[8]=(o*E-s*T+c*z)*A,e[9]=(r*T-n*E-a*z)*A,e[10]=(p*w-m*x+y*g)*A,e[11]=(f*x-u*w-d*g)*A,e[12]=(s*M-o*S-l*z)*A,e[13]=(n*S-r*M+i*z)*A,e[14]=(m*_-p*b-v*g)*A,e[15]=(u*b-f*_+h*g)*A,e):null}function As(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],h=t[9],d=t[10],p=t[11],m=t[12],v=t[13],y=t[14],g=t[15],_=n[0],x=n[1],b=n[2],w=n[3];return e[0]=_*r+x*s+b*f+w*m,e[1]=_*i+x*l+b*h+w*v,e[2]=_*a+x*c+b*d+w*y,e[3]=_*o+x*u+b*p+w*g,e[4]=(_=n[4])*r+(x=n[5])*s+(b=n[6])*f+(w=n[7])*m,e[5]=_*i+x*l+b*h+w*v,e[6]=_*a+x*c+b*d+w*y,e[7]=_*o+x*u+b*p+w*g,e[8]=(_=n[8])*r+(x=n[9])*s+(b=n[10])*f+(w=n[11])*m,e[9]=_*i+x*l+b*h+w*v,e[10]=_*a+x*c+b*d+w*y,e[11]=_*o+x*u+b*p+w*g,e[12]=(_=n[12])*r+(x=n[13])*s+(b=n[14])*f+(w=n[15])*m,e[13]=_*i+x*l+b*h+w*v,e[14]=_*a+x*c+b*d+w*y,e[15]=_*o+x*u+b*p+w*g,e}function Is(e,t,n){var r,i,a,o,s,l,c,u,f,h,d,p,m=n[0],v=n[1],y=n[2];return t===e?(e[12]=t[0]*m+t[4]*v+t[8]*y+t[12],e[13]=t[1]*m+t[5]*v+t[9]*y+t[13],e[14]=t[2]*m+t[6]*v+t[10]*y+t[14],e[15]=t[3]*m+t[7]*v+t[11]*y+t[15]):(i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],h=t[9],d=t[10],p=t[11],e[0]=r=t[0],e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=f,e[9]=h,e[10]=d,e[11]=p,e[12]=r*m+s*v+f*y+t[12],e[13]=i*m+l*v+h*y+t[13],e[14]=a*m+c*v+d*y+t[14],e[15]=o*m+u*v+p*y+t[15]),e}function Ps(e,t,n){var r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Ls(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*r,e[5]=o*i+u*r,e[6]=s*i+f*r,e[7]=l*i+h*r,e[8]=c*i-a*r,e[9]=u*i-o*r,e[10]=f*i-s*r,e[11]=h*i-l*r,e}function Ds(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],l=t[3],c=t[8],u=t[9],f=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*r,e[1]=o*i-u*r,e[2]=s*i-f*r,e[3]=l*i-h*r,e[8]=a*r+c*i,e[9]=o*r+u*i,e[10]=s*r+f*i,e[11]=l*r+h*i,e}function Rs(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Os(e,t,n){var r,i,a,o=n[0],s=n[1],l=n[2],c=Math.hypot(o,s,l);return c0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function Ks(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function $s(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],l=n[2];return e[0]=i*l-a*s,e[1]=a*o-r*l,e[2]=r*s-i*o,e}function Js(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return e[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/(o=o||1),e[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,e[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,e}function Qs(e,t,n){var r=n[0],i=n[1],a=n[2],o=t[0],s=t[1],l=t[2],c=i*l-a*s,u=a*o-r*l,f=r*s-i*o,h=i*f-a*u,d=a*c-r*f,p=r*u-i*c,m=2*n[3];return u*=m,f*=m,d*=2,p*=2,e[0]=o+(c*=m)+(h*=2),e[1]=s+u+d,e[2]=l+f+p,e}var el,tl=Hs,nl=Zs,rl=Vs;function il(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function al(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=r*o,e[2]=i*o,e[3]=a*o,e}function ol(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}function sl(){var e=new Ms(4);return Ms!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ll(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function cl(e,t,n){n*=.5;var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*s,e[1]=i*l+a*s,e[2]=a*l-i*s,e[3]=o*l-r*s,e}function ul(e,t,n){n*=.5;var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l-a*s,e[1]=i*l+o*s,e[2]=a*l+r*s,e[3]=o*l-i*s,e}Ns(),el=new Ms(4),Ms!=Float32Array&&(el[0]=0,el[1]=0,el[2]=0,el[3]=0);var fl=al;Ns(),js(1,0,0),js(0,1,0),sl(),sl(),Ts();var hl=Qa([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]).members,dl=Qa([{name:"a_pos_3",components:3,type:"Int16"}]),pl=Qa([{name:"a_pos",type:"Int16",components:2}]),ml=function(){function e(t,n){d(this,e),this.pos=t,this.dir=n}return p(e,[{key:"intersectsPlane",value:function(e,t,n){var r=Ks(t,this.dir);if(Math.abs(r)<1e-6)return!1;var i=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1]+(e[2]-this.pos[2])*t[2])/r;return n[0]=this.pos[0]+this.dir[0]*i,n[1]=this.pos[1]+this.dir[1]*i,n[2]=this.pos[2]+this.dir[2]*i,!0}},{key:"closestPointOnSphere",value:function(e,t,n){if(function(e,t){var n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return Math.abs(n-a)<=zs*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=zs*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=zs*Math.max(1,Math.abs(i),Math.abs(s))}(this.pos,e)||0===t)return n[0]=n[1]=n[2]=0,!1;var r=f(this.dir,3),i=r[0],a=r[1],o=r[2],s=this.pos[0]-e[0],l=this.pos[1]-e[1],c=this.pos[2]-e[2],u=i*i+a*a+o*o,h=2*(s*i+l*a+c*o),d=h*h-4*u*(s*s+l*l+c*c-t*t);if(d<0){var p=Math.max(-h/2,0),m=s+i*p,v=l+a*p,y=c+o*p,g=Math.hypot(m,v,y);return n[0]=m*t/g,n[1]=v*t/g,n[2]=y*t/g,!1}var _=(-h-Math.sqrt(d))/(2*u);if(_<0){var x=Math.hypot(s,l,c);return n[0]=s*t/x,n[1]=l*t/x,n[2]=c*t/x,!1}return n[0]=s+i*_,n[1]=l+a*_,n[2]=c+o*_,!0}}]),e}(),vl=function(){function e(t,n,r,i,a){d(this,e),this.TL=t,this.TR=n,this.BR=r,this.BL=i,this.horizon=a}return p(e,null,[{key:"fromInvProjectionMatrix",value:function(t,n,r){var i=[-1,1,1],a=[1,1,1],o=[1,-1,1],s=[-1,-1,1];return new e(Js(i,i,t),Js(a,a,t),Js(o,o,t),Js(s,s,t),n/r)}}]),e}(),yl=function(){function e(t,n){d(this,e),this.points=t,this.planes=n}return p(e,null,[{key:"fromInvProjectionMatrix",value:function(t,n,r,i){var a=Math.pow(2,r),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(e){var r=ol([],e,t),o=1/r[3]/n*a;return function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}(r,r,[o,o,i?1/r[3]:o,o])})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var t=Ys([],$s([],tl([],o[e[0]],o[e[1]]),tl([],o[e[2]],o[e[1]]))),n=-Ks(t,o[e[1]]);return t.concat(n)}));return new e(o,s)}}]),e}(),gl=function(){function e(t,n){d(this,e),this.min=t,this.max=n,this.center=Ws([],Us([],this.min,this.max),.5)}return p(e,[{key:"quadrant",value:function(t){for(var n=[t%2==0,t<2],r=Fs(this.min),i=Fs(this.max),a=0;a=0;if(0===a)return 0;a!==t.length&&(n=!1)}if(n)return 2;for(var s=0;s<3;s++){for(var l=Number.MAX_VALUE,c=-Number.MAX_VALUE,u=0;uthis.max[s]-this.min[s])return 0}return 1}}],[{key:"fromPoints",value:function(t){var n,r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0],a=h(t);try{for(a.s();!(n=a.n()).done;){var o=n.value;Gs(r,r,o),qs(i,i,o)}}catch(s){a.e(s)}finally{a.f()}return new e(r,i)}},{key:"applyTransform",value:function(t,n){for(var r=t.getCorners(),i=0;i3&&void 0!==arguments[3])||arguments[3],i=Ws([],e._camera.position,e.worldSize),a=[t,n,1,1];ol(a,a,e.pixelMatrixInverse),il(a,a,1/a[3]);var o=Ys([],tl([],a,i)),s=e.globeMatrix,l=[s[12],s[13],s[14]],c=tl([],l,i),u=Vs(c),f=Ys([],c),h=e.worldSize/(2*Math.PI),d=Ks(f,o),p=Math.asin(h/u);if(p1?null:function(e,t,n,r){var i=Math.sin(n);return e*(Math.sin((1-r)*n)/i)+t*(Math.sin(r*n)/i)}(e.a[t],e.b[t],e.angle,j(n,0,1))+e.center[t];var n}function Pl(e){if(e.z<=1)return Sl[e.z+2*e.y+e.x];var t=Nl(Bl(e));return gl.fromPoints(t)}function Ll(e,t,n){return Ws(e,e,1-n),Xs(e,e,t,n)}function Dl(e,t){var n=Wl(t.zoom);if(0===n)return Pl(e);var r=Bl(e),i=Nl(r),a=ic(r.getWest())*t.worldSize,o=ic(r.getEast())*t.worldSize,s=ac(r.getNorth())*t.worldSize,l=ac(r.getSouth())*t.worldSize,c=[a,s,0],u=[o,s,0],f=[a,l,0],h=[o,l,0],d=Cs([],t.globeMatrix);return Js(c,c,d),Js(u,u,d),Js(f,f,d),Js(h,h,d),i[0]=Ll(i[0],f,n),i[1]=Ll(i[1],h,n),i[2]=Ll(i[2],u,n),i[3]=Ll(i[3],c,n),gl.fromPoints(i)}function Rl(e,t,n){var r,i=h(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;Js(a,a,t),Ws(a,a,n)}}catch(o){i.e(o)}finally{i.f()}}function Ol(e,t,n){var r=t/e.worldSize,i=e.globeMatrix;if(n.z<=1){var a=Pl(n).getCorners();return Rl(a,i,r),gl.fromPoints(a)}var o=Bl(n),s=Nl(o);Rl(s,i,r);var l=Number.MAX_VALUE,c=[-l,-l,-l],u=[l,l,l];if(o.contains(e.center)){var f,d=h(s);try{for(d.s();!(f=d.n()).done;){var p=f.value;Gs(u,u,p),qs(c,c,p)}}catch(N){d.e(N)}finally{d.f()}c[2]=0;var m=e.point,v=[m.x*r,m.y*r,0];return Gs(u,u,v),qs(c,c,v),new gl(u,c)}var y=[i[12]*r,i[13]*r,i[14]*r],g=o.getCenter(),_=j(e.center.lat,-uc,uc),x=j(g.lat,-uc,uc),b=ic(e.center.lng),w=ac(_),k=b-ic(g.lng),z=w-ac(x);k>.5?k-=1:k<-.5&&(k+=1);var M=0;Math.abs(k)>Math.abs(z)?M=k>=0?1:3:(M=z>=0?0:2,Xs(y,y,[i[4]*r,i[5]*r,i[6]*r],-Math.sin(R(z>=0?o.getSouth():o.getNorth()))*bl));var T=s[M],S=s[(M+1)%4],E=new Al(T,S,y),C=[Il(E,0)||T[0],Il(E,1)||T[1],Il(E,2)||T[2]],A=Wl(e.zoom);if(A>0){for(var I=function(e,t,n,r,i){var a=e.x,o=e.y,s=1/(1<.5?h=-1:d<-.5&&(h=1),u=(u*t-(i*=t))*n+i,[[l=((l+h)*t-(r*=t))*n+r,f=(f*t-i)*n+i,0],[c=((c+h)*t-r)*n+r,f,0],[c,u,0],[l,u,0]]}(n,t,e._pixelsPerMercatorPixel,b,w),P=0;P3&&void 0!==arguments[3]?arguments[3]:bl;return n=R(n),[e*Math.sin(n)*r,-t*r,e*Math.cos(n)*r]}function Vl(e,t,n){return Fl(Math.cos(R(e)),Math.sin(R(e)),t,n)}function jl(e,t,n,r){var i=1<Math.PI/2*1.01}var Kl=R(85),$l=Math.cos(Kl),Jl=Math.sin(Kl),Ql=6371008.8,ec=2*Math.PI*Ql,tc=function(){function e(t,n){if(d(this,e),isNaN(t)||isNaN(n))throw new Error("Invalid LngLat object: (".concat(t,", ").concat(n,")"));if(this.lng=+t,this.lat=+n,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}return p(e,[{key:"wrap",value:function(){return new e(H(this.lng,-180,180),this.lat)}},{key:"toArray",value:function(){return[this.lng,this.lat]}},{key:"toString",value:function(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}},{key:"distanceTo",value:function(e){var t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return Ql*Math.acos(Math.min(i,1))}},{key:"toBounds",value:function(){var t=360*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)/40075017,n=t/Math.cos(Math.PI/180*this.lat);return new ks(new e(this.lng-n,this.lat-t),new e(this.lng+n,this.lat+t))}},{key:"toEcef",value:function(e){var t=El(e);return Vl(this.lat,this.lng,bl+t)}}],[{key:"convert",value:function(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new e(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 [, ]")}}]),e}(),nc=tc;function rc(e){return ec*Math.cos(e*Math.PI/180)}function ic(e){return(180+e)/360}function ac(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function oc(e,t){return e/rc(t)}function sc(e){return 360*e-180}function lc(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function cc(e,t){return e*rc(lc(t))}var uc=85.051129;function fc(e){return 1/Math.cos(e*Math.PI/180)}var hc=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;d(this,e),this.x=+t,this.y=+n,this.z=+r}return p(e,[{key:"toLngLat",value:function(){return new nc(sc(this.x),lc(this.y))}},{key:"toAltitude",value:function(){return cc(this.z,this.y)}},{key:"meterInMercatorCoordinateUnits",value:function(){return 1/ec*fc(lc(this.y))}}],[{key:"fromLngLat",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=nc.convert(t);return new e(ic(r.lng),ac(r.lat),oc(n,r.lat))}}]),e}();function dc(e,t,n,r,i,a,o,s,l){var c=(t+r)/2,u=(n+i)/2,f=new P(c,u);s(f),function(e,t,n,r,i,a){var o=n-i,s=r-a;return Math.abs((r-t)*o-(n-e)*s)/Math.hypot(o,s)}(f.x,f.y,a.x,a.y,o.x,o.y)>=l?(dc(e,t,n,c,u,a,f,s,l),dc(e,c,u,r,i,f,o,s,l)):e.push(o)}function pc(e,t,n){var r=e[0],i=r.x,a=r.y;t(r);for(var o=[r],s=1;se.x+1||re.y+1)&&ie("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function xc(e,t,n){var r=e.loadGeometry(),i=e.extent,a=ws/i;if(t&&n&&n.projection.isReprojectedInTileSpace)for(var o=1<=i||y.y<0||y.y>=i||(f(y),m.push(y))}}catch(k){v.e(k)}finally{v.f()}r[d]=m}var g,_=h(r);try{for(_.s();!(g=_.n()).done;){var x,b=g.value,w=h(b);try{for(w.s();!(x=w.n()).done;)_c(x.value,a)}catch(k){w.e(k)}finally{w.f()}}}catch(k){_.e(k)}finally{_.f()}return r}function bc(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?xc(e):[]}}function wc(e,t,n,r,i){e.emplaceBack(2*t+(r+1)/2,2*n+(i+1)/2)}function kc(e,t,n){var r=16384;e.emplaceBack(t.x,t.y,t.z,n[0]*r,n[1]*r,n[2]*r)}var zc=function(){function e(t){d(this,e),this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=t.index,this.hasPattern=!1,this.projection=t.projection,this.layoutVertexArray=new to,this.indexArray=new go,this.segments=new bs,this.programConfigurations=new fs(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))}return p(e,[{key:"populate",value:function(e,t,n,r){var i=this.layers[0],a=[],o=null;"circle"===i.type&&(o=i.layout.get("circle-sort-key"));var s,l=h(e);try{for(l.s();!(s=l.n()).done;){var c=s.value,u=c.feature,f=c.id,d=c.index,p=c.sourceLayerIndex,m=this.layers[0]._featureFilter.needGeometry,v=bc(u,m);if(this.layers[0]._featureFilter.filter(new Oa(this.zoom),v,n)){var y=o?o.evaluate(v,{},n):void 0,g={id:f,properties:u.properties,type:u.type,sourceLayerIndex:p,index:d,geometry:m?v.geometry:xc(u,n,r),patterns:{},sortKey:y};a.push(g)}}}catch(S){l.e(S)}finally{l.f()}o&&a.sort((function(e,t){return e.sortKey-t.sortKey}));var _=null;"globe"===r.projection.name&&(this.globeExtVertexArray=new lo,_=r.projection);for(var x=0,b=a;x=ws||p<0||p>=ws)){if(a){var m=a.projectTilePoint(d,p,i),v=a.upVector(i,d,p),y=this.globeExtVertexArray;kc(y,m,v),kc(y,m,v),kc(y,m,v),kc(y,m,v)}var g=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),_=g.vertexLength;wc(this.layoutVertexArray,d,p,-1,-1),wc(this.layoutVertexArray,d,p,1,-1),wc(this.layoutVertexArray,d,p,1,1),wc(this.layoutVertexArray,d,p,-1,1),this.indexArray.emplaceBack(_,_+1,_+2),this.indexArray.emplaceBack(_,_+2,_+3),g.vertexLength+=4,g.primitiveLength+=2}}}catch(x){u.e(x)}finally{u.f()}}}catch(x){s.e(x)}finally{s.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},r,i)}}]),e}();function Mc(e,t){for(var n=0;n1){if(Cc(e,t))return!0;for(var r=0;r1?n:n.sub(t)._mult(i)._add(t))}function Lc(e,t){for(var n,r,i,a=!1,o=0;ot.y!=i.y>t.y&&t.x<(i.x-r.x)*(t.y-r.y)/(i.y-r.y)+r.x&&(a=!a);return a}function Dc(e,t){for(var n=!1,r=0,i=e.length-1;rt.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(n=!n)}return n}function Rc(e,t,n,r,i){var a,o=h(e);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(t<=s.x&&n<=s.y&&r>=s.x&&i>=s.y)return!0}}catch(d){o.e(d)}finally{o.f()}var l=[new P(t,n),new P(t,i),new P(r,i),new P(r,n)];if(e.length>2){var c,u=h(l);try{for(u.s();!(c=u.n()).done;)if(Dc(e,c.value))return!0}catch(d){u.e(d)}finally{u.f()}}for(var f=0;fi.x&&t.x>i.x||e.yi.y&&t.y>i.y)return!1;var a=ae(e,t,n[0]);return a!==ae(e,t,n[1])||a!==ae(e,t,n[2])||a!==ae(e,t,n[3])}function Bc(e,t,n){var r=t.paint.get(e).value;return"constant"===r.kind?r.value:n.programConfigurations.get(t.id).getMaxValue(e)}function Nc(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Fc(e,t,n,r,i){if(!t[0]&&!t[1])return e;var a=P.convert(t)._mult(i);"viewport"===n&&a._rotate(-r);for(var o=[],s=0;s0){var m=n.projection.upVector(u,c.x,c.y);d.x+=m[0]*f*h,d.y+=m[1]*f*h,d.z+=m[2]*f*h}var v=a?c:Zc(d.x,d.y,d.z,r),y=a?e.tilespaceRays.map((function(e){return Wc(e,h)})):e.queryGeometry.screenGeometry,g=ol([],[d.x,d.y,d.z,1],r);if(!o&&a?l*=g[3]/n.cameraToCenterDistance:o&&!a&&(l*=n.cameraToCenterDistance/g[3]),a){var _=lc((t.y/ws+u.y)/(1<e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=e.data,s=t.data,l=0;l80*n){r=a=e[0],i=o=e[1];for(var p=n;pa&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-r,o-i))?32767/c:0}return lu(h,d,n,r,i,c,0),d}function ou(e,t,n,r,i){var a,o;if(i===Au(e,t,n,r)>0)for(a=t;a=t;a-=r)o=Su(a,e[a],e[a+1],o);return o&&bu(o,o.next)&&(Eu(o),o=o.next),o}function su(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!bu(r,r.next)&&0!==xu(r.prev,r,r.next))r=r.next;else{if(Eu(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function lu(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){var i=e;do{0===i.z&&(i.z=vu(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,o,s,l,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1)}(i)}(e,r,i,a);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?uu(e,r,i,a):cu(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),Eu(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?lu(e=fu(su(e),t,n),t,n,r,i,a,2):2===o&&hu(e,t,n,r,i,a):lu(su(e),t,n,r,i,a,1);break}}}function cu(e){var t=e.prev,n=e,r=e.next;if(xu(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,l=n.y,c=r.y,u=ia?i>o?i:o:a>o?a:o,d=s>l?s>c?s:c:l>c?l:c,p=r.next;p!==t;){if(p.x>=u&&p.x<=h&&p.y>=f&&p.y<=d&&gu(i,s,a,l,o,c,p.x,p.y)&&xu(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function uu(e,t,n,r){var i=e.prev,a=e,o=e.next;if(xu(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,c=o.x,u=i.y,f=a.y,h=o.y,d=sl?s>c?s:c:l>c?l:c,v=u>f?u>h?u:h:f>h?f:h,y=vu(d,p,t,n,r),g=vu(m,v,t,n,r),_=e.prevZ,x=e.nextZ;_&&_.z>=y&&x&&x.z<=g;){if(_.x>=d&&_.x<=m&&_.y>=p&&_.y<=v&&_!==i&&_!==o&&gu(s,u,l,f,c,h,_.x,_.y)&&xu(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,x.x>=d&&x.x<=m&&x.y>=p&&x.y<=v&&x!==i&&x!==o&&gu(s,u,l,f,c,h,x.x,x.y)&&xu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;_&&_.z>=y;){if(_.x>=d&&_.x<=m&&_.y>=p&&_.y<=v&&_!==i&&_!==o&&gu(s,u,l,f,c,h,_.x,_.y)&&xu(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=g;){if(x.x>=d&&x.x<=m&&x.y>=p&&x.y<=v&&x!==i&&x!==o&&gu(s,u,l,f,c,h,x.x,x.y)&&xu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function fu(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!bu(i,a)&&wu(i,r,r.next,a)&&Mu(i,a)&&Mu(a,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(a.i/n|0),Eu(r),Eu(r.next),r=e=a),r=r.next}while(r!==e);return su(r)}function hu(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&_u(o,s)){var l=Tu(o,s);return o=su(o,o.next),l=su(l,l.next),lu(o,t,n,r,i,a,0),void lu(l,t,n,r,i,a,0)}s=s.next}o=o.next}while(o!==e)}function du(e,t){return e.x-t.x}function pu(e,t){var n=function(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o&&(o=s,n=r.x=r.x&&r.x>=u&&i!==r.x&&gu(an.x||r.x===n.x&&mu(n,r)))&&(n=r,h=l)),r=r.next}while(r!==c);return n}(e,t);if(!n)return t;var r=Tu(n,e);return su(r,r.next),su(n,n.next)}function mu(e,t){return xu(e.prev,e,t.prev)<0&&xu(t.next,e,e.next)<0}function vu(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function yu(e){var t=e,n=e;do{(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function _u(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&wu(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Mu(e,t)&&Mu(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(xu(e.prev,e,t.prev)||xu(e,t.prev,t))||bu(e,t)&&xu(e.prev,e,e.next)>0&&xu(t.prev,t,t.next)>0)}function xu(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function bu(e,t){return e.x===t.x&&e.y===t.y}function wu(e,t,n,r){var i=zu(xu(e,t,n)),a=zu(xu(e,t,r)),o=zu(xu(n,r,e)),s=zu(xu(n,r,t));return i!==a&&o!==s||!(0!==i||!ku(e,n,t))||!(0!==a||!ku(e,r,t))||!(0!==o||!ku(n,e,r))||!(0!==s||!ku(n,t,r))}function ku(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function zu(e){return e>0?1:e<0?-1:0}function Mu(e,t){return xu(e.prev,e,e.next)<0?xu(e,t,e.next)>=0&&xu(e,e.prev,t)>=0:xu(e,t,e.prev)<0||xu(e,e.next,t)<0}function Tu(e,t){var n=new Cu(e.i,e.x,e.y),r=new Cu(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Su(e,t,n,r){var i=new Cu(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Eu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Cu(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Au(e,t,n,r){for(var i=0,a=t,o=n-r;a0&&n.holes.push(r+=e[i-1].length)}return n};var Iu=T(iu.exports);function Pu(e,t,n,r,i){Lu(e,t,n||0,r||e.length-1,i||Ru)}function Lu(e,t,n,r,i){for(;r>n;){if(r-n>600){var a=r-n+1,o=t-n+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Lu(e,t,Math.max(n,Math.floor(t-o*l/a+c)),Math.min(r,Math.floor(t+(a-o)*l/a+c)),i)}var u=e[t],f=n,h=r;for(Du(e,n,t),i(e[r],u)>0&&Du(e,n,r);f0;)h--}0===i(e[n],u)?Du(e,n,h):Du(e,++h,r),h<=t&&(n=h+1),t<=h&&(r=h-1)}}function Du(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Ru(e,t){return et?1:0}function Ou(e,t){var n=e.length;if(n<=1)return[e];for(var r,i,a=[],o=0;o1)for(var l=0;l5&&void 0!==arguments[5]?arguments[5]:[],s=h(Ou(t,500));try{for(s.s();!(a=s.n()).done;){var l,c=a.value,u=0,f=h(c);try{for(f.s();!(l=f.n()).done;)u+=l.value.length}catch(M){f.e(M)}finally{f.f()}var d,p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),m=p.vertexLength,v=[],y=[],g=h(c);try{for(g.s();!(d=g.n()).done;){var _=d.value;if(0!==_.length){_!==c[0]&&y.push(v.length/2);var x=this.segments2.prepareSegment(_.length,this.layoutVertexArray,this.indexArray2),b=x.vertexLength;this.layoutVertexArray.emplaceBack(_[0].x,_[0].y),this.indexArray2.emplaceBack(b+_.length-1,b),v.push(_[0].x),v.push(_[0].y);for(var w=1;w<_.length;w++)this.layoutVertexArray.emplaceBack(_[w].x,_[w].y),this.indexArray2.emplaceBack(b+w-1,b+w),v.push(_[w].x),v.push(_[w].y);x.vertexLength+=_.length,x.primitiveLength+=_.length}}}catch(M){g.e(M)}finally{g.f()}for(var k=Iu(v,y),z=0;z>3}if(i--,1===r||2===r)a+=e.readSVarint(),o+=e.readSVarint(),1===r&&(t&&s.push(t),t=[]),t.push(new Xu(a,o));else{if(7!==r)throw new Error("unknown command "+r);t&&t.push(t[0].clone())}}return t&&s.push(t),s},Ku.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,r=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;e.pos>3}if(r--,1===n||2===n)(i+=e.readSVarint())s&&(s=i),(a+=e.readSVarint())c&&(c=a);else if(7!==n)throw new Error("unknown command "+n)}return[o,l,s,c]},Ku.prototype.toGeoJSON=function(e,t,n){var r,i,a=this.extent*Math.pow(2,n),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Ku.types[this.type];function u(e){for(var t=0;t>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(n))}tf.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Qu(this._pbf,t,this.extent,this._keys,this._values)};var rf=ef;function af(e,t,n){if(3===e){var r=new rf(n,n.readVarint()+n.pos);r.length&&(t[r.name]=r)}}var of=Wu.VectorTile=function(e,t){this.layers=e.readFields(af,{},t)},sf=Wu.VectorTileFeature=Yu;function lf(e,t,n,r){var i,a=[],o=0===r?function(e,t,n,r,i,a){e.push(new P(a,n+(a-t)/(r-t)*(i-n)))}:function(e,t,n,r,i,a){e.push(new P(t+(a-n)/(i-n)*(r-t),a))},s=h(e);try{for(s.s();!(i=s.n()).done;){var l,c=i.value,u=[],f=h(c);try{for(f.s();!(l=f.n()).done;){var d=l.value;if(!(d.length<=2)){for(var p=[],m=0;mt&&o(p,v,y,g,_,t):x>n?b=t&&o(p,v,y,g,_,t),b>n&&x<=n&&o(p,v,y,g,_,n)}var w=d[d.length-1],k=0===r?w.x:w.y;k>=t&&k<=n&&p.push(w),p.length&&(w=p[p.length-1],p[0].x===w.x&&p[0].y===w.y||p.push(p[0]),u.push(p))}}}catch(z){f.e(z)}finally{f.f()}u.length&&a.push(u)}}catch(z){s.e(z)}finally{s.f()}return a}Wu.VectorTileLayer=ef;var cf=sf.types,uf=Math.pow(2,13);function ff(e,t,n,r,i,a,o,s){e.emplaceBack((t<<1)+o,(n<<1)+a,(Math.floor(r*uf)<<1)+i,Math.round(s))}function hf(e,t,n){var r=16384;e.emplaceBack(t.x,t.y,t.z,n[0]*r,n[1]*r,n[2]*r)}var df=function(){function e(){d(this,e),this.acc=new P(0,0),this.polyCount=[]}return p(e,[{key:"startRing",value:function(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new P(e.x,e.y),this.max=new P(e.x,e.y))}},{key:"append",value:function(e,t){this.currentPolyCount.edges++,this.acc._add(e);var n=this.min,r=this.max;e.xr.x&&(r.x=e.x),e.yr.y&&(r.y=e.y),((0===e.x||e.x===ws)&&e.x===t.x)!=((0===e.y||e.y===ws)&&e.y===t.y)&&this.processBorderOverlap(e,t),t.x<0!=e.x<0&&this.addBorderIntersection(0,qn(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>ws!=e.x>ws&&this.addBorderIntersection(1,qn(t.y,e.y,(ws-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,qn(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>ws!=e.y>ws&&this.addBorderIntersection(3,qn(t.x,e.x,(ws-t.y)/(e.y-t.y)))}},{key:"addBorderIntersection",value:function(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);var n=this.borders[e];tn[1]&&(n[1]=t)}},{key:"processBorderOverlap",value:function(e,t){if(e.x===t.x){if(e.y===t.y)return;var n=0===e.x?0:1;this.addBorderIntersection(n,t.y),this.addBorderIntersection(n,e.y)}else{var r=0===e.y?2:3;this.addBorderIntersection(r,t.x),this.addBorderIntersection(r,e.x)}}},{key:"centroid",value:function(){var e=this.polyCount.reduce((function(e,t){return e+t.edges}),0);return 0!==e?this.acc.div(e)._round():new P(0,0)}},{key:"span",value:function(){return new P(this.max.x-this.min.x,this.max.y-this.min.y)}},{key:"intersectsCount",value:function(){return this.borders.reduce((function(e,t){return e+ +(t[0]!==Number.MAX_VALUE)}),0)}}]),e}(),pf=function(){function e(t){d(this,e),this.zoom=t.zoom,this.canonical=t.canonical,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=t.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=t.projection,this.layoutVertexArray=new ro,this.centroidVertexArray=new Bo,this.indexArray=new go,this.programConfigurations=new fs(t.layers,t.zoom),this.segments=new bs,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id})),this.enableTerrain=t.enableTerrain}return p(e,[{key:"populate",value:function(e,t,n,r){this.features=[],this.hasPattern=Nu("fill-extrusion",this.layers,t),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(e){var t=Math.exp(Math.PI*(1-e.y/(1<=0;v--){var y=m[v];(0===y.length||(d=y[0]).every((function(e){return e.x<=0}))||d.every((function(e){return e.x>=ws}))||d.every((function(e){return e.y<=0}))||d.every((function(e){return e.y>=ws})))&&m.splice(v,1)}if(c)p=wf(m,s,r);else{p=[];var g,_=h(m);try{for(_.s();!(g=_.n()).done;){var x=g.value;p.push({polygon:x,bounds:s})}}catch(Ae){_.e(Ae)}finally{_.f()}}var b,w=f?this.edgeRadius:0,k=h(p);try{for(k.s();!(b=k.n()).done;){var z,M=b.value,T=M.polygon,S=M.bounds,E=0,C=0,A=h(T);try{for(A.s();!(z=A.n()).done;){var I=z.value;f&&!I[0].equals(I[I.length-1])&&I.push(I[0]),C+=f?I.length-1:I.length}}catch(Ae){A.e(Ae)}finally{A.f()}var L=this.segments.prepareSegment((f?5:4)*C,this.layoutVertexArray,this.indexArray);if(f){var D=[],R=[];E=L.vertexLength;var O,B=h(T);try{for(B.s();!(O=B.n()).done;){var N=O.value,F=void 0,V=void 0;N.length&&N!==T[0]&&R.push(D.length/2),F=N[1].sub(N[0])._perp()._unit();for(var j=1;j4&&_f(J[J.length-2],J[0],J[1]),re=w?vf(J[J.length-2],J[0],J[1],w):0;ee=J[1].sub(J[0])._perp()._unit();for(var ie=!0,ae=1,oe=0;ae0?1:0,de=se.dist(le);if(oe+de>32768&&(oe=0),w){te=ce.sub(le)._perp()._unit();var pe=yf(se,le,ce,mf(ee,te),w);isNaN(pe)&&(pe=0);var me=le.sub(se)._unit();se=se.add(me.mult(re))._round(),le=le.add(me.mult(-pe))._round(),re=pe,ee=te}var ve=L.vertexLength,ye=J.length>4&&_f(se,le,ce),ge=xf(oe,ne,ie);if(ff(this.layoutVertexArray,se.x,se.y,fe,he,0,0,ge),ff(this.layoutVertexArray,se.x,se.y,fe,he,0,1,ge),ge=xf(oe+=de,ye,!ie),ne=ye,ff(this.layoutVertexArray,le.x,le.y,fe,he,0,0,ge),ff(this.layoutVertexArray,le.x,le.y,fe,he,0,1,ge),L.vertexLength+=4,this.indexArray.emplaceBack(ve+0,ve+1,ve+2),this.indexArray.emplaceBack(ve+1,ve+3,ve+2),L.primitiveLength+=2,w){var _e=E+(1===ae?J.length-2:ae-2),xe=1===ae?E:_e+1;if(this.indexArray.emplaceBack(ve+1,_e,ve+3),this.indexArray.emplaceBack(_e,xe,ve+3),L.primitiveLength+=2,void 0===Q&&(Q=ve),!gf(ce,J[ae],S)){var be=ae===J.length-1?Q:L.vertexLength;this.indexArray.emplaceBack(ve+2,ve+3,be),this.indexArray.emplaceBack(ve+3,be+1,be),this.indexArray.emplaceBack(ve+3,xe,be+1),L.primitiveLength+=3}ie=!ie}if(c){var we=this.layoutVertexExtArray,ke=l.projectTilePoint(se.x,se.y,r),ze=l.projectTilePoint(le.x,le.y,r),Me=l.upVector(r,se.x,se.y),Te=l.upVector(r,le.x,le.y);hf(we,ke,Me),hf(we,ke,Me),hf(we,ze,Te),hf(we,ze,Te)}}}f&&(E+=J.length-1)}}catch(Ae){$.e(Ae)}finally{$.f()}}}catch(Ae){k.e(Ae)}finally{k.f()}if(u&&u.polyCount.length>0){if(u.borders){u.vertexArrayOffset=this.centroidVertexArray.length;for(var Se=u.borders,Ee=this.featuresOnBorder.push(u)-1,Ce=0;Ce<4;Ce++)Se[Ce][0]!==Number.MAX_VALUE&&this.borders[Ce].push(Ee)}this.encodeCentroid(u.borders?void 0:u.centroid(),u)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,a,r)}},{key:"sortBorders",value:function(){for(var e=this,t=function(t){e.borders[t].sort((function(n,r){return e.featuresOnBorder[n].borders[t][0]-e.featuresOnBorder[r].borders[t][0]}))},n=0;n<4;n++)t(n)}},{key:"encodeCentroid",value:function(e,t){var n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e)if(0!==e.y){var a=t.span()._mult(this.tileToMeter);n=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(a.x/10)),r=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(a.y/10))}else n=Math.ceil(7*(e.x+450)),r=0;else n=0,r=+i;var o,s=i?this.centroidVertexArray.length:t.vertexArrayOffset,l=h(t.polyCount);try{for(l.s();!(o=l.n()).done;){var c=o.value;i&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*c.edges+c.top);for(var u=0;un[1].x&&t.x>n[1].x||e.yn[1].y&&t.y>n[1].y}function _f(e,t,n){if(e.x<0||e.x>=ws||t.x<0||t.x>=ws||n.x<0||n.x>=ws)return!1;var r=n.sub(t),i=r.perp(),a=e.sub(t);return(r.x*a.x+r.y*a.y)/Math.sqrt((r.x*r.x+r.y*r.y)*(a.x*a.x+a.y*a.y))>-.866&&i.x*a.x+i.y*a.y<0}function xf(e,t,n){var r=t?2|e:-3&e;return n?1|r:-2&r}function bf(){var e=Math.PI/32,t=Math.tan(e),n=Ql;return n*Math.sqrt(1+2*t*t)-n}function wf(e,t,n){var r=1<4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=[];if(!e.length||!n||!r)return o;for(var s=function(e,t){var n,r=h(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;o.push({polygon:i,bounds:t})}}catch(a){r.e(a)}finally{r.f()}},l=Math.ceil(Math.log2(n)),c=Math.ceil(Math.log2(r)),u=l-c,f=[],d=0;d0?0:1);for(var p=0;pg+1?v.push({polygons:M,bounds:S,depth:g+1}):s(M,S)}if(T.length){var E=[new P(0===_?z:x.x,1===_?z:x.y),b];f.length>g+1?v.push({polygons:T,bounds:E,depth:g+1}):s(T,E)}}return o}(e,t,Math.ceil((a-i)/11.25),Math.ceil((o-s)/11.25),1,(function(e,t,i){if(0===e)return.5*(t+i);var a=lc((n.y+t/ws)/r);return(ac(.5*(lc((n.y+i/ws)/r)+a))*r-n.y)*ws}))}ca(pf,"FillExtrusionBucket",{omit:["layers","features"]}),ca(df,"PartMetadata");var kf=new Xa({"fill-extrusion-edge-radius":new Ga(pt["layout_fill-extrusion"]["fill-extrusion-edge-radius"])}),zf={paint:new Xa({"fill-extrusion-opacity":new Ga(pt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new qa(pt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ga(pt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ga(pt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new qa(pt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new qa(pt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new qa(pt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ga(pt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Ga(pt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Ga(pt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new Ga(pt["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:kf};function Mf(e,t,n){var r=2*Math.PI*6378137/256/Math.pow(2,n);return[e*r-2*Math.PI*6378137/2,t*r-2*Math.PI*6378137/2]}var Tf=function(){function e(t,n,r){d(this,e),this.z=t,this.x=n,this.y=r,this.key=Cf(0,t,t,n,r)}return p(e,[{key:"equals",value:function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}},{key:"url",value:function(e,t){var n=function(e,t,n){var r=Mf(256*e,256*(t=Math.pow(2,n)-t-1),n),i=Mf(256*(e+1),256*(t+1),n);return r[0]+","+r[1]+","+i[0]+","+i[1]}(this.x,this.y,this.z),r=function(e,t,n){for(var r,i="",a=e;a>0;a--)i+=(t&(r=1<this.canonical.z?new e(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new e(t,this.wrap,t,this.canonical.x>>n,this.canonical.y>>n)}},{key:"calculateScaledKey",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return Cf(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);var n=this.canonical.z-e;return Cf(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)}},{key:"isChildOf",value:function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t}},{key:"children",value:function(t){if(this.overscaledZ>=t)return[new e(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var n=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return[new e(n,this.wrap,n,r,i),new e(n,this.wrap,n,r+1,i),new e(n,this.wrap,n,r,i+1),new e(n,this.wrap,n,r+1,i+1)]}},{key:"isLessThan",value:function(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y=2&&e[l-1].equals(e[l-2]);)l--;for(var c=0;c0;if(k&&y>c){var M=u.dist(f);if(M>2*m){var T=u.sub(u.sub(f)._mult(m/M)._round());this.updateDistance(f,T),this.addCurrentVertex(T,d,0,0,v),f=T}}var S=f&&h,E=S?n:s?"butt":r;if(S&&"round"===E&&(bi&&(E="bevel"),"bevel"===E&&(b>2&&(E="flipbevel"),b100)g=p.mult(-1);else{var C=b*d.add(p).mag()/d.sub(p).mag();g._perp()._mult(C*(z?-1:1))}this.addCurrentVertex(u,g,0,0,v),this.addCurrentVertex(u,g.mult(-1),0,0,v)}else if("bevel"===E||"fakeround"===E){var A=-Math.sqrt(b*b-1),I=z?A:0,P=z?0:A;if(f&&this.addCurrentVertex(u,d,I,P,v),"fakeround"===E)for(var L=Math.round(180*w/Math.PI/20),D=1;D2*m){var V=u.add(h.sub(u)._mult(m/F)._round());this.updateDistance(u,V),this.addCurrentVertex(V,p,0,0,v),u=V}}}}}},{key:"addCurrentVertex",value:function(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=t.y*r-t.x,s=-t.y-t.x*r;this.addHalfVertex(e,t.x+t.y*n,t.y-t.x*n,a,!1,n,i),this.addHalfVertex(e,o,s,a,!0,-r,i)}},{key:"addHalfVertex",value:function(e,t,n,r,i,a,o){var s=e.x,l=e.y;this.layoutVertexArray.emplaceBack((s<<1)+(r?1:0),(l<<1)+(i?1:0),Math.round(63*t)+128,Math.round(63*n)+128,1+(0===a?0:a<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);var c=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),o.primitiveLength++),i?this.e2=c:this.e1=c}},{key:"updateScaledDistance",value:function(){if(this.lineClips){var e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}},{key:"updateDistance",value:function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}]),e}();ca(Nf,"LineBucket",{omit:["layers","patternFeatures"]});var Ff=new Xa({"line-cap":new qa(pt.layout_line["line-cap"]),"line-join":new qa(pt.layout_line["line-join"]),"line-miter-limit":new Ga(pt.layout_line["line-miter-limit"]),"line-round-limit":new Ga(pt.layout_line["line-round-limit"]),"line-sort-key":new qa(pt.layout_line["line-sort-key"])}),Vf={paint:new Xa({"line-opacity":new qa(pt.paint_line["line-opacity"]),"line-color":new qa(pt.paint_line["line-color"]),"line-translate":new Ga(pt.paint_line["line-translate"]),"line-translate-anchor":new Ga(pt.paint_line["line-translate-anchor"]),"line-width":new qa(pt.paint_line["line-width"]),"line-gap-width":new qa(pt.paint_line["line-gap-width"]),"line-offset":new qa(pt.paint_line["line-offset"]),"line-blur":new qa(pt.paint_line["line-blur"]),"line-dasharray":new qa(pt.paint_line["line-dasharray"]),"line-pattern":new qa(pt.paint_line["line-pattern"]),"line-gradient":new Wa(pt.paint_line["line-gradient"]),"line-trim-offset":new Ga(pt.paint_line["line-trim-offset"])}),layout:Ff},jf=new(function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"possiblyEvaluate",value:function(e,t){return t=new Oa(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),o(s(n.prototype),"possiblyEvaluate",this).call(this,e,t)}},{key:"evaluate",value:function(e,t,r,i){return t=q({},t,{zoom:Math.floor(t.zoom)}),o(s(n.prototype),"evaluate",this).call(this,e,t,r,i)}}]),n}(qa))(Vf.paint.properties["line-width"].specification);function Uf(e,t){return t>0?t+2*e:e}jf.useIntegerZoom=!0;var Hf=Qa([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Zf=Qa([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Gf=Qa([{name:"a_projected_pos",components:4,type:"Float32"}],4);Qa([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var qf=Qa([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Wf=Qa([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);Qa([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);var Xf=Qa([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Yf=Qa([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Qa([{name:"triangle",components:3,type:"Uint16"}]),Qa([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),Qa([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Qa([{type:"Float32",name:"offsetX"}]),Qa([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Kf=24,$f=128;function Jf(e,t){var n=t.expression;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new Oa(e+1))};if("source"===n.kind)return{kind:"source"};for(var r=n.zoomStops,i=n.interpolationType,a=0;a":"\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","\u2190":"\u2191","\u2192":"\u2193"};function ih(e){return"\ufe36"===e||"\ufe48"===e||"\ufe38"===e||"\ufe44"===e||"\ufe42"===e||"\ufe3e"===e||"\ufe3c"===e||"\ufe3a"===e||"\ufe18"===e||"\ufe40"===e||"\ufe10"===e||"\ufe13"===e||"\ufe14"===e||"\uff40"===e||"\uffe3"===e||"\ufe11"===e||"\ufe12"===e}function ah(e){return"\ufe35"===e||"\ufe47"===e||"\ufe37"===e||"\ufe43"===e||"\ufe41"===e||"\ufe3d"===e||"\ufe3b"===e||"\ufe39"===e||"\ufe17"===e||"\ufe3f"===e}var oh=ch,sh=function(e,t,n,r,i){var a,o,s=8*i-r-1,l=(1<>1,u=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+e[t+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=256*o+e[t+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=c}return(d?-1:1)*o*Math.pow(2,a-r)},lh=function(e,t,n,r,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(t*l-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[n+d]=255&o,d+=p,o/=256,c-=8);e[n+d-p]|=128*m};function ch(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}ch.Varint=0,ch.Fixed64=1,ch.Bytes=2,ch.Fixed32=5;var uh=4294967296,fh=1/uh,hh="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function dh(e){return e.type===ch.Bytes?e.readVarint()+e.pos:e.pos+1}function ph(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function mh(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function vh(e,t){for(var n=0;n>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function Sh(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}ch.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos>3,a=this.pos;this.type=7&r,e(i,t,this),this.pos===a&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Mh(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Sh(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Mh(this.buf,this.pos)+Mh(this.buf,this.pos+4)*uh;return this.pos+=8,e},readSFixed64:function(){var e=Mh(this.buf,this.pos)+Sh(this.buf,this.pos+4)*uh;return this.pos+=8,e},readFloat:function(){var e=sh(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=sh(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,n,r=this.buf;return t=127&(n=r[this.pos++]),n<128?t:(t|=(127&(n=r[this.pos++]))<<7,n<128?t:(t|=(127&(n=r[this.pos++]))<<14,n<128?t:(t|=(127&(n=r[this.pos++]))<<21,n<128?t:function(e,t,n){var r,i,a=n.buf;if(r=(112&(i=a[n.pos++]))>>4,i<128)return ph(e,r,t);if(r|=(127&(i=a[n.pos++]))<<3,i<128)return ph(e,r,t);if(r|=(127&(i=a[n.pos++]))<<10,i<128)return ph(e,r,t);if(r|=(127&(i=a[n.pos++]))<<17,i<128)return ph(e,r,t);if(r|=(127&(i=a[n.pos++]))<<24,i<128)return ph(e,r,t);if(r|=(1&(i=a[n.pos++]))<<31,i<128)return ph(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(n=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&hh?function(e,t,n){return hh.decode(e.subarray(t,n))}(this.buf,t,e):function(e,t,n){for(var r="",i=t;i239?4:l>223?3:l>191?2:1;if(i+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(a=e[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(o=e[i+2],128==(192&(a=e[i+1]))&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=e[i+2],s=e[i+3],128==(192&(a=e[i+1]))&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=u}return r}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==ch.Bytes)return e.push(this.readVarint(t));var n=dh(this);for(e=e||[];this.pos127;);else if(t===ch.Bytes)this.pos=this.readVarint()+this.pos;else if(t===ch.Fixed32)this.pos+=4;else{if(t!==ch.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?function(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,n.buf[n.pos]=127&(e>>>=7)}(n,0,t),function(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var r,i,a=0;a55295&&r<57344){if(!i){r>56319||a+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):i=r;continue}if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(e[n++]=239,e[n++]=191,e[n++]=189,i=null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&mh(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),lh(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),lh(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n=128&&mh(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,n){this.writeTag(e,ch.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,vh,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,yh,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,xh,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,gh,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,_h,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,bh,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,wh,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,kh,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,zh,t)},writeBytesField:function(e,t){this.writeTag(e,ch.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,ch.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,ch.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,ch.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,ch.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,ch.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,ch.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,ch.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,ch.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,ch.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var Eh=T(oh),Ch=3;function Ah(e,t,n){t.glyphs=[],1===e&&n.readMessage(Ih,t)}function Ih(e,t,n){if(3===e){var r=n.readMessage(Ph,{}),i=r.id,a=r.bitmap,o=r.width,s=r.height,l=r.left,c=r.top,u=r.advance;t.glyphs.push({id:i,bitmap:new Jc({width:o+2*Ch,height:s+2*Ch},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}else 4===e?t.ascender=n.readSVarint():5===e&&(t.descender=n.readSVarint())}function Ph(e,t,n){1===e?t.id=n.readVarint():2===e?t.bitmap=n.readBytes():3===e?t.width=n.readVarint():4===e?t.height=n.readVarint():5===e?t.left=n.readSVarint():6===e?t.top=n.readSVarint():7===e&&(t.advance=n.readVarint())}var Lh=Ch;function Dh(e){var t,n=0,r=0,i=h(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;n+=a.w*a.h,r=Math.max(r,a.w)}}catch(v){i.e(v)}finally{i.f()}e.sort((function(e,t){return t.h-e.h}));var o,s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(n/.95)),r),h:1/0}],l=0,c=0,u=h(e);try{for(u.s();!(o=u.n()).done;)for(var f=o.value,d=s.length-1;d>=0;d--){var p=s[d];if(!(f.w>p.w||f.h>p.h)){if(f.x=p.x,f.y=p.y,c=Math.max(c,f.y+f.h),l=Math.max(l,f.x+f.w),f.w===p.w&&f.h===p.h){var m=s.pop();d=0&&r>=e&&Hh[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(e,n),this.sectionIndex=this.sectionIndex.slice(e,n)}},{key:"substring",value:function(t,n){var r=new e;return r.text=this.text.substring(t,n),r.sectionIndex=this.sectionIndex.slice(t,n),r.sections=this.sections,r}},{key:"toString",value:function(){return this.text}},{key:"getMaxScale",value:function(){var e=this;return this.sectionIndex.reduce((function(t,n){return Math.max(t,e.sections[n].scale)}),0)}},{key:"addTextSection",value:function(e,t){this.text+=e.text,this.sections.push(Vh.forText(e.scale,e.fontStack||t));for(var n=this.sections.length-1,r=0;r=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}],[{key:"fromFeature",value:function(t,n){for(var r=new e,i=0;i=0,u=0,f=0;f0&&$>R&&(R=$)}else{var J=n[F.fontStack];if(!J)continue;J[j]&&(Z=J[j]);var Q=t[F.fontStack];if(!Q)continue;var ee=Q.glyphs[j];if(!ee)continue;if(H=ee.metrics,q=8203!==j?Kf:0,g){var te=void 0!==Q.ascender?Math.abs(Q.ascender):0,ne=void 0!==Q.descender?Math.abs(Q.descender):0,re=(te+ne)*U;O-n/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var l=[],c=0;sr;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=u.dist(f)}return!0}function nd(e){for(var t=0,n=0;nc){var p=(c-l)/d,m=qn(f.x,h.x,p),v=qn(f.y,h.y,p),y=new ed(m,v,0,h.angleTo(f),u);return!o||td(e,y,s,o,t)?y:void 0}l+=d}}function od(e,t,n,r,i,a,o,s,l){var c=rd(r,a,o),u=id(r,i),f=u*o,h=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-f=0&&x=0&&b=0&&h+c<=u){var w=new ed(x,b,0,g,p);w._round(),r&&!td(e,w,a,r,i)||d.push(w)}}f+=y}return s||d.length||o||(d=sd(e,f/2,n,r,i,a,o,!0,l)),d}function ld(e,t,n,r,i){for(var a=[],o=0;o=r&&f.x>=r||(u.x>=r?u=new P(r,u.y+(r-u.x)/(f.x-u.x)*(f.y-u.y))._round():f.x>=r&&(f=new P(r,u.y+(r-u.x)/(f.x-u.x)*(f.y-u.y))._round()),u.y>=i&&f.y>=i||(u.y>=i?u=new P(u.x+(i-u.y)/(f.y-u.y)*(f.x-u.x),i)._round():f.y>=i&&(f=new P(u.x+(i-u.y)/(f.y-u.y)*(f.x-u.x),i)._round()),l&&u.equals(l[l.length-1])||(l=[u],a.push(l)),l.push(f)))))}return a}ca(ed,"Anchor");var cd=1e20;function ud(e,t,n,r,i,a,o,s,l){for(var c=t;c-1);a[++l]=s,o[l]=c,o[l+1]=cd}for(var h=0,d=0;h65535)n(new Error("glyphs > 65535 not supported"));else if(o.ranges[l])n(null,{stack:i,id:a,glyph:s});else{var u=o.requests[l];u||(u=o.requests[l]=[],e.loadGlyphRange(i,l,r.url,r.requestManager,(function(e,t){if(t){for(var n in o.ascender=t.ascender,o.descender=t.descender,t.glyphs)r._doesCharSupportLocalGlyph(+n)||(o.glyphs[+n]=t.glyphs[+n]);o.ranges[l]=!0}var i,a=h(u);try{for(a.s();!(i=a.n()).done;)(0,i.value)(e,t)}catch(c){a.e(c)}finally{a.f()}delete o.requests[l]}))),u.push((function(e,t){e?n(e):t&&n(null,{stack:i,id:a,glyph:t.glyphs[a]||null})}))}}else n(null,{stack:i,id:a,glyph:s})}),(function(e,t){if(e)n(e);else if(t){var i,a={},o=h(t);try{for(o.s();!(i=o.n()).done;){var s=i.value,l=s.stack,u=s.id,f=s.glyph;void 0===a[l]&&(a[l]={}),void 0===a[l].glyphs&&(a[l].glyphs={}),a[l].glyphs[u]=f&&{id:f.id,bitmap:f.bitmap.clone(),metrics:f.metrics},a[l].ascender=r.entries[l].ascender,a[l].descender=r.entries[l].descender}}catch(c){o.e(c)}finally{o.f()}n(null,a)}}))}},{key:"_doesCharSupportLocalGlyph",value:function(e){return this.localGlyphMode!==dd.none&&(this.localGlyphMode===dd.all?!!this.localFontFamily:!!this.localFontFamily&&(ma["CJK Unified Ideographs"](e)||ma["Hangul Syllables"](e)||ma.Hiragana(e)||ma.Katakana(e)||ma["CJK Symbols and Punctuation"](e)))}},{key:"_tinySDF",value:function(t,n,r){var i=this.localFontFamily;if(i&&this._doesCharSupportLocalGlyph(r)){var a=t.tinySDF;if(!a){var o="400";/bold/i.test(n)?o="900":/medium/i.test(n)?o="500":/light/i.test(n)&&(o="200"),(a=t.tinySDF=new e.TinySDF({fontFamily:i,fontWeight:o,fontSize:24*hd,buffer:3*hd,radius:8*hd})).fontWeight=o}if(this.localGlyphs[a.fontWeight][r])return this.localGlyphs[a.fontWeight][r];var s=String.fromCharCode(r),l=a.draw(s),c=l.data,u=l.width,f=l.height,h=l.glyphWidth,d=l.glyphHeight,p=l.glyphLeft,m=l.glyphTop,v=l.glyphAdvance;return this.localGlyphs[a.fontWeight][r]={id:r,bitmap:new Jc({width:u,height:f},c),metrics:{width:h/hd,height:d/hd,left:p/hd,top:m/hd-27,advance:v/hd,localGlyph:!0}}}}}]),e}();pd.loadGlyphRange=function(e,t,n,r,i){var a=256*t,o=a+255,s=r.transformRequest(r.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}","".concat(a,"-").concat(o)),we.Glyphs);Te(s,(function(e,t){if(e)i(e);else if(t){var n,r={},a=function(e){return new Eh(e).readFields(Ah,{})}(t),o=h(a.glyphs);try{for(o.s();!(n=o.n()).done;){var s=n.value;r[s.id]=s}}catch(l){o.e(l)}finally{o.f()}i(null,{glyphs:r,ascender:a.ascender,descender:a.descender})}}))},pd.TinySDF=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.fontSize,r=void 0===n?24:n,i=t.buffer,a=void 0===i?3:i,o=t.radius,s=void 0===o?8:o,l=t.cutoff,c=void 0===l?.25:l,u=t.fontFamily,f=void 0===u?"sans-serif":u,h=t.fontWeight,p=void 0===h?"normal":h,m=t.fontStyle,v=void 0===m?"normal":m;d(this,e),this.buffer=a,this.cutoff=c,this.radius=s;var y=this.size=r+4*a,g=this._createCanvas(y),_=this.ctx=g.getContext("2d",{willReadFrequently:!0});_.font="".concat(v," ").concat(p," ").concat(r,"px ").concat(f),_.textBaseline="alphabetic",_.textAlign="left",_.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}return p(e,[{key:"_createCanvas",value:function(e){var t=document.createElement("canvas");return t.width=t.height=e,t}},{key:"draw",value:function(e){var t=this.ctx.measureText(e),n=t.width,r=t.actualBoundingBoxAscent,i=t.actualBoundingBoxDescent,a=t.actualBoundingBoxLeft,o=t.actualBoundingBoxRight,s=Math.ceil(r),l=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-a))),c=Math.min(this.size-this.buffer,s+Math.ceil(i)),u=l+2*this.buffer,f=c+2*this.buffer,h=Math.max(u*f,0),d=new Uint8ClampedArray(h),p={data:d,width:u,height:f,glyphWidth:l,glyphHeight:c,glyphTop:s,glyphLeft:0,glyphAdvance:n};if(0===l||0===c)return p;var m=this.ctx,v=this.buffer,y=this.gridInner,g=this.gridOuter;m.clearRect(v,v,l,c),m.fillText(e,v,v+s);var _=m.getImageData(v,v,l,c);g.fill(cd,0,h),y.fill(0,0,h);for(var x=0;x0?z*z:0,y[k]=z<0?z*z:0}}}ud(g,0,0,u,f,u,this.f,this.v,this.z),ud(y,v,v,l,c,u,this.f,this.v,this.z);for(var M=0;M0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kd;if(d(this,e),this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}return p(e,[{key:"push",value:function(e){this.data.push(e),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(e){for(var t=this.data,n=this.compare,r=t[e];e>0;){var i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}},{key:"_down",value:function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e];e=0)break;t[e]=o,e=a}t[e]=i}}]),e}();function kd(e,t){return et?1:0}function zd(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=1/0,i=1/0,a=-1/0,o=-1/0,s=e[0],l=0;la)&&(a=c.x),(!l||c.y>o)&&(o=c.y)}var u=Math.min(a-r,o-i),f=u/2,h=new wd([],Md);if(0===u)return new P(r,i);for(var d=r;dm.d||!m.d)&&(m=y,n&&console.log("found best %d after %d probes",Math.round(1e4*y.d)/1e4,v)),y.max-m.d<=t||(f=y.h/2,h.push(new Td(y.p.x-f,y.p.y-f,f,e)),h.push(new Td(y.p.x+f,y.p.y-f,f,e)),h.push(new Td(y.p.x-f,y.p.y+f,f,e)),h.push(new Td(y.p.x+f,y.p.y+f,f,e)),v+=4)}return n&&(console.log("num probes: ".concat(v)),console.log("best distance: ".concat(m.d))),m.p}function Md(e,t){return t.max-e.max}var Td=p((function e(t,n,r,i){d(this,e),this.p=new P(t,n),this.h=r,this.d=function(e,t){for(var n=!1,r=1/0,i=0;ie.y!=u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(n=!n),r=Math.min(r,Pc(e,c,u))}return(n?1:-1)*Math.sqrt(r)}(this.p,i),this.max=this.d+this.h*Math.SQRT2})),Sd=7,Ed=Number.POSITIVE_INFINITY,Cd=Math.sqrt(2);function Ad(e,t){var n=f(t,2),r=n[0],i=n[1],a=0,o=0;if(i===Ed){r<0&&(r=0);var s=r/Cd;switch(e){case"top-right":case"top-left":o=s-Sd;break;case"bottom-right":case"bottom-left":o=-s+Sd;break;case"bottom":o=-r+Sd;break;case"top":o=r-Sd}switch(e){case"top-right":case"bottom-right":a=-s;break;case"top-left":case"bottom-left":a=s;break;case"left":a=r;break;case"right":a=-r}}else{switch(r=Math.abs(r),i=Math.abs(i),e){case"top-right":case"top-left":case"top":o=i-Sd;break;case"bottom-right":case"bottom-left":case"bottom":o=-i+Sd}switch(e){case"top-right":case"bottom-right":case"right":a=-r;break;case"top-left":case"bottom-left":case"left":a=r}}return[a,o]}function Id(e,t,n,r,i,a,o,s,l,c){e.createArrays(),e.tilePixelRatio=ws/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var u=e.layers[0].layout,f=e.layers[0]._unevaluatedLayout._values,d={};if("composite"===e.textSizeData.kind){var p=e.textSizeData,m=p.minZoom,v=p.maxZoom;d.compositeTextSizes=[f["text-size"].possiblyEvaluate(new Oa(m),s),f["text-size"].possiblyEvaluate(new Oa(v),s)]}if("composite"===e.iconSizeData.kind){var y=e.iconSizeData,g=y.minZoom,_=y.maxZoom;d.compositeIconSizes=[f["icon-size"].possiblyEvaluate(new Oa(g),s),f["icon-size"].possiblyEvaluate(new Oa(_),s)]}d.layoutTextSize=f["text-size"].possiblyEvaluate(new Oa(l+1),s),d.layoutIconSize=f["icon-size"].possiblyEvaluate(new Oa(l+1),s),d.textMaxSize=f["text-size"].possiblyEvaluate(new Oa(18),s);var x,b="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),w=u.get("text-size"),k=h(e.features);try{var z=function(){var a,l=x.value,f=u.get("text-font").evaluate(l,{},s).join(","),h=w.evaluate(l,{},s),p=d.layoutTextSize.evaluate(l,{},s),m=(d.layoutIconSize.evaluate(l,{},s),{horizontal:{},vertical:void 0}),v=l.text,y=[0,0];if(v){var g=v.toString(),_=u.get("text-letter-spacing").evaluate(l,{},s)*Kf,k=u.get("text-line-height").evaluate(l,{},s)*Kf,z=ya(g)?_:0,M=u.get("text-anchor").evaluate(l,{},s),T=u.get("text-variable-anchor");if(!T){var S=u.get("text-radial-offset").evaluate(l,{},s);y=S?Ad(M,[S*Kf,Ed]):u.get("text-offset").evaluate(l,{},s).map((function(e){return e*Kf}))}var E=b?"center":u.get("text-justify").evaluate(l,{},s),C="point"===u.get("symbol-placement"),A=C?u.get("text-max-width").evaluate(l,{},s)*Kf:1/0,I=function(r){e.allowVerticalPlacement&&va(g)&&(m.vertical=Uh(v,t,n,i,f,A,k,M,r,z,y,Nh.vertical,!0,p,h))};if(!b&&T){for(var P="auto"===E?T.map((function(e){return Pd(e)})):[E],L=!1,D=0;D=0||!va(g)){var B=Uh(v,t,n,i,f,A,k,M,E,z,y,Nh.horizontal,!1,p,h);B&&(m.horizontal[E]=B)}I(C?"left":E)}}var N=!1;if(l.icon&&l.icon.name){var F=r[l.icon.name];F&&(a=Jh(i[l.icon.name],u.get("icon-offset").evaluate(l,{},s),u.get("icon-anchor").evaluate(l,{},s)),N=F.sdf,void 0===e.sdfIcons?e.sdfIcons=F.sdf:e.sdfIcons!==F.sdf&&ie("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(F.pixelRatio!==e.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}var V=Bd(m.horizontal)||m.vertical;e.iconsInText||(e.iconsInText=!!V&&V.iconsInText),(V||a)&&Ld(e,l,m,a,r,d,p,0,y,N,o,s,c)};for(k.s();!(x=k.n()).done;)z()}catch(M){k.e(M)}finally{k.f()}a&&e.generateCollisionDebugBuffers(l,e.collisionBoxArray)}function Pd(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Ld(e,t,n,r,i,a,o,s,l,c,u,d,p){var m=a.textMaxSize.evaluate(t,{},d);void 0===m&&(m=o);var v,y,g=e.layers[0].layout,_=g.get("icon-offset").evaluate(t,{},d),x=Bd(n.horizontal)||n.vertical,b="globe"===p.name,w=Kf,k=o/w,z=e.tilePixelRatio*m/w,M=(v=e.overscaling,e.zoom>18&&v>2&&(v>>=1),Math.max(ws/(512*v),1)*g.get("symbol-spacing")),T=g.get("text-padding")*e.tilePixelRatio,S=g.get("icon-padding")*e.tilePixelRatio,E=R(g.get("text-max-angle")),C="map"===g.get("text-rotation-alignment")&&"point"!==g.get("symbol-placement"),A="map"===g.get("icon-rotation-alignment")&&"point"!==g.get("symbol-placement"),I=g.get("symbol-placement"),P=M/2,L=g.get("icon-text-fit");r&&"none"!==L&&(e.allowVerticalPlacement&&n.vertical&&(y=Qh(r,n.vertical,L,g.get("icon-text-fit-padding"),_,k)),x&&(r=Qh(r,x,L,g.get("icon-text-fit-padding"),_,k)));var D=function(o,s,h){if(!(s.x<0||s.x>=ws||s.y<0||s.y>=ws)){var m=null;if(b){var v=p.projectTilePoint(s.x,s.y,h),g=v.x,x=v.y,w=v.z;m={anchor:new ed(g,x,w,0,void 0),up:p.upVector(h,s.x,s.y)}}!function(e,t,n,r,i,a,o,s,l,c,u,h,d,p,m,v,y,g,_,x,b,w,k,z,M,T,S){var E,C,A,I,P,L,D,R=e.addToLineVertexArray(t,r),O=0,B=0,N=0,F=0,V=-1,j=-1,U={},H=qo(""),Z=n?n.anchor:t,G=0,q=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?(T=l.layout.get("text-offset").evaluate(b,{},M).map((function(e){return e*Kf})),G=(S=f(T,2))[0],q=S[1]):(G=l.layout.get("text-radial-offset").evaluate(b,{},M)*Kf,q=Ed),e.allowVerticalPlacement&&i.vertical){var W=i.vertical;if(m)L=Fd(W),s&&(D=Fd(s));else{var X=l.layout.get("text-rotate").evaluate(b,{},M)+90;A=Nd(c,Z,t,u,h,d,W,p,X,v),s&&(I=Nd(c,Z,t,u,h,d,s,g,X))}}if(a){var Y=l.layout.get("icon-rotate").evaluate(b,{},M),K="none"!==l.layout.get("icon-text-fit"),$=vd(a,Y,k,K),J=s?vd(s,Y,k,K):void 0;C=Nd(c,Z,t,u,h,d,a,g,Y),O=4*$.length;var Q=e.iconSizeData,ee=null;"source"===Q.kind?(ee=[$f*l.layout.get("icon-size").evaluate(b,{},M)])[0]>Rd&&ie("".concat(e.layerIds[0],': Value for "icon-size" is >= ').concat(Dd,'. Reduce your "icon-size".')):"composite"===Q.kind&&((ee=[$f*w.compositeIconSizes[0].evaluate(b,{},M),$f*w.compositeIconSizes[1].evaluate(b,{},M)])[0]>Rd||ee[1]>Rd)&&ie("".concat(e.layerIds[0],': Value for "icon-size" is >= ').concat(Dd,'. Reduce your "icon-size".')),e.addSymbols(e.icon,$,ee,x,_,b,!1,n,t,R.lineStartIndex,R.lineLength,-1,z,M),V=e.icon.placedSymbolArray.length-1,J&&(B=4*J.length,e.addSymbols(e.icon,J,ee,x,_,b,Nh.vertical,n,t,R.lineStartIndex,R.lineLength,-1,z,M),j=e.icon.placedSymbolArray.length-1)}for(var te in i.horizontal){var ne=i.horizontal[te];E||(H=qo(ne.text),m?P=Fd(ne):E=Nd(c,Z,t,u,h,d,ne,p,l.layout.get("text-rotate").evaluate(b,{},M),v));var re=1===ne.positionedLines.length;if(N+=Od(e,n,t,ne,o,l,m,b,v,R,i.vertical?Nh.horizontal:Nh.horizontalOnly,re?Object.keys(i.horizontal):[te],U,V,w,z,M),re)break}i.vertical&&(F+=Od(e,n,t,i.vertical,o,l,m,b,v,R,Nh.vertical,["vertical"],U,j,w,z,M));var ae=-1,oe=function(e,t){return e?Math.max(e,t):t};ae=oe(P,ae),ae=oe(L,ae);var se=(ae=oe(D,ae))>-1?1:0;e.glyphOffsetArray.length>=gp.MAX_GLYPHS&&ie("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey),e.symbolInstances.emplaceBack(Z.x,Z.y,Z.z,t.x,t.y,U.right>=0?U.right:-1,U.center>=0?U.center:-1,U.left>=0?U.left:-1,U.vertical>=0?U.vertical:-1,V,j,H,void 0!==E?E:e.collisionBoxArray.length,void 0!==E?E+1:e.collisionBoxArray.length,void 0!==A?A:e.collisionBoxArray.length,void 0!==A?A+1:e.collisionBoxArray.length,void 0!==C?C:e.collisionBoxArray.length,void 0!==C?C+1:e.collisionBoxArray.length,I||e.collisionBoxArray.length,I?I+1:e.collisionBoxArray.length,u,N,F,O,B,se,0,G,q,ae)}(e,s,m,o,n,r,i,y,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,T,C,l,0,S,A,_,t,a,c,u,d)}};if("line"===I){var O,B=h(ld(t.geometry,0,0,ws,ws));try{for(B.s();!(O=B.n()).done;){var N,F=O.value,V=od(F,M,E,n.vertical||x,r,w,z,e.overscaling,ws),j=h(V);try{for(j.s();!(N=j.n()).done;){var U=N.value;x&&Vd(e,x.text,P,U)||D(F,U,d)}}catch(se){j.e(se)}finally{j.f()}}}catch(se){B.e(se)}finally{B.f()}}else if("line-center"===I){var H,Z=h(t.geometry);try{for(Z.s();!(H=Z.n()).done;){var G=H.value;if(G.length>1){var q=ad(G,E,n.vertical||x,r,w,z);q&&D(G,q,d)}}}catch(se){Z.e(se)}finally{Z.f()}}else if("Polygon"===t.type){var W,X=h(Ou(t.geometry,0));try{for(X.s();!(W=X.n()).done;){var Y=W.value,K=zd(Y,16);D(Y[0],new ed(K.x,K.y,0,0,void 0),d)}}catch(se){X.e(se)}finally{X.f()}}else if("LineString"===t.type){var $,J=h(t.geometry);try{for(J.s();!($=J.n()).done;){var Q=$.value;D(Q,new ed(Q[0].x,Q[0].y,0,0,void 0),d)}}catch(se){J.e(se)}finally{J.f()}}else if("Point"===t.type){var ee,te=h(t.geometry);try{for(te.s();!(ee=te.n()).done;){var ne,re=ee.value,ae=h(re);try{for(ae.s();!(ne=ae.n()).done;){var oe=ne.value;D([oe],new ed(oe.x,oe.y,0,0,void 0),d)}}catch(se){ae.e(se)}finally{ae.f()}}}catch(se){te.e(se)}finally{te.f()}}}var Dd=255,Rd=Dd*$f;function Od(e,t,n,r,i,o,s,l,c,f,d,p,m,v,y,g,_){var x=function(e,t,n,r,i,o,s,l){var c=[];if(0===t.positionedLines.length)return c;var f,d=r.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,p=function(e){var t=e[0],n=e[1],r=t*n;return r>0?[t,-n]:r<0?[-t,n]:0===t?[n,t]:[n,-t]}(n),m=Math.abs(t.top-t.bottom),v=h(t.positionedLines);try{for(v.s();!(f=v.n()).done;)m-=f.value.lineOffset}catch(oe){v.e(oe)}finally{v.f()}for(var y=t.positionedLines.length,g=m/y,_=t.top-n[1],x=0;xRd&&ie("".concat(e.layerIds[0],': Value for "text-size" is >= ').concat(Dd,'. Reduce your "text-size".')):"composite"===b.kind&&((w=[$f*y.compositeTextSizes[0].evaluate(l,{},_),$f*y.compositeTextSizes[1].evaluate(l,{},_)])[0]>Rd||w[1]>Rd)&&ie("".concat(e.layerIds[0],': Value for "text-size" is >= ').concat(Dd,'. Reduce your "text-size".')),e.addSymbols(e.text,x,w,c,s,l,d,t,n,f.lineStartIndex,f.lineLength,v,g,_);var k,z=h(p);try{for(z.s();!(k=z.n()).done;)m[k.value]=e.text.placedSymbolArray.length-1}catch(M){z.e(M)}finally{z.f()}return 4*x.length}function Bd(e){for(var t in e)return e[t];return null}function Nd(e,t,n,r,i,a,o,s,l,c){var u=o.top,f=o.bottom,h=o.left,d=o.right,p=o.collisionPadding;if(p&&(h-=p[0],u-=p[1],d+=p[2],f+=p[3]),l){var m=new P(h,u),v=new P(d,u),y=new P(h,f),g=new P(d,f),_=R(l),x=new P(0,0);c&&(x=new P(c[0],c[1])),m._rotateAround(_,x),v._rotateAround(_,x),y._rotateAround(_,x),g._rotateAround(_,x),h=Math.min(m.x,v.x,y.x,g.x),d=Math.max(m.x,v.x,y.x,g.x),u=Math.min(m.y,v.y,y.y,g.y),f=Math.max(m.y,v.y,y.y,g.y)}return e.emplaceBack(t.x,t.y,t.z,n.x,n.y,h,u,d,f,s,r,i,a),e.length-1}function Fd(e){e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);var t=e.bottom-e.top;return t>0?Math.max(10,t):null}function Vd(e,t,n,r){var i=e.compareText;if(t in i){for(var a=i[t],o=a.length-1;o>=0;o--)if(r.dist(a[o])_&&(x(e,c,r,i,s,l),x(c,n,s,l,a,o))}x(f,h,r,a,i,a),x(h,d,i,a,i,o),x(d,p,i,o,r,o),x(p,f,r,o,r,a),m-=_,v-=_,y+=_,g+=_;var b=1/Math.max(y-m,g-v);return{scale:b,x:m*b,y:v*b,x2:y*b,y2:g*b,projection:t}}var Hd=Es(new Float32Array(16)),Zd=function(){function e(t){d(this,e),this.spec=t,this.name=t.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}return p(e,[{key:"project",value:function(e,t){return{x:0,y:0,z:0}}},{key:"unproject",value:function(e,t){return new nc(0,0)}},{key:"projectTilePoint",value:function(e,t,n){return{x:e,y:t,z:0}}},{key:"locationPoint",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e._coordinatePoint(e.locationCoordinate(t),n)}},{key:"pixelsPerMeter",value:function(e,t){return oc(1,e)*t}},{key:"pixelSpaceConversion",value:function(e,t,n){return 1}},{key:"farthestPixelDistance",value:function(e){return jd(e,e.pixelsPerMeter)}},{key:"pointCoordinate",value:function(e,t,n,r){var i=e.horizonLineFromTop(!1),a=new P(t,Math.max(i,n));return e.rayIntersectionCoordinate(e.pointRayIntersection(a,r))}},{key:"pointCoordinate3D",value:function(e,t,n){var r=new P(t,n);if(e.elevation)return e.elevation.pointCoordinate(r);var i=this.pointCoordinate(e,r.x,r.y,0);return[i.x,i.y,i.z]}},{key:"isPointAboveHorizon",value:function(e,t){if(e.elevation)return!this.pointCoordinate3D(e,t.x,t.y);var n=e.horizonLineFromTop();return t.y0?t<-Qd+n&&(t=-Qd+n):t>Qd-n&&(t=Qd-n);var a=i/Math.pow(ep(t),r),o=a*Math.sin(r*e),s=i-a*Math.cos(r*e);return o=.5*(o/Math.PI+.5),s=.5*(s/Math.PI+.5),{x:o,y:this.southernCenter?s:1-s,z:0}}},{key:"unproject",value:function(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;var n=this.n,r=this.f,i=r-t,a=Math.sign(i),o=Math.sign(n)*Math.sqrt(e*e+i*i),s=Math.atan2(e,Math.abs(i))*a;i*n<0&&(s-=Math.PI*Math.sign(e)*a);var l=j(O(s/n)+this.center[0],-180,180),c=j(O(2*Math.atan(Math.pow(r/o,1/n))-Qd),-uc,uc);return new nc(l,this.southernCenter?-c:c)}}]),n}(Zd),np=function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e)).wrap=!0,r.supportsWorldCopies=!0,r.supportsTerrain=!0,r.supportsFog=!0,r.supportsFreeCamera=!0,r.isReprojectedInTileSpace=!1,r.unsupportedLayers=[],r.range=null,r}return p(n,[{key:"project",value:function(e,t){return{x:ic(e),y:ac(t),z:0}}},{key:"unproject",value:function(e,t){var n=sc(e),r=lc(t);return new nc(n,r)}}]),n}(Zd),rp=R(uc),ip=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"project",value:function(e,t){var n=(t=R(t))*t,r=n*n;return{x:.5*((e=R(e))*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))/Math.PI+1),z:0}}},{key:"unproject",value:function(e,t){e=(2*e-.5)*Math.PI;var n=t=(2*(1-t)-1)*Math.PI,r=25,i=0,a=n*n;do{var o=(a=n*n)*a;n=j(n-(i=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-t)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))),-rp,rp)}while(Math.abs(i)>1e-6&&--r>0);var s=j(O(e/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979))),-180,180),l=O(n);return new nc(s,l)}}]),n}(Zd),ap=R(uc),op=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n,[{key:"project",value:function(e,t){t=R(t),e=R(e);var n=Math.cos(t),r=2/Math.PI,i=Math.acos(n*Math.cos(e/2)),a=Math.sin(i)/i,o=.5*(e*r+2*n*Math.sin(e/2)/a)||0,s=.5*(t+Math.sin(t)/a)||0;return{x:.5*(o/Math.PI+.5),y:1-.5*(s/Math.PI+1),z:0}}},{key:"unproject",value:function(e,t){var n=e=(2*e-.5)*Math.PI,r=t=(2*(1-t)-1)*Math.PI,i=25,a=1e-6,o=0,s=0;do{var l=Math.cos(r),c=Math.sin(r),u=2*c*l,f=c*c,h=l*l,d=Math.cos(n/2),p=Math.sin(n/2),m=2*d*p,v=p*p,y=1-h*d*d,g=y?1/y:0,_=y?Math.acos(l*d)*Math.sqrt(1/y):0,x=.5*(2*_*l*p+2*n/Math.PI)-e,b=.5*(_*c+r)-t,w=.5*g*(h*v+_*l*d*f)+1/Math.PI,k=g*(m*u/4-_*c*p),z=.125*g*(u*p-_*c*h*m),M=.5*g*(f*d+_*v*l)+.5,T=k*z-M*w;s=(x*z-b*w)/T,n=j(n-(o=(b*k-x*M)/T),-Math.PI,Math.PI),r=j(r-s,-ap,ap)}while((Math.abs(o)>a||Math.abs(s)>a)&&--i>0);return new nc(O(n),O(r))}}]),n}(Zd),sp=function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e)).center=e.center||[0,0],r.parallels=e.parallels||[0,0],r.cosPhi=Math.max(.01,Math.cos(R(r.parallels[0]))),r.scale=1/(2*Math.max(Math.PI*r.cosPhi,1/r.cosPhi)),r.wrap=!0,r.supportsWorldCopies=!0,r}return p(n,[{key:"project",value:function(e,t){var n=this.scale,r=this.cosPhi;return{x:R(e)*r*n+.5,y:-Math.sin(R(t))/r*n+.5,z:0}}},{key:"unproject",value:function(e,t){var n=this.scale,r=this.cosPhi,i=-(t-.5)/n,a=j(O((e-.5)/n)/r,-180,180),o=Math.asin(j(i*r,-1,1)),s=j(O(o),-uc,uc);return new nc(a,s)}}]),n}(Zd),lp=function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e)).requiresDraping=!0,r.supportsWorldCopies=!1,r.supportsFog=!0,r.zAxisUnit="pixels",r.unsupportedLayers=["debug"],r.range=[3,5],r}return p(n,[{key:"projectTilePoint",value:function(e,t,n){var r=jl(e,t,n);return Js(r,r,Zl(Pl(n))),{x:r[0],y:r[1],z:r[2]}}},{key:"locationPoint",value:function(e,t){var n=Vl(t.lat,t.lng),r=Ys([],n),i=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(t),e._centerAltitude):e._centerAltitude;Xs(n,n,r,oc(1,0)*ws*i);var a=Es(new Float64Array(16));return As(a,e.pixelMatrix,e.globeMatrix),Js(n,n,a),new P(n[0],n[1])}},{key:"pixelsPerMeter",value:function(e,t){return oc(1,0)*t}},{key:"pixelSpaceConversion",value:function(e,t,n){var r=oc(1,e)*t,i=qn(oc(1,45)*t,r,n);return this.pixelsPerMeter(e,t)/i}},{key:"createTileMatrix",value:function(e,t,n){var r=Gl(Pl(n.canonical));return As(new Float64Array(16),e.globeMatrix,r)}},{key:"createInversionMatrix",value:function(e,t){var n=e.center,r=Zl(Pl(t));return Ds(r,r,R(n.lng)),Ls(r,r,R(n.lat)),Ps(r,r,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(r)}},{key:"pointCoordinate",value:function(e,t,n,r){return Cl(e,t,n,!0)||new hc(0,0)}},{key:"pointCoordinate3D",value:function(e,t,n){var r=this.pointCoordinate(e,t,n,0);return[r.x,r.y,r.z]}},{key:"isPointAboveHorizon",value:function(e,t){return!Cl(e,t.x,t.y,!1)}},{key:"farthestPixelDistance",value:function(e){var t=function(e,t){var n,r=e.cameraToCenterDistance,i=e._centerAltitude*t,a=e._camera,o=e._camera.forward(),s=Us([],Ws([],o,-r),[0,0,i]),l=e.worldSize/(2*Math.PI),c=[0,0,-l],u=e.width/e.height,f=Math.tan(e.fovAboveCenter),h=Ws([],a.up(),f),d=Ws([],a.right(),f*u),p=Ys([],Us([],Us([],o,h),d)),m=[];if(new ml(s,p).closestPointOnSphere(c,l,m)){var v=Us([],m,c),y=tl([],v,s);n=Math.cos(e.fovAboveCenter)*Vs(y)}else{var g=tl([],s,c),_=tl([],c,s);Ys(_,_);var x=Vs(g)-l;n=Math.sqrt(x*(x+2*l));var b=Math.acos(n/(l+x))-Math.acos(Ks(o,_));n*=Math.cos(b)}return 1.01*n}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),n=Wl(e.zoom);if(n>0){var r=jd(e,oc(1,e.center.lat)*e.worldSize),i=e.worldSize/(2*Math.PI),a=Math.max(e.width,e.height)/e.worldSize*Math.PI;return qn(t,r+i*(1-Math.cos(a)),Math.pow(n,10))}return t}},{key:"upVector",value:function(e,t,n){return jl(t,n,e,1)}},{key:"upVectorScale",value:function(e){return{metersToTile:El(Ul(Pl(e)))}}}]),n}(np);function cp(e){var t=e.parallels,n=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new np(e);case"equirectangular":return new Jd(e);case"naturalEarth":return new ip(e);case"equalEarth":return new $d(e);case"winkelTripel":return new op(e);case"albers":return n?new sp(e):new Gd(e);case"lambertConformalConic":return n?new sp(e):new tp(e);case"globe":return new lp(e)}throw new Error("Invalid projection name: ".concat(e.name))}var up=sf.types,fp=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function hp(e,t,n,r,i,a,o,s,l,c,u,f,h){var d=s?Math.min(Rd,Math.round(s[0])):0,p=s?Math.min(Rd,Math.round(s[1])):0;e.emplaceBack(t,n,Math.round(32*r),Math.round(32*i),a,o,(d<<1)+(l?1:0),p,16*c,16*u,256*f,256*h)}function dp(e,t,n,r,i,a,o){e.emplaceBack(t,n,r,i,a,o)}function pp(e,t,n,r,i){e.emplaceBack(t,n,r,i),e.emplaceBack(t,n,r,i),e.emplaceBack(t,n,r,i),e.emplaceBack(t,n,r,i)}function mp(e){var t,n=h(e.sections);try{for(n.s();!(t=n.n()).done;)if(ka(t.value.text))return!0}catch(r){n.e(r)}finally{n.f()}return!1}var vp=function(){function e(t){d(this,e),this.layoutVertexArray=new co,this.indexArray=new go,this.programConfigurations=t,this.segments=new bs,this.dynamicLayoutVertexArray=new ao,this.opacityVertexArray=new fo,this.placedSymbolArray=new Ao,this.globeExtVertexArray=new uo}return p(e,[{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}},{key:"upload",value:function(e,t,n,r){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Hf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Gf.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,fp,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Zf.members,!0)),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(e))}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}]),e}();ca(vp,"SymbolBuffers");var yp=function(){function e(t,n,r){d(this,e),this.layoutVertexArray=new t,this.layoutAttributes=n,this.indexArray=new r,this.segments=new bs,this.collisionVertexArray=new vo,this.collisionVertexArrayExt=new yo}return p(e,[{key:"upload",value:function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,qf.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Wf.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}]),e}();ca(yp,"CollisionBuffers");var gp=function(){function e(t){d(this,e),this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Es([]),this.placementViewportMatrix=Es([]);var n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Jf(this.zoom,n["text-size"]),this.iconSizeData=Jf(this.zoom,n["icon-size"]);var r=this.layers[0].layout,i=r.get("symbol-sort-key"),a=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&void 0!==i.constantOr(1),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=r.get("text-writing-mode").map((function(e){return Nh[e]})),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id})),this.sourceID=t.sourceID,this.projection=t.projection}return p(e,[{key:"createArrays",value:function(){this.text=new vp(new fs(this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new vp(new fs(this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new Lo,this.lineVertexArray=new Do,this.symbolInstances=new Po}},{key:"calculateGlyphDependencies",value:function(e,t,n,r,i){for(var a=0;a0)&&("constant"!==l.value.kind||l.value.value.length>0),d="constant"!==u.value.kind||!!u.value.value||Object.keys(u.parameters).length>0,p=o.get("symbol-sort-key");if(this.features=[],f||d){var m,v=t.iconDependencies,y=t.glyphDependencies,g=t.availableImages,_=new Oa(this.zoom),x=h(e);try{var b=function(){var e,t,c=m.value,u=c.feature,x=c.id,b=c.index,w=c.sourceLayerIndex,k=a._featureFilter.needGeometry,z=bc(u,k);if(!a._featureFilter.filter(_,z,n))return 0;if(k||(z.geometry=xc(u,n,r)),s&&1!==u.type&&n.z<=5)for(var M=z.geometry,T=.98078528056,S=function(e,t){return Ks(jl(e.x,e.y,n,1),jl(t.x,t.y,n,1))=0;var R,O=h(e.sections);try{for(O.s();!(R=O.n()).done;){var B=R.value;if(B.image)v[B.image.name]=!0;else{var N=va(e.toString()),F=B.fontStack||L,V=y[F]=y[F]||{};i.calculateGlyphDependencies(B.text,V,D,i.allowVerticalPlacement,N)}}}catch(j){O.e(j)}finally{O.f()}}};for(x.s();!(m=x.n()).done;)b()}catch(w){x.e(w)}finally{x.f()}"line"===o.get("symbol-placement")&&(this.features=function(e){var t={},n={},r=[],i=0;function a(t){r.push(e[t]),i++}function o(e,t,i){var a=n[e];return delete n[e],n[t]=a,r[a].geometry[0].pop(),r[a].geometry[0]=r[a].geometry[0].concat(i[0]),a}function s(e,n,i){var a=t[n];return delete t[n],t[e]=a,r[a].geometry[0].shift(),r[a].geometry[0]=i[0].concat(r[a].geometry[0]),a}function l(e,t,n){var r=n?t[0][t[0].length-1]:t[0][0];return"".concat(e,":").concat(r.x,":").concat(r.y)}for(var c=0;c=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:r),a=Qf(this.textSizeData,e,i)/Kf;return this.tilePixelRatio*a}},{key:"getSymbolInstanceIconSize",value:function(e,t,n){var r=this.icon.placedSymbolArray.get(n),i=Qf(this.iconSizeData,e,r);return this.tilePixelRatio*i}},{key:"_commitDebugCollisionVertexUpdate",value:function(e,t,n){e.emplaceBack(t,-n,-n),e.emplaceBack(t,n,-n),e.emplaceBack(t,n,n),e.emplaceBack(t,-n,n)}},{key:"_updateTextDebugCollisionBoxes",value:function(e,t,n,r,i,a){for(var o=r;o0}},{key:"hasIconData",value:function(){return this.icon.segments.get().length>0}},{key:"hasDebugData",value:function(){return this.textCollisionBox&&this.iconCollisionBox}},{key:"hasTextCollisionBoxData",value:function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}},{key:"hasIconCollisionBoxData",value:function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}},{key:"addIndicesForPlacedSymbol",value:function(e,t){for(var n=e.placedSymbolArray.get(t),r=n.vertexStartIndex+4*n.numGlyphs,i=n.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];var t,n=h(this.symbolInstanceIndexes);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=this.symbolInstances.get(r);this.featureSortOrder.push(i.featureIndex);var a=i.rightJustifiedTextSymbolIndex,o=i.centerJustifiedTextSymbolIndex,s=i.leftJustifiedTextSymbolIndex,l=i.verticalPlacedTextSymbolIndex,c=i.placedIconSymbolIndex,u=i.verticalPlacedIconSymbolIndex;a>=0&&this.addIndicesForPlacedSymbol(this.text,a),o>=0&&o!==a&&this.addIndicesForPlacedSymbol(this.text,o),s>=0&&s!==o&&s!==a&&this.addIndicesForPlacedSymbol(this.text,s),l>=0&&this.addIndicesForPlacedSymbol(this.text,l),c>=0&&this.addIndicesForPlacedSymbol(this.icon,c),u>=0&&this.addIndicesForPlacedSymbol(this.icon,u)}}catch(f){n.e(f)}finally{n.f()}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}]),e}();ca(gp,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),gp.MAX_GLYPHS=65535,gp.addDynamicAttributes=pp;var _p=new Xa({"symbol-placement":new Ga(pt.layout_symbol["symbol-placement"]),"symbol-spacing":new Ga(pt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ga(pt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qa(pt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ga(pt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ga(pt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ga(pt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ga(pt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ga(pt.layout_symbol["icon-rotation-alignment"]),"icon-size":new qa(pt.layout_symbol["icon-size"]),"icon-text-fit":new Ga(pt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ga(pt.layout_symbol["icon-text-fit-padding"]),"icon-image":new qa(pt.layout_symbol["icon-image"]),"icon-rotate":new qa(pt.layout_symbol["icon-rotate"]),"icon-padding":new Ga(pt.layout_symbol["icon-padding"]),"icon-keep-upright":new Ga(pt.layout_symbol["icon-keep-upright"]),"icon-offset":new qa(pt.layout_symbol["icon-offset"]),"icon-anchor":new qa(pt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ga(pt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ga(pt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ga(pt.layout_symbol["text-rotation-alignment"]),"text-field":new qa(pt.layout_symbol["text-field"]),"text-font":new qa(pt.layout_symbol["text-font"]),"text-size":new qa(pt.layout_symbol["text-size"]),"text-max-width":new qa(pt.layout_symbol["text-max-width"]),"text-line-height":new qa(pt.layout_symbol["text-line-height"]),"text-letter-spacing":new qa(pt.layout_symbol["text-letter-spacing"]),"text-justify":new qa(pt.layout_symbol["text-justify"]),"text-radial-offset":new qa(pt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ga(pt.layout_symbol["text-variable-anchor"]),"text-anchor":new qa(pt.layout_symbol["text-anchor"]),"text-max-angle":new Ga(pt.layout_symbol["text-max-angle"]),"text-writing-mode":new Ga(pt.layout_symbol["text-writing-mode"]),"text-rotate":new qa(pt.layout_symbol["text-rotate"]),"text-padding":new Ga(pt.layout_symbol["text-padding"]),"text-keep-upright":new Ga(pt.layout_symbol["text-keep-upright"]),"text-transform":new qa(pt.layout_symbol["text-transform"]),"text-offset":new qa(pt.layout_symbol["text-offset"]),"text-allow-overlap":new Ga(pt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ga(pt.layout_symbol["text-ignore-placement"]),"text-optional":new Ga(pt.layout_symbol["text-optional"])}),xp={paint:new Xa({"icon-opacity":new qa(pt.paint_symbol["icon-opacity"]),"icon-color":new qa(pt.paint_symbol["icon-color"]),"icon-halo-color":new qa(pt.paint_symbol["icon-halo-color"]),"icon-halo-width":new qa(pt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qa(pt.paint_symbol["icon-halo-blur"]),"icon-translate":new Ga(pt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ga(pt.paint_symbol["icon-translate-anchor"]),"text-opacity":new qa(pt.paint_symbol["text-opacity"]),"text-color":new qa(pt.paint_symbol["text-color"],{runtimeType:Tt,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new qa(pt.paint_symbol["text-halo-color"]),"text-halo-width":new qa(pt.paint_symbol["text-halo-width"]),"text-halo-blur":new qa(pt.paint_symbol["text-halo-blur"]),"text-translate":new Ga(pt.paint_symbol["text-translate"]),"text-translate-anchor":new Ga(pt.paint_symbol["text-translate-anchor"])}),layout:_p},bp=function(){function e(t){d(this,e),this.type=t.property.overrides?t.property.overrides.runtimeType:wt,this.defaultValue=t}return p(e,[{key:"evaluate",value:function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}},{key:"eachChild",value:function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return null}}]),e}();ca(bp,"FormatSectionOverride",{omit:["defaultValue"]});var wp=function(e){m(n,e);var t=v(n);function n(e){return d(this,n),t.call(this,e,xp)}return p(n,[{key:"recalculate",value:function(e,t){o(s(n.prototype),"recalculate",this).call(this,e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));var r=this.layout.get("text-writing-mode");if(r){var i,a=[],l=h(r);try{for(l.s();!(i=l.n()).done;){var c=i.value;a.indexOf(c)<0&&a.push(c)}}catch(u){l.e(u)}finally{l.f()}this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}},{key:"getValueAndResolveTokens",value:function(e,t,n,r){var i=this.layout.get(e).evaluate(t,{},n,r),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||ci(a.value)||!i?i:function(e,t){return t.replace(/{([^{}]+)}/g,(function(t,n){return n in e?String(e[n]):""}))}(t.properties,i)}},{key:"createBucket",value:function(e){return new gp(e)}},{key:"queryRadius",value:function(){return 0}},{key:"queryIntersectsFeature",value:function(){return!1}},{key:"_setPaintOverrides",value:function(){var e,t=h(xp.paint.overridableProperties);try{for(t.s();!(e=t.n()).done;){var r=e.value;if(n.hasPaintOverride(this.layout,r)){var i=this.paint.get(r),a=new bp(i),o=new li(a,i.property.specification),s=null;s="constant"===i.value.kind||"source"===i.value.kind?new fi("source",o):new hi("composite",o,i.value.zoomStops,i.value._interpolationType),this.paint._values[r]=new Ha(i.property,s,i.parameters)}}}catch(l){t.e(l)}finally{t.f()}}},{key:"_handleOverridablePaintPropertyUpdate",value:function(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&n.hasPaintOverride(this.layout,e)}},{key:"getProgramConfiguration",value:function(e){return new us(this,e)}}],[{key:"hasPaintOverride",value:function(e,t){var n=e.get("text-field"),r=xp.paint.properties[t],i=!1,a=function(e){var t,n=h(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;if(r.overrides&&r.overrides.hasOverride(a))return void(i=!0)}}catch(o){n.e(o)}finally{n.f()}};if("constant"===n.value.kind&&n.value.value instanceof Xt)a(n.value.value.sections);else if("source"===n.value.kind){var o=function e(t){i||(t instanceof tn&&Jt(t.value)===At?a(t.value.sections):t instanceof sn?a(t.sections):t.eachChild(e))},s=n.value;s._styleExpression&&o(s._styleExpression.expression)}return i}}]),n}(gs),kp={paint:new Xa({"background-color":new Ga(pt.paint_background["background-color"]),"background-pattern":new Ga(pt.paint_background["background-pattern"]),"background-opacity":new Ga(pt.paint_background["background-opacity"])})},zp={paint:new Xa({"raster-opacity":new Ga(pt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ga(pt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ga(pt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ga(pt.paint_raster["raster-brightness-max"]),"raster-saturation":new Ga(pt.paint_raster["raster-saturation"]),"raster-contrast":new Ga(pt.paint_raster["raster-contrast"]),"raster-resampling":new Ga(pt.paint_raster["raster-resampling"]),"raster-fade-duration":new Ga(pt.paint_raster["raster-fade-duration"])})},Mp=function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e,{})).implementation=e,r}return p(n,[{key:"is3D",value:function(){return"3d"===this.implementation.renderingMode}},{key:"hasOffscreenPass",value:function(){return void 0!==this.implementation.prerender}},{key:"isLayerDraped",value:function(){return void 0!==this.implementation.renderToTile}},{key:"shouldRedrape",value:function(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}},{key:"recalculate",value:function(){}},{key:"updateTransitions",value:function(){}},{key:"hasTransition",value:function(){return!1}},{key:"serialize",value:function(){}},{key:"onAdd",value:function(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}},{key:"onRemove",value:function(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}]),n}(gs),Tp={paint:new Xa({"sky-type":new Ga(pt.paint_sky["sky-type"]),"sky-atmosphere-sun":new Ga(pt.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Ga(pt.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Ga(pt.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Ga(pt.paint_sky["sky-gradient-radius"]),"sky-gradient":new Wa(pt.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Ga(pt.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Ga(pt.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Ga(pt.paint_sky["sky-opacity"])})};function Sp(e,t,n){var r=[0,0,1],i=ll([]);return ul(i,i,n?-R(e)+Math.PI:R(e)),cl(i,i,-R(t)),Qs(r,r,i),Ys(r,r)}for(var Ep={circle:function(e){m(n,e);var t=v(n);function n(e){return d(this,n),t.call(this,e,Uc)}return p(n,[{key:"createBucket",value:function(e){return new zc(e)}},{key:"queryRadius",value:function(e){var t=e;return Bc("circle-radius",this,t)+Bc("circle-stroke-width",this,t)+Nc(this.paint.get("circle-translate"))}},{key:"queryIntersectsFeature",value:function(e,t,n,r,i,a,o,s){var l=Vc(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(t,n)+this.paint.get("circle-stroke-width").evaluate(t,n);return Hc(e,r,a,o,s,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}},{key:"getProgramIds",value:function(){return["circle"]}},{key:"getProgramConfiguration",value:function(e){return new us(this,e)}}]),n}(gs),heatmap:function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e,eu))._updateColorRamp(),r}return p(n,[{key:"createBucket",value:function(e){return new Xc(e)}},{key:"_handleSpecialPaintPropertyUpdate",value:function(e){"heatmap-color"===e&&this._updateColorRamp()}},{key:"_updateColorRamp",value:function(){this.colorRamp=tu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}},{key:"resize",value:function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}},{key:"queryRadius",value:function(e){return Bc("heatmap-radius",this,e)}},{key:"queryIntersectsFeature",value:function(e,t,n,r,i,a,o,s){var l=this.paint.get("heatmap-radius").evaluate(t,n);return Hc(e,r,a,o,s,!0,!0,new P(0,0),l)}},{key:"hasOffscreenPass",value:function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}},{key:"getProgramIds",value:function(){return["heatmap","heatmapTexture"]}},{key:"getProgramConfiguration",value:function(e){return new us(this,e)}}]),n}(gs),hillshade:function(e){m(n,e);var t=v(n);function n(e){return d(this,n),t.call(this,e,nu)}return p(n,[{key:"hasOffscreenPass",value:function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}},{key:"getProgramIds",value:function(){return["hillshade","hillshadePrepare"]}}]),n}(gs),fill:function(e){m(n,e);var t=v(n);function n(e){return d(this,n),t.call(this,e,Uu)}return p(n,[{key:"getProgramIds",value:function(){var e=this.paint.get("fill-pattern"),t=e&&e.constantOr(1),n=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&n.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),n}},{key:"getProgramConfiguration",value:function(e){return new us(this,e)}},{key:"recalculate",value:function(e,t){o(s(n.prototype),"recalculate",this).call(this,e,t);var r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}},{key:"createBucket",value:function(e){return new Vu(e)}},{key:"queryRadius",value:function(){return Nc(this.paint.get("fill-translate"))}},{key:"queryIntersectsFeature",value:function(e,t,n,r,i,a){return!e.queryGeometry.isAboveHorizon&&Sc(Fc(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,e.pixelToTileUnitsFactor),r)}},{key:"isTileClipped",value:function(){return!0}}]),n}(gs),"fill-extrusion":function(e){m(n,e);var t=v(n);function n(e){return d(this,n),t.call(this,e,zf)}return p(n,[{key:"createBucket",value:function(e){return new pf(e)}},{key:"queryRadius",value:function(){return Nc(this.paint.get("fill-extrusion-translate"))}},{key:"is3D",value:function(){return!0}},{key:"getProgramIds",value:function(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}},{key:"getProgramConfiguration",value:function(e){return new us(this,e)}},{key:"queryIntersectsFeature",value:function(e,t,n,r,i,a,o,s,l){var c=Vc(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,e.pixelToTileUnitsFactor),u=this.paint.get("fill-extrusion-height").evaluate(t,n),d=this.paint.get("fill-extrusion-base").evaluate(t,n),p=[0,0],m=s&&a.elevation,v=a.elevation?a.elevation.exaggeration():1,y=e.tile.getBucket(this);if(m&&y instanceof pf){var g=y.centroidVertexArray,_=l+1;_0&&(n+=g),r+=g;var _,x=h(t);try{for(x.s();!(_=x.n()).done;){var b,w=_.value,k=[],z=[],M=h(w);try{for(M.s();!(b=M.n()).done;){var T=b.value,S=T.x+i.x,E=T.y+i.y,C=e.projection.projectTilePoint(S,E,u),A=e.projection.upVector(u,T.x,T.y),I=n,P=r;if(o){var L=Lf(S,E,n,r,o,s,l,c);I+=L.base,P+=L.top}0!==n?y(m,C.x+A[0]*p*I,C.y+A[1]*p*I,C.z+A[2]*p*I):y(m,C.x,C.y,C.z),y(v,C.x+A[0]*p*P,C.y+A[1]*p*P,C.z+A[2]*p*P),Js(m,m,a),Js(v,v,a),k.push(new Af(m[0],m[1],m[2])),z.push(new Af(v[0],v[1],v[2]))}}catch(D){M.e(D)}finally{M.f()}f.push(k),d.push(z)}}catch(D){x.e(D)}finally{x.f()}return[f,d]}(e,t,n,r,i,a,o,s,l,c,u):o?function(e,t,n,r,i,a,o,s,l){var c,u=[],f=[],d=[0,0,0,1],p=h(e);try{for(p.s();!(c=p.n()).done;){var m,v=c.value,y=[],g=[],_=h(v);try{for(_.s();!(m=_.n()).done;){var x=m.value,b=x.x+r.x,w=x.y+r.y,k=Lf(b,w,t,n,a,o,s,l);d[0]=b,d[1]=w,d[2]=k.base,d[3]=1,ol(d,d,i),d[3]=Math.max(d[3],1e-5);var z=new Af(d[0]/d[3],d[1]/d[3],d[2]/d[3]);d[0]=b,d[1]=w,d[2]=k.top,d[3]=1,ol(d,d,i),d[3]=Math.max(d[3],1e-5);var M=new Af(d[0]/d[3],d[1]/d[3],d[2]/d[3]);y.push(z),g.push(M)}}catch(T){_.e(T)}finally{_.f()}u.push(y),f.push(g)}}catch(T){p.e(T)}finally{p.f()}return[u,f]}(t,n,r,i,a,o,s,l,c):function(e,t,n,r,i){var a,o=[],s=[],l=i[8]*t,c=i[9]*t,u=i[10]*t,f=i[11]*t,d=i[8]*n,p=i[9]*n,m=i[10]*n,v=i[11]*n,y=h(e);try{for(y.s();!(a=y.n()).done;){var g,_=a.value,x=[],b=[],w=h(_);try{for(w.s();!(g=w.n()).done;){var k=g.value,z=k.x+r.x,M=k.y+r.y,T=i[0]*z+i[4]*M+i[12],S=i[1]*z+i[5]*M+i[13],E=i[2]*z+i[6]*M+i[14],C=i[3]*z+i[7]*M+i[15],A=T+l,I=S+c,P=E+u,L=Math.max(C+f,1e-5),D=T+d,R=S+p,O=E+m,B=Math.max(C+v,1e-5);x.push(new Af(A/L,I/L,P/L)),b.push(new Af(D/B,R/B,O/B))}}catch(N){w.e(N)}finally{w.f()}o.push(x),s.push(b)}}catch(N){y.e(N)}finally{y.f()}return[o,s]}(t,n,r,i,a)}(a,r,d,u,c,o,m?s:null,p,v,a.center.lat,e.tileID.canonical),b=f(x,2),w=b[0],k=b[1],z=e.queryGeometry;return function(e,t,n){var r=1/0;Sc(n,t)&&(r=Pf(n,t[0]));for(var i=0;i=3)for(var a=0;a>=1)>1;){var qp=Vp+Up>>1,Wp=jp+Hp>>1;1&Fp?(Up=Vp,Hp=jp,Vp=Zp,jp=Gp):(Vp=Up,jp=Hp,Up=Zp,Hp=Gp),Zp=qp,Gp=Wp}var Xp=4*Np;Bp[Xp+0]=Vp,Bp[Xp+1]=jp,Bp[Xp+2]=Up,Bp[Xp+3]=Hp}var Yp=new Uint16Array(2178),Kp=new Uint8Array(1089),$p=new Uint16Array(1089);function Jp(e){return 0===e?-.03125:32===e?.03125:0}var Qp=Qa([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),em={type:2,extent:ws,loadGeometry:function(){return[[new P(0,0),new P(ws+1,0),new P(ws+1,ws+1),new P(0,ws+1),new P(0,0)]]}},tm=function(){function e(t,n,r,i,a){d(this,e),this.tileID=t,this.uid=X(),this.uses=0,this.tileSize=n,this.tileZoom=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=a,this.expiredRequestCount=0,this.state="loading",i&&i.transform&&(this.projection=i.transform.projection)}return p(e,[{key:"registerFadeDuration",value:function(e){var t=e+this.timeAdded;tr)i=!1;else if(t)if(this.expirationTime=0;u--){var f=4*u,h=Bp[f+0],d=Bp[f+1],p=Bp[f+2],m=Bp[f+3],v=h+p>>1,y=d+m>>1,g=v+y-d,_=y+h-v,x=d*Op+h,b=m*Op+p,w=y*Op+v,k=Math.hypot((Yp[2*x+0]+Yp[2*b+0])/2-Yp[2*w+0],(Yp[2*x+1]+Yp[2*b+1])/2-Yp[2*w+1])>=16;Kp[w]=Kp[w]||(k?1:0),u<1022&&(Kp[w]=Kp[w]||Kp[(d+_>>1)*Op+(h+g>>1)]||Kp[(m+_>>1)*Op+(p+g>>1)])}var z=new ro,M=new go,T=0;function S(e,t){var n=t*Op+e;return 0===$p[n]&&(z.emplaceBack(Yp[2*n+0],Yp[2*n+1],e*ws/Rp,t*ws/Rp),$p[n]=++T),$p[n]-1}function E(e,t,n,r,i,a){var o=e+n>>1,s=t+r>>1;if(Math.abs(e-i)+Math.abs(t-a)>1&&Kp[s*Op+o])E(i,a,e,t,o,s),E(n,r,i,a,o,s);else{var l=S(e,t),c=S(n,r),u=S(i,a);M.emplaceBack(l,c,u)}}return E(0,0,Rp,Rp,Rp,0),E(Rp,Rp,0,0,0,Rp),{vertices:z,indices:M}}(this.tileID.canonical,t);n=a.vertices,r=a.indices}else{n=new ro,r=new go;var o,s=h(i);try{for(s.s();!(o=s.n()).done;){var l=o.value,c=l.x,u=l.y;n.emplaceBack(c,u,0,0)}}catch(p){s.e(p)}finally{s.f()}for(var f=Iu(n.int16,void 0,4),d=0;d0&&(r=Cs(new Float64Array(16),t.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,i,t,a,r,o),this._makeGlobeTileDebugTextBuffer(e,i,t,a,r,o)}}},{key:"_globePoint",value:function(e,t,n,r,i,a,o){var s=jl(e,t,n);if(a){var l=1<.5?h=-1:f<-.5&&(h=1);var d=(e/ws+n.x)/l+h,p=(t/ws+n.y)/l;d=(d-c)*r._pixelsPerMercatorPixel+c,p=(p-u)*r._pixelsPerMercatorPixel+u;var m=[d*r.worldSize,p*r.worldSize,0];Js(m,m,a),s=Ll(s,m,o)}return Js(s,s,i)}},{key:"_makeGlobeTileDebugBorderBuffer",value:function(e,t,n,r,i,a){var o=this,s=new to,l=new Mo,c=new no,u=function(e,u,f,h,d){for(var p=(f-e)/(d-1),m=(h-u)/(d-1),v=s.length,y=0;yt[o])return null}else{var s=1/r[o],l=(e[o]-n[o])*s,c=(t[o]-n[o])*s;if(l>c){var u=l;l=c,c=u}if(l>i&&(i=l),ca)return null}return i}function am(e,t,n,r,i,a,o,s,l,c,u){var f=r-e,h=i-t,d=a-n,p=o-e,m=s-t,v=l-n,y=u[1]*v-u[2]*m,g=u[2]*p-u[0]*v,_=u[0]*m-u[1]*p,x=f*y+h*g+d*_;if(Math.abs(x)<1e-15)return null;var b=1/x,w=c[0]-e,k=c[1]-t,z=c[2]-n,M=(w*y+k*g+z*_)*b;if(M<0||M>1)return null;var T=k*d-z*h,S=z*f-w*d,E=w*h-k*f,C=(u[0]*T+u[1]*S+u[2]*E)*b;return C<0||M+C>1?null:(p*T+m*S+v*E)*b}function om(e,t,n){return(e-t)/(n-t)}function sm(e,t,n,r,i,a,o,s,l){var c=1<=1;r/=2){var d=n[n.length-1];o=new rm(r);for(var p=0;p6&&void 0!==arguments[6]?arguments[6]:1;return im([e,t,-100],[n,r,this.maximums[0]*o],i,a)}},{key:"raycast",value:function(e,t,n,r,i,a){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(!this.nodeCount)return null;var s=this.raycastRoot(e,t,n,r,i,a,o);if(null==s)return null;for(var l=[],c=[],u=[],f=[],h=[{idx:0,t:s,nodex:0,nodey:0,depth:0}];h.length>0;){var d=h.pop(),p=d.idx,m=d.t,v=d.nodex,y=d.nodey,g=d.depth;if(this.leaves[p]){sm(v,y,g,e,t,n,r,u,f);var _=1<=I[2])return m}else{for(var P=0,L=0;L=l[c[B]]&&(c.splice(B,0,L),O=!0);O||(c[P]=L),P++}}for(var N=0;N3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(d(this,e),this.uid=t,n.height!==n.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return ie('"'.concat(r,'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".'));this.stride=n.height;var o=this.dim=n.height-2,s=new Uint32Array(n.data.buffer);if(this.pixels=new Uint8Array(n.data.buffer),this.encoding=r||"mapbox",this.borderReady=i,!i){for(var l=0;l2&&void 0!==arguments[2]&&arguments[2]&&(e=j(e,-1,this.dim),t=j(t,-1,this.dim));var n=4*this._idx(e,t);return("terrarium"===this.encoding?dm:hm)(this.pixels[n],this.pixels[n+1],this.pixels[n+2])}},{key:"unpackVector",get:function(){return fm[this.encoding]}},{key:"_idx",value:function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}},{key:"getPixels",value:function(){return new Qc({width:this.stride,height:this.stride},this.pixels)}},{key:"backfillBorder",value:function(e,t,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var r=t*this.dim,i=t*this.dim+this.dim,a=n*this.dim,o=n*this.dim+this.dim;switch(t){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:a=o-1;break;case 1:o=a+1}for(var s=-t*this.dim,l=-n*this.dim,c=a;cthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this}},{key:"has",value:function(e){return e.wrapped().key in this.data}},{key:"getAndRemove",value:function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}},{key:"_getAndRemoveByKey",value:function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}},{key:"getByKey",value:function(e){var t=this.data[e];return t?t[0].value:null}},{key:"get",value:function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}},{key:"remove",value:function(e,t){if(!this.has(e))return this;var n=e.wrapped().key,r=void 0===t?0:this.data[n].indexOf(t),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this}},{key:"setMaxSize",value:function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}},{key:"filter",value:function(e){var t=[];for(var n in this.data){var r,i=h(this.data[n]);try{for(i.s();!(r=i.n()).done;){var a=r.value;e(a.value)||t.push(a)}}catch(c){i.e(c)}finally{i.f()}}for(var o=0,s=t;o1||(Math.abs(n)>1&&(1===Math.abs(n+i)?n+=i:1===Math.abs(n-i)&&(n-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,n,r),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}}}},{key:"getTile",value:function(e){return this.getTileByID(e.key)}},{key:"getTileByID",value:function(e){return this._tiles[e]}},{key:"_retainLoadedChildren",value:function(e,t,n,r){for(var i in this._tiles){var a=this._tiles[i];if(!(r[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>n)){for(var o=a.tileID;a&&a.tileID.overscaledZ>t+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){r[o.key]=o;break}}}}},{key:"findLoadedParent",value:function(e,t){if(e.key in this._loadedParentTiles){var n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=t?n:null}for(var r=e.overscaledZ-1;r>=t;r--){var i=e.scaledTo(r),a=this._getLoadedTile(i);if(a)return a}}},{key:"_getLoadedTile",value:function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}},{key:"updateCacheSize",value:function(e,t){t=t||this._source.tileSize;var n=Math.ceil(e.width/t)+1,r=Math.ceil(e.height/t)+1,i=Math.floor(n*r*5),a="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,i):i,o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,a):a;this._cache.setMaxSize(o)}},{key:"handleWrapJump",value:function(e){var t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){var n={};for(var r in this._tiles){var i=this._tiles[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),n[i.tileID.key]=i}for(var a in this._tiles=n,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var o in this._tiles)this._setTileReloadTimer(+o,this._tiles[o])}}},{key:"update",value:function(e,t,r){var i=this;if(this.transform=e,this._sourceLoaded&&!this._paused&&!this.transform.freezeTileCoverage&&(!this.usedForTerrain||r)){var a;this.updateCacheSize(e,t),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new Ef(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(a=e.coveringTiles({tileSize:t||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!r,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(a=a.filter((function(e){return i._source.hasTile(e)})))):a=[];var o=this._updateRetainedTiles(a);if(Mm(this._source.type)&&0!==a.length){for(var s={},l={},c=0,u=Object.keys(o);cv;){_=_.scaledTo(_.overscaledZ-1);var x=this._tiles[_.key];if(x&&x.hasData()&&l[_.key]){o[y]=g.tileID;break}}}for(var b in s)o[b]||(this._coveredTiles[b]=!0,o[b]=s[b])}for(var w in o)this._tiles[w].clearFadeHold();var k,z=function(e,t){var n=[];for(var r in e)r in t||n.push(r);return n}(this._tiles,o),M=h(z);try{for(M.s();!(k=M.n()).done;){var T=k.value,S=this._tiles[T];S.hasSymbolBuckets&&!S.holdingForFade()?S.setHoldDuration(this.map._fadeDuration):S.hasSymbolBuckets&&!S.symbolFadeFinished()||this._removeTile(+T)}}catch(E){M.e(E)}finally{M.f()}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}}},{key:"releaseSymbolFadeTiles",value:function(){for(var e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}},{key:"_updateRetainedTiles",value:function(e){var t={};if(0===e.length)return t;var r,i={},a=e.reduce((function(e,t){return Math.min(e,t.overscaledZ)}),1/0),o=e[0].overscaledZ,s=Math.max(o-n.maxOverzooming,this._source.minzoom),l=Math.max(o+n.maxUnderzooming,this._source.minzoom),c={},u=h(e);try{for(u.s();!(r=u.n()).done;){var f=r.value,d=this._addTile(f);t[f.key]=f,d.hasData()||a=this._source.maxzoom){var g=v.children(this._source.maxzoom)[0],_=this.getTile(g);if(_&&_.hasData()){t[g.key]=g;continue}}else{var x=v.children(this._source.maxzoom);if(t[x[0].key]&&t[x[1].key]&&t[x[2].key]&&t[x[3].key])continue}for(var b=y.wasRequested(),w=v.overscaledZ-1;w>=s;--w){var k=v.scaledTo(w);if(i[k.key])break;if(i[k.key]=!0,!(y=this.getTile(k))&&b&&(y=this._addTile(k)),y&&(t[k.key]=k,b=y.wasRequested(),y.hasData()))break}}}}catch(z){m.e(z)}finally{m.f()}return t}},{key:"_updateLoadedParentTileCache",value:function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],n=void 0,r=this._tiles[e].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){n=this._loadedParentTiles[r.key];break}t.push(r.key);var i=r.scaledTo(r.overscaledZ-1);if(n=this._getLoadedTile(i))break;r=i}for(var a=0,o=t;a0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}},{key:"clearTiles",value:function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}},{key:"tilesIn",value:function(e,t,n){var r=[],i=this.transform;if(!i)return r;var a="globe"===i.projection.name,o=ic(i.center.lng);for(var s in this._tiles){var l=this._tiles[s];if(n&&l.clearQueryDebugViz(),!l.holdingForFade()){var c=void 0;if(a){var f=l.tileID.canonical;if(0===f.z){var d=[Math.abs(j.apply(void 0,[o].concat(u(Tm(f,-1))))-o),Math.abs(j.apply(void 0,[o].concat(u(Tm(f,1))))-o)];c=[0,2*d.indexOf(Math.min.apply(Math,d))-1]}else{var p=[Math.abs(j.apply(void 0,[o].concat(u(Tm(f,-1))))-o),Math.abs(j.apply(void 0,[o].concat(u(Tm(f,0))))-o),Math.abs(j.apply(void 0,[o].concat(u(Tm(f,1))))-o)];c=[p.indexOf(Math.min.apply(Math,p))-1]}}else c=[0];var m,v=h(c);try{for(v.s();!(m=v.n()).done;){var y=m.value,g=e.containsTile(l,i,t,y);g&&r.push(g)}}catch(_){v.e(_)}finally{v.f()}}}return r}},{key:"getVisibleCoordinates",value:function(e){var t,n=this,r=this.getRenderableIds(e).map((function(e){return n._tiles[e].tileID})),i=h(r);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.projMatrix=this.transform.calculateProjMatrix(a.toUnwrapped())}}catch(o){i.e(o)}finally{i.f()}return r}},{key:"hasTransition",value:function(){if(this._source.hasTransition())return!0;if(Mm(this._source.type))for(var e in this._tiles){var t=this._tiles[e];if(void 0!==t.fadeEndTime&&t.fadeEndTime>=lt.now())return!0}return!1}},{key:"setFeatureState",value:function(e,t,n){this._state.updateState(e=e||"_geojsonTileLayer",t,n)}},{key:"removeFeatureState",value:function(e,t,n){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,n)}},{key:"getFeatureState",value:function(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}},{key:"setDependencies",value:function(e,t,n){var r=this._tiles[e];r&&r.setDependencies(t,n)}},{key:"reloadTilesForDependencies",value:function(e,t){for(var n in this._tiles)this._tiles[n].hasDependency(e,t)&&this._reloadTile(+n,"reloading");this._cache.filter((function(n){return!n.hasDependency(e,t)}))}},{key:"_preloadTiles",value:function(e,t){var n=this;if(this._sourceLoaded){var r,i=new Map,a=Array.isArray(e)?e:[e],o=this.map.painter.terrain,s=this.usedForTerrain&&o?o.getScaledDemTileSize():this._source.tileSize,l=h(a);try{for(l.s();!(r=l.n()).done;){var c,u=r.value,f=u.coveringTiles({tileSize:s,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),d=h(f);try{for(d.s();!(c=d.n()).done;){var p=c.value;i.set(p.key,p)}}catch(v){d.e(v)}finally{d.f()}this.usedForTerrain&&u.updateElevation(!1)}}catch(v){l.e(v)}finally{l.f()}Z(Array.from(i.values()),(function(e,t){var r=new tm(e,n._source.tileSize*e.overscaleFactor(),n.transform.tileZoom,n.map.painter,n._isRaster);n._loadTile(r,(function(e){"raster-dem"===n._source.type&&r.dem&&n._backfillDEM(r),t(e,r)}))}),t)}else{var m=function r(){n._sourceLoaded&&(n._source.off("data",r),n._preloadTiles(e,t))};this._source.on("data",m)}}}]),n}(dt);function zm(e,t){var n=Math.abs(2*e.wrap)-+(e.wrap<0),r=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-n||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Mm(e){return"raster"===e||"image"===e||"video"===e||"custom"===e}function Tm(e,t){var n=1<5&&void 0!==arguments[5]?arguments[5]:0,o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i,a);for(var s=this.grid,l=0;l=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}}},{key:"loadVTLayers",value:function(){if(!this.vtLayers)for(var e in this.vtLayers=new of(new Eh(this.rawTileData)).layers,this.sourceLayerCoder=new Pp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={},this.vtLayers)this.vtFeatures[e]=[];return this.vtLayers}},{key:"query",value:function(e,t,n,r){var i=this;this.loadVTLayers();var a=e.params||{},o=Mi(a.filter),s=e.tileResult,l=e.transform,c=s.bufferedTilespaceBounds,u=this.grid.query(c.min.x,c.min.y,c.max.x,c.max.y,(function(e,t,n,r){return Rc(s.bufferedTilespaceGeometry,e,t,n,r)}));u.sort(Am);var f=null;l.elevation&&u.length>0&&(f=Sm.create(l.elevation,this.tileID));for(var h,d={},p=function(){var l=u[m];if(l===h)return 1;h=l;var c=i.featureIndexArray.get(l),p=null;i.loadMatchingFeature(d,c,o,a.layers,a.availableImages,t,n,r,(function(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return p||(p=xc(t,i.tileID.canonical,e.tileTransform)),n.queryIntersectsFeature(s,t,r,p,i.z,e.transform,e.pixelPosMatrix,f,a)}))},m=0;m=0)return!0;return!1}(r,d)){var p=this.sourceLayerCoder.decode(f),m=this.vtLayers[p].feature(c);if(n.needGeometry){var v=bc(m,!0);if(!n.filter(new Oa(this.tileID.overscaledZ),v,this.tileID.canonical))return}else if(!n.filter(new Oa(this.tileID.overscaledZ),m))return;for(var y=this.getId(m,p),g=0;g1&&(s=e[++o]);var c=Math.abs(l-s.left),u=Math.abs(l-s.right),f=Math.min(c,u),h=void 0,d=i/n*(r+1);if(s.isDash){var p=r-Math.abs(d);h=Math.sqrt(f*f+p*p)}else h=r-Math.sqrt(f*f+d*d);this.image.data[a+l]=Math.max(0,Math.min(255,h+128))}}},{key:"addRegularDash",value:function(e,t){for(var n=e.length-1;n>=0;--n){var r=e[n],i=e[n+1];r.zeroLength?e.splice(n,1):i&&i.isDash===r.isDash&&(i.left=r.left,e.splice(n,1))}var a=e[0],o=e[e.length-1];a.isDash===o.isDash&&(a.left=o.left-this.width,o.right=a.right+this.width);for(var s=this.width*this.nextRow,l=0,c=e[l],u=0;u1&&(c=e[++l]);var f=Math.abs(u-c.left),h=Math.abs(u-c.right),d=Math.min(f,h);this.image.data[s+u]=Math.max(0,Math.min(255,(c.isDash?d:-d)+t+128))}}},{key:"addDash",value:function(e,t){var n=this.getKey(e,t);if(this.positions[n])return this.positions[n];var r="round"===t,i=r?7:0,a=2*i+1;if(this.nextRow+a>this.height)return ie("LineAtlas out of space"),null;0===e.length&&e.push(1);for(var o=0,s=0;s=I.maxzoom||"none"!==I.visibility&&(Rm(A,this.zoom,n),(d[I.id]=I.createBucket({index:s.bucketLayerIDs.length,layers:A,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:k,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:n})).populate(z,m,this.tileID.canonical,this.tileTransform),s.bucketLayerIDs.push(A.map((function(e){return e.id}))))}}catch(B){C.e(B)}finally{C.f()}}}}p.trim();var P={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},L=function(){if(l)return i(l);if(c&&u&&f){var e=new Lm(c),t=new Bh(u,f);for(var r in d){var o=d[r];o instanceof gp?(Rm(o.layers,a.zoom,n),Id(o,c,e.positions,u,t.iconPositions,a.showCollisionBoxes,n,a.tileID.canonical,a.tileZoom,a.projection)):o.hasPattern&&(o instanceof Nf||o instanceof Vu||o instanceof pf)&&(Rm(o.layers,a.zoom,n),o.addFeatures(m,a.tileID.canonical,t.patternPositions,n,a.tileTransform))}a.status="done",i(null,{buckets:G(d).filter((function(e){return!e.isEmpty()})),featureIndex:s,collisionBoxArray:a.collisionBoxArray,glyphAtlasImage:e.image,lineAtlas:p,imageAtlas:t,glyphMap:a.returnDependencies?c:null,iconMap:a.returnDependencies?u:null,glyphPositions:a.returnDependencies?e.positions:null})}},D=ee(m.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(D).length?r.send("getGlyphs",{uid:this.uid,stacks:D},(function(e,t){l||(l=e,c=t,L())}),void 0,!1,P):c={};var R=Object.keys(m.iconDependencies);R.length?r.send("getImages",{icons:R,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){l||(l=e,u=t,L())}),void 0,!1,P):u={};var O=Object.keys(m.patternDependencies);O.length?r.send("getImages",{icons:O,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){l||(l=e,f=t,L())}),void 0,!1,P):f={},L()}}]),e}();function Rm(e,t,n){var r,i=new Oa(t),a=h(e);try{for(a.s();!(r=a.n()).done;)r.value.recalculate(i,n)}catch(o){a.e(o)}finally{a.f()}}var Om=function(){function e(t){d(this,e),this.entries={},this.scheduler=t}return p(e,[{key:"request",value:function(e,t,n,r){var i=this,a=this.entries[e]=this.entries[e]||{callbacks:[]};if(a.result){var o=f(a.result,2),s=o[0],l=o[1];return this.scheduler?this.scheduler.add((function(){r(s,l)}),t):r(s,l),function(){}}return a.callbacks.push(r),a.cancel||(a.cancel=n((function(n,r){a.result=[n,r];var o,s=h(a.callbacks);try{var l=function(){var e=o.value;i.scheduler?i.scheduler.add((function(){e(n,r)}),t):e(n,r)};for(s.s();!(o=s.n()).done;)l()}catch(c){s.e(c)}finally{s.f()}setTimeout((function(){return delete i.entries[e]}),3e3)}))),function(){a.result||(a.callbacks=a.callbacks.filter((function(e){return e!==r})),a.callbacks.length||(a.cancel(),delete i.entries[e]))}}}]),e}();function Bm(e,t,n){var r=JSON.stringify(e.request);return e.data&&(this.deduped.entries[r]={result:[null,e.data]}),this.deduped.request(r,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom},(function(t){var r=Te(e.request,(function(e,r,i,a){e?t(e):r&&t(null,{vectorTile:n?void 0:new of(new Eh(r)),rawData:r,cacheControl:i,expires:a})}));return function(){r.cancel(),t()}}),t)}var Nm=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Fm=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,i=arguments.length>3?arguments[3]:void 0;if(d(this,e),isNaN(t)||t<0)throw new Error("Unpexpected numItems value: ".concat(t,"."));this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;var a=Nm.indexOf(this.ArrayType),o=2*t*this.ArrayType.BYTES_PER_ELEMENT,s=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-s%8)%8;if(a<0)throw new Error("Unexpected typed array class: ".concat(r,"."));i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+s+l,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+o+s+l),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+s+l,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+a]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}return p(e,[{key:"add",value:function(e,t){var n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}},{key:"finish",value:function(){var e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return Vm(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}},{key:"range",value:function(e,t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var i=this.ids,a=this.coords,o=this.nodeSize,s=[0,i.length-1,0],l=[];s.length;){var c=s.pop()||0,u=s.pop()||0,f=s.pop()||0;if(u-f<=o)for(var h=f;h<=u;h++){var d=a[2*h],p=a[2*h+1];d>=e&&d<=n&&p>=t&&p<=r&&l.push(i[h])}else{var m=f+u>>1,v=a[2*m],y=a[2*m+1];v>=e&&v<=n&&y>=t&&y<=r&&l.push(i[m]),(0===c?e<=v:t<=y)&&(s.push(f),s.push(m-1),s.push(1-c)),(0===c?n>=v:r>=y)&&(s.push(m+1),s.push(u),s.push(1-c))}}return l}},{key:"within",value:function(e,t,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var r=this.ids,i=this.coords,a=this.nodeSize,o=[0,r.length-1,0],s=[],l=n*n;o.length;){var c=o.pop()||0,u=o.pop()||0,f=o.pop()||0;if(u-f<=a)for(var h=f;h<=u;h++)Zm(i[2*h],i[2*h+1],e,t)<=l&&s.push(r[h]);else{var d=f+u>>1,p=i[2*d],m=i[2*d+1];Zm(p,m,e,t)<=l&&s.push(r[d]),(0===c?e-n<=p:t-n<=m)&&(o.push(f),o.push(d-1),o.push(1-c)),(0===c?e+n>=p:t+n>=m)&&(o.push(d+1),o.push(u),o.push(1-c))}}return s}}],[{key:"from",value:function(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");var n=new Uint8Array(t,0,2),r=f(n,2),i=r[0],a=r[1];if(219!==i)throw new Error("Data does not appear to be in a KDBush format.");var o=a>>4;if(1!==o)throw new Error("Got v".concat(o," data when expected v1."));var s=Nm[15&a];if(!s)throw new Error("Unrecognized array type.");var l=new Uint16Array(t,2,1),c=f(l,1)[0],u=new Uint32Array(t,4,1);return new e(f(u,1)[0],c,s,t)}}]),e}();function Vm(e,t,n,r,i,a){if(!(i-r<=n)){var o=r+i>>1;jm(e,t,o,r,i,a),Vm(e,t,n,r,o-1,1-a),Vm(e,t,n,o+1,i,1-a)}}function jm(e,t,n,r,i,a){for(;i>r;){if(i-r>600){var o=i-r+1,s=n-r+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);jm(e,t,n,Math.max(r,Math.floor(n-s*c/o+u)),Math.min(i,Math.floor(n+(o-s)*c/o+u)),a)}var f=t[2*n+a],h=r,d=i;for(Um(e,t,r,n),t[2*i+a]>f&&Um(e,t,r,i);hf;)d--}t[2*r+a]===f?Um(e,t,r,d):Um(e,t,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}function Um(e,t,n,r){Hm(e,n,r),Hm(t,2*n,2*r),Hm(t,2*n+1,2*r+1)}function Hm(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Zm(e,t,n,r){var i=e-n,a=t-r;return i*i+a*a}e.ARRAY_TYPE=Ms,e.AUTH_ERR_MSG=Pe,e.Aabb=gl,e.Actor=function(){function e(t,n,r){d(this,e),this.target=t,this.parent=n,this.mapId=r,this.callbacks={},this.cancelCallbacks={},J(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=se()?t:g,this.scheduler=new Ip}return p(e,[{key:"send",value:function(e,t,n,r){var i=this,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5?arguments[5]:void 0,s=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(n.metadata=o,this.callbacks[s]=n);var l=ue(this.globalScope)?void 0:[];return this.target.postMessage({id:s,type:e,hasCallback:!!n,targetMapId:r,mustQueue:a,sourceMapId:this.mapId,data:da(t,l)},l),{cancel:function(){n&&delete i.callbacks[s],i.target.postMessage({id:s,type:"",targetMapId:r,sourceMapId:i.mapId})}}}},{key:"receive",value:function(e){var t=this,n=e.data,r=n.id;if(r&&(!n.targetMapId||this.mapId===n.targetMapId))if(""===n.type){var i=this.cancelCallbacks[r];delete this.cancelCallbacks[r],i&&i.cancel()}else if(n.mustQueue||se()){var a=this.callbacks[r];this.cancelCallbacks[r]=this.scheduler.add((function(){return t.processTask(r,n)}),a&&a.metadata||{type:"message"})}else this.processTask(r,n)}},{key:"processTask",value:function(e,t){var n=this;if(""===t.type){var r=this.callbacks[e];delete this.callbacks[e],r&&(t.error?r(pa(t.error)):r(null,pa(t.data)))}else{var i=ue(this.globalScope)?void 0:[],a=t.hasCallback?function(t,r){delete n.cancelCallbacks[e],n.target.postMessage({id:e,type:"",sourceMapId:n.mapId,error:t?da(t):null,data:da(r,i)},i)}:function(e){},o=pa(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,o,a);else if(this.parent.getWorkerSource){var s=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,s[0],o.source)[s[1]](o,a)}else a(new Error("Could not find function ".concat(t.type)))}}},{key:"remove",value:function(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}]),e}(),e.CanonicalTileID=Tf,e.Color=Gt,e.ColorMode=_m,e.CullFaceMode=wm,e.DEMData=pm,e.DataConstantProperty=Ga,e.DedupedRequest=Om,e.DepthMode=vm,e.EXTENT=ws,e.Elevation=function(){function e(){d(this,e)}return p(e,[{key:"isDataAvailableAtPoint",value:function(e){var t=this._source();if(this.isUsingMockSource()||!t||e.y<0||e.y>1)return!1;var n=t.getSource().maxzoom,r=1<1&&void 0!==arguments[1]?arguments[1]:0;return this.getAtPoint(e,t)||0}},{key:"getAtPoint",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.isUsingMockSource())return null;null==t&&(t=null);var r=this._source();if(!r)return t;if(e.y<0||e.y>1)return t;var i=r.getSource().maxzoom,a=1<this._skuTokenExpiresAt}},{key:"transformRequest",value:function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}},{key:"normalizeStyleURL",value:function(e,t){if(!Le(e))return e;var n=Fe(e);return n.path="/styles/v1".concat(n.path),this._makeAPIURL(n,this._customAccessToken||t)}},{key:"normalizeGlyphsURL",value:function(e,t){if(!Le(e))return e;var n=Fe(e);return n.path="/fonts/v1".concat(n.path),this._makeAPIURL(n,this._customAccessToken||t)}},{key:"normalizeSourceURL",value:function(e,t,n,r){if(!Le(e))return e;var i=Fe(e);return i.path="/v4/".concat(i.authority,".json"),i.params.push("secure"),n&&i.params.push("language=".concat(n)),r&&i.params.push("worldview=".concat(r)),this._makeAPIURL(i,this._customAccessToken||t)}},{key:"normalizeSpriteURL",value:function(e,t,n,r){var i=Fe(e);return Le(e)?(i.path="/styles/v1".concat(i.path,"/sprite").concat(t).concat(n),this._makeAPIURL(i,this._customAccessToken||r)):(i.path+="".concat(t).concat(n),Ve(i))}},{key:"normalizeTileURL",value:function(e,t,n){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!Le(e))return e;var r=Fe(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,"".concat(t||n&&"raster"!==r.authority&&512===n?"@2x":"").concat(b.supported?".webp":"$1")),"raster"===r.authority?r.path="/".concat(x.RASTER_URL_PREFIX).concat(r.path):(r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/".concat(x.TILE_URL_VERSION).concat(r.path));var i=this._customAccessToken||function(e){var t,n=h(e);try{for(n.s();!(t=n.n()).done;){var r=t.value.match(/^access_token=(.*)$/);if(r)return r[1]}}catch(i){n.e(i)}finally{n.f()}return null}(r.params)||x.ACCESS_TOKEN;return x.REQUIRE_ACCESS_TOKEN&&i&&this._skuToken&&r.params.push("sku=".concat(this._skuToken)),this._makeAPIURL(r,i)}},{key:"canonicalizeTileURL",value:function(e,t){var n=Fe(e);if(!n.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!n.path.match(/\.[\w]+$/))return e;var r="mapbox://";n.path.match(/^\/raster\/v1\//)?r+="raster/".concat(n.path.replace("/".concat(x.RASTER_URL_PREFIX,"/"),"")):r+="tiles/".concat(n.path.replace("/".concat(x.TILE_URL_VERSION,"/"),""));var i=n.params;return t&&(i=i.filter((function(e){return!e.match(/^access_token=/)}))),i.length&&(r+="?".concat(i.join("&"))),r}},{key:"canonicalizeTileset",value:function(e,t){var n,r=!!t&&Le(t),i=[],a=h(e.tiles||[]);try{for(a.s();!(n=a.n()).done;){var o=n.value;De(o)?i.push(this.canonicalizeTileURL(o,r)):i.push(o)}}catch(s){a.e(s)}finally{a.f()}return i}},{key:"_makeAPIURL",value:function(e,t){var n="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",r=Fe(x.API_URL);if(e.protocol=r.protocol,e.authority=r.authority,"http"===e.protocol){var i=e.params.indexOf("secure");i>=0&&e.params.splice(i,1)}if("/"!==r.path&&(e.path="".concat(r.path).concat(e.path)),!x.REQUIRE_ACCESS_TOKEN)return Ve(e);if(t=t||x.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error("An API access token is required to use Mapbox GL. ".concat(n));if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ".concat(n))}return e.params=e.params.filter((function(e){return-1===e.indexOf("access_token")})),e.params.push("access_token=".concat(t||"")),Ve(e)}}]),e}(),e.ResourceType=we,e.SegmentVector=bs,e.SourceCache=km,e.StencilMode=gm,e.StructArrayLayout1ui2=Mo,e.StructArrayLayout2f1f2i16=mo,e.StructArrayLayout2i4=to,e.StructArrayLayout2ui4=zo,e.StructArrayLayout3f12=yo,e.StructArrayLayout3ui6=go,e.StructArrayLayout4i8=ro,e.StructArrayLayout5f20=wo,e.Texture=Cp,e.Tile=tm,e.Transitionable=Fa,e.Uniform1f=Jo,e.Uniform1i=function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e)).current=0,r}return p(n,[{key:"set",value:function(e,t,n){this.fetchUniformLocation(e,t)&&this.current!==n&&(this.current=n,this.gl.uniform1i(this.location,n))}}]),n}($o),e.Uniform2f=function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e)).current=[0,0],r}return p(n,[{key:"set",value:function(e,t,n){this.fetchUniformLocation(e,t)&&(n[0]===this.current[0]&&n[1]===this.current[1]||(this.current=n,this.gl.uniform2f(this.location,n[0],n[1])))}}]),n}($o),e.Uniform3f=function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e)).current=[0,0,0],r}return p(n,[{key:"set",value:function(e,t,n){this.fetchUniformLocation(e,t)&&(n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]||(this.current=n,this.gl.uniform3f(this.location,n[0],n[1],n[2])))}}]),n}($o),e.Uniform4f=Qo,e.UniformColor=es,e.UniformMatrix2f=function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e)).current=rs,r}return p(n,[{key:"set",value:function(e,t,n){if(this.fetchUniformLocation(e,t))for(var r=0;r<4;r++)if(n[r]!==this.current[r]){this.current=n,this.gl.uniformMatrix2fv(this.location,!1,n);break}}}]),n}($o),e.UniformMatrix3f=function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e)).current=ns,r}return p(n,[{key:"set",value:function(e,t,n){if(this.fetchUniformLocation(e,t))for(var r=0;r<9;r++)if(n[r]!==this.current[r]){this.current=n,this.gl.uniformMatrix3fv(this.location,!1,n);break}}}]),n}($o),e.UniformMatrix4f=function(e){m(n,e);var t=v(n);function n(e){var r;return d(this,n),(r=t.call(this,e)).current=ts,r}return p(n,[{key:"set",value:function(e,t,n){if(this.fetchUniformLocation(e,t)){if(n[12]!==this.current[12]||n[0]!==this.current[0])return this.current=n,void this.gl.uniformMatrix4fv(this.location,!1,n);for(var r=1;r<16;r++)if(n[r]!==this.current[r]){this.current=n,this.gl.uniformMatrix4fv(this.location,!1,n);break}}}}]),n}($o),e.UnwrappedTileID=Sf,e.ValidationError=vi,e.VectorTileFeature=sf,e.VectorTileWorkerSource=function(e){m(n,e);var t=v(n);function n(e,r,i,a,o){var s;return d(this,n),(s=t.call(this)).actor=e,s.layerIndex=r,s.availableImages=i,s.loadVectorData=o||Bm,s.loading={},s.loaded={},s.deduped=new Om(e.scheduler),s.isSpriteLoaded=a,s.scheduler=e.scheduler,s}return p(n,[{key:"loadTile",value:function(e,t){var n=this,r=e.uid,i=e&&e.request,a=i&&i.collectResourceTiming,o=this.loading[r]=new Dm(e);o.abort=this.loadVectorData(e,(function(s,l){var c=!n.loading[r];if(delete n.loading[r],c||s||!l)return o.status="done",c||(n.loaded[r]=o),t(s);var u=l.rawData,f={};l.expires&&(f.expires=l.expires),l.cacheControl&&(f.cacheControl=l.cacheControl),o.vectorTile=l.vectorTile||new of(new Eh(u));var h=function(){o.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return t(e);var r={};if(a){var o=st(i);o.length>0&&(r.resourceTiming=JSON.parse(JSON.stringify(o)))}t(null,q({rawTileData:u.slice(0)},n,f,r))}))};n.isSpriteLoaded?h():n.once("isSpriteLoaded",(function(){n.scheduler?n.scheduler.add(h,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom}):h()})),n.loaded=n.loaded||{},n.loaded[r]=o}))}},{key:"reloadTile",value:function(e,t){var n=this,r=this.loaded,i=e.uid,a=this;if(r&&r[i]){var o=r[i];o.showCollisionBoxes=e.showCollisionBoxes,o.enableTerrain=!!e.enableTerrain,o.projection=e.projection,o.tileTransform=Ud(e.tileID.canonical,e.projection);var s=function(e,r){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,n.availableImages,a.actor,i)),t(e,r)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}}},{key:"abortTile",value:function(e,t){var n=e.uid,r=this.loading[n];r&&(r.abort&&r.abort(),delete this.loading[n]),t()}},{key:"removeTile",value:function(e,t){var n=this.loaded,r=e.uid;n&&n[r]&&delete n[r],t()}}]),n}(dt),e.WritingMode=Nh,e.ZoomDependentExpression=hi,e.add=Us,e.addDynamicAttributes=pp,e.adjoint=function(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=o*u-s*c,e[1]=i*c-r*u,e[2]=r*s-i*o,e[3]=s*l-a*u,e[4]=n*u-i*l,e[5]=i*a-n*s,e[6]=a*c-o*l,e[7]=r*l-n*c,e[8]=n*o-r*a,e},e.asyncAll=Z,e.bezier=F,e.bindAll=J,e.boundsAttributes=Qp,e.bufferConvexPolygon=function(e,t){for(var n=[],r=0;rye&&(e.getActor().send("enforceCacheSizeLimit",ve),be=0)},e.calculateGlobeLabelMatrix=function(e,t){var n=e.point,r=ql(n.x,n.y,e.worldSize/e._pixelsPerMercatorPixel,0,0);return As(r,r,Gl(Pl(t)))},e.calculateGlobeMatrix=function(e){var t=e.point,n=t.x,r=t.y,i=e._center,a=i.lng,o=i.lat;return ql(n,r,e.worldSize,a,o)},e.calculateGlobeMercatorMatrix=function(e){var t=e.pixelsPerMeter,n=t/oc(1,e.center.lat),r=Es(new Float64Array(16));return Is(r,r,[e.point.x,e.point.y,0]),Ps(r,r,[n,n,t]),Float32Array.from(r)},e.circumferenceAtLatitude=rc,e.clamp=j,e.clearTileCache=function(e){if(ge()){var t=g.caches.delete(me);e&&t.catch(e).then((function(){return e()}))}},e.clipLine=ld,e.clone=function(e){var t=new Ms(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.clone$1=ne,e.collisionCircleLayout=Yf,e.config=x,e.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},e.create=function(){var e=new Ms(16);return Ms!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=Ts,e.createExpression=ui,e.createLayout=Qa,e.createStyleLayer=function(e){return"custom"===e.type?new Mp(e):new Ep[e.type](e)},e.cross=$s,e.degToRad=R,e.distance=function(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])},e.div=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e},e.dot=Ks,e.earthRadius=Ql,e.ease=V,e.easeCubicInOut=N,e.ecefToLatLng=function(e){var t=f(e,3),n=t[0],r=t[1],i=t[2],a=Math.hypot(n,r,i),o=Math.atan2(n,i),s=.5*Math.PI-Math.acos(-r/a);return new nc(O(o),O(s))},e.emitValidationErrors=ra,e.endsWith=Q,e.enforceCacheSizeLimit=function(e){_e(),de&&de.then((function(t){t.keys().then((function(n){for(var r=0;ra&&(r+=(e[i]-a)*(e[i]-a)),t[i]0){var p=180/r;Ss(d,d,[p/c+1,0,0,0,p/u+1,0,-.5*p/f,.5*p/h,1])}return d[2]=l,d[5]=e.x,d[8]=e.y,d},e.getImage=Ie,e.getJSON=function(e,t){return Me(q(e,{type:"json"}),t)},e.getLatitudinalLod=function(e){var t=uc-5;e=j(e,-t,t)/t*90;var n=Math.pow(Math.abs(Math.sin(R(e))),3);return Math.round(n*(zl.length-1))},e.getMapSessionAPI=$e,e.getPerformanceMeasurement=st,e.getProjection=cp,e.getRTLTextPluginStatus=La,e.getReferrer=ze,e.getTilePoint=function(e,t){var n=t.x,r=t.y;return new P(((n-(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0))*e.scale-e.x)*ws,(r*e.scale-e.y)*ws)},e.getTileVec3=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return js(((t.x-n)*e.scale-e.x)*ws,(t.y*e.scale-e.y)*ws,cc(t.z,t.y))},e.getVideo=function(e,t){var n=g.document.createElement("video");n.muted=!0,n.onloadstart=function(){t(null,n)};for(var r=0;r0;return 0===r&&!i&&!o&&a},e.identity=Es,e.identity$1=ll,e.invert=Cs,e.isFullscreen=function(){return!!g.document.fullscreenElement||!!g.document.webkitFullscreenElement},e.isLngLatBehindGlobe=Yl,e.isMapAuthenticated=function(e){return Je.has(e)},e.isMapboxURL=Le,e.isSafariWithAntialiasingBug=function(e){var t=e.navigator?e.navigator.userAgent:null;return!!ue(e)&&t&&(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},e.latFromMercatorY=lc,e.latLngToECEF=Vl,e.len=rl,e.length=Vs,e.length$1=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},e.lngFromMercatorX=sc,e.loadVectorTile=Bm,e.makeRequest=Me,e.mapValue=function(e,t,n,r,i){return j((e-t)/(n-t)*(i-r)+r,r,i)},e.mercatorScale=fc,e.mercatorXfromLng=ic,e.mercatorYfromLat=ac,e.mercatorZfromAltitude=oc,e.mul=Bs,e.mul$1=nl,e.multiply=As,e.multiply$1=Ss,e.multiply$2=Zs,e.nextPowerOfTwo=K,e.normalize=Ys,e.normalize$1=fl,e.normalize$2=al,e.number=qn,e.ortho=function(e,t,n,r,i,a,o){var s=1/(t-n),l=1/(r-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(o+a)*c,e[15]=1,e},e.pbf=oh,e.perspective=function(e,t,n,r,i){var a,o=1/Math.tan(t/2);return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+r)*(a=1/(r-i)),e[14]=2*i*r*a):(e[10]=-1,e[14]=-2*r),e},e.pick=function(e,t){for(var n={},r=0;r0&&n[0]<=e.width&&n[1]>0&&n[1]<=e.height&&!Yl(e,new nc(e.center.lat,90)),r[0]>0&&r[0]<=e.width&&r[1]>0&&r[1]<=e.height&&!Yl(e,new nc(e.center.lat,-90))]},e.polygonContainsPoint=Dc,e.polygonIntersectsBox=Rc,e.polygonIntersectsPolygon=Mc,e.polygonizeBounds=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=new P(n,n),a=e.sub(i),o=t.add(i),s=[a,new P(o.x,a.y),o,new P(a.x,o.y)];return r&&s.push(a.clone()),s},e.posAttributes=pl,e.postMapLoadEvent=We,e.postPerformanceEvent=Ye,e.postTurnstileEvent=Ge,e.potpack=Dh,e.prevPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},e.radToDeg=O,e.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.registerForPluginStateChange=function(e){return e({pluginStatus:Ea,pluginURL:Ca}),Pa.on("pluginStateChange",e),e},e.removeAuthState=function(e){Je.delete(e)},e.renderColorRamp=tu,e.resample=pc,e.rotateX=Ls,e.rotateX$1=cl,e.rotateY=Ds,e.rotateY$1=ul,e.rotateZ=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*r,e[1]=o*i+u*r,e[2]=s*i+f*r,e[3]=l*i+h*r,e[4]=c*i-a*r,e[5]=u*i-o*r,e[6]=f*i-s*r,e[7]=h*i-l*r,e},e.rotateZ$1=function(e,t,n){n*=.5;var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+i*s,e[1]=i*l-r*s,e[2]=a*l+o*s,e[3]=o*l-a*s,e},e.scale=Ps,e.scale$1=il,e.scale$2=Ws,e.scaleAndAdd=Xs,e.set=function(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e},e.setCacheLimits=function(e,t){ve=e,ye=t},e.setColumn=function(e,t,n){e[4*t+0]=n[0],e[4*t+1]=n[1],e[4*t+2]=n[2],e[4*t+3]=n[3]},e.setRTLTextPlugin=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Ea===za||Ea===Ma||Ea===Ta)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ca=lt.resolveURL(e),Ea=za,Sa=t,Ia(),n||Da()},e.smoothstep=U,e.spec=pt,e.squaredLength=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r},e.storeAuthState=function(e,t){t?Je.add(e):Je.delete(e)},e.sub=tl,e.subtract=Hs,e.symbolSize=th,e.tileAABB=function(e,t,n,r,i,a,o,s,l){if("globe"===l.name)return Ol(e,t,new Tf(n,r,i));var c=Ud({z:n,x:r,y:i},l);return new gl([(a+c.x/c.scale)*t,t*(c.y/c.scale),o],[(a+c.x2/c.scale)*t,t*(c.y2/c.scale),s])},e.tileCornersToBounds=Bl,e.tileTransform=Ud,e.transformMat3=function(e,t,n){var r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e},e.transformMat4=Js,e.transformMat4$1=ol,e.transformQuat=Qs,e.transitionTileAABBinECEF=Dl,e.translate=Is,e.transpose=function(e,t){if(e===t){var n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},e.triggerPluginCompletionEvent=Aa,e.uniqueId=X,e.updateGlobeVertexNormal=function(e,t,n,r,i){var a=5*t+2;e.float32[a+0]=n,e.float32[a+1]=r,e.float32[a+2]=i},e.validateCustomStyleLayer=function(e){var t=[],n=e.id;return void 0===n&&t.push({message:"layers.".concat(n,': missing required property "id"')}),void 0===e.render&&t.push({message:"layers.".concat(n,': missing required method "render"')}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:"layers.".concat(n,': property "renderingMode" must be either "2d" or "3d"')}),t},e.validateFilter=function(e){return na(Bi(e))},e.validateFog=function(e){return na(Yi(e))},e.validateLayer=function(e){return na(Ui(e))},e.validateLight=function(e){return na(Wi(e))},e.validateSource=function(e){return na(Gi(e))},e.validateStyle=Qi,e.validateTerrain=function(e){return na(Xi(e))},e.values=G,e.vectorTile=Wu,e.version=_,e.warnOnce=ie,e.window=g,e.wrap=H})),g(["./shared"],(function(e){function t(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){var n,r="[",i=h(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;r+="".concat(t(a),",")}}catch(u){i.e(u)}finally{i.f()}return"".concat(r,"]")}var o,s="{",l=h(Object.keys(e).sort());try{for(l.s();!(o=l.n()).done;){var c=o.value;s+="".concat(c,":").concat(t(e[c]),",")}}catch(u){l.e(u)}finally{l.f()}return"".concat(s,"}")}function n(n){var r,i="",a=h(e.refProperties);try{for(a.s();!(r=a.n()).done;){var o=r.value;i+="/".concat(t(n[o]))}}catch(s){a.e(s)}finally{a.f()}return i}var r=function(){function t(e){d(this,t),this.keyCache={},e&&this.replace(e)}return p(t,[{key:"replace",value:function(e){this._layerConfigs={},this._layers={},this.update(e,[])}},{key:"update",value:function(t,r){var i,a=this,o=h(t);try{for(o.s();!(i=o.n()).done;){var s=i.value;this._layerConfigs[s.id]=s,(this._layers[s.id]=e.createStyleLayer(s)).compileFilter(),this.keyCache[s.id]&&delete this.keyCache[s.id]}}catch(b){o.e(b)}finally{o.f()}var l,c=h(r);try{for(c.s();!(l=c.n()).done;){var u=l.value;delete this.keyCache[u],delete this._layerConfigs[u],delete this._layers[u]}}catch(b){c.e(b)}finally{c.f()}this.familiesBySource={};var f,d=function(e,t){for(var r={},i=0;i=Math.abs(s)?n-l+s:s-l+n,n=l}n+r>=0!=!!t&&e.reverse()}var c=e.getDefaultExportFromCjs((function e(t,n){var r,i=t&&t.type;if("FeatureCollection"===i)for(r=0;r>31}function I(e,t){for(var n=e.loadGeometry(),r=e.type,i=0,a=0,o=n.length,s=0;s=r;v--){var y=+Date.now();m=this.trees[v]=this._createTree(this._cluster(m,v)),n&&console.log("z%d: %d clusters in %dms",v,m.numItems,+Date.now()-y)}return n&&console.timeEnd("total time"),this}},{key:"getClusters",value:function(e,t){var n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){var o=this.getClusters([n,r,180,a],t),s=this.getClusters([-180,r,i,a],t);return o.concat(s)}var l,c=this.trees[this._limitZoom(t)],u=c.range(H(n),Z(a),H(i),Z(r)),f=c.data,d=[],p=h(u);try{for(p.s();!(l=p.n()).done;){var m=l.value,v=this.stride*m;d.push(f[v+N]>1?j(f,v,this.clusterProps):this.points[f[v+B]])}}catch(y){p.e(y)}finally{p.f()}return d}},{key:"getChildren",value:function(e){var t=this._getOriginId(e),n=this._getOriginZoom(e),r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);var a=i.data;if(t*this.stride>=a.length)throw new Error(r);var o,s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),l=i.within(a[t*this.stride],a[t*this.stride+1],s),c=[],u=h(l);try{for(u.s();!(o=u.n()).done;){var f=o.value*this.stride;a[f+4]===e&&c.push(a[f+N]>1?j(a,f,this.clusterProps):this.points[a[f+B]])}}catch(d){u.e(d)}finally{u.f()}if(0===c.length)throw new Error(r);return c}},{key:"getLeaves",value:function(e,t,n){var r=[];return this._appendLeaves(r,e,t=t||10,n=n||0,0),r}},{key:"getTile",value:function(e,t,n){var r=this.trees[this._limitZoom(e)],i=Math.pow(2,e),a=this.options,o=a.extent,s=a.radius/o,l=(n-s)/i,c=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,l,(t+1+s)/i,c),r.data,t,n,i,u),0===t&&this._addTileFeatures(r.range(1-s/i,l,1,c),r.data,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,l,s/i,c),r.data,-1,n,i,u),u.features.length?u:null}},{key:"getClusterExpansionZoom",value:function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var n=this.getChildren(e);if(t++,1!==n.length)break;e=n[0].properties.cluster_id}return t}},{key:"_appendLeaves",value:function(e,t,n,r,i){var a,o=this.getChildren(t),s=h(o);try{for(s.s();!(a=s.n()).done;){var l=a.value,c=l.properties;if(c&&c.cluster?i+c.point_count<=r?i+=c.point_count:i=this._appendLeaves(e,c.cluster_id,n,r,i):i1,u=void 0,d=void 0,p=void 0;if(c)u=U(t,l,this.clusterProps),d=t[l],p=t[l+1];else{var m=this.points[t[l+B]];u=m.properties;var v=f(m.geometry.coordinates,2),y=v[0],g=v[1];d=H(y),p=Z(g)}var _={type:1,geometry:[[Math.round(this.options.extent*(d*i-n)),Math.round(this.options.extent*(p*i-r))]],tags:u},x=void 0;void 0!==(x=c||this.options.generateId?t[l+B]:this.points[t[l+B]].id)&&(_.id=x),a.features.push(_)}}catch(b){s.e(b)}finally{s.f()}}},{key:"_limitZoom",value:function(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}},{key:"_cluster",value:function(e,t){for(var n=this.options,r=n.radius,i=n.extent,a=n.reduce,o=n.minPoints,s=r/(i*Math.pow(2,t)),l=e.data,c=[],u=this.stride,f=0;ft&&(g+=l[x+N])}}catch(R){_.e(R)}finally{_.f()}if(g>y&&g>=o){var b,w=void 0,k=p*y,z=m*y,M=-1,T=((f/u|0)<<5)+(t+1)+this.points.length,S=h(v);try{for(S.s();!(b=S.n()).done;){var E=b.value*u;if(!(l[E+2]<=t)){l[E+2]=t;var C=l[E+N];k+=l[E]*C,z+=l[E+1]*C,l[E+4]=T,a&&(w||(w=this._map(l,f,!0),M=this.clusterProps.length,this.clusterProps.push(w)),a(w,this._map(l,E)))}}}catch(R){S.e(R)}finally{S.f()}l[f+4]=T,c.push(k/g,z/g,1/0,T,-1,g),a&&c.push(M)}else{for(var A=0;A1){var I,P=h(v);try{for(P.s();!(I=P.n()).done;){var L=I.value*u;if(!(l[L+2]<=t)){l[L+2]=t;for(var D=0;D>5}},{key:"_getOriginZoom",value:function(e){return(e-this.points.length)%32}},{key:"_map",value:function(e,t,n){if(e[t+N]>1){var r=this.clusterProps[e[t+F]];return n?Object.assign({},r):r}var i=this.points[e[t+B]].properties,a=this.options.map(i);return n&&a===i?Object.assign({},a):a}}]),t}();function j(e,t,n){return{type:"Feature",id:e[t+B],properties:U(e,t,n),geometry:{type:"Point",coordinates:[(r=e[t],360*(r-.5)),G(e[t+1])]}};var r}function U(e,t,n){var r=e[t+N],i=r>=1e4?"".concat(Math.round(r/1e3),"k"):r>=1e3?Math.round(r/100)/10+"k":r,a=e[t+F],o=-1===a?{}:Object.assign({},n[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+B],point_count:r,point_count_abbreviated:i})}function H(e){return e/360+.5}function Z(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function G(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function q(e,t,n,r){for(var i,a=r,o=n-t>>1,s=n-t,l=e[t],c=e[t+1],u=e[n],f=e[n+1],h=t+3;ha)i=h,a=d;else if(d===a){var p=Math.abs(h-o);pr&&(i-t>3&&q(e,t,i,r),e[i+2]=a,n-i>3&&q(e,i,n,r))}function W(e,t,n,r,i,a){var o=i-n,s=a-r;if(0!==o||0!==s){var l=((e-n)*o+(t-r)*s)/(o*o+s*s);l>1?(n=i,r=a):l>0&&(n+=o*l,r+=s*l)}return(o=e-n)*o+(s=t-r)*s}function X(e,t,n,r){var i={id:void 0===e?null:e,type:t,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,n=e.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)Y(e,t);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r0&&(o+=r?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=t.length-3;t[2]=1,q(t,0,u,n),t[u+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function Q(e,t,n,r){for(var i=0;i1?1:n}function ne(e,t,n,r,i,a,o,s){if(r/=t,a>=(n/=t)&&o=r)return null;for(var l=[],c=0;c=n&&p=r)){var m=[];if("Point"===h||"MultiPoint"===h)re(f,m,n,r,i);else if("LineString"===h)ie(f,m,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===h)oe(f,m,n,r,i,!1);else if("Polygon"===h)oe(f,m,n,r,i,!0);else if("MultiPolygon"===h)for(var v=0;v=n&&o<=r&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function ie(e,t,n,r,i,a,o){for(var s,l,c=ae(e),u=0===i?le:ce,f=e.start,h=0;hn&&(l=u(c,d,p,v,y,n),o&&(c.start=f+s*l)):g>r?_=n&&(l=u(c,d,p,v,y,n),x=!0),_>r&&g<=r&&(l=u(c,d,p,v,y,r),x=!0),!a&&x&&(o&&(c.end=f+s*l),t.push(c),c=ae(e)),o&&(f+=s)}var b=e.length-3;d=e[b],p=e[b+1],m=e[b+2],(g=0===i?d:p)>=n&&g<=r&&se(c,d,p,m),b=c.length-3,a&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&se(c,c[0],c[1],c[2]),c.length&&t.push(c)}function ae(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function oe(e,t,n,r,i,a){for(var o=0;oo.maxX&&(o.maxX=u),f>o.maxY&&(o.maxY=f)}return o}function me(e,t,n,r){var i=t.geometry,a=t.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&t.size<(i?o:r))n.numPoints+=t.length/3;else{for(var s=[],l=0;lo)&&(n.numSimplified++,s.push(t[l]),s.push(t[l+1])),n.numPoints++;i&&function(e,t){for(var n=0,r=0,i=e.length,a=i-2;r0===t)for(r=0,i=e.length;r24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(e,t){var n=[];if("FeatureCollection"===e.type)for(var r=0;r1&&console.time("creation"),h=this.tiles[f]=pe(e,t,n,r,l),this.tileCoords.push({z:t,x:n,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,n,r,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var d="z"+t;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(h.source=e,i){if(t===l.maxZoom||t===i)continue;var p=1<1&&console.time("clipping");var m,v,y,g,_,x,b=.5*l.buffer/l.extent,w=.5-b,k=.5+b,z=1+b;m=v=y=g=null,_=ne(e,u,n-b,n+k,0,h.minX,h.maxX,l),x=ne(e,u,n+w,n+z,0,h.minX,h.maxX,l),e=null,_&&(m=ne(_,u,r-b,r+k,1,h.minY,h.maxY,l),v=ne(_,u,r+w,r+z,1,h.minY,h.maxY,l),_=null),x&&(y=ne(x,u,r-b,r+k,1,h.minY,h.maxY,l),g=ne(x,u,r+w,r+z,1,h.minY,h.maxY,l),x=null),c>1&&console.timeEnd("clipping"),s.push(m||[],t+1,2*n,2*r),s.push(v||[],t+1,2*n,2*r+1),s.push(y||[],t+1,2*n+1,2*r),s.push(g||[],t+1,2*n+1,2*r+1)}}},ye.prototype.getTile=function(e,t,n){var r=this.options,i=r.extent,a=r.debug;if(e<0||e>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",e,t,n);for(var l,c=e,u=t,f=n;!l&&c>0;)c--,u=Math.floor(u/2),f=Math.floor(f/2),l=this.tiles[ge(c,u,f)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,f),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,f,e,t,n),a>1&&console.timeEnd("drilling down"),this.tiles[s]?he(this.tiles[s],i):null):null};var xe=function(t){m(r,t);var n=v(r);function r(e,t,i,a,o){var s;return d(this,r),s=n.call(this,e,t,i,a,_e),o&&(s.loadGeoJSON=o),s}return p(r,[{key:"loadData",value:function(t,n){var r=this,i=t&&t.request,a=i&&i.collectResourceTiming;this.loadGeoJSON(t,(function(o,s){if(o||!s)return n(o);if("object"!=typeof s)return n(new Error("Input data given to '".concat(t.source,"' is not a valid GeoJSON object.")));c(s,!0);try{if(t.filter){var l=e.createExpression(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===l.result)throw new Error(l.value.map((function(e){return"".concat(e.key,": ").concat(e.message)})).join(", "));var u=s.features.filter((function(e){return l.value.evaluate({zoom:0},e)}));s={type:"FeatureCollection",features:u}}r._geoJSONIndex=t.cluster?new V(function(t){var n=t.superclusterOptions,r=t.clusterProperties;if(!r||!n)return n;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(r),c=0,u=l;c=0?0:t.button}function A(t,n,r){var i=t.offsetWidth===n.width?1:t.offsetWidth/n.width;return new e.Point((r.clientX-n.left)*i,(r.clientY-n.top)*i)}function I(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*a-i*r;return o?(e[0]=a*(o=1/o),e[1]=-r*o,e[2]=-i*o,e[3]=n*o,e):null}function P(e){var t=e.userImage;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}var L=function(t){m(r,t);var n=v(r);function r(){var t;return d(this,r),(t=n.call(this)).images={},t.updatedImages={},t.callbackDispatchedThisFrame={},t.loaded=!1,t.requestors=[],t.patterns={},t.atlasImage=new e.RGBAImage({width:1,height:1}),t.dirty=!0,t}return p(r,[{key:"isLoaded",value:function(){return this.loaded}},{key:"setLoaded",value:function(e){if(this.loaded!==e&&(this.loaded=e,e)){var t,n=h(this.requestors);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=r.ids,a=r.callback;this._notify(i,a)}}catch(o){n.e(o)}finally{n.f()}this.requestors=[]}}},{key:"hasImage",value:function(e){return!!this.getImage(e)}},{key:"getImage",value:function(e){return this.images[e]}},{key:"addImage",value:function(e,t){this._validate(e,t)&&(this.images[e]=t)}},{key:"_validate",value:function(t,n){var r=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new e.ErrorEvent(new Error('Image "'.concat(t,'" has invalid "stretchX" value')))),r=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new e.ErrorEvent(new Error('Image "'.concat(t,'" has invalid "stretchY" value')))),r=!1),this._validateContent(n.content,n)||(this.fire(new e.ErrorEvent(new Error('Image "'.concat(t,'" has invalid "content" value')))),r=!1),r}},{key:"_validateStretch",value:function(e,t){if(!e)return!0;var n,r=0,i=h(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(a[0]1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(e.validateLight,t,n))for(var r in t){var i=t[r];e.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-11),i):this._transitionable.setValue(r,i)}}},{key:"updateTransitions",value:function(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}},{key:"hasTransition",value:function(){return this._transitioning.hasTransition()}},{key:"recalculate",value:function(e){this.properties=this._transitioning.possiblyEvaluate(e)}},{key:"_validate",value:function(t,n,r){return(!r||!1!==r.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:e.spec})))}}]),r}(e.Evented),O=new e.Properties({source:new e.DataConstantProperty(e.spec.terrain.source),exaggeration:new e.DataConstantProperty(e.spec.terrain.exaggeration)}),B=function(t){m(r,t);var n=v(r);function r(t,i){var a;return d(this,r),(a=n.call(this))._transitionable=new e.Transitionable(O),a.set(t),a._transitioning=a._transitionable.untransitioned(),a.drapeRenderMode=i,a}return p(r,[{key:"get",value:function(){return this._transitionable.serialize()}},{key:"set",value:function(t){for(var n in t){var r=t[n];e.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-11),r):this._transitionable.setValue(n,r)}}},{key:"updateTransitions",value:function(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}},{key:"hasTransition",value:function(){return this._transitioning.hasTransition()}},{key:"recalculate",value:function(e){this.properties=this._transitioning.possiblyEvaluate(e)}}]),r}(e.Evented);function N(t,n,r,i){var a=e.smoothstep(45,65,r),o=F(t,i),s=f(o,2),l=s[0],c=s[1],u=e.length(n),h=1-Math.min(1,Math.exp((u-l)/(c-l)*-6));return h*=h*h,(h=Math.min(1,1.00747*h))*a*t.alpha}function F(e,t){var n=.5/Math.tan(.5*t);return[e.range[0]+n,e.range[1]+n]}var V=new e.Properties({range:new e.DataConstantProperty(e.spec.fog.range),color:new e.DataConstantProperty(e.spec.fog.color),"high-color":new e.DataConstantProperty(e.spec.fog["high-color"]),"space-color":new e.DataConstantProperty(e.spec.fog["space-color"]),"horizon-blend":new e.DataConstantProperty(e.spec.fog["horizon-blend"]),"star-intensity":new e.DataConstantProperty(e.spec.fog["star-intensity"])}),j=function(t){m(r,t);var n=v(r);function r(t,i){var a;return d(this,r),(a=n.call(this))._transitionable=new e.Transitionable(V),a.set(t),a._transitioning=a._transitionable.untransitioned(),a._transform=i,a}return p(r,[{key:"state",get:function(){var t=this._transform,n="globe"===t.projection.name,r=e.globeToMercatorTransition(t.zoom),i=this.properties.get("range"),a=[.5,3];return{range:n?[e.number(a[0],i[0],r),e.number(a[1],i[1],r)]:i,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}},{key:"get",value:function(){return this._transitionable.serialize()}},{key:"set",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(e.validateFog,t,n)){for(var r=0,i=Object.keys(e.spec.fog);rr.y&&(this.cameraPoint.x>n.x&&this.cameraPoint.x=r.x?i[2]=this.cameraPoint:this.cameraPoint.x<=n.x&&(i[3]=this.cameraPoint)),e.bufferConvexPolygon(i,t)}},{key:"bufferedCameraGeometryGlobe",value:function(t){var n=this.screenBounds[0],r=1===this.screenBounds.length?this.screenBounds[0].add(new e.Point(1,1)):this.screenBounds[1],i=e.polygonizeBounds(n,r,t),a=this.cameraPoint.clone();switch(3*((a.y>n.y)+(a.y>r.y))+((a.x>n.x)+(a.x>r.x))){case 0:i[0]=a,i[4]=a.clone();break;case 1:i.splice(1,0,a);break;case 2:i[1]=a;break;case 3:i.splice(4,0,a);break;case 5:i.splice(2,0,a);break;case 6:i[3]=a;break;case 7:i.splice(3,0,a);break;case 8:i[2]=a}return i}},{key:"containsTile",value:function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=t.queryPadding/n._pixelsPerMercatorPixel+1,o=r?this._bufferedCameraMercator(a,n):this._bufferedScreenMercator(a,n),s=t.tileID.wrap+(o.unwrapped?i:0),l=o.polygon.map((function(n){return e.getTilePoint(t.tileTransform,n,s)}));if(e.polygonIntersectsBox(l,0,0,e.EXTENT,e.EXTENT)){s=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?i:0);var c,u=this.screenGeometryMercator.polygon.map((function(n){return e.getTileVec3(t.tileTransform,n,s)})),f=u.map((function(t){return new e.Point(t[0],t[1])})),h=n.getFreeCameraOptions().position||new e.MercatorCoordinate(0,0,0),d=e.getTileVec3(t.tileTransform,h,s),p=u.map((function(t){var n=e.sub(t,t,d);return e.normalize(n,n),new e.Ray(d,n)})),m=H(t,1,n.zoom)*n._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:f,tilespaceRays:p,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(c=e.getBounds(l),c.min.x=e.clamp(c.min.x,0,e.EXTENT),c.min.y=e.clamp(c.min.y,0,e.EXTENT),c.max.x=e.clamp(c.max.x,0,e.EXTENT),c.max.y=e.clamp(c.max.y,0,e.EXTENT),c),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:m}}}},{key:"_bufferedScreenMercator",value:function(e,t){var n,r=W(e);return this._screenRaycastCache[r]?this._screenRaycastCache[r]:(n="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map((function(e){return t.pointCoordinate3D(e)})),unwrapped:!0},this._screenRaycastCache[r]=n,n)}},{key:"_bufferedCameraMercator",value:function(e,t){var n,r=W(e);return this._cameraRaycastCache[r]?this._cameraRaycastCache[r]:(n="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map((function(e){return t.pointCoordinate3D(e)})),unwrapped:!0},this._cameraRaycastCache[r]=n,n)}},{key:"_projectAndResample",value:function(t,n){var r=function(t,n){var r=e.multiply([],n.pixelMatrix,n.globeMatrix),i=[0,-e.GLOBE_RADIUS,0,1],a=[0,e.GLOBE_RADIUS,0,1],o=[0,0,0,1];e.transformMat4$1(i,i,r),e.transformMat4$1(a,a,r),e.transformMat4$1(o,o,r);var s=new e.Point(i[0]/i[3],i[1]/i[3]),l=new e.Point(a[0]/a[3],a[1]/a[3]),c=e.polygonContainsPoint(t,s)&&i[3]1?G(t.slice(0,d),n):[],v=di&&(i=t[o].x,a=o);for(var s=0;s.5&&(c.x=r&&t.x=i&&t.y1&&void 0!==arguments[1]&&arguments[1];if(d(this,n),this.gl=e,this.isWebGL2=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),t){var r=e;this.extVertexArrayObject={createVertexArrayOES:r.createVertexArray.bind(e),deleteVertexArrayOES:r.deleteVertexArray.bind(e),bindVertexArrayOES:r.bindVertexArray.bind(e)}}this.clearColor=new te(this),this.clearDepth=new ne(this),this.clearStencil=new re(this),this.colorMask=new ie(this),this.depthMask=new ae(this),this.stencilMask=new oe(this),this.stencilFunc=new se(this),this.stencilOp=new le(this),this.stencilTest=new ce(this),this.depthRange=new ue(this),this.depthTest=new fe(this),this.depthFunc=new he(this),this.blend=new de(this),this.blendFunc=new pe(this),this.blendColor=new me(this),this.blendEquation=new ve(this),this.cullFace=new ye(this),this.cullFaceSide=new ge(this),this.frontFace=new _e(this),this.program=new xe(this),this.activeTexture=new be(this),this.viewport=new we(this),this.bindFramebuffer=new ke(this),this.bindRenderbuffer=new ze(this),this.bindTexture=new Me(this),this.bindVertexBuffer=new Te(this),this.bindElementBuffer=new Se(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Ee(this),this.pixelStoreUnpack=new Ce(this),this.pixelStoreUnpackPremultiplyAlpha=new Ae(this),this.pixelStoreUnpackFlipY=new Ie(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extStandardDerivativesForceOff=!1,this.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),t||(this.extTextureHalfFloat=e.getExtension("OES_texture_half_float")),(t||this.extTextureHalfFloat&&e.getExtension("OES_texture_half_float_linear"))&&(this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float")),this.extStandardDerivatives=t||e.getExtension("OES_standard_derivatives"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)}return p(n,[{key:"setDefault",value:function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}},{key:"setDirty",value:function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}},{key:"createIndexBuffer",value:function(e,t){return new $(this,e,t)}},{key:"createVertexBuffer",value:function(e,t,n){return new Q(this,e,t,n)}},{key:"createRenderbuffer",value:function(e,t,n){var r=this.gl,i=r.createRenderbuffer();return this.bindRenderbuffer.set(i),r.renderbufferStorage(r.RENDERBUFFER,e,t,n),this.bindRenderbuffer.set(null),i}},{key:"createFramebuffer",value:function(e,t,n){return new Oe(this,e,t,n)}},{key:"clear",value:function(e){var t=e.color,n=e.depth,r=e.stencil,i=this.gl,a=0;t&&(a|=i.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==n&&(a|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),void 0!==r&&(a|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(r),this.stencilMask.set(255)),i.clear(a)}},{key:"setCullFace",value:function(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}},{key:"setDepthMode",value:function(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}},{key:"setStencilMode",value:function(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}},{key:"setColorMode",value:function(n){t(n.blendFunction,e.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(n.blendFunction),this.blendColor.set(n.blendColor)),this.colorMask.set(n.mask)}},{key:"unbindVAO",value:function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}]),n}(),Ne=function(t){m(r,t);var n=v(r);function r(t,a,o,s){var c;if(d(this,r),(c=n.call(this)).id=t,c.dispatcher=o,c.type="vector",c.minzoom=0,c.maxzoom=22,c.scheme="xyz",c.tileSize=512,c.reparseOverscaled=!0,c.isTileClipped=!0,c._loaded=!1,e.extend(i(c),e.pick(a,["url","scheme","tileSize","promoteId"])),c._options=e.extend({type:"vector"},a),c._collectResourceTiming=a.collectResourceTiming,512!==c.tileSize)throw new Error("vector tile sources must have a tileSize of 512");return c.setEventedParent(s),c._tileWorkers={},c._deduped=new e.DedupedRequest,l(c)}return p(r,[{key:"load",value:function(t){var n=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"}));var r=Array.isArray(this.map._language)?this.map._language.join():this.map._language,i=this.map._worldview;this._tileJSONRequest=X(this._options,this.map._requestManager,r,i,(function(a,o){n._tileJSONRequest=null,n._loaded=!0,a?(r&&console.warn("Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ".concat(r)),i&&2!==i.length&&console.warn("Requested worldview strings must be a valid ISO alpha-2 code. Found: ".concat(i)),n.fire(new e.ErrorEvent(a))):o&&(e.extend(n,o),o.bounds&&(n.tileBounds=new K(o.bounds,n.minzoom,n.maxzoom)),e.postTurnstileEvent(o.tiles,n.map._requestManager._customAccessToken),n.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))),t&&t(a)}))}},{key:"loaded",value:function(){return this._loaded}},{key:"hasTile",value:function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"reload",value:function(){var e=this;this.cancelTileJSONRequest(),this.load((function(){return e.map.style._clearSource(e.id)}))}},{key:"setTiles",value:function(e){return this._options.tiles=e,this.reload(),this}},{key:"setUrl",value:function(e){return this.url=e,this._options.url=e,this.reload(),this}},{key:"onRemove",value:function(){this.cancelTileJSONRequest()}},{key:"serialize",value:function(){return e.extend({},this._options)}},{key:"loadTile",value:function(t,n){var r=this,i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),a={request:this.map._requestManager.transformRequest(i,e.ResourceType.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:e.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile};if(a.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=n:t.request=t.actor.send("reloadTile",a,s.bind(this));else if(t.actor=this._tileWorkers[i]=this._tileWorkers[i]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",a,s.bind(this),void 0,!0);else{var o=e.loadVectorTile.call({deduped:this._deduped},a,(function(e,n){e||!n?s.call(r,e):(a.data={cacheControl:n.cacheControl,expires:n.expires,rawData:n.rawData.slice(0)},t.actor&&t.actor.send("loadTile",a,s.bind(r),void 0,!0))}),!0);t.request={cancel:o}}function s(r,i){return delete t.request,t.aborted?n(null):r&&404!==r.status?n(r):(i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}},{key:"abortTile",value:function(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id})}},{key:"unloadTile",value:function(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}},{key:"hasTransition",value:function(){return!1}},{key:"afterUpdate",value:function(){this._tileWorkers={}}},{key:"cancelTileJSONRequest",value:function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}]),r}(e.Evented),Fe=function(t){m(r,t);var n=v(r);function r(t,a,o,s){var l;return d(this,r),(l=n.call(this)).id=t,l.dispatcher=o,l.setEventedParent(s),l.type="raster",l.minzoom=0,l.maxzoom=22,l.roundZoom=!0,l.scheme="xyz",l.tileSize=512,l._loaded=!1,l._options=e.extend({type:"raster"},a),e.extend(i(l),e.pick(a,["url","scheme","tileSize"])),l}return p(r,[{key:"load",value:function(t){var n=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=X(this._options,this.map._requestManager,null,null,(function(r,i){n._tileJSONRequest=null,n._loaded=!0,r?n.fire(new e.ErrorEvent(r)):i&&(e.extend(n,i),i.bounds&&(n.tileBounds=new K(i.bounds,n.minzoom,n.maxzoom)),e.postTurnstileEvent(i.tiles),n.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))),t&&t(r)}))}},{key:"loaded",value:function(){return this._loaded}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"reload",value:function(){var e=this;this.cancelTileJSONRequest(),this.load((function(){return e.map.style._clearSource(e.id)}))}},{key:"setTiles",value:function(e){return this._options.tiles=e,this.reload(),this}},{key:"setUrl",value:function(e){return this.url=e,this._options.url=e,this.reload(),this}},{key:"onRemove",value:function(){this.cancelTileJSONRequest()}},{key:"serialize",value:function(){return e.extend({},this._options)}},{key:"hasTile",value:function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}},{key:"loadTile",value:function(t,n){var r=this,i=e.exported.devicePixelRatio>=2,a=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),i,this.tileSize);t.request=e.getImage(this.map._requestManager.transformRequest(a,e.ResourceType.Tile),(function(i,a,o,s){return delete t.request,t.aborted?(t.state="unloaded",n(null)):i?(t.state="errored",n(i)):a?(r.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:o,expires:s}),t.setTexture(a,r.map.painter),t.state="loaded",e.cacheEntryPossiblyAdded(r.dispatcher),void n(null)):n(null)}))}},{key:"abortTile",value:function(e,t){e.request&&(e.request.cancel(),delete e.request),t()}},{key:"unloadTile",value:function(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()}},{key:"hasTransition",value:function(){return!1}},{key:"cancelTileJSONRequest",value:function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}],[{key:"loadTileData",value:function(e,t,n){e.setTexture(t,n)}},{key:"unloadTileData",value:function(e,t){e.texture&&t.saveTileTexture(e.texture)}}]),r}(e.Evented);function Ve(t,n,r,i,a,o,s,l){var c=[t,r,a,n,i,o,1,1,1],u=[s,l,1],h=e.adjoint([],c),d=e.transformMat3(u,u,e.transpose(h,h)),p=f(d,3),m=p[0],v=p[1],y=p[2];return e.multiply$1(c,[m,0,0,0,v,0,0,0,y],c)}var je=function(t){m(r,t);var n=v(r);function r(e,t,i,a){var o;return d(this,r),(o=n.call(this)).id=e,o.dispatcher=i,o.coordinates=t.coordinates,o.type="image",o.minzoom=0,o.maxzoom=22,o.tileSize=512,o.tiles={},o._loaded=!1,o.setEventedParent(a),o.options=t,o._dirty=!1,o}return p(r,[{key:"load",value:function(t,n){var r=this;this._loaded=n||!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),(function(n,i){if(r._imageRequest=null,r._loaded=!0,n)r.fire(new e.ErrorEvent(n));else if(i){var a=e.window.HTMLImageElement;r.image=i instanceof a?e.exported.getImageData(i):i,r._dirty=!0,r.width=r.image.width,r.height=r.image.height,t&&(r.coordinates=t),r._finishLoading()}}))}},{key:"loaded",value:function(){return this._loaded}},{key:"updateImage",value:function(e){return this.image&&e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}},{key:"_finishLoading",value:function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"onRemove",value:function(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}},{key:"setCoordinates",value:function(t){this.coordinates=t,this._boundsArray=void 0;var n=t.map(e.MercatorCoordinate.fromLngLat);return this.tileID=function(t){var n,r=1/0,i=1/0,a=-1/0,o=-1/0,s=h(t);try{for(s.s();!(n=s.n()).done;){var l=n.value;r=Math.min(r,l.x),i=Math.min(i,l.y),a=Math.max(a,l.x),o=Math.max(o,l.y)}}catch(d){s.e(d)}finally{s.f()}var c=Math.max(a-r,o-i),u=Math.max(0,Math.floor(-Math.log(c)/Math.LN2)),f=Math.pow(2,u);return new e.CanonicalTileID(u,Math.floor((r+a)/2*f),Math.floor((i+o)/2*f))}(n),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this}},{key:"_clear",value:function(){this._boundsArray=void 0}},{key:"_prepareData",value:function(t){for(var n in this.tiles){var r=this.tiles[n];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}if(!this._boundsArray){var i=e.tileTransform(this.tileID,this.map.transform.projection),a=this.coordinates.map((function(t){var n=i.projection.project(t[0],t[1]);return e.getTilePoint(i,n)._round()})),o=f(a,4),s=o[0],l=o[1],c=o[2],u=o[3];this.perspectiveTransform=function(t,n,r,i,a,o,s,l,c,u){var f=Ve(0,0,t,0,0,n,t,n),h=Ve(r,i,a,o,s,l,c,u);return e.multiply$1(h,e.adjoint(f,f),h),[h[6]/h[8]*t/e.EXTENT,h[7]/h[8]*n/e.EXTENT]}(this.width,this.height,s.x,s.y,l.x,l.y,u.x,u.y,c.x,c.y);var h=this._boundsArray=new e.StructArrayLayout4i8;h.emplaceBack(s.x,s.y,0,0),h.emplaceBack(l.x,l.y,e.EXTENT,0),h.emplaceBack(u.x,u.y,0,e.EXTENT),h.emplaceBack(c.x,c.y,e.EXTENT,e.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=t.createVertexBuffer(h,e.boundsAttributes.members),this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)}}},{key:"prepare",value:function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,n=t.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new e.Texture(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(t)}}},{key:"loadTile",value:function(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}},{key:"serialize",value:function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}},{key:"hasTransition",value:function(){return!1}}]),r}(e.Evented),Ue={vector:Ne,raster:Fe,"raster-dem":function(t){m(r,t);var n=v(r);function r(t,i,a,o){var s;return d(this,r),(s=n.call(this,t,i,a,o)).type="raster-dem",s.maxzoom=22,s._options=e.extend({type:"raster-dem"},i),s.encoding=i.encoding||"mapbox",s}return p(r,[{key:"loadTile",value:function(t,n){var r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function i(e,r){e&&(t.state="errored",n(e)),r&&(t.dem=r,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",n(null))}t.request=e.getImage(this.map._requestManager.transformRequest(r,e.ResourceType.Tile),function(r,a,o,s){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(r)t.state="errored",n(r);else if(a){this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:o,expires:s});var l=e.window.ImageBitmap&&a instanceof e.window.ImageBitmap&&(null==Y&&(Y=e.window.OffscreenCanvas&&new e.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof e.window.createImageBitmap),Y),c=1-(a.width-e.prevPowerOfTwo(a.width))/2;c<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));var u=l?a:e.exported.getImageData(a,c),f={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:u,encoding:this.encoding,padding:c};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",f,i.bind(this),void 0,!0))}}.bind(this))}},{key:"_getNeighboringTiles",value:function(t){var n=t.canonical,r=Math.pow(2,n.z),i=(n.x-1+r)%r,a=0===n.x?t.wrap-1:t.wrap,o=(n.x+1+r)%r,s=n.x+1===r?t.wrap+1:t.wrap,l={};return l[new e.OverscaledTileID(t.overscaledZ,a,n.z,i,n.y).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,n.z,o,n.y).key]={backfilled:!1},n.y>0&&(l[new e.OverscaledTileID(t.overscaledZ,a,n.z,i,n.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,n.z,o,n.y-1).key]={backfilled:!1}),n.y+1n.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(this.id),null,"Playback for this video can be set only between the ".concat(n.start(0)," and ").concat(n.end(0),"-second mark.")))):this.video.currentTime=t}}},{key:"getVideo",value:function(){return this.video}},{key:"onAdd",value:function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}},{key:"prepare",value:function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,n=t.gl;this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}}},{key:"serialize",value:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}},{key:"hasTransition",value:function(){return this.video&&!this.video.paused}}]),r}(je),image:je,canvas:function(t){m(r,t);var n=v(r);function r(t,i,a,o){var s;return d(this,r),s=n.call(this,t,i,a,o),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((function(e){return!Array.isArray(e)||2!==e.length||e.some((function(e){return"number"!=typeof e}))}))||s.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(t),null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):s.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(t),null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&s.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(t),null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof e.window.HTMLCanvasElement||s.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(t),null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):s.fire(new e.ErrorEvent(new e.ValidationError("sources.".concat(t),null,'missing required property "canvas"'))),s.options=i,s.animate=void 0===i.animate||i.animate,s}return p(r,[{key:"load",value:function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.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())}},{key:"getCanvas",value:function(){return this.canvas}},{key:"onAdd",value:function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}},{key:"onRemove",value:function(){this.pause()}},{key:"prepare",value:function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var n=this.map.painter.context;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(n,this.canvas,n.gl.RGBA,{premultiply:!0}),this._prepareData(n)}}},{key:"serialize",value:function(){return{type:"canvas",coordinates:this.coordinates}}},{key:"hasTransition",value:function(){return this._playing}},{key:"_hasInvalidDimensions",value:function(){for(var e=0,t=[this.canvas.width,this.canvas.height];e7&&void 0!==arguments[7]&&arguments[7],l=e.tilesIn(r,o,s);l.sort(We);var c,u=[],f=h(l);try{for(f.s();!(c=f.n()).done;){var d=c.value;u.push({wrappedTileID:d.tile.tileID.wrapped().key,queryResults:d.tile.queryRenderedFeatures(t,n,e._state,d,i,a,Ze(e.transform,d.tile.tileID),s)})}}catch(v){f.e(v)}finally{f.f()}var p=function(e){var t,n={},r={},i=h(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=a.queryResults,s=a.wrappedTileID,l=r[s]=r[s]||{};for(var c in o){var u,f=o[c],d=l[c]=l[c]||{},p=n[c]=n[c]||[],m=h(f);try{for(m.s();!(u=m.n()).done;){var y=u.value;d[y.featureIndex]||(d[y.featureIndex]=!0,p.push(y))}}catch(v){m.e(v)}finally{m.f()}}}}catch(v){i.e(v)}finally{i.f()}return n}(u);for(var m in p)p[m].forEach((function(t){var n=t.feature,r=n.layer;r&&"background"!==r.type&&"sky"!==r.type&&(n.source=r.source,r["source-layer"]&&(n.sourceLayer=r["source-layer"]),n.state=void 0!==n.id?e.getFeatureState(r["source-layer"],n.id):{})}));return p}function qe(e,t){for(var n=e.getRenderableIds().map((function(t){return e.getTileByID(t)})),r=[],i={},a=0;a0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[n].mult(l))}}]),t}(),ut=function(){function e(t,n,r){d(this,e);var i=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(n/r);for(var o=0;othis.width||r<0||t>this.height)return!i&&[];var o=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(var s=0;s0:o}},{key:"_queryCircle",value:function(e,t,n,r,i){var a=e-n,o=e+n,s=t-n,l=t+n;if(o<0||a>this.width||l<0||s>this.height)return!r&&[];var c=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,c,{hitTest:r,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}},i),r?c.length>0:c}},{key:"query",value:function(e,t,n,r,i){return this._query(e,t,n,r,!1,i)}},{key:"hitTest",value:function(e,t,n,r,i){return this._query(e,t,n,r,!0,i)}},{key:"hitTestCircle",value:function(e,t,n,r){return this._queryCircle(e,t,n,!0,r)}},{key:"_queryCell",value:function(e,t,n,r,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c){var u,f=this.bboxes,d=h(c);try{for(d.s();!(u=d.n()).done;){var p=u.value;if(!l.box[p]){l.box[p]=!0;var m=4*p;if(e<=f[m+2]&&t<=f[m+3]&&n>=f[m+0]&&r>=f[m+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:f[m],y1:f[m+1],x2:f[m+2],y2:f[m+3]})}}}}catch(M){d.e(M)}finally{d.f()}}var v=this.circleCells[i];if(null!==v){var y,g=this.circles,_=h(v);try{for(_.s();!(y=_.n()).done;){var x=y.value;if(!l.circle[x]){l.circle[x]=!0;var b=3*x;if(this._circleAndRectCollide(g[b],g[b+1],g[b+2],e,t,n,r)&&(!s||s(this.circleKeys[x]))){if(o.hitTest)return a.push(!0),!0;var w=g[b],k=g[b+1],z=g[b+2];a.push({key:this.circleKeys[x],x1:w-z,y1:k-z,x2:w+z,y2:k+z})}}}}catch(M){_.e(M)}finally{_.f()}}}},{key:"_queryCellCircle",value:function(e,t,n,r,i,a,o,s){var l=o.circle,c=o.seenUids,u=this.boxCells[i];if(null!==u){var f,d=this.bboxes,p=h(u);try{for(p.s();!(f=p.n()).done;){var m=f.value;if(!c.box[m]){c.box[m]=!0;var v=4*m;if(this._circleAndRectCollide(l.x,l.y,l.radius,d[v+0],d[v+1],d[v+2],d[v+3])&&(!s||s(this.boxKeys[m])))return a.push(!0),!0}}}catch(k){p.e(k)}finally{p.f()}}var y=this.circleCells[i];if(null!==y){var g,_=this.circles,x=h(y);try{for(x.s();!(g=x.n()).done;){var b=g.value;if(!c.circle[b]){c.circle[b]=!0;var w=3*b;if(this._circlesCollide(_[w],_[w+1],_[w+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[b])))return a.push(!0),!0}}}catch(k){x.e(k)}finally{x.f()}}}},{key:"_forEachCell",value:function(e,t,n,r,i,a,o,s){for(var l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(n),f=this._convertToYCellCoord(r),h=l;h<=u;h++)for(var d=c;d<=f;d++)if(i.call(this,e,t,n,r,this.xCellCount*d+h,a,o,s))return}},{key:"_convertToXCellCoord",value:function(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}},{key:"_convertToYCellCoord",value:function(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}},{key:"_circlesCollide",value:function(e,t,n,r,i,a){var o=r-e,s=i-t,l=n+a;return l*l>o*o+s*s}},{key:"_circleAndRectCollide",value:function(e,t,n,r,i,a,o){var s=(a-r)/2,l=Math.abs(e-(r+s));if(l>s+n)return!1;var c=(o-i)/2,u=Math.abs(t-(i+c));if(u>c+n)return!1;if(l<=s||u<=c)return!0;var f=l-s,h=u-c;return f*f+h*h<=n*n}}]),e}(),ft={unknown:0,flipRequired:1,flipNotRequired:2},ht=Math.tan(85*Math.PI/180);function dt(t,n,r,i,a,o,s){var l=e.create();if(r)if("globe"===o.name){var c=e.calculateGlobeLabelMatrix(a,n);e.multiply(l,l,c)}else{var u=I([],s);l[0]=u[0],l[1]=u[1],l[4]=u[2],l[5]=u[3],i||e.rotateZ(l,l,a.angle)}else e.multiply(l,a.labelPlaneMatrix,t);return l}function pt(e,t,n,r,i,a,o){var s=dt(e,t,n,r,i,a,o);return"globe"===a.name&&n||(s[2]=s[6]=s[10]=s[14]=0),s}function mt(t,n,r,i,a,o,s){if(r){if("globe"===o.name){var l=dt(t,n,r,i,a,o,s);return e.invert(l,l),e.multiply(l,t,l),l}var c=e.clone(t),u=e.identity([]);return u[0]=s[0],u[1]=s[1],u[4]=s[2],u[5]=s[3],e.multiply(c,c,u),i||e.rotateZ(c,c,-a.angle),c}return a.glCoordMatrix}function vt(t,n,r,i){var a=[t,n,r,1];r?e.transformMat4$1(a,a,i):St(a,a,i);var o=a[3];return a[0]/=o,a[1]/=o,a[2]/=o,a}function yt(e,t){return Math.min(.5+e/t*.5,1.5)}function gt(e,t){var n=e[0]/e[3],r=e[1]/e[3];return n>=-t[0]&&n<=t[0]&&r>=-t[1]&&r<=t[1]}function _t(t,n,r,i,a,o,s,l,c,u){var h=r.transform,d=i?t.textSizeData:t.iconSizeData,p=e.evaluateSizeForZoom(d,r.transform.zoom),m="globe"===h.projection.name,v=[256/r.width*2+1,256/r.height*2+1],y=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;y.clear();var g=null;m&&(g=i?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);for(var _,x=t.lineVertexArray,b=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,w=r.transform.width/r.transform.height,k=!1,z=0;zMath.abs(r)?{useVertical:!0}:t===e.WritingMode.vertical?i>0?{needsFlipping:!0}:null:n!==ft.unknown&&function(e,t){return 0===e||Math.abs(t/e)>ht}(r,i)?n===ft.flipRequired?{needsFlipping:!0}:null:r<0?{needsFlipping:!0}:null}function wt(t,n,r,i,a,o,s,l,c,u,h,d,p,m,v,y,g,_,x){var b=n/24,w=t.lineOffsetX*b,k=t.lineOffsetY*b,z=t.lineStartIndex,M=t.glyphStartIndex,T=t.numGlyphs,S=t.segment,E=t.writingMode,C=t.flipState,A=z+t.lineLength,I=function(t){if(h){var n=f(t.up,3),r=n[0],i=n[1],a=n[2],o=u.length;e.updateGlobeVertexNormal(h,o+0,r,i,a),e.updateGlobeVertexNormal(h,o+1,r,i,a),e.updateGlobeVertexNormal(h,o+2,r,i,a),e.updateGlobeVertexNormal(h,o+3,r,i,a)}var s=f(t.point,3),l=s[0],c=s[1],d=s[2];e.addDynamicAttributes(u,l,c,d,t.angle)};if(T>1){var P=xt(b,l,w,k,r,d,p,t,c,o,m,y,!1,g,_,x);if(!P)return{notEnoughRoom:!0};if(i&&!r){var L,D,R,O,B=f(P.first.point,3),N=B[0],F=B[1],V=B[2],j=f(P.last.point,3),U=j[0],H=j[1],Z=j[2];L=vt(N,F,V,s),N=(D=f(L,2))[0],F=D[1],R=vt(U,H,Z,s);var G=bt(E,C,((U=(O=f(R,2))[0])-N)*v,(H=O[1])-F);if(t.flipState=G&&G.needsFlipping?ft.flipRequired:ft.flipNotRequired,G)return G}I(P.first);for(var q=M+1;q0?$:zt(p,K,X,1,a,void 0,g,_.canonical),Q=bt(E,C,(J[0]-X[0])*v,J[1]-X[1]);if(t.flipState=Q&&Q.needsFlipping?ft.flipRequired:ft.flipNotRequired,Q)return Q}var ee=Mt(b*l.getoffsetX(M),w,k,r,d,p,S,z,A,c,o,m,y,!1,!1,g,_,x);if(!ee)return{notEnoughRoom:!0};I(ee)}return{}}function kt(e,t,n,r,i){var a=r.projectTilePoint(e.x,e.y,t),o=a.x,s=a.y,l=a.z;if(!i)return vt(o,s,l,n);var c=i(e),u=f(c,3);return vt(o+u[0],s+u[1],l+u[2],n)}function zt(t,n,r,i,a,o,s,l){var c=kt(t.sub(n)._unit()._add(t),l,a,s,o);return e.sub(c,r,c),e.normalize(c,c),e.scaleAndAdd(c,r,c,i)}function Mt(t,n,r,i,a,o,s,l,c,u,f,h,d,p,m,v,y,g){var _=i?t-n:t+n,x=_>0?1:-1,b=0;i&&(x*=-1,b=Math.PI),x<0&&(b+=Math.PI);for(var w=l+s+(x>0?0:1)|0,k=a,z=a,M=0,T=0,S=Math.abs(_),E=[],C=[],A=o,I=A,P=function(){return zt(I,A,z,S-M+1,f,d,v,y.canonical)};M+T<=S;){if((w+=x)=c)return null;if(z=k,I=A,E.push(z),p&&C.push(I),A=new e.Point(u.getx(w),u.gety(w)),!(k=h[w])){var L=kt(A,y.canonical,f,v,d);k=L[3]>0?h[w]=L:P()}M+=T,T=e.distance(z,k)}m&&d&&(h[w]&&(k=P(),T=e.distance(z,k)),h[w]=k);var D=(S-M)/T,R=A.sub(I)._mult(D)._add(I),O=e.sub([],k,z),B=e.scaleAndAdd([],z,O,D),N=[0,0,1],F=O[0],V=O[1];if(g&&(0!==(N=v.upVector(y.canonical,R.x,R.y))[0]||0!==N[1]||1!==N[2])){var j=[N[2],0,-N[0]],U=e.cross([],N,j);e.normalize(j,j),e.normalize(U,U),F=e.dot(O,j),V=e.dot(O,U)}if(r){var H=e.cross([],N,O);e.normalize(H,H),e.scaleAndAdd(B,B,H,r*x)}var Z=b+Math.atan2(V,F);return E.push(B),p&&C.push(R),{point:B,angle:Z,path:E,tilePath:C,up:N}}function Tt(e,t){var n=t.length,r=n+4*e;t.resize(r),t.float32.fill(-1/0,4*n,4*r)}function St(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e[3]=n[3]*r+n[7]*i+n[15],e}var Et=100,Ct=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ut(e.width+200,e.height+200,25),i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new ut(e.width+200,e.height+200,25);d(this,t),this.transform=e,this.grid=r,this.ignoredGrid=i,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Et,this.screenBottomBoundary=e.height+Et,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=n}return p(t,[{key:"placeCollisionBox",value:function(e,t,n,r,i,a,o,s){var l=n.projectedAnchorX,c=n.projectedAnchorY,u=n.projectedAnchorZ,h=n.elevation,d=n.tileID,p=e.getProjection();if(h&&d){var m=p.upVector(d.canonical,n.tileAnchorX,n.tileAnchorY),v=f(m,3),y=v[0],g=v[1],_=v[2],x=p.upVectorScale(d.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;l+=y*h*x,c+=g*h*x,u+=_*h*x}var b=this.projectAndGetPerspectiveRatio(o,l,c,u,n.tileID,"globe"===p.name||!!h||this.transform.pitch>0,p),w=a*b.perspectiveRatio,k=(n.x1*t+r.x-n.padding)*w+b.point.x,z=(n.y1*t+r.y-n.padding)*w+b.point.y,M=(n.x2*t+r.x+n.padding)*w+b.point.x,T=(n.y2*t+r.y+n.padding)*w+b.point.y,S=b.perspectiveRatio<=.55||b.occluded;return!this.isInsideGrid(k,z,M,T)||!i&&this.grid.hitTest(k,z,M,T,s)||S?{box:[],offscreen:!1,occluded:b.occluded}:{box:[k,z,M,T],offscreen:this.isOffscreen(k,z,M,T),occluded:!1}}},{key:"placeCollisionCircles",value:function(t,n,r,i,a,o,s,l,c,u,d,p,m,v,y){var g=[],_=this.transform.elevation,x=t.getProjection(),b=_?_.getAtTileOffsetFunc(y,this.transform.center.lat,this.transform.worldSize,x):null,w=new e.Point(r.tileAnchorX,r.tileAnchorY),k=x.projectTilePoint(w.x,w.y,y.canonical),z=k.x,M=k.y,T=k.z;if(b){var S=b(w),E=f(S,3);z+=E[0],M+=E[1],T+=E[2]}var C="globe"===x.name,A=this.projectAndGetPerspectiveRatio(s,z,M,T,y,C||!!_||this.transform.pitch>0,x),I=A.perspectiveRatio,P=(d?o/I:o*I)/e.ONE_EM,L=vt(z,M,T,l),D=A.signedDistanceFromCamera>0?xt(P,a,r.lineOffsetX*P,r.lineOffsetY*P,!1,L,w,r,i,l,{},_&&!d?b:null,d&&!!_,x,y,d):null,R=!1,O=!1,B=!0;if(D&&!A.occluded){for(var N=.5*m*I+v,F=new e.Point(-100,-100),V=new e.Point(this.screenRightBoundary,this.screenBottomBoundary),j=new ct,U=D.first,H=D.last,Z=U.path.length,G=[],q=Z-1;q>=1;q--)G.push(U.path[q]);for(var W=1;W0){var K,$=1/0,J=-1/0,Q=1/0,ee=-1/0,te=h(G);try{for(te.s();!(K=te.n()).done;){var ne=K.value;$=Math.min($,ne[0]),Q=Math.min(Q,ne[1]),J=Math.max(J,ne[0]),ee=Math.max(ee,ne[1])}}catch(ve){te.e(ve)}finally{te.f()}J>=F.x&&$<=V.x&&ee>=F.y&&Q<=V.y&&(Y=[G.map((function(t){return new e.Point(t[0],t[1])}))],($V.x||QV.y)&&(Y=e.clipLine(Y,F.x,F.y,V.x,V.y)))}var re,ie=h(Y);try{for(ie.s();!(re=ie.n()).done;){var ae=re.value;j.reset(ae,.25*N);var oe=0;oe=j.length<=.5*N?1:Math.ceil(j.paddedLength/X)+1;for(var se=0;se0){if(e.transformMat4$1(l,l,t),this.fogState&&a&&"globe"!==s.name){var u=function(t,n,r,i,a,o){var s=o.calculateFogTileMatrix(a),l=[n,r,i];return e.transformMat4(l,l,s),N(t,l,o.pitch,o._fov)}(this.fogState,n,r,i,a.toUnwrapped(),this.transform);c=u>.9}}else St(l,l,t);var f=l[3];return{point:new e.Point((l[0]/f+1)/2*this.transform.width+Et,(-l[1]/f+1)/2*this.transform.height+Et),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(s)/f*.5,1.5),signedDistanceFromCamera:f,occluded:o&&l[2]>f||c}}},{key:"isOffscreen",value:function(e,t,n,r){return n=this.screenRightBoundary||rthis.screenBottomBoundary}},{key:"isInsideGrid",value:function(e,t,n,r){return n>=0&&e=0&&t5&&void 0!==arguments[5]&&arguments[5];d(this,e),this.text=new Lt(t?t.text:null,n,r,a),this.icon=new Lt(t?t.icon:null,n,i,a),this.clipped=o}return p(e,[{key:"isHidden",value:function(){return this.text.isHidden()&&this.icon.isHidden()}}]),e}(),Rt=p((function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];d(this,e),this.text=t,this.icon=n,this.skipFade=r,this.clipped=i})),Ot=p((function t(){d(this,t),this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]})),Bt=p((function e(t,n,r,i,a){d(this,e),this.bucketInstanceId=t,this.featureIndex=n,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=a})),Nt=function(){function e(t){d(this,e),this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}return p(e,[{key:"get",value:function(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){var t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:function(e){return e.collisionGroupID===t}}}return this.collisionGroups[e]}}]),e}();function Ft(t,n,r,i,a){var o=e.getAnchorAlignment(t),s=-(o.horizontalAlign-.5)*n,l=-(o.verticalAlign-.5)*r,c=e.evaluateVariableOffset(t,i);return new e.Point(s+c[0]*a,l+c[1]*a)}function Vt(t,n,r,i,a){var o=new e.Point(t,n);return r&&o._rotate(i?a:-a),o}var jt=function(){function t(e,n,r,i,a){d(this,t),this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new Ct(this.transform,a),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new Nt(r),this.collisionCircleArrays={},this.prevPlacement=i,i&&(i.prevPlacement=void 0),this.placedOrientations={}}return p(t,[{key:"getBucketParts",value:function(t,n,r,i){var a=r.getBucket(n),o=r.latestFeatureIndex;if(a&&o&&n.id===a.layerIds[0]){var s=a.layers[0].layout,l=r.collisionBoxArray,c=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),u=r.tileSize/e.EXTENT,f=r.tileID.toUnwrapped();this.transform.setProjection(a.projection);var d,p,m,v=(d=r.tileID,p=a.getProjection(),m=this.transform,p.name===this.projection?m.calculateProjMatrix(d.toUnwrapped()):At(m,p,d)),y="map"===s.get("text-pitch-alignment"),g="map"===s.get("text-rotation-alignment");n.compileFilter();var _=n.dynamicFilter(),x=n.dynamicFilterNeedsFeature(),b=this.transform.calculatePixelsToTileUnitsMatrix(r),w=pt(v,r.tileID.canonical,y,g,this.transform,a.getProjection(),b),k=null;if(y){var z=mt(v,r.tileID.canonical,y,g,this.transform,a.getProjection(),b);k=e.multiply([],this.transform.labelPlaneMatrix,z)}var M=null;_&&r.latestFeatureIndex&&(M={unwrappedTileID:f,dynamicFilter:_,dynamicFilterNeedsFeature:x,featureIndex:r.latestFeatureIndex}),this.retainedQueryData[a.bucketInstanceId]=new Bt(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,r.tileID);var T={bucket:a,layout:s,posMatrix:v,textLabelPlaneMatrix:w,labelToScreenMatrix:k,clippingData:M,scale:c,textPixelRatio:u,holdingForFade:r.holdingForFade(),collisionBoxArray:l,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(a.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:e.evaluateSizeForZoom(a.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i){var S,E=h(a.sortKeyRanges);try{for(E.s();!(S=E.n()).done;){var C=S.value,A=C.sortKey,I=C.symbolInstanceStart,P=C.symbolInstanceEnd;t.push({sortKey:A,symbolInstanceStart:I,symbolInstanceEnd:P,parameters:T})}}catch(L){E.e(L)}finally{E.f()}}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:T})}}},{key:"attemptAnchorPlacement",value:function(e,t,n,r,i,a,o,s,l,c,u,f,h,d,p,m,v,y){var g,_=f.textOffset0,x=f.textOffset1,b=f.crossTileID,w=[_,x],k=Ft(e,n,r,w,i),z=this.collisionIndex.placeCollisionBox(d,i,t,Vt(k.x,k.y,a,o,this.transform.angle),u,s,l,c.predicate);if(m){var M=d.getSymbolInstanceIconSize(y,this.transform.zoom,f.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(d,M,m,Vt(k.x,k.y,a,o,this.transform.angle),u,s,l,c.predicate).box.length)return}if(z.box.length>0)return this.prevPlacement&&this.prevPlacement.variableOffsets[b]&&this.prevPlacement.placements[b]&&this.prevPlacement.placements[b].text&&(g=this.prevPlacement.variableOffsets[b].anchor),this.variableOffsets[b]={textOffset:w,width:n,height:r,anchor:e,textScale:i,prevAnchor:g},this.markUsedJustification(d,e,f,p),d.allowVerticalPlacement&&(this.markUsedOrientation(d,p,f),this.placedOrientations[b]=p),{shift:k,placedGlyphBoxes:z}}},{key:"placeLayerBucketPart",value:function(t,n,r,i){var a=this,o=t.parameters,s=o.bucket,l=o.layout,c=o.posMatrix,u=o.textLabelPlaneMatrix,f=o.labelToScreenMatrix,d=o.clippingData,p=o.textPixelRatio,m=o.holdingForFade,v=o.collisionBoxArray,y=o.partiallyEvaluatedTextSize,g=o.partiallyEvaluatedIconSize,_=o.collisionGroup,x=l.get("text-optional"),b=l.get("icon-optional"),w=l.get("text-allow-overlap"),k=l.get("icon-allow-overlap"),z="map"===l.get("text-rotation-alignment"),M="map"===l.get("text-pitch-alignment"),T="none"!==l.get("icon-text-fit"),S="viewport-y"===l.get("symbol-z-order");this.transform.setProjection(s.projection);var E=w&&(k||!s.hasIconData()||b),C=k&&(w||!s.hasTextData()||x);!s.collisionArrays&&v&&s.deserializeCollisionBoxes(v),r&&i&&s.updateCollisionDebugBuffers(this.transform.zoom,v);var A=function(t,i,o){var v=t.crossTileID,S=t.numVerticalGlyphVertices;if(d){var A={zoom:a.transform.zoom,pitch:a.transform.pitch},I=null;if(d.dynamicFilterNeedsFeature){var P=a.retainedQueryData[s.bucketInstanceId];I=d.featureIndex.loadFeature({featureIndex:t.featureIndex,bucketIndex:P.bucketIndex,sourceLayerIndex:P.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,d.dynamicFilter)(A,I,a.retainedQueryData[s.bucketInstanceId].tileID.canonical,new e.Point(t.tileAnchorX,t.tileAnchorY),a.transform.calculateDistanceTileData(d.unwrappedTileID)))return a.placements[v]=new Rt(!1,!1,!1,!0),void n.add(v)}if(!n.has(v))if(m)a.placements[v]=new Rt(!1,!1,!1);else{var L=!1,D=!1,R=!0,O=!1,B=!1,N=null,F={box:null,offscreen:null,occluded:null},V={box:null,offscreen:null,occluded:null},j=null,U=null,H=null,Z=0,G=0,q=0;o.textFeatureIndex?Z=o.textFeatureIndex:t.useRuntimeCollisionCircles&&(Z=t.featureIndex),o.verticalTextFeatureIndex&&(G=o.verticalTextFeatureIndex);var W=function(e){e.tileID=a.retainedQueryData[s.bucketInstanceId].tileID;var t=a.transform.elevation;(t||e.elevation)&&(e.elevation=t?t.getAtTileOffset(e.tileID,e.tileAnchorX,e.tileAnchorY):0)},X=o.textBox;if(X){W(X);var Y=function(n){var r=e.WritingMode.horizontal;if(s.allowVerticalPlacement&&!n&&a.prevPlacement){var i=a.prevPlacement.placedOrientations[v];i&&(a.placedOrientations[v]=i,r=i,a.markUsedOrientation(s,r,t))}return r},K=function(t,n){if(s.allowVerticalPlacement&&S>0&&o.verticalTextBox){var r,i=h(s.writingModes);try{for(i.s();!(r=i.n()).done&&(r.value===e.WritingMode.vertical?(F=n(),V=F):F=t(),!(F&&F.box&&F.box.length)););}catch(a){i.e(a)}finally{i.f()}}else F=t()};if(l.get("text-variable-anchor")){var $=l.get("text-variable-anchor");if(a.prevPlacement&&a.prevPlacement.variableOffsets[v]){var J=a.prevPlacement.variableOffsets[v];$.indexOf(J.anchor)>0&&($=$.filter((function(e){return e!==J.anchor})),$.unshift(J.anchor))}var Q=function(e,n,r){var o=s.getSymbolInstanceTextSize(y,t,a.transform.zoom,i),l=(e.x2-e.x1)*o+2*e.padding,u=(e.y2-e.y1)*o+2*e.padding,f=T&&!k?n:null;f&&W(f);for(var h={box:[],offscreen:!1,occluded:!1},d=w?2*$.length:$.length,m=0;m=$.length,t,i,s,r,f,y,g);if(v&&(h=v.placedGlyphBoxes)&&h.box&&h.box.length){L=!0,N=v.shift;break}}return h};K((function(){return Q(X,o.iconBox,e.WritingMode.horizontal)}),(function(){var t=o.verticalTextBox;return t&&W(t),s.allowVerticalPlacement&&!(F&&F.box&&F.box.length)&&S>0&&t?Q(t,o.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null,occluded:null}})),F&&(L=F.box,R=F.offscreen,O=F.occluded);var ee=Y(!(!F||!F.box));if(!L&&a.prevPlacement){var te=a.prevPlacement.variableOffsets[v];te&&(a.variableOffsets[v]=te,a.markUsedJustification(s,te.anchor,t,ee))}}else{var ne=function(n,r){var o=s.getSymbolInstanceTextSize(y,t,a.transform.zoom,i),l=a.collisionIndex.placeCollisionBox(s,o,n,new e.Point(0,0),w,p,c,_.predicate);return l&&l.box&&l.box.length&&(a.markUsedOrientation(s,r,t),a.placedOrientations[v]=r),l};K((function(){return ne(X,e.WritingMode.horizontal)}),(function(){var t=o.verticalTextBox;return s.allowVerticalPlacement&&S>0&&t?(W(t),ne(t,e.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}})),Y(!!(F&&F.box&&F.box.length))}}if(L=(j=F)&&j.box&&j.box.length>0,R=j&&j.offscreen,O=j&&j.occluded,t.useRuntimeCollisionCircles){var re=s.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex),ie=e.evaluateSizeForFeature(s.textSizeData,y,re),ae=l.get("text-padding");U=a.collisionIndex.placeCollisionCircles(s,w,re,s.lineVertexArray,s.glyphOffsetArray,ie,c,u,f,r,M,_.predicate,t.collisionCircleDiameter*ie/e.ONE_EM,ae,a.retainedQueryData[s.bucketInstanceId].tileID),L=w||U.circles.length>0&&!U.collisionDetected,R=R&&U.offscreen,O=U.occluded}if(o.iconFeatureIndex&&(q=o.iconFeatureIndex),o.iconBox){var oe=function(n){W(n);var r=T&&N?Vt(N.x,N.y,z,M,a.transform.angle):new e.Point(0,0),i=s.getSymbolInstanceIconSize(g,a.transform.zoom,t.placedIconSymbolIndex);return a.collisionIndex.placeCollisionBox(s,i,n,r,k,p,c,_.predicate)};D=V&&V.box&&V.box.length&&o.verticalIconBox?(H=oe(o.verticalIconBox)).box.length>0:(H=oe(o.iconBox)).box.length>0,R=R&&H.offscreen,B=H.occluded}var se=x||0===t.numHorizontalGlyphVertices&&0===S,le=b||0===t.numIconVertices;if(se||le?le?se||(D=D&&L):L=D&&L:D=L=D&&L,L&&j&&j.box&&a.collisionIndex.insertCollisionBox(j.box,l.get("text-ignore-placement"),s.bucketInstanceId,V&&V.box&&G?G:Z,_.ID),D&&H&&a.collisionIndex.insertCollisionBox(H.box,l.get("icon-ignore-placement"),s.bucketInstanceId,q,_.ID),U&&(L&&a.collisionIndex.insertCollisionCircles(U.circles,l.get("text-ignore-placement"),s.bucketInstanceId,Z,_.ID),r)){var ce=s.bucketInstanceId,ue=a.collisionCircleArrays[ce];void 0===ue&&(ue=a.collisionCircleArrays[ce]=new Ot);for(var fe=0;fe=0;--P){var L=I[P];A(s.symbolInstances.get(L),L,s.collisionArrays[L])}else for(var D=t.symbolInstanceStart;D=0&&(t.text.placedSymbolArray.get(a).crossTileID=f>=0&&a!==f?0:c),o>=0&&(t.text.placedSymbolArray.get(o).crossTileID=f>=0&&o!==f?0:c),s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=f>=0&&s!==f?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=f>=0&&l!==f?0:c)}},{key:"markUsedOrientation",value:function(t,n,r){var i=n===e.WritingMode.horizontal||n===e.WritingMode.horizontalOnly?n:0,a=n===e.WritingMode.vertical?n:0,o=r.leftJustifiedTextSymbolIndex,s=r.centerJustifiedTextSymbolIndex,l=r.rightJustifiedTextSymbolIndex,c=r.verticalPlacedTextSymbolIndex,u=t.text.placedSymbolArray;o>=0&&(u.get(o).placedOrientation=i),s>=0&&(u.get(s).placedOrientation=i),l>=0&&(u.get(l).placedOrientation=i),c>=0&&(u.get(c).placedOrientation=a)}},{key:"commit",value:function(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;var t=this.prevPlacement,n=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;var r=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],c=i[s];c?(this.opacities[s]=new Dt(c,r,l.text,l.icon,null,l.clipped),n=n||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[s]=new Dt(null,r,l.text,l.icon,l.skipFade,l.clipped),n=n||l.text||l.icon)}for(var u in i){var f=i[u];if(!this.opacities[u]){var h=new Dt(f,r,!1,!1);h.isHidden()||(this.opacities[u]=h,n=n||f.text.placed||f.icon.placed)}}for(var d in a)this.variableOffsets[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.variableOffsets[d]=a[d]);for(var p in o)this.placedOrientations[p]||!this.opacities[p]||this.opacities[p].isHidden()||(this.placedOrientations[p]=o[p]);n?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}},{key:"updateLayerOpacities",value:function(e,t){var n,r=new Set,i=h(t);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=a.getBucket(e);o&&a.latestFeatureIndex&&e.id===o.layerIds[0]&&this.updateBucketOpacities(o,r,a.collisionBoxArray)}}catch(s){i.e(s)}finally{i.f()}}},{key:"updateBucketOpacities",value:function(t,n,r){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();var i=t.layers[0].layout,a=!!t.layers[0].dynamicFilter(),o=new Dt(null,0,!1,!1,!0),s=i.get("text-allow-overlap"),l=i.get("icon-allow-overlap"),c=i.get("text-variable-anchor"),u="map"===i.get("text-rotation-alignment"),f="map"===i.get("text-pitch-alignment"),h="none"!==i.get("icon-text-fit"),d=new Dt(null,0,s&&(l||!t.hasIconData()||i.get("icon-optional")),l&&(s||!t.hasTextData()||i.get("text-optional")),!0);!t.collisionArrays&&r&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(r);for(var p=function(e,t,n){for(var r=0;r0||_>0,M=b>0,T=this.placedOrientations[x],S=T===e.WritingMode.vertical,E=T===e.WritingMode.horizontal||T===e.WritingMode.horizontalOnly;if(!z&&!M||k.isHidden()||m++,z){var C=Kt(k.text);p(t.text,g,S?$t:C),p(t.text,_,E?$t:C);var A=k.text.isHidden(),I=y.leftJustifiedTextSymbolIndex,P=y.centerJustifiedTextSymbolIndex,L=y.rightJustifiedTextSymbolIndex,D=y.verticalPlacedTextSymbolIndex,R=t.text.placedSymbolArray,O=A||S?1:0;I>=0&&(R.get(I).hidden=O),P>=0&&(R.get(P).hidden=O),L>=0&&(R.get(L).hidden=O),D>=0&&(R.get(D).hidden=A||E?1:0);var B=this.variableOffsets[x];B&&this.markUsedJustification(t,B.anchor,y,T);var N=this.placedOrientations[x];N&&(this.markUsedJustification(t,"left",y,N),this.markUsedOrientation(t,N,y))}if(M){var F=Kt(k.icon),V=y.placedIconSymbolIndex,j=y.verticalPlacedIconSymbolIndex,U=t.icon.placedSymbolArray,H=k.icon.isHidden()?1:0;V>=0&&(p(t.icon,b,S?$t:F),U.get(V).hidden=H),j>=0&&(p(t.icon,y.numVerticalIconVertices,E?$t:F),U.get(j).hidden=H)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var Z=t.collisionArrays[v];if(Z){var G=new e.Point(0,0),q=!0;if(Z.textBox||Z.verticalTextBox){if(c){var W=this.variableOffsets[x];W?(G=Ft(W.anchor,W.width,W.height,W.textOffset,W.textScale),u&&G._rotate(f?this.transform.angle:-this.transform.angle)):q=!1}a&&(q=!k.clipped),Z.textBox&&Ut(t.textCollisionBox.collisionVertexArray,k.text.placed,!q||S,G.x,G.y),Z.verticalTextBox&&Ut(t.textCollisionBox.collisionVertexArray,k.text.placed,!q||E,G.x,G.y)}var X=q&&Boolean(!E&&Z.verticalIconBox);Z.iconBox&&Ut(t.iconCollisionBox.collisionVertexArray,k.icon.placed,X,h?G.x:0,h?G.y:0),Z.verticalIconBox&&Ut(t.iconCollisionBox.collisionVertexArray,k.icon.placed,!X,h?G.x:0,h?G.y:0)}}}if(t.fullyClipped=0===m,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){var Y=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=Y.invProjMatrix,t.placementViewportMatrix=Y.viewportMatrix,t.collisionCircleArray=Y.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}},{key:"symbolFadeChange",value:function(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}},{key:"zoomAdjustment",value:function(e){return Math.max(0,(this.transform.zoom-e)/1.5)}},{key:"hasTransitions",value:function(e){return this.stale||e-this.lastPlacementChangeTimee}},{key:"setStale",value:function(){this.stale=!0}}]),t}();function Ut(e,t,n,r,i){e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0)}var Ht=Math.pow(2,25),Zt=Math.pow(2,24),Gt=Math.pow(2,17),qt=Math.pow(2,16),Wt=Math.pow(2,9),Xt=Math.pow(2,8),Yt=Math.pow(2,1);function Kt(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,n=Math.floor(127*e.opacity);return n*Ht+t*Zt+n*Gt+t*qt+n*Wt+t*Xt+n*Yt+t}var $t=0,Jt=function(){function e(t){d(this,e),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=new Set,this._bucketParts=[]}return p(e,[{key:"continuePlacement",value:function(e,t,n,r,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=n[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Jt(s)),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}},{key:"commit",value:function(e){return this.placement.commit(e),this.placement}}]),t}(),en=512/e.EXTENT/2,tn=function(){function t(n,r,i){d(this,t),this.tileID=n,this.bucketInstanceId=i,this.index=new e.KDBush(r.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];for(var a=n.canonical.x*e.EXTENT,o=n.canonical.y*e.EXTENT,s=0;se.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,i)}else{var c=o[e.scaledTo(Number(a)).key];c&&c.findMatches(t.symbolInstances,e,i)}}for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:{};d(this,a),(n=r.call(this)).map=t,n.dispatcher=new U(Je(),i(n)),n.imageManager=new L,n.imageManager.setEventedParent(i(n)),n.glyphManager=new e.GlyphManager(t._requestManager,o.localFontFamily?e.LocalGlyphMode.all:o.localIdeographFontFamily?e.LocalGlyphMode.ideographs:e.LocalGlyphMode.none,o.localFontFamily||o.localIdeographFontFamily),n.crossTileSymbolIndex=new an,n._layers={},n._num3DLayers=0,n._numSymbolLayers=0,n._numCircleLayers=0,n._serializedLayers={},n._sourceCaches={},n._otherSourceCaches={},n._symbolSourceCaches={},n._loaded=!1,n._availableImages=[],n._order=[],n._drapedFirstOrder=[],n._markersNeedUpdate=!1,n._resetUpdates(),n.dispatcher.broadcast("setReferrer",e.getReferrer());var s=i(n);return n._rtlTextPluginCallback=a.registerForPluginStateChange((function(t){s.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},(function(t,n){if(e.triggerPluginCompletionEvent(t),n&&n.every((function(e){return e})))for(var r in s._sourceCaches){var i=s._sourceCaches[r],a=i.getSource().type;"vector"!==a&&"geojson"!==a||i.reload()}}))})),n.on("data",(function(e){if("source"===e.dataType&&"metadata"===e.sourceDataType){var t=n.getSource(e.sourceId);if(t&&t.vectorLayerIds)for(var r in n._layers){var i=n._layers[r];i.source===t.id&&n._validateLayer(i)}}})),n}return p(a,[{key:"loadURL",value:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.fire(new e.Event("dataloading",{dataType:"style"}));var i="boolean"==typeof r.validate?r.validate:!e.isMapboxURL(t);t=this.map._requestManager.normalizeStyleURL(t,r.accessToken);var a=this.map._requestManager.transformRequest(t,e.ResourceType.Style);this._request=e.getJSON(a,(function(t,r){n._request=null,t?n.fire(new e.ErrorEvent(t)):r&&n._load(r,i)}))}},{key:"loadJSON",value:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.exported.frame((function(){n._request=null,n._load(t,!1!==r.validate)}))}},{key:"loadEmpty",value:function(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(cn,!1)}},{key:"_updateLayerCount",value:function(e,t){var n=t?1:-1;e.is3D()&&(this._num3DLayers+=n),"circle"===e.type&&(this._numCircleLayers+=n),"symbol"===e.type&&(this._numSymbolLayers+=n)}},{key:"_load",value:function(t,n){if(!n||!on(this,e.validateStyle(t))){for(var r in this._loaded=!0,this.stylesheet=e.clone$1(t),this._updateMapProjection(),t.sources)this.addSource(r,t.sources[r],{validate:!1});this._changed=!1,t.sprite?this._loadSprite(t.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(t.glyphs);var i=et(this.stylesheet.layers);this._order=i.map((function(e){return e.id})),this._layers={},this._serializedLayers={};var a,o=h(i);try{for(o.s();!(a=o.n()).done;){var s=a.value,l=e.createStyleLayer(s);l.setEventedParent(this,{layer:{id:l.id}}),this._layers[l.id]=l,this._serializedLayers[l.id]=l.serialize(),this._updateLayerCount(l,!0)}}catch(c){o.e(c)}finally{o.f()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new R(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}}},{key:"terrainSetForDrapingOnly",value:function(){return!!this.terrain&&0===this.terrain.drapeRenderMode}},{key:"setProjection",value:function(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this._updateMapProjection()}},{key:"applyProjectionUpdate",value:function(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}},{key:"_updateMapProjection",value:function(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}},{key:"_loadSprite",value:function(t){var n=this;this._spriteRequest=function(t,n,r){var i,a,o,s=e.exported.devicePixelRatio>1?"@2x":"",l=e.getJSON(n.transformRequest(n.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),(function(e,t){l=null,o||(o=e,i=t,u())})),c=e.getImage(n.transformRequest(n.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),(function(e,t){c=null,o||(o=e,a=t,u())}));function u(){if(o)r(o);else if(i&&a){var t=e.exported.getImageData(a),n={};for(var s in i){var l=i[s],c=l.width,u=l.height,f=l.x,h=l.y,d=l.sdf,p=l.pixelRatio,m=l.stretchX,v=l.stretchY,y=l.content,g=new e.RGBAImage({width:c,height:u});e.RGBAImage.copy(t,g,{x:f,y:h},{x:0,y:0},{width:c,height:u}),n[s]={data:g,pixelRatio:p,sdf:d,stretchX:m,stretchY:v,content:y}}r(null,n)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,(function(t,r){if(n._spriteRequest=null,t)n.fire(new e.ErrorEvent(t));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);n.imageManager.setLoaded(!0),n._availableImages=n.imageManager.listImages(),n.dispatcher.broadcast("setImages",n._availableImages),n.dispatcher.broadcast("spriteLoaded",!0),n.fire(new e.Event("data",{dataType:"style"}))}))}},{key:"_validateLayer",value:function(t){var n=this.getSource(t.source);if(n){var r=t.sourceLayer;r&&("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(r))&&this.fire(new e.ErrorEvent(new Error('Source layer "'.concat(r,'" does not exist on source "').concat(n.id,'" as specified by style layer "').concat(t.id,'"'))))}}},{key:"loaded",value:function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}},{key:"_serializeLayers",value:function(e){var t,n=[],r=h(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=this._layers[i];"custom"!==a.type&&n.push(a.serialize())}}catch(o){r.e(o)}finally{r.f()}return n}},{key:"hasTransitions",value:function(){if(this.light&&this.light.hasTransition())return!0;if(this.fog&&this.fog.hasTransition())return!0;for(var e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(var t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}},{key:"order",get:function(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}},{key:"isLayerDraped",value:function(e){return!!this.terrain&&("function"==typeof e.isLayerDraped?e.isLayerDraped():un[e.type])}},{key:"_checkLoaded",value:function(){if(!this._loaded)throw new Error("Style is not done loading")}},{key:"update",value:function(t){if(this._loaded){var n=this._changed;if(this._changed){var r=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var a in(r.length||i.length)&&this._updateWorkerLayers(r,i),this._updatedSources){var o=this._updatedSources[a];"reload"===o?this._reloadSource(a):"clear"===o&&this._clearSource(a)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(t);this.light.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this._resetUpdates()}var l={};for(var c in this._sourceCaches){var u=this._sourceCaches[c];l[c]=u.used,u.used=!1}var f,d=h(this._order);try{for(d.s();!(f=d.n()).done;){var p=f.value,m=this._layers[p];if(m.recalculate(t,this._availableImages),!m.isHidden(t.zoom)){var v=this._getLayerSourceCache(m);v&&(v.used=!0)}var y=this.map.painter;if(y){var g=m.getProgramIds();if(!g)continue;var _,x=m.getProgramConfiguration(t.zoom),b=h(g);try{for(b.s();!(_=b.n()).done;){var w=_.value;y.useProgram(w,x)}}catch(M){b.e(M)}finally{b.f()}}}}catch(M){d.e(M)}finally{d.f()}for(var k in l){var z=this._sourceCaches[k];l[k]!==z.used&&z.getSource().fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:z.getSource().id}))}this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),n&&this.fire(new e.Event("data",{dataType:"style"}))}}},{key:"_updateTilesForChangedImages",value:function(){var e=Object.keys(this._changedImages);if(e.length){for(var t in this._sourceCaches)this._sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}},{key:"_updateWorkerLayers",value:function(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})}},{key:"_resetUpdates",value:function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}},{key:"setState",value:function(n){var r=this;if(this._checkLoaded(),on(this,e.validateStyle(n)))return!1;(n=e.clone$1(n)).layers=et(n.layers);var i=function(e,n){if(!e)return[{command:tt.setStyle,args:[n]}];var r=[];try{if(!t(e.version,n.version))return[{command:tt.setStyle,args:[n]}];t(e.center,n.center)||r.push({command:tt.setCenter,args:[n.center]}),t(e.zoom,n.zoom)||r.push({command:tt.setZoom,args:[n.zoom]}),t(e.bearing,n.bearing)||r.push({command:tt.setBearing,args:[n.bearing]}),t(e.pitch,n.pitch)||r.push({command:tt.setPitch,args:[n.pitch]}),t(e.sprite,n.sprite)||r.push({command:tt.setSprite,args:[n.sprite]}),t(e.glyphs,n.glyphs)||r.push({command:tt.setGlyphs,args:[n.glyphs]}),t(e.transition,n.transition)||r.push({command:tt.setTransition,args:[n.transition]}),t(e.light,n.light)||r.push({command:tt.setLight,args:[n.light]}),t(e.fog,n.fog)||r.push({command:tt.setFog,args:[n.fog]}),t(e.projection,n.projection)||r.push({command:tt.setProjection,args:[n.projection]});var i={},a=[];!function(e,n,r,i){var a;for(a in n=n||{},e=e||{})e.hasOwnProperty(a)&&(n.hasOwnProperty(a)||rt(a,r,i));for(a in n)if(n.hasOwnProperty(a)){var o=n[a];e.hasOwnProperty(a)?t(e[a],o)||("geojson"===e[a].type&&"geojson"===o.type&&at(e,n,a)?r.push({command:tt.setGeoJSONSourceData,args:[a,o.data]}):it(a,n,r,i)):nt(a,n,r)}}(e.sources,n.sources,a,i);var o=[];e.layers&&e.layers.forEach((function(e){e.source&&i[e.source]?r.push({command:tt.removeLayer,args:[e.id]}):o.push(e)}));var s=e.terrain;s&&i[s.source]&&(r.push({command:tt.setTerrain,args:[void 0]}),s=void 0),r=r.concat(a),t(s,n.terrain)||r.push({command:tt.setTerrain,args:[n.terrain]}),function(e,n,r){n=n||[];var i,a,o,s,l,c,u,f=(e=e||[]).map(st),h=n.map(st),d=e.reduce(lt,{}),p=n.reduce(lt,{}),m=f.slice(),v=Object.create(null);for(i=0,a=0;i0)throw new Error("Unimplemented: ".concat(a.map((function(e){return e.command})).join(", "),"."));return i.forEach((function(e){"setTransition"!==e.command&&"setProjection"!==e.command&&r[e.command].apply(r,e.args)})),this.stylesheet=n,this._updateMapProjection(),!0}},{key:"addImage",value:function(t,n){return this.getImage(t)?this.fire(new e.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(t,n),this._afterImageUpdated(t),this)}},{key:"updateImage",value:function(e,t){this.imageManager.updateImage(e,t)}},{key:"getImage",value:function(e){return this.imageManager.getImage(e)}},{key:"removeImage",value:function(t){return this.getImage(t)?(this.imageManager.removeImage(t),this._afterImageUpdated(t),this):this.fire(new e.ErrorEvent(new Error("No image with this name exists.")))}},{key:"_afterImageUpdated",value:function(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))}},{key:"listImages",value:function(){return this._checkLoaded(),this._availableImages.slice()}},{key:"addSource",value:function(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._checkLoaded(),void 0!==this.getSource(t))throw new Error("There is already a source with this ID");if(!n.type)throw new Error("The type property must be defined, but only the following properties were given: ".concat(Object.keys(n).join(", "),"."));if(!(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(e.validateSource,"sources.".concat(t),n,null,i))){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var a=He(t,n,this.dispatcher,this);a.setEventedParent(this,(function(){return{isSourceLoaded:r._isSourceCacheLoaded(t),source:a.serialize(),sourceId:t}}));var o=function(n){var i=(n?"symbol:":"other:")+t,o=r._sourceCaches[i]=new e.SourceCache(i,a,n);(n?r._symbolSourceCaches:r._otherSourceCaches)[t]=o,o.style=r,o.onAdd(r.map)};o(!1),"vector"!==n.type&&"geojson"!==n.type||o(!0),a.onAdd&&a.onAdd(this.map),this._changed=!0}}},{key:"removeSource",value:function(t){this._checkLoaded();var n=this.getSource(t);if(!n)throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'.concat(t,'" cannot be removed while layer "').concat(r,'" is using it.'))));if(this.terrain&&this.terrain.get().source===t)return this.fire(new e.ErrorEvent(new Error('Source "'.concat(t,'" cannot be removed while terrain is using it.'))));var i,a=this._getSourceCaches(t),o=h(a);try{for(o.s();!(i=o.n()).done;){var s=i.value;delete this._sourceCaches[s.id],delete this._updatedSources[s.id],s.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:s.getSource().id})),s.setEventedParent(null),s.clearTiles()}}catch(l){o.e(l)}finally{o.f()}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],n.setEventedParent(null),n.onRemove&&n.onRemove(this.map),this._changed=!0,this}},{key:"setGeoJSONSourceData",value:function(e,t){this._checkLoaded(),this.getSource(e).setData(t),this._changed=!0}},{key:"getSource",value:function(e){var t=this._getSourceCache(e);return t&&t.getSource()}},{key:"_getSources",value:function(){var e=[];for(var t in this._otherSourceCaches){var n=this._getSourceCache(t);n&&e.push(n.getSource())}return e}},{key:"addLayer",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(new Error('Layer with id "'.concat(i,'" already exists on this map'))));else{var a;if("custom"===t.type){if(on(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if("object"==typeof t.source&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateLayer,"layers.".concat(i),t,{arrayIndex:-1},r))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize(),this._updateLayerCount(a,!0)}var o=n?this._order.indexOf(n):this._order.length;if(n&&-1===o)this.fire(new e.ErrorEvent(new Error('Layer with id "'.concat(n,'" does not exist on this map.'))));else{this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a;var s=this._getLayerSourceCache(a);if(this._removedLayers[i]&&a.source&&s&&"custom"!==a.type){var l=this._removedLayers[i];delete this._removedLayers[i],l.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",s.pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map),this._updateDrapeFirstLayers()}}}},{key:"moveLayer",value:function(t,n){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==n){var r=this._order.indexOf(t);this._order.splice(r,1);var i=n?this._order.indexOf(n):this._order.length;n&&-1===i?this.fire(new e.ErrorEvent(new Error('Layer with id "'.concat(n,'" does not exist on this map.')))):(this._order.splice(i,0,t),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}}else this.fire(new e.ErrorEvent(new Error("The layer '".concat(t,"' does not exist in the map's style and cannot be moved."))))}},{key:"removeLayer",value:function(t){this._checkLoaded();var n=this._layers[t];if(n){n.setEventedParent(null),this._updateLayerCount(n,!1);var r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map),this._updateDrapeFirstLayers()}else this.fire(new e.ErrorEvent(new Error("The layer '".concat(t,"' does not exist in the map's style and cannot be removed."))))}},{key:"getLayer",value:function(e){return this._layers[e]}},{key:"hasLayer",value:function(e){return e in this._layers}},{key:"hasLayerType",value:function(e){for(var t in this._layers)if(this._layers[t].type===e)return!0;return!1}},{key:"setLayerZoomRange",value:function(t,n,r){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===n&&i.maxzoom===r||(null!=n&&(i.minzoom=n),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error("The layer '".concat(t,"' does not exist in the map's style and cannot have zoom extent."))))}},{key:"setFilter",value:function(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();var a=this.getLayer(n);if(a){if(!t(a.filter,r))return null==r?(a.filter=void 0,void this._updateLayer(a)):void(this._validate(e.validateFilter,"layers.".concat(a.id,".filter"),r,{layerType:a.type},i)||(a.filter=e.clone$1(r),this._updateLayer(a)))}else this.fire(new e.ErrorEvent(new Error("The layer '".concat(n,"' does not exist in the map's style and cannot be filtered."))))}},{key:"getFilter",value:function(t){var n=this.getLayer(t);return n&&e.clone$1(n.filter)}},{key:"setLayoutProperty",value:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();var o=this.getLayer(n);o?t(o.getLayoutProperty(r),i)||(o.setLayoutProperty(r,i,a),this._updateLayer(o)):this.fire(new e.ErrorEvent(new Error("The layer '".concat(n,"' does not exist in the map's style and cannot be styled."))))}},{key:"getLayoutProperty",value:function(t,n){var r=this.getLayer(t);if(r)return r.getLayoutProperty(n);this.fire(new e.ErrorEvent(new Error("The layer '".concat(t,"' does not exist in the map's style."))))}},{key:"setPaintProperty",value:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();var o=this.getLayer(n);o?t(o.getPaintProperty(r),i)||(o.setPaintProperty(r,i,a)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new e.ErrorEvent(new Error("The layer '".concat(n,"' does not exist in the map's style and cannot be styled."))))}},{key:"getPaintProperty",value:function(e,t){var n=this.getLayer(e);return n&&n.getPaintProperty(t)}},{key:"setFeatureState",value:function(t,n){this._checkLoaded();var r=t.source,i=t.sourceLayer,a=this.getSource(r);if(a){var o=a.type;if("geojson"===o&&i)this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));else if("vector"!==o||i){void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided.")));var s,l=this._getSourceCaches(r),c=h(l);try{for(c.s();!(s=c.n()).done;)s.value.setFeatureState(i,t.id,n)}catch(u){c.e(u)}finally{c.f()}}else this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '".concat(r,"' does not exist in the map's style."))))}},{key:"removeFeatureState",value:function(t,n){this._checkLoaded();var r=t.source,i=this.getSource(r);if(i){var a=i.type,o="vector"===a?t.sourceLayer:void 0;if("vector"!==a||o)if(n&&"string"!=typeof t.id&&"number"!=typeof t.id)this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));else{var s,l=this._getSourceCaches(r),c=h(l);try{for(c.s();!(s=c.n()).done;)s.value.removeFeatureState(o,t.id,n)}catch(u){c.e(u)}finally{c.f()}}else this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '".concat(r,"' does not exist in the map's style."))))}},{key:"getFeatureState",value:function(t){this._checkLoaded();var n=t.source,r=t.sourceLayer,i=this.getSource(n);if(i){if("vector"!==i.type||r)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(n)[0].getFeatureState(r,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '".concat(n,"' does not exist in the map's style."))))}},{key:"getTransition",value:function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}},{key:"serialize",value:function(){var t={};for(var n in this._sourceCaches){var r=this._sourceCaches[n].getSource();t[r.id]||(t[r.id]=r.serialize())}return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:t,layers:this._serializeLayers(this._order)},(function(e){return void 0!==e}))}},{key:"_updateLayer",value:function(e){this._updatedLayers[e.id]=!0;var t=this._getLayerSourceCache(e);e.source&&!this._updatedSources[e.source]&&t&&"raster"!==t.getSource().type&&(this._updatedSources[e.source]="reload",t.pause()),this._changed=!0,e.invalidateCompiledFilter()}},{key:"_flattenAndSortRenderedFeatures",value:function(e){for(var t=this,n=function(e){return"fill-extrusion"===t._layers[e].type},r={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(n(o)){r[o]=a;var s,l=h(e);try{for(l.s();!(s=l.n()).done;){var c=s.value[o];if(c){var u,f=h(c);try{for(f.s();!(u=f.n()).done;){var d=u.value;i.push(d)}}catch(M){f.e(M)}finally{f.f()}}}}catch(M){l.e(M)}finally{l.f()}}}i.sort((function(e,t){return t.intersectionZ-e.intersectionZ}));for(var p=[],m=this._order.length-1;m>=0;m--){var v=this._order[m];if(n(v))for(var y=i.length-1;y>=0;y--){var g=i[y].feature;if(r[g.layer.id]1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded();var r=this.light.getLight(),i=!1;for(var a in e)if(!t(e[a],r[a])){i=!0;break}if(i){var o=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(e,n),this.light.updateTransitions(o)}}},{key:"getTerrain",value:function(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}},{key:"setTerrainForDraping",value:function(){this.setTerrain({source:"",exaggeration:0},0)}},{key:"setTerrain",value:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this._checkLoaded(),!n)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);var i=n;if(1===r){if("object"==typeof i.source){var a="terrain-dem-src";this.addSource(a,i.source),i=e.clone$1(i),i=e.extend(i,{source:a})}if(this._validate(e.validateTerrain,"terrain",i))return}if(!this.terrain||this.terrain&&r!==this.terrain.drapeRenderMode){if(!i)return;this._createTerrain(i,r)}else{for(var o=this.terrain,s=o.get(),l=0,c=Object.keys(e.spec.terrain);l4&&void 0!==arguments[4]?arguments[4]:{};return(!a||!1!==a.validate)&&on(this,t.call(e.validateStyle,e.extend({key:n,style:this.serialize(),value:r,styleSpec:e.spec},i)))}},{key:"_remove",value:function(){for(var t in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[t].setEventedParent(null);for(var n in this._sourceCaches)this._sourceCaches[n].clearTiles(),this._sourceCaches[n].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}},{key:"_clearSource",value:function(e){var t,n=this._getSourceCaches(e),r=h(n);try{for(r.s();!(t=r.n()).done;)t.value.clearTiles()}catch(i){r.e(i)}finally{r.f()}}},{key:"_reloadSource",value:function(e){var t,n=this._getSourceCaches(e),r=h(n);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.resume(),i.reload()}}catch(a){r.e(a)}finally{r.f()}}},{key:"_reloadSources",value:function(){var e,t=h(this._getSources());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.reload&&n.reload()}}catch(r){t.e(r)}finally{t.f()}}},{key:"_updateSources",value:function(e){for(var t in this._sourceCaches)this._sourceCaches[t].update(e)}},{key:"_generateCollisionBoxes",value:function(){for(var e in this._sourceCaches){var t=this._sourceCaches[e];t.resume(),t.reload()}}},{key:"_updatePlacement",value:function(t,n,r,i){var a,o=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=!1,c=!1,u={},f=h(this._order);try{var d=function(){var e=a.value,n=o._layers[e];if("symbol"!==n.type)return 0;if(!u[n.source]){var r=o._getLayerSourceCache(n);if(!r)return 0;u[n.source]=r.getRenderableIds(!0).map((function(e){return r.getTileByID(e)})).sort((function(e,t){return t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)}))}var i=o.crossTileSymbolIndex.addLayer(n,u[n.source],t.center.lng,t.projection);l=l||i};for(f.s();!(a=f.n()).done;)d()}catch(g){f.e(g)}finally{f.f()}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),s=s||this._layerOrderChanged||0===r,this._layerOrderChanged&&this.fire(new e.Event("neworder")),(s||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.exported.now(),t.zoom))&&(this.pauseablePlacement=new Qt(t,this._order,s,n,r,i,this.placement,this.fog&&t.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,u),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.exported.now()),c=!0),l&&this.pauseablePlacement.placement.setStale()),c||l){var p,m=h(this._order);try{for(m.s();!(p=m.n()).done;){var v=p.value,y=this._layers[v];"symbol"===y.type&&this.placement.updateLayerOpacities(y,u[y.source])}}catch(g){m.e(g)}finally{m.f()}}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.exported.now())}},{key:"_releaseSymbolFadeTiles",value:function(){for(var e in this._sourceCaches)this._sourceCaches[e].releaseSymbolFadeTiles()}},{key:"getImages",value:function(e,t,n){this.imageManager.getImages(t.icons,n),this._updateTilesForChangedImages();var r=function(e){e&&e.setDependencies(t.tileID.key,t.type,t.icons)};r(this._otherSourceCaches[t.source]),r(this._symbolSourceCaches[t.source])}},{key:"getGlyphs",value:function(e,t,n){this.glyphManager.getGlyphs(t.stacks,n)}},{key:"getResource",value:function(t,n,r){return e.makeRequest(n,r)}},{key:"_getSourceCache",value:function(e){return this._otherSourceCaches[e]}},{key:"_getLayerSourceCache",value:function(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}},{key:"_getSourceCaches",value:function(e){var t=[];return this._otherSourceCaches[e]&&t.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&t.push(this._symbolSourceCaches[e]),t}},{key:"_isSourceCacheLoaded",value:function(t){var n=this._getSourceCaches(t);return 0===n.length?(this.fire(new e.ErrorEvent(new Error("There is no source with ID '".concat(t,"'")))),!1):n.every((function(e){return e.loaded()}))}},{key:"has3DLayers",value:function(){return this._num3DLayers>0}},{key:"hasSymbolLayers",value:function(){return this._numSymbolLayers>0}},{key:"hasCircleLayers",value:function(){return this._numCircleLayers>0}},{key:"_clearWorkerCaches",value:function(){this.dispatcher.broadcast("clearCaches")}},{key:"destroy",value:function(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}]),a}(e.Evented);fn.getSourceType=function(e){return Ue[e]},fn.setSourceType=function(e,t){Ue[e]=t},fn.registerForPluginStateChange=e.registerForPluginStateChange;var hn="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#define EXTENT 8192.0\n#define HALF_PI PI/2.0\n#define QUARTER_PI PI/4.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0",dn="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",pn="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\nconst float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#ifdef TERRAIN\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;\n#else\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;\n#endif\nuniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));\n#ifdef TERRAIN_DEM_NEAREST_FILTER\nreturn u_exaggeration*tl;\n#endif\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nfloat tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;\n#else\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);\n#endif\nreturn vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",mn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",vn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",yn={},gn={},_n=[];zn(hn,_n),zn(pn,_n),zn(mn,_n),zn(vn,_n),yn=Mn("",pn),gn=Mn(vn,mn);var xn=Mn("\n#if __VERSION__ >=300\n#define varying in\n#define gl_FragColor glFragColor\n#define texture2D texture\n#define textureCube texture\nout vec4 glFragColor;\n#endif\nhighp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}","\n#if __VERSION__ >=300\n#define attribute in\n#define varying out\n#define texture2D texture\n#endif\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."),bn=hn,wn="\n#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",kn={background:Mn("uniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nvarying vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform vec4 u_color;varying vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(u_color);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:Mn("uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:Mn("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}"),clippingMask:Mn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Mn("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:Mn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:Mn("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}","attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Mn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-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(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Mn("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;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;\n#endif\nvarying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}"),fill:Mn("#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\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_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);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:Mn("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);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_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;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:Mn("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(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 float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:Mn("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*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 float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:Mn("varying vec4 v_color;\n#ifdef RENDER_SHADOWS\nvarying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\nvoid main() {\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvec3 normal=v_normal;\n#endif\nfloat z;vec4 color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);\n#else\ncolor=v_color;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef ZERO_ROOF_RADIUS\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#endif\ncolor.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=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;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec4 v_color;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\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\nvec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nv_normal=normal;\n#endif\nbase=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nv_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w;\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(color,NdotL);\n#else\nv_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_color*=u_opacity;\n#ifdef ZERO_ROOF_RADIUS\nv_roof_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef LIGHTING_3D_MODE\nv_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));\n#else\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:Mn("uniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,v_NdotL)*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\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 float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_NdotL=NdotL;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:Mn("#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 vec4 u_unpack;float getElevation(vec2 coord) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nreturn texture2D(u_image,coord).a/4.0;\n#else\nvec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;\n#endif\n}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.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;}"),hillshade:Mn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\ngl_FragColor=apply_lighting(gl_FragColor);\n#endif\n#ifdef FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\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;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:Mn("uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nuniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nfloat linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\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);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture2D(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trimmed=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef RENDER_LINE_ALPHA_DISCARD\nif (alpha < u_alpha_discard_threshold) {discard;}\n#endif\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);\n#ifdef RENDER_LINE_BORDER_AUTO\nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}\n#else\nout_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha);\n#endif\n}\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nattribute highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nattribute float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\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 floorwidth\n#pragma mapbox: initialize lowp vec4 dash\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;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat 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;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:Mn("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_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;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\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\n#pragma mapbox: define lowp float pixel_ratio\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\n#pragma mapbox: initialize lowp float pixel_ratio\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;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat 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;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:Mn("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(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*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 vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:Mn("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}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying 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_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}"),symbolSDF:Mn("#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}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying 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_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}"),symbolTextAndIcon:Mn("#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}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying 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_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}"),terrainRaster:Mn("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvarying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef RENDER_SHADOWS\ncolor.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nconst float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=wireframeOffset;\n#endif\nv_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;\n#endif\n}"),terrainDepth:Mn("#ifdef GL_ES\nprecision highp float;\n#endif\nvarying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:Mn("\nvarying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",dn),skyboxGradient:Mn("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",dn),skyboxCapture:Mn("\nvarying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;\n#ifdef GL_ES\nprecision highp float;\n#endif\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}","attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:Mn("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#else\ncolor=texture2D(u_image0,v_pos0);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nattribute vec3 a_globe_pos;attribute vec2 a_uv;\n#else\nattribute vec2 a_pos;\n#endif\nvarying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);\n#ifdef TERRAIN_WIREFRAME\nheight+=wireframeOffset;\n#endif\nglobe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}"),globeAtmosphere:Mn("uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x:\n(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:\nuv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}","attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}")};function zn(e,t){var n,r=e.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n"),i=h(r);try{for(i.s();!(n=i.n()).done;){var a=n.value;if("#"===(a=a.trim())[0]&&a.includes("if")&&!a.includes("endif")){var o,s=(a=a.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim()).split(" "),l=h(s);try{for(l.s();!(o=l.n()).done;){var c=o.value;t.includes(c)||t.push(c)}}catch(u){l.e(u)}finally{l.f()}}}}catch(u){i.e(u)}finally{i.f()}}function Mn(e,t){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=t.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),i={},a=[].concat(_n);return zn(e,a),zn(t,a),{fragmentSource:e=e.replace(n,(function(e,t,n,r,a){return i[a]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(a,"\nvarying ").concat(n," ").concat(r," ").concat(a,";\n#else\nuniform ").concat(n," ").concat(r," u_").concat(a,";\n#endif\n"):"\n#ifdef HAS_UNIFORM_u_".concat(a,"\n ").concat(n," ").concat(r," ").concat(a," = u_").concat(a,";\n#endif\n")})),vertexSource:t=t.replace(n,(function(e,t,n,r,a){var o="float"===r?"vec2":"vec4",s=a.match(/color/)?"color":o;return i[a]?"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(a,"\nuniform lowp float u_").concat(a,"_t;\nattribute ").concat(n," ").concat(o," a_").concat(a,";\nvarying ").concat(n," ").concat(r," ").concat(a,";\n#else\nuniform ").concat(n," ").concat(r," u_").concat(a,";\n#endif\n"):"vec4"===s?"\n#ifndef HAS_UNIFORM_u_".concat(a,"\n ").concat(a," = a_").concat(a,";\n#else\n ").concat(n," ").concat(r," ").concat(a," = u_").concat(a,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(a,"\n ").concat(a," = unpack_mix_").concat(s,"(a_").concat(a,", u_").concat(a,"_t);\n#else\n ").concat(n," ").concat(r," ").concat(a," = u_").concat(a,";\n#endif\n"):"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(a,"\nuniform lowp float u_").concat(a,"_t;\nattribute ").concat(n," ").concat(o," a_").concat(a,";\n#else\nuniform ").concat(n," ").concat(r," u_").concat(a,";\n#endif\n"):"vec4"===s?"\n#ifndef HAS_UNIFORM_u_".concat(a,"\n ").concat(n," ").concat(r," ").concat(a," = a_").concat(a,";\n#else\n ").concat(n," ").concat(r," ").concat(a," = u_").concat(a,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(a,"\n ").concat(n," ").concat(r," ").concat(a," = unpack_mix_").concat(s,"(a_").concat(a,", u_").concat(a,"_t);\n#else\n ").concat(n," ").concat(r," ").concat(a," = u_").concat(a,";\n#endif\n")})),staticAttributes:r,usedDefines:a}}var Tn=function(){function e(){d(this,e),this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}return p(e,[{key:"bind",value:function(e,t,n,r,i,a,o){this.context=e;for(var s=this.boundPaintVertexBuffers.length!==r.length,l=0;!s&&l=1||!this._validOp(n);)if(!this._nextOp(n,e)){delete this.operations[t];break}}}},{key:"_nextOp",value:function(e,t){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=t,!0)}},{key:"_validOp",value:function(e){return e.from.hasData()&&e.to.hasData()}}]),e}()),On={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Bn(e){return 6*Math.pow(1.5,22-e)}function Nn(e,t){var n=1<0){var o=e.exported.now(),s=(o-t.timeAdded)/a,l=n?(o-n.timeAdded)/a:-1,c=r.getSource(),u=i.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),f=!n||Math.abs(n.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),h=f&&t.refreshedUponExpiration?1:e.clamp(f?s:1-l,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),n?{opacity:1,mix:1-h}:{opacity:h,mix:0}}return{opacity:1,mix:0}}var jn=function(e){m(n,e);var t=v(n);function n(e){var r;d(this,n);var a={type:"raster-dem",maxzoom:e.transform.maxZoom},o=new U(Je(),null),s=He("mock-dem",a,o,e.style);return r=t.call(this,"mock-dem",s,!1),s.setEventedParent(i(r)),r._sourceLoaded=!0,r}return p(n,[{key:"_loadTile",value:function(e,t){e.state="loaded",t(null)}}]),n}(e.SourceCache),Un=function(t){m(r,t);var n=v(r);function r(e){var t;d(this,r);var a=He("proxy",{type:"geojson",maxzoom:e.transform.maxZoom},new U(Je(),null),e.style);return t=n.call(this,"proxy",a,!1),a.setEventedParent(i(t)),t.map=t.getSource().map=e,t.used=t._sourceLoaded=!0,t.renderCache=[],t.renderCachePool=[],t.proxyCachedFBO={},t}return p(r,[{key:"update",value:function(t,n,r){var i=this;if(!t.freezeTileCoverage){this.transform=t;var a=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((function(n,r){if(n[r.key]="",!i._tiles[r.key]){var a=new e.Tile(r,i._source.tileSize*r.overscaleFactor(),t.tileZoom);a.state="loaded",i._tiles[r.key]=a}return n}),{});for(var o in this._tiles)o in a||(this.freeFBO(o),this._tiles[o].unloadVectorData(),delete this._tiles[o])}}},{key:"freeFBO",value:function(e){var t=this.proxyCachedFBO[e];if(void 0!==t){var n,r=Object.values(t);(n=this.renderCachePool).push.apply(n,r),delete this.proxyCachedFBO[e]}}},{key:"deallocRenderCache",value:function(){this.renderCache.forEach((function(e){return e.fb.destroy()})),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}]),r}(e.SourceCache),Hn=function(e){m(n,e);var t=v(n);function n(e,r,i){var a;return d(this,n),(a=t.call(this,e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)).proxyTileKey=r,a.projMatrix=i,a}return p(n)}(e.OverscaledTileID),Zn=function(t){m(r,t);var n=v(r);function r(t,i){var a;d(this,r),(a=n.call(this)).painter=t,a.terrainTileForTile={},a.prevTerrainTileForTile={};var o=function(t){var n=new e.StructArrayLayout2i4,r=new e.StructArrayLayout3ui6,i=131;n.reserve(17161),r.reserve(33800);for(var a=e.EXTENT/128,o=e.EXTENT+a/2,s=o+a,l=-a;lo||l<0||l>o?24575:0,f=e.clamp(Math.round(c),0,e.EXTENT),h=e.clamp(Math.round(l),0,e.EXTENT);n.emplaceBack(f+u,h)}for(var d=function(e,t){var n=t*i+e;r.emplaceBack(n+1,n,n+i),r.emplaceBack(n+i,n+i+1,n+1)},p=1;p<129;p++)for(var m=1;m<129;m++)d(m,p);return[0,129].forEach((function(e){for(var t=0;t<130;t++)d(t,e),d(e,t)})),[n,r,32768]}(),s=f(o,3),l=s[0],c=s[1],u=s[2],h=t.context;a.gridBuffer=h.createVertexBuffer(l,e.posAttributes.members),a.gridIndexBuffer=h.createIndexBuffer(c),a.gridSegments=e.SegmentVector.simpleSegment(0,0,l.length,c.length),a.gridNoSkirtSegments=e.SegmentVector.simpleSegment(0,0,l.length,u),a.proxyCoords=[],a.proxiedCoords={},a._visibleDemTiles=[],a._drapedRenderBatches=[],a._sourceTilesOverlap={},a.proxySourceCache=new Un(i.map),a.orthoMatrix=e.create(),e.ortho(a.orthoMatrix,"globe"===a.painter.transform.projection.name?.015:0,e.EXTENT,0,e.EXTENT,0,1);var p=h.gl;return a._overlapStencilMode=new e.StencilMode({func:p.GEQUAL,mask:255},0,255,p.KEEP,p.KEEP,p.REPLACE),a._previousZoom=t.transform.zoom,a.pool=[],a._findCoveringTileCache={},a._tilesDirty={},a.style=i,a._useVertexMorphing=!0,a._exaggeration=1,a._mockSourceCache=new jn(i.map),a}return p(r,[{key:"style",set:function(e){var t=this;e.on("data",this._onStyleDataEvent.bind(this)),e.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=e,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",(function(){t._clearLineLayersFromRenderCache()}))}},{key:"update",value:function(t,n,r){var i=this;if(t&&t.terrain){this._style!==t&&(this.style=t),this.enabled=!0;var a=t.terrain.properties;this.sourceCache=0===t.terrain.drapeRenderMode?this._mockSourceCache:t._getSourceCache(a.get("source")),this._exaggeration=a.get("exaggeration");var o=function(){i.sourceCache.used&&e.warnOnce("Raster DEM source '".concat(i.sourceCache.id,"' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source."));var t=i.getScaledDemTileSize();i.sourceCache.update(n,t,!0),i.resetTileLookupCache(i.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,o(),this._initializing=!0),o(),n.updateElevation(!0,r),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(n),this._emptyDEMTextureDirty=!0}else this._disable()}},{key:"resetTileLookupCache",value:function(e){this._findCoveringTileCache[e]={}}},{key:"getScaledDemTileSize",value:function(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}},{key:"_checkRenderCacheEfficiency",value:function(){var t=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==t.efficiency&&e.warnOnce("Terrain render cache efficiency is not optimal (".concat(t.efficiency,"%) and performance\n may be affected negatively, consider placing all background, fill and line layers before layer\n with id '").concat(t.firstUndrapedLayer,"' or create a map using optimizeForTerrain: true option."))}},{key:"_onStyleDataEvent",value:function(e){e.coord&&"source"===e.dataType?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this._invalidateRenderCache=!0)}},{key:"_disable",value:function(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(var e in this._style._sourceCaches)this._style._sourceCaches[e].usedForTerrain=!1}},{key:"destroy",value:function(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach((function(e){return e.fb.destroy()})),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}},{key:"_source",value:function(){return this.enabled?this.sourceCache:null}},{key:"isUsingMockSource",value:function(){return this.sourceCache===this._mockSourceCache}},{key:"exaggeration",value:function(){return this._exaggeration}},{key:"visibleDemTiles",get:function(){return this._visibleDemTiles}},{key:"drapeBufferSize",get:function(){var e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}},{key:"useVertexMorphing",set:function(e){this._useVertexMorphing=e}},{key:"updateTileBinding",value:function(t){var n=this;if(this.enabled){this.prevTerrainTileForTile=this.terrainTileForTile;var r=this.proxySourceCache,i=this.painter.transform;this._initializing&&(this._initializing=0===i._centerAltitude&&-1===this.getAtPointOrZero(e.MercatorCoordinate.fromLngLat(i.center),-1),this._emptyDEMTextureDirty=!this._initializing);var a=this.proxyCoords=r.getIds().map((function(e){var t=r.getTileByID(e).tileID;return t.projMatrix=i.calculateProjMatrix(t.toUnwrapped()),t}));!function(t,n){var r=n.transform.pointCoordinate(n.transform.getCameraPoint()),i=new e.Point(r.x,r.y);t.sort((function(t,n){if(n.overscaledZ-t.overscaledZ)return n.overscaledZ-t.overscaledZ;var r=new e.Point(t.canonical.x+(1<0&&e++,t+r}),0);return e?t/e:0}},{key:"_updateEmptyDEMTexture",value:function(){var t=this.painter.context,n=t.gl;t.activeTexture.set(n.TEXTURE2);var r=this._getLoadedAreaMinimum(),i=new e.RGBAImage({width:1,height:1},new Uint8Array(e.DEMData.pack(r,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;var a=this._emptyDEMTexture;return a?a.update(i,{premultiply:!1}):a=this._emptyDEMTexture=new e.Texture(t,i,n.RGBA,{premultiply:!1}),a}},{key:"setupElevationDraw",value:function(t,n,r){var i,a=this.painter.context,o=a.gl,s=(i=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:e.DEMData.getUnpackVector(i),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});s.u_dem_size=this.sourceCache.getSource().tileSize,s.u_exaggeration=this.exaggeration();var l=null,c=null,u=1;if(r&&r.morphing&&this._useVertexMorphing){var f=r.morphing.srcDemTile,h=r.morphing.dstDemTile;u=r.morphing.phase,f&&h&&(this._prepareDemTileUniforms(t,f,s,"_prev")&&(c=f),this._prepareDemTileUniforms(t,h,s)&&(l=h))}if(c&&l?(a.activeTexture.set(o.TEXTURE2),l.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),a.activeTexture.set(o.TEXTURE4),c.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),s.u_dem_lerp=u):(l=this.terrainTileForTile[t.tileID.key],a.activeTexture.set(o.TEXTURE2),(this._prepareDemTileUniforms(t,l,s)?l.demTexture:this.emptyDEMTexture).bind(o.NEAREST,o.CLAMP_TO_EDGE)),a.activeTexture.set(o.TEXTURE3),r&&r.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),this._depthFBO&&(s.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),s.u_depth_size_inv=[1,1]),r&&r.useMeterToDem&&l){var d=(1<t.renderCachePool.length){var n=Object.values(t.proxyCachedFBO);t.proxyCachedFBO={};for(var r=0;r=0;l--){var c=o[l];if(t.getTileByID(c.key),void 0!==t.proxyCachedFBO[c.key]){var f=e[c.key],d=this.proxyToSource[c.key],p=0,m=function(e){var t=d[e],n=f[e];if(!n||n.length!==t.length||t.some((function(t,r){return t!==n[r]||s[e]&&s[e].hasOwnProperty(t.key)})))return p=-1,1;++p};for(var v in d)if(m(v))break;for(var y in t.proxyCachedFBO[c.key])t.renderCache[t.proxyCachedFBO[c.key][y]].dirty=p<0||p!==Object.values(f).length}}var g=u(this._drapedRenderBatches);g.sort((function(e,t){return t.end-t.start-(e.end-e.start)}));var _,x=h(g);try{for(x.s();!(_=x.n()).done;){var b,w=_.value,k=h(o);try{for(k.s();!(b=k.n()).done;){var z=b.value;if(!t.proxyCachedFBO[z.key]){var M=t.renderCachePool.pop();void 0===M&&t.renderCache.length<50&&(M=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==M&&(t.proxyCachedFBO[z.key]={},t.proxyCachedFBO[z.key][w.start]=M,t.renderCache[M].dirty=!0)}}}catch(T){k.e(T)}finally{k.f()}}}catch(T){x.e(T)}finally{x.f()}this._tilesDirty={}}}},{key:"_setupStencil",value:function(e,t,n,r){if(r&&this._sourceTilesOverlap[r.id]){var i=this.painter.context,a=i.gl;if(t.length<=1)this._overlapStencilType=!1;else{var o;if(n.isTileClipped())o=t.length,this._overlapStencilMode.test={func:a.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);o=1,this._overlapStencilMode.test={func:a.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+o>255&&(i.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=o,this._overlapStencilMode.ref=this._stencilRef,n.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}}else this._overlapStencilType&&(this._overlapStencilType=!1)}},{key:"clipOrMaskOverlapStencilType",value:function(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}},{key:"stencilModeForRTTOverlap",value:function(t){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[t.key]),this._overlapStencilMode):e.StencilMode.disabled}},{key:"_renderTileClippingMasks",value:function(t,n){var r=this.painter,i=this.painter.context,a=i.gl;r._tileClippingMaskIDs={},i.setColorMode(e.ColorMode.disabled),i.setDepthMode(e.DepthMode.disabled);var o,s=r.useProgram("clippingMask"),l=h(t);try{for(l.s();!(o=l.n()).done;){var c=o.value,u=r._tileClippingMaskIDs[c.key]=--n;s.draw(i,a.TRIANGLES,e.DepthMode.disabled,new e.StencilMode({func:a.ALWAYS,mask:0},u,255,a.KEEP,a.KEEP,a.REPLACE),e.ColorMode.disabled,e.CullFaceMode.disabled,Fn(c.projMatrix),"$clipping",r.tileExtentBuffer,r.quadTriangleIndexBuffer,r.tileExtentSegments)}}catch(f){l.e(f)}finally{l.f()}}},{key:"pointCoordinate",value:function(t){var n=this.painter.transform;if(t.x<0||t.x>n.width||t.y<0||t.y>n.height)return null;var r=[t.x,t.y,1,1];e.transformMat4$1(r,r,n.pixelMatrixInverse),e.scale$1(r,r,1/r[3]),r[0]/=n.worldSize,r[1]/=n.worldSize;var i=n._camera.position,a=e.mercatorZfromAltitude(1,n.center.lat),o=[i[0],i[1],i[2]/a,0],s=e.subtract([],r.slice(0,3),o);e.normalize(s,s);var l=this.raycast(o,s,this._exaggeration);return null!==l&&l?(e.scaleAndAdd(o,o,s,l),o[3]=o[2],o[2]*=a,o):null}},{key:"drawDepth",value:function(){var t=this.painter,n=t.context,r=this.proxySourceCache,i=Math.ceil(t.width),a=Math.ceil(t.height);if(!this._depthFBO||this._depthFBO.width===i&&this._depthFBO.height===a||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){var o=n.gl,s=n.createFramebuffer(i,a,!0);n.activeTexture.set(o.TEXTURE0);var l=new e.Texture(n,{width:i,height:a,data:null},o.RGBA);l.bind(o.NEAREST,o.CLAMP_TO_EDGE),s.colorAttachment.set(l.texture);var c=n.createRenderbuffer(n.gl.DEPTH_COMPONENT16,i,a);s.depthAttachment.set(c),this._depthFBO=s,this._depthTexture=l}n.bindFramebuffer.set(this._depthFBO.framebuffer),n.viewport.set([0,0,i,a]),function(t,n,r,i){if("globe"!==t.transform.projection.name){var a=t.context,o=a.gl;a.clear({depth:1});var s,l=t.useProgram("terrainDepth"),c=new e.DepthMode(o.LESS,e.DepthMode.ReadWrite,t.depthRangeFor3D),u=h(i);try{for(u.s();!(s=u.n()).done;){var f=s.value,d=r.getTile(f),p=Pn(f.projMatrix,0);n.setupElevationDraw(d,l),l.draw(a,o.TRIANGLES,c,e.StencilMode.disabled,e.ColorMode.unblended,e.CullFaceMode.backCCW,p,"terrain_depth",n.gridBuffer,n.gridIndexBuffer,n.gridNoSkirtSegments)}}catch(m){u.e(m)}finally{u.f()}}}(t,this,r,this.proxyCoords)}},{key:"_setupProxiedCoordsForOrtho",value:function(e,t,n){if(e.getSource()instanceof je)return this._setupProxiedCoordsForImageSource(e,t,n);this._findCoveringTileCache[e.id]=this._findCoveringTileCache[e.id]||{};for(var r=this.proxiedCoords[e.id]=[],i=this.proxyCoords,a=0;ao+l.max.x||i+as+l.max.y},u=0;u0?(s=(o=e.EXTENT>>c)*((n.tileID.canonical.x<=u){var f=t.canonical.z-u;n.getSource().reparseOverscaled?(s=Math.max(t.canonical.z+2,n.transform.tileZoom),o=new e.OverscaledTileID(s,t.wrap,u,t.canonical.x>>f,t.canonical.y>>f)):0!==f&&(s=u,o=new e.OverscaledTileID(s,t.wrap,u,t.canonical.x>>f,t.canonical.y>>f))}o.key!==t.key&&(c.push(o.key),r=n.getTile(o))}var h=function(e){c.forEach((function(t){i[t]=e})),c.length=0};for(s-=1;s>=l&&(!r||!r.hasData());s--){r&&h(r.tileID.key);var d=o.calculateScaledKey(s);if((r=n.getTileByID(d))&&r.hasData())break;var p=i[d];if(null===p)break;void 0===p?c.push(d):r=n.getTileByID(p)}return h(r?r.tileID.key:null),r&&r.hasData()?r:null}},{key:"findDEMTileFor",value:function(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}},{key:"prepareDrawTile",value:function(){this.renderedToTile=!0}},{key:"_clearRenderCacheForTile",value:function(e,t){var n=this._tilesDirty[e];n||(n=this._tilesDirty[e]={}),n[t.key]=!0}},{key:"getWirefameBuffer",value:function(){if(!this.wireframeSegments){var t=function(t){for(var n=0,r=new e.StructArrayLayout2ui4,i=131,a=1;a<129;a++){for(var o=1;o<129;o++)n=a*i+o,r.emplaceBack(n,n+1),r.emplaceBack(n,n+i),r.emplaceBack(n+1,n+i),128===a&&r.emplaceBack(n+i,n+i+1);r.emplaceBack(n+1,n+1+i)}return r}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(t),this.wireframeSegments=e.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,t.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}]),r}(e.Elevation),Gn=function(){function t(n,r,i,a,o,s){d(this,t);var l=n.gl;this.program=l.createProgram();var c=function(e){for(var t=[],n=0;n>16,a>>16],u_pixel_coord_lower:[65535&i,65535&a]}}var Wn=e.create(),Xn=function(t,n,r,i,a,o,s,l,c,u,f){var h=n.style.light,d=h.properties.get("position"),p=[d.x,d.y,d.z],m=e.create$1();"viewport"===h.properties.get("anchor")&&(e.fromRotation(m,-n.transform.angle),e.transformMat3(p,p,m));var v=h.properties.get("color"),y=n.transform,g={u_matrix:t,u_lightpos:p,u_lightintensity:h.properties.get("intensity"),u_lightcolor:[v.r,v.g,v.b],u_vertical_gradient:+r,u_opacity:i,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Wn,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:a,u_edge_radius:o};return"globe"===y.projection.name&&(g.u_tile_id=[s.canonical.x,s.canonical.y,1<2&&void 0!==arguments[2]?arguments[2]:1}},ar=e.create(),or=function(t,n,r,i,a,o,s){var l=t.transform,c="globe"===l.projection.name,u=c?e.globePixelsToTileUnits(l.zoom,n.canonical)*l._pixelsPerMercatorPixel:H(r,1,o),f={u_matrix:n.projMatrix,u_extrude_scale:u,u_intensity:s,u_inv_rot_matrix:ar,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){f.u_inv_rot_matrix=i,f.u_merc_center=a,f.u_tile_id=[n.canonical.x,n.canonical.y,1<0?1-1/(1.001-s):-s),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:dr(i.paint.get("raster-hue-rotate")),u_perspective_transform:a};var o,s};function dr(e){e*=Math.PI/180;var t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}var pr,mr=e.create(),vr=function(t,n,r,i,a,o,s,l,c,u,f,h,d,p,m,v){var y=a.transform,g={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_camera_to_center_distance:y.cameraToCenterDistance,u_rotate_symbol:+r,u_aspect_ratio:y.width/y.height,u_fade_change:a.options.fadeDuration?a.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:s,u_coord_matrix:l,u_is_text:+c,u_pitch_with_map:+i,u_texsize:u,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:mr,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:mr,u_up_vector:[0,-1,0]};return"globe"===v.name&&(g.u_tile_id=[f.canonical.x,f.canonical.y,1<>16,u>>16],u_pixel_coord_lower:[65535&c,65535&u]}}(i,r,a),{u_matrix:t,u_opacity:n})},br={fillExtrusion:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_lightpos:new e.Uniform3f(t),u_lightintensity:new e.Uniform1f(t),u_lightcolor:new e.Uniform3f(t),u_vertical_gradient:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_edge_radius:new e.Uniform1f(t),u_ao:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_up_dir:new e.Uniform3f(t),u_height_lift:new e.Uniform1f(t)}},fillExtrusionPattern:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_lightpos:new e.Uniform3f(t),u_lightintensity:new e.Uniform1f(t),u_lightcolor:new e.Uniform3f(t),u_vertical_gradient:new e.Uniform1f(t),u_height_factor:new e.Uniform1f(t),u_edge_radius:new e.Uniform1f(t),u_ao:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_up_dir:new e.Uniform3f(t),u_height_lift:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t)}},fill:function(t){return{u_matrix:new e.UniformMatrix4f(t)}},fillPattern:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}},fillOutline:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_world:new e.Uniform2f(t)}},fillOutlinePattern:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_world:new e.Uniform2f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}},circle:function(t){return{u_camera_to_center_distance:new e.Uniform1f(t),u_extrude_scale:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_up_dir:new e.Uniform3f(t)}},collisionBox:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_extrude_scale:new e.Uniform2f(t)}},collisionCircle:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_inv_matrix:new e.UniformMatrix4f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_viewport_size:new e.Uniform2f(t)}},debug:function(t){return{u_color:new e.UniformColor(t),u_matrix:new e.UniformMatrix4f(t),u_overlay:new e.Uniform1i(t),u_overlay_scale:new e.Uniform1f(t)}},clippingMask:function(t){return{u_matrix:new e.UniformMatrix4f(t)}},heatmap:function(t){return{u_extrude_scale:new e.Uniform1f(t),u_intensity:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_up_dir:new e.Uniform3f(t)}},heatmapTexture:function(t){return{u_image:new e.Uniform1i(t),u_color_ramp:new e.Uniform1i(t),u_opacity:new e.Uniform1f(t)}},hillshade:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_latrange:new e.Uniform2f(t),u_light:new e.Uniform2f(t),u_shadow:new e.UniformColor(t),u_highlight:new e.UniformColor(t),u_accent:new e.UniformColor(t)}},hillshadePrepare:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_dimension:new e.Uniform2f(t),u_zoom:new e.Uniform1f(t),u_unpack:new e.Uniform4f(t)}},line:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_pixels_to_tile_units:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_units_to_pixels:new e.Uniform2f(t),u_dash_image:new e.Uniform1i(t),u_gradient_image:new e.Uniform1i(t),u_image_height:new e.Uniform1f(t),u_texsize:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_alpha_discard_threshold:new e.Uniform1f(t),u_trim_offset:new e.Uniform2f(t)}},linePattern:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_texsize:new e.Uniform2f(t),u_pixels_to_tile_units:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_units_to_pixels:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_alpha_discard_threshold:new e.Uniform1f(t)}},raster:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_tl_parent:new e.Uniform2f(t),u_scale_parent:new e.Uniform1f(t),u_fade_t:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_image0:new e.Uniform1i(t),u_image1:new e.Uniform1i(t),u_brightness_low:new e.Uniform1f(t),u_brightness_high:new e.Uniform1f(t),u_saturation_factor:new e.Uniform1f(t),u_contrast_factor:new e.Uniform1f(t),u_spin_weights:new e.Uniform3f(t),u_perspective_transform:new e.Uniform2f(t)}},symbolIcon:function(t){return{u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_camera_forward:new e.Uniform3f(t),u_tile_matrix:new e.UniformMatrix4f(t),u_up_vector:new e.Uniform3f(t),u_ecef_origin:new e.Uniform3f(t),u_texture:new e.Uniform1i(t)}},symbolSDF:function(t){return{u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_texture:new e.Uniform1i(t),u_gamma_scale:new e.Uniform1f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_camera_forward:new e.Uniform3f(t),u_tile_matrix:new e.UniformMatrix4f(t),u_up_vector:new e.Uniform3f(t),u_ecef_origin:new e.Uniform3f(t),u_is_halo:new e.Uniform1i(t)}},symbolTextAndIcon:function(t){return{u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_texsize_icon:new e.Uniform2f(t),u_texture:new e.Uniform1i(t),u_texture_icon:new e.Uniform1i(t),u_gamma_scale:new e.Uniform1f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_is_halo:new e.Uniform1i(t)}},background:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_opacity:new e.Uniform1f(t),u_color:new e.UniformColor(t)}},backgroundPattern:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_opacity:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_pattern_tl:new e.Uniform2f(t),u_pattern_br:new e.Uniform2f(t),u_texsize:new e.Uniform2f(t),u_pattern_size:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}},terrainRaster:In,terrainDepth:In,skybox:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_sun_direction:new e.Uniform3f(t),u_cubemap:new e.Uniform1i(t),u_opacity:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t)}},skyboxGradient:function(t){return{u_matrix:new e.UniformMatrix4f(t),u_color_ramp:new e.Uniform1i(t),u_center_direction:new e.Uniform3f(t),u_radius:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t)}},skyboxCapture:function(t){return{u_matrix_3f:new e.UniformMatrix3f(t),u_sun_direction:new e.Uniform3f(t),u_sun_intensity:new e.Uniform1f(t),u_color_tint_r:new e.Uniform4f(t),u_color_tint_m:new e.Uniform4f(t),u_luminance:new e.Uniform1f(t)}},globeRaster:function(t){return{u_proj_matrix:new e.UniformMatrix4f(t),u_globe_matrix:new e.UniformMatrix4f(t),u_normalize_matrix:new e.UniformMatrix4f(t),u_merc_matrix:new e.UniformMatrix4f(t),u_zoom_transition:new e.Uniform1f(t),u_merc_center:new e.Uniform2f(t),u_image0:new e.Uniform1i(t),u_grid_matrix:new e.UniformMatrix3f(t),u_skirt_height:new e.Uniform1f(t),u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_globe_pos:new e.Uniform3f(t),u_globe_radius:new e.Uniform1f(t),u_viewport:new e.Uniform2f(t)}},globeAtmosphere:function(t){return{u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_horizon:new e.Uniform1f(t),u_transition:new e.Uniform1f(t),u_fadeout_range:new e.Uniform1f(t),u_color:new e.Uniform4f(t),u_high_color:new e.Uniform4f(t),u_space_color:new e.Uniform4f(t),u_star_intensity:new e.Uniform1f(t),u_star_density:new e.Uniform1f(t),u_star_size:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t),u_horizon_angle:new e.Uniform1f(t),u_rotation_matrix:new e.UniformMatrix4f(t)}}};function wr(t,n,r,i,a,o,s){for(var l=t.context,c=l.gl,u=t.transform,f=t.useProgram("collisionBox"),h=[],d=0,p=0,m=0;m0){var k=e.create(),z=x;e.mul(k,g.placementInvProjMatrix,u.glCoordMatrix),e.mul(k,k,g.placementViewportMatrix),h.push({circleArray:w,circleOffset:p,transform:z,invTransform:k,projection:g.getProjection()}),p=d+=w.length/4}b&&(t.terrain&&t.terrain.setupElevationDraw(y,f),f.draw(l,c.LINES,e.DepthMode.disabled,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.disabled,rr(x,u,y,g.getProjection()),r.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,null,u.zoom,null,[b.collisionVertexBuffer,b.collisionVertexBufferExt]))}}if(s&&h.length){var M=t.useProgram("collisionCircle"),T=new e.StructArrayLayout2f1f2i16;T.resize(4*d),T._trim();for(var S=0,E=0,C=h;E=0&&(v[w.associatedIconIndex]={x:N,y:F,z:V,angle:G})}else Tt(M,p)}if(h){m.clear();for(var W=t.icon.placedSymbolArray,X=0;X0&&!r.paint.get("fill-extrusion-rounded-roof"),g=y?0:v,_="globe"===u.projection.name?e.fillExtrusionHeightLift():0,x="globe"===u.projection.name,b=x?e.globeToMercatorTransition(u.zoom):0,w=[e.mercatorXfromLng(u.center.lng),e.mercatorYfromLat(u.center.lat)],k=[];x&&k.push("PROJECTION_GLOBE_VIEW"),m[0]>0&&k.push("FAUX_AO"),y&&k.push("ZERO_ROOF_RADIUS");var z,M=h(i);try{for(M.s();!(z=M.n()).done;){var T=z.value,S=n.getTile(T),E=S.getBucket(r);if(E&&E.projection.name===u.projection.name){var C=E.programConfigurations.get(r.id),A=t.useProgram(d?"fillExtrusionPattern":"fillExtrusion",C,k);if(t.terrain){var I=t.terrain;if(t.style.terrainSetForDrapingOnly())I.setupElevationDraw(S,A,{useMeterToDem:!0});else{if(!E.enableTerrain)continue;if(I.setupElevationDraw(S,A,{useMeterToDem:!0}),Ir(l,n,T,E,r,I),!E.centroidVertexBuffer){var P=A.attributes.a_centroid_pos;void 0!==P&&c.vertexAttrib2f(P,0,0)}}}d&&(t.context.activeTexture.set(c.TEXTURE0),S.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),C.updatePaintBuffers());var L=f.constantOr(null);if(L&&S.imageAtlas){var D=S.imageAtlas.patternPositions[L.toString()];D&&C.setConstantPatternPositions(D)}var R=t.translatePosMatrix(T.projMatrix,S,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),O=u.projection.createInversionMatrix(u,T.canonical),B=r.paint.get("fill-extrusion-vertical-gradient"),N=d?Yn(R,t,B,p,m,g,T,S,_,b,w,O):Xn(R,t,B,p,m,g,T,_,b,w,O);t.prepareDrawProgram(l,A,T.toUnwrapped());var F=[];t.terrain&&F.push(E.centroidVertexBuffer),x&&F.push(E.layoutVertexExtBuffer),A.draw(l,l.gl.TRIANGLES,a,o,s,e.CullFaceMode.backCCW,N,r.id,E.layoutVertexBuffer,E.indexBuffer,E.segments,r.paint,t.transform.zoom,C,F)}}}catch(V){M.e(V)}finally{M.f()}}function Ir(t,n,r,i,a,o){for(var s,l,c,u=[function(t){var n=t.canonical.x-1,r=t.wrap;return n<0&&(n=(1<t.max.x?n.min.x-e.EXTENT:t.max.x,d},m=function(t,n){return d[0]=Math.min(t.min.x,n.min.x),d[1]=Math.max(t.max.x,n.max.x),d[2]=e.EXTENT-n.min.y>t.max.y?n.min.y-e.EXTENT:t.max.y,d},v=[function(e,t){return p(e,t)},function(e,t){return p(t,e)},function(e,t){return m(e,t)},function(e,t){return m(t,e)}],y=new e.Point(0,0),g=function(t,n,i,a,u){var f=[[a?i:t,a?t:i,0],[a?i:n,a?n:i,0]],h=u<0?e.EXTENT+u:u,d=[a?h:(t+n)/2,a?(t+n)/2:h,0];return 0===i&&u<0||0!==i&&u>0?o.getForTilePoints(c,[d],!0,l):f.push(d),o.getForTilePoints(r,f,!0,s),Math.max(f[0][2],f[1][2],d[2])/o.exaggeration()},_=0;_<4;_++){var x=(_<2?1:5)-_,b=i.borders[_];if(0!==b.length){var w=c=u[_](r),k=f(w);if(k&&k instanceof e.FillExtrusionBucket&&k.enableTerrain&&(i.borderDoneWithNeighborZ[_]!==k.canonical.z||k.borderDoneWithNeighborZ[x]!==i.canonical.z)&&(l=o.findDEMTileFor(w))&&l.dem){if(!s){var z=o.findDEMTileFor(r);if(!z||!z.dem)return;s=z}var M=k.borders[x],T=0,S=k.borderDoneWithNeighborZ[x]!==i.canonical.z;if(i.canonical.z===k.canonical.z){for(var E=0;EA[0]+3);)S&&k.encodeCentroid(void 0,I,!1),T++;if(I&&TA[1]-3)&&(L++,++T!==M.length);)I=k.featuresOnBorder[M[T]];if(I=k.featuresOnBorder[M[P]],C.intersectsCount()>1||I.intersectsCount()>1||1!==L){1!==L&&(T=P),i.encodeCentroid(void 0,C,!1),S&&k.encodeCentroid(void 0,I,!1);continue}var D=v[_](C,I),R=_%2?e.EXTENT-1:0;y.x=g(D[0],Math.min(e.EXTENT-1,D[1]),R,_<2,D[2]),y.y=0,i.encodeCentroid(y,C,!1),S&&k.encodeCentroid(y,I,!1)}else i.encodeCentroid(void 0,C,!1)}i.borderDoneWithNeighborZ[_]=k.canonical.z,i.needsCentroidUpdate=!0,S&&(k.borderDoneWithNeighborZ[x]=i.canonical.z,k.needsCentroidUpdate=!0)}else{var O,B=h(b);try{for(B.s();!(O=B.n()).done;){var N=O.value;i.encodeCentroid(void 0,i.featuresOnBorder[N],!1)}}catch(U){B.e(U)}finally{B.f()}if(S){var F,V=h(M);try{for(V.s();!(F=V.n()).done;){var j=F.value;k.encodeCentroid(void 0,k.featuresOnBorder[j],!1)}}catch(U){V.e(U)}finally{V.f()}k.borderDoneWithNeighborZ[x]=i.canonical.z,k.needsCentroidUpdate=!0}i.borderDoneWithNeighborZ[_]=k.canonical.z,i.needsCentroidUpdate=!0}}}}(i.needsCentroidUpdate||!i.centroidVertexBuffer&&0!==i.centroidVertexArray.length)&&i.uploadCentroid(t)}var Pr=new e.Color(1,0,0,1),Lr=new e.Color(0,1,0,1),Dr=new e.Color(0,0,1,1),Rr=new e.Color(1,0,1,1),Or=new e.Color(0,1,1,1);function Br(t,n,r){var i=t.context,a=t.transform,o=i.gl,s="globe"===a.projection.name,l=s?["PROJECTION_GLOBE_VIEW"]:null,c=r.projMatrix;if(s&&e.globeToMercatorTransition(a.zoom)>0){var u=e.transitionTileAABBinECEF(r.canonical,a),f=e.globeDenormalizeECEF(u);c=e.multiply(new Float32Array(16),a.globeMatrix,f),e.multiply(c,a.projMatrix,c)}var h=t.useProgram("debug",null,l),d=n.getTileByID(r.key);t.terrain&&t.terrain.setupElevationDraw(d,h);var p=e.DepthMode.disabled,m=e.StencilMode.disabled,v=t.colorModeForRenderPass(),y="$debug";i.activeTexture.set(o.TEXTURE0),t.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s?d._makeGlobeTileDebugBuffers(t.context,a):d._makeDebugTileBoundsBuffers(t.context,a.projection);var g=d._tileDebugBuffer||t.debugBuffer,_=d._tileDebugIndexBuffer||t.debugIndexBuffer,x=d._tileDebugSegments||t.debugSegments;h.draw(i,o.LINE_STRIP,p,m,v,e.CullFaceMode.disabled,ir(c,e.Color.red),y,g,_,x,null,null,null,[d._globeTileDebugBorderBuffer]);var b=d.latestRawTileData,w=Math.floor((b&&b.byteLength||0)/1024),k=n.getTile(r).tileSize,z=512/Math.min(k,512)*(r.overscaledZ/a.zoom)*.5,M=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(M+=" => ".concat(r.overscaledZ)),function(e,t){e.initDebugOverlayCanvas();var n=e.debugOverlayCanvas,r=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,n.width,n.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(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,M+=" ".concat(w,"kb"));var T=d._tileDebugTextBuffer||t.debugBuffer,S=d._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,E=d._tileDebugTextSegments||t.debugSegments;h.draw(i,o.TRIANGLES,p,m,e.ColorMode.alphaBlended,e.CullFaceMode.disabled,ir(c,e.Color.transparent,z),y,T,S,E,null,null,null,[d._globeTileDebugTextBuffer])}function Nr(e,t,n,r){Vr(e,0,t+n/2,e.transform.width,n,r)}function Fr(e,t,n,r){Vr(e,t-n/2,0,n,e.transform.height,r)}function Vr(t,n,r,i,a,o){var s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(n*e.exported.devicePixelRatio,r*e.exported.devicePixelRatio,i*e.exported.devicePixelRatio,a*e.exported.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}var jr=e.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]).members;function Ur(e,t,n,r){e.emplaceBack(t,n,r)}var Hr=p((function t(n){d(this,t),this.vertexArray=new e.StructArrayLayout3f12,this.indices=new e.StructArrayLayout3ui6,Ur(this.vertexArray,-1,-1,1),Ur(this.vertexArray,1,-1,1),Ur(this.vertexArray,-1,1,1),Ur(this.vertexArray,1,1,1),Ur(this.vertexArray,-1,-1,-1),Ur(this.vertexArray,1,-1,-1),Ur(this.vertexArray,-1,1,-1),Ur(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=n.createVertexBuffer(this.vertexArray,jr),this.indexBuffer=n.createIndexBuffer(this.indices),this.segment=e.SegmentVector.simpleSegment(0,0,36,12)}));function Zr(t,n,r,i,a,o){var s=t.gl,l=n.paint.get("sky-atmosphere-color"),c=n.paint.get("sky-atmosphere-halo-color"),u=n.paint.get("sky-atmosphere-sun-intensity"),f=function(e,t,n,r,i){return{u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:n,u_color_tint_r:[r.r,r.g,r.b,r.a],u_color_tint_m:[i.r,i.g,i.b,i.a],u_luminance:5e-5}}(e.fromMat4(e.create$1(),i),a,u,l,c);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+o,n.skyboxTexture,0),r.draw(t,s.TRIANGLES,e.DepthMode.disabled,e.StencilMode.disabled,e.ColorMode.unblended,e.CullFaceMode.frontCW,f,"skyboxCapture",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}var Gr=e.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),qr=function(){function t(n){d(this,t);var r=new e.StructArrayLayout5f20;r.emplaceBack(-1,1,1,0,0),r.emplaceBack(1,1,1,1,0),r.emplaceBack(1,-1,1,1,1),r.emplaceBack(-1,-1,1,0,1);var i=new e.StructArrayLayout3ui6;i.emplaceBack(0,1,2),i.emplaceBack(2,3,0),this.vertexBuffer=n.createVertexBuffer(r,Gr.members),this.indexBuffer=n.createIndexBuffer(i),this.segments=e.SegmentVector.simpleSegment(0,0,4,2)}return p(t,[{key:"destroy",value:function(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}]),t}(),Wr={symbol:function(t,n,r,i,a){if("translucent"===t.renderPass){var o=e.StencilMode.disabled,s=t.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(t,n,r,i,a,o,s){var l,c=n.transform,u="map"===a,f="map"===o,d=h(t);try{for(d.s();!(l=d.n()).done;){var p=l.value,m=i.getTile(p),v=m.getBucket(r);if(v&&v.text&&v.text.segments.get().length){var y=e.evaluateSizeForZoom(v.textSizeData,c.zoom),g=Pt(p,v.getProjection(),c),_=c.calculatePixelsToTileUnitsMatrix(m),x=dt(g,m.tileID.canonical,f,u,c,v.getProjection(),_),b="none"!==r.layout.get("icon-text-fit")&&v.hasIconData();if(y){var w=Math.pow(2,c.zoom-m.tileID.overscaledZ);Mr(v,u,f,s,e.symbolSize,c,x,p,w,y,b)}}}}catch(k){d.e(k)}finally{d.f()}}(i,t,r,n,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),a),0!==r.paint.get("icon-opacity").constantOr(1)&&Sr(t,n,r,i,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),o,s),0!==r.paint.get("text-opacity").constantOr(1)&&Sr(t,n,r,i,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),o,s),n.map.showCollisionBoxes&&(wr(t,n,r,i,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),wr(t,n,r,i,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1))}},circle:function(t,n,r,i){if("translucent"===t.renderPass){var a=r.paint.get("circle-opacity"),o=r.paint.get("circle-stroke-width"),s=r.paint.get("circle-stroke-opacity"),l=void 0!==r.layout.get("circle-sort-key").constantOr(1);if(0!==a.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var c=t.context,u=c.gl,f=t.transform,d=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),p=e.StencilMode.disabled,m=t.colorModeForRenderPass(),v="globe"===f.projection.name,y=[e.mercatorXfromLng(f.center.lng),e.mercatorYfromLat(f.center.lat)],g=[],_=0;_20&&c.texParameterf(c.TEXTURE_2D,l.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,l.extTextureFilterAnisotropicMax);var R=hr(S,L||[0,0],P||1,I,r,u instanceof je?u.perspectiveTransform:[0,0]);if(t.prepareDrawProgram(l,d,M),u instanceof je)u.boundsBuffer&&u.boundsSegments&&d.draw(l,c.TRIANGLES,z,e.StencilMode.disabled,p,e.CullFaceMode.disabled,R,r.id,u.boundsBuffer,t.quadTriangleIndexBuffer,u.boundsSegments);else{var O=t.getTileBoundsBuffers(T),B=O.tileBoundsBuffer,N=O.tileBoundsIndexBuffer,F=O.tileBoundsSegments;d.draw(l,c.TRIANGLES,z,E,p,e.CullFaceMode.disabled,R,r.id,B,N,F)}}}}catch(V){w.e(V)}finally{w.f()}t.resetStencilClippingMasks()}},background:function(t,n,r,i){var a=r.paint.get("background-color"),o=r.paint.get("background-opacity");if(0!==o){var s=t.context,l=s.gl,c=t.transform,u=c.tileSize,f=r.paint.get("background-pattern");if(!t.isPatternMissing(f)){var d=!f&&1===a.a&&1===o&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===d){var p,m=e.StencilMode.disabled,v=t.depthModeForSublayer(0,"opaque"===d?e.DepthMode.ReadWrite:e.DepthMode.ReadOnly),y=t.colorModeForRenderPass(),g=t.useProgram(f?"backgroundPattern":"background"),_=i;_||(p=t.getBackgroundTiles(),_=Object.values(p).map((function(e){return e.tileID}))),f&&(s.activeTexture.set(l.TEXTURE0),t.imageManager.bind(t.context));var x,b=h(_);try{for(b.s();!(x=b.n()).done;){var w=x.value,k=w.toUnwrapped(),z=i?w.projMatrix:t.transform.calculateProjMatrix(k);t.prepareDrawTile();var M=n?n.getTile(w):p?p[w.key]:new e.Tile(w,u,c.zoom,t),T=f?xr(z,o,t,f,{tileID:w,tileSize:u}):_r(z,o,a);t.prepareDrawProgram(s,g,k);var S=t.getTileBoundsBuffers(M),E=S.tileBoundsBuffer,C=S.tileBoundsIndexBuffer,A=S.tileBoundsSegments;g.draw(s,l.TRIANGLES,v,m,y,e.CullFaceMode.disabled,T,r.id,E,C,A)}}catch(I){b.e(I)}finally{b.f()}}}}},sky:function(t,n,r){var i=t.transform,a="mercator"===i.projection.name||"globe"===i.projection.name?1:e.smoothstep(7,8,i.zoom),o=r.paint.get("sky-opacity")*a;if(0!==o){var s=t.context,l=r.paint.get("sky-type"),c=new e.DepthMode(s.gl.LEQUAL,e.DepthMode.ReadOnly,[0,1]),u=t.frameCounter/1e3%1;"atmosphere"===l?"offscreen"===t.renderPass?r.needsSkyboxCapture(t)&&(function(t,n,r,i){var a=t.context,o=a.gl,s=n.skyboxFbo;if(!s){s=n.skyboxFbo=a.createFramebuffer(32,32,!1),n.skyboxGeometry=new Hr(a),n.skyboxTexture=a.gl.createTexture(),o.bindTexture(o.TEXTURE_CUBE_MAP,n.skyboxTexture),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MAG_FILTER,o.LINEAR);for(var l=0;l<6;++l)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,o.RGBA,32,32,0,o.RGBA,o.UNSIGNED_BYTE,null)}a.bindFramebuffer.set(s.framebuffer),a.viewport.set([0,0,32,32]);var c=n.getCenter(t,!0),u=t.useProgram("skyboxCapture"),f=new Float64Array(16);e.identity(f),e.rotateY(f,f,.5*-Math.PI),Zr(a,n,u,f,c,0),e.identity(f),e.rotateY(f,f,.5*Math.PI),Zr(a,n,u,f,c,1),e.identity(f),e.rotateX(f,f,.5*-Math.PI),Zr(a,n,u,f,c,2),e.identity(f),e.rotateX(f,f,.5*Math.PI),Zr(a,n,u,f,c,3),e.identity(f),Zr(a,n,u,f,c,4),e.identity(f),e.rotateY(f,f,Math.PI),Zr(a,n,u,f,c,5),a.viewport.set([0,0,t.width,t.height])}(t,r),r.markSkyboxValid(t)):"sky"===t.renderPass&&function(t,n,r,i,a){var o=t.context,s=o.gl,l=t.transform,c=t.useProgram("skybox");o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_CUBE_MAP,n.skyboxTexture);var u=function(e,t,n,r,i){return{u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:r,u_temporal_offset:i}}(l.skyboxMatrix,n.getCenter(t,!1),0,i,a);t.prepareDrawProgram(o,c),c.draw(o,s.TRIANGLES,r,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.backCW,u,"skybox",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}(t,r,c,o,u):"gradient"===l&&"sky"===t.renderPass&&function(t,n,r,i,a){var o=t.context,s=o.gl,l=t.transform,c=t.useProgram("skyboxGradient");n.skyboxGeometry||(n.skyboxGeometry=new Hr(o)),o.activeTexture.set(s.TEXTURE0);var u=n.colorRampTexture;u||(u=n.colorRampTexture=new e.Texture(o,n.colorRamp,s.RGBA)),u.bind(s.LINEAR,s.CLAMP_TO_EDGE);var f=function(t,n,r,i,a){return{u_matrix:t,u_color_ramp:0,u_center_direction:n,u_radius:e.degToRad(r),u_opacity:i,u_temporal_offset:a}}(l.skyboxMatrix,n.getCenter(t,!1),n.paint.get("sky-gradient-radius"),i,a);t.prepareDrawProgram(o,c),c.draw(o,s.TRIANGLES,r,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.backCW,f,"skyboxGradient",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}(t,r,c,o,u)}},debug:function(e,t,n){for(var r=0;r2&&void 0!==arguments[2]&&arguments[2];d(this,t),this.context=new Be(n,i),this.transform=r,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=e.SourceCache.maxUnderzooming+e.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={}}return p(t,[{key:"updateTerrain",value:function(e,t){var n=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(n||this._terrain&&this._terrain.enabled){this._terrain||(this._terrain=new Zn(this,e));var r=this._terrain;this.transform.elevation=n?r:null,r.update(e,this.transform,t)}}},{key:"_updateFog",value:function(e){var t=e.fog;if(!t||"globe"===this.transform.projection.name||t.getOpacity(this.transform.pitch)<1||t.properties.get("horizon-blend")<.03)this.transform.fogCullDistSq=null;else{var n=t.getFovAdjustedRange(this.transform._fov),r=f(n,2),i=r[0],a=r[1];if(i>a)this.transform.fogCullDistSq=null;else{var o=i+.78*(a-i);this.transform.fogCullDistSq=o*o}}}},{key:"terrain",get:function(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}},{key:"resize",value:function(t,n){if(this.width=t*e.exported.devicePixelRatio,this.height=n*e.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style){var r,i=h(this.style.order);try{for(i.s();!(r=i.n()).done;){var a=r.value;this.style._layers[a].resize()}}catch(o){i.e(o)}finally{i.f()}}}},{key:"setup",value:function(){var t=this.context,n=new e.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(e.EXTENT,0),n.emplaceBack(0,e.EXTENT),n.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(n,e.posAttributes.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var r=new e.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(e.EXTENT,0),r.emplaceBack(0,e.EXTENT),r.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=t.createVertexBuffer(r,e.posAttributes.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);var i=new e.StructArrayLayout2i4;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(-1,1),i.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(i,e.posAttributes.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);var a=new e.StructArrayLayout4i8;a.emplaceBack(0,0,0,0),a.emplaceBack(e.EXTENT,0,e.EXTENT,0),a.emplaceBack(0,e.EXTENT,0,e.EXTENT),a.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.mercatorBoundsBuffer=t.createVertexBuffer(a,e.boundsAttributes.members),this.mercatorBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);var o=new e.StructArrayLayout3ui6;o.emplaceBack(0,1,2),o.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(o);for(var s=new e.StructArrayLayout1ui2,l=0,c=[0,1,3,2,0];l256&&this.clearStencil(),l.setColorMode(e.ColorMode.disabled),l.setDepthMode(e.DepthMode.disabled);var u=this.useProgram("clippingMask");this._tileClippingMaskIDs={};var f,d=h(r);try{for(d.s();!(f=d.n()).done;){var p=f.value,m=n.getTile(p),v=this._tileClippingMaskIDs[p.key]=this.nextStencilID++,y=this.getTileBoundsBuffers(m),g=y.tileBoundsBuffer,_=y.tileBoundsIndexBuffer,x=y.tileBoundsSegments;u.draw(l,c.TRIANGLES,e.DepthMode.disabled,new e.StencilMode({func:c.ALWAYS,mask:0},v,255,c.KEEP,c.KEEP,c.REPLACE),e.ColorMode.disabled,e.CullFaceMode.disabled,Fn(p.projMatrix),"$clipping",g,_,x)}}catch(b){d.e(b)}finally{d.f()}}}},{key:"stencilModeFor3D",value:function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,n=this.context.gl;return new e.StencilMode({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}},{key:"stencilModeForClipping",value:function(t){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(t);var n=this.context.gl;return new e.StencilMode({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}},{key:"stencilConfigForOverlap",value:function(t){var n=this.context.gl,i=t.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),a=i[i.length-1].overscaledZ,o=i[0].overscaledZ-a+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var s={},l=0;l=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],k=t._getLayerSourceCache(w);if(!w.isSky()){var z=k?c[k.id]:void 0;this._renderTileClippingMasks(w,k,z),this.renderLayer(this,k,w,z)}}if(this.style.fog&&this.transform.projection.supportsFog&&function(t,n){var r=t.context,i=r.gl,a=t.transform,o=new e.DepthMode(i.LEQUAL,e.DepthMode.ReadOnly,[0,1]),s=t.useProgram("globeAtmosphere",null,"globe"===a.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),l=e.globeToMercatorTransition(a.zoom),c=n.properties.get("color").toArray01(),u=n.properties.get("high-color").toArray01(),f=n.properties.get("space-color").toArray01PremultipliedAlpha(),h=e.identity$1([]);e.rotateY$1(h,h,-e.degToRad(a._center.lng)),e.rotateX$1(h,h,e.degToRad(a._center.lat)),e.rotateZ$1(h,h,a.angle),e.rotateX$1(h,h,-a._pitch);var d=e.fromQuat(new Float32Array(16),h),p=e.mapValue(n.properties.get("star-intensity"),0,1,0,.25),m=5e-4,v=e.mapValue(n.properties.get("horizon-blend"),0,1,m,.25),y=e.globeUseCustomAntiAliasing(t,r,a)&&v===m?a.worldSize/(2*Math.PI*1.025)-1:a.globeRadius,g=t.frameCounter/1e3%1,_=e.length(a.globeCenterInViewSpace),x=Math.sqrt(Math.pow(_,2)-Math.pow(y,2)),b=Math.acos(x/_),w=function(t,n,r,i,a,o,s,l,c,u,f,h,d,p){return{u_frustum_tl:t,u_frustum_tr:n,u_frustum_br:r,u_frustum_bl:i,u_horizon:a,u_transition:o,u_fadeout_range:s,u_color:l,u_high_color:c,u_space_color:u,u_star_intensity:f,u_star_size:5*e.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:h,u_horizon_angle:d,u_rotation_matrix:p}}(a.frustumCorners.TL,a.frustumCorners.TR,a.frustumCorners.BR,a.frustumCorners.BL,a.frustumCorners.horizon,l,v,c,u,f,p,g,b,d);t.prepareDrawProgram(r,s);var k=t.atmosphereBuffer;k&&s.draw(r,i.TRIANGLES,o,e.StencilMode.disabled,e.ColorMode.alphaBlended,e.CullFaceMode.backCW,w,"skybox",k.vertexBuffer,k.indexBuffer,k.segments)}(this,this.style.fog),this.renderPass="sky",(e.globeToMercatorTransition(this.transform.zoom)>0||"globe"!==this.transform.projection.name)&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer0?t.pop():null}},{key:"isPatternMissing",value:function(e){return null===e||void 0!==e&&!this.imageManager.getPattern(e.toString())}},{key:"terrainRenderModeElevated",value:function(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}},{key:"currentGlobalDefines",value:function(){var e=this.terrain&&this.terrain.renderingToTexture,t=this.terrain&&0===this.terrain.exaggeration(),n=this.style&&this.style.fog,r=[];return this.terrainRenderModeElevated()&&r.push("TERRAIN"),"globe"===this.transform.projection.name&&r.push("GLOBE"),t&&r.push("ZERO_EXAGGERATION"),n&&!e&&0!==n.getOpacity(this.transform.pitch)&&r.push("FOG"),e&&r.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&r.push("OVERDRAW_INSPECTOR"),r}},{key:"useProgram",value:function(e,t,n){this.cache=this.cache||{};var r=n||[],i=this.currentGlobalDefines().concat(r),a=Gn.cacheKey(kn[e],e,i,t);return this.cache[a]||(this.cache[a]=new Gn(this.context,e,kn[e],t,br[e],i)),this.cache[a]}},{key:"setCustomLayerDefaults",value:function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}},{key:"setBaseState",value:function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}},{key:"initDebugOverlayCanvas",value:function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}},{key:"destroy",value:function(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}},{key:"prepareDrawTile",value:function(){this.terrain&&this.terrain.prepareDrawTile()}},{key:"prepareDrawProgram",value:function(t,n,r){if(!this.terrain||!this.terrain.renderingToTexture){var i=this.style.fog;if(i){var a=i.getOpacity(this.transform.pitch),o=function(t,n,r,i,a,o,s,l,c,u,f){var h=t.transform,d=n.properties.get("color").toArray01();d[3]=i;var p=t.frameCounter/1e3%1;return{u_fog_matrix:r?h.calculateFogTileMatrix(r):t.identityMat,u_fog_range:n.getFovAdjustedRange(h._fov),u_fog_color:d,u_fog_horizon_blend:n.properties.get("horizon-blend"),u_fog_temporal_offset:p,u_frustum_tl:a,u_frustum_tr:o,u_frustum_br:s,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:u,u_viewport:f,u_globe_transition:e.globeToMercatorTransition(h.zoom),u_is_globe:+("globe"===h.projection.name)}}(this,i,r,a,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*e.exported.devicePixelRatio,this.transform.height*e.exported.devicePixelRatio]);n.setFogUniformValues(t,o)}}}},{key:"setTileLoadedFlag",value:function(e){this.tileLoaded=e}},{key:"saveCanvasCopy",value:function(){var e=this.canvasCopy();e&&(this.frameCopies.push(e),this.tileLoaded=!1)}},{key:"canvasCopy",value:function(){var e=this.context.gl,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),t}},{key:"getCanvasCopiesAndTimestamps",value:function(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}},{key:"averageElevationNeedsEasing",value:function(){if(!this.transform._elevation)return!1;var e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}},{key:"getBackgroundTiles",value:function(){var t,n=this._backgroundTiles,r=this._backgroundTiles={},i=this.transform.coveringTiles({tileSize:512}),a=h(i);try{for(a.s();!(t=a.n()).done;){var o=t.value;r[o.key]=n[o.key]||new e.Tile(o,512,this.transform.tileZoom,this)}}catch(s){a.e(s)}finally{a.f()}return r}},{key:"clearBackgroundTiles",value:function(){this._backgroundTiles={}}}]),t}(),Yr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(d(this,t),isNaN(e)||e<0||isNaN(n)||n<0||isNaN(r)||r<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=n,this.left=r,this.right=i}return p(t,[{key:"interpolate",value:function(t,n,r){return null!=n.top&&null!=t.top&&(this.top=e.number(t.top,n.top,r)),null!=n.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,n.bottom,r)),null!=n.left&&null!=t.left&&(this.left=e.number(t.left,n.left,r)),null!=n.right&&null!=t.right&&(this.right=e.number(t.right,n.right,r)),this}},{key:"getCenter",value:function(t,n){var r=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+n-this.bottom)/2,0,n);return new e.Point(r,i)}},{key:"equals",value:function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}},{key:"clone",value:function(){return new t(this.top,this.bottom,this.left,this.right)}},{key:"toJSON",value:function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}]),t}();function Kr(t,n){var r=e.getColumn(t,3);e.fromQuat(t,n),e.setColumn(t,3,r)}function $r(t,n){var r=e.identity$1([]);return e.rotateZ$1(r,r,-n),e.rotateX$1(r,r,-t),r}function Jr(t,n){var r=[t[0],t[1],0],i=[n[0],n[1],0];if(e.length(r)>=1e-15){var a=e.normalize([],r);e.scale$2(i,a,e.dot(i,a)),n[0]=i[0],n[1]=i[1]}var o=e.cross([],n,t);if(e.len(o)<1e-15)return null;var s=Math.atan2(-o[1],o[0]);return $r(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),s)}var Qr=function(){function t(e,n){d(this,t),this.position=e,this.orientation=n}return p(t,[{key:"position",get:function(){return this._position},set:function(t){if(t){var n=t instanceof e.MercatorCoordinate?t:new e.MercatorCoordinate(t[0],t[1],t[2]);this._renderWorldCopies&&(n.x=e.wrap(n.x,0,1)),this._position=n}else this._position=null}},{key:"lookAtPoint",value:function(t,n){if(this.orientation=null,this.position){var r=this.position,i=this._elevation?this._elevation.getAtPointOrZero(e.MercatorCoordinate.fromLngLat(t)):0,a=e.MercatorCoordinate.fromLngLat(t,i),o=[a.x-r.x,a.y-r.y,a.z-r.z];n||(n=[0,0,1]),n[2]=Math.abs(n[2]),this.orientation=Jr(o,n)}}},{key:"setPitchBearing",value:function(t,n){this.orientation=$r(e.degToRad(t),e.degToRad(-n))}}]),t}(),ei=function(){function t(n,r){d(this,t),this._transform=e.identity([]),this.orientation=r,this.position=n}return p(t,[{key:"mercatorPosition",get:function(){var t=this.position;return new e.MercatorCoordinate(t[0],t[1],t[2])}},{key:"position",get:function(){var t=e.getColumn(this._transform,3);return[t[0],t[1],t[2]]},set:function(t){var n;t&&e.setColumn(this._transform,3,[(n=t)[0],n[1],n[2],1])}},{key:"orientation",get:function(){return this._orientation},set:function(t){this._orientation=t||e.identity$1([]),t&&Kr(this._transform,this._orientation)}},{key:"getPitchBearing",value:function(){var e=this.forward(),t=this.right();return{bearing:Math.atan2(-t[1],t[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}},{key:"setPitchBearing",value:function(e,t){this._orientation=$r(e,t),Kr(this._transform,this._orientation)}},{key:"forward",value:function(){var t=e.getColumn(this._transform,2);return[-t[0],-t[1],-t[2]]}},{key:"up",value:function(){var t=e.getColumn(this._transform,1);return[-t[0],-t[1],-t[2]]}},{key:"right",value:function(){var t=e.getColumn(this._transform,0);return[t[0],t[1],t[2]]}},{key:"getCameraToWorld",value:function(t,n){var r=new Float64Array(16);return e.invert(r,this.getWorldToCamera(t,n)),r}},{key:"getWorldToCameraPosition",value:function(t,n,r){var i=this.position;e.scale$2(i,i,-t);var a=new Float64Array(16);return e.fromScaling(a,[r,r,r]),e.translate(a,a,i),a[10]*=n,a}},{key:"getWorldToCamera",value:function(t,n){var r=new Float64Array(16),i=new Float64Array(4),a=this.position;return e.conjugate(i,this._orientation),e.scale$2(a,a,-t),e.fromQuat(r,i),e.translate(r,r,a),r[1]*=-1,r[5]*=-1,r[9]*=-1,r[13]*=-1,r[8]*=n,r[9]*=n,r[10]*=n,r[11]*=n,r}},{key:"getCameraToClipPerspective",value:function(t,n,r,i){var a=new Float64Array(16);return e.perspective(a,t,n,r,i),a}},{key:"getDistanceToElevation",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0===t?0:e.mercatorZfromAltitude(t,n?e.latFromMercatorY(this.position[1]):this.position[1]),i=this.forward();return(r-this.position[2])/i[2]}},{key:"clone",value:function(){return new t(u(this.position),u(this.orientation))}}]),t}();function ti(t,n){var r=ri(t.projection,t.zoom,t.width,t.height),i=function(t,n,r,i,a){var o=new e.LngLat(r.lng-180*ii,r.lat),s=new e.LngLat(r.lng+180*ii,r.lat),l=t.project(o.lng,o.lat),c=t.project(s.lng,s.lat),u=-Math.atan2(c.y-l.y,c.x-l.x),f=e.MercatorCoordinate.fromLngLat(r);f.y=e.clamp(f.y,-1+ii,1-ii);var h=f.toLngLat(),d=t.project(h.lng,h.lat),p=e.MercatorCoordinate.fromLngLat(h);p.x+=ii;var m=p.toLngLat(),v=t.project(m.lng,m.lat),y=oi(v.x-d.x,v.y-d.y,u),g=e.MercatorCoordinate.fromLngLat(h);g.y+=ii;var _=g.toLngLat(),x=t.project(_.lng,_.lat),b=oi(x.x-d.x,x.y-d.y,u),w=Math.abs(y.x)/Math.abs(b.y),k=e.identity([]);e.rotateZ(k,k,-u*(1-(a?0:i)));var z=e.identity([]);return e.scale(z,z,[1,1-(1-w)*i,1]),z[4]=-b.x/b.y*i,e.rotateZ(z,z,u),e.multiply(z,k,z),z}(t.projection,0,t.center,r,n),a=ni(t);return e.scale(i,i,[a,a,1]),i}function ni(t){var n=t.projection,r=ri(t.projection,t.zoom,t.width,t.height),i=ai(n,t.center),a=ai(n,e.LngLat.convert(n.center));return Math.pow(2,i*r+(1-r)*a)}function ri(t,n,r,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,o=t.range;if(!o)return 0;var s=Math.min(a,Math.max(r,i)),l=Math.log(s/1024)/Math.LN2;return e.smoothstep(o[0]+l,o[1]+l,n)}var ii=1/4e4;function ai(t,n){var r=e.clamp(n.lat,-e.MAX_MERCATOR_LATITUDE,e.MAX_MERCATOR_LATITUDE),i=new e.LngLat(n.lng-180*ii,r),a=new e.LngLat(n.lng+180*ii,r),o=t.project(i.lng,r),s=t.project(a.lng,r),l=e.MercatorCoordinate.fromLngLat(i),c=e.MercatorCoordinate.fromLngLat(a),u=s.x-o.x,f=s.y-o.y,h=c.x-l.x,d=c.y-l.y,p=Math.sqrt((h*h+d*d)/(u*u+f*f));return Math.log(p)/Math.LN2}function oi(e,t,n){var r=Math.cos(n),i=Math.sin(n);return{x:e*r-t*i,y:e*i+t*r}}var si=function(){function n(t,r,i,a,o,s,l){d(this,n),this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=null==i?0:i,this._maxPitch=null==a?60:a,this.setProjection(s),this.setMaxBounds(l),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Yr,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new ei,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}return p(n,[{key:"clone",value:function(){var e=new n(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._averageElevation=this._averageElevation,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e}},{key:"elevation",get:function(){return this._elevation},set:function(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}},{key:"updateElevation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||n)&&this._updateCameraOnTerrain(),(e||n)&&this._constrainCamera(t),this._calcMatrices()}},{key:"getProjection",value:function(){return e.pick(this.projection,["name","center","parallels"])}},{key:"setProjection",value:function(n){this.projectionOptions=n||{name:"mercator"};var r=this.projection?this.getProjection():void 0;this.projection=e.getProjection(this.projectionOptions);var i=!t(r,this.getProjection());return i&&this._calcMatrices(),this.mercatorFromTransition=!1,i}},{key:"setMercatorFromTransition",value:function(){var t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.getProjection({name:"mercator"});var n=t!==this.projection.name;return n&&this._calcMatrices(),n}},{key:"minZoom",get:function(){return this._minZoom},set:function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}},{key:"minPitch",get:function(){return this._minPitch},set:function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}},{key:"maxPitch",get:function(){return this._maxPitch},set:function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}},{key:"renderWorldCopies",get:function(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies},set:function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}},{key:"worldSize",get:function(){return this.tileSize*this.scale}},{key:"cameraWorldSizeForFog",get:function(){var e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}},{key:"cameraWorldSize",get:function(){var e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}},{key:"pixelsPerMeter",get:function(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}},{key:"cameraPixelsPerMeter",get:function(){return e.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}},{key:"centerOffset",get:function(){return this.centerPoint._sub(this.size._div(2))}},{key:"size",get:function(){return new e.Point(this.width,this.height)}},{key:"bearing",get:function(){return e.wrap(this.rotation,-180,180)},set:function(e){this.rotation=e}},{key:"rotation",get:function(){return-this.angle/Math.PI*180},set:function(t){var n,r=-t*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=(n=new e.ARRAY_TYPE(4),e.ARRAY_TYPE!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),l=Math.cos(n);e[0]=r*l+a*s,e[1]=i*l+o*s,e[2]=r*-s+a*l,e[3]=i*-s+o*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}},{key:"pitch",get:function(){return this._pitch/Math.PI*180},set:function(t){var n=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}},{key:"aspect",get:function(){return this.width/this.height}},{key:"fov",get:function(){return this._fov/Math.PI*180},set:function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=e.degToRad(t),this._calcMatrices())}},{key:"fovX",get:function(){return this._fov}},{key:"fovY",get:function(){var e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}},{key:"averageElevation",get:function(){return this._averageElevation},set:function(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}},{key:"zoom",get:function(){return this._zoom},set:function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._setZoom(t),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}},{key:"_setZoom",value:function(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}},{key:"_updateCameraOnTerrain",value:function(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);var e=this._elevation;this._centerAltitude=e.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=e.exaggeration(),this._updateSeaLevelZoom()}},{key:"_updateSeaLevelZoom",value:function(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}},{key:"sampleAverageElevation",value:function(){if(!this._elevation)return 0;for(var t=this._elevation,n=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],r=this.horizonLineFromTop(),i=0,a=0,o=0;ot.maxzoom&&(r=t.maxzoom);var s=this.locationCoordinate(this.center),l=this.center.lat,c=1<=.9)return!0}else if(a&&(s=C(t.aabb.distanceZ(y)*m)),n.projection.isReprojectedInTileSpace&&i<=5){var x=Math.pow(2,t.zoom),b=k(new e.MercatorCoordinate((t.x+.5)/x,(t.y+.5)/x));c=b>.85?1:b}var w=r*r+o*o+s,z=C((1<0;){var D=M.pop(),R=D.x,O=D.y,B=D.fullyVisible;if(!B){var N=D.aabb.intersects(d);if(0===N)continue;B=2===N}if(D.zoom!==S&&P(D))for(var F=0;F<4;F++){var V=(R<<1)+F%2,j=(O<<1)+(F>>1),U={aabb:o?D.aabb.quadrant(F):e.tileAABB(this,c,D.zoom+1,V,j,D.wrap,D.minZ,D.maxZ,this.projection),zoom:D.zoom+1,x:V,y:j,wrap:D.wrap,fullyVisible:B,tileID:void 0,shouldSplit:void 0,minZ:D.minZ,maxZ:D.maxZ};a&&!f&&(U.tileID=new e.OverscaledTileID(D.zoom+1===S?E:D.zoom+1,D.wrap,D.zoom+1,V,j),I(U)),M.push(U)}else{var H=D.zoom===S?E:D.zoom;if(t.minzoom&&t.minzoom>H)continue;var Z=u[0]-(.5+R+(D.wrap<W&&0!==X){var u,f=n.calculateProjMatrix(r.tileID.toUnwrapped());t.isTerrainDEM||(u=c.getMinMaxForTile(r.tileID)),u||(u={min:b,max:x});var h=e.furthestTileCorner(n.rotation),d=[h[0]*e.EXTENT,h[1]*e.EXTENT,u.max];e.transformMat4(d,d,f),l=(1-d[1])*n.height*.51&&void 0!==arguments[1]?arguments[1]:this._centerAltitude;return this.projection.pointCoordinate(this,e.x,e.y,t)}},{key:"pointCoordinate3D",value:function(t){if(!this.elevation)return this.pointCoordinate(t);var n=this.projection.pointCoordinate3D(this,t.x,t.y);if(n)return new e.MercatorCoordinate(n[0],n[1],n[2]);var r=0,i=this.horizonLineFromTop();if(t.y>i)return this.pointCoordinate(t);for(var a=.02*i,o=t.clone(),s=0;s<10&&i-r>a;s++){o.y=e.number(r,i,.66);var l=this.projection.pointCoordinate3D(this,o.x,o.y);l?(i=o.y,n=l):r=o.y}return n?new e.MercatorCoordinate(n[0],n[1],n[2]):this.pointCoordinate(t)}},{key:"isPointAboveHorizon",value:function(e){return this.projection.isPointAboveHorizon(this,e)}},{key:"isPointOnSurface",value:function(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=e.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(t);var n=this.pointCoordinate(t);return n.y>=0&&n.y<=1}},{key:"_coordinatePoint",value:function(t,n){var r=n&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,i=[t.x*this.worldSize,t.y*this.worldSize,r+t.toAltitude(),1];return e.transformMat4$1(i,i,this.pixelMatrix),i[3]>0?new e.Point(i[0]/i[3],i[1]/i[3]):new e.Point(Number.MAX_VALUE,Number.MAX_VALUE)}},{key:"_getBoundsNonRectangular",value:function(){var t=this,n=this._edgeInsets,r=n.top,i=n.left,a=this.height-this._edgeInsets.bottom,o=this.width-this._edgeInsets.right,s=this.pointLocation3D(new e.Point(i,r)),l=this.pointLocation3D(new e.Point(o,r)),c=this.pointLocation3D(new e.Point(o,a)),u=this.pointLocation3D(new e.Point(i,a)),h=Math.min(s.lng,l.lng,c.lng,u.lng),d=Math.max(s.lng,l.lng,c.lng,u.lng),p=Math.min(s.lat,l.lat,c.lat,u.lat),m=Math.max(s.lat,l.lat,c.lat,u.lat),v=Math.pow(2,-this.zoom)/16*270,y="globe"===this.projection.name?1:4,g=function n(r,i,a,o,s){var l=(r+a)/2,c=(i+o)/2,u=new e.Point(l,c),f=t.pointLocation3D(u),g=f.lng,_=f.lat,x=Math.max(0,h-g,p-_,g-d,_-m);h=Math.min(h,g),d=Math.max(d,g),p=Math.min(p,_),m=Math.max(m,_),(sv)&&(n(r,i,l,c,s+1),n(l,c,a,o,s+1))};if(g(i,r,o,r,1),g(o,r,o,a,1),g(o,a,i,a,1),g(i,a,i,r,1),"globe"===this.projection.name){var _=e.polesInViewport(this),x=f(_,2),b=x[0],w=x[1];b?(m=90,d=180,h=-180):w&&(p=-90,d=180,h=-180)}return new e.LngLatBounds(new e.LngLat(h,p),new e.LngLat(d,m))}},{key:"_getBoundsRectangular",value:function(t,n){var r=this._edgeInsets,i=r.top,a=r.left,o=this.height-this._edgeInsets.bottom,s=this.width-this._edgeInsets.right,l=new e.Point(a,i),c=new e.Point(s,i),u=new e.Point(s,o),f=new e.Point(a,o),h=this.pointCoordinate(l,t),d=this.pointCoordinate(c,t),p=this.pointCoordinate(u,n),m=this.pointCoordinate(f,n),v=function(e,t){return(t.y-e.y)/(t.x-e.x)};return h.y>1&&d.y>=0?h=new e.MercatorCoordinate((1-m.y)/v(m,h)+m.x,1):h.y<0&&d.y<=1&&(h=new e.MercatorCoordinate(-m.y/v(m,h)+m.x,0)),d.y>1&&h.y>=0?d=new e.MercatorCoordinate((1-p.y)/v(p,d)+p.x,1):d.y<0&&h.y<=1&&(d=new e.MercatorCoordinate(-p.y/v(p,d)+p.x,0)),(new e.LngLatBounds).extend(this.coordinateLocation(h)).extend(this.coordinateLocation(d)).extend(this.coordinateLocation(m)).extend(this.coordinateLocation(p))}},{key:"_getBoundsRectangularTerrain",value:function(){var e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBoundsRectangular(0,0);var t=e.visibleDemTiles.reduce((function(e,t){if(t.dem){var n=t.dem.tree;e.min=Math.min(e.min,n.minimums[0]),e.max=Math.max(e.max,n.maximums[0])}return e}),{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(t.min*e.exaggeration(),t.max*e.exaggeration())}},{key:"getBounds",value:function(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}},{key:"horizonLineFromTop",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,n=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,n):n}},{key:"getMaxBounds",value:function(){return this.maxBounds}},{key:"setMaxBounds",value:function(t){this.maxBounds=t,this.minLat=-e.MAX_MERCATOR_LATITUDE,this.maxLat=e.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLng1&&void 0!==arguments[1]&&arguments[1],r=t.key,i=n?this._alignedProjMatrixCache:this._projMatrixCache;if(i[r])return i[r];var a=this.calculatePosMatrix(t,this.worldSize);return e.multiply(a,this.projection.isReprojectedInTileSpace?this.mercatorMatrix:n?this.alignedProjMatrix:this.projMatrix,a),i[r]=new Float32Array(a),i[r]}},{key:"calculatePixelsToTileUnitsMatrix",value:function(t){var n=t.tileID.key,r=this._pixelsToTileUnitsCache;if(r[n])return r[n];var i=function(t,n){var r,i,a,o,s,l,c,u,f=t.tileTransform.scale*e.EXTENT/(t.tileSize*Math.pow(2,n.zoom-t.tileID.overscaledZ+t.tileID.canonical.z));return r=new Float32Array(4),o=(i=n.inverseAdjustmentMatrix)[1],s=i[2],l=i[3],u=(a=[f,f])[1],r[0]=i[0]*(c=a[0]),r[1]=o*c,r[2]=s*u,r[3]=l*u,r}(t,this);return r[n]=i,r[n]}},{key:"customLayerMatrix",value:function(){return this.mercatorMatrix.slice()}},{key:"globeToMercatorMatrix",value:function(){if("globe"===this.projection.name){var t=1/this.worldSize,n=e.fromScaling([],[t,t,t]);return e.multiply(n,n,this.globeMatrix),n}}},{key:"recenterOnTerrain",value:function(){if(this._elevation&&"globe"!==this.projection.name){var t=this._elevation;this._updateCameraState();var n=e.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,r=this._computeCameraPosition(n),i=this._camera.forward(),a=e.mercatorZfromAltitude(1,this._center.lat);r[2]/=a,i[2]/=a,e.normalize(i,i);var o=t.raycast(r,i,t.exaggeration());if(o){var s=e.scaleAndAdd([],r,i,o),l=new e.MercatorCoordinate(s[0],s[1],e.mercatorZfromAltitude(s[2],e.latFromMercatorY(s[1]))),c=(l.z+e.length([l.x-r[0],l.y-r[1],l.z-r[2]*a]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(c),this._centerAltitude=l.toAltitude(),this._center=this.coordinateLocation(l),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}}},{key:"_constrainCamera",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._elevation){var n=this._elevation,r=e.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,i=this._computeCameraPosition(r),o=n.getAtPointOrZero(a(e.MercatorCoordinate,u(i))),s=this.pixelsPerMeter/this.worldSize*o,l=this._minimumHeightOverTerrain(),c=i[2]-s;if(c<=l)if(c<0||t){var f=this.locationCoordinate(this._center,this._centerAltitude),h=[i[0],i[1],f.z-i[2]],d=e.length(h);h[2]-=(l-c)/this._pixelsPerMercatorPixel;var p=e.length(h);if(0===p)return;e.scale$2(h,h,d/p*this._pixelsPerMercatorPixel),this._camera.position=[i[0],i[1],f.z*this._pixelsPerMercatorPixel-h[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}}},{key:"_constrain",value:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||t){var n=this.center;return n.lat=e.clamp(n.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(n.lng=e.clamp(n.lng,this.minLng,this.maxLng)),this.center=n,void(this._constraining=!1)}var r=this._unmodified,i=this.point,a=i.x,o=i.y,s=0,l=a,c=o,u=this.width/2,f=this.height/2,h=this.worldMinY*this.scale,d=this.worldMaxY*this.scale;if(o-fd&&(c=d-f),d-hm&&(l=m-u),m-p.5?b-1:b,w>.5?w-1:w,0]),this.alignedProjMatrix=k,s=e.create(),e.scale(s,s,[this.width/2,-this.height/2,1]),e.translate(s,s,[1,-1,0]),this.labelPlaneMatrix=s,s=e.create(),e.scale(s,s,[1,-1,1]),e.translate(s,s,[-1,-1,0]),e.scale(s,s,[2/this.width,2/this.height,1]),this.glCoordMatrix=s,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},!(s=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=s,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.calculateGlobeMatrix(this);var z=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.transformMat4(z,z,a),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=s;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}}},{key:"_calcFogMatrices",value:function(){this._fogTileMatrixCache={};var t=this.cameraWorldSizeForFog,n=this.cameraPixelsPerMeter,r=this._camera.position,i=1/this.height/this._pixelsPerMercatorPixel,a=[t,t,n];e.scale$2(a,a,i),e.scale$2(r,r,-1),e.multiply$2(r,r,a);var o=e.create();e.translate(o,o,r),e.scale(o,o,a),this.mercatorFogMatrix=o,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,n,i)}},{key:"_computeCameraPosition",value:function(e){var t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,n=this._camera.forward(),r=this.point,i=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return[r.x/this.worldSize-n[0]*i,r.y/this.worldSize-n[1]*i,e/this.worldSize*this._centerAltitude-n[2]*i]}},{key:"_updateCameraState",value:function(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}},{key:"_translateCameraConstrained",value:function(t){var n=this._maxCameraBoundsDistance()*Math.cos(this._pitch),r=this._camera.position[2],i=t[2],a=1;this.projection.wrap&&(this.center=this.center.wrap()),i>0&&(a=Math.min((n-r)/i,1)),this._camera.position=e.scaleAndAdd([],this._camera.position,t,a),this._updateStateFromCamera()}},{key:"_updateStateFromCamera",value:function(){var t=this._camera.position,n=this._camera.forward(),r=this._camera.getPitchBearing(),i=r.pitch,a=r.bearing,o=e.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,s=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.degToRad(this._maxPitch)),l=Math.max((t[2]-o)/Math.cos(i),s),c=this._zoomFromMercatorZ(l);e.scaleAndAdd(t,t,n,l),this._pitch=e.clamp(i,e.degToRad(this.minPitch),e.degToRad(this.maxPitch)),this.angle=e.wrap(a,-Math.PI,Math.PI),this._setZoom(e.clamp(c,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e.MercatorCoordinate(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}},{key:"_worldSizeFromZoom",value:function(e){return Math.pow(2,e)*this.tileSize}},{key:"_mercatorZfromZoom",value:function(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}},{key:"_minimumHeightOverTerrain",value:function(){var e=Math.min((null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(e)}},{key:"_zoomFromMercatorZ",value:function(e){return this.scaleZoom(this.cameraToCenterDistance/(e*this.tileSize))}},{key:"zoomFromMercatorZAdjusted",value:function(t){for(var n=0,r=e.GLOBE_ZOOM_THRESHOLD_MAX,i=0,a=1/0;r-n>1e-6&&r>n;){var o=n+.5*(r-n),s=this.tileSize*Math.pow(2,o),l=this.getCameraToCenterDistance(this.projection,o,s),c=this.scaleZoom(l/(t*this.tileSize)),u=Math.abs(o-c);uc||p.y>1)return!0}return!1}},{key:"isHorizonVisible",value:function(){return this.pitch+e.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.Point(0,0),new e.Point(this.width,this.height))}},{key:"zoomDeltaToMovement",value:function(t,n){var r=e.length(e.sub([],this._camera.position,t)),i=this._zoomFromMercatorZ(r)+n;return r-this._mercatorZfromZoom(i)}},{key:"getCameraPoint",value:function(){if("globe"===this.projection.name){var t=function(t,n){var r=f(t,3),i=[r[0],r[1],r[2],1];e.transformMat4$1(i,i,n);var a=i[3]=Math.max(i[3],1e-6);return i[0]/=a,i[1]/=a,i[2]/=a,i}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.Point(t[0],t[1])}var n=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,n))}},{key:"getCameraToCenterDistance",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.zoom,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.worldSize,r=ri(e,t,this.width,this.height,1024),i=e.pixelSpaceConversion(this.center.lat,n,r);return.5/Math.tan(.5*this._fov)*this.height*i}},{key:"getWorldToCameraMatrix",value:function(){var t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&e.multiply(t,t,this.globeMatrix),t}}]),n}();function li(e,t){var n=!1,r=null,i=function i(){r=null,n&&(e(),r=setTimeout(i,t),n=!1)};return function(){return n=!0,r||i(),r}}var ci=function(){function t(n){d(this,t),this._hashName=n&&encodeURIComponent(n),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=li(this._updateHashUnthrottled.bind(this),300)}return p(t,[{key:"addTo",value:function(t){return this._map=t,e.window.addEventListener("hashchange",this._onHashChange,!1),t.on("moveend",this._updateHash),this}},{key:"remove",value:function(){return this._map?(this._map.off("moveend",this._updateHash),e.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}},{key:"getHashString",value:function(){var t=this._map;if(!t)return"";var n=ui(t);if(this._hashName){var r=this._hashName,i=!1,a=e.window.location.hash.slice(1).split("&").map((function(e){var t=e.split("=")[0];return t===r?(i=!0,"".concat(t,"=").concat(n)):e})).filter((function(e){return e}));return i||a.push("".concat(r,"=").concat(n)),"#".concat(a.join("&"))}return"#".concat(n)}},{key:"_getCurrentHash",value:function(){var t,n=this,r=e.window.location.hash.replace("#","");return this._hashName?(r.split("&").map((function(e){return e.split("=")})).forEach((function(e){e[0]===n._hashName&&(t=e)})),(t&&t[1]||"").split("/")):r.split("/")}},{key:"_onHashChange",value:function(){var e=this._map;if(!e)return!1;var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(e){return isNaN(e)}))){var n=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:n,pitch:+(t[4]||0)}),!0}return!1}},{key:"_updateHashUnthrottled",value:function(){var t=e.window.location.href.replace(/(#.+)?$/,this.getHashString());e.window.history.replaceState(e.window.history.state,null,t)}}]),t}();function ui(e,t){var n=e.getCenter(),r=Math.round(100*e.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.pow(10,i),o=Math.round(n.lng*a)/a,s=Math.round(n.lat*a)/a,l=e.getBearing(),c=e.getPitch(),u=t?"/".concat(o,"/").concat(s,"/").concat(r):"".concat(r,"/").concat(s,"/").concat(o);return(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+="/".concat(Math.round(c))),u}var fi={linearity:.3,easing:e.bezier(0,0,.3,1)},hi=e.extend({deceleration:2500,maxSpeed:1400},fi),di=e.extend({deceleration:20,maxSpeed:1400},fi),pi=e.extend({deceleration:1e3,maxSpeed:360},fi),mi=e.extend({deceleration:1e3,maxSpeed:90},fi),vi=function(){function t(e){d(this,t),this._map=e,this.clear()}return p(t,[{key:"clear",value:function(){this._inertiaBuffer=[]}},{key:"record",value:function(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.exported.now(),settings:t})}},{key:"_drainInertiaBuffer",value:function(){for(var t=this._inertiaBuffer,n=e.exported.now();t.length>0&&n-t[0].time>160;)t.shift()}},{key:"_onMoveEnd",value:function(t){if(!this._map._prefersReducedMotion()&&(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2))){var n,r={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},i=h(this._inertiaBuffer);try{for(i.s();!(n=i.n()).done;){var a=n.value.settings;r.zoom+=a.zoomDelta||0,r.bearing+=a.bearingDelta||0,r.pitch+=a.pitchDelta||0,a.panDelta&&r.pan._add(a.panDelta),a.around&&(r.around=a.around),a.pinchAround&&(r.pinchAround=a.pinchAround)}}catch(p){i.e(p)}finally{i.f()}var o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(r.pan.mag()){var l=gi(r.pan.mag(),o,e.extend({},hi,t||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,yi(s,l)}if(r.zoom){var c=gi(r.zoom,o,di);s.zoom=this._map.transform.zoom+c.amount,yi(s,c)}if(r.bearing){var u=gi(r.bearing,o,pi);s.bearing=this._map.transform.bearing+e.clamp(u.amount,-179,179),yi(s,u)}if(r.pitch){var f=gi(r.pitch,o,mi);s.pitch=this._map.transform.pitch+f.amount,yi(s,f)}if(s.zoom||s.bearing){var d=void 0===r.pinchAround?r.around:r.pinchAround;s.around=d?this._map.unproject(d):this._map.getCenter()}return this.clear(),s.noMoveStart=!0,s}}}]),t}();function yi(e,t){(!e.duration||e.duration3&&void 0!==arguments[3]?arguments[3]:{};d(this,r);var l=S(i.getCanvasContainer(),a),c=i.unproject(l);return(o=n.call(this,t,e.extend({point:l,lngLat:c,originalEvent:a},s)))._defaultPrevented=!1,o.target=i,o}return p(r,[{key:"preventDefault",value:function(){this._defaultPrevented=!0}},{key:"defaultPrevented",get:function(){return this._defaultPrevented}}]),r}(e.Event),xi=function(t){m(r,t);var n=v(r);function r(t,i,a){var o;d(this,r);var s="touchend"===t?a.changedTouches:a.touches,l=E(i.getCanvasContainer(),s),c=l.map((function(e){return i.unproject(e)})),u=l.reduce((function(e,t,n,r){return e.add(t.div(r.length))}),new e.Point(0,0));return(o=n.call(this,t,{points:l,point:u,lngLats:c,lngLat:i.unproject(u),originalEvent:a}))._defaultPrevented=!1,o}return p(r,[{key:"preventDefault",value:function(){this._defaultPrevented=!0}},{key:"defaultPrevented",get:function(){return this._defaultPrevented}}]),r}(e.Event),bi=function(e){m(n,e);var t=v(n);function n(e,r,i){var a;return d(this,n),(a=t.call(this,e,{originalEvent:i}))._defaultPrevented=!1,a}return p(n,[{key:"preventDefault",value:function(){this._defaultPrevented=!0}},{key:"defaultPrevented",get:function(){return this._defaultPrevented}}]),n}(e.Event),wi=function(){function t(e,n){d(this,t),this._map=e,this._clickTolerance=n.clickTolerance}return p(t,[{key:"reset",value:function(){this._mousedownPos=void 0}},{key:"wheel",value:function(e){return this._firePreventable(new bi(e.type,this._map,e))}},{key:"mousedown",value:function(e,t){return this._mousedownPos=t,this._firePreventable(new _i(e.type,this._map,e))}},{key:"mouseup",value:function(e){this._map.fire(new _i(e.type,this._map,e))}},{key:"preclick",value:function(t){var n=e.extend({},t);n.type="preclick",this._map.fire(new _i(n.type,this._map,n))}},{key:"click",value:function(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new _i(e.type,this._map,e)))}},{key:"dblclick",value:function(e){return this._firePreventable(new _i(e.type,this._map,e))}},{key:"mouseover",value:function(e){this._map.fire(new _i(e.type,this._map,e))}},{key:"mouseout",value:function(e){this._map.fire(new _i(e.type,this._map,e))}},{key:"touchstart",value:function(e){return this._firePreventable(new xi(e.type,this._map,e))}},{key:"touchmove",value:function(e){this._map.fire(new xi(e.type,this._map,e))}},{key:"touchend",value:function(e){this._map.fire(new xi(e.type,this._map,e))}},{key:"touchcancel",value:function(e){this._map.fire(new xi(e.type,this._map,e))}},{key:"_firePreventable",value:function(e){if(this._map.fire(e),e.defaultPrevented)return{}}},{key:"isEnabled",value:function(){return!0}},{key:"isActive",value:function(){return!1}},{key:"enable",value:function(){}},{key:"disable",value:function(){}}]),t}(),ki=function(){function e(t){d(this,e),this._map=t}return p(e,[{key:"reset",value:function(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}},{key:"mousemove",value:function(e){this._map.fire(new _i(e.type,this._map,e))}},{key:"mousedown",value:function(){this._delayContextMenu=!0}},{key:"mouseup",value:function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new _i("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}},{key:"contextmenu",value:function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new _i(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}},{key:"isEnabled",value:function(){return!0}},{key:"isActive",value:function(){return!1}},{key:"enable",value:function(){}},{key:"disable",value:function(){}}]),e}(),zi=function(){function t(e,n){d(this,t),this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=n.clickTolerance||1}return p(t,[{key:"isEnabled",value:function(){return!!this._enabled}},{key:"isActive",value:function(){return!!this._active}},{key:"enable",value:function(){this.isEnabled()||(this._enabled=!0)}},{key:"disable",value:function(){this.isEnabled()&&(this._enabled=!1)}},{key:"mousedown",value:function(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(k(),this._startPos=this._lastPos=t,this._active=!0)}},{key:"mousemoveWindow",value:function(e,t){var n=this;if(this._active){var r=t,i=this._startPos,a=this._lastPos;if(!(!i||!a||a.equals(r)||!this._box&&r.dist(i)this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){var n,r=new e.Point(0,0),i=h(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;r._add(a)}}catch(o){i.e(o)}finally{i.f()}return r.div(t.length)}(n),this.touches=Mi(r,n)))}},{key:"touchmove",value:function(e,t,n){if(!this.aborted&&this.centroid){var r=Mi(n,t);for(var i in this.touches){var a=r[i];(!a||a.dist(this.touches[i])>30)&&(this.aborted=!0)}}}},{key:"touchend",value:function(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}}}]),t}(),Si=function(){function e(t){d(this,e),this.singleTap=new Ti(t),this.numTaps=t.numTaps,this.reset()}return p(e,[{key:"reset",value:function(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}},{key:"touchstart",value:function(e,t,n){this.singleTap.touchstart(e,t,n)}},{key:"touchmove",value:function(e,t,n){this.singleTap.touchmove(e,t,n)}},{key:"touchend",value:function(e,t,n){var r=this.singleTap.touchend(e,t,n);if(r){var i=e.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(r)<30;if(i&&a||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}]),e}(),Ei=function(){function e(){d(this,e),this._zoomIn=new Si({numTouches:1,numTaps:2}),this._zoomOut=new Si({numTouches:2,numTaps:1}),this.reset()}return p(e,[{key:"reset",value:function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}},{key:"touchstart",value:function(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)}},{key:"touchmove",value:function(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)}},{key:"touchend",value:function(e,t,n){var r=this,i=this._zoomIn.touchend(e,t,n),a=this._zoomOut.touchend(e,t,n);return i?(this._active=!0,e.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(i)},{originalEvent:e})}}):a?(this._active=!0,e.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(a)},{originalEvent:e})}}):void 0}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}}]),e}(),Ci={0:1,2:2},Ai=function(){function e(t){d(this,e),this.reset(),this._clickTolerance=t.clickTolerance||1}return p(e,[{key:"blur",value:function(){this.reset()}},{key:"reset",value:function(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}},{key:"_correctButton",value:function(e,t){return!1}},{key:"_move",value:function(e,t){return{}}},{key:"mousedown",value:function(e,t){if(!this._lastPoint){var n=C(e);this._correctButton(e,n)&&(this._lastPoint=t,this._eventButton=n)}}},{key:"mousemoveWindow",value:function(e,t){var n=this._lastPoint;if(n)if(e.preventDefault(),null!=this._eventButton&&function(e,t){var n=Ci[t];return void 0===e.buttons||(e.buttons&n)!==n}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(n)0&&(this._active=!0);var i=Mi(r,n),a=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(sMath.abs(e.x)}var Ui=function(t){m(r,t);var n=v(r);function r(e){var t;return d(this,r),(t=n.call(this))._map=e,t}return p(r,[{key:"reset",value:function(){o(s(r.prototype),"reset",this).call(this),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}},{key:"_start",value:function(e){this._lastPoints=e,ji(e[0].sub(e[1]))&&(this._valid=!1)}},{key:"_move",value:function(t,n,r){var i=this._lastPoints;if(i){var a=t[0].sub(i[0]),o=t[1].sub(i[1]);return this._map._cooperativeGestures&&!e.isFullscreen()&&r.touches.length<3||(this._valid=this.gestureBeginsVertically(a,o,r.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(a.y+o.y)/2*-.5})}}},{key:"gestureBeginsVertically",value:function(e,t,n){if(void 0!==this._valid)return this._valid;var r=e.mag()>=2,i=t.mag()>=2;if(r||i){if(!r||!i)return null==this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;var a=e.y>0==t.y>0;return ji(e)&&ji(t)&&a}}}]),r}(Ri),Hi={panStep:100,bearingStep:15,pitchStep:10},Zi=function(){function e(){d(this,e);var t=Hi;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}return p(e,[{key:"blur",value:function(){this.reset()}},{key:"reset",value:function(){this._active=!1}},{key:"keydown",value:function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var n=0,r=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:Gi,zoom:n?Math.round(l)+n*(e.shiftKey?2:1):l,bearing:s.getBearing()+r*t._bearingStep,pitch:s.getPitch()+i*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}},{key:"disableRotation",value:function(){this._rotationDisabled=!0}},{key:"enableRotation",value:function(){this._rotationDisabled=!1}}]),e}();function Gi(e){return e*(2-e)}var qi=4.000244140625,Wi=function(){function t(n,r){d(this,t),this._map=n,this._el=n.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,e.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}return p(t,[{key:"setZoomRate",value:function(e){this._defaultZoomRate=e}},{key:"setWheelZoomRate",value:function(e){this._wheelZoomRate=e}},{key:"isEnabled",value:function(){return!!this._enabled}},{key:"isActive",value:function(){return this._active||void 0!==this._finishTimeout}},{key:"isZooming",value:function(){return!!this._zooming}},{key:"enable",value:function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}},{key:"disable",value:function(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}},{key:"wheel",value:function(t){if(this.isEnabled()){if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||e.isFullscreen()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}var n=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,r=e.exported.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==n&&n%qi==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}}},{key:"_onTimeout",value:function(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}},{key:"_start",value: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 t=S(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:t,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}}},{key:"renderFrame",value:function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var n=this._map.transform;"wheel"===this._type&&n.projection.wrap&&(n._center.lng>=180||n._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);var r=function(){return n._terrainEnabled()&&t._aroundCoord?n.computeZoomRelativeTo(t._aroundCoord):n.zoom};if(0!==this._delta){var i="wheel"===this._type&&Math.abs(this._delta)>qi?this._wheelZoomRate:this._defaultZoomRate,a=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==a&&(a=1/a);var o=r(),s=Math.pow(2,o),l="number"==typeof this._targetZoom?n.zoomScale(this._targetZoom):s;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(l*a))),"wheel"===this._type&&(this._startZoom=o,this._easing=this._smoothOutEasing(200)),this._delta=0}var c,u="number"==typeof this._targetZoom?this._targetZoom:r(),f=this._startZoom,h=this._easing,d=!1;if("wheel"===this._type&&f&&h){var p=Math.min((e.exported.now()-this._lastWheelEventTime)/200,1),m=h(p);c=e.number(f,u,m),p<1?this._frameId||(this._frameId=!0):d=!0}else c=u,d=!0;return this._active=!0,d&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!d,zoomDelta:c-r(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}}},{key:"_smoothOutEasing",value:function(t){var n=e.ease;if(this._prevEase){var r=this._prevEase,i=(e.exported.now()-r.start)/r.duration,a=r.easing(i+.01)-r.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);n=e.bezier(o,s,.25,1)}return this._prevEase={start:e.exported.now(),duration:t,easing:n},n}},{key:"blur",value:function(){this.reset()}},{key:"reset",value:function(){this._active=!1}},{key:"_addScrollZoomBlocker",value:function(){this._map&&!this._alertContainer&&(this._alertContainer=g("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(e.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize="".concat(Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth))),"px"))}},{key:"_showBlockerAlert",value:function(){var e=this;this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout((function(){e._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),e._alertContainer.setAttribute("role","null")}),200)}}]),t}(),Xi=function(){function e(t,n){d(this,e),this._clickZoom=t,this._tapZoom=n}return p(e,[{key:"enable",value:function(){this._clickZoom.enable(),this._tapZoom.enable()}},{key:"disable",value:function(){this._clickZoom.disable(),this._tapZoom.disable()}},{key:"isEnabled",value:function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}},{key:"isActive",value:function(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}]),e}(),Yi=function(){function e(){d(this,e),this.reset()}return p(e,[{key:"reset",value:function(){this._active=!1}},{key:"blur",value:function(){this.reset()}},{key:"dblclick",value:function(e,t){return e.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(e.shiftKey?-1:1),around:n.unproject(t)},{originalEvent:e})}}}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}}]),e}(),Ki=function(){function e(){d(this,e),this._tap=new Si({numTouches:1,numTaps:1}),this.reset()}return p(e,[{key:"reset",value:function(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}},{key:"touchstart",value:function(e,t,n){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=t[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(e,t,n))}},{key:"touchmove",value:function(e,t,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var r=t[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,n)}},{key:"touchend",value:function(e,t,n){this._tapTime?this._swipePoint&&0===n.length&&this.reset():this._tap.touchend(e,t,n)&&(this._tapTime=e.timeStamp)}},{key:"touchcancel",value:function(){this.reset()}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1,this.reset()}},{key:"isEnabled",value:function(){return this._enabled}},{key:"isActive",value:function(){return this._active}}]),e}(),$i=function(){function e(t,n,r){d(this,e),this._el=t,this._mousePan=n,this._touchPan=r}return p(e,[{key:"enable",value:function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}},{key:"disable",value:function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}},{key:"isEnabled",value:function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}},{key:"isActive",value:function(){return this._mousePan.isActive()||this._touchPan.isActive()}}]),e}(),Ji=function(){function e(t,n,r){d(this,e),this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=r}return p(e,[{key:"enable",value:function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}},{key:"disable",value:function(){this._mouseRotate.disable(),this._mousePitch.disable()}},{key:"isEnabled",value:function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}},{key:"isActive",value:function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}]),e}(),Qi=function(){function e(t,n,r,i){d(this,e),this._el=t,this._touchZoom=n,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}return p(e,[{key:"enable",value:function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}},{key:"disable",value:function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}},{key:"isEnabled",value:function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}},{key:"isActive",value:function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}},{key:"disableRotation",value:function(){this._rotationDisabled=!0,this._touchRotate.disable()}},{key:"enableRotation",value:function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}]),e}(),ea=function(e){return e.zoom||e.drag||e.pitch||e.rotate},ta=function(e){m(n,e);var t=v(n);function n(){return d(this,n),t.apply(this,arguments)}return p(n)}(e.Event),na=function(){function t(){d(this,t),this.constants=[1,1,.01],this.radius=0}return p(t,[{key:"setup",value:function(t,n){var r=e.sub([],n,t);this.radius=e.length(r[2]<0?e.div([],r,this.constants):[r[0],r[1],0])}},{key:"projectRay",value:function(t){e.div(t,t,this.constants),e.normalize(t,t),e.mul$1(t,t,this.constants);var n=e.scale$2([],t,this.radius);if(n[2]>0){var r=e.scale$2([],[0,0,1],e.dot(n,[0,0,1])),i=e.scale$2([],e.normalize([],[n[0],n[1],0]),this.radius),a=e.add([],n,e.scale$2([],e.sub([],e.add([],i,r),n),2));n[0]=a[0],n[1]=a[1]}return n}}]),t}();function ra(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var ia=function(){function t(n,r){d(this,t),this._map=n,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new vi(n),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new na,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(r),e.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],[e.window.document,"mousemove",{capture:!0}],[e.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],[e.window,"blur",void 0]];var a,o=h(this._listeners);try{for(o.s();!(a=o.n()).done;){var s=f(a.value,3),l=s[0],c=s[1],u=s[2];l.addEventListener(c,l===e.window.document?this.handleWindowEvent:this.handleEvent,u)}}catch(p){o.e(p)}finally{o.f()}}return p(t,[{key:"destroy",value:function(){var t,n=h(this._listeners);try{for(n.s();!(t=n.n()).done;){var r=f(t.value,3),i=r[0],a=r[1],o=r[2];i.removeEventListener(a,i===e.window.document?this.handleWindowEvent:this.handleEvent,o)}}catch(s){n.e(s)}finally{n.f()}}},{key:"_addDefaultHandlers",value:function(e){var t=this._map,n=t.getCanvasContainer();this._add("mapEvent",new wi(t,e));var r=t.boxZoom=new zi(t,e);this._add("boxZoom",r);var i=new Ei,a=new Yi;t.doubleClickZoom=new Xi(a,i),this._add("tapZoom",i),this._add("clickZoom",a);var o=new Ki;this._add("tapDragZoom",o);var s=t.touchPitch=new Ui(t);this._add("touchPitch",s);var l=new Pi(e),c=new Li(e);t.dragRotate=new Ji(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);var u=new Ii(e),f=new Di(t,e);t.dragPan=new $i(n,u,f),this._add("mousePan",u),this._add("touchPan",f,["touchZoom","touchRotate"]);var h=new Vi,d=new Ni;t.touchZoomRotate=new Qi(n,d,h,o),this._add("touchRotate",h,["touchPan","touchZoom"]),this._add("touchZoom",d,["touchPan","touchRotate"]),this._add("blockableMapEvent",new ki(t));var p=t.scrollZoom=new Wi(t,this);this._add("scrollZoom",p,["mousePan"]);var m=t.keyboard=new Zi;this._add("keyboard",m);for(var v=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];v0&&(u=0),o._isCameraConstrained=!1),void 0!==m&&(d=m),(u||function(e){return n[e]&&!i._eventsInProgress[e]}("drag"))&&d&&(this._dragOrigin=s(o.pointCoordinate3D(d)),this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",a._stop(!0),d=d||a.transform.centerPoint,f&&(o.bearing+=f),h&&(o.pitch+=h),o._updateCameraState();var v=[0,0,0];if(c)if("mercator"===o.projection.name){var y=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(d).dir),g=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(d.sub(c)).dir);v[0]=g[0]-y[0],v[1]=g[1]-y[1]}else{var _=o.pointCoordinate(d);if("globe"===o.projection.name){c=c.rotate(-o.angle);var x=o._pixelsPerMercatorPixel/o.worldSize;v[0]=-c.x*e.mercatorScale(e.latFromMercatorY(_.y))*x,v[1]=-c.y*e.mercatorScale(o.center.lat)*x}else{var b=o.pointCoordinate(d.sub(c));_&&b&&(v[0]=b.x-_.x,v[1]=b.y-_.y)}}var w=o.zoom,k=[0,0,0];if(u){var z=s(p||o.pointCoordinate3D(d)),M={dir:e.normalize([],e.sub([],z,o._camera.position))};if(M.dir[2]<0){var T=o.zoomDeltaToMovement(z,u);e.scale$2(k,M.dir,T)}}var S=e.add(v,v,k);o._translateCameraConstrained(S),u&&Math.abs(o.zoom-w)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,r,!0)}else this._fireEvents(n,r,!0)}},{key:"_fireEvents",value:function(t,n,r){var i=this,a=ea(this._eventsInProgress),o=ea(t),s={};for(var l in t){var c=t[l].originalEvent;this._eventsInProgress[l]||(s["".concat(l,"start")]=c),this._eventsInProgress[l]=t[l]}for(var u in!a&&o&&this._fireEvent("movestart",o.originalEvent),s)this._fireEvent(u,s[u]);for(var f in o&&this._fireEvent("move",o.originalEvent),t){var h=t[f].originalEvent;this._fireEvent(f,h)}var d,p={};for(var m in this._eventsInProgress){var v=this._eventsInProgress[m],y=v.handlerName,g=v.originalEvent;this._handlersById[y].isActive()||(delete this._eventsInProgress[m],d=n[y]||g,p["".concat(m,"end")]=d)}for(var _ in p)this._fireEvent(_,p[_]);var x=ea(this._eventsInProgress);if(r&&(a||o)&&!x){this._updatingCamera=!0;var b=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),w=function(e){return 0!==e&&-i._bearingSnape.aspect?n/(2*Math.tan(.5*e.fovX)*e.aspect):r/(2*Math.tan(.5*e.fovY)*e.aspect)}},{key:"_cameraForBoundsOnGlobe",value:function(t,n,r,i,a,o){var s=t.clone(),l=this._extendCameraOptions(o);s.bearing=i,s.pitch=a;var c=e.LngLat.convert(n),u=e.LngLat.convert(r),f=.5*(c.lat+u.lat),h=.5*(c.lng+u.lng),d=e.latLngToECEF(f,h),p=e.normalize([],d),m=e.normalize([],e.cross([],p,[0,1,0])),v=e.cross([],m,p),y=[m[0],m[1],m[2],0,v[0],v[1],v[2],0,p[0],p[1],p[2],0,0,0,0,1],g=[d,e.latLngToECEF(c.lat,c.lng),e.latLngToECEF(u.lat,c.lng),e.latLngToECEF(u.lat,u.lng),e.latLngToECEF(c.lat,u.lng),e.latLngToECEF(f,c.lng),e.latLngToECEF(f,u.lng),e.latLngToECEF(c.lat,h),e.latLngToECEF(u.lat,h)],_=e.Aabb.fromPoints(g.map((function(t){return[e.dot(m,t),e.dot(v,t),e.dot(p,t)]}))),x=e.transformMat4([],_.center,y);0===e.squaredLength(x)&&e.set(x,0,0,1),e.normalize(x,x),e.scale$2(x,x,e.GLOBE_RADIUS),s.center=e.ecefToLatLng(x);var b=s.getWorldToCameraMatrix(),w=e.invert(new Float64Array(16),b);_=e.Aabb.applyTransform(_,e.multiply([],b,y)),e.transformMat4(x,x,b);var k=.5*(_.max[2]-_.min[2]),z=this._minimumAABBFrustumDistance(s,_),M=e.scale$2([],[0,0,1],k),T=e.add(M,x,M),S=z+(0===s.pitch?0:e.distance(x,T)),E=s.globeCenterInViewSpace,C=e.sub([],x,[E[0],E[1],E[2]]);e.normalize(C,C),e.scale$2(C,C,S);var A=e.add([],x,C);e.transformMat4(A,A,w);var I=e.earthRadius/e.GLOBE_RADIUS,P=e.length(A),L=e.mercatorZfromAltitude(Math.max(P*I-e.earthRadius,Number.EPSILON),0),D=Math.min(s.zoomFromMercatorZAdjusted(L),l.maxZoom);return D>.5*(e.GLOBE_ZOOM_THRESHOLD_MIN+e.GLOBE_ZOOM_THRESHOLD_MAX)?(s.setProjection({name:"mercator"}),s.zoom=D,this._cameraForBounds(s,n,r,i,a,o)):{center:s.center,zoom:D,bearing:i,pitch:a}}},{key:"queryTerrainElevation",value:function(t,n){var r=this.transform.elevation;return r?(n=e.extend({},{exaggerated:!0},n),r.getAtPoint(e.MercatorCoordinate.fromLngLat(t),null,n.exaggerated)):null}},{key:"_cameraForBounds",value:function(t,n,r,i,a,o){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,n,r,i,a,o);var s=t.clone(),l=this._extendCameraOptions(o),c=s.padding;s.bearing=i,s.pitch=a;var u=e.LngLat.convert(n),f=e.LngLat.convert(r),h=new e.LngLat(u.lng,f.lat),d=new e.LngLat(f.lng,u.lat),p=s.project(u),m=s.project(f),v=this.queryTerrainElevation(u),y=this.queryTerrainElevation(f),g=this.queryTerrainElevation(h),_=this.queryTerrainElevation(d),x=[[p.x,p.y,Math.min(v||0,y||0,g||0,_||0)],[m.x,m.y,Math.max(v||0,y||0,g||0,_||0)]],b=e.Aabb.fromPoints(x),w=s.getWorldToCameraMatrix(),k=e.invert(new Float64Array(16),w);b=e.Aabb.applyTransform(b,w);var z=e.sub([],b.max,b.min),M=c.left||0,T=c.right||0,S=c.bottom||0,E=c.top||0,C=l.padding,A=C.left,I=C.right,P=C.top,L=C.bottom,D=.5*(M+T),R=.5*(E+S),O=Math.min(s.scaleZoom(s.scale*Math.min((s.width-(M+T+A+I))/z[0],(s.height-(S+E+L+P))/z[1])),l.maxZoom),B=s.scale/s.zoomScale(O);b=new e.Aabb([b.min[0]-(A+D)*B,b.min[1]-(L+R)*B,b.min[2]],[b.max[0]+(I+D)*B,b.max[1]+(P+R)*B,b.max[2]]);var N=.5*z[2],F=this._minimumAABBFrustumDistance(s,b),V=[0,0,1,0];e.transformMat4$1(V,V,w),e.normalize$2(V,V);var j=e.scale$2([],V,F+N),U=e.add([],b.center,j),H=("number"==typeof l.offset.x&&"number"==typeof l.offset.y?new e.Point(l.offset.x,l.offset.y):e.Point.convert(l.offset)).rotate(-e.degToRad(i));b.center[0]-=H.x*B,b.center[1]+=H.y*B,e.transformMat4(b.center,b.center,k),e.transformMat4(U,U,k);var Z=[b.center[0],b.center[1],U[2]*s.pixelsPerMeter];e.scale$2(Z,Z,1/s.worldSize);var G=e.lngFromMercatorX(Z[0]),q=e.latFromMercatorY(Z[1]),W=Math.min(s._zoomFromMercatorZ(Z[2]),l.maxZoom),X=new e.LngLat(G,q);return s.mercatorFromTransition&&W<.5*(e.GLOBE_ZOOM_THRESHOLD_MIN+e.GLOBE_ZOOM_THRESHOLD_MAX)?(s.setProjection({name:"globe"}),s.zoom=W,this._cameraForBounds(s,n,r,i,a,o)):{center:X,zoom:W,bearing:i,pitch:a}}},{key:"fitBounds",value:function(e,t,n){var r=this.cameraForBounds(e,t);return this._fitInternal(r,t,n)}},{key:"fitScreenCoordinates",value:function(t,n,r,i,a){var o=e.Point.convert(t),s=e.Point.convert(n),l=new e.Point(Math.min(o.x,s.x),Math.min(o.y,s.y)),c=new e.Point(Math.max(o.x,s.x),Math.max(o.y,s.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(o,s))return this;var u=this.transform.pointLocation3D(l),f=this.transform.pointLocation3D(c),h=this.transform.pointLocation3D(new e.Point(l.x,c.y)),d=this.transform.pointLocation3D(new e.Point(c.x,l.y)),p=[Math.min(u.lng,f.lng,h.lng,d.lng),Math.min(u.lat,f.lat,h.lat,d.lat)],m=[Math.max(u.lng,f.lng,h.lng,d.lng),Math.max(u.lat,f.lat,h.lat,d.lat)],v=i&&i.pitch?i.pitch:this.getPitch(),y=this._cameraForBounds(this.transform,p,m,r,v,i);return this._fitInternal(y,i,a)}},{key:"_fitInternal",value:function(t,n,r){return t?(delete(n=e.extend(t,n)).padding,n.linear?this.easeTo(n,r):this.flyTo(n,r)):this}},{key:"jumpTo",value:function(t,n){this.stop();var r=t.preloadOnly?this.transform.clone():this.transform,i=!1,a=!1,o=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(i=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=e.LngLat.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(a=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(o=!0,r.pitch=+t.pitch),null==t.padding||r.isPaddingEqual(t.padding)||(r.padding=t.padding),t.preloadOnly?(this._preloadTiles(r),this):(this.fire(new e.Event("movestart",n)).fire(new e.Event("move",n)),i&&this.fire(new e.Event("zoomstart",n)).fire(new e.Event("zoom",n)).fire(new e.Event("zoomend",n)),a&&this.fire(new e.Event("rotatestart",n)).fire(new e.Event("rotate",n)).fire(new e.Event("rotateend",n)),o&&this.fire(new e.Event("pitchstart",n)).fire(new e.Event("pitch",n)).fire(new e.Event("pitchend",n)),this.fire(new e.Event("moveend",n)))}},{key:"getFreeCameraOptions",value:function(){return this.transform.projection.supportsFreeCamera||e.warnOnce(aa),this.transform.getFreeCameraOptions()}},{key:"setFreeCameraOptions",value:function(t,n){var r=this.transform;if(!r.projection.supportsFreeCamera)return e.warnOnce(aa),this;this.stop();var i=r.zoom,a=r.pitch,o=r.bearing;r.setFreeCameraOptions(t);var s=i!==r.zoom,l=a!==r.pitch,c=o!==r.bearing;return this.fire(new e.Event("movestart",n)).fire(new e.Event("move",n)),s&&this.fire(new e.Event("zoomstart",n)).fire(new e.Event("zoom",n)).fire(new e.Event("zoomend",n)),c&&this.fire(new e.Event("rotatestart",n)).fire(new e.Event("rotate",n)).fire(new e.Event("rotateend",n)),l&&this.fire(new e.Event("pitchstart",n)).fire(new e.Event("pitch",n)).fire(new e.Event("pitchend",n)),this.fire(new e.Event("moveend",n)),this}},{key:"easeTo",value:function(t,n){var r=this;this._stop(!1,t.easeId),(!1===(t=e.extend({offset:[0,0],duration:500,easing:e.ease},t)).animate||this._prefersReducedMotion(t))&&(t.duration=0);var i,a,o,s=this.transform,l=this.getZoom(),c=this.getBearing(),u=this.getPitch(),f=this.getPadding(),h="zoom"in t?+t.zoom:l,d="bearing"in t?this._normalizeBearing(t.bearing,c):c,p="pitch"in t?+t.pitch:u,m="padding"in t?t.padding:s.padding,v=e.Point.convert(t.offset);if("globe"===s.projection.name){var y=e.MercatorCoordinate.fromLngLat(s.center),g=v.rotate(-s.angle);y.x+=g.x/s.worldSize,y.y+=g.y/s.worldSize;var _=y.toLngLat(),x=e.LngLat.convert(t.center||_);this._normalizeCenter(x),i=s.centerPoint.add(g),a=new e.Point(y.x,y.y).mult(s.worldSize),o=new e.Point(e.mercatorXfromLng(x.lng),e.mercatorYfromLat(x.lat)).mult(s.worldSize).sub(a)}else{i=s.centerPoint.add(v);var b=s.pointLocation(i),w=e.LngLat.convert(t.center||b);this._normalizeCenter(w),a=s.project(b),o=s.project(w).sub(a)}var k,z,M=s.zoomScale(h-l);t.around&&(k=e.LngLat.convert(t.around),z=s.locationPoint(k));var T=this._zooming||h!==l,S=this._rotating||c!==d,E=this._pitching||p!==u,C=!s.isPaddingEqual(m),A=function(s){return function(y){if(T&&(s.zoom=e.number(l,h,y)),S&&(s.bearing=e.number(c,d,y)),E&&(s.pitch=e.number(u,p,y)),C&&(s.interpolatePadding(f,m,y),i=s.centerPoint.add(v)),k)s.setLocationAtPoint(k,z);else{var g=s.zoomScale(s.zoom-l),_=h>l?Math.min(2,M):Math.max(.5,M),x=Math.pow(_,1-y),b=s.unproject(a.add(o.mult(y*x)).mult(g));s.setLocationAtPoint(s.renderWorldCopies?b.wrap():b,i)}return t.preloadOnly||r._fireMoveEvents(n),s}};if(t.preloadOnly){var I=this._emulate(A,t.duration,s);return this._preloadTiles(I),this}var P={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=T,this._rotating=S,this._pitching=E,this._padding=C,this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,P),this._ease(A(s),(function(e){s.recenterOnTerrain(),r._afterEase(n,e)}),t),this}},{key:"_prepareEase",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._moving=!0,this.transform.cameraElevationReference="sea",n||r.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!r.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new e.Event("pitchstart",t))}},{key:"_fireMoveEvents",value:function(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))}},{key:"_afterEase",value:function(t,n){if(!this._easeId||!n||this._easeId!==n){this._easeId=void 0,this.transform.cameraElevationReference="ground";var r=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new e.Event("zoomend",t)),i&&this.fire(new e.Event("rotateend",t)),a&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}}},{key:"flyTo",value:function(t,n){var r=this;if(this._prefersReducedMotion(t)){var i=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,n)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,f="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:l,d="padding"in t?t.padding:a.padding,p=a.zoomScale(u-o),m=e.Point.convert(t.offset),v=a.centerPoint.add(m),y=a.pointLocation(v),g=e.LngLat.convert(t.center||y);this._normalizeCenter(g);var _=a.project(y),x=a.project(g).sub(_),b=t.curve,w=Math.max(a.width,a.height),k=w/p,z=x.mag();if("minZoom"in t){var M=e.clamp(Math.min(t.minZoom,o,u),a.minZoom,a.maxZoom),T=w/a.zoomScale(M-o);b=Math.sqrt(T/z*2)}var S=b*b;function E(e){var t=(k*k-w*w+(e?-1:1)*S*S*z*z)/(2*(e?k:w)*S*z);return Math.log(Math.sqrt(t*t+1)-t)}function C(e){return(Math.exp(e)-Math.exp(-e))/2}function A(e){return(Math.exp(e)+Math.exp(-e))/2}var I=E(0),P=function(e){return A(I)/A(I+b*e)},L=function(e){return w*((A(I)*(C(t=I+b*e)/A(t))-C(I))/S)/z;var t},D=(E(1)-I)/b;if(Math.abs(z)<1e-6||!isFinite(D)){if(Math.abs(w-k)<1e-6)return this.easeTo(t,n);var R=kt.maxDuration&&(t.duration=0);var O=s!==f,B=h!==l,N=!a.isPaddingEqual(d),F=function(i){return function(a){var p=a*D,y=1/P(p);i.zoom=1===a?u:o+i.scaleZoom(y),O&&(i.bearing=e.number(s,f,a)),B&&(i.pitch=e.number(l,h,a)),N&&(i.interpolatePadding(c,d,a),v=i.centerPoint.add(m));var b=1===a?g:i.unproject(_.add(x.mult(L(p))).mult(y));return i.setLocationAtPoint(i.renderWorldCopies?b.wrap():b,v),i._updateCameraOnTerrain(),t.preloadOnly||r._fireMoveEvents(n),i}};if(t.preloadOnly){var V=this._emulate(F,t.duration,a);return this._preloadTiles(V),this}return this._zooming=!0,this._rotating=O,this._pitching=B,this._padding=N,this._prepareEase(n,!1),this._ease(F(a),(function(){return r._afterEase(n)}),t),this}},{key:"isEasing",value:function(){return!!this._easeFrameId}},{key:"stop",value:function(){return this._stop()}},{key:"_stop",value:function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){var n=this._onEaseEnd;this._onEaseEnd=void 0,n.call(this,t)}if(!e){var r=this.handlers;r&&r.stop(!1)}return this}},{key:"_ease",value:function(t,n,r){!1===r.animate||0===r.duration?(t(1),n()):(this._easeStart=e.exported.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}},{key:"_renderFrameCallback",value:function(){var t=Math.min((e.exported.now()-this._easeStart)/this._easeOptions.duration,1),n=this._onEaseFrame;n&&n(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}},{key:"_normalizeBearing",value:function(t,n){t=e.wrap(t,-180,180);var r=Math.abs(t-n);return Math.abs(t-360-n)180?-360:n<-180?360:0}}},{key:"_prefersReducedMotion",value:function(t){return this._respectPrefersReducedMotion&&e.exported.prefersReducedMotion&&!(t&&t.essential)}},{key:"_emulate",value:function(e,t,n){for(var r=Math.ceil(15*t/1e3),i=[],a=e(n.clone()),o=0;o<=r;o++){var s=a(o/r);i.push(s.clone())}return i}}]),r}(e.Evented),sa=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(this,t),this.options=n,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}return p(t,[{key:"getDefaultPosition",value:function(){return"bottom-right"}},{key:"onAdd",value:function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=g("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=g("button","mapboxgl-ctrl-attrib-button",this._container),g("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=g("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),t&&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===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}},{key:"onRemove",value:function(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}},{key:"_setElementTitle",value:function(e,t){var n=this._map._getUIString("AttributionControl.".concat(t));e.setAttribute("aria-label",n),e.removeAttribute("title"),e.firstElementChild&&e.firstElementChild.setAttribute("title",n)}},{key:"_toggleAttribution",value:function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}},{key:"_updateEditLink",value:function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){var r=n.reduce((function(e,t,r){return t.value&&(e+="".concat(t.key,"=").concat(t.value).concat(r=0)return!1;return!0})),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[].concat(u(this.options.customAttribution),u(e)):e.unshift(this.options.customAttribution));var o=e.join(" | ");o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}}},{key:"_updateCompact",value:function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}]),t}(),la=function(){function t(){d(this,t),e.bindAll(["_updateLogo","_updateCompact"],this)}return p(t,[{key:"onAdd",value:function(e){this._map=e,this._container=g("div","mapboxgl-ctrl");var t=g("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}},{key:"onRemove",value:function(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}},{key:"getDefaultPosition",value:function(){return"bottom-left"}},{key:"_updateLogo",value:function(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}},{key:"_logoRequired",value:function(){if(!this._map.style)return!0;var e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(var t in e){var n=e[t].getSource();if(n.hasOwnProperty("mapbox_logo")&&!n.mapbox_logo)return!1}return!0}},{key:"_updateCompact",value:function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}}}]),t}(),ca=function(){function e(){d(this,e),this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}return p(e,[{key:"add",value:function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}},{key:"remove",value:function(e){var t,n=this._currentlyRunning,r=n?this._queue.concat(n):this._queue,i=h(r);try{for(i.s();!(t=i.n()).done;){var a=t.value;if(a.id===e)return void(a.cancelled=!0)}}catch(o){i.e(o)}finally{i.f()}}},{key:"run",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this._currentlyRunning=this._queue;this._queue=[];var n,r=h(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!i.cancelled&&(i.callback(e),this._cleared))break}}catch(a){r.e(a)}finally{r.f()}this._cleared=!1,this._currentlyRunning=!1}},{key:"clear",value:function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}]),e}();function ua(t,n,r){if(t=new e.LngLat(t.lng,t.lat),n){var i=new e.LngLat(t.lng-360,t.lat),a=new e.LngLat(t.lng+360,t.lat),o=360*Math.ceil(Math.abs(t.lng-r.center.lng)/360),s=r.locationPoint(t).distSqr(n),l=n.x<0||n.y<0||n.x>r.width||n.y>r.height;r.locationPoint(i).distSqr(n)180;){var c=r.locationPoint(t);if(c.x>=0&&c.y>=0&&c.x<=r.width&&c.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}var fa={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},ha=function(t){m(r,t);var n=v(r);function r(t,a){var o;if(d(this,r),o=n.call(this),(t instanceof e.window.HTMLElement||a)&&(t=e.extend({element:t},a)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],i(o)),o._anchor=t&&t.anchor||"center",o._color=t&&t.color||"#3FB1CE",o._scale=t&&t.scale||1,o._draggable=t&&t.draggable||!1,o._clickTolerance=t&&t.clickTolerance||0,o._isDragging=!1,o._state="inactive",o._rotation=t&&t.rotation||0,o._rotationAlignment=t&&t.rotationAlignment||"auto",o._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment||"auto",o._updateMoving=function(){return o._update(!0)},o._occludedOpacity=t&&t.occludedOpacity||.2,t&&t.element)o._element=t.element,o._offset=e.Point.convert(t&&t.offset||[0,0]);else{o._defaultMarker=!0,o._element=g("div");var s=41,c=27,u=_("svg",{display:"block",height:s*o._scale+"px",width:c*o._scale+"px",viewBox:"0 0 ".concat(c," ").concat(s)},o._element),f=_("radialGradient",{id:"shadowGradient"},_("defs",{},u));_("stop",{offset:"10%","stop-opacity":.4},f),_("stop",{offset:"100%","stop-opacity":.05},f),_("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},u),_("path",{fill:o._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},u),_("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},u),_("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},u),o._offset=e.Point.convert(t&&t.offset||[0,-14])}o._element.hasAttribute("aria-label")||o._element.setAttribute("aria-label","Map marker"),o._element.classList.add("mapboxgl-marker"),o._element.addEventListener("dragstart",(function(e){e.preventDefault()})),o._element.addEventListener("mousedown",(function(e){e.preventDefault()}));var h=o._element.classList;for(var p in fa)h.remove("mapboxgl-marker-anchor-".concat(p));return h.add("mapboxgl-marker-anchor-".concat(o._anchor)),o._popup=null,l(o)}return p(r,[{key:"addTo",value:function(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}},{key:"remove",value:function(){var e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}},{key:"getLngLat",value:function(){return this._lngLat}},{key:"setLngLat",value:function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}},{key:"getElement",value:function(){return this._element}},{key:"setPopup",value:function(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){var t=38.1,n=13.5,r=Math.sqrt(Math.pow(n,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[r,-1*(t-n+r)],"bottom-right":[-r,-1*(t-n+r)],left:[n,-1*(t-n)],right:[-n,-1*(t-n)]}:this._offset}this._popup=e,e._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}},{key:"_onKeyPress",value:function(e){var t=e.code,n=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==n&&13!==n||this.togglePopup()}},{key:"_onMapClick",value:function(e){var t=e.originalEvent.target,n=this._element;this._popup&&(t===n||n.contains(t))&&this.togglePopup()}},{key:"getPopup",value:function(){return this._popup}},{key:"togglePopup",value:function(){var e=this._popup;return e?(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}},{key:"_behindTerrain",value:function(){var e=this._map,t=this._pos;if(!e||!t)return!1;var n=e.unproject(t),r=e.getFreeCameraOptions();if(!r.position)return!1;var i=r.position.toLngLat();return i.distanceTo(n)<.9*i.distanceTo(this._lngLat)}},{key:"_evaluateOpacity",value:function(){var t=this._map;if(t){var n=this._pos;if(!n||n.x<0||n.x>t.transform.width||n.y<0||n.y>t.transform.height)this._clearFadeTimer();else{var r,i=t.unproject(n);t._showingGlobe()&&e.isLngLatBehindGlobe(t.transform,this._lngLat)?r=0:(r=1-t._queryFogOpacity(i),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(r*=this._occludedOpacity)),this._element.style.opacity="".concat(r),this._element.style.pointerEvents=r>0?"auto":"none",this._popup&&this._popup._setOpacity(r),this._fadeTimer=null}}}},{key:"_clearFadeTimer",value:function(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}},{key:"_updateDOM",value:function(){var e=this._pos;if(e&&this._map){var t=this._offset.mult(this._scale);this._element.style.transform="\n translate(".concat(e.x,"px,").concat(e.y,"px)\n ").concat(fa[this._anchor],"\n ").concat(this._calculateXYTransform()," ").concat(this._calculateZTransform(),"\n translate(").concat(t.x,"px,").concat(t.y,"px)\n ")}}},{key:"_calculateXYTransform",value:function(){var t=this._pos,n=this._map,r=this.getPitchAlignment();if(!n||!t||"map"!==r)return"";if(!n._showingGlobe()){var i=n.getPitch();return i?"rotateX(".concat(i,"deg)"):""}var a=e.radToDeg(e.globeTiltAtLngLat(n.transform,this._lngLat)),o=t.sub(e.globeCenterToScreenPoint(n.transform)),s=Math.abs(o.x)+Math.abs(o.y);if(0===s)return"";var l=a/s;return"rotateX(".concat(-o.y*l,"deg) rotateY(").concat(o.x*l,"deg)")}},{key:"_calculateZTransform",value:function(){var t=this._pos,n=this._map;if(!n||!t)return"";var r=0,i=this.getRotationAlignment();if("map"===i)if(n._showingGlobe()){var a=n.project(new e.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),o=n.project(new e.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(a);r=e.radToDeg(Math.atan2(o.y,o.x))-90}else r=-n.getBearing();else if("horizon"===i){var s=e.smoothstep(4,6,n.getZoom()),l=e.globeCenterToScreenPoint(n.transform);l.y+=s*n.transform.height;var c=t.sub(l),u=e.radToDeg(Math.atan2(c.y,c.x));r=(u>90?u-270:u+90)*(1-s)}return(r+=this._rotation)?"rotateZ(".concat(r,"deg)"):""}},{key:"_update",value:function(t){var n=this;e.window.cancelAnimationFrame(this._updateFrameId);var r=this._map;r&&(r.transform.renderWorldCopies&&(this._lngLat=ua(this._lngLat,this._pos,r.transform)),this._pos=r.project(this._lngLat),!0===t?this._updateFrameId=e.window.requestAnimationFrame((function(){n._element&&n._pos&&n._anchor&&(n._pos=n._pos.round(),n._updateDOM())})):this._pos=this._pos.round(),r._requestDomTask((function(){n._map&&(n._element&&n._pos&&n._anchor&&n._updateDOM(),(r._showingGlobe()||r.getTerrain()||r.getFog())&&!n._fadeTimer&&(n._fadeTimer=setTimeout(n._evaluateOpacity.bind(n),60)))})))}},{key:"getOffset",value:function(){return this._offset}},{key:"setOffset",value:function(t){return this._offset=e.Point.convert(t),this._update(),this}},{key:"_onMove",value:function(t){var n=this._map;if(n){var r=this._pointerdownPos,i=this._positionDelta;if(r&&i){if(!this._isDragging){var a=this._clickTolerance||n._clickTolerance;if(t.point.dist(r)0&&void 0!==arguments[0]?arguments[0]:new e.Point(0,0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bottom";if("number"==typeof t){var r=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(n){case"top":return new e.Point(0,t);case"top-left":return new e.Point(r,r);case"top-right":return new e.Point(-r,r);case"bottom":return new e.Point(0,-t);case"bottom-left":return new e.Point(r,-r);case"bottom-right":return new e.Point(-r,-r);case"left":return new e.Point(t,0);case"right":return new e.Point(-t,0)}return new e.Point(0,0)}return t instanceof e.Point||Array.isArray(t)?e.Point.convert(t):e.Point.convert(t[n]||[0,0])}var va=function(){function t(e){d(this,t),this.jumpTo(e)}return p(t,[{key:"getValue",value:function(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;var n=e.easeCubicInOut((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-n)+this._end*n}},{key:"isEasing",value:function(e){return e>=this._startTime&&e<=this._endTime}},{key:"jumpTo",value:function(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}},{key:"easeTo",value:function(e,t,n){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+n}}]),t}(),ya={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use \u2318 + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},ga={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},_a={showCompass:!0,showZoom:!0,visualizePitch:!1},xa=function(){function t(n,r){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];d(this,t),this._clickTolerance=10,this.element=r,this.mouseRotate=new Pi({clickTolerance:n.dragRotate._mouseRotate._clickTolerance}),this.map=n,i&&(this.mousePitch=new Li({clickTolerance:n.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener("mousedown",this.mousedown),r.addEventListener("touchstart",this.touchstart,{passive:!1}),r.addEventListener("touchmove",this.touchmove),r.addEventListener("touchend",this.touchend),r.addEventListener("touchcancel",this.reset)}return p(t,[{key:"down",value:function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),k()}},{key:"move",value:function(e,t){var n=this.map,r=this.mouseRotate.mousemoveWindow(e,t),i=r&&r.bearingDelta;if(i&&n.setBearing(n.getBearing()+i),this.mousePitch){var a=this.mousePitch.mousemoveWindow(e,t),o=a&&a.pitchDelta;o&&n.setPitch(n.getPitch()+o)}}},{key:"off",value:function(){var e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart,{passive:!1}),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}},{key:"offTemp",value:function(){z(),e.window.removeEventListener("mousemove",this.mousemove),e.window.removeEventListener("mouseup",this.mouseup)}},{key:"mousedown",value:function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),S(this.element,t)),e.window.addEventListener("mousemove",this.mousemove),e.window.addEventListener("mouseup",this.mouseup)}},{key:"mousemove",value:function(e){this.move(e,S(this.element,e))}},{key:"mouseup",value:function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}},{key:"touchstart",value:function(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=E(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos))}},{key:"touchmove",value:function(e){1!==e.targetTouches.length?this.reset():(this._lastPos=E(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos))}},{key:"touchend",value:function(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(t.antialias&&e.isSafariWithAntialiasingBug(e.window)&&(t.antialias=!1,e.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),(n=a.call(this,new si(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),t))._interactive=t.interactive,n._minTileCacheSize=t.minTileCacheSize,n._maxTileCacheSize=t.maxTileCacheSize,n._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,n._preserveDrawingBuffer=t.preserveDrawingBuffer,n._antialias=t.antialias,n._useWebGL2=t.useWebGL2,n._trackResize=t.trackResize,n._bearingSnap=t.bearingSnap,n._refreshExpiredTiles=t.refreshExpiredTiles,n._fadeDuration=t.fadeDuration,n._isInitialLoad=!0,n._crossSourceCollisions=t.crossSourceCollisions,n._collectResourceTiming=t.collectResourceTiming,n._optimizeForTerrain=t.optimizeForTerrain,n._language=n._parseLanguage(t.language),n._worldview=t.worldview,n._renderTaskQueue=new ca,n._domRenderTaskQueue=new ca,n._controls=[],n._markers=[],n._popups=[],n._mapId=e.uniqueId(),n._locale=e.extend({},ya,t.locale),n._clickTolerance=t.clickTolerance,n._cooperativeGestures=t.cooperativeGestures,n._performanceMetricsCollection=t.performanceMetricsCollection,n._containerWidth=0,n._containerHeight=0,n._averageElevationLastSampledAt=-1/0,n._averageElevationExaggeration=0,n._averageElevation=new va(0),n._interactionRange=[1/0,-1/0],n._visibilityHidden=0,n._useExplicitProjection=!1,n._requestManager=new e.RequestManager(t.transformRequest,t.accessToken,t.testMode),n._silenceAuthErrors=!!t.testMode,"string"==typeof t.container){if(n._container=e.window.document.getElementById(t.container),!n._container)throw new Error("Container '".concat(t.container,"' not found."))}else{if(!(t.container instanceof e.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");n._container=t.container}if(n._container.childNodes.length>0&&e.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),t.maxBounds&&n.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],i(n)),n._setupContainer(),n._setupPainter(),void 0===n.painter)throw new Error("Failed to initialize WebGL.");return n.on("move",(function(){return n._update(!1)})),n.on("moveend",(function(){return n._update(!1)})),n.on("zoom",(function(){return n._update(!0)})),void 0!==e.window&&(e.window.addEventListener("online",n._onWindowOnline,!1),e.window.addEventListener("resize",n._onWindowResize,!1),e.window.addEventListener("orientationchange",n._onWindowResize,!1),e.window.addEventListener("webkitfullscreenchange",n._onWindowResize,!1),e.window.addEventListener("visibilitychange",n._onVisibilityChange,!1)),n.handlers=new ia(i(n),t),n._localFontFamily=t.localFontFamily,n._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&n.setStyle(t.style,{localFontFamily:n._localFontFamily,localIdeographFontFamily:n._localIdeographFontFamily}),t.projection&&n.setProjection(t.projection),n._hash=t.hash&&new ci("string"==typeof t.hash&&t.hash||void 0).addTo(i(n)),n._hash&&n._hash._onHashChange()||(n.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(n.resize(),n.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),n.resize(),t.attributionControl&&n.addControl(new sa({customAttribution:t.customAttribution})),n._logoControl=new la,n.addControl(n._logoControl,t.logoPosition),n.on("style.load",(function(){n.transform.unmodified&&n.jumpTo(n.style.stylesheet)})),n.on("data",(function(t){n._update("style"===t.dataType),n.fire(new e.Event("".concat(t.dataType,"data"),t))})),n.on("dataloading",(function(t){n.fire(new e.Event("".concat(t.dataType,"dataloading"),t))})),l(n)}return p(u,[{key:"_getMapId",value:function(){return this._mapId}},{key:"addControl",value:function(t,n){if(void 0===n&&(n=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var r=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[n];return-1!==n.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this}},{key:"removeControl",value:function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var n=this._controls.indexOf(t);return n>-1&&this._controls.splice(n,1),t.onRemove(this),this}},{key:"hasControl",value:function(e){return this._controls.indexOf(e)>-1}},{key:"getContainer",value:function(){return this._container}},{key:"getCanvasContainer",value:function(){return this._canvasContainer}},{key:"getCanvas",value:function(){return this._canvas}},{key:"resize",value:function(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));var n=!this._moving;return n&&this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t)),this.fire(new e.Event("resize",t)),n&&this.fire(new e.Event("moveend",t)),this}},{key:"getBounds",value:function(){return this.transform.getBounds()}},{key:"getMaxBounds",value:function(){return this.transform.getMaxBounds()||null}},{key:"setMaxBounds",value:function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()}},{key:"setMinZoom",value: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.fire(new e.Event("zoomstart")).fire(new e.Event("zoom")).fire(new e.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}},{key:"getMaxZoom",value:function(){return this.transform.maxZoom}},{key:"setMinPitch",value: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()85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t?this.setPitch(t):this.fire(new e.Event("pitchstart")).fire(new e.Event("pitch")).fire(new e.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}},{key:"getMaxPitch",value:function(){return this.transform.maxPitch}},{key:"getRenderWorldCopies",value:function(){return this.transform.renderWorldCopies}},{key:"setRenderWorldCopies",value:function(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}},{key:"getLanguage",value:function(){return this._language}},{key:"_parseLanguage",value:function(t){return"auto"===t?e.window.navigator.language:Array.isArray(t)?0===t.length?void 0:t.map((function(t){return"auto"===t?e.window.navigator.language:t})):t}},{key:"setLanguage",value:function(e){var t=this._parseLanguage(e);if(!this.style||t===this._language)return this;this._language=t,this.style._reloadSources();var n,r=h(this._controls);try{for(r.s();!(n=r.n()).done;){var i=n.value;i._setLanguage&&i._setLanguage(this._language)}}catch(a){r.e(a)}finally{r.f()}return this}},{key:"getWorldview",value:function(){return this._worldview}},{key:"setWorldview",value:function(e){return this.style&&e!==this._worldview?(this._worldview=e,this.style._reloadSources(),this):this}},{key:"getProjection",value:function(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}},{key:"_showingGlobe",value:function(){return"globe"===this.transform.projection.name}},{key:"setProjection",value:function(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.stylesheet?this.style.stylesheet.projection:null)}},{key:"_updateProjectionTransition",value:function(){if("globe"===this.getProjection().name){var t,n=this.transform,r=n.projection.name;"globe"===r&&n.zoom>=e.GLOBE_ZOOM_THRESHOLD_MAX?(n.setMercatorFromTransition(),t=!0):"mercator"===r&&n.zoom=e.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate(),n){for(var r in this.painter.clearBackgroundTiles(),this.style._sourceCaches)this.style._sourceCaches[r].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}},{key:"project",value:function(t){return this.transform.locationPoint3D(e.LngLat.convert(t))}},{key:"unproject",value:function(t){return this.transform.pointLocation3D(e.Point.convert(t))}},{key:"isMoving",value:function(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}},{key:"isZooming",value:function(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}},{key:"isRotating",value:function(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}},{key:"_isDragging",value:function(){return this.handlers&&this.handlers._isDragging()||!1}},{key:"_createDelegatedListener",value:function(e,t,n){var i=this;if("mouseenter"===e||"mouseover"===e){var a=!1,o=function(r){var o=t.filter((function(e){return i.getLayer(e)})),s=o.length?i.queryRenderedFeatures(r.point,{layers:o}):[];s.length?a||(a=!0,n.call(i,new _i(e,i,r.originalEvent,{features:s}))):a=!1},s=function(){a=!1};return{layers:new Set(t),listener:n,delegates:{mousemove:o,mouseout:s}}}if("mouseleave"===e||"mouseout"===e){var l=!1,c=function(r){var a=t.filter((function(e){return i.getLayer(e)}));(a.length?i.queryRenderedFeatures(r.point,{layers:a}):[]).length?l=!0:l&&(l=!1,n.call(i,new _i(e,i,r.originalEvent)))},u=function(t){l&&(l=!1,n.call(i,new _i(e,i,t.originalEvent)))};return{layers:new Set(t),listener:n,delegates:{mousemove:c,mouseout:u}}}var f=function(e){var r=t.filter((function(e){return i.getLayer(e)})),a=r.length?i.queryRenderedFeatures(e.point,{layers:r}):[];a.length&&(e.features=a,n.call(i,e),delete e.features)};return{layers:new Set(t),listener:n,delegates:r({},e,f)}}},{key:"on",value:function(e,t,n){if(void 0===n)return o(s(u.prototype),"on",this).call(this,e,t);Array.isArray(t)||(t=[t]);var r=this._createDelegatedListener(e,t,n);for(var i in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(r),r.delegates)this.on(i,r.delegates[i]);return this}},{key:"once",value:function(e,t,n){if(void 0===n)return o(s(u.prototype),"once",this).call(this,e,t);Array.isArray(t)||(t=[t]);var r=this._createDelegatedListener(e,t,n);for(var i in r.delegates)this.once(i,r.delegates[i]);return this}},{key:"off",value:function(e,t,n){var r=this;if(void 0===n)return o(s(u.prototype),"off",this).call(this,e,t);t=new Set(Array.isArray(t)?t:[t]);var i=function(e,t){if(e.size!==t.size)return!1;var n,r=h(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!t.has(i))return!1}}catch(a){r.e(a)}finally{r.f()}return!0},a=this._delegatedListeners?this._delegatedListeners[e]:void 0;return a&&function(e){for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{},i=r.pixelRatio,a=void 0===i?1:i,o=r.sdf,s=void 0!==o&&o,l=r.stretchX,c=r.stretchY,u=r.content;if(this._lazyInitEmptyStyle(),n instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&n instanceof e.window.ImageBitmap){var f=e.exported.getImageData(n),h=f.width,d=f.height,p=f.data;this.style.addImage(t,{data:new e.RGBAImage({width:h,height:d},p),pixelRatio:a,stretchX:l,stretchY:c,content:u,sdf:s,version:0})}else if(void 0===n.width||void 0===n.height)this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{var m=n.width,v=n.height,y=n;this.style.addImage(t,{data:new e.RGBAImage({width:m,height:v},new Uint8Array(y.data)),pixelRatio:a,stretchX:l,stretchY:c,content:u,sdf:s,version:0,userImage:y}),y.onAdd&&y.onAdd(this,t)}}},{key:"updateImage",value:function(t,n){var r=this.style.getImage(t);if(r){var i=n instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&n instanceof e.window.ImageBitmap?e.exported.getImageData(n):n,a=i.width,o=i.height;void 0!==a&&void 0!==o?a===r.data.width&&o===r.data.height?(r.data.replace(i.data,!(n instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&n instanceof e.window.ImageBitmap)),this.style.updateImage(t,r)):this.fire(new e.ErrorEvent(new Error("The width and height of the updated image (".concat(a,", ").concat(o,")\n must be that same as the previous version of the image\n (").concat(r.data.width,", ").concat(r.data.height,")")))):this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")))}else this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")))}},{key:"hasImage",value:function(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)}},{key:"removeImage",value:function(e){this.style.removeImage(e)}},{key:"loadImage",value:function(t,n){e.getImage(this._requestManager.transformRequest(t,e.ResourceType.Image),(function(t,r){n(t,r instanceof e.window.HTMLImageElement?e.exported.getImageData(r):r)}))}},{key:"listImages",value:function(){return this.style.listImages()}},{key:"addLayer",value:function(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}},{key:"moveLayer",value:function(e,t){return this.style.moveLayer(e,t),this._update(!0)}},{key:"removeLayer",value:function(e){return this.style.removeLayer(e),this._update(!0)}},{key:"getLayer",value:function(e){return this.style.getLayer(e)}},{key:"setLayerZoomRange",value:function(e,t,n){return this.style.setLayerZoomRange(e,t,n),this._update(!0)}},{key:"setFilter",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.style.setFilter(e,t,n),this._update(!0)}},{key:"getFilter",value:function(e){return this.style.getFilter(e)}},{key:"setPaintProperty",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setPaintProperty(e,t,n,r),this._update(!0)}},{key:"getPaintProperty",value:function(e,t){return this.style.getPaintProperty(e,t)}},{key:"setLayoutProperty",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setLayoutProperty(e,t,n,r),this._update(!0)}},{key:"getLayoutProperty",value:function(e,t){return this.style.getLayoutProperty(e,t)}},{key:"setLight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}},{key:"getLight",value:function(){return this.style.getLight()}},{key:"setTerrain",value:function(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}},{key:"getTerrain",value:function(){return this.style?this.style.getTerrain():null}},{key:"setFog",value:function(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}},{key:"getFog",value:function(){return this.style?this.style.getFog():null}},{key:"_queryFogOpacity",value:function(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.LngLat.convert(t),this.transform):0}},{key:"setFeatureState",value:function(e,t){return this.style.setFeatureState(e,t),this._update()}},{key:"removeFeatureState",value:function(e,t){return this.style.removeFeatureState(e,t),this._update()}},{key:"getFeatureState",value:function(e){return this.style.getFeatureState(e)}},{key:"_updateContainerDimensions",value:function(){if(this._container){for(var t,n,r,i=this._container.getBoundingClientRect().width||400,a=this._container.getBoundingClientRect().height||300,o=this._container;o&&(!n||!r);){var s=e.window.getComputedStyle(o).transform;s&&"none"!==s&&((t=s.match(/matrix.*\((.+)\)/)[1].split(", "))[0]&&"0"!==t[0]&&"1"!==t[0]&&(n=t[0]),t[3]&&"0"!==t[3]&&"1"!==t[3]&&(r=t[3])),o=o.parentElement}this._containerWidth=n?Math.abs(i/n):i,this._containerHeight=r?Math.abs(a/r):a}}},{key:"_detectMissingCSS",value:function(){"rgb(250, 128, 114)"!==e.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}},{key:"_setupContainer",value:function(){var e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=g("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();var t=this._canvasContainer=g("div","mapboxgl-canvas-container",e);this._interactive&&t.classList.add("mapboxgl-interactive"),this._canvas=g("canvas","mapboxgl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);var n=this._controlContainer=g("div","mapboxgl-control-container",e),r=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(e){r[e]=g("div","mapboxgl-ctrl-".concat(e),n)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}},{key:"_resizeCanvas",value:function(t,n){var r=e.exported.devicePixelRatio||1;this._canvas.width=r*Math.ceil(t),this._canvas.height=r*Math.ceil(n),this._canvas.style.width="".concat(t,"px"),this._canvas.style.height="".concat(n,"px")}},{key:"_addMarker",value:function(e){this._markers.push(e)}},{key:"_removeMarker",value:function(e){var t=this._markers.indexOf(e);-1!==t&&this._markers.splice(t,1)}},{key:"_addPopup",value:function(e){this._popups.push(e)}},{key:"_removePopup",value:function(e){var t=this._popups.indexOf(e);-1!==t&&this._popups.splice(t,1)}},{key:"_setupPainter",value:function(){var t=this,r=e.extend({},n.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._useWebGL2&&this._canvas.getContext("webgl2",r),a=i||this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);a?(this._useWebGL2&&!i&&e.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),e.storeAuthState(a,!0),this.painter=new Xr(a,this.transform,!!i),this.on("data",(function(e){"source"===e.dataType&&t.painter.setTileLoadedFlag(!0)})),e.exported$1.testSupport(a)):this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")))}},{key:"_contextLost",value:function(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:t}))}},{key:"_contextRestored",value:function(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:t}))}},{key:"_onMapScroll",value:function(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}},{key:"loaded",value:function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}},{key:"_update",value:function(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}},{key:"_requestRenderFrame",value:function(e){return this._update(),this._renderTaskQueue.add(e)}},{key:"_cancelRenderFrame",value:function(e){this._renderTaskQueue.remove(e)}},{key:"_requestDomTask",value:function(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}},{key:"_render",value:function(t){var n,r=this,i=this.painter.context.extTimerQuery,a=e.exported.now();if(this.listens("gpu-timing-frame")&&(n=i.createQueryEXT(),i.beginQueryEXT(i.TIME_ELAPSED_EXT,n)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],e.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],e.window.performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),!this._removed){this._updateProjectionTransition();var o=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,l=this.transform.pitch,c=e.exported.now(),u=new e.EvaluationParameters(s,{now:c,fadeDuration:o,pitch:l,transition:this.style.getTransition()});this.style.update(u)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);var f=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),f=this._updateAverageElevation(a),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):f=this._updateAverageElevation(a),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,o,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:o,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),n){var h=e.exported.now()-a;i.endQueryEXT(i.TIME_ELAPSED_EXT,n),setTimeout((function(){var t=i.getQueryObjectEXT(n,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(n),r.fire(new e.Event("gpu-timing-frame",{cpuTime:h,gpuTime:t})),e.window.performance.mark("frame-gpu",{startTime:a,detail:{gpuTime:t}})}),50)}if(this.listens("gpu-timing-layer")){var d=this.painter.collectGpuTimers();setTimeout((function(){var t=r.painter.queryGpuTimers(d);r.fire(new e.Event("gpu-timing-layer",{layerTimes:t}))}),50)}if(this.listens("gpu-timing-deferred-render")){var p=this.painter.collectDeferredRenderGpuQueries();setTimeout((function(){var t=r.painter.queryGpuTimeDeferredRender(p);r.fire(new e.Event("gpu-timing-deferred-render",{gpuTime:t}))}),50)}var m=this._sourcesDirty||this._styleDirty||this._placementDirty||f;if(m||this._repaint)this.triggerRepaint();else{var v=!this.isMoving()&&this.loaded();if(v&&(f=this._updateAverageElevation(a,!0)),f)this.triggerRepaint();else if(this._triggerFrame(!1),v&&(this.fire(new e.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){var y=this._calculateSpeedIndex();this.fire(new e.Event("speedindexcompleted",{speedIndex:y})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||m||(this._fullyLoaded=!0,e.LivePerformanceUtils.mark(e.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&e.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}}},{key:"_forceMarkerAndPopupUpdate",value:function(e){var t,n=h(this._markers);try{for(n.s();!(t=n.n()).done;){var r=t.value;e&&!this.getRenderWorldCopies()&&(r._lngLat=r._lngLat.wrap()),r._update()}}catch(s){n.e(s)}finally{n.f()}var i,a=h(this._popups);try{for(a.s();!(i=a.n()).done;){var o=i.value;!e||this.getRenderWorldCopies()||o._trackPointer||(o._lngLat=o._lngLat.wrap()),o._update()}}catch(s){a.e(s)}finally{a.f()}}},{key:"_updateAverageElevation",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=function(e){return t.transform.averageElevation=e,t._update(!1),!0};if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&r(0);if((n||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){var i=this.transform.averageElevation,a=this.transform.sampleAverageElevation(),o=!1;this.transform.elevation&&(o=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(a)?a=0:this._averageElevationLastSampledAt=e;var s=Math.abs(i-a);if(s>1){if(this._isInitialLoad||o)return this._averageElevation.jumpTo(a),r(a);this._averageElevation.easeTo(a,e,300)}else if(s>1e-4)return this._averageElevation.jumpTo(a),r(a)}return!!this._averageElevation.isEasing(e)&&r(this._averageElevation.getValue(e))}},{key:"_authenticate",value:function(){var t=this;e.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(function(n){if(n&&(n.message===e.AUTH_ERR_MSG||401===n.status)){var r=t.painter.context.gl;e.storeAuthState(r,!1),t._logoControl instanceof la&&t._logoControl._updateLogo(),r&&r.clear(r.DEPTH_BUFFER_BIT|r.COLOR_BUFFER_BIT|r.STENCIL_BUFFER_BIT),t._silenceAuthErrors||t.fire(new e.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}})),e.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(function(){}))}},{key:"_updateTerrain",value:function(){var e=this._isDragging();this.painter.updateTerrain(this.style,e)}},{key:"_calculateSpeedIndex",value:function(){var e=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());var n=this.painter.context.gl,r=n.createFramebuffer();function i(e){n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0);var t=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);return n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,t),t}return n.bindFramebuffer(n.FRAMEBUFFER,r),this._canvasPixelComparison(i(e),t.canvasCopies.map(i),t.timeStamps)}},{key:"_canvasPixelComparison",value:function(e,t,n){for(var r=n[1]-n[0],i=e.length/4,a=0;a0&&void 0!==arguments[0]?arguments[0]:!!n.options.geolocation;n._supportsGeolocation=e,t(e)};void 0!==this._supportsGeolocation?t(this._supportsGeolocation):void 0!==e.window.navigator.permissions?e.window.navigator.permissions.query({name:"geolocation"}).then((function(e){return r("denied"!==e.state)})).catch((function(){return r()})):r()}},{key:"_isOutOfMapMaxBounds",value:function(e){var t=this._map.getMaxBounds(),n=e.coords;return!!t&&(n.longitudet.getEast()||n.latitudet.getNorth())}},{key:"_setErrorState",value: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")}}},{key:"_onSuccess",value:function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("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(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}}},{key:"_updateCamera",value:function(t){var n=new e.LngLat(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,i=this._map.getBearing(),a=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(r),a,{geolocateSource:!0})}},{key:"_updateMarker",value:function(t){if(t){var n=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}},{key:"_updateCircleRadius",value:function(){var t=this._map.transform,n=e.mercatorZfromAltitude(1,t._center.lat)*t.worldSize,r=Math.ceil(2*this._accuracy*n);this._circleElement.style.width="".concat(r,"px"),this._circleElement.style.height="".concat(r,"px")}},{key:"_onZoom",value:function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}},{key:"_updateMarkerRotation",value:function(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}},{key:"_onError",value:function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.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 n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",n),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",n),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}}},{key:"_finish",value:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}},{key:"_setupUI",value:function(t){var n=this;if(void 0!==this._map){if(this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this._geolocateButton=g("button","mapboxgl-ctrl-geolocate",this._container),g("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}else{var i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",i),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=g("div","mapboxgl-user-location"),this._dotElement.appendChild(g("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(g("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new ha({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=g("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ha({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(t){t.geolocateSource||"ACTIVE_LOCK"!==n._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new e.Event("trackuserlocationend")))}))}}},{key:"_onDeviceOrientation",value:function(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}},{key:"trigger",value:function(){if(!this._setup)return e.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 e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.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 e.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 t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(t={maximumAge:6e5,timeout:0},this._noTimeout=!0):(t=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,t),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}},{key:"_addDeviceOrientationListener",value:function(){var t=this,n=function(){e.window.addEventListener("ondeviceorientationabsolute"in e.window?"deviceorientationabsolute":"deviceorientation",t._onDeviceOrientation)};void 0!==e.window.DeviceMotionEvent&&"function"==typeof e.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){"granted"===e&&n()})).catch(console.error):n()}},{key:"_clearWatch",value:function(){this.options.geolocation.clearWatch(this._geolocationWatchID),e.window.removeEventListener("deviceorientation",this._onDeviceOrientation),e.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}}]),r}(e.Evented),AttributionControl:sa,ScaleControl:function(){function t(n){d(this,t),this.options=e.extend({},wa,n),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(e){return!1}}(),e.bindAll(["_update","_setScale","setUnit"],this)}return p(t,[{key:"getDefaultPosition",value:function(){return"bottom-left"}},{key:"_update",value:function(){var e=this.options.maxWidth||100,t=this._map,n=t._containerHeight/2,r=t._containerWidth/2-e/2,i=t.unproject([r,n]),a=t.unproject([r+e,n]),o=i.distanceTo(a);if("imperial"===this.options.unit){var s=3.2808*o;s>5280?this._setScale(e,s/5280,"mile"):this._setScale(e,s,"foot")}else"nautical"===this.options.unit?this._setScale(e,o/1852,"nautical-mile"):o>=1e3?this._setScale(e,o/1e3,"kilometer"):this._setScale(e,o,"meter")}},{key:"_setScale",value:function(e,t,n){var r=this;this._map._requestDomTask((function(){var i=function(e){var t=Math.pow(10,"".concat(Math.floor(e)).length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:function(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(n),t*n}(t),a=i/t;r._container.innerHTML=r._isNumberFormatSupported&&"nautical-mile"!==n?new Intl.NumberFormat(r._language,{style:"unit",unitDisplay:"short",unit:n}).format(i):"".concat(i," ").concat(ka[n]),r._container.style.width=e*a+"px"}))}},{key:"onAdd",value:function(e){return this._map=e,this._language=e.getLanguage(),this._container=g("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}},{key:"onRemove",value:function(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}},{key:"_setLanguage",value:function(e){this._language=e,this._update()}},{key:"setUnit",value:function(e){this.options.unit=e,this._update()}}]),t}(),FullscreenControl:function(){function t(n){d(this,t),this._fullscreen=!1,n&&n.container&&(n.container instanceof e.window.HTMLElement?this._container=n.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in e.window.document&&(this._fullscreenchange="webkitfullscreenchange")}return p(t,[{key:"onAdd",value:function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=g("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}},{key:"onRemove",value:function(){this._controlContainer.remove(),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}},{key:"_checkFullscreenSupport",value:function(){return!(!e.window.document.fullscreenEnabled&&!e.window.document.webkitFullscreenEnabled)}},{key:"_setupUI",value:function(){var t=this._fullscreenButton=g("button","mapboxgl-ctrl-fullscreen",this._controlContainer);g("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}},{key:"_updateTitle",value:function(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}},{key:"_getTitle",value:function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}},{key:"_isFullscreen",value:function(){return this._fullscreen}},{key:"_changeIcon",value:function(){(e.window.document.fullscreenElement||e.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}},{key:"_onClickFullscreen",value:function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}}]),t}(),Popup:function(t){m(r,t);var n=v(r);function r(t){var a;return d(this,r),(a=n.call(this)).options=e.extend(Object.create(da),t),e.bindAll(["_update","_onClose","remove","_onMouseEvent"],i(a)),a._classList=new Set(t&&t.className?t.className.trim().split(/\s+/):[]),a}return p(r,[{key:"addTo",value:function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new e.Event("open")),this}},{key:"isOpen",value:function(){return!!this._map}},{key:"remove",value:function(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);var t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new e.Event("close")),this}},{key:"getLngLat",value:function(){return this._lngLat}},{key:"setLngLat",value:function(t){this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update();var n=this._map;return n&&(n.on("move",this._update),n.off("mousemove",this._onMouseEvent),n._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}},{key:"trackPointer",value:function(){this._trackPointer=!0,this._pos=null,this._update();var e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}},{key:"getElement",value:function(){return this._container}},{key:"setText",value:function(t){return this.setDOMContent(e.window.document.createTextNode(t))}},{key:"setHTML",value:function(t){var n,r=e.window.document.createDocumentFragment(),i=e.window.document.createElement("body");for(i.innerHTML=t;n=i.firstChild;)r.appendChild(n);return this.setDOMContent(r)}},{key:"getMaxWidth",value:function(){return this._container&&this._container.style.maxWidth}},{key:"setMaxWidth",value:function(e){return this.options.maxWidth=e,this._update(),this}},{key:"setDOMContent",value:function(e){var t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=g("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){var n=this._closeButton=g("button","mapboxgl-popup-close-button",t);n.type="button",n.setAttribute("aria-label","Close popup"),n.setAttribute("aria-hidden","true"),n.innerHTML="×",n.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}},{key:"addClassName",value:function(e){return this._classList.add(e),this._updateClassList(),this}},{key:"removeClassName",value:function(e){return this._classList.delete(e),this._updateClassList(),this}},{key:"setOffset",value:function(e){return this.options.offset=e,this._update(),this}},{key:"toggleClassName",value:function(e){var t;return this._classList.delete(e)?t=!1:(this._classList.add(e),t=!0),this._updateClassList(),t}},{key:"_onMouseEvent",value:function(e){this._update(e.point)}},{key:"_getAnchor",value:function(e){if(this.options.anchor)return this.options.anchor;var t=this._map,n=this._container,r=this._pos;if(!t||!n||!r)return"bottom";var i=n.offsetWidth,a=n.offsetHeight,o=r.xt.transform.width-i/2;if(r.y+et.transform.height-a){if(o)return"bottom-left";if(s)return"bottom-right"}return o?"left":s?"right":"bottom"}},{key:"_updateClassList",value:function(){var e=this._container;if(e){var t=u(this._classList);t.push("mapboxgl-popup"),this._anchor&&t.push("mapboxgl-popup-anchor-".concat(this._anchor)),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),e.className=t.join(" ")}}},{key:"_update",value:function(t){var n=this,r=this._map,i=this._content;if(r&&(this._lngLat||this._trackPointer)&&i){var a=this._container;if(a||(a=this._container=g("div","mapboxgl-popup",r.getContainer()),this._tip=g("div","mapboxgl-popup-tip",a),a.appendChild(i)),this.options.maxWidth&&a.style.maxWidth!==this.options.maxWidth&&(a.style.maxWidth=this.options.maxWidth),r.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ua(this._lngLat,this._pos,r.transform)),!this._trackPointer||t){var o=this._pos=this._trackPointer&&t?t:r.project(this._lngLat),s=ma(this.options.offset),l=this._anchor=this._getAnchor(s.y),c=ma(this.options.offset,l),u=o.add(c).round();r._requestDomTask((function(){n._container&&l&&(n._container.style.transform="".concat(fa[l]," translate(").concat(u.x,"px,").concat(u.y,"px)"))}))}if(!this._marker&&r._showingGlobe()){var f=e.isLngLatBehindGlobe(r.transform,this._lngLat)?0:1;this._setOpacity(f)}this._updateClassList()}}},{key:"_focusFirstElement",value:function(){if(this.options.focusAfterOpen&&this._container){var e=this._container.querySelector(pa);e&&e.focus()}}},{key:"_onClose",value:function(){this.remove()}},{key:"_setOpacity",value:function(e){this._container&&(this._container.style.opacity="".concat(e)),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}}]),r}(e.Evented),Marker:ha,Style:fn,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,FreeCameraOptions:Qr,Evented:e.Evented,config:e.config,prewarm:function(){Je().acquire(Ke)},clearPrewarmedResources:function(){var e=Ye;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(Ke),Ye=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 e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return $e.workerCount},set workerCount(e){$e.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:"",workerClass:null,setNow:e.exported.setNow,restoreNow:e.exported.restoreNow};return za})),n}()},9972:function(e,t,n){"use strict";var r=n(5263),i=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.Accordion=void 0;var a=i(n(8152)),o=i(n(4925)),s=i(n(168)),l=r(n(1748)),c=n(2858),u=n(6282);function f(){var e=(0,s.default)(["\n color: #fff;\n margin: 30px 0;\n"]);return f=function(){return e},e}function h(){var e=(0,s.default)(["\n margin-top: 20px;\n"]);return h=function(){return e},e}function d(){var e=(0,s.default)(["\n ","\n transition: rotate .3s ease-out;\n rotate: 90deg;\n"]);return d=function(){return e},e}function p(){var e=(0,s.default)(["\n transition: rotate .3s ease-out;\n rotate: 0deg;\n"]);return p=function(){return e},e}function m(){var e=(0,s.default)(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n"]);return m=function(){return e},e}function v(e,t){return t(!0!==e)}var y=(0,c.css)(m()),g=(0,c.css)(p()),_=(0,c.css)(d(),g),x=(0,c.css)(h()),b=(0,c.css)(f());t.Accordion=function(e){var t=e.triangleColor,n=e.title,r=e.children,i=(0,o.default)(e,["triangleColor","title","children"]),s=l.useState(!1),f=(0,a.default)(s,2),h=f[0],d=f[1];return(0,c.jsx)("div",i,(0,c.jsx)("header",{css:y,onClick:function(){return v(h,d)},onKeyDown:function(e){"Enter"===e.key&&v(h,d)},role:"button",tabIndex:0},n,(0,c.jsx)(u.MetrocommonTriangle,{color:t,css:h?_:g})),h?(0,c.jsx)("div",{css:x},r):"",(0,c.jsx)("hr",{css:b}))}},9185:function(e,t,n){"use strict";var r=n(5263),i=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.Footer=void 0;var a=i(n(168)),o=i(n(4925)),s=(r(n(1748)),n(2858)),l=n(9929),c=i(n(3514));function u(){var e=(0,a.default)(["margin-right: 30px;"]);return u=function(){return e},e}function f(){var e=(0,a.default)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n "]);return f=function(){return e},e}function h(){var e=(0,a.default)(["\n align-items: center;\n color: ",";\n display: flex;\n font-size: 16px;\n flex-direction: row;\n justify-content: space-between;\n height: 90px;\n padding: 0 ","px 0 ","px;\n margin: 0 auto;\n max-width: ","px;\n "]);return h=function(){return e},e}function d(){var e=(0,a.default)(["\n background-color: ",";\n width: 100%;\n "]);return d=function(){return e},e}function p(){var e=(0,a.default)(["\n color: ",";\n text-decoration: none;\n "]);return p=function(){return e},e}t.Footer=function(e){var t=e.backgroundColor,n=e.fontColor,r=void 0===n?"#FFFFFF":n,i=e.paddingLeft,a=void 0===i?50:i,m=e.paddingRight,v=void 0===m?50:m,y=e.maxWidth,g=void 0===y?1366:y,_=(0,o.default)(e,["backgroundColor","fontColor","paddingLeft","paddingRight","maxWidth"]),x=(0,s.css)(p(),r);return(0,s.jsx)("footer",Object.assign({css:(0,s.css)(d(),t)},_),(0,s.jsx)("div",{css:(0,s.css)(h(),r,v,a,g)},(0,s.jsx)("div",{css:(0,s.css)(f())},(0,s.jsx)("a",{href:"https://www.mapc.org/",css:(0,s.css)(u())},(0,s.jsx)("img",{src:c.default,alt:"MAPC logo"})),(0,s.jsx)("span",null,(0,s.jsx)("a",{href:"https://www.mapc.org/",css:x},"Metropolitan Area Planning Council")," ","|"," ",(0,s.jsx)("a",{href:"tel:617-933-0700",css:x},"617-933-0700")," ","|"," ",(0,s.jsx)("a",{href:"https://metrocommon.mapc.org/",css:x},"metrocommon.mapc.org"))),(0,s.jsx)(l.SocialNav,{color:r})))}},1775:function(e,t,n){"use strict";var r=n(5263),i=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0;var a=i(n(4925)),o=r(n(1748)),s=i(n(3514)),l=i(n(9554)),c=i(n(4133)),u={duotone:s.default,semitransparent:l.default,fullcolor:c.default};t.Logo=function(e){var t=e.style,n=(0,a.default)(e,["style"]);return o.createElement("img",Object.assign({src:u[t],alt:"MAPC Logo"},n))}},6282:function(e,t,n){"use strict";var r=n(5263),i=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.MetrocommonTriangle=void 0;var a=i(n(4925)),o=r(n(1748));t.MetrocommonTriangle=function(e){var t=e.color,n=void 0===t?"#78BE20":t,r=(0,a.default)(e,["color"]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"21.176",viewBox:"0 0 20 21.176",role:"img","aria-labelledby":"triangleTitle"},r),o.createElement("title",{id:"triangleTitle"},"Decorative triangle"),o.createElement("path",{id:"Polygon_10","data-name":"Polygon 10",d:"M10.588,0,21.176,20H0Z",transform:"translate(20) rotate(90)",fill:n}))}},1868:function(e,t,n){"use strict";var r=n(5263),i=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.SocialIcon=void 0;var a=i(n(4925)),o=r(n(1748)),s=n(4483),l=n(7118),c={facebook:{url:"https://www.facebook.com/MAPCMetroBoston",icon:l.faFacebookSquare},twitter:{url:"https://twitter.com/MAPCMetroBoston",icon:l.faTwitter},instagram:{url:"https://www.instagram.com/mapcmetroboston/",icon:l.faInstagram}};t.SocialIcon=function(e){var t=e.color,n=e.site,r=(0,a.default)(e,["color","site"]),i=c[n],l=i.url,u=i.icon;return o.createElement("a",Object.assign({href:l},r),o.createElement(s.FontAwesomeIcon,{color:t,icon:u,size:"2x"}))}},9929:function(e,t,n){"use strict";var r=n(5263),i=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.SocialNav=void 0;var a=i(n(4925)),o=i(n(168)),s=(r(n(1748)),n(2858)),l=n(1868);function c(){var e=(0,o.default)(["\n display: flex;\n flex-direction: row;\n "]);return c=function(){return e},e}function u(){var e=(0,o.default)(["\n margin: 0 1rem;\n"]);return u=function(){return e},e}var f=(0,s.css)(u());t.SocialNav=function(e){var t=e.color,n=(0,a.default)(e,["color"]);return(0,s.jsx)("nav",Object.assign({css:(0,s.css)(c())},n),(0,s.jsx)(l.SocialIcon,{color:t,site:"twitter",css:f}),(0,s.jsx)(l.SocialIcon,{color:t,site:"instagram",css:f}),(0,s.jsx)(l.SocialIcon,{color:t,site:"facebook",css:f}))}},2724:function(e,t,n){"use strict";var r=n(5263);Object.defineProperty(t,"__esModule",{value:!0}),t.Layer=void 0;var i=r(n(1748)),a=n(687),o=n(5136);t.Layer=function(e){var t=e.layerId,n=e.type,r=e.sourceLayer,s=e.paint,l=void 0===s?{}:s,c=e.layout,u=void 0===c?{}:c,f=i.useContext(a.MapContext),h=i.useContext(o.SourceContext);return i.useEffect((function(){null===f||void 0===f||f.on("styledata",(function(e){!(null===f||void 0===f?void 0:f.getLayer(t))&&(null===f||void 0===f?void 0:f.getSource(h))&&(null===f||void 0===f||f.addLayer({id:t,type:n,source:h,"source-layer":r,paint:l,layout:u}))}))}),[t,f,l,h,r,n,u]),i.createElement(i.Fragment,null)}},687:function(e,t,n){"use strict";var r=n(5263),i=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.Map=t.MapContext=void 0;var a=i(n(168)),o=i(n(8152)),s=r(n(1748)),l=n(2858),c=r(n(5483));function u(){var e=(0,a.default)(["\n height: ",";\n width: ",";\n "]);return u=function(){return e},e}var f=s.createContext(null);t.MapContext=f;t.Map=function(e){var t=e.container,n=e.style,r=void 0===n?"mapbox://styles/mapbox/streets-v11":n,i=e.accessToken,a=e.width,h=void 0===a?"700px":a,d=e.height,p=void 0===d?"500px":d,m=e.center,v=void 0===m?[-70.944,42.37]:m,y=e.zoom,g=void 0===y?8.4:y,_=e.minZoom,x=void 0===_?8:_,b=e.maxZoom,w=void 0===b?16:b,k=e.onClick,z=e.children,M=s.useRef(null),T=s.useState(null),S=(0,o.default)(T,2),E=S[0],C=S[1];return s.useEffect((function(){if(!E){var e=new c.Map({container:t,style:r,accessToken:i,zoom:g,center:v,maxZoom:w,minZoom:x});C(e)}return function(){E&&(null===E||void 0===E||E.remove(),C(null))}}),[E,x,w,v,r,i,g,t]),s.useEffect((function(){E&&k&&E.on("click",(function(e){return e.features=E.queryRenderedFeatures([e.point.x,e.point.y]),k(e)}))}),[E,k]),(0,l.jsx)(f.Provider,{value:E},(0,l.jsx)("div",{ref:M,id:t,css:(0,l.css)(u(),p,h)},z))}},7506:function(e,t,n){"use strict";var r=n(5263),i=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.MapLegend=void 0;var a=i(n(8152)),o=i(n(168)),s=r(n(1748)),l=n(2858);function c(){var e=(0,o.default)(["float: right; margin-left: 16px;"]);return c=function(){return e},e}function u(){var e=(0,o.default)(["margin-right: 4px;"]);return u=function(){return e},e}function f(){var e=(0,o.default)(["\n color: #1f4e46;\n font-family: 'Montserrat', sans-serif;\n font-size: .75rem;\n font-weight: 700;\n margin-bottom: 16px;\n"]);return f=function(){return e},e}function h(){var e=(0,o.default)(["\n align-items: flex-start;\n color: #1f4e46;\n font-family: 'Montserrat', sans-serif;\n font-size: .75rem;\n font-weight: 300;\n display: flex;\n flex-direction: row;\n margin-bottom: 10px;\n"]);return h=function(){return e},e}function d(){var e=(0,o.default)(["\n padding: 0;\n margin: 0;\n list-style: none;\n"]);return d=function(){return e},e}function p(){var e=(0,o.default)(["\n background-color: rgba(255,255,255,0.8);\n max-width: 168px;\n min-height: 20px;\n padding: 5px 15px;\n position: absolute;\n right: 8px;\n top: 8px;\n width: 168px;\n z-index: 10;\n"]);return p=function(){return e},e}var m=(0,l.css)(p()),v=(0,l.css)(d()),y=(0,l.css)(h()),g=(0,l.css)(f());t.MapLegend=function(e){var t=e.legendEntries,n=e.colorScale,r=e.title,i=e.children,o=s.useState(!0),f=(0,a.default)(o,2),h=f[0],d=f[1];return(0,l.jsx)("div",{css:m},h?(0,l.jsx)(s.Fragment,null,(0,l.jsx)("span",{css:g},r),(0,l.jsx)("ul",{css:v},function(e,t){return e.map((function(e,n){return(0,l.jsx)("li",{key:e,css:y},(0,l.jsx)("svg",{width:"21",height:"20",css:(0,l.css)(u())},(0,l.jsx)("rect",{x:"2",y:"2",width:"16",height:"16",fill:t[n],stroke:"black"})),(0,l.jsx)("span",{className:"map-legend__entry"},e))}))}(t,n)),i):(0,l.jsx)("span",{css:g},"Expand Legend"),(0,l.jsx)("button",{type:"button",css:(0,l.css)(c()),onClick:function(){return d(!h)}},h?"-":"+"))}},3056:function(e,t,n){"use strict";var r=n(5263),i=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.MunicipalitiesMAPC=void 0;var a=i(n(3063)),o=i(n(8152)),s=r(n(1748)),l=n(5136),c=n(2724);t.MunicipalitiesMAPC=function(e){var t=e.type,n=e.layerId,r=e.paint,i=e.data,u=e.colorScale,f=e.choroplethFunc,h=e.matchOn,d=e.mapColumn,p=s.useState([]),m=(0,o.default)(p,2),v=m[0],y=m[1];return s.useEffect((function(){if(i){var e=["match",["get","municipal"]];i.forEach((function(t){e.push(t[h],t[d]?f(u,t[d]):"gray")})),e.push("gray"),y(e)}}),[f,u,i,d,h]),s.createElement(l.Source,{sourceId:"MAPC Municipalities",url:"ihill.763lks2o"},s.createElement(c.Layer,{type:t,paint:(0,a.default)((0,a.default)({},r),{},{"fill-color":v}),sourceLayer:"MAPC_borders-0im3ea",layerId:n}))}},1302:function(e,t,n){"use strict";var r=n(5263);Object.defineProperty(t,"__esModule",{value:!0}),t.NavigationControl=void 0;var i=r(n(1748)),a=r(n(5483)),o=n(687);t.NavigationControl=function(e){var t=e.position,n=void 0===t?"bottom-right":t,r=i.useContext(o.MapContext);return i.useEffect((function(){var e=new a.NavigationControl;return(null===r||void 0===r?void 0:r.hasControl(e))||null===r||void 0===r||r.addControl(e,n),function(){(null===r||void 0===r?void 0:r.hasControl(e))&&r.removeControl(e)}}),[r,n]),i.createElement(i.Fragment,null)}},5136:function(e,t,n){"use strict";var r=n(5263);Object.defineProperty(t,"__esModule",{value:!0}),t.Source=t.SourceContext=void 0;var i=r(n(1748)),a=n(687),o=i.createContext("");t.SourceContext=o;t.Source=function(e){var t=e.sourceId,n=e.url,r=e.children,s=i.useContext(a.MapContext);return i.useEffect((function(){return(null===s||void 0===s?void 0:s.loaded())?null===s||void 0===s||s.addSource(t,{type:"vector",url:"mapbox://".concat(n)}):null===s||void 0===s||s.on("load",(function(e){null===s||void 0===s||s.addSource(t,{type:"vector",url:"mapbox://".concat(n)})})),function(){(null===s||void 0===s?void 0:s.isStyleLoaded())&&(null===s||void 0===s?void 0:s.getSource(t))&&(!function(e,t){var n;e&&(null===(n=e.getStyle().layers)||void 0===n||n.forEach((function(n){n.source===t&&(null===e||void 0===e||e.removeLayer(n.id))})))}(s,t),null===s||void 0===s||s.removeSource(t),null===s||void 0===s||s.off("load",(function(e){null===s||void 0===s||s.addSource(t,{type:"vector",url:"mapbox://".concat(n)})})))}}),[s,t,n]),i.createElement(o.Provider,{value:t},r)}},6972:function(e,t,n){"use strict";var r=n(5263);Object.defineProperty(t,"__esModule",{value:!0}),t.Tooltip=void 0;var i=r(n(1748)),a=r(n(5483)),o=n(687);t.Tooltip=function(e){var t=e.onLayer,n=e.children,r=i.useContext(o.MapContext),s=document.createElement("div");return i.useEffect((function(){t?null===r||void 0===r||r.on("click",t,(function(e){(new a.Popup).setLngLat(e.lngLat).setDOMContent(s).addTo(r)})):null===r||void 0===r||r.on("click",(function(e){(new a.Popup).setLngLat(e.lngLat).setDOMContent(s).addTo(r)}))}),[r,n,s,t]),i.createElement("div",null)}},523:function(e,t,n){"use strict";Object.defineProperty(t,"$_",{enumerable:!0,get:function(){return r.Footer}});var r=n(9185),i=n(9929),a=n(1868),o=n(9972),s=n(1775),l=n(6282),c=n(687),u=n(5136),f=n(2724),h=n(1302),d=n(3056),p=n(6972),m=n(7506)},7162:function(e,t,n){"use strict";var r=n(1725),i=60103,a=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,s=60110,l=60112;t.Suspense=60113;var c=60115,u=60116;if("function"===typeof Symbol&&Symbol.for){var f=Symbol.for;i=f("react.element"),a=f("react.portal"),t.Fragment=f("react.fragment"),t.StrictMode=f("react.strict_mode"),t.Profiler=f("react.profiler"),o=f("react.provider"),s=f("react.context"),l=f("react.forward_ref"),t.Suspense=f("react.suspense"),c=f("react.memo"),u=f("react.lazy")}var h="function"===typeof Symbol&&Symbol.iterator;function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n