!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=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;t0){t+=Math.abs(s(e[0]));for(var n=1;n2){for(i=0;i3)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(Eo)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=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.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;it[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-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();++tu))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-1&&e%1==0&&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=-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=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;u1)for(var n=1;n=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),sp&&(p=s),ih&&(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=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_MAX||s[1]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]))}),e.container.classList.remove.apply(e.container.classList,t),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]);