var _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol?"symbol":typeof n};(function(n,t,i){function s(){var t=n.L;r.noConflict=function(){return n.L=t,this};n.L=r}var r={version:"1.0.0-rc.1"},u,e,f,o;(typeof module=="undefined"?"undefined":_typeof(module))==="object"&&_typeof(module.exports)==="object"?module.exports=r:typeof define=="function"&&define.amd&&define(r);typeof n!="undefined"&&s();r.Util={extend:function(n){for(var i,r,t=1,u=arguments.length;t<u;t++){r=arguments[t];for(i in r)n[i]=r[i]}return n},create:Object.create||function(){function n(){}return function(t){return n.prototype=t,new n}}(),bind:function(n,t){var i=Array.prototype.slice,r;return n.bind?n.bind.apply(n,i.call(arguments,1)):(r=i.call(arguments,2),function(){return n.apply(t,r.length?r.concat(i.call(arguments)):arguments)})},stamp:function(n){return n._leaflet_id=n._leaflet_id||++r.Util.lastId,n._leaflet_id},lastId:0,throttle:function(n,t,i){var u,r,f,e;return e=function(){u=!1;r&&(f.apply(i,r),r=!1)},f=function(){u?r=arguments:(n.apply(i,arguments),setTimeout(e,t),u=!0)}},wrapNum:function(n,t,i){var f=t[1],r=t[0],u=f-r;return n===f&&i?n:((n-r)%u+u)%u+r},falseFn:function(){return!1},formatNum:function(n,t){var i=Math.pow(10,t||5);return Math.round(n*i)/i},trim:function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")},splitWords:function(n){return r.Util.trim(n).split(/\s+/)},setOptions:function(n,t){n.hasOwnProperty("options")||(n.options=n.options?r.Util.create(n.options):{});for(var i in t)n.options[i]=t[i];return n.options},getParamString:function(n,t,i){var u=[],r;for(r in n)u.push(encodeURIComponent(i?r.toUpperCase():r)+"="+encodeURIComponent(n[r]));return(!t||t.indexOf("?")===-1?"?":"&")+u.join("&")},template:function(n,t){return n.replace(r.Util.templateRe,function(n,r){var u=t[r];if(u===i)throw new Error("No value provided for variable "+n);else typeof u=="function"&&(u=u(t));return u})},templateRe:/\{ *([\w_\-]+) *\}/g,isArray:Array.isArray||function(n){return Object.prototype.toString.call(n)==="[object Array]"},indexOf:function(n,t){for(var i=0;i<n.length;i++)if(n[i]===t)return i;return-1},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function t(t){return n["webkit"+t]||n["moz"+t]||n["ms"+t]}function u(t){var r=+new Date,u=Math.max(0,16-(r-i));return i=r+u,n.setTimeout(t,u)}var i=0,f=n.requestAnimationFrame||t("RequestAnimationFrame")||u,e=n.cancelAnimationFrame||t("CancelAnimationFrame")||t("CancelRequestAnimationFrame")||function(t){n.clearTimeout(t)};r.Util.requestAnimFrame=function(t,i,e){if(e&&f===u)t.call(i);else return f.call(n,r.bind(t,i))};r.Util.cancelAnimFrame=function(t){t&&e.call(n,t)}}();r.extend=r.Util.extend;r.bind=r.Util.bind;r.stamp=r.Util.stamp;r.setOptions=r.Util.setOptions;r.Class=function(){};r.Class.extend=function(n){var i=function(){this.initialize&&this.initialize.apply(this,arguments);this.callInitHooks()},f=i.__super__=this.prototype,t=r.Util.create(f),u;t.constructor=i;i.prototype=t;for(u in this)this.hasOwnProperty(u)&&u!=="prototype"&&(i[u]=this[u]);return n.statics&&(r.extend(i,n.statics),delete n.statics),n.includes&&(r.Util.extend.apply(null,[t].concat(n.includes)),delete n.includes),t.options&&(n.options=r.Util.extend(r.Util.create(t.options),n.options)),r.extend(t,n),t._initHooks=[],t.callInitHooks=function(){if(!this._initHooksCalled){f.callInitHooks&&f.callInitHooks.call(this);this._initHooksCalled=!0;for(var n=0,i=t._initHooks.length;n<i;n++)t._initHooks[n].call(this)}},i};r.Class.include=function(n){return r.extend(this.prototype,n),this};r.Class.mergeOptions=function(n){return r.extend(this.prototype.options,n),this};r.Class.addInitHook=function(n){var t=Array.prototype.slice.call(arguments,1),i=typeof n=="function"?n:function(){this[n].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};r.Evented=r.Class.extend({on:function(n,t,i){var f,u,e;if((typeof n=="undefined"?"undefined":_typeof(n))==="object")for(f in n)this._on(f,n[f],t);else for(n=r.Util.splitWords(n),u=0,e=n.length;u<e;u++)this._on(n[u],t,i);return this},off:function(n,t,i){var f,u,e;if(n)if((typeof n=="undefined"?"undefined":_typeof(n))==="object")for(f in n)this._off(f,n[f],t);else for(n=r.Util.splitWords(n),u=0,e=n.length;u<e;u++)this._off(n[u],t,i);else delete this._events;return this},_on:function(n,t,i){var u=this._events=this._events||{},f=i&&i!==this&&r.stamp(i);if(f){var e=n+"_idx",o=n+"_len",s=u[e]=u[e]||{},h=r.stamp(t)+"_"+f;s[h]||(s[h]={fn:t,ctx:i},u[o]=(u[o]||0)+1)}else u[n]=u[n]||[],u[n].push({fn:t})},_off:function(n,t,i){var f=this._events,c=n+"_idx",l=n+"_len",h,u,e,a,o,s;if(f){if(!t){delete f[n];delete f[c];delete f[l];return}if(h=i&&i!==this&&r.stamp(i),h)s=r.stamp(t)+"_"+h,u=f[c],u&&u[s]&&(o=u[s],delete u[s],f[l]--);else if(u=f[n],u)for(e=0,a=u.length;e<a;e++)if(u[e].fn===t){o=u[e];u.splice(e,1);break}o&&(o.fn=r.Util.falseFn)}},fire:function(n,t,i){var f,u,e,o,c,s,h;if(!this.listens(n,i))return this;if(f=r.Util.extend({},t,{type:n,target:this}),u=this._events,u){if(e=u[n+"_idx"],u[n])for(s=u[n].slice(),o=0,c=s.length;o<c;o++)s[o].fn.call(this,f);for(h in e)e[h].fn.call(e[h].ctx,f)}return i&&this._propagateEvent(f),this},listens:function(n,t){var i=this._events,r;if(i&&(i[n]||i[n+"_len"]))return!0;if(t)for(r in this._eventParents)if(this._eventParents[r].listens(n,t))return!0;return!1},once:function(n,t,i){var u,f;if((typeof n=="undefined"?"undefined":_typeof(n))==="object"){for(u in n)this.once(u,n[u],t);return this}f=r.bind(function(){this.off(n,t,i).off(n,f,i)},this);return this.on(n,t,i).on(n,f,i)},addEventParent:function(n){return this._eventParents=this._eventParents||{},this._eventParents[r.stamp(n)]=n,this},removeEventParent:function(n){return this._eventParents&&delete this._eventParents[r.stamp(n)],this},_propagateEvent:function(n){for(var t in this._eventParents)this._eventParents[t].fire(n.type,r.extend({layer:n.target},n),!0)}});u=r.Evented.prototype;u.addEventListener=u.on;u.removeEventListener=u.clearAllEventListeners=u.off;u.addOneTimeEventListener=u.once;u.fireEvent=u.fire;u.hasEventListeners=u.listens;r.Mixin={Events:u},function(){var i=navigator.userAgent.toLowerCase(),e=t.documentElement,f="ActiveXObject"in n,o=i.indexOf("webkit")!==-1,b=i.indexOf("phantom")!==-1,h=i.search("android [23]")!==-1,c=i.indexOf("chrome")!==-1,l=i.indexOf("gecko")!==-1&&!o&&!n.opera&&!f,u=typeof orientation!="undefined"||i.indexOf("mobile")!==-1,a=!n.PointerEvent&&n.MSPointerEvent,v=n.PointerEvent||a,y=f&&"transition"in e.style,s="WebKitCSSMatrix"in n&&"m11"in new n.WebKitCSSMatrix&&!h,p="MozPerspective"in e.style,w="OTransition"in e.style,k=!n.L_NO_TOUCH&&(v||"ontouchstart"in n||n.DocumentTouch&&t instanceof n.DocumentTouch);r.Browser={ie:f,ielt9:f&&!t.addEventListener,edge:"msLaunchUri"in navigator&&!("documentMode"in t),webkit:o,gecko:l,android:i.indexOf("android")!==-1,android23:h,chrome:c,safari:!c&&i.indexOf("safari")!==-1,ie3d:y,webkit3d:s,gecko3d:p,opera12:w,any3d:!n.L_DISABLE_3D&&(y||s||p)&&!w&&!b,mobile:u,mobileWebkit:u&&o,mobileWebkit3d:u&&s,mobileOpera:u&&n.opera,mobileGecko:u&&l,touch:!!k,msPointer:!!a,pointer:!!v,retina:(n.devicePixelRatio||n.screen.deviceXDPI/n.screen.logicalXDPI)>1}}();r.Point=function(n,t,i){this.x=i?Math.round(n):n;this.y=i?Math.round(t):t};r.Point.prototype={clone:function(){return new r.Point(this.x,this.y)},add:function(n){return this.clone()._add(r.point(n))},_add:function(n){return this.x+=n.x,this.y+=n.y,this},subtract:function(n){return this.clone()._subtract(r.point(n))},_subtract:function(n){return this.x-=n.x,this.y-=n.y,this},divideBy:function(n){return this.clone()._divideBy(n)},_divideBy:function(n){return this.x/=n,this.y/=n,this},multiplyBy:function(n){return this.clone()._multiplyBy(n)},_multiplyBy:function(n){return this.x*=n,this.y*=n,this},scaleBy:function(n){return new r.Point(this.x*n.x,this.y*n.y)},unscaleBy:function(n){return new r.Point(this.x/n.x,this.y/n.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},distanceTo:function(n){n=r.point(n);var t=n.x-this.x,i=n.y-this.y;return Math.sqrt(t*t+i*i)},equals:function(n){return n=r.point(n),n.x===this.x&&n.y===this.y},contains:function(n){return n=r.point(n),Math.abs(n.x)<=Math.abs(this.x)&&Math.abs(n.y)<=Math.abs(this.y)},toString:function(){return"Point("+r.Util.formatNum(this.x)+", "+r.Util.formatNum(this.y)+")"}};r.point=function(n,t,u){return n instanceof r.Point?n:r.Util.isArray(n)?new r.Point(n[0],n[1]):n===i||n===null?n:new r.Point(n,t,u)};r.Bounds=function(n,t){var r,i,u;if(n)for(r=t?[n,t]:n,i=0,u=r.length;i<u;i++)this.extend(r[i])};r.Bounds.prototype={extend:function(n){return n=r.point(n),this.min||this.max?(this.min.x=Math.min(n.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(n.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=n.clone(),this.max=n.clone()),this},getCenter:function(n){return new r.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,n)},getBottomLeft:function(){return new r.Point(this.min.x,this.max.y)},getTopRight:function(){return new r.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(n){var t,i;return n=typeof n[0]=="number"||n instanceof r.Point?r.point(n):r.bounds(n),n instanceof r.Bounds?(t=n.min,i=n.max):t=i=n,t.x>=this.min.x&&i.x<=this.max.x&&t.y>=this.min.y&&i.y<=this.max.y},intersects:function(n){n=r.bounds(n);var t=this.min,i=this.max,u=n.min,f=n.max,e=f.x>=t.x&&u.x<=i.x,o=f.y>=t.y&&u.y<=i.y;return e&&o},overlaps:function(n){n=r.bounds(n);var t=this.min,i=this.max,u=n.min,f=n.max,e=f.x>t.x&&u.x<i.x,o=f.y>t.y&&u.y<i.y;return e&&o},isValid:function(){return!!(this.min&&this.max)}};r.bounds=function(n,t){return!n||n instanceof r.Bounds?n:new r.Bounds(n,t)};r.Transformation=function(n,t,i,r){this._a=n;this._b=t;this._c=i;this._d=r};r.Transformation.prototype={transform:function(n,t){return this._transform(n.clone(),t)},_transform:function(n,t){return t=t||1,n.x=t*(this._a*n.x+this._b),n.y=t*(this._c*n.y+this._d),n},untransform:function(n,t){return t=t||1,new r.Point((n.x/t-this._b)/this._a,(n.y/t-this._d)/this._c)}};r.DomUtil={get:function(n){return typeof n=="string"?t.getElementById(n):n},getStyle:function(n,i){var r=n.style[i]||n.currentStyle&&n.currentStyle[i],u;return(!r||r==="auto")&&t.defaultView&&(u=t.defaultView.getComputedStyle(n,null),r=u?u[i]:null),r==="auto"?null:r},create:function(n,i,r){var u=t.createElement(n);return u.className=i,r&&r.appendChild(u),u},remove:function(n){var t=n.parentNode;t&&t.removeChild(n)},empty:function(n){while(n.firstChild)n.removeChild(n.firstChild)},toFront:function(n){n.parentNode.appendChild(n)},toBack:function(n){var t=n.parentNode;t.insertBefore(n,t.firstChild)},hasClass:function(n,t){if(n.classList!==i)return n.classList.contains(t);var u=r.DomUtil.getClass(n);return u.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(u)},addClass:function(n,t){var f,u,o,e;if(n.classList!==i)for(f=r.Util.splitWords(t),u=0,o=f.length;u<o;u++)n.classList.add(f[u]);else r.DomUtil.hasClass(n,t)||(e=r.DomUtil.getClass(n),r.DomUtil.setClass(n,(e?e+" ":"")+t))},removeClass:function(n,t){n.classList!==i?n.classList.remove(t):r.DomUtil.setClass(n,r.Util.trim((" "+r.DomUtil.getClass(n)+" ").replace(" "+t+" "," ")))},setClass:function(n,t){n.className.baseVal===i?n.className=t:n.className.baseVal=t},getClass:function(n){return n.className.baseVal===i?n.className:n.className.baseVal},setOpacity:function(n,t){"opacity"in n.style?n.style.opacity=t:"filter"in n.style&&r.DomUtil._setOpacityIE(n,t)},_setOpacityIE:function(n,t){var i=!1,r="DXImageTransform.Microsoft.Alpha";try{i=n.filters.item(r)}catch(u){if(t===1)return}t=Math.round(t*100);i?(i.Enabled=t!==100,i.Opacity=t):n.style.filter+=" progid:"+r+"(opacity="+t+")"},testProp:function(n){for(var r=t.documentElement.style,i=0;i<n.length;i++)if(n[i]in r)return n[i];return!1},setTransform:function(n,t,i){var u=t||new r.Point(0,0);n.style[r.DomUtil.TRANSFORM]=(r.Browser.ie3d?"translate("+u.x+"px,"+u.y+"px)":"translate3d("+u.x+"px,"+u.y+"px,0)")+(i?" scale("+i+")":"")},setPosition:function(n,t){n._leaflet_pos=t;r.Browser.any3d?r.DomUtil.setTransform(n,t):(n.style.left=t.x+"px",n.style.top=t.y+"px")},getPosition:function(n){return n._leaflet_pos||new r.Point(0,0)}},function(){var u,i;r.DomUtil.TRANSFORM=r.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]);u=r.DomUtil.TRANSITION=r.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);r.DomUtil.TRANSITION_END=u==="webkitTransition"||u==="OTransition"?u+"End":"transitionend";"onselectstart"in t?(r.DomUtil.disableTextSelection=function(){r.DomEvent.on(n,"selectstart",r.DomEvent.preventDefault)},r.DomUtil.enableTextSelection=function(){r.DomEvent.off(n,"selectstart",r.DomEvent.preventDefault)}):(i=r.DomUtil.testProp(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),r.DomUtil.disableTextSelection=function(){if(i){var n=t.documentElement.style;this._userSelect=n[i];n[i]="none"}},r.DomUtil.enableTextSelection=function(){i&&(t.documentElement.style[i]=this._userSelect,delete this._userSelect)});r.DomUtil.disableImageDrag=function(){r.DomEvent.on(n,"dragstart",r.DomEvent.preventDefault)};r.DomUtil.enableImageDrag=function(){r.DomEvent.off(n,"dragstart",r.DomEvent.preventDefault)};r.DomUtil.preventOutline=function(t){while(t.tabIndex===-1)t=t.parentNode;if(t&&t.style){r.DomUtil.restoreOutline();this._outlineElement=t;this._outlineStyle=t.style.outline;t.style.outline="none";r.DomEvent.on(n,"keydown",r.DomUtil.restoreOutline,this)}};r.DomUtil.restoreOutline=function(){this._outlineElement&&(this._outlineElement.style.outline=this._outlineStyle,delete this._outlineElement,delete this._outlineStyle,r.DomEvent.off(n,"keydown",r.DomUtil.restoreOutline,this))}}();r.LatLng=function(n,t,r){if(isNaN(n)||isNaN(t))throw new Error("Invalid LatLng object: ("+n+", "+t+")");this.lat=+n;this.lng=+t;r!==i&&(this.alt=+r)};r.LatLng.prototype={equals:function(n,t){if(!n)return!1;n=r.latLng(n);var u=Math.max(Math.abs(this.lat-n.lat),Math.abs(this.lng-n.lng));return u<=(t===i?1e-9:t)},toString:function(n){return"LatLng("+r.Util.formatNum(this.lat,n)+", "+r.Util.formatNum(this.lng,n)+")"},distanceTo:function(n){return r.CRS.Earth.distance(this,r.latLng(n))},wrap:function(){return r.CRS.Earth.wrapLatLng(this)},toBounds:function(n){var t=180*n/40075017,i=t/Math.cos(Math.PI/180*this.lat);return r.latLngBounds([this.lat-t,this.lng-i],[this.lat+t,this.lng+i])},clone:function(){return new r.LatLng(this.lat,this.lng,this.alt)}};r.latLng=function(n,t,u){return n instanceof r.LatLng?n:r.Util.isArray(n)&&_typeof(n[0])!=="object"?n.length===3?new r.LatLng(n[0],n[1],n[2]):n.length===2?new r.LatLng(n[0],n[1]):null:n===i||n===null?n:(typeof n=="undefined"?"undefined":_typeof(n))==="object"&&"lat"in n?new r.LatLng(n.lat,"lng"in n?n.lng:n.lon,n.alt):t===i?null:new r.LatLng(n,t,u)};r.LatLngBounds=function(n,t){var r,i,u;if(n)for(r=t?[n,t]:n,i=0,u=r.length;i<u;i++)this.extend(r[i])};r.LatLngBounds.prototype={extend:function(n){var u=this._southWest,f=this._northEast,t,i;if(n instanceof r.LatLng)t=n,i=n;else if(n instanceof r.LatLngBounds){if(t=n._southWest,i=n._northEast,!t||!i)return this}else return n?this.extend(r.latLng(n)||r.latLngBounds(n)):this;return u||f?(u.lat=Math.min(t.lat,u.lat),u.lng=Math.min(t.lng,u.lng),f.lat=Math.max(i.lat,f.lat),f.lng=Math.max(i.lng,f.lng)):(this._southWest=new r.LatLng(t.lat,t.lng),this._northEast=new r.LatLng(i.lat,i.lng)),this},pad:function(n){var t=this._southWest,i=this._northEast,u=Math.abs(t.lat-i.lat)*n,f=Math.abs(t.lng-i.lng)*n;return new r.LatLngBounds(new r.LatLng(t.lat-u,t.lng-f),new r.LatLng(i.lat+u,i.lng+f))},getCenter:function(){return new r.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new r.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new r.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(n){n=typeof n[0]=="number"||n instanceof r.LatLng?r.latLng(n):r.latLngBounds(n);var u=this._southWest,f=this._northEast,t,i;return n instanceof r.LatLngBounds?(t=n.getSouthWest(),i=n.getNorthEast()):t=i=n,t.lat>=u.lat&&i.lat<=f.lat&&t.lng>=u.lng&&i.lng<=f.lng},intersects:function(n){n=r.latLngBounds(n);var t=this._southWest,i=this._northEast,u=n.getSouthWest(),f=n.getNorthEast(),e=f.lat>=t.lat&&u.lat<=i.lat,o=f.lng>=t.lng&&u.lng<=i.lng;return e&&o},overlaps:function(n){n=r.latLngBounds(n);var t=this._southWest,i=this._northEast,u=n.getSouthWest(),f=n.getNorthEast(),e=f.lat>t.lat&&u.lat<i.lat,o=f.lng>t.lng&&u.lng<i.lng;return e&&o},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(n){return n?(n=r.latLngBounds(n),this._southWest.equals(n.getSouthWest())&&this._northEast.equals(n.getNorthEast())):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};r.latLngBounds=function(n,t){return n instanceof r.LatLngBounds?n:new r.LatLngBounds(n,t)};r.Projection={};r.Projection.LonLat={project:function(n){return new r.Point(n.lng,n.lat)},unproject:function(n){return new r.LatLng(n.y,n.x)},bounds:r.bounds([-180,-90],[180,90])};r.Projection.SphericalMercator={R:6378137,MAX_LATITUDE:85.0511287798,project:function(n){var t=Math.PI/180,i=this.MAX_LATITUDE,f=Math.max(Math.min(i,n.lat),-i),u=Math.sin(f*t);return new r.Point(this.R*n.lng*t,this.R*Math.log((1+u)/(1-u))/2)},unproject:function(n){var t=180/Math.PI;return new r.LatLng((2*Math.atan(Math.exp(n.y/this.R))-Math.PI/2)*t,n.x*t/this.R)},bounds:function(){var n=6378137*Math.PI;return r.bounds([-n,-n],[n,n])}()};r.CRS={latLngToPoint:function(n,t){var i=this.projection.project(n),r=this.scale(t);return this.transformation._transform(i,r)},pointToLatLng:function(n,t){var i=this.scale(t),r=this.transformation.untransform(n,i);return this.projection.unproject(r)},project:function(n){return this.projection.project(n)},unproject:function(n){return this.projection.unproject(n)},scale:function(n){return 256*Math.pow(2,n)},zoom:function(n){return Math.log(n/256)/Math.LN2},getProjectedBounds:function(n){if(this.infinite)return null;var t=this.projection.bounds,i=this.scale(n),u=this.transformation.transform(t.min,i),f=this.transformation.transform(t.max,i);return r.bounds(u,f)},infinite:!1,wrapLatLng:function(n){var t=this.wrapLng?r.Util.wrapNum(n.lng,this.wrapLng,!0):n.lng,i=this.wrapLat?r.Util.wrapNum(n.lat,this.wrapLat,!0):n.lat,u=n.alt;return r.latLng(i,t,u)}};r.CRS.Simple=r.extend({},r.CRS,{projection:r.Projection.LonLat,transformation:new r.Transformation(1,0,-1,0),scale:function(n){return Math.pow(2,n)},zoom:function(n){return Math.log(n)/Math.LN2},distance:function(n,t){var i=t.lng-n.lng,r=t.lat-n.lat;return Math.sqrt(i*i+r*r)},infinite:!0});r.CRS.Earth=r.extend({},r.CRS,{wrapLng:[-180,180],R:6371e3,distance:function(n,t){var i=Math.PI/180,r=n.lat*i,u=t.lat*i,f=Math.sin(r)*Math.sin(u)+Math.cos(r)*Math.cos(u)*Math.cos((t.lng-n.lng)*i);return this.R*Math.acos(Math.min(f,1))}});r.CRS.EPSG3857=r.extend({},r.CRS.Earth,{code:"EPSG:3857",projection:r.Projection.SphericalMercator,transformation:function(){var n=.5/(Math.PI*r.Projection.SphericalMercator.R);return new r.Transformation(n,.5,-n,.5)}()});r.CRS.EPSG900913=r.extend({},r.CRS.EPSG3857,{code:"EPSG:900913"});r.CRS.EPSG4326=r.extend({},r.CRS.Earth,{code:"EPSG:4326",projection:r.Projection.LonLat,transformation:new r.Transformation(1/180,1,-1/180,.5)});r.Map=r.Evented.extend({options:{crs:r.CRS.EPSG3857,center:i,zoom:i,minZoom:i,maxZoom:i,layers:[],maxBounds:i,renderer:i,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(n,t){t=r.setOptions(this,t);this._initContainer(n);this._initLayout();this._onResize=r.bind(this._onResize,this);this._initEvents();t.maxBounds&&this.setMaxBounds(t.maxBounds);t.zoom!==i&&(this._zoom=this._limitZoom(t.zoom));t.center&&t.zoom!==i&&this.setView(r.latLng(t.center),t.zoom,{reset:!0});this._handlers=[];this._layers={};this._zoomBoundLayers={};this._sizeChanged=!0;this.callInitHooks();this._addLayers(this.options.layers)},setView:function(n,t){return t=t===i?this.getZoom():t,this._resetView(r.latLng(n),t),this},setZoom:function(n,t){return this._loaded?this.setView(this.getCenter(),n,{zoom:t}):(this._zoom=n,this)},zoomIn:function(n,t){return n=n||(r.Browser.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+n,t)},zoomOut:function(n,t){return n=n||(r.Browser.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-n,t)},setZoomAround:function(n,t,i){var f=this.getZoomScale(t),u=this.getSize().divideBy(2),e=n instanceof r.Point?n:this.latLngToContainerPoint(n),o=e.subtract(u).multiplyBy(1-1/f),s=this.containerPointToLatLng(u.add(o));return this.setView(s,t,{zoom:i})},_getBoundsCenterZoom:function(n,t){t=t||{};n=n.getBounds?n.getBounds():r.latLngBounds(n);var u=r.point(t.paddingTopLeft||t.padding||[0,0]),f=r.point(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(n,!1,u.add(f));i=typeof t.maxZoom=="number"?Math.min(t.maxZoom,i):i;var e=f.subtract(u).divideBy(2),o=this.project(n.getSouthWest(),i),s=this.project(n.getNorthEast(),i),h=this.unproject(o.add(s).divideBy(2).add(e),i);return{center:h,zoom:i}},fitBounds:function(n,t){if(n=r.latLngBounds(n),!n.isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(n,t);return this.setView(i.center,i.zoom,t)},fitWorld:function(n){return this.fitBounds([[-90,-180],[90,180]],n)},panTo:function(n,t){return this.setView(n,this._zoom,{pan:t})},panBy:function(n){return this.fire("movestart"),this._rawPanBy(r.point(n)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(n){if(n=r.latLngBounds(n),n)this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds);else return this.off("moveend",this._panInsideMaxBounds);this.options.maxBounds=n;this._loaded&&this._panInsideMaxBounds();return this.on("moveend",this._panInsideMaxBounds)},setMinZoom:function(n){return(this.options.minZoom=n,this._loaded&&this.getZoom()<this.options.minZoom)?this.setZoom(n):this},setMaxZoom:function(n){return(this.options.maxZoom=n,this._loaded&&this.getZoom()>this.options.maxZoom)?this.setZoom(n):this},panInsideBounds:function(n,t){this._enforcingBounds=!0;var i=this.getCenter(),u=this._limitCenter(i,this._zoom,r.latLngBounds(n));return i.equals(u)||this.panTo(u,t),this._enforcingBounds=!1,this},invalidateSize:function(n){var i;if(!this._loaded)return this;n=r.extend({animate:!1,pan:!0},n===!0?{animate:!0}:n);i=this.getSize();this._sizeChanged=!0;this._lastCenter=null;var u=this.getSize(),f=i.divideBy(2).round(),e=u.divideBy(2).round(),t=f.subtract(e);return!t.x&&!t.y?this:(n.animate&&n.pan?this.panBy(t):(n.pan&&this._rawPanBy(t),this.fire("move"),n.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:u}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},addHandler:function(n,t){if(!t)return this;var i=this[n]=new t(this);return this._handlers.push(i),this.options[n]&&i.enable(),this},remove:function(){this._initEvents(!0);try{delete this._container._leaflet}catch(t){this._container._leaflet=i}r.DomUtil.remove(this._mapPane);this._clearControlPos&&this._clearControlPos();this._clearHandlers();this._loaded&&this.fire("unload");for(var n in this._layers)this._layers[n].remove();return this},createPane:function(n,t){var u="leaflet-pane"+(n?" leaflet-"+n.replace("Pane","")+"-pane":""),i=r.DomUtil.create("div",u,t||this._mapPane);return n&&(this._panes[n]=i),i},getCenter:function(){return(this._checkIfLoaded(),this._lastCenter&&!this._moved())?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var n=this.getPixelBounds(),t=this.unproject(n.getBottomLeft()),i=this.unproject(n.getTopRight());return new r.LatLngBounds(t,i)},getMinZoom:function(){return this.options.minZoom===i?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===i?this._layersMaxZoom===i?Infinity:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(n,t,i){n=r.latLngBounds(n);i=r.point(i||[0,0]);var u=this.getZoom()||0,s=this.getMinZoom(),h=this.getMaxZoom(),c=n.getNorthWest(),l=n.getSouthEast(),e=this.getSize(),o=this.project(l,u).subtract(this.project(c,u)).add(i),f=r.Browser.any3d?this.options.zoomSnap:1,a=Math.min(e.x/o.x,e.y/o.y);return u=this.getScaleZoom(a,u),f&&(u=Math.round(u/(f/100))*(f/100),u=t?Math.ceil(u/f)*f:Math.floor(u/f)*f),Math.max(s,Math.min(h,u))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new r.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(n,t){var i=this._getTopLeftPoint(n,t);return new r.Bounds(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(n){return this.options.crs.getProjectedBounds(n===i?this.getZoom():n)},getPane:function(n){return typeof n=="string"?this._panes[n]:n},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(n,t){var r=this.options.crs;return t=t===i?this._zoom:t,r.scale(n)/r.scale(t)},getScaleZoom:function(n,t){var r=this.options.crs;return t=t===i?this._zoom:t,r.zoom(n*r.scale(t))},project:function(n,t){return t=t===i?this._zoom:t,this.options.crs.latLngToPoint(r.latLng(n),t)},unproject:function(n,t){return t=t===i?this._zoom:t,this.options.crs.pointToLatLng(r.point(n),t)},layerPointToLatLng:function(n){var t=r.point(n).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(n){var t=this.project(r.latLng(n))._round();return t._subtract(this.getPixelOrigin())},wrapLatLng:function(n){return this.options.crs.wrapLatLng(r.latLng(n))},distance:function(n,t){return this.options.crs.distance(r.latLng(n),r.latLng(t))},containerPointToLayerPoint:function(n){return r.point(n).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(n){return r.point(n).add(this._getMapPanePos())},containerPointToLatLng:function(n){var t=this.containerPointToLayerPoint(r.point(n));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(n){return this.layerPointToContainerPoint(this.latLngToLayerPoint(r.latLng(n)))},mouseEventToContainerPoint:function(n){return r.DomEvent.getMousePosition(n,this._container)},mouseEventToLayerPoint:function(n){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(n))},mouseEventToLatLng:function(n){return this.layerPointToLatLng(this.mouseEventToLayerPoint(n))},_initContainer:function(n){var t=this._container=r.DomUtil.get(n);if(t){if(t._leaflet)throw new Error("Map container is already initialized.");}else throw new Error("Map container not found.");r.DomEvent.addListener(t,"scroll",this._onScroll,this);t._leaflet=!0},_initLayout:function(){var t=this._container,n;this._fadeAnimated=this.options.fadeAnimation&&r.Browser.any3d;r.DomUtil.addClass(t,"leaflet-container"+(r.Browser.touch?" leaflet-touch":"")+(r.Browser.retina?" leaflet-retina":"")+(r.Browser.ielt9?" leaflet-oldie":"")+(r.Browser.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));n=r.DomUtil.getStyle(t,"position");n!=="absolute"&&n!=="relative"&&n!=="fixed"&&(t.style.position="relative");this._initPanes();this._initControlPos&&this._initControlPos()},_initPanes:function(){var n=this._panes={};this._paneRenderers={};this._mapPane=this.createPane("mapPane",this._container);r.DomUtil.setPosition(this._mapPane,new r.Point(0,0));this.createPane("tilePane");this.createPane("shadowPane");this.createPane("overlayPane");this.createPane("markerPane");this.createPane("popupPane");this.options.markerZoomAnimation||(r.DomUtil.addClass(n.markerPane,"leaflet-zoom-hide"),r.DomUtil.addClass(n.shadowPane,"leaflet-zoom-hide"))},_resetView:function(n,t){var u,i;r.DomUtil.setPosition(this._mapPane,new r.Point(0,0));u=!this._loaded;this._loaded=!0;t=this._limitZoom(t);this.fire("viewprereset");i=this._zoom!==t;this._moveStart(i)._move(n,t)._moveEnd(i);this.fire("viewreset");u&&this.fire("load")},_moveStart:function(n){return n&&this.fire("zoomstart"),this.fire("movestart")},_move:function(n,t,r){t===i&&(t=this._zoom);var u=this._zoom!==t;return this._zoom=t,this._lastCenter=n,this._pixelOrigin=this._getNewPixelOrigin(n),(u||r&&r.pinch)&&this.fire("zoom",r),this.fire("move",r)},_moveEnd:function(n){return n&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return r.Util.cancelAnimFrame(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(n){r.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(n))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.");},_initEvents:function(t){if(r.DomEvent){this._targets={};this._targets[r.stamp(this._container)]=this;var i=t?"off":"on";r.DomEvent[i](this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this);this.options.trackResize&&r.DomEvent[i](n,"resize",this._onResize,this);r.Browser.any3d&&this.options.transform3DLimit&&this[i]("moveend",this._onMoveEnd)}},_onResize:function(){r.Util.cancelAnimFrame(this._resizeRequest);this._resizeRequest=r.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0;this._container.scrollLeft=0},_onMoveEnd:function(){var n=this._getMapPanePos();Math.max(Math.abs(n.x),Math.abs(n.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(n,t){for(var f=[],u,e=t==="mouseout"||t==="mouseover",i=n.target||n.srcElement,o=!1;i;){if(u=this._targets[r.stamp(i)],u&&(t==="click"||t==="preclick")&&!n._simulated&&this._draggableMoved(u)){o=!0;break}if(u&&u.listens(t,!0)){if(e&&!r.DomEvent._isExternalTarget(i,n))break;if(f.push(u),e)break}if(i===this._container)break;i=i.parentNode}return f.length||o||e||!r.DomEvent._isExternalTarget(i,n)||(f=[this]),f},_handleDOMEvent:function(n){var t,i;this._loaded&&!r.DomEvent._skipped(n)&&(t=n.type==="keypress"&&n.keyCode===13?"click":n.type,n.type==="click"&&(i=r.Util.extend({},n),i.type="preclick",this._handleDOMEvent(i)),t==="mousedown"&&r.DomUtil.preventOutline(n.target||n.srcElement),this._fireDOMEvent(n,t))},_fireDOMEvent:function(n,t,i){var e,u,o,f;if(!n._stopped&&(i=(i||[]).concat(this._findEventTargets(n,t)),i.length))for(e=i[0],t==="contextmenu"&&e.listens(t,!0)&&r.DomEvent.preventDefault(n),u={originalEvent:n},n.type!=="keypress"&&(o=e instanceof r.Marker,u.containerPoint=o?this.latLngToContainerPoint(e.getLatLng()):this.mouseEventToContainerPoint(n),u.layerPoint=this.containerPointToLayerPoint(u.containerPoint),u.latlng=o?e.getLatLng():this.layerPointToLatLng(u.layerPoint)),f=0;f<i.length;f++)if(i[f].fire(t,u,!0),u.originalEvent._stopped||i[f].options.nonBubblingEvents&&r.Util.indexOf(i[f].options.nonBubblingEvents,t)!==-1)return},_draggableMoved:function(n){return n=n.options.draggable?n:this,n.dragging&&n.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var n=0,t=this._handlers.length;n<t;n++)this._handlers[n].disable()},whenReady:function(n,t){if(this._loaded)n.call(t||this,{target:this});else this.on("load",n,t);return this},_getMapPanePos:function(){return r.DomUtil.getPosition(this._mapPane)||new r.Point(0,0)},_moved:function(){var n=this._getMapPanePos();return n&&!n.equals([0,0])},_getTopLeftPoint:function(n,t){var r=n&&t!==i?this._getNewPixelOrigin(n,t):this.getPixelOrigin();return r.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(n,t){var i=this.getSize()._divideBy(2);return this.project(n,t)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(n,t,i){var r=this._getNewPixelOrigin(i,t);return this.project(n,t)._subtract(r)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(n){return this.latLngToLayerPoint(n).subtract(this._getCenterLayerPoint())},_limitCenter:function(n,t,i){if(!i)return n;var u=this.project(n,t),f=this.getSize().divideBy(2),o=new r.Bounds(u.subtract(f),u.add(f)),e=this._getBoundsOffset(o,i,t);return e.round().equals([0,0])?n:this.unproject(u.add(e),t)},_limitOffset:function(n,t){if(!t)return n;var i=this.getPixelBounds(),u=new r.Bounds(i.min.add(n),i.max.add(n));return n.add(this._getBoundsOffset(u,t))},_getBoundsOffset:function(n,t,i){var u=r.bounds(this.project(t.getNorthEast(),i),this.project(t.getSouthWest(),i)),f=u.min.subtract(n.min),e=u.max.subtract(n.max),o=this._rebound(f.x,-e.x),s=this._rebound(f.y,-e.y);return new r.Point(o,s)},_rebound:function(n,t){return n+t>0?Math.round(n-t)/2:Math.max(0,Math.ceil(n))-Math.max(0,Math.floor(t))},_limitZoom:function(n){var i=this.getMinZoom(),u=this.getMaxZoom(),t=r.Browser.any3d?this.options.zoomSnap:1;return t&&(n=Math.round(n/t)*t),Math.max(i,Math.min(u,n))}});r.map=function(n,t){return new r.Map(n,t)};r.Layer=r.Evented.extend({options:{pane:"overlayPane",nonBubblingEvents:[]},addTo:function(n){return n.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(n){return n&&n.removeLayer(this),this},getPane:function(n){return this._map.getPane(n?this.options[n]||n:this.options.pane)},addInteractiveTarget:function(n){return this._map._targets[r.stamp(n)]=this,this},removeInteractiveTarget:function(n){return delete this._map._targets[r.stamp(n)],this},_layerAdd:function(n){var t=n.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents)t.on(this.getEvents(),this);this.onAdd(t);this.getAttribution&&this._map.attributionControl&&this._map.attributionControl.addAttribution(this.getAttribution());this.fire("add");t.fire("layeradd",{layer:this})}}});r.Map.include({addLayer:function(n){var t=r.stamp(n);return this._layers[t]?n:(this._layers[t]=n,n._mapToAdd=this,n.beforeAdd&&n.beforeAdd(this),this.whenReady(n._layerAdd,n),this)},removeLayer:function(n){var t=r.stamp(n);if(!this._layers[t])return this;if(this._loaded)n.onRemove(this);return n.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(n.getAttribution()),n.getEvents&&this.off(n.getEvents(),n),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:n}),n.fire("remove")),n._map=n._mapToAdd=null,this},hasLayer:function(n){return!!n&&r.stamp(n)in this._layers},eachLayer:function(n,t){for(var i in this._layers)n.call(t,this._layers[i]);return this},_addLayers:function(n){n=n?r.Util.isArray(n)?n:[n]:[];for(var t=0,i=n.length;t<i;t++)this.addLayer(n[t])},_addZoomLimit:function(n){(isNaN(n.options.maxZoom)||!isNaN(n.options.minZoom))&&(this._zoomBoundLayers[r.stamp(n)]=n,this._updateZoomLevels())},_removeZoomLimit:function(n){var t=r.stamp(n);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var n=Infinity,t=-Infinity,f=this._getZoomSpan(),u,r;for(u in this._zoomBoundLayers)r=this._zoomBoundLayers[u].options,n=r.minZoom===i?n:Math.min(n,r.minZoom),t=r.maxZoom===i?t:Math.max(t,r.maxZoom);this._layersMaxZoom=t===-Infinity?i:t;this._layersMinZoom=n===Infinity?i:n;f!==this._getZoomSpan()&&this.fire("zoomlevelschange")}});r.Projection.Mercator={R:6378137,R_MINOR:6356752.3142451793,bounds:r.bounds([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(n){var u=Math.PI/180,i=this.R,t=n.lat*u,f=this.R_MINOR/i,e=Math.sqrt(1-f*f),o=e*Math.sin(t),s=Math.tan(Math.PI/4-t/2)/Math.pow((1-o)/(1+o),e/2);return t=-i*Math.log(Math.max(s,1e-10)),new r.Point(n.lng*u*i,t)},unproject:function(n){for(var o=180/Math.PI,f=this.R,s=this.R_MINOR/f,h=Math.sqrt(1-s*s),c=Math.exp(-n.y/f),i=Math.PI/2-2*Math.atan(c),t,e=0,u=.1;e<15&&Math.abs(u)>1e-7;e++)t=h*Math.sin(i),t=Math.pow((1-t)/(1+t),h/2),u=Math.PI/2-2*Math.atan(c*t)-i,i+=u;return new r.LatLng(i*o,n.x*o/f)}};r.CRS.EPSG3395=r.extend({},r.CRS.Earth,{code:"EPSG:3395",projection:r.Projection.Mercator,transformation:function(){var n=.5/(Math.PI*r.Projection.Mercator.R);return new r.Transformation(n,.5,-n,.5)}()});r.GridLayer=r.Layer.extend({options:{tileSize:256,opacity:1,updateWhenIdle:r.Browser.mobile,updateInterval:200,attribution:null,zIndex:1,bounds:null,minZoom:0,noWrap:!1,pane:"tilePane"},initialize:function(n){n=r.setOptions(this,n)},onAdd:function(){this._initContainer();this._levels={};this._tiles={};this._resetView();this._update()},beforeAdd:function(n){n._addZoomLimit(this)},onRemove:function(n){this._removeAllTiles();r.DomUtil.remove(this._container);n._removeZoomLimit(this);this._container=null;this._tileZoom=null},bringToFront:function(){return this._map&&(r.DomUtil.toFront(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(r.DomUtil.toBack(this._container),this._setAutoZIndex(Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(n){return this.options.opacity=n,this._updateOpacity(),this},setZIndex:function(n){return this.options.zIndex=n,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var n={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=r.Util.throttle(this._onMoveEnd,this.options.updateInterval,this)),n.move=this._onMove),this._zoomAnimated&&(n.zoomanim=this._animateZoom),n},createTile:function(){return t.createElement("div")},getTileSize:function(){var n=this.options.tileSize;return n instanceof r.Point?n:new r.Point(n,n)},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(n){for(var r=this.getPane().children,i=-n(-Infinity,Infinity),u,t=0,f=r.length;t<f;t++)u=r[t].style.zIndex,r[t]!==this._container&&u&&(i=n(i,+u));isFinite(i)&&(this.options.zIndex=i+n(-1,1),this._updateZIndex())},_updateOpacity:function(){var f,n,t;if(this._map&&!r.Browser.ielt9){r.DomUtil.setOpacity(this._container,this.options.opacity);var e=+new Date,i=!1,u=!1;for(f in this._tiles)(n=this._tiles[f],n.current&&n.loaded)&&(t=Math.min(1,(e-n.loaded)/200),r.DomUtil.setOpacity(n.el,t),t<1?i=!0:(n.active&&(u=!0),n.active=!0));u&&!this._noPrune&&this._pruneTiles();i&&(r.Util.cancelAnimFrame(this._fadeFrame),this._fadeFrame=r.Util.requestAnimFrame(this._updateOpacity,this))}},_initContainer:function(){this._container||(this._container=r.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var u=this._tileZoom,e=this.options.maxZoom,t,n,f;if(u===i)return i;for(t in this._levels)this._levels[t].el.children.length||t===u?this._levels[t].el.style.zIndex=e-Math.abs(u-t):(r.DomUtil.remove(this._levels[t].el),this._removeTilesAtZoom(t),delete this._levels[t]);return n=this._levels[u],f=this._map,n||(n=this._levels[u]={},n.el=r.DomUtil.create("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=f.project(f.unproject(f.getPixelOrigin()),u).round(),n.zoom=u,this._setZoomTransform(n,f.getCenter(),f.getZoom()),r.Util.falseFn(n.el.offsetWidth)),this._level=n,n},_pruneTiles:function(){var t,i,r,n;if(this._map){if(r=this._map.getZoom(),r>this.options.maxZoom||r<this.options.minZoom){this._removeAllTiles();return}for(t in this._tiles)i=this._tiles[t],i.retain=i.current;for(t in this._tiles)i=this._tiles[t],i.current&&!i.active&&(n=i.coords,this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2));for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(n){for(var t in this._tiles)this._tiles[t].coords.z===n&&this._removeTile(t)},_removeAllTiles:function(){for(var n in this._tiles)this._removeTile(n)},_invalidateAll:function(){for(var n in this._levels)r.DomUtil.remove(this._levels[n].el),delete this._levels[n];this._removeAllTiles();this._tileZoom=null},_retainParent:function(n,t,i,u){var o=Math.floor(n/2),s=Math.floor(t/2),e=i-1,h=new r.Point(+o,+s),c,f;return(h.z=+e,c=this._tileCoordsToKey(h),f=this._tiles[c],f&&f.active)?(f.retain=!0,!0):(f&&f.loaded&&(f.retain=!0),e>u)?this._retainParent(o,s,e,u):!1},_retainChildren:function(n,t,i,u){for(var o,s,h,f,e=2*n;e<2*n+2;e++)for(o=2*t;o<2*t+2;o++){if(s=new r.Point(e,o),s.z=i+1,h=this._tileCoordsToKey(s),f=this._tiles[h],f&&f.active){f.retain=!0;continue}else f&&f.loaded&&(f.retain=!0);i+1<u&&this._retainChildren(e,o,i+1,u)}},_resetView:function(n){var t=n&&(n.pinch||n.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(n){this._setView(n.center,n.zoom,!0,n.noUpdate)},_setView:function(n,t,r,u){var f=Math.round(t),e;(this.options.maxZoom!==i&&f>this.options.maxZoom||this.options.minZoom!==i&&f<this.options.minZoom)&&(f=i);e=f!==this._tileZoom;(!u||e)&&(this._tileZoom=f,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),f!==i&&this._update(n),r||this._pruneTiles(),this._noPrune=!!r);this._setZoomTransforms(n,t)},_setZoomTransforms:function(n,t){for(var i in this._levels)this._setZoomTransform(this._levels[i],n,t)},_setZoomTransform:function(n,t,i){var u=this._map.getZoomScale(i,n.zoom),f=n.origin.multiplyBy(u).subtract(this._map._getNewPixelOrigin(t,i)).round();r.Browser.any3d?r.DomUtil.setTransform(n.el,f,u):r.DomUtil.setPosition(n.el,f)},_resetGrid:function(){var t=this._map,n=t.options.crs,i=this._tileSize=this.getTileSize(),r=this._tileZoom,u=this._map.getPixelWorldBounds(this._tileZoom);u&&(this._globalTileRange=this._pxBoundsToTileRange(u));this._wrapX=n.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,n.wrapLng[0]],r).x/i.x),Math.ceil(t.project([0,n.wrapLng[1]],r).x/i.y)];this._wrapY=n.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([n.wrapLat[0],0],r).y/i.x),Math.ceil(t.project([n.wrapLat[1],0],r).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._resetView()},_getTiledPixelBounds:function(n){var t=this._map,f=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),e=t.getZoomScale(f,this._tileZoom),i=t.project(n,this._tileZoom).floor(),u=t.getSize().divideBy(e*2);return new r.Bounds(i.subtract(u),i.add(u))},_update:function(n){var h=this._map,c,y,s,u,o,l,a;if(h&&(c=h.getZoom(),n===i&&(n=h.getCenter()),this._tileZoom!==i)){var p=this._getTiledPixelBounds(n),f=this._pxBoundsToTileRange(p),v=f.getCenter(),e=[];for(y in this._tiles)this._tiles[y].current=!1;if(Math.abs(c-this._tileZoom)>1){this._setView(n,c);return}for(s=f.min.y;s<=f.max.y;s++)for(u=f.min.x;u<=f.max.x;u++)(o=new r.Point(u,s),o.z=this._tileZoom,this._isValidTile(o))&&(l=this._tiles[this._tileCoordsToKey(o)],l?l.current=!0:e.push(o));if(e.sort(function(n,t){return n.distanceTo(v)-t.distanceTo(v)}),e.length!==0){for(this._loading||(this._loading=!0,this.fire("loading")),a=t.createDocumentFragment(),u=0;u<e.length;u++)this._addTile(e[u],a);this._level.el.appendChild(a)}}},_isValidTile:function(n){var i=this._map.options.crs,t,u;return!i.infinite&&(t=this._globalTileRange,!i.wrapLng&&(n.x<t.min.x||n.x>t.max.x)||!i.wrapLat&&(n.y<t.min.y||n.y>t.max.y))?!1:this.options.bounds?(u=this._tileCoordsToBounds(n),r.latLngBounds(this.options.bounds).overlaps(u)):!0},_keyToBounds:function(n){return this._tileCoordsToBounds(this._keyToTileCoords(n))},_tileCoordsToBounds:function(n){var t=this._map,i=this.getTileSize(),u=n.scaleBy(i),f=u.add(i),e=t.wrapLatLng(t.unproject(u,n.z)),o=t.wrapLatLng(t.unproject(f,n.z));return new r.LatLngBounds(e,o)},_tileCoordsToKey:function(n){return n.x+":"+n.y+":"+n.z},_keyToTileCoords:function(n){var t=n.split(":"),i=new r.Point(+t[0],+t[1]);return i.z=+t[2],i},_removeTile:function(n){var t=this._tiles[n];t&&(r.DomUtil.remove(t.el),delete this._tiles[n],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(n)}))},_initTile:function(n){r.DomUtil.addClass(n,"leaflet-tile");var t=this.getTileSize();n.style.width=t.x+"px";n.style.height=t.y+"px";n.onselectstart=r.Util.falseFn;n.onmousemove=r.Util.falseFn;r.Browser.ielt9&&this.options.opacity<1&&r.DomUtil.setOpacity(n,this.options.opacity);r.Browser.android&&!r.Browser.android23&&(n.style.WebkitBackfaceVisibility="hidden")},_addTile:function(n,t){var u=this._getTilePos(n),f=this._tileCoordsToKey(n),i=this.createTile(this._wrapCoords(n),r.bind(this._tileReady,this,n));this._initTile(i);this.createTile.length<2&&r.Util.requestAnimFrame(r.bind(this._tileReady,this,n,null,i));r.DomUtil.setPosition(i,u);this._tiles[f]={el:i,coords:n,current:!0};t.appendChild(i);this.fire("tileloadstart",{tile:i,coords:n})},_tileReady:function(n,t,i){if(this._map){t&&this.fire("tileerror",{error:t,tile:i,coords:n});var u=this._tileCoordsToKey(n);(i=this._tiles[u],i)&&(i.loaded=+new Date,this._map._fadeAnimated?(r.DomUtil.setOpacity(i.el,0),r.Util.cancelAnimFrame(this._fadeFrame),this._fadeFrame=r.Util.requestAnimFrame(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),r.DomUtil.addClass(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:n}),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),r.Browser.ielt9||!this._map._fadeAnimated?r.Util.requestAnimFrame(this._pruneTiles,this):setTimeout(r.bind(this._pruneTiles,this),250)))}},_getTilePos:function(n){return n.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(n){var t=new r.Point(this._wrapX?r.Util.wrapNum(n.x,this._wrapX):n.x,this._wrapY?r.Util.wrapNum(n.y,this._wrapY):n.y);return t.z=n.z,t},_pxBoundsToTileRange:function(n){var t=this.getTileSize();return new r.Bounds(n.min.unscaleBy(t).floor(),n.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var n in this._tiles)if(!this._tiles[n].loaded)return!1;return!0}});r.gridLayer=function(n){return new r.GridLayer(n)};r.TileLayer=r.GridLayer.extend({options:{minZoom:0,maxZoom:18,maxNativeZoom:null,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(n,t){if(this._url=n,t=r.setOptions(this,t),t.detectRetina&&r.Browser.retina&&t.maxZoom>0&&(t.tileSize=Math.floor(t.tileSize/2),t.zoomOffset++,t.minZoom=Math.max(0,t.minZoom),t.maxZoom--),typeof t.subdomains=="string"&&(t.subdomains=t.subdomains.split("")),!r.Browser.android)this.on("tileunload",this._onTileRemove)},setUrl:function(n,t){return this._url=n,t||this.redraw(),this},createTile:function(n,i){var u=t.createElement("img");r.DomEvent.on(u,"load",r.bind(this._tileOnLoad,this,i,u));r.DomEvent.on(u,"error",r.bind(this._tileOnError,this,i,u));return this.options.crossOrigin&&(u.crossOrigin=""),u.alt="",u.src=this.getTileUrl(n),u},getTileUrl:function(n){var t={r:r.Browser.retina?"@2x":"",s:this._getSubdomain(n),x:n.x,y:n.y,z:this._getZoomForUrl()},i;return this._map&&!this._map.options.crs.infinite&&(i=this._globalTileRange.max.y-n.y,this.options.tms&&(t.y=i),t["-y"]=i),r.Util.template(this._url,r.extend(t,this.options))},_tileOnLoad:function(n,t){r.Browser.ielt9?setTimeout(r.bind(n,this,null,t),0):n(null,t)},_tileOnError:function(n,t,i){var r=this.options.errorTileUrl;r&&(t.src=r);n(i,t)},getTileSize:function(){var u=this._map,t=r.GridLayer.prototype.getTileSize.call(this),i=this._tileZoom+this.options.zoomOffset,n=this.options.maxNativeZoom;return n!==null&&i>n?t.divideBy(u.getZoomScale(n,i)).round():t},_onTileRemove:function(n){n.tile.onload=null},_getZoomForUrl:function(){var n=this.options,t=this._tileZoom;return n.zoomReverse&&(t=n.maxZoom-t),t+=n.zoomOffset,n.maxNativeZoom!==null?Math.min(t,n.maxNativeZoom):t},_getSubdomain:function(n){var t=Math.abs(n.x+n.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var t,n;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&(n=this._tiles[t].el,n.onload=r.Util.falseFn,n.onerror=r.Util.falseFn,n.complete||(n.src=r.Util.emptyImageUrl,r.DomUtil.remove(n)))}});r.tileLayer=function(n,t){return new r.TileLayer(n,t)};r.TileLayer.WMS=r.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(n,t){var i,u;this._url=n;i=r.extend({},this.defaultWmsParams);for(u in t)u in this.options||(i[u]=t[u]);t=r.setOptions(this,t);i.width=i.height=t.tileSize*(t.detectRetina&&r.Browser.retina?2:1);this.wmsParams=i},onAdd:function(n){this._crs=this.options.crs||n.options.crs;this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code;r.TileLayer.prototype.onAdd.call(this,n)},getTileUrl:function(n){var u=this._tileCoordsToBounds(n),t=this._crs.project(u.getNorthWest()),i=this._crs.project(u.getSouthEast()),e=(this._wmsVersion>=1.3&&this._crs===r.CRS.EPSG4326?[i.y,t.x,t.y,i.x]:[t.x,i.y,i.x,t.y]).join(","),f=r.TileLayer.prototype.getTileUrl.call(this,n);return f+r.Util.getParamString(this.wmsParams,f,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+e},setParams:function(n,t){return r.extend(this.wmsParams,n),t||this.redraw(),this}});r.tileLayer.wms=function(n,t){return new r.TileLayer.WMS(n,t)};r.ImageOverlay=r.Layer.extend({options:{opacity:1,alt:"",interactive:!1,attribution:null},initialize:function(n,t,i){this._url=n;this._bounds=r.latLngBounds(t);r.setOptions(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity());this.options.interactive&&(r.DomUtil.addClass(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image));this.getPane().appendChild(this._image);this._reset()},onRemove:function(){r.DomUtil.remove(this._image);this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(n){return this.options.opacity=n,this._image&&this._updateOpacity(),this},setStyle:function(n){return n.opacity&&this.setOpacity(n.opacity),this},bringToFront:function(){return this._map&&r.DomUtil.toFront(this._image),this},bringToBack:function(){return this._map&&r.DomUtil.toBack(this._image),this},setUrl:function(n){return this._url=n,this._image&&(this._image.src=n),this},setBounds:function(n){return this._bounds=n,this._map&&this._reset(),this},getAttribution:function(){return this.options.attribution},getEvents:function(){var n={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(n.zoomanim=this._animateZoom),n},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var n=this._image=r.DomUtil.create("img","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":""));n.onselectstart=r.Util.falseFn;n.onmousemove=r.Util.falseFn;n.onload=r.bind(this.fire,this,"load");this.options.crossOrigin&&(n.crossOrigin="");n.src=this._url;n.alt=this.options.alt},_animateZoom:function(n){var t=this._map.getZoomScale(n.zoom),i=this._map._latLngToNewLayerPoint(this._bounds.getNorthWest(),n.zoom,n.center);r.DomUtil.setTransform(this._image,i,t)},_reset:function(){var n=this._image,t=new r.Bounds(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=t.getSize();r.DomUtil.setPosition(n,t.min);n.style.width=i.x+"px";n.style.height=i.y+"px"},_updateOpacity:function(){r.DomUtil.setOpacity(this._image,this.options.opacity)}});r.imageOverlay=function(n,t,i){return new r.ImageOverlay(n,t,i)};r.Icon=r.Class.extend({initialize:function(n){r.setOptions(this,n)},createIcon:function(n){return this._createIcon("icon",n)},createShadow:function(n){return this._createIcon("shadow",n)},_createIcon:function(n,t){var r=this._getIconUrl(n),i;if(!r){if(n==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}return i=this._createImg(r,t&&t.tagName==="IMG"?t:null),this._setIconStyles(i,n),i},_setIconStyles:function(n,t){var u=this.options,i=r.point(u[t+"Size"]),f=r.point(t==="shadow"&&u.shadowAnchor||u.iconAnchor||i&&i.divideBy(2,!0));n.className="leaflet-marker-"+t+" "+(u.className||"");f&&(n.style.marginLeft=-f.x+"px",n.style.marginTop=-f.y+"px");i&&(n.style.width=i.x+"px",n.style.height=i.y+"px")},_createImg:function(n,i){return i=i||t.createElement("img"),i.src=n,i},_getIconUrl:function(n){return r.Browser.retina&&this.options[n+"RetinaUrl"]||this.options[n+"Url"]}});r.icon=function(n){return new r.Icon(n)};r.Icon.Default=r.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(n){var i=n+"Url",t;if(this.options[i])return this.options[i];if(t=r.Icon.Default.imagePath,!t)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return t+"/marker-"+n+(r.Browser.retina&&n==="icon"?"-2x":"")+".png"}});r.Icon.Default.imagePath=function(){for(var u=t.getElementsByTagName("script"),f=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/,i,r,n=0,e=u.length;n<e;n++)if(i=u[n].src||"",i.match(f))return r=i.split(f)[0],(r?r+"/":"")+"images"}();r.Marker=r.Layer.extend({options:{icon:new r.Icon.Default,interactive:!0,draggable:!1,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",nonBubblingEvents:["click","dblclick","mouseover","mouseout","contextmenu"]},initialize:function(n,t){r.setOptions(this,t);this._latlng=r.latLng(n)},onAdd:function(n){this._zoomAnimated=this._zoomAnimated&&n.options.markerZoomAnimation;this._initIcon();this.update()},onRemove:function(){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks());this._removeIcon();this._removeShadow()},getEvents:function(){var n={zoom:this.update,viewreset:this.update};return this._zoomAnimated&&(n.zoomanim=this._animateZoom),n},getLatLng:function(){return this._latlng},setLatLng:function(n){var t=this._latlng;return this._latlng=r.latLng(n),this.update(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(n){return this.options.zIndexOffset=n,this.update()},setIcon:function(n){return this.options.icon=n,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon){var n=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(n)}return this},_initIcon:function(){var n=this.options,f="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),t=n.icon.createIcon(this._icon),e=!1,i,u;if(t!==this._icon&&(this._icon&&this._removeIcon(),e=!0,n.title&&(t.title=n.title),n.alt&&(t.alt=n.alt)),r.DomUtil.addClass(t,f),n.keyboard&&(t.tabIndex="0"),this._icon=t,n.riseOnHover)this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});i=n.icon.createShadow(this._shadow);u=!1;i!==this._shadow&&(this._removeShadow(),u=!0);i&&r.DomUtil.addClass(i,f);this._shadow=i;n.opacity<1&&this._updateOpacity();e&&this.getPane().appendChild(this._icon);this._initInteraction();i&&u&&this.getPane("shadowPane").appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex});r.DomUtil.remove(this._icon);this.removeInteractiveTarget(this._icon);this._icon=null},_removeShadow:function(){this._shadow&&r.DomUtil.remove(this._shadow);this._shadow=null},_setPos:function(n){r.DomUtil.setPosition(this._icon,n);this._shadow&&r.DomUtil.setPosition(this._shadow,n);this._zIndex=n.y+this.options.zIndexOffset;this._resetZIndex()},_updateZIndex:function(n){this._icon.style.zIndex=this._zIndex+n},_animateZoom:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(r.DomUtil.addClass(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),r.Handler.MarkerDrag)){var n=this.options.draggable;this.dragging&&(n=this.dragging.enabled(),this.dragging.disable());this.dragging=new r.Handler.MarkerDrag(this);n&&this.dragging.enable()}},setOpacity:function(n){return this.options.opacity=n,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var n=this.options.opacity;r.DomUtil.setOpacity(this._icon,n);this._shadow&&r.DomUtil.setOpacity(this._shadow,n)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}});r.marker=function(n,t){return new r.Marker(n,t)};r.DivIcon=r.Icon.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(n){var i=n&&n.tagName==="DIV"?n:t.createElement("div"),u=this.options,f;return i.innerHTML=u.html!==!1?u.html:"",u.bgPos&&(f=r.point(u.bgPos),i.style.backgroundPosition=-f.x+"px "+-f.y+"px"),this._setIconStyles(i,"icon"),i},createShadow:function(){return null}});r.divIcon=function(n){return new r.DivIcon(n)};r.Map.mergeOptions({closePopupOnClick:!0});r.Popup=r.Layer.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,offset:[0,7],autoClose:!0,zoomAnimation:!0,className:"",pane:"popupPane"},initialize:function(n,t){r.setOptions(this,n);this._source=t},onAdd:function(n){if(this._zoomAnimated=this._zoomAnimated&&this.options.zoomAnimation,this._container||this._initLayout(),n._fadeAnimated&&r.DomUtil.setOpacity(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),n._fadeAnimated&&r.DomUtil.setOpacity(this._container,1),n.fire("popupopen",{popup:this}),this._source){this._source.fire("popupopen",{popup:this},!0);this._source.on("preclick",r.DomEvent.stopPropagation)}},openOn:function(n){return n.openPopup(this),this},onRemove:function(n){n._fadeAnimated?(r.DomUtil.setOpacity(this._container,0),this._removeTimeout=setTimeout(r.bind(r.DomUtil.remove,r.DomUtil,this._container),200)):r.DomUtil.remove(this._container);n.fire("popupclose",{popup:this});this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source.off("preclick",r.DomEvent.stopPropagation))},getLatLng:function(){return this._latlng},setLatLng:function(n){return this._latlng=r.latLng(n),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(n){return this._content=n,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var n={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(n.zoomanim=this._animateZoom),("closeOnClick"in this.options?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(n.preclick=this._close),this.options.keepInView&&(n.moveend=this._adjustPan),n},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&r.DomUtil.toFront(this._container),this},bringToBack:function(){return this._map&&r.DomUtil.toBack(this._container),this},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var n="leaflet-popup",u=this._container=r.DomUtil.create("div",n+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide")),t,i;if(this.options.closeButton){t=this._closeButton=r.DomUtil.create("a",n+"-close-button",u);t.href="#close";t.innerHTML="&#215;";r.DomEvent.on(t,"click",this._onCloseButtonClick,this)}i=this._wrapper=r.DomUtil.create("div",n+"-content-wrapper",u);this._contentNode=r.DomUtil.create("div",n+"-content",i);r.DomEvent.disableClickPropagation(i).disableScrollPropagation(this._contentNode).on(i,"contextmenu",r.DomEvent.stopPropagation);this._tipContainer=r.DomUtil.create("div",n+"-tip-container",u);this._tip=r.DomUtil.create("div",n+"-tip",this._tipContainer)},_updateContent:function(){if(this._content){var n=this._contentNode,t=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof t=="string")n.innerHTML=t;else{while(n.hasChildNodes())n.removeChild(n.firstChild);n.appendChild(t)}this.fire("contentupdate")}},_updateLayout:function(){var i=this._contentNode,n=i.style,t;n.width="";n.whiteSpace="nowrap";t=i.offsetWidth;t=Math.min(t,this.options.maxWidth);t=Math.max(t,this.options.minWidth);n.width=t+1+"px";n.whiteSpace="";n.height="";var e=i.offsetHeight,u=this.options.maxHeight,f="leaflet-popup-scrolled";u&&e>u?(n.height=u+"px",r.DomUtil.addClass(i,f)):r.DomUtil.removeClass(i,f);this._containerWidth=this._container.offsetWidth},_updatePosition:function(){var t,n,i,u;this._map&&(t=this._map.latLngToLayerPoint(this._latlng),n=r.point(this.options.offset),this._zoomAnimated?r.DomUtil.setPosition(this._container,t):n=n.add(t),i=this._containerBottom=-n.y,u=this._containerLeft=-Math.round(this._containerWidth/2)+n.x,this._container.style.bottom=i+"px",this._container.style.left=u+"px")},_animateZoom:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center);r.DomUtil.setPosition(this._container,t)},_adjustPan:function(){if(this.options.autoPan&&(!this._map._panAnim||!this._map._panAnim._inProgress)){var o=this._map,s=this._container.offsetHeight,h=this._containerWidth,c=new r.Point(this._containerLeft,-s-this._containerBottom);this._zoomAnimated&&c._add(r.DomUtil.getPosition(this._container));var n=o.layerPointToContainerPoint(c),l=r.point(this.options.autoPanPadding),u=r.point(this.options.autoPanPaddingTopLeft||l),f=r.point(this.options.autoPanPaddingBottomRight||l),e=o.getSize(),t=0,i=0;n.x+h+f.x>e.x&&(t=n.x+h-e.x+f.x);n.x-t-u.x<0&&(t=n.x-u.x);n.y+s+f.y>e.y&&(i=n.y+s-e.y+f.y);n.y-i-u.y<0&&(i=n.y-u.y);(t||i)&&o.fire("autopanstart").panBy([t,i])}},_onCloseButtonClick:function(n){this._close();r.DomEvent.stop(n)}});r.popup=function(n,t){return new r.Popup(n,t)};r.Map.include({openPopup:function(n,t,i){return(n instanceof r.Popup||(n=new r.Popup(i).setContent(n)),t&&n.setLatLng(t),this.hasLayer(n))?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=n,this.addLayer(n))},closePopup:function(n){return n&&n!==this._popup||(n=this._popup,this._popup=null),n&&this.removeLayer(n),this}});r.Layer.include({bindPopup:function(n,t){if(n instanceof r.Popup?(r.setOptions(n,t),this._popup=n,n._source=this):((!this._popup||t)&&(this._popup=new r.Popup(t,this)),this._popup.setContent(n)),!this._popupHandlersAdded){this.on({click:this._openPopup,remove:this.closePopup,move:this._movePopup});this._popupHandlersAdded=!0}return this._originalPopupOffset=this._popup.options.offset,this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(n,t){if(n instanceof r.Layer||(t=n,n=this),n instanceof r.FeatureGroup)for(var i in this._layers){n=this._layers[i];break}return t||(t=n.getCenter?n.getCenter():n.getLatLng()),this._popup&&this._map&&(this._popup.options.offset=this._popupAnchor(n),this._popup._source=n,this._popup.update(),this._map.openPopup(this._popup,t)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(n){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(n)),this},isPopupOpen:function(){return this._popup.isOpen()},setPopupContent:function(n){return this._popup&&this._popup.setContent(n),this},getPopup:function(){return this._popup},_openPopup:function(n){var t=n.layer||n.target;if(this._popup&&this._map){if(t instanceof r.Path){this.openPopup(n.layer||n.target,n.latlng);return}this._map.hasLayer(this._popup)&&this._popup._source===t?this.closePopup():this.openPopup(t,n.latlng)}},_popupAnchor:function(n){var t=n._getPopupAnchor?n._getPopupAnchor():[0,0],i=this._originalPopupOffset||r.Popup.prototype.options.offset;return r.point(t).add(i)},_movePopup:function(n){this._popup.setLatLng(n.latlng)}});r.Marker.include({_getPopupAnchor:function(){return this.options.icon.options.popupAnchor||[0,0]}});r.LayerGroup=r.Layer.extend({initialize:function(n){this._layers={};var t,i;if(n)for(t=0,i=n.length;t<i;t++)this.addLayer(n[t])},addLayer:function(n){var t=this.getLayerId(n);return this._layers[t]=n,this._map&&this._map.addLayer(n),this},removeLayer:function(n){var t=n in this._layers?n:this.getLayerId(n);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(n){return!!n&&(n in this._layers||this.getLayerId(n)in this._layers)},clearLayers:function(){for(var n in this._layers)this.removeLayer(this._layers[n]);return this},invoke:function(n){var r=Array.prototype.slice.call(arguments,1),i,t;for(i in this._layers)t=this._layers[i],t[n]&&t[n].apply(t,r);return this},onAdd:function(n){for(var t in this._layers)n.addLayer(this._layers[t])},onRemove:function(n){for(var t in this._layers)n.removeLayer(this._layers[t])},eachLayer:function(n,t){for(var i in this._layers)n.call(t,this._layers[i]);return this},getLayer:function(n){return this._layers[n]},getLayers:function(){var n=[],t;for(t in this._layers)n.push(this._layers[t]);return n},setZIndex:function(n){return this.invoke("setZIndex",n)},getLayerId:function(n){return r.stamp(n)}});r.layerGroup=function(n){return new r.LayerGroup(n)};r.FeatureGroup=r.LayerGroup.extend({addLayer:function(n){return this.hasLayer(n)?this:(n.addEventParent(this),r.LayerGroup.prototype.addLayer.call(this,n),this.fire("layeradd",{layer:n}))},removeLayer:function(n){return this.hasLayer(n)?(n in this._layers&&(n=this._layers[n]),n.removeEventParent(this),r.LayerGroup.prototype.removeLayer.call(this,n),this.fire("layerremove",{layer:n})):this},setStyle:function(n){return this.invoke("setStyle",n)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new r.LatLngBounds,i,n;for(i in this._layers)n=this._layers[i],t.extend(n.getBounds?n.getBounds():n.getLatLng());return t}});r.featureGroup=function(n){return new r.FeatureGroup(n)};r.Renderer=r.Layer.extend({options:{padding:.1},initialize:function(n){r.setOptions(this,n);r.stamp(this)},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&r.DomUtil.addClass(this._container,"leaflet-zoom-animated"));this.getPane().appendChild(this._container);this._update()},onRemove:function(){r.DomUtil.remove(this._container)},getEvents:function(){var n={viewreset:this._reset,zoom:this._onZoom,moveend:this._update};return this._zoomAnimated&&(n.zoomanim=this._onAnimZoom),n},_onAnimZoom:function(n){this._updateTransform(n.center,n.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(n,t){var i=this._map.getZoomScale(t,this._zoom),e=r.DomUtil.getPosition(this._container),u=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,t),s=this._map.project(n,t),h=s.subtract(o),f=u.multiplyBy(-i).add(e).add(u).subtract(h);r.Browser.any3d?r.DomUtil.setTransform(this._container,f,i):r.DomUtil.setPosition(this._container,f)},_reset:function(){this._update();this._updateTransform(this._center,this._zoom)},_update:function(){var n=this.options.padding,t=this._map.getSize(),i=this._map.containerPointToLayerPoint(t.multiplyBy(-n)).round();this._bounds=new r.Bounds(i,i.add(t.multiplyBy(1+n*2)).round());this._center=this._map.getCenter();this._zoom=this._map.getZoom()}});r.Map.include({getRenderer:function(n){var t=n.options.renderer||this._getPaneRenderer(n.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this.options.preferCanvas&&r.canvas()||r.svg()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(n){if(n==="overlayPane"||n===i)return!1;var t=this._paneRenderers[n];return t===i&&(t=r.SVG&&r.svg({pane:n})||r.Canvas&&r.canvas({pane:n}),this._paneRenderers[n]=t),t}});r.Path=r.Layer.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0},beforeAdd:function(n){this._renderer=n.getRenderer(this)},onAdd:function(){this._renderer._initPath(this);this._reset();this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},getEvents:function(){return{zoomend:this._project,moveend:this._update,viewreset:this._reset}},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(n){return r.setOptions(this,n),this._renderer&&this._renderer._updateStyle(this),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project();this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(r.Browser.touch?10:0)}});r.LineUtil={simplify:function(n,t){if(!t||!n.length)return n.slice();var i=t*t;return n=this._reducePoints(n,i),this._simplifyDP(n,i)},pointToSegmentDistance:function(n,t,i){return Math.sqrt(this._sqClosestPointOnSegment(n,t,i,!0))},closestPointOnSegment:function(n,t,i){return this._sqClosestPointOnSegment(n,t,i)},_simplifyDP:function(n,t){var u=n.length,o=(typeof Uint8Array=="undefined"?"undefined":_typeof(Uint8Array))!==i+""?Uint8Array:Array,f=new o(u),r,e;for(f[0]=f[u-1]=1,this._simplifyDPStep(n,f,t,0,u-1),e=[],r=0;r<u;r++)f[r]&&e.push(n[r]);return e},_simplifyDPStep:function(n,t,i,r,u){for(var o=0,e,s,f=r+1;f<=u-1;f++)s=this._sqClosestPointOnSegment(n[f],n[r],n[u],!0),s>o&&(e=f,o=s);o>i&&(t[e]=1,this._simplifyDPStep(n,t,i,r,e),this._simplifyDPStep(n,t,i,e,u))},_reducePoints:function(n,t){for(var r=[n[0]],i=1,u=0,f=n.length;i<f;i++)this._sqDist(n[i],n[u])>t&&(r.push(n[i]),u=i);return u<f-1&&r.push(n[f-1]),r},clipSegment:function(n,t,i,r,u){var f=r?this._lastCode:this._getBitCode(n,i),e=this._getBitCode(t,i),s,o,h;for(this._lastCode=e;;){if(!(f|e))return[n,t];if(f&e)return!1;s=f||e;o=this._getEdgeIntersection(n,t,s,i,u);h=this._getBitCode(o,i);s===f?(n=o,f=h):(t=o,e=h)}},_getEdgeIntersection:function(n,t,i,u,f){var s=t.x-n.x,h=t.y-n.y,c=u.min,l=u.max,e,o;return i&8?(e=n.x+s*(l.y-n.y)/h,o=l.y):i&4?(e=n.x+s*(c.y-n.y)/h,o=c.y):i&2?(e=l.x,o=n.y+h*(l.x-n.x)/s):i&1&&(e=c.x,o=n.y+h*(c.x-n.x)/s),new r.Point(e,o,f)},_getBitCode:function(n,t){var i=0;return n.x<t.min.x?i|=1:n.x>t.max.x&&(i|=2),n.y<t.min.y?i|=4:n.y>t.max.y&&(i|=8),i},_sqDist:function(n,t){var i=t.x-n.x,r=t.y-n.y;return i*i+r*r},_sqClosestPointOnSegment:function(n,t,i,u){var o=t.x,s=t.y,f=i.x-o,e=i.y-s,c=f*f+e*e,h;return c>0&&(h=((n.x-o)*f+(n.y-s)*e)/c,h>1?(o=i.x,s=i.y):h>0&&(o+=f*h,s+=e*h)),f=n.x-o,e=n.y-s,u?f*f+e*e:new r.Point(o,s)}};r.Polyline=r.Path.extend({options:{smoothFactor:1,noClip:!1},initialize:function(n,t){r.setOptions(this,t);this._setLatLngs(n)},getLatLngs:function(){return this._latlngs},setLatLngs:function(n){return this._setLatLngs(n),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(n){for(var e=Infinity,i=null,c=r.LineUtil._sqClosestPointOnSegment,o,s,f,t,a,h,u=0,l=this._parts.length;u<l;u++)for(f=this._parts[u],t=1,a=f.length;t<a;t++)o=f[t-1],s=f[t],h=c(n,o,s,!0),h<e&&(e=h,i=c(n,o,s));return i&&(i.distance=Math.sqrt(e)),i},getCenter:function(){var n,r,e,u,f,t,o,i=this._rings[0],s=i.length;if(!s)return null;for(n=0,r=0;n<s-1;n++)r+=i[n].distanceTo(i[n+1])/2;if(r===0)return this._map.layerPointToLatLng(i[0]);for(n=0,u=0;n<s-1;n++)if(f=i[n],t=i[n+1],e=f.distanceTo(t),u+=e,u>r)return o=(u-r)/e,this._map.layerPointToLatLng([t.x-o*(t.x-f.x),t.y-o*(t.y-f.y)])},getBounds:function(){return this._bounds},addLatLng:function(n,t){return t=t||this._defaultShape(),n=r.latLng(n),t.push(n),this._bounds.extend(n),this.redraw()},_setLatLngs:function(n){this._bounds=new r.LatLngBounds;this._latlngs=this._convertLatLngs(n)},_defaultShape:function(){return r.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(n){for(var i=[],f=r.Polyline._flat(n),t=0,u=n.length;t<u;t++)f?(i[t]=r.latLng(n[t]),this._bounds.extend(i[t])):i[t]=this._convertLatLngs(n[t]);return i},_project:function(){var n=new r.Bounds,t,i;this._rings=[];this._projectLatlngs(this._latlngs,this._rings,n);t=this._clickTolerance();i=new r.Point(t,t);this._bounds.isValid()&&n.isValid()&&(n.min._subtract(i),n.max._add(i),this._pxBounds=n)},_projectLatlngs:function(n,t,i){var o=n[0]instanceof r.LatLng,e=n.length,u,f;if(o){for(f=[],u=0;u<e;u++)f[u]=this._map.latLngToLayerPoint(n[u]),i.extend(f[u]);t.push(f)}else for(u=0;u<e;u++)this._projectLatlngs(n[u],t,i)},_clipPoints:function(){var s=this._renderer._bounds,i,e,n,t,h,o,u,f;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(s)){if(this.options.noClip){this._parts=this._rings;return}for(i=this._parts,e=0,t=0,h=this._rings.length;e<h;e++)for(f=this._rings[e],n=0,o=f.length;n<o-1;n++)(u=r.LineUtil.clipSegment(f[n],f[n+1],s,n,!0),u)&&(i[t]=i[t]||[],i[t].push(u[0]),(u[1]!==f[n+1]||n===o-2)&&(i[t].push(u[1]),t++))}},_simplifyPoints:function(){for(var t=this._parts,u=this.options.smoothFactor,n=0,i=t.length;n<i;n++)t[n]=r.LineUtil.simplify(t[n],u)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)}});r.polyline=function(n,t){return new r.Polyline(n,t)};r.Polyline._flat=function(n){return!r.Util.isArray(n[0])||_typeof(n[0][0])!=="object"&&typeof n[0][0]!="undefined"};r.PolyUtil={};r.PolyUtil.clipPolygon=function(n,t,i){for(var o,y=[1,4,2,8],v,a,s,h,e,f,l=r.LineUtil,u=0,c=n.length;u<c;u++)n[u]._code=l._getBitCode(n[u],t);for(a=0;a<4;a++){for(e=y[a],o=[],u=0,c=n.length,v=c-1;u<c;v=u++)s=n[u],h=n[v],s._code&e?h._code&e||(f=l._getEdgeIntersection(h,s,e,t,i),f._code=l._getBitCode(f,t),o.push(f)):(h._code&e&&(f=l._getEdgeIntersection(h,s,e,t,i),f._code=l._getBitCode(f,t),o.push(f)),o.push(s));n=o}return n};r.Polygon=r.Polyline.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){var r,e,n,t,u,i,o,s,c,f=this._rings[0],h=f.length;if(!h)return null;for(i=o=s=0,r=0,e=h-1;r<h;e=r++)n=f[r],t=f[e],u=n.y*t.x-t.y*n.x,o+=(n.x+t.x)*u,s+=(n.y+t.y)*u,i+=u*3;return c=i===0?f[0]:[o/i,s/i],this._map.layerPointToLatLng(c)},_convertLatLngs:function(n){var t=r.Polyline.prototype._convertLatLngs.call(this,n),i=t.length;return i>=2&&t[0]instanceof r.LatLng&&t[0].equals(t[i-1])&&t.pop(),t},_setLatLngs:function(n){r.Polyline.prototype._setLatLngs.call(this,n);r.Polyline._flat(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return r.Polyline._flat(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var n=this._renderer._bounds,u=this.options.weight,f=new r.Point(u,u),t,e,i;if(n=new r.Bounds(n.min.subtract(f),n.max.add(f)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(n)){if(this.options.noClip){this._parts=this._rings;return}for(t=0,e=this._rings.length;t<e;t++)i=r.PolyUtil.clipPolygon(this._rings[t],n,!0),i.length&&this._parts.push(i)}},_updatePath:function(){this._renderer._updatePoly(this,!0)}});r.polygon=function(n,t){return new r.Polygon(n,t)};r.Rectangle=r.Polygon.extend({initialize:function(n,t){r.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(n),t)},setBounds:function(n){return this.setLatLngs(this._boundsToLatLngs(n))},_boundsToLatLngs:function(n){return n=r.latLngBounds(n),[n.getSouthWest(),n.getNorthWest(),n.getNorthEast(),n.getSouthEast()]}});r.rectangle=function(n,t){return new r.Rectangle(n,t)};r.CircleMarker=r.Path.extend({options:{fill:!0,radius:10},initialize:function(n,t){r.setOptions(this,t);this._latlng=r.latLng(n);this._radius=this.options.radius},setLatLng:function(n){return this._latlng=r.latLng(n),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(n){return this.options.radius=this._radius=n,this.redraw()},getRadius:function(){return this._radius},setStyle:function(n){var t=n&&n.radius||this._radius;return r.Path.prototype.setStyle.call(this,n),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng);this._updateBounds()},_updateBounds:function(){var n=this._radius,u=this._radiusY||n,t=this._clickTolerance(),i=[n+t,u+t];this._pxBounds=new r.Bounds(this._point.subtract(i),this._point.add(i))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)}});r.circleMarker=function(n,t){return new r.CircleMarker(n,t)};r.Circle=r.CircleMarker.extend({initialize:function(n,t,i){if(typeof t=="number"&&(t=r.extend({},i,{radius:t})),r.setOptions(this,t),this._latlng=r.latLng(n),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(n){return this._mRadius=n,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var n=[this._radius,this._radiusY||this._radius];return new r.LatLngBounds(this._map.layerPointToLatLng(this._point.subtract(n)),this._map.layerPointToLatLng(this._point.add(n)))},setStyle:r.Path.prototype.setStyle,_project:function(){var o=this._latlng.lng,i=this._latlng.lat,n=this._map,s=n.options.crs,l;if(s.distance===r.CRS.Earth.distance){var t=Math.PI/180,f=this._mRadius/r.CRS.Earth.R/t,c=n.project([i+f,o]),a=n.project([i-f,o]),e=c.add(a).divideBy(2),h=n.unproject(e).lat,u=Math.acos((Math.cos(f*t)-Math.sin(i*t)*Math.sin(h*t))/(Math.cos(i*t)*Math.cos(h*t)))/t;(isNaN(u)||u===0)&&(u=f/Math.cos(Math.PI/180*i));this._point=e.subtract(n.getPixelOrigin());this._radius=isNaN(u)?0:Math.max(Math.round(e.x-n.project([h,o-u]).x),1);this._radiusY=Math.max(Math.round(e.y-c.y),1)}else l=s.unproject(s.project(this._latlng).subtract([this._mRadius,0])),this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(l).x;this._updateBounds()}});r.circle=function(n,t,i){return new r.Circle(n,t,i)};r.SVG=r.Renderer.extend({getEvents:function(){var n=r.Renderer.prototype.getEvents.call(this);return n.zoomstart=this._onZoomStart,n},_initContainer:function(){this._container=r.SVG.create("svg");this._container.setAttribute("pointer-events","none");this._rootGroup=r.SVG.create("g");this._container.appendChild(this._rootGroup)},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){r.Renderer.prototype._update.call(this);var t=this._bounds,n=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(n)||(this._svgSize=n,i.setAttribute("width",n.x),i.setAttribute("height",n.y));r.DomUtil.setPosition(i,t.min);i.setAttribute("viewBox",[t.min.x,t.min.y,n.x,n.y].join(" "))}},_initPath:function(n){var t=n._path=r.SVG.create("path");n.options.className&&r.DomUtil.addClass(t,n.options.className);n.options.interactive&&r.DomUtil.addClass(t,"leaflet-interactive");this._updateStyle(n)},_addPath:function(n){this._rootGroup.appendChild(n._path);n.addInteractiveTarget(n._path)},_removePath:function(n){r.DomUtil.remove(n._path);n.removeInteractiveTarget(n._path)},_updatePath:function(n){n._project();n._update()},_updateStyle:function(n){var t=n._path,i=n.options;t&&(i.stroke?(t.setAttribute("stroke",i.color),t.setAttribute("stroke-opacity",i.opacity),t.setAttribute("stroke-width",i.weight),t.setAttribute("stroke-linecap",i.lineCap),t.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?t.setAttribute("stroke-dasharray",i.dashArray):t.removeAttribute("stroke-dasharray"),i.dashOffset?t.setAttribute("stroke-dashoffset",i.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),i.fill?(t.setAttribute("fill",i.fillColor||i.color),t.setAttribute("fill-opacity",i.fillOpacity),t.setAttribute("fill-rule",i.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(n,t){this._setPath(n,r.SVG.pointsToPath(n._parts,t))},_updateCircle:function(n){var i=n._point,t=n._radius,u=n._radiusY||t,r="a"+t+","+u+" 0 1,0 ",f=n._empty()?"M0 0":"M"+(i.x-t)+","+i.y+r+t*2+",0 "+r+-t*2+",0 ";this._setPath(n,f)},_setPath:function(n,t){n._path.setAttribute("d",t)},_bringToFront:function(n){r.DomUtil.toFront(n._path)},_bringToBack:function(n){r.DomUtil.toBack(n._path)}});r.extend(r.SVG,{create:function(n){return t.createElementNS("http://www.w3.org/2000/svg",n)},pointsToPath:function(n,t){for(var f="",i,h,e,o,u=0,s=n.length;u<s;u++){for(e=n[u],i=0,h=e.length;i<h;i++)o=e[i],f+=(i?"L":"M")+o.x+" "+o.y;f+=t?r.Browser.svg?"z":"x":""}return f||"M0 0"}});r.Browser.svg=!!(t.createElementNS&&r.SVG.create("svg").createSVGRect);r.svg=function(n){return r.Browser.svg||r.Browser.vml?new r.SVG(n):null};r.Browser.vml=!r.Browser.svg&&function(){var i,n;try{return i=t.createElement("div"),i.innerHTML='<v:shape adj="1"/>',n=i.firstChild,n.style.behavior="url(#default#VML)",n&&_typeof(n.adj)==="object"}catch(r){return!1}}();r.SVG.include(r.Browser.vml?{_initContainer:function(){this._container=r.DomUtil.create("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||r.Renderer.prototype._update.call(this)},_initPath:function(n){var t=n._container=r.SVG.create("shape");r.DomUtil.addClass(t,"leaflet-vml-shape "+(this.options.className||""));t.coordsize="1 1";n._path=r.SVG.create("path");t.appendChild(n._path);this._updateStyle(n)},_addPath:function(n){var t=n._container;this._container.appendChild(t);n.options.interactive&&n.addInteractiveTarget(t)},_removePath:function(n){var t=n._container;r.DomUtil.remove(t);n.removeInteractiveTarget(t)},_updateStyle:function(n){var i=n._stroke,u=n._fill,t=n.options,f=n._container;f.stroked=!!t.stroke;f.filled=!!t.fill;t.stroke?(i||(i=n._stroke=r.SVG.create("stroke")),f.appendChild(i),i.weight=t.weight+"px",i.color=t.color,i.opacity=t.opacity,i.dashStyle=t.dashArray?r.Util.isArray(t.dashArray)?t.dashArray.join(" "):t.dashArray.replace(/( *, *)/g," "):"",i.endcap=t.lineCap.replace("butt","flat"),i.joinstyle=t.lineJoin):i&&(f.removeChild(i),n._stroke=null);t.fill?(u||(u=n._fill=r.SVG.create("fill")),f.appendChild(u),u.color=t.fillColor||t.color,u.opacity=t.fillOpacity):u&&(f.removeChild(u),n._fill=null)},_updateCircle:function(n){var t=n._point.round(),i=Math.round(n._radius),r=Math.round(n._radiusY||i);this._setPath(n,n._empty()?"M0 0":"AL "+t.x+","+t.y+" "+i+","+r+" 0,23592600")},_setPath:function(n,t){n._path.v=t},_bringToFront:function(n){r.DomUtil.toFront(n._container)},_bringToBack:function(n){r.DomUtil.toBack(n._container)}}:{});r.Browser.vml&&(r.SVG.create=function(){try{return t.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(n){return t.createElement("<lvml:"+n+' class="lvml">')}}catch(n){return function(n){return t.createElement("<"+n+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}());r.Canvas=r.Renderer.extend({onAdd:function(){r.Renderer.prototype.onAdd.call(this);this._layers=this._layers||{};this._draw()},_initContainer:function(){var n=this._container=t.createElement("canvas");r.DomEvent.on(n,"mousemove",r.Util.throttle(this._onMouseMove,32,this),this).on(n,"click dblclick mousedown mouseup contextmenu",this._onClick,this).on(n,"mouseout",this._handleMouseOut,this);this._ctx=n.getContext("2d")},_update:function(){if(!this._map._animatingZoom||!this._bounds){this._drawnLayers={};r.Renderer.prototype._update.call(this);var t=this._bounds,n=this._container,i=t.getSize(),u=r.Browser.retina?2:1;r.DomUtil.setPosition(n,t.min);n.width=u*i.x;n.height=u*i.y;n.style.width=i.x+"px";n.style.height=i.y+"px";r.Browser.retina&&this._ctx.scale(2,2);this._ctx.translate(-t.min.x,-t.min.y)}},_initPath:function(n){this._updateDashArray(n);this._layers[r.stamp(n)]=n},_addPath:r.Util.falseFn,_removePath:function(n){n._removed=!0;this._requestRedraw(n)},_updatePath:function(n){this._redrawBounds=n._pxBounds;this._draw(!0);n._project();n._update();this._draw();this._redrawBounds=null},_updateStyle:function(n){this._updateDashArray(n);this._requestRedraw(n)},_updateDashArray:function(n){if(n.options.dashArray){for(var i=n.options.dashArray.split(","),r=[],t=0;t<i.length;t++)r.push(Number(i[t]));n.options._dashArray=r}},_requestRedraw:function(n){if(this._map){var t=(n.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new r.Bounds;this._redrawBounds.extend(n._pxBounds.min.subtract([t,t]));this._redrawBounds.extend(n._pxBounds.max.add([t,t]));this._redrawRequest=this._redrawRequest||r.Util.requestAnimFrame(this._redraw,this)}},_redraw:function(){this._redrawRequest=null;this._draw(!0);this._draw();this._redrawBounds=null},_draw:function(n){var i,t,r;this._clear=n;t=this._redrawBounds;this._ctx.save();t&&(this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,t.max.x-t.min.x,t.max.y-t.min.y),this._ctx.clip());for(r in this._layers)i=this._layers[r],(!t||i._pxBounds.intersects(t))&&i._updatePath(),n&&i._removed&&(delete i._removed,delete this._layers[r]);this._ctx.restore()},_updatePoly:function(n,t){var r,u,o,f,e=n._parts,s=e.length,i=this._ctx;if(s){for(this._drawnLayers[n._leaflet_id]=n,i.beginPath(),i.setLineDash&&i.setLineDash(n.options&&n.options._dashArray||[]),r=0;r<s;r++){for(u=0,o=e[r].length;u<o;u++)f=e[r][u],i[u?"lineTo":"moveTo"](f.x,f.y);t&&i.closePath()}this._fillStroke(i,n)}},_updateCircle:function(n){if(!n._empty()){var u=n._point,t=this._ctx,r=n._radius,i=(n._radiusY||r)/r;this._drawnLayers[n._leaflet_id]=n;i!==1&&(t.save(),t.scale(1,i));t.beginPath();t.arc(u.x,u.y/i,r,0,Math.PI*2,!1);i!==1&&t.restore();this._fillStroke(t,n)}},_fillStroke:function(n,t){var r=this._clear,i=t.options;n.globalCompositeOperation=r?"destination-out":"source-over";i.fill&&(n.globalAlpha=r?1:i.fillOpacity,n.fillStyle=i.fillColor||i.color,n.fill(i.fillRule||"evenodd"));i.stroke&&i.weight!==0&&(n.globalAlpha=r?1:i.opacity,t._prevWeight=n.lineWidth=r?t._prevWeight+1:i.weight,n.strokeStyle=i.color,n.lineCap=i.lineCap,n.lineJoin=i.lineJoin,n.stroke())},_onClick:function(n){var f=this._map.mouseEventToLayerPoint(n),i=[],t,u;for(u in this._layers)t=this._layers[u],t.options.interactive&&t._containsPoint(f)&&(r.DomEvent._fakeStop(n),i.push(t));i.length&&this._fireEvent(i,n)},_onMouseMove:function(n){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(n);this._handleMouseOut(n,t);this._handleMouseHover(n,t)}},_handleMouseOut:function(n,t){var i=this._hoveredLayer;i&&(n.type==="mouseout"||!i._containsPoint(t))&&(r.DomUtil.removeClass(this._container,"leaflet-interactive"),this._fireEvent([i],n,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(n,t){var u,i;for(u in this._drawnLayers)i=this._drawnLayers[u],i.options.interactive&&i._containsPoint(t)&&(r.DomUtil.addClass(this._container,"leaflet-interactive"),this._fireEvent([i],n,"mouseover"),this._hoveredLayer=i);this._hoveredLayer&&this._fireEvent([this._hoveredLayer],n)},_fireEvent:function(n,t,i){this._map._fireDOMEvent(t,i||t.type,n)},_bringToFront:r.Util.falseFn,_bringToBack:r.Util.falseFn});r.Browser.canvas=function(){return!!t.createElement("canvas").getContext}();r.canvas=function(n){return r.Browser.canvas?new r.Canvas(n):null};r.Polyline.prototype._containsPoint=function(n,t){var u,i,e,s,o,f,h=this._clickTolerance();if(!this._pxBounds.contains(n))return!1;for(u=0,s=this._parts.length;u<s;u++)for(f=this._parts[u],i=0,o=f.length,e=o-1;i<o;e=i++)if((t||i!==0)&&r.LineUtil.pointToSegmentDistance(n,f[e],f[i])<=h)return!0;return!1};r.Polygon.prototype._containsPoint=function(n){var o=!1,i,t,u,f,e,s,c,h;if(!this._pxBounds.contains(n))return!1;for(f=0,c=this._parts.length;f<c;f++)for(i=this._parts[f],e=0,h=i.length,s=h-1;e<h;s=e++)t=i[e],u=i[s],t.y>n.y!=u.y>n.y&&n.x<(u.x-t.x)*(n.y-t.y)/(u.y-t.y)+t.x&&(o=!o);return o||r.Polyline.prototype._containsPoint.call(this,n,!0)};r.CircleMarker.prototype._containsPoint=function(n){return n.distanceTo(this._point)<=this._radius+this._clickTolerance()};r.GeoJSON=r.FeatureGroup.extend({initialize:function(n,t){r.setOptions(this,t);this._layers={};n&&this.addData(n)},addData:function(n){var e=r.Util.isArray(n)?n:n.features,f,o,i,u,t;if(e){for(f=0,o=e.length;f<o;f++)i=e[f],(i.geometries||i.geometry||i.features||i.coordinates)&&this.addData(i);return this}if((u=this.options,u.filter&&!u.filter(n))||(t=r.GeoJSON.geometryToLayer(n,u),!t))return this;if(t.feature=r.GeoJSON.asFeature(n),t.defaultOptions=t.options,this.resetStyle(t),u.onEachFeature)u.onEachFeature(n,t);return this.addLayer(t)},resetStyle:function(n){return n.options=r.Util.extend({},n.defaultOptions),this._setLayerStyle(n,this.options.style),this},setStyle:function(n){return this.eachLayer(function(t){this._setLayerStyle(t,n)},this)},_setLayerStyle:function(n,t){typeof t=="function"&&(t=t(n.feature));n.setStyle&&n.setStyle(t)}});r.extend(r.GeoJSON,{geometryToLayer:function(n,t){var i=n.type==="Feature"?n.geometry:n,f=i?i.coordinates:null,o=[],s=t&&t.pointToLayer,h=t&&t.coordsToLatLng||this.coordsToLatLng,e,c,u,l,a;if(!f&&!i)return null;switch(i.type){case"Point":return e=h(f),s?s(n,e):new r.Marker(e);case"MultiPoint":for(u=0,l=f.length;u<l;u++)e=h(f[u]),o.push(s?s(n,e):new r.Marker(e));return new r.FeatureGroup(o);case"LineString":case"MultiLineString":return c=this.coordsToLatLngs(f,i.type==="LineString"?0:1,h),new r.Polyline(c,t);case"Polygon":case"MultiPolygon":return c=this.coordsToLatLngs(f,i.type==="Polygon"?1:2,h),new r.Polygon(c,t);case"GeometryCollection":for(u=0,l=i.geometries.length;u<l;u++)a=this.geometryToLayer({geometry:i.geometries[u],type:"Feature",properties:n.properties},t),a&&o.push(a);return new r.FeatureGroup(o);default:throw new Error("Invalid GeoJSON object.");}},coordsToLatLng:function(n){return new r.LatLng(n[1],n[0],n[2])},coordsToLatLngs:function(n,t,i){for(var u=[],e,r=0,f=n.length;r<f;r++)e=t?this.coordsToLatLngs(n[r],t-1,i):(i||this.coordsToLatLng)(n[r]),u.push(e);return u},latLngToCoords:function(n){return n.alt!==i?[n.lng,n.lat,n.alt]:[n.lng,n.lat]},latLngsToCoords:function(n,t,i){for(var f=[],u=0,e=n.length;u<e;u++)f.push(t?r.GeoJSON.latLngsToCoords(n[u],t-1,i):r.GeoJSON.latLngToCoords(n[u]));return!t&&i&&f.push(f[0]),f},getFeature:function(n,t){return n.feature?r.extend({},n.feature,{geometry:t}):r.GeoJSON.asFeature(t)},asFeature:function(n){return n.type==="Feature"?n:{type:"Feature",properties:{},geometry:n}}});e={toGeoJSON:function(){return r.GeoJSON.getFeature(this,{type:"Point",coordinates:r.GeoJSON.latLngToCoords(this.getLatLng())})}};r.Marker.include(e);r.Circle.include(e);r.CircleMarker.include(e);r.Polyline.prototype.toGeoJSON=function(){var n=!r.Polyline._flat(this._latlngs),t=r.GeoJSON.latLngsToCoords(this._latlngs,n?1:0);return r.GeoJSON.getFeature(this,{type:(n?"Multi":"")+"LineString",coordinates:t})};r.Polygon.prototype.toGeoJSON=function(){var n=!r.Polyline._flat(this._latlngs),i=n&&!r.Polyline._flat(this._latlngs[0]),t=r.GeoJSON.latLngsToCoords(this._latlngs,i?2:n?1:0,!0);return n||(t=[t]),r.GeoJSON.getFeature(this,{type:(i?"Multi":"")+"Polygon",coordinates:t})};r.LayerGroup.include({toMultiPoint:function(){var n=[];return this.eachLayer(function(t){n.push(t.toGeoJSON().geometry.coordinates)}),r.GeoJSON.getFeature(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(){var i=this.feature&&this.feature.geometry&&this.feature.geometry.type,t,n;return i==="MultiPoint"?this.toMultiPoint():(t=i==="GeometryCollection",n=[],this.eachLayer(function(i){if(i.toGeoJSON){var u=i.toGeoJSON();n.push(t?u.geometry:r.GeoJSON.asFeature(u))}}),t)?r.GeoJSON.getFeature(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});r.geoJSON=function(n,t){return new r.GeoJSON(n,t)};r.geoJson=r.geoJSON;f="_leaflet_events";r.DomEvent={on:function(n,t,i,u){var e,f,o;if((typeof t=="undefined"?"undefined":_typeof(t))==="object")for(e in t)this._on(n,e,t[e],i);else for(t=r.Util.splitWords(t),f=0,o=t.length;f<o;f++)this._on(n,t[f],i,u);return this},off:function(n,t,i,u){var e,f,o;if((typeof t=="undefined"?"undefined":_typeof(t))==="object")for(e in t)this._off(n,e,t[e],i);else for(t=r.Util.splitWords(t),f=0,o=t.length;f<o;f++)this._off(n,t[f],i,u);return this},_on:function(t,i,u,e){var s=i+r.stamp(u)+(e?"_"+r.stamp(e):""),o,h;return t[f]&&t[f][s]?this:(o=function(i){return u.call(e||t,i||n.event)},h=o,r.Browser.pointer&&i.indexOf("touch")===0?this.addPointerListener(t,i,o,s):r.Browser.touch&&i==="dblclick"&&this.addDoubleTapListener?this.addDoubleTapListener(t,o,s):"addEventListener"in t?i==="mousewheel"?t.addEventListener("onwheel"in t?"wheel":"mousewheel",o,!1):i==="mouseenter"||i==="mouseleave"?(o=function(i){i=i||n.event;r.DomEvent._isExternalTarget(t,i)&&h(i)},t.addEventListener(i==="mouseenter"?"mouseover":"mouseout",o,!1)):(i==="click"&&r.Browser.android&&(o=function(n){return r.DomEvent._filterClick(n,h)}),t.addEventListener(i,o,!1)):"attachEvent"in t&&t.attachEvent("on"+i,o),t[f]=t[f]||{},t[f][s]=o,this)},_off:function(n,t,i,u){var e=t+r.stamp(i)+(u?"_"+r.stamp(u):""),o=n[f]&&n[f][e];return o?(r.Browser.pointer&&t.indexOf("touch")===0?this.removePointerListener(n,t,e):r.Browser.touch&&t==="dblclick"&&this.removeDoubleTapListener?this.removeDoubleTapListener(n,e):"removeEventListener"in n?t==="mousewheel"?n.removeEventListener("onwheel"in n?"wheel":"mousewheel",o,!1):n.removeEventListener(t==="mouseenter"?"mouseover":t==="mouseleave"?"mouseout":t,o,!1):"detachEvent"in n&&n.detachEvent("on"+t,o),n[f][e]=null,this):this},stopPropagation:function(n){return n.stopPropagation?n.stopPropagation():n.originalEvent?n.originalEvent._stopped=!0:n.cancelBubble=!0,r.DomEvent._skipped(n),this},disableScrollPropagation:function(n){return r.DomEvent.on(n,"mousewheel",r.DomEvent.stopPropagation)},disableClickPropagation:function(n){var t=r.DomEvent.stopPropagation;r.DomEvent.on(n,r.Draggable.START.join(" "),t);return r.DomEvent.on(n,{click:r.DomEvent._fakeStop,dblclick:t})},preventDefault:function(n){return n.preventDefault?n.preventDefault():n.returnValue=!1,this},stop:function(n){return r.DomEvent.preventDefault(n).stopPropagation(n)},getMousePosition:function(n,t){if(!t)return new r.Point(n.clientX,n.clientY);var i=t.getBoundingClientRect();return new r.Point(n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop)},getWheelDelta:function(n){return n.deltaY&&n.deltaMode===0?-n.deltaY:n.deltaY&&n.deltaMode===1?-n.deltaY*18:n.deltaY&&n.deltaMode===2?-n.deltaY*52:n.deltaX||n.deltaZ?0:n.wheelDelta?(n.wheelDeltaY||n.wheelDelta)/2:n.detail&&Math.abs(n.detail)<32765?-n.detail*18:n.detail?n.detail/-32765*52:0},_skipEvents:{},_fakeStop:function(n){r.DomEvent._skipEvents[n.type]=!0},_skipped:function(n){var t=this._skipEvents[n.type];return this._skipEvents[n.type]=!1,t},_isExternalTarget:function(n,t){var i=t.relatedTarget;if(!i)return!0;try{while(i&&i!==n)i=i.parentNode}catch(r){return!1}return i!==n},_filterClick:function(n,t){var u=n.timeStamp||n.originalEvent&&n.originalEvent.timeStamp,i=r.DomEvent._lastClick&&u-r.DomEvent._lastClick;if(i&&i>100&&i<500||n.target._simulatedClick&&!n._simulated){r.DomEvent.stop(n);return}r.DomEvent._lastClick=u;t(n)}};r.DomEvent.addListener=r.DomEvent.on;r.DomEvent.removeListener=r.DomEvent.off;r.Draggable=r.Evented.extend({options:{clickTolerance:3},statics:{START:r.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(n,t,i){this._element=n;this._dragStartTarget=t||n;this._preventOutline=i},enable:function(){if(!this._enabled){r.DomEvent.on(this._dragStartTarget,r.Draggable.START.join(" "),this._onDown,this);this._enabled=!0}},disable:function(){this._enabled&&(r.DomEvent.off(this._dragStartTarget,r.Draggable.START.join(" "),this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(n){if(!n._simulated&&(this._moved=!1,!r.DomUtil.hasClass(this._element,"leaflet-zoom-anim"))&&!r.Draggable._dragging&&!n.shiftKey&&(n.which===1||n.button===1||n.touches)&&this._enabled&&(r.Draggable._dragging=!0,this._preventOutline&&r.DomUtil.preventOutline(this._element),r.DomUtil.disableImageDrag(),r.DomUtil.disableTextSelection(),!this._moving)){this.fire("down");var i=n.touches?n.touches[0]:n;this._startPoint=new r.Point(i.clientX,i.clientY);this._startPos=this._newPos=r.DomUtil.getPosition(this._element);r.DomEvent.on(t,r.Draggable.MOVE[n.type],this._onMove,this).on(t,r.Draggable.END[n.type],this._onUp,this)}},_onMove:function(i){if(!i._simulated){if(i.touches&&i.touches.length>1){this._moved=!0;return}var f=i.touches&&i.touches.length===1?i.touches[0]:i,e=new r.Point(f.clientX,f.clientY),u=e.subtract(this._startPoint);(u.x||u.y)&&(Math.abs(u.x)+Math.abs(u.y)<this.options.clickTolerance||(r.DomEvent.preventDefault(i),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=r.DomUtil.getPosition(this._element).subtract(u),r.DomUtil.addClass(t.body,"leaflet-dragging"),this._lastTarget=i.target||i.srcElement,n.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),r.DomUtil.addClass(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(u),this._moving=!0,r.Util.cancelAnimFrame(this._animRequest),this._lastEvent=i,this._animRequest=r.Util.requestAnimFrame(this._updatePosition,this,!0)))}},_updatePosition:function(){var n={originalEvent:this._lastEvent};this.fire("predrag",n);r.DomUtil.setPosition(this._element,this._newPos);this.fire("drag",n)},_onUp:function(n){if(!n._simulated){r.DomUtil.removeClass(t.body,"leaflet-dragging");this._lastTarget&&(r.DomUtil.removeClass(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null);for(var i in r.Draggable.MOVE)r.DomEvent.off(t,r.Draggable.MOVE[i],this._onMove,this).off(t,r.Draggable.END[i],this._onUp,this);r.DomUtil.enableImageDrag();r.DomUtil.enableTextSelection();this._moved&&this._moving&&(r.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)}));this._moving=!1;r.Draggable._dragging=!1}}});r.Handler=r.Class.extend({initialize:function(n){this._map=n},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}});r.Map.mergeOptions({dragging:!0,inertia:!r.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:Infinity,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});r.Map.Drag=r.Handler.extend({addHooks:function(){if(!this._draggable){var n=this._map;this._draggable=new r.Draggable(n._mapPane,n._container);this._draggable.on({down:this._onDown,dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this);this._draggable.on("predrag",this._onPreDragLimit,this);if(n.options.worldCopyJump){this._draggable.on("predrag",this._onPreDragWrap,this);n.on("zoomend",this._onZoomEnd,this);n.whenReady(this._onZoomEnd,this)}}r.DomUtil.addClass(this._map._container,"leaflet-grab");this._draggable.enable();this._positions=[];this._times=[]},removeHooks:function(){r.DomUtil.removeClass(this._map._container,"leaflet-grab");this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDown:function(){this._map._stop()},_onDragStart:function(){var t=this._map,n;this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(n=r.latLngBounds(this._map.options.maxBounds),this._offsetLimit=r.bounds(this._map.latLngToContainerPoint(n.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(n.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null;t.fire("movestart").fire("dragstart");t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(n){if(this._map.options.inertia){var t=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i);this._times.push(t);t-this._times[0]>50&&(this._positions.shift(),this._times.shift())}this._map.fire("move",n).fire("drag",n)},_onZoomEnd:function(){var n=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(n).x;this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(n,t){return n-(n-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var n=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;n.x<t.min.x&&(n.x=this._viscousLimit(n.x,t.min.x));n.y<t.min.y&&(n.y=this._viscousLimit(n.y,t.min.y));n.x>t.max.x&&(n.x=this._viscousLimit(n.x,t.max.x));n.y>t.max.y&&(n.y=this._viscousLimit(n.y,t.max.y));this._draggable._newPos=this._draggable._startPos.add(n)}},_onPreDragWrap:function(){var i=this._worldWidth,t=Math.round(i/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,u=(r-t+n)%i+t-n,f=(r+t+n)%i-t-n,e=Math.abs(u+n)<Math.abs(f+n)?u:f;this._draggable._absPos=this._draggable._newPos.clone();this._draggable._newPos.x=e},_onDragEnd:function(n){var t=this._map,u=t.options,c=!u.inertia||this._times.length<2;if(t.fire("dragend",n),c)t.fire("moveend");else{var l=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,f=u.easeLinearity,e=l.multiplyBy(f/a),o=e.distanceTo([0,0]),s=Math.min(u.inertiaMaxSpeed,o),v=e.multiplyBy(s/o),h=s/(u.inertiaDeceleration*f),i=v.multiplyBy(-h/2).round();i.x||i.y?(i=t._limitOffset(i,t.options.maxBounds),r.Util.requestAnimFrame(function(){t.panBy(i,{duration:h,easeLinearity:f,noMoveStart:!0,animate:!0})})):t.fire("moveend")}}});r.Map.addInitHook("addHandler","dragging",r.Map.Drag);r.Map.mergeOptions({doubleClickZoom:!0});r.Map.DoubleClickZoom=r.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(n){var t=this._map,i=t.getZoom(),r=t.options.zoomDelta,u=n.originalEvent.shiftKey?i-r:i+r;t.options.doubleClickZoom==="center"?t.setZoom(u):t.setZoomAround(n.containerPoint,u)}});r.Map.addInitHook("addHandler","doubleClickZoom",r.Map.DoubleClickZoom);r.Map.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:50});r.Map.ScrollWheelZoom=r.Handler.extend({addHooks:function(){r.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this);this._delta=0},removeHooks:function(){r.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(n){var i=r.DomEvent.getWheelDelta(n),u=this._map.options.wheelDebounceTime,t;this._delta+=i;this._lastMousePos=this._map.mouseEventToContainerPoint(n);this._startTime||(this._startTime=+new Date);t=Math.max(u-(+new Date-this._startTime),0);clearTimeout(this._timer);this._timer=setTimeout(r.bind(this._performZoom,this),t);r.DomEvent.stop(n)},_performZoom:function(){var n=this._map,t=n.getZoom(),i=this._map.options.zoomSnap||0;n._stop();var e=this._delta/(this._map.options.wheelPxPerZoomLevel*4),u=4*Math.log(2/(1+Math.exp(-Math.abs(e))))/Math.LN2,f=i?Math.ceil(u/i)*i:u,r=n._limitZoom(t+(this._delta>0?f:-f))-t;(this._delta=0,this._startTime=null,r)&&(n.options.scrollWheelZoom==="center"?n.setZoom(t+r):n.setZoomAround(this._lastMousePos,t+r))}});r.Map.addInitHook("addHandler","scrollWheelZoom",r.Map.ScrollWheelZoom);r.extend(r.DomEvent,{_touchstart:r.Browser.msPointer?"MSPointerDown":r.Browser.pointer?"pointerdown":"touchstart",_touchend:r.Browser.msPointer?"MSPointerUp":r.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(n,t,i){function s(n){var e,t,i;(e=r.Browser.pointer?r.DomEvent._pointersCount:n.touches.length,e>1)||(t=Date.now(),i=t-(f||t),u=n.touches?n.touches[0]:n,o=i>0&&i<=a,f=t)}function h(){if(o&&!u.cancelBubble){if(r.Browser.pointer){var e={},n,i;for(i in u)n=u[i],e[i]=n&&n.bind?n.bind(u):n;u=e}u.type="dblclick";t(u);f=null}}var f,u,o=!1,a=250,e="_leaflet_",c=this._touchstart,l=this._touchend;return n[e+c+i]=s,n[e+l+i]=h,n[e+"dblclick"+i]=t,n.addEventListener(c,s,!1),n.addEventListener(l,h,!1),r.Browser.edge||n.addEventListener("dblclick",t,!1),this},removeDoubleTapListener:function(n,t){var i="_leaflet_",u=n[i+this._touchstart+t],f=n[i+this._touchend+t],e=n[i+"dblclick"+t];return n.removeEventListener(this._touchstart,u,!1),n.removeEventListener(this._touchend,f,!1),r.Browser.edge||n.removeEventListener("dblclick",e,!1),this}});r.extend(r.DomEvent,{POINTER_DOWN:r.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:r.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:r.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:r.Browser.msPointer?"MSPointerCancel":"pointercancel",TAG_WHITE_LIST:["INPUT","SELECT","OPTION"],_pointers:{},_pointersCount:0,addPointerListener:function(n,t,i,r){return t==="touchstart"?this._addPointerStart(n,i,r):t==="touchmove"?this._addPointerMove(n,i,r):t==="touchend"&&this._addPointerEnd(n,i,r),this},removePointerListener:function(n,t,i){var r=n["_leaflet_"+t+i];return t==="touchstart"?n.removeEventListener(this.POINTER_DOWN,r,!1):t==="touchmove"?n.removeEventListener(this.POINTER_MOVE,r,!1):t==="touchend"&&(n.removeEventListener(this.POINTER_UP,r,!1),n.removeEventListener(this.POINTER_CANCEL,r,!1)),this},_addPointerStart:function(n,i,u){var e=r.bind(function(n){if(n.pointerType!=="mouse"&&n.pointerType!==n.MSPOINTER_TYPE_MOUSE)if(this.TAG_WHITE_LIST.indexOf(n.target.tagName)<0)r.DomEvent.preventDefault(n);else return;this._handlePointer(n,i)},this),f;n["_leaflet_touchstart"+u]=e;n.addEventListener(this.POINTER_DOWN,e,!1);this._pointerDocListener||(f=r.bind(this._globalPointerUp,this),t.documentElement.addEventListener(this.POINTER_DOWN,r.bind(this._globalPointerDown,this),!0),t.documentElement.addEventListener(this.POINTER_MOVE,r.bind(this._globalPointerMove,this),!0),t.documentElement.addEventListener(this.POINTER_UP,f,!0),t.documentElement.addEventListener(this.POINTER_CANCEL,f,!0),this._pointerDocListener=!0)},_globalPointerDown:function(n){this._pointers[n.pointerId]=n;this._pointersCount++},_globalPointerMove:function(n){this._pointers[n.pointerId]&&(this._pointers[n.pointerId]=n)},_globalPointerUp:function(n){delete this._pointers[n.pointerId];this._pointersCount--},_handlePointer:function(n,t){n.touches=[];for(var i in this._pointers)n.touches.push(this._pointers[i]);n.changedTouches=[n];t(n)},_addPointerMove:function(n,t,i){var u=r.bind(function(n){(n.pointerType!==n.MSPOINTER_TYPE_MOUSE&&n.pointerType!=="mouse"||n.buttons!==0)&&this._handlePointer(n,t)},this);n["_leaflet_touchmove"+i]=u;n.addEventListener(this.POINTER_MOVE,u,!1)},_addPointerEnd:function(n,t,i){var u=r.bind(function(n){this._handlePointer(n,t)},this);n["_leaflet_touchend"+i]=u;n.addEventListener(this.POINTER_UP,u,!1);n.addEventListener(this.POINTER_CANCEL,u,!1)}});r.Map.mergeOptions({touchZoom:r.Browser.touch&&!r.Browser.android23,bounceAtZoomLimits:!0});r.Map.TouchZoom=r.Handler.extend({addHooks:function(){r.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){r.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(n){var i=this._map,u,f;if(n.touches&&n.touches.length===2&&!i._animatingZoom&&!this._zooming){u=i.mouseEventToContainerPoint(n.touches[0]);f=i.mouseEventToContainerPoint(n.touches[1]);this._centerPoint=i.getSize()._divideBy(2);this._startLatLng=i.containerPointToLatLng(this._centerPoint);i.options.touchZoom!=="center"&&(this._pinchStartLatLng=i.containerPointToLatLng(u.add(f)._divideBy(2)));this._startDist=u.distanceTo(f);this._startZoom=i.getZoom();this._moved=!1;this._zooming=!0;i._stop();r.DomEvent.on(t,"touchmove",this._onTouchMove,this).on(t,"touchend",this._onTouchEnd,this);r.DomEvent.preventDefault(n)}},_onTouchMove:function(n){var u,o;if(n.touches&&n.touches.length===2&&this._zooming){var t=this._map,f=t.mouseEventToContainerPoint(n.touches[0]),e=t.mouseEventToContainerPoint(n.touches[1]),i=f.distanceTo(e)/this._startDist;if(this._zoom=t.getScaleZoom(i,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&i<1||this._zoom>t.getMaxZoom()&&i>1)&&(this._zoom=t._limitZoom(this._zoom)),t.options.touchZoom==="center"){if(this._center=this._startLatLng,i===1)return}else{if(u=f._add(e)._divideBy(2)._subtract(this._centerPoint),i===1&&u.x===0&&u.y===0)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(u),this._zoom)}this._moved||(t._moveStart(!0),this._moved=!0);r.Util.cancelAnimFrame(this._animRequest);o=r.bind(t._move,t,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=r.Util.requestAnimFrame(o,this,!0);r.DomEvent.preventDefault(n)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1;r.Util.cancelAnimFrame(this._animRequest);r.DomEvent.off(t,"touchmove",this._onTouchMove).off(t,"touchend",this._onTouchEnd);this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.snapZoom):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});r.Map.addInitHook("addHandler","touchZoom",r.Map.TouchZoom);r.Map.mergeOptions({tap:!0,tapTolerance:15});r.Map.Tap=r.Handler.extend({addHooks:function(){r.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){r.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(n){if(n.touches){if(r.DomEvent.preventDefault(n),this._fireClick=!0,n.touches.length>1){this._fireClick=!1;clearTimeout(this._holdTimeout);return}var i=n.touches[0],u=i.target;this._startPos=this._newPos=new r.Point(i.clientX,i.clientY);u.tagName&&u.tagName.toLowerCase()==="a"&&r.DomUtil.addClass(u,"leaflet-active");this._holdTimeout=setTimeout(r.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3);this._simulateEvent("mousedown",i);r.DomEvent.on(t,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(n){if(clearTimeout(this._holdTimeout),r.DomEvent.off(t,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&n&&n.changedTouches){var u=n.changedTouches[0],i=u.target;i&&i.tagName&&i.tagName.toLowerCase()==="a"&&r.DomUtil.removeClass(i,"leaflet-active");this._simulateEvent("mouseup",u);this._isTapValid()&&this._simulateEvent("click",u)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(n){var t=n.touches[0];this._newPos=new r.Point(t.clientX,t.clientY);this._simulateEvent("mousemove",t)},_simulateEvent:function(i,r){var u=t.createEvent("MouseEvents");u._simulated=!0;r.target._simulatedClick=!0;u.initMouseEvent(i,!0,!0,n,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null);r.target.dispatchEvent(u)}});r.Browser.touch&&!r.Browser.pointer&&r.Map.addInitHook("addHandler","tap",r.Map.Tap);r.Map.mergeOptions({boxZoom:!0});r.Map.BoxZoom=r.Handler.extend({initialize:function(n){this._map=n;this._container=n._container;this._pane=n._panes.overlayPane},addHooks:function(){r.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){r.DomEvent.off(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_resetState:function(){this._moved=!1},_onMouseDown:function(n){if(!n.shiftKey||n.which!==1&&n.button!==1)return!1;this._resetState();r.DomUtil.disableTextSelection();r.DomUtil.disableImageDrag();this._startPoint=this._map.mouseEventToContainerPoint(n);r.DomEvent.on(t,{contextmenu:r.DomEvent.stop,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(n){this._moved||(this._moved=!0,this._box=r.DomUtil.create("div","leaflet-zoom-box",this._container),r.DomUtil.addClass(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart"));this._point=this._map.mouseEventToContainerPoint(n);var t=new r.Bounds(this._point,this._startPoint),i=t.getSize();r.DomUtil.setPosition(this._box,t.min);this._box.style.width=i.x+"px";this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(r.DomUtil.remove(this._box),r.DomUtil.removeClass(this._container,"leaflet-crosshair"));r.DomUtil.enableTextSelection();r.DomUtil.enableImageDrag();r.DomEvent.off(t,{contextmenu:r.DomEvent.stop,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(n){if((n.which===1||n.button===1)&&(this._finish(),this._moved)){setTimeout(r.bind(this._resetState,this),0);var t=new r.LatLngBounds(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(n){n.keyCode===27&&this._finish()}});r.Map.addInitHook("addHandler","boxZoom",r.Map.BoxZoom);r.Map.mergeOptions({keyboard:!0,keyboardPanDelta:80});r.Map.Keyboard=r.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(n){this._map=n;this._setPanDelta(n.options.keyboardPanDelta);this._setZoomDelta(n.options.zoomDelta)},addHooks:function(){var n=this._map._container;n.tabIndex<=0&&(n.tabIndex="0");r.DomEvent.on(n,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this);this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks();r.DomEvent.off(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this);this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var i=t.body,r=t.documentElement,u=i.scrollTop||r.scrollTop,f=i.scrollLeft||r.scrollLeft;this._map._container.focus();n.scrollTo(f,u)}},_onFocus:function(){this._focused=!0;this._map.fire("focus")},_onBlur:function(){this._focused=!1;this._map.fire("blur")},_setPanDelta:function(n){for(var u=this._panKeys={},i=this.keyCodes,t=0,r=i.left.length;t<r;t++)u[i.left[t]]=[-1*n,0];for(t=0,r=i.right.length;t<r;t++)u[i.right[t]]=[n,0];for(t=0,r=i.down.length;t<r;t++)u[i.down[t]]=[0,n];for(t=0,r=i.up.length;t<r;t++)u[i.up[t]]=[0,-1*n]},_setZoomDelta:function(n){for(var u=this._zoomKeys={},i=this.keyCodes,t=0,r=i.zoomIn.length;t<r;t++)u[i.zoomIn[t]]=n;for(t=0,r=i.zoomOut.length;t<r;t++)u[i.zoomOut[t]]=-n},_addHooks:function(){r.DomEvent.on(t,"keydown",this._onKeyDown,this)},_removeHooks:function(){r.DomEvent.off(t,"keydown",this._onKeyDown,this)},_onKeyDown:function(n){if(!n.altKey&&!n.ctrlKey&&!n.metaKey){var i=n.keyCode,t=this._map,u;if(i in this._panKeys){if(t._panAnim&&t._panAnim._inProgress)return;u=this._panKeys[i];n.shiftKey&&(u=r.point(u).multiplyBy(3));t.panBy(u);t.options.maxBounds&&t.panInsideBounds(t.options.maxBounds)}else if(i in this._zoomKeys)t.setZoom(t.getZoom()+(n.shiftKey?3:1)*this._zoomKeys[i]);else if(i===27)t.closePopup();else return;r.DomEvent.stop(n)}}});r.Map.addInitHook("addHandler","keyboard",r.Map.Keyboard);r.Handler.MarkerDrag=r.Handler.extend({initialize:function(n){this._marker=n},addHooks:function(){var n=this._marker._icon;this._draggable||(this._draggable=new r.Draggable(n,n,!0));this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this).enable();r.DomUtil.addClass(n,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this).disable();this._marker._icon&&r.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(n){var t=this._marker,i=t._shadow,u=r.DomUtil.getPosition(t._icon),f=t._map.layerPointToLatLng(u);i&&r.DomUtil.setPosition(i,u);t._latlng=f;n.latlng=f;t.fire("move",n).fire("drag",n)},_onDragEnd:function(n){this._marker.fire("moveend").fire("dragend",n)}});r.Control=r.Class.extend({options:{position:"topright"},initialize:function(n){r.setOptions(this,n)},getPosition:function(){return this.options.position},setPosition:function(n){var t=this._map;return t&&t.removeControl(this),this.options.position=n,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(n){this.remove();this._map=n;var t=this._container=this.onAdd(n),u=this.getPosition(),i=n._controlCorners[u];return r.DomUtil.addClass(t,"leaflet-control"),u.indexOf("bottom")!==-1?i.insertBefore(t,i.firstChild):i.appendChild(t),this},remove:function(){if(!this._map)return this;if(r.DomUtil.remove(this._container),this.onRemove)this.onRemove(this._map);return this._map=null,this},_refocusOnMap:function(n){this._map&&n&&n.screenX>0&&n.screenY>0&&this._map.getContainer().focus()}});r.control=function(n){return new r.Control(n)};r.Map.include({addControl:function(n){return n.addTo(this),this},removeControl:function(n){return n.remove(),this},_initControlPos:function(){function n(n,f){var e=t+n+" "+t+f;i[n+f]=r.DomUtil.create("div",e,u)}var i=this._controlCorners={},t="leaflet-",u=this._controlContainer=r.DomUtil.create("div",t+"control-container",this._container);n("top","left");n("top","right");n("bottom","left");n("bottom","right")},_clearControlPos:function(){r.DomUtil.remove(this._controlContainer)}});r.Control.Zoom=r.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(n){var i="leaflet-control-zoom",u=r.DomUtil.create("div",i+" leaflet-bar"),t=this.options;this._zoomInButton=this._createButton(t.zoomInText,t.zoomInTitle,i+"-in",u,this._zoomIn);this._zoomOutButton=this._createButton(t.zoomOutText,t.zoomOutTitle,i+"-out",u,this._zoomOut);this._updateDisabled();n.on("zoomend zoomlevelschange",this._updateDisabled,this);return u},onRemove:function(n){n.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(n){this._disabled||this._map.zoomIn(this._map.options.zoomDelta*(n.shiftKey?3:1))},_zoomOut:function(n){this._disabled||this._map.zoomOut(this._map.options.zoomDelta*(n.shiftKey?3:1))},_createButton:function(n,t,i,u,f){var e=r.DomUtil.create("a",i,u);e.innerHTML=n;e.href="#";e.title=t;r.DomEvent.on(e,"mousedown dblclick",r.DomEvent.stopPropagation).on(e,"click",r.DomEvent.stop).on(e,"click",f,this).on(e,"click",this._refocusOnMap,this);return e},_updateDisabled:function(){var n=this._map,t="leaflet-disabled";r.DomUtil.removeClass(this._zoomInButton,t);r.DomUtil.removeClass(this._zoomOutButton,t);(this._disabled||n._zoom===n.getMinZoom())&&r.DomUtil.addClass(this._zoomOutButton,t);(this._disabled||n._zoom===n.getMaxZoom())&&r.DomUtil.addClass(this._zoomInButton,t)}});r.Map.mergeOptions({zoomControl:!0});r.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new r.Control.Zoom,this.addControl(this.zoomControl))});r.control.zoom=function(n){return new r.Control.Zoom(n)};r.Control.Attribution=r.Control.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet<\/a>'},initialize:function(n){r.setOptions(this,n);this._attributions={}},onAdd:function(n){n.attributionControl=this;this._container=r.DomUtil.create("div","leaflet-control-attribution");r.DomEvent&&r.DomEvent.disableClickPropagation(this._container);for(var t in n._layers)n._layers[t].getAttribution&&this.addAttribution(n._layers[t].getAttribution());return this._update(),this._container},setPrefix:function(n){return this.options.prefix=n,this._update(),this},addAttribution:function(n){return n?(this._attributions[n]||(this._attributions[n]=0),this._attributions[n]++,this._update(),this):this},removeAttribution:function(n){return n?(this._attributions[n]&&(this._attributions[n]--,this._update()),this):this},_update:function(){var n,i,t;if(this._map){n=[];for(i in this._attributions)this._attributions[i]&&n.push(i);t=[];this.options.prefix&&t.push(this.options.prefix);n.length&&t.push(n.join(", "));this._container.innerHTML=t.join(" | ")}}});r.Map.mergeOptions({attributionControl:!0});r.Map.addInitHook(function(){this.options.attributionControl&&(new r.Control.Attribution).addTo(this)});r.control.attribution=function(n){return new r.Control.Attribution(n)};r.Control.Scale=r.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(n){var t="leaflet-control-scale",i=r.DomUtil.create("div",t),u=this.options;this._addScales(u,t+"-line",i);n.on(u.updateWhenIdle?"moveend":"move",this._update,this);return n.whenReady(this._update,this),i},onRemove:function(n){n.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(n,t,i){n.metric&&(this._mScale=r.DomUtil.create("div",t,i));n.imperial&&(this._iScale=r.DomUtil.create("div",t,i))},_update:function(){var n=this._map,t=n.getSize().y/2,i=n.distance(n.containerPointToLatLng([0,t]),n.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(i)},_updateScales:function(n){this.options.metric&&n&&this._updateMetric(n);this.options.imperial&&n&&this._updateImperial(n)},_updateMetric:function(n){var t=this._getRoundNum(n),i=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,i,t/n)},_updateImperial:function(n){var t=n*3.2808399,i,r,u;t>5280?(i=t/5280,r=this._getRoundNum(i),this._updateScale(this._iScale,r+" mi",r/i)):(u=this._getRoundNum(t),this._updateScale(this._iScale,u+" ft",u/t))},_updateScale:function(n,t,i){n.style.width=Math.round(this.options.maxWidth*i)+"px";n.innerHTML=t},_getRoundNum:function(n){var i=Math.pow(10,(Math.floor(n)+"").length-1),t=n/i;return t=t>=10?10:t>=5?5:t>=3?3:t>=2?2:1,i*t}});r.control.scale=function(n){return new r.Control.Scale(n)};r.Control.Layers=r.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1},initialize:function(n,t,i){r.setOptions(this,i);this._layers=[];this._lastZIndex=0;this._handlingClick=!1;for(var u in n)this._addLayer(n[u],u);for(u in t)this._addLayer(t[u],u,!0)},onAdd:function(n){this._initLayout();this._update();this._map=n;n.on("zoomend",this._checkDisabledLayers,this);return this._container},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var n in this._layers)this._layers[n].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(n,t){return this._addLayer(n,t),this._map?this._update():this},addOverlay:function(n,t){return this._addLayer(n,t,!0),this._map?this._update():this},removeLayer:function(n){n.off("add remove",this._onLayerChange,this);var t=this._getLayer(r.stamp(n));return this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){r.DomUtil.addClass(this._container,"leaflet-control-layers-expanded");this._form.style.height=null;var n=this._map.getSize().y-(this._container.offsetTop+50);return n<this._form.clientHeight?(r.DomUtil.addClass(this._form,"leaflet-control-layers-scrollbar"),this._form.style.height=n+"px"):r.DomUtil.removeClass(this._form,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return r.DomUtil.removeClass(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var n="leaflet-control-layers",t=this._container=r.DomUtil.create("div",n),i,u;if(t.setAttribute("aria-haspopup",!0),r.DomEvent.disableClickPropagation(t),r.Browser.touch||r.DomEvent.disableScrollPropagation(t),i=this._form=r.DomUtil.create("form",n+"-list"),this.options.collapsed){if(!r.Browser.android)r.DomEvent.on(t,{mouseenter:this.expand,mouseleave:this.collapse},this);if(u=this._layersLink=r.DomUtil.create("a",n+"-toggle",t),u.href="#",u.title="Layers",r.Browser.touch)r.DomEvent.on(u,"click",r.DomEvent.stop).on(u,"click",this.expand,this);else r.DomEvent.on(u,"focus",this.expand,this);r.DomEvent.on(i,"click",function(){setTimeout(r.bind(this._onInputClick,this),0)},this);this._map.on("click",this.collapse,this)}else this.expand();this._baseLayersList=r.DomUtil.create("div",n+"-base",i);this._separator=r.DomUtil.create("div",n+"-separator",i);this._overlaysList=r.DomUtil.create("div",n+"-overlays",i);t.appendChild(i)},_getLayer:function(n){for(var t=0;t<=this._layers.length;t++)if(r.stamp(this._layers[t].layer)===n)return this._layers[t]},_addLayer:function(n,t,i){n.on("add remove",this._onLayerChange,this);this._layers.push({layer:n,name:t,overlay:i});this.options.autoZIndex&&n.setZIndex&&(this._lastZIndex++,n.setZIndex(this._lastZIndex))},_update:function(){if(!this._container)return this;r.DomUtil.empty(this._baseLayersList);r.DomUtil.empty(this._overlaysList);var n,i,u,t,f=0;for(u in this._layers)t=this._layers[u],this._addItem(t),i=i||t.overlay,n=n||!t.overlay,f+=t.overlay?0:1;return this.options.hideSingleBase&&(n=n&&f>1,this._baseLayersList.style.display=n?"":"none"),this._separator.style.display=i&&n?"":"none",this},_onLayerChange:function(n){this._handlingClick||this._update();var t=this._getLayer(r.stamp(n.target)),i=t.overlay?n.type==="add"?"overlayadd":"overlayremove":n.type==="add"?"baselayerchange":null;i&&this._map.fire(i,t)},_createRadioElement:function(n,i){var u='<input type="radio" class="leaflet-control-layers-selector" name="'+n+'"'+(i?' checked="checked"':"")+"/>",r=t.createElement("div");return r.innerHTML=u,r.firstChild},_addItem:function(n){var f=t.createElement("label"),o=this._map.hasLayer(n.layer),i,e,u,s;n.overlay?(i=t.createElement("input"),i.type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=o):i=this._createRadioElement("leaflet-base-layers",o);i.layerId=r.stamp(n.layer);r.DomEvent.on(i,"click",this._onInputClick,this);return e=t.createElement("span"),e.innerHTML=" "+n.name,u=t.createElement("div"),f.appendChild(u),u.appendChild(i),u.appendChild(e),s=n.overlay?this._overlaysList:this._baseLayersList,s.appendChild(f),this._checkDisabledLayers(),f},_onInputClick:function(){var e=this._form.getElementsByTagName("input"),t,i,r,u=[],f=[],n;for(this._handlingClick=!0,n=e.length-1;n>=0;n--)t=e[n],i=this._getLayer(t.layerId).layer,r=this._map.hasLayer(i),t.checked&&!r?u.push(i):!t.checked&&r&&f.push(i);for(n=0;n<f.length;n++)this._map.removeLayer(f[n]);for(n=0;n<u.length;n++)this._map.addLayer(u[n]);this._handlingClick=!1;this._refocusOnMap()},_checkDisabledLayers:function(){for(var u=this._form.getElementsByTagName("input"),r,n,f=this._map.getZoom(),t=u.length-1;t>=0;t--)r=u[t],n=this._getLayer(r.layerId).layer,r.disabled=n.options.minZoom!==i&&f<n.options.minZoom||n.options.maxZoom!==i&&f>n.options.maxZoom},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}});r.control.layers=function(n,t,i){return new r.Control.Layers(n,t,i)};r.PosAnimation=r.Evented.extend({run:function(n,t,i,u){this.stop();this._el=n;this._inProgress=!0;this._duration=i||.25;this._easeOutPower=1/Math.max(u||.5,.2);this._startPos=r.DomUtil.getPosition(n);this._offset=t.subtract(this._startPos);this._startTime=+new Date;this.fire("start");this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=r.Util.requestAnimFrame(this._animate,this);this._step()},_step:function(n){var t=+new Date-this._startTime,i=this._duration*1e3;t<i?this._runFrame(this._easeOut(t/i),n):(this._runFrame(1),this._complete())},_runFrame:function(n,t){var i=this._startPos.add(this._offset.multiplyBy(n));t&&i._round();r.DomUtil.setPosition(this._el,i);this.fire("step")},_complete:function(){r.Util.cancelAnimFrame(this._animId);this._inProgress=!1;this.fire("end")},_easeOut:function(n){return 1-Math.pow(1-n,this._easeOutPower)}});r.Map.include({setView:function(n,t,u){if(t=t===i?this._zoom:this._limitZoom(t),n=this._limitCenter(r.latLng(n),t,this.options.maxBounds),u=u||{},this._stop(),this._loaded&&!u.reset&&u!==!0){u.animate!==i&&(u.zoom=r.extend({animate:u.animate},u.zoom),u.pan=r.extend({animate:u.animate,duration:u.duration},u.pan));var f=this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(n,t,u.zoom):this._tryAnimatedPan(n,u.pan);if(f)return clearTimeout(this._sizeTimer),this}return this._resetView(n,t),this},panBy:function(n,t){if(n=r.point(n).round(),t=t||{},!n.x&&!n.y)return this.fire("moveend");if(t.animate!==!0&&!this.getSize().contains(n))return this._resetView(this.unproject(this.project(this.getCenter()).add(n)),this.getZoom()),this;if(!this._panAnim){this._panAnim=new r.PosAnimation;this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)}if(t.noMoveStart||this.fire("movestart"),t.animate!==!1){r.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(n).round();this._panAnim.run(this._mapPane,i,t.duration||.25,t.easeLinearity)}else this._rawPanBy(n),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){r.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim");this.fire("moveend")},_tryAnimatedPan:function(n,t){var i=this._getCenterOffset(n)._floor();return(t&&t.animate)!==!0&&!this.getSize().contains(i)?!1:(this.panBy(i,t),!0)}});r.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4});o=r.DomUtil.TRANSITION&&r.Browser.any3d&&!r.Browser.mobileOpera;o&&r.Map.addInitHook(function(){if(this._zoomAnimated=this.options.zoomAnimation,this._zoomAnimated){this._createAnimProxy();r.DomEvent.on(this._proxy,r.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}});r.Map.include(o?{_createAnimProxy:function(){var n=this._proxy=r.DomUtil.create("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(n);this.on("zoomanim",function(t){var i=r.DomUtil.TRANSFORM,u=n.style[i];r.DomUtil.setTransform(n,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1));u===n.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this);this.on("load moveend",function(){var i=this.getCenter(),t=this.getZoom();r.DomUtil.setTransform(n,this.project(i,t),this.getZoomScale(t,1))},this)},_catchTransitionEnd:function(n){this._animatingZoom&&n.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(n,t,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var u=this.getZoomScale(t),f=this._getCenterOffset(n)._divideBy(1-1/u);return i.animate!==!0&&!this.getSize().contains(f)?!1:(r.Util.requestAnimFrame(function(){this._moveStart(!0)._animateZoom(n,t,!0)},this),!0)},_animateZoom:function(n,t,i,u){i&&(this._animatingZoom=!0,this._animateToCenter=n,this._animateToZoom=t,r.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"));this.fire("zoomanim",{center:n,zoom:t,noUpdate:u});setTimeout(r.bind(this._onZoomTransitionEnd,this),250)},_onZoomTransitionEnd:function(){this._animatingZoom&&(r.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),r.Util.requestAnimFrame(function(){this._moveEnd(!0)},this))}}:{});r.Map.include({flyTo:function(n,t,u){function w(n){var r=n?-1:1,u=n?v:f,e=v*v-f*f+r*c*c*h*h,o=2*u*c*h,t=e/o,i=Math.sqrt(t*t+1)-t;return i<1e-9?-18:Math.log(i)}function b(n){return(Math.exp(n)-Math.exp(-n))/2}function l(n){return(Math.exp(n)+Math.exp(-n))/2}function g(n){return b(n)/l(n)}function nt(n){return f*(l(e)/l(e+o*n))}function tt(n){return f*(l(e)*g(e+o*n)-b(e))/c}function it(n){return 1-Math.pow(1-n,1.5)}function d(){var i=(Date.now()-rt)/ut,u=it(i)*k;i<=1?(this._flyToFrame=r.Util.requestAnimFrame(d,this),this._move(this.unproject(a.add(y.subtract(a).multiplyBy(tt(u)/h)),s),this.getScaleZoom(f/nt(u),s),{flyTo:!0})):this._move(n,t)._moveEnd(!0)}var e;if(u=u||{},u.animate===!1||!r.Browser.any3d)return this.setView(n,t,u);this._stop();var a=this.project(this.getCenter()),y=this.project(n),p=this.getSize(),s=this._zoom;n=r.latLng(n);t=t===i?s:t;var f=Math.max(p.x,p.y),v=f*this.getZoomScale(s,t),h=y.distanceTo(a)||1,o=1.42,c=o*o;e=w(0);var rt=Date.now(),k=(w(1)-e)/o,ut=u.duration?1e3*u.duration:1e3*k*.8;return this._moveStart(!0),d.call(this),this},flyToBounds:function(n,t){var i=this._getBoundsCenterZoom(n,t);return this.flyTo(i.center,i.zoom,t)}});r.Map.include({_defaultLocateOptions:{timeout:1e4,watch:!1},locate:function(n){if(n=this._locateOptions=r.extend({},this._defaultLocateOptions,n),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=r.bind(this._handleGeolocationResponse,this),i=r.bind(this._handleGeolocationError,this);return n.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,i,n):navigator.geolocation.getCurrentPosition(t,i,n),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(n){var t=n.code,i=n.message||(t===1?"permission denied":t===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld();this.fire("locationerror",{code:t,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(n){var s=n.coords.latitude,h=n.coords.longitude,i=new r.LatLng(s,h),o=i.toBounds(n.coords.accuracy),u=this._locateOptions,f,e,t;u.setView&&(f=this.getBoundsZoom(o),this.setView(i,u.maxZoom?Math.min(f,u.maxZoom):f));e={latlng:i,bounds:o,timestamp:n.timestamp};for(t in n.coords)typeof n.coords[t]=="number"&&(e[t]=n.coords[t]);this.fire("locationfound",e)}})})(window,document);!function(n,t){"object"==(typeof exports=="undefined"?"undefined":_typeof(exports))&&"undefined"!=typeof module?t(exports,require("leaflet")):"function"==typeof define&&define.amd?define(["exports","leaflet"],t):t((n.L=n.L||{},n.L.esri=n.L.esri||{}),n.L)}(this,function(n,t){"use strict";function li(n,t){for(var i=0;i<n.length;i++)if(n[i]!==t[i])return!1;return!0}function tt(n){return li(n[0],n[n.length-1])||n.push(n[0]),n}function it(n){var i,u=0,t=0,f=n.length,r=n[t];for(t;f-1>t;t++)i=n[t+1],u+=(i[0]-r[0])*(i[1]+r[1]),r=i;return u>=0}function ai(n,t,i,r){var o=(r[0]-i[0])*(n[1]-i[1])-(r[1]-i[1])*(n[0]-i[0]),s=(t[0]-n[0])*(n[1]-i[1])-(t[1]-n[1])*(n[0]-i[0]),u=(r[1]-i[1])*(t[0]-n[0])-(r[0]-i[0])*(t[1]-n[1]),f,e;return 0!==u&&(f=o/u,e=s/u,f>=0&&1>=f&&e>=0&&1>=e)?!0:!1}function ht(n,t){for(var r,i=0;i<n.length-1;i++)for(r=0;r<t.length-1;r++)if(ai(n[i],n[i+1],t[r],t[r+1]))return!0;return!1}function vi(n,t){for(var u=!1,i=-1,f=n.length,r=f-1;++i<f;r=i)(n[i][1]<=t[1]&&t[1]<n[r][1]||n[r][1]<=t[1]&&t[1]<n[i][1])&&t[0]<(n[r][0]-n[i][0])*(t[1]-n[i][1])/(n[r][1]-n[i][1])+n[i][0]&&(u=!u);return u}function yi(n,t){var i=ht(n,t),r=vi(n,t[0]);return!(i||!r)}function pi(n){for(var u,l,e,h,c,i,f,r,t=[],o=[],s=0;s<n.length;s++)u=tt(n[s].slice(0)),u.length<4||(it(u)?(l=[u],t.push(l)):o.push(u));for(e=[];o.length;){for(r=o.pop(),h=!1,i=t.length-1;i>=0;i--)if(f=t[i][0],yi(f,r)){t[i].push(r);h=!0;break}h||e.push(r)}for(;e.length;){for(r=e.pop(),c=!1,i=t.length-1;i>=0;i--)if(f=t[i][0],ht(f,r)){t[i].push(r);c=!0;break}c||t.push([r.reverse()])}return 1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}function ct(n){var u=[],f=n.slice(0),i=tt(f.shift().slice(0)),r,t;if(i.length>=4)for(it(i)||i.reverse(),u.push(i),r=0;r<f.length;r++)t=tt(f[r].slice(0)),t.length>=4&&(it(t)&&t.reverse(),u.push(t));return u}function wi(n){for(var u,i,f,r=[],t=0;t<n.length;t++)for(u=ct(n[t]),i=u.length-1;i>=0;i--)f=u[i].slice(0),r.push(f);return r}function lt(n){var i={},t;for(t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i}function at(n,t){var i={};return"number"==typeof n.x&&"number"==typeof n.y&&(i.type="Point",i.coordinates=[n.x,n.y]),n.points&&(i.type="MultiPoint",i.coordinates=n.points.slice(0)),n.paths&&(1===n.paths.length?(i.type="LineString",i.coordinates=n.paths[0].slice(0)):(i.type="MultiLineString",i.coordinates=n.paths.slice(0))),n.rings&&(i=pi(n.rings.slice(0))),(n.geometry||n.attributes)&&(i.type="Feature",i.geometry=n.geometry?at(n.geometry):null,i.properties=n.attributes?lt(n.attributes):null,n.attributes&&(i.id=n.attributes[t]||n.attributes.OBJECTID||n.attributes.FID)),i}function l(n,t){t=t||"OBJECTID";var r,u={wkid:4326},i={};switch(n.type){case"Point":i.x=n.coordinates[0];i.y=n.coordinates[1];i.spatialReference=u;break;case"MultiPoint":i.points=n.coordinates.slice(0);i.spatialReference=u;break;case"LineString":i.paths=[n.coordinates.slice(0)];i.spatialReference=u;break;case"MultiLineString":i.paths=n.coordinates.slice(0);i.spatialReference=u;break;case"Polygon":i.rings=ct(n.coordinates.slice(0));i.spatialReference=u;break;case"MultiPolygon":i.rings=wi(n.coordinates.slice(0));i.spatialReference=u;break;case"Feature":n.geometry&&(i.geometry=l(n.geometry,t));i.attributes=n.properties?lt(n.properties):{};n.id&&(i.attributes[t]=n.id);break;case"FeatureCollection":for(i=[],r=0;r<n.features.length;r++)i.push(l(n.features[r],t));break;case"GeometryCollection":for(i=[],r=0;r<n.geometries.length;r++)i.push(l(n.geometries[r],t))}return i}function rt(n,t){return l(n,t)}function vt(n,t){return at(n,t)}function bi(n){var i={},t;for(t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i}function ki(n){var i=t.latLng(n.ymin,n.xmin),r=t.latLng(n.ymax,n.xmax);return t.latLngBounds(i,r)}function di(n){return n=t.latLngBounds(n),{xmin:n.getSouthWest().lng,ymin:n.getSouthWest().lat,xmax:n.getNorthEast().lng,ymax:n.getNorthEast().lat,spatialReference:{wkid:4326}}}function gi(n,t){var i,r,e,u,f,o;if(t)i=t;else if(n.objectIdFieldName)i=n.objectIdFieldName;else if(n.fields){for(r=0;r<=n.fields.length-1;r++)if("esriFieldTypeOID"===n.fields[r].type){i=n.fields[r].name;break}}else i="OBJECTID";if(e={type:"FeatureCollection",features:[]},u=n.features||n.results,u.length)for(f=u.length-1;f>=0;f--)o=vt(u[f],i),e.features.push(o);return e}function e(n){return n=t.Util.trim(n),"/"!==n[n.length-1]&&(n+="/"),n}function nr(n){return/\.arcgis\.com.*?FeatureServer/g.test(n)}function tr(n){var t;switch(n){case"Point":t="esriGeometryPoint";break;case"MultiPoint":t="esriGeometryMultipoint";break;case"LineString":t="esriGeometryPolyline";break;case"MultiLineString":t="esriGeometryPolyline";break;case"Polygon":t="esriGeometryPolygon";break;case"MultiPolygon":t="esriGeometryPolygon"}return t}function a(){console&&console.warn&&console.warn.apply(console,arguments)}function v(n){var i="",r,f,t,u;n.f=n.f||"json";for(r in n)n.hasOwnProperty(r)&&(t=n[r],u=Object.prototype.toString.call(t),i.length&&(i+="&"),f="[object Array]"===u?"[object Object]"===Object.prototype.toString.call(t[0])?JSON.stringify(t):t.join(","):"[object Object]"===u?JSON.stringify(t):"[object Date]"===u?t.valueOf():t,i+=encodeURIComponent(r)+"="+encodeURIComponent(f));return i}function ut(n,i){var r=new window.XMLHttpRequest;return r.onerror=function(){r.onreadystatechange=t.Util.falseFn;n.call(i,{error:{code:500,message:"XMLHttpRequest error"}},null)},r.onreadystatechange=function(){var u,f;if(4===r.readyState){try{u=JSON.parse(r.responseText)}catch(e){u=null;f={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!f&&u.error&&(f=u.error,u=null);r.onerror=t.Util.falseFn;n.call(i,f,u)}},r.ontimeout=function(){this.onerror()},r}function yt(n,t,i,r){var u=ut(i,r);return u.open("POST",n),"undefined"!=typeof r&&null!==r&&"undefined"!=typeof r.options&&(u.timeout=r.options.timeout),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),u.send(v(t)),u}function pt(n,t,i,r){var u=ut(i,r);return u.open("GET",n+"?"+v(t),!0),"undefined"!=typeof r&&null!==r&&"undefined"!=typeof r.options&&(u.timeout=r.options.timeout),u.send(null),u}function wt(n,t,i,r){var e=v(t),u=ut(i,r),f=(n+"?"+e).length;if(2e3>=f&&o.cors?u.open("GET",n+"?"+e):f>2e3&&o.cors&&(u.open("POST",n),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded")),"undefined"!=typeof r&&null!==r&&"undefined"!=typeof r.options&&(u.timeout=r.options.timeout),2e3>=f&&o.cors)u.send(null);else{if(!(f>2e3&&o.cors))return 2e3>=f&&!o.cors?y(n,t,i,r):void a("a request to "+n+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html");u.send(e)}return u}function y(n,i,r,u){var f,e;return window._EsriLeafletCallbacks=window._EsriLeafletCallbacks||{},f="c"+ti,i.callback="window._EsriLeafletCallbacks."+f,window._EsriLeafletCallbacks[f]=function(n){if(window._EsriLeafletCallbacks[f]!==!0){var t,i=Object.prototype.toString.call(n);"[object Object]"!==i&&"[object Array]"!==i&&(t={error:{code:500,message:"Expected array or object as JSONP response"}},n=null);!t&&n.error&&(t=n,n=null);r.call(u,t,n);window._EsriLeafletCallbacks[f]=!0}},e=t.DomUtil.create("script",null,document.body),e.type="text/javascript",e.src=n+"?"+v(i),e.id=f,ti++,{id:f,url:e.src,abort:function(){window._EsriLeafletCallbacks._callback[f]({code:0,message:"Request aborted."})}}}function ir(n){return new s(n)}function p(n){return new ii(n)}function bt(n){return new ri(n)}function rr(n){return new d(n)}function kt(n){return new ui(n)}function dt(n){return new fi(n)}function ur(n){return new h(n)}function ft(n){return new ei(n)}function gt(n){return new oi(n)}function ni(n){return new si(n)}function fr(n){return new lr(n)}function er(n,t){return new g(n,t)}function or(n,t){return new et(n,t)}function sr(n,t){return new hi(n,t)}function hr(n,t){return new ci(n,t)}function u(n){this.values=[].concat(n||[])}function cr(n){return new st(n)}var c,st;t="default"in t?t["default"]:t;var w=window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest,f=""===document.documentElement.style.pointerEvents,o={cors:w,pointerEvents:f},r={shallowClone:bi,warn:a,cleanUrl:e,isArcgisOnline:nr,geojsonTypeToArcGIS:tr,responseToFeatureCollection:gi,geojsonToArcGIS:rt,arcgisToGeoJSON:vt,boundsToExtent:di,extentToBounds:ki},ti=0,b=o.cors?pt:y;b.CORS=pt;b.JSONP=y;var k={request:wt,get:b,post:yt},s=t.Class.extend({options:{proxy:!1,useCors:w},generateSetter:function(n,i){return t.Util.bind(function(t){return this.params[n]=t,this},i)},initialize:function(n){var i,r;if(n.request&&n.options?(this._service=n,t.Util.setOptions(this,n.options)):(t.Util.setOptions(this,n),this.options.url=e(n.url)),this.params=t.Util.extend({},this.params||{}),this.setters)for(i in this.setters)r=this.setters[i],this[i]=this.generateSetter(r,this)},token:function(n){return this._service?this._service.authenticate(n):this.params.token=n,this},request:function(n,t){return this._service?this._service.request(this.path,this.params,n,t):this._request("request",this.path,this.params,n,t)},_request:function(n,t,i,r,u){var f=this.options.proxy?this.options.proxy+"?"+this.options.url+t:this.options.url+t;return"get"!==n&&"request"!==n||this.options.useCors?k[n](f,i,r,u):k.get.JSONP(f,i,r,u)}}),ii=s.extend({setters:{offset:"offset",limit:"limit",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSr:4326,outFields:"*"},within:function(n){return this._setGeometry(n),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(n){return this._setGeometry(n),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(n){return this._setGeometry(n),this.params.spatialRel="esriSpatialRelWithin",this},crosses:function(n){return this._setGeometry(n),this.params.spatialRel="esriSpatialRelCrosses",this},touches:function(n){return this._setGeometry(n),this.params.spatialRel="esriSpatialRelTouches",this},overlaps:function(n){return this._setGeometry(n),this.params.spatialRel="esriSpatialRelOverlaps",this},nearby:function(n,i){return n=t.latLng(n),this.params.geometry=[n.lng,n.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=i,this.params.inSr=4326,this},where:function(n){return this.params.where=n,this},between:function(n,t){return this.params.time=[n.valueOf(),t.valueOf()],this},simplify:function(n,t){var i=Math.abs(n.getBounds().getWest()-n.getBounds().getEast());return this.params.maxAllowableOffset=i/n.getSize().y*t,this},orderBy:function(n,t){return t=t||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[n,t].join(" "),this},run:function(n,t){return this._cleanParams(),r.isArcgisOnline(this.options.url)?(this.params.f="geojson",this.request(function(i,r){this._trapSQLerrors(i);n.call(t,i,r,r)},this)):this.request(function(i,u){this._trapSQLerrors(i);n.call(t,i,u&&r.responseToFeatureCollection(u),u)},this)},count:function(n,t){return this._cleanParams(),this.params.returnCountOnly=!0,this.request(function(t,i){n.call(this,t,i&&i.count,i)},t)},ids:function(n,t){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request(function(t,i){n.call(this,t,i&&i.objectIds,i)},t)},bounds:function(n,t){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request(function(i,u){n.call(t,i,u&&u.extent&&r.extentToBounds(u.extent),u)},t)},pixelSize:function(n){return n=t.point(n),this.params.pixelSize=[n.x,n.y],this},layer:function(n){return this.path=n+"/query",this},_trapSQLerrors:function(n){n&&"400"===n.code&&r.warn("one common syntax error in query requests is encasing string values in double quotes instead of single quotes")},_cleanParams:function(){delete this.params.returnIdsOnly;delete this.params.returnExtentOnly;delete this.params.returnCountOnly},_setGeometry:function(n){return this.params.inSr=4326,n instanceof t.LatLngBounds?(this.params.geometry=r.boundsToExtent(n),void(this.params.geometryType="esriGeometryEnvelope")):(n.getLatLng&&(n=n.getLatLng()),n instanceof t.LatLng&&(n={type:"Point",coordinates:[n.lng,n.lat]}),n instanceof t.GeoJSON&&(n=n.getLayers()[0].feature.geometry,this.params.geometry=r.geojsonToArcGIS(n),this.params.geometryType=r.geojsonTypeToArcGIS(n.type)),n.toGeoJSON&&(n=n.toGeoJSON()),"Feature"===n.type&&(n=n.geometry),"Point"===n.type||"LineString"===n.type||"Polygon"===n.type?(this.params.geometry=r.geojsonToArcGIS(n),void(this.params.geometryType=r.geojsonTypeToArcGIS(n.type))):void r.warn("invalid geometry passed to spatial query. Should be an L.LatLng, L.LatLngBounds or L.Marker or a GeoJSON Point Line or Polygon object"))}}),ri=s.extend({setters:{contains:"contains",text:"searchText",fields:"searchFields",spatialReference:"sr",sr:"sr",layers:"layers",returnGeometry:"returnGeometry",maxAllowableOffset:"maxAllowableOffset",precision:"geometryPrecision",dynamicLayers:"dynamicLayers",returnZ:"returnZ",returnM:"returnM",gdbVersion:"gdbVersion",token:"token"},path:"find",params:{sr:4326,contains:!0,returnGeometry:!0,returnZ:!0,returnM:!1},layerDefs:function(n,t){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[n,t].join(":"),this},simplify:function(n,t){var i=Math.abs(n.getBounds().getWest()-n.getBounds().getEast());return this.params.maxAllowableOffset=i/n.getSize().y*t,this},run:function(n,t){return this.request(function(i,u){n.call(t,i,u&&r.responseToFeatureCollection(u),u)},t)}}),d=s.extend({path:"identify",between:function(n,t){return this.params.time=[n.valueOf(),t.valueOf()],this}}),ui=d.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(n){var t=r.boundsToExtent(n.getBounds()),i=n.getSize();return this.params.imageDisplay=[i.x,i.y,96],this.params.mapExtent=[t.xmin,t.ymin,t.xmax,t.ymax],this},at:function(n){return n=t.latLng(n),this.params.geometry=[n.lng,n.lat],this.params.geometryType="esriGeometryPoint",this},layerDef:function(n,t){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[n,t].join(":"),this},simplify:function(n,t){var i=Math.abs(n.getBounds().getWest()-n.getBounds().getEast());return this.params.maxAllowableOffset=i/n.getSize().y*(1-t),this},run:function(n,t){return this.request(function(i,u){var e,f,o;if(i)return void n.call(t,i,void 0,u);for(e=r.responseToFeatureCollection(u),u.results=u.results.reverse(),f=0;f<e.features.length;f++)o=e.features[f],o.layerId=u.results[f].layerId;n.call(t,void 0,e,u)})}}),fi=d.extend({setters:{setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setPixelSize:"pixelSize",returnCatalogItems:"returnCatalogItems",returnGeometry:"returnGeometry"},params:{returnGeometry:!1},at:function(n){return n=t.latLng(n),this.params.geometry=JSON.stringify({x:n.lng,y:n.lat,spatialReference:{wkid:4326}}),this.params.geometryType="esriGeometryPoint",this},getMosaicRule:function(){return this.params.mosaicRule},getRenderingRule:function(){return this.params.renderingRule},getPixelSize:function(){return this.params.pixelSize},run:function(n,t){return this.request(function(i,r){n.call(t,i,r&&this._responseToGeoJSON(r),r)},this)},_responseToGeoJSON:function(n){var f=n.location,e=n.catalogItems,u=n.catalogItemVisibilities,t={pixel:{type:"Feature",geometry:{type:"Point",coordinates:[f.x,f.y]},crs:{type:"EPSG",properties:{code:f.spatialReference.wkid}},properties:{OBJECTID:n.objectId,name:n.name,value:n.value},id:n.objectId}},i;if(n.properties&&n.properties.Values&&(t.pixel.properties.values=n.properties.Values),e&&e.features&&(t.catalogItems=r.responseToFeatureCollection(e),u&&u.length===t.catalogItems.features.length))for(i=u.length-1;i>=0;i--)t.catalogItems.features[i].properties.catalogItemVisibility=u[i];return t}}),h=t.Evented.extend({options:{proxy:!1,useCors:w,timeout:0},initialize:function(n){n=n||{};this._requestQueue=[];this._authenticating=!1;t.Util.setOptions(this,n);this.options.url=e(this.options.url)},get:function(n,t,i,r){return this._request("get",n,t,i,r)},post:function(n,t,i,r){return this._request("post",n,t,i,r)},request:function(n,t,i,r){return this._request("request",n,t,i,r)},metadata:function(n,t){return this._request("get","",{},n,t)},authenticate:function(n){return this._authenticating=!1,this.options.token=n,this._runQueue(),this},getTimeout:function(){return this.options.timeout},setTimeout:function(n){this.options.timeout=n},_request:function(n,t,i,r,u){var f,e;return(this.fire("requeststart",{url:this.options.url+t,params:i,method:n},!0),f=this._createServiceCallback(n,t,i,r,u),this.options.token&&(i.token=this.options.token),this._authenticating)?void this._requestQueue.push([n,t,i,r,u]):(e=this.options.proxy?this.options.proxy+"?"+this.options.url+t:this.options.url+t,"get"!==n&&"request"!==n||this.options.useCors?k[n](e,i,f,u):k.get.JSONP(e,i,f,u))},_createServiceCallback:function(n,i,r,u,f){return t.Util.bind(function(e,o){e&&(499===e.code||498===e.code)&&(this._authenticating=!0,this._requestQueue.push([n,i,r,u,f]),this.fire("authenticationrequired",{authenticate:t.Util.bind(this.authenticate,this)},!0),e.authenticate=t.Util.bind(this.authenticate,this));u.call(f,e,o);e?this.fire("requesterror",{url:this.options.url+i,params:r,message:e.message,code:e.code,method:n},!0):this.fire("requestsuccess",{url:this.options.url+i,params:r,response:o,method:n},!0);this.fire("requestend",{url:this.options.url+i,params:r,method:n},!0)},this)},_runQueue:function(){for(var t,i,n=this._requestQueue.length-1;n>=0;n--)t=this._requestQueue[n],i=t.shift(),this[i].apply(this,t);this._requestQueue=[]}}),ei=h.extend({identify:function(){return kt(this)},find:function(){return bt(this)},query:function(){return p(this)}}),oi=h.extend({query:function(){return p(this)},identify:function(){return dt(this)}}),si=h.extend({options:{idAttribute:"OBJECTID"},query:function(){return p(this)},addFeature:function(n,t,i){return delete n.id,n=rt(n),this.post("addFeatures",{features:[n]},function(n,r){var u=r&&r.addResults?r.addResults[0]:void 0;t&&t.call(i,n||r.addResults[0].error,u)},i)},updateFeature:function(n,t,i){return n=rt(n,this.options.idAttribute),this.post("updateFeatures",{features:[n]},function(n,r){var u=r&&r.updateResults?r.updateResults[0]:void 0;t&&t.call(i,n||r.updateResults[0].error,u)},i)},deleteFeature:function(n,t,i){return this.post("deleteFeatures",{objectIds:n},function(n,r){var u=r&&r.deleteResults?r.deleteResults[0]:void 0;t&&t.call(i,n||r.deleteResults[0].error,u)},i)},deleteFeatures:function(n,t,i){return this.post("deleteFeatures",{objectIds:n},function(n,r){var u=r&&r.deleteResults?r.deleteResults:void 0;t&&t.call(i,n||r.deleteResults[0].error,u)},i)}}),lr=t.Control.extend({options:{position:"bottomright",marginTop:0,marginLeft:0,marginBottom:0,marginRight:0},onAdd:function(){var n=t.DomUtil.create("div","esri-leaflet-logo");return n.style.marginTop=this.options.marginTop,n.style.marginLeft=this.options.marginLeft,n.style.marginBottom=this.options.marginBottom,n.style.marginRight=this.options.marginRight,n.innerHTML='<a href="http://www.esri.com" target="_blank" style="border: none;"><img src="https://js.arcgis.com/3.13/esri/images/map/logo-sm.png" alt="Powered by Esri" style="border: none;"><\/a>',n}}),i="https:"!==window.location.protocol?"http:":"https:",g=t.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",attributionUrl:"https://static.arcgis.com/attribution/World_Street_Map",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"Esri"}},Topographic:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",attributionUrl:"https://static.arcgis.com/attribution/World_Topo_Map",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"Esri"}},Oceans:{urlTemplate:i+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}",attributionUrl:"https://static.arcgis.com/attribution/Ocean_Basemap",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri"}},OceansLabels:{urlTemplate:i+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],pane:f?"esri-labels":"tilePane"}},NationalGeographic:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"National Geographic, Esri, DeLorme, HERE, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp."}},DarkGray:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri, HERE, DeLorme, MapmyIndia, © OpenStreetMap contributors"}},DarkGrayLabels:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],pane:f?"esri-labels":"tilePane"}},Gray:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"Esri, HERE, DeLorme, MapmyIndia, © OpenStreetMap contributors"}},GrayLabels:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:16,subdomains:["server","services"],pane:f?"esri-labels":"tilePane"}},Imagery:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"Esri, DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community"}},ImageryLabels:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],pane:f?"esri-labels":"tilePane"}},ImageryTransportation:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:19,subdomains:["server","services"],pane:f?"esri-labels":"tilePane"}},ShadedRelief:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"Esri, USGS"}},ShadedReliefLabels:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:12,subdomains:["server","services"],pane:f?"esri-labels":"tilePane"}},Terrain:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"Esri, USGS, NOAA"}},TerrainLabels:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!0,logoPosition:"bottomright",minZoom:1,maxZoom:13,subdomains:["server","services"],pane:f?"esri-labels":"tilePane"}},USATopo:{urlTemplate:i+"//{s}.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}",options:{hideLogo:!1,logoPosition:"bottomright",minZoom:1,maxZoom:15,subdomains:["server","services"],attribution:"National Geographic Society, i-cubed"}}}},initialize:function(n,i){var r,u;if("object"==(typeof n=="undefined"?"undefined":_typeof(n))&&n.urlTemplate&&n.options)r=n;else{if("string"!=typeof n||!g.TILES[n])throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ShadedRelief", "ShadedReliefLabels", "Terrain" or "TerrainLabels"');r=g.TILES[n]}u=t.Util.extend(r.options,i);t.Util.setOptions(this,u);t.TileLayer.prototype.initialize.call(this,r.urlTemplate,u);r.attributionUrl&&this._getAttributionData(r.attributionUrl);this._logo=fr({position:this.options.logoPosition})},onAdd:function(n){this.options.hideLogo||n._hasEsriLogo||(this._logo.addTo(n),n._hasEsriLogo=!0);"esri-labels"===this.options.pane&&this._initPane();n.on("moveend",this._updateMapAttribution,this);t.TileLayer.prototype.onAdd.call(this,n)},onRemove:function(n){this._logo&&this._logo._container&&(n.removeControl(this._logo),n._hasEsriLogo=!1);n.off("moveend",this._updateMapAttribution,this);t.TileLayer.prototype.onRemove.call(this,n)},getAttribution:function(){if(this.options.attribution)var n='<span class="esri-attributions" style="line-height:14px; vertical-align: -3px; text-overflow:ellipsis; white-space:nowrap; overflow:hidden; display:inline-block;">'+this.options.attribution+"<\/span>";return n},_initPane:function(){if(!this._map.getPane(this.options.pane)){var n=this._map.createPane(this.options.pane);n.style.pointerEvents="none";n.style.zIndex=500}},_getAttributionData:function(n){y(n,{},t.Util.bind(function(n,i){var u,f,e;if(!n){for(this._attributions=[],u=0;u<i.contributors.length;u++)for(f=i.contributors[u],e=0;e<f.coverageAreas.length;e++){var r=f.coverageAreas[e],o=t.latLng(r.bbox[0],r.bbox[1]),s=t.latLng(r.bbox[2],r.bbox[3]);this._attributions.push({attribution:f.attribution,score:r.score,bounds:t.latLngBounds(o,s),minZoom:r.zoomMin,maxZoom:r.zoomMax})}this._attributions.sort(function(n,t){return t.score-n.score});this._updateMapAttribution()}},this))},_updateMapAttribution:function(){var t,r,u;if(this._map&&this._map.attributionControl&&this._attributions){for(var n="",e=this._map.getBounds(),f=this._map.getZoom(),i=0;i<this._attributions.length;i++)t=this._attributions[i],r=t.attribution,!n.match(r)&&e.intersects(t.bounds)&&f>=t.minZoom&&f<=t.maxZoom&&(n+=", "+r);n=n.substr(2);u=this._map.attributionControl._container.querySelector(".esri-attributions");u.innerHTML=n;u.style.maxWidth=.65*this._map.getSize().x+"px";this.fire("attributionupdated",{attribution:n})}}}),et=t.TileLayer.extend({options:{zoomOffsetAllowance:.1},statics:{MercatorZoomLevels:{0:156543.033928,1:78271.5169639999,2:39135.7584820001,3:19567.8792409999,4:9783.93962049996,5:4891.96981024998,6:2445.98490512499,7:1222.99245256249,8:611.49622628138,9:305.748113140558,10:152.874056570411,11:76.4370282850732,12:38.2185141425366,13:19.1092570712683,14:9.55462853563415,15:4.77731426794937,16:2.38865713397468,17:1.19432856685505,18:.597164283559817,19:.298582141647617,20:.14929107082381,21:.07464553541191,22:.0373227677059525,23:.0186613838529763}},initialize:function(n){n.url=e(n.url);n=t.Util.setOptions(this,n);this.tileUrl=n.url+"tile/{z}/{y}/{x}";this.service=ft(n);this.service.addEventParent(this);var i=new RegExp(/tiles.arcgis(online)?\.com/g);i.test(n.url)&&(this.tileUrl=this.tileUrl.replace("://tiles","://tiles{s}"),n.subdomains=["1","2","3","4"]);this.options.token&&(this.tileUrl+="?token="+this.options.token);t.TileLayer.prototype.initialize.call(this,this.tileUrl,n)},getTileUrl:function(n){return t.Util.template(this.tileUrl,t.extend({s:this._getSubdomain(n),z:this._lodMap&&this._lodMap[n.z]?this._lodMap[n.z]:n.z,x:n.x,y:n.y},this.options))},createTile:function(n,i){var r=document.createElement("img");return t.DomEvent.on(r,"load",t.bind(this._tileOnLoad,this,i,r)),t.DomEvent.on(r,"error",t.bind(this._tileOnError,this,i,r)),this.options.crossOrigin&&(r.crossOrigin=""),r.alt="",!this._lodMap||this._lodMap&&this._lodMap[n.z]?r.src=this.getTileUrl(n):this.once("lodmap",function(){r.src=this.getTileUrl(n)},this),r},onAdd:function(n){n.options.crs!==t.CRS.EPSG3857||this._lodMap||(this._lodMap={},this.metadata(function(n,t){var i,u,f,s;if(!n)if(i=t.spatialReference.latestWkid||t.spatialReference.wkid,102100===i||3857===i){for(var e=t.tileInfo.lods,o=et.MercatorZoomLevels,r=0;r<e.length;r++){u=e[r];for(f in o)if(s=o[f],this._withinPercentage(u.resolution,s,this.options.zoomOffsetAllowance)){this._lodMap[f]=u.level;break}}this.fire("lodmap")}else a("L.esri.TiledMapLayer is using a non-mercator spatial reference. Support may be available through Proj4Leaflet http://esri.github.io/esri-leaflet/examples/non-mercator-projection.html")},this));t.TileLayer.prototype.onAdd.call(this,n)},metadata:function(n,t){return this.service.metadata(n,t),this},identify:function(){return this.service.identify()},find:function(){return this.service.find()},query:function(){return this.service.query()},authenticate:function(n){var t="?token="+n;return this.tileUrl=this.options.token?this.tileUrl.replace(/\?token=(.+)/g,t):this.tileUrl+t,this.options.token=n,this.service.authenticate(n),this},_withinPercentage:function(n,t,i){var r=Math.abs(n/t-1);return i>r}}),ar=t.ImageOverlay.extend({onAdd:function(n){this._topLeft=n.getPixelBounds().min;t.ImageOverlay.prototype.onAdd.call(this,n)},_reset:function(){this._map.options.crs===t.CRS.EPSG3857?t.ImageOverlay.prototype._reset.call(this):t.DomUtil.setPosition(this._image,this._topLeft.subtract(this._map.getPixelOrigin()))}}),ot=t.Layer.extend({options:{opacity:1,position:"front",f:"image",useCors:w,attribution:null,interactive:!1,alt:""},onAdd:function(n){this._update=t.Util.throttle(this._update,this.options.updateInterval,this);n.on("moveend",this._update,this);this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?n.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null);this._update();this._popup&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this))},onRemove:function(){this._currentImage&&this._map.removeLayer(this._currentImage);this._popup&&(this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this));this._map.off("moveend",this._update,this)},bindPopup:function(n,i){return this._shouldRenderPopup=!1,this._lastClick=!1,this._popup=t.popup(i),this._popupFunction=n,this._map&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this},unbindPopup:function(){return this._map&&(this._map.closePopup(this._popup),this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._popup=!1,this},bringToFront:function(){return this.options.position="front",this._currentImage&&this._currentImage.bringToFront(),this},bringToBack:function(){return this.options.position="back",this._currentImage&&this._currentImage.bringToBack(),this},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(n){return this.options.opacity=n,this._currentImage.setOpacity(n),this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(n,t){return this.options.from=n,this.options.to=t,this._update(),this},metadata:function(n,t){return this.service.metadata(n,t),this},authenticate:function(n){return this.service.authenticate(n),this},_renderImage:function(n,t){if(this._map){var i=new ar(n,t,{opacity:0,crossOrigin:this.options.useCors,alt:this.options.alt,pane:this.options.pane||this.getPane(),interactive:this.options.interactive}).addTo(this._map);i.once("load",function(n){if(this._map){var r=n.target,i=this._currentImage;r._bounds.equals(t)&&r._bounds.equals(this._map.getBounds())?(this._currentImage=r,"front"===this.options.position?this.bringToFront():this.bringToBack(),this._map&&this._currentImage._map?this._currentImage.setOpacity(this.options.opacity):this._currentImage._map.removeLayer(this._currentImage),i&&this._map&&this._map.removeLayer(i),i&&i._map&&i._map.removeLayer(i)):this._map.removeLayer(r)}this.fire("load",{bounds:t})},this);this.fire("loading",{bounds:t})}},_update:function(){var n,t,i;if(this._map&&(n=this._map.getZoom(),t=this._map.getBounds(),!(this._animatingZoom||this._map._panTransition&&this._map._panTransition._inProgress))){if(n>this.options.maxZoom||n<this.options.minZoom)return void this._currentImage._map.removeLayer(this._currentImage);i=this._buildExportParams();this._requestExport(i,t)}},_renderPopup:function(n,i,r,u){if(n=t.latLng(n),this._shouldRenderPopup&&this._lastClick.equals(n)){var f=this._popupFunction(i,r,u);f&&this._popup.setLatLng(n).setContent(f).openOn(this._map)}},_resetPopupState:function(n){this._shouldRenderPopup=!1;this._lastClick=n.latlng}}),hi=ot.extend({options:{updateInterval:150,format:"jpgpng",transparent:!0,f:"json"},query:function(){return this.service.query()},identify:function(){return this.service.identify()},initialize:function(n){n.url=e(n.url);this.service=gt(n);this.service.addEventParent(this);t.Util.setOptions(this,n)},setPixelType:function(n){return this.options.pixelType=n,this._update(),this},getPixelType:function(){return this.options.pixelType},setBandIds:function(n){return this.options.bandIds=t.Util.isArray(n)?n.join(","):n.toString(),this._update(),this},getBandIds:function(){return this.options.bandIds},setNoData:function(n,i){return this.options.noData=t.Util.isArray(n)?n.join(","):n.toString(),i&&(this.options.noDataInterpretation=i),this._update(),this},getNoData:function(){return this.options.noData},getNoDataInterpretation:function(){return this.options.noDataInterpretation},setRenderingRule:function(n){this.options.renderingRule=n;this._update()},getRenderingRule:function(){return this.options.renderingRule},setMosaicRule:function(n){this.options.mosaicRule=n;this._update()},getMosaicRule:function(){return this.options.mosaicRule},_getPopupData:function(n){var r=t.Util.bind(function(i,r,u){i||setTimeout(t.Util.bind(function(){this._renderPopup(n.latlng,i,r,u)},this),300)},this),i=this.identify().at(n.latlng);this.options.mosaicRule&&i.setMosaicRule(this.options.mosaicRule);i.run(r);this._shouldRenderPopup=!0;this._lastClick=n.latlng},_buildExportParams:function(){var t=this._map.getBounds(),i=this._map.getSize(),u=this._map.options.crs.project(t._northEast),f=this._map.options.crs.project(t._southWest),e=this._map.latLngToLayerPoint(t._northEast),o=this._map.latLngToLayerPoint(t._southWest),r,n;return(e.y>0||o.y<i.y)&&(i.y=o.y-e.y),r=parseInt(this._map.options.crs.code.split(":")[1],10),n={bbox:[f.x,f.y,u.x,u.y].join(","),size:i.x+","+i.y,format:this.options.format,transparent:this.options.transparent,bboxSR:r,imageSR:r},this.options.from&&this.options.to&&(n.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.options.pixelType&&(n.pixelType=this.options.pixelType),this.options.interpolation&&(n.interpolation=this.options.interpolation),this.options.compressionQuality&&(n.compressionQuality=this.options.compressionQuality),this.options.bandIds&&(n.bandIds=this.options.bandIds),this.options.noData&&(n.noData=this.options.noData),this.options.noDataInterpretation&&(n.noDataInterpretation=this.options.noDataInterpretation),this.service.options.token&&(n.token=this.service.options.token),this.options.renderingRule&&(n.renderingRule=JSON.stringify(this.options.renderingRule)),this.options.mosaicRule&&(n.mosaicRule=JSON.stringify(this.options.mosaicRule)),n},_requestExport:function(n,i){"json"===this.options.f?this.service.request("exportImage",n,function(n,t){n||this._renderImage(t.href,i)},this):(n.f="image",this._renderImage(this.options.url+"exportImage"+t.Util.getParamString(n),i))}}),ci=ot.extend({options:{updateInterval:150,layers:!1,layerDefs:!1,timeOptions:!1,format:"png24",transparent:!0,f:"json"},initialize:function(n){n.url=e(n.url);this.service=ft(n);this.service.addEventParent(this);(n.proxy||n.token)&&"json"!==n.f&&(n.f="json");t.Util.setOptions(this,n)},getDynamicLayers:function(){return this.options.dynamicLayers},setDynamicLayers:function(n){return this.options.dynamicLayers=n,this._update(),this},getLayers:function(){return this.options.layers},setLayers:function(n){return this.options.layers=n,this._update(),this},getLayerDefs:function(){return this.options.layerDefs},setLayerDefs:function(n){return this.options.layerDefs=n,this._update(),this},getTimeOptions:function(){return this.options.timeOptions},setTimeOptions:function(n){return this.options.timeOptions=n,this._update(),this},query:function(){return this.service.query()},identify:function(){return this.service.identify()},find:function(){return this.service.find()},_getPopupData:function(n){var r=t.Util.bind(function(i,r,u){i||setTimeout(t.Util.bind(function(){this._renderPopup(n.latlng,i,r,u)},this),300)},this),i=this.identify().on(this._map).at(n.latlng);this.options.layers?i.layers("visible:"+this.options.layers.join(",")):i.layers("visible");i.run(r);this._shouldRenderPopup=!0;this._lastClick=n.latlng},_buildExportParams:function(){var t=this._map.getBounds(),i=this._map.getSize(),r=this._map.options.crs.project(t.getNorthEast()),u=this._map.options.crs.project(t.getSouthWest()),f=parseInt(this._map.options.crs.code.split(":")[1],10),e=this._map.latLngToLayerPoint(t._northEast),o=this._map.latLngToLayerPoint(t._southWest),n;return(e.y>0||o.y<i.y)&&(i.y=o.y-e.y),n={bbox:[u.x,u.y,r.x,r.y].join(","),size:i.x+","+i.y,dpi:96,format:this.options.format,transparent:this.options.transparent,bboxSR:f,imageSR:f},this.options.dynamicLayers&&(n.dynamicLayers=this.options.dynamicLayers),this.options.layers&&(n.layers="show:"+this.options.layers.join(",")),this.options.layerDefs&&(n.layerDefs=JSON.stringify(this.options.layerDefs)),this.options.timeOptions&&(n.timeOptions=JSON.stringify(this.options.timeOptions)),this.options.from&&this.options.to&&(n.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.service.options.token&&(n.token=this.service.options.token),n},_requestExport:function(n,i){"json"===this.options.f?this.service.request("export",n,function(n,t){n||this._renderImage(t.href,i)},this):(n.f="image",this._renderImage(this.options.url+"export"+t.Util.getParamString(n),i))}}),nt=t.Layer.extend({options:{cellSize:512,updateInterval:150},initialize:function(n){n=t.setOptions(this,n);this._zooming=!1},onAdd:function(n){this._map=n;this._update=t.Util.throttle(this._update,this.options.updateInterval,this);this._reset();this._update()},onRemove:function(){this._map.removeEventListener(this.getEvents(),this);this._removeCells()},getEvents:function(){return{moveend:this._update,zoomstart:this._zoomstart,zoomend:this._reset}},addTo:function(n){return n.addLayer(this),this},removeFrom:function(n){return n.removeLayer(this),this},_zoomstart:function(){this._zooming=!0},_reset:function(){this._removeCells();this._cells={};this._activeCells={};this._cellsToLoad=0;this._cellsTotal=0;this._cellNumBounds=this._getCellNumBounds();this._resetWrap();this._zooming=!1},_resetWrap:function(){var t=this._map,n=t.options.crs,i;n.infinite||(i=this._getCellSize(),n.wrapLng&&(this._wrapLng=[Math.floor(t.project([0,n.wrapLng[0]]).x/i),Math.ceil(t.project([0,n.wrapLng[1]]).x/i)]),n.wrapLat&&(this._wrapLat=[Math.floor(t.project([n.wrapLat[0],0]).y/i),Math.ceil(t.project([n.wrapLat[1],0]).y/i)]))},_getCellSize:function(){return this.options.cellSize},_update:function(){if(this._map){var n=this._map.getPixelBounds(),i=this._getCellSize(),r=t.bounds(n.min.divideBy(i).floor(),n.max.divideBy(i).floor());this._removeOtherCells(r);this._addCells(r);this.fire("cellsupdated")}},_addCells:function(n){for(var i,f,e=[],o=n.getCenter(),s=this._map.getZoom(),r,u=n.min.y;u<=n.max.y;u++)for(i=n.min.x;i<=n.max.x;i++)f=t.point(i,u),f.z=s,this._isValidCell(f)&&e.push(f);if(r=e.length,0!==r)for(this._cellsToLoad+=r,this._cellsTotal+=r,e.sort(function(n,t){return n.distanceTo(o)-t.distanceTo(o)}),i=0;r>i;i++)this._addCell(e[i])},_isValidCell:function(n){var r=this._map.options.crs,i,u;return!r.infinite&&(i=this._cellNumBounds,!r.wrapLng&&(n.x<i.min.x||n.x>i.max.x)||!r.wrapLat&&(n.y<i.min.y||n.y>i.max.y))?!1:this.options.bounds?(u=this._cellCoordsToBounds(n),t.latLngBounds(this.options.bounds).intersects(u)):!0},_cellCoordsToBounds:function(n){var i=this._map,r=this.options.cellSize,u=n.multiplyBy(r),f=u.add([r,r]),e=i.wrapLatLng(i.unproject(u,n.z)),o=i.wrapLatLng(i.unproject(f,n.z));return t.latLngBounds(e,o)},_cellCoordsToKey:function(n){return n.x+":"+n.y},_keyToCellCoords:function(n){var i=n.split(":"),r=parseInt(i[0],10),u=parseInt(i[1],10);return t.point(r,u)},_removeOtherCells:function(n){for(var t in this._cells)n.contains(this._keyToCellCoords(t))||this._removeCell(t)},_removeCell:function(n){var t=this._activeCells[n];t&&(delete this._activeCells[n],this.cellLeave&&this.cellLeave(t.bounds,t.coords),this.fire("cellleave",{bounds:t.bounds,coords:t.coords}))},_removeCells:function(){var n,t,i;for(n in this._cells)t=this._cells[n].bounds,i=this._cells[n].coords,this.cellLeave&&this.cellLeave(t,i),this.fire("cellleave",{bounds:t,coords:i})},_addCell:function(n){this._wrapCoords(n);var i=this._cellCoordsToKey(n),t=this._cells[i];t&&!this._activeCells[i]&&(this.cellEnter&&this.cellEnter(t.bounds,n),this.fire("cellenter",{bounds:t.bounds,coords:n}),this._activeCells[i]=t);t||(t={coords:n,bounds:this._cellCoordsToBounds(n)},this._cells[i]=t,this._activeCells[i]=t,this.createCell&&this.createCell(t.bounds,n),this.fire("cellcreate",{bounds:t.bounds,coords:n}))},_wrapCoords:function(n){n.x=this._wrapLng?t.Util.wrapNum(n.x,this._wrapLng):n.x;n.y=this._wrapLat?t.Util.wrapNum(n.y,this._wrapLat):n.y},_getCellNumBounds:function(){var n=this._map.getPixelWorldBounds(),i=this._getCellSize();return n?t.bounds(n.min.divideBy(i).floor(),n.max.divideBy(i).ceil().subtract([1,1])):null}});u.prototype.query=function(n){var t=this.getIndex(n);return this.values[t]};u.prototype.getIndex=function(n){this.dirty&&this.sort();for(var t,r,u=0,i=this.values.length-1;i>=u;)if(t=(u+i)/2|0,r=this.values[Math.round(t)],+r.value<+n)u=t+1;else{if(!(+r.value>+n))return t;i=t-1}return Math.abs(~i)};u.prototype.between=function(n,t){var r=this.getIndex(n),i=this.getIndex(t);if(0===r&&0===i)return[];for(;this.values[r-1]&&this.values[r-1].value===n;)r--;for(;this.values[i+1]&&this.values[i+1].value===t;)i++;return this.values[i]&&this.values[i].value===t&&this.values[i+1]&&i++,this.values.slice(r,i)};u.prototype.insert=function(n){return this.values.splice(this.getIndex(n.value),0,n),this};u.prototype.bulkAdd=function(n,t){return this.values=this.values.concat([].concat(n||[])),t?this.sort():this.dirty=!0,this};u.prototype.sort=function(){return this.values.sort(function(n,t){return+t.value-+n.value}).reverse(),this.dirty=!1,this};c=nt.extend({options:{attribution:null,where:"1=1",fields:["*"],from:!1,to:!1,timeField:!1,timeFilterMode:"server",simplifyFactor:0,precision:6},initialize:function(n){if(nt.prototype.initialize.call(this,n),n.url=e(n.url),n=t.setOptions(this,n),this.service=ni(n),this.service.addEventParent(this),"*"!==this.options.fields[0]){for(var r=!1,i=0;i<this.options.fields.length;i++)this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)&&(r=!0);r===!1&&a("no known esriFieldTypeOID field detected in fields Array.  Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.")}this.options.timeField.start&&this.options.timeField.end?(this._startTimeIndex=new u,this._endTimeIndex=new u):this.options.timeField&&(this._timeIndex=new u);this._cache={};this._currentSnapshot=[];this._activeRequests=0},onAdd:function(n){return n.on("zoomend",this._handleZoomChange,this),nt.prototype.onAdd.call(this,n)},onRemove:function(n){return n.off("zoomend",this._handleZoomChange,this),nt.prototype.onRemove.call(this,n)},getAttribution:function(){return this.options.attribution},createCell:function(n,t){this._requestFeatures(n,t)},_requestFeatures:function(n,i,r){return this._activeRequests++,1===this._activeRequests&&this.fire("loading",{bounds:n},!0),this._buildQuery(n).run(function(u,f,e){e&&e.exceededTransferLimit&&this.fire("drawlimitexceeded");!u&&f&&f.features.length&&t.Util.requestAnimFrame(t.Util.bind(function(){this._addFeatures(f.features,i);this._postProcessFeatures(n)},this));u||!f||f.features.length||this._postProcessFeatures(n);u&&this._postProcessFeatures(n);r&&r.call(this,u,f)},this)},_postProcessFeatures:function(n){this._activeRequests--;this._activeRequests<=0&&this.fire("load",{bounds:n})},_cacheKey:function(n){return n.z+":"+n.x+":"+n.y},_addFeatures:function(n,t){var r=this._cacheKey(t),i,u;for(this._cache[r]=this._cache[r]||[],i=n.length-1;i>=0;i--)u=n[i].id,this._currentSnapshot.push(u),this._cache[r].push(u);this.options.timeField&&this._buildTimeIndexes(n);this.createLayers(n)},_buildQuery:function(n){var t=this.service.query().intersects(n).where(this.options.where).fields(this.options.fields).precision(this.options.precision);return this.options.simplifyFactor&&t.simplify(this._map,this.options.simplifyFactor),"server"===this.options.timeFilterMode&&this.options.from&&this.options.to&&t.between(this.options.from,this.options.to),t},setWhere:function(n,i,r){var o,c,l;this.options.where=n&&n.length?n:"1=1";for(var s=[],u=[],f=0,h=null,a=t.Util.bind(function(n,e){if(n&&(h=n),e)for(var o=e.features.length-1;o>=0;o--)u.push(e.features[o].id);f--;0>=f&&(this._currentSnapshot=u,t.Util.requestAnimFrame(t.Util.bind(function(){this.removeLayers(s);this.addLayers(u);i&&i.call(r,h)},this)))},this),e=this._currentSnapshot.length-1;e>=0;e--)s.push(this._currentSnapshot[e]);for(o in this._activeCells)f++,c=this._keyToCellCoords(o),l=this._cellCoordsToBounds(c),this._requestFeatures(l,o,a);return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(n,i,r,u){var o=this.options.from,s=this.options.to,f=0,h=null,a=t.Util.bind(function(t){t&&(h=t);this._filterExistingFeatures(o,s,n,i);f--;r&&0>=f&&r.call(u,h)},this),e,c,l;if(this.options.from=n,this.options.to=i,this._filterExistingFeatures(o,s,n,i),"server"===this.options.timeFilterMode)for(e in this._activeCells)f++,c=this._keyToCellCoords(e),l=this._cellCoordsToBounds(c),this._requestFeatures(l,e,a);return this},refresh:function(){var n,t,i;for(n in this._activeCells)t=this._keyToCellCoords(n),i=this._cellCoordsToBounds(t),this._requestFeatures(i,n);this.redraw&&this.once("load",function(){this.eachFeature(function(n){this._redraw(n.feature.id)},this)},this)},_filterExistingFeatures:function(n,i,r,u){var o=n&&i?this._getFeaturesInTimeRange(n,i):this._currentSnapshot,f=this._getFeaturesInTimeRange(r,u),e,s;if(f.indexOf)for(e=0;e<f.length;e++)s=o.indexOf(f[e]),s>=0&&o.splice(s,1);t.Util.requestAnimFrame(t.Util.bind(function(){this.removeLayers(o);this.addLayers(f)},this))},_getFeaturesInTimeRange:function(n,t){var i,u=[],f,e,r;for(this.options.timeField.start&&this.options.timeField.end?(f=this._startTimeIndex.between(n,t),e=this._endTimeIndex.between(n,t),i=f.concat(e)):i=this._timeIndex.between(n,t),r=i.length-1;r>=0;r--)u.push(i[r].id);return u},_buildTimeIndexes:function(n){var t,i,r,u,f;if(this.options.timeField.start&&this.options.timeField.end){for(r=[],u=[],t=n.length-1;t>=0;t--)i=n[t],r.push({id:i.id,value:new Date(i.properties[this.options.timeField.start])}),u.push({id:i.id,value:new Date(i.properties[this.options.timeField.end])});this._startTimeIndex.bulkAdd(r);this._endTimeIndex.bulkAdd(u)}else{for(f=[],t=n.length-1;t>=0;t--)i=n[t],f.push({id:i.id,value:new Date(i.properties[this.options.timeField])});this._timeIndex.bulkAdd(f)}},_featureWithinTimeRange:function(n){var t,i,r,u,f;return!this.options.from||!this.options.to?!0:(t=+this.options.from.valueOf(),i=+this.options.to.valueOf(),"string"==typeof this.options.timeField)?(r=+n.properties[this.options.timeField],r>=t&&i>=r):this.options.timeField.start&&this.options.timeField.end?(u=+n.properties[this.options.timeField.start],f=+n.properties[this.options.timeField.end],u>=t&&i>=u||f>=t&&i>=f):void 0},_visibleZoom:function(){if(!this._map)return!1;var n=this._map.getZoom();return!(n>this.options.maxZoom||n<this.options.minZoom)},_handleZoomChange:function(){var t,i,n;if(this._visibleZoom())for(t in this._activeCells)i=this._activeCells[t].coords,n=this._cacheKey(i),this._cache[n]&&this.addLayers(this._cache[n]);else this.removeLayers(this._currentSnapshot),this._currentSnapshot=[]},authenticate:function(n){return this.service.authenticate(n),this},metadata:function(n,t){return this.service.metadata(n,t),this},query:function(){return this.service.query()},_getMetadata:function(n){if(this._metadata){var i;n(i,this._metadata)}else this.metadata(t.Util.bind(function(t,i){this._metadata=i;n(t,this._metadata)},this))},addFeature:function(n,i,r){this._getMetadata(t.Util.bind(function(u,f){return u?void(i&&i.call(this,u,null)):void this.service.addFeature(n,t.Util.bind(function(t,u){t||(n.properties[f.objectIdField]=u.objectId,n.id=u.objectId,this.createLayers([n]));i&&i.call(r,t,u)},this))},this))},updateFeature:function(n,t,i){this.service.updateFeature(n,function(r,u){r||(this.removeLayers([n.id],!0),this.createLayers([n]));t&&t.call(i,r,u)},this)},deleteFeature:function(n,t,i){this.service.deleteFeature(n,function(n,r){!n&&r.objectId&&this.removeLayers([r.objectId],!0);t&&t.call(i,n,r)},this)},deleteFeatures:function(n,t,i){return this.service.deleteFeatures(n,function(n,r){if(!n&&r.length>0)for(var u=0;u<r.length;u++)this.removeLayers([r[u].objectId],!0);t&&t.call(i,n,r)},this)}});st=c.extend({options:{cacheLayers:!0},initialize:function(n){c.prototype.initialize.call(this,n);this._originalStyle=this.options.style;this._layers={}},onRemove:function(n){for(var t in this._layers)n.removeLayer(this._layers[t]);return c.prototype.onRemove.call(this,n)},createNewLayer:function(n){var i=t.GeoJSON.geometryToLayer(n,this.options);return i.defaultOptions=i.options,i},_updateLayer:function(n,i){var r=[],u=this.options.coordsToLatLng||t.GeoJSON.coordsToLatLng;switch(i.properties&&(n.feature.properties=i.properties),i.geometry.type){case"Point":r=t.GeoJSON.coordsToLatLng(i.geometry.coordinates);n.setLatLng(r);break;case"LineString":r=t.GeoJSON.coordsToLatLngs(i.geometry.coordinates,0,u);n.setLatLngs(r);break;case"MultiLineString":r=t.GeoJSON.coordsToLatLngs(i.geometry.coordinates,1,u);n.setLatLngs(r);break;case"Polygon":r=t.GeoJSON.coordsToLatLngs(i.geometry.coordinates,1,u);n.setLatLngs(r);break;case"MultiPolygon":r=t.GeoJSON.coordsToLatLngs(i.geometry.coordinates,2,u);n.setLatLngs(r)}},createLayers:function(n){for(var t,r,i,u=n.length-1;u>=0;u--)r=n[u],i=this._layers[r.id],this._visibleZoom()&&i&&!this._map.hasLayer(i)&&this._map.addLayer(i),i&&this.options.simplifyFactor>0&&(i.setLatLngs||i.setLatLng)&&this._updateLayer(i,r),i||(t=this.createNewLayer(r),t.feature=r,t.addEventParent(this),this.options.onEachFeature&&this.options.onEachFeature(t.feature,t),this._layers[t.feature.id]=t,this.setFeatureStyle(t.feature.id,this.options.style),this.fire("createfeature",{feature:t.feature},!0),this._visibleZoom()&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(r))&&this._map.addLayer(t))},addLayers:function(n){for(var i,t=n.length-1;t>=0;t--)i=this._layers[n[t]],i&&(this.fire("addfeature",{feature:i.feature},!0),this._map.addLayer(i))},removeLayers:function(n,t){for(var u,i,r=n.length-1;r>=0;r--)u=n[r],i=this._layers[u],i&&(this.fire("removefeature",{feature:i.feature,permanent:t},!0),this._map.removeLayer(i)),i&&t&&delete this._layers[u]},cellEnter:function(n,i){!this._zooming&&this._map&&t.Util.requestAnimFrame(t.Util.bind(function(){var t=this._cacheKey(i),r=this._cellCoordsToKey(i),n=this._cache[t];this._activeCells[r]&&n&&this.addLayers(n)},this))},cellLeave:function(n,i){this._zooming||t.Util.requestAnimFrame(t.Util.bind(function(){var t,r,u;if(this._map){var e=this._cacheKey(i),f=this._cellCoordsToKey(i),n=this._cache[e],o=this._map.getBounds();if(!this._activeCells[f]&&n){for(t=!0,r=0;r<n.length;r++)u=this._layers[n[r]],u&&u.getBounds&&o.intersects(u.getBounds())&&(t=!1);t&&this.removeLayers(n,!this.options.cacheLayers);!this.options.cacheLayers&&t&&(delete this._cache[e],delete this._cells[f],delete this._activeCells[f])}}},this))},resetStyle:function(){return this.options.style=this._originalStyle,this.eachFeature(function(n){this.resetFeatureStyle(n.feature.id)},this),this},setStyle:function(n){return this.options.style=n,this.eachFeature(function(t){this.setFeatureStyle(t.feature.id,n)},this),this},resetFeatureStyle:function(n){var i=this._layers[n],r=this._originalStyle||t.Path.prototype.options;return i&&(t.Util.extend(i.options,i.defaultOptions),this.setFeatureStyle(n,r)),this},setFeatureStyle:function(n,t){var i=this._layers[n];return"function"==typeof t&&(t=t(i.feature)),i.setStyle&&i.setStyle(t),this},eachFeature:function(n,t){for(var i in this._layers)n.call(t,this._layers[i]);return this},getFeature:function(n){return this._layers[n]},bringToBack:function(){this.eachFeature(function(n){n.bringToBack&&n.bringToBack()})},bringToFront:function(){this.eachFeature(function(n){n.bringToFront&&n.bringToFront()})},redraw:function(n){return n&&this._redraw(n),this},_redraw:function(n){var i=this._layers[n],r=i.feature,u,f,e,o;i&&i.setIcon&&this.options.pointToLayer&&this.options.pointToLayer&&(u=this.options.pointToLayer(r,t.latLng(r.geometry.coordinates[1],r.geometry.coordinates[0])),f=u.options.icon,i.setIcon(f));i&&i.setStyle&&this.options.pointToLayer&&(e=this.options.pointToLayer(r,t.latLng(r.geometry.coordinates[1],r.geometry.coordinates[0])),o=e.options,this.setFeatureStyle(r.id,o));i&&i.setStyle&&this.options.style&&this.resetStyle(r.id)}});n.VERSION="2.0.0";n.Support=o;n.Util=r;n.get=b;n.post=yt;n.request=wt;n.Task=s;n.task=ir;n.Query=ii;n.query=p;n.Find=ri;n.find=bt;n.Identify=d;n.identify=rr;n.IdentifyFeatures=ui;n.identifyFeatures=kt;n.IdentifyImage=fi;n.identifyImage=dt;n.Service=h;n.service=ur;n.MapService=ei;n.mapService=ft;n.ImageService=oi;n.imageService=gt;n.FeatureLayerService=si;n.featureLayerService=ni;n.BasemapLayer=g;n.basemapLayer=er;n.TiledMapLayer=et;n.tiledMapLayer=or;n.RasterLayer=ot;n.ImageMapLayer=hi;n.imageMapLayer=sr;n.DynamicMapLayer=ci;n.dynamicMapLayer=hr;n.FeatureManager=c;n.FeatureLayer=st;n.featureLayer=cr});!function(n,t,i){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(n){L.Util.setOptions(this,n);this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction);this._featureGroup=L.featureGroup();this._featureGroup.addEventParent(this);this._nonPointGroup=L.featureGroup();this._nonPointGroup.addEventParent(this);this._inZoomAnimation=0;this._needsClustering=[];this._needsRemoving=[];this._currentShownBounds=null;this._queue=[];var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation);this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(n){var i,r,t,u;if(n instanceof L.LayerGroup){i=[];for(r in n._layers)i.push(n._layers[r]);return this.addLayers(i)}if(!n.getLatLng)return this._nonPointGroup.addLayer(n),this;if(!this._map)return this._needsClustering.push(n),this;if(this.hasLayer(n))return this;if(this._unspiderfy&&this._unspiderfy(),this._addLayer(n,this._maxZoom),this._topClusterLevel._recalculateBounds(),t=n,u=this._map.getZoom(),n.__parent)for(;t.__parent._zoom>=u;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(n,t):this._animationAddLayerNonAnimated(n,t)),this},removeLayer:function(n){var t,i;if(n instanceof L.LayerGroup){t=[];for(i in n._layers)t.push(n._layers[i]);return this.removeLayers(t)}return n.getLatLng?this._map?n.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(n)),this._removeLayer(n,!0),this._topClusterLevel._recalculateBounds(),n.off("move",this._childMarkerMoved,this),this._featureGroup.hasLayer(n)&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,n)&&this.hasLayer(n)&&this._needsRemoving.push(n),this):(this._nonPointGroup.removeLayer(n),this)},addLayers:function(n){var u,r,f,t,h=this._featureGroup,e=this._nonPointGroup,c=this.options.chunkedLoading,l=this.options.chunkInterval,o=this.options.chunkProgress;if(this._map){var i=0,a=(new Date).getTime(),s=L.bind(function(){for(var f,r,v,u=(new Date).getTime();i<n.length;i++){if(c&&0==i%200&&(f=(new Date).getTime()-u,f>l))break;(t=n[i],t.getLatLng)?!this.hasLayer(t)&&(this._addLayer(t,this._maxZoom),t.__parent&&2===t.__parent.getChildCount())&&(r=t.__parent.getAllChildMarkers(),v=r[0]===t?r[1]:r[0],h.removeLayer(v)):e.addLayer(t)}o&&o(i,n.length,(new Date).getTime()-a);i===n.length?(this._topClusterLevel._recalculateBounds(),this._featureGroup.eachLayer(function(n){n instanceof L.MarkerCluster&&n._iconNeedsUpdate&&n._updateIcon()}),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(s,this.options.chunkDelay)},this);s()}else{for(u=[],r=0,f=n.length;f>r;r++)t=n[r],t.getLatLng?this.hasLayer(t)||u.push(t):e.addLayer(t);this._needsClustering=this._needsClustering.concat(u)}return this},removeLayers:function(n){var i,r,t,u=this._featureGroup,f=this._nonPointGroup;if(!this._map){for(i=0,r=n.length;r>i;i++)t=n[i],this._arraySplice(this._needsClustering,t),f.removeLayer(t),this.hasLayer(t)&&this._needsRemoving.push(t);return this}if(this._unspiderfy)for(this._unspiderfy(),i=0,r=n.length;r>i;i++)t=n[i],this._unspiderfyLayer(t);for(i=0,r=n.length;r>i;i++)t=n[i],t.__parent?(this._removeLayer(t,!0,!0),u.hasLayer(t)&&(u.removeLayer(t),t.clusterShow&&t.clusterShow())):f.removeLayer(t);return this._topClusterLevel._recalculateBounds(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),u.eachLayer(function(n){n instanceof L.MarkerCluster&&n._updateIcon()}),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(n){n.off("move",this._childMarkerMoved,this);delete n.__parent}),this._map&&this._generateInitialClusters(),this},getBounds:function(){var n=new L.LatLngBounds,t;for(this._topClusterLevel&&n.extend(this._topClusterLevel._bounds),t=this._needsClustering.length-1;t>=0;t--)n.extend(this._needsClustering[t].getLatLng());return n.extend(this._nonPointGroup.getBounds()),n},eachLayer:function(n,t){var i,r=this._needsClustering.slice(),u=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(r),i=r.length-1;i>=0;i--)-1===u.indexOf(r[i])&&n.call(t,r[i]);this._nonPointGroup.eachLayer(n,t)},getLayers:function(){var n=[];return this.eachLayer(function(t){n.push(t)}),n},getLayer:function(n){var t=null;return n=parseInt(n,10),this.eachLayer(function(i){L.stamp(i)===n&&(t=i)}),t},hasLayer:function(n){if(!n)return!1;for(var i=this._needsClustering,t=i.length-1;t>=0;t--)if(i[t]===n)return!0;for(i=this._needsRemoving,t=i.length-1;t>=0;t--)if(i[t]===n)return!1;return!(!n.__parent||n.__parent._group!==this)||this._nonPointGroup.hasLayer(n)},zoomToShowLayer:function(n,t){var i,r;"function"!=typeof t&&(t=function(){});i=function i(){(n._icon||n.__parent._icon)&&!this._inZoomAnimation&&(this._map.off("moveend",i,this),this.off("animationend",i,this),n._icon?t():n.__parent._icon&&(this.once("spiderfied",t,this),n.__parent.spiderfy()))};n._icon&&this._map.getBounds().contains(n.getLatLng())?t():n.__parent._zoom<this._map.getZoom()?(this._map.on("moveend",i,this),this._map.panTo(n.getLatLng())):(r=function(){this._map.off("movestart",r,this);r=null},this._map.on("movestart",r,this),this._map.on("moveend",i,this),this.on("animationend",i,this),n.__parent.zoomToBounds(),r&&i.call(this))},onAdd:function(n){this._map=n;var t,i,r;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(n),this._nonPointGroup.addTo(n),this._gridClusters||this._generateInitialClusters(),this._maxLat=n.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;i>t;t++)r=this._needsRemoving[t],this._removeLayer(r,!0);this._needsRemoving=[];this._zoom=this._map.getZoom();this._currentShownBounds=this._getExpandedVisibleBounds();this._map.on("zoomend",this._zoomEnd,this);this._map.on("moveend",this._moveEnd,this);this._spiderfierOnAdd&&this._spiderfierOnAdd();this._bindEvents();i=this._needsClustering;this._needsClustering=[];this.addLayers(i)},onRemove:function(n){n.off("zoomend",this._zoomEnd,this);n.off("moveend",this._moveEnd,this);this._unbindEvents();this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","");this._spiderfierOnRemove&&this._spiderfierOnRemove();delete this._maxLat;this._hideCoverage();this._featureGroup.remove();this._nonPointGroup.remove();this._featureGroup.clearLayers();this._map=null},getVisibleParent:function(n){for(var t=n;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(n,t){for(var i=n.length-1;i>=0;i--)if(n[i]===t)return n.splice(i,1),!0},_removeFromGridUnclustered:function(n,t){for(var i=this._map,r=this._gridUnclustered;t>=0&&r[t].removeObject(n,i.project(n.getLatLng(),t));t--);},_childMarkerMoved:function(n){this._ignoreMove||(n.target._latlng=n.oldLatLng,this.removeLayer(n.target),n.target._latlng=n.latlng,this.addLayer(n.target))},_removeLayer:function(n,t,i){var s=this._gridClusters,h=this._gridUnclustered,f=this._featureGroup,e=this._map,u,r,o;for(t&&this._removeFromGridUnclustered(n,this._maxZoom),r=n.__parent,o=r._markers,this._arraySplice(o,n);r&&(r._childCount--,r._boundsNeedUpdate=!0,!(r._zoom<0));)t&&r._childCount<=1?(u=r._markers[0]===n?r._markers[1]:r._markers[0],s[r._zoom].removeObject(r,e.project(r._cLatLng,r._zoom)),h[r._zoom].addObject(u,e.project(u.getLatLng(),r._zoom)),this._arraySplice(r.__parent._childClusters,r),r.__parent._markers.push(u),u.__parent=r.__parent,r._icon&&(f.removeLayer(r),i||f.addLayer(u))):i&&r._icon||r._updateIcon(),r=r.__parent;delete n.__parent},_isOrIsParent:function(n,t){for(;t;){if(n===t)return!0;t=t.parentNode}return!1},fire:function(n,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;n="cluster"+n}L.FeatureGroup.prototype.fire.call(this,n,t,i)},listens:function(n,t){return L.FeatureGroup.prototype.listens.call(this,n,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+n,t)},_defaultIconCreateFunction:function(n){var t=n.getChildCount(),i=" marker-cluster-";return i+=10>t?"small":100>t?"medium":"large",new L.DivIcon({html:"<div><span>"+t+"<\/span><\/div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var n=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,r=this.options.zoomToBoundsOnClick;(t||r)&&this.on("clusterclick",this._zoomOrSpiderfy,this);i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),n.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(n){for(var i=n.layer,t=i;1===t._childClusters.length;)t=t._childClusters[0];t._zoom===this._maxZoom&&t._childCount===i._childCount?this.options.spiderfyOnMaxZoom&&i.spiderfy():this.options.zoomToBoundsOnClick&&i.zoomToBounds();n.originalEvent&&13===n.originalEvent.keyCode&&this._map._container.focus()},_showCoverage:function(n){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),n.layer.getChildCount()>2&&n.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(n.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var n=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,r=this._map;(n||i)&&this.off("clusterclick",this._zoomOrSpiderfy,this);t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var n=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._zoom,n);this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),n);this._currentShownBounds=n}},_generateInitialClusters:function(){var t=this._map.getMaxZoom(),i=this.options.maxClusterRadius,r=i,n;for("function"!=typeof i&&(r=function(){return i}),this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={},n=t;n>=0;n--)this._gridClusters[n]=new L.DistanceGrid(r(n)),this._gridUnclustered[n]=new L.DistanceGrid(r(n));this._topClusterLevel=new this._markerCluster(this,-1)},_addLayer:function(n,t){var e,r,s=this._gridClusters,h=this._gridUnclustered,i,o,u,f;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(n),n.on("move",this._childMarkerMoved,this);t>=0;t--){if(e=this._map.project(n.getLatLng(),t),i=s[t].getNearObject(e),i)return i._addChild(n),n.__parent=i,void 0;if(i=h[t].getNearObject(e)){for(o=i.__parent,o&&this._removeLayer(i,!1),u=new this._markerCluster(this,t,i,n),s[t].addObject(u,this._map.project(u._cLatLng,t)),i.__parent=u,n.__parent=u,f=u,r=t-1;r>o._zoom;r--)f=new this._markerCluster(this,r,f),s[r].addObject(f,this._map.project(i.getLatLng(),r));return o._addChild(f),this._removeFromGridUnclustered(i,t),void 0}h[t].addObject(n,e)}this._topClusterLevel._addChild(n);n.__parent=this._topClusterLevel},_enqueue:function(n){this._queue.push(n);this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var n=0;n<this._queue.length;n++)this._queue[n].call(this);this._queue.length=0;clearTimeout(this._queueTimeout);this._queueTimeout=null},_mergeSplitClusters:function(){var n=Math.round(this._map._zoom);this._processQueue();this._zoom<n&&this._currentShownBounds.contains(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,n)):this._zoom>n?(this._animationStart(),this._animationZoomOut(this._zoom,n)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(n){var t=this._maxLat;return t!==i&&(n.getNorth()>=t&&(n._northEast.lat=1/0),n.getSouth()<=-t&&(n._southWest.lat=-1/0)),n},_animationAddLayerNonAnimated:function(n,t){if(t===n)this._featureGroup.addLayer(n);else if(2===t._childCount){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]);this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_overrideMarkerIcon:function(n){return n.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[n]}})}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))});L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,n);this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds());this.fire("animationend")},_animationZoomOut:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,n);this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds());this.fire("animationend")},_animationAddLayer:function(n,t){this._animationAddLayerNonAnimated(n,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim";this._inZoomAnimation++},_animationZoomIn:function(n,t){var r,i=this._getExpandedVisibleBounds(),u=this._featureGroup;this._ignoreMove=!0;this._topClusterLevel._recursively(i,n,0,function(f){var e,o=f._latlng,s=f._markers;for(i.contains(o)||(o=null),f._isSingleParent()&&n+1===t?(u.removeLayer(f),f._recursivelyAddChildrenToMap(null,t,i)):(f.clusterHide(),f._recursivelyAddChildrenToMap(o,t,i)),r=s.length-1;r>=0;r--)e=s[r],i.contains(e._latlng)||u.removeLayer(e)});this._forceLayout();this._topClusterLevel._recursivelyBecomeVisible(i,t);u.eachLayer(function(n){n instanceof L.MarkerCluster||!n._icon||n.clusterShow()});this._topClusterLevel._recursively(i,n,t,function(n){n._recursivelyRestoreChildPositions(t)});this._ignoreMove=!1;this._enqueue(function(){this._topClusterLevel._recursively(i,n,0,function(n){u.removeLayer(n);n.clusterShow()});this._animationEnd()})},_animationZoomOut:function(n,t){this._animationZoomOutSingle(this._topClusterLevel,n-1,t);this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds());this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,n,this._getExpandedVisibleBounds())},_animationAddLayer:function(n,t){var i=this,r=this._featureGroup;r.addLayer(n);t!==n&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),n._setPos(this._map.latLngToLayerPoint(t.getLatLng())),n.clusterHide(),this._enqueue(function(){r.removeLayer(n);n.clusterShow();i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._map.getZoom())))}},_animationZoomOutSingle:function(n,t,i){var r=this._getExpandedVisibleBounds(),u;n._recursivelyAnimateChildrenInAndAddSelfToMap(r,t+1,i);u=this;this._forceLayout();n._recursivelyBecomeVisible(r,i);this._enqueue(function(){if(1===n._childCount){var f=n._markers[0];this._ignoreMove=!0;f.setLatLng(f.getLatLng());this._ignoreMove=!1;f.clusterShow&&f.clusterShow()}else n._recursively(r,i,0,function(n){n._recursivelyRemoveChildrenFromMap(r,t+1)});u._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""));this._inZoomAnimation--;this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(t.body.offsetWidth)}});L.markerClusterGroup=function(n){return new L.MarkerClusterGroup(n)};L.MarkerCluster=L.Marker.extend({initialize:function(n,t,i,r){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this});this._group=n;this._zoom=t;this._markers=[];this._childClusters=[];this._childCount=0;this._iconNeedsUpdate=!0;this._boundsNeedUpdate=!0;this._bounds=new L.LatLngBounds;i&&this._addChild(i);r&&this._addChild(r)},getAllChildMarkers:function(n){var t,i;for(n=n||[],t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(n);for(i=this._markers.length-1;i>=0;i--)n.push(this._markers[i]);return n},getChildCount:function(){return this._childCount},zoomToBounds:function(){for(var r,n,t=this._childClusters.slice(),f=this._group._map,u=f.getBoundsZoom(this._bounds),i=this._zoom+1,e=f.getZoom();t.length>0&&u>i;){for(i++,r=[],n=0;n<t.length;n++)r=r.concat(t[n]._childClusters);t=r}u>i?this._group._map.setView(this._latlng,i):e>=u?this._group._map.setView(this._latlng,e+1):this._group._map.fitBounds(this._bounds)},getBounds:function(){var n=new L.LatLngBounds;return n.extend(this._bounds),n},_updateIcon:function(){this._iconNeedsUpdate=!0;this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(n,t){this._iconNeedsUpdate=!0;this._boundsNeedUpdate=!0;this._setClusterCenter(n);n instanceof L.MarkerCluster?(t||(this._childClusters.push(n),n.__parent=this),this._childCount+=n._childCount):(t||this._markers.push(n),this._childCount++);this.__parent&&this.__parent._addChild(n,!0)},_setClusterCenter:function(n){this._cLatLng||(this._cLatLng=n._cLatLng||n._latlng)},_resetBounds:function(){var n=this._bounds;n._southWest&&(n._southWest.lat=1/0,n._southWest.lng=1/0);n._northEast&&(n._northEast.lat=-1/0,n._northEast.lng=-1/0)},_recalculateBounds:function(){var n,i,t,r,o=this._markers,s=this._childClusters,u=0,f=0,e=this._childCount;if(0!==e){for(this._resetBounds(),n=0;n<o.length;n++)t=o[n]._latlng,this._bounds.extend(t),u+=t.lat,f+=t.lng;for(n=0;n<s.length;n++)i=s[n],i._boundsNeedUpdate&&i._recalculateBounds(),this._bounds.extend(i._bounds),t=i._wLatLng,r=i._childCount,u+=t.lat*r,f+=t.lng*r;this._latlng=this._wLatLng=new L.LatLng(u/e,f/e);this._boundsNeedUpdate=!1}},_addToMap:function(n){n&&(this._backupLatlng=this._latlng,this.setLatLng(n));this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(n,t,i){this._recursively(n,0,i-1,function(n){for(var r,u=n._markers,i=u.length-1;i>=0;i--)r=u[i],r._icon&&(r._setPos(t),r.clusterHide())},function(n){for(var r,u=n._childClusters,i=u.length-1;i>=0;i--)r=u[i],r._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(n,t,i){this._recursively(n,i,0,function(r){r._recursivelyAnimateChildrenIn(n,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),t);r._isSingleParent()&&t-1===i?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(n,t)):r.clusterHide();r._addToMap()})},_recursivelyBecomeVisible:function(n,t){this._recursively(n,0,t,null,function(n){n.clusterShow()})},_recursivelyAddChildrenToMap:function(n,t,i){this._recursively(i,-1,t,function(r){var f,u;if(t!==r._zoom)for(f=r._markers.length-1;f>=0;f--)u=r._markers[f],i.contains(u._latlng)&&(n&&(u._backupLatlng=u.getLatLng(),u.setLatLng(n),u.clusterHide&&u.clusterHide()),r._group._featureGroup.addLayer(u))},function(t){t._addToMap(n)})},_recursivelyRestoreChildPositions:function(n){for(var t,r,u,i=this._markers.length-1;i>=0;i--)t=this._markers[i],t._backupLatlng&&(t.setLatLng(t._backupLatlng),delete t._backupLatlng);if(n-1===this._zoom)for(r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._restorePosition();else for(u=this._childClusters.length-1;u>=0;u--)this._childClusters[u]._recursivelyRestoreChildPositions(n)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(n,t,i){var r,u;this._recursively(n,-1,t-1,function(n){for(u=n._markers.length-1;u>=0;u--)r=n._markers[u],i&&i.contains(r._latlng)||(n._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(n){for(u=n._childClusters.length-1;u>=0;u--)r=n._childClusters[u],i&&i.contains(r._latlng)||(n._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(n,t,i,r,u){var f,e,o=this._childClusters,s=this._zoom;if(t>s)for(f=o.length-1;f>=0;f--)e=o[f],n.intersects(e._bounds)&&e._recursively(n,t,i,r,u);else if(r&&r(this),u&&this._zoom===i&&u(this),i>s)for(f=o.length-1;f>=0;f--)e=o[f],n.intersects(e._bounds)&&e._recursively(n,t,i,r,u)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var n=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,n}});L.DistanceGrid=function(n){this._cellSize=n;this._sqCellSize=n*n;this._grid={};this._objectPoint={}};L.DistanceGrid.prototype={addObject:function(n,t){var i=this._getCoord(t.x),r=this._getCoord(t.y),u=this._grid,f=u[r]=u[r]||{},e=f[i]=f[i]||[],o=L.Util.stamp(n);this._objectPoint[o]=t;e.push(n)},updateObject:function(n,t){this.removeObject(n);this.addObject(n,t)},removeObject:function(n,t){var i,r,u=this._getCoord(t.x),o=this._getCoord(t.y),s=this._grid,f=s[o]=s[o]||{},e=f[u]=f[u]||[];for(delete this._objectPoint[L.Util.stamp(n)],i=0,r=e.length;r>i;i++)if(e[i]===n)return e.splice(i,1),1===r&&delete f[u],!0},eachObject:function(n,t){var e,o,i,r,u,f,s,h=this._grid;for(e in h){u=h[e];for(o in u)for(f=u[o],i=0,r=f.length;r>i;i++)s=n.call(t,f[i]),s&&(i--,r--)}},getNearObject:function(n){for(var i,r,o,u,s,f,e,h=this._getCoord(n.x),c=this._getCoord(n.y),v=this._objectPoint,l=this._sqCellSize,a=null,t=c-1;c+1>=t;t++)if(o=this._grid[t])for(i=h-1;h+1>=i;i++)if(u=o[i])for(r=0,s=u.length;s>r;r++)f=u[r],e=this._sqDist(v[L.Util.stamp(f)],n),l>e&&(l=e,a=f);return a},_getCoord:function(n){return Math.floor(n/this._cellSize)},_sqDist:function(n,t){var i=t.x-n.x,r=t.y-n.y;return i*i+r*r}},function(){L.QuickHull={getDistant:function(n,t){var i=t[1].lat-t[0].lat,r=t[0].lng-t[1].lng;return r*(n.lat-t[0].lat)+i*(n.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(n,t){for(var r,u,f=0,e=null,o=[],i=t.length-1;i>=0;i--)r=t[i],u=this.getDistant(r,n),u>0&&(o.push(r),u>f&&(f=u,e=r));return{maxPoint:e,newPoints:o}},buildConvexHull:function(n,t){var r=[],i=this.findMostDistantPointFromBaseLine(n,t);return i.maxPoint?(r=r.concat(this.buildConvexHull([n[0],i.maxPoint],i.newPoints)),r=r.concat(this.buildConvexHull([i.maxPoint,n[1]],i.newPoints))):[n[0]]},getConvexHull:function(n){for(var r=!1,u=!1,o=!1,s=!1,h=null,c=null,l=null,a=null,f=null,e=null,t,i=n.length-1;i>=0;i--)t=n[i],(r===!1||t.lat>r)&&(h=t,r=t.lat),(u===!1||t.lat<u)&&(c=t,u=t.lat),(o===!1||t.lng>o)&&(l=t,o=t.lng),(s===!1||t.lng<s)&&(a=t,s=t.lng);return u!==r?(e=c,f=h):(e=a,f=l),[].concat(this.buildConvexHull([e,f],n),this.buildConvexHull([f,e],n))}}}();L.MarkerCluster.include({getConvexHull:function(){for(var t,i=this.getAllChildMarkers(),r=[],n=i.length-1;n>=0;n--)t=i[n].getLatLng(),r.push(t);return L.QuickHull.getConvexHull(r)}});L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var t,n=this.getAllChildMarkers(),r=this._group,u=r._map,i=u.latLngToLayerPoint(this._latlng);this._group._unspiderfy();this._group._spiderfied=this;n.length>=this._circleSpiralSwitchover?t=this._generatePointsSpiral(n.length,i):(i.y+=10,t=this._generatePointsCircle(n.length,i));this._animationSpiderfy(n,t)}},unspiderfy:function(n){this._group._inZoomAnimation||(this._animationUnspiderfy(n),this._group._spiderfied=null)},_generatePointsCircle:function(n,t){var i,r,e=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+n),f=e/this._2PI,o=this._2PI/n,u=[];for(u.length=n,i=n-1;i>=0;i--)r=this._circleStartAngle+i*o,u[i]=new L.Point(t.x+f*Math.cos(r),t.y+f*Math.sin(r))._round();return u},_generatePointsSpiral:function(n,t){var i,f=this._group.options.spiderfyDistanceMultiplier,r=f*this._spiralLengthStart,o=f*this._spiralFootSeparation,s=f*this._spiralLengthFactor*this._2PI,u=0,e=[];for(e.length=n,i=n-1;i>=0;i--)u+=o/r+.0005*i,e[i]=new L.Point(t.x+r*Math.cos(u),t.y+r*Math.sin(u))._round(),r+=s/u;return e},_noanimationUnspiderfy:function(){var n,i,t=this._group,u=t._map,f=t._featureGroup,r=this.getAllChildMarkers();for(t._ignoreMove=!0,this.setOpacity(1),i=r.length-1;i>=0;i--)n=r[i],f.removeLayer(n),n._preSpiderfyLatlng&&(n.setLatLng(n._preSpiderfyLatlng),delete n._preSpiderfyLatlng),n.setZIndexOffset&&n.setZIndexOffset(0),n._spiderLeg&&(u.removeLayer(n._spiderLeg),delete n._spiderLeg);t.fire("unspiderfied",{cluster:this,markers:r});t._ignoreMove=!1;t._spiderfied=null}});L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(n,t){var r,i,f,e,u=this._group,o=u._map,s=u._featureGroup,h=this._group.options.spiderLegPolylineOptions;for(u._ignoreMove=!0,r=0;r<n.length;r++)e=o.layerPointToLatLng(t[r]),i=n[r],f=new L.Polyline([this._latlng,e],h),o.addLayer(f),i._spiderLeg=f,i._preSpiderfyLatlng=i._latlng,i.setLatLng(e),i.setZIndexOffset&&i.setZIndexOffset(1e6),s.addLayer(i);this.setOpacity(.3);u._ignoreMove=!1;u.fire("spiderfied",{cluster:this,markers:n})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}});L.MarkerCluster.include({_animationSpiderfy:function(n,t){var u,r,e,o,a,h,p=this,f=this._group,c=f._map,w=f._featureGroup,y=this._latlng,b=c.latLngToLayerPoint(y),v=L.Path.SVG,s=L.extend({},this._group.options.spiderLegPolylineOptions),l=s.opacity;for(l===i&&(l=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),v?(s.opacity=0,s.className=(s.className||"")+" leaflet-cluster-spider-leg"):s.opacity=l,f._ignoreMove=!0,u=0;u<n.length;u++)r=n[u],h=c.layerPointToLatLng(t[u]),e=new L.Polyline([y,h],s),c.addLayer(e),r._spiderLeg=e,v&&(o=e._path,a=o.getTotalLength()+.1,o.style.strokeDasharray=a,o.style.strokeDashoffset=a),r.setZIndexOffset&&r.setZIndexOffset(1e6),r.clusterHide&&r.clusterHide(),w.addLayer(r),r._setPos&&r._setPos(b);for(f._forceLayout(),f._animationStart(),u=n.length-1;u>=0;u--)h=c.layerPointToLatLng(t[u]),r=n[u],r._preSpiderfyLatlng=r._latlng,r.setLatLng(h),r.clusterShow&&r.clusterShow(),v&&(e=r._spiderLeg,o=e._path,o.style.strokeDashoffset=0,e.setStyle({opacity:l}));this.setOpacity(.3);f._ignoreMove=!1;setTimeout(function(){f._animationEnd();f.fire("spiderfied",{cluster:p,markers:n})},200)},_animationUnspiderfy:function(n){var t,i,e,o,h,f,l=this,r=this._group,s=r._map,c=r._featureGroup,a=n?s._latLngToNewLayerPoint(this._latlng,n.zoom,n.center):s.latLngToLayerPoint(this._latlng),u=this.getAllChildMarkers(),v=L.Path.SVG;for(r._ignoreMove=!0,r._animationStart(),this.setOpacity(1),i=u.length-1;i>=0;i--)t=u[i],t._preSpiderfyLatlng&&(t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,f=!0,t._setPos&&(t._setPos(a),f=!1),t.clusterHide&&(t.clusterHide(),f=!1),f&&c.removeLayer(t),v&&(e=t._spiderLeg,o=e._path,h=o.getTotalLength()+.1,o.style.strokeDashoffset=h,e.setStyle({opacity:0})));r._ignoreMove=!1;setTimeout(function(){var n=0;for(i=u.length-1;i>=0;i--)t=u[i],t._spiderLeg&&n++;for(i=u.length-1;i>=0;i--)t=u[i],t._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),n>1&&c.removeLayer(t),s.removeLayer(t._spiderLeg),delete t._spiderLeg);r._animationEnd();r.fire("unspiderfied",{cluster:l,markers:u})},200)}});L.MarkerClusterGroup.include({_spiderfied:null,_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this);this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this);this._map.on("zoomend",this._noanimationUnspiderfy,this);L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this);this._map.off("zoomstart",this._unspiderfyZoomStart,this);this._map.off("zoomanim",this._unspiderfyZoomAnim,this);this._map.off("zoomend",this._noanimationUnspiderfy,this);this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(n){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(n))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(n){this._spiderfied&&this._spiderfied.unspiderfy(n)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(n){n._spiderLeg&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow(),n.setZIndexOffset&&n.setZIndexOffset(0),this._map.removeLayer(n._spiderLeg),delete n._spiderLeg)}});L.MarkerClusterGroup.include({refreshClusters:function(n){return n?n instanceof L.MarkerClusterGroup?n=n._topClusterLevel.getAllChildMarkers():n instanceof L.LayerGroup?n=n._layers:n instanceof L.MarkerCluster?n=n.getAllChildMarkers():n instanceof L.Marker&&(n=[n]):n=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(n),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(n),this},_flagParentsIconsNeedUpdate:function(n){var i,t;for(i in n)for(t=n[i].__parent;t;)t._iconNeedsUpdate=!0,t=t.__parent},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(n){n instanceof L.MarkerCluster&&n._iconNeedsUpdate&&n._updateIcon()})},_refreshSingleMarkerModeMarkers:function(n){var i,t;for(i in n)t=n[i],this.hasLayer(t)&&t.setIcon(this._overrideMarkerIcon(t))}});L.Marker.include({refreshIconOptions:function(n,t){var i=this.options.icon;return L.setOptions(i,n),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}})}(window,document);!function(n,t){"object"==(typeof exports=="undefined"?"undefined":_typeof(exports))&&"undefined"!=typeof module?t(exports,require("leaflet"),require("esri-leaflet")):"function"==typeof define&&define.amd?define(["exports","leaflet","esri-leaflet"],t):t((n.L=n.L||{},n.L.esri=n.L.esri||{},n.L.esri.Geocoding=n.L.esri.Geocoding||{}),n.L,n.L.esri)}(this,function(n,t,i){"use strict";function f(n){return new h(n)}function e(n){return new c(n)}function o(n){return new l(n)}function k(n){return new u(n)}function s(n,t){return new a(n,t)}function d(n){return new v(n)}function g(n){return new y(n)}function nt(n){return new p(n)}function tt(n){return new w(n)}function it(n){return new b(n)}t="default"in t?t["default"]:t;var h=i.Task.extend({path:"find",params:{outSr:4326,forStorage:!1,outFields:"*",maxLocations:20},setters:{address:"address",neighborhood:"neighborhood",city:"city",subregion:"subregion",region:"region",postal:"postal",country:"country",text:"text",category:"category",token:"token",key:"magicKey",fields:"outFields",forStorage:"forStorage",maxLocations:"maxLocations"},initialize:function(n){n=n||{};n.url=n.url||r;i.Task.prototype.initialize.call(this,n)},within:function(n){return n=t.latLngBounds(n),this.params.bbox=i.Util.boundsToExtent(n),this},nearby:function(n,i){return n=t.latLng(n),this.params.location=n.lng+","+n.lat,this.params.distance=Math.min(Math.max(i,2e3),5e4),this},run:function(n,t){return this.path=this.params.text?"find":"findAddressCandidates","findAddressCandidates"===this.path&&this.params.bbox&&(this.params.searchExtent=this.params.bbox,delete this.params.bbox),this.request(function(i,r){var u="find"===this.path?this._processFindResponse:this._processFindAddressCandidatesResponse,f=i?void 0:u(r);n.call(t,i,{results:f},r)},this)},_processFindResponse:function(n){for(var e,r,f=[],u=0;u<n.locations.length;u++)r=n.locations[u],r.extent&&(e=i.Util.extentToBounds(r.extent)),f.push({text:r.name,bounds:e,score:r.feature.attributes.Score,latlng:t.latLng(r.feature.geometry.y,r.feature.geometry.x),properties:r.feature.attributes});return f},_processFindAddressCandidatesResponse:function(n){for(var r,e,f=[],u=0;u<n.candidates.length;u++)r=n.candidates[u],e=i.Util.extentToBounds(r.extent),f.push({text:r.address,bounds:e,score:r.score,latlng:t.latLng(r.location.y,r.location.x),properties:r.attributes});return f}}),c=i.Task.extend({path:"reverseGeocode",params:{outSR:4326,returnIntersection:!1},setters:{distance:"distance",language:"langCode",intersection:"returnIntersection"},initialize:function(n){n=n||{};n.url=n.url||r;i.Task.prototype.initialize.call(this,n)},latlng:function(n){return n=t.latLng(n),this.params.location=n.lng+","+n.lat,this},run:function(n,i){return this.request(function(r,u){var f;f=r?void 0:{latlng:t.latLng(u.location.y,u.location.x),address:u.address};n.call(i,r,f,u)},this)}}),l=i.Task.extend({path:"suggest",params:{},setters:{text:"text",category:"category",countries:"countryCode"},initialize:function(n){n=n||{};n.url=n.url||r;i.Task.prototype.initialize.call(this,n)},within:function(n){n=t.latLngBounds(n);n=n.pad(.5);var r=n.getCenter(),u=n.getNorthWest();return this.params.location=r.lng+","+r.lat,this.params.distance=Math.min(Math.max(r.distanceTo(u),2e3),5e4),this.params.searchExtent=i.Util.boundsToExtent(n),this},nearby:function(n,i){return n=t.latLng(n),this.params.location=n.lng+","+n.lat,this.params.distance=Math.min(Math.max(i,2e3),5e4),this},run:function(n,t){return this.request(function(i,r){n.call(t,i,r,r)},this)}}),u=i.Service.extend({initialize:function(n){n=n||{};n.url=n.url||r;i.Service.prototype.initialize.call(this,n);this._confirmSuggestSupport()},geocode:function(){return f(this)},reverse:function(){return e(this)},suggest:function(){return o(this)},_confirmSuggestSupport:function(){this.metadata(function(n,t){n||(this.options.supportsSuggest=t.capabilities.indexOf("Suggest")>-1?!0:!1)},this)}}),a=t.Evented.extend({options:{zoomToResult:!0,useMapBounds:12,searchBounds:null},initialize:function(n,i){if(t.Util.setOptions(this,i),this._control=n,!i||!i.providers||!i.providers.length)throw new Error("You must specify at least one provider");this._providers=i.providers},_geocode:function(n,i,r){var u,f=0,e=[],s=t.Util.bind(function(t,i){f--;t||(i&&(e=e.concat(i)),0>=f&&(u=this._boundsFromResults(e),this.fire("results",{results:e,bounds:u,latlng:u?u.getCenter():void 0,text:n},!0),this.options.zoomToResult&&u&&this._control._map.fitBounds(u),this.fire("load")))},this),o;if(i)f++,r.results(n,i,this._searchBounds(),s);else for(o=0;o<this._providers.length;o++)f++,this._providers[o].results(n,i,this._searchBounds(),s)},_suggest:function(n){var f=this._providers.length,e=t.Util.bind(function(n,i){return t.Util.bind(function(t,r){if(!t){var u;if(f-=1,n.length<2)return this._suggestions.innerHTML="",void(this._suggestions.style.display="none");if(r)for(u=0;u<r.length;u++)r[u].provider=i;if(i._lastRender!==n&&i.nodes){for(u=0;u<i.nodes.length;u++)i.nodes[u].parentElement&&this._control._suggestions.removeChild(i.nodes[u]);i.nodes=[]}r.length&&this._control._input.value===n&&(this._control.clearSuggestions(i.nodes),i._lastRender=n,i.nodes=this._control._renderSuggestions(r),this._control._nodes=[])}},this)},this),i,r,u;for(this._pendingSuggestions=[],i=0;i<this._providers.length;i++)r=this._providers[i],u=r.suggestions(n,this._searchBounds(),e(n,r)),this._pendingSuggestions.push(u)},_searchBounds:function(){return null!==this.options.searchBounds?this.options.searchBounds:this.options.useMapBounds===!1?null:this.options.useMapBounds===!0?this._control._map.getBounds():this.options.useMapBounds<=this._control._map.getZoom()?this._control._map.getBounds():null},_boundsFromResults:function(n){var i,e,r;if(n.length){for(var s=t.latLngBounds([0,0],[0,0]),u=[],o=[],f=n.length-1;f>=0;f--)i=n[f],o.push(i.latlng),i.bounds&&i.bounds.isValid()&&!i.bounds.equals(s)&&u.push(i.bounds);for(e=t.latLngBounds(o),r=0;r<u.length;r++)e.extend(u[r]);return e}},_getAttribution:function(){for(var i=[],t=this._providers,n=0;n<t.length;n++)t[n].options.attribution&&i.push(t[n].options.attribution);return i.join(", ")}}),v=t.Control.extend({includes:t.Mixin.Events,options:{position:"topleft",collapseAfterResult:!0,expanded:!1,allowMultipleResults:!0,placeholder:"Search for places or addresses",title:"Location Search"},initialize:function(n){if(t.Util.setOptions(this,n),!n||!n.providers||!n.providers.length)throw new Error("You must specify at least one provider");this._geosearchCore=s(this,n);this._geosearchCore._providers=n.providers;this._geosearchCore.addEventParent(this);for(var i=0;i<this._geosearchCore._providers.length;i++)this._geosearchCore._providers[i].addEventParent(this);this._geosearchCore._pendingSuggestions=[];t.Control.prototype.initialize.call(n)},_renderSuggestions:function(n){var s,u,r,f,e,i,o;for(this._suggestions.style.display="block",this._suggestions.style.maxHeight=this._map.getSize().y-this._suggestions.offsetTop-this._wrapper.offsetTop-10+"px",f=[],e=0;e<n.length;e++)i=n[e],!r&&this._geosearchCore._providers.length>1&&s!==i.provider.options.label&&(r=t.DomUtil.create("span","geocoder-control-header",this._suggestions),r.textContent=i.provider.options.label,r.innerText=i.provider.options.label,s=i.provider.options.label,f.push(r)),u||(u=t.DomUtil.create("ul","geocoder-control-list",this._suggestions)),o=t.DomUtil.create("li","geocoder-control-suggestion",u),o.innerHTML=i.text,o.provider=i.provider,o["data-magic-key"]=i.magicKey;return t.DomUtil.removeClass(this._input,"geocoder-control-loading"),f.push(u),f},_boundsFromResults:function(n){var i,e,r;if(n.length){for(var s=t.latLngBounds([0,0],[0,0]),u=[],o=[],f=n.length-1;f>=0;f--)i=n[f],o.push(i.latlng),i.bounds&&i.bounds.isValid()&&!i.bounds.equals(s)&&u.push(i.bounds);for(e=t.latLngBounds(o),r=0;r<u.length;r++)e.extend(u[r]);return e}},clear:function(){this._suggestions.innerHTML="";this._suggestions.style.display="none";this._input.value="";this.options.collapseAfterResult&&(this._input.placeholder="",t.DomUtil.removeClass(this._wrapper,"geocoder-control-expanded"));!this._map.scrollWheelZoom.enabled()&&this._map.options.scrollWheelZoom&&this._map.scrollWheelZoom.enable()},clearSuggestions:function(){if(this._nodes)for(var n=0;n<this._nodes.length;n++)this._nodes[n].parentElement&&this._suggestions.removeChild(this._nodes[n])},_setupClick:function(){t.DomUtil.addClass(this._wrapper,"geocoder-control-expanded");this._input.focus()},disable:function(){this._input.disabled=!0;t.DomUtil.addClass(this._input,"geocoder-control-input-disabled");t.DomEvent.removeListener(this._wrapper,"click",this._setupClick,this)},enable:function(){this._input.disabled=!1;t.DomUtil.removeClass(this._input,"geocoder-control-input-disabled");t.DomEvent.addListener(this._wrapper,"click",this._setupClick,this)},getAttribution:function(){for(var t=[],n=0;n<this._providers.length;n++)this._providers[n].options.attribution&&t.push(this._providers[n].options.attribution);return t.join(", ")},onAdd:function(n){this._map=n;this._wrapper=t.DomUtil.create("div","geocoder-control "+(this.options.expanded?" geocoder-control-expanded":""));this._input=t.DomUtil.create("input","geocoder-control-input leaflet-bar",this._wrapper);this._input.title=this.options.title;this._suggestions=t.DomUtil.create("div","geocoder-control-suggestions leaflet-bar",this._wrapper);var i=this._geosearchCore._getAttribution();return n.attributionControl.addAttribution(i),t.DomEvent.addListener(this._input,"focus",function(){this._input.placeholder=this.options.placeholder;t.DomUtil.addClass(this._wrapper,"geocoder-control-expanded")},this),t.DomEvent.addListener(this._wrapper,"click",this._setupClick,this),t.DomEvent.addListener(this._suggestions,"mousedown",function(n){var t=n.target||n.srcElement;this._geosearchCore._geocode(t.innerHTML,t["data-magic-key"],t.provider);this.clear()},this),t.DomEvent.addListener(this._input,"blur",function(){this.clear()},this),t.DomEvent.addListener(this._input,"keydown",function(n){var s,h,e,u;t.DomUtil.addClass(this._wrapper,"geocoder-control-expanded");for(var o,r=this._suggestions.querySelectorAll(".geocoder-control-suggestion"),i=this._suggestions.querySelectorAll(".geocoder-control-selected")[0],f=0;f<r.length;f++)if(r[f]===i){o=f;break}switch(n.keyCode){case 13:i?(this._geosearchCore._geocode(i.innerHTML,i["data-magic-key"],i.provider),this.clear()):this.options.allowMultipleResults?(this._geosearchCore._geocode(this._input.value,void 0),this.clear()):t.DomUtil.addClass(r[0],"geocoder-control-selected");t.DomEvent.preventDefault(n);break;case 38:i&&t.DomUtil.removeClass(i,"geocoder-control-selected");s=r[o-1];i&&s?t.DomUtil.addClass(s,"geocoder-control-selected"):t.DomUtil.addClass(r[r.length-1],"geocoder-control-selected");t.DomEvent.preventDefault(n);break;case 40:i&&t.DomUtil.removeClass(i,"geocoder-control-selected");h=r[o+1];i&&h?t.DomUtil.addClass(h,"geocoder-control-selected"):t.DomUtil.addClass(r[0],"geocoder-control-selected");t.DomEvent.preventDefault(n);break;default:for(e=0;e<this._geosearchCore._pendingSuggestions.length;e++)u=this._geosearchCore._pendingSuggestions[e],u&&u.abort&&!u.id&&u.abort()}},this),t.DomEvent.addListener(this._input,"keyup",t.Util.throttle(function(n){var i=n.which||n.keyCode,r=(n.target||n.srcElement).value;return r.length<2?(this._suggestions.innerHTML="",this._suggestions.style.display="none",void t.DomUtil.removeClass(this._input,"geocoder-control-loading")):27===i?(this._suggestions.innerHTML="",void(this._suggestions.style.display="none")):void(13!==i&&38!==i&&40!==i&&this._input.value!==this._lastValue&&(this._lastValue=this._input.value,t.DomUtil.addClass(this._input,"geocoder-control-loading"),this._geosearchCore._suggest(r)))},50,this),this),t.DomEvent.disableClickPropagation(this._wrapper),t.DomEvent.addListener(this._suggestions,"mouseover",function(){n.scrollWheelZoom.enabled()&&n.options.scrollWheelZoom&&n.scrollWheelZoom.disable()}),t.DomEvent.addListener(this._suggestions,"mouseout",function(){!n.scrollWheelZoom.enabled()&&n.options.scrollWheelZoom&&n.scrollWheelZoom.enable()}),this._geosearchCore.on("load",function(){t.DomUtil.removeClass(this._input,"geocoder-control-loading");this.clear();this._input.blur()},this),this._wrapper},onRemove:function(n){n.attributionControl.removeAttribution("Geocoding by Esri")}}),y=u.extend({options:{label:"Places and Addresses",maxResults:5,attribution:'<a href="https://developers.arcgis.com/en/features/geocoding/">Geocoding by Esri<\/a>'},suggestions:function(n,t,i){var r=this.suggest().text(n);return t&&r.within(t),this.options.countries&&r.countries(this.options.countries),this.options.categories&&r.category(this.options.categories),r.run(function(n,t,r){var f=[],u;if(!n)for(;r.suggestions.length&&f.length<=this.options.maxResults-1;)u=r.suggestions.shift(),u.isCollection||f.push({text:u.text,magicKey:u.magicKey});i(n,f)},this)},results:function(n,t,i,r){var u=this.geocode().text(n);return t?u.key(t):u.maxLocations(this.options.maxResults),i&&u.within(i),this.options.forStorage&&u.forStorage(!0),u.run(function(n,t){r(n,t.results)},this)}}),p=i.FeatureLayerService.extend({options:{label:"Feature Layer",maxResults:5,bufferRadius:1e3,formatSuggestion:function(n){return n.properties[this.options.searchFields[0]]}},initialize:function(n){i.FeatureLayerService.prototype.initialize.call(this,n);"string"==typeof this.options.searchFields&&(this.options.searchFields=[this.options.searchFields])},suggestions:function(n,t,i){var r=this.query().where(this._buildQuery(n)).returnGeometry(!1);return t&&r.intersects(t),this.options.idField&&r.fields([this.options.idField].concat(this.options.searchFields)),r.run(function(n,t,r){var f;if(n)i(n,[]);else{this.options.idField=r.objectIdFieldName;for(var e=[],o=Math.min(t.features.length,this.options.maxResults),u=0;o>u;u++)f=t.features[u],e.push({text:this.options.formatSuggestion.call(this,f),magicKey:f.id});i(n,e.slice(0,this.options.maxResults).reverse())}},this)},results:function(n,i,r,u){var f=this.query();return i?f.featureIds([i]):f.where(this._buildQuery(n)),r&&f.within(r),f.run(t.Util.bind(function(n,t){for(var i,e,o,f=[],r=0;r<t.features.length;r++)i=t.features[r],i&&(e=this._featureBounds(i),o={latlng:e.getCenter(),bounds:e,text:this.options.formatSuggestion.call(this,i),properties:i.properties,geojson:i},f.push(o));u(n,f)},this))},_buildQuery:function(n){for(var r,i=[],t=this.options.searchFields.length-1;t>=0;t--)r='upper("'+this.options.searchFields[t]+'")',i.push(r+" LIKE upper('%"+n+"%')");return i.join(" OR ")},_featureBounds:function(n){var r=t.geoJson(n);if("Point"===n.geometry.type){var i=r.getBounds().getCenter(),u=this.options.bufferRadius/40075017*360/Math.cos(180/Math.PI*i.lat),f=this.options.bufferRadius/40075017*360;return t.latLngBounds([i.lat-f,i.lng-u],[i.lat+f,i.lng+u])}return r.getBounds()}}),w=i.MapService.extend({options:{layers:[0],label:"Map Service",bufferRadius:1e3,maxResults:5,formatSuggestion:function(n){return n.properties[n.displayFieldName]+" <small>"+n.layerName+"<\/small>"}},initialize:function(n){i.MapService.prototype.initialize.call(this,n);this._getIdFields()},suggestions:function(n,t,i){var r=this.find().text(n).fields(this.options.searchFields).returnGeometry(!1).layers(this.options.layers);return r.run(function(n,t,r){var o=[],s,u;if(!n)for(s=Math.min(this.options.maxResults,t.features.length),r.results=r.results.reverse(),u=0;s>u;u++){var e=t.features[u],h=r.results[u],f=h.layerId,c=this._idFields[f];e.layerId=f;e.layerName=this._layerNames[f];e.displayFieldName=this._displayFields[f];c&&o.push({text:this.options.formatSuggestion.call(this,e),magicKey:h.attributes[c]+":"+f})}i(n,o.reverse())},this)},results:function(n,t,i,r){var f,e=[],o,u;return t?(o=t.split(":")[0],u=t.split(":")[1],f=this.query().layer(u).featureIds(o)):f=this.find().text(n).fields(this.options.searchFields).contains(!1).layers(this.options.layers),f.run(function(n,t,i){var o,f,s,h;if(!n)for(i.results&&(i.results=i.results.reverse()),o=0;o<t.features.length;o++)f=t.features[o],(u=u||i.results[o].layerId,f&&void 0!==u)&&(s=this._featureBounds(f),f.layerId=u,f.layerName=this._layerNames[u],f.displayFieldName=this._displayFields[u],h={latlng:s.getCenter(),bounds:s,text:this.options.formatSuggestion.call(this,f),properties:f.properties,geojson:f},e.push(h));r(n,e.reverse())},this)},_featureBounds:function(n){var r=t.geoJson(n);if("Point"===n.geometry.type){var i=r.getBounds().getCenter(),u=this.options.bufferRadius/40075017*360/Math.cos(180/Math.PI*i.lat),f=this.options.bufferRadius/40075017*360;return t.latLngBounds([i.lat-f,i.lng-u],[i.lat+f,i.lng+u])}return r.getBounds()},_layerMetadataCallback:function(n){return t.Util.bind(function(t,i){var r,u;if(!t)for(this._displayFields[n]=i.displayField,this._layerNames[n]=i.name,r=0;r<i.fields.length;r++)if(u=i.fields[r],"esriFieldTypeOID"===u.type){this._idFields[n]=u.name;break}},this)},_getIdFields:function(){var n,t;for(this._idFields={},this._displayFields={},this._layerNames={},n=0;n<this.options.layers.length;n++)t=this.options.layers[n],this.get(t,{},this._layerMetadataCallback(t))}}),b=u.extend({options:{label:"Geocode Server",maxResults:5},suggestions:function(n,t,i){if(this.options.supportsSuggest){var r=this.suggest().text(n);return t&&r.within(t),r.run(function(n,t,r){var f=[],u;if(!n)for(;r.suggestions.length&&f.length<=this.options.maxResults-1;)u=r.suggestions.shift(),u.isCollection||f.push({text:u.text,magicKey:u.magicKey});i(n,f)},this)}return i(void 0,[]),!1},results:function(n,t,i,r){var u=this.geocode().text(n);return u.maxLocations(this.options.maxResults),i&&u.within(i),u.run(function(n,t){r(n,t.results)},this)}}),r="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/";n.WorldGeocodingServiceUrl=r;n.VERSION="2.1.0";n.Geocode=h;n.geocode=f;n.ReverseGeocode=c;n.reverseGeocode=e;n.Suggest=l;n.suggest=o;n.GeocodeService=u;n.geocodeService=k;n.Geosearch=v;n.geosearch=d;n.GeosearchCore=a;n.geosearchCore=s;n.ArcgisOnlineProvider=y;n.arcgisOnlineProvider=g;n.FeatureLayerProvider=p;n.featureLayerProvider=nt;n.MapServiceProvider=w;n.mapServiceProvider=tt;n.GeocodeServiceProvider=b;n.geocodeServiceProvider=it})