jonnybarnes.uk/public/assets/js/newnote.js
Jonny Barnes 0b7bf7a378 Updating codebase to use es6/7
Squashed commit of the following:

commit 07b27d00f135a521143154a2e77abdc1680b7d5b
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Jan 26 14:59:35 2017 +0000

    Fix styleci.io issue

commit 9e67f0a96484f8047f22d13abb4cd41c2e44b95d
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Jan 26 08:28:22 2017 +0000

    Remove some unused dependencies

commit 3c65070f3ff2aec10d821ae9f12821bc08e37d0a
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 25 18:00:10 2017 +0000

    Compressed webpack/babel output

commit 694c43d1a9a6c8cb84d4cc789a6643b8d2863cec
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 25 17:59:27 2017 +0000

    Let’s compress the es5 output

commit debffc0e41760fcc87e6d3768163e6ed8ea5d98c
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 25 17:45:05 2017 +0000

    webpack/babel generated es5 assets

commit 1e978d6c5795f230ab320f94ad2fb98871bb6fa5
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 25 17:36:52 2017 +0000

    Allow content of micropub form page to be persisted

commit 44fb8026962ef574700f07ef93d18bdb38cdedb2
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 25 17:35:58 2017 +0000

    Name the micropub form

commit 732abaf561bf9d6392fe506d30d320e9c17b8226
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 25 17:34:39 2017 +0000

    Add webStorage dependency

commit a4520085dfc673c5c3d940150358b8ecc3cdf022
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Mon Jan 16 12:32:33 2017 +0000

    No need for a form id on the micropub form untill form autosave is added

commit a182be46a616d8e4085be5e24cbd3623f13cc28d
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sat Jan 14 20:37:31 2017 +0000

    Polyfill fetch and promise only in older browsers using unpkg.com

commit fdc044150dc8e2b755f93119b196ba0455bbbb83
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Jan 13 15:46:05 2017 +0000

    Generated js from webpack/babel

commit d24e6aa9fff38823a0c667e6f9e43dcb2ca179c4
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Jan 13 15:45:32 2017 +0000

    Lots of es6 to generate and add map, particularly the new note form

commit e7004a9fe475e07d43de905fb00d51c659878474
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Jan 13 15:44:54 2017 +0000

    Don’t link to commons.js, it aint being made at the moment

commit d4a2e4e143b644287f9da109eb2850c2361b2f20
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Jan 13 15:43:27 2017 +0000

    Temporarily don’t optimize JS

commit 05623de122da7d88642af60f85e5320a3ff651fc
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 11 14:24:15 2017 +0000

    Add places to geojson data

commit 3eb1a4f29bb4263b9998a6f3f53abb7d1eeff520
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 11 14:22:53 2017 +0000

    Use alertify.js to give relevant feedback to user

commit 6f123fa178d6cd19528130ebd78157c37eaab1a1
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 11 14:21:24 2017 +0000

    Add alertify.css back

commit 89fca3b3aeb23ef97fb767514e0502298d1b83fd
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 11 14:19:56 2017 +0000

    Webpack’d javascript

commit 94ab60f34079238ed6228bf6e789f14d7a09823b
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Mon Jan 9 09:10:17 2017 +0000

    Webpack’d javascript

commit 1ca3a55a27c20ea08633b589023fe5ad1acb2b68
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Mon Jan 9 09:09:06 2017 +0000

    Define const functions in order of usage

commit dc5535b32a357611860e0e98fcdc7d9c12c5d383
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Jan 8 18:50:55 2017 +0000

    Link to correct js files with defer option

commit 42f0e5b85825943ed148736e8e0fe22f5654ae90
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Jan 8 18:50:18 2017 +0000

    New webpacked es6 code

commit 300443bb0ce7b65bda1cf550fe5c7173a89edaf3
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Jan 8 18:49:44 2017 +0000

    Moving towards consolidated es6 map code

commit b1001760e03dd358f896feb90dd3acc0bc6728fc
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Jan 8 18:44:40 2017 +0000

    Don’t mangle the fetch function

commit 289e59025634b6d2569b73ae87e3ea4942034e33
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Jan 8 18:43:47 2017 +0000

    Updated yarn/npm dependencies

commit 3439b008e6bd96d8c45591c2a945c4ac246440ec
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Dec 29 11:58:50 2016 +0000

    Link to the correct assets on the new note page

commit 81dc83e362266028f8336ae5a27e92c8c8a2b6dc
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Dec 29 11:57:46 2016 +0000

    Add a map to the new note page

commit 5101ecd3dd60cd78e9a4bce81a5e60a2f575bc57
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Dec 29 11:56:54 2016 +0000

    Bundle common JS between entry points

commit 1f916adcfd1b07df388417b6bd800e109cec543c
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Dec 29 11:55:31 2016 +0000

    Add geojson to individual notes

commit 7a6ae8ca49b4ca49413ddb977f7b534f62b41c20
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Dec 28 19:53:30 2016 +0000

    Link to self-hosted mapbox-gl.css

commit 8be006ec2b738cbcebd06283e18c292b3efd7d16
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Dec 28 19:52:41 2016 +0000

    Use self-hosted mapbox-gl css, and a better default geojson title value

commit 5ec480842a2194a071b6a23ae181a8de5b8d47cd
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Dec 28 17:09:46 2016 +0000

    Access geojson data to markup map correctly

commit f2f1d7563f7b0cb7cc62658cc2817e56d2b47c31
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Dec 28 17:09:07 2016 +0000

    Generate geojson data for places

commit 9f8c9ba02f7ac37b4ab81aad2fb0cd2c077c45cd
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Dec 23 11:55:10 2016 +0000

    Use geojson to add a default you location point

commit 3da499d3ea6a214f8008d1b98f9b0c2f31ecba0c
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Dec 22 22:29:18 2016 +0000

    Some code cleaning

commit 39376097eda82491df272cc214d70ff3095d4873
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Dec 22 22:21:29 2016 +0000

    Use satellite streets view

commit f3db8f43fc403bc180e24d63e21c8311441cb2b0
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Dec 22 16:46:03 2016 +0000

    Semi working map state, still need to add own css, and add marker

commit 5f398a642b9db67f4b0733988c20138b37d2141d
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Dec 22 13:17:04 2016 +0000

    Reference new maps.js with bundled mapbox

commit bad97649a623c5552e6b607a1975aa2de8131191
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Dec 22 13:16:25 2016 +0000

    Add mapbox-gl again

commit 47484962e7620aa7a9a5153cfc03e2ba4030dd5c
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Dec 21 00:03:23 2016 +0000

    Early working version of maps.js

commit e53e0f39952a65996c09b06fd35918ffabed0de2
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 20 17:14:17 2016 +0000

    Setup webpack

commit f930a1e2bd7d18809bd40d0cc22f9c3af75f1984
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 20 15:00:42 2016 +0000

    Add webpack v2

commit b16e8d62db071155a8b5fb216d3d60ebf6fa9468
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 20 14:53:47 2016 +0000

    Define default settings for babel

commit 97c13cb753e08d25aa48ecff579efa05173a2c81
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 20 14:53:31 2016 +0000

    Add babeljs

commit dd9efc3b056cf96323d7f11acff0fb1ab137caef
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 20 14:49:23 2016 +0000

    Remove old javascript

commit ab99c251ad
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Dec 16 13:26:10 2016 +0000

    update readme to reflect changes to how syndication targets need to be set
2017-01-26 15:21:21 +00:00

29 lines
No EOL
476 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=19)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function n(t){var e=/POINT\((.*)\)/.exec(t),r=e[1].split(" ")[0],n=e[1].split(" ")[1];return{latitude:n,longitude:r}}e.a=n},function(t,e,r){"use strict";function n(t){return Array.isArray(t)?t:Array.from(t)}function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=document.querySelectorAll(".map"),i=!0,o=!1,c=void 0;try{for(var p,f=function(){var n=p.value,i=n.dataset.latitude,o=n.dataset.longitude,l=n.dataset.id,c=window["geojson"+l];if(null==c&&(c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[o,i]},properties:{title:"Current Location",icon:"circle-stroked",uri:"current-location"}}]}),null!=e){var f=!0,d=!1,m=void 0;try{for(var y,v=e[Symbol.iterator]();!(f=(y=v.next()).done);f=!0){var g=y.value,_=r.i(s.a)(g.location).longitude,x=r.i(s.a)(g.location).latitude;c.features.push({type:"Feature",geometry:{type:"Point",coordinates:[_,x]},properties:{title:g.name,icon:"circle",uri:g.slug}})}}catch(t){d=!0,m=t}finally{try{!f&&v.return&&v.return()}finally{if(d)throw m}}}if(!o){t.coords.longitude}if(!i){t.coords.latitude}var map=new a.a.Map({container:n,style:"mapbox://styles/mapbox/streets-v9",center:[o,i],zoom:15});if(null==t&&map.scrollZoom.disable(),map.addControl(new a.a.NavigationControl),n.appendChild(h(map)),map.on("load",function(){map.addSource("points",{type:"geojson",data:c}),map.addLayer({id:"points",interactive:!0,type:"symbol",source:"points",layout:{"icon-image":"{icon}-15","text-field":"{title}","text-offset":[0,1]}})}),map.on("click",function(t){var e=map.queryRenderedFeatures(t.point,{layer:["points"]});e.length&&(map.flyTo({center:e[0].geometry.coordinates}),r.i(u.a)(e[0].properties.uri))}),c.features&&c.features.length>1){var b=new a.a.LngLatBounds,w=!0,E=!1,T=void 0;try{for(var S,z=c.features[Symbol.iterator]();!(w=(S=z.next()).done);w=!0){var A=S.value;b.extend(A.geometry.coordinates)}}catch(t){E=!0,T=t}finally{try{!w&&z.return&&z.return()}finally{if(E)throw T}}map.fitBounds(b,{padding:65})}return{v:map}},d=n[Symbol.iterator]();!(i=(p=d.next()).done);i=!0){var m=f();if("object"===("undefined"==typeof m?"undefined":l(m)))return m.v}}catch(t){o=!0,c=t}finally{try{!i&&d.return&&d.return()}finally{if(o)throw c}}}var o=r(9),a=r.n(o),s=r(1),u=r(4);e.a=i;var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};a.a.accessToken="pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiY2l2cDhjYW04MDAwcjJ0cG1uZnhqcm82ayJ9.qA2zeVA-nsoMh9IFrd5KQw";var c=function(t){return t.split("-").map(function(t){var e=n(t),r=e[0],i=e.slice(1);return r.toUpperCase()+i.join("").toLowerCase()}).join(" ")},p=function(map,t,e){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=document.createElement("input");n.setAttribute("id",e),n.setAttribute("type","radio"),n.setAttribute("name","toggle"),n.setAttribute("value",e),1==r&&n.setAttribute("checked","checked"),n.addEventListener("click",function(){map.setStyle("mapbox://styles/mapbox/"+e+"-v9")});var i=document.createElement("label");i.setAttribute("for",e),i.appendChild(document.createTextNode(c(e))),t.appendChild(n),t.appendChild(i)},h=function(map){var t=document.createElement("div");return t.classList.add("map-menu"),p(map,t,"streets",!0),p(map,t,"satellite-streets"),t}},function(t,e,r){(function(t){var n;!function(){"use strict";function i(){var t={parent:document.body,version:"1.0.12",defaultOkLabel:"Ok",okLabel:"Ok",defaultCancelLabel:"Cancel",cancelLabel:"Cancel",defaultMaxLogItems:2,maxLogItems:2,promptValue:"",promptPlaceholder:"",closeLogOnClick:!1,closeLogOnClickDefault:!1,delay:5e3,defaultDelay:5e3,logContainerClass:"alertify-logs",logContainerDefaultClass:"alertify-logs",dialogs:{buttons:{holder:"<nav>{{buttons}}</nav>",ok:"<button class='ok' tabindex='1'>{{ok}}</button>",cancel:"<button class='cancel' tabindex='2'>{{cancel}}</button>"},input:"<input type='text'>",message:"<p class='msg'>{{message}}</p>",log:"<div class='{{class}}'>{{message}}</div>"},defaultDialogs:{buttons:{holder:"<nav>{{buttons}}</nav>",ok:"<button class='ok' tabindex='1'>{{ok}}</button>",cancel:"<button class='cancel' tabindex='2'>{{cancel}}</button>"},input:"<input type='text'>",message:"<p class='msg'>{{message}}</p>",log:"<div class='{{class}}'>{{message}}</div>"},build:function(t){var e=this.dialogs.buttons.ok,r="<div class='dialog'><div>"+this.dialogs.message.replace("{{message}}",t.message);return"confirm"!==t.type&&"prompt"!==t.type||(e=this.dialogs.buttons.cancel+this.dialogs.buttons.ok),"prompt"===t.type&&(r+=this.dialogs.input),r=(r+this.dialogs.buttons.holder+"</div></div>").replace("{{buttons}}",e).replace("{{ok}}",this.okLabel).replace("{{cancel}}",this.cancelLabel)},setCloseLogOnClick:function(t){this.closeLogOnClick=!!t},close:function(t,e){this.closeLogOnClick&&t.addEventListener("click",function(){a(t)}),e=e&&!isNaN(+e)?+e:this.delay,0>e?a(t):e>0&&setTimeout(function(){a(t)},e)},dialog:function(t,e,r,n){return this.setup({type:e,message:t,onOkay:r,onCancel:n})},log:function(t,e,r){var n=document.querySelectorAll(".alertify-logs > div");if(n){var i=n.length-this.maxLogItems;if(i>=0)for(var o=0,a=i+1;a>o;o++)this.close(n[o],-1)}this.notify(t,e,r)},setLogPosition:function(t){this.logContainerClass="alertify-logs "+t},setupLogContainer:function(){var t=document.querySelector(".alertify-logs"),e=this.logContainerClass;return t||(t=document.createElement("div"),t.className=e,this.parent.appendChild(t)),t.className!==e&&(t.className=e),t},notify:function(e,r,n){var i=this.setupLogContainer(),o=document.createElement("div");o.className=r||"default",t.logTemplateMethod?o.innerHTML=t.logTemplateMethod(e):o.innerHTML=e,"function"==typeof n&&o.addEventListener("click",n),i.appendChild(o),setTimeout(function(){o.className+=" show"},10),this.close(o,this.delay)},setup:function(t){function e(e){"function"!=typeof e&&(e=function(){}),n&&n.addEventListener("click",function(n){t.onOkay&&"function"==typeof t.onOkay&&(o?t.onOkay(o.value,n):t.onOkay(n)),e(o?{buttonClicked:"ok",inputValue:o.value,event:n}:{buttonClicked:"ok",event:n}),a(r)}),i&&i.addEventListener("click",function(n){t.onCancel&&"function"==typeof t.onCancel&&t.onCancel(n),e({buttonClicked:"cancel",event:n}),a(r)}),o&&o.addEventListener("keyup",function(t){13===t.which&&n.click()})}var r=document.createElement("div");r.className="alertify hide",r.innerHTML=this.build(t);var n=r.querySelector(".ok"),i=r.querySelector(".cancel"),o=r.querySelector("input"),s=r.querySelector("label");o&&("string"==typeof this.promptPlaceholder&&(s?s.textContent=this.promptPlaceholder:o.placeholder=this.promptPlaceholder),"string"==typeof this.promptValue&&(o.value=this.promptValue));var u;return"function"==typeof Promise?u=new Promise(e):e(),this.parent.appendChild(r),setTimeout(function(){r.classList.remove("hide"),o&&t.type&&"prompt"===t.type?(o.select(),o.focus()):n&&n.focus()},100),u},okBtn:function(t){return this.okLabel=t,this},setDelay:function(t){return t=t||0,this.delay=isNaN(t)?this.defaultDelay:parseInt(t,10),this},cancelBtn:function(t){return this.cancelLabel=t,this},setMaxLogItems:function(t){this.maxLogItems=parseInt(t||this.defaultMaxLogItems)},theme:function(t){switch(t.toLowerCase()){case"bootstrap":this.dialogs.buttons.ok="<button class='ok btn btn-primary' tabindex='1'>{{ok}}</button>",this.dialogs.buttons.cancel="<button class='cancel btn btn-default' tabindex='2'>{{cancel}}</button>",this.dialogs.input="<input type='text' class='form-control'>";break;case"purecss":this.dialogs.buttons.ok="<button class='ok pure-button' tabindex='1'>{{ok}}</button>",this.dialogs.buttons.cancel="<button class='cancel pure-button' tabindex='2'>{{cancel}}</button>";break;case"mdl":case"material-design-light":this.dialogs.buttons.ok="<button class='ok mdl-button mdl-js-button mdl-js-ripple-effect' tabindex='1'>{{ok}}</button>",this.dialogs.buttons.cancel="<button class='cancel mdl-button mdl-js-button mdl-js-ripple-effect' tabindex='2'>{{cancel}}</button>",this.dialogs.input="<div class='mdl-textfield mdl-js-textfield'><input class='mdl-textfield__input'><label class='md-textfield__label'></label></div>";break;case"angular-material":this.dialogs.buttons.ok="<button class='ok md-primary md-button' tabindex='1'>{{ok}}</button>",this.dialogs.buttons.cancel="<button class='cancel md-button' tabindex='2'>{{cancel}}</button>",this.dialogs.input="<div layout='column'><md-input-container md-no-float><input type='text'></md-input-container></div>";break;case"default":default:this.dialogs.buttons.ok=this.defaultDialogs.buttons.ok,this.dialogs.buttons.cancel=this.defaultDialogs.buttons.cancel,this.dialogs.input=this.defaultDialogs.input}},reset:function(){this.parent=document.body,this.theme("default"),this.okBtn(this.defaultOkLabel),this.cancelBtn(this.defaultCancelLabel),this.setMaxLogItems(),this.promptValue="",this.promptPlaceholder="",this.delay=this.defaultDelay,this.setCloseLogOnClick(this.closeLogOnClickDefault),this.setLogPosition("bottom left"),this.logTemplateMethod=null},injectCSS:function(){if(!document.querySelector("#alertifyCSS")){var t=document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",e.id="alertifyCSS",e.innerHTML=".alertify-logs>*{padding:12px 24px;color:#fff;box-shadow:0 2px 5px 0 rgba(0,0,0,.2);border-radius:1px}.alertify-logs>*,.alertify-logs>.default{background:rgba(0,0,0,.8)}.alertify-logs>.error{background:rgba(244,67,54,.8)}.alertify-logs>.success{background:rgba(76,175,80,.9)}.alertify{position:fixed;background-color:rgba(0,0,0,.3);left:0;right:0;top:0;bottom:0;width:100%;height:100%;z-index:1}.alertify.hide{opacity:0;pointer-events:none}.alertify,.alertify.show{box-sizing:border-box;transition:all .33s cubic-bezier(.25,.8,.25,1)}.alertify,.alertify *{box-sizing:border-box}.alertify .dialog{padding:12px}.alertify .alert,.alertify .dialog{width:100%;margin:0 auto;position:relative;top:50%;transform:translateY(-50%)}.alertify .alert>*,.alertify .dialog>*{width:400px;max-width:95%;margin:0 auto;text-align:center;padding:12px;background:#fff;box-shadow:0 2px 4px -1px rgba(0,0,0,.14),0 4px 5px 0 rgba(0,0,0,.098),0 1px 10px 0 rgba(0,0,0,.084)}.alertify .alert .msg,.alertify .dialog .msg{padding:12px;margin-bottom:12px;margin:0;text-align:left}.alertify .alert input:not(.form-control),.alertify .dialog input:not(.form-control){margin-bottom:15px;width:100%;font-size:100%;padding:12px}.alertify .alert input:not(.form-control):focus,.alertify .dialog input:not(.form-control):focus{outline-offset:-2px}.alertify .alert nav,.alertify .dialog nav{text-align:right}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button),.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button){background:transparent;box-sizing:border-box;color:rgba(0,0,0,.87);position:relative;outline:0;border:0;display:inline-block;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center;padding:0 6px;margin:6px 8px;line-height:36px;min-height:36px;white-space:nowrap;min-width:88px;text-align:center;text-transform:uppercase;font-size:14px;text-decoration:none;cursor:pointer;border:1px solid transparent;border-radius:2px}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):active,.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):hover,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):active,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):hover{background-color:rgba(0,0,0,.05)}.alertify .alert nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):focus,.alertify .dialog nav button:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button):focus{border:1px solid rgba(0,0,0,.1)}.alertify .alert nav button.btn,.alertify .dialog nav button.btn{margin:6px 4px}.alertify-logs{position:fixed;z-index:1}.alertify-logs.bottom,.alertify-logs:not(.top){bottom:16px}.alertify-logs.left,.alertify-logs:not(.right){left:16px}.alertify-logs.left>*,.alertify-logs:not(.right)>*{float:left;transform:translateZ(0);height:auto}.alertify-logs.left>.show,.alertify-logs:not(.right)>.show{left:0}.alertify-logs.left>*,.alertify-logs.left>.hide,.alertify-logs:not(.right)>*,.alertify-logs:not(.right)>.hide{left:-110%}.alertify-logs.right{right:16px}.alertify-logs.right>*{float:right;transform:translateZ(0)}.alertify-logs.right>.show{right:0;opacity:1}.alertify-logs.right>*,.alertify-logs.right>.hide{right:-110%;opacity:0}.alertify-logs.top{top:0}.alertify-logs>*{box-sizing:border-box;transition:all .4s cubic-bezier(.25,.8,.25,1);position:relative;clear:both;backface-visibility:hidden;perspective:1000;max-height:0;margin:0;padding:0;overflow:hidden;opacity:0;pointer-events:none}.alertify-logs>.show{margin-top:12px;opacity:1;max-height:1000px;padding:12px;pointer-events:auto}",t.insertBefore(e,t.firstChild)}},removeCSS:function(){var t=document.querySelector("#alertifyCSS");t&&t.parentNode&&t.parentNode.removeChild(t)}};return t.injectCSS(),{_$$alertify:t,parent:function(e){t.parent=e},reset:function(){return t.reset(),this},alert:function(e,r,n){return t.dialog(e,"alert",r,n)||this},confirm:function(e,r,n){return t.dialog(e,"confirm",r,n)||this},prompt:function(e,r,n){return t.dialog(e,"prompt",r,n)||this},log:function(e,r){return t.log(e,"default",r),this},theme:function(e){return t.theme(e),this},success:function(e,r){return t.log(e,"success",r),this},error:function(e,r){return t.log(e,"error",r),this},cancelBtn:function(e){return t.cancelBtn(e),this},okBtn:function(e){return t.okBtn(e),this},delay:function(e){return t.setDelay(e),this},placeholder:function(e){return t.promptPlaceholder=e,this},defaultValue:function(e){return t.promptValue=e,this},maxLogItems:function(e){return t.setMaxLogItems(e),this},closeLogOnClick:function(e){return t.setCloseLogOnClick(!!e),this},logPosition:function(e){return t.setLogPosition(e||""),this},setLogTemplate:function(e){return t.logTemplateMethod=e,this},clearLogs:function(){return t.setupLogContainer().innerHTML="",this},version:t.version}}var o=500,a=function(t){if(t){var e=function(){t&&t.parentNode&&t.parentNode.removeChild(t)};t.classList.remove("show"),t.classList.add("hide"),t.addEventListener("transitionend",e),setTimeout(e,o)}};if("undefined"!=typeof t&&t&&t.exports){t.exports=function(){return new i};var s=new i;for(var u in s)t.exports[u]=s[u]}else n=function(){return new i}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))}()}).call(e,r(17)(t))},function(t,e,r){"use strict";function n(t){document.querySelector("select")&&("current-location"==t?document.querySelector('select [id="option-coords"]').selected=!0:document.querySelector('select [value="'+t+'"]').selected=!0)}e.a=n},function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function o(t){var e,r,i,o,a,s,u=t.length;a=n(t),s=new p(3*u/4-a),i=a>0?u-4:u;var l=0;for(e=0,r=0;e<i;e+=4,r+=3)o=c[t.charCodeAt(e)]<<18|c[t.charCodeAt(e+1)]<<12|c[t.charCodeAt(e+2)]<<6|c[t.charCodeAt(e+3)],s[l++]=o>>16&255,s[l++]=o>>8&255,s[l++]=255&o;return 2===a?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[l++]=255&o):1===a&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[l++]=o>>8&255,s[l++]=255&o),s}function a(t){return l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}function s(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(a(n));return i.join("")}function u(t){for(var e,r=t.length,n=r%3,i="",o=[],a=16383,u=0,c=r-n;u<c;u+=a)o.push(s(t,u,u+a>c?c:u+a));return 1===n?(e=t[r-1],i+=l[e>>2],i+=l[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=l[e>>10],i+=l[e>>4&63],i+=l[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=u;for(var l=[],c=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=h.length;f<d;++f)l[f]=h[f],c[h.charCodeAt(f)]=f;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(t,e,r){"use strict";(function(t){function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(i()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=a.prototype):(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,e,r)}function s(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?f(t,e,r,n):"string"==typeof e?p(t,e,r):d(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e,r,n){return u(e),e<=0?o(t,e):void 0!==r?"string"==typeof n?o(t,e).fill(r,n):o(t,e).fill(r):o(t,e)}function c(t,e){if(u(e),t=o(t,e<0?0:0|m(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(e,r);t=o(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function h(t,e){var r=e.length<0?0:0|m(e.length);t=o(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function f(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),a.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=a.prototype):t=h(t,e),t}function d(t,e){if(a.isBuffer(e)){var r=0|m(e.length);return t=o(t,r),0===t.length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||J(e.length)?o(t,0):h(t,e);if("Buffer"===e.type&&$(e.data))return h(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),a.alloc(+t)}function v(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return G(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function x(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){function o(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,s=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}var l;if(i){var c=-1;for(l=r;l<s;l++)if(o(t,l)===o(e,c===-1?0:l-c)){if(c===-1&&(c=l),l-c+1===u)return c*a}else c!==-1&&(l-=l-c),c=-1}else for(r+u>s&&(r=s-u),l=r;l>=0;l--){for(var p=!0,h=0;h<u;h++)if(o(t,l+h)!==o(e,h)){p=!1;break}if(p)return l}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function E(t,e,r,n){return H(G(e,t.length-r),t,r,n)}function T(t,e,r,n){return H(X(e),t,r,n)}function S(t,e,r,n){return T(t,e,r,n)}function z(t,e,r,n){return H(Y(e),t,r,n)}function A(t,e,r,n){return H(W(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?K.fromByteArray(t):K.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=r){var u,l,c,p;switch(s){case 1:o<128&&(a=o);break;case 2:u=t[i+1],128===(192&u)&&(p=(31&o)<<6|63&u,p>127&&(a=p));break;case 3:u=t[i+1],l=t[i+2],128===(192&u)&&128===(192&l)&&(p=(15&o)<<12|(63&u)<<6|63&l,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:u=t[i+1],l=t[i+2],c=t[i+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(p=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c,p>65535&&p<1114112&&(a=p))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return L(n)}function L(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=tt));return r}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function I(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=Z(t[o]);return i}function R(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function D(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function j(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function F(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,i){return i||F(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,i){return i||F(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function V(t){if(t=q(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function W(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function Y(t){return K.toByteArray(V(t))}function H(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t){return t!==t}/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var K=r(5),Q=r(7),$=r(8);e.Buffer=a,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),e.kMaxLength=i(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return s(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return l(null,t,e,r)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!$(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)_(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)_(this,e,e+3),_(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):g.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,u=Math.min(o,s),l=this.slice(n,i),c=t.slice(e,r),p=0;p<u;++p)if(l[p]!==c[p]){o=l[p],s=c[p];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},a.prototype.indexOf=function(t,e,r){return x(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return x(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return T(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return z(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=a.prototype;else{var i=e-t;n=new a(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},a.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},a.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=t/o&255;return e+r},a.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=a.isBuffer(t)?t:G(new a(t,n).toString()),u=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%u]}return this};var et=/[^+\/0-9A-Za-z-_]/g}).call(e,r(0))},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,p=r?i-1:0,h=r?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,p=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+p>=1?h/u:h*Math.pow(2,1-p),e*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*u-1)*Math.pow(2,i),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(e,r){var n,n;!function(e){t.exports=e()}(function(){var t;return function t(e,r,i){function o(s,u){if(!r[s]){if(!e[s]){var l="function"==typeof n&&n;if(!u&&l)return n(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[s]={exports:{}};e[s][0].call(p.exports,function(t){var r=e[s][1][t];return o(r?r:t)},p,p.exports,t,e,r,i)}return r[s].exports}for(var a="function"==typeof n&&n,s=0;s<i.length;s++)o(i[s]);return o}({1:[function(t,e,r){"use strict";function n(t,e){var r={};for(var n in t){var i=t[n].paintVertexArray;if(0!==i.length){var o=i.serialize(e),a=i.constructor.serialize();r[n]={array:o,type:a}}}return r}var i=t("./program_configuration"),o=function(t,e){this.vertexOffset=t,this.primitiveOffset=e,this.vertexLength=0,this.primitiveLength=0},a=function(t,e,r){var n=this;this.globalProperties={zoom:r};var o=t.layoutVertexArrayType;this.layoutVertexArray=new o;var a=t.elementArrayType;a&&(this.elementArray=new a);var s=t.elementArrayType2;s&&(this.elementArray2=new s),this.layerData={};for(var u=0,l=e;u<l.length;u+=1){var c=l[u],p=i.createDynamic(t.paintAttributes||[],c,r);n.layerData[c.id]={layer:c,programConfiguration:p,paintVertexArray:new p.PaintVertexArray}}this.segments=[],this.segments2=[]};a.prototype.prepareSegment=function(t){var e=this.segments[this.segments.length-1];return(!e||e.vertexLength+t>a.MAX_VERTEX_ARRAY_LENGTH)&&(e=new o(this.layoutVertexArray.length,this.elementArray.length),this.segments.push(e)),e},a.prototype.prepareSegment2=function(t){var e=this.segments2[this.segments2.length-1];return(!e||e.vertexLength+t>a.MAX_VERTEX_ARRAY_LENGTH)&&(e=new o(this.layoutVertexArray.length,this.elementArray2.length),this.segments2.push(e)),e},a.prototype.populatePaintArrays=function(t){var e=this;for(var r in this.layerData){var n=e.layerData[r];0!==n.paintVertexArray.bytesPerElement&&n.programConfiguration.populatePaintArray(n.layer,n.paintVertexArray,e.layoutVertexArray.length,e.globalProperties,t)}},a.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},a.prototype.serialize=function(t){return{layoutVertexArray:this.layoutVertexArray.serialize(t),elementArray:this.elementArray&&this.elementArray.serialize(t),elementArray2:this.elementArray2&&this.elementArray2.serialize(t),paintVertexArrays:n(this.layerData,t),segments:this.segments,segments2:this.segments2}},a.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,e.exports=a},{"./program_configuration":15}],2:[function(t,e,r){"use strict";var n=t("./array_group"),i=t("./buffer_group"),o=t("../util/util"),a=function(t,e){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,t.arrays?this.buffers=new i(e,t.layers,t.zoom,t.arrays):this.arrays=new n(e,t.layers,t.zoom)};a.prototype.populate=function(t,e){for(var r=this,n=0,i=t;n<i.length;n+=1){var o=i[n];r.layers[0].filter(o)&&(r.addFeature(o),e.featureIndex.insert(o,r.index))}},a.prototype.isEmpty=function(){return this.arrays.isEmpty()},a.prototype.serialize=function(t){return{zoom:this.zoom,layerIds:this.layers.map(function(t){return t.id}),arrays:this.arrays.serialize(t)}},a.prototype.destroy=function(){this.buffers&&(this.buffers.destroy(),this.buffers=null)},e.exports=a,a.deserialize=function(t,e){if(e){for(var r={},n=0,i=t;n<i.length;n+=1){var a=i[n],s=a.layerIds.map(function(t){return e.getLayer(t)}).filter(Boolean);if(0!==s.length)for(var u=s[0].createBucket(o.extend({layers:s},a)),l=0,c=s;l<c.length;l+=1){var p=c[l];r[p.id]=u}}return r}}},{"../util/util":127,"./array_group":1,"./buffer_group":9}],3:[function(t,e,r){"use strict";function n(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var i=t("../bucket"),o=t("../vertex_array_type"),a=t("../element_array_type"),s=t("../load_geometry"),u=t("../extent"),l={layoutVertexArrayType:o([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:a(),paintAttributes:[{property:"circle-color",type:"Uint8"},{property:"circle-radius",type:"Uint16",multiplier:10},{property:"circle-blur",type:"Uint16",multiplier:10},{property:"circle-opacity",type:"Uint8",multiplier:255},{property:"circle-stroke-color",type:"Uint8"},{property:"circle-stroke-width",type:"Uint16",multiplier:10},{property:"circle-stroke-opacity",type:"Uint8",multiplier:255}]},c=function(t){function e(e){t.call(this,e,l)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,i=s(t);r<i.length;r+=1)for(var o=i[r],a=0,l=o;a<l.length;a+=1){var c=l[a],p=c.x,h=c.y;if(!(p<0||p>=u||h<0||h>=u)){var f=e.prepareSegment(4),d=f.vertexLength;n(e.layoutVertexArray,p,h,-1,-1),n(e.layoutVertexArray,p,h,1,-1),n(e.layoutVertexArray,p,h,1,1),n(e.layoutVertexArray,p,h,-1,1),e.elementArray.emplaceBack(d,d+1,d+2),e.elementArray.emplaceBack(d,d+3,d+2),f.vertexLength+=4,f.primitiveLength+=2}}e.populatePaintArrays(t.properties)},e}(i);e.exports=c},{"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17}],4:[function(t,e,r){"use strict";var n=t("../bucket"),i=t("../vertex_array_type"),o=t("../element_array_type"),a=t("../load_geometry"),s=t("earcut"),u=t("../../util/classify_rings"),l=500,c={layoutVertexArrayType:i([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:o(3),elementArrayType2:o(2),paintAttributes:[{property:"fill-color",type:"Uint8"},{property:"fill-outline-color",type:"Uint8"},{property:"fill-opacity",type:"Uint8",multiplier:255}]},p=function(t){function e(e){t.call(this,e,c)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,n=u(a(t),l);r<n.length;r+=1){for(var i=n[r],o=0,c=0,p=i;c<p.length;c+=1){var h=p[c];o+=h.length}for(var f=e.prepareSegment(o),d=f.vertexLength,m=[],y=[],v=0,g=i;v<g.length;v+=1){var _=g[v];if(0!==_.length){_!==i[0]&&y.push(m.length/2);var x=e.prepareSegment2(_.length),b=x.vertexLength;e.layoutVertexArray.emplaceBack(_[0].x,_[0].y),e.elementArray2.emplaceBack(b+_.length-1,b),m.push(_[0].x),m.push(_[0].y);for(var w=1;w<_.length;w++)e.layoutVertexArray.emplaceBack(_[w].x,_[w].y),e.elementArray2.emplaceBack(b+w-1,b+w),m.push(_[w].x),m.push(_[w].y);x.vertexLength+=_.length,x.primitiveLength+=_.length}}for(var E=s(m,y),T=0;T<E.length;T+=3)e.elementArray.emplaceBack(d+E[T],d+E[T+1],d+E[T+2]);f.vertexLength+=o,f.primitiveLength+=E.length/3}e.populatePaintArrays(t.properties)},e}(n);e.exports=p},{"../../util/classify_rings":111,"../bucket":2,"../element_array_type":10,"../load_geometry":13,"../vertex_array_type":17,earcut:133}],5:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*d)+a,i*d*2,o*d*2,Math.round(s))}function i(t,e){return t.x===e.x&&(t.x<0||t.x>l)||t.y===e.y&&(t.y<0||t.y>l)}var o=t("../bucket"),a=t("../vertex_array_type"),s=t("../element_array_type"),u=t("../load_geometry"),l=t("../extent"),c=t("earcut"),p=t("../../util/classify_rings"),h=500,f={layoutVertexArrayType:a([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal",components:3,type:"Int16"},{name:"a_edgedistance",components:1,type:"Int16"}]),elementArrayType:s(3),paintAttributes:[{property:"fill-extrusion-base",type:"Uint16"},{property:"fill-extrusion-height",type:"Uint16"},{property:"fill-extrusion-color",type:"Uint8"}]},d=Math.pow(2,13),m=function(t){function e(e){t.call(this,e,f)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this.arrays,r=0,o=p(u(t),h);r<o.length;r+=1){for(var a=o[r],s=0,l=0,f=a;l<f.length;l+=1){var d=f[l];s+=d.length}for(var m=e.prepareSegment(5*s),y=[],v=[],g=[],_=0,x=a;_<x.length;_+=1){var b=x[_];if(0!==b.length){b!==a[0]&&v.push(y.length/2);for(var w=0,E=0;E<b.length;E++){var T=b[E];if(n(e.layoutVertexArray,T.x,T.y,0,0,1,1,0),g.push(m.vertexLength++),E>=1){var S=b[E-1];if(!i(T,S)){var z=T.sub(S)._perp()._unit();n(e.layoutVertexArray,T.x,T.y,z.x,z.y,0,0,w),n(e.layoutVertexArray,T.x,T.y,z.x,z.y,0,1,w),w+=S.dist(T),n(e.layoutVertexArray,S.x,S.y,z.x,z.y,0,0,w),n(e.layoutVertexArray,S.x,S.y,z.x,z.y,0,1,w);var A=m.vertexLength;e.elementArray.emplaceBack(A,A+1,A+2),e.elementArray.emplaceBack(A+1,A+2,A+3),m.vertexLength+=4,m.primitiveLength+=2}}y.push(T.x),y.push(T.y)}}}for(var M=c(y,v),P=0;P<M.length;P+=3)e.elementArray.emplaceBack(g[M[P]],g[M[P+1]],g[M[P+2]]);m.primitiveLength+=M.length/3}e.populatePaintArrays(t.properties)},e}(o);e.exports=m},{"../../util/classify_rings":111,"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17,earcut:133}],6:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a){t.emplaceBack(e.x<<1|n,e.y<<1|i,Math.round(l*r.x)+128,Math.round(l*r.y)+128,(0===o?0:o<0?-1:1)+1|(a*f&63)<<2,a*f>>6)}var i=t("../bucket"),o=t("../vertex_array_type"),a=t("../element_array_type"),s=t("../load_geometry"),u=t("../extent"),l=63,c=Math.cos(37.5*(Math.PI/180)),p=15,h=15,f=.5,d=Math.pow(2,h-1)/f,m={layoutVertexArrayType:o([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),paintAttributes:[{property:"line-color",type:"Uint8"},{property:"line-blur",multiplier:10,type:"Uint8"},{property:"line-opacity",multiplier:10,type:"Uint8"},{property:"line-gap-width",multiplier:10,type:"Uint8",name:"a_gapwidth"},{property:"line-offset",multiplier:1,type:"Int8"}],elementArrayType:a()},y=function(t){function e(e){t.call(this,e,m)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){for(var e=this,r=this.layers[0].layout,n=r["line-join"],i=r["line-cap"],o=r["line-miter-limit"],a=r["line-round-limit"],u=0,l=s(t,h);u<l.length;u+=1){var c=l[u];e.addLine(c,t.properties,n,i,o,a)}},e.prototype.addLine=function(t,e,r,n,i,o){for(var a=this,s=t.length;s>2&&t[s-1].equals(t[s-2]);)s--;if(!(t.length<2)){"bevel"===r&&(i=1.05);var l=p*(u/(512*this.overscaling)),h=t[0],f=t[s-1],d=h.equals(f),m=this.arrays,y=m.prepareSegment(10*s);if(2!==s||!d){this.distance=0;var v,g,_,x,b,w,E,T=n,S=d?"butt":n,z=!0;this.e1=this.e2=this.e3=-1,d&&(v=t[s-2],b=h.sub(v)._unit()._perp());for(var A=0;A<s;A++)if(_=d&&A===s-1?t[1]:t[A+1],!_||!t[A].equals(_)){b&&(x=b),v&&(g=v),v=t[A],b=_?_.sub(v)._unit()._perp():x,x=x||b;var M=x.add(b)._unit(),P=M.x*b.x+M.y*b.y,L=1/P,k=P<c&&g&&_;if(k&&A>0){var C=v.dist(g);if(C>2*l){var I=v.sub(v.sub(g)._mult(l/C)._round());a.distance+=I.dist(g),a.addCurrentVertex(I,a.distance,x.mult(1),0,0,!1,y),g=I}}var R=g&&_,D=R?r:_?T:S;if(R&&"round"===D&&(L<o?D="miter":L<=2&&(D="fakeround")),"miter"===D&&L>i&&(D="bevel"),"bevel"===D&&(L>2&&(D="flipbevel"),L<i&&(D="miter")),g&&(a.distance+=v.dist(g)),"miter"===D)M._mult(L),a.addCurrentVertex(v,a.distance,M,0,0,!1,y);else if("flipbevel"===D){if(L>100)M=b.clone();else{var O=x.x*b.y-x.y*b.x>0?-1:1,B=L*x.add(b).mag()/x.sub(b).mag();M._perp()._mult(B*O)}a.addCurrentVertex(v,a.distance,M,0,0,!1,y),a.addCurrentVertex(v,a.distance,M.mult(-1),0,0,!1,y)}else if("bevel"===D||"fakeround"===D){var j=x.x*b.y-x.y*b.x>0,F=-Math.sqrt(L*L-1);if(j?(E=0,w=F):(w=0,E=F),z||a.addCurrentVertex(v,a.distance,x,w,E,!1,y),"fakeround"===D){for(var U,N=Math.floor(8*(.5-(P-.5))),V=0;V<N;V++)U=b.mult((V+1)/(N+1))._add(x)._unit(),a.addPieSliceVertex(v,a.distance,U,j,y);a.addPieSliceVertex(v,a.distance,M,j,y);for(var q=N-1;q>=0;q--)U=x.mult((q+1)/(N+1))._add(b)._unit(),a.addPieSliceVertex(v,a.distance,U,j,y)}_&&a.addCurrentVertex(v,a.distance,b,-w,-E,!1,y)}else"butt"===D?(z||a.addCurrentVertex(v,a.distance,x,0,0,!1,y),_&&a.addCurrentVertex(v,a.distance,b,0,0,!1,y)):"square"===D?(z||(a.addCurrentVertex(v,a.distance,x,1,1,!1,y),a.e1=a.e2=-1),_&&a.addCurrentVertex(v,a.distance,b,-1,-1,!1,y)):"round"===D&&(z||(a.addCurrentVertex(v,a.distance,x,0,0,!1,y),a.addCurrentVertex(v,a.distance,x,1,1,!0,y),a.e1=a.e2=-1),_&&(a.addCurrentVertex(v,a.distance,b,-1,-1,!0,y),a.addCurrentVertex(v,a.distance,b,0,0,!1,y)));if(k&&A<s-1){var Z=v.dist(_);if(Z>2*l){var G=v.add(_.sub(v)._mult(l/Z)._round());a.distance+=G.dist(v),a.addCurrentVertex(G,a.distance,b.mult(1),0,0,!1,y),v=G}}z=!1}m.populatePaintArrays(e)}}},e.prototype.addCurrentVertex=function(t,e,r,i,o,a,s){var u,l=a?1:0,c=this.arrays,p=c.layoutVertexArray,h=c.elementArray;u=r.clone(),i&&u._sub(r.perp()._mult(i)),n(p,t,u,l,0,i,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(h.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,u=r.mult(-1),o&&u._sub(r.perp()._mult(o)),n(p,t,u,l,1,-o,e),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(h.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>d/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,i,o,a,s))},e.prototype.addPieSliceVertex=function(t,e,r,i,o){var a=i?1:0;r=r.mult(i?-1:1);var s=this.arrays,u=s.layoutVertexArray,l=s.elementArray;n(u,t,r,0,a,0,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(l.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),i?this.e2=this.e3:this.e1=this.e3},e}(i);e.exports=y},{"../bucket":2,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17}],7:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a,s,u,l,c){t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),o/4,a/4,10*(l||0),c,10*(s||0),10*Math.min(u||25,25))}function i(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)}var o=t("point-geometry"),a=t("../array_group"),s=t("../buffer_group"),u=t("../vertex_array_type"),l=t("../element_array_type"),c=t("../extent"),p=t("../../symbol/anchor"),h=t("../../symbol/get_anchors"),f=t("../../util/token"),d=t("../../symbol/quads"),m=t("../../symbol/shaping"),y=t("../../symbol/resolve_text"),v=t("../../symbol/mergelines"),g=t("../../symbol/clip_line"),_=t("../../util/util"),x=t("../../util/script_detection"),b=t("../load_geometry"),w=t("../../symbol/collision_feature"),E=t("../../util/find_pole_of_inaccessibility"),T=t("../../util/classify_rings"),S=t("vector-tile").VectorTileFeature,z=m.shapeText,A=m.shapeIcon,M=m.WritingMode,P=d.getGlyphQuads,L=d.getIconQuads,k=l(),C=u([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),I={glyph:{layoutVertexArrayType:C,elementArrayType:k},icon:{layoutVertexArrayType:C,elementArrayType:k},collisionBox:{layoutVertexArrayType:u([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}]),elementArrayType:l(2)}},R=function(t){var e=this;if(this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.index=t.index,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack,t.arrays){this.buffers={};for(var r in t.arrays)t.arrays[r]&&(e.buffers[r]=new s(I[r],t.layers,t.zoom,t.arrays[r]))}};R.prototype.populate=function(t,e){var r=this,n=this.layers[0].layout,i=n["text-field"],o=n["text-font"],a=n["icon-image"],s=i&&o,u=a;if(this.features=[],s||u){for(var l=e.iconDependencies,c=e.glyphDependencies,p=c[o]=c[o]||{},h=0;h<t.length;h++){var d=t[h];if(r.layers[0].filter(d)){var m;s&&(m=y(d,n));var g;if(u&&(g=f(d.properties,a)),(m||g)&&(r.features.push({text:m,icon:g,index:h,sourceLayerIndex:d.sourceLayerIndex,geometry:b(d),properties:d.properties,type:S.types[d.type]}),g&&(l[g]=!0),m))for(var _=0;_<m.length;_++)p[m.charCodeAt(_)]=!0}}"line"===n["symbol-placement"]&&(this.features=v(this.features))}},R.prototype.isEmpty=function(){return this.arrays.icon.isEmpty()&&this.arrays.glyph.isEmpty()&&this.arrays.collisionBox.isEmpty()},R.prototype.serialize=function(t){return{zoom:this.zoom,layerIds:this.layers.map(function(t){return t.id}),sdfIcons:this.sdfIcons,iconsNeedLinear:this.iconsNeedLinear,adjustedTextSize:this.adjustedTextSize,adjustedIconSize:this.adjustedIconSize,fontstack:this.fontstack,arrays:_.mapObject(this.arrays,function(e){return e.isEmpty()?null:e.serialize(t)})}},R.prototype.destroy=function(){this.buffers&&(this.buffers.icon&&this.buffers.icon.destroy(),this.buffers.glyph&&this.buffers.glyph.destroy(),this.buffers.collisionBox&&this.buffers.collisionBox.destroy(),this.buffers=null)},R.prototype.createArrays=function(){var t=this;this.arrays=_.mapObject(I,function(e){return new a(e,t.layers,t.zoom)})},R.prototype.prepare=function(t,e){var r=this;this.createArrays(),this.adjustedTextMaxSize=this.layers[0].getLayoutValue("text-size",{zoom:18}),this.adjustedTextSize=this.layers[0].getLayoutValue("text-size",{zoom:this.zoom+1}),this.adjustedIconMaxSize=this.layers[0].getLayoutValue("icon-size",{zoom:18}),this.adjustedIconSize=this.layers[0].getLayoutValue("icon-size",{zoom:this.zoom+1});var n=512*this.overscaling;this.tilePixelRatio=c/n,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var i=this.layers[0].layout,o=.5,a=.5;switch(i["text-anchor"]){case"right":case"top-right":case"bottom-right":o=1;break;case"left":case"top-left":case"bottom-left":o=0}switch(i["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":a=1;break;case"top":case"top-right":case"top-left":a=0}for(var s="right"===i["text-justify"]?1:"left"===i["text-justify"]?0:.5,u=24,l=i["text-line-height"]*u,p="line"!==i["symbol-placement"]?i["text-max-width"]*u:0,h=i["text-letter-spacing"]*u,f=[i["text-offset"][0]*u,i["text-offset"][1]*u],d=this.fontstack=i["text-font"].join(","),m="map"===i["text-rotation-alignment"]&&"line"===i["symbol-placement"],y=0,v=this.features;y<v.length;y+=1){var g,b=v[y];if(b.text){var w=x.allowsVerticalWritingMode(b.text);g={},g[M.horizontal]=z(b.text,t[d],p,l,o,a,s,h,f,u,M.horizontal),g[M.vertical]=w&&m&&z(b.text,t[d],p,l,o,a,s,h,f,u,M.vertical)}else g={};var E;if(b.icon){var T=e[b.icon],S=r.layers[0].getLayoutValue("icon-offset",{zoom:r.zoom},b.properties);E=A(T,S),T&&(void 0===r.sdfIcons?r.sdfIcons=T.sdf:r.sdfIcons!==T.sdf&&_.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),1!==T.pixelRatio?r.iconsNeedLinear=!0:0===i["icon-rotate"]&&r.layers[0].isLayoutValueFeatureConstant("icon-rotate")||(r.iconsNeedLinear=!0))}(g[M.horizontal]||E)&&r.addFeature(b,g,E)}this.symbolInstancesEndIndex=this.symbolInstancesArray.length},R.prototype.addFeature=function(t,e,r){var n=this,i=this.layers[0].layout,o=24,a=this.adjustedTextSize/o,s=void 0!==this.adjustedTextMaxSize?this.adjustedTextMaxSize:this.adjustedTextSize,u=this.tilePixelRatio*a,l=this.tilePixelRatio*s/o,f=this.tilePixelRatio*this.adjustedIconSize,d=this.tilePixelRatio*i["symbol-spacing"],m=i["symbol-avoid-edges"],y=i["text-padding"]*this.tilePixelRatio,v=i["icon-padding"]*this.tilePixelRatio,_=i["text-max-angle"]/180*Math.PI,x="map"===i["text-rotation-alignment"]&&"line"===i["symbol-placement"],b="map"===i["icon-rotation-alignment"]&&"line"===i["symbol-placement"],w=i["text-allow-overlap"]||i["icon-allow-overlap"]||i["text-ignore-placement"]||i["icon-ignore-placement"],S=i["symbol-placement"],z=d/2,A=function(i,o){var a=!(o.x<0||o.x>c||o.y<0||o.y>c);if(!m||a){var s=a||w;n.addSymbolInstance(o,i,e,r,n.layers[0],s,n.symbolInstancesArray.length,n.collisionBoxArray,t.index,t.sourceLayerIndex,n.index,u,y,x,f,v,b,{zoom:n.zoom},t.properties)}};if("line"===S)for(var P=0,L=g(t.geometry,0,0,c,c);P<L.length;P+=1)for(var k=L[P],C=h(k,d,_,e[M.vertical]||e[M.horizontal],r,o,l,n.overscaling,c),I=0,R=C;I<R.length;I+=1){var D=R[I],O=e[M.horizontal];O&&n.anchorIsTooClose(O.text,z,D)||A(k,D)}else if("Polygon"===t.type)for(var B=0,j=T(t.geometry,0);B<j.length;B+=1){var F=j[B],U=E(F,16);A(F[0],new p(U.x,U.y,0))}else if("LineString"===t.type)for(var N=0,V=t.geometry;N<V.length;N+=1){var q=V[N];A(q,new p(q[0].x,q[0].y,0))}else if("Point"===t.type)for(var Z=0,G=t.geometry;Z<G.length;Z+=1)for(var X=G[Z],W=0,Y=X;W<Y.length;W+=1){
var H=Y[W];A([H],new p(H.x,H.y,0))}},R.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],o=i.length-1;o>=0;o--)if(r.dist(i[o])<e)return!0}else n[t]=[];return n[t].push(r),!1},R.prototype.place=function(t,e){var r=this;this.createArrays();var n=this.layers[0].layout,i=t.maxScale,o="map"===n["text-rotation-alignment"]&&"line"===n["symbol-placement"],a="map"===n["icon-rotation-alignment"]&&"line"===n["symbol-placement"],s=n["text-allow-overlap"]||n["icon-allow-overlap"]||n["text-ignore-placement"]||n["icon-ignore-placement"];if(s){var u=this.symbolInstancesArray.toArray(this.symbolInstancesStartIndex,this.symbolInstancesEndIndex),l=t.angle,c=Math.sin(l),p=Math.cos(l);this.sortedSymbolInstances=u.sort(function(t,e){var r=c*t.anchorPointX+p*t.anchorPointY|0,n=c*e.anchorPointX+p*e.anchorPointY|0;return r-n||e.index-t.index})}for(var h=this.symbolInstancesStartIndex;h<this.symbolInstancesEndIndex;h++){var f=r.sortedSymbolInstances?r.sortedSymbolInstances[h-r.symbolInstancesStartIndex]:r.symbolInstancesArray.get(h),d={boxStartIndex:f.textBoxStartIndex,boxEndIndex:f.textBoxEndIndex},m={boxStartIndex:f.iconBoxStartIndex,boxEndIndex:f.iconBoxEndIndex},y=!(f.textBoxStartIndex===f.textBoxEndIndex),v=!(f.iconBoxStartIndex===f.iconBoxEndIndex),g=n["text-optional"]||!y,_=n["icon-optional"]||!v,x=y?t.placeCollisionFeature(d,n["text-allow-overlap"],n["symbol-avoid-edges"]):t.minScale,b=v?t.placeCollisionFeature(m,n["icon-allow-overlap"],n["symbol-avoid-edges"]):t.minScale;g||_?!_&&x?x=Math.max(b,x):!g&&b&&(b=Math.max(b,x)):b=x=Math.max(b,x),y&&(t.insertCollisionFeature(d,x,n["text-ignore-placement"]),x<=i&&r.addSymbols(r.arrays.glyph,f.glyphQuadStartIndex,f.glyphQuadEndIndex,x,n["text-keep-upright"],o,t.angle,f.writingModes)),v&&(t.insertCollisionFeature(m,b,n["icon-ignore-placement"]),b<=i&&r.addSymbols(r.arrays.icon,f.iconQuadStartIndex,f.iconQuadEndIndex,b,n["icon-keep-upright"],a,t.angle))}e&&this.addToDebugBuffers(t)},R.prototype.addSymbols=function(t,e,r,i,o,a,s,u){for(var l=this,c=t.elementArray,p=t.layoutVertexArray,h=this.zoom,f=Math.max(Math.log(i)/Math.LN2+h,0),d=e;d<r;d++){var m=l.symbolQuadsArray.get(d).SymbolQuad,y=(m.anchorAngle+s+Math.PI)%(2*Math.PI);if(u&M.vertical){if(a&&m.writingMode===M.vertical){if(o&&a&&y<=5*Math.PI/4||y>7*Math.PI/4)continue}else if(o&&a&&y<=3*Math.PI/4||y>5*Math.PI/4)continue}else if(o&&a&&(y<=Math.PI/2||y>3*Math.PI/2))continue;var v=m.tl,g=m.tr,_=m.bl,x=m.br,b=m.tex,w=m.anchorPoint,E=Math.max(h+Math.log(m.minScale)/Math.LN2,f),T=Math.min(h+Math.log(m.maxScale)/Math.LN2,25);if(!(T<=E)){E===f&&(E=0);var S=Math.round(m.glyphAngle/(2*Math.PI)*256),z=t.prepareSegment(4),A=z.vertexLength;n(p,w.x,w.y,v.x,v.y,b.x,b.y,E,T,f,S),n(p,w.x,w.y,g.x,g.y,b.x+b.w,b.y,E,T,f,S),n(p,w.x,w.y,_.x,_.y,b.x,b.y+b.h,E,T,f,S),n(p,w.x,w.y,x.x,x.y,b.x+b.w,b.y+b.h,E,T,f,S),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3),z.vertexLength+=4,z.primitiveLength+=2}}},R.prototype.addToDebugBuffers=function(t){for(var e=this,r=this.arrays.collisionBox,n=r.layoutVertexArray,a=r.elementArray,s=-t.angle,u=t.yStretch,l=this.symbolInstancesStartIndex;l<this.symbolInstancesEndIndex;l++){var c=e.symbolInstancesArray.get(l);c.textCollisionFeature={boxStartIndex:c.textBoxStartIndex,boxEndIndex:c.textBoxEndIndex},c.iconCollisionFeature={boxStartIndex:c.iconBoxStartIndex,boxEndIndex:c.iconBoxEndIndex};for(var p=0;p<2;p++){var h=c[0===p?"textCollisionFeature":"iconCollisionFeature"];if(h)for(var f=h.boxStartIndex;f<h.boxEndIndex;f++){var d=e.collisionBoxArray.get(f),m=d.anchorPoint,y=new o(d.x1,d.y1*u)._rotate(s),v=new o(d.x2,d.y1*u)._rotate(s),g=new o(d.x1,d.y2*u)._rotate(s),_=new o(d.x2,d.y2*u)._rotate(s),x=Math.max(0,Math.min(25,e.zoom+Math.log(d.maxScale)/Math.LN2)),b=Math.max(0,Math.min(25,e.zoom+Math.log(d.placementScale)/Math.LN2)),w=r.prepareSegment(4),E=w.vertexLength;i(n,m,y,x,b),i(n,m,v,x,b),i(n,m,_,x,b),i(n,m,g,x,b),a.emplaceBack(E,E+1),a.emplaceBack(E+1,E+2),a.emplaceBack(E+2,E+3),a.emplaceBack(E+3,E),w.vertexLength+=4,w.primitiveLength+=4}}}},R.prototype.addSymbolInstance=function(t,e,r,n,i,o,a,s,u,l,c,p,h,f,d,m,y,v,g){var x,b,E,T=this,S=[];for(var z in r){var A=parseInt(z,10);r[A]&&(S=S.concat(o?P(t,r[A],p,e,i,f,A):[]),x=new w(s,e,t,u,l,c,r[A],p,h,f,!1))}var k=this.symbolQuadsArray.length;if(S&&S.length)for(var C=0;C<S.length;C++)T.addSymbolQuad(S[C]);var I=this.symbolQuadsArray.length,D=x?x.boxStartIndex:this.collisionBoxArray.length,O=x?x.boxEndIndex:this.collisionBoxArray.length;n&&(E=o?L(t,n,d,e,i,y,r[M.horizontal],v,g):[],b=new w(s,e,t,u,l,c,n,d,m,y,!0));var B=this.symbolQuadsArray.length;E&&1===E.length&&this.addSymbolQuad(E[0]);var j=this.symbolQuadsArray.length,F=b?b.boxStartIndex:this.collisionBoxArray.length,U=b?b.boxEndIndex:this.collisionBoxArray.length;j>R.MAX_QUADS&&_.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),I>R.MAX_QUADS&&_.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var N=(r[M.vertical]?M.vertical:0)|(r[M.horizontal]?M.horizontal:0);return this.symbolInstancesArray.emplaceBack(D,O,F,U,k,I,B,j,t.x,t.y,a,N)},R.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale,t.writingMode)},R.MAX_QUADS=65535,e.exports=R},{"../../symbol/anchor":73,"../../symbol/clip_line":75,"../../symbol/collision_feature":77,"../../symbol/get_anchors":79,"../../symbol/mergelines":82,"../../symbol/quads":83,"../../symbol/resolve_text":84,"../../symbol/shaping":85,"../../util/classify_rings":111,"../../util/find_pole_of_inaccessibility":117,"../../util/script_detection":124,"../../util/token":126,"../../util/util":127,"../array_group":1,"../buffer_group":9,"../element_array_type":10,"../extent":11,"../load_geometry":13,"../vertex_array_type":17,"point-geometry":194,"vector-tile":204}],8:[function(t,e,r){"use strict";var n={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"},i=function(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e};i.fromStructArray=function(t,e){return new i(t.serialize(),t.constructor.serialize(),e)},i.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.gl=t,this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)},i.prototype.setVertexAttribPointers=function(t,e,r){for(var i=this,o=0;o<this.attributes.length;o++){var a=i.attributes[o],s=e[a.name];void 0!==s&&t.vertexAttribPointer(s,a.components,t[n[a.type]],!1,i.arrayType.bytesPerElement,a.offset+(i.arrayType.bytesPerElement*r||0))}},i.prototype.destroy=function(){this.buffer&&this.gl.deleteBuffer(this.buffer)},i.BufferType={VERTEX:"ARRAY_BUFFER",ELEMENT:"ELEMENT_ARRAY_BUFFER"},e.exports=i},{}],9:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("./buffer"),o=t("./program_configuration"),a=t("../render/vertex_array_object"),s=function(t,e,r,s){var u=this;this.layoutVertexBuffer=new i(s.layoutVertexArray,t.layoutVertexArrayType.serialize(),i.BufferType.VERTEX),s.elementArray&&(this.elementBuffer=new i(s.elementArray,t.elementArrayType.serialize(),i.BufferType.ELEMENT)),s.elementArray2&&(this.elementBuffer2=new i(s.elementArray2,t.elementArrayType2.serialize(),i.BufferType.ELEMENT)),this.layerData={};for(var l=0,c=e;l<c.length;l+=1){var p=c[l],h=s.paintVertexArrays&&s.paintVertexArrays[p.id],f=o.createDynamic(t.paintAttributes||[],p,r),d=h?new i(h.array,h.type,i.BufferType.VERTEX):null;u.layerData[p.id]={programConfiguration:f,paintVertexBuffer:d}}this.segments=s.segments,this.segments2=s.segments2;for(var m=0,y=[this.segments,this.segments2];m<y.length;m+=1)for(var v=y[m],g=0,_=v||[];g<_.length;g+=1){var x=_[g];x.vaos=n.mapObject(u.layerData,function(){return new a})}};s.prototype.destroy=function(){var t=this;this.layoutVertexBuffer.destroy(),this.elementBuffer&&this.elementBuffer.destroy(),this.elementBuffer2&&this.elementBuffer2.destroy();for(var e in this.layerData){var r=t.layerData[e].paintVertexBuffer;r&&r.destroy()}for(var n=0,i=[this.segments,this.segments2];n<i.length;n+=1)for(var o=i[n],a=0,s=o||[];a<s.length;a+=1){var u=s[a];for(var l in u.vaos)u.vaos[l].destroy()}},e.exports=s},{"../render/vertex_array_object":39,"../util/util":127,"./buffer":8,"./program_configuration":15}],10:[function(t,e,r){"use strict";function n(t){return i({members:[{type:"Uint16",name:"vertices",components:t||3}]})}var i=t("../util/struct_array");e.exports=n},{"../util/struct_array":125}],11:[function(t,e,r){"use strict";e.exports=8192},{}],12:[function(t,e,r){"use strict";function n(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function i(t,e){return e-t}function o(t){return t["line-gap-width"]>0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function a(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===r&&e._rotate(-n);for(var o=[],a=0;a<t.length;a++){for(var s=t[a],l=[],c=0;c<s.length;c++)l.push(s[c].sub(e._mult(i)));o.push(l)}return o}function s(t,e){for(var r=[],n=new u(0,0),i=0;i<t.length;i++){for(var o=t[i],a=[],s=0;s<o.length;s++){var l=o[s-1],c=o[s],p=o[s+1],h=0===s?n:c.sub(l)._unit()._perp(),f=s===o.length-1?n:p.sub(c)._unit()._perp(),d=h._add(f)._unit(),m=d.x*f.x+d.y*f.y;d._mult(1/m),a.push(d._mult(e)._add(c))}r.push(a)}return r}var u=t("point-geometry"),l=t("./load_geometry"),c=t("./extent"),p=t("feature-filter"),h=t("../util/struct_array"),f=t("grid-index"),d=t("../util/dictionary_coder"),m=t("vector-tile"),y=t("pbf"),v=t("../util/vectortile_to_geojson"),g=t("../util/util").arraysIntersect,_=t("../util/intersection_tests"),x=_.multiPolygonIntersectsBufferedMultiPoint,b=_.multiPolygonIntersectsMultiPolygon,w=_.multiPolygonIntersectsBufferedMultiLine,E=h({members:[{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]}),T=function(t,e,r){if(t.grid){var n=t,i=e;t=n.coord,e=n.overscaling,this.grid=new f(n.grid),this.featureIndexArray=new E(n.featureIndexArray),this.rawTileData=i,this.bucketLayerIDs=n.bucketLayerIDs}else this.grid=new f(c,16,0),this.featureIndexArray=new E;this.coord=t,this.overscaling=e,this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.setCollisionTile(r)};T.prototype.insert=function(t,e){var r=this,n=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(t.index,t.sourceLayerIndex,e);for(var i=l(t),o=0;o<i.length;o++){for(var a=i[o],s=[1/0,1/0,-(1/0),-(1/0)],u=0;u<a.length;u++){var c=a[u];s[0]=Math.min(s[0],c.x),s[1]=Math.min(s[1],c.y),s[2]=Math.max(s[2],c.x),s[3]=Math.max(s[3],c.y)}r.grid.insert(n,s[0],s[1],s[2],s[3])}},T.prototype.setCollisionTile=function(t){this.collisionTile=t},T.prototype.serialize=function(t){var e=this.grid.toArrayBuffer();return t&&t.push(e),{coord:this.coord,overscaling:this.overscaling,grid:e,featureIndexArray:this.featureIndexArray.serialize(t),bucketLayerIDs:this.bucketLayerIDs}},T.prototype.query=function(t,e){this.vtLayers||(this.vtLayers=new m.VectorTile(new y(this.rawTileData)).layers,this.sourceLayerCoder=new d(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));var r={},a=t.params||{},s=c/t.tileSize/t.scale,l=p(a.filter),h=0;for(var f in e){var v=e[f],g=v.paint,_=0;"line"===v.type?_=o(g)/2+Math.abs(g["line-offset"])+n(g["line-translate"]):"fill"===v.type?_=n(g["fill-translate"]):"fill-extrusion"===v.type?_=n(g["fill-extrusion-translate"]):"circle"===v.type&&(_=g["circle-radius"]+n(g["circle-translate"])),h=Math.max(h,_*s)}for(var x=t.queryGeometry.map(function(t){return t.map(function(t){return new u(t.x,t.y)})}),b=1/0,w=1/0,E=-(1/0),T=-(1/0),S=0;S<x.length;S++)for(var z=x[S],A=0;A<z.length;A++){var M=z[A];b=Math.min(b,M.x),w=Math.min(w,M.y),E=Math.max(E,M.x),T=Math.max(T,M.y)}var P=this.grid.query(b-h,w-h,E+h,T+h);P.sort(i),this.filterMatching(r,P,this.featureIndexArray,x,l,a.layers,e,t.bearing,s);var L=this.collisionTile.queryRenderedSymbols(x,t.scale);return L.sort(),this.filterMatching(r,L,this.collisionTile.collisionBoxArray,x,l,a.layers,e,t.bearing,s),r},T.prototype.filterMatching=function(t,e,r,n,i,u,c,p,h){for(var f,d=this,m=0;m<e.length;m++){var y=e[m];if(y!==f){f=y;var _=r.get(y),E=d.bucketLayerIDs[_.bucketIndex];if(!u||g(u,E)){var T=d.sourceLayerCoder.decode(_.sourceLayerIndex),S=d.vtLayers[T],z=S.feature(_.featureIndex);if(i(z))for(var A=null,M=0;M<E.length;M++){var P=E[M];if(!(u&&u.indexOf(P)<0)){var L=c[P];if(L){var k;if("symbol"!==L.type){A||(A=l(z));var C=L.paint;if("line"===L.type){k=a(n,C["line-translate"],C["line-translate-anchor"],p,h);var I=o(C)/2*h;if(C["line-offset"]&&(A=s(A,C["line-offset"]*h)),!w(k,A,I))continue}else if("fill"===L.type||"fill-extrusion"===L.type){var R=L.type;if(k=a(n,C[R+"-translate"],C[R+"-translate-anchor"],p,h),!b(k,A))continue}else if("circle"===L.type){k=a(n,C["circle-translate"],C["circle-translate-anchor"],p,h);var D=C["circle-radius"]*h;if(!x(k,A,D))continue}}var O=new v(z,d.z,d.x,d.y);O.layer=L.serialize();var B=t[P];void 0===B&&(B=t[P]=[]),B.push(O)}}}}}}},e.exports=T},{"../util/dictionary_coder":113,"../util/intersection_tests":120,"../util/struct_array":125,"../util/util":127,"../util/vectortile_to_geojson":128,"./extent":11,"./load_geometry":13,"feature-filter":135,"grid-index":146,pbf:193,"point-geometry":194,"vector-tile":204}],13:[function(t,e,r){"use strict";function n(t){return{min:-1*Math.pow(2,t-1),max:Math.pow(2,t-1)-1}}var i=t("../util/util"),o=t("./extent"),a={15:n(15),16:n(16)};e.exports=function(t,e){for(var r=a[e||16],n=o/t.extent,s=t.loadGeometry(),u=0;u<s.length;u++)for(var l=s[u],c=0;c<l.length;c++){var p=l[c];p.x=Math.round(p.x*n),p.y=Math.round(p.y*n),(p.x<r.min||p.x>r.max||p.y<r.min||p.y>r.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return s}},{"../util/util":127,"./extent":11}],14:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=n({members:[{name:"a_pos",type:"Int16",components:2}]});e.exports=i},{"../util/struct_array":125}],15:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.zoomStops)return e.getPaintValue(t.property,r,n);var i=t.zoomStops.map(function(i){return e.getPaintValue(t.property,a.extend({},r,{zoom:i}),n)});return 1===i.length?i[0]:i}function i(t,e){var r=t.property.replace(e.type+"-","").replace(/-/g,"_"),n="color"===e._paintSpecifications[t.property].type;return a.extend({name:"a_"+r,components:n?4:1,multiplier:n?255:1},t)}var o=t("./vertex_array_type"),a=t("../util/util"),s=function(){this.attributes=[],this.uniforms=[],this.interpolationUniforms=[],this.pragmas={vertex:{},fragment:{}},this.cacheKey=""};s.createDynamic=function(t,e,r){for(var n=new s,a=0,u=t;a<u.length;a+=1){var l=u[a],c=i(l,e),p=c.name.slice(2);e.isPaintValueFeatureConstant(c.property)?n.addZoomAttribute(p,c):e.isPaintValueZoomConstant(c.property)?n.addPropertyAttribute(p,c):n.addZoomAndPropertyAttribute(p,c,e,r)}return n.PaintVertexArray=o(n.attributes),n},s.createStatic=function(t){for(var e=new s,r=0,n=t;r<n.length;r+=1){var i=n[r];e.addUniform(i,"u_"+i)}return e},s.prototype.addUniform=function(t,e){var r=this.getPragmas(t);r.define.push("uniform {precision} {type} "+e+";"),r.initialize.push("{precision} {type} "+t+" = "+e+";"),this.cacheKey+="/u_"+t},s.prototype.addZoomAttribute=function(t,e){this.uniforms.push(e),this.addUniform(t,e.name)},s.prototype.addPropertyAttribute=function(t,e){var r=this.getPragmas(t);this.attributes.push(e),r.define.push("varying {precision} {type} "+t+";"),r.vertex.define.push("attribute {precision} {type} "+e.name+";"),r.vertex.initialize.push(t+" = "+e.name+" / "+e.multiplier+".0;"),this.cacheKey+="/a_"+t},s.prototype.addZoomAndPropertyAttribute=function(t,e,r,n){var i=this,o=this.getPragmas(t);o.define.push("varying {precision} {type} "+t+";");for(var s=0,u=r.getPaintValueStopZoomLevels(e.property);s<u.length&&u[s]<n;)s++;var l=Math.max(0,Math.min(u.length-4,s-2)),c="u_"+t+"_t";o.vertex.define.push("uniform lowp float "+c+";"),this.interpolationUniforms.push({name:c,property:e.property,stopOffset:l});for(var p=[],h=0;h<4;h++)p.push(u[Math.min(l+h,u.length-1)]);var f=[];if(1===e.components)this.attributes.push(a.extend({},e,{components:4,zoomStops:p})),o.vertex.define.push("attribute {precision} vec4 "+e.name+";"),f.push(e.name);else for(var d=0;d<4;d++){var m=e.name+d;f.push(m),i.attributes.push(a.extend({},e,{name:m,zoomStops:[p[d]]})),o.vertex.define.push("attribute {precision} {type} "+m+";")}o.vertex.initialize.push(t+" = evaluate_zoom_function_"+e.components+"( "+f.join(", ")+", "+c+") / "+e.multiplier+".0;"),this.cacheKey+="/z_"+t},s.prototype.getPragmas=function(t){return this.pragmas[t]||(this.pragmas[t]={define:[],initialize:[]},this.pragmas[t].fragment={define:[],initialize:[]},this.pragmas[t].vertex={define:[],initialize:[]}),this.pragmas[t]},s.prototype.applyPragmas=function(t,e){var r=this;return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,n,i,o,a){return r.pragmas[a][n].concat(r.pragmas[a][e][n]).join("\n").replace(/{type}/g,o).replace(/{precision}/g,i)})},s.prototype.populatePaintArray=function(t,e,r,i,o){var a=e.length;e.resize(r);for(var s=0,u=this.attributes;s<u.length;s+=1)for(var l=u[s],c=n(l,t,i,o),p=a;p<r;p++){var h=e.get(p);if(4===l.components)for(var f=0;f<4;f++)h[l.name+f]=c[f]*l.multiplier;else h[l.name]=c*l.multiplier}},s.prototype.setUniforms=function(t,e,r,n){for(var i=0,o=this.uniforms;i<o.length;i+=1){var a=o[i],s=r.getPaintValue(a.property,n);4===a.components?t.uniform4fv(e[a.name],s):t.uniform1f(e[a.name],s)}for(var u=0,l=this.interpolationUniforms;u<l.length;u+=1){var c=l[u],p=r.getPaintInterpolationT(c.property,n);t.uniform1f(e[c.name],Math.max(0,Math.min(4,p-c.stopOffset)))}},e.exports=s},{"../util/util":127,"./vertex_array_type":17}],16:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=n({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]});e.exports=i},{"../util/struct_array":125}],17:[function(t,e,r){"use strict";function n(t){return i({members:t,alignment:4})}var i=t("../util/struct_array");e.exports=n},{"../util/struct_array":125}],18:[function(t,e,r){"use strict";var n=function(t,e,r){this.column=t,this.row=e,this.zoom=r};n.prototype.clone=function(){return new n(this.column,this.row,this.zoom)},n.prototype.zoomTo=function(t){return this.clone()._zoomTo(t)},n.prototype.sub=function(t){return this.clone()._sub(t)},n.prototype._zoomTo=function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},n.prototype._sub=function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this},e.exports=n},{}],19:[function(t,e,r){"use strict";var n=t("../util/util").wrap,i=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};i.prototype.wrap=function(){return new i(n(this.lng,-180,180),this.lat)},i.prototype.toArray=function(){return[this.lng,this.lat]},i.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},i.convert=function(t){if(t instanceof i)return t;if(t&&t.hasOwnProperty("lng")&&t.hasOwnProperty("lat"))return new i(t.lng,t.lat);if(Array.isArray(t)&&2===t.length)return new i(t[0],t[1]);throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")},e.exports=i},{"../util/util":127}],20:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};i.prototype.setNorthEast=function(t){return this._ne=n.convert(t),this},i.prototype.setSouthWest=function(t){return this._sw=n.convert(t),this},i.prototype.extend=function(t){var e,r,o=this._sw,a=this._ne;if(t instanceof n)e=t,r=t;else{if(!(t instanceof i))return Array.isArray(t)?t.every(Array.isArray)?this.extend(i.convert(t)):this.extend(n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return o||a?(o.lng=Math.min(e.lng,o.lng),o.lat=Math.min(e.lat,o.lat),a.lng=Math.max(r.lng,a.lng),a.lat=Math.max(r.lat,a.lat)):(this._sw=new n(e.lng,e.lat),this._ne=new n(r.lng,r.lat)),this},i.prototype.getCenter=function(){return new n((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},i.prototype.getSouthWest=function(){return this._sw},i.prototype.getNorthEast=function(){return this._ne},i.prototype.getNorthWest=function(){return new n(this.getWest(),this.getNorth())},i.prototype.getSouthEast=function(){return new n(this.getEast(),this.getSouth())},i.prototype.getWest=function(){return this._sw.lng},i.prototype.getSouth=function(){return this._sw.lat},i.prototype.getEast=function(){return this._ne.lng},i.prototype.getNorth=function(){return this._ne.lat},i.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},i.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},i.convert=function(t){return!t||t instanceof i?t:new i(t)},e.exports=i},{"./lng_lat":19}],21:[function(t,e,r){"use strict";var n=t("./lng_lat"),i=t("point-geometry"),o=t("./coordinate"),a=t("../util/util"),s=t("../util/interpolate"),u=t("../source/tile_coord"),l=t("../data/extent"),c=t("@mapbox/gl-matrix"),p=c.vec4,h=c.mat4,f=c.mat2,d=function(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new n(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0},m={minZoom:{},maxZoom:{},worldSize:{},centerPoint:{},size:{},bearing:{},pitch:{},fov:{},zoom:{},center:{},unmodified:{},x:{},y:{},point:{}};m.minZoom.get=function(){return this._minZoom},m.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},m.maxZoom.get=function(){return this._maxZoom},m.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},m.worldSize.get=function(){return this.tileSize*this.scale},m.centerPoint.get=function(){return this.size._div(2)},m.size.get=function(){return new i(this.width,this.height)},m.bearing.get=function(){return-this.angle/Math.PI*180},m.bearing.set=function(t){var e=-a.wrap(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=f.create(),f.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},m.pitch.get=function(){return this._pitch/Math.PI*180},m.pitch.set=function(t){var e=a.clamp(t,0,60)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},m.fov.get=function(){return this._fov/Math.PI*180},m.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},m.zoom.get=function(){return this._zoom},m.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},m.center.get=function(){return this._center},m.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},d.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},d.prototype.coveringTiles=function(t){var e=this.coveringZoomLevel(t),r=e;if(e<t.minzoom)return[];e>t.maxzoom&&(e=t.maxzoom);var n=this.pointCoordinate(this.centerPoint,e),o=new i(n.column-.5,n.row-.5),a=[this.pointCoordinate(new i(0,0),e),this.pointCoordinate(new i(this.width,0),e),this.pointCoordinate(new i(this.width,this.height),e),this.pointCoordinate(new i(0,this.height),e)];return u.cover(e,a,t.reparseOverscaled?r:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},d.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},m.unmodified.get=function(){return this._unmodified},d.prototype.zoomScale=function(t){return Math.pow(2,t)},d.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},d.prototype.project=function(t){return new i(this.lngX(t.lng),this.latY(t.lat))},d.prototype.unproject=function(t){return new n(this.xLng(t.x),this.yLat(t.y))},m.x.get=function(){return this.lngX(this.center.lng)},m.y.get=function(){return this.latY(this.center.lat)},m.point.get=function(){return new i(this.x,this.y)},d.prototype.lngX=function(t){return(180+t)*this.worldSize/360},d.prototype.latY=function(t){var e=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-e)*this.worldSize/360},d.prototype.xLng=function(t){return 360*t/this.worldSize-180},d.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},d.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(r))},d.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},d.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},d.prototype.locationCoordinate=function(t){return new o(this.lngX(t.lng)/this.tileSize,this.latY(t.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},d.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new n(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},d.prototype.pointCoordinate=function(t,e){void 0===e&&(e=this.tileZoom);var r=0,n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];p.transformMat4(n,n,this.pixelMatrixInverse),p.transformMat4(i,i,this.pixelMatrixInverse);var a=n[3],u=i[3],l=n[0]/a,c=i[0]/u,h=n[1]/a,f=i[1]/u,d=n[2]/a,m=i[2]/u,y=d===m?0:(r-d)/(m-d);return new o(s(l,c,y)/this.tileSize,s(h,f,y)/this.tileSize,this.zoom)._zoomTo(e)},d.prototype.coordinatePoint=function(t){var e=t.zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return p.transformMat4(r,r,this.pixelMatrix),new i(r[0]/r[3],r[1]/r[3])},d.prototype.calculatePosMatrix=function(t,e){var r=t.toCoordinate(e),n=this.worldSize/this.zoomScale(r.zoom),i=h.identity(new Float64Array(16));return h.translate(i,i,[r.column*n,r.row*n,0]),h.scale(i,i,[n/l,n/l,1]),h.multiply(i,this.projMatrix,i),new Float32Array(i)},d.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,o,a,s,u,l=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),o=e-t<l.y?l.y/(e-t):0),this.lngRange&&(r=this.lngX(this.lngRange[0]),n=this.lngX(this.lngRange[1]),a=n-r<l.x?l.x/(n-r):0);var p=Math.max(a||0,o||0);if(p)return this.center=this.unproject(new i(a?(n+r)/2:this.x,o?(e+t)/2:this.y)),this.zoom+=this.scaleZoom(p),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var h=this.y,f=l.y/2;h-f<t&&(u=t+f),h+f>e&&(u=e-f)}if(this.lngRange){var d=this.x,m=l.x/2;d-m<r&&(s=r+m),d+m>n&&(s=n-m)}void 0===s&&void 0===u||(this.center=this.unproject(new i(void 0!==s?s:this.x,void 0!==u?u:this.y))),this._unmodified=c,this._constraining=!1}},d.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),n=Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance,i=1.01*n,o=new Float64Array(16);h.perspective(o,this._fov,this.width/this.height,1,i),h.scale(o,o,[1,-1,1]),h.translate(o,o,[0,0,-this.cameraToCenterDistance]),h.rotateX(o,o,this._pitch),h.rotateZ(o,o,this.angle),h.translate(o,o,[-this.x,-this.y,0]);var a=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(h.scale(o,o,[1,1,a,1]),this.projMatrix=o,o=h.create(),h.scale(o,o,[this.width/2,-this.height/2,1]),h.translate(o,o,[1,-1,0]),this.pixelMatrix=h.multiply(new Float64Array(16),o,this.projMatrix),o=h.invert(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o}},Object.defineProperties(d.prototype,m),e.exports=d},{"../data/extent":11,"../source/tile_coord":51,"../util/interpolate":119,"../util/util":127,"./coordinate":18,"./lng_lat":19,"@mapbox/gl-matrix":131,"point-geometry":194}],22:[function(t,e,r){"use strict";var n,i=t("./util/worker_pool");e.exports=function(){return n||(n=new i),n}},{"./util/worker_pool":130}],23:[function(t,e,r){"use strict";var n={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],
F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var o,a,s,u,l,c,p,h,f=[];for(o=0,a=t.length;o<a;o++)if(l=n[t[o]]){for(h=null,s=0,u=l[1].length;s<u;s+=2)l[1][s]===-1&&l[1][s+1]===-1?h=null:(c=e+l[1][s]*i,p=r-l[1][s+1]*i,h&&f.push(h.x,h.y,c,p),h={x:c,y:p});e+=l[0]*i}return f}},{}],24:[function(t,e,r){"use strict";var n=t("./util/browser"),i=e.exports={};i.version=t("../package.json").version,i.workerCount=Math.max(Math.floor(n.hardwareConcurrency/2),1),i.Map=t("./ui/map"),i.NavigationControl=t("./ui/control/navigation_control"),i.GeolocateControl=t("./ui/control/geolocate_control"),i.AttributionControl=t("./ui/control/attribution_control"),i.ScaleControl=t("./ui/control/scale_control"),i.Popup=t("./ui/popup"),i.Marker=t("./ui/marker"),i.Style=t("./style/style"),i.LngLat=t("./geo/lng_lat"),i.LngLatBounds=t("./geo/lng_lat_bounds"),i.Point=t("point-geometry"),i.Evented=t("./util/evented"),i.util=t("./util/util"),i.supported=t("./util/browser").supported;var o=t("./util/ajax");i.util.getJSON=o.getJSON,i.util.getArrayBuffer=o.getArrayBuffer;var a=t("./util/config");i.config=a,Object.defineProperty(i,"accessToken",{get:function(){return a.ACCESS_TOKEN},set:function(t){a.ACCESS_TOKEN=t}})},{"../package.json":214,"./geo/lng_lat":19,"./geo/lng_lat_bounds":20,"./style/style":61,"./ui/control/attribution_control":91,"./ui/control/geolocate_control":92,"./ui/control/navigation_control":93,"./ui/control/scale_control":94,"./ui/map":103,"./ui/marker":104,"./ui/popup":105,"./util/ajax":107,"./util/browser":108,"./util/config":112,"./util/evented":116,"./util/util":127,"point-geometry":194}],25:[function(t,e,r){"use strict";function n(t,e,r){var n=t.gl,o=t.transform,a=o.tileSize,s=r.paint["background-color"],u=r.paint["background-pattern"],l=r.paint["background-opacity"],c=!u&&1===s[3]&&1===l;if(t.isOpaquePass===c){n.disable(n.STENCIL_TEST),t.setDepthSublayer(0);var p;u?(p=t.useProgram("fillPattern",t.basicFillProgramConfiguration),i.prepare(u,t,p),t.tileExtentPatternVAO.bind(n,p,t.tileExtentBuffer)):(p=t.useProgram("fill",t.basicFillProgramConfiguration),n.uniform4fv(p.u_color,s),t.tileExtentVAO.bind(n,p,t.tileExtentBuffer)),n.uniform1f(p.u_opacity,l);for(var h=o.coveringTiles({tileSize:a}),f=0,d=h;f<d.length;f+=1){var m=d[f];u&&i.setTile({coord:m,tileSize:a},t,p),n.uniformMatrix4fv(p.u_matrix,!1,t.transform.calculatePosMatrix(m)),n.drawArrays(n.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}}}var i=t("./pattern");e.exports=n},{"./pattern":37}],26:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var o=t.gl;t.setDepthSublayer(0),t.depthMask(!1),o.disable(o.STENCIL_TEST);for(var a=0;a<n.length;a++){var s=n[a],u=e.getTile(s),l=u.getBucket(r);if(l){var c=l.buffers,p=c.layerData[r.id],h=p.programConfiguration,f=t.useProgram("circle",h);h.setUniforms(o,f,r,{zoom:t.transform.zoom}),"map"===r.paint["circle-pitch-scale"]?(o.uniform1i(f.u_scale_with_map,!0),o.uniform2f(f.u_extrude_scale,t.transform.pixelsToGLUnits[0]*t.transform.cameraToCenterDistance,t.transform.pixelsToGLUnits[1]*t.transform.cameraToCenterDistance)):(o.uniform1i(f.u_scale_with_map,!1),o.uniform2fv(f.u_extrude_scale,t.transform.pixelsToGLUnits)),o.uniform1f(f.u_devicepixelratio,i.devicePixelRatio),o.uniformMatrix4fv(f.u_matrix,!1,t.translatePosMatrix(s.posMatrix,u,r.paint["circle-translate"],r.paint["circle-translate-anchor"]));for(var d=0,m=c.segments;d<m.length;d+=1){var y=m[d];y.vaos[r.id].bind(o,f,c.layoutVertexBuffer,c.elementBuffer,p.paintVertexBuffer,y.vertexOffset),o.drawElements(o.TRIANGLES,3*y.primitiveLength,o.UNSIGNED_SHORT,3*y.primitiveOffset*2)}}}}}var i=t("../util/browser");e.exports=n},{"../util/browser":108}],27:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t.gl;i.enable(i.STENCIL_TEST);for(var o=t.useProgram("collisionBox"),a=0;a<n.length;a++){var s=n[a],u=e.getTile(s),l=u.getBucket(r);if(l){var c=l.buffers.collisionBox;if(c){i.uniformMatrix4fv(o.u_matrix,!1,s.posMatrix),t.enableTileClippingMask(s),t.lineWidth(1),i.uniform1f(o.u_scale,Math.pow(2,t.transform.zoom-u.coord.z)),i.uniform1f(o.u_zoom,10*t.transform.zoom),i.uniform1f(o.u_maxzoom,10*(u.coord.z+1));for(var p=0,h=c.segments;p<h.length;p+=1){var f=h[p];f.vaos[r.id].bind(i,o,c.layoutVertexBuffer,c.elementBuffer,null,f.vertexOffset),i.drawElements(i.LINES,2*f.primitiveLength,i.UNSIGNED_SHORT,2*f.primitiveOffset*2)}}}}}e.exports=n},{}],28:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<r.length;n++)i(t,e,r[n])}function i(t,e,r){var n=t.gl;n.disable(n.STENCIL_TEST),t.lineWidth(1*a.devicePixelRatio);var i=r.posMatrix,h=t.useProgram("debug");n.uniformMatrix4fv(h.u_matrix,!1,i),n.uniform4f(h.u_color,1,0,0,1),t.debugVAO.bind(n,h,t.debugBuffer),n.drawArrays(n.LINE_STRIP,0,t.debugBuffer.length);for(var f=o(r.toString(),50,200,5),d=new p,m=0;m<f.length;m+=2)d.emplaceBack(f[m],f[m+1]);var y=l.fromStructArray(d,l.BufferType.VERTEX),v=new c;v.bind(n,h,y),n.uniform4f(h.u_color,1,1,1,1);for(var g=e.getTile(r).tileSize,_=u/(Math.pow(2,t.transform.zoom-r.z)*g),x=[[-1,-1],[-1,1],[1,-1],[1,1]],b=0;b<x.length;b++){var w=x[b];n.uniformMatrix4fv(h.u_matrix,!1,s.translate([],i,[_*w[0],_*w[1],0])),n.drawArrays(n.LINES,0,y.length)}n.uniform4f(h.u_color,0,0,0,1),n.uniformMatrix4fv(h.u_matrix,!1,i),n.drawArrays(n.LINES,0,y.length)}var o=t("../lib/debugtext"),a=t("../util/browser"),s=t("@mapbox/gl-matrix").mat4,u=t("../data/extent"),l=t("../data/buffer"),c=t("./vertex_array_object"),p=t("../data/pos_array");e.exports=n},{"../data/buffer":8,"../data/extent":11,"../data/pos_array":14,"../lib/debugtext":23,"../util/browser":108,"./vertex_array_object":39,"@mapbox/gl-matrix":131}],29:[function(t,e,r){"use strict";function n(t,e,r,n){var s=t.gl;s.enable(s.STENCIL_TEST);var u=!r.paint["fill-pattern"]&&r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"];t.isOpaquePass===u&&(t.setDepthSublayer(1),i(t,e,r,n,o)),!t.isOpaquePass&&r.paint["fill-antialias"]&&(t.lineWidth(2),t.depthMask(!1),t.setDepthSublayer(r.getPaintProperty("fill-outline-color")?2:0),i(t,e,r,n,a))}function i(t,e,r,n,i){for(var o=!0,a=0,s=n;a<s.length;a+=1){var u=s[a],l=e.getTile(u),c=l.getBucket(r);c&&(t.enableTileClippingMask(u),i(t,e,r,l,u,c.buffers,o),o=!1)}}function o(t,e,r,n,i,o,a){for(var u=t.gl,l=o.layerData[r.id],c=s("fill",r.paint["fill-pattern"],t,l,r,n,i,a),p=0,h=o.segments;p<h.length;p+=1){var f=h[p];f.vaos[r.id].bind(u,c,o.layoutVertexBuffer,o.elementBuffer,l.paintVertexBuffer,f.vertexOffset),u.drawElements(u.TRIANGLES,3*f.primitiveLength,u.UNSIGNED_SHORT,3*f.primitiveOffset*2)}}function a(t,e,r,n,i,o,a){var u=t.gl,l=o.layerData[r.id],c=r.paint["fill-pattern"]&&!r.getPaintProperty("fill-outline-color"),p=s("fillOutline",c,t,l,r,n,i,a);u.uniform2f(p.u_world,u.drawingBufferWidth,u.drawingBufferHeight);for(var h=0,f=o.segments2;h<f.length;h+=1){var d=f[h];d.vaos[r.id].bind(u,p,o.layoutVertexBuffer,o.elementBuffer2,l.paintVertexBuffer,d.vertexOffset),u.drawElements(u.LINES,2*d.primitiveLength,u.UNSIGNED_SHORT,2*d.primitiveOffset*2)}}function s(t,e,r,n,i,o,a,s){var l,c=r.currentProgram;return e?(l=r.useProgram(t+"Pattern",n.programConfiguration),(s||l!==c)&&(n.programConfiguration.setUniforms(r.gl,l,i,{zoom:r.transform.zoom}),u.prepare(i.paint["fill-pattern"],r,l)),u.setTile(o,r,l)):(l=r.useProgram(t,n.programConfiguration),(s||l!==c)&&n.programConfiguration.setUniforms(r.gl,l,i,{zoom:r.transform.zoom})),r.gl.uniformMatrix4fv(l.u_matrix,!1,r.translatePosMatrix(a.posMatrix,o,i.paint["fill-translate"],i.paint["fill-translate-anchor"])),l}var u=t("./pattern");e.exports=n},{"./pattern":37}],30:[function(t,e,r){"use strict";function n(t,e,r,n){if(0!==r.paint["fill-extrusion-opacity"]){var a=t.gl;a.disable(a.STENCIL_TEST),a.enable(a.DEPTH_TEST),t.depthMask(!0);var s=new i(a,t,r);s.bindFramebuffer(),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);for(var u=0;u<n.length;u++)o(t,e,r,n[u]);s.unbindFramebuffer(),s.renderToMap()}}function i(t,e,r){this.gl=t,this.width=e.width,this.height=e.height,this.painter=e,this.layer=r,this.texture=null,this.fbo=null,this.fbos=this.painter.preFbos[this.width]&&this.painter.preFbos[this.width][this.height]}function o(t,e,r,n){if(!t.isOpaquePass){var i=e.getTile(n),o=i.getBucket(r);if(o){var s=o.buffers,u=t.gl,l=r.paint["fill-extrusion-pattern"],c=s.layerData[r.id],h=c.programConfiguration,f=t.useProgram(l?"fillExtrusionPattern":"fillExtrusion",h);h.setUniforms(u,f,r,{zoom:t.transform.zoom}),l&&(p.prepare(l,t,f),p.setTile(i,t,f),u.uniform1f(f.u_height_factor,-Math.pow(2,n.z)/i.tileSize/8)),t.gl.uniformMatrix4fv(f.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint["fill-extrusion-translate"],r.paint["fill-extrusion-translate-anchor"])),a(f,t);for(var d=0,m=s.segments;d<m.length;d+=1){var y=m[d];y.vaos[r.id].bind(u,f,s.layoutVertexBuffer,s.elementBuffer,c.paintVertexBuffer,y.vertexOffset),u.drawElements(u.TRIANGLES,3*y.primitiveLength,u.UNSIGNED_SHORT,3*y.primitiveOffset*2)}}}}function a(t,e){var r=e.gl,n=e.style.light,i=n.calculated.position,o=[i.x,i.y,i.z],a=h.create();"viewport"===n.calculated.anchor&&h.fromRotation(a,-e.transform.angle),d.transformMat3(o,o,a),r.uniform3fv(t.u_lightpos,o),r.uniform1f(t.u_lightintensity,n.calculated.intensity),r.uniform3fv(t.u_lightcolor,n.calculated.color.slice(0,3))}var s=t("@mapbox/gl-matrix"),u=t("../data/buffer"),l=t("./vertex_array_object"),c=t("../data/pos_array"),p=t("./pattern"),h=s.mat3,f=s.mat4,d=s.vec3;e.exports=n,i.prototype.bindFramebuffer=function(){var t=this.gl;if(this.texture=this.painter.getViewportTexture(this.width,this.height),t.activeTexture(t.TEXTURE1),this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),this.texture.width=this.width,this.texture.height=this.height),this.fbos)this.fbo=this.fbos.pop(),t.bindFramebuffer(t.FRAMEBUFFER,this.fbo),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0);else{this.fbo=t.createFramebuffer();var e=t.createRenderbuffer(),r=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,e),t.bindRenderbuffer(t.RENDERBUFFER,r),t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,this.width,this.height),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,this.width,this.height),t.bindFramebuffer(t.FRAMEBUFFER,this.fbo),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,e),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}},i.prototype.unbindFramebuffer=function(){this.painter.bindDefaultFramebuffer(),this.fbos?this.fbos.push(this.fbo):(this.painter.preFbos[this.width]||(this.painter.preFbos[this.width]={}),this.painter.preFbos[this.width][this.height]=[this.fbo]),this.painter.saveViewportTexture(this.texture)},i.prototype.renderToMap=function(){var t=this.gl,e=this.painter,r=e.useProgram("extrusionTexture");t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this.texture),t.uniform1f(r.u_opacity,this.layer.paint["fill-extrusion-opacity"]),t.uniform1i(r.u_texture,1),t.uniformMatrix4fv(r.u_matrix,!1,f.ortho(f.create(),0,e.width,e.height,0,0,1)),t.disable(t.DEPTH_TEST),t.uniform1i(r.u_xdim,e.width),t.uniform1i(r.u_ydim,e.height);var n=new c;n.emplaceBack(0,0),n.emplaceBack(e.width,0),n.emplaceBack(0,e.height),n.emplaceBack(e.width,e.height);var i=u.fromStructArray(n,u.BufferType.VERTEX),o=new l;o.bind(t,r,i),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.enable(t.DEPTH_TEST)}},{"../data/buffer":8,"../data/pos_array":14,"./pattern":37,"./vertex_array_object":39,"@mapbox/gl-matrix":131}],31:[function(t,e,r){"use strict";function n(t,e,r,n,a,s,u,l,c){var p,h,f,d,m=e.gl,y=a.paint["line-dasharray"],v=a.paint["line-pattern"];if(l||c){var g=1/o(r,1,e.transform.tileZoom);if(y){p=e.lineAtlas.getDash(y.from,"round"===a.layout["line-cap"]),h=e.lineAtlas.getDash(y.to,"round"===a.layout["line-cap"]);var _=p.width*y.fromScale,x=h.width*y.toScale;m.uniform2f(t.u_patternscale_a,g/_,-p.height/2),m.uniform2f(t.u_patternscale_b,g/x,-h.height/2),m.uniform1f(t.u_sdfgamma,e.lineAtlas.width/(256*Math.min(_,x)*i.devicePixelRatio)/2)}else if(v){if(f=e.spriteAtlas.getPosition(v.from,!0),d=e.spriteAtlas.getPosition(v.to,!0),!f||!d)return;m.uniform2f(t.u_pattern_size_a,f.size[0]*v.fromScale/g,d.size[1]),m.uniform2f(t.u_pattern_size_b,d.size[0]*v.toScale/g,d.size[1])}m.uniform2f(t.u_gl_units_to_pixels,1/e.transform.pixelsToGLUnits[0],1/e.transform.pixelsToGLUnits[1])}l&&(y?(m.uniform1i(t.u_image,0),m.activeTexture(m.TEXTURE0),e.lineAtlas.bind(m),m.uniform1f(t.u_tex_y_a,p.y),m.uniform1f(t.u_tex_y_b,h.y),m.uniform1f(t.u_mix,y.t)):v&&(m.uniform1i(t.u_image,0),m.activeTexture(m.TEXTURE0),e.spriteAtlas.bind(m,!0),m.uniform2fv(t.u_pattern_tl_a,f.tl),m.uniform2fv(t.u_pattern_br_a,f.br),m.uniform2fv(t.u_pattern_tl_b,d.tl),m.uniform2fv(t.u_pattern_br_b,d.br),m.uniform1f(t.u_fade,v.t)),m.uniform1f(t.u_width,a.paint["line-width"])),e.enableTileClippingMask(s);var b=e.translatePosMatrix(s.posMatrix,r,a.paint["line-translate"],a.paint["line-translate-anchor"]);m.uniformMatrix4fv(t.u_matrix,!1,b),m.uniform1f(t.u_ratio,1/o(r,1,e.transform.zoom));for(var w=0,E=n.segments;w<E.length;w+=1){var T=E[w];T.vaos[a.id].bind(m,t,n.layoutVertexBuffer,n.elementBuffer,u.paintVertexBuffer,T.vertexOffset),m.drawElements(m.TRIANGLES,3*T.primitiveLength,m.UNSIGNED_SHORT,3*T.primitiveOffset*2)}}var i=t("../util/browser"),o=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,i){if(!t.isOpaquePass){t.setDepthSublayer(0),t.depthMask(!1);var o=t.gl;if(o.enable(o.STENCIL_TEST),!(r.paint["line-width"]<=0))for(var a,s=r.paint["line-dasharray"]?"lineSDF":r.paint["line-pattern"]?"linePattern":"line",u=!0,l=0,c=i;l<c.length;l+=1){var p=c[l],h=e.getTile(p),f=h.getBucket(r);if(f){var d=f.buffers.layerData[r.id],m=t.currentProgram,y=t.useProgram(s,d.programConfiguration),v=u||y!==m,g=a!==h.coord.z;v&&d.programConfiguration.setUniforms(t.gl,y,r,{zoom:t.transform.zoom}),n(y,t,h,f.buffers,r,p,d,v,g),a=h.coord.z,u=!1}}}}},{"../source/pixels_to_tile_units":45,"../util/browser":108}],32:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var o=t.gl;o.enable(o.DEPTH_TEST),t.depthMask(!0),o.depthFunc(o.LESS);for(var a=n.length&&n[0].z,s=0;s<n.length;s++){var u=n[s];t.setDepthSublayer(u.z-a),i(t,e,r,u)}o.depthFunc(o.LEQUAL)}}function i(t,e,r,n){var i=t.gl;i.disable(i.STENCIL_TEST);var l=e.getTile(n),c=t.transform.calculatePosMatrix(n,e.getSource().maxzoom);l.registerFadeDuration(t.style.animationLoop,r.paint["raster-fade-duration"]);var p=t.useProgram("raster");i.uniformMatrix4fv(p.u_matrix,!1,c),i.uniform1f(p.u_brightness_low,r.paint["raster-brightness-min"]),i.uniform1f(p.u_brightness_high,r.paint["raster-brightness-max"]),i.uniform1f(p.u_saturation_factor,s(r.paint["raster-saturation"])),i.uniform1f(p.u_contrast_factor,a(r.paint["raster-contrast"])),i.uniform3fv(p.u_spin_weights,o(r.paint["raster-hue-rotate"]));var h,f,d=l.sourceCache&&l.sourceCache.findLoadedParent(n,0,{}),m=u(l,d,r,t.transform);i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,l.texture),i.activeTexture(i.TEXTURE1),d?(i.bindTexture(i.TEXTURE_2D,d.texture),h=Math.pow(2,d.coord.z-l.coord.z),f=[l.coord.x*h%1,l.coord.y*h%1]):i.bindTexture(i.TEXTURE_2D,l.texture),i.uniform2fv(p.u_tl_parent,f||[0,0]),i.uniform1f(p.u_scale_parent,h||1),i.uniform1f(p.u_buffer_scale,1),i.uniform1f(p.u_opacity0,m[0]),i.uniform1f(p.u_opacity1,m[1]),i.uniform1i(p.u_image0,0),i.uniform1i(p.u_image1,1);var y=l.boundsBuffer||t.rasterBoundsBuffer,v=l.boundsVAO||t.rasterBoundsVAO;v.bind(i,p,y),i.drawArrays(i.TRIANGLE_STRIP,0,y.length)}function o(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}function a(t){return t>0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function u(t,e,r,n){var i=[1,0],o=r.paint["raster-fade-duration"];if(t.sourceCache&&o>0){var a=Date.now(),s=(a-t.timeAdded)/o,u=e?(a-e.timeAdded)/o:-1,c=t.sourceCache.getSource(),p=n.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!e||Math.abs(e.coord.z-p)>Math.abs(t.coord.z-p);i[0]=l.clamp(h?s:1-u,0,1),i[1]=e?1-i[0]:0}var f=r.paint["raster-opacity"];return i[0]*=f,i[1]*=f,i}var l=t("../util/util");e.exports=n},{"../util/util":127}],33:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var o=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),a=t.gl;o?a.disable(a.STENCIL_TEST):a.enable(a.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),i(t,e,r,n,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-rotation-alignment"],r.layout["icon-size"],r.paint["icon-halo-width"],r.paint["icon-halo-color"],r.paint["icon-halo-blur"],r.paint["icon-opacity"],r.paint["icon-color"]),i(t,e,r,n,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-size"],r.paint["text-halo-width"],r.paint["text-halo-color"],r.paint["text-halo-blur"],r.paint["text-opacity"],r.paint["text-color"]),e.map.showCollisionBoxes&&l(t,e,r,n)}}function i(t,e,r,n,i,s,u,l,c,p,h,f,d,m,y){if(i||!t.style.sprite||t.style.sprite.loaded()){var v=t.gl,g="map"===l,_="map"===c,x=_;x?v.enable(v.DEPTH_TEST):v.disable(v.DEPTH_TEST);for(var b,w=0,E=n;w<E.length;w+=1){var T=E[w],S=e.getTile(T),z=S.getBucket(r);if(z){var A=i?z.buffers.glyph:z.buffers.icon;if(A&&A.segments.length){var M=i||z.sdfIcons;b||(b=t.useProgram(M?"symbolSDF":"symbolIcon"),o(b,t,i,M,g,_,z.fontstack,p,z.iconsNeedLinear,i?z.adjustedTextSize:z.adjustedIconSize,m)),t.enableTileClippingMask(T),v.uniformMatrix4fv(b.u_matrix,!1,t.translatePosMatrix(T.posMatrix,S,s,u)),a(b,t,r,S,A,i,M,_,p,h,f,d,y)}}}x||v.enable(v.DEPTH_TEST)}}function o(t,e,r,n,i,o,a,s,l,c,p){var h=e.gl,f=e.transform;if(h.uniform1i(t.u_rotate_with_map,i),h.uniform1i(t.u_pitch_with_map,o),h.activeTexture(h.TEXTURE0),h.uniform1i(t.u_texture,0),r){var d=a&&e.glyphSource.getGlyphAtlas(a);if(!d)return;d.updateTexture(h),h.uniform2f(t.u_texsize,d.width/4,d.height/4)}else{var m=e.options.rotating||e.options.zooming,y=1!==s||u.devicePixelRatio!==e.spriteAtlas.pixelRatio||l,v=o||f.pitch;e.spriteAtlas.bind(h,n||m||y||v),h.uniform2f(t.u_texsize,e.spriteAtlas.width/4,e.spriteAtlas.height/4)}h.activeTexture(h.TEXTURE1),e.frameHistory.bind(h),h.uniform1i(t.u_fadetexture,1);var g=Math.log(s/c)/Math.LN2||0;h.uniform1f(t.u_zoom,10*(f.zoom-g)),h.uniform1f(t.u_pitch,f.pitch/360*2*Math.PI),h.uniform1f(t.u_bearing,f.bearing/360*2*Math.PI),h.uniform1f(t.u_aspect_ratio,f.width/f.height),h.uniform1f(t.u_opacity,p)}function a(t,e,r,n,i,o,a,u,l,m,y,v,g){var _=e.gl,x=e.transform,b=l/(o?24:1);if(u){var w=c(n,b,x.zoom);_.uniform2f(t.u_extrude_scale,w,w)}else{var E=x.cameraToCenterDistance*b;_.uniform2f(t.u_extrude_scale,x.pixelsToGLUnits[0]*E,x.pixelsToGLUnits[1]*E)}if(a){var T=b*(u?Math.cos(x._pitch):1)*x.cameraToCenterDistance;m&&(_.uniform1f(t.u_gamma,(v*h/p+d)/T),_.uniform4fv(t.u_color,y),_.uniform1f(t.u_buffer,(f-m/b)/p),s(i,r,_,t)),_.uniform1f(t.u_gamma,d/T),_.uniform4fv(t.u_color,g),_.uniform1f(t.u_buffer,.75)}s(i,r,_,t)}function s(t,e,r,n){for(var i=0,o=t.segments;i<o.length;i+=1){var a=o[i];a.vaos[e.id].bind(r,n,t.layoutVertexBuffer,t.elementBuffer,null,a.vertexOffset),r.drawElements(r.TRIANGLES,3*a.primitiveLength,r.UNSIGNED_SHORT,3*a.primitiveOffset*2)}}var u=t("../util/browser"),l=t("./draw_collision_debug"),c=t("../source/pixels_to_tile_units");e.exports=n;var p=8,h=1.19,f=6,d=.105/u.devicePixelRatio},{"../source/pixels_to_tile_units":45,"../util/browser":108,"./draw_collision_debug":27}],34:[function(t,e,r){"use strict";var n=function(){this.changeTimes=new Float64Array(256),this.changeOpacities=new Uint8Array(256),this.opacities=new Uint8ClampedArray(256),this.array=new Uint8Array(this.opacities.buffer),this.previousZoom=0,this.firstFrame=!0};n.prototype.record=function(t,e,r){var n=this;this.firstFrame&&(t=0,this.firstFrame=!1),e=Math.floor(10*e);var i;if(e<this.previousZoom)for(i=e+1;i<=this.previousZoom;i++)n.changeTimes[i]=t,n.changeOpacities[i]=n.opacities[i];else for(i=e;i>this.previousZoom;i--)n.changeTimes[i]=t,n.changeOpacities[i]=n.opacities[i];for(i=0;i<256;i++){var o=t-n.changeTimes[i],a=255*(r?o/r:1);i<=e?n.opacities[i]=n.changeOpacities[i]+a:n.opacities[i]=n.changeOpacities[i]-a}this.changed=!0,this.previousZoom=e},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))},e.exports=n},{}],35:[function(t,e,r){"use strict";var n=t("../util/util"),i=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};i.prototype.setSprite=function(t){this.sprite=t},i.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},i.prototype.addDash=function(t,e){var r=this,i=e?7:0,o=2*i+1,a=128;if(this.nextRow+o>this.height)return n.warnOnce("LineAtlas out of space"),null;for(var s=0,u=0;u<t.length;u++)s+=t[u];for(var l=this.width/s,c=l/2,p=t.length%2===1,h=-i;h<=i;h++)for(var f=r.nextRow+i+h,d=r.width*f,m=p?-t[t.length-1]:0,y=t[0],v=1,g=0;g<this.width;g++){for(;y<g/l;)m=y,y+=t[v],p&&v===t.length-1&&(y+=t[0]),v++;var _,x=Math.abs(g-m*l),b=Math.abs(g-y*l),w=Math.min(x,b),E=v%2===1;if(e){var T=i?h/i*(c+1):0;if(E){var S=c-Math.abs(T);_=Math.sqrt(w*w+S*S)}else _=c-Math.sqrt(w*w+T*T)}else _=(E?1:-1)*w;r.data[3+4*(d+g)]=Math.max(0,Math.min(255,_+a))}var z={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:s};return this.nextRow+=o,this.dirty=!0,z},i.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))},e.exports=i},{"../util/util":127}],36:[function(t,e,r){"use strict";var n=t("../util/browser"),i=t("@mapbox/gl-matrix").mat4,o=t("./frame_history"),a=t("../source/source_cache"),s=t("../data/extent"),u=t("../source/pixels_to_tile_units"),l=t("../util/util"),c=t("../data/buffer"),p=t("./vertex_array_object"),h=t("../data/raster_bounds_array"),f=t("../data/pos_array"),d=t("../data/program_configuration"),m=t("./shaders"),y={symbol:t("./draw_symbol"),circle:t("./draw_circle"),line:t("./draw_line"),fill:t("./draw_fill"),"fill-extrusion":t("./draw_fill_extrusion"),raster:t("./draw_raster"),background:t("./draw_background"),debug:t("./draw_debug")},v=function(t,e){this.gl=t,this.transform=e,this.reusableTextures={},this.preFbos={},this.frameHistory=new o,this.setup(),this.numSublayers=a.maxUnderzooming+a.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.lineWidthRange=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE),this.basicFillProgramConfiguration=d.createStatic(["color","opacity"]),this.emptyProgramConfiguration=new d};v.prototype.resize=function(t,e){var r=this.gl;this.width=t*n.devicePixelRatio,this.height=e*n.devicePixelRatio,r.viewport(0,0,this.width,this.height)},v.prototype.setup=function(){var t=this.gl;t.verbose=!0,t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.enable(t.STENCIL_TEST),t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),this._depthMask=!1,t.depthMask(!1);var e=new f;e.emplaceBack(0,0),e.emplaceBack(s,0),e.emplaceBack(0,s),e.emplaceBack(s,s),this.tileExtentBuffer=c.fromStructArray(e,c.BufferType.VERTEX),this.tileExtentVAO=new p,this.tileExtentPatternVAO=new p;var r=new f;r.emplaceBack(0,0),r.emplaceBack(s,0),r.emplaceBack(s,s),r.emplaceBack(0,s),r.emplaceBack(0,0),this.debugBuffer=c.fromStructArray(r,c.BufferType.VERTEX),this.debugVAO=new p;var n=new h;n.emplaceBack(0,0,0,0),n.emplaceBack(s,0,32767,0),n.emplaceBack(0,s,0,32767),n.emplaceBack(s,s,32767,32767),this.rasterBoundsBuffer=c.fromStructArray(n,c.BufferType.VERTEX),this.rasterBoundsVAO=new p},v.prototype.clearColor=function(){var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},v.prototype.clearStencil=function(){var t=this.gl;t.clearStencil(0),t.stencilMask(255),t.clear(t.STENCIL_BUFFER_BIT)},v.prototype.clearDepth=function(){var t=this.gl;t.clearDepth(1),this.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},v.prototype._renderTileClippingMasks=function(t){var e=this,r=this.gl;r.colorMask(!1,!1,!1,!1),this.depthMask(!1),r.disable(r.DEPTH_TEST),r.enable(r.STENCIL_TEST),r.stencilMask(248),r.stencilOp(r.KEEP,r.KEEP,r.REPLACE);var n=1;this._tileClippingMaskIDs={};for(var i=0,o=t;i<o.length;i+=1){var a=o[i],s=e._tileClippingMaskIDs[a.id]=n++<<3;r.stencilFunc(r.ALWAYS,s,248);var u=e.useProgram("fill",e.basicFillProgramConfiguration);r.uniformMatrix4fv(u.u_matrix,!1,a.posMatrix),e.tileExtentVAO.bind(r,u,e.tileExtentBuffer),r.drawArrays(r.TRIANGLE_STRIP,0,e.tileExtentBuffer.length)}r.stencilMask(0),r.colorMask(!0,!0,!0,!0),this.depthMask(!0),r.enable(r.DEPTH_TEST)},v.prototype.enableTileClippingMask=function(t){var e=this.gl;e.stencilFunc(e.EQUAL,this._tileClippingMaskIDs[t.id],248)},v.prototype.prepareBuffers=function(){},v.prototype.bindDefaultFramebuffer=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)},v.prototype.render=function(t,e){if(this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.spriteAtlas=t.spriteAtlas,this.spriteAtlas.setSprite(t.sprite),this.glyphSource=t.glyphSource,this.frameHistory.record(Date.now(),this.transform.zoom,t.getTransition().duration),this.prepareBuffers(),this.clearColor(),this.clearDepth(),this.showOverdrawInspector(e.showOverdrawInspector),this.depthRange=(t._order.length+2)*this.numSublayers*this.depthEpsilon,this.isOpaquePass=!0,this.renderPass(),this.isOpaquePass=!1,this.renderPass(),this.options.showTileBoundaries){var r=this.style.sourceCaches[Object.keys(this.style.sourceCaches)[0]];y.debug(this,r,r.getVisibleCoordinates())}},v.prototype.renderPass=function(){var t,e,r=this,n=this.style._order;this.currentLayer=this.isOpaquePass?n.length-1:0;for(var i=0;i<n.length;i++){var o=r.style._layers[n[r.currentLayer]];o.source!==(t&&t.id)&&(t=r.style.sourceCaches[o.source],e=[],t&&(t.prepare&&t.prepare(),r.clearStencil(),e=t.getVisibleCoordinates(),t.getSource().isTileClipped&&r._renderTileClippingMasks(e)),r.isOpaquePass?r._showOverdrawInspector||r.gl.disable(r.gl.BLEND):(r.gl.enable(r.gl.BLEND),e.reverse())),r.renderLayer(r,t,o,e),r.currentLayer+=r.isOpaquePass?-1:1}},v.prototype.depthMask=function(t){t!==this._depthMask&&(this._depthMask=t,this.gl.depthMask(t))},v.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||n.length)&&(this.id=r.id,y[r.type](t,e,r,n))},v.prototype.setDepthSublayer=function(t){var e=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,r=e-1+this.depthRange;
this.gl.depthRange(r,e)},v.prototype.translatePosMatrix=function(t,e,r,n){if(!r[0]&&!r[1])return t;if("viewport"===n){var o=Math.sin(-this.transform.angle),a=Math.cos(-this.transform.angle);r=[r[0]*a-r[1]*o,r[0]*o+r[1]*a]}var s=[u(e,r[0],this.transform.zoom),u(e,r[1],this.transform.zoom),0],l=new Float32Array(16);return i.translate(l,t,s),l},v.prototype.saveTileTexture=function(t){var e=this.reusableTextures[t.size];e?e.push(t):this.reusableTextures[t.size]=[t]},v.prototype.saveViewportTexture=function(t){this.reusableTextures.viewport||(this.reusableTextures.viewport={}),this.reusableTextures.viewport.texture=t},v.prototype.getTileTexture=function(t,e){var r=this.reusableTextures[t];if(r){var n=r[e||t];return n&&n.length>0?n.pop():null}},v.prototype.getViewportTexture=function(t,e){if(this.reusableTextures.viewport){var r=this.reusableTextures.viewport.texture;return r.width===t&&r.height===e?r:(this.gl.deleteTexture(r),void(this.reusableTextures.viewport.texture=null))}},v.prototype.lineWidth=function(t){this.gl.lineWidth(l.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},v.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);var r=8,n=1/r;e.blendColor(n,n,n,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}},v.prototype.createProgram=function(t,e){var r=this.gl,i=r.createProgram(),o=m[t],a="#define MAPBOX_GL_JS\n#define DEVICE_PIXEL_RATIO "+n.devicePixelRatio.toFixed(1)+"\n";this._showOverdrawInspector&&(a+="#define OVERDRAW_INSPECTOR;\n");var s=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(s,e.applyPragmas(a+m.prelude.fragmentSource+o.fragmentSource,"fragment")),r.compileShader(s),r.attachShader(i,s);var u=r.createShader(r.VERTEX_SHADER);r.shaderSource(u,e.applyPragmas(a+m.prelude.vertexSource+o.vertexSource,"vertex")),r.compileShader(u),r.attachShader(i,u),r.linkProgram(i);for(var l=r.getProgramParameter(i,r.ACTIVE_ATTRIBUTES),c={program:i,numAttributes:l},p=0;p<l;p++){var h=r.getActiveAttrib(i,p);c[h.name]=r.getAttribLocation(i,h.name)}for(var f=r.getProgramParameter(i,r.ACTIVE_UNIFORMS),d=0;d<f;d++){var y=r.getActiveUniform(i,d);c[y.name]=r.getUniformLocation(i,y.name)}return c},v.prototype._createProgramCached=function(t,e){this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=this.createProgram(t,e)),this.cache[r]},v.prototype.useProgram=function(t,e){var r=this.gl,n=this._createProgramCached(t,e||this.emptyProgramConfiguration);return this.currentProgram!==n&&(r.useProgram(n.program),this.currentProgram=n),n},e.exports=v},{"../data/buffer":8,"../data/extent":11,"../data/pos_array":14,"../data/program_configuration":15,"../data/raster_bounds_array":16,"../source/pixels_to_tile_units":45,"../source/source_cache":49,"../util/browser":108,"../util/util":127,"./draw_background":25,"./draw_circle":26,"./draw_debug":28,"./draw_fill":29,"./draw_fill_extrusion":30,"./draw_line":31,"./draw_raster":32,"./draw_symbol":33,"./frame_history":34,"./shaders":38,"./vertex_array_object":39,"@mapbox/gl-matrix":131}],37:[function(t,e,r){"use strict";var n=t("../source/pixels_to_tile_units");r.prepare=function(t,e,r){var n=e.gl,i=e.spriteAtlas.getPosition(t.from,!0),o=e.spriteAtlas.getPosition(t.to,!0);i&&o&&(n.uniform1i(r.u_image,0),n.uniform2fv(r.u_pattern_tl_a,i.tl),n.uniform2fv(r.u_pattern_br_a,i.br),n.uniform2fv(r.u_pattern_tl_b,o.tl),n.uniform2fv(r.u_pattern_br_b,o.br),n.uniform1f(r.u_mix,t.t),n.uniform2fv(r.u_pattern_size_a,i.size),n.uniform2fv(r.u_pattern_size_b,o.size),n.uniform1f(r.u_scale_a,t.fromScale),n.uniform1f(r.u_scale_b,t.toScale),n.activeTexture(n.TEXTURE0),e.spriteAtlas.bind(n,!0))},r.setTile=function(t,e,r){var i=e.gl;i.uniform1f(r.u_tile_units_to_pixels,1/n(t,1,e.transform.tileZoom));var o=Math.pow(2,t.coord.z),a=t.tileSize*Math.pow(2,e.transform.tileZoom)/o,s=a*(t.coord.x+t.coord.w*o),u=a*t.coord.y;i.uniform2f(r.u_pixel_coord_upper,s>>16,u>>16),i.uniform2f(r.u_pixel_coord_lower,65535&s,65535&u)}},{"../source/pixels_to_tile_units":45}],38:[function(t,e,r){"use strict";t("path");e.exports={prelude:{fragmentSource:"#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\n",vertexSource:"#ifdef GL_ES\nprecision highp 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\n\nfloat evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n\n// The offset depends on how many pixels are between the world origin and the edge of the tile:\n// vec2 offset = mod(pixel_coord, size)\n//\n// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.\n// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.\n//\n// The pixel_coord is passed in as two 16 bit values:\n// pixel_coord_upper = floor(pixel_coord / 2^16)\n// pixel_coord_lower = mod(pixel_coord, 2^16)\n//\n// The offset is calculated in a series of steps that should preserve this precision:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},circle:{fragmentSource:"#pragma mapbox: define lowp 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 lowp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main() {\n #pragma mapbox: initialize lowp 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 lowp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n float extrude_length = length(v_extrude);\n float antialiased_blur = -max(blur, v_antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform vec2 u_extrude_scale;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define lowp 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 lowp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main(void) {\n #pragma mapbox: initialize lowp 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 lowp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n vec2 extrude = v_extrude * (radius + stroke_width) * u_extrude_scale;\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude;\n } else {\n gl_Position.xy += extrude * gl_Position.w;\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n v_antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n}\n"},collisionBox:{fragmentSource:"uniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"},debug:{fragmentSource:"uniform lowp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize lowp vec4 color\n\n gl_FragColor = v_color;\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\nuniform lowp vec4 u_outline_color;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define lowp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize lowp vec4 color\n\n float ed = a_edgedistance; // use each attrib in order to not trip a VAO assert\n float t = mod(a_normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n#ifdef OUTLINE\n color = u_outline_color;\n#endif\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(a_normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n float t = mod(a_normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = a_normal.x == 1.0 && a_normal.y == 0.0 && a_normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(a_edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(a_normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_texture;\nuniform float u_opacity;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_texture, v_pos) * u_opacity;\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform int u_xdim;\nuniform int u_ydim;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos.x = a_pos.x / float(u_xdim);\n v_pos.y = 1.0 - a_pos.y / float(u_ydim);\n}\n"},line:{fragmentSource:"#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\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\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\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",
vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\nuniform mediump float u_width;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset;\n \n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},symbolSDF:{fragmentSource:"uniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = gl_Position.w;\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"}}},{path:191}],39:[function(t,e,r){"use strict";var n=function(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.boundVertexOffset=null,this.vao=null};n.prototype.bind=function(t,e,r,n,i,o){void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension("OES_vertex_array_object"));var a=!this.vao||this.boundProgram!==e||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==i||this.boundElementBuffer!==n||this.boundVertexOffset!==o;!t.extVertexArrayObject||a?(this.freshBind(t,e,r,n,i,o),this.gl=t):t.extVertexArrayObject.bindVertexArrayOES(this.vao)},n.prototype.freshBind=function(t,e,r,n,i,o){var a,s=e.numAttributes;if(t.extVertexArrayObject)this.vao&&this.destroy(),this.vao=t.extVertexArrayObject.createVertexArrayOES(),t.extVertexArrayObject.bindVertexArrayOES(this.vao),a=0,this.boundProgram=e,this.boundVertexBuffer=r,this.boundVertexBuffer2=i,this.boundElementBuffer=n,this.boundVertexOffset=o;else{a=t.currentNumAttributes||0;for(var u=s;u<a;u++)t.disableVertexAttribArray(u)}for(var l=a;l<s;l++)t.enableVertexAttribArray(l);r.bind(t),r.setVertexAttribPointers(t,e,o),i&&(i.bind(t),i.setVertexAttribPointers(t,e,o)),n&&n.bind(t),t.currentNumAttributes=s},n.prototype.destroy=function(){this.vao&&(this.gl.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)},e.exports=n},{}],40:[function(t,e,r){"use strict";function n(t){var e=a.document.createElement("a");return e.href=t,e.href}var i=t("../util/evented"),o=t("../util/util"),a=t("../util/window"),s=t("../data/extent"),u=function(t){function e(e,r,n,i){var a=this;t.call(this),r=r||{},this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this.dispatcher=n,this._data=r.data,void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type);var u=s/this.tileSize;this.workerOptions=o.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*u,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*u,extent:s,maxZoom:this.maxzoom},superclusterOptions:{maxZoom:Math.min(r.clusterMaxZoom,this.maxzoom-1)||this.maxzoom-1,extent:s,radius:(r.clusterRadius||50)*u,log:!1}},r.workerOptions),this.setEventedParent(i),this.fire("dataloading",{dataType:"source"}),this._updateWorkerData(function(t){return t?void a.fire("error",{error:t}):(a.fire("data",{dataType:"source"}),void a.fire("source.load"))})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){this.map=t},e.prototype.setData=function(t){var e=this;return this._data=t,this.fire("dataloading",{dataType:"source"}),this._updateWorkerData(function(t){return t?e.fire("error",{error:t}):void e.fire("data",{dataType:"source"})}),this},e.prototype._updateWorkerData=function(t){var e=this,r=o.extend({},this.workerOptions),i=this._data;"string"==typeof i?r.url=n(i):r.data=JSON.stringify(i),this.workerID=this.dispatcher.send(this.type+".loadData",r,function(r){e._loaded=!0,t(r)})},e.prototype.loadTile=function(t,e){var r=this,n=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("loadTile",i,function(n,i){if(t.unloadVectorData(),!t.aborted)return n?e(n):(t.loadVectorData(i,r.map.painter),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(r)),e(null))},this.workerID)},e.prototype.abortTile=function(t){t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},function(){},t.workerID)},e.prototype.onRemove=function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id},function(){})},e.prototype.serialize=function(){return{type:this.type,data:this._data}},e}(i);e.exports=u},{"../data/extent":11,"../util/evented":116,"../util/util":127,"../util/window":110}],41:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("geojson-rewind"),o=t("./geojson_wrapper"),a=t("vt-pbf"),s=t("supercluster"),u=t("geojson-vt"),l=t("./vector_tile_worker_source"),c=function(t){function e(e,r,n){t.call(this,e,r),n&&(this.loadGeoJSON=n),this._geoJSONIndexes={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.loadVectorData=function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var s=new o(i.features);s.name="_geojsonTileLayer";var u=a({layers:{_geojsonTileLayer:s}});0===u.byteOffset&&u.byteLength===u.buffer.byteLength||(u=new Uint8Array(u)),s.rawData=u.buffer,e(null,s)},e.prototype.loadData=function(t,e){var r=function(r,n){var o=this;return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(i(n,!0),void this._indexData(n,t,function(r,n){return r?e(r):(o._geoJSONIndexes[t.source]=n,void e(null))}))}.bind(this);this.loadGeoJSON(t,r)},e.prototype.loadGeoJSON=function(t,e){if(t.url)n.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},e.prototype.removeSource=function(t){this._geoJSONIndexes[t.source]&&delete this._geoJSONIndexes[t.source]},e.prototype._indexData=function(t,e,r){try{e.cluster?r(null,s(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}},e}(l);e.exports=c},{"../util/ajax":107,"./geojson_wrapper":42,"./vector_tile_worker_source":53,"geojson-rewind":137,"geojson-vt":141,supercluster:198,"vt-pbf":208}],42:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("vector-tile").VectorTileFeature,o=t("../data/extent"),a=function(t){var e=this;if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var r=0;r<t.geometry.length;r++)e.rawGeometry.push([t.geometry[r]])}else this.rawGeometry=t.geometry;this.properties=t.tags,this.extent=o};a.prototype.loadGeometry=function(){var t=this,e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var i=e[r],o=[],a=0;a<i.length;a++)o.push(new n(i[a][0],i[a][1]));t.geometry.push(o)}return this.geometry},a.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-(1/0),n=1/0,i=-(1/0),o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),r=Math.max(r,u.x),n=Math.min(n,u.y),i=Math.max(i,u.y)}return[e,n,r,i]},a.prototype.toGeoJSON=function(){i.prototype.toGeoJSON.call(this)};var s=function(t){this.features=t,this.length=t.length,this.extent=o};s.prototype.feature=function(t){return new a(this.features[t])},e.exports=s},{"../data/extent":11,"point-geometry":194,"vector-tile":204}],43:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/window"),o=t("./tile_coord"),a=t("../geo/lng_lat"),s=t("point-geometry"),u=t("../util/evented"),l=t("../util/ajax"),c=t("../data/extent"),p=t("../data/raster_bounds_array"),h=t("../data/buffer"),f=t("../render/vertex_array_object"),d=function(t){function e(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.coordinates=r.coordinates,this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.setEventedParent(i),this.fire("dataloading",{dataType:"source"}),this._load(r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._load=function(t){var e=this;this.url=t.url,l.getImage(t.url,function(t,r){return t?e.fire("error",{error:t}):(e.image=r,void e._finishLoading())})},e.prototype._finishLoading=function(){this.fire("source.load"),this.map&&this.setCoordinates(this.coordinates)},e.prototype.onAdd=function(t){this.map=t,this.image&&this.setCoordinates(this.coordinates)},e.prototype.setCoordinates=function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(a.convert(t)).zoomTo(0)}),i=this.centerCoord=n.getCoordinatesCenter(r);return i.column=Math.round(i.column),i.row=Math.round(i.row),this.minzoom=this.maxzoom=i.zoom,this.coord=new o(i.zoom,i.column,i.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(i.zoom);return new s(Math.round((e.column-i.column)*c),Math.round((e.row-i.row)*c))}),this.fire("data",{dataType:"source"}),this},e.prototype._setTile=function(t){this.tile=t;var e=32767,r=new p;r.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),r.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,e,0),r.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,e),r.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,e,e),this.tile.buckets={},this.tile.boundsBuffer=h.fromStructArray(r,h.BufferType.VERTEX),this.tile.boundsVAO=new f},e.prototype.prepare=function(){this.tile&&this.image&&this._prepareImage(this.map.painter.gl,this.image)},e.prototype._prepareImage=function(t,e){"loaded"!==this.tile.state?(this.tile.state="loaded",this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e)):e instanceof i.HTMLVideoElement&&(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,e))},e.prototype.loadTile=function(t,e){this.coord&&this.coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},e.prototype.serialize=function(){return{type:"image",urls:this.url,coordinates:this.coordinates}},e}(u);e.exports=d},{"../data/buffer":8,"../data/extent":11,"../data/raster_bounds_array":16,"../geo/lng_lat":19,"../render/vertex_array_object":39,"../util/ajax":107,"../util/evented":116,"../util/util":127,"../util/window":110,"./tile_coord":51,"point-geometry":194}],44:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/ajax"),o=t("../util/browser"),a=t("../util/mapbox").normalizeSourceURL;e.exports=function(t,e){var r=function(t,r){if(t)return e(t);var i=n.pick(r,["tiles","minzoom","maxzoom","attribution"]);r.vector_layers&&(i.vectorLayers=r.vector_layers,i.vectorLayerIds=i.vectorLayers.map(function(t){return t.id})),e(null,i)};t.url?i.getJSON(a(t.url),r):o.frame(r.bind(null,null,t))}},{"../util/ajax":107,"../util/browser":108,"../util/mapbox":123,"../util/util":127}],45:[function(t,e,r){"use strict";var n=t("../data/extent");e.exports=function(t,e,r){return e*(n/(t.tileSize*Math.pow(2,r-t.coord.z)))}},{"../data/extent":11}],46:[function(t,e,r){"use strict";function n(t,e){var r=t.coord,n=e.coord;return r.z-n.z||r.y-n.y||r.w-n.w||r.x-n.x}function i(t){for(var e=t[0]||{},r=1;r<t.length;r++){var n=t[r];for(var i in n){var o=n[i],a=e[i];if(void 0===a)a=e[i]=o;else for(var s=0;s<o.length;s++)a.push(o[s])}}return e}var o=t("./tile_coord");r.rendered=function(t,e,r,o,a,s){var u=t.tilesIn(r);u.sort(n);for(var l=[],c=0;c<u.length;c++){var p=u[c];p.tile.featureIndex&&l.push(p.tile.featureIndex.query({queryGeometry:p.queryGeometry,scale:p.scale,tileSize:p.tile.tileSize,bearing:s,params:o},e))}return i(l)},r.source=function(t,e){for(var r=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),n=[],i={},a=0;a<r.length;a++){var s=r[a],u=new o(Math.min(s.sourceMaxZoom,s.coord.z),s.coord.x,s.coord.y,0).id;i[u]||(i[u]=!0,s.querySourceFeatures(n,e))}return n}},{"./tile_coord":51}],47:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/ajax"),o=t("../util/evented"),a=t("./load_tilejson"),s=t("../util/mapbox").normalizeTileURL,u=function(t){function e(e,r,i,o){var s=this;t.call(this),this.id=e,this.dispatcher=i,this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,n.extend(this,n.pick(r,["url","scheme","tileSize"])),this.setEventedParent(o),this.fire("dataloading",{dataType:"source"}),a(r,function(t,e){return t?s.fire("error",t):(n.extend(s,e),s.fire("data",{dataType:"source"}),void s.fire("source.load"))})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){this.map=t},e.prototype.serialize=function(){return{type:"raster",url:this.url,tileSize:this.tileSize,tiles:this.tiles}},e.prototype.loadTile=function(t,e){function r(r,n){if(delete t.request,t.aborted)return this.state="unloaded",e(null);if(r)return this.state="errored",e(r);var i=this.map.painter.gl;t.texture=this.map.painter.getTileTexture(n.width),t.texture?(i.bindTexture(i.TEXTURE_2D,t.texture),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,n)):(t.texture=i.createTexture(),i.bindTexture(i.TEXTURE_2D,t.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),t.texture.size=n.width),i.generateMipmap(i.TEXTURE_2D),t.state="loaded",e(null)}var n=s(t.coord.url(this.tiles,null,this.scheme),this.url,this.tileSize);t.request=i.getImage(n,r.bind(this))},e.prototype.abortTile=function(t){t.request&&(t.request.abort(),delete t.request)},e.prototype.unloadTile=function(t){t.texture&&this.map.painter.saveTileTexture(t.texture)},e}(o);e.exports=u},{"../util/ajax":107,"../util/evented":116,"../util/mapbox":123,"../util/util":127,"./load_tilejson":44}],48:[function(t,e,r){"use strict";var n=t("../util/util"),i={vector:t("../source/vector_tile_source"),raster:t("../source/raster_tile_source"),geojson:t("../source/geojson_source"),video:t("../source/video_source"),image:t("../source/image_source")};r.create=function(t,e,r,o){if(e=new i[e.type](t,e,r,o),e.setEventedParent(o),e.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+e.id);return n.bindAll(["load","abort","unload","serialize","prepare"],e),e},r.getType=function(t){return i[t]},r.setType=function(t,e){i[t]=e}},{"../source/geojson_source":40,"../source/image_source":43,"../source/raster_tile_source":47,"../source/vector_tile_source":52,"../source/video_source":54,"../util/util":127}],49:[function(t,e,r){"use strict";function n(t,e,r){var n=r.zoomTo(Math.min(t.z,e));return{x:(n.column-(t.x+t.w*Math.pow(2,t.z)))*h,y:(n.row-t.y)*h}}function i(t,e){return t%32-e%32}var o=t("./source"),a=t("./tile"),s=t("../util/evented"),u=t("./tile_coord"),l=t("../util/lru_cache"),c=t("../geo/coordinate"),p=t("../util/util"),h=t("../data/extent"),f=function(t){function e(e,r,n){t.call(this),this.id=e,this.dispatcher=n,this._source=o.create(e,r,n,this),this.on("source.load",function(){this.map&&this._source.onAdd&&this._source.onAdd(this.map),this._sourceLoaded=!0}),this.on("error",function(){this._sourceErrored=!0}),this.on("data",function(t){this._sourceLoaded&&"source"===t.dataType&&(this.reload(),this.transform&&this.update(this.transform))}),this._tiles={},this._cache=new l(0,this.unloadTile.bind(this)),this._isIdRenderable=this._isIdRenderable.bind(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){this.map=t,this._source&&this._source.onAdd&&this._source.onAdd(t)},e.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},e.prototype.loaded=function(){var t=this;if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var e in this._tiles){var r=t._tiles[e];if("loaded"!==r.state&&"errored"!==r.state)return!1}return!0},e.prototype.getSource=function(){return this._source},e.prototype.loadTile=function(t,e){return this._source.loadTile(t,e)},e.prototype.unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t)},e.prototype.abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t)},e.prototype.serialize=function(){return this._source.serialize()},e.prototype.prepare=function(){if(this._sourceLoaded&&this._source.prepare)return this._source.prepare()},e.prototype.getIds=function(){return Object.keys(this._tiles).map(Number).sort(i)},e.prototype.getRenderableIds=function(){return this.getIds().filter(this._isIdRenderable)},e.prototype._isIdRenderable=function(t){return this._tiles[t].hasData()&&!this._coveredTiles[t]},e.prototype.reload=function(){var t=this;this._cache.reset();for(var e in this._tiles){var r=t._tiles[e];"loading"!==r.state&&(r.state="reloading"),t.loadTile(t._tiles[e],t._tileLoaded.bind(t,t._tiles[e]))}},e.prototype._tileLoaded=function(t,e){return e?(t.state="errored",void this._source.fire("error",{tile:t,error:e})):(t.sourceCache=this,t.timeAdded=(new Date).getTime(),this._source.fire("data",{tile:t,coord:t.coord,dataType:"tile"}),void(this.map&&(this.map.painter.tileExtentVAO.vao=null)))},e.prototype.getTile=function(t){return this.getTileByID(t.id)},e.prototype.getTileByID=function(t){return this._tiles[t]},e.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},e.prototype.findLoadedChildren=function(t,e,r){var n=this,i=!1;for(var o in this._tiles){var a=n._tiles[o];if(!(r[o]||!a.hasData()||a.coord.z<=t.z||a.coord.z>e)){var s=Math.pow(2,Math.min(a.coord.z,n._source.maxzoom)-Math.min(t.z,n._source.maxzoom));if(Math.floor(a.coord.x/s)===t.x&&Math.floor(a.coord.y/s)===t.y)for(r[o]=!0,i=!0;a&&a.coord.z-1>t.z;){var u=a.coord.parent(n._source.maxzoom).id;a=n._tiles[u],a&&a.hasData()&&(delete r[o],r[u]=!0)}}}return i},e.prototype.findLoadedParent=function(t,e,r){for(var n=this,i=t.z-1;i>=e;i--){t=t.parent(n._source.maxzoom);var o=n._tiles[t.id];if(o&&o.hasData())return r[t.id]=!0,o;if(n._cache.has(t.id))return n.addTile(t),r[t.id]=!0,n._tiles[t.id]}},e.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r,i=5;this._cache.setMaxSize(Math.floor(n*i))},e.prototype.update=function(t){var r=this;if(this._sourceLoaded){var n,i,o;this.updateCacheSize(t);var a=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(a-e.maxOverzooming,this._source.minzoom),l=Math.max(a+e.maxUnderzooming,this._source.minzoom),c={};this._coveredTiles={};var h;for(h=this.used?this._source.coord?[this._source.coord]:t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}):[],n=0;n<h.length;n++)i=h[n],o=r.addTile(i),c[i.id]=!0,o.hasData()||r.findLoadedChildren(i,l,c)||r.findLoadedParent(i,s,c);for(var f={},d=Object.keys(c),m=0;m<d.length;m++){var y=d[m];i=u.fromID(y),o=r._tiles[y],o&&o.fadeEndTime>=Date.now()&&(r.findLoadedChildren(i,l,c)&&(c[y]=!0),r.findLoadedParent(i,s,f))}var v;for(v in f)c[v]||(r._coveredTiles[v]=!0);for(v in f)c[v]=!0;var g=p.keysDifference(this._tiles,c);for(n=0;n<g.length;n++)r.removeTile(+g[n]);this.transform=t}},e.prototype.addTile=function(t){var e=this._tiles[t.id];if(e)return e;var r=t.wrapped();if(e=this._tiles[r.id],e||(e=this._cache.get(r.id),e&&e.redoPlacement(this._source)),!e){var n=t.z,i=n>this._source.maxzoom?Math.pow(2,n-this._source.maxzoom):1;e=new a(r,this._source.tileSize*i,this._source.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this._source.fire("dataloading",{tile:e,coord:e.coord,dataType:"tile"}),e},e.prototype.removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._source.fire("data",{tile:e,coord:e.coord,dataType:"tile"}),e.uses>0||(e.hasData()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},e.prototype.clearTiles=function(){var t=this;for(var e in this._tiles)t.removeTile(e);this._cache.reset()},e.prototype.tilesIn=function(t){for(var e=this,r={},i=this.getIds(),o=1/0,a=1/0,s=-(1/0),l=-(1/0),p=t[0].zoom,f=0;f<t.length;f++){var d=t[f];o=Math.min(o,d.column),a=Math.min(a,d.row),s=Math.max(s,d.column),l=Math.max(l,d.row)}for(var m=0;m<i.length;m++){var y=e._tiles[i[m]],v=u.fromID(i[m]),g=[n(v,y.sourceMaxZoom,new c(o,a,p)),n(v,y.sourceMaxZoom,new c(s,l,p))];if(g[0].x<h&&g[0].y<h&&g[1].x>=0&&g[1].y>=0){for(var _=[],x=0;x<t.length;x++)_.push(n(v,y.sourceMaxZoom,t[x]));var b=r[y.coord.id];void 0===b&&(b=r[y.coord.id]={tile:y,coord:v,
queryGeometry:[],scale:Math.pow(2,e.transform.zoom-y.coord.z)}),b.queryGeometry.push(_)}}var w=[];for(var E in r)w.push(r[E]);return w},e.prototype.redoPlacement=function(){for(var t=this,e=this.getIds(),r=0;r<e.length;r++){var n=t.getTileByID(e[r]);n.redoPlacement(t._source)}},e.prototype.getVisibleCoordinates=function(){for(var t=this,e=this.getRenderableIds().map(u.fromID),r=0,n=e;r<n.length;r+=1){var i=n[r];i.posMatrix=t.transform.calculatePosMatrix(i,t._source.maxzoom)}return e},e}(s);f.maxOverzooming=10,f.maxUnderzooming=3,e.exports=f},{"../data/extent":11,"../geo/coordinate":18,"../util/evented":116,"../util/lru_cache":122,"../util/util":127,"./source":48,"./tile":50,"./tile_coord":51}],50:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../data/bucket"),o=t("../data/feature_index"),a=t("vector-tile"),s=t("pbf"),u=t("../util/vectortile_to_geojson"),l=t("feature-filter"),c=t("../symbol/collision_tile"),p=t("../symbol/collision_box"),h=t("../symbol/symbol_instances"),f=t("../symbol/symbol_quads"),d=function(t,e,r){this.coord=t,this.uid=n.uniqueId(),this.uses=0,this.tileSize=e,this.sourceMaxZoom=r,this.buckets={},this.state="loading"};d.prototype.registerFadeDuration=function(t,e){var r=e+this.timeAdded;r<Date.now()||this.fadeEndTime&&r<this.fadeEndTime||(this.fadeEndTime=r,t.set(this.fadeEndTime-Date.now()))},d.prototype.loadVectorData=function(t,e){this.hasData()&&this.unloadVectorData(e),this.state="loaded",t&&(t.rawTileData&&(this.rawTileData=t.rawTileData),this.collisionBoxArray=new p(t.collisionBoxArray),this.collisionTile=new c(t.collisionTile,this.collisionBoxArray),this.symbolInstancesArray=new h(t.symbolInstancesArray),this.symbolQuadsArray=new f(t.symbolQuadsArray),this.featureIndex=new o(t.featureIndex,this.rawTileData,this.collisionTile),this.buckets=i.deserialize(t.buckets,e.style))},d.prototype.reloadSymbolData=function(t,e){var r=this;if("unloaded"!==this.state){this.collisionTile=new c(t.collisionTile,this.collisionBoxArray),this.featureIndex.setCollisionTile(this.collisionTile);for(var o in this.buckets){var a=r.buckets[o];"symbol"===a.type&&(a.destroy(),delete r.buckets[o])}n.extend(this.buckets,i.deserialize(t.buckets,e))}},d.prototype.unloadVectorData=function(){var t=this;for(var e in this.buckets)t.buckets[e].destroy();this.buckets={},this.collisionBoxArray=null,this.symbolQuadsArray=null,this.symbolInstancesArray=null,this.collisionTile=null,this.featureIndex=null,this.state="unloaded"},d.prototype.redoPlacement=function(t){function e(e,r){this.reloadSymbolData(r,t.map.style),t.fire("data",{tile:this,coord:this.coord,dataType:"tile"}),t.map&&(t.map.painter.tileExtentVAO.vao=null),this.state="loaded",this.redoWhenDone&&(this.redoPlacement(t),this.redoWhenDone=!1)}if("vector"===t.type||"geojson"===t.type){if("loaded"!==this.state||"reloading"===this.state)return void(this.redoWhenDone=!0);this.state="reloading",t.dispatcher.send("redoPlacement",{type:t.type,uid:this.uid,source:t.id,angle:t.map.transform.angle,pitch:t.map.transform.pitch,showCollisionBoxes:t.map.showCollisionBoxes},e.bind(this),this.workerID)}},d.prototype.getBucket=function(t){return this.buckets[t.id]},d.prototype.querySourceFeatures=function(t,e){var r=this;if(this.rawTileData){this.vtLayers||(this.vtLayers=new a.VectorTile(new s(this.rawTileData)).layers);var n=this.vtLayers._geojsonTileLayer||this.vtLayers[e.sourceLayer];if(n)for(var i=l(e&&e.filter),o={z:this.coord.z,x:this.coord.x,y:this.coord.y},c=0;c<n.length;c++){var p=n.feature(c);if(i(p)){var h=new u(p,r.coord.z,r.coord.x,r.coord.y);h.tile=o,t.push(h)}}}},d.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state},e.exports=d},{"../data/bucket":2,"../data/feature_index":12,"../symbol/collision_box":76,"../symbol/collision_tile":78,"../symbol/symbol_instances":87,"../symbol/symbol_quads":88,"../util/util":127,"../util/vectortile_to_geojson":128,"feature-filter":135,pbf:193,"vector-tile":204}],51:[function(t,e,r){"use strict";function n(t,e){if(t.row>e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function i(t,e,r,n,i){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var u=t.dx/t.dy,l=e.dx/e.dy,c=t.dx>0,p=e.dx<0,h=o;h<a;h++){var f=u*Math.max(0,Math.min(t.dy,h+c-t.y0))+t.x0,d=l*Math.max(0,Math.min(e.dy,h+p-e.y0))+e.x0;i(Math.floor(d),Math.ceil(f),h)}}function o(t,e,r,o,a,s){var u,l=n(t,e),c=n(e,r),p=n(r,t);l.dy>c.dy&&(u=l,l=c,c=u),l.dy>p.dy&&(u=l,l=p,p=u),c.dy>p.dy&&(u=c,c=p,p=u),l.dy&&i(p,l,o,a,s),c.dy&&i(p,c,o,a,s)}function a(t,e,r){for(var n,i="",o=t;o>0;o--)n=1<<o-1,i+=(e&n?1:0)+(r&n?2:0);return i}var s=t("whoots-js"),u=t("../geo/coordinate"),l=function(t,e,r,n){isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,n*=2,n<0&&(n=n*-1-1);var i=1<<this.z;this.id=32*(i*i*n+i*this.y+this.x)+this.z,this.posMatrix=null};l.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},l.prototype.toCoordinate=function(t){var e=Math.min(this.z,void 0===t?this.z:t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new u(i,n,e)},l.prototype.url=function(t,e,r){var n=s.getTileBBox(this.x,this.y,this.z),i=a(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",Math.min(this.z,e||this.z)).replace("{x}",this.x).replace("{y}","tms"===r?Math.pow(2,this.z)-this.y-1:this.y).replace("{quadkey}",i).replace("{bbox-epsg-3857}",n)},l.prototype.parent=function(t){return 0===this.z?null:this.z>t?new l(this.z-1,this.x,this.y,this.w):new l(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},l.prototype.wrapped=function(){return new l(this.z,this.x,this.y,0)},l.prototype.children=function(t){if(this.z>=t)return[new l(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,n=2*this.y;return[new l(e,r,n,this.w),new l(e,r+1,n,this.w),new l(e,r,n+1,this.w),new l(e,r+1,n+1,this.w)]},l.cover=function(t,e,r){function n(t,e,n){var o,s,u;if(n>=0&&n<=i)for(o=t;o<e;o++)s=(o%i+i)%i,u=new l(r,s,n,Math.floor(o/i)),a[u.id]=u}var i=1<<t,a={};return o(e[0],e[1],e[2],0,i,n),o(e[2],e[3],e[0],0,i,n),Object.keys(a).map(function(t){return a[t]})},l.fromID=function(t){var e=t%32,r=1<<e,n=(t-e)/32,i=n%r,o=(n-i)/r%r,a=Math.floor(n/(r*r));return a%2!==0&&(a=a*-1-1),a/=2,new l(e,i,o,a)},e.exports=l},{"../geo/coordinate":18,"whoots-js":213}],52:[function(t,e,r){"use strict";var n=t("../util/evented"),i=t("../util/util"),o=t("./load_tilejson"),a=t("../util/mapbox").normalizeTileURL,s=function(t){function e(e,r,n,a){var s=this;if(t.call(this),this.id=e,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,i.extend(this,i.pick(r,["url","scheme","tileSize"])),this._options=i.extend({type:"vector"},r),512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(a),this.fire("dataloading",{dataType:"source"}),o(r,function(t,e){return t?void s.fire("error",t):(i.extend(s,e),s.fire("data",{dataType:"source"}),void s.fire("source.load"))})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){this.map=t},e.prototype.serialize=function(){return i.extend({},this._options)},e.prototype.loadTile=function(t,e){function r(r,n){if(!t.aborted){if(r)return e(r);t.loadVectorData(n,this.map.painter),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)}}var n=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:a(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,type:this.type,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:this.dispatcher.send("reloadTile",i,r.bind(this),t.workerID):t.workerID=this.dispatcher.send("loadTile",i,r.bind(this))},e.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e}(n);e.exports=s},{"../util/evented":116,"../util/mapbox":123,"../util/util":127,"./load_tilejson":44}],53:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("vector-tile"),o=t("pbf"),a=t("./worker_tile"),s=t("../util/util"),u=function(t,e,r){this.actor=t,this.layerIndex=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}};u.prototype.loadTile=function(t,e){function r(t,r){return delete this.loading[n][i],t?e(t):r?(o.vectorTile=r,o.parse(r,this.layerIndex,this.actor,function(t,n,i){return t?e(t):void e(null,s.extend({rawTileData:r.rawData},n),i)}),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][i]=o)):e(null,null)}var n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var o=this.loading[n][i]=new a(t);o.abort=this.loadVectorData(t,r.bind(this))},u.prototype.reloadTile=function(t,e){function r(t,r){if(this.reloadCallback){var n=this.reloadCallback;delete this.reloadCallback,this.parse(this.vectorTile,o.layerIndex,o.actor,n)}e(t,r)}var n=this.loaded[t.source],i=t.uid,o=this;if(n&&n[i]){var a=n[i];"parsing"===a.status?a.reloadCallback=e:"done"===a.status&&a.parse(a.vectorTile,this.layerIndex,this.actor,r.bind(a))}},u.prototype.abortTile=function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},u.prototype.removeTile=function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},u.prototype.loadVectorData=function(t,e){function r(t,r){if(t)return e(t);var n=new i.VectorTile(new o(r));n.rawData=r,e(t,n)}var a=n.getArrayBuffer(t.url,r.bind(this));return function(){a.abort()}},u.prototype.redoPlacement=function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var o=r[i],a=o.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)},e.exports=u},{"../util/ajax":107,"../util/util":127,"./worker_tile":56,pbf:193,"vector-tile":204}],54:[function(t,e,r){"use strict";var n=t("../util/ajax"),i=t("./image_source"),o=function(t){function e(e,r,n,i){t.call(this,e,r,n,i),this.roundZoom=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._load=function(t){var e=this;this.urls=t.urls,n.getVideo(t.urls,function(t,r){if(t)return e.fire("error",{error:t});e.video=r,e.video.loop=!0;var n;e.video.addEventListener("playing",function(){n=e.map.style.animationLoop.set(1/0),e.map._rerender()}),e.video.addEventListener("pause",function(){e.map.style.animationLoop.cancel(n)}),e.map&&e.video.play(),e._finishLoading()})},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){!this.tile||this.video.readyState<2||this._prepareImage(this.map.painter.gl,this.video)},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e}(i);e.exports=o},{"../util/ajax":107,"./image_source":43}],55:[function(t,e,r){"use strict";var n=t("../util/actor"),i=t("../style/style_layer_index"),o=t("./vector_tile_worker_source"),a=t("./geojson_worker_source"),s=function(t){var e=this;this.self=t,this.actor=new n(t,this),this.layerIndexes={},this.workerSourceTypes={vector:o,geojson:a},this.workerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r}};s.prototype.setLayers=function(t,e){this.getLayerIndex(t).replace(e)},s.prototype.updateLayers=function(t,e){this.getLayerIndex(t).update(e.layers,e.removedIds,e.symbolOrder)},s.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type).loadTile(e,r)},s.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type).reloadTile(e,r)},s.prototype.abortTile=function(t,e){this.getWorkerSource(t,e.type).abortTile(e)},s.prototype.removeTile=function(t,e){this.getWorkerSource(t,e.type).removeTile(e)},s.prototype.removeSource=function(t,e){var r=this.getWorkerSource(t,e.type);void 0!==r.removeSource&&r.removeSource(e)},s.prototype.redoPlacement=function(t,e,r){this.getWorkerSource(t,e.type).redoPlacement(e,r)},s.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t)}},s.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i),e},s.prototype.getWorkerSource=function(t,e){var r=this;if(this.workerSources[t]||(this.workerSources[t]={}),!this.workerSources[t][e]){var n={send:function(e,n,i,o){r.actor.send(e,n,i,o,t)}};this.workerSources[t][e]=new this.workerSourceTypes[e](n,this.getLayerIndex(t))}return this.workerSources[t][e]},e.exports=function(t){return new s(t)}},{"../style/style_layer_index":69,"../util/actor":106,"./geojson_worker_source":41,"./vector_tile_worker_source":53}],56:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=t.layers;r<n.length;r+=1){var i=n[r];i.recalculate(e)}}function i(t,e){return t.filter(function(t){return!t.isEmpty()}).map(function(t){return t.serialize(e)})}var o=t("../data/feature_index"),a=t("../symbol/collision_tile"),s=t("../symbol/collision_box"),u=t("../util/dictionary_coder"),l=t("../util/util"),c=t("../symbol/symbol_instances"),p=t("../symbol/symbol_quads"),h=function(t){this.coord=t.coord,this.uid=t.uid,this.zoom=t.zoom,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=t.overscaling,this.angle=t.angle,this.pitch=t.pitch,this.showCollisionBoxes=t.showCollisionBoxes};h.prototype.parse=function(t,e,r,h){var f=this;t.layers||(t={layers:{_geojsonTileLayer:t}}),this.status="parsing",this.data=t,this.collisionBoxArray=new s,this.symbolInstancesArray=new c,this.symbolQuadsArray=new p;var d=new u(Object.keys(t.layers).sort()),m=new o(this.coord,this.overscaling);m.bucketLayerIDs={};var y={},v=0,g={featureIndex:m,iconDependencies:{},glyphDependencies:{}},_=e.familiesBySource[this.source];for(var x in _){var b=t.layers[x];if(b){1===b.version&&l.warnOnce('Vector tile source "'+f.source+'" layer "'+x+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var w=d.encode(x),E=[],T=0;T<b.length;T++){var S=b.feature(T);S.index=T,S.sourceLayerIndex=w,E.push(S)}for(var z=0,A=_[x];z<A.length;z+=1){var M=A[z],P=M[0];if(!(P.minzoom&&f.zoom<P.minzoom||P.maxzoom&&f.zoom>=P.maxzoom||P.layout&&"none"===P.layout.visibility)){for(var L=0,k=M;L<k.length;L+=1){var C=k[L];C.recalculate(f.zoom)}var I=y[P.id]=P.createBucket({index:v,layers:M,zoom:f.zoom,overscaling:f.overscaling,collisionBoxArray:f.collisionBoxArray,symbolQuadsArray:f.symbolQuadsArray,symbolInstancesArray:f.symbolInstancesArray});I.populate(E,g),m.bucketLayerIDs[v]=M.map(function(t){return t.id}),v++}}}}var R=function(t){f.status="done";var e=[];h(null,{buckets:i(l.values(y),e),featureIndex:m.serialize(e),collisionTile:t.serialize(e),collisionBoxArray:f.collisionBoxArray.serialize(),symbolInstancesArray:f.symbolInstancesArray.serialize(),symbolQuadsArray:f.symbolQuadsArray.serialize()},e)};this.symbolBuckets=[];for(var D=e.symbolOrder.length-1;D>=0;D--){var O=y[e.symbolOrder[D]];O&&f.symbolBuckets.push(O)}if(0===this.symbolBuckets.length)return R(new a(this.angle,this.pitch,this.collisionBoxArray));var B=0,j=Object.keys(g.iconDependencies),F=l.mapObject(g.glyphDependencies,function(t){return Object.keys(t).map(Number)}),U=function(t){if(t)return h(t);if(B++,2===B){for(var e=new a(f.angle,f.pitch,f.collisionBoxArray),r=0,i=f.symbolBuckets;r<i.length;r+=1){var o=i[r];n(o,f.zoom),o.prepare(F,j),o.place(e,f.showCollisionBoxes)}R(e)}};Object.keys(F).length?r.send("getGlyphs",{uid:this.uid,stacks:F},function(t,e){F=e,U(t)}):U(),j.length?r.send("getIcons",{icons:j},function(t,e){j=e,U(t)}):U()},h.prototype.redoPlacement=function(t,e,r){var o=this;if(this.angle=t,this.pitch=e,"done"!==this.status)return{};for(var s=new a(this.angle,this.pitch,this.collisionBoxArray),u=0,l=this.symbolBuckets;u<l.length;u+=1){var c=l[u];n(c,o.zoom),c.place(s,r)}var p=[];return{result:{buckets:i(this.symbolBuckets,p),collisionTile:s.serialize(p)},transferables:p}},e.exports=h},{"../data/feature_index":12,"../symbol/collision_box":76,"../symbol/collision_tile":78,"../symbol/symbol_instances":87,"../symbol/symbol_quads":88,"../util/dictionary_coder":113,"../util/util":127}],57:[function(t,e,r){"use strict";var n=function(){this.n=0,this.times=[]};n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})},e.exports=n},{}],58:[function(t,e,r){"use strict";var n=t("../util/evented"),i=t("../util/ajax"),o=t("../util/browser"),a=t("../util/mapbox").normalizeSpriteURL,s=function(){this.x=0,this.y=0,this.width=0,this.height=0,this.pixelRatio=1,this.sdf=!1},u=function(t){function e(e){var r=this;t.call(this),this.base=e,this.retina=o.devicePixelRatio>1;var n=this.retina?"@2x":"";i.getJSON(a(e,n,".json"),function(t,e){return t?void r.fire("error",{error:t}):(r.data=e,void(r.imgData&&r.fire("data",{dataType:"style"})))}),i.getImage(a(e,n,".png"),function(t,e){if(t)return void r.fire("error",{error:t});r.imgData=o.getImageData(e);for(var n=0;n<r.imgData.length;n+=4){var i=r.imgData[n+3]/255;r.imgData[n+0]*=i,r.imgData[n+1]*=i,r.imgData[n+2]*=i}r.width=e.width,r.data&&r.fire("data",{dataType:"style"})})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toJSON=function(){return this.base},e.prototype.loaded=function(){return!(!this.data||!this.imgData)},e.prototype.resize=function(){var t=this;if(o.devicePixelRatio>1!==this.retina){var r=new e(this.base);r.on("data",function(){t.data=r.data,t.imgData=r.imgData,t.width=r.width,t.retina=r.retina})}},e.prototype.getSpritePosition=function(t){if(!this.loaded())return new s;var e=this.data&&this.data[t];return e&&this.imgData?e:new s},e}(n);e.exports=u},{"../util/ajax":107,"../util/browser":108,"../util/evented":116,"../util/mapbox":123}],59:[function(t,e,r){"use strict";var n=t("./style_spec"),i=t("../util/util"),o=t("../util/evented"),a=t("./validate_style"),s=t("./style_declaration"),u=t("./style_transition"),l="-transition",c=function(t){function e(e){t.call(this),this.properties=["anchor","color","position","intensity"],this._specifications=n.light,this.set(e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){var e=this;if(!this._validate(a.light,t)){this._declarations={},this._transitions={},this._transitionOptions={},this.calculated={},t=i.extend({anchor:this._specifications.anchor.default,color:this._specifications.color.default,position:this._specifications.position.default,intensity:this._specifications.intensity.default},t);for(var r=0,n=this.properties;r<n.length;r+=1){var o=n[r];e._declarations[o]=new s(e._specifications[o],t[o])}return this}},e.prototype.getLight=function(){return{anchor:this.getLightProperty("anchor"),color:this.getLightProperty("color"),position:this.getLightProperty("position"),intensity:this.getLightProperty("intensity")}},e.prototype.getLightProperty=function(t){return i.endsWith(t,l)?this._transitionOptions[t]:this._declarations[t]&&this._declarations[t].value},e.prototype.getLightValue=function(t,e){if("position"===t){var r=this._transitions[t].calculate(e),n=i.sphericalToCartesian(r);return{x:n[0],y:n[1],z:n[2]}}return this._transitions[t].calculate(e)},e.prototype.setLight=function(t){var e=this;if(!this._validate(a.light,t))for(var r in t){var n=t[r];i.endsWith(r,l)?e._transitionOptions[r]=n:null===n||void 0===n?delete e._declarations[r]:e._declarations[r]=new s(e._specifications[r],n)}},e.prototype.recalculate=function(t){var e=this;for(var r in this._declarations)e.calculated[r]=e.getLightValue(r,{zoom:t})},e.prototype._applyLightDeclaration=function(t,e,r,n,o){var a=r.transition?this._transitions[t]:void 0,c=this._specifications[t];if(null!==e&&void 0!==e||(e=new s(c,c.default)),!a||a.declaration.json!==e.json){var p=i.extend({duration:300,delay:0},n,this.getLightProperty(t+l)),h=this._transitions[t]=new u(c,e,a,p);h.instant()||(h.loopID=o.set(h.endTime-Date.now())),a&&o.cancel(a.loopID)}},e.prototype.updateLightTransitions=function(t,e,r){var n,i=this;for(n in this._declarations)i._applyLightDeclaration(n,i._declarations[n],t,e,r)},e.prototype._validate=function(t,e){return a.emitErrors(this,t.call(a,i.extend({value:e,style:{glyphs:!0,sprite:!0},styleSpec:n})))},e}(o);e.exports=c},{"../util/evented":116,"../util/util":127,"./style_declaration":62,"./style_spec":70,"./style_transition":71,"./validate_style":72}],60:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),o=t("mapbox-gl-function"),a={};e.exports=function t(e){if(e&&o.isFunctionDefinition(e))return e.stops?i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})}):e;if("string"==typeof e){if(!a[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);a[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return a[e]}if(Array.isArray(e))return e;throw new Error("Invalid color "+e)}},{"../util/util":127,csscolorparser:132,"mapbox-gl-function":161}],61:[function(t,e,r){"use strict";var n=t("../util/evented"),i=t("./style_layer"),o=t("./image_sprite"),a=t("./light"),s=t("../symbol/glyph_source"),u=t("../symbol/sprite_atlas"),l=t("../render/line_atlas"),c=t("../util/util"),p=t("../util/ajax"),h=t("../util/mapbox"),f=t("../util/browser"),d=t("../util/dispatcher"),m=t("./animation_loop"),y=t("./validate_style"),v=t("../source/source"),g=t("../source/query_features"),_=t("../source/source_cache"),x=t("./style_spec"),b=t("mapbox-gl-function"),w=t("../global_worker_pool"),E=t("mapbox-gl-style-spec/lib/deref"),T=t("mapbox-gl-style-spec/lib/diff"),S=c.pick(T.operations,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition"]),z=c.pick(T.operations,["setCenter","setZoom","setBearing","setPitch"]),A=function(t){function e(e,r,n){var i=this;t.call(this),this.map=r,this.animationLoop=r&&r.animationLoop||new m,this.dispatcher=new d(w(),this),this.spriteAtlas=new u(1024,1024),this.lineAtlas=new l(256,512),this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory={},this._loaded=!1,c.bindAll(["_redoPlacement"],this),this._resetUpdates(),n=c.extend({validate:"string"!=typeof e||!h.isMapboxURL(e)},n),this.setEventedParent(r),this.fire("dataloading",{dataType:"style"});var a=function(t,e){if(t)return void i.fire("error",{error:t});if(!n.validate||!y.emitErrors(i,y(e))){i._loaded=!0,i.stylesheet=e,i.updateClasses();for(var r in e.sources)i.addSource(r,e.sources[r],n);e.sprite&&(i.sprite=new o(e.sprite),i.sprite.setEventedParent(i)),i.glyphSource=new s(e.glyphs),i._resolve(),i.fire("data",{dataType:"style"}),i.fire("style.load")}};"string"==typeof e?p.getJSON(h.normalizeStyleURL(e),a):f.frame(a.bind(this,null,e)),this.on("source.load",function(t){var e=i.sourceCaches[t.sourceId].getSource();if(e&&e.vectorLayerIds)for(var r in i._layers){var n=i._layers[r];n.source===e.id&&i._validateLayer(n)}})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._validateLayer=function(t){var e=this.sourceCaches[t.source];if(t.sourceLayer&&e){var r=e.getSource();r.vectorLayerIds&&r.vectorLayerIds.indexOf(t.sourceLayer)===-1&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+r.id+'" as specified by style layer "'+t.id+'"')})}},e.prototype.loaded=function(){var t=this;if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var e in this.sourceCaches)if(!t.sourceCaches[e].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},e.prototype._resolve=function(){var t=this,e=E(this.stylesheet.layers);this._order=e.map(function(t){return t.id}),this._layers={};for(var r=0,n=e;r<n.length;r+=1){var o=n[r];o=i.create(o),o.setEventedParent(t,{layer:{id:o.id}}),t._layers[o.id]=o}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new a(this.stylesheet.light)},e.prototype._serializeLayers=function(t){var e=this;return t.map(function(t){return e._layers[t].serialize()})},e.prototype._applyClasses=function(t,e){var r=this;if(this._loaded){t=t||[],e=e||{transition:!0};var n=this.stylesheet.transition||{},i=this._updatedAllPaintProps?this._layers:this._updatedPaintProps;for(var o in i){var a=r._layers[o],s=r._updatedPaintProps[o];if(r._updatedAllPaintProps||s.all)a.updatePaintTransitions(t,e,n,r.animationLoop,r.zoomHistory);else for(var u in s)r._layers[o].updatePaintTransition(u,t,e,n,r.animationLoop,r.zoomHistory)}this.light.updateLightTransitions(e,n,this.animationLoop)}},e.prototype._recalculate=function(t){var e=this;if(this._loaded){for(var r in this.sourceCaches)e.sourceCaches[r].used=!1;this._updateZoomHistory(t);for(var n=0,i=this._order;n<i.length;n+=1){var o=i[n],a=e._layers[o];a.recalculate(t),!a.isHidden(t)&&a.source&&(e.sourceCaches[a.source].used=!0)}this.light.recalculate(t);var s=300;Math.floor(this.z)!==Math.floor(t)&&this.animationLoop.set(s),this.z=t}},e.prototype._updateZoomHistory=function(t){var e=this.zoomHistory;void 0===e.lastIntegerZoom&&(e.lastIntegerZoom=Math.floor(t),e.lastIntegerZoomTime=0,e.lastZoom=t),Math.floor(e.lastZoom)<Math.floor(t)?(e.lastIntegerZoom=Math.floor(t),e.lastIntegerZoomTime=Date.now()):Math.floor(e.lastZoom)>Math.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},e.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},e.prototype.update=function(t,e){var r=this;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(n.length||i.length||this._updatedSymbolOrder)&&this._updateWorkerLayers(n,i);for(var o in this._updatedSources){var a=r._updatedSources[o];"reload"===a?r._reloadSource(o):"clear"===a&&r._clearSource(o)}this._applyClasses(t,e),this._resetUpdates(),this.fire("data",{dataType:"style"})}},e.prototype._updateWorkerLayers=function(t,e){var r=this,n=this._updatedSymbolOrder?this._order.filter(function(t){return"symbol"===r._layers[t].type}):null;this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e,symbolOrder:n})},e.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSymbolOrder=!1,this._updatedSources={},this._updatedPaintProps={},this._updatedAllPaintProps=!1},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),y.emitErrors(this,y(t)))return!1;t=c.extend({},t),t.layers=E(t.layers);var r=T(this.serialize(),t).filter(function(t){return!(t.command in z)});if(0===r.length)return!1;var n=r.filter(function(t){return!(t.command in S)});if(n.length>0)throw new Error("Unimplemented: "+n.map(function(t){return t.command}).join(", ")+".");return r.forEach(function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)}),this.stylesheet=t,!0},e.prototype.addSource=function(t,e,r){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e)+".");var n=["vector","raster","geojson","video","image"],i=n.indexOf(e.type)>=0;if(!i||!this._validate(y.source,"sources."+t,e,null,r)){var o=this.sourceCaches[t]=new _(t,e,this.dispatcher);o.style=this,o.setEventedParent(this,function(){return{isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:t}}),o.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");var e=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],e.setEventedParent(null),e.clearTiles(),e.onRemove&&e.onRemove(this.map),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,r){this._checkLoaded();var n=t.id;if(!this._validate(y.layer,"layers."+n,t,{arrayIndex:-1},r)){var o=i.create(t);this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}});var a=e?this._order.indexOf(e):this._order.length;this._order.splice(a,0,n),this._layers[n]=o,this._removedLayers[n]&&(delete this._removedLayers[n],this._updatedSources[o.source]="clear"),this._updateLayer(o),"symbol"===o.type&&(this._updatedSymbolOrder=!0),this.updateClasses(n)}},e.prototype.moveLayer=function(t,e){this._checkLoaded(),this._changed=!0;var r=this._layers[t];if(!r)throw new Error("Layer not found: "+t);var n=this._order.indexOf(t);this._order.splice(n,1);var i=e?this._order.indexOf(e):this._order.length;this._order.splice(i,0,t),"symbol"===r.type&&(this._updatedSymbolOrder=!0,r.source&&!this._updatedSources[r.source]&&(this._updatedSources[r.source]="reload"))},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(!e)throw new Error("Layer not found: "+t);e.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),"symbol"===e.type&&(this._updatedSymbolOrder=!0),this._changed=!0,this._removedLayers[t]=!0,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t]},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.setLayerZoomRange=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);n.minzoom===e&&n.maxzoom===r||(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},e.prototype.setFilter=function(t,e){this._checkLoaded();var r=this.getLayer(t);null!==e&&void 0!==e&&this._validate(y.filter,"layers."+r.id+".filter",e)||c.deepEqual(r.filter,e)||(r.filter=c.clone(e),this._updateLayer(r))},e.prototype.getFilter=function(t){return c.clone(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);c.deepEqual(n.getLayoutProperty(e),r)||(n.setLayoutProperty(e,r),this._updateLayer(n))},e.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},e.prototype.setPaintProperty=function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(!c.deepEqual(i.getPaintProperty(e,n),r)){var o=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);var a=!(r&&b.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property);a&&o||this._updateLayer(i),this.updateClasses(t,e)}},e.prototype.getPaintProperty=function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},e.prototype.getTransition=function(){return c.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},e.prototype.updateClasses=function(t,e){if(this._changed=!0,t){var r=this._updatedPaintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updatedAllPaintProps=!0},e.prototype.serialize=function(){var t=this;return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,
sources:c.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(e){return t._layers[e].serialize()})},function(t){return void 0!==t})},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload"),this._changed=!0},e.prototype._flattenRenderedFeatures=function(t){for(var e=this,r=[],n=this._order.length-1;n>=0;n--)for(var i=e._order[n],o=0,a=t;o<a.length;o+=1){var s=a[o],u=s[i];if(u)for(var l=0,c=u;l<c.length;l+=1){var p=c[l];r.push(p)}}return r},e.prototype.queryRenderedFeatures=function(t,e,r,n){var i=this;e&&e.filter&&this._validate(y.filter,"queryRenderedFeatures.filter",e.filter);var o={};if(e&&e.layers)for(var a=0,s=e.layers;a<s.length;a+=1){var u=s[a],l=i._layers[u];if(!l)return void i.fire("error",{error:"The layer '"+u+"' does not exist in the map's style and cannot be queried for features."});o[l.source]=!0}var c=[];for(var p in this.sourceCaches)if(!e.layers||o[p]){var h=g.rendered(i.sourceCaches[p],i._layers,t,e,r,n);c.push(h)}return this._flattenRenderedFeatures(c)},e.prototype.querySourceFeatures=function(t,e){e&&e.filter&&this._validate(y.filter,"querySourceFeatures.filter",e.filter);var r=this.sourceCaches[t];return r?g.source(r,e):[]},e.prototype.addSourceType=function(t,e,r){return v.getType(t)?r(new Error('A source type called "'+t+'" already exists.')):(v.setType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},e.prototype.getLight=function(){return this.light.getLight()},e.prototype.setLight=function(t,e){this._checkLoaded();var r=this.light.getLight(),n=!1;for(var i in t)if(!c.deepEqual(t[i],r[i])){n=!0;break}if(n){var o=this.stylesheet.transition||{};this.light.setLight(t),this.light.updateLightTransitions(e||{transition:!0},o,this.animationLoop)}},e.prototype._validate=function(t,e,r,n,i){return(!i||i.validate!==!1)&&y.emitErrors(this,t.call(y,c.extend({key:e,style:this.serialize(),value:r,styleSpec:x},n)))},e.prototype._remove=function(){var t=this;for(var e in this.sourceCaches)t.sourceCaches[e].clearTiles();this.dispatcher.remove()},e.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},e.prototype._reloadSource=function(t){this.sourceCaches[t].reload()},e.prototype._updateSources=function(t){var e=this;for(var r in this.sourceCaches)e.sourceCaches[r].update(t)},e.prototype._redoPlacement=function(){var t=this;for(var e in this.sourceCaches)t.sourceCaches[e].redoPlacement()},e.prototype.getIcons=function(t,e,r){var n=this,i=function(){n.spriteAtlas.setSprite(n.sprite),n.spriteAtlas.addIcons(e.icons,r)};this.sprite.loaded()?i():this.sprite.on("data",i)},e.prototype.getGlyphs=function(t,e,r){function n(t,e,n){t&&console.error(t),s[n]=e,a--,0===a&&r(null,s)}var i=this,o=e.stacks,a=Object.keys(o).length,s={};for(var u in o)i.glyphSource.getSimpleGlyphs(u,o[u],e.uid,n)},e}(n);e.exports=A},{"../global_worker_pool":22,"../render/line_atlas":35,"../source/query_features":46,"../source/source":48,"../source/source_cache":49,"../symbol/glyph_source":81,"../symbol/sprite_atlas":86,"../util/ajax":107,"../util/browser":108,"../util/dispatcher":114,"../util/evented":116,"../util/mapbox":123,"../util/util":127,"./animation_loop":57,"./image_sprite":58,"./light":59,"./style_layer":63,"./style_spec":70,"./validate_style":72,"mapbox-gl-function":161,"mapbox-gl-style-spec/lib/deref":162,"mapbox-gl-style-spec/lib/diff":163}],62:[function(t,e,r){"use strict";var n=t("mapbox-gl-function"),i=t("./parse_color"),o=t("../util/util"),a=function(t,e){var r=this;this.value=o.clone(e),this.isFunction=n.isFunctionDefinition(e),this.json=JSON.stringify(this.value),this.minimum=t.minimum,this.isColor="color"===t.type;var a=this.isColor&&this.value?i(this.value):e,s=t.default;if(s&&"color"===t.type&&(s=i(s)),this.function=n[t.function||"piecewise-constant"](a,s),this.isFeatureConstant=this.function.isFeatureConstant,this.isZoomConstant=this.function.isZoomConstant,!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var u=[],l=0,c=this.value.stops;l<c.length;l+=1){var p=c[l],h=p[0].zoom;r.stopZoomLevels.indexOf(h)<0&&(r.stopZoomLevels.push(h),u.push([h,u.length]))}this.functionInterpolationT=n.interpolated({stops:u,base:e.base,colorSpace:e.colorSpace})}};a.prototype.calculate=function(t,e){var r=this.function(t&&t.zoom,e||{});return this.isColor&&r?i(r):void 0!==this.minimum&&r<this.minimum?this.minimum:r},a.prototype.calculateInterpolationT=function(t,e){return this.functionInterpolationT(t&&t.zoom,e||{})},e.exports=a},{"../util/util":127,"./parse_color":60,"mapbox-gl-function":161}],63:[function(t,e,r){"use strict";function n(t){return t.value}var i=t("../util/util"),o=t("./style_transition"),a=t("./style_declaration"),s=t("./style_spec"),u=t("./validate_style"),l=t("./parse_color"),c=t("../util/evented"),p="-transition",h=function(t){function e(e){var r=this;t.call(this),this.id=e.id,this.metadata=e.metadata,this.type=e.type,this.source=e.source,this.sourceLayer=e["source-layer"],this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,this.filter=e.filter,this.paint={},this.layout={},this._paintSpecifications=s["paint_"+this.type],this._layoutSpecifications=s["layout_"+this.type],this._paintTransitions={},this._paintTransitionOptions={},this._paintDeclarations={},this._layoutDeclarations={},this._layoutFunctions={};var n,i,o={validate:!1};for(var a in e){var u=a.match(/^paint(?:\.(.*))?$/);if(u){var l=u[1]||"";for(n in e[a])r.setPaintProperty(n,e[a][n],l,o)}}for(i in e.layout)r.setLayoutProperty(i,e.layout[i],o);for(n in this._paintSpecifications)r.paint[n]=r.getPaintValue(n);for(i in this._layoutSpecifications)r._updateLayoutValue(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setLayoutProperty=function(t,e,r){if(null==e)delete this._layoutDeclarations[t];else{var n="layers."+this.id+".layout."+t;if(this._validate(u.layoutProperty,n,t,e,r))return;this._layoutDeclarations[t]=new a(this._layoutSpecifications[t],e)}this._updateLayoutValue(t)},e.prototype.getLayoutProperty=function(t){return this._layoutDeclarations[t]&&this._layoutDeclarations[t].value},e.prototype.getLayoutValue=function(t,e,r){var n=this._layoutSpecifications[t],i=this._layoutDeclarations[t];return i?i.calculate(e,r):n.default},e.prototype.setPaintProperty=function(t,e,r,n){var o="layers."+this.id+(r?'["paint.'+r+'"].':".paint.")+t;if(i.endsWith(t,p))if(this._paintTransitionOptions[r||""]||(this._paintTransitionOptions[r||""]={}),null===e||void 0===e)delete this._paintTransitionOptions[r||""][t];else{if(this._validate(u.paintProperty,o,t,e,n))return;this._paintTransitionOptions[r||""][t]=e}else if(this._paintDeclarations[r||""]||(this._paintDeclarations[r||""]={}),null===e||void 0===e)delete this._paintDeclarations[r||""][t];else{if(this._validate(u.paintProperty,o,t,e,n))return;this._paintDeclarations[r||""][t]=new a(this._paintSpecifications[t],e)}},e.prototype.getPaintProperty=function(t,e){return e=e||"",i.endsWith(t,p)?this._paintTransitionOptions[e]&&this._paintTransitionOptions[e][t]:this._paintDeclarations[e]&&this._paintDeclarations[e][t]&&this._paintDeclarations[e][t].value},e.prototype.getPaintValue=function(t,e,r){var n=this._paintSpecifications[t],i=this._paintTransitions[t];return i?i.calculate(e,r):"color"===n.type&&n.default?l(n.default):n.default},e.prototype.getPaintValueStopZoomLevels=function(t){var e=this._paintTransitions[t];return e?e.declaration.stopZoomLevels:[]},e.prototype.getPaintInterpolationT=function(t,e){var r=this._paintTransitions[t];return r.declaration.calculateInterpolationT(e)},e.prototype.isPaintValueFeatureConstant=function(t){var e=this._paintTransitions[t];return!e||e.declaration.isFeatureConstant},e.prototype.isLayoutValueFeatureConstant=function(t){var e=this._layoutDeclarations[t];return!e||e.isFeatureConstant},e.prototype.isPaintValueZoomConstant=function(t){var e=this._paintTransitions[t];return!e||e.declaration.isZoomConstant},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.layout.visibility},e.prototype.updatePaintTransitions=function(t,e,r,n,o){for(var a=this,s=i.extend({},this._paintDeclarations[""]),u=0;u<t.length;u++)i.extend(s,a._paintDeclarations[t[u]]);var l;for(l in s)a._applyPaintDeclaration(l,s[l],e,r,n,o);for(l in this._paintTransitions)l in s||a._applyPaintDeclaration(l,null,e,r,n,o)},e.prototype.updatePaintTransition=function(t,e,r,n,i,o){for(var a=this,s=this._paintDeclarations[""][t],u=0;u<e.length;u++){var l=a._paintDeclarations[e[u]];l&&l[t]&&(s=l[t])}this._applyPaintDeclaration(t,s,r,n,i,o)},e.prototype.recalculate=function(t){var e=this;for(var r in this._paintTransitions)e.paint[r]=e.getPaintValue(r,{zoom:t});for(var n in this._layoutFunctions)e.layout[n]=e.getLayoutValue(n,{zoom:t})},e.prototype.serialize=function(){var t=this,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:i.mapObject(this._layoutDeclarations,n)};for(var r in this._paintDeclarations){var o=""===r?"paint":"paint."+r;e[o]=i.mapObject(t._paintDeclarations[r],n)}return i.filterObject(e,function(t,e){return void 0!==t&&!("layout"===e&&!Object.keys(t).length)})},e.prototype._applyPaintDeclaration=function(t,e,r,n,s,u){var l=r.transition?this._paintTransitions[t]:void 0,c=this._paintSpecifications[t];if(null!==e&&void 0!==e||(e=new a(c,c.default)),!l||l.declaration.json!==e.json){var h=i.extend({duration:300,delay:0},n,this.getPaintProperty(t+p)),f=this._paintTransitions[t]=new o(c,e,l,h,u);f.instant()||(f.loopID=s.set(f.endTime-Date.now())),l&&s.cancel(l.loopID)}},e.prototype._updateLayoutValue=function(t){var e=this._layoutDeclarations[t];e&&e.isFunction?this._layoutFunctions[t]=!0:(delete this._layoutFunctions[t],this.layout[t]=this.getLayoutValue(t))},e.prototype._validate=function(t,e,r,n,i){return(!i||i.validate!==!1)&&u.emitErrors(this,t.call(u,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:s,style:{glyphs:!0,sprite:!0}}))},e}(c);e.exports=h;var f={circle:t("./style_layer/circle_style_layer"),fill:t("./style_layer/fill_style_layer"),"fill-extrusion":t("./style_layer/fill_extrusion_style_layer"),line:t("./style_layer/line_style_layer"),symbol:t("./style_layer/symbol_style_layer")};h.create=function(t){var e=f[t.type]||h;return new e(t)}},{"../util/evented":116,"../util/util":127,"./parse_color":60,"./style_declaration":62,"./style_layer/circle_style_layer":64,"./style_layer/fill_extrusion_style_layer":65,"./style_layer/fill_style_layer":66,"./style_layer/line_style_layer":67,"./style_layer/symbol_style_layer":68,"./style_spec":70,"./style_transition":71,"./validate_style":72}],64:[function(t,e,r){"use strict";var n=t("../style_layer"),i=t("../../data/bucket/circle_bucket"),o=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new i(t)},e}(n);e.exports=o},{"../../data/bucket/circle_bucket":3,"../style_layer":63}],65:[function(t,e,r){"use strict";var n=t("../style_layer"),i=t("../../data/bucket/fill_extrusion_bucket"),o=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPaintValue=function(e,r,n){var i=t.prototype.getPaintValue.call(this,e,r,n);return"fill-extrusion-color"===e&&i&&(i[3]=1),i},e.prototype.createBucket=function(t){return new i(t)},e}(n);e.exports=o},{"../../data/bucket/fill_extrusion_bucket":5,"../style_layer":63}],66:[function(t,e,r){"use strict";var n=t("../style_layer"),i=t("../../data/bucket/fill_bucket"),o=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPaintValue=function(e,r,n){return"fill-outline-color"===e&&void 0===this.getPaintProperty("fill-outline-color")?t.prototype.getPaintValue.call(this,"fill-color",r,n):t.prototype.getPaintValue.call(this,e,r,n)},e.prototype.getPaintValueStopZoomLevels=function(e){return"fill-outline-color"===e&&void 0===this.getPaintProperty("fill-outline-color")?t.prototype.getPaintValueStopZoomLevels.call(this,"fill-color"):t.prototype.getPaintValueStopZoomLevels.call(this,e)},e.prototype.getPaintInterpolationT=function(e,r){return"fill-outline-color"===e&&void 0===this.getPaintProperty("fill-outline-color")?t.prototype.getPaintInterpolationT.call(this,"fill-color",r):t.prototype.getPaintInterpolationT.call(this,e,r)},e.prototype.isPaintValueFeatureConstant=function(e){return"fill-outline-color"===e&&void 0===this.getPaintProperty("fill-outline-color")?t.prototype.isPaintValueFeatureConstant.call(this,"fill-color"):t.prototype.isPaintValueFeatureConstant.call(this,e)},e.prototype.isPaintValueZoomConstant=function(e){return"fill-outline-color"===e&&void 0===this.getPaintProperty("fill-outline-color")?t.prototype.isPaintValueZoomConstant.call(this,"fill-color"):t.prototype.isPaintValueZoomConstant.call(this,e)},e.prototype.createBucket=function(t){return new i(t)},e}(n);e.exports=o},{"../../data/bucket/fill_bucket":4,"../style_layer":63}],67:[function(t,e,r){"use strict";var n=t("../style_layer"),i=t("../../data/bucket/line_bucket"),o=t("../../util/util"),a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPaintValue=function(e,r,n){var i=t.prototype.getPaintValue.call(this,e,r,n);if(i&&"line-dasharray"===e){var a=this.getPaintValue("line-width",o.extend({},r,{zoom:Math.floor(r.zoom)}),n);i.fromScale*=a,i.toScale*=a}return i},e.prototype.createBucket=function(t){return new i(t)},e}(n);e.exports=a},{"../../data/bucket/line_bucket":6,"../../util/util":127,"../style_layer":63}],68:[function(t,e,r){"use strict";var n=t("../style_layer"),i=t("../../data/bucket/symbol_bucket"),o=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getLayoutValue=function(e,r,n){var i=t.prototype.getLayoutValue.call(this,e,r,n);if("auto"!==i)return i;switch(e){case"text-rotation-alignment":case"icon-rotation-alignment":return"line"===this.getLayoutValue("symbol-placement",r,n)?"map":"viewport";case"text-pitch-alignment":return this.getLayoutValue("text-rotation-alignment",r,n);default:return i}},e.prototype.createBucket=function(t){return new i(t)},e}(n);e.exports=o},{"../../data/bucket/symbol_bucket":7,"../style_layer":63}],69:[function(t,e,r){"use strict";var n=t("./style_layer"),i=t("../util/util"),o=t("feature-filter"),a=t("mapbox-gl-style-spec/lib/group_by_layout"),s=function(t){t&&this.replace(t)};s.prototype.replace=function(t){var e=this;this.symbolOrder=[];for(var r=0,n=t;r<n.length;r+=1){var i=n[r];"symbol"===i.type&&e.symbolOrder.push(i.id)}this._layers={},this.update(t,[])},s.prototype.update=function(t,e,r){for(var s=this,u=0,l=t;u<l.length;u+=1){var c=l[u];s._layers[c.id]=c}for(var p=0,h=e;p<h.length;p+=1){var f=h[p];delete s._layers[f]}r&&(this.symbolOrder=r),this.familiesBySource={};for(var d=a(i.values(this._layers)),m=0,y=d;m<y.length;m+=1){var v=y[m];v=v.map(function(t){return t=n.create(t),t.updatePaintTransitions({},{transition:!1}),t.filter=o(t.filter),t});var g=v[0];if(!g.layout||"none"!==g.layout.visibility){var _=g.source||"",x=s.familiesBySource[_];x||(x=s.familiesBySource[_]={});var b=g.sourceLayer||"_geojsonTileLayer",w=x[b];w||(w=x[b]=[]),w.push(v)}}},e.exports=s},{"../util/util":127,"./style_layer":63,"feature-filter":135,"mapbox-gl-style-spec/lib/group_by_layout":165}],70:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/reference/latest.min")},{"mapbox-gl-style-spec/reference/latest.min":188}],71:[function(t,e,r){"use strict";function n(t,e,r){if(void 0!==t&&void 0!==e)return{from:t.to,fromScale:t.toScale,to:e.to,toScale:e.toScale,t:r}}var i=t("../util/util"),o=t("../util/interpolate"),a={lastIntegerZoom:0,lastIntegerZoomTime:0,lastZoom:0},s=function(t,e,r,i,s){this.declaration=e,this.startTime=this.endTime=(new Date).getTime(),this.oldTransition=r,this.duration=i.duration||0,this.delay=i.delay||0,this.zoomTransitioned="piecewise-constant"===t.function&&t.transition,this.interp=this.zoomTransitioned?n:o[t.type],this.zoomHistory=s||a,this.instant()||(this.endTime=this.startTime+this.duration+this.delay),r&&r.endTime<=this.startTime&&delete r.oldTransition};s.prototype.instant=function(){return!this.oldTransition||!this.interp||0===this.duration&&0===this.delay},s.prototype.calculate=function(t,e,r){var n=this._calculateTargetValue(t,e);if(this.instant())return n;if(r=r||Date.now(),r>=this.endTime)return n;var o=this.oldTransition.calculate(t,e,this.startTime),a=i.easeCubicInOut((r-this.startTime-this.delay)/this.duration);return this.interp(o,n,a)},s.prototype._calculateTargetValue=function(t,e){if(!this.zoomTransitioned)return this.declaration.calculate(t,e);var r=t.zoom,n=this.zoomHistory.lastIntegerZoom,i=r>n?2:.5,a=this.declaration.calculate({zoom:r>n?r-1:r+1},e),s=this.declaration.calculate({zoom:r},e),u=Math.min((Date.now()-this.zoomHistory.lastIntegerZoomTime)/this.duration,1),l=Math.abs(r-n),c=o(u,1,l);return void 0!==a&&void 0!==s?{from:a,fromScale:i,to:s,toScale:1,t:c}:void 0},e.exports=s},{"../util/interpolate":119,"../util/util":127}],72:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/lib/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0;r<e.length;r++)t.fire("error",{error:new Error(e[r].message)});return!0}return!1}},{"mapbox-gl-style-spec/lib/validate_style.min":187}],73:[function(t,e,r){"use strict";var n=t("point-geometry"),i=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(n);e.exports=i},{"point-geometry":194}],74:[function(t,e,r){"use strict";function n(t,e,r,n,i){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-r/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;s<r/2;){var c=t[a-1],p=t[a],h=t[a+1];if(!h)return!1;var f=c.angleTo(p)-p.angleTo(h);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:f}),l+=f;s-u[0].distance>n;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=p.dist(h)}return!0}e.exports=n},{}],75:[function(t,e,r){"use strict";function n(t,e,r,n,o){for(var a=[],s=0;s<t.length;s++)for(var u,l=t[s],c=0;c<l.length-1;c++){var p=l[c],h=l[c+1];p.x<e&&h.x<e||(p.x<e?p=new i(e,p.y+(h.y-p.y)*((e-p.x)/(h.x-p.x)))._round():h.x<e&&(h=new i(e,p.y+(h.y-p.y)*((e-p.x)/(h.x-p.x)))._round()),p.y<r&&h.y<r||(p.y<r?p=new i(p.x+(h.x-p.x)*((r-p.y)/(h.y-p.y)),r)._round():h.y<r&&(h=new i(p.x+(h.x-p.x)*((r-p.y)/(h.y-p.y)),r)._round()),p.x>=n&&h.x>=n||(p.x>=n?p=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round():h.x>=n&&(h=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new i(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round():h.y>=o&&(h=new i(p.x+(h.x-p.x)*((o-p.y)/(h.y-p.y)),o)._round()),u&&p.equals(u[u.length-1])||(u=[p],a.push(u)),u.push(h)))))}return a}var i=t("point-geometry");e.exports=n},{"point-geometry":194}],76:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("point-geometry"),o=n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});Object.defineProperty(o.prototype.StructType.prototype,"anchorPoint",{get:function(){return new i(this.anchorPointX,this.anchorPointY)}}),e.exports=o},{"../util/struct_array":125,"point-geometry":194}],77:[function(t,e,r){"use strict";var n=function(t,e,r,n,i,o,a,s,u,l,c){var p=a.top*s-u,h=a.bottom*s+u,f=a.left*s-u,d=a.right*s+u;if(this.boxStartIndex=t.length,l){var m=h-p,y=d-f;if(m>0)if(m=Math.max(10*s,m),c){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(y),g=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,g,r,0,y,m,n,i,o)}else this._addLineCollisionBoxes(t,e,r,r.segment,y,m,n,i,o)}else t.emplaceBack(r.x,r.y,f,p,d,h,1/0,n,i,o,0,0,0,0,0);this.boxEndIndex=t.length};n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,o,a,s,u){var l=o/2,c=Math.floor(i/l),p=-o/2,h=this.boxes,f=r,d=n+1,m=p;do{if(d--,d<0)return h;m-=e[d].dist(f),f=e[d]}while(m>-i/2);for(var y=e[d].dist(e[d+1]),v=0;v<c;v++){for(var g=-i/2+v*l;m+y<g;){if(m+=y,d++,d+1>=e.length)return h;y=e[d].dist(e[d+1])}var _=g-m,x=e[d],b=e[d+1],w=b.sub(x)._unit()._mult(_)._add(x)._round(),E=Math.max(Math.abs(g-p)-l/2,0),T=i/2/E;t.emplaceBack(w.x,w.y,-o/2,-o/2,o/2,o/2,T,a,s,u,0,0,0,0,0)}return h},e.exports=n},{}],78:[function(t,e,r){"use strict";var n=t("point-geometry"),i=t("../data/extent"),o=t("grid-index"),a=t("../util/intersection_tests"),s=function(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(i,12,6),this.ignoredGrid=new o(i,12,0);this.minScale=.5,this.maxScale=2,this.angle=t,this.pitch=e;var a=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-a,a,s],this.reverseRotationMatrix=[s,a,-a,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();var u=32767;r.emplaceBack(0,0,0,-u,0,u,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(i,0,0,-u,0,u,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-u,0,u,0,u,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,i,-u,0,u,0,u,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]};s.prototype.serialize=function(t){var e=this.grid.toArrayBuffer(),r=this.ignoredGrid.toArrayBuffer();return t&&(t.push(e),t.push(r)),{angle:this.angle,pitch:this.pitch,grid:e,ignoredGrid:r}},s.prototype.placeCollisionFeature=function(t,e,r){for(var i=this,o=this.collisionBoxArray,a=this.minScale,s=this.rotationMatrix,u=this.yStretch,l=t.boxStartIndex;l<t.boxEndIndex;l++){var c=o.get(l),p=c.anchorPoint._matMult(s),h=p.x,f=p.y,d=h+c.x1,m=f+c.y1*u,y=h+c.x2,v=f+c.y2*u;if(c.bbox0=d,c.bbox1=m,c.bbox2=y,c.bbox3=v,!e)for(var g=i.grid.query(d,m,y,v),_=0;_<g.length;_++){var x=o.get(g[_]),b=x.anchorPoint._matMult(s);if(a=i.getPlacementScale(a,p,c,b,x),a>=i.maxScale)return a}if(r){var w;if(i.angle){var E=i.reverseRotationMatrix,T=new n(c.x1,c.y1).matMult(E),S=new n(c.x2,c.y1).matMult(E),z=new n(c.x1,c.y2).matMult(E),A=new n(c.x2,c.y2).matMult(E);w=i.tempCollisionBox,w.anchorPointX=c.anchorPoint.x,w.anchorPointY=c.anchorPoint.y,w.x1=Math.min(T.x,S.x,z.x,A.x),w.y1=Math.min(T.y,S.x,z.x,A.x),w.x2=Math.max(T.x,S.x,z.x,A.x),w.y2=Math.max(T.y,S.x,z.x,A.x),w.maxScale=c.maxScale}else w=c;for(var M=0;M<this.edges.length;M++){var P=i.edges[M];if(a=i.getPlacementScale(a,c.anchorPoint,w,P.anchorPoint,P),a>=i.maxScale)return a}}}return a},s.prototype.queryRenderedSymbols=function(t,e){var r={},i=[];if(0===t.length||0===this.grid.length&&0===this.ignoredGrid.length)return i;for(var o=this.collisionBoxArray,s=this.rotationMatrix,u=this.yStretch,l=[],c=1/0,p=1/0,h=-(1/0),f=-(1/0),d=0;d<t.length;d++)for(var m=t[d],y=0;y<m.length;y++){var v=m[y].matMult(s);c=Math.min(c,v.x),p=Math.min(p,v.y),h=Math.max(h,v.x),f=Math.max(f,v.y),l.push(v)}for(var g=this.grid.query(c,p,h,f),_=this.ignoredGrid.query(c,p,h,f),x=0;x<_.length;x++)g.push(_[x]);for(var b=Math.pow(2,Math.ceil(Math.log(e)/Math.LN2*10)/10),w=0;w<g.length;w++){var E=o.get(g[w]),T=E.sourceLayerIndex,S=E.featureIndex;if(void 0===r[T]&&(r[T]={}),!r[T][S]&&!(b<E.placementScale||b>E.maxScale)){var z=E.anchorPoint.matMult(s),A=z.x+E.x1/e,M=z.y+E.y1/e*u,P=z.x+E.x2/e,L=z.y+E.y2/e*u,k=[new n(A,M),new n(P,M),new n(P,L),new n(A,L)];a.polygonIntersectsPolygon(l,k)&&(r[T][S]=!0,i.push(g[w]))}}return i},s.prototype.getPlacementScale=function(t,e,r,n,i){var o=e.x-n.x,a=e.y-n.y,s=(i.x1-r.x2)/o,u=(i.x2-r.x1)/o,l=(i.y1-r.y2)*this.yStretch/a,c=(i.y2-r.y1)*this.yStretch/a;(isNaN(s)||isNaN(u))&&(s=u=1),(isNaN(l)||isNaN(c))&&(l=c=1);var p=Math.min(Math.max(s,u),Math.max(l,c)),h=i.maxScale,f=r.maxScale;return p>h&&(p=h),p>f&&(p=f),p>t&&p>=i.placementScale&&(t=p),t},s.prototype.insertCollisionFeature=function(t,e,r){for(var n=this,i=r?this.ignoredGrid:this.grid,o=this.collisionBoxArray,a=t.boxStartIndex;a<t.boxEndIndex;a++){var s=o.get(a);s.placementScale=e,e<n.maxScale&&i.insert(a,s.bbox0,s.bbox1,s.bbox2,s.bbox3)}},e.exports=s},{"../data/extent":11,"../util/intersection_tests":120,"grid-index":146,"point-geometry":194}],79:[function(t,e,r){"use strict";function n(t,e,r,n,o,a,s,u,l){var c=n?.6*a*s:0,p=Math.max(n?n.right-n.left:0,o?o.right-o.left:0),h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;e-p*s<e/4&&(e=p*s+e/4);var f=2*a,d=h?e/2*u%e:(p/2+f)*s*u%e;return i(t,d,e,c,r,p*s,h,!1,l)}function i(t,e,r,n,u,l,c,p,h){for(var f=l/2,d=0,m=0;m<t.length-1;m++)d+=t[m].dist(t[m+1]);for(var y=0,v=e-r,g=[],_=0;_<t.length-1;_++){for(var x=t[_],b=t[_+1],w=x.dist(b),E=b.angleTo(x);v+r<y+w;){v+=r;var T=(v-y)/w,S=o(x.x,b.x,T),z=o(x.y,b.y,T);if(S>=0&&S<h&&z>=0&&z<h&&v-f>=0&&v+f<=d){var A=new a(S,z,E,_)._round();n&&!s(t,A,l,n,u)||g.push(A)}}y+=w}return p||g.length||c||(g=i(t,y/2,r,n,u,l,c,!0,h)),g}var o=t("../util/interpolate"),a=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../symbol/anchor":73,"../util/interpolate":119,"./check_max_angle":74}],80:[function(t,e,r){"use strict";var n=t("shelf-pack"),i=t("../util/util"),o=4,a=128,s=2048,u=function(){this.width=a,this.height=a,this.bin=new n(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)};u.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},u.prototype.getRects=function(){var t,e,r,n=this,i={};for(var o in this.ids)t=o.split("#"),e=t[0],r=t[1],i[e]||(i[e]={}),i[e][r]=n.index[o];return i},u.prototype.addGlyph=function(t,e,r,n){var o=this;if(!r)return null;var a=e+"#"+r.id;if(this.index[a])return this.ids[a].indexOf(t)<0&&this.ids[a].push(t),this.index[a];if(!r.bitmap)return null;var s=r.width+2*n,u=r.height+2*n,l=1,c=s+2*l,p=u+2*l;c+=4-c%4,p+=4-p%4;var h=this.bin.packOne(c,p);if(h||(this.resize(),h=this.bin.packOne(c,p)),!h)return i.warnOnce("glyph bitmap overflow"),null;this.index[a]=h,this.ids[a]=[t];for(var f=this.data,d=r.bitmap,m=0;m<u;m++)for(var y=o.width*(h.y+m+l)+h.x+l,v=s*m,g=0;g<s;g++)f[y+g]=d[v+g];return this.dirty=!0,h},u.prototype.resize=function(){var t=this,e=this.width,r=this.height;if(!(e>=s||r>=s)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=o,this.height*=o,this.bin.resize(this.width,this.height);for(var n=new ArrayBuffer(this.width*this.height),i=0;i<r;i++){var a=new Uint8Array(t.data.buffer,r*i,e),u=new Uint8Array(n,r*i*o,e);u.set(a)}this.data=new Uint8Array(n)}},u.prototype.bind=function(t){this.gl=t,this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,null))},u.prototype.updateTexture=function(t){this.bind(t),this.dirty&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data),this.dirty=!1)},e.exports=u},{"../util/util":127,"shelf-pack":197}],81:[function(t,e,r){"use strict";function n(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}var i=t("../util/mapbox").normalizeGlyphsURL,o=t("../util/ajax"),a=t("../util/verticalize_punctuation"),s=t("../util/glyphs"),u=t("../symbol/glyph_atlas"),l=t("pbf"),c=function(t,e,r){var n=1;this.advance=t.advance,this.left=t.left-r-n,this.top=t.top+r+n,this.rect=e},p=function(t){this.url=t&&i(t),this.atlases={},this.stacks={},this.loading={}};p.prototype.getSimpleGlyphs=function(t,e,r,n){var i=this;void 0===this.stacks[t]&&(this.stacks[t]={}),void 0===this.atlases[t]&&(this.atlases[t]=new u);for(var o={},s=this.stacks[t],l=this.atlases[t],p=3,h={},f=0,d=function(e){var n=Math.floor(e/256);if(s[n]){var i=s[n].glyphs[e],a=l.addGlyph(r,t,i,p);i&&(o[e]=new c(i,a,p))}else void 0===h[n]&&(h[n]=[],f++),h[n].push(e)},m=0;m<e.length;m++){var y=e[m],v=String.fromCharCode(y);d(y),a.lookup[v]&&d(a.lookup[v].charCodeAt(0))}f||n(void 0,o,t);var g=function(e,a,s){if(!e)for(var u=i.stacks[t][a]=s.stacks[0],d=0;d<h[a].length;d++){var m=h[a][d],y=u.glyphs[m],v=l.addGlyph(r,t,y,p);y&&(o[m]=new c(y,v,p))}f--,f||n(void 0,o,t)};for(var _ in h)i.loadRange(t,_,g)},p.prototype.loadRange=function(t,e,r){if(256*e>65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var i=this.loading[t];if(i[e])i[e].push(r);else{i[e]=[r];var a=256*e+"-"+(256*e+255),u=n(t,a,this.url);o.getArrayBuffer(u,function(t,r){for(var n=!t&&new s(new l(r)),o=0;o<i[e].length;o++)i[e][o](t,e,n);delete i[e]})}},p.prototype.getGlyphAtlas=function(t){return this.atlases[t]},e.exports=p},{"../symbol/glyph_atlas":80,"../util/ajax":107,"../util/glyphs":118,"../util/mapbox":123,"../util/verticalize_punctuation":129,pbf:193}],82:[function(t,e,r){"use strict";e.exports=function(t){function e(e){s.push(t[e]),u++}function r(t,e,r){var n=a[t];return delete a[t],a[e]=n,s[n].geometry[0].pop(),s[n].geometry[0]=s[n].geometry[0].concat(r[0]),n}function n(t,e,r){var n=o[e];return delete o[e],o[t]=n,s[n].geometry[0].shift(),s[n].geometry[0]=r[0].concat(s[n].geometry[0]),n}function i(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var o={},a={},s=[],u=0,l=0;l<t.length;l++){var c=t[l],p=c.geometry,h=c.text;if(h){var f=i(h,p),d=i(h,p,!0);if(f in a&&d in o&&a[f]!==o[d]){var m=n(f,d,p),y=r(f,d,s[m].geometry);delete o[f],delete a[d],a[i(h,s[y].geometry,!0)]=y,s[m].geometry=null}else f in a?r(f,d,p):d in o?n(f,d,p):(e(l),o[f]=u-1,a[d]=u-1)}else e(l)}return s.filter(function(t){return t.geometry})}},{}],83:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a,s,u,l,c){this.anchorPoint=t,this.tl=e,this.tr=r,this.bl=n,this.br=i,this.tex=o,this.anchorAngle=a,this.glyphAngle=s,this.minScale=u,this.maxScale=l,this.writingMode=c}function i(t,e,r,i,o,a,l,c,p){var h,f,d,m,y=e.image.rect,v=o.layout,g=1,_=e.left-g,x=_+y.w/e.image.pixelRatio,b=e.top-g,w=b+y.h/e.image.pixelRatio;if("none"!==v["icon-text-fit"]&&l){var E=x-_,T=w-b,S=v["text-size"]/24,z=l.left*S,A=l.right*S,M=l.top*S,P=l.bottom*S,L=A-z,k=P-M,C=v["icon-text-fit-padding"][0],I=v["icon-text-fit-padding"][1],R=v["icon-text-fit-padding"][2],D=v["icon-text-fit-padding"][3],O="width"===v["icon-text-fit"]?.5*(k-T):0,B="height"===v["icon-text-fit"]?.5*(L-E):0,j="width"===v["icon-text-fit"]||"both"===v["icon-text-fit"]?L:E,F="height"===v["icon-text-fit"]||"both"===v["icon-text-fit"]?k:T;h=new s(z+B-D,M+O-C),f=new s(z+B+I+j,M+O-C),d=new s(z+B+I+j,M+O+R+F),m=new s(z+B-D,M+O+R+F)}else h=new s(_,b),f=new s(x,b),d=new s(x,w),m=new s(_,w);var U=o.getLayoutValue("icon-rotate",c,p)*Math.PI/180;if(a){var N=i[t.segment];if(t.y===N.y&&t.x===N.x&&t.segment+1<i.length){var V=i[t.segment+1];U+=Math.atan2(t.y-V.y,t.x-V.x)+Math.PI}else U+=Math.atan2(t.y-N.y,t.x-N.x)}if(U){var q=Math.sin(U),Z=Math.cos(U),G=[Z,-q,q,Z];
h=h.matMult(G),f=f.matMult(G),m=m.matMult(G),d=d.matMult(G)}return[new n(new s(t.x,t.y),h,f,m,d,e.image.rect,0,0,u,1/0)]}function o(t,e,r,i,o,l){for(var c=o.layout["text-rotate"]*Math.PI/180,p=o.layout["text-keep-upright"],h=e.positionedGlyphs,f=[],d=0;d<h.length;d++){var m=h[d],y=m.glyph;if(y){var v=y.rect;if(v){var g,_=(m.x+y.advance/2)*r,x=u;l?(g=[],x=a(g,t,_,i,t.segment,!0),p&&(x=Math.min(x,a(g,t,_,i,t.segment,!1)))):g=[{anchorPoint:new s(t.x,t.y),offset:0,angle:0,maxScale:1/0,minScale:u}];var b=m.x+y.left,w=m.y-y.top,E=b+v.w,T=w+v.h,S=new s(m.x,y.advance/2),z=new s(b,w),A=new s(E,w),M=new s(b,T),P=new s(E,T);0!==m.angle&&(z._sub(S)._rotate(m.angle)._add(S),A._sub(S)._rotate(m.angle)._add(S),M._sub(S)._rotate(m.angle)._add(S),P._sub(S)._rotate(m.angle)._add(S));for(var L=0;L<g.length;L++){var k=g[L],C=z,I=A,R=M,D=P;if(c){var O=Math.sin(c),B=Math.cos(c),j=[B,-O,O,B];C=C.matMult(j),I=I.matMult(j),R=R.matMult(j),D=D.matMult(j)}var F=Math.max(k.minScale,x),U=(t.angle+k.offset+2*Math.PI)%(2*Math.PI),N=(k.angle+k.offset+2*Math.PI)%(2*Math.PI);f.push(new n(k.anchorPoint,C,I,R,D,v,U,N,F,k.maxScale,e.writingMode))}}}}return f}function a(t,e,r,n,i,o){var a=!o;r<0&&(o=!o),o&&i++;var l=new s(e.x,e.y),c=n[i],p=1/0;r=Math.abs(r);for(var h=u;;){var f=l.dist(c),d=r/f,m=Math.atan2(c.y-l.y,c.x-l.x);if(o||(m+=Math.PI),t.push({anchorPoint:l,offset:a?Math.PI:0,minScale:d,maxScale:p,angle:(m+2*Math.PI)%(2*Math.PI)}),d<=h)break;for(l=c;l.equals(c);)if(i+=o?1:-1,c=n[i],!c)return d;var y=c.sub(l)._unit();l=l.sub(y._mult(f)),p=d}return h}var s=t("point-geometry");e.exports={getIconQuads:i,getGlyphQuads:o,SymbolQuad:n};var u=.5},{"point-geometry":194}],84:[function(t,e,r){"use strict";var n=t("../util/token");e.exports=function(t,e){var r=n(t.properties,e["text-field"]);if(r){r=r.toString();var i=e["text-transform"];return"uppercase"===i?r=r.toLocaleUpperCase():"lowercase"===i&&(r=r.toLocaleLowerCase()),r}}},{"../util/token":126}],85:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.codePoint=t,this.x=e,this.y=r,this.glyph=n||null,this.angle=i}function i(t,e,r,n,i,o,a){this.positionedGlyphs=t,this.text=e,this.top=r,this.bottom=n,this.left=i,this.right=o,this.writingMode=a}function o(t,e){for(var r=[],n=0,i=0,o=e;i<o.length;i+=1){var a=o[i];r.push(t.substring(n,a)),n=a}return n<t.length&&r.push(t.substring(n,t.length)),r}function a(t,e,r,n,a,s,u,l,c,p,d){t=t.trim(),d===x.vertical&&(t=_(t));var m=[],y=new i(m,t,c[1],c[1],c[0],c[0],d),v=d===x.horizontal&&r?o(t,h(t,l,r,e)):[t];return f(y,e,v,n,a,s,u,c,d,l,p),!!m.length&&y}function s(t,e,r,n){var i=0;for(var o in t){var a=n[t.charCodeAt(o)];a&&(i+=a.advance+e)}var s=Math.max(1,Math.ceil(i/r));return i/s}function u(t,e,r,n){var i=Math.pow(t-e,2);return n&&t<e?Math.max(0,i-150):i+Math.abs(r)*r}function l(t,e){var r=0;return 10===t&&(r-=1e4),!e||40!==e&&65288!==e||(r+=50),41!==t&&65289!==t||(r+=50),r}function c(t,e,r,n,i,o){for(var a=[],s=0,l=n;s<l.length;s+=1){var c=l[s],p=e-c.x;a.push({priorBreak:c,badness:u(p,r,i,o)+c.badness})}return a.push({priorBreak:null,badness:u(e,r,i,o)}),a.sort(function(t,e){return t.badness-e.badness}),{index:t,x:e,priorBreak:a[0].priorBreak,badness:a[0].badness}}function p(t){return t?p(t.priorBreak).concat(t.index):[]}function h(t,e,r,n){if(!r)return[];if(!t)return[];for(var i=[],o=s(t,e,r,n),a=0,u=0;u<t.length;u++){var h=t.charCodeAt(u),f=n[h];if(f||h===b){if(w[h]||g.charAllowsIdeographicBreaking(h)){var d=t.charCodeAt(u-1);i.unshift(c(u,a,o,i,l(h,d),!1))}f&&(a+=f.advance+e)}}return i.unshift(c(t.length,a,o,i,0,!0)),p(i.shift())}function f(t,e,r,i,o,a,s,u,l,c,p){var h=-17,f=0,y=h,v=0,_=t.positionedGlyphs;for(var b in r){var w=r[b].trim();if(w.length){for(var E=_.length,T=0;T<w.length;T++){var S=w.charCodeAt(T),z=e[S];z&&(g.charHasUprightVerticalOrientation(S)&&l!==x.horizontal?(_.push(new n(S,f,0,z,-Math.PI/2)),f+=p+c):(_.push(new n(S,f,y,z,0)),f+=z.advance+c))}if(_.length!==E){var A=f-c;v=Math.max(A,v),d(_,e,E,_.length-1,s)}f=0,y+=i}else y+=i}m(_,s,o,a,v,i,r.length,u);var M=r.length*i;t.top+=-a*M,t.bottom=t.top+M,t.left+=-o*v,t.right=t.left+v}function d(t,e,r,n,i){if(i)for(var o=e[t[n].codePoint].advance,a=(t[n].x+o)*i,s=r;s<=n;s++)t[s].x-=a}function m(t,e,r,n,i,o,a,s){for(var u=(e-r)*i+s[0],l=(-n*a+.5)*o+s[1],c=0;c<t.length;c++)t[c].x+=u,t[c].y+=l}function y(t,e){if(!t||!t.rect)return null;var r=e[0],n=e[1],i=r-t.width/2,o=i+t.width,a=n-t.height/2,s=a+t.height;return new v(t,a,s,i,o)}function v(t,e,r,n,i){this.image=t,this.top=e,this.bottom=r,this.left=n,this.right=i}var g=t("../util/script_detection"),_=t("../util/verticalize_punctuation"),x={horizontal:1,vertical:2};e.exports={shapeText:a,shapeIcon:y,WritingMode:x};var b=10,w={32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};w[b]=!0},{"../util/script_detection":124,"../util/verticalize_punctuation":129}],86:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a,s,u,l,c){var p,h,f=n*e+r,d=s*o+a;if(c)for(d-=o,h=-1;h<=l;h++,f=((h+l)%l+n)*e+r,d+=o)for(p=-1;p<=u;p++)i[d+p]=t[f+(p+u)%u];else for(h=0;h<l;h++,f+=e,d+=o)for(p=0;p<u;p++)i[d+p]=t[f+p]}var i=t("shelf-pack"),o=t("../util/browser"),a=t("../util/util"),s=function(t,e,r,n,i){this.rect=t,this.width=e,this.height=r,this.sdf=n,this.pixelRatio=i},u=function(t,e){this.width=t,this.height=e,this.bin=new i(t,e),this.images={},this.data=!1,this.texture=0,this.filter=0,this.pixelRatio=1,this.dirty=!0};u.prototype.allocateImage=function(t,e){t/=this.pixelRatio,e/=this.pixelRatio;var r=2,n=t+r+(4-(t+r)%4),i=e+r+(4-(e+r)%4),o=this.bin.packOne(n,i);return o?o:(a.warnOnce("SpriteAtlas out of space."),null)},u.prototype.getImage=function(t,e){if(this.images[t])return this.images[t];if(!this.sprite)return null;var r=this.sprite.getSpritePosition(t);if(!r.width||!r.height)return null;var n=this.allocateImage(r.width,r.height);if(!n)return null;var i=new s(n,r.width/r.pixelRatio,r.height/r.pixelRatio,r.sdf,r.pixelRatio/this.pixelRatio);return this.images[t]=i,this.copy(n,r,e),i},u.prototype.getPosition=function(t,e){var r=this.getImage(t,e),n=r&&r.rect;if(!n)return null;var i=r.width*r.pixelRatio,o=r.height*r.pixelRatio,a=1;return{size:[r.width,r.height],tl:[(n.x+a)/this.width,(n.y+a)/this.height],br:[(n.x+a+i)/this.width,(n.y+a+o)/this.height]}},u.prototype.allocate=function(){var t=this;if(!this.data){var e=Math.floor(this.width*this.pixelRatio),r=Math.floor(this.height*this.pixelRatio);this.data=new Uint32Array(e*r);for(var n=0;n<this.data.length;n++)t.data[n]=0}},u.prototype.copy=function(t,e,r){if(this.sprite.imgData){var i=new Uint32Array(this.sprite.imgData.buffer);this.allocate();var o=this.data,a=1;n(i,this.sprite.width,e.x,e.y,o,this.width*this.pixelRatio,(t.x+a)*this.pixelRatio,(t.y+a)*this.pixelRatio,e.width,e.height,r),this.dirty=!0}},u.prototype.setSprite=function(t){t&&(this.pixelRatio=o.devicePixelRatio>1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},u.prototype.addIcons=function(t,e){for(var r=this,n=0;n<t.length;n++)r.getImage(t[n]);e(null,this.images)},u.prototype.bind=function(t,e){var r=!1;this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r=!0);var n=e?t.LINEAR:t.NEAREST;n!==this.filter&&(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n),this.filter=n),this.dirty&&(this.allocate(),r?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width*this.pixelRatio,this.height*this.pixelRatio,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width*this.pixelRatio,this.height*this.pixelRatio,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)),this.dirty=!1)},e.exports=u},{"../util/browser":108,"../util/util":127,"shelf-pack":197}],87:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("point-geometry"),o=n({members:[{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"glyphQuadStartIndex"},{type:"Uint16",name:"glyphQuadEndIndex"},{type:"Uint16",name:"iconQuadStartIndex"},{type:"Uint16",name:"iconQuadEndIndex"},{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int8",name:"index"},{type:"Uint8",name:"writingModes"}]});Object.defineProperty(o.prototype.StructType.prototype,"anchorPoint",{get:function(){return new i(this.anchorPointX,this.anchorPointY)}}),e.exports=o},{"../util/struct_array":125,"point-geometry":194}],88:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("point-geometry"),o=t("./quads").SymbolQuad,a=n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Float32",name:"tlX"},{type:"Float32",name:"tlY"},{type:"Float32",name:"trX"},{type:"Float32",name:"trY"},{type:"Float32",name:"blX"},{type:"Float32",name:"blY"},{type:"Float32",name:"brX"},{type:"Float32",name:"brY"},{type:"Int16",name:"texH"},{type:"Int16",name:"texW"},{type:"Int16",name:"texX"},{type:"Int16",name:"texY"},{type:"Float32",name:"anchorAngle"},{type:"Float32",name:"glyphAngle"},{type:"Float32",name:"maxScale"},{type:"Float32",name:"minScale"},{type:"Uint8",name:"writingMode"}]});Object.defineProperty(a.prototype.StructType.prototype,"anchorPoint",{get:function(){return new i(this.anchorPointX,this.anchorPointY)}}),Object.defineProperty(a.prototype.StructType.prototype,"SymbolQuad",{get:function(){return new o(this.anchorPoint,new i(this.tlX,this.tlY),new i(this.trX,this.trY),new i(this.blX,this.blY),new i(this.brX,this.brY),{x:this.texX,y:this.texY,h:this.texH,w:this.texW,height:this.texH,width:this.texW},this.anchorAngle,this.glyphAngle,this.minScale,this.maxScale,this.writingMode)}}),e.exports=a},{"../util/struct_array":125,"./quads":83,"point-geometry":194}],89:[function(t,e,r){"use strict";var n=t("../util/dom"),i=t("point-geometry"),o={scrollZoom:t("./handler/scroll_zoom"),boxZoom:t("./handler/box_zoom"),dragRotate:t("./handler/drag_rotate"),dragPan:t("./handler/drag_pan"),keyboard:t("./handler/keyboard"),doubleClickZoom:t("./handler/dblclick_zoom"),touchZoomRotate:t("./handler/touch_zoom_rotate")};e.exports=function(t,e){function r(t){v("mouseout",t)}function a(e){t.stop(),w=n.mousePos(_,e),v("mousedown",e),b=!0}function s(e){var r=t.dragRotate&&t.dragRotate.isActive();x&&!r&&v("contextmenu",x),x=null,b=!1,v("mouseup",e)}function u(e){if(!(t.dragPan&&t.dragPan.isActive()||t.dragRotate&&t.dragRotate.isActive())){for(var r=e.toElement||e.target;r&&r!==_;)r=r.parentNode;r===_&&v("mousemove",e)}}function l(e){t.stop(),g("touchstart",e),!e.touches||e.touches.length>1||(E?(clearTimeout(E),E=null,v("dblclick",e)):E=setTimeout(f,300))}function c(t){g("touchmove",t)}function p(t){g("touchend",t)}function h(t){g("touchcancel",t)}function f(){E=null}function d(t){var e=n.mousePos(_,t);e.equals(w)&&v("click",t)}function m(t){v("dblclick",t),t.preventDefault()}function y(e){var r=t.dragRotate&&t.dragRotate.isActive();b||r?b&&(x=e):v("contextmenu",e),e.preventDefault()}function v(e,r){var i=n.mousePos(_,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function g(e,r){var o=n.touchPos(_,r),a=o.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(a),point:a,lngLats:o.map(function(e){return t.unproject(e)},this),points:o,originalEvent:r})}var _=t.getCanvasContainer(),x=null,b=!1,w=null,E=null;for(var T in o)t[T]=new o[T](t,e),e.interactive&&e[T]&&t[T].enable();_.addEventListener("mouseout",r,!1),_.addEventListener("mousedown",a,!1),_.addEventListener("mouseup",s,!1),_.addEventListener("mousemove",u,!1),_.addEventListener("touchstart",l,!1),_.addEventListener("touchend",p,!1),_.addEventListener("touchmove",c,!1),_.addEventListener("touchcancel",h,!1),_.addEventListener("click",d,!1),_.addEventListener("dblclick",m,!1),_.addEventListener("contextmenu",y,!1)}},{"../util/dom":115,"./handler/box_zoom":95,"./handler/dblclick_zoom":96,"./handler/drag_pan":97,"./handler/drag_rotate":98,"./handler/keyboard":99,"./handler/scroll_zoom":100,"./handler/touch_zoom_rotate":101,"point-geometry":194}],90:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),o=t("../util/browser"),a=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),u=t("point-geometry"),l=t("../util/evented"),c=function(t){function e(e,r){t.call(this),this.transform=e,this._bearingSnap=r.bearingSnap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCenter=function(){return this.transform.center},e.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e),this},e.prototype.panBy=function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:u.convert(t).mult(-1)},e),r),this},e.prototype.panTo=function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},e.prototype.getZoom=function(){return this.transform.zoom},e.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},e.prototype.zoomTo=function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},e.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},e.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},e.prototype.getBearing=function(){return this.transform.bearing},e.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},e.prototype.rotateTo=function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},e.prototype.resetNorth=function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},e.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},e.prototype.getPitch=function(){return this.transform.pitch},e.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},e.prototype.fitBounds=function(t,e,r){e=n.extend({padding:0,offset:[0,0],maxZoom:this.getMaxZoom()},e),t=s.convert(t);var i=u.convert(e.offset),o=this.transform,a=o.project(t.getNorthWest()),l=o.project(t.getSouthEast()),c=l.sub(a),p=(o.width-2*e.padding-2*Math.abs(i.x))/c.x,h=(o.height-2*e.padding-2*Math.abs(i.y))/c.y;return e.center=o.unproject(a.add(l).div(2)),e.zoom=Math.min(o.scaleZoom(o.scale*Math.min(p,h)),e.maxZoom),e.bearing=0,e.linear?this.easeTo(e,r):this.flyTo(e,r)},e.prototype.jumpTo=function(t,e){this.stop();var r=this.transform,n=!1,i=!1,o=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(n=!0,r.zoom=+t.zoom),"center"in t&&(r.center=a.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(i=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(o=!0,r.pitch=+t.pitch),this.fire("movestart",e).fire("move",e),n&&this.fire("zoomstart",e).fire("zoom",e).fire("zoomend",e),i&&this.fire("rotate",e),o&&this.fire("pitch",e),this.fire("moveend",e)},e.prototype.easeTo=function(t,e){var r=this;this.stop(),t=n.extend({offset:[0,0],duration:500,easing:n.ease},t);var o,s,l=this.transform,c=u.convert(t.offset),p=this.getZoom(),h=this.getBearing(),f=this.getPitch(),d="zoom"in t?+t.zoom:p,m="bearing"in t?this._normalizeBearing(t.bearing,h):h,y="pitch"in t?+t.pitch:f;"center"in t?(o=a.convert(t.center),s=l.centerPoint.add(c)):"around"in t?(o=a.convert(t.around),s=l.locationPoint(o)):(s=l.centerPoint.add(c),o=l.pointLocation(s));var v=l.locationPoint(o);return t.animate===!1&&(t.duration=0),this.zooming=d!==p,this.rotating=h!==m,this.pitching=y!==f,t.smoothEasing&&0!==t.duration&&(t.easing=this._smoothOutEasing(t.duration)),t.noMoveStart||this.fire("movestart",e),this.zooming&&this.fire("zoomstart",e),clearTimeout(this._onEaseEnd),this._ease(function(t){this.zooming&&(l.zoom=i(p,d,t)),this.rotating&&(l.bearing=i(h,m,t)),this.pitching&&(l.pitch=i(f,y,t)),l.setLocationAtPoint(o,v.add(s.sub(v)._mult(t))),this.fire("move",e),this.zooming&&this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)},function(){t.delayEndEvents?r._onEaseEnd=setTimeout(r._easeToEnd.bind(r,e),t.delayEndEvents):r._easeToEnd(e)},t),this},e.prototype._easeToEnd=function(t){var e=this.zooming;this.zooming=!1,this.rotating=!1,this.pitching=!1,e&&this.fire("zoomend",t),this.fire("moveend",t)},e.prototype.flyTo=function(t,e){function r(t){var e=(T*T-E*E+(t?-1:1)*M*M*S*S)/(2*(t?T:E)*M*S);return Math.log(Math.sqrt(e*e+1)-e)}function o(t){return(Math.exp(t)-Math.exp(-t))/2}function s(t){return(Math.exp(t)+Math.exp(-t))/2}function l(t){return o(t)/s(t)}this.stop(),t=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},t);var c=this.transform,p=u.convert(t.offset),h=this.getZoom(),f=this.getBearing(),d=this.getPitch(),m="center"in t?a.convert(t.center):this.getCenter(),y="zoom"in t?+t.zoom:h,v="bearing"in t?this._normalizeBearing(t.bearing,f):f,g="pitch"in t?+t.pitch:d;Math.abs(c.center.lng)+Math.abs(m.lng)>180&&(c.center.lng>0&&m.lng<0?m.lng+=360:c.center.lng<0&&m.lng>0&&(m.lng-=360));var _=c.zoomScale(y-h),x=c.point,b="center"in t?c.project(m).sub(p.div(_)):x,w=t.curve,E=Math.max(c.width,c.height),T=E/_,S=b.sub(x).mag();if("minZoom"in t){var z=n.clamp(Math.min(t.minZoom,h,y),c.minZoom,c.maxZoom),A=E/c.zoomScale(z-h);w=Math.sqrt(A/S*2)}var M=w*w,P=r(0),L=function(t){return s(P)/s(P+w*t)},k=function(t){return E*((s(P)*l(P+w*t)-o(P))/M)/S},C=(r(1)-P)/w;if(Math.abs(S)<1e-6){if(Math.abs(E-T)<1e-6)return this.easeTo(t);var I=T<E?-1:1;C=Math.abs(Math.log(T/E))/w,k=function(){return 0},L=function(t){return Math.exp(I*w*t)}}if("duration"in t)t.duration=+t.duration;else{var R="screenSpeed"in t?+t.screenSpeed/w:+t.speed;t.duration=1e3*C/R}return this.zooming=!0,f!==v&&(this.rotating=!0),d!==g&&(this.pitching=!0),this.fire("movestart",e),this.fire("zoomstart",e),this._ease(function(t){var r=t*C,n=k(r),o=1/L(r);c.zoom=h+c.scaleZoom(o),c.center=c.unproject(x.add(b.sub(x).mult(n)).mult(o)),this.rotating&&(c.bearing=i(f,v,t)),this.pitching&&(c.pitch=i(d,g,t)),this.fire("move",e),this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)},function(){this.zooming=!1,this.rotating=!1,this.pitching=!1,this.fire("zoomend",e),this.fire("moveend",e)},t),this},e.prototype.isEasing=function(){return!!this._abortFn},e.prototype.stop=function(){return this._abortFn&&(this._abortFn(),this._finishEase()),this},e.prototype._ease=function(t,e,r){this._finishFn=e,this._abortFn=o.timed(function(e){t.call(this,r.easing(e)),1===e&&this._finishEase()},r.animate===!1?0:r.duration,this)},e.prototype._finishEase=function(){delete this._abortFn;var t=this._finishFn;delete this._finishFn,t.call(this)},e.prototype._normalizeBearing=function(t,e){t=n.wrap(t,-180,180);var r=Math.abs(t-e);return Math.abs(t-360-e)<r&&(t-=360),Math.abs(t+360-e)<r&&(t+=360),t},e.prototype._smoothOutEasing=function(t){var e=n.ease;if(this._prevEase){var r=this._prevEase,i=(Date.now()-r.start)/r.duration,o=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);e=n.bezier(a,s,.25,1)}return this._prevEase={start:(new Date).getTime(),duration:t,easing:e},e},e}(l);e.exports=c},{"../geo/lng_lat":19,"../geo/lng_lat_bounds":20,"../util/browser":108,"../util/evented":116,"../util/interpolate":119,"../util/util":127,"point-geometry":194}],91:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=function(t){this.options=t,i.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};o.prototype.getDefaultPosition=function(){return"bottom-right"},o.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),e&&this._container.classList.add("compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("data",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},o.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("data",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},o.prototype._updateEditLink=function(){if(this._editLink||(this._editLink=this._container.querySelector(".mapbox-improve-map")),this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}},o.prototype._updateData=function(t){"source"===t.dataType&&(this._updateAttributions(),this._updateEditLink())},o.prototype._updateAttributions=function(){if(this._map.style){var t=[],e=this._map.style.sourceCaches;for(var r in e){var n=e[r].getSource();n.attribution&&t.indexOf(n.attribution)<0&&t.push(n.attribution)}t.sort(function(t,e){return t.length-e.length}),t=t.filter(function(e,r){for(var n=r+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0}),this._container.innerHTML=t.join(" | "),this._editLink=null}},o.prototype._updateCompact=function(){var t=this._map.getCanvasContainer().offsetWidth<=640;this._container.classList[t?"add":"remove"]("compact")},e.exports=o},{"../../util/dom":115,"../../util/util":127}],92:[function(t,e,r){"use strict";function n(t){void 0!==i?t(i):void 0!==s.navigator.permissions?s.navigator.permissions.query({name:"geolocation"}).then(function(e){i="denied"!==e.state,t(i)}):(i=!!s.navigator.geolocation,t(i))}var i,o=t("../../util/evented"),a=t("../../util/dom"),s=t("../../util/window"),u=t("../../util/util"),l={enableHighAccuracy:!1,timeout:6e3},c="mapboxgl-ctrl",p=function(t){function e(e){t.call(this),this.options=e,u.bindAll(["_onSuccess","_onError","_finish","_setupUI"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.onAdd=function(t){return this._map=t,this._container=a.create("div",c+" "+c+"-group"),n(this._setupUI),this._container},e.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},e.prototype._onSuccess=function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},e.prototype._onError=function(t){this.fire("error",t),this._finish()},e.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},e.prototype._setupUI=function(t){t!==!1&&(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=a.create("button",c+"-icon "+c+"-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.watchPosition&&this._geolocateButton.setAttribute("aria-pressed",!1),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)))},e.prototype._onClickGeolocate=function(){var t=u.extend(l,this.options&&this.options.positionOptions||{});this.options.watchPosition?void 0!==this._geolocationWatchID?(this._geolocateButton.classList.remove("watching"),this._geolocateButton.setAttribute("aria-pressed",!1),s.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0):(this._geolocateButton.classList.add("watching"),this._geolocateButton.setAttribute("aria-pressed",!0),this._geolocationWatchID=s.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)):(s.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,t),this._timeoutId=setTimeout(this._finish,1e4))},e}(o);e.exports=p},{"../../util/dom":115,"../../util/evented":116,"../../util/util":127,"../../util/window":110}],93:[function(t,e,r){"use strict";function n(t){return new o.MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var i=t("../../util/dom"),o=t("../../util/window"),a=t("../../util/util"),s="mapboxgl-ctrl",u=function(){a.bindAll(["_rotateCompassArrow"],this)};u.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},u.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div",s+" "+s+"-group",t.getContainer()),this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(s+"-icon "+s+"-zoom-in","Zoom In",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(s+"-icon "+s+"-zoom-out","Zoom Out",t.zoomOut.bind(t)),this._compass=this._createButton(s+"-icon "+s+"-compass","Reset North",t.resetNorth.bind(t)),this._compassArrow=i.create("span","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._container},u.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("rotate",this._rotateCompassArrow),this._map=void 0},u.prototype._onContextMenu=function(t){t.preventDefault()},u.prototype._onCompassDown=function(t){0===t.button&&(i.disableDrag(),o.document.addEventListener("mousemove",this._onCompassMove),o.document.addEventListener("mouseup",this._onCompassUp),this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._onCompassMove=function(t){0===t.button&&(this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._onCompassUp=function(t){0===t.button&&(o.document.removeEventListener("mousemove",this._onCompassMove),o.document.removeEventListener("mouseup",this._onCompassUp),i.enableDrag(),this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._createButton=function(t,e,r){var n=i.create("button",t,this._container);return n.type="button",n.setAttribute("aria-label",e),n.addEventListener("click",function(){r()}),n},e.exports=u},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],94:[function(t,e,r){"use strict";function n(t,e,r){var n=r&&r.maxWidth||100,a=t._container.clientHeight/2,s=o(t.unproject([0,a]),t.unproject([n,a]));if(r&&"imperial"===r.unit){var u=3.2808*s;if(u>5280){var l=u/5280;i(e,n,l,"mi")}else i(e,n,u,"ft")}else i(e,n,s,"m")}function i(t,e,r,n){var i=a(r),o=i/r;"m"===n&&i>=1e3&&(i/=1e3,n="km"),t.style.width=e*o+"px",t.innerHTML=i+n}function o(t,e){var r=6371e3,n=Math.PI/180,i=t.lat*n,o=e.lat*n,a=Math.sin(i)*Math.sin(o)+Math.cos(i)*Math.cos(o)*Math.cos((e.lng-t.lng)*n),s=r*Math.acos(Math.min(a,1));return s}function a(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:1,e*r}var s=t("../../util/dom"),u=t("../../util/util"),l=function(t){this.options=t,u.bindAll(["_onMove"],this)};l.prototype.getDefaultPosition=function(){return"bottom-left"},l.prototype._onMove=function(){n(this._map,this._container,this.options)},l.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},l.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("move",this._onMove),this._map=void 0},e.exports=l},{"../../util/dom":115,"../../util/util":127}],95:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../geo/lng_lat_bounds"),o=t("../../util/util"),a=t("../../util/window"),s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},s.prototype._onMouseDown=function(t){t.shiftKey&&0===t.button&&(a.document.addEventListener("mousemove",this._onMouseMove,!1),a.document.addEventListener("keydown",this._onKeyDown,!1),a.document.addEventListener("mouseup",this._onMouseUp,!1),n.disableDrag(),this._startPos=n.mousePos(this._el,t),this._active=!0)},s.prototype._onMouseMove=function(t){var e=this._startPos,r=n.mousePos(this._el,t);this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(e.x,r.x),o=Math.max(e.x,r.x),a=Math.min(e.y,r.y),s=Math.max(e.y,r.y);n.setTransform(this._box,"translate("+i+"px,"+a+"px)"),this._box.style.width=o-i+"px",this._box.style.height=s-a+"px"},s.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=n.mousePos(this._el,t),o=(new i).extend(this._map.unproject(e)).extend(this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(o,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:o})}},s.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},s.prototype._finish=function(){this._active=!1,a.document.removeEventListener("mousemove",this._onMouseMove,!1),a.document.removeEventListener("keydown",this._onKeyDown,!1),a.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),n.enableDrag()},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},e.exports=s},{"../../geo/lng_lat_bounds":20,"../../util/dom":115,"../../util/util":127,"../../util/window":110}],96:[function(t,e,r){"use strict";var n=function(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)};n.prototype.isEnabled=function(){return!!this._enabled},n.prototype.enable=function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},n.prototype.disable=function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},n.prototype._onDblClick=function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},e.exports=n},{}],97:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.3,s=i.bezier(0,0,a,1),u=1400,l=2500,c=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(o.document.addEventListener("touchmove",this._onMove),o.document.addEventListener("touchend",this._onTouchEnd)):(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=n.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},c.prototype._onMove=function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=n.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),
this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},c.prototype._onUp=function(t){var e=this;if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var r=function(){return e._fireEvent("moveend",t)},n=this._inertia;if(n.length<2)return void r();var i=n[n.length-1],o=n[0],c=i[1].sub(o[1]),p=(i[0]-o[0])/1e3;if(0===p||i[1].equals(o[1]))return void r();var h=c.mult(a/p),f=h.mag();f>u&&(f=u,h._unit()._mult(f));var d=f/(l*a),m=h.mult(-d/2);this._map.panBy(m,{duration:1e3*d,easing:s,noMoveStart:!0},{originalEvent:t})}},c.prototype._onMouseUp=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onMouseUp))},c.prototype._onTouchEnd=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onTouchEnd))},c.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},c.prototype._ignoreEvent=function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;var r=1,n=0;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],98:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.25,s=i.bezier(0,0,a,1),u=180,l=720,c=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,this._pitchWithRotate=e.pitchWithRotate!==!1,i.bindAll(["_onDown","_onMove","_onUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=n.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault())},c.prototype._onMove=function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,i=n.mousePos(this._el,t),o=.8*(r.x-i.x),a=(r.y-i.y)*-.5,s=e.getBearing()-o,u=e.getPitch()-a,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._pitchWithRotate&&(e.transform.pitch=u),this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=i}},c.prototype._onUp=function(t){var e=this;if(!this._ignoreEvent(t)&&(o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),i=this._inertia,c=function(){Math.abs(n)<e._bearingSnap?r.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t)};if(i.length<2)return void c();var p=i[0],h=i[i.length-1],f=i[i.length-2],d=r._normalizeBearing(n,f[1]),m=h[1]-p[1],y=m<0?-1:1,v=(h[0]-p[0])/1e3;if(0===m||0===v)return void c();var g=Math.abs(m*(a/v));g>u&&(g=u);var _=g/(l*a),x=y*g*(_/2);d+=x,Math.abs(r._normalizeBearing(d,0))<this._bearingSnap&&(d=r._normalizeBearing(0,d)),r.rotateTo(d,{duration:1e3*_,easing:s,noMoveStart:!0},{originalEvent:t})}},c.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},c.prototype._ignoreEvent=function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragPan&&e.dragPan.isActive())return!0;if(t.touches)return t.touches.length>1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2,i=t.button;return"undefined"!=typeof InstallTrigger&&2===t.button&&t.ctrlKey&&o.navigator.platform.toUpperCase().indexOf("MAC")>=0&&(i=0),"mousemove"===t.type?t.buttons&0===r:i!==n},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],99:[function(t,e,r){"use strict";function n(t){return t*(2-t)}var i=100,o=15,a=10,s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},s.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,s=0,u=0,l=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),u=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),u=1);break;case 38:t.shiftKey?s=1:(t.preventDefault(),l=-1);break;case 40:t.shiftKey?s=-1:(l=1,t.preventDefault())}var c=this._map,p=c.getZoom(),h={duration:300,delayEndEvents:500,easing:n,zoom:e?Math.round(p)+e*(t.shiftKey?2:1):p,bearing:c.getBearing()+r*o,pitch:c.getPitch()+s*a,offset:[-u*i,-l*i],center:c.getCenter()};c.easeTo(h,{originalEvent:t})}},e.exports=s},{}],100:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/browser"),a=t("../../util/window"),s=a.navigator.userAgent.toLowerCase(),u=s.indexOf("firefox")!==-1,l=s.indexOf("safari")!==-1&&s.indexOf("chrom")===-1,c=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onWheel","_onTimeout"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},c.prototype._onWheel=function(t){var e;"wheel"===t.type?(e=t.deltaY,u&&t.deltaMode===a.WheelEvent.DOM_DELTA_PIXEL&&(e/=o.devicePixelRatio),t.deltaMode===a.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,l&&(e/=3));var r=o.now(),i=r-(this._time||0);this._pos=n.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625===0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(i*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},c.prototype._onTimeout=function(){this._type="wheel",this._zoom(-this._lastValue)},c.prototype._zoom=function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,o=r.transform.scaleZoom(i*n);r.zoomTo(o,{duration:"wheel"===this._type?200:0,around:r.unproject(this._pos),delayEndEvents:200,smoothEasing:!0},{originalEvent:e})}},e.exports=c},{"../../util/browser":108,"../../util/dom":115,"../../util/util":127,"../../util/window":110}],101:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.15,s=i.bezier(0,0,a,1),u=12,l=2.5,c=.15,p=4,h=function(t){this._map=t,this._el=t.getCanvasContainer(),i.bindAll(["_onStart","_onMove","_onEnd"],this)};h.prototype.isEnabled=function(){return!!this._enabled},h.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},h.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},h.prototype.disableRotation=function(){this._rotationDisabled=!0},h.prototype.enableRotation=function(){this._rotationDisabled=!1},h.prototype._onStart=function(t){if(2===t.touches.length){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],o.document.addEventListener("touchmove",this._onMove,!1),o.document.addEventListener("touchend",this._onEnd,!1)}},h.prototype._onMove=function(t){if(2===t.touches.length){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]),i=e.add(r).div(2),o=e.sub(r),a=o.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI,u=this._map;if(this._gestureIntent){var l={duration:0,around:u.unproject(i)};"rotate"===this._gestureIntent&&(l.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(l.zoom=u.transform.scaleZoom(this._startScale*a)),u.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),a,i]),u.easeTo(l,{originalEvent:t})}else{var h=Math.abs(1-a)>c,f=Math.abs(s)>p;f?this._gestureIntent="rotate":h&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=o,this._startScale=u.transform.scale,this._startBearing=u.transform.bearing)}t.preventDefault()}},h.prototype._onEnd=function(t){o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],c=r.transform.scaleZoom(this._startScale*n[1]),p=r.transform.scaleZoom(this._startScale*i[1]),h=c-p,f=(n[0]-i[0])/1e3,d=n[2];if(0===f||c===p)return void r.snapToNorth({},{originalEvent:t});var m=h*a/f;Math.abs(m)>l&&(m=m>0?l:-l);var y=1e3*Math.abs(m/(u*a)),v=c+m*y/2e3;v<0&&(v=0),r.easeTo({zoom:v,duration:y,easing:s,around:r.unproject(d)},{originalEvent:t})},h.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>2&&e-t[0][0]>r;)t.shift()},e.exports=h},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],102:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/window"),o=function(){n.bindAll(["_onHashChange","_updateHash"],this)};o.prototype.addTo=function(t){return this._map=t,i.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},o.prototype.remove=function(){return i.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},o.prototype._onHashChange=function(){var t=i.location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},o.prototype._updateHash=function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=this._map.getPitch(),o=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),a="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(o)+"/"+t.lng.toFixed(o);(r||n)&&(a+="/"+Math.round(10*r)/10),n&&(a+="/"+Math.round(n)),i.history.replaceState("","",a)},e.exports=o},{"../util/util":127,"../util/window":110}],103:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/util"),o=t("../util/browser"),a=t("../util/window"),s=t("../util/dom"),u=t("../style/style"),l=t("../style/animation_loop"),c=t("../render/painter"),p=t("../geo/transform"),h=t("./hash"),f=t("./bind_handlers"),d=t("./camera"),m=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),v=t("point-geometry"),g=t("./control/attribution_control"),_=t("mapbox-gl-supported"),x=0,b=20,w={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:x,maxZoom:b,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0},E=function(t){function e(e){var r=this;e=i.extend({},w,e);var n=new p(e.minZoom,e.maxZoom);if(t.call(this,n,e),this._interactive=e.interactive,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,"string"==typeof e.container){if(this._container=a.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else this._container=e.container;this.animationLoop=new l,e.maxBounds&&this.setMaxBounds(e.maxBounds),i.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){r.animationLoop.set(300),r._rerender()}),"undefined"!=typeof a&&(a.addEventListener("online",this._onWindowOnline,!1),a.addEventListener("resize",this._onWindowResize,!1)),f(this,e),this._hash=e.hash&&(new h).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this._classes=[],this.resize(),e.classes&&this.setClasses(e.classes),e.style&&this.setStyle(e.style),e.attributionControl&&this.addControl(new g),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1})}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={showTileBoundaries:{},showCollisionBoxes:{},showOverdrawInspector:{},repaint:{},vertices:{}};return e.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),n=this._controlPositions[e];return e.indexOf("bottom")!==-1?n.insertBefore(r,n.firstChild):n.appendChild(r),this},e.prototype.removeControl=function(t){return t.onRemove(this),this},e.prototype.addClass=function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.removeClass=function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},e.prototype.setClasses=function(t,e){for(var r={},n=0;n<t.length;n++)""!==t[n]&&(r[t[n]]=!0);return this._classes=Object.keys(r),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0)},e.prototype.hasClass=function(t){return this._classes.indexOf(t)>=0},e.prototype.getClasses=function(){return this._classes},e.prototype.resize=function(){var t=this._containerDimensions(),e=t[0],r=t[1];return this._resizeCanvas(e,r),this.transform.resize(e,r),this.painter.resize(e,r),this.fire("movestart").fire("move").fire("resize").fire("moveend")},e.prototype.getBounds=function(){var t=new y(this.transform.pointLocation(new v(0,this.transform.height)),this.transform.pointLocation(new v(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new v(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new v(0,this.transform.size.y)))),t},e.prototype.setMaxBounds=function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},e.prototype.setMinZoom=function(t){if(t=null===t||void 0===t?x:t,t>=x&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between "+x+" and the current maxZoom, inclusive")},e.prototype.getMinZoom=function(){return this.transform.minZoom},e.prototype.setMaxZoom=function(t){if(t=null===t||void 0===t?b:t,t>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},e.prototype.getMaxZoom=function(){return this.transform.maxZoom},e.prototype.project=function(t){return this.transform.locationPoint(m.convert(t))},e.prototype.unproject=function(t){return this.transform.pointLocation(v.convert(t))},e.prototype.queryRenderedFeatures=function(){function t(t){return t instanceof v||Array.isArray(t)}var e,r={};return 2===arguments.length?(e=arguments[0],r=arguments[1]):1===arguments.length&&t(arguments[0])?e=arguments[0]:1===arguments.length&&(r=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(e),r,this.transform.zoom,this.transform.angle)},e.prototype._makeQueryGeometry=function(t){var e=this;void 0===t&&(t=[v.convert([0,0]),v.convert([this.transform.width,this.transform.height])]);var r,n=t instanceof v||"number"==typeof t[0];if(n){var i=v.convert(t);r=[i]}else{var o=[v.convert(t[0]),v.convert(t[1])];r=[o[0],new v(o[1].x,o[0].y),o[1],new v(o[0].x,o[1].y),o[0]]}return r=r.map(function(t){return e.transform.pointCoordinate(t)})},e.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},e.prototype.setStyle=function(t,e){var r=(!e||e.diff!==!1)&&this.style&&t&&!(t instanceof u)&&"string"!=typeof t;if(r)try{return this.style.setState(t)&&this._update(!0),this}catch(t){i.warnOnce("Unable to perform style diff: "+(t.message||t.error||t)+". Rebuilding the style from scratch.")}return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(t instanceof u?this.style=t:this.style=new u(t,this),this.style.setEventedParent(this,{style:this.style}),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},e.prototype.getStyle=function(){if(this.style)return this.style.serialize()},e.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0),this},e.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},e.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0),this},e.prototype.getSource=function(t){return this.style.getSource(t)},e.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0),this},e.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0),this},e.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0),this},e.prototype.getLayer=function(t){return this.style.getLayer(t)},e.prototype.setFilter=function(t,e){return this.style.setFilter(t,e),this._update(!0),this},e.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},e.prototype.getFilter=function(t){return this.style.getFilter(t)},e.prototype.setPaintProperty=function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},e.prototype.getPaintProperty=function(t,e,r){return this.style.getPaintProperty(t,e,r)},e.prototype.setLayoutProperty=function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},e.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},e.prototype.setLight=function(t){return this.style.setLight(t),this._update(!0),this},e.prototype.getLight=function(){return this.style.getLight()},e.prototype.getContainer=function(){return this._container},e.prototype.getCanvasContainer=function(){return this._canvasContainer},e.prototype.getCanvas=function(){return this._canvas},e.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),[t,e]},e.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=s.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=s.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",0),this._canvas.setAttribute("aria-label","Map");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var n=this._controlContainer=s.create("div","mapboxgl-control-container",t),i=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){i[t]=s.create("div","mapboxgl-ctrl-"+t,n)})},e.prototype._resizeCanvas=function(t,e){var r=a.devicePixelRatio||1;this._canvas.width=r*t,this._canvas.height=r*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},e.prototype._setupPainter=function(){var t=i.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},_.webGLContextAttributes),e=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);return e?void(this.painter=new c(e,this.transform)):void this.fire("error",{error:new Error("Failed to initialize WebGL")})},e.prototype._contextLost=function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},e.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},e.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},e.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},e.prototype._render=function(){return this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender(),this},e.prototype.remove=function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),"undefined"!=typeof a&&a.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map"),this.fire("remove")},e.prototype._rerender=function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},e.prototype._onWindowOnline=function(){this._update()},e.prototype._onWindowResize=function(){this._trackResize&&this.stop().resize()._update()},r.showTileBoundaries.get=function(){return!!this._showTileBoundaries},r.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},r.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},r.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},r.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},r.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},r.repaint.get=function(){return!!this._repaint},r.repaint.set=function(t){this._repaint=t,this._update()},r.vertices.get=function(){return!!this._vertices},r.vertices.set=function(t){this._vertices=t,this._update()},e.prototype._onData=function(t){this._update("style"===t.dataType),this.fire(t.dataType+"data",t)},e.prototype._onDataLoading=function(t){this.fire(t.dataType+"dataloading",t)},Object.defineProperties(e.prototype,r),e}(d);e.exports=E},{"../geo/lng_lat":19,"../geo/lng_lat_bounds":20,"../geo/transform":21,"../render/painter":36,"../style/animation_loop":57,"../style/style":61,"../util/browser":108,"../util/dom":115,"../util/util":127,"../util/window":110,"./bind_handlers":89,"./camera":90,"./control/attribution_control":91,"./hash":102,"mapbox-gl-supported":190,"point-geometry":194}],104:[function(t,e,r){"use strict";var n=t("../util/dom"),i=t("../geo/lng_lat"),o=t("point-geometry"),a=function(t,e){this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this),this._onMapClick=this._onMapClick.bind(this),t||(t=n.create("div")),t.classList.add("mapboxgl-marker"),this._element=t,this._popup=null};a.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this._update(),this._map.on("click",this._onMapClick),this},a.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map=null),n.remove(this._element),this._popup&&this._popup.remove(),this},a.prototype.getLngLat=function(){return this._lngLat},a.prototype.setLngLat=function(t){return this._lngLat=i.convert(t),this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},a.prototype.getElement=function(){return this._element},a.prototype.setPopup=function(t){return this._popup&&(this._popup.remove(),this._popup=null),t&&(this._popup=t,this._popup.setLngLat(this._lngLat)),this},a.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},a.prototype.getPopup=function(){return this._popup},a.prototype.togglePopup=function(){var t=this._popup;t&&(t.isOpen()?t.remove():t.addTo(this._map))},a.prototype._update=function(t){if(this._map){var e=this._map.project(this._lngLat)._add(this._offset);t&&"moveend"!==t.type||(e=e.round()),n.setTransform(this._element,"translate("+e.x+"px, "+e.y+"px)")}},e.exports=a},{"../geo/lng_lat":19,"../util/dom":115,"point-geometry":194}],105:[function(t,e,r){"use strict";function n(t){if(t){if("number"==typeof t){var e=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{top:new l(0,t),"top-left":new l(e,e),"top-right":new l(-e,e),bottom:new l(0,-t),"bottom-left":new l(e,-e),"bottom-right":new l(-e,-e),left:new l(t,0),right:new l(-t,0)}}if(i(t)){var r=l.convert(t);return{top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{top:l.convert(t.top||[0,0]),"top-left":l.convert(t["top-left"]||[0,0]),"top-right":l.convert(t["top-right"]||[0,0]),bottom:l.convert(t.bottom||[0,0]),"bottom-left":l.convert(t["bottom-left"]||[0,0]),"bottom-right":l.convert(t["bottom-right"]||[0,0]),left:l.convert(t.left||[0,0]),right:l.convert(t.right||[0,0])}}return n(new l(0,0))}function i(t){return t instanceof l||Array.isArray(t)}var o=t("../util/util"),a=t("../util/evented"),s=t("../util/dom"),u=t("../geo/lng_lat"),l=t("point-geometry"),c=t("../util/window"),p={closeButton:!0,closeOnClick:!0},h=function(t){function e(e){t.call(this),this.options=o.extend(Object.create(p),e),o.bindAll(["_update","_onClickClose"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addTo=function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},e.prototype.isOpen=function(){return!!this._map},e.prototype.remove=function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=u.convert(t),this._update(),this},e.prototype.setText=function(t){return this.setDOMContent(c.document.createTextNode(t))},e.prototype.setHTML=function(t){var e,r=c.document.createDocumentFragment(),n=c.document.createElement("body");for(n.innerHTML=t;e=n.firstChild,e;)r.appendChild(e);return this.setDOMContent(r)},e.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},e.prototype._createContent=function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=s.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=s.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},e.prototype._update=function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=s.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=s.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this.options.anchor,e=n(this.options.offset),r=this._map.project(this._lngLat).round();if(!t){var i=this._container.offsetWidth,o=this._container.offsetHeight;t=r.y+e.bottom.y<o?["top"]:r.y>this._map.transform.height-o?["bottom"]:[],r.x<i/2?t.push("left"):r.x>this._map.transform.width-i/2&&t.push("right"),t=0===t.length?"bottom":t.join("-")}var a=r.add(e[t]),u={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%)"},l=this._container.classList;for(var c in u)l.remove("mapboxgl-popup-anchor-"+c);l.add("mapboxgl-popup-anchor-"+t),s.setTransform(this._container,u[t]+" translate("+a.x+"px,"+a.y+"px)")}},e.prototype._onClickClose=function(){this.remove()},e}(a);e.exports=h},{"../geo/lng_lat":19,"../util/dom":115,"../util/evented":116,"../util/util":127,"../util/window":110,"point-geometry":194}],106:[function(t,e,r){"use strict";var n=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)};n.prototype.send=function(t,e,r,n,i){var o=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[o]=r),this.target.postMessage({targetMapId:i,sourceMapId:this.mapId,type:t,id:String(o),data:e},n)},n.prototype.receive=function(t){var e,r=this,n=t.data,i=n.id;if(!n.targetMapId||this.mapId===n.targetMapId){var o=function(t,e,n){r.target.postMessage({sourceMapId:r.mapId,type:"<response>",id:String(i),error:t?String(t):null,data:e},n)};if("<response>"===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&e(n.error||null,n.data);else if("undefined"!=typeof n.id&&this.parent[n.type])this.parent[n.type](n.sourceMapId,n.data,o);else if("undefined"!=typeof n.id&&this.parent.getWorkerSource){var a=n.type.split("."),s=this.parent.getWorkerSource(n.sourceMapId,a[0]);s[a[1]](n.data,o)}else this.parent[n.type](n.data)}},n.prototype.remove=function(){
this.target.removeEventListener("message",this.receive,!1)},e.exports=n},{}],107:[function(t,e,r){"use strict";function n(t){var e=i.document.createElement("a");return e.href=t,e.protocol===i.document.location.protocol&&e.host===i.document.location.host}var i=t("./window");r.getJSON=function(t,e){var r=new i.XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new i.XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){return 0===r.response.byteLength&&200===r.status?e(new Error("http status 200 returned without content.")):void(r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText)))},r.send(),r};var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new i.Image,a=i.URL||i.webkitURL;n.onload=function(){e(null,n),a.revokeObjectURL(n.src)};var s=new i.Blob([new Uint8Array(r)],{type:"image/png"});n.src=r.byteLength?a.createObjectURL(s):o})},r.getVideo=function(t,e){var r=i.document.createElement("video");r.onloadstart=function(){e(null,r)};for(var o=0;o<t.length;o++){var a=i.document.createElement("source");n(t[o])||(r.crossOrigin="Anonymous"),a.src=t[o],r.appendChild(a)}return r}},{"./window":110}],108:[function(t,e,r){"use strict";var n=t("./window");e.exports.now=function(){return n.performance&&n.performance.now?n.performance.now.bind(n.performance):Date.now.bind(Date)}();var i=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame;r.frame=function(t){return i(t)};var o=n.cancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelAnimationFrame||n.msCancelAnimationFrame;r.cancelFrame=function(t){o(t)},r.timed=function(t,n,i){function o(u){a||(u=e.exports.now(),u>=s+n?t.call(i,1):(t.call(i,(u-s)/n),r.frame(o)))}if(!n)return t.call(i,1),null;var a=!1,s=e.exports.now();return r.frame(o),function(){a=!0}},r.getImageData=function(t){var e=n.document.createElement("canvas"),r=e.getContext("2d");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height).data},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=n.navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return n.devicePixelRatio}}),r.supportsWebp=!1;var a=n.document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{"./window":110,"mapbox-gl-supported":190}],109:[function(t,e,r){"use strict";var n=t("webworkify"),i=t("../window"),o=i.URL.createObjectURL(new n(t("../../source/worker"),{bare:!0}));e.exports=function(){return new i.Worker(o)}},{"../../source/worker":55,"../window":110,webworkify:211}],110:[function(t,e,r){"use strict";e.exports=self},{}],111:[function(t,e,r){"use strict";function n(t,e){return e.area-t.area}var i=t("quickselect"),o=t("./util").calculateSignedArea;e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var a,s,u=[],l=0;l<r;l++){var c=o(t[l]);0!==c&&(t[l].area=Math.abs(c),void 0===s&&(s=c<0),s===c<0?(a&&u.push(a),a=[t[l]]):a.push(t[l]))}if(a&&u.push(a),e>1)for(var p=0;p<u.length;p++)u[p].length<=e||(i(u[p],e,1,u[p].length-1,n),u[p]=u[p].slice(0,e));return u}},{"./util":127,quickselect:196}],112:[function(t,e,r){"use strict";var n={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null};e.exports=n},{}],113:[function(t,e,r){"use strict";var n=function(t){var e=this;this._stringToNumber={},this._numberToString=[];for(var r=0;r<t.length;r++){var n=t[r];e._stringToNumber[n]=r,e._numberToString[r]=n}};n.prototype.encode=function(t){return this._stringToNumber[t]},n.prototype.decode=function(t){return this._numberToString[t]},e.exports=n},{}],114:[function(t,e,r){"use strict";var n=t("./util"),i=t("./actor"),o=function(t,e){var r=this;this.workerPool=t,this.actors=[],this.currentActor=0,this.id=n.uniqueId();for(var o=this.workerPool.acquire(this.id),a=0;a<o.length;a++){var s=o[a],u=new i(s,e,r.id);u.name="Worker "+a,r.actors.push(u)}};o.prototype.broadcast=function(t,e,r){r=r||function(){},n.asyncAll(this.actors,function(r,n){r.send(t,e,n)},r)},o.prototype.send=function(t,e,r,n,i){return("number"!=typeof n||isNaN(n))&&(n=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[n].send(t,e,r,i),n},o.prototype.remove=function(){this.actors.forEach(function(t){t.remove()}),this.actors=[],this.workerPool.release(this.id)},e.exports=o},{"./actor":106,"./util":127}],115:[function(t,e,r){"use strict";function n(t){for(var e=0;e<t.length;e++)if(t[e]in u)return t[e];return t[0]}function i(t){t.preventDefault(),t.stopPropagation(),a.removeEventListener("click",i,!0)}var o=t("point-geometry"),a=t("./window");r.create=function(t,e,r){var n=a.document.createElement(t);return e&&(n.className=e),r&&r.appendChild(n),n};var s,u=a.document.documentElement.style,l=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){l&&(s=u[l],u[l]="none")},r.enableDrag=function(){l&&(u[l]=s)};var c=n(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[c]=e},r.suppressClick=function(){a.addEventListener("click",i,!0),a.setTimeout(function(){a.removeEventListener("click",i,!0)},0)},r.mousePos=function(t,e){var r=t.getBoundingClientRect();return e=e.touches?e.touches[0]:e,new o(e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop)},r.touchPos=function(t,e){for(var r=t.getBoundingClientRect(),n=[],i="touchend"===e.type?e.changedTouches:e.touches,a=0;a<i.length;a++)n.push(new o(i[a].clientX-r.left-t.clientLeft,i[a].clientY-r.top-t.clientTop));return n},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)}},{"./window":110,"point-geometry":194}],116:[function(t,e,r){"use strict";var n=t("./util"),i=function(){};i.prototype.on=function(t,e){return this._listeners=this._listeners||{},this._listeners[t]=this._listeners[t]||[],this._listeners[t].push(e),this},i.prototype.off=function(t,e){if(this._listeners&&this._listeners[t]){var r=this._listeners[t].indexOf(e);r!==-1&&this._listeners[t].splice(r,1)}return this},i.prototype.once=function(t,e){var r=this,n=function(i){r.off(t,n),e.call(r,i)};return this.on(t,n),this},i.prototype.fire=function(t,e){var r=this;if(this.listens(t)){e=n.extend({},e,{type:t,target:this});for(var i=this._listeners&&this._listeners[t]?this._listeners[t].slice():[],o=0;o<i.length;o++)i[o].call(r,e);this._eventedParent&&this._eventedParent.fire(t,n.extend({},e,this._eventedParentData))}else n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event");return this},i.prototype.listens=function(t){return this._listeners&&this._listeners[t]||this._eventedParent&&this._eventedParent.listens(t)},i.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData="function"==typeof e?e():e,this},e.exports=i},{"./util":127}],117:[function(t,e,r){"use strict";function n(t,e){return e.max-t.max}function i(t,e,r,n){this.p=new u(t,e),this.h=r,this.d=o(this.p,n),this.max=this.d+this.h*Math.SQRT2}function o(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var o=e[i],a=0,s=o.length,u=s-1;a<s;u=a++){var c=o[a],p=o[u];c.y>t.y!=p.y>t.y&&t.x<(p.x-c.x)*(t.y-c.y)/(p.y-c.y)+c.x&&(r=!r),n=Math.min(n,l(t,c,p))}return(r?1:-1)*Math.sqrt(n)}function a(t){for(var e=0,r=0,n=0,o=t[0],a=0,s=o.length,u=s-1;a<s;u=a++){var l=o[a],c=o[u],p=l.x*c.y-c.x*l.y;r+=(l.x+c.x)*p,n+=(l.y+c.y)*p,e+=3*p}return new i(r/e,n/e,0,t)}var s=t("tinyqueue"),u=t("point-geometry"),l=t("./intersection_tests").distToSegmentSquared;e.exports=function(t,e,r){e=e||1;for(var o,u,l,c,p=t[0],h=0;h<p.length;h++){var f=p[h];(!h||f.x<o)&&(o=f.x),(!h||f.y<u)&&(u=f.y),(!h||f.x>l)&&(l=f.x),(!h||f.y>c)&&(c=f.y)}for(var d=l-o,m=c-u,y=Math.min(d,m),v=y/2,g=new s(null,n),_=o;_<l;_+=y)for(var x=u;x<c;x+=y)g.push(new i(_+v,x+v,v,t));for(var b=a(t),w=g.length;g.length;){var E=g.pop();E.d>b.d&&(b=E,r&&console.log("found best %d after %d probes",Math.round(1e4*E.d)/1e4,w)),E.max-b.d<=e||(v=E.h/2,g.push(new i(E.p.x-v,E.p.y-v,v,t)),g.push(new i(E.p.x+v,E.p.y-v,v,t)),g.push(new i(E.p.x-v,E.p.y+v,v,t)),g.push(new i(E.p.x+v,E.p.y+v,v,t)),w+=4)}return r&&(console.log("num probes: "+w),console.log("best distance: "+b.d)),b.p}},{"./intersection_tests":120,"point-geometry":194,tinyqueue:199}],118:[function(t,e,r){"use strict";function n(t,e){this.stacks=t.readFields(i,[],e)}function i(t,e,r){if(1===t){var n=r.readMessage(o,{glyphs:{}});e.push(n)}}function o(t,e,r){if(1===t)e.name=r.readString();else if(2===t)e.range=r.readString();else if(3===t){var n=r.readMessage(a,{});e.glyphs[n.id]=n}}function a(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}e.exports=n},{}],119:[function(t,e,r){"use strict";function n(t,e,r){return t*(1-r)+e*r}e.exports=n,n.number=n,n.vec2=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r)]},n.color=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r),n(t[2],e[2],r),n(t[3],e[3],r)]},n.array=function(t,e,r){return t.map(function(t,i){return n(t,e[i],r)})}},{}],120:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r<t.length;r++)if(f(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(f(t,e[n]))return!0;return!!u(t,e)}function i(t,e,r){for(var n=0;n<t.length;n++)for(var i=t[n],o=0;o<e.length;o++)for(var a=e[o],s=0;s<a.length;s++){var u=a[s];if(f(i,u))return!0;if(c(u,i,r))return!0}return!1}function o(t,e){if(1===t.length&&1===t[0].length)return h(e,t[0][0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(h(t,n[i]))return!0;for(var o=0;o<t.length;o++){for(var a=t[o],s=0;s<a.length;s++)if(h(e,a[s]))return!0;for(var l=0;l<e.length;l++)if(u(a,e[l]))return!0}return!1}function a(t,e,r){for(var n=0;n<e.length;n++)for(var i=e[n],o=0;o<t.length;o++){var a=t[o];if(a.length>=3)for(var u=0;u<i.length;u++)if(f(a,i[u]))return!0;if(s(a,i,r))return!0}return!1}function s(t,e,r){if(t.length>1){if(u(t,e))return!0;for(var n=0;n<e.length;n++)if(c(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(c(t[i],e,r))return!0;return!1}function u(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],o=0;o<e.length-1;o++){var a=e[o],s=e[o+1];if(l(n,i,a,s))return!0}return!1}function l(t,e,r,n){return d(t,r,n)!==d(e,r,n)&&d(t,e,r)!==d(t,e,n)}function c(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++){var o=e[i-1],a=e[i];if(p(t,o,a)<n)return!0}return!1}function p(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function h(t,e){for(var r,n,i,o=!1,a=0;a<t.length;a++){r=t[a];for(var s=0,u=r.length-1;s<r.length;u=s++)n=r[s],i=r[u],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o)}return o}function f(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var o=t[n],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}var d=t("./util").isCounterClockwise;e.exports={multiPolygonIntersectsBufferedMultiPoint:i,multiPolygonIntersectsMultiPolygon:o,multiPolygonIntersectsBufferedMultiLine:a,polygonIntersectsPolygon:n,distToSegmentSquared:p}},{"./util":127}],121:[function(t,e,r){"use strict";var n={"Latin-1 Supplement":function(t){return t>=128&&t<=255},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};e.exports=n},{}],122:[function(t,e,r){"use strict";var n=function(t,e){this.max=t,this.onRemove=e,this.reset()};n.prototype.reset=function(){var t=this;for(var e in this.data)t.onRemove(t.data[e]);return this.data={},this.order=[],this},n.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){var e=this;for(this.max=t;this.order.length>this.max;){var r=e.get(e.order[0]);r&&e.onRemove(r)}return this},e.exports=n},{}],123:[function(t,e,r){"use strict";function n(t,e){var r=a(u.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,!u.REQUIRE_ACCESS_TOKEN)return s(t);if(e=e||u.ACCESS_TOKEN,!e)throw new Error("An API access token is required to use Mapbox GL. "+c);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+c);return t.params.push("access_token="+e),s(t)}function i(t){return 0===t.indexOf("mapbox:")}function o(t){for(var e=0;e<t.length;e++)0===t[e].indexOf("access_token=tk.")&&(t[e]="access_token="+(u.ACCESS_TOKEN||""))}function a(t){var e=t.match(h);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function s(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}var u=t("./config"),l=t("./browser"),c="See https://www.mapbox.com/developers/api/#access-tokens";r.isMapboxURL=i,r.normalizeStyleURL=function(t,e){if(!i(t))return t;var r=a(t);return r.path="/styles/v1"+r.path,n(r,e)},r.normalizeGlyphsURL=function(t,e){if(!i(t))return t;var r=a(t);return r.path="/fonts/v1"+r.path,n(r,e)},r.normalizeSourceURL=function(t,e){if(!i(t))return t;var r=a(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),n(r,e)},r.normalizeSpriteURL=function(t,e,r,o){var u=a(t);return i(t)?(u.path="/styles/v1"+u.path+"/sprite"+e+r,n(u,o)):(u.path+=""+e+r,s(u))};var p=/(\.(png|jpg)\d*)(?=$)/;r.normalizeTileURL=function(t,e,r){if(!e||!i(e))return t;var n=a(t),u=l.devicePixelRatio>=2||512===r?"@2x":"",c=l.supportsWebp?".webp":"$1";return n.path=n.path.replace(p,""+u+c),o(n.params),s(n)};var h=/^(\w+):\/\/([^\/?]+)(\/[^?]+)?\??(.+)?/},{"./browser":108,"./config":112}],124:[function(t,e,r){"use strict";var n=t("./is_char_in_unicode_block");e.exports.allowsIdeographicBreaking=function(t){for(var e=0,n=t;e<n.length;e+=1){var i=n[e];if(!r.charAllowsIdeographicBreaking(i.charCodeAt(0)))return!1}return!0},e.exports.allowsVerticalWritingMode=function(t){for(var e=0,n=t;e<n.length;e+=1){var i=n[e];if(r.charHasUprightVerticalOrientation(i.charCodeAt(0)))return!0}return!1},e.exports.charAllowsIdeographicBreaking=function(t){return!!(!(t<11904)&&(n["Bopomofo Extended"](t)||n.Bopomofo(t)||n["CJK Compatibility Forms"](t)||n["CJK Compatibility Ideographs"](t)||n["CJK Compatibility"](t)||n["CJK Radicals Supplement"](t)||n["CJK Strokes"](t)||n["CJK Symbols and Punctuation"](t)||n["CJK Unified Ideographs Extension A"](t)||n["CJK Unified Ideographs"](t)||n["Enclosed CJK Letters and Months"](t)||n["Halfwidth and Fullwidth Forms"](t)||n.Hiragana(t)||n["Ideographic Description Characters"](t)||n["Kangxi Radicals"](t)||n["Katakana Phonetic Extensions"](t)||n.Katakana(t)||n["Vertical Forms"](t)||n["Yi Radicals"](t)||n["Yi Syllables"](t)))},r.charHasUprightVerticalOrientation=function(t){return!!(746===t||747===t||!(t<4352)&&(n["Bopomofo Extended"](t)||n.Bopomofo(t)||n["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||n["CJK Compatibility Ideographs"](t)||n["CJK Compatibility"](t)||n["CJK Radicals Supplement"](t)||n["CJK Strokes"](t)||!(!n["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||n["CJK Unified Ideographs Extension A"](t)||n["CJK Unified Ideographs"](t)||n["Enclosed CJK Letters and Months"](t)||n["Hangul Compatibility Jamo"](t)||n["Hangul Jamo Extended-A"](t)||n["Hangul Jamo Extended-B"](t)||n["Hangul Jamo"](t)||n["Hangul Syllables"](t)||n.Hiragana(t)||n["Ideographic Description Characters"](t)||n.Kanbun(t)||n["Kangxi Radicals"](t)||n["Katakana Phonetic Extensions"](t)||n.Katakana(t)&&12540!==t||!(!n["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!n["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||n["Unified Canadian Aboriginal Syllabics"](t)||n["Unified Canadian Aboriginal Syllabics Extended"](t)||n["Vertical Forms"](t)||n["Yijing Hexagram Symbols"](t)||n["Yi Syllables"](t)||n["Yi Radicals"](t)))},r.charHasNeutralVerticalOrientation=function(t){return!!(n["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||n["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||n["Letterlike Symbols"](t)||n["Number Forms"](t)||n["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||n["Control Pictures"](t)&&9251!==t||n["Optical Character Recognition"](t)||n["Enclosed Alphanumerics"](t)||n["Geometric Shapes"](t)||n["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||n["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||n["CJK Symbols and Punctuation"](t)||n.Katakana(t)||n["Private Use Area"](t)||n["CJK Compatibility Forms"](t)||n["Small Form Variants"](t)||n["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)},r.charHasRotatedVerticalOrientation=function(t){return!(r.charHasUprightVerticalOrientation(t)||r.charHasNeutralVerticalOrientation(t))}},{"./is_char_in_unicode_block":121}],125:[function(t,e,r){"use strict";function n(t){var e=JSON.stringify(t);if(y[e])return y[e];var r=void 0===t.alignment?1:t.alignment,n=0,a=0,u=["Uint8"],p=t.members.map(function(t){u.indexOf(t.type)<0&&u.push(t.type);var e=o(t.type),s=n=i(n,Math.max(r,e)),l=t.components||1;return a=Math.max(a,e),n+=e*l,{name:t.name,type:t.type,components:l,offset:s}}),f=i(n,Math.max(a,r)),d=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(h);d.prototype.alignment=r,d.prototype.size=f;for(var v=0,g=p;v<g.length;v+=1)for(var _=g[v],x=0;x<_.components;x++){var b=_.name+(1===_.components?"":x);Object.defineProperty(d.prototype,b,{get:l(_,x),set:c(_,x)})}var w=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(m);return w.prototype.members=p,w.prototype.StructType=d,w.prototype.bytesPerElement=f,w.prototype.emplaceBack=s(p,f),w.prototype._usedTypes=u,y[e]=w,w}function i(t,e){return Math.ceil(t/e)*e}function o(t){return p[t].BYTES_PER_ELEMENT}function a(t){return t.toLowerCase()}function s(t,e){for(var r=[],n=[],i="var i = this.length;\nthis.resize(this.length + 1);\n",s=0,u=t;s<u.length;s+=1){var l=u[s],c=o(l.type);r.indexOf(c)<0&&(r.push(c),i+="var o"+c.toFixed(0)+" = i * "+(e/c).toFixed(0)+";\n");for(var p=0;p<l.components;p++){var h="v"+n.length,f="o"+c.toFixed(0)+" + "+(l.offset/c+p).toFixed(0);i+="this."+a(l.type)+"["+f+"] = "+h+";\n",n.push(h)}}return i+="return i;",new Function(n.toString(),i)}function u(t,e){var r="this._pos"+o(t.type).toFixed(0),n=(t.offset/o(t.type)+e).toFixed(0),i=r+" + "+n;return"this._structArray."+a(t.type)+"["+i+"]"}function l(t,e){return new Function("return "+u(t,e)+";")}function c(t,e){return new Function("x",u(t,e)+" = x;")}e.exports=n;var p={Int8:Int8Array,Uint8:Uint8Array,Uint8Clamped:Uint8ClampedArray,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array,Float64:Float64Array},h=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},f=128,d=5,m=function(t){this.isTransferred=!1,void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))};m.serialize=function(){return{members:this.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}},m.prototype.serialize=function(t){return this._trim(),t&&(this.isTransferred=!0,t.push(this.arrayBuffer)),{length:this.length,arrayBuffer:this.arrayBuffer}},m.prototype.get=function(t){return new this.StructType(this,t)},m.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},m.prototype.resize=function(t){if(this.length=t,t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*d),f),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},m.prototype._refreshViews=function(){for(var t=this,e=0,r=this._usedTypes;e<r.length;e+=1){var n=r[e];t[a(n)]=new p[n](t.arrayBuffer)}},m.prototype.toArray=function(t,e){for(var r=this,n=[],i=t;i<e;i++){var o=r.get(i);n.push(o)}return n};var y={}},{}],126:[function(t,e,r){"use strict";function n(t,e){return e.replace(/{([^{}]+)}/g,function(e,r){return r in t?t[r]:""})}e.exports=n},{}],127:[function(t,e,r){"use strict";var n=t("unitbezier"),i=t("../geo/coordinate");t("point-geometry");r.easeCubicInOut=function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),i[a]=e,0===--n&&r(o,i)})})},r.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},r.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},r.extend=function(t,e,r,n){for(var i=arguments,o=1;o<arguments.length;o++){var a=i[o];for(var s in a)t[s]=a[s]}return t},r.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r};var o=1;r.uniqueId=function(){return o++},r.bindAll=function(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})},r.getCoordinatesCenter=function(t){for(var e=1/0,r=1/0,n=-(1/0),o=-(1/0),a=0;a<t.length;a++)e=Math.min(e,t[a].column),r=Math.min(r,t[a].row),n=Math.max(n,t[a].column),o=Math.max(o,t[a].row);var s=n-e,u=o-r,l=Math.max(s,u);return new i((e+n)/2,(r+o)/2,0).zoomTo(Math.floor(-Math.log(l)/Math.LN2))},r.endsWith=function(t,e){return t.indexOf(e,t.length-e.length)!==-1},r.mapObject=function(t,e,r){var n=this,i={};for(var o in t)i[o]=e.call(r||n,t[o],o,t);return i},r.filterObject=function(t,e,r){var n=this,i={};for(var o in t)e.call(r||n,t[o],o,t)&&(i[o]=t[o]);return i},r.deepEqual=function(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!r.deepEqual(t[n],e[n]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;var i=Object.keys(t);if(i.length!==Object.keys(e).length)return!1;for(var o in t)if(!r.deepEqual(t[o],e[o]))return!1;return!0}return t===e},r.clone=function(t){return Array.isArray(t)?t.map(r.clone):"object"==typeof t&&t?r.mapObject(t,r.clone):t},r.arraysIntersect=function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1};var a={};r.warnOnce=function(t){a[t]||("undefined"!=typeof console&&console.warn(t),a[t]=!0)},r.isCounterClockwise=function(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)},r.calculateSignedArea=function(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r=t[a],n+=(r.x-e.x)*(e.y+r.y);return n},r.isClosedPolygon=function(t){if(t.length<4)return!1;var e=t[0],n=t[t.length-1];return!(Math.abs(e.x-n.x)>0||Math.abs(e.y-n.y)>0)&&Math.abs(r.calculateSignedArea(t))>.01},r.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,[e*Math.cos(r)*Math.sin(n),e*Math.sin(r)*Math.sin(n),e*Math.cos(n)]}},{"../geo/coordinate":18,"point-geometry":194,unitbezier:200}],128:[function(t,e,r){"use strict";var n=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},i={geometry:{}};i.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},i.geometry.set=function(t){this._geometry=t},n.prototype.toJSON=function(){var t=this,e={geometry:this.geometry};for(var r in this)"_geometry"!==r&&"_vectorTileFeature"!==r&&(e[r]=t[r]);return e},Object.defineProperties(n.prototype,i),e.exports=n},{}],129:[function(t,e,r){"use strict";var n=t("./script_detection");e.exports=function(t){for(var r="",i=0;i<t.length;i++){var o=t.charCodeAt(i+1)||null,a=t.charCodeAt(i-1)||null,s=(!o||!n.charHasRotatedVerticalOrientation(o)||e.exports.lookup[t[i+1]])&&(!a||!n.charHasRotatedVerticalOrientation(a)||e.exports.lookup[t[i-1]]);r+=s&&e.exports.lookup[t[i]]?e.exports.lookup[t[i]]:t[i]}return r},e.exports.lookup={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},{"./script_detection":124}],130:[function(t,e,r){"use strict";var n=t("./web_worker"),i=function(){this.active={}};i.prototype.acquire=function(e){var r=this;if(!this.workers){var i=t("../mapbox-gl").workerCount;for(this.workers=[];this.workers.length<i;)r.workers.push(new n)}return this.active[e]=!0,this.workers.slice()},i.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach(function(t){t.terminate()}),this.workers=null)},e.exports=i},{"../mapbox-gl":24,"./web_worker":109}],131:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.glMatrix=i()}(this,function(){"use strict";function t(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}function e(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function r(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function n(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function i(){var t=new Float32Array(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function o(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*s,t[1]=i*u+a*s,t[2]=n*-s+o*u,t[3]=i*-s+a*u,t}function a(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1];return t[0]=n*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t}function s(){var t=new Float32Array(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function u(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function l(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function p(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],v=e[15],g=r*s-n*a,_=r*u-i*a,x=r*l-o*a,b=n*u-i*s,w=n*l-o*s,E=i*l-o*u,T=c*m-p*d,S=c*y-h*d,z=c*v-f*d,A=p*y-h*m,M=p*v-f*m,P=h*v-f*y,L=g*P-_*M+x*A+b*z-w*S+E*T;return L?(L=1/L,t[0]=(s*P-u*M+l*A)*L,t[1]=(i*M-n*P-o*A)*L,t[2]=(m*E-y*w+v*b)*L,t[3]=(h*w-p*E-f*b)*L,t[4]=(u*z-a*P-l*S)*L,t[5]=(r*P-i*z+o*S)*L,t[6]=(y*x-d*E-v*_)*L,t[7]=(c*E-h*x+f*_)*L,t[8]=(a*M-s*z+l*T)*L,t[9]=(n*z-r*M-o*T)*L,t[10]=(d*w-m*x+v*g)*L,t[11]=(p*x-c*w-f*g)*L,t[12]=(s*S-a*A-u*T)*L,t[13]=(r*A-n*S+i*T)*L,t[14]=(m*_-d*b-y*g)*L,t[15]=(c*b-p*_+h*g)*L,t):null}function h(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],v=e[14],g=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*p+w*m,t[1]=_*i+x*u+b*h+w*y,t[2]=_*o+x*l+b*f+w*v,t[3]=_*a+x*c+b*d+w*g,_=r[4],
x=r[5],b=r[6],w=r[7],t[4]=_*n+x*s+b*p+w*m,t[5]=_*i+x*u+b*h+w*y,t[6]=_*o+x*l+b*f+w*v,t[7]=_*a+x*c+b*d+w*g,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*n+x*s+b*p+w*m,t[9]=_*i+x*u+b*h+w*y,t[10]=_*o+x*l+b*f+w*v,t[11]=_*a+x*c+b*d+w*g,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*n+x*s+b*p+w*m,t[13]=_*i+x*u+b*h+w*y,t[14]=_*o+x*l+b*f+w*v,t[15]=_*a+x*c+b*d+w*g,t}function f(t,e,r){var n,i,o,a,s,u,l,c,p,h,f,d,m=r[0],y=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*v+e[12],t[13]=e[1]*m+e[5]*y+e[9]*v+e[13],t[14]=e[2]*m+e[6]*y+e[10]*v+e[14],t[15]=e[3]*m+e[7]*y+e[11]*v+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=n*m+s*y+p*v+e[12],t[13]=i*m+u*y+h*v+e[13],t[14]=o*m+l*y+f*v+e[14],t[15]=a*m+c*y+d*v+e[15]),t}function d(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function m(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],p=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*n,t[5]=a*i+c*n,t[6]=s*i+p*n,t[7]=u*i+h*n,t[8]=l*i-o*n,t[9]=c*i-a*n,t[10]=p*i-s*n,t[11]=h*i-u*n,t}function y(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],p=e[6],h=e[7];return e!==t&&(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[0]=o*i+l*n,t[1]=a*i+c*n,t[2]=s*i+p*n,t[3]=u*i+h*n,t[4]=l*i-o*n,t[5]=c*i-a*n,t[6]=p*i-s*n,t[7]=h*i-u*n,t}function v(t,e,r,n,i){var o=1/Math.tan(e/2),a=1/(n-i);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*a,t[15]=0,t}function g(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*l,t[15]=1,t}var _=(t(),r(),{vec3:{transformMat3:e},vec4:{transformMat4:n},mat2:{create:i,rotate:o,scale:a},mat3:{create:s,fromRotation:u},mat4:{create:l,identity:c,translate:f,scale:d,multiply:h,perspective:v,rotateX:m,rotateZ:y,invert:p,ortho:g}});return _})},{}],132:[function(t,e,r){function n(t){return t=Math.round(t),t<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(t){var e=t.replace(/ /g,"").toLowerCase();if(e in l)return l[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),u=e.indexOf(")");if(i!==-1&&u+1===e.length){var c=e.substr(0,i),p=e.substr(i+1,u-(i+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=a(p.pop());case"rgb":return 3!==p.length?null:[o(p[0]),o(p[1]),o(p[2]),h];case"hsla":if(4!==p.length)return null;h=a(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=a(p[1]),m=a(p[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[n(255*s(v,y,f+1/3)),n(255*s(v,y,f)),n(255*s(v,y,f-1/3)),h];default:return null}}return null}var l={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=u}catch(t){}},{}],133:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,o=n?e[0]*r:t.length,s=i(t,0,o,r,!0),u=[];if(!s)return u;var l,c,h,f,d,m,y;if(n&&(s=p(t,e,s,r)),t.length>80*r){l=h=t[0],c=f=t[1];for(var v=r;v<o;v+=r)d=t[v],m=t[v+1],d<l&&(l=d),m<c&&(c=m),d>h&&(h=d),m>f&&(f=m);y=Math.max(h-l,f-c)}return a(s,u,r,l,c,y),u}function i(t,e,r,n,i){var o,a;if(i===k(t,e,r,n)>0)for(o=e;o<r;o+=n)a=M(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=M(o,t[o],t[o+1],a);return a&&w(a,a.next)&&(P(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var r,n=t;do if(r=!1,n.steiner||!w(n,n.next)&&0!==b(n.prev,n,n.next))n=n.next;else{if(P(n),n=e=n.prev,n===n.next)return null;r=!0}while(r||n!==e);return e}function a(t,e,r,n,i,p,h){if(t){!h&&p&&m(t,n,i,p);for(var f,d,y=t;t.prev!==t.next;)if(f=t.prev,d=t.next,p?u(t,n,i,p):s(t))e.push(f.i/r),e.push(t.i/r),e.push(d.i/r),P(t),t=d.next,y=d.next;else if(t=d,t===y){h?1===h?(t=l(t,e,r),a(t,e,r,n,i,p,2)):2===h&&c(t,e,r,n,i,p):a(o(t),e,r,n,i,p,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(b(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(_(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,r,n){var i=t.prev,o=t,a=t.next;if(b(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,p=v(s,u,e,r,n),h=v(l,c,e,r,n),f=t.nextZ;f&&f.z<=h;){if(f!==t.prev&&f!==t.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=p;){if(f!==t.prev&&f!==t.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function l(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!w(i,o)&&E(i,n,n.next,o)&&S(i,o)&&S(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),P(n),P(n.next),n=t=o),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&x(u,l)){var c=A(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,e,r,n,i,s),void a(c,e,r,n,i,s)}l=l.next}u=u.next}while(u!==t)}function p(t,e,r,n){var a,s,u,l,c,p=[];for(a=0,s=e.length;a<s;a++)u=e[a]*n,l=a<s-1?e[a+1]*n:t.length,c=i(t,u,l,n,!1),c===c.next&&(c.steiner=!0),p.push(g(c));for(p.sort(h),a=0;a<p.length;a++)f(p[a],r),r=o(r,r.next);return r}function h(t,e){return t.x-e.x}function f(t,e){if(e=d(t,e)){var r=A(e,t);o(r,r.next)}}function d(t,e){var r,n=e,i=t.x,o=t.y,a=-(1/0);do{if(o<=n.y&&o>=n.next.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===a)return r.prev;var u,l=r,c=r.x,p=r.y,h=1/0;for(n=r.next;n!==l;)i>=n.x&&n.x>=c&&_(o<p?i:a,o,c,p,o<p?a:i,o,n.x,n.y)&&(u=Math.abs(o-n.y)/(i-n.x),(u<h||u===h&&n.x>r.x)&&S(n,t)&&(r=n,h=u)),n=n.next;return r}function m(t,e,r,n){var i=t;do null===i.z&&(i.z=v(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,y(i)}function y(t){var e,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e<l&&(s++,n=n.nextZ);e++);for(u=l;s>0||u>0&&n;)0===s?(i=n,n=n.nextZ,u--):0!==u&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1);return t}function v(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function g(t){var e=t,r=t;do e.x<r.x&&(r=e),e=e.next;while(e!==t);return r}function _(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!T(t,e)&&S(t,e)&&S(e,t)&&z(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function E(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||b(t,e,r)>0!=b(t,e,n)>0&&b(r,n,t)>0!=b(r,n,e)>0}function T(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&E(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function S(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function z(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function A(t,e){var r=new L(t.i,t.x,t.y),n=new L(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function M(t,e,r,n){var i=new L(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function P(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function L(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function k(t,e,r,n){for(var i=0,o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}e.exports=n,n.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(k(t,0,o,r));if(i)for(var s=0,u=e.length;s<u;s++){var l=e[s]*r,c=s<u-1?e[s+1]*r:t.length;a-=Math.abs(k(t,l,c,r))}var p=0;for(s=0;s<n.length;s+=3){var h=n[s]*r,f=n[s+1]*r,d=n[s+2]*r;p+=Math.abs((t[h]-t[d])*(t[f+1]-t[h+1])-(t[h]-t[f])*(t[d+1]-t[h+1]))}return 0===a&&0===p?0:Math.abs((p-a)/a)},n.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[i][o][a]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],134:[function(t,e,r){function n(t){var e,r,i,l,c,p;switch(typeof t){case"object":if(null===t)return null;if(o(t)){for(i="[",r=t.length-1,e=0;e<r;e++)i+=n(t[e])+",";return r>-1&&(i+=n(t[e])),i+"]"}for(l=a(t).sort(),r=l.length,i="{",c=l[e=0],p=r>0&&void 0!==t[c];e<r;)p?(i+='"'+c.replace(s,u)+'":'+n(t[c]),c=l[++e],p=e<r&&void 0!==t[c],p&&(i+=",")):(c=l[++e],p=e<r&&void 0!==t[c]);return i+"}";case"undefined":return null;case"string":return'"'+t.replace(s,u)+'"';default:return t}}var i={}.toString,o=Array.isArray||function(t){return"[object Array]"===i.call(t)},a=Object.keys||function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e},s=/[\u0000-\u001f"\\]/g,u=function(t){var e=t.charCodeAt(0);switch(e){case 34:return'\\"';case 92:return"\\\\";case 12:return"\\f";case 10:return"\\n";case 13:return"\\r";case 9:return"\\t";case 8:return"\\b";default:return e>15?"\\u00"+e.toString(16):"\\u000"+e.toString(16)}};e.exports=function(t){if(void 0!==t)return""+n(t)},e.exports.stringSearch=s,e.exports.stringReplace=u},{}],135:[function(t,e,r){"use strict";function n(t){return new Function("f","var p = (f && f.properties || {}); return "+i(t))}function i(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";var r="=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(t[1],t[2],e,!0):"any"===e?s(t.slice(1),"||"):"all"===e?s(t.slice(1),"&&"):"none"===e?c(s(t.slice(1),"||")):"in"===e?u(t[1],t.slice(2)):"!in"===e?c(u(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true";return"("+r+")"}function o(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var i=o(t),a="$type"===t?h.indexOf(e):JSON.stringify(e);return(n?"typeof "+i+"=== typeof "+a+"&&":"")+i+r+a}function s(t,e){return t.map(i).join(e)}function u(t,e){"$type"===t&&(e=e.map(function(t){return h.indexOf(t)}));var r=JSON.stringify(e.sort(p)),n=o(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function p(t,e){return t<e?-1:t>e?1:0}e.exports=n;var h=["Unknown","Point","LineString","Polygon"]},{}],136:[function(t,e,r){function n(t){if("Polygon"===t.type)return i(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r<t.coordinates.length;r++)e+=i(t.coordinates[r]);return e}return null}function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(o(t[r]))}return e}function o(t){var e=0;if(t.length>2){for(var r,n,i=0;i<t.length-1;i++)r=t[i],n=t[i+1],e+=a(n[0]-r[0])*(2+Math.sin(a(r[1]))+Math.sin(a(n[1])));e=e*s.RADIUS*s.RADIUS/2}return e}function a(t){return t*Math.PI/180}var s=t("wgs84");e.exports.geometry=n,e.exports.ring=o},{wgs84:212}],137:[function(t,e,r){function n(t,e){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.map(i(n,e)),t;case"Feature":return t.geometry=n(t.geometry,e),t;case"Polygon":case"MultiPolygon":return o(t,e);default:return t}}function i(t,e){return function(r){return t(r,e)}}function o(t,e){return"Polygon"===t.type?t.coordinates=a(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(i(a,e))),t}function a(t,e){e=!!e,t[0]=s(t[0],!e);for(var r=1;r<t.length;r++)t[r]=s(t[r],e);return t}function s(t,e){return u(t)===e?t:t.reverse()}function u(t){return l.ring(t)>=0}var l=t("geojson-area");e.exports=n},{"geojson-area":136}],138:[function(t,e,r){"use strict";function n(t,e,r,n,a,u,l,c){if(r/=e,n/=e,l>=r&&c<=n)return t;if(l>n||c<r)return null;for(var p=[],h=0;h<t.length;h++){var f,d,m=t[h],y=m.geometry,v=m.type;if(f=m.min[a],d=m.max[a],f>=r&&d<=n)p.push(m);else if(!(f>n||d<r)){var g=1===v?i(y,r,n,a):o(y,r,n,a,u,3===v);g.length&&p.push(s(m.tags,v,g,m.id))}}return p.length?p:null}function i(t,e,r,n){for(var i=[],o=0;o<t.length;o++){var a=t[o],s=a[n];s>=e&&s<=r&&i.push(a)}return i}function o(t,e,r,n,i,o){for(var s=[],u=0;u<t.length;u++){var l,c,p,h=0,f=0,d=null,m=t[u],y=m.area,v=m.dist,g=m.outer,_=m.length,x=[];for(c=0;c<_-1;c++)l=d||m[c],d=m[c+1],h=f||l[n],f=d[n],h<e?f>r?(x.push(i(l,d,e),i(l,d,r)),o||(x=a(s,x,y,v,g))):f>=e&&x.push(i(l,d,e)):h>r?f<e?(x.push(i(l,d,r),i(l,d,e)),o||(x=a(s,x,y,v,g))):f<=r&&x.push(i(l,d,r)):(x.push(l),f<e?(x.push(i(l,d,e)),o||(x=a(s,x,y,v,g))):f>r&&(x.push(i(l,d,r)),o||(x=a(s,x,y,v,g))));l=m[_-1],h=l[n],h>=e&&h<=r&&x.push(l),p=x[x.length-1],o&&p&&(x[0][0]!==p[0]||x[0][1]!==p[1])&&x.push(x[0]),a(s,x,y,v,g)}return s}function a(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t("./feature")},{"./feature":140}],139:[function(t,e,r){"use strict";function n(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)i(r,t.features[n],e);else"Feature"===t.type?i(r,t,e):i(r,{geometry:t},e);return r}function i(t,e,r){if(null!==e.geometry){var n,s,u,c,p=e.geometry,h=p.type,f=p.coordinates,d=e.properties,m=e.id;if("Point"===h)t.push(l(d,1,[a(f)],m));else if("MultiPoint"===h)t.push(l(d,1,o(f),m));else if("LineString"===h)t.push(l(d,2,[o(f,r)],m));else if("MultiLineString"===h||"Polygon"===h){for(u=[],n=0;n<f.length;n++)c=o(f[n],r),"Polygon"===h&&(c.outer=0===n),u.push(c);t.push(l(d,"Polygon"===h?3:2,u,m))}else if("MultiPolygon"===h){for(u=[],n=0;n<f.length;n++)for(s=0;s<f[n].length;s++)c=o(f[n][s],r),c.outer=0===s,u.push(c);t.push(l(d,3,u,m))}else{if("GeometryCollection"!==h)throw new Error("Input data is not a valid GeoJSON object.");for(n=0;n<p.geometries.length;n++)i(t,{geometry:p.geometries[n],properties:d},r)}}}function o(t,e){for(var r=[],n=0;n<t.length;n++)r.push(a(t[n]));return e&&(u(r,e),s(r)),r}function a(t){var e=Math.sin(t[1]*Math.PI/180),r=t[0]/360+.5,n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n=n<0?0:n>1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,o=0;o<t.length-1;o++)e=r||t[o],r=t[o+1],n+=e[0]*r[1]-r[0]*e[1],i+=Math.abs(r[0]-e[0])+Math.abs(r[1]-e[1]);t.area=Math.abs(n/2),t.dist=i}e.exports=n;var u=t("./simplify"),l=t("./feature")},{"./feature":140,"./simplify":142}],140:[function(t,e,r){"use strict";function n(t,e,r,n){var o={id:n||null,type:e,geometry:r,tags:t||null,min:[1/0,1/0],max:[-(1/0),-(1/0)]};return i(o),o}function i(t){var e=t.geometry,r=t.min,n=t.max;if(1===t.type)o(r,n,e);else for(var i=0;i<e.length;i++)o(r,n,e[i]);return t}function o(t,e,r){for(var n,i=0;i<r.length;i++)n=r[i],t[0]=Math.min(n[0],t[0]),e[0]=Math.max(n[0],e[0]),t[1]=Math.min(n[1],t[1]),e[1]=Math.max(n[1],e[1])}e.exports=n},{}],141:[function(t,e,r){"use strict";function n(t,e){return new i(t,e)}function i(t,e){e=this.options=u(Object.create(this.options),e);var r=e.debug;r&&console.time("preprocess data");var n=1<<e.maxZoom,i=c(t,e.tolerance/(n*e.extent));this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=f(i,e.buffer/e.extent,a),i.length&&this.splitTile(i,0,0,0),r&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function o(t,e,r){return 32*((1<<t)*r+e)+t}function a(t,e,r){return[r,(r-t[0])*(e[1]-t[1])/(e[0]-t[0])+t[1],1]}function s(t,e,r){return[(r-t[1])*(e[0]-t[0])/(e[1]-t[1])+t[0],r,1]}function u(t,e){for(var r in e)t[r]=e[r];return t}function l(t,e,r){var n=t.source;if(1!==n.length)return!1;var i=n[0];if(3!==i.type||i.geometry.length>1)return!1;var o=i.geometry[0].length;if(5!==o)return!1;for(var a=0;a<o;a++){var s=p.point(i.geometry[0][a],e,t.z2,t.x,t.y);if(s[0]!==-r&&s[0]!==e+r||s[1]!==-r&&s[1]!==e+r)return!1}return!0}e.exports=n;var c=t("./convert"),p=t("./transform"),h=t("./clip"),f=t("./wrap"),d=t("./tile");i.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},i.prototype.splitTile=function(t,e,r,n,i,u,c){for(var p=[t,e,r,n],f=this.options,m=f.debug,y=null;p.length;){n=p.pop(),r=p.pop(),e=p.pop(),t=p.pop();var v=1<<e,g=o(e,r,n),_=this.tiles[g],x=e===f.maxZoom?0:f.tolerance/(v*f.extent);if(!_&&(m>1&&console.time("creation"),_=this.tiles[g]=d(t,v,r,n,x,e===f.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,_.numFeatures,_.numPoints,_.numSimplified),console.timeEnd("creation"));var b="z"+e;this.stats[b]=(this.stats[b]||0)+1,this.total++}if(_.source=t,i){if(e===f.maxZoom||e===i)continue;var w=1<<i-e;if(r!==Math.floor(u/w)||n!==Math.floor(c/w))continue}else if(e===f.indexMaxZoom||_.numPoints<=f.indexMaxPoints)continue;if(f.solidChildren||!l(_,f.extent,f.buffer)){_.source=null,m>1&&console.time("clipping");var E,T,S,z,A,M,P=.5*f.buffer/f.extent,L=.5-P,k=.5+P,C=1+P;E=T=S=z=null,A=h(t,v,r-P,r+k,0,a,_.min[0],_.max[0]),M=h(t,v,r+L,r+C,0,a,_.min[0],_.max[0]),A&&(E=h(A,v,n-P,n+k,1,s,_.min[1],_.max[1]),T=h(A,v,n+L,n+C,1,s,_.min[1],_.max[1])),M&&(S=h(M,v,n-P,n+k,1,s,_.min[1],_.max[1]),z=h(M,v,n+L,n+C,1,s,_.min[1],_.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(p.push(E||[],e+1,2*r,2*n),p.push(T||[],e+1,2*r,2*n+1),p.push(S||[],e+1,2*r+1,2*n),p.push(z||[],e+1,2*r+1,2*n+1))}else i&&(y=e)}return y},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug,s=1<<t;e=(e%s+s)%s;var u=o(t,e,r);if(this.tiles[u])return p.tile(this.tiles[u],i);a>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,h=t,f=e,d=r;!c&&h>0;)h--,f=Math.floor(f/2),d=Math.floor(d/2),c=this.tiles[o(h,f,d)];if(!c||!c.source)return null;if(a>1&&console.log("found parent tile z%d-%d-%d",h,f,d),l(c,i,n.buffer))return p.tile(c,i);a>1&&console.time("drilling down");var m=this.splitTile(c.source,h,f,d,t,e,r);if(a>1&&console.timeEnd("drilling down"),null!==m){var y=1<<t-m;u=o(m,Math.floor(e/y),Math.floor(r/y))}return this.tiles[u]?p.tile(this.tiles[u],i):null}},{"./clip":138,"./convert":139,"./tile":143,"./transform":144,"./wrap":145}],142:[function(t,e,r){"use strict";function n(t,e){var r,n,o,a,s=e*e,u=t.length,l=0,c=u-1,p=[];for(t[l][2]=1,t[c][2]=1;c;){for(n=0,r=l+1;r<c;r++)o=i(t[r],t[l],t[c]),o>n&&(a=r,n=o);n>s?(t[a][2]=n,p.push(l),p.push(a),l=a):(c=p.pop(),l=p.pop())}}function i(t,e,r){var n=e[0],i=e[1],o=r[0],a=r[1],s=t[0],u=t[1],l=o-n,c=a-i;if(0!==l||0!==c){var p=((s-n)*l+(u-i)*c)/(l*l+c*c);p>1?(n=o,i=a):p>0&&(n+=l*p,i+=c*p)}return l=s-n,c=u-i,l*l+c*c}e.exports=n},{}],143:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},u=0;u<t.length;u++){s.numFeatures++,i(s,t[u],o,a);var l=t[u].min,c=t[u].max;l[0]<s.min[0]&&(s.min[0]=l[0]),l[1]<s.min[1]&&(s.min[1]=l[1]),c[0]>s.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,a,s,u,l=e.geometry,c=e.type,p=[],h=r*r;if(1===c)for(i=0;i<l.length;i++)p.push(l[i]),t.numPoints++,t.numSimplified++;else for(i=0;i<l.length;i++)if(s=l[i],n||!(2===c&&s.dist<r||3===c&&s.area<h)){var f=[];for(a=0;a<s.length;a++)u=s[a],(n||u[2]>h)&&(f.push(u),t.numSimplified++),t.numPoints++;3===c&&o(f,s.outer),p.push(f)}else t.numPoints+=s.length;if(p.length){var d={geometry:p,type:c,tags:e.tags||null};null!==e.id&&(d.id=e.id),t.features.push(d)}}function o(t,e){var r=a(t);r<0===e&&t.reverse()}function a(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r=t[a],n+=(r[0]-e[0])*(e[1]+r[1]);return n}e.exports=n},{}],144:[function(t,e,r){"use strict";function n(t,e){if(t.transformed)return t;var r,n,o,a=t.z2,s=t.x,u=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],c=l.geometry,p=l.type;if(1===p)for(n=0;n<c.length;n++)c[n]=i(c[n],e,a,s,u);else for(n=0;n<c.length;n++){var h=c[n];for(o=0;o<h.length;o++)h[o]=i(h[o],e,a,s,u)}}return t.transformed=!0,t}function i(t,e,r,n,i){var o=Math.round(e*(t[0]*r-n)),a=Math.round(e*(t[1]*r-i));return[o,a]}r.tile=n,r.point=i},{}],145:[function(t,e,r){"use strict";function n(t,e,r){var n=t,o=a(t,1,-1-e,e,0,r,-1,2),s=a(t,1,1-e,2+e,0,r,-1,2);return(o||s)&&(n=a(t,1,-e,1+e,0,r,-1,2)||[],o&&(n=i(o,1).concat(n)),s&&(n=n.concat(i(s,-1)))),n}function i(t,e){for(var r=[],n=0;n<t.length;n++){var i,a=t[n],u=a.type;if(1===u)i=o(a.geometry,e);else{i=[];for(var l=0;l<a.geometry.length;l++)i.push(o(a.geometry[l],e))}r.push(s(a.tags,u,i,a.id))}return r}function o(t,e){var r=[];r.area=t.area,r.dist=t.dist;for(var n=0;n<t.length;n++)r.push([t[n][0]+e,t[n][1],t[n][2]]);return r}var a=t("./clip"),s=t("./feature");e.exports=n},{"./clip":138,"./feature":140}],146:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],e=o[1],r=o[2],this.d=e+2*r;for(var a=0;a<this.d*this.d;a++){var s=o[i+a],u=o[i+a+1];n.push(s===u?null:o.subarray(s,u))}var l=o[i+n.length],c=o[i+n.length+1];this.keys=o.subarray(l,c),this.bboxes=o.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var p=0;p<this.d*this.d;p++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var h=r/e*t;this.min=-h,this.max=t+h}e.exports=n;var i=3;n.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},n.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},n.prototype._insertCell=function(t,e,r,n,i,o){this.cells[i].push(o)},n.prototype.query=function(t,e,r,n){var i=this.min,o=this.max;if(t<=i&&e<=i&&o<=r&&o<=n)return Array.prototype.slice.call(this.keys);var a=[],s={};return this._forEachCell(t,e,r,n,this._queryCell,a,s),a},n.prototype._queryCell=function(t,e,r,n,i,o,a){var s=this.cells[i];if(null!==s)for(var u=this.keys,l=this.bboxes,c=0;c<s.length;c++){var p=s[c];if(void 0===a[p]){var h=4*p;t<=l[h+2]&&e<=l[h+3]&&r>=l[h+0]&&n>=l[h+1]?(a[p]=!0,o.push(u[p])):a[p]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,o,a){for(var s=this._convertToCellCoord(t),u=this._convertToCellCoord(e),l=this._convertToCellCoord(r),c=this._convertToCellCoord(n),p=s;p<=l;p++)for(var h=u;h<=c;h++){var f=this.d*h+p;if(i.call(this,t,e,r,n,f,o,a))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var o=new Int32Array(e+r+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;for(var a=e,s=0;s<t.length;s++){var u=t[s];o[i+s]=a,o.set(u,a),a+=u.length}return o[i+t.length]=a,o.set(this.keys,a),a+=this.keys.length,o[i+t.length+1]=a,o.set(this.bboxes,a),a+=this.bboxes.length,o.buffer}},{}],147:[function(t,e,r){r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,p=r?i-1:0,h=r?-1:1,f=t[e+p];for(p+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,p=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+p>=1?h/u:h*Math.pow(2,1-p),e*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*u-1)*Math.pow(2,i),a+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*m}},{}],148:[function(t,e,r){"use strict";function n(t,e,r,n,o){return new i(t,e,r,n,o)}function i(t,e,r,n,i){e=e||o,r=r||a,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var u=0;u<t.length;u++)this.ids[u]=u,this.coords[2*u]=e(t[u]),this.coords[2*u+1]=r(t[u]);s(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function o(t){return t[0]}function a(t){return t[1]}var s=t("./sort"),u=t("./range"),l=t("./within");e.exports=n,i.prototype={range:function(t,e,r,n){return u(this.ids,this.coords,t,e,r,n,this.nodeSize)},within:function(t,e,r){return l(this.ids,this.coords,t,e,r,this.nodeSize)}}},{"./range":149,"./sort":150,"./within":151}],149:[function(t,e,r){"use strict";function n(t,e,r,n,i,o,a){for(var s,u,l=[0,t.length-1,0],c=[];l.length;){var p=l.pop(),h=l.pop(),f=l.pop();if(h-f<=a)for(var d=f;d<=h;d++)s=e[2*d],u=e[2*d+1],s>=r&&s<=i&&u>=n&&u<=o&&c.push(t[d]);else{var m=Math.floor((f+h)/2);s=e[2*m],u=e[2*m+1],s>=r&&s<=i&&u>=n&&u<=o&&c.push(t[m]);var y=(p+1)%2;(0===p?r<=s:n<=u)&&(l.push(f),l.push(m-1),l.push(y)),(0===p?i>=s:o>=u)&&(l.push(m+1),l.push(h),l.push(y))}}return c}e.exports=n},{}],150:[function(t,e,r){"use strict";function n(t,e,r,o,a,s){if(!(a-o<=r)){var u=Math.floor((o+a)/2);i(t,e,u,o,a,s%2),n(t,e,r,o,u-1,s+1),n(t,e,r,u+1,a,s+1)}}function i(t,e,r,n,a,s){for(;a>n;){if(a-n>600){var u=a-n+1,l=r-n+1,c=Math.log(u),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(u-p)/u)*(l-u/2<0?-1:1),f=Math.max(n,Math.floor(r-l*p/u+h)),d=Math.min(a,Math.floor(r+(u-l)*p/u+h));i(t,e,r,f,d,s)}var m=e[2*r+s],y=n,v=a;for(o(t,e,n,r),e[2*a+s]>m&&o(t,e,n,a);y<v;){for(o(t,e,y,v),y++,v--;e[2*y+s]<m;)y++;for(;e[2*v+s]>m;)v--}e[2*n+s]===m?o(t,e,n,v):(v++,o(t,e,v,a)),v<=r&&(n=v+1),r<=v&&(a=v-1)}}function o(t,e,r,n){a(t,r,n),a(e,2*r,2*n),a(e,2*r+1,2*n+1)}function a(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],151:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s=[0,t.length-1,0],u=[],l=o*o;s.length;){var c=s.pop(),p=s.pop(),h=s.pop();if(p-h<=a)for(var f=h;f<=p;f++)i(e[2*f],e[2*f+1],r,n)<=l&&u.push(t[f]);else{var d=Math.floor((h+p)/2),m=e[2*d],y=e[2*d+1];i(m,y,r,n)<=l&&u.push(t[d]);var v=(c+1)%2;(0===c?r-o<=m:n-o<=y)&&(s.push(h),s.push(d-1),s.push(v)),(0===c?r+o>=m:n+o>=y)&&(s.push(d+1),s.push(p),s.push(v))}}return u}function i(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}e.exports=n},{}],152:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function o(t,e,r,i,s,u){return t===e||(null==t||null==e||!c(t)&&!n(e)?t!==t&&e!==e:a(t,e,o,r,i,s,u))}function a(t,e,r,n,i,o,a){var c=p(t),f=p(e),y=m,v=m;c||(y=S.call(t),y==d?y=x:y!=x&&(c=h(t))),f||(v=S.call(e),v==d?v=x:v!=x&&(f=h(e)));var g=y==x,_=v==x,b=y==v;if(b&&!c&&!g)return u(t,e,y);if(!i){var w=g&&T.call(t,"__wrapped__"),E=_&&T.call(e,"__wrapped__");
if(w||E)return r(w?t.value():t,E?e.value():e,n,i,o,a)}if(!b)return!1;o||(o=[]),a||(a=[]);for(var z=o.length;z--;)if(o[z]==t)return a[z]==e;o.push(t),a.push(e);var A=(c?s:l)(t,e,r,n,i,o,a);return o.pop(),a.pop(),A}function s(t,e,r,n,o,a,s){var u=-1,l=t.length,c=e.length;if(l!=c&&!(o&&c>l))return!1;for(;++u<l;){var p=t[u],h=e[u],f=n?n(o?h:p,o?p:h,u):void 0;if(void 0!==f){if(f)continue;return!1}if(o){if(!i(e,function(t){return p===t||r(p,t,n,o,a,s)}))return!1}else if(p!==h&&!r(p,h,n,o,a,s))return!1}return!0}function u(t,e,r){switch(r){case y:case v:return+t==+e;case g:return t.name==e.name&&t.message==e.message;case _:return t!=+t?e!=+e:t==+e;case b:case w:return t==e+""}return!1}function l(t,e,r,n,i,o,a){var s=f(t),u=s.length,l=f(e),c=l.length;if(u!=c&&!i)return!1;for(var p=u;p--;){var h=s[p];if(!(i?h in e:T.call(e,h)))return!1}for(var d=i;++p<u;){h=s[p];var m=t[h],y=e[h],v=n?n(i?y:m,i?m:y,h):void 0;if(!(void 0===v?r(m,y,n,i,o,a):v))return!1;d||(d="constructor"==h)}if(!d){var g=t.constructor,_=e.constructor;if(g!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof g&&g instanceof g&&"function"==typeof _&&_ instanceof _))return!1}return!0}function c(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var p=t("lodash.isarray"),h=t("lodash.istypedarray"),f=t("lodash.keys"),d="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",g="[object Error]",_="[object Number]",x="[object Object]",b="[object RegExp]",w="[object String]",E=Object.prototype,T=E.hasOwnProperty,S=E.toString;e.exports=o},{"lodash.isarray":156,"lodash.istypedarray":158,"lodash.keys":159}],153:[function(t,e,r){function n(t,e,r){if("function"!=typeof t)return i;if(void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,n,i){return t.call(e,r,n,i)};case 4:return function(r,n,i,o){return t.call(e,r,n,i,o)};case 5:return function(r,n,i,o,a){return t.call(e,r,n,i,o,a)}}return function(){return t.apply(e,arguments)}}function i(t){return t}e.exports=n},{}],154:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){var r=null==t?void 0:t[e];return s(r)?r:void 0}function o(t){return a(t)&&f.call(t)==u}function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function s(t){return null!=t&&(o(t)?d.test(p.call(t)):n(t)&&l.test(t))}var u="[object Function]",l=/^\[object .+?Constructor\]$/,c=Object.prototype,p=Function.prototype.toString,h=c.hasOwnProperty,f=c.toString,d=RegExp("^"+p.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=i},{}],155:[function(t,e,r){function n(t){return o(t)&&m.call(t,"callee")&&(!v.call(t,"callee")||y.call(t)==p)}function i(t){return null!=t&&s(t.length)&&!a(t)}function o(t){return l(t)&&i(t)}function a(t){var e=u(t)?y.call(t):"";return e==h||e==f}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=c}function u(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function l(t){return!!t&&"object"==typeof t}var c=9007199254740991,p="[object Arguments]",h="[object Function]",f="[object GeneratorFunction]",d=Object.prototype,m=d.hasOwnProperty,y=d.toString,v=d.propertyIsEnumerable;e.exports=n},{}],156:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){var r=null==t?void 0:t[e];return u(r)?r:void 0}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=g}function a(t){return s(t)&&m.call(t)==c}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){return null!=t&&(a(t)?y.test(f.call(t)):n(t)&&p.test(t))}var l="[object Array]",c="[object Function]",p=/^\[object .+?Constructor\]$/,h=Object.prototype,f=Function.prototype.toString,d=h.hasOwnProperty,m=h.toString,y=RegExp("^"+f.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=i(Array,"isArray"),g=9007199254740991,_=v||function(t){return n(t)&&o(t.length)&&m.call(t)==l};e.exports=_},{}],157:[function(t,e,r){function n(t,e,r,n){r="function"==typeof r?o(r,n,3):void 0;var a=r?r(t,e):void 0;return void 0===a?i(t,e,r):!!a}var i=t("lodash._baseisequal"),o=t("lodash._bindcallback");e.exports=n},{"lodash._baseisequal":152,"lodash._bindcallback":153}],158:[function(t,e,r){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function i(t){return!!t&&"object"==typeof t}function o(t){return i(t)&&n(t.length)&&!!k[I.call(t)]}var a=9007199254740991,s="[object Arguments]",u="[object Array]",l="[object Boolean]",c="[object Date]",p="[object Error]",h="[object Function]",f="[object Map]",d="[object Number]",m="[object Object]",y="[object RegExp]",v="[object Set]",g="[object String]",_="[object WeakMap]",x="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",E="[object Float64Array]",T="[object Int8Array]",S="[object Int16Array]",z="[object Int32Array]",A="[object Uint8Array]",M="[object Uint8ClampedArray]",P="[object Uint16Array]",L="[object Uint32Array]",k={};k[w]=k[E]=k[T]=k[S]=k[z]=k[A]=k[M]=k[P]=k[L]=!0,k[s]=k[u]=k[x]=k[l]=k[b]=k[c]=k[p]=k[h]=k[f]=k[d]=k[m]=k[y]=k[v]=k[g]=k[_]=!1;var C=Object.prototype,I=C.toString;e.exports=o},{}],159:[function(t,e,r){function n(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&a(g(t))}function o(t,e){return t="number"==typeof t||f.test(t)?+t:-1,e=null==e?v:e,t>-1&&t%1==0&&t<e}function a(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=v}function s(t){for(var e=l(t),r=e.length,n=r&&t.length,i=!!n&&a(n)&&(h(t)||p(t)),s=-1,u=[];++s<r;){var c=e[s];(i&&o(c,n)||m.call(t,c))&&u.push(c)}return u}function u(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function l(t){if(null==t)return[];u(t)||(t=Object(t));var e=t.length;e=e&&a(e)&&(h(t)||p(t))&&e||0;for(var r=t.constructor,n=-1,i="function"==typeof r&&r.prototype===t,s=Array(e),l=e>0;++n<e;)s[n]=n+"";for(var c in t)l&&o(c,e)||"constructor"==c&&(i||!m.call(t,c))||s.push(c);return s}var c=t("lodash._getnative"),p=t("lodash.isarguments"),h=t("lodash.isarray"),f=/^\d+$/,d=Object.prototype,m=d.hasOwnProperty,y=c(Object,"keys"),v=9007199254740991,g=n("length"),_=y?function(t){var e=null==t?void 0:t.constructor;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&i(t)?s(t):u(t)?y(t):[]}:s;e.exports=_},{"lodash._getnative":154,"lodash.isarguments":155,"lodash.isarray":156}],160:[function(t,e,r){function n(t){return t>v?Math.pow(t,1/3):t/y+d}function i(t){return t>m?t*t*t:y*(t-d)}function o(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function a(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function s(t){var e=a(t[0]),r=a(t[1]),i=a(t[2]),o=n((.4124564*e+.3575761*r+.1804375*i)/p),s=n((.2126729*e+.7151522*r+.072175*i)/h),u=n((.0193339*e+.119192*r+.9503041*i)/f);return[116*s-16,500*(o-s),200*(s-u),t[3]]}function u(t){var e=(t[0]+16)/116,r=isNaN(t[1])?e:e+t[1]/500,n=isNaN(t[2])?e:e-t[2]/200;return e=h*i(e),r=p*i(r),n=f*i(n),[o(3.2404542*r-1.5371385*e-.4985314*n),o(-.969266*r+1.8760108*e+.041556*n),o(.0556434*r-.2040259*e+1.0572252*n),t[3]]}function l(t){var e=s(t),r=e[0],n=e[1],i=e[2],o=Math.atan2(i,n)*_;return[o<0?o+360:o,Math.sqrt(n*n+i*i),r,t[3]]}function c(t){var e=t[0]*g,r=t[1],n=t[2];return u([n,Math.cos(e)*r,Math.sin(e)*r,t[3]])}var p=.95047,h=1,f=1.08883,d=4/29,m=6/29,y=3*m*m,v=m*m*m,g=Math.PI/180,_=180/Math.PI;e.exports={lab:{forward:s,reverse:u},hcl:{forward:l,reverse:c}}},{}],161:[function(t,e,r){"use strict";function n(t){return t}function i(t,e){var r;if(f(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],p=c||void 0!==t.property,h=c||!p,m=t.stops&&typeof(c?t.stops[0][0].property:t.stops[0][0]),y=t.type||e||("string"===m?"categorical":"exponential");if("exponential"===y)l=s;else if("interval"===y)l=a;else if("categorical"===y)l=o;else{if("identity"!==y)throw new Error('Unknown function type "'+y+'"');l=u}var v;if(t.colorSpace&&"rgb"!==t.colorSpace){if(!d[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);var g=d[t.colorSpace];t=JSON.parse(JSON.stringify(t));for(var _=0;_<t.stops.length;_++)t.stops[_]=[t.stops[_][0],g.forward(t.stops[_][1])];v=g.reverse}else v=n;if(l===o)for(var x=Object.create(null),b=0;b<t.stops.length;b++)x[t.stops[b][0]]=t.stops[b][1];if(c){var w={},E=[];for(_=0;_<t.stops.length;_++){var T=t.stops[_];void 0===w[T[0].zoom]&&(w[T[0].zoom]={zoom:T[0].zoom,type:t.type,property:t.property,stops:[]}),w[T[0].zoom].stops.push([T[0].value,T[1]])}for(var S in w)E.push([w[S].zoom,i(w[S])]);r=function(e,r){return v(s({stops:E,base:t.base},e)(e,r))},r.isFeatureConstant=!1,r.isZoomConstant=!1}else h?(r=function(e){return v(l===o?l(t,e,x):l(t,e))},r.isFeatureConstant=!0,r.isZoomConstant=!1):(r=function(e,r){return v(l===o?l(t,r[t.property],x):l(t,r[t.property]))},r.isFeatureConstant=!1,r.isZoomConstant=!0)}else r=function(){return t},r.isFeatureConstant=!0,r.isZoomConstant=!0;return r}function o(t,e,r){var n=r[e];return void 0===n?t.stops[0][1]:n}function a(t,e){var r=t.stops.length;if(1===r)return t.stops[0][1];if(void 0===e||null===e)return t.stops[r-1][1];if(e<=t.stops[0][0])return t.stops[0][1];if(e>=t.stops[r-1][0])return t.stops[r-1][1];var n=l(t.stops,e);return t.stops[n][1]}function s(t,e){var r=void 0!==t.base?t.base:1,n=t.stops.length;if(1===n)return t.stops[0][1];if(void 0===e||null===e)return t.stops[n-1][1];if(e<=t.stops[0][0])return t.stops[0][1];if(e>=t.stops[n-1][0])return t.stops[n-1][1];var i=l(t.stops,e);return c(e,r,t.stops[i][0],t.stops[i+1][0],t.stops[i][1],t.stops[i+1][1])}function u(t,e){return e}function l(t,e){for(var r,n=t.length,i=0,o=n-1,a=0;i<=o;){if(a=Math.floor((i+o)/2),r=t[a][0],r===e){a+=1;break}r<e?i=a+1:r>e&&(o=a-1)}return Math.max(a-1,0)}function c(t,e,r,n,i,o){return"function"==typeof i?function(){var a=i.apply(void 0,arguments),s=o.apply(void 0,arguments);return c(t,e,r,n,a,s)}:i.length?h(t,e,r,n,i,o):p(t,e,r,n,i,o)}function p(t,e,r,n,i,o){var a,s=n-r,u=t-r;return a=1===e?u/s:(Math.pow(e,u)-1)/(Math.pow(e,s)-1),i*(1-a)+o*a}function h(t,e,r,n,i,o){for(var a=[],s=0;s<i.length;s++)a[s]=p(t,e,r,n,i[s],o[s]);return a}function f(t){return"object"==typeof t&&(t.stops||"identity"===t.type)}var d=t("./color_spaces");e.exports.isFunctionDefinition=f,e.exports.interpolated=function(t){return i(t,"exponential")},e.exports["piecewise-constant"]=function(t){return i(t,"interval")}},{"./color_spaces":160}],162:[function(t,e,r){"use strict";function n(t,e){var r={};for(var n in t)"ref"!==n&&(r[n]=t[n]);return o.forEach(function(t){t in e&&(r[t]=e[t])}),r}function i(t){t=t.slice();var e,r=Object.create(null);for(e=0;e<t.length;e++)r[t[e].id]=t[e];for(e=0;e<t.length;e++)"ref"in t[e]&&(t[e]=n(t[e],r[t[e].ref]));return t}var o=t("./util/ref_properties");e.exports=i},{"./util/ref_properties":168}],163:[function(t,e,r){"use strict";function n(t,e,r,n){t=t||{},e=e||{};var i;for(i in t)t.hasOwnProperty(i)&&(e.hasOwnProperty(i)||(r.push({command:c.removeSource,args:[i]}),n[i]=!0));for(i in e)e.hasOwnProperty(i)&&(t.hasOwnProperty(i)?l(t[i],e[i])||(r.push({command:c.removeSource,args:[i]}),r.push({command:c.addSource,args:[i,e[i]]}),n[i]=!0):r.push({command:c.addSource,args:[i,e[i]]}))}function i(t,e,r,n,i,o){t=t||{},e=e||{};var a;for(a in t)t.hasOwnProperty(a)&&(l(t[a],e[a])||r.push({command:o,args:[n,a,e[a],i]}));for(a in e)e.hasOwnProperty(a)&&!t.hasOwnProperty(a)&&(l(t[a],e[a])||r.push({command:o,args:[n,a,e[a],i]}))}function o(t){return t.id}function a(t,e){return t[e.id]=e,t}function s(t,e,r){t=t||[],e=e||[];var n,s,u,p,h,f,d,m=t.map(o),y=e.map(o),v=t.reduce(a,{}),g=e.reduce(a,{}),_=m.slice(),x=Object.create(null);for(n=0,s=0;n<m.length;n++)u=m[n],g.hasOwnProperty(u)?s++:(r.push({command:c.removeLayer,args:[u]}),_.splice(_.indexOf(u,s),1));for(n=0,s=0;n<y.length;n++)u=y[y.length-1-n],_[_.length-1-n]!==u&&(v.hasOwnProperty(u)?(r.push({command:c.removeLayer,args:[u]}),_.splice(_.lastIndexOf(u,_.length-s),1)):s++,f=_[_.length-n],r.push({command:c.addLayer,args:[g[u],f]}),_.splice(_.length-n,0,u),x[u]=!0);for(n=0;n<y.length;n++)if(u=y[n],p=v[u],h=g[u],!x[u]&&!l(p,h))if(l(p.source,h.source)&&l(p["source-layer"],h["source-layer"])&&l(p.type,h.type)){i(p.layout,h.layout,r,u,null,c.setLayoutProperty),i(p.paint,h.paint,r,u,null,c.setPaintProperty),l(p.filter,h.filter)||r.push({command:c.setFilter,args:[u,h.filter]}),l(p.minzoom,h.minzoom)&&l(p.maxzoom,h.maxzoom)||r.push({command:c.setLayerZoomRange,args:[u,h.minzoom,h.maxzoom]});for(d in p)p.hasOwnProperty(d)&&"layout"!==d&&"paint"!==d&&"filter"!==d&&"metadata"!==d&&"minzoom"!==d&&"maxzoom"!==d&&(0===d.indexOf("paint.")?i(p[d],h[d],r,u,d.slice(6),c.setPaintProperty):l(p[d],h[d])||r.push({command:c.setLayerProperty,args:[u,d,h[d]]}));for(d in h)h.hasOwnProperty(d)&&!p.hasOwnProperty(d)&&"layout"!==d&&"paint"!==d&&"filter"!==d&&"metadata"!==d&&"minzoom"!==d&&"maxzoom"!==d&&(0===d.indexOf("paint.")?i(p[d],h[d],r,u,d.slice(6),c.setPaintProperty):l(p[d],h[d])||r.push({command:c.setLayerProperty,args:[u,d,h[d]]}))}else r.push({command:c.removeLayer,args:[u]}),f=_[_.lastIndexOf(u)+1],r.push({command:c.addLayer,args:[h,f]})}function u(t,e){if(!t)return[{command:c.setStyle,args:[e]}];var r=[];try{if(!l(t.version,e.version))return[{command:c.setStyle,args:[e]}];l(t.center,e.center)||r.push({command:c.setCenter,args:[e.center]}),l(t.zoom,e.zoom)||r.push({command:c.setZoom,args:[e.zoom]}),l(t.bearing,e.bearing)||r.push({command:c.setBearing,args:[e.bearing]}),l(t.pitch,e.pitch)||r.push({command:c.setPitch,args:[e.pitch]}),l(t.sprite,e.sprite)||r.push({command:c.setSprite,args:[e.sprite]}),l(t.glyphs,e.glyphs)||r.push({command:c.setGlyphs,args:[e.glyphs]}),l(t.transition,e.transition)||r.push({command:c.setTransition,args:[e.transition]}),l(t.light,e.light)||r.push({command:c.setLight,args:[e.light]});var i={},o=[];n(t.sources,e.sources,o,i);var a=[];t.layers&&t.layers.forEach(function(t){i[t.source]?r.push({command:c.removeLayer,args:[t.id]}):a.push(t)}),r=r.concat(o),s(a,e.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:c.setStyle,args:[e]}]}return r}var l=t("lodash.isequal"),c={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};e.exports=u,e.exports.operations=c},{"lodash.isequal":157}],164:[function(t,e,r){"use strict";function n(t,e){this.message=(t?t+": ":"")+i.apply(i,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var i=t("util").format;e.exports=n},{util:203}],165:[function(t,e,r){"use strict";function n(t){return a(o.map(function(e){return t[e]}))}function i(t){var e,r,i={};for(e=0;e<t.length;e++){r=n(t[e]);var o=i[r];o||(o=i[r]=[]),o.push(t[e])}var a=[];for(r in i)a.push(i[r]);return a}var o=t("./util/ref_properties"),a=t("fast-stable-stringify");e.exports=i},{"./util/ref_properties":168,"fast-stable-stringify":134}],166:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}},{}],167:[function(t,e,r){"use strict";e.exports=function(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}},{}],168:[function(t,e,r){"use strict";e.exports=["type","source","source-layer","minzoom","maxzoom","filter","layout"]},{}],169:[function(t,e,r){"use strict";e.exports=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}},{}],170:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),o=t("../util/extend");e.exports=function(e){var r=t("./validate_function"),a=t("./validate_object"),s={"*":function(){return[]},array:t("./validate_array"),boolean:t("./validate_boolean"),number:t("./validate_number"),color:t("./validate_color"),constants:t("./validate_constants"),enum:t("./validate_enum"),filter:t("./validate_filter"),function:t("./validate_function"),layer:t("./validate_layer"),object:t("./validate_object"),source:t("./validate_source"),light:t("./validate_light"),string:t("./validate_string")},u=e.value,l=e.valueSpec,c=e.key,p=e.styleSpec,h=e.style;if("string"===i(u)&&"@"===u[0]){if(p.$version>7)return[new n(c,u,"constants have been deprecated as of v8")];if(!(u in h.constants))return[new n(c,u,'constant "%s" not found',u)];e=o({},e,{value:h.constants[u]})}return l.function&&"object"===i(u)?r(e):l.type&&s[l.type]?s[l.type](e):a(o({},e,{valueSpec:l.type?p[l.type]:l}))}},{"../error/validation_error":164,"../util/extend":166,"../util/get_type":167,"./validate_array":171,"./validate_boolean":172,"./validate_color":173,"./validate_constants":174,"./validate_enum":175,"./validate_filter":176,"./validate_function":177,"./validate_layer":179,"./validate_light":181,"./validate_number":182,"./validate_object":183,"./validate_source":185,"./validate_string":186}],171:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),o=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,a=t.style,s=t.styleSpec,u=t.key,l=t.arrayElementValidator||i;if("array"!==n(e))return[new o(u,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new o(u,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length<r["min-length"])return[new o(u,e,"array length at least %d expected, length %d found",r["min-length"],e.length)];var c={type:r.value};s.$version<7&&(c.function=r.function),"object"===n(r.value)&&(c=r.value);for(var p=[],h=0;h<e.length;h++)p=p.concat(l({array:e,arrayIndex:h,value:e[h],valueSpec:c,style:a,styleSpec:s,key:u+"["+h+"]"}));return p}},{"../error/validation_error":164,"../util/get_type":167,"./validate":170}],172:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,o=n(e);return"boolean"!==o?[new i(r,e,"boolean expected, %s found",o)]:[]}},{"../error/validation_error":164,"../util/get_type":167}],173:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),o=t("csscolorparser").parseCSSColor;e.exports=function(t){var e=t.key,r=t.value,a=i(r);return"string"!==a?[new n(e,r,"color expected, %s found",a)]:null===o(r)?[new n(e,r,'color expected, "%s" found',r)]:[]}},{"../error/validation_error":164,"../util/get_type":167,csscolorparser:132}],174:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type");e.exports=function(t){var e=t.key,r=t.value,o=t.styleSpec;if(o.$version>7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var s=[];for(var u in r)"@"!==u[0]&&s.push(new n(e+"."+u,r[u],'constants must start with "@"'));return s}},{"../error/validation_error":164,"../util/get_type":167}],175:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,a=[];return Array.isArray(o.values)?o.values.indexOf(i(r))===-1&&a.push(new n(e,r,"expected one of [%s], %s found",o.values.join(", "),r)):Object.keys(o.values).indexOf(i(r))===-1&&a.push(new n(e,r,"expected one of [%s], %s found",Object.keys(o.values).join(", "),r)),a}},{"../error/validation_error":164,"../util/unbundle_jsonlint":169}],176:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),o=t("../util/get_type"),a=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,u=e.key,l=e.styleSpec,c=[];if("array"!==o(s))return[new n(u,s,"array expected, %s found",o(s))];if(s.length<1)return[new n(u,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:u+"[0]",value:s[0],valueSpec:l.filter_operator,style:e.style,styleSpec:e.styleSpec})),a(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new n(u,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new n(u,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(r=o(s[1]),"string"!==r?c.push(new n(u+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(u+"[1]",s[1],"filter key cannot be a constant")));for(var p=2;p<s.length;p++)r=o(s[p]),"$type"==s[1]?c=c.concat(i({key:u+"["+p+"]",value:s[p],valueSpec:l.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"===r&&"@"===s[p][0]?c.push(new n(u+"["+p+"]",s[p],"filter value cannot be a constant")):"string"!==r&&"number"!==r&&"boolean"!==r&&c.push(new n(u+"["+p+"]",s[p],"string, number, or boolean expected, %s found",r));break;case"any":case"all":case"none":for(p=1;p<s.length;p++)c=c.concat(t({key:u+"["+p+"]",value:s[p],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":r=o(s[1]),2!==s.length?c.push(new n(u,s,'filter array for "%s" operator must have 2 elements',s[0])):"string"!==r?c.push(new n(u+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(u+"[1]",s[1],"filter key cannot be a constant"))}return c}},{"../error/validation_error":164,"../util/get_type":167,"../util/unbundle_jsonlint":169,"./validate_enum":175}],177:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),o=t("./validate"),a=t("./validate_object"),s=t("./validate_array"),u=t("./validate_number"),l=t("../util/unbundle_jsonlint");e.exports=function(t){function e(t){if("identity"===f)return[new n(t.key,t.value,'identity function may not have a "stops" property')];var e=[],o=t.value;return e=e.concat(s({key:t.key,value:o,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:r})),"array"===i(o)&&0===o.length&&e.push(new n(t.key,o,"array must have at least one stop")),e}function r(t){var e=[],r=t.value,s=t.key;if("array"!==i(r))return[new n(s,r,"array expected, %s found",i(r))];if(2!==r.length)return[new n(s,r,"array length %d expected, length %d found",2,r.length)];if(y){if("object"!==i(r[0]))return[new n(s,r,"object expected, %s found",i(r[0]))];if(void 0===r[0].zoom)return[new n(s,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new n(s,r,"object stop key must have value")];e=e.concat(a({key:s+"[0]",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:u,value:c}}))}else e=e.concat((d?u:c)({key:s+"[0]",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return e=e.concat(o({key:s+"[1]",value:r[1],valueSpec:h,style:t.style,styleSpec:t.styleSpec})),"number"===i(r[0])&&("piecewise-constant"===h.function&&r[0]%1!==0&&e.push(new n(s+"[0]",r[0],"zoom level for piecewise-constant functions must be an integer")),0!==t.arrayIndex&&r[0]<t.array[t.arrayIndex-1][0]&&e.push(new n(s+"[0]",r[0],"array stops must appear in ascending order"))),e}function c(t){var e=i(t.value);if(p){if(e!==p)return[new n(t.key,t.value,"%s stop domain type must match previous stop domain type %s",e,p)]}else p=e,f||"string"!==e||(f="categorical");return"number"!==e&&"string"!==e?[new n(t.key,t.value,"property value must be a number or string")]:"number"!==e&&"categorical"!==f?[new n(t.key,t.value,"number expected, %s found",e)]:[]}var p,h=t.valueSpec,f=l(t.value.type),d=void 0===t.value.property,m=void 0!==t.value.property,y="array"===i(t.value.stops)&&"array"===i(t.value.stops[0])&&"object"===i(t.value.stops[0][0]),v=a({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:e}});return"identity"===f||t.value.stops||v.push(new n(t.key,t.value,'missing required property "stops"')),t.styleSpec.$version>=8&&(m&&!t.valueSpec["property-function"]?v.push(new n(t.key,t.value,"property functions not supported")):d&&!t.valueSpec["zoom-function"]&&v.push(new n(t.key,t.value,"zoom functions not supported"))),v}},{"../error/validation_error":164,"../util/get_type":167,"../util/unbundle_jsonlint":169,"./validate":170,"./validate_array":171,"./validate_number":182,"./validate_object":183}],178:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,o=i(t);return o.length?o:(e.indexOf("{fontstack}")===-1&&o.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new n(r,e,'"glyphs" url must include a "{range}" token')),o)}},{"../error/validation_error":164,"./validate_string":186}],179:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_filter"),s=t("./validate_paint_property"),u=t("./validate_layout_property"),l=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,p=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either "type" or "ref" is required'));var f=i(r.type),d=i(r.ref);if(r.id)for(var m=0;m<t.arrayIndex;m++){var y=p.layers[m];i(y.id)===i(r.id)&&e.push(new n(c,r.id,'duplicate layer id "%s", previously used at line %d',r.id,y.id.__line__))}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new n(c,r[t],'"%s" is prohibited for ref layers',t))});var v;p.layers.forEach(function(t){t.id==d&&(v=t)}),v?v.ref?e.push(new n(c,r.ref,"ref cannot reference another ref layer")):f=i(v.type):e.push(new n(c,r.ref,'ref layer "%s" not found',d))}else if("background"!==f)if(r.source){var g=p.sources&&p.sources[r.source];g?"vector"==g.type&&"raster"==f?e.push(new n(c,r.source,'layer "%s" requires a raster source',r.id)):"raster"==g.type&&"raster"!=f?e.push(new n(c,r.source,'layer "%s" requires a vector source',r.id)):"vector"!=g.type||r["source-layer"]||e.push(new n(c,r,'layer "%s" must specify a "source-layer"',r.id)):e.push(new n(c,r.source,'source "%s" not found',r.source))}else e.push(new n(c,r,'missing required property "source"'));return e=e.concat(o({key:c,value:r,valueSpec:h.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},filter:a,layout:function(t){return o({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return u(l({layerType:f},t))}}})},paint:function(t){return o({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return s(l({layerType:f},t))}}})}}}))}},{"../error/validation_error":164,"../util/extend":166,"../util/unbundle_jsonlint":169,"./validate_filter":176,"./validate_layout_property":180,"./validate_object":183,"./validate_paint_property":184}],180:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,u=o["layout_"+t.layerType];if(!u)return[];if(t.valueSpec||u[s]){var l=[];return"symbol"===t.layerType&&("icon-image"===s&&r&&!r.sprite?l.push(new i(e,a,'use of "icon-image" requires a style "sprite" property')):"text-field"===s&&r&&!r.glyphs&&l.push(new i(e,a,'use of "text-field" requires a style "glyphs" property'))),l.concat(n({key:t.key,value:a,valueSpec:t.valueSpec||u[s],style:r,styleSpec:o}))}return[new i(e,a,'unknown property "%s"',s)]}},{"../error/validation_error":164,"./validate":170}],181:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),o=t("./validate");e.exports=function(t){var e=t.value,r=t.styleSpec,a=r.light,s=t.style,u=[],l=i(e);if(void 0===e)return u;if("object"!==l)return u=u.concat([new n("light",e,"object expected, %s found",l)]);for(var c in e){var p=c.match(/^(.*)-transition$/);u=p&&a[p[1]]&&a[p[1]].transition?u.concat(o({key:c,value:e[c],valueSpec:r.transition,style:s,styleSpec:r})):a[c]?u.concat(o({key:c,value:e[c],valueSpec:a[c],style:s,styleSpec:r})):u.concat([new n(c,e[c],'unknown property "%s"',c)])}return u}},{"../error/validation_error":164,"../util/get_type":167,"./validate":170}],182:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,a=n(r);return"number"!==a?[new i(e,r,"number expected, %s found",a)]:"minimum"in o&&r<o.minimum?[new i(e,r,"%s is less than the minimum value %s",r,o.minimum)]:"maximum"in o&&r>o.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,o.maximum)]:[]}},{"../error/validation_error":164,"../util/get_type":167}],183:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),o=t("./validate");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec||{},s=t.objectElementValidators||{},u=t.style,l=t.styleSpec,c=[],p=i(r);if("object"!==p)return[new n(e,r,"object expected, %s found",p)];for(var h in r){var f,d=h.split(".")[0],m=a[d]||a["*"];if(s[d])f=s[d];else if(a[d])f=o;else if(s["*"])f=s["*"];else{if(!a["*"]){c.push(new n(e,r[h],'unknown property "%s"',h));continue}f=o}c=c.concat(f({key:(e?e+".":e)+h,value:r[h],valueSpec:m,style:u,styleSpec:l,object:r,objectKey:h}))}for(d in a)a[d].required&&void 0===a[d].default&&void 0===r[d]&&c.push(new n(e,r,'missing required property "%s"',d));return c}},{"../error/validation_error":164,"../util/get_type":167,"./validate":170}],184:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,u=o["paint_"+t.layerType];if(!u)return[];var l=s.match(/^(.*)-transition$/);return l&&u[l[1]]&&u[l[1]].transition?n({key:e,value:a,valueSpec:o.transition,style:r,styleSpec:o}):t.valueSpec||u[s]?n({key:t.key,value:a,valueSpec:t.valueSpec||u[s],style:r,styleSpec:o}):[new i(e,a,'unknown property "%s"',s)]}},{"../error/validation_error":164,"./validate":170}],185:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,u=t.style;if(!e.type)return[new n(r,e,'"type" is required')];var l=i(e.type);switch(l){case"vector":case"raster":var c=[];if(c=c.concat(o({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var p in e)["type","url","tileSize"].indexOf(p)<0&&c.push(new n(r+"."+p,e[p],'a source with a "url" property may not include a "%s" property',p));return c;case"geojson":return o({key:r,value:e,valueSpec:s.source_geojson,style:u,styleSpec:s});case"video":return o({key:r,value:e,valueSpec:s.source_video,style:u,styleSpec:s});case"image":return o({key:r,value:e,valueSpec:s.source_image,style:u,styleSpec:s});default:return a({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:u,styleSpec:s})}}},{"../error/validation_error":164,"../util/unbundle_jsonlint":169,"./validate_enum":175,"./validate_object":183}],186:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,o=n(e);return"string"!==o?[new i(r,e,"string expected, %s found",o)]:[]}},{"../error/validation_error":164,"../util/get_type":167}],187:[function(t,e,r){"use strict";function n(t,e){e=e||u;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:l,"*":function(){return[]}}})),e.$version>7&&t.constants&&(r=r.concat(a({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function o(t){return function(){return i(t.apply(this,arguments))}}var a=t("./validate/validate_constants"),s=t("./validate/validate"),u=t("../reference/latest.min"),l=t("./validate/validate_glyphs_url");
n.source=o(t("./validate/validate_source")),n.light=o(t("./validate/validate_light")),n.layer=o(t("./validate/validate_layer")),n.filter=o(t("./validate/validate_filter")),n.paintProperty=o(t("./validate/validate_paint_property")),n.layoutProperty=o(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":188,"./validate/validate":170,"./validate/validate_constants":174,"./validate/validate_filter":176,"./validate/validate_glyphs_url":178,"./validate/validate_layer":179,"./validate/validate_layout_property":180,"./validate/validate_light":181,"./validate/validate_paint_property":184,"./validate/validate_source":185}],188:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":189}],189:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:{vector:{},raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},"fill-extrusion":{},raster:{},background:{}}},metadata:{type:"*"},ref:{type:"string"},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"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_fill-extrusion","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},"layout_fill-extrusion":{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{butt:{},round:{},square:{}},default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{bevel:{},round:{},miter:{}},default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{point:{},line:{}},default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{left:{},center:{},right:{}},default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{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"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},transition:!1},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_fill-extrusion","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!1,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0,requires:[{"<=":"fill-extrusion-height"}]}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{}},default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{}},default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{}},default:"map"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],190:[function(t,e,r){"use strict";function n(t){return!!(i()&&o()&&a()&&s()&&u()&&l()&&c()&&p(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function o(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function a(){return Function.prototype&&Function.prototype.bind}function s(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function u(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function l(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function p(t){return void 0===f[t]&&(f[t]=h(t)),f[t]}function h(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}"undefined"!=typeof e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var f={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],191:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(t){return i.exec(t).slice(1)};r.resolve=function(){for(var r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),o="/"===a(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u<a;u++)if(i[u]!==o[u]){s=u;break}for(var l=[],u=s;u<i.length;u++)l.push("..");return l=l.concat(o.slice(s)),l.join("/")},r.sep="/",r.delimiter=":",r.dirname=function(t){var e=o(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},r.basename=function(t,e){var r=o(t)[2];return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){return o(t)[3]};var a="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:195}],192:[function(t,e,r){"use strict";function n(t){var e;t&&t.length&&(e=t,t=e.length);var r=new Uint8Array(t||0);return e&&r.set(e),r.readUInt32LE=o.readUInt32LE,r.writeUInt32LE=o.writeUInt32LE,r.readInt32LE=o.readInt32LE,r.writeInt32LE=o.writeInt32LE,r.readFloatLE=o.readFloatLE,r.writeFloatLE=o.writeFloatLE,r.readDoubleLE=o.readDoubleLE,r.writeDoubleLE=o.writeDoubleLE,r.toString=o.toString,r.write=o.write,r.slice=o.slice,r.copy=o.copy,r._isBuffer=!0,r}function i(t){for(var e,r,n=t.length,i=[],o=0;o<n;o++){if(e=t.charCodeAt(o),e>55295&&e<57344){if(!r){e>56319||o+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var o,a,s,u=t("ieee754");o={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return u.read(this,t,!0,23,4)},readDoubleLE:function(t){return u.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return u.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return u.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var o=e;o<r;o++){var a=this[o];a<=127?(n+=decodeURIComponent(i)+String.fromCharCode(a),i=""):i+="%"+a.toString(16)}return n+=decodeURIComponent(i)},write:function(t,e){for(var r=t===a?s:i(t),n=0;n<r.length;n++)this[e+n]=r[n]},slice:function(t,e){return this.subarray(t,e)},copy:function(t,e){e=e||0;for(var r=0;r<this.length;r++)t[e+r]=this[r]}},o.writeInt32LE=o.writeUInt32LE,n.byteLength=function(t){return a=t,s=i(t),s.length},n.isBuffer=function(t){return!(!t||!t._isBuffer)}},{ieee754:147}],193:[function(t,e,n){(function(r){"use strict";function n(t){this.buf=y.isBuffer(t)?t:new y(t||0),this.pos=0,this.length=this.buf.length}function i(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}function o(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function a(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function u(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function m(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}e.exports=n;var y=r.Buffer||t("./buffer");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var v=4294967296,g=1/v,_=Math.pow(2,63);n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readUInt32LE(this.pos+4)*v;return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readInt32LE(this.pos+4)*v;return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e<_)return e;for(var r=this.pos-2;255===this.buf[r];)r--;r<t&&(r=t),e=0;for(var n=0;n<r-t+1;n++){var i=127&~this.buf[t+n];e+=n<4?i<<7*n:i*Math.pow(2,7*n)}return-e-1},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.buf.toString("utf8",this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.slice(this.pos,t);return this.pos=t,e},readPackedVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readVarint());return e},readPackedSVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new y(e);this.buf.copy(r),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.slice(0,this.length)},writeFixed32:function(t){this.realloc(4),this.buf.writeUInt32LE(t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),this.buf.writeInt32LE(t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(t&-1,this.pos),this.buf.writeUInt32LE(Math.floor(t*g),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(t&-1,this.pos),this.buf.writeInt32LE(Math.floor(t*g),this.pos+4),this.pos+=8},writeVarint:function(t){return t=+t,t>268435455?void o(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),void(t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127)))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=y.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){
this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&a(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){this.writeMessage(t,p,e)},writePackedFloat:function(t,e){this.writeMessage(t,l,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,h,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedFixed64:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":192}],194:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],195:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(p===setTimeout)return setTimeout(t,0);if((p===n||!p)&&setTimeout)return p=setTimeout,setTimeout(t,0);try{return p(t,0)}catch(e){try{return p.call(null,t,0)}catch(e){return p.call(this,t,0)}}}function a(t){if(h===clearTimeout)return clearTimeout(t);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){y&&d&&(y=!1,d.length?m=d.concat(m):v=-1,m.length&&u())}function u(){if(!y){var t=o(s);y=!0;for(var e=m.length;e;){for(d=m,m=[];++v<e;)d&&d[v].run();v=-1,e=m.length}d=null,y=!1,a(t)}}function l(t,e){this.fun=t,this.array=e}function c(){}var p,h,f=e.exports={};!function(){try{p="function"==typeof setTimeout?setTimeout:n}catch(t){p=n}try{h="function"==typeof clearTimeout?clearTimeout:i}catch(t){h=i}}();var d,m=[],y=!1,v=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];m.push(new l(t,e)),1!==m.length||y||o(u)},l.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=c,f.addListener=c,f.once=c,f.off=c,f.removeListener=c,f.removeAllListeners=c,f.emit=c,f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],196:[function(t,e,r){"use strict";function n(t,e,r,a,s){for(r=r||0,a=a||t.length-1,s=s||o;a>r;){if(a-r>600){var u=a-r+1,l=e-r+1,c=Math.log(u),p=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*p*(u-p)/u)*(l-u/2<0?-1:1),f=Math.max(r,Math.floor(e-l*p/u+h)),d=Math.min(a,Math.floor(e+(u-l)*p/u+h));n(t,e,f,d,s)}var m=t[e],y=r,v=a;for(i(t,r,e),s(t[a],m)>0&&i(t,r,a);y<v;){for(i(t,y,v),y++,v--;s(t[y],m)<0;)y++;for(;s(t[v],m)>0;)v--}0===s(t[r],m)?i(t,r,v):(v++,i(t,v,a)),v<=e&&(r=v+1),e<=v&&(a=v-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function o(t,e){return t<e?-1:t>e?1:0}e.exports=n},{}],197:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.ShelfPack=i()}(this,function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=(0|this.stats[t])+1}}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,n,i,o=[],a=0;a<t.length;a++)if(r=t[a].w||t[a].width,n=t[a].h||t[a].height,r&&n){if(i=this.packOne(r,n),!i)continue;e.inPlace&&(t[a].x=i.x,t[a].y=i.y),o.push(i)}if(this.shelves.length>0){for(var s=0,u=0,l=0;l<this.shelves.length;l++){var c=this.shelves[l];u+=c.h,s=Math.max(c.w-c.free,s)}this.resize(s,u)}return o},t.prototype.packOne=function(t,r){for(var n,i,o=0,a={shelf:-1,waste:1/0},s=0;s<this.shelves.length;s++){if(n=this.shelves[s],o+=n.h,r===n.h&&t<=n.free)return this.count(r),n.alloc(t,r);r>n.h||t>n.free||r<n.h&&t<=n.free&&(i=n.h-r,i<a.waste&&(a.waste=i,a.shelf=s))}if(a.shelf!==-1)return n=this.shelves[a.shelf],this.count(r),n.alloc(t,r);if(r<=this.h-o&&t<=this.w)return n=new e(o,this.w,r),this.shelves.push(n),this.count(r),n.alloc(t,r);if(this.autoResize){var u,l,c,p;return u=l=this.h,c=p=this.w,(c<=u||t>c)&&(p=2*Math.max(t,c)),(u<c||r>u)&&(l=2*Math.max(r,u)),this.resize(p,l),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;r<this.shelves.length;r++)this.shelves[r].resize(t);return!0},e.prototype.alloc=function(t,e){if(t>this.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],198:[function(t,e,r){"use strict";function n(t){return new i(t)}function i(t){this.options=f(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function o(t,e,r,n){return{x:t,y:e,zoom:1/0,id:n,numPoints:r}}function a(t,e){var r=t.geometry.coordinates;return o(l(r[0]),c(r[1]),1,e)}function s(t){return{type:"Feature",properties:u(t),geometry:{type:"Point",coordinates:[p(t.x),h(t.y)]}}}function u(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return{cluster:!0,point_count:e,point_count_abbreviated:r}}function l(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function p(t){return 360*(t-.5)}function h(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function f(t,e){for(var r in e)t[r]=e[r];return t}function d(t){return t.x}function m(t){return t.y}var y=t("kdbush");e.exports=n,i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(a);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var o=+Date.now();this.trees[i+1]=y(n,d,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=y(n,d,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(l(t[0]),c(t[3]),l(t[2]),c(t[1])),i=[],o=0;o<n.length;o++){var a=r.points[n[o]];i.push(a.id!==-1?this.points[a.id]:s(a))}return i},getTile:function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options.extent,a=this.options.radius,s=a/o,u=(r-s)/i,l=(r+1+s)/i,c={features:[]};return this._addTileFeatures(n.range((e-s)/i,u,(e+1+s)/i,l),n.points,e,r,i,c),0===e&&this._addTileFeatures(n.range(1-s/i,u,1,l),n.points,i,r,i,c),e===i-1&&this._addTileFeatures(n.range(0,u,s/i,l),n.points,-1,r,i,c),c.features.length?c:null},_addTileFeatures:function(t,e,r,n,i,o){for(var a=0;a<t.length;a++){var s=e[t[a]];o.features.push({type:1,geometry:[[Math.round(this.options.extent*(s.x*i-r)),Math.round(this.options.extent*(s.y*i-n))]],tags:s.id!==-1?this.points[s.id].properties:u(s)})}},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var r=[],n=this.options.radius/(this.options.extent*Math.pow(2,e)),i=0;i<t.length;i++){var a=t[i];if(!(a.zoom<=e)){a.zoom=e;for(var s=this.trees[e+1],u=s.within(a.x,a.y,n),l=!1,c=a.numPoints,p=a.x*c,h=a.y*c,f=0;f<u.length;f++){var d=s.points[u[f]];e<d.zoom&&(l=!0,d.zoom=e,p+=d.x*d.numPoints,h+=d.y*d.numPoints,c+=d.numPoints)}r.push(l?o(p/c,h/c,c,-1):a)}}return r}}},{kdbush:148}],199:[function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||i,t)for(var r=Math.floor(this.length/2);r>=0;r--)this._down(r)}function i(t,e){return t<e?-1:t>e?1:0}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n,n.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){var t=this.data[0];return this.data[0]=this.data[this.length-1],this.length--,this.data.pop(),this._down(0),t},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare;t>0;){var n=Math.floor((t-1)/2);if(!(r(e[t],e[n])<0))break;o(e,n,t),t=n}},_down:function(t){for(var e=this.data,r=this.compare,n=this.length;;){var i=2*t+1,a=i+1,s=t;if(i<n&&r(e[i],e[s])<0&&(s=i),a<n&&r(e[a],e[s])<0&&(s=a),s===t)return;o(e,s,t),t=s}}}},{}],200:[function(t,e,r){function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}e.exports=n,n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){"undefined"==typeof e&&(e=1e-6);var r,n,i,o,a;for(i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if(r=0,n=1,i=t,i<r)return r;if(i>n)return n;for(;r<n;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],201:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],202:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],203:[function(t,e,n){(function(e,r){function i(t,e){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(e)?r.showHidden=e:e&&n._extend(r,e),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,t,r.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function u(t,e,r){if(t.customInspect&&e&&z(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return _(i)||(i=u(t,i,r)),i}var o=l(t,e);if(o)return o;var a=Object.keys(e),m=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),S(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(e);if(0===a.length){if(z(e)){var y=e.name?": "+e.name:"";return t.stylize("[Function"+y+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(T(e))return t.stylize(Date.prototype.toString.call(e),"date");if(S(e))return c(e)}var v="",g=!1,x=["{","}"];if(d(e)&&(g=!0,x=["[","]"]),z(e)){var b=e.name?": "+e.name:"";v=" [Function"+b+"]"}if(w(e)&&(v=" "+RegExp.prototype.toString.call(e)),T(e)&&(v=" "+Date.prototype.toUTCString.call(e)),S(e)&&(v=" "+c(e)),0===a.length&&(!g||0==e.length))return x[0]+v+x[1];if(r<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var E;return E=g?p(t,e,r,m,a):a.map(function(n){return h(t,e,r,m,n,g)}),t.seen.pop(),f(E,v,x)}function l(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i){for(var o=[],a=0,s=e.length;a<s;++a)k(e,String(a))?o.push(h(t,e,r,n,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(t,e,r,n,i,!0))}),o}function h(t,e,r,n,i,o){var a,s,l;if(l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},l.get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),k(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=y(r)?u(t,l.value,null):u(t,l.value,r-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return null==t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function b(t){return void 0===t}function w(t){return E(t)&&"[object RegExp]"===M(t)}function E(t){return"object"==typeof t&&null!==t}function T(t){return E(t)&&"[object Date]"===M(t)}function S(t){return E(t)&&("[object Error]"===M(t)||t instanceof Error)}function z(t){return"function"==typeof t}function A(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function M(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}function L(){var t=new Date,e=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":");return[t.getDate(),D[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var C=/%[sdj%]/g;n.format=function(t){if(!_(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(i(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,o=n.length,a=String(t).replace(C,function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r<o;s=n[++r])a+=y(s)||!E(s)?" "+s:" "+i(s);return a},n.deprecate=function(t,i){function o(){if(!a){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),a=!0}return t.apply(this,arguments)}if(b(r.process))return function(){return n.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var a=!1;return o};var I,R={};n.debuglog=function(t){if(b(I)&&(I=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!R[t])if(new RegExp("\\b"+t+"\\b","i").test(I)){var r=e.pid;R[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else R[t]=function(){};return R[t]},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=d,n.isBoolean=m,n.isNull=y,n.isNullOrUndefined=v,n.isNumber=g,n.isString=_,n.isSymbol=x,n.isUndefined=b,n.isRegExp=w,n.isObject=E,n.isDate=T,n.isError=S,n.isFunction=z,n.isPrimitive=A,n.isBuffer=t("./support/isBuffer");var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",L(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!E(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":202,_process:195,inherits:201}],204:[function(t,e,r){e.exports.VectorTile=t("./lib/vectortile.js"),e.exports.VectorTileFeature=t("./lib/vectortilefeature.js"),e.exports.VectorTileLayer=t("./lib/vectortilelayer.js")},{"./lib/vectortile.js":205,"./lib/vectortilefeature.js":206,"./lib/vectortilelayer.js":207}],205:[function(t,e,r){"use strict";function n(t,e){this.layers=t.readFields(i,{},e)}function i(t,e,r){if(3===t){var n=new o(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}var o=t("./vectortilelayer");e.exports=n},{"./vectortilelayer":207}],206:[function(t,e,r){"use strict";function n(t,e,r,n,o){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=o,t.readFields(i,this,e)}function i(t,e,r){1==t?e.id=r.readVarint():2==t?o(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function o(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}function a(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],o=0;o<e;o++){var a=s(t[o]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[t[o]]):r.push(t[o]))}return r&&i.push(r),i}function s(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r=t[a],n+=(r.x-e.x)*(e.y+r.y);return n}var u=t("point-geometry");e.exports=n,n.types=["Unknown","Point","LineString","Polygon"],n.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,o=0,a=0,s=[];t.pos<r;){if(!i){var l=t.readVarint();n=7&l,i=l>>3}if(i--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new u(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-(1/0),u=1/0,l=-(1/0);t.pos<e;){if(!n){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)i+=t.readSVarint(),o+=t.readSVarint(),i<a&&(a=i),i>s&&(s=i),o<u&&(u=o),o>l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+c)/u;t[e]=[360*(r.x+l)/u-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}var o,s,u=this.extent*Math.pow(2,r),l=this.extent*t,c=this.extent*e,p=this.loadGeometry(),h=n.types[this.type];switch(this.type){case 1:var f=[];for(o=0;o<p.length;o++)f[o]=p[o][0];p=f,i(p);break;case 2:for(o=0;o<p.length;o++)i(p[o]);break;case 3:for(p=a(p),o=0;o<p.length;o++)for(s=0;s<p[o].length;s++)i(p[o][s])}1===p.length?p=p[0]:h="Multi"+h;var d={type:"Feature",geometry:{type:h,coordinates:p},properties:this.properties};return"id"in this&&(d.id=this.id),d}},{"point-geometry":194}],207:[function(t,e,r){"use strict";function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(i,this,e),this.length=this._features.length}function i(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(o(r))}function o(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var a=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":206}],208:[function(t,e,r){function n(t){var e=[];for(var r in t.layers)e.push(o(t.layers[r]));var n=new c;return p.tile.write({layers:e},n),n.finish()}function i(t){var e={};for(var r in t)e[r]=new h(t[r].features),e[r].name=r;return n({layers:e})}function o(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},r={},n={},i=0;i<t.length;i++){var o=t.feature(i);o.geometry=u(o.loadGeometry());var a=[];for(var s in o.properties){var c=r[s];"undefined"==typeof c&&(e.keys.push(s),c=e.keys.length-1,r[s]=c);var p=l(o.properties[s]),h=n[p.key];"undefined"==typeof h&&(e.values.push(p),h=e.values.length-1,n[p.key]=h),a.push(c),a.push(h)}o.tags=a,e.features.push(o)}return e}function a(t,e){return(e<<3)+(7&t)}function s(t){return t<<1^t>>31}function u(t){for(var e=[],r=0,n=0,i=t.length,o=0;o<i;o++){var u=t[o];e.push(a(1,1));for(var l=0;l<u.length;l++){1===l&&e.push(a(2,u.length-1));var c=u[l].x-r,p=u[l].y-n;e.push(s(c),s(p)),r+=c,n+=p}}return e}function l(t){var e,r=typeof t;return"string"===r?e={string_value:t}:"boolean"===r?e={bool_value:t}:"number"===r?e=t%1!==0?{double_value:t}:t<0?{sint_value:t}:{uint_value:t}:(t=JSON.stringify(t),e={string_value:t}),e.key=r+":"+t,e}var c=t("pbf"),p=t("./vector-tile-pb"),h=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=i,e.exports.GeoJSONWrapper=h},{"./lib/geojson_wrapper":209,"./vector-tile-pb":210,pbf:193}],209:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var o=t("point-geometry"),a=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new o(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},i.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-(1/0),n=1/0,i=-(1/0),o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),r=Math.max(r,u.x),n=Math.min(n,u.y),i=Math.max(i,u.y)}return[e,n,r,i]},i.prototype.toGeoJSON=a.prototype.toGeoJSON},{"point-geometry":194,"vector-tile":204}],210:[function(t,e,r){"use strict";function n(t,e){return t.readFields(i,{layers:[]},e)}function i(t,e,r){3===t&&e.layers.push(h(r,r.readVarint()+r.pos))}function o(t,e){var r;if(void 0!==t.layers)for(r=0;r<t.layers.length;r++)e.writeMessage(3,d,t.layers[r])}function a(t,e){return t.readFields(s,{},e)}function s(t,e,r){1===t?e.string_value=r.readString():2===t?e.float_value=r.readFloat():3===t?e.double_value=r.readDouble():4===t?e.int_value=r.readVarint():5===t?e.uint_value=r.readVarint():6===t?e.sint_value=r.readSVarint():7===t&&(e.bool_value=r.readBoolean())}function u(t,e){void 0!==t.string_value&&e.writeStringField(1,t.string_value),void 0!==t.float_value&&e.writeFloatField(2,t.float_value),void 0!==t.double_value&&e.writeDoubleField(3,t.double_value),void 0!==t.int_value&&e.writeVarintField(4,t.int_value),void 0!==t.uint_value&&e.writeVarintField(5,t.uint_value),void 0!==t.sint_value&&e.writeSVarintField(6,t.sint_value),void 0!==t.bool_value&&e.writeBooleanField(7,t.bool_value)}function l(t,e){var r=t.readFields(c,{},e);return void 0===r.type&&(r.type="Unknown"),r}function c(t,e,r){1===t?e.id=r.readVarint():2===t?e.tags=r.readPackedVarint():3===t?e.type=r.readVarint():4===t&&(e.geometry=r.readPackedVarint())}function p(t,e){void 0!==t.id&&e.writeVarintField(1,t.id),void 0!==t.tags&&e.writePackedVarint(2,t.tags),void 0!==t.type&&e.writeVarintField(3,t.type),void 0!==t.geometry&&e.writePackedVarint(4,t.geometry)}function h(t,e){return t.readFields(f,{features:[],keys:[],values:[]},e)}function f(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():2===t?e.features.push(l(r,r.readVarint()+r.pos)):3===t?e.keys.push(r.readString()):4===t?e.values.push(a(r,r.readVarint()+r.pos)):5===t&&(e.extent=r.readVarint())}function d(t,e){void 0!==t.version&&e.writeVarintField(15,t.version),void 0!==t.name&&e.writeStringField(1,t.name);var r;if(void 0!==t.features)for(r=0;r<t.features.length;r++)e.writeMessage(2,p,t.features[r]);if(void 0!==t.keys)for(r=0;r<t.keys.length;r++)e.writeStringField(3,t.keys[r]);if(void 0!==t.values)for(r=0;r<t.values.length;r++)e.writeMessage(4,u,t.values[r]);void 0!==t.extent&&e.writeVarintField(5,t.extent)}var m=r.tile={read:n,write:o};m.GeomType={Unknown:0,Point:1,LineString:2,Polygon:3},m.value={read:a,write:u},m.feature={read:l,write:p},m.layer={read:h,write:d}},{}],211:[function(t,e,r){var n=arguments[3],i=arguments[4],o=arguments[5],a=JSON.stringify;e.exports=function(t,e){function r(t){y[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];y[n]||r(n)}}for(var s,u=Object.keys(o),l=0,c=u.length;l<c;l++){var p=u[l],h=o[p].exports;if(h===t||h&&h.default===t){s=p;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var f={},l=0,c=u.length;l<c;l++){var p=u[l];f[p]=p}i[s]=[Function(["require","module","exports"],"("+t+")(self)"),f]}var d=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[s]=s,i[d]=[Function(["require"],"var f = require("+a(s)+");(f.default ? f.default : f)(self);"),m];var y={};r(d);var v="("+n+")({"+Object.keys(y).map(function(t){return a(t)+":["+i[t][0]+","+a(i[t][1])+"]"}).join(",")+"},{},["+a(d)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL,_=new Blob([v],{type:"text/javascript"});if(e&&e.bare)return _;var x=g.createObjectURL(_),b=new Worker(x);return b.objectURL=x,b}},{}],212:[function(t,e,r){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],213:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.WhooTS=e.WhooTS||{})}(this,function(t){function e(t,e,n,i,o,a){a=a||{};var s=t+"?"+["bbox="+r(n,i,o),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+e].join("&");return s}function r(t,e,r){e=Math.pow(2,r)-e-1;var i=n(256*t,256*e,r),o=n(256*(t+1),256*(e+1),r);return i[0]+","+i[1]+","+o[0]+","+o[1]}function n(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,o=e*n-2*Math.PI*6378137/2;return[i,o]}t.getURL=e,t.getTileBBox=r,t.getMercCoords=n,Object.defineProperty(t,"__esModule",{value:!0})})},{}],214:[function(t,e,r){e.exports={version:"0.29.0"}},{}]},{},[24])(24)})}).call(e,r(6).Buffer,r(0))},function(t,e,r){"use strict";function n(t){"geolocation"in navigator&&t.addEventListener&&(t.disabled=!1,t.addEventListener("click",i.a))}var i=r(13);e.a=n},function(t,e,r){"use strict";function n(){var t=document.querySelector('form[name="micropub"]');t.addEventListener("change",l),t.addEventListener("submit",c),u()}var i=r(16),o=r.n(i),a=r(3),s=r.n(a);e.a=n;var u=function(){var t=document.querySelector("#in-reply-to");t.value=o.a.getItem("replyTo");var e=document.querySelector("#content");e.value=o.a.getItem("content")},l=function(){var t=document.querySelector("#in-reply-to"),e=document.querySelector("#content");o.a.setItem("replyTo",t.value),o.a.setItem("content",e.value),s.a.success("Auto-saved data")},c=function(){o.a.removeItem("replyTo"),o.a.removeItem("content")}},function(t,e,r){"use strict";function n(t){fetch("/places/near/"+t.coords.latitude+"/"+t.coords.longitude+"?u="+t.coords.accuracy,{credentials:"same-origin",method:"get"}).then(function(t){return t.ok?t.json():(o.a.reset(),void o.a.error("Non OK response"))}).then(function(e){1==e.error&&(o.a.reset(),o.a.error(e.error_description));var n=null;e.places.length>0&&(n=e.places);var map=r.i(a.a)(t,n),i=document.createElement("div"),s=l(map,t,n);i.appendChild(s);var c=r.i(u.a)(map);i.appendChild(c);var p=document.querySelector("fieldset");p.insertBefore(i,document.querySelector(".map"))}).catch(function(t){console.error(t)})}var i=r(3),o=r.n(i),a=r(2),s=r(1),u=r(14);e.a=n;var l=function(map,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=document.createElement("select");n.setAttribute("name","location");var i=document.createElement("option");i.setAttribute("selected","selected"),i.setAttribute("value","no-location"),i.appendChild(document.createTextNode("Dont send location")),n.appendChild(i);var o=document.createElement("option");if(o.setAttribute("id","option-coords"),o.setAttribute("value","geo:"+t.coords.latitude+","+t.coords.longitude),o.dataset.latitude=t.coords.latitude,o.dataset.longitude=t.coords.longitude,o.appendChild(document.createTextNode("Send co-ordinates")),n.appendChild(o),null!=e){var a=!0,u=!1,l=void 0;try{for(var c,p=e[Symbol.iterator]();!(a=(c=p.next()).done);a=!0){
var h=c.value,f=r.i(s.a)(h.location),d=document.createElement("option");d.setAttribute("value",h.slug),d.dataset.latitude=f.latitude,d.dataset.longitude=f.longitude,d.appendChild(document.createTextNode(h.name)),n.appendChild(d)}}catch(t){u=!0,l=t}finally{try{!a&&p.return&&p.return()}finally{if(u)throw l}}}return n.addEventListener("change",function(){if("no-location"!==n.value){var t=n[n.selectedIndex].dataset.latitude,e=n[n.selectedIndex].dataset.longitude;map.flyTo({center:[e,t]})}}),n}},function(t,e,r){"use strict";function n(){var t=document.querySelector("fieldset"),e=document.createElement("div");e.classList.add("map"),t.appendChild(e),navigator.geolocation.getCurrentPosition(function(t){e.dataset.latitude=t.coords.latitude,e.dataset.longitude=t.coords.longitude,e.dataset.accuracy=t.coords.accuracy,r.i(i.a)(t)})}var i=r(12);e.a=n},function(t,e,r){"use strict";function n(map){var t=document.createElement("button");return t.setAttribute("type","button"),t.setAttribute("id","create-new-place"),t.appendChild(document.createTextNode("Create New Place?")),t.addEventListener("click",function(){var t=document.createElement("div"),e=document.createElement("label");e.setAttribute("for","place-name"),e.classList.add("place-label"),e.appendChild(document.createTextNode("Name:"));var n=document.createElement("input");n.setAttribute("placeholder","Name"),n.setAttribute("name","place-name"),n.setAttribute("id","place-name"),n.setAttribute("type","text"),t.appendChild(e),t.appendChild(n);var o=document.createElement("div"),a=document.createElement("label");a.setAttribute("for","place-description"),a.classList.add("place-label"),a.appendChild(document.createTextNode("Description:"));var s=document.createElement("input");s.setAttribute("placeholder","Description"),s.setAttribute("name","place-description"),s.setAttribute("id","place-description"),s.setAttribute("type","text"),o.appendChild(a),o.appendChild(s);var u=document.createElement("div"),l=document.createElement("label");l.setAttribute("for","place-latitude"),l.classList.add("place-label"),l.appendChild(document.createTextNode("Latitude:"));var c=document.createElement("input");c.setAttribute("name","place-latitude"),c.setAttribute("id","place-latitude"),c.setAttribute("type","text"),c.value=map.getCenter().lat,u.appendChild(l),u.appendChild(c);var p=document.createElement("div"),h=document.createElement("label");h.setAttribute("for","place-longitude"),h.classList.add("place-label"),h.appendChild(document.createTextNode("Longitude:"));var f=document.createElement("input");f.setAttribute("name","place-longitude"),f.setAttribute("id","place-longitude"),f.setAttribute("type","text"),f.value=map.getCenter().lng,p.appendChild(h),p.appendChild(f);var d=document.createElement("button");d.setAttribute("id","place-submit"),d.setAttribute("name","place-submit"),d.setAttribute("type","button"),d.appendChild(document.createTextNode("Submit New Place")),d.addEventListener("click",function(){r.i(i.a)(map)});var m=document.querySelector("fieldset");m.appendChild(t),m.appendChild(o),m.appendChild(u),m.appendChild(p),m.appendChild(d)}),t}var i=r(15);e.a=n},function(t,e,r){"use strict";function n(map){var t=new FormData;t.append("place-name",document.querySelector("#place-name").value),t.append("place-description",document.querySelector("#place-description").value),t.append("place-latitude",document.querySelector("#place-latitude").value),t.append("place-longitude",document.querySelector("#place-longitude").value),fetch("/places/new",{credentials:"same-origin",method:"post",body:t}).then(function(t){return t.json()}).then(function(t){if(t.error===!0)throw new Error(t.error_description);var e=document.querySelector("fieldset"),r=document.querySelectorAll(".place-label"),n=!0,i=!1,o=void 0;try{for(var a,s=r[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;e.removeChild(u.parentNode)}}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}e.removeChild(document.querySelector("#place-submit"));var l=document.querySelector("#create-new-place");l.parentNode.removeChild(l);var c=map.getSource("points"),p=c._data.features.filter(function(t){return"Current Location"!=t.properties.title});p.push({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{title:t.name,icon:"circle",uri:t.uri}});var h={type:"FeatureCollection",features:p};map.getSource("points").setData(h);var f=document.querySelector("select"),d=document.createElement("option");d.setAttribute("value",t.uri),d.appendChild(document.createTextNode(t.name)),d.dataset.latitude=t.latitude,d.dataset.longitude=t.longitude,f.appendChild(d),document.querySelector('select [value="'+t.uri+'"]').selected=!0}).catch(function(t){o.a.reset(),o.a.error(t)})}var i=r(3),o=r.n(i);e.a=n},function(t,e,r){/*!
* webStorage - A minimal Javascript wrapper to work with localStorage and sessionStorage
*
* @version v1.2.1
* @author George Raptis <georapbox@gmail.com> (georapbox.github.io)
* @homepage https://github.com/georapbox/webStorage#readme
* @repository git+https://github.com/georapbox/webStorage.git
*/
!function(e,r){t.exports=r()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(1),s=n(a),u=r(2),l=n(u),c=r(3),p=n(c),h=r(4),f=n(h),d=r(5),m=n(d),y=r(6),v=n(y),g=r(7),_=n(g),x={driver:localStorage,name:"webStorage"},b={set:"setItem",set_err:"setItemError",get:"getItem",get_err:"getItemError",remove:"removeItem",clear:"clear"},w=function(){function t(e){if(i(this,t),e=(0,f.default)({},x,e),null==e.name||""===(0,p.default)(e.name))throw"You must use a valid name for the database.";this.options=e,this.storeKeyPrefix=(0,v.default)(this),s.default.apply(Object.getPrototypeOf(this))}return o(t,[{key:"createInstance",value:function(e){return new t(e)}},{key:"config",value:function(t){if(t=(0,f.default)({},x,t),null==t.name||""===(0,p.default)(t.name))throw"You must use a valid name for the database.";this.options=t,this.storeKeyPrefix=(0,v.default)(this)}},{key:"getItem",value:function(t){var e=this.options.driver.getItem(this.storeKeyPrefix+t);try{var r=JSON.parse(e);return this.dispatchEvent({type:b.get,data:r}),r}catch(t){throw this.dispatchEvent({type:b.get_err,data:t}),t}}},{key:"setItem",value:function(t,e){try{return e=null==e?null:e,t=this.storeKeyPrefix+t,this.options.driver.setItem(t,JSON.stringify(e)),this.dispatchEvent({type:b.set,data:e}),e}catch(t){throw this.dispatchEvent({type:b.set_err,data:t}),t}}},{key:"removeItem",value:function(t){this.dispatchEvent({type:b.remove,data:t}),this.options.driver.removeItem(this.storeKeyPrefix+t)}},{key:"clear",value:function(t){var e=this.options.driver;t===!0?e.clear():(0,_.default)(this,function(t){e.removeItem(t)}),this.dispatchEvent({type:b.clear})}},{key:"keys",value:function(){var t=[],e=this.storeKeyPrefix;return(0,_.default)(this,function(r){t.push((0,l.default)(r,e))}),t}},{key:"length",value:function(){var t=0;return(0,_.default)(this,function(){t+=1}),t}},{key:"iterate",value:function(t){var e=this.storeKeyPrefix;(0,_.default)(this,function(r,n,i){var o=(0,l.default)(r,e),a=JSON.parse(n);if(t&&t(o,a,i)===!1)return!1})}},{key:"quota",value:function(){var t={},e=0;return(0,_.default)(this,function(r,n){var i=2*n.length/1024/1024;e+=i,t[r]=i}),{total:e,items:t}}},{key:"supported",value:function(){return(0,m.default)(this.options.driver)}}]),t}();e.default=new w,t.exports=e.default},function(t,e,r){var n,i;!function(o,a,s){"use strict";n=s,i="function"==typeof n?n.call(e,r,e,t):n,!(void 0!==i&&(t.exports=i))}("eventDispatcher",this,function(t){"use strict";var e={nonExtensible:'Cannot apply "'+t+'" on an non extensible object'},r={addEventListener:function(t,r){var n;if(!Object.isExtensible(this))throw new TypeError(e.nonExtensible);return"undefined"==typeof this._listeners&&(this._listeners={}),n=this._listeners,"undefined"==typeof n[t]&&(n[t]=[]),n[t].indexOf(r)===-1&&n[t].push(r),this},hasEventListener:function(t,e){var r;return"undefined"!=typeof this._listeners&&(r=this._listeners,"undefined"!=typeof r[t]&&r[t].indexOf(e)!==-1)},removeEventListener:function(t,e){var r,n,i;if("undefined"!=typeof this._listeners)return r=this._listeners,n=r[t],"undefined"!=typeof n&&(i=n.indexOf(e),i!==-1&&n.splice(i,1)),this},dispatchEvent:function(t){var e,r,n,i;if("undefined"!=typeof this._listeners){if(e=this._listeners,r=e[t.type],"undefined"!=typeof r)for(t.target=this,i=r.length,n=0;n<i;n+=1)r[n].call(this,t);return this}}},n=Object.create(r,{apply:{value:function(t){if(!Object.isExtensible(t))throw new TypeError(e.nonExtensible);return t.addEventListener=r.addEventListener,t.hasEventListener=r.hasEventListener,t.removeEventListener=r.removeEventListener,t.dispatchEvent=r.dispatchEvent,this}}});return n})},function(t,e){"use strict";function r(t,e){return 0===t.indexOf(e)?t.slice(e.length):t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default},function(t,e){"use strict";function r(t){return String.prototype.trim?t.trim():t.replace(/(^\s*|\s*$)/g,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default},function(t,e){"use strict";function r(){for(var t=1,e=arguments.length;t<e;t++)for(var n in arguments[t])({}).hasOwnProperty.call(arguments[t],n)&&(arguments[t][n]&&arguments[t][n].constructor&&arguments[t][n].constructor===Object?(arguments[0][n]=arguments[0][n]||{},r(arguments[0][n],arguments[t][n])):arguments[0][n]=arguments[t][n]);return arguments[0]}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default},function(t,e){"use strict";function r(t){var e="storage.dummy";try{return t.setItem(e,e),t.removeItem(e),!0}catch(t){return!1}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default},function(t,e){"use strict";function r(t){return t.options.name+"/"}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var r=t.options.driver,n=0;Object.keys(r).forEach(function(i){if((0,a.default)(t,i)&&e(i,r[i],++n)===!1)return!1})}Object.defineProperty(e,"__esModule",{value:!0});var o=r(8),a=n(o);e.default=i,t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){return(0,a.default)(e,t.storeKeyPrefix)}Object.defineProperty(e,"__esModule",{value:!0});var o=r(9),a=n(o);e.default=i,t.exports=e.default},function(t,e){"use strict";function r(t,e){return t.substr(0,e.length)===e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default}])})},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,configurable:!1,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,configurable:!1,get:function(){return t.i}}),t.webpackPolyfill=1),t}},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10),i=r(11),o=document.querySelector("#locate");r.i(n.a)(o),r.i(i.a)()}]);