Skip to content

Instantly share code, notes, and snippets.

@danswick
Last active September 7, 2016 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danswick/c142d7afa2c9c511bfbea71b4273e61c to your computer and use it in GitHub Desktop.
Save danswick/c142d7afa2c9c511bfbea71b4273e61c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.21.0/mapbox-gl.js'></script>
<script src='mapbox-gl-draw.js'></script>
<script src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v1.3.0/mapbox-gl-geocoder.js"></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.21.0/mapbox-gl.css' rel='stylesheet' />
<link href='mapbox-gl-draw.css' rel='stylesheet' />
<link rel='stylesheet' href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v1.3.0/mapbox-gl-geocoder.css' type='text/css' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoiZGFuc3dpY2siLCJhIjoieUZiWmwtVSJ9.0cPQywdbPVmvHiHJ6NwdXA';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/mapbox/streets-v8', //stylesheet location
center: [-74.50, 40], // starting position
zoom: 9 // starting zoom
});
var Draw = mapboxgl.Draw();
map.addControl(Draw)
map.addControl(new mapboxgl.Geocoder());
</script>
</body>
</html>
/* Override default control style */
.mapbox-gl-draw_ctrl-bottom-left,
.mapbox-gl-draw_ctrl-top-left {
margin-left:0;
border-radius:0 4px 4px 0;
}
.mapbox-gl-draw_ctrl-top-right,
.mapbox-gl-draw_ctrl-bottom-right {
margin-right:0;
border-radius:4px 0 0 4px;
}
.mapbox-gl-draw_ctrl-draw {
background-color:rgba(0,0,0,0.75);
border-color:rgba(0,0,0,0.9);
}
.mapbox-gl-draw_ctrl-draw > button {
border-color:rgba(0,0,0,0.9);
color:rgba(255,255,255,0.5);
width:30px;
height:30px;
}
.mapbox-gl-draw_ctrl-draw > button:hover {
background-color:rgba(0,0,0,0.85);
color:rgba(255,255,255,0.75);
}
.mapbox-gl-draw_ctrl-draw > button.active,
.mapbox-gl-draw_ctrl-draw > button.active:hover {
background-color:rgba(0,0,0,0.95);
color:#fff;
}
.mapbox-gl-draw_ctrl-draw-btn {
background-repeat: no-repeat;
background-position: center;
}
.mapbox-gl-draw_point {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIgICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgICB4bWxuczpzb2RpcG9kaT0iaHR0cDovL3NvZGlwb2RpLnNvdXJjZWZvcmdlLm5ldC9EVEQvc29kaXBvZGktMC5kdGQiICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiICAgd2lkdGg9IjIwIiAgIGhlaWdodD0iMjAiICAgdmlld0JveD0iMCAwIDIwIDIwIiAgIGlkPSJzdmcxOTE2NyIgICB2ZXJzaW9uPSIxLjEiICAgaW5rc2NhcGU6dmVyc2lvbj0iMC45MStkZX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VybztzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MC45OTk5OTk4MjttYXJrZXI6bm9uZTtlbmFibGUtYmFja2dyb3VuZDphY2N1bXVsYXRlIiAgICAgICBkPSJtIDEwLDEwMzUuNzc0MyBjIC0wLjc4NDkyNTMsOGUtNCAtMS40OTY4Mzc2LDAuNDYwNiAtMS44MjAzMTI1LDEuMTc1OCBsIC0zLjE3OTY4NzUsMCAtMSwxIDAsMSAxMiwwIDAsLTEgLTEsLTEgLTMuMTc5Njg4LDAgYyAtMC4zMjM0NzUsLTAuNzE1MiAtMS4wMzUzODcsLTEuMTc1IC0xLjgyMDMxMiwtMS4xNzU4IHogbSAtNSw0LjU4NzkgMCw3IGMgMCwxIDEsMiAyLDIgbCA2LDAgYyAxLDAgMiwtMSAyLC0yIGwgMCwtNyAtMiwwIDAsNS41IC0xLjUsMCAwLC01LjUgLTMsMCAwLDUuNSAtMS41LDAgMCwtNS41IHoiICAgICAgIGlkPSJyZWN0MjQzOS03IiAgICAgICBpbmtzY2FwZTpjb25uZWN0b3ItY3VydmF0dXJlPSIwIiAgICAgICBzb2RpcG9kaTpub2RldHlwZXM9ImNjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2MiIC8+ICA8L2c+PC9zdmc+);
}
.mapboxgl-map.mouse-pointer .mapboxgl-canvas-container.mapboxgl-interactive {
cursor: pointer;
}
.mapboxgl-map.mouse-move .mapboxgl-canvas-container.mapboxgl-interactive {
cursor: move;
}
.mapboxgl-map.mouse-add .mapboxgl-canvas-container.mapboxgl-interactive {
cursor: crosshair;
}
.mapboxgl-map.mouse-move.mode-direct_select .mapboxgl-canvas-container.mapboxgl-interactive {
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
}
.mapboxgl-map.mode-direct_select.feature-vertex.mouse-move .mapboxgl-canvas-container.mapboxgl-interactive {
cursor: move;
}
.mapboxgl-map.mode-direct_select.feature-midpoint.mouse-pointer .mapboxgl-canvas-container.mapboxgl-interactive {
cursor: cell;
}
.mapboxgl-map.mode-static.mouse-pointer .mapboxgl-canvas-container.mapboxgl-interactive {
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
}
.mapbox-gl-draw_boxselect {
pointer-events: none;
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
background: rgba(0,0,0,.1);
border: 2px dotted #fff;
opacity: 0.5;
}
!function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){"use strict";var r=e("./src/setup"),o=e("./src/options"),i=e("./src/api"),s=e("./src/constants"),a=function(e){e=o(e);var t={options:e},n=i(t);t.api=n;var a=r(t);return n.addTo=a.addTo,n.remove=a.remove,n.types=s.types,n.options=e,n};t.exports=a,window.mapboxgl=window.mapboxgl||{},window.mapboxgl.Draw=a},{"./src/api":23,"./src/constants":24,"./src/options":58,"./src/setup":60}],2:[function(e,t,n){},{}],3:[function(e,t,n){function r(){return this instanceof r?(this._bbox=[1/0,1/0,-(1/0),-(1/0)],void(this._valid=!1)):new r}t.exports=r,r.prototype.include=function(e){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[0]),this._bbox[3]=Math.max(this._bbox[3],e[1]),this},r.prototype.union=function(e){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[2]),this._bbox[3]=Math.max(this._bbox[3],e[3]),this},r.prototype.bbox=function(){return this._valid?this._bbox:null},r.prototype.contains=function(e){return this._valid?this._bbox[0]<=e[0]&&this._bbox[1]<=e[1]&&this._bbox[2]>=e[0]&&this._bbox[3]>=e[1]:null},r.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null}},{}],4:[function(e,t,n){function r(e){var t,n=0;switch(e.type){case"Polygon":return o(e.coordinates);case"MultiPolygon":for(t=0;t<e.coordinates.length;t++)n+=o(e.coordinates[t]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(t=0;t<e.geometries.length;t++)n+=r(e.geometries[t]);return n}}function o(e){var t=0;if(e&&e.length>0){t+=Math.abs(s(e[0]));for(var n=1;n<e.length;n++)t-=Math.abs(s(e[n]))}return t}function s(e){var t,n,r,o,s,c,l=0,p=e.length;if(p>2){for(i=0;i<p;i++)i===p-2?(o=p-2,s=p-1,c=0):i===p-1?(o=p-1,s=0,c=1):(o=i,s=i+1,c=i+2),t=e[o],n=e[s],r=e[c],l+=(a(r[0])-a(t[0]))*Math.sin(a(n[1]));l=l*u.RADIUS*u.RADIUS/2}return l}function a(e){return e*Math.PI/180}var u=e("wgs84");t.exports.geometry=r,t.exports.ring=s},{wgs84:21}],5:[function(e,t,n){t.exports=function(e,t){function n(e){return Array.isArray(e)&&e.length&&"number"==typeof e[0]?[e]:e.reduce(function(e,t){return Array.isArray(t)&&Array.isArray(t[0])?e.concat(n(t)):(e.push(t),e)},[])}return n(e)}},{}],6:[function(e,t,n){var r=e("geojson-normalize"),o=e("geojson-flatten"),i=e("./flatten");t.exports=function(e){if(!e)return[];var t=o(r(e)),n=[];return t.features.forEach(function(e){e.geometry&&(n=n.concat(i(e.geometry.coordinates)))}),n}},{"./flatten":5,"geojson-flatten":9,"geojson-normalize":7}],7:[function(e,t,n){function r(e){if(!e||!e.type)return null;var t=o[e.type];return t?"geometry"===t?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:e}]}:"feature"===t?{type:"FeatureCollection",features:[e]}:"featurecollection"===t?e:void 0:null}t.exports=r;var o={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},{}],8:[function(e,t,n){function r(e){for(var t=s(),n=o(e),r=0;r<n.length;r++)t.include(n[r]);return t}var o=e("geojson-coords"),i=e("traverse"),s=e("extent");t.exports=function(e){return r(e).bbox()},t.exports.polygon=function(e){return r(e).polygon()},t.exports.bboxify=function(e){return i(e).map(function(e){e&&"string"==typeof e.type&&(e.bbox=r(e).bbox(),this.update(e))})}},{extent:3,"geojson-coords":6,traverse:20}],9:[function(e,t,n){function r(e,t){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.reduce(function(e,t){return e.concat(r(t))},[]),e;case"Feature":return r(e.geometry).map(function(t){return{type:"Feature",properties:JSON.parse(JSON.stringify(e.properties)),geometry:t}});case"MultiPoint":return e.coordinates.map(function(e){return{type:"Point",coordinates:e}});case"MultiPolygon":return e.coordinates.map(function(e){return{type:"Polygon",coordinates:e}});case"MultiLineString":return e.coordinates.map(function(e){return{type:"LineString",coordinates:e}});case"GeometryCollection":return e.geometries;case"Point":case"Polygon":case"LineString":return[e];default:return e}}t.exports=r},{}],10:[function(e,t,n){arguments[4][7][0].apply(n,arguments)},{dup:7}],11:[function(e,t,n){function r(e,t){var n,r=[];if("object"==typeof e)n=e;else{if("string"!=typeof e)return[{message:"Expected string or object as input",line:0}];try{n=o.parse(e)}catch(e){var s=e.message.match(/line (\d+)/),a=parseInt(s[1],10);return[{line:a-1,message:e.message,error:e}]}}return r=r.concat(i.hint(n,t))}var o=e("jsonlint-lines"),i=e("./object");t.exports.hint=r},{"./object":12,"jsonlint-lines":15}],12:[function(e,t,n){function r(e,t){function n(e){if(t&&t.noDuplicateMembers===!1||!e.__duplicateProperties__||b.push({message:"An object contained duplicate members, making parsing ambigous: "+e.__duplicateProperties__.join(", "),line:e.__line__}),!i(e,"type","string"))if(T[e.type])e&&T[e.type](e);else{var n=O[e.type.toLowerCase()];void 0!==n?b.push({message:"Expected "+n+" but got "+e.type+" (case sensitive)",line:e.__line__}):b.push({message:"The type "+e.type+" is unknown",line:e.__line__})}}function r(e,t){return e.every(function(e){return null!==e&&typeof e===t})}function i(e,t,n){if("undefined"==typeof e[t])return b.push({message:'"'+t+'" member required',line:e.__line__});if("array"===n){if(!Array.isArray(e[t]))return b.push({message:'"'+t+'" member should be an array, but is an '+typeof e[t]+" instead",line:e.__line__})}else{if("object"===n&&e[t]&&"Object"!==e[t].constructor.name)return b.push({message:'"'+t+'" member should be '+n+", but is an "+e[t].constructor.name+" instead",line:e.__line__});if(n&&typeof e[t]!==n)return b.push({message:'"'+t+'" member should be '+n+", but is an "+typeof e[t]+" instead",line:e.__line__})}}function s(e){if(c(e),l(e),void 0!==e.properties&&b.push({message:'FeatureCollection object cannot contain a "properties" member',line:e.__line__}),void 0!==e.coordinates&&b.push({message:'FeatureCollection object cannot contain a "coordinates" member',line:e.__line__}),!i(e,"features","array")){if(!r(e.features,"object"))return b.push({message:"Every feature must be an object",line:e.__line__});e.features.forEach(v)}}function a(e,t){if(!Array.isArray(e))return b.push({message:"position should be an array, is a "+typeof e+" instead",line:e.__line__||t});if(e.length<2)return b.push({message:"position must have 2 or more elements",line:e.__line__||t});if(e.length>3)return b.push({message:"position should not have more than 3 elements",line:e.__line__||t});if(!r(e,"number"))return b.push({message:"each element in a position must be a number",line:e.__line__||t});var n=10,o=6;return E===n?(E+=1,b.push({message:"truncated warnings: we've encountered coordinate precision warning "+n+" times, no more warnings will be reported",level:"warn",line:e.__line__||t})):void(E<n&&e.forEach(function(n){var r=0,i=String(n).split(".")[1];if(void 0!==i&&(r=i.length),r>o)return E+=1,b.push({message:"precision of coordinates should be reduced",level:"warn",line:e.__line__||t})}))}function u(e,t,n,r){if(void 0===r&&void 0!==e.__line__&&(r=e.__line__),0===n)return a(e,r);if(1===n&&t)if("LinearRing"===t){if(!Array.isArray(e[e.length-1]))return b.push({message:"a number was found where a coordinate array should have been found: this needs to be nested more deeply",line:r}),!0;e.length<4&&b.push({message:"a LinearRing of coordinates needs to have four or more positions",line:r}),!e.length||e[e.length-1].length===e[0].length&&e[e.length-1].every(function(t,n){return e[0][n]===t})||b.push({message:"the first and last positions in a LinearRing of coordinates must be the same",line:r})}else if("Line"===t&&e.length<2)return b.push({message:"a line needs to have two or more coordinates to be valid",line:r});Array.isArray(e)?e.forEach(function(e){u(e,t,n-1,e.__line__||r)}):b.push({message:"a number was found where a coordinate array should have been found: this needs to be nested more deeply",line:r})}function c(e){if(e.crs){var t="urn:ogc:def:crs:OGC:1.3:CRS84";"object"==typeof e.crs&&e.crs.properties&&e.crs.properties.name===t?b.push({message:"old-style crs member is not recommended, this object is equivalent to the default and should be removed",level:"warn",line:e.__line__}):b.push({message:"old-style crs member is not recommended",level:"warn",line:e.__line__})}}function l(e){if(e.bbox)return Array.isArray(e.bbox)?(r(e.bbox,"number")||b.push({message:"each element in a bbox member must be a number",line:e.bbox.__line__}),4!==e.bbox.length&&6!==e.bbox.length&&b.push({message:"bbox must contain 4 elements (for 2D) or 6 elements (for 3D)",line:e.bbox.__line__}),b.length):void b.push({message:"bbox member must be an array of numbers, but is a "+typeof e.bbox,line:e.__line__})}function p(e){void 0!==e.properties&&b.push({message:'geometry object cannot contain a "properties" member',line:e.__line__}),void 0!==e.geometry&&b.push({message:'geometry object cannot contain a "geometry" member',line:e.__line__}),void 0!==e.features&&b.push({message:'geometry object cannot contain a "features" member',line:e.__line__})}function f(e){c(e),l(e),p(e),i(e,"coordinates","array")||a(e.coordinates)}function d(e){c(e),l(e),i(e,"coordinates","array")||u(e.coordinates,"LinearRing",2)||o(e,b)}function h(e){c(e),l(e),i(e,"coordinates","array")||u(e.coordinates,"LinearRing",3)||o(e,b)}function y(e){c(e),l(e),i(e,"coordinates","array")||u(e.coordinates,"Line",1)}function g(e){c(e),l(e),i(e,"coordinates","array")||u(e.coordinates,"Line",2)}function m(e){c(e),l(e),i(e,"coordinates","array")||u(e.coordinates,"",1)}function _(e){c(e),l(e),i(e,"geometries","array")||(r(e.geometries,"object")||b.push({message:"The geometries array in a GeometryCollection must contain only geometry objects",line:e.__line__}),1===e.geometries.length&&b.push({message:"GeometryCollection with a single geometry should be avoided in favor of single part or a single object of multi-part type",level:"warn",line:e.geometries.__line__}),e.geometries.forEach(function(t){t&&("GeometryCollection"===t.type&&b.push({message:"GeometryCollection should avoid nested geometry collections",level:"warn",line:e.geometries.__line__}),n(t))}))}function v(e){c(e),l(e),void 0!==e.id&&"string"!=typeof e.id&&"number"!=typeof e.id&&b.push({message:'Feature "id" member must have a string or number value',line:e.__line__}),void 0!==e.features&&b.push({message:'Feature object cannot contain a "features" member',line:e.__line__}),void 0!==e.coordinates&&b.push({message:'Feature object cannot contain a "coordinates" member',line:e.__line__}),"Feature"!==e.type&&b.push({message:"GeoJSON features must have a type=feature member",line:e.__line__}),i(e,"properties","object"),i(e,"geometry","object")||e.geometry&&n(e.geometry)}var b=[],E=0,T={Point:f,Feature:v,MultiPoint:m,LineString:y,MultiLineString:g,FeatureCollection:s,GeometryCollection:_,Polygon:d,MultiPolygon:h},O=Object.keys(T).reduce(function(e,t){return e[t.toLowerCase()]=t,e},{});return"object"!=typeof e||null===e||void 0===e?(b.push({message:"The root of a GeoJSON object must be an object.",line:0}),b):(n(e),b.forEach(function(e){({}).hasOwnProperty.call(e,"line")&&void 0===e.line&&delete e.line}),b)}var o=e("./rhr");t.exports.hint=r},{"./rhr":13}],13:[function(e,t,n){function r(e){return e*Math.PI/180}function o(e){var t=0;if(e.length>2)for(var n,o,i=0;i<e.length-1;i++)n=e[i],o=e[i+1],t+=r(o[0]-n[0])*(2+Math.sin(r(n[1]))+Math.sin(r(o[1])));return t>=0}function i(e){if(e&&e.length>0){if(!o(e[0]))return!1;var t=e.slice(1,e.length);if(t.some(o))return!1}return!0}function s(e){return"Polygon"===e.type?i(e.coordinates):"MultiPolygon"===e.type?e.coordinates.every(i):void 0}t.exports=function(e,t){s(e)||t.push({message:"Polygons and MultiPolygons should follow the right-hand rule",level:"warn",line:e.__line__})}},{}],14:[function(e,t,n){var r=t.exports=function(e,t){if(t||(t=16),void 0===e&&(e=128),e<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),o=2;n===1/0;o*=2)n=Math.log(Math.pow(2,e/o))/Math.log(t)*o;for(var i=n-Math.floor(n),s="",o=0;o<Math.floor(n);o++){var a=Math.floor(Math.random()*t).toString(t);s=a+s}if(i){var u=Math.pow(t,i),a=Math.floor(Math.random()*u).toString(t);s=a+s}var c=parseInt(s,t);return c!==1/0&&c>=Math.pow(2,e)?r(e,t):s};r.rack=function(e,t,n){var o=function(o){var s=0;do{if(s++>10){if(!n)throw new Error("too many ID collisions, use more bits");e+=n}var a=r(e,t)}while(Object.hasOwnProperty.call(i,a));return i[a]=o,a},i=o.hats={};return o.get=function(e){return o.hats[e]},o.set=function(e,t){return o.hats[e]=t,o},o.bits=e||128,o.base=t||16,o}},{}],15:[function(e,t,n){(function(r){var o=function(){function e(){this.yy={}}var t=function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},n=[1,12],r=[1,13],o=[1,9],i=[1,10],s=[1,11],a=[1,14],u=[1,15],c=[14,18,22,24],l=[18,22],p=[22,24],f={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(e,t,n,r,o,i,s){var a=i.length-1;switch(o){case 1:this.$=e.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(e);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=i[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=i[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[i[a-2],i[a]];break;case 16:this.$={},this.$[i[a][0]]=i[a][1];break;case 17:this.$=i[a-2],void 0!==i[a-2][i[a][0]]&&(this.$.__duplicateProperties__||Object.defineProperty(this.$,"__duplicateProperties__",{value:[],enumerable:!1}),this.$.__duplicateProperties__.push(i[a][0])),i[a-2][i[a][0]]=i[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[i[a]];break;case 21:this.$=i[a-2],i[a-2].push(i[a])}},table:[{3:5,4:n,5:6,6:r,7:3,8:o,9:4,10:i,11:s,12:1,13:2,15:7,16:8,17:a,23:u},{1:[3]},{14:[1,16]},t(c,[2,7]),t(c,[2,8]),t(c,[2,9]),t(c,[2,10]),t(c,[2,11]),t(c,[2,12]),t(c,[2,3]),t(c,[2,4]),t(c,[2,5]),t([14,18,21,22,24],[2,1]),t(c,[2,2]),{3:20,4:n,18:[1,17],19:18,20:19},{3:5,4:n,5:6,6:r,7:3,8:o,9:4,10:i,11:s,13:23,15:7,16:8,17:a,23:u,24:[1,21],25:22},{1:[2,6]},t(c,[2,13]),{18:[1,24],22:[1,25]},t(l,[2,16]),{21:[1,26]},t(c,[2,18]),{22:[1,28],24:[1,27]},t(p,[2,20]),t(c,[2,14]),{3:20,4:n,20:29},{3:5,4:n,5:6,6:r,7:3,8:o,9:4,10:i,11:s,13:30,15:7,16:8,17:a,23:u},t(c,[2,19]),{3:5,4:n,5:6,6:r,7:3,8:o,9:4,10:i,11:s,13:31,15:7,16:8,17:a,23:u},t(l,[2,17]),t(l,[2,15]),t(p,[2,21])],defaultActions:{16:[2,6]},parseError:function(e,t){function n(e,t){this.message=e,this.hash=t}if(!t.recoverable)throw n.prototype=Error,new n(e,t);this.trace(e)},parse:function(e){var t=this,n=[0],r=[null],o=[],i=this.table,s="",a=0,u=0,c=0,l=2,p=1,f=o.slice.call(arguments,1),d=Object.create(this.lexer),h={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(h.yy[y]=this.yy[y]);d.setInput(e,h.yy),h.yy.lexer=d,h.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var g=d.yylloc;o.push(g);var m=d.options&&d.options.ranges;"function"==typeof h.yy.parseError?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,v,b,E,T,O,x,I,L,S=function(){var e;return e=d.lex()||p,"number"!=typeof e&&(e=t.symbols_[e]||e),e},C={};;){if(b=n[n.length-1],this.defaultActions[b]?E=this.defaultActions[b]:(null!==_&&"undefined"!=typeof _||(_=S()),E=i[b]&&i[b][_]),"undefined"==typeof E||!E.length||!E[0]){var N="";L=[];for(O in i[b])this.terminals_[O]&&O>l&&L.push("'"+this.terminals_[O]+"'");N=d.showPosition?"Parse error on line "+(a+1)+":\n"+d.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(a+1)+": Unexpected "+(_==p?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:d.match,token:this.terminals_[_]||_,line:d.yylineno,loc:g,expected:L})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+_);switch(E[0]){case 1:n.push(_),r.push(d.yytext),o.push(d.yylloc),n.push(E[1]),_=null,v?(_=v,v=null):(u=d.yyleng,s=d.yytext,a=d.yylineno,g=d.yylloc,c>0&&c--);break;case 2:if(x=this.productions_[E[1]][1],C.$=r[r.length-x],C._$={first_line:o[o.length-(x||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(x||1)].first_column,last_column:o[o.length-1].last_column},m&&(C._$.range=[o[o.length-(x||1)].range[0],o[o.length-1].range[1]]),T=this.performAction.apply(C,[s,u,a,h.yy,E[1],r,o].concat(f)),"undefined"!=typeof T)return T;x&&(n=n.slice(0,-1*x*2),r=r.slice(0,-1*x),o=o.slice(0,-1*x)),n.push(this.productions_[E[1]][0]),r.push(C.$),o.push(C._$),I=i[n[n.length-2]][n[n.length-1]],n.push(I);break;case 3:return!0}}return!0}},d=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var o=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var n,r,o;if(this.options.backtrack_lexer&&(o={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(o.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in o)this[i]=o[i];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),i=0;i<o.length;i++)if(n=this._input.match(this.rules[o[i]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=i,this.options.backtrack_lexer){if(e=this.test_match(n,o[i]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,o[r]),e!==!1&&e):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,n,r){switch(n){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt\/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return e}();return f.lexer=d,e.prototype=f,f.Parser=e,new e}();"undefined"!=typeof e&&"undefined"!=typeof n&&(n.parser=o,n.Parser=o.Parser,n.parse=function(){return o.parse.apply(o,arguments)},n.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),r.exit(1));var o=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return n.parser.parse(o)},"undefined"!=typeof t&&e.main===t&&n.main(r.argv.slice(1)))}).call(this,e("_process"))},{_process:19,fs:2,path:17}],16:[function(e,t,n){(function(e){function r(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function o(e){return function(t){return null==t?void 0:t[e]}}function i(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function s(e){return function(t){return e(t)}}function a(e,t){return null==e?void 0:e[t]}function u(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function c(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function l(e,t){return function(n){return e(t(n))}}function p(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function f(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function d(){this.__data__=xt?xt(null):{}}function h(e){return this.has(e)&&delete this.__data__[e]}function y(e){var t=this.__data__;if(xt){var n=t[e];return n===ye?void 0:n}return lt.call(t,e)?t[e]:void 0}function g(e){var t=this.__data__;return xt?void 0!==t[e]:lt.call(t,e)}function m(e,t){var n=this.__data__;return n[e]=xt&&void 0===t?ye:t,this}function _(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function v(){this.__data__=[]}function b(e){var t=this.__data__,n=U(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():gt.call(t,n,1),!0}function E(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]}function T(e){return U(this.__data__,e)>-1}function O(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}function x(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function I(){this.__data__={hash:new f,map:new(bt||_),string:new f}}function L(e){return W(this,e).delete(e)}function S(e){return W(this,e).get(e)}function C(e){return W(this,e).has(e)}function N(e,t){return W(this,e).set(e,t),this}function w(e){var t=-1,n=e?e.length:0;for(this.__data__=new x;++t<n;)this.add(e[t])}function A(e){return this.__data__.set(e,ye),this}function M(e){return this.__data__.has(e)}function P(e){this.__data__=new _(e)}function j(){this.__data__=new _}function k(e){return this.__data__.delete(e)}function R(e){return this.__data__.get(e)}function D(e){return this.__data__.has(e)}function F(e,t){var n=this.__data__;if(n instanceof _){var r=n.__data__;if(!bt||r.length<he-1)return r.push([e,t]),this;n=this.__data__=new x(r)}return n.set(e,t),this}function U(e,t){for(var n=e.length;n--;)if(re(e[n][0],t))return n;return-1}function G(e){return pt.call(e)}function $(e,t){return null!=e&&(lt.call(e,t)||"object"==typeof e&&t in e&&null===jt(e))}function V(e,t,n,r,o){return e===t||(null==e||null==t||!le(e)&&!pe(t)?e!==e&&t!==t:B(e,t,V,n,r,o))}function B(e,t,n,r,o,i){var s=Rt(e),a=Rt(t),c=be,l=be;s||(c=kt(e),c=c==ve?Ce:c),a||(l=kt(t),l=l==ve?Ce:l);var p=c==Ce&&!u(e),f=l==Ce&&!u(t),d=c==l;if(d&&!p)return i||(i=new P),s||Dt(e)?Y(e,t,n,r,o,i):z(e,t,c,n,r,o,i);if(!(o&me)){var h=p&&lt.call(e,"__wrapped__"),y=f&&lt.call(t,"__wrapped__");if(h||y){var g=h?e.value():e,m=y?t.value():t;return i||(i=new P),n(g,m,r,o,i)}}return!!d&&(i||(i=new P),X(e,t,n,r,o,i))}function J(e){if(!le(e)||ee(e))return!1;var t=ue(e)||u(e)?ft:ze;return t.test(ne(e))}function q(e){return pe(e)&&ce(e.length)&&!!We[pt.call(e)]}function Y(e,t,n,o,i,s){var a=i&me,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var l=s.get(e);if(l&&s.get(t))return l==t;var p=-1,f=!0,d=i&ge?new w:void 0;for(s.set(e,t),s.set(t,e);++p<u;){var h=e[p],y=t[p];if(o)var g=a?o(y,h,p,t,e,s):o(h,y,p,e,t,s);if(void 0!==g){if(g)continue;f=!1;break}if(d){if(!r(t,function(e,t){if(!d.has(t)&&(h===e||n(h,e,o,i,s)))return d.add(t)})){f=!1;break}}else if(h!==y&&!n(h,y,o,i,s)){f=!1;break}}return s.delete(e),s.delete(t),f}function z(e,t,n,r,o,i,s){switch(n){case Re:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ke:return!(e.byteLength!=t.byteLength||!r(new ht(e),new ht(t)));case Ee:case Te:case Se:return re(+e,+t);case Oe:return e.name==t.name&&e.message==t.message;case we:case Me:return e==t+"";case Le:var a=c;case Ae:var u=i&me;if(a||(a=p),e.size!=t.size&&!u)return!1;var l=s.get(e);if(l)return l==t;i|=ge,s.set(e,t);var f=Y(a(e),a(t),r,o,i,s);return s.delete(e),f;case Pe:if(At)return At.call(e)==At.call(t)}return!1}function X(e,t,n,r,o,i){var s=o&me,a=de(e),u=a.length,c=de(t),l=c.length;if(u!=l&&!s)return!1;for(var p=u;p--;){var f=a[p];if(!(s?f in t:$(t,f)))return!1}var d=i.get(e);if(d&&i.get(t))return d==t;var h=!0;i.set(e,t),i.set(t,e);for(var y=s;++p<u;){f=a[p];var g=e[f],m=t[f];if(r)var _=s?r(m,g,f,t,e,i):r(g,m,f,e,t,i);if(!(void 0===_?g===m||n(g,m,r,o,i):_)){h=!1;break}y||(y="constructor"==f)}if(h&&!y){var v=e.constructor,b=t.constructor;v!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b)&&(h=!1)}return i.delete(e),i.delete(t),h}function W(e,t){var n=e.__data__;return Q(t)?n["string"==typeof t?"string":"hash"]:n.map}function H(e,t){var n=a(e,t);return J(n)?n:void 0}function K(e){var t=e?e.length:void 0;return ce(t)&&(Rt(e)||fe(e)||oe(e))?i(t,String):null}function Z(e,t){return t=null==t?_e:t,!!t&&("number"==typeof e||Xe.test(e))&&e>-1&&e%1==0&&e<t}function Q(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function ee(e){return!!ut&&ut in e}function te(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||st;return e===n}function ne(e){if(null!=e){try{return ct.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function re(e,t){return e===t||e!==e&&t!==t}function oe(e){return se(e)&&lt.call(e,"callee")&&(!yt.call(e,"callee")||pt.call(e)==ve)}function ie(e){return null!=e&&ce(Pt(e))&&!ue(e)}function se(e){return pe(e)&&ie(e)}function ae(e,t){return V(e,t)}function ue(e){var t=le(e)?pt.call(e):"";return t==xe||t==Ie}function ce(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=_e}function le(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function pe(e){return!!e&&"object"==typeof e}function fe(e){return"string"==typeof e||!Rt(e)&&pe(e)&&pt.call(e)==Me}function de(e){var t=te(e);if(!t&&!ie(e))return Mt(e);var n=K(e),r=!!n,o=n||[],i=o.length;for(var s in e)!$(e,s)||r&&("length"==s||Z(s,i))||t&&"constructor"==s||o.push(s);return o}var he=200,ye="__lodash_hash_undefined__",ge=1,me=2,_e=9007199254740991,ve="[object Arguments]",be="[object Array]",Ee="[object Boolean]",Te="[object Date]",Oe="[object Error]",xe="[object Function]",Ie="[object GeneratorFunction]",Le="[object Map]",Se="[object Number]",Ce="[object Object]",Ne="[object Promise]",we="[object RegExp]",Ae="[object Set]",Me="[object String]",Pe="[object Symbol]",je="[object WeakMap]",ke="[object ArrayBuffer]",Re="[object DataView]",De="[object Float32Array]",Fe="[object Float64Array]",Ue="[object Int8Array]",Ge="[object Int16Array]",$e="[object Int32Array]",Ve="[object Uint8Array]",Be="[object Uint8ClampedArray]",Je="[object Uint16Array]",qe="[object Uint32Array]",Ye=/[\\^$.*+?()[\]{}|]/g,ze=/^\[object .+?Constructor\]$/,Xe=/^(?:0|[1-9]\d*)$/,We={};We[De]=We[Fe]=We[Ue]=We[Ge]=We[$e]=We[Ve]=We[Be]=We[Je]=We[qe]=!0,We[ve]=We[be]=We[ke]=We[Ee]=We[Re]=We[Te]=We[Oe]=We[xe]=We[Le]=We[Se]=We[Ce]=We[we]=We[Ae]=We[Me]=We[je]=!1;var He="object"==typeof e&&e&&e.Object===Object&&e,Ke="object"==typeof self&&self&&self.Object===Object&&self,Ze=He||Ke||Function("return this")(),Qe="object"==typeof n&&n&&!n.nodeType&&n,et=Qe&&"object"==typeof t&&t&&!t.nodeType&&t,tt=et&&et.exports===Qe,nt=tt&&He.process,rt=function(){try{return nt&&nt.binding("util")}catch(e){}}(),ot=rt&&rt.isTypedArray,it=Array.prototype,st=Object.prototype,at=Ze["__core-js_shared__"],ut=function(){var e=/[^.]+$/.exec(at&&at.keys&&at.keys.IE_PROTO||"");
return e?"Symbol(src)_1."+e:""}(),ct=Function.prototype.toString,lt=st.hasOwnProperty,pt=st.toString,ft=RegExp("^"+ct.call(lt).replace(Ye,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dt=Ze.Symbol,ht=Ze.Uint8Array,yt=st.propertyIsEnumerable,gt=it.splice,mt=Object.getPrototypeOf,_t=Object.keys,vt=H(Ze,"DataView"),bt=H(Ze,"Map"),Et=H(Ze,"Promise"),Tt=H(Ze,"Set"),Ot=H(Ze,"WeakMap"),xt=H(Object,"create"),It=ne(vt),Lt=ne(bt),St=ne(Et),Ct=ne(Tt),Nt=ne(Ot),wt=dt?dt.prototype:void 0,At=wt?wt.valueOf:void 0;f.prototype.clear=d,f.prototype.delete=h,f.prototype.get=y,f.prototype.has=g,f.prototype.set=m,_.prototype.clear=v,_.prototype.delete=b,_.prototype.get=E,_.prototype.has=T,_.prototype.set=O,x.prototype.clear=I,x.prototype.delete=L,x.prototype.get=S,x.prototype.has=C,x.prototype.set=N,w.prototype.add=w.prototype.push=A,w.prototype.has=M,P.prototype.clear=j,P.prototype.delete=k,P.prototype.get=R,P.prototype.has=D,P.prototype.set=F;var Mt=l(_t,Object),Pt=o("length"),jt=l(mt,Object),kt=G;(vt&&kt(new vt(new ArrayBuffer(1)))!=Re||bt&&kt(new bt)!=Le||Et&&kt(Et.resolve())!=Ne||Tt&&kt(new Tt)!=Ae||Ot&&kt(new Ot)!=je)&&(kt=function(e){var t=pt.call(e),n=t==Ce?e.constructor:void 0,r=n?ne(n):void 0;if(r)switch(r){case It:return Re;case Lt:return Le;case St:return Ne;case Ct:return Ae;case Nt:return je}return t});var Rt=Array.isArray,Dt=ot?s(ot):q;t.exports=ae}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],17:[function(e,t,n){(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return o.exec(e).slice(1)};n.resolve=function(){for(var n="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,o="/"===s.charAt(0))}return n=t(r(n.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+n||"."},n.normalize=function(e){var o=n.isAbsolute(e),i="/"===s(e,-1);return e=t(r(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&i&&(e+="/"),(o?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var o=r(e.split("/")),i=r(t.split("/")),s=Math.min(o.length,i.length),a=s,u=0;u<s;u++)if(o[u]!==i[u]){a=u;break}for(var c=[],u=a;u<o.length;u++)c.push("..");return c=c.concat(i.slice(a)),c.join("/")},n.sep="/",n.delimiter=":",n.dirname=function(e){var t=i(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},n.basename=function(e,t){var n=i(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},n.extname=function(e){return i(e)[3]};var s="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,e("_process"))},{_process:19}],18:[function(e,t,n){"use strict";function r(e,t){this.x=e,this.y=t}t.exports=r,r.prototype={clone:function(){return new r(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,o=n*this.x+t*this.y;return this.x=r,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},r.convert=function(e){return e instanceof r?e:Array.isArray(e)?new r(e[0],e[1]):e}},{}],19:[function(e,t,n){function r(e){if(c===setTimeout)return setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(l===clearTimeout)return clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function i(){h&&f&&(h=!1,f.length?d=f.concat(d):y=-1,d.length&&s())}function s(){if(!h){var e=r(i);h=!0;for(var t=d.length;t;){for(f=d,d=[];++y<t;)f&&f[y].run();y=-1,t=d.length}f=null,h=!1,o(e)}}function a(e,t){this.fun=e,this.array=t}function u(){}var c,l,p=t.exports={};!function(){try{c=setTimeout}catch(e){c=function(){throw new Error("setTimeout is not defined")}}try{l=clearTimeout}catch(e){l=function(){throw new Error("clearTimeout is not defined")}}}();var f,d=[],h=!1,y=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new a(e,t)),1!==d.length||h||r(s)},a.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=u,p.addListener=u,p.once=u,p.off=u,p.removeListener=u,p.removeAllListeners=u,p.emit=u,p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},{}],20:[function(e,t,n){function r(e){this.value=e}function o(e,t,n){var r=[],o=[],s=!0;return function e(a){function u(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=h(f.node)),f.isLeaf=0==f.keys.length;for(var e=0;e<o.length;e++)if(o[e].node_===a){f.circular=o[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}var c=n?i(a):a,l={},p=!0,f={node:c,node_:a,path:[].concat(r),parent:o[o.length-1],parents:o,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(p=!1)},delete:function(e){delete f.parent.node[f.key],e&&(p=!1)},remove:function(e){y(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(p=!1)},keys:null,before:function(e){l.before=e},after:function(e){l.after=e},pre:function(e){l.pre=e},post:function(e){l.post=e},stop:function(){s=!1},block:function(){p=!1}};if(!s)return f;u();var d=t.call(f,f.node);return void 0!==d&&f.update&&f.update(d),l.before&&l.before.call(f,f.node),p?("object"!=typeof f.node||null===f.node||f.circular||(o.push(f),u(),g(f.keys,function(t,o){r.push(t),l.pre&&l.pre.call(f,f.node[t],t);var i=e(f.node[t]);n&&m.call(f.node,t)&&(f.node[t]=i.node),i.isLast=o==f.keys.length-1,i.isFirst=0==o,l.post&&l.post.call(f,i),r.pop()}),o.pop()),l.after&&l.after.call(f,f.node),f):f}(e).node}function i(e){if("object"==typeof e&&null!==e){var t;if(y(e))t=[];else if(a(e))t=new Date(e.getTime?e.getTime():e);else if(u(e))t=new RegExp(e);else if(c(e))t={message:e.message};else if(l(e))t=new Boolean(e);else if(p(e))t=new Number(e);else if(f(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},r=function(){};r.prototype=n,t=new r}return g(h(e),function(n){t[n]=e[n]}),t}return e}function s(e){return Object.prototype.toString.call(e)}function a(e){return"[object Date]"===s(e)}function u(e){return"[object RegExp]"===s(e)}function c(e){return"[object Error]"===s(e)}function l(e){return"[object Boolean]"===s(e)}function p(e){return"[object Number]"===s(e)}function f(e){return"[object String]"===s(e)}var d=t.exports=function(e){return new r(e)};r.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!m.call(t,r)){t=void 0;break}t=t[r]}return t},r.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!m.call(t,r))return!1;t=t[r]}return!0},r.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var o=e[r];m.call(n,o)||(n[o]={}),n=n[o]}return n[e[r]]=t,t},r.prototype.map=function(e){return o(this.value,e,!0)},r.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},r.prototype.reduce=function(e,t){var n=1===arguments.length,r=n?this.value:t;return this.forEach(function(t){this.isRoot&&n||(r=e.call(this,r,t))}),r},r.prototype.paths=function(){var e=[];return this.forEach(function(t){e.push(this.path)}),e},r.prototype.nodes=function(){var e=[];return this.forEach(function(t){e.push(this.node)}),e},r.prototype.clone=function(){var e=[],t=[];return function n(r){for(var o=0;o<e.length;o++)if(e[o]===r)return t[o];if("object"==typeof r&&null!==r){var s=i(r);return e.push(r),t.push(s),g(h(r),function(e){s[e]=n(r[e])}),e.pop(),t.pop(),s}return r}(this.value)};var h=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},y=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},g=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};g(h(r.prototype),function(e){d[e]=function(t){var n=[].slice.call(arguments,1),o=new r(t);return o[e].apply(o,n)}});var m=Object.hasOwnProperty||function(e,t){return t in e}},{}],21:[function(e,t,n){t.exports.RADIUS=6378137,t.exports.FLATTENING=1/298.257223563,t.exports.POLAR_RADIUS=6356752.3142},{}],22:[function(e,t,n){function r(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)o.call(n,r)&&(e[r]=n[r])}return e}t.exports=r;var o=Object.prototype.hasOwnProperty},{}],23:[function(e,t,n){"use strict";var r=e("lodash.isequal"),o=e("geojson-normalize"),i=e("hat"),s=e("./lib/features_at"),a=e("./lib/string_sets_are_equal"),u=e("geojsonhint"),c=e("./constants"),l=e("./lib/string_set"),p={Polygon:e("./feature_types/polygon"),LineString:e("./feature_types/line_string"),Point:e("./feature_types/point"),MultiPolygon:e("./feature_types/multi_feature"),MultiLineString:e("./feature_types/multi_feature"),MultiPoint:e("./feature_types/multi_feature")};t.exports=function(e){var t={modes:c.modes};return t.getFeatureIdsAt=function(t){var n=s({point:t},null,e);return n.map(function(e){return e.properties.id})},t.getSelectedIds=function(){return e.store.getSelectedIds()},t.set=function(n){if(void 0===n.type||n.type!==c.geojsonTypes.FEATURE_COLLECTION||!Array.isArray(n.features))throw new Error("Invalid FeatureCollection");var r=e.store.createRenderBatch(),o=e.store.getAllIds().slice(),i=t.add(n),s=new l(i);return o=o.filter(function(e){return!s.has(e)}),o.length&&t.delete(o),r(),i},t.add=function(t){var n=u.hint(t).filter(function(e){return"message"!==e.level});if(n.length)throw new Error(n[0].message);var s=o(t);s=JSON.parse(JSON.stringify(s));var a=s.features.map(function(t){if(t.id=t.id||i(),null===t.geometry)throw new Error("Invalid geometry: null");if(void 0===e.store.get(t.id)||e.store.get(t.id).type!==t.geometry.type){var n=p[t.geometry.type];if(void 0===n)throw new Error("Invalid geometry type: "+t.geometry.type+".");var o=new n(e,t);e.store.add(o)}else{var s=e.store.get(t.id);s.properties=t.properties,r(s.getCoordinates(),t.geometry.coordinates)||s.incomingCoords(t.geometry.coordinates)}return t.id});return e.store.render(),a},t.get=function(t){var n=e.store.get(t);if(n)return n.toGeoJSON()},t.getAll=function(){return{type:c.geojsonTypes.FEATURE_COLLECTION,features:e.store.getAll().map(function(e){return e.toGeoJSON()})}},t.delete=function(n){return e.store.delete(n,{silent:!0}),t.getMode()!==c.modes.DIRECT_SELECT||e.store.getSelectedIds().length?e.store.render():e.events.changeMode(c.modes.SIMPLE_SELECT,void 0,{silent:!0}),t},t.deleteAll=function(){return e.store.delete(e.store.getAllIds(),{silent:!0}),t.getMode()===c.modes.DIRECT_SELECT?e.events.changeMode(c.modes.SIMPLE_SELECT,void 0,{silent:!0}):e.store.render(),t},t.changeMode=function(n){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return n===c.modes.SIMPLE_SELECT&&t.getMode()===c.modes.SIMPLE_SELECT?a(r.featureIds||[],e.store.getSelectedIds())?t:(e.store.setSelected(r.featureIds,{silent:!0}),e.store.render(),t):n===c.modes.DIRECT_SELECT&&t.getMode()===c.modes.DIRECT_SELECT&&r.featureId===e.store.getSelectedIds()[0]?t:(e.events.changeMode(n,r,{silent:!0}),t)},t.getMode=function(){return e.events.getMode()},t.trash=function(){return e.events.trash({silent:!0}),t},t}},{"./constants":24,"./feature_types/line_string":27,"./feature_types/multi_feature":28,"./feature_types/point":29,"./feature_types/polygon":30,"./lib/features_at":38,"./lib/string_set":47,"./lib/string_sets_are_equal":48,"geojson-normalize":10,geojsonhint:11,hat:14,"lodash.isequal":16}],24:[function(e,t,n){"use strict";t.exports={classes:{CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},sources:{HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},cursors:{ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},types:{POLYGON:"polygon",LINE:"line_string",POINT:"point"},geojsonTypes:{FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},modes:{DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},events:{CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",RENDER:"draw.render"},updateActions:{MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},meta:{FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},activeStates:{ACTIVE:"true",INACTIVE:"false"},LAT_MIN:-90,LAT_RENDERED_MIN:-85,LAT_MAX:90,LAT_RENDERED_MAX:85,LNG_MIN:-270,LNG_MAX:270}},{}],25:[function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o,i=e("./lib/mode_handler"),s=e("./lib/get_features_and_set_cursor"),a=e("./lib/is_click"),u=e("./constants"),c=(o={},r(o,u.modes.SIMPLE_SELECT,e("./modes/simple_select")),r(o,u.modes.DIRECT_SELECT,e("./modes/direct_select")),r(o,u.modes.DRAW_POINT,e("./modes/draw_point")),r(o,u.modes.DRAW_LINE_STRING,e("./modes/draw_line_string")),r(o,u.modes.DRAW_POLYGON,e("./modes/draw_polygon")),r(o,u.modes.STATIC,e("./modes/static")),o);t.exports=function(e){function t(t,n){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];l.stop();var s=c[t];if(void 0===s)throw new Error(t+" is not valid");o=t;var a=s(e,n);l=i(a,e),r.silent||e.map.fire(u.events.MODE_CHANGE,{mode:t}),e.store.setDirty(),e.store.render()}var n={},r={},o=u.modes.SIMPLE_SELECT,l=i(c.simple_select(e),e);r.drag=function(t){a(n,{point:t.point,time:(new Date).getTime()})?t.originalEvent.stopPropagation():(e.ui.queueMapClasses({mouse:u.cursors.DRAG}),l.drag(t))},r.mousemove=function(t){if(1===t.originalEvent.which)return r.drag(t);var n=s(t,e);t.featureTarget=n,l.mousemove(t)},r.mousedown=function(t){n={time:(new Date).getTime(),point:t.point};var r=s(t,e);t.featureTarget=r,l.mousedown(t)},r.mouseup=function(t){var r=s(t,e);t.featureTarget=r,a(n,{point:t.point,time:(new Date).getTime()})?l.click(t):l.mouseup(t)},r.mouseout=function(e){l.mouseout(e)};var p=function(e){return!(8===e||46===e||e>=48&&e<=57)};r.keydown=function(n){8!==n.keyCode&&46!==n.keyCode||!e.options.controls.trash?p(n.keyCode)?l.keydown(n):49===n.keyCode&&e.options.controls.point?t(u.modes.DRAW_POINT):50===n.keyCode&&e.options.controls.line_string?t(u.modes.DRAW_LINE_STRING):51===n.keyCode&&e.options.controls.polygon&&t(u.modes.DRAW_POLYGON):(n.preventDefault(),l.trash())},r.keyup=function(e){p(e.keyCode)&&l.keyup(e)},r.zoomend=function(){e.store.changeZoom()};var f={changeMode:t,currentModeName:function(){return o},currentModeRender:function(e,t){return l.render(e,t)},fire:function(e,t){r[e]&&r[e](t)},addEventListeners:function(){e.map.on("mousemove",r.mousemove),e.map.on("mousedown",r.mousedown),e.map.on("mouseup",r.mouseup),e.container.addEventListener("mouseout",r.mouseout),e.options.keybindings&&(e.container.addEventListener("keydown",r.keydown),e.container.addEventListener("keyup",r.keyup))},removeEventListeners:function(){e.map.off("mousemove",r.mousemove),e.map.off("mousedown",r.mousedown),e.map.off("mouseup",r.mouseup),e.container.removeEventListener("mouseout",r.mouseout),e.options.keybindings&&(e.container.removeEventListener("keydown",r.keydown),e.container.removeEventListener("keyup",r.keyup))},trash:function(e){l.trash(e)},getMode:function(){return o}};return f}},{"./constants":24,"./lib/get_features_and_set_cursor":39,"./lib/is_click":40,"./lib/mode_handler":43,"./modes/direct_select":52,"./modes/draw_line_string":53,"./modes/draw_point":54,"./modes/draw_polygon":55,"./modes/simple_select":56,"./modes/static":57}],26:[function(e,t,n){"use strict";var r=e("hat"),o=e("../constants"),i=function(e,t){this.ctx=e,this.properties=t.properties||{},this.coordinates=t.geometry.coordinates,this.id=t.id||r(),this.type=t.geometry.type};i.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},i.prototype.incomingCoords=function(e){this.setCoordinates(e)},i.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},i.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},i.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:o.geojsonTypes.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},i.prototype.internal=function(e){return{type:o.geojsonTypes.FEATURE,properties:{id:this.id,meta:o.meta.FEATURE,"meta:type":this.type,active:o.activeStates.INACTIVE,mode:e},geometry:{coordinates:this.getCoordinates(),type:this.type}}},t.exports=i},{"../constants":24,hat:14}],27:[function(e,t,n){"use strict";var r=e("./feature"),o=function(e,t){r.call(this,e,t)};o.prototype=Object.create(r.prototype),o.prototype.isValid=function(){return this.coordinates.length>1},o.prototype.addCoordinate=function(e,t,n){this.changed();var r=parseInt(e,10);this.coordinates.splice(r,0,[t,n])},o.prototype.getCoordinate=function(e){var t=parseInt(e,10);return JSON.parse(JSON.stringify(this.coordinates[t]))},o.prototype.removeCoordinate=function(e){this.changed(),this.coordinates.splice(parseInt(e,10),1)},o.prototype.updateCoordinate=function(e,t,n){var r=parseInt(e,10);this.coordinates[r]=[t,n],this.changed()},t.exports=o},{"./feature":26}],28:[function(e,t,n){"use strict";var r=e("./feature"),o=e("../constants"),i={MultiPoint:e("./point"),MultiLineString:e("./line_string"),MultiPolygon:e("./polygon")},s=function(e,t,n,r,o){var i=n.split("."),s=parseInt(i[0],10),a=i[1]?i.slice(1).join("."):null;return e[s][t](a,r,o)},a=function(e,t){if(r.call(this,e,t),delete this.coordinates,this.model=i[t.geometry.type],void 0===this.model)throw new TypeError(t.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(t.geometry.coordinates)};a.prototype=Object.create(r.prototype),a.prototype._coordinatesToFeatures=function(e){var t=this;return e.map(function(e){return new t.model(t.ctx,{id:t.id,type:o.geojsonTypes.FEATURE,properties:{},geometry:{coordinates:e,type:t.type.replace("Multi","")}})})},a.prototype.isValid=function(){return this.features.every(function(e){return e.isValid()})},a.prototype.setCoordinates=function(e){this.features=this._coordinatesToFeatures(e),this.changed()},a.prototype.getCoordinate=function(e){return s(this.features,"getCoordinate",e)},a.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map(function(e){return e.type===o.geojsonTypes.POLYGON?e.getCoordinates():e.coordinates})))},a.prototype.updateCoordinate=function(e,t,n){s(this.features,"updateCoordinate",e,t,n)},a.prototype.addCoordinate=function(e,t,n){s(this.features,"addCoordinate",e,t,n)},a.prototype.removeCoordinate=function(e){s(this.features,"removeCoordinate",e)},t.exports=a},{"../constants":24,"./feature":26,"./line_string":27,"./point":29,"./polygon":30}],29:[function(e,t,n){"use strict";var r=e("./feature"),o=function(e,t){r.call(this,e,t)};o.prototype=Object.create(r.prototype),o.prototype.isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},o.prototype.updateCoordinate=function(e,t,n){3===arguments.length?this.coordinates=[t,n]:this.coordinates=[e,t],this.changed()},o.prototype.getCoordinate=function(){return this.getCoordinates()},t.exports=o},{"./feature":26}],30:[function(e,t,n){"use strict";var r=e("./feature"),o=function(e,t){r.call(this,e,t),this.coordinates=this.coordinates.map(function(e){return e.slice(0,-1)})};o.prototype=Object.create(r.prototype),o.prototype.isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every(function(e){return e.length>2})},o.prototype.incomingCoords=function(e){this.coordinates=e.map(function(e){return e.slice(0,-1)}),this.changed()},o.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},o.prototype.addCoordinate=function(e,t,n){this.changed();var r=e.split(".").map(function(e){return parseInt(e,10)}),o=this.coordinates[r[0]];o.splice(r[1],0,[t,n])},o.prototype.removeCoordinate=function(e){this.changed();var t=e.split(".").map(function(e){return parseInt(e,10)}),n=this.coordinates[t[0]];n&&(n.splice(t[1],1),n.length<3&&this.coordinates.splice(t[0],1))},o.prototype.getCoordinate=function(e){var t=e.split(".").map(function(e){return parseInt(e,10)}),n=this.coordinates[t[0]];return JSON.parse(JSON.stringify(n[t[1]]))},o.prototype.getCoordinates=function(){return this.coordinates.map(function(e){return e.concat([e[0]])})},o.prototype.updateCoordinate=function(e,t,n){this.changed();var r=e.split("."),o=parseInt(r[0],10),i=parseInt(r[1],10);void 0===this.coordinates[o]&&(this.coordinates[o]=[]),this.coordinates[o][i]=[t,n]},t.exports=o},{"./feature":26}],31:[function(e,t,n){"use strict";var r=e("../constants");t.exports={isOfMetaType:function(e){return function(t){var n=t.featureTarget;return!!n&&(!!n.properties&&n.properties.meta===e)}},isShiftMousedown:function(e){return!!e.originalEvent&&(!!e.originalEvent.shiftKey&&0===e.originalEvent.button)},isActiveFeature:function(e){return!!e.featureTarget&&(!!e.featureTarget.properties&&(e.featureTarget.properties.active===r.activeStates.ACTIVE&&e.featureTarget.properties.meta===r.meta.FEATURE))},isInactiveFeature:function(e){return!!e.featureTarget&&(!!e.featureTarget.properties&&(e.featureTarget.properties.active===r.activeStates.INACTIVE&&e.featureTarget.properties.meta===r.meta.FEATURE))},noTarget:function(e){return void 0===e.featureTarget},isFeature:function(e){return!!e.featureTarget&&(!!e.featureTarget.properties&&e.featureTarget.properties.meta===r.meta.FEATURE)},isVertex:function(e){var t=e.featureTarget;return!!t&&(!!t.properties&&t.properties.meta===r.meta.VERTEX)},isShiftDown:function(e){return!!e.originalEvent&&e.originalEvent.shiftKey===!0},isEscapeKey:function(e){return 27===e.keyCode},isEnterKey:function(e){return 13===e.keyCode},true:function(){return!0}}},{"../constants":24}],32:[function(e,t,n){"use strict";var r=e("geojson-extent"),o=e("../constants"),i=o.LAT_MIN,s=o.LAT_MAX,a=o.LAT_RENDERED_MIN,u=o.LAT_RENDERED_MAX,c=o.LNG_MIN,l=o.LNG_MAX;t.exports=function(e,t){var n=i,o=s,p=i,f=s,d=l,h=c;e.forEach(function(e){var t=r(e),i=t[1],s=t[3],a=t[0],u=t[2];i>n&&(n=i),s<o&&(o=s),s>p&&(p=s),i<f&&(f=i),a<d&&(d=a),u>h&&(h=u)});var y=t;return n+y.lat>u&&(y.lat=u-n),p+y.lat>s&&(y.lat=s-p),o+y.lat<a&&(y.lat=a-o),f+y.lat<i&&(y.lat=i-f),d+y.lng<=c&&(y.lng+=360*Math.ceil(Math.abs(y.lng)/360)),h+y.lng>=l&&(y.lng-=360*Math.ceil(Math.abs(y.lng)/360)),y}},{"../constants":24,"geojson-extent":8}],33:[function(e,t,n){"use strict";var r=e("../constants");t.exports=function(e,t,n,o){var i=t.geometry.coordinates,s=n.geometry.coordinates;if(i[1]>r.LAT_RENDERED_MAX||i[1]<r.LAT_RENDERED_MIN||s[1]>r.LAT_RENDERED_MAX||s[1]<r.LAT_RENDERED_MIN)return null;var a=o.project([i[0],i[1]]),u=o.project([s[0],s[1]]),c=o.unproject([(a.x+u.x)/2,(a.y+u.y)/2]);return{type:r.geojsonTypes.FEATURE,properties:{meta:r.meta.MIDPOINT,parent:e,lng:c.lng,lat:c.lat,coord_path:n.properties.coord_path},geometry:{type:r.geojsonTypes.POINT,coordinates:[c.lng,c.lat]}}}},{"../constants":24}],34:[function(e,t,n){"use strict";function r(e){function t(e,t){var r="",s=null;e.forEach(function(e,a){var c=void 0!=t?t+"."+a:String(a),l=o(d,e,c,n(c));if(u.midpoints&&s){var p=i(d,s,l,u.map);p&&h.push(p)}s=l;var f=JSON.stringify(e);r!==f&&h.push(l),0===a&&(r=f)})}function n(e){return!!u.selectedPaths&&u.selectedPaths.indexOf(e)!==-1}function a(){var t=p.replace(s.geojsonTypes.MULTI_PREFIX,"");f.forEach(function(n,o){var i={type:s.geojsonTypes.FEATURE,properties:e.properties,geometry:{type:t,coordinates:n}};h=h.concat(r(i,u,o))})}var u=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],c=arguments.length<=2||void 0===arguments[2]?null:arguments[2],l=e.geometry,p=l.type,f=l.coordinates,d=e.properties&&e.properties.id,h=[];return p===s.geojsonTypes.POINT?h.push(o(d,f,c,n(c))):p===s.geojsonTypes.POLYGON?f.forEach(function(e,n){t(e,c?c+"."+n:String(n))}):p===s.geojsonTypes.LINE_STRING?t(f,c):0===p.indexOf(s.geojsonTypes.MULTI_PREFIX)&&a(),h}var o=e("./create_vertex"),i=e("./create_midpoint"),s=e("../constants");t.exports=r},{"../constants":24,"./create_midpoint":33,"./create_vertex":35}],35:[function(e,t,n){"use strict";var r=e("../constants");t.exports=function(e,t,n,o){return{type:r.geojsonTypes.FEATURE,properties:{meta:r.meta.VERTEX,parent:e,coord_path:n,active:o?r.activeStates.ACTIVE:r.activeStates.INACTIVE},geometry:{type:r.geojsonTypes.POINT,coordinates:t}}}},{"../constants":24}],36:[function(e,t,n){"use strict";t.exports={enable:function(e){setTimeout(function(){e.map&&e.map.doubleClickZoom&&e.map.doubleClickZoom.enable()},0)},disable:function(e){setTimeout(function(){e.map&&e.map.doubleClickZoom&&e.map.doubleClickZoom.disable()},0)}}},{}],37:[function(e,t,n){"use strict";t.exports=function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}},{}],38:[function(e,t,n){"use strict";var r=e("./sort_features"),o=e("./map_event_to_bounding_box"),i=e("../constants"),s=[i.meta.FEATURE,i.meta.MIDPOINT,i.meta.VERTEX];t.exports=function(e,t,n){if(null===n.map)return[];var i=e?o(e,n.options.clickBuffer):t,a={};n.options.styles&&(a.layers=n.options.styles.map(function(e){return e.id}));var u=n.map.queryRenderedFeatures(i,a).filter(function(e){return s.indexOf(e.properties.meta)!==-1});return r(u)}},{"../constants":24,"./map_event_to_bounding_box":42,"./sort_features":46}],39:[function(e,t,n){"use strict";var r=e("./features_at"),o=e("../constants");t.exports=function(e,t){var n=r(e,null,t),i={mouse:o.cursors.NONE};return n[0]&&(i.mouse=n[0].properties.active===o.activeStates.ACTIVE?o.cursors.MOVE:o.cursors.POINTER,i.feature=n[0].properties.meta),t.events.currentModeName().indexOf("draw")!==-1&&(i.mouse=o.cursors.ADD),t.ui.queueMapClasses(i),t.ui.updateMapClasses(),n[0]}},{"../constants":24,"./features_at":38}],40:[function(e,t,n){"use strict";var r=e("./euclidean_distance"),o=4,i=12,s=500;t.exports=function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],a=null!=n.fineTolerance?n.fineTolerance:o,u=null!=n.grossTolerance?n.grossTolerance:i,c=null!=n.interval?n.interval:s;e.point=e.point||t.point,e.time=e.time||t.time;var l=r(e.point,t.point);return l<a||l<u&&t.time-e.time<c}},{"./euclidean_distance":37}],41:[function(e,t,n){"use strict";function r(e,t){return!!e.lngLat&&(e.lngLat.lng===t[0]&&e.lngLat.lat===t[1])}t.exports=r},{}],42:[function(e,t,n){"use strict";function r(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];return[[e.point.x-t,e.point.y-t],[e.point.x+t,e.point.y+t]]}t.exports=r},{}],43:[function(e,t,n){"use strict";var r=function(e,t){var n={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[]},r={on:function(e,t,r){if(void 0===n[e])throw new Error("Invalid event type: "+e);n[e].push({selector:t,fn:r})},render:function(e){t.store.featureChanged(e)}},o=function(e,o){for(var i=n[e],s=i.length;s--;){var a=i[s];if(a.selector(o)){a.fn.call(r,o),t.store.render(),t.ui.updateMapClasses();break}}};return e.start.call(r),{render:e.render,stop:function(){e.stop&&e.stop()},trash:function(){e.trash&&(e.trash(),t.store.render())},drag:function(e){o("drag",e)},click:function(e){o("click",e)},mousemove:function(e){o("mousemove",e)},mousedown:function(e){o("mousedown",e)},mouseup:function(e){o("mouseup",e)},mouseout:function(e){o("mouseout",e)},keydown:function(e){o("keydown",e)},keyup:function(e){o("keyup",e)}}};t.exports=r},{}],44:[function(e,t,n){"use strict";function r(e,t){var n=t.getBoundingClientRect();return new o(e.clientX-n.left-t.clientLeft,e.clientY-n.top-t.clientTop)}var o=e("point-geometry");t.exports=r},{"point-geometry":18}],45:[function(e,t,n){"use strict";var r=(e("xtend"),e("./constrain_feature_movement")),o=e("../constants");t.exports=function(e,t){var n=r(e.map(function(e){return e.toGeoJSON()}),t);e.forEach(function(e){var t=e.getCoordinates(),r=function(e){return[e[0]+n.lng,e[1]+n.lat]},i=function(e){return e.map(function(e){return r(e)})},s=function(e){return e.map(function(e){return i(e)})},a=void 0;e.type===o.geojsonTypes.POINT?a=r(t):e.type===o.geojsonTypes.LINE_STRING||e.type===o.geojsonTypes.MULTI_POINT?a=t.map(r):e.type===o.geojsonTypes.POLYGON||e.type===o.geojsonTypes.MULTI_LINE_STRING?a=t.map(i):e.type===o.geojsonTypes.MULTI_POLYGON&&(a=t.map(s)),e.incomingCoords(a)})}},{"../constants":24,"./constrain_feature_movement":32,xtend:22}],46:[function(e,t,n){"use strict";function r(e,t){var n=a[e.geometry.type]-a[t.geometry.type];return 0===n&&e.geometry.type===s.geojsonTypes.POLYGON?e.area-t.area:n}function o(e){return e.map(function(e){return e.geometry.type===s.geojsonTypes.POLYGON&&(e.area=i.geometry({type:s.geojsonTypes.FEATURE,property:{},geometry:e.geometry})),e}).sort(r).map(function(e){return delete e.area,e})}var i=e("geojson-area"),s=e("../constants"),a={Point:0,LineString:1,Polygon:2};t.exports=o},{"../constants":24,"geojson-area":4}],47:[function(e,t,n){"use strict";function r(e){if(this._items={},e)for(var t=0,n=e.length;t<n;t++)void 0!==e[t]&&(this._items[e[t]]=String(e[t]));
}r.prototype.add=function(e){return this._items[e]=String(e),this},r.prototype.delete=function(e){return delete this._items[e],this},r.prototype.has=function(e){return void 0!==this._items[e]},r.prototype.values=function(){return Object.keys(this._items)},r.prototype.clear=function(){return this._items={},this},t.exports=r},{}],48:[function(e,t,n){"use strict";t.exports=function(e,t){return JSON.stringify(e.sort())===JSON.stringify(t.sort())}},{}],49:[function(e,t,n){"use strict";t.exports=[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1},interactive:!0},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1},interactive:!0},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"},interactive:!0},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2},interactive:!0},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2},interactive:!0},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2},interactive:!0},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2},interactive:!0},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"},interactive:!0},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"},interactive:!0},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"},interactive:!0},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"},interactive:!0},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"},interactive:!0},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"},interactive:!0},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1},interactive:!0},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2},interactive:!0},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2},interactive:!0},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"},interactive:!0}]},{}],50:[function(e,t,n){"use strict";function r(e,t,n){var r,o,i,s;return s=function(){r=!1,o&&(i.apply(n,o),o=!1)},i=function(){r?o=arguments:(r=!0,e.apply(n,arguments),setTimeout(s,t))}}t.exports=r},{}],51:[function(e,t,n){"use strict";function r(e){return[].concat(e).filter(function(e){return void 0!==e})}t.exports=r},{}],52:[function(e,t,n){"use strict";var r=e("../lib/common_selectors"),o=r.noTarget,i=r.isOfMetaType,s=r.isInactiveFeature,a=r.isShiftDown,u=e("../lib/create_supplementary_points"),c=e("../lib/constrain_feature_movement"),l=e("../lib/double_click_zoom"),p=e("../constants"),f=e("../lib/common_selectors"),d=i(p.meta.VERTEX),h=i(p.meta.MIDPOINT);t.exports=function(e,t){var n=t.featureId,r=e.store.get(n);if(!r)throw new Error("You must provide a featureId to enter direct_select mode");if(r.type===p.geojsonTypes.POINT)throw new TypeError("direct_select mode doesn't handle point features");var i=t.startPos||null,y=!1,g=!1,m=t.coordPath?[t.coordPath]:[],_=function(){e.map.fire(p.events.UPDATE,{action:p.updateActions.CHANGE_COORDINATES,features:e.store.getSelected().map(function(e){return e.toGeoJSON()})})},v=function(t){e.map.dragPan.disable(),g=!0,i=t.lngLat},b=function(){e.map.dragPan.enable(),y=!1,g=!1,i=null},E=function(e){v(e);var t=e.featureTarget.properties,n=m.indexOf(t.coord_path);a(e)||n!==-1?a(e)&&n===-1&&m.push(t.coord_path):m=[t.coord_path],r.changed()},T=function(e){v(e);var t=e.featureTarget.properties;r.addCoordinate(t.coord_path,t.lng,t.lat),_(),m=[t.coord_path]};return{start:function(){e.store.setSelected(n),l.disable(e),this.on("mousemove",f.true,b),this.on("mouseout",function(){return y},_),this.on("mousedown",d,E),this.on("mousedown",h,T),this.on("drag",function(){return g},function(e){y=!0,e.originalEvent.stopPropagation();for(var t=m.map(function(e){return r.getCoordinate(e)}),n=t.map(function(e){return{type:p.geojsonTypes.FEATURE,properties:{},geometry:{type:p.geojsonTypes.POINT,coordinates:e}}}),o={lng:e.lngLat.lng-i.lng,lat:e.lngLat.lat-i.lat},s=c(n,o),a=0;a<t.length;a++){var u=t[a];r.updateCoordinate(m[a],u[0]+s.lng,u[1]+s.lat)}i=e.lngLat}),this.on("click",f.true,b),this.on("mouseup",f.true,function(){y&&_(),b()}),this.on("click",o,function(){e.events.changeMode(p.modes.SIMPLE_SELECT)}),this.on("click",s,function(){e.events.changeMode(p.modes.SIMPLE_SELECT)})},stop:function(){l.enable(e)},render:function(t,r){n===t.properties.id?(t.properties.active=p.activeStates.ACTIVE,r(t),u(t,{map:e.map,midpoints:!0,selectedPaths:m}).forEach(r)):(t.properties.active=p.activeStates.INACTIVE,r(t))},trash:function(){return 0===m.length?e.events.changeMode(p.modes.SIMPLE_SELECT,{features:[r]}):(m.sort().reverse().forEach(function(e){return r.removeCoordinate(e)}),e.map.fire(p.events.UPDATE,{action:p.updateActions.CHANGE_COORDINATES,features:e.store.getSelected().map(function(e){return e.toGeoJSON()})}),m=[],void(r.isValid()===!1&&(e.store.delete([n]),e.events.changeMode(p.modes.SIMPLE_SELECT,null))))}}}},{"../constants":24,"../lib/common_selectors":31,"../lib/constrain_feature_movement":32,"../lib/create_supplementary_points":34,"../lib/double_click_zoom":36}],53:[function(e,t,n){"use strict";var r=e("../lib/common_selectors"),o=e("../feature_types/line_string"),i=e("../lib/is_event_at_coordinates"),s=e("../lib/double_click_zoom"),a=e("../constants"),u=e("../lib/create_vertex");t.exports=function(e){var t=new o(e,{type:a.geojsonTypes.FEATURE,properties:{},geometry:{type:a.geojsonTypes.LINE_STRING,coordinates:[]}}),n=0;return e._test&&(e._test.line=t),e.store.add(t),{start:function(){e.store.clearSelected(),s.disable(e),e.ui.queueMapClasses({mouse:a.cursors.ADD}),e.ui.setActiveButton(a.types.LINE),this.on("mousemove",r.true,function(o){t.updateCoordinate(n,o.lngLat.lng,o.lngLat.lat),r.isVertex(o)&&e.ui.queueMapClasses({mouse:a.cursors.POINTER})}),this.on("click",r.true,function(r){return n>0&&i(r,t.coordinates[n-1])?e.events.changeMode(a.modes.SIMPLE_SELECT,{featureIds:[t.id]}):(e.ui.queueMapClasses({mouse:a.cursors.ADD}),t.updateCoordinate(n,r.lngLat.lng,r.lngLat.lat),void n++)}),this.on("click",r.isVertex,function(){return e.events.changeMode(a.modes.SIMPLE_SELECT,{featureIds:[t.id]})}),this.on("keyup",r.isEscapeKey,function(){e.store.delete([t.id],{silent:!0}),e.events.changeMode(a.modes.SIMPLE_SELECT)}),this.on("keyup",r.isEnterKey,function(){e.events.changeMode(a.modes.SIMPLE_SELECT,{featureIds:[t.id]})})},stop:function(){s.enable(e),e.ui.setActiveButton(),void 0!==e.store.get(t.id)&&(t.removeCoordinate(""+n),t.isValid()?e.map.fire(a.events.CREATE,{features:[t.toGeoJSON()]}):(e.store.delete([t.id],{silent:!0}),e.events.changeMode(a.modes.SIMPLE_SELECT,{},{silent:!0})))},render:function(e,n){var r=e.properties.id===t.id;return e.properties.active=r?a.activeStates.ACTIVE:a.activeStates.INACTIVE,r?void(e.geometry.coordinates.length<2||(e.properties.meta=a.meta.FEATURE,e.geometry.coordinates.length>=3&&n(u(t.id,e.geometry.coordinates[e.geometry.coordinates.length-2],""+(e.geometry.coordinates.length-2),!1)),n(e))):n(e)},trash:function(){e.store.delete([t.id],{silent:!0}),e.events.changeMode(a.modes.SIMPLE_SELECT)}}}},{"../constants":24,"../feature_types/line_string":27,"../lib/common_selectors":31,"../lib/create_vertex":35,"../lib/double_click_zoom":36,"../lib/is_event_at_coordinates":41}],54:[function(e,t,n){"use strict";var r=e("../lib/common_selectors"),o=e("../feature_types/point"),i=e("../constants");t.exports=function(e){function t(){e.events.changeMode(i.modes.SIMPLE_SELECT),e.store.delete([s.id],{silent:!0})}function n(t){e.ui.queueMapClasses({mouse:i.cursors.MOVE}),s.updateCoordinate("",t.lngLat.lng,t.lngLat.lat),e.map.fire(i.events.CREATE,{features:[s.toGeoJSON()]}),e.events.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[s.id]})}var s=new o(e,{type:i.geojsonTypes.FEATURE,properties:{},geometry:{type:i.geojsonTypes.POINT,coordinates:[]}});return e._test&&(e._test.point=s),e.store.add(s),{start:function(){e.store.clearSelected(),e.ui.queueMapClasses({mouse:i.cursors.ADD}),e.ui.setActiveButton(i.types.POINT),this.on("click",r.true,n),this.on("keyup",r.isEscapeKey,t),this.on("keyup",r.isEnterKey,t)},stop:function(){e.ui.setActiveButton(),s.getCoordinate().length||e.store.delete([s.id],{silent:!0})},render:function(e,t){var n=e.properties.id===s.id;if(e.properties.active=n?i.activeStates.ACTIVE:i.activeStates.INACTIVE,!n)return t(e)},trash:function(){t()}}}},{"../constants":24,"../feature_types/point":29,"../lib/common_selectors":31}],55:[function(e,t,n){"use strict";var r=e("../lib/common_selectors"),o=e("../feature_types/polygon"),i=e("../lib/double_click_zoom"),s=e("../constants"),a=e("../lib/is_event_at_coordinates"),u=e("../lib/create_vertex");t.exports=function(e){var t=new o(e,{type:s.geojsonTypes.FEATURE,properties:{},geometry:{type:s.geojsonTypes.POLYGON,coordinates:[[]]}}),n=0;return e._test&&(e._test.polygon=t),e.store.add(t),{start:function(){e.store.clearSelected(),i.disable(e),e.ui.queueMapClasses({mouse:s.cursors.ADD}),e.ui.setActiveButton(s.types.POLYGON),this.on("mousemove",r.true,function(o){t.updateCoordinate("0."+n,o.lngLat.lng,o.lngLat.lat),r.isVertex(o)&&e.ui.queueMapClasses({mouse:s.cursors.POINTER})}),this.on("click",r.true,function(r){return n>0&&a(r,t.coordinates[0][n-1])?e.events.changeMode(s.modes.SIMPLE_SELECT,{featureIds:[t.id]}):(e.ui.queueMapClasses({mouse:s.cursors.ADD}),t.updateCoordinate("0."+n,r.lngLat.lng,r.lngLat.lat),void n++)}),this.on("click",r.isVertex,function(){return e.events.changeMode(s.modes.SIMPLE_SELECT,{featureIds:[t.id]})}),this.on("keyup",r.isEscapeKey,function(){e.store.delete([t.id],{silent:!0}),e.events.changeMode(s.modes.SIMPLE_SELECT)}),this.on("keyup",r.isEnterKey,function(){e.events.changeMode(s.modes.SIMPLE_SELECT,{featureIds:[t.id]})})},stop:function(){e.ui.queueMapClasses({mouse:s.cursors.NONE}),i.enable(e),e.ui.setActiveButton(),void 0!==e.store.get(t.id)&&(t.removeCoordinate("0."+n),t.isValid()?e.map.fire(s.events.CREATE,{features:[t.toGeoJSON()]}):(e.store.delete([t.id],{silent:!0}),e.events.changeMode(s.modes.SIMPLE_SELECT,{},{silent:!0})))},render:function(e,n){var r=e.properties.id===t.id;if(e.properties.active=r?s.activeStates.ACTIVE:s.activeStates.INACTIVE,!r)return n(e);if(0!==e.geometry.coordinates.length){var o=e.geometry.coordinates[0].length;if(!(o<3)){if(e.properties.meta=s.meta.FEATURE,o>4){n(u(t.id,e.geometry.coordinates[0][0],"0.0",!1));var i=e.geometry.coordinates[0].length-3;n(u(t.id,e.geometry.coordinates[0][i],"0."+i,!1))}if(o>3)return n(e);var a=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];return n({type:s.geojsonTypes.FEATURE,properties:e.properties,geometry:{coordinates:a,type:s.geojsonTypes.LINE_STRING}})}}},trash:function(){e.store.delete([t.id],{silent:!0}),e.events.changeMode(s.modes.SIMPLE_SELECT)}}}},{"../constants":24,"../feature_types/polygon":30,"../lib/common_selectors":31,"../lib/create_vertex":35,"../lib/double_click_zoom":36,"../lib/is_event_at_coordinates":41}],56:[function(e,t,n){"use strict";var r=e("../lib/common_selectors"),o=e("../lib/mouse_event_point"),i=e("../lib/features_at"),s=e("../lib/create_supplementary_points"),a=e("../lib/string_set"),u=e("../lib/double_click_zoom"),c=e("../lib/move_features"),l=e("../constants");t.exports=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=null,p=null,f=void 0,d=!1,h=!1,y=!1,g=!1,m=t.featureIds||[],_=function(){e.map.fire(l.events.UPDATE,{action:l.updateActions.MOVE,features:e.store.getSelected().map(function(e){return e.toGeoJSON()})})},v=function(e){if(!e.length)return[];var t=e.map(function(e){return e.properties.id}).filter(function(e){return void 0!==e}).reduce(function(e,t){return e.add(t),e},new a);return t.values()},b=function(){f&&(f.parentNode&&f.parentNode.removeChild(f),f=null),e.map.dragPan.enable(),d=!1,h=!1,y=!1,g=!1};return{stop:function(){u.enable(e)},start:function(){e.store&&e.store.setSelected(m.filter(function(t){return void 0!==e.store.get(t)})),this.on("mouseup",r.true,b),this.on("mousemove",r.true,b),this.on("mouseout",function(){return y},_),this.on("click",r.noTarget,function(){var t=this,n=e.store.getSelectedIds();n.length&&(e.store.clearSelected(),n.forEach(function(e){return t.render(e)})),u.enable(e),b()}),this.on("click",r.isOfMetaType(l.meta.VERTEX),function(t){e.events.changeMode(l.modes.DIRECT_SELECT,{featureId:t.featureTarget.properties.parent,coordPath:t.featureTarget.properties.coord_path,startPos:t.lngLat}),e.ui.queueMapClasses({mouse:l.cursors.MOVE})}),this.on("mousedown",r.isActiveFeature,function(t){b(),e.map.dragPan.disable(),this.render(t.featureTarget.properties.id),g=!0,n=t.lngLat}),this.on("click",r.isFeature,function(t){u.disable(e),b();var n=r.isShiftDown(t),o=e.store.getSelectedIds(),i=t.featureTarget.properties.id,s=e.store.isSelected(i);return!n&&s&&e.store.get(i).type!==l.geojsonTypes.POINT?e.events.changeMode(l.modes.DIRECT_SELECT,{featureId:i}):(s&&n?(e.store.deselect(i),e.ui.queueMapClasses({mouse:l.cursors.POINTER}),1===o.length&&u.enable(e)):!s&&n?(e.store.select(i),e.ui.queueMapClasses({mouse:l.cursors.MOVE})):s||n||(o.forEach(this.render),e.store.setSelected(i),e.ui.queueMapClasses({mouse:l.cursors.MOVE})),void this.render(i))}),this.on("drag",function(){return g},function(t){y=!0,t.originalEvent.stopPropagation();var r={lng:t.lngLat.lng-n.lng,lat:t.lngLat.lat-n.lat};c(e.store.getSelected(),r),n=t.lngLat}),this.on("mouseup",r.true,function(t){if(y)_();else if(d){var n=[p,o(t.originalEvent,e.container)],r=i(null,n,e),s=v(r).filter(function(t){return!e.store.isSelected(t)});s.length&&(e.store.select(s),s.forEach(this.render),e.ui.queueMapClasses({mouse:l.cursors.MOVE}))}b()}),e.options.boxSelect&&(this.on("mousedown",r.isShiftMousedown,function(t){b(),e.map.dragPan.disable(),p=o(t.originalEvent,e.container),h=!0}),this.on("drag",function(){return h},function(t){d=!0,e.ui.queueMapClasses({mouse:l.cursors.ADD}),f||(f=document.createElement("div"),f.classList.add(l.classes.BOX_SELECT),e.container.appendChild(f));var n=o(t.originalEvent,e.container),r=Math.min(p.x,n.x),i=Math.max(p.x,n.x),s=Math.min(p.y,n.y),a=Math.max(p.y,n.y),u="translate("+r+"px, "+s+"px)";f.style.transform=u,f.style.WebkitTransform=u,f.style.width=i-r+"px",f.style.height=a-s+"px"}))},render:function(t,n){t.properties.active=e.store.isSelected(t.properties.id)?l.activeStates.ACTIVE:l.activeStates.INACTIVE,n(t),t.properties.active===l.activeStates.ACTIVE&&t.geometry.type!==l.geojsonTypes.POINT&&s(t).forEach(n)},trash:function(){e.store.delete(e.store.getSelectedIds())}}}},{"../constants":24,"../lib/common_selectors":31,"../lib/create_supplementary_points":34,"../lib/double_click_zoom":36,"../lib/features_at":38,"../lib/mouse_event_point":44,"../lib/move_features":45,"../lib/string_set":47}],57:[function(e,t,n){"use strict";t.exports=function(){return{stop:function(){},start:function(){},render:function(e,t){t(e)}}}},{}],58:[function(e,t,n){"use strict";function r(e,t){return e.map(function(e){return e.source?e:o(e,{id:e.id+"."+t,source:"hot"===t?i.sources.HOT:i.sources.COLD})})}var o=e("xtend"),i=e("./constants"),s={defaultMode:i.modes.SIMPLE_SELECT,position:"top-left",keybindings:!0,clickBuffer:2,boxSelect:!0,displayControlsDefault:!0,styles:e("./lib/theme"),controls:{}},a={point:!0,line_string:!0,polygon:!0,trash:!0},u={point:!1,line_string:!1,polygon:!1,trash:!1};t.exports=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=o(e);return e.controls||(t.controls={}),e.displayControlsDefault===!1?t.controls=o(u,e.controls):t.controls=o(a,e.controls),t=o(s,t),t.styles=r(t.styles,"cold").concat(r(t.styles,"hot")),t}},{"./constants":24,"./lib/theme":49,xtend:22}],59:[function(e,t,n){"use strict";var r=e("./constants");t.exports=function(){function e(e,t){var r=n.get(e),o=r.internal(i);n.ctx.events.currentModeRender(o,function(e){n.sources[t].push(e)})}function t(){n.isDirty=!1,n.clearChangedIds()}var n=this,o=n.ctx.map&&void 0!==n.ctx.map.getSource(r.sources.HOT);if(!o)return t();var i=n.ctx.events.currentModeName();n.ctx.ui.queueMapClasses({mode:i});var s=[],a=[];n.isDirty?a=n.getAllIds():(s=n.getChangedIds().filter(function(e){return void 0!==n.get(e)}),a=n.sources.hot.filter(function(e){return e.properties.id&&s.indexOf(e.properties.id)===-1&&void 0!==n.get(e.properties.id)}).map(function(e){return e.properties.id})),n.sources.hot=[];var u=n.sources.cold.length;n.sources.cold=n.isDirty?[]:n.sources.cold.filter(function(e){var t=e.properties.id||e.properties.parent;return s.indexOf(t)===-1});var c=u!==n.sources.cold.length||a.length>0;if(s.forEach(function(t){return e(t,"hot")}),a.forEach(function(t){return e(t,"cold")}),c&&n.ctx.map.getSource(r.sources.COLD).setData({type:r.geojsonTypes.FEATURE_COLLECTION,features:n.sources.cold}),n.ctx.map.getSource(r.sources.HOT).setData({type:r.geojsonTypes.FEATURE_COLLECTION,features:n.sources.hot}),n._emitSelectionChange&&(n.ctx.map.fire(r.events.SELECTION_CHANGE,{features:n.getSelected().map(function(e){return e.toGeoJSON()})}),n._emitSelectionChange=!1),n._deletedFeaturesToEmit.length){var l=n._deletedFeaturesToEmit.map(function(e){return e.toGeoJSON()});n._deletedFeaturesToEmit=[],n.ctx.map.fire(r.events.DELETE,{features:l})}n.ctx.map.fire(r.events.RENDER,{}),t()}},{"./constants":24}],60:[function(e,t,n){"use strict";var r=e("./events"),o=e("./store"),i=e("./ui"),s=e("./constants");t.exports=function(e){e.events=r(e),e.map=null,e.container=null,e.store=null,e.ui=i(e);var t={addTo:function(n){return e.map=n,t.onAdd(n),this},remove:function(){return t.removeLayers(),e.ui.removeButtons(),e.events.removeEventListeners(),e.map=null,e.container=null,e.store=null,this},onAdd:function(n){e.container=n.getContainer(),e.store=new o(e),e.ui.addButtons(),e.options.boxSelect&&(n.boxZoom.disable(),n.dragPan.disable(),n.dragPan.enable()),n.loaded()?(t.addLayers(),e.events.addEventListeners()):n.on("load",function(){t.addLayers(),e.events.addEventListeners()})},addLayers:function(){e.map.addSource(s.sources.COLD,{data:{type:s.geojsonTypes.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.map.addSource(s.sources.HOT,{data:{type:s.geojsonTypes.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.options.styles.forEach(function(t){e.map.addLayer(t)}),e.store.render()},removeLayers:function(){e.options.styles.forEach(function(t){e.map.removeLayer(t.id)}),e.map.removeSource(s.sources.COLD),e.map.removeSource(s.sources.HOT)}};return t}},{"./constants":24,"./events":25,"./store":61,"./ui":62}],61:[function(e,t,n){"use strict";var r=e("./lib/throttle"),o=e("./lib/to_dense_array"),i=e("./lib/string_set"),s=e("./render"),a=t.exports=function(e){this._features={},this._featureIds=new i,this._selectedFeatureIds=new i,this._changedFeatureIds=new i,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this.ctx=e,this.sources={hot:[],cold:[]},this.render=r(s,16,this),this.isDirty=!1};a.prototype.createRenderBatch=function(){var e=this,t=this.render,n=0;return this.render=function(){n++},function(){e.render=t,n>0&&e.render()}},a.prototype.setDirty=function(){return this.isDirty=!0,this},a.prototype.featureChanged=function(e){return this._changedFeatureIds.add(e),this},a.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},a.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},a.prototype.getAllIds=function(){return this._featureIds.values()},a.prototype.add=function(e){return this.featureChanged(e.id),this._features[e.id]=e,this._featureIds.add(e.id),this},a.prototype.delete=function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return o(e).forEach(function(e){t._featureIds.has(e)&&(t._featureIds.delete(e),t._selectedFeatureIds.delete(e),n.silent||t._deletedFeaturesToEmit.indexOf(t._features[e])===-1&&t._deletedFeaturesToEmit.push(t._features[e]),delete t._features[e],t.isDirty=!0)}),this},a.prototype.get=function(e){return this._features[e]},a.prototype.getAll=function(){var e=this;return Object.keys(this._features).map(function(t){return e._features[t]})},a.prototype.select=function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return o(e).forEach(function(e){t._selectedFeatureIds.has(e)||(t._selectedFeatureIds.add(e),t._changedFeatureIds.add(e),n.silent||(t._emitSelectionChange=!0))}),this},a.prototype.deselect=function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return o(e).forEach(function(e){t._selectedFeatureIds.has(e)&&(t._selectedFeatureIds.delete(e),t._changedFeatureIds.add(e),n.silent||(t._emitSelectionChange=!0))}),this},a.prototype.clearSelected=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return this.deselect(this._selectedFeatureIds.values(),{silent:e.silent}),this},a.prototype.setSelected=function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return e=o(e),this.deselect(this._selectedFeatureIds.values().filter(function(t){return e.indexOf(t)===-1}),{silent:n.silent}),this.select(e.filter(function(e){return!t._selectedFeatureIds.has(e)}),{silent:n.silent}),this},a.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},a.prototype.getSelected=function(){var e=this;return this._selectedFeatureIds.values().map(function(t){return e.get(t)})},a.prototype.isSelected=function(e){return this._selectedFeatureIds.has(e)}},{"./lib/string_set":47,"./lib/throttle":50,"./lib/to_dense_array":51,"./render":59}],62:[function(e,t,n){"use strict";var r=e("xtend"),o=e("./constants"),i=["mode","feature","mouse"];t.exports=function(e){function t(e){h=r(h,e)}function n(){if(e.container){var t=[],n=[];i.forEach(function(e){h[e]!==d[e]&&(t.push(e+"-"+d[e]),null!==h[e]&&n.push(e+"-"+h[e]))}),t.length>0&&e.container.classList.remove.apply(e.container.classList,t),n.length>0&&e.container.classList.add.apply(e.container.classList,n),d=r(d,h)}}function s(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=document.createElement("button");return n.className=o.classes.CONTROL_BUTTON+" "+t.className,n.setAttribute("title",t.title),t.container.appendChild(n),n.addEventListener("click",function(n){n.preventDefault(),n.stopPropagation();var r=n.target;return r===f?void a():(u(e),void t.onActivate())},!0),n}function a(){f&&(f.classList.remove(o.classes.ACTIVE_BUTTON),f=null)}function u(e){a();var t=p[e];t&&t&&"trash"!==e&&(t.classList.add(o.classes.ACTIVE_BUTTON),f=t)}function c(){var t=e.options.controls;if(t){var n=""+o.classes.CONTROL_PREFIX+(e.options.position||"top-left"),r=e.container.getElementsByClassName(n)[0];r||(r=document.createElement("div"),r.className=n,e.container.appendChild(r));var i=r.getElementsByClassName(o.classes.CONTROL_GROUP)[0];if(!i){i=document.createElement("div"),i.className=o.classes.CONTROL_GROUP+" "+o.classes.CONTROL_BASE;var a=r.getElementsByClassName(o.classes.ATTRIBUTION)[0];a?r.insertBefore(i,a):r.appendChild(i)}t[o.types.LINE]&&(p[o.types.LINE]=s(o.types.LINE,{container:i,className:o.classes.CONTROL_BUTTON_LINE,title:"LineString tool "+(e.options.keybindings&&"(l)"),onActivate:function(){return e.events.changeMode(o.modes.DRAW_LINE_STRING)}})),t[o.types.POLYGON]&&(p[o.types.POLYGON]=s(o.types.POLYGON,{container:i,className:o.classes.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(e.options.keybindings&&"(p)"),onActivate:function(){return e.events.changeMode(o.modes.DRAW_POLYGON)}})),t[o.types.POINT]&&(p[o.types.POINT]=s(o.types.POINT,{container:i,className:o.classes.CONTROL_BUTTON_POINT,title:"Marker tool "+(e.options.keybindings&&"(m)"),onActivate:function(){return e.events.changeMode(o.modes.DRAW_POINT)}})),t.trash&&(p.trash=s("trash",{container:i,className:o.classes.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:function(){e.events.trash()}}))}}function l(){Object.keys(p).forEach(function(e){var t=p[e];t.parentNode&&t.parentNode.removeChild(t),delete p[e]})}var p={},f=null,d={mode:null,feature:null,mouse:null},h={mode:null,feature:null,mouse:null};return{setActiveButton:u,queueMapClasses:t,updateMapClasses:n,addButtons:c,removeButtons:l}}},{"./constants":24,xtend:22}]},{},[1]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment