(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,32322,(t,e,i)=>{t.e,function(t){"use strict";function e(t){var e,i,n,r;for(i=1,n=arguments.length;itypeof L&&L&&L.Mixin){t=P(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};function F(t,e,i){return t instanceof G?t:P(t)?new G(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new G(t.x,t.y):new G(t,e,i)}function U(t,e){if(t)for(var i=e?[t,e]:t,n=0,r=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=V(t);var e=this.min,i=this.max,n=t.min,r=t.max,o=r.x>=e.x&&n.x<=i.x,s=r.y>=e.y&&n.y<=i.y;return o&&s},overlaps:function(t){t=V(t);var e=this.min,i=this.max,n=t.min,r=t.max,o=r.x>e.x&&n.xe.y&&n.y=n.lat&&i.lat<=r.lat&&e.lng>=n.lng&&i.lng<=r.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),r=t.getNorthEast(),o=r.lat>=e.lat&&n.lat<=i.lat,s=r.lng>=e.lng&&n.lng<=i.lng;return o&&s},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),r=t.getNorthEast(),o=r.lat>e.lat&&n.late.lng&&n.lngtypeof orientation||tI("mobile"),tw=!window.PointerEvent&&window.MSPointerEvent,tC=!!(window.PointerEvent||tw),tP="ontouchstart"in window||!!window.TouchEvent,tE=!window.L_NO_TOUCH&&(tP||tC),tT=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,tS=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",y,e),window.removeEventListener("testPassiveEventSupport",y,e)}catch(t){}return t}(),tB=!!document.createElement("canvas").getContext,tO=!!(document.createElementNS&&ti("svg").createSVGRect),tD=!!tO&&((u=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(u.firstChild&&u.firstChild.namespaceURI)),tR=!tO&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function tI(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var tA={ie:to,ielt9:ts,edge:ta,webkit:tl,android:th,android23:tu,androidStock:tc,opera:td,chrome:t_,gecko:tf,safari:tm,phantom:tg,opera12:ty,win:tv,ie3d:tL,webkit3d:tb,gecko3d:tk,any3d:tM,mobile:tx,mobileWebkit:tx&&tl,mobileWebkit3d:tx&&tb,msPointer:tw,pointer:tC,touch:tE,touchNative:tP,mobileOpera:tx&&td,mobileGecko:tx&&tf,retina:tT,passiveEvents:tS,canvas:tB,svg:tO,vml:tR,inlineSvg:tD,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},tz=tA.msPointer?"MSPointerDown":"pointerdown",tN=tA.msPointer?"MSPointerMove":"pointermove",tj=tA.msPointer?"MSPointerUp":"pointerup",tG=tA.msPointer?"MSPointerCancel":"pointercancel",tZ={touchstart:tz,touchmove:tN,touchend:tj,touchcancel:tG},tF={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ek(e),tW(t,e)},touchmove:tW,touchend:tW,touchcancel:tW},tU={},tV=!1;function tH(t){tU[t.pointerId]=t}function tq(t){tU[t.pointerId]&&(tU[t.pointerId]=t)}function tK(t){delete tU[t.pointerId]}function tW(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],tU)e.touches.push(tU[i]);e.changedTouches=[e],t(e)}}var tY=ee(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),tX=ee(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),tJ="webkitTransition"===tX||"OTransition"===tX?tX+"End":"transitionend";function t$(t){return"string"==typeof t?document.getElementById(t):t}function tQ(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function t0(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function t1(t){var e=t.parentNode;e&&e.removeChild(t)}function t2(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function t3(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function t4(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function t8(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=t7(t);return i.length>0&&RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function t5(t,e){if(void 0!==t.classList)for(var i=k(e),n=0,r=i.length;n0?2*window.devicePixelRatio:1;function eP(t){return tA.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/eC:t.deltaY&&1===t.deltaMode?-(20*t.deltaY):t.deltaY&&2===t.deltaMode?-(60*t.deltaY):t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&32765>Math.abs(t.detail)?-(20*t.detail):t.detail?-(60*(t.detail/32765)):0}function eE(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var eT=j.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=er(t),this._offset=e.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=I(this._animate,this),this._step()},_step:function(t){var e=new Date-this._startTime,i=1e3*this._duration;ethis.options.maxZoom))?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,q(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=F((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=F(e.paddingBottomRight||e.padding||[0,0]),r=this.project(this.getCenter()),o=this.project(t),s=this.getPixelBounds(),a=V([s.min.add(i),s.max.subtract(n)]),l=a.getSize();if(!a.contains(o)){this._enforcingBounds=!0;var h=o.subtract(a.getCenter()),u=a.extend(o).getSize().subtract(l);r.x+=h.x<0?-u.x:u.x,r.y+=h.y<0?-u.y:u.y,this.panTo(this.unproject(r),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),r=i.divideBy(2).round(),o=n.divideBy(2).round(),s=r.subtract(o);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(d(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=d(this._handleGeolocationResponse,this),n=d(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,n,t):navigator.geolocation.getCurrentPosition(i,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new K(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var r=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(r,n.maxZoom):r)}var o={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(o[s]=t.coords[s]);this.fire("locationfound",o)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){var t;if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),t1(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(A(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)t1(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=t0("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return(this._checkIfLoaded(),this._lastCenter&&!this._moved())?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new H(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=q(t),i=F(i||[0,0]);var n=this.getZoom()||0,r=this.getMinZoom(),o=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=V(this.project(a,n),this.project(s,n)).getSize(),u=tA.any3d?this.options.zoomSnap:1,p=l.x/h.x,c=l.y/h.y,d=e?Math.max(p,c):Math.min(p,c);return n=this.getScaleZoom(d,n),u&&(n=u/100*Math.round(n/(u/100)),n=e?Math.ceil(n/u)*u:Math.floor(n/u)*u),Math.max(r,Math.min(o,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new G(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new U(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(W(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(F(t),e)},layerPointToLatLng:function(t){var e=F(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(W(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(W(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(W(t),W(e))},containerPointToLayerPoint:function(t){return F(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return F(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(F(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(W(t)))},mouseEventToContainerPoint:function(t){return ew(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=t$(t);if(e){if(e._leaflet_id)throw Error("Map container is already initialized.")}else throw Error("Map container not found.");ec(e,"scroll",this._onScroll,this),this._containerId=f(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&tA.any3d,t5(t,"leaflet-container"+(tA.touch?" leaflet-touch":"")+(tA.retina?" leaflet-retina":"")+(tA.ielt9?" leaflet-oldie":"")+(tA.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=tQ(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),en(this._mapPane,new G(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(t5(t.markerPane,"leaflet-zoom-hide"),t5(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){en(this._mapPane,new G(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var r=this._zoom!==e;this._moveStart(r,i)._move(t,e)._moveEnd(r),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var r=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((r||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return A(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){en(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[f(this._container)]=this;var e=t?e_:ec;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),tA.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){A(this._resizeRequest),this._resizeRequest=I(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],r="mouseout"===e||"mouseover"===e,o=t.target||t.srcElement,s=!1;o;){if((i=this._targets[f(o)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){s=!0;break}if(i&&i.listens(e,!0)&&(r&&!eE(o,t)||(n.push(i),r)))break;if(o===this._container)break;o=o.parentNode}return!n.length&&!s&&!r&&this.listens(e,!0)&&(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var i=t.type;"mousedown"===i&&el(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,n){if("click"===t.type){var r=e({},t);r.type="preclick",this._fireDOMEvent(r,r.type,n)}var o=this._findEventTargets(t,i);if(n){for(var s=[],a=0;a=Math.abs(s.x)&&1>=Math.abs(s.y)?t:this.unproject(n.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new U(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=V(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),r=n.min.subtract(t.min),o=n.max.subtract(t.max);return new G(this._rebound(r.x,-o.x),this._rebound(r.y,-o.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=tA.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){t6(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return(!0===(e&&e.animate)||!!this.getSize().contains(i))&&(this.panBy(i,e),!0)},_createAnimProxy:function(){var t=this._proxy=t0("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=this._proxy.style[tY];ei(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style[tY]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){t1(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();ei(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),r=this._getCenterOffset(t)._divideBy(1-1/n);return(!0===i.animate||!!this.getSize().contains(r))&&(I(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,t5(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(d(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&t6(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}}),eB=z.extend({options:{position:"topright"},initialize:function(t){M(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return t5(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(t1(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),eO=function(t){return new eB(t)};eS.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=t0("div",e+"control-container",this._container);function n(n,r){t[n+r]=t0("div",e+n+" "+e+r,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)t1(this._controlCorners[t]);t1(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var eD=eB.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(f(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i=document.createElement("div");return i.innerHTML='",i.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+f(this),n),this._layerControlInputs.push(e),e.layerId=f(t.layer),ec(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var o=document.createElement("span");return i.appendChild(o),o.appendChild(e),o.appendChild(r),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],r=[];this._handlingClick=!0;for(var o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||r.push(e);for(o=0;o=0;r--)t=i[r],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&ne.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,ec(t,"click",ek),this.expand();var e=this;setTimeout(function(){e_(t,"click",ek),e._preventClick=!1})}}),eR=eB.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=t0("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,r){var o=t0("a",i,n);return o.innerHTML=t,o.href="#",o.title=e,o.setAttribute("role","button"),o.setAttribute("aria-label",e),eb(o),ec(o,"click",eM),ec(o,"click",r,this),ec(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";t6(this._zoomInButton,e),t6(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(t5(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(t5(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});eS.mergeOptions({zoomControl:!0}),eS.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new eR,this.addControl(this.zoomControl))});var eI=eB.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=t0("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=t0("div",e,i)),t.imperial&&(this._iScale=t0("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,n,r=3.2808399*t;r>5280?(e=r/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(r),this._updateScale(this._iScale,n+" ft",n/r))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),eA=eB.extend({options:{position:"bottomright",prefix:''+(tA.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){M(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=t0("div","leaflet-control-attribution"),eb(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' ')}}});eS.mergeOptions({attributionControl:!0}),eS.addInitHook(function(){this.options.attributionControl&&new eA().addTo(this)}),eB.Layers=eD,eB.Zoom=eR,eB.Scale=eI,eB.Attribution=eA,eO.layers=function(t,e,i){return new eD(t,e,i)},eO.zoom=function(t){return new eR(t)},eO.scale=function(t){return new eI(t)},eO.attribution=function(t){return new eA(t)};var ez=z.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});ez.addTo=function(t,e){return t.addHandler(e,this),this};var eN=tA.touch?"touchstart mousedown":"mousedown",ej=j.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){M(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(ec(this._dragStartTarget,eN,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ej._dragging===this&&this.finishDrag(!0),e_(this._dragStartTarget,eN,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!(!this._enabled||(this._moved=!1,t8(this._element,"leaflet-zoom-anim")))){if(t.touches&&1!==t.touches.length){ej._dragging===this&&this.finishDrag();return}if(!ej._dragging&&!t.shiftKey&&(1===t.which||1===t.button||t.touches)&&(ej._dragging=this,this._preventOutline&&el(this._element),es(),i(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,n=eu(this._element);this._startPoint=new G(e.clientX,e.clientY),this._startPos=er(this._element),this._parentScale=ep(n);var r="mousedown"===t.type;ec(document,r?"mousemove":"touchmove",this._onMove,this),ec(document,r?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new G(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)typeof Uint8Array?Uint8Array:Array)(i);n[0]=n[i-1]=1,function t(e,i,n,r,o){var s,a,l,h=0;for(a=r+1;a<=o-1;a++)(l=eW(e[a],e[r],e[o],!0))>h&&(s=a,h=l);h>n&&(i[s]=1,t(e,i,n,r,s),t(e,i,n,s,o))}(t,n,e,0,i-1);var r,o=[];for(r=0;re&&(i.push(t[n]),r=n);return re.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function eW(t,e,i,n){var r,o=e.x,s=e.y,a=i.x-o,l=i.y-s,h=a*a+l*l;return h>0&&((r=((t.x-o)*a+(t.y-s)*l)/h)>1?(o=i.x,s=i.y):r>0&&(o+=a*r,s+=l*r)),a=t.x-o,l=t.y-s,n?a*a+l*l:new G(o,s)}function eY(t){return!P(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function eX(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),eY(t)}function eJ(t,e){if(!t||0===t.length)throw Error("latlngs not passed");eY(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var i,n,r,o,s,a,l,h,u=W([0,0]),p=q(t);p.getNorthWest().distanceTo(p.getSouthWest())*p.getNorthEast().distanceTo(p.getNorthWest())<1700&&(u=eF(t));var c=t.length,d=[];for(i=0;in){l=(o-n)/r,h=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var f=e.unproject(F(h));return W([f.lat+u.lat,f.lng+u.lng])}var e$={project:function(t){return new G(t.lng,t.lat)},unproject:function(t){return new K(t.y,t.x)},bounds:new U([-180,-90],[180,90])},eQ={R:6378137,R_MINOR:6356752.314245179,bounds:new U([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,r=this.R_MINOR/i,o=Math.sqrt(1-r*r),s=o*Math.sin(n);return n=-i*Math.log(Math.max(Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),o/2),1e-10)),new G(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,r=this.R_MINOR/n,o=Math.sqrt(1-r*r),s=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(s),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)h=Math.PI/2-2*Math.atan(s*(e=Math.pow((1-(e=o*Math.sin(a)))/(1+e),o/2)))-a,a+=h;return new K(a*i,t.x*i/n)}},e0=e({},X,{code:"EPSG:3395",projection:eQ,transformation:Q(p=.5/(Math.PI*eQ.R),.5,-p,.5)}),e1=e({},X,{code:"EPSG:4326",projection:e$,transformation:Q(1/180,1,-1/180,.5)}),e2=e({},Y,{projection:e$,transformation:Q(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});Y.Earth=X,Y.EPSG3395=e0,Y.EPSG3857=tt,Y.EPSG900913=te,Y.EPSG4326=e1,Y.Simple=e2;var e3=j.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[f(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[f(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});eS.include({addLayer:function(t){if(!t._layerAdd)throw Error("The provided object is not a Layer.");var e=f(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=f(t);return this._layers[e]&&(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return f(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){t=t?P(t)?t:[t]:[];for(var e=0,i=t.length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof K&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){ir.prototype._setLatLngs.call(this,t),eY(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return eY(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new G(e,e);if(t=new U(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t)){if(this.options.noClip){this._parts=this._rings;return}for(var n,r=0,o=this._rings.length;rt.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||ir.prototype._containsPoint.call(this,t,!0)}}),is=e8.extend({initialize:function(t,e){M(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,r=P(t)?t:t.features;if(r){for(e=0,i=r.length;e0&&r.push(r[0].slice()),r}function id(t,i){return t.feature?e({},t.feature,{geometry:i}):i_(i)}function i_(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var im={toGeoJSON:function(t){return id(this,{type:"Point",coordinates:ip(this.getLatLng(),t)})}};function ig(t,e){return new is(t,e)}e7.include(im),ii.include(im),ie.include(im),ir.include({toGeoJSON:function(t){var e=!eY(this._latlngs),i=ic(this._latlngs,+!!e,!1,t);return id(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),io.include({toGeoJSON:function(t){var e=!eY(this._latlngs),i=e&&!eY(this._latlngs[0]),n=ic(this._latlngs,i?2:+!!e,!0,t);return e||(n=[n]),id(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),e4.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),id(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return(this.eachLayer(function(e){if(e.toGeoJSON){var r=e.toGeoJSON(t);if(i)n.push(r.geometry);else{var o=i_(r);"FeatureCollection"===o.type?n.push.apply(n,o.features):n.push(o)}}}),i)?id(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var iy=e3.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=q(e),M(this,i)},onAdd:function(){!this._image&&(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(t5(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){t1(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&t3(this._image),this},bringToBack:function(){return this._map&&t4(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=q(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:t0("img");if(t5(e,"leaflet-image-layer"),this._zoomAnimated&&t5(e,"leaflet-zoom-animated"),this.options.className&&t5(e,this.options.className),e.onselectstart=y,e.onmousemove=y,e.onload=d(this.fire,this,"load"),e.onerror=d(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;ei(this._image,i,e)},_reset:function(){var t=this._image,e=new U(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();en(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){et(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),iv=iy.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:t0("video");if(t5(e,"leaflet-image-layer"),this._zoomAnimated&&t5(e,"leaflet-zoom-animated"),this.options.className&&t5(e,this.options.className),e.onselectstart=y,e.onmousemove=y,e.onloadeddata=d(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],r=0;r0?n:[e.src];return}P(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var o=0;or?(e.height=r+"px",t5(t,o)):t6(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();en(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(tQ(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,r=new G(this._containerLeft,-i-this._containerBottom);r._add(er(this._container));var o=t.layerPointToContainerPoint(r),s=F(this.options.autoPanPadding),a=F(this.options.autoPanPaddingTopLeft||s),l=F(this.options.autoPanPaddingBottomRight||s),h=t.getSize(),u=0,p=0;o.x+n+l.x>h.x&&(u=o.x+n-h.x+l.x),o.x-u-a.x<0&&(u=o.x-a.x),o.y+i+l.y>h.y&&(p=o.y+i-h.y+l.y),o.y-p-a.y<0&&(p=o.y-a.y),(u||p)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([u,p]))}},_getAnchor:function(){return F(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});eS.mergeOptions({closePopupOnClick:!0}),eS.include({openPopup:function(t,e,i){return this._initOverlay(ik,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),e3.include({bindPopup:function(t,e){return this._popup=this._initOverlay(ik,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof e8||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){eM(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof it))return void(this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng));this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var iM=ib.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){ib.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){ib.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=ib.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=t0("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+f(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,r=this._container,o=n.latLngToContainerPoint(n.getCenter()),s=n.layerPointToContainerPoint(t),a=this.options.direction,l=r.offsetWidth,h=r.offsetHeight,u=F(this.options.offset),p=this._getAnchor();"top"===a?(e=l/2,i=h):"bottom"===a?(e=l/2,i=0):("center"===a?e=l/2:"right"===a?e=0:"left"===a?e=l:s.xthis.options.maxZoom||in&&this._retainParent(r,o,s,n))},_retainChildren:function(t,e,i,n){for(var r=2*t;r<2*t+2;r++)for(var o=2*e;o<2*e+2;o++){var s=new G(r,o);s.z=i+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];if(l&&l.active){l.retain=!0;continue}l&&l.loaded&&(l.retain=!0),i+1this.options.maxZoom||void 0!==this.options.minZoom&&r1)return void this._setView(t,i);for(var p=r.min.y;p<=r.max.y;p++)for(var c=r.min.x;c<=r.max.x;c++){var d=new G(c,p);if(d.z=this._tileZoom,this._isValidTile(d)){var _=this._tiles[this._tileCoordsToKey(d)];_?_.current=!0:s.push(d)}}if(s.sort(function(t,e){return t.distanceTo(o)-e.distanceTo(o)}),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(c=0;ci.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return q(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),r=n.add(i);return[e.unproject(n,t.z),e.unproject(r,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new H(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new G(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(t1(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){t5(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=y,t.onmousemove=y,tA.ielt9&&this.options.opacity<1&&et(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),d(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&I(d(this._tileReady,this,t,null,r)),en(r,i),this._tiles[n]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(et(i.el,0),A(this._fadeFrame),this._fadeFrame=I(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(t5(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),tA.ielt9||!this._map._fadeAnimated?I(this._pruneTiles,this):setTimeout(d(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new G(this._wrapX?g(t.x,this._wrapX):t.x,this._wrapY?g(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new U(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),iC=iw.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=M(this,e)).detectRetina&&tA.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return ec(i,"load",d(this._tileOnLoad,this,e,i)),ec(i,"error",d(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var i={r:tA.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(i.y=n),i["-y"]=n}return C(this._url,e(i,this.options))},_tileOnLoad:function(t,e){tA.ielt9?setTimeout(d(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,i=this.options.zoomReverse,n=this.options.zoomOffset;return i&&(t=e-t),t+n},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=y,e.onerror=y,!e.complete)){e.src=T;var i=this._tiles[t].coords;t1(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",T),iw.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==T))return iw.prototype._tileReady.call(this,t,e,i)}});function iP(t,e){return new iC(t,e)}var iE=iC.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,i){this._url=t;var n=e({},this.defaultWmsParams);for(var r in i)r in this.options||(n[r]=i[r]);var o=(i=M(this,i)).detectRetina&&tA.retina?2:1,s=this.getTileSize();n.width=s.x*o,n.height=s.y*o,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,iC.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=V(i.project(e[0]),i.project(e[1])),r=n.min,o=n.max,s=(this._wmsVersion>=1.3&&this._crs===e1?[r.y,r.x,o.y,o.x]:[r.x,r.y,o.x,o.y]).join(","),a=iC.prototype.getTileUrl.call(this,t);return a+x(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,i){return e(this.wmsParams,t),i||this.redraw(),this}});iC.WMS=iE,iP.wms=function(t,e){return new iE(t,e)};var iT=e3.extend({options:{padding:.1},initialize:function(t){M(this,t),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),t5(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),o=n.multiplyBy(-i).add(r).subtract(this._map._getNewPixelOrigin(t,e));tA.any3d?ei(this._container,o,i):en(this._container,o)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new U(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),iS=iT.extend({options:{tolerance:0},getEvents:function(){var t=iT.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){iT.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ec(t,"mousemove",this._onMouseMove,this),ec(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ec(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){A(this._redrawRequest),delete this._ctx,t1(this._container),e_(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){iT.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=tA.retina?2:1;en(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",tA.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){iT.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[f(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[f(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),r=[];for(i=0;i')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),iD=tA.vml?iO:ti,iR=iT.extend({_initContainer:function(){this._container=iD("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=iD("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){t1(this._container),e_(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){iT.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),en(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=iD("path");t.options.className&&t5(e,t.options.className),t.options.interactive&&t5(e,"leaflet-interactive"),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){t1(t._path),t.removeInteractiveTarget(t._path),delete this._layers[f(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,tn(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n=Math.max(Math.round(t._radiusY),1)||i,r="a"+i+","+n+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+r+2*i+",0 "+r+-(2*i)+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){t3(t._path)},_bringToBack:function(t){t4(t._path)}});function iI(t){return tA.svg||tA.vml?new iR(t):null}tA.vml&&iR.include({_initContainer:function(){this._container=t0("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(iT.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=iO("shape");t5(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=iO("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;t1(e),t.removeInteractiveTarget(e),delete this._layers[f(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,r=t._container;r.stroked=!!n.stroke,r.filled=!!n.fill,n.stroke?(e||(e=t._stroke=iO("stroke")),r.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=P(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(r.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=iO("fill")),r.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(r.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){t3(t._container)},_bringToBack:function(t){t4(t._container)}}),eS.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&iB(t)||iI(t)}});var iA=io.extend({initialize:function(t,e){io.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=q(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});iR.create=iD,iR.pointsToPath=tn,is.geometryToLayer=ia,is.coordsToLatLng=ih,is.coordsToLatLngs=iu,is.latLngToCoords=ip,is.latLngsToCoords=ic,is.getFeature=id,is.asFeature=i_,eS.mergeOptions({boxZoom:!0});var iz=ez.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ec(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){e_(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){t1(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),i(),es(),this._startPoint=this._map.mouseEventToContainerPoint(t),ec(document,{contextmenu:eM,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=t0("div","leaflet-zoom-box",this._container),t5(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new U(this._point,this._startPoint),i=e.getSize();en(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(t1(this._box),t6(this._container,"leaflet-crosshair")),n(),ea(),e_(document,{contextmenu:eM,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(d(this._resetState,this),0);var e=new H(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});eS.addInitHook("addHandler","boxZoom",iz),eS.mergeOptions({doubleClickZoom:!0});var iN=ez.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,r=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(r):e.setZoomAround(t.containerPoint,r)}});eS.addInitHook("addHandler","doubleClickZoom",iN),eS.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ij=ez.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new ej(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}t5(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){t6(this._map._container,"leaflet-grab"),t6(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=q(this._map.options.maxBounds);this._offsetLimit=V(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,r=(n-e+i)%t+e-i,o=(n+e+i)%t-e-i,s=Math.abs(r+i)0?r:-r))-e;this._delta=0,this._startTime=null,o&&("center"===t.options.scrollWheelZoom?t.setZoom(e+o):t.setZoomAround(this._lastMousePos,e+o))}});eS.addInitHook("addHandler","scrollWheelZoom",iZ),eS.mergeOptions({tapHold:tA.touchNative&&tA.safari&&tA.mobile,tapTolerance:15});var iF=ez.extend({addHooks:function(){ec(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){e_(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new G(e.clientX,e.clientY),this._holdTimeout=setTimeout(d(function(){this._cancel(),this._isTapValid()&&(ec(document,"touchend",ek),ec(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),ec(document,"touchend touchcancel contextmenu",this._cancel,this),ec(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){e_(document,"touchend",ek),e_(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),e_(document,"touchend touchcancel contextmenu",this._cancel,this),e_(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new G(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});eS.addInitHook("addHandler","tapHold",iF),eS.mergeOptions({touchZoom:tA.touch,bounceAtZoomLimits:!0});var iU=ez.extend({addHooks:function(){t5(this._map._container,"leaflet-touch-zoom"),ec(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){t6(this._map._container,"leaflet-touch-zoom"),e_(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),ec(document,"touchmove",this._onTouchMove,this),ec(document,"touchend touchcancel",this._onTouchEnd,this),ek(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var o=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===o.x&&0===o.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(o),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),A(this._animRequest);var s=d(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=I(s,this,!0),ek(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,A(this._animRequest),e_(document,"touchmove",this._onTouchMove,this),e_(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});eS.addInitHook("addHandler","touchZoom",iU),eS.BoxZoom=iz,eS.DoubleClickZoom=iN,eS.Drag=ij,eS.Keyboard=iG,eS.ScrollWheelZoom=iZ,eS.TapHold=iF,eS.TouchZoom=iU,t.Bounds=U,t.Browser=tA,t.CRS=Y,t.Canvas=iS,t.Circle=ii,t.CircleMarker=ie,t.Class=z,t.Control=eB,t.DivIcon=ix,t.DivOverlay=ib,t.DomEvent={__proto__:null,on:ec,off:e_,stopPropagation:ev,disableScrollPropagation:eL,disableClickPropagation:eb,preventDefault:ek,stop:eM,getPropagationPath:ex,getMousePosition:ew,getWheelDelta:eP,isExternalTarget:eE,addListener:ec,removeListener:e_},t.DomUtil={__proto__:null,TRANSFORM:tY,TRANSITION:tX,TRANSITION_END:tJ,get:t$,getStyle:tQ,create:t0,remove:t1,empty:t2,toFront:t3,toBack:t4,hasClass:t8,addClass:t5,removeClass:t6,setClass:t9,getClass:t7,setOpacity:et,testProp:ee,setTransform:ei,setPosition:en,getPosition:er,get disableTextSelection(){return i},get enableTextSelection(){return n},disableImageDrag:es,enableImageDrag:ea,preventOutline:el,restoreOutline:eh,getSizedParentNode:eu,getScale:ep},t.Draggable=ej,t.Evented=j,t.FeatureGroup=e8,t.GeoJSON=is,t.GridLayer=iw,t.Handler=ez,t.Icon=e5,t.ImageOverlay=iy,t.LatLng=K,t.LatLngBounds=H,t.Layer=e3,t.LayerGroup=e4,t.LineUtil={__proto__:null,simplify:eU,pointToSegmentDistance:eV,closestPointOnSegment:function(t,e,i){return eW(t,e,i)},clipSegment:eH,_getEdgeIntersection:eq,_getBitCode:eK,_sqClosestPointOnSegment:eW,isFlat:eY,_flat:eX,polylineCenter:eJ},t.Map=eS,t.Marker=e7,t.Mixin={Events:N},t.Path=it,t.Point=G,t.PolyUtil={__proto__:null,clipPolygon:eG,polygonCenter:eZ,centroid:eF},t.Polygon=io,t.Polyline=ir,t.Popup=ik,t.PosAnimation=eT,t.Projection={__proto__:null,LonLat:e$,Mercator:eQ,SphericalMercator:J},t.Rectangle=iA,t.Renderer=iT,t.SVG=iR,t.SVGOverlay=iL,t.TileLayer=iC,t.Tooltip=iM,t.Transformation=$,t.Util={__proto__:null,extend:e,create:c,bind:d,get lastId(){return _},stamp:f,throttle:m,wrapNum:g,falseFn:y,formatNum:v,trim:b,splitWords:k,setOptions:M,getParamString:x,template:C,isArray:P,indexOf:E,emptyImageUrl:T,requestFn:D,cancelFn:R,requestAnimFrame:I,cancelAnimFrame:A},t.VideoOverlay=iv,t.bind=d,t.bounds=V,t.canvas=iB,t.circle=function(t,e,i){return new ii(t,e,i)},t.circleMarker=function(t,e){return new ie(t,e)},t.control=eO,t.divIcon=function(t){return new ix(t)},t.extend=e,t.featureGroup=function(t,e){return new e8(t,e)},t.geoJSON=ig,t.geoJson=ig,t.gridLayer=function(t){return new iw(t)},t.icon=function(t){return new e5(t)},t.imageOverlay=function(t,e,i){return new iy(t,e,i)},t.latLng=W,t.latLngBounds=q,t.layerGroup=function(t,e){return new e4(t,e)},t.map=function(t,e){return new eS(t,e)},t.marker=function(t,e){return new e7(t,e)},t.point=F,t.polygon=function(t,e){return new io(t,e)},t.polyline=function(t,e){return new ir(t,e)},t.popup=function(t,e){return new ik(t,e)},t.rectangle=function(t,e){return new iA(t,e)},t.setOptions=M,t.stamp=f,t.svg=iI,t.svgOverlay=function(t,e,i){return new iL(t,e,i)},t.tileLayer=iP,t.tooltip=function(t,e){return new iM(t,e)},t.transformation=Q,t.version="1.9.4",t.videoOverlay=function(t,e,i){return new iv(t,e,i)};var iV=window.L;t.noConflict=function(){return window.L=iV,this},window.L=t}(i)},15258,(t,e,i)=>{t.e,function(t){"use strict";var e=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(t){L.Util.setOptions(this,t),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=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var e=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,e?this._withAnimation:this._noAnimation),this._markerCluster=e?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(t){if(t instanceof L.LayerGroup)return this.addLayers([t]);if(!t.getLatLng)return this._nonPointGroup.addLayer(t),this.fire("layeradd",{layer:t}),this;if(!this._map)return this._needsClustering.push(t),this.fire("layeradd",{layer:t}),this;if(this.hasLayer(t))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(t,this._maxZoom),this.fire("layeradd",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var e=t,i=this._zoom;if(t.__parent)for(;e.__parent._zoom>=i;)e=e.__parent;return this._currentShownBounds.contains(e.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(t,e):this._animationAddLayerNonAnimated(t,e)),this},removeLayer:function(t){return t instanceof L.LayerGroup?this.removeLayers([t]):(t.getLatLng?this._map?t.__parent&&(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(t)),this._removeLayer(t,!0),this.fire("layerremove",{layer:t}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),t.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(t)&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow())):(!this._arraySplice(this._needsClustering,t)&&this.hasLayer(t)&&this._needsRemoving.push({layer:t,latlng:t._latlng}),this.fire("layerremove",{layer:t})):(this._nonPointGroup.removeLayer(t),this.fire("layerremove",{layer:t})),this)},addLayers:function(t,e){if(!L.Util.isArray(t))return this.addLayer(t);var i,n=this._featureGroup,r=this._nonPointGroup,o=this.options.chunkedLoading,s=this.options.chunkInterval,a=this.options.chunkProgress,l=t.length,h=0,u=!0;if(this._map){var p=new Date().getTime(),c=L.bind(function(){var d=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();hs);h++){if((i=t[h])instanceof L.LayerGroup){u&&(t=t.slice(),u=!1),this._extractNonGroupLayers(i,t),l=t.length;continue}if(!i.getLatLng){r.addLayer(i),e||this.fire("layeradd",{layer:i});continue}if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),e||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var _=i.__parent.getAllChildMarkers(),f=_[0]===i?_[1]:_[0];n.removeLayer(f)}}a&&a(h,l,new Date().getTime()-p),h===l?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(c,this.options.chunkDelay)},this);c()}else for(var d=this._needsClustering;h=0;e--)t.extend(this._needsClustering[e].getLatLng());return t.extend(this._nonPointGroup.getBounds()),t},eachLayer:function(t,e){var i,n,r,o=this._needsClustering.slice(),s=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(o),n=o.length-1;n>=0;n--){for(i=!0,r=s.length-1;r>=0;r--)if(s[r].layer===o[n]){i=!1;break}i&&t.call(e,o[n])}this._nonPointGroup.eachLayer(t,e)},getLayers:function(){var t=[];return this.eachLayer(function(e){t.push(e)}),t},getLayer:function(t){var e=null;return t=parseInt(t,10),this.eachLayer(function(i){L.stamp(i)===t&&(e=i)}),e},hasLayer:function(t){if(!t)return!1;var e,i=this._needsClustering;for(e=i.length-1;e>=0;e--)if(i[e]===t)return!0;for(e=(i=this._needsRemoving).length-1;e>=0;e--)if(i[e].layer===t)return!1;return!!(t.__parent&&t.__parent._group===this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer:function(t,e){var i=this._map;"function"!=typeof e&&(e=function(){});var n=function(){(i.hasLayer(t)||i.hasLayer(t.__parent))&&!this._inZoomAnimation&&(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(t)?e():t.__parent._icon&&(this.once("spiderfied",e,this),t.__parent.spiderfy()))};t._icon&&this._map.getBounds().contains(t.getLatLng())?e():t.__parent._zoom=0;i--)if(t[i]===e)return t.splice(i,1),!0},_removeFromGridUnclustered:function(t,e){for(var i=this._map,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());e>=r&&n[e].removeObject(t,i.project(t.getLatLng(),e));e--);},_childMarkerDragStart:function(t){t.target.__dragStart=t.target._latlng},_childMarkerMoved:function(t){if(!this._ignoreMove&&!t.target.__dragStart){var e=t.target._popup&&t.target._popup.isOpen();this._moveChild(t.target,t.oldLatLng,t.latlng),e&&t.target.openPopup()}},_moveChild:function(t,e,i){t._latlng=e,this.removeLayer(t),t._latlng=i,this.addLayer(t)},_childMarkerDragEnd:function(t){var e=t.target.__dragStart;delete t.target.__dragStart,e&&this._moveChild(t.target,e,t.target._latlng)},_removeLayer:function(t,e,i){var n=this._gridClusters,r=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this._map.getMinZoom());e&&this._removeFromGridUnclustered(t,this._maxZoom);var l,h=t.__parent,u=h._markers;for(this._arraySplice(u,t);h&&(h._childCount--,h._boundsNeedUpdate=!0,!(h._zoom"+e+"",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom;(e||n||r)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(t){var e=t.layer,i=e;if("clusterkeypress"!==t.type||!t.originalEvent||13===t.originalEvent.keyCode){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===e._childCount&&this.options.spiderfyOnMaxZoom?e.spiderfy():this.options.zoomToBoundsOnClick&&e.zoomToBounds(),this.options.spiderfyOnEveryZoom&&e.spiderfy(),t.originalEvent&&13===t.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage:function(t){var e=this._map;!this._inZoomAnimation&&(this._shownPolygon&&e.removeLayer(this._shownPolygon),t.layer.getChildCount()>2&&t.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(t.layer.getConvexHull(),this.options.polygonOptions),e.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,r=this._map;(t||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),e&&(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 t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),t),this._currentShownBounds=t}},_generateInitialClusters:function(){var t=Math.ceil(this._map.getMaxZoom()),e=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;"function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={};for(var r=t;r>=e;r--)this._gridClusters[r]=new L.DistanceGrid(n(r)),this._gridUnclustered[r]=new L.DistanceGrid(n(r));this._topClusterLevel=new this._markerCluster(this,e-1)},_addLayer:function(t,e){var i,n,r=this._gridClusters,o=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(t),t.on(this._childMarkerEventHandlers,this);e>=s;e--){i=this._map.project(t.getLatLng(),e);var a=r[e].getNearObject(i);if(a){a._addChild(t),t.__parent=a;return}if(a=o[e].getNearObject(i)){var l=a.__parent;l&&this._removeLayer(a,!1);var h=new this._markerCluster(this,e,a,t);r[e].addObject(h,this._map.project(h._cLatLng,e)),a.__parent=h,t.__parent=h;var u=h;for(n=e-1;n>l._zoom;n--)u=new this._markerCluster(this,n,u),r[n].addObject(u,this._map.project(a.getLatLng(),n));l._addChild(u),this._removeFromGridUnclustered(a,e);return}o[e].addObject(t,i)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(t){t instanceof L.MarkerCluster&&t._iconNeedsUpdate&&t._updateIcon()})},_enqueue:function(t){this._queue.push(t),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var t=0;tt?(this._animationStart(),this._animationZoomOut(this._zoom,t)):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(t){var e=this._maxLat;return void 0!==e&&(t.getNorth()>=e&&(t._northEast.lat=1/0),t.getSouth()<=-e&&(t._southWest.lat=-1/0)),t},_animationAddLayerNonAnimated:function(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();var i=e.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else e._updateIcon()},_extractNonGroupLayers:function(t,e){var i,n=t.getLayers(),r=0;for(e=e||[];r=0;i--)s=l[i],n.contains(s._latlng)||r.removeLayer(s)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,e),r.eachLayer(function(t){t instanceof L.MarkerCluster||!t._icon||t.clusterShow()}),this._topClusterLevel._recursively(n,t,e,function(t){t._recursivelyRestoreChildPositions(e)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(n,t,o,function(t){r.removeLayer(t),t.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(t,e){this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),t,this._getExpandedVisibleBounds())},_animationAddLayer:function(t,e){var i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(e._childCount>2?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.clusterHide(),this._enqueue(function(){n.removeLayer(t),t.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(t,e,i){var n=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());t._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,e+1,i);var o=this;this._forceLayout(),t._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===t._childCount){var s=t._markers[0];this._ignoreMove=!0,s.setLatLng(s.getLatLng()),this._ignoreMove=!1,s.clusterShow&&s.clusterShow()}else t._recursively(n,i,r,function(t){t._recursivelyRemoveChildrenFromMap(n,r,e+1)});o._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(document.body.offsetWidth)}}),L.markerClusterGroup=function(t){return new L.MarkerClusterGroup(t)};var i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(t,e,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:t.options.clusterPane}),this._group=t,this._zoom=e,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(t,e){t=t||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(t,e);for(var n=this._markers.length-1;n>=0;n--)e&&this._markers[n].__dragStart||t.push(this._markers[n]);return t},getChildCount:function(){return this._childCount},zoomToBounds:function(t){for(var e,i=this._childClusters.slice(),n=this._group._map,r=n.getBoundsZoom(this._bounds),o=this._zoom+1,s=n.getZoom();i.length>0&&r>o;){o++;var a=[];for(e=0;eo?this._group._map.setView(this._latlng,o):r<=s?this._group._map.setView(this._latlng,s+1):this._group._map.fitBounds(this._bounds,t)},getBounds:function(){var t=new L.LatLngBounds;return t.extend(this._bounds),t},_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(t,e){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(t),t instanceof L.MarkerCluster?(e||(this._childClusters.push(t),t.__parent=this),this._childCount+=t._childCount):(e||this._markers.push(t),this._childCount++),this.__parent&&this.__parent._addChild(t,!0)},_setClusterCenter:function(t){this._cLatLng||(this._cLatLng=t._cLatLng||t._latlng)},_resetBounds:function(){var t=this._bounds;t._southWest&&(t._southWest.lat=1/0,t._southWest.lng=1/0),t._northEast&&(t._northEast.lat=-1/0,t._northEast.lng=-1/0)},_recalculateBounds:function(){var t,e,i,n,r=this._markers,o=this._childClusters,s=0,a=0,l=this._childCount;if(0!==l){for(this._resetBounds(),t=0;t=0;i--)(n=r[i])._icon&&(n._setPos(e),n.clusterHide())},function(t){var i,n,r=t._childClusters;for(i=r.length-1;i>=0;i--)(n=r[i])._icon&&(n._setPos(e),n.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(t,e,i,n){this._recursively(t,n,e,function(r){r._recursivelyAnimateChildrenIn(t,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(t,e,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible:function(t,e){this._recursively(t,this._group._map.getMinZoom(),e,null,function(t){t.clusterShow()})},_recursivelyAddChildrenToMap:function(t,e,i){this._recursively(i,this._group._map.getMinZoom()-1,e,function(n){if(e!==n._zoom)for(var r=n._markers.length-1;r>=0;r--){var o=n._markers[r];i.contains(o._latlng)&&(t&&(o._backupLatlng=o.getLatLng(),o.setLatLng(t),o.clusterHide&&o.clusterHide()),n._group._featureGroup.addLayer(o))}},function(e){e._addToMap(t)})},_recursivelyRestoreChildPositions:function(t){for(var e=this._markers.length-1;e>=0;e--){var i=this._markers[e];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(t-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(t)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(t,e,i,n){var r,o;this._recursively(t,e-1,i-1,function(t){for(o=t._markers.length-1;o>=0;o--)r=t._markers[o],n&&n.contains(r._latlng)||(t._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(t){for(o=t._childClusters.length-1;o>=0;o--)r=t._childClusters[o],n&&n.contains(r._latlng)||(t._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(t,e,i,n,r){var o,s,a=this._childClusters,l=this._zoom;if(e<=l&&(n&&n(this),r&&l===i&&r(this)),l=0;o--)(s=a[o])._boundsNeedUpdate&&s._recalculateBounds(),t.intersects(s._bounds)&&s._recursively(t,e,i,n,r)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var t=this.options.opacity;return this.setOpacity(0),this.options.opacity=t,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(t,e){var i=this._getCoord(e.x),n=this._getCoord(e.y),r=this._grid,o=r[n]=r[n]||{},s=o[i]=o[i]||[],a=L.Util.stamp(t);this._objectPoint[a]=e,s.push(t)},updateObject:function(t,e){this.removeObject(t),this.addObject(t,e)},removeObject:function(t,e){var i,n,r=this._getCoord(e.x),o=this._getCoord(e.y),s=this._grid,a=s[o]=s[o]||{},l=a[r]=a[r]||[];for(delete this._objectPoint[L.Util.stamp(t)],i=0,n=l.length;i=0;i--)n=e[i],(r=this.getDistant(n,t))>0&&(a.push(n),r>o&&(o=r,s=n));return{maxPoint:s,newPoints:a}},buildConvexHull:function(t,e){var i=[],n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?i=(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints))).concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints)):[t[0]]},getConvexHull:function(t){var e,i=!1,n=!1,r=!1,o=!1,s=null,a=null,l=null,h=null,u=null,p=null;for(e=t.length-1;e>=0;e--){var c=t[e];(!1===i||c.lat>i)&&(s=c,i=c.lat),(!1===n||c.latr)&&(l=c,r=c.lng),(!1===o||c.lng=0;e--)t=i[e].getLatLng(),n.push(t);return L.QuickHull.getConvexHull(n)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var t,e=this.getAllChildMarkers(null,!0),i=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?t=this._group.options.spiderfyShapePositions(e.length,i):e.length>=this._circleSpiralSwitchover?t=this._generatePointsSpiral(e.length,i):(i.y+=10,t=this._generatePointsCircle(e.length,i)),this._animationSpiderfy(e,t)}},unspiderfy:function(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle:function(t,e){var i,n,r=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+t)/this._2PI,o=this._2PI/t,s=[];for(i=0,r=Math.max(r,35),s.length=t;i=0;i--)i=0;e--)t=o[e],r.removeLayer(t),t._preSpiderfyLatlng&&(t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng),t.setZIndexOffset&&t.setZIndexOffset(0),t._spiderLeg&&(n.removeLayer(t._spiderLeg),delete t._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:o}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(t,e){var i,n,r,o,s=this._group,a=s._map,l=s._featureGroup,h=this._group.options.spiderLegPolylineOptions;for(i=0,s._ignoreMove=!0;i=0;i--)a=u.layerPointToLatLng(e[i]),(n=t[i])._preSpiderfyLatlng=n._latlng,n.setLatLng(a),n.clusterShow&&n.clusterShow(),_&&((o=(r=n._spiderLeg)._path).style.strokeDashoffset=0,r.setStyle({opacity:m}));this.setOpacity(.3),h._ignoreMove=!1,setTimeout(function(){h._animationEnd(),h.fire("spiderfied",{cluster:l,markers:t})},200)},_animationUnspiderfy:function(t){var e,i,n,r,o,s,a=this,l=this._group,h=l._map,u=l._featureGroup,p=t?h._latLngToNewLayerPoint(this._latlng,t.zoom,t.center):h.latLngToLayerPoint(this._latlng),c=this.getAllChildMarkers(null,!0),d=L.Path.SVG;for(l._ignoreMove=!0,l._animationStart(),this.setOpacity(1),i=c.length-1;i>=0;i--)(e=c[i])._preSpiderfyLatlng&&(e.closePopup(),e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng,s=!0,e._setPos&&(e._setPos(p),s=!1),e.clusterHide&&(e.clusterHide(),s=!1),s&&u.removeLayer(e),d&&(o=(r=(n=e._spiderLeg)._path).getTotalLength()+.1,r.style.strokeDashoffset=o,n.setStyle({opacity:0})));l._ignoreMove=!1,setTimeout(function(){var t=0;for(i=c.length-1;i>=0;i--)(e=c[i])._spiderLeg&&t++;for(i=c.length-1;i>=0;i--)(e=c[i])._spiderLeg&&(e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),t>1&&u.removeLayer(e),h.removeLayer(e._spiderLeg),delete e._spiderLeg);l._animationEnd(),l.fire("unspiderfied",{cluster:a,markers:c})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_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(t){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(t))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(t){return t?t instanceof L.MarkerClusterGroup?t=t._topClusterLevel.getAllChildMarkers():t instanceof L.LayerGroup?t=t._layers:t instanceof L.MarkerCluster?t=t.getAllChildMarkers():t instanceof L.Marker&&(t=[t]):t=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(t),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(t),this},_flagParentsIconsNeedUpdate:function(t){var e,i;for(e in t)for(i=t[e].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(t){var e,i;for(e in t)i=t[e],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(t,e){var i=this.options.icon;return L.setOptions(i,t),this.setIcon(i),e&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),t.MarkerClusterGroup=e,t.MarkerCluster=i,Object.defineProperty(t,"__esModule",{value:!0})}(i)},70462,(t,e,i)=>{"use strict";(()=>{var n=Object.create,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,h=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),u=(t,e,i)=>(i=null!=t?n(a(t)):{},((t,e,i,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let a of s(e))l.call(t,a)||a===i||r(t,a,{get:()=>e[a],enumerable:!(n=o(e,a))||n.enumerable});return t})(!e&&t&&t.__esModule?i:r(i,"default",{value:t,enumerable:!0}),t)),p=h((t,e)=>{e.exports=function(){this.__data__=[],this.size=0}}),c=h((t,e)=>{e.exports=function(t,e){return t===e||t!=t&&e!=e}}),d=h((t,e)=>{var i=c();e.exports=function(t,e){for(var n=t.length;n--;)if(i(t[n][0],e))return n;return -1}}),_=h((t,e)=>{var i=d(),n=Array.prototype.splice;e.exports=function(t){var e=this.__data__,r=i(e,t);return!(r<0)&&(r==e.length-1?e.pop():n.call(e,r,1),--this.size,!0)}}),f=h((t,e)=>{var i=d();e.exports=function(t){var e=this.__data__,n=i(e,t);return n<0?void 0:e[n][1]}}),m=h((t,e)=>{var i=d();e.exports=function(t){return i(this.__data__,t)>-1}}),g=h((t,e)=>{var i=d();e.exports=function(t,e){var n=this.__data__,r=i(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}}),y=h((t,e)=>{var i=p(),n=_(),r=f(),o=m(),s=g();function a(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e{var i=y();e.exports=function(){this.__data__=new i,this.size=0}}),b=h((t,e)=>{e.exports=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}}),k=h((t,e)=>{e.exports=function(t){return this.__data__.get(t)}}),M=h((t,e)=>{e.exports=function(t){return this.__data__.has(t)}}),x=h((e,i)=>{i.exports=t.g&&t.g.Object===Object&&t.g}),w=h((t,e)=>{var i=x(),n="object"==typeof self&&self&&self.Object===Object&&self;e.exports=i||n||Function("return this")()}),C=h((t,e)=>{e.exports=w().Symbol}),P=h((t,e)=>{var i=C(),n=Object.prototype,r=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;e.exports=function(t){var e=r.call(t,s),i=t[s];try{t[s]=void 0;var n=!0}catch{}var a=o.call(t);return n&&(e?t[s]=i:delete t[s]),a}}),E=h((t,e)=>{var i=Object.prototype.toString;e.exports=function(t){return i.call(t)}}),T=h((t,e)=>{var i=C(),n=P(),r=E(),o=i?i.toStringTag:void 0;e.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":o&&o in Object(t)?n(t):r(t)}}),S=h((t,e)=>{e.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}}),B=h((t,e)=>{var i=T(),n=S();e.exports=function(t){if(!n(t))return!1;var e=i(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}),O=h((t,e)=>{e.exports=w()["__core-js_shared__"]}),D=h((t,e)=>{var i,n=O(),r=(i=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";e.exports=function(t){return!!r&&r in t}}),R=h((t,e)=>{var i=Function.prototype.toString;e.exports=function(t){if(null!=t){try{return i.call(t)}catch{}try{return t+""}catch{}}return""}}),I=h((t,e)=>{var i=B(),n=D(),r=S(),o=R(),s=/^\[object .+?Constructor\]$/,a=Object.prototype,l=Function.prototype.toString,h=a.hasOwnProperty,u=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(t){return!(!r(t)||n(t))&&(i(t)?u:s).test(o(t))}}),A=h((t,e)=>{e.exports=function(t,e){return t?.[e]}}),z=h((t,e)=>{var i=I(),n=A();e.exports=function(t,e){var r=n(t,e);return i(r)?r:void 0}}),N=h((t,e)=>{e.exports=z()(w(),"Map")}),j=h((t,e)=>{e.exports=z()(Object,"create")}),G=h((t,e)=>{var i=j();e.exports=function(){this.__data__=i?i(null):{},this.size=0}}),Z=h((t,e)=>{e.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=!!e,e}}),F=h((t,e)=>{var i=j(),n=Object.prototype.hasOwnProperty;e.exports=function(t){var e=this.__data__;if(i){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return n.call(e,t)?e[t]:void 0}}),U=h((t,e)=>{var i=j(),n=Object.prototype.hasOwnProperty;e.exports=function(t){var e=this.__data__;return i?void 0!==e[t]:n.call(e,t)}}),V=h((t,e)=>{var i=j();e.exports=function(t,e){var n=this.__data__;return this.size+=+!this.has(t),n[t]=i&&void 0===e?"__lodash_hash_undefined__":e,this}}),H=h((t,e)=>{var i=G(),n=Z(),r=F(),o=U(),s=V();function a(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e{var i=H(),n=y(),r=N();e.exports=function(){this.size=0,this.__data__={hash:new i,map:new(r||n),string:new i}}}),K=h((t,e)=>{e.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}}),W=h((t,e)=>{var i=K();e.exports=function(t,e){var n=t.__data__;return i(e)?n["string"==typeof e?"string":"hash"]:n.map}}),Y=h((t,e)=>{var i=W();e.exports=function(t){var e=i(this,t).delete(t);return this.size-=!!e,e}}),X=h((t,e)=>{var i=W();e.exports=function(t){return i(this,t).get(t)}}),J=h((t,e)=>{var i=W();e.exports=function(t){return i(this,t).has(t)}}),$=h((t,e)=>{var i=W();e.exports=function(t,e){var n=i(this,t),r=n.size;return n.set(t,e),this.size+=+(n.size!=r),this}}),Q=h((t,e)=>{var i=q(),n=Y(),r=X(),o=J(),s=$();function a(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e{var i=y(),n=N(),r=Q();e.exports=function(t,e){var o=this.__data__;if(o instanceof i){var s=o.__data__;if(!n||s.length<199)return s.push([t,e]),this.size=++o.size,this;o=this.__data__=new r(s)}return o.set(t,e),this.size=o.size,this}}),te=h((t,e)=>{var i=y(),n=v(),r=b(),o=k(),s=M(),a=tt();function l(t){var e=this.__data__=new i(t);this.size=e.size}l.prototype.clear=n,l.prototype.delete=r,l.prototype.get=o,l.prototype.has=s,l.prototype.set=a,e.exports=l}),ti=h((t,e)=>{var i=z();e.exports=function(){try{var t=i(Object,"defineProperty");return t({},"",{}),t}catch{}}()}),tn=h((t,e)=>{var i=ti();e.exports=function(t,e,n){"__proto__"==e&&i?i(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}}),tr=h((t,e)=>{var i=tn(),n=c();e.exports=function(t,e,r){(void 0===r||n(t[e],r))&&(void 0!==r||e in t)||i(t,e,r)}}),to=h((t,e)=>{e.exports=function(t){return function(e,i,n){for(var r=-1,o=Object(e),s=n(e),a=s.length;a--;){var l=s[t?a:++r];if(!1===i(o[l],l,o))break}return e}}}),ts=h((t,e)=>{e.exports=to()()}),ta=h((t,e)=>{var i=w(),n="object"==typeof t&&t&&!t.nodeType&&t,r=n&&"object"==typeof e&&e&&!e.nodeType&&e,o=r&&r.exports===n?i.Buffer:void 0,s=o?o.allocUnsafe:void 0;e.exports=function(t,e){if(e)return t.slice();var i=t.length,n=s?s(i):new t.constructor(i);return t.copy(n),n}}),tl=h((t,e)=>{e.exports=w().Uint8Array}),th=h((t,e)=>{var i=tl();e.exports=function(t){var e=new t.constructor(t.byteLength);return new i(e).set(new i(t)),e}}),tu=h((t,e)=>{var i=th();e.exports=function(t,e){var n=e?i(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}}),tp=h((t,e)=>{e.exports=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i{var i=S(),n=Object.create;e.exports=function(){function t(){}return function(e){if(!i(e))return{};if(n)return n(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}()}),td=h((t,e)=>{e.exports=function(t,e){return function(i){return t(e(i))}}}),t_=h((t,e)=>{e.exports=td()(Object.getPrototypeOf,Object)}),tf=h((t,e)=>{var i=Object.prototype;e.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||i)}}),tm=h((t,e)=>{var i=tc(),n=t_(),r=tf();e.exports=function(t){return"function"!=typeof t.constructor||r(t)?{}:i(n(t))}}),tg=h((t,e)=>{e.exports=function(t){return null!=t&&"object"==typeof t}}),ty=h((t,e)=>{var i=T(),n=tg();e.exports=function(t){return n(t)&&"[object Arguments]"==i(t)}}),tv=h((t,e)=>{var i=ty(),n=tg(),r=Object.prototype,o=r.hasOwnProperty,s=r.propertyIsEnumerable;e.exports=i(function(){return arguments}())?i:function(t){return n(t)&&o.call(t,"callee")&&!s.call(t,"callee")}}),tL=h((t,e)=>{e.exports=Array.isArray}),tb=h((t,e)=>{e.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=0x1fffffffffffff}}),tk=h((t,e)=>{var i=B(),n=tb();e.exports=function(t){return null!=t&&n(t.length)&&!i(t)}}),tM=h((t,e)=>{var i=tk(),n=tg();e.exports=function(t){return n(t)&&i(t)}}),tx=h((t,e)=>{e.exports=function(){return!1}}),tw=h((t,e)=>{var i=w(),n=tx(),r="object"==typeof t&&t&&!t.nodeType&&t,o=r&&"object"==typeof e&&e&&!e.nodeType&&e,s=o&&o.exports===r?i.Buffer:void 0;e.exports=(s?s.isBuffer:void 0)||n}),tC=h((t,e)=>{var i=T(),n=t_(),r=tg(),o=Object.prototype,s=Function.prototype.toString,a=o.hasOwnProperty,l=s.call(Object);e.exports=function(t){if(!r(t)||"[object Object]"!=i(t))return!1;var e=n(t);if(null===e)return!0;var o=a.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&s.call(o)==l}}),tP=h((t,e)=>{var i=T(),n=tb(),r=tg(),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(t){return r(t)&&n(t.length)&&!!o[i(t)]}}),tE=h((t,e)=>{e.exports=function(t){return function(e){return t(e)}}}),tT=h((t,e)=>{var i=x(),n="object"==typeof t&&t&&!t.nodeType&&t,r=n&&"object"==typeof e&&e&&!e.nodeType&&e,o=r&&r.exports===n&&i.process;e.exports=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch{}}()}),tS=h((t,e)=>{var i=tP(),n=tE(),r=tT(),o=r&&r.isTypedArray;e.exports=o?n(o):i}),tB=h((t,e)=>{e.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}}),tO=h((t,e)=>{var i=tn(),n=c(),r=Object.prototype.hasOwnProperty;e.exports=function(t,e,o){var s=t[e];r.call(t,e)&&n(s,o)&&(void 0!==o||e in t)||i(t,e,o)}}),tD=h((t,e)=>{var i=tO(),n=tn();e.exports=function(t,e,r,o){var s=!r;r||(r={});for(var a=-1,l=e.length;++a{e.exports=function(t,e){for(var i=-1,n=Array(t);++i{var i=/^(?:0|[1-9]\d*)$/;e.exports=function(t,e){var n=typeof t;return!!(e=e??0x1fffffffffffff)&&("number"==n||"symbol"!=n&&i.test(t))&&t>-1&&t%1==0&&t{var i=tR(),n=tv(),r=tL(),o=tw(),s=tI(),a=tS(),l=Object.prototype.hasOwnProperty;e.exports=function(t,e){var h=r(t),u=!h&&n(t),p=!h&&!u&&o(t),c=!h&&!u&&!p&&a(t),d=h||u||p||c,_=d?i(t.length,String):[],f=_.length;for(var m in t)(e||l.call(t,m))&&!(d&&("length"==m||p&&("offset"==m||"parent"==m)||c&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,f)))&&_.push(m);return _}}),tz=h((t,e)=>{e.exports=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}}),tN=h((t,e)=>{var i=S(),n=tf(),r=tz(),o=Object.prototype.hasOwnProperty;e.exports=function(t){if(!i(t))return r(t);var e=n(t),s=[];for(var a in t)"constructor"==a&&(e||!o.call(t,a))||s.push(a);return s}}),tj=h((t,e)=>{var i=tA(),n=tN(),r=tk();e.exports=function(t){return r(t)?i(t,!0):n(t)}}),tG=h((t,e)=>{var i=tD(),n=tj();e.exports=function(t){return i(t,n(t))}}),tZ=h((t,e)=>{var i=tr(),n=ta(),r=tu(),o=tp(),s=tm(),a=tv(),l=tL(),h=tM(),u=tw(),p=B(),c=S(),d=tC(),_=tS(),f=tB(),m=tG();e.exports=function(t,e,g,y,v,b,k){var M=f(t,g),x=f(e,g),w=k.get(x);if(w)return void i(t,g,w);var C=b?b(M,x,g+"",t,e,k):void 0,P=void 0===C;if(P){var E=l(x),T=!E&&u(x),S=!E&&!T&&_(x);C=x,E||T||S?l(M)?C=M:h(M)?C=o(M):T?(P=!1,C=n(x,!0)):S?(P=!1,C=r(x,!0)):C=[]:d(x)||a(x)?(C=M,a(M)?C=m(M):(!c(M)||p(M))&&(C=s(x))):P=!1}P&&(k.set(x,C),v(C,x,y,b,k),k.delete(x)),i(t,g,C)}}),tF=h((t,e)=>{var i=te(),n=tr(),r=ts(),o=tZ(),s=S(),a=tj(),l=tB();e.exports=function t(e,h,u,p,c){e!==h&&r(h,function(r,a){if(c||(c=new i),s(r))o(e,h,a,u,t,p,c);else{var d=p?p(l(e,a),r,a+"",e,h,c):void 0;void 0===d&&(d=r),n(e,a,d)}},a)}}),tU=h((t,e)=>{e.exports=function(t){return t}}),tV=h((t,e)=>{e.exports=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}}),tH=h((t,e)=>{var i=tV(),n=Math.max;e.exports=function(t,e,r){return e=n(void 0===e?t.length-1:e,0),function(){for(var o=arguments,s=-1,a=n(o.length-e,0),l=Array(a);++s{e.exports=function(t){return function(){return t}}}),tK=h((t,e)=>{var i=tq(),n=ti(),r=tU();e.exports=n?function(t,e){return n(t,"toString",{configurable:!0,enumerable:!1,value:i(e),writable:!0})}:r}),tW=h((t,e)=>{var i=Date.now;e.exports=function(t){var e=0,n=0;return function(){var r=i(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}}),tY=h((t,e)=>{var i=tK();e.exports=tW()(i)}),tX=h((t,e)=>{var i=tU(),n=tH(),r=tY();e.exports=function(t,e){return r(n(t,e,i),t+"")}}),tJ=h((t,e)=>{var i=c(),n=tk(),r=tI(),o=S();e.exports=function(t,e,s){if(!o(s))return!1;var a=typeof e;return("number"==a?!!(n(s)&&r(e,s.length)):"string"==a&&e in s)&&i(s[e],t)}}),t$=h((t,e)=>{var i=tX(),n=tJ();e.exports=function(t){return i(function(e,i){var r=-1,o=i.length,s=o>1?i[o-1]:void 0,a=o>2?i[2]:void 0;for(s=t.length>3&&"function"==typeof s?(o--,s):void 0,a&&n(i[0],i[1],a)&&(s=o<3?void 0:s,o=1),e=Object(e);++r{var i=tF();e.exports=t$()(function(t,e,n){i(t,e,n)})}),t0=h((t,e)=>{var i=T(),n=tg();e.exports=function(t){return"symbol"==typeof t||n(t)&&"[object Symbol]"==i(t)}}),t1=h((t,e)=>{var i=tL(),n=t0(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(t,e){if(i(t))return!1;var s=typeof t;return!!("number"==s||"symbol"==s||"boolean"==s||null==t||n(t))||o.test(t)||!r.test(t)||null!=e&&t in Object(e)}}),t2=h((t,e)=>{var i=Q();function n(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw TypeError("Expected a function");var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var s=t.apply(this,i);return r.cache=o.set(n,s)||o,s};return r.cache=new(n.Cache||i),r}n.Cache=i,e.exports=n}),t3=h((t,e)=>{var i=t2();e.exports=function(t){var e=i(t,function(t){return 500===n.size&&n.clear(),t}),n=e.cache;return e}}),t4=h((t,e)=>{var i=t3(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g;e.exports=i(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(n,function(t,i,n,o){e.push(n?o.replace(r,"$1"):i||t)}),e})}),t8=h((t,e)=>{e.exports=function(t,e){for(var i=-1,n=null==t?0:t.length,r=Array(n);++i{var i=C(),n=t8(),r=tL(),o=t0(),s=1/0,a=i?i.prototype:void 0,l=a?a.toString:void 0;e.exports=function t(e){if("string"==typeof e)return e;if(r(e))return n(e,t)+"";if(o(e))return l?l.call(e):"";var i=e+"";return"0"==i&&1/e==-s?"-0":i}}),t6=h((t,e)=>{var i=t5();e.exports=function(t){return null==t?"":i(t)}}),t9=h((t,e)=>{var i=tL(),n=t1(),r=t4(),o=t6();e.exports=function(t,e){return i(t)?t:n(t,e)?[t]:r(o(t))}}),t7=h((t,e)=>{var i=t0(),n=1/0;e.exports=function(t){if("string"==typeof t||i(t))return t;var e=t+"";return"0"==e&&1/t==-n?"-0":e}}),et=h((t,e)=>{var i=t9(),n=t7();e.exports=function(t,e){e=i(e,t);for(var r=0,o=e.length;null!=t&&r{var i=et();e.exports=function(t,e,n){var r=null==t?void 0:i(t,e);return void 0===r?n:r}}),ei=h((n,r)=>{var o,s;let a;o=n,s=function(){function t(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function e(t,e){return te)}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(t,e){r(t,0,t.children.length,e,t)}function r(t,e,i,n,r){r||(r=c(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var s=e;s=t.minX&&e.maxY>=t.minY}function c(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,r,o,s){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=o)){var l=n+Math.ceil((r-n)/o/2)*o;(function e(i,n,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,l=n-r+1,h=Math.log(a),u=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*u*(a-u)/a)*(l-a/2<0?-1:1),c=Math.max(r,Math.floor(n-l*u/a+p)),d=Math.min(o,Math.floor(n+(a-l)*u/a+p));e(i,n,c,d,s)}var _=i[n],f=r,m=o;for(t(i,r,n),s(i[o],_)>0&&t(i,r,o);fs(i[f],_);)f++;for(;s(i[m],_)>0;)m--}0===s(i[r],_)?t(i,r,m):t(i,++m,o),m<=n&&(r=m+1),n<=m&&(o=m-1)}})(i,l,n||0,r||i.length-1,s||e),a.push(n,l,l,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,i=[];if(!p(t,e))return i;for(var n=this.toBBox,r=[];e;){for(var o=0;o=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},i.prototype._split=function(t,e){var i=t[e],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);var s=this._chooseSplitIndex(i,o,r),a=c(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,n(i,this.toBBox),n(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},i.prototype._splitRoot=function(t,e){this.data=c([t,e]),this.data.height=t.height+1,this.data.leaf=!1,n(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,i){for(var n,o,s,a,h,u=1/0,p=1/0,c=e;c<=i-e;c++){var d=r(t,0,c,this.toBBox),_=r(t,c,i,this.toBBox),f=(o=void 0,s=void 0,a=void 0,o=Math.max(d.minX,_.minX),s=Math.max(d.minY,_.minY),Math.max(0,(a=Math.min(d.maxX,_.maxX))-o)*Math.max(0,Math.min(d.maxY,_.maxY)-s)),m=l(d)+l(_);f=e;d--){var _=t.children[d];o(l,t.leaf?s(_):_),u+=h(l)}return u},i.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)o(e[n],t)},i.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():n(t[e],this.toBBox)},i},"object"==typeof n&&"u">typeof r?r.exports=s():"function"==typeof define&&define.amd?void 0!==(a=s(t.r,i,e))&&t.v(a):(o=o||self).RBush=s()});Array.prototype.findIndex=Array.prototype.findIndex||function(t){if(this===null)throw TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof t)throw TypeError("callback must be a function");for(var e=Object(this),i=e.length>>>0,n=arguments[1],r=0;r>>0,n=arguments[1],r=0;r>>0;if(0===r)return!1;for(var o=0|e,s=Math.max(o>=0?o:r-Math.abs(o),0);s{if(0!==e.length){let i=Array.isArray(e)?ep(e):e;Array.isArray(i)?0!==i.length&&t.push(i):t.push(i)}return t},[])}function ec(t,e,i,n,r=!0){let o,s,a=[];for(let l=0;l1e-12;){x=Math.cos(2*f+k);let t=b*(w=Math.sin(k))*(x+b/4*((C=Math.cos(k))*(-1+2*x*x)-b/6*x*(-3+4*w*w)*(-3+4*x*x)));M=k,k=i/(r*v)+t}let P=_*w-d*C*p,E=Math.atan2(_*C+d*w*p,(1-o)*Math.sqrt(m*m+P*P)),T=o/16*g*(4+o*(4-3*g)),S=Math.atan2(w*u,d*C-_*w*p)-(1-T)*o*m*(k+T*w*(x+T*C*(-1+2*x*x)));return L.latLng(s+180*S/l,180*E/l)}(t,360*l/i+n,e),s=L.latLng(o.lng,o.lat);else{let n=t.lat+Math.cos(2*l*Math.PI/i)*e,r=t.lng+Math.sin(2*l*Math.PI/i)*e;s=L.latLng(n,r)}a.push(s)}return a}function ed(t,e,i){let n=t.latLngToContainerPoint(e),r=t.latLngToContainerPoint(i),o=180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI+90;return o+360*(o<0)}function e_(t,e,i,n){let r=ed(t,e,i);return function(t,e,i){e=(e+360)%360;let n=Math.PI/180,r=180/Math.PI,{R:o}=L.CRS.Earth,s=t.lng*n,a=t.lat*n,l=e*n,h=Math.sin(a),u=Math.cos(a),p=Math.cos(i/o),c=Math.sin(i/o),d=Math.asin(h*p+u*c*Math.cos(l)),_=s+Math.atan2(Math.sin(l)*c*u,p-h*Math.sin(d)),f=(_*=r)-360,m=_<-180?_+360:_;return _=_>180?f:m,L.latLng([d*r,_])}(e,r,n)}function ef(t,e=t.getLatLngs()){return t instanceof L.Polygon?L.polygon(e).getLatLngs():L.polyline(e).getLatLngs()}function em(t,e){if(e.options.crs?.projection?.MAX_LATITUDE){let i=e.options.crs?.projection?.MAX_LATITUDE;t.lat=Math.max(Math.min(i,t.lat),-i)}return t}function eg(t){return t.options.renderer||t._map&&(t._map._getPaneRenderer(t.options.pane)||t._map.options.renderer||t._map._renderer)||t._renderer}var ey=L.Class.extend({includes:[{_globalEditModeEnabled:!1,enableGlobalEditMode(t){let e={...t};this._globalEditModeEnabled=!0,this.Toolbar.toggleButton("editMode",this.globalEditModeEnabled()),L.PM.Utils.findLayers(this.map).forEach(t=>{this._isRelevantForEdit(t)&&t.pm.enable(e)}),this.throttledReInitEdit||(this.throttledReInitEdit=L.Util.throttle(this.handleLayerAdditionInGlobalEditMode,100,this)),this._addedLayersEdit={},this.map.on("layeradd",this._layerAddedEdit,this),this.map.on("layeradd",this.throttledReInitEdit,this),this._fireGlobalEditModeToggled(!0)},disableGlobalEditMode(){this._globalEditModeEnabled=!1,L.PM.Utils.findLayers(this.map).forEach(t=>{t.pm.disable()}),this.map.off("layeradd",this._layerAddedEdit,this),this.map.off("layeradd",this.throttledReInitEdit,this),this.Toolbar.toggleButton("editMode",this.globalEditModeEnabled()),this._fireGlobalEditModeToggled(!1)},globalEditEnabled(){return this.globalEditModeEnabled()},globalEditModeEnabled(){return this._globalEditModeEnabled},toggleGlobalEditMode(t=this.globalOptions){this.globalEditModeEnabled()?this.disableGlobalEditMode():this.enableGlobalEditMode(t)},handleLayerAdditionInGlobalEditMode(){let t=this._addedLayersEdit;if(this._addedLayersEdit={},this.globalEditModeEnabled())for(let e in t){let i=t[e];this._isRelevantForEdit(i)&&i.pm.enable({...this.globalOptions})}},_layerAddedEdit({layer:t}){this._addedLayersEdit[L.stamp(t)]=t},_isRelevantForEdit:t=>t.pm&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)&&!t._pmTempLayer&&t.pm.options.allowEditing},{_globalDragModeEnabled:!1,enableGlobalDragMode(){let t=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!0,this._addedLayersDrag={},t.forEach(t=>{this._isRelevantForDrag(t)&&t.pm.enableLayerDrag()}),this.throttledReInitDrag||(this.throttledReInitDrag=L.Util.throttle(this.reinitGlobalDragMode,100,this)),this.map.on("layeradd",this._layerAddedDrag,this),this.map.on("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!0)},disableGlobalDragMode(){let t=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!1,t.forEach(t=>{t.pm.disableLayerDrag()}),this.map.off("layeradd",this._layerAddedDrag,this),this.map.off("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!1)},globalDragModeEnabled(){return!!this._globalDragModeEnabled},toggleGlobalDragMode(){this.globalDragModeEnabled()?this.disableGlobalDragMode():this.enableGlobalDragMode()},reinitGlobalDragMode(){let t=this._addedLayersDrag;if(this._addedLayersDrag={},this.globalDragModeEnabled())for(let e in t){let i=t[e];this._isRelevantForDrag(i)&&i.pm.enableLayerDrag()}},_layerAddedDrag({layer:t}){this._addedLayersDrag[L.stamp(t)]=t},_isRelevantForDrag:t=>t.pm&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)&&!t._pmTempLayer&&t.pm.options.draggable},{_globalRemovalModeEnabled:!1,enableGlobalRemovalMode(){this._globalRemovalModeEnabled=!0,this.map.eachLayer(t=>{this._isRelevantForRemoval(t)&&(t.pm.enabled()&&t.pm.disable(),t.on("click",this.removeLayer,this))}),this.throttledReInitRemoval||(this.throttledReInitRemoval=L.Util.throttle(this.handleLayerAdditionInGlobalRemovalMode,100,this)),this._addedLayersRemoval={},this.map.on("layeradd",this._layerAddedRemoval,this),this.map.on("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!0)},disableGlobalRemovalMode(){this._globalRemovalModeEnabled=!1,this.map.eachLayer(t=>{t.off("click",this.removeLayer,this)}),this.map.off("layeradd",this._layerAddedRemoval,this),this.map.off("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!1)},globalRemovalEnabled(){return this.globalRemovalModeEnabled()},globalRemovalModeEnabled(){return!!this._globalRemovalModeEnabled},toggleGlobalRemovalMode(){this.globalRemovalModeEnabled()?this.disableGlobalRemovalMode():this.enableGlobalRemovalMode()},removeLayer(t){let e=t.target;this._isRelevantForRemoval(e)&&!e.pm.dragging()&&(e.removeFrom(this.map.pm._getContainingLayer()),e.remove(),e instanceof L.LayerGroup?(this._fireRemoveLayerGroup(e),this._fireRemoveLayerGroup(this.map,e)):(e.pm._fireRemove(e),e.pm._fireRemove(this.map,e)))},_isRelevantForRemoval:t=>t.pm&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)&&!t._pmTempLayer&&t.pm.options.allowRemoval,handleLayerAdditionInGlobalRemovalMode(){let t=this._addedLayersRemoval;if(this._addedLayersRemoval={},this.globalRemovalModeEnabled())for(let e in t){let i=t[e];this._isRelevantForRemoval(i)&&(i.pm.enabled()&&i.pm.disable(),i.on("click",this.removeLayer,this))}},_layerAddedRemoval({layer:t}){this._addedLayersRemoval[L.stamp(t)]=t}},{_globalRotateModeEnabled:!1,enableGlobalRotateMode(){this._globalRotateModeEnabled=!0,L.PM.Utils.findLayers(this.map).filter(t=>t instanceof L.Polyline).forEach(t=>{this._isRelevantForRotate(t)&&t.pm.enableRotate()}),this.throttledReInitRotate||(this.throttledReInitRotate=L.Util.throttle(this.handleLayerAdditionInGlobalRotateMode,100,this)),this._addedLayersRotate={},this.map.on("layeradd",this._layerAddedRotate,this),this.map.on("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},disableGlobalRotateMode(){this._globalRotateModeEnabled=!1,L.PM.Utils.findLayers(this.map).filter(t=>t instanceof L.Polyline).forEach(t=>{t.pm.disableRotate()}),this.map.off("layeradd",this._layerAddedRotate,this),this.map.off("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},globalRotateModeEnabled(){return!!this._globalRotateModeEnabled},toggleGlobalRotateMode(){this.globalRotateModeEnabled()?this.disableGlobalRotateMode():this.enableGlobalRotateMode()},_isRelevantForRotate:t=>t.pm&&t instanceof L.Polyline&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)&&!t._pmTempLayer&&t.pm.options.allowRotation,handleLayerAdditionInGlobalRotateMode(){let t=this._addedLayersRotate;if(this._addedLayersRotate={},this.globalRotateModeEnabled())for(let e in t){let i=t[e];this._isRelevantForRemoval(i)&&i.pm.enableRotate()}},_layerAddedRotate({layer:t}){this._addedLayersRotate[L.stamp(t)]=t}},ea],initialize(t){this.map=t,this.Draw=new L.PM.Draw(t),this.Toolbar=new L.PM.Toolbar(t),this.Keyboard={_lastEvents:{keydown:void 0,keyup:void 0,current:void 0},_initKeyListener(t){this.map=t,L.DomEvent.on(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.on(window,"blur",this._onBlur,this),t.once("unload",this._unbindKeyListenerEvents,this)},_handleEscapeKey(t){let e=this.map.pm;return!!e.getGlobalOptions().exitModeOnEscape&&!!(e.globalDrawModeEnabled()||e.globalEditModeEnabled()||e.globalDragModeEnabled()||e.globalRemovalModeEnabled()||e.globalRotateModeEnabled()||e.globalCutModeEnabled())&&(t.preventDefault(),e.globalDrawModeEnabled()&&e.disableDraw(),e.globalEditModeEnabled()&&e.disableGlobalEditMode(),e.globalDragModeEnabled()&&e.disableGlobalDragMode(),e.globalRemovalModeEnabled()&&e.disableGlobalRemovalMode(),e.globalRotateModeEnabled()&&e.disableGlobalRotateMode(),e.globalCutModeEnabled()&&e.disableGlobalCutMode(),!0)},_handleEnterKey(t){let e=this.map.pm;if(!e.getGlobalOptions().finishOnEnter)return!1;let i=e.Draw.getActiveShape();if(!i)return!1;let n=e.Draw[i];return!!n&&!!n._finishShape&&!!this._canFinishShape(n,i)&&(t.preventDefault(),n._finishShape(),!0)},_canFinishShape(t,e){if(["Marker","CircleMarker","Text"].includes(e))return!1;if("Rectangle"===e)return void 0!==t._startMarker;if("Circle"===e)return t._centerMarker&&t._layerGroup?.hasLayer(t._centerMarker);if(t._layer&&t._layer.getLatLngs){let i=t._layer.getLatLngs();if("Line"===e)return(i.flat?i.flat():i).length>=2;if("Polygon"===e||"Cut"===e)return i.length>=3}return!1},_unbindKeyListenerEvents(){L.DomEvent.off(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.off(window,"blur",this._onBlur,this)},_onKeyListener(t){let e="document";this.map.getContainer().contains(t.target)&&(e="map");let i={event:t,eventType:t.type,focusOn:e};this._lastEvents[t.type]=i,this._lastEvents.current=i,this.map.pm._fireKeyeventEvent(t,t.type,e),"keydown"===t.type&&("Escape"===t.key&&this._handleEscapeKey(t),"Enter"===t.key&&this._handleEnterKey(t))},_onBlur(t){t.altKey=!1;let e={event:t,eventType:t.type,focusOn:"document"};this._lastEvents[t.type]=e,this._lastEvents.current=e},getLastKeyEvent(t="current"){return this._lastEvents[t]},isShiftKeyPressed(){return this._lastEvents.current?.event.shiftKey},isAltKeyPressed(){return this._lastEvents.current?.event.altKey},isCtrlKeyPressed(){return this._lastEvents.current?.event.ctrlKey},isMetaKeyPressed(){return this._lastEvents.current?.event.metaKey},getPressedKey(){return this._lastEvents.current?.event.key}},this.globalOptions={snappable:!0,layerGroup:void 0,snappingOrder:["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],panes:{vertexPane:"markerPane",layerPane:"overlayPane",markerPane:"markerPane"},draggable:!0,exitModeOnEscape:!1,finishOnEnter:!1},this.Keyboard._initKeyListener(t)},setLang(t="en",e,i="en"){t=function(t,e){if(e[t=t.trim().toLowerCase()])return t;let i=t.replace(/[-_\s]/g,"_").match(/^([a-z]{2,3})(?:_([a-z]{2,3}))?$/);if(i){let t=[];for(let n of(i[2]&&t.push(`${i[1]}_${i[2]}`),t.push(i[1]),t))if(e[n])return n}return t}(t,eo);let n=L.PM.activeLang;e&&(eo[t]=(0,en.default)(eo[i],e)),L.PM.activeLang=t,this.map.pm.Toolbar.reinit(),this._fireLangChange(n,t,i,eo[t])},addControls(t){this.Toolbar.addControls(t)},removeControls(){this.Toolbar.removeControls()},toggleControls(){this.Toolbar.toggleControls()},controlsVisible(){return this.Toolbar.isVisible},enableDraw(t="Polygon",e){"Poly"===t&&(t="Polygon"),this.Draw.enable(t,e)},disableDraw(t="Polygon"){"Poly"===t&&(t="Polygon"),this.Draw.disable(t)},setPathOptions(t,e={}){let i=e.ignoreShapes||[],n=e.merge||!1;this.map.pm.Draw.shapes.forEach(e=>{-1===i.indexOf(e)&&this.map.pm.Draw[e].setPathOptions(t,n)})},getGlobalOptions(){return this.globalOptions},setGlobalOptions(t){let e=(0,en.default)(this.globalOptions,t);e.editable&&(e.resizeableCircleMarker=e.editable,delete e.editable);let i=!1;this.map.pm.Draw.CircleMarker.enabled()&&!!this.map.pm.Draw.CircleMarker.options.resizeableCircleMarker!=!!e.resizeableCircleMarker&&(this.map.pm.Draw.CircleMarker.disable(),i=!0);let n=!1;this.map.pm.Draw.Circle.enabled()&&!!this.map.pm.Draw.Circle.options.resizeableCircle!=!!e.resizeableCircle&&(this.map.pm.Draw.Circle.disable(),n=!0),this.map.pm.Draw.shapes.forEach(t=>{this.map.pm.Draw[t].setOptions(e)}),i&&this.map.pm.Draw.CircleMarker.enable(),n&&this.map.pm.Draw.Circle.enable(),L.PM.Utils.findLayers(this.map).forEach(t=>{t.pm.setOptions(e)}),this.map.fire("pm:globaloptionschanged"),this.globalOptions=e,this.applyGlobalOptions()},applyGlobalOptions(){L.PM.Utils.findLayers(this.map).forEach(t=>{t.pm.enabled()&&t.pm.applyOptions()})},globalDrawModeEnabled(){return!!this.Draw.getActiveShape()},globalCutModeEnabled(){return!!this.Draw.Cut.enabled()},enableGlobalCutMode(t){return this.Draw.Cut.enable(t)},toggleGlobalCutMode(t){return this.Draw.Cut.toggle(t)},disableGlobalCutMode(){return this.Draw.Cut.disable()},getGeomanLayers(t=!1){let e=L.PM.Utils.findLayers(this.map);if(!t)return e;let i=L.featureGroup();return i._pmTempLayer=!0,e.forEach(t=>{i.addLayer(t)}),i},getGeomanDrawLayers(t=!1){let e=L.PM.Utils.findLayers(this.map).filter(t=>!0===t._drawnByGeoman);if(!t)return e;let i=L.featureGroup();return i._pmTempLayer=!0,e.forEach(t=>{i.addLayer(t)}),i},_getContainingLayer(){return this.globalOptions.layerGroup&&this.globalOptions.layerGroup instanceof L.LayerGroup?this.globalOptions.layerGroup:this.map},_isCRSSimple(){return this.map.options.crs===L.CRS.Simple},_touchEventCounter:0,_addTouchEvents(t){0===this._touchEventCounter&&(L.DomEvent.on(t,"touchmove",this._canvasTouchMove,this),L.DomEvent.on(t,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter+=1},_removeTouchEvents(t){1===this._touchEventCounter&&(L.DomEvent.off(t,"touchmove",this._canvasTouchMove,this),L.DomEvent.off(t,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter=this._touchEventCounter<=1?0:this._touchEventCounter-1},_canvasTouchMove(t){eg(this.map)._onMouseMove(this._createMouseEvent("mousemove",t))},_canvasTouchClick(t){let e="";"touchstart"===t.type||"pointerdown"===t.type?e="mousedown":("touchend"===t.type||"pointerup"===t.type||"touchcancel"===t.type||"pointercancel"===t.type)&&(e="mouseup"),e&&eg(this.map)._onClick(this._createMouseEvent(e,t))},_createMouseEvent(t,e){let i,n=e.touches[0]||e.changedTouches[0];try{i=new MouseEvent(t,{bubbles:e.bubbles,cancelable:e.cancelable,view:e.view,detail:n.detail,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,button:e.button,relatedTarget:e.relatedTarget})}catch{(i=document.createEvent("MouseEvents")).initMouseEvent(t,e.bubbles,e.cancelable,e.view,n.detail,n.screenX,n.screenY,n.clientX,n.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}return i}}),ev=L.Control.extend({includes:[ea],options:{position:"topleft",disableByOtherButtons:!0},initialize(t){this._button=L.Util.extend({},this.options,t)},onAdd(t){return this._map=t,this._map.pm.Toolbar.options.oneBlock?this._container=this._map.pm.Toolbar._createContainer(this.options.position):"edit"===this._button.tool?this._container=this._map.pm.Toolbar.editContainer:"options"===this._button.tool?this._container=this._map.pm.Toolbar.optionsContainer:"custom"===this._button.tool?this._container=this._map.pm.Toolbar.customContainer:this._container=this._map.pm.Toolbar.drawContainer,this._renderButton(),this._container},_renderButton(){let t=this.buttonsDomNode;this.buttonsDomNode=this._makeButton(this._button),t?t.replaceWith(this.buttonsDomNode):this._container.appendChild(this.buttonsDomNode)},onRemove(){return this.buttonsDomNode.remove(),this._container},getText(){return this._button.text},getIconUrl(){return this._button.iconUrl},destroy(){this._button={},this._update()},toggle(t){return"boolean"==typeof t?this._button.toggleStatus=t:this._button.toggleStatus=!this._button.toggleStatus,this._applyStyleClasses(),this._updateActiveAction(this._button),this._button.toggleStatus},toggled(){return this._button.toggleStatus},onCreate(){this.toggle(!1)},disable(){this.toggle(!1),this._button.disabled=!0,this._updateDisabled()},enable(){this._button.disabled=!1,this._updateDisabled(),this._updateActiveAction(this._button)},_triggerClick(t){t&&t.preventDefault(),this._button.disabled||(this._button.onClick(t,{button:this,event:t}),this._clicked(t),this._button.afterClick(t,{button:this,event:t}))},_makeButton(t){let e=this.options.position.indexOf("right")>-1?"pos-right":"",i=L.DomUtil.create("div",`button-container ${e}`,this._container);t.title&&i.setAttribute("title",t.title);let n=L.DomUtil.create("a","leaflet-buttons-control-button",i);n.setAttribute("role","button"),n.setAttribute("tabindex","0"),n.href="#";let r=L.DomUtil.create("div",`leaflet-pm-actions-container ${e}`,i),o=t.actions,s={cancel:{text:eh("actions.cancel"),title:eh("actions.cancel"),onClick(){this._triggerClick()}},finishMode:{text:eh("actions.finish"),title:eh("actions.finish"),onClick(){this._triggerClick()}},removeLastVertex:{text:eh("actions.removeLastVertex"),title:eh("actions.removeLastVertex"),onClick(){this._map.pm.Draw[t.jsClass]._removeLastVertex()}},finish:{text:eh("actions.finish"),title:eh("actions.finish"),onClick(e){this._map.pm.Draw[t.jsClass]._finishShape(e)}}};t._preparedActions=o.map(i=>{let n="string"==typeof i?i:i.name,o;if(s[n])o=s[n];else{if(!i.text)return o;o=i}let a=L.DomUtil.create("a",`leaflet-pm-action ${e} action-${n}`,r);if(a.setAttribute("role","button"),a.setAttribute("tabindex","0"),a.href="#",o.title&&(a.title=o.title),a.innerHTML=o.text,L.DomEvent.disableClickPropagation(a),L.DomEvent.on(a,"click",L.DomEvent.stop),o._node=a,!t.disabled&&o.onClick){let e=e=>{e.preventDefault();let i="",{buttons:n}=this._map.pm.Toolbar;for(let e in n)if(n[e]._button===t){i=e;break}this._fireActionClick(o,i,t)};L.DomEvent.addListener(a,"click",e,this),L.DomEvent.addListener(a,"click",o.onClick,this),L.DomEvent.addListener(a,"click",()=>this._updateActiveAction(t))}return o}),this._updateActiveAction(t),t.toggleStatus&&L.DomUtil.addClass(i,"active");let a=L.DomUtil.create("div","control-icon",n);return t.iconUrl&&a.setAttribute("src",t.iconUrl),t.className&&L.DomUtil.addClass(a,t.className),L.DomEvent.disableClickPropagation(n),L.DomEvent.on(n,"click",L.DomEvent.stop),t.disabled||(L.DomEvent.addListener(n,"click",this._onBtnClick,this),L.DomEvent.addListener(n,"click",this._triggerClick,this)),t.disabled&&(L.DomUtil.addClass(n,"pm-disabled"),n.setAttribute("aria-disabled","true")),i},_applyStyleClasses(){this._container&&(this._button.toggleStatus&&!1!==this._button.cssToggle?(L.DomUtil.addClass(this.buttonsDomNode,"active"),L.DomUtil.addClass(this._container,"activeChild")):(L.DomUtil.removeClass(this.buttonsDomNode,"active"),L.DomUtil.removeClass(this._container,"activeChild")))},_onBtnClick(){if(this._button.disabled)return;this._button.disableOtherButtons&&this._map.pm.Toolbar.triggerClickOnToggledButtons(this);let t="",{buttons:e}=this._map.pm.Toolbar;for(let i in e)if(e[i]._button===this._button){t=i;break}this._fireButtonClick(t,this._button)},_clicked(){this._button.doToggle&&this.toggle()},_updateDisabled(){if(!this._container)return;let t="pm-disabled",e=this.buttonsDomNode.children[0];this._button.disabled?(L.DomUtil.addClass(e,t),e.setAttribute("aria-disabled","true")):(L.DomUtil.removeClass(e,t),e.setAttribute("aria-disabled","false"))},_updateActiveAction(t){t._preparedActions?.forEach(t=>{t?._node&&(t.isActive&&t.isActive.call(this)?L.DomUtil.addClass(t._node,"active-action"):L.DomUtil.removeClass(t._node,"active-action"))})}});L.Control.PMButton=ev;var eL=L.Class.extend({options:{drawMarker:!0,drawRectangle:!0,drawPolyline:!0,drawPolygon:!0,drawCircle:!0,drawCircleMarker:!0,drawText:!0,editMode:!0,dragMode:!0,cutPolygon:!0,removalMode:!0,rotateMode:!0,snappingOption:!0,drawControls:!0,editControls:!0,optionsControls:!0,customControls:!0,oneBlock:!1,position:"topleft",positions:{draw:"",edit:"",options:"",custom:""}},customButtons:[],initialize(t){this.customButtons=[],this.options.positions={draw:"",edit:"",options:"",custom:""},this.init(t)},reinit(){let t=this.isVisible;this.removeControls(),this._defineButtons(),t&&this.addControls()},init(t){this.map=t,this.buttons={},this.isVisible=!1,this.drawContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-draw leaflet-bar leaflet-control"),this.editContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-edit leaflet-bar leaflet-control"),this.optionsContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-options leaflet-bar leaflet-control"),this.customContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-custom leaflet-bar leaflet-control"),this._defineButtons()},_createContainer(t){let e=`${t}Container`;return this[e]||(this[e]=L.DomUtil.create("div",`leaflet-pm-toolbar leaflet-pm-${t} leaflet-bar leaflet-control`)),this[e]},getButtons(){return this.buttons},addControls(t=this.options){"u">typeof t.editPolygon&&(t.editMode=t.editPolygon),"u">typeof t.deleteLayer&&(t.removalMode=t.deleteLayer),L.Util.setOptions(this,t),this.applyIconStyle(),this.isVisible=!0,this._showHideButtons()},applyIconStyle(){let t=this.getButtons(),e={drawMarker:"control-icon leaflet-pm-icon-marker",drawPolyline:"control-icon leaflet-pm-icon-polyline",drawRectangle:"control-icon leaflet-pm-icon-rectangle",drawPolygon:"control-icon leaflet-pm-icon-polygon",drawCircle:"control-icon leaflet-pm-icon-circle",drawCircleMarker:"control-icon leaflet-pm-icon-circle-marker",editMode:"control-icon leaflet-pm-icon-edit",dragMode:"control-icon leaflet-pm-icon-drag",cutPolygon:"control-icon leaflet-pm-icon-cut",removalMode:"control-icon leaflet-pm-icon-delete",drawText:"control-icon leaflet-pm-icon-text"};for(let i in t){let n=t[i];L.Util.setOptions(n,{className:e[i]})}},removeControls(){let t=this.getButtons();for(let e in t)t[e].remove();this.isVisible=!1},deleteControl(t){let e=this._btnNameMapping(t);this.buttons[e]&&(this.buttons[e].remove(),delete this.buttons[e])},toggleControls(t=this.options){this.isVisible?this.removeControls():this.addControls(t)},_addButton(t,e){return this.buttons[t]=e,this.options[t]=!!this.options[t],this.buttons[t]},triggerClickOnToggledButtons(t){for(let e in this.buttons){let i=this.buttons[e];i._button.disableByOtherButtons&&i!==t&&i.toggled()&&i._triggerClick()}},toggleButton(t,e,i=!0){"editPolygon"===t&&(t="editMode"),"deleteLayer"===t&&(t="removalMode");let n=t;return i&&this.triggerClickOnToggledButtons(this.buttons[n]),!!this.buttons[n]&&this.buttons[n].toggle(e)},_defineButtons(){let t={className:"control-icon leaflet-pm-icon-marker",title:eh("buttonTitles.drawMarkerButton"),jsClass:"Marker",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},e={title:eh("buttonTitles.drawPolyButton"),className:"control-icon leaflet-pm-icon-polygon",jsClass:"Polygon",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},i={className:"control-icon leaflet-pm-icon-polyline",title:eh("buttonTitles.drawLineButton"),jsClass:"Line",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},n={title:eh("buttonTitles.drawCircleButton"),className:"control-icon leaflet-pm-icon-circle",jsClass:"Circle",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},r={title:eh("buttonTitles.drawCircleMarkerButton"),className:"control-icon leaflet-pm-icon-circle-marker",jsClass:"CircleMarker",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},o={title:eh("buttonTitles.drawRectButton"),className:"control-icon leaflet-pm-icon-rectangle",jsClass:"Rectangle",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},s={title:eh("buttonTitles.editButton"),className:"control-icon leaflet-pm-icon-edit",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalEditMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},a={title:eh("buttonTitles.dragButton"),className:"control-icon leaflet-pm-icon-drag",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalDragMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},l={title:eh("buttonTitles.cutButton"),className:"control-icon leaflet-pm-icon-cut",jsClass:"Cut",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle({snappable:!0,cursorMarker:!0,allowSelfIntersection:!1})},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finish","removeLastVertex","cancel"]},h={title:eh("buttonTitles.deleteButton"),className:"control-icon leaflet-pm-icon-delete",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalRemovalMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},u={title:eh("buttonTitles.rotateButton"),className:"control-icon leaflet-pm-icon-rotate",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalRotateMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},p={className:"control-icon leaflet-pm-icon-text",title:eh("buttonTitles.drawTextButton"),jsClass:"Text",onClick:()=>{},afterClick:(t,e)=>{this.map.pm.Draw[e.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]};this._addButton("drawMarker",new L.Control.PMButton(t)),this._addButton("drawPolyline",new L.Control.PMButton(i)),this._addButton("drawRectangle",new L.Control.PMButton(o)),this._addButton("drawPolygon",new L.Control.PMButton(e)),this._addButton("drawCircle",new L.Control.PMButton(n)),this._addButton("drawCircleMarker",new L.Control.PMButton(r)),this._addButton("drawText",new L.Control.PMButton(p)),this._addButton("editMode",new L.Control.PMButton(s)),this._addButton("dragMode",new L.Control.PMButton(a)),this._addButton("cutPolygon",new L.Control.PMButton(l)),this._addButton("removalMode",new L.Control.PMButton(h)),this._addButton("rotateMode",new L.Control.PMButton(u))},_showHideButtons(){if(!this.isVisible)return;this.removeControls(),this.isVisible=!0;let t=this.getButtons(),e=[];for(let i in!1===this.options.drawControls&&(e=e.concat(Object.keys(t).filter(e=>!t[e]._button.tool))),!1===this.options.editControls&&(e=e.concat(Object.keys(t).filter(e=>"edit"===t[e]._button.tool))),!1===this.options.optionsControls&&(e=e.concat(Object.keys(t).filter(e=>"options"===t[e]._button.tool))),!1===this.options.customControls&&(e=e.concat(Object.keys(t).filter(e=>"custom"===t[e]._button.tool))),t)if(this.options[i]&&-1===e.indexOf(i)){let e=t[i]._button.tool;e||(e="draw"),t[i].setPosition(this._getBtnPosition(e)),t[i].addTo(this.map)}},_getBtnPosition(t){return this.options.positions&&this.options.positions[t]?this.options.positions[t]:this.options.position},setBlockPosition(t,e){this.options.positions[t]=e,this._showHideButtons(),this.changeControlOrder()},getBlockPositions(){return this.options.positions},copyDrawControl(t,e){if(e)"object"!=typeof e&&(e={name:e});else throw TypeError("Button has no name");let i=this._btnNameMapping(t);if(!e.name)throw TypeError("Button has no name");if(this.buttons[e.name])throw TypeError("Button with this name already exists");let n=this.map.pm.Draw.createNewDrawInstance(e.name,i);return e={...this.buttons[i]._button,...e},{drawInstance:n,control:this.createCustomControl(e)}},createCustomControl(t){if(!t.name)throw TypeError("Button has no name");if(this.buttons[t.name])throw TypeError("Button with this name already exists");t.onClick||(t.onClick=()=>{}),t.afterClick||(t.afterClick=()=>{}),!1!==t.toggle&&(t.toggle=!0),t.block&&(t.block=t.block.toLowerCase()),t.block&&"draw"!==t.block||(t.block=""),t.className?-1===t.className.indexOf("control-icon")&&(t.className=`control-icon ${t.className}`):t.className="control-icon";let e={tool:t.block,className:t.className,title:t.title||"",jsClass:t.name,onClick:t.onClick,afterClick:t.afterClick,doToggle:t.toggle,toggleStatus:!1,disableOtherButtons:t.disableOtherButtons??!0,disableByOtherButtons:t.disableByOtherButtons??!0,cssToggle:t.toggle,position:this.options.position,actions:t.actions||[],disabled:!!t.disabled};!1!==this.options[t.name]&&(this.options[t.name]=!0);let i=this._addButton(t.name,new L.Control.PMButton(e));return this.changeControlOrder(),i},controlExists(t){return!!this.getButton(t)},getButton(t){return this.getButtons()[t]},getButtonsInBlock(t){let e={};if(t)for(let i in this.getButtons()){let n=this.getButtons()[i];n._button.tool!==t&&("draw"!==t||n._button.tool)||(e[i]=n)}return e},changeControlOrder(t=[]){let e=this._shapeMapping(),i=[];t.forEach(t=>{e[t]?i.push(e[t]):i.push(t)});let n=this.getButtons(),r={};i.forEach(t=>{n[t]&&(r[t]=n[t])}),Object.keys(n).filter(t=>!n[t]._button.tool||"draw"===n[t]._button.tool).forEach(t=>{-1===i.indexOf(t)&&(r[t]=n[t])}),Object.keys(n).filter(t=>"edit"===n[t]._button.tool).forEach(t=>{-1===i.indexOf(t)&&(r[t]=n[t])}),Object.keys(n).filter(t=>"options"===n[t]._button.tool).forEach(t=>{-1===i.indexOf(t)&&(r[t]=n[t])}),Object.keys(n).filter(t=>"custom"===n[t]._button.tool).forEach(t=>{-1===i.indexOf(t)&&(r[t]=n[t])}),Object.keys(n).forEach(t=>{-1===i.indexOf(t)&&(r[t]=n[t])}),this.map.pm.Toolbar.buttons=r,this._showHideButtons()},getControlOrder(){let t=this.getButtons(),e=[];for(let i in t)e.push(i);return e},changeActionsOfControl(t,e){let i=this._btnNameMapping(t);if(!i)throw TypeError("No name passed");if(!e)throw TypeError("No actions passed");if(!this.buttons[i])throw TypeError("Button with this name not exists");this.buttons[i]._button.actions=e,this.changeControlOrder()},setButtonDisabled(t,e){let i=this._btnNameMapping(t);e?this.buttons[i].disable():this.buttons[i].enable()},_shapeMapping:()=>({Marker:"drawMarker",Circle:"drawCircle",Polygon:"drawPolygon",Rectangle:"drawRectangle",Polyline:"drawPolyline",Line:"drawPolyline",CircleMarker:"drawCircleMarker",Edit:"editMode",Drag:"dragMode",Cut:"cutPolygon",Removal:"removalMode",Rotate:"rotateMode",Text:"drawText"}),_btnNameMapping(t){let e=this._shapeMapping();return e[t]?e[t]:t}}),eb=u(tQ()),ek={_initSnappableMarkers(){this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=void 0===this.options.snapSegment||this.options.snapSegment,this._assignEvents(this._markers),this._layer.off("pm:dragstart",this._unsnap,this),this._layer.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){this._layer.off("pm:dragstart",this._unsnap,this)},_assignEvents(t){t.forEach(t=>{Array.isArray(t)?this._assignEvents(t):(t.off("drag",this._handleSnapping,this),t.on("drag",this._handleSnapping,this),t.off("dragend",this._cleanupSnapping,this),t.on("dragend",this._cleanupSnapping,this))})},_cleanupSnapping(t){t&&(t.target._snapped=!1),delete this._snapList,this.throttledList&&(this._map.off("layeradd",this.throttledList,this),this.throttledList=void 0),this._map.off("layerremove",this._handleSnapLayerRemoval,this),this.debugIndicatorLines&&this.debugIndicatorLines.forEach(t=>{t.remove()})},_handleThrottleSnapping(){this.throttledList&&this._createSnapList()},_handleSnapping(t,e=!1){let i,n,r=t.target;if(r._snapped=!1,this.throttledList||(this.throttledList=L.Util.throttle(this._handleThrottleSnapping,100,this)),t?.originalEvent?.altKey||this._map?.pm?.Keyboard.isAltKeyPressed())return!1;if(e){if(!this._otherSnapLayers||0===this._otherSnapLayers.length)return!1;n=this._otherSnapLayers}else void 0===this._snapList&&(this._createSnapList(),this._map.off("layeradd",this.throttledList,this),this._map.on("layeradd",this.throttledList,this)),n=this._snapList;if(n.length<=0)return!1;let o=this._calcClosestLayer(r.getLatLng(),n);if(0===Object.keys(o).length)return!1;i=o.layer instanceof L.Marker||o.layer instanceof L.CircleMarker||!this.options.snapSegment?o.latlng:this._checkPrioritiySnapping(o);let s=this.options.snapDistance,a={marker:r,shape:this._shape,snapLatLng:i,segment:o.segment,layer:this._layer,workingLayer:this._layer,layerInteractedWith:o.layer,distance:o.distance};if(this._fireSnapDrag(a.marker,a),this._fireSnapDrag(this._layer,a),o.distance{this._snapLatLng=i,this._fireSnap(r,a),this._fireSnap(this._layer,a)},e=this._snapLatLng||{},n=i||{};(e.lat!==n.lat||e.lng!==n.lng)&&t()}else this._snapLatLng&&(this._unsnap(a),r._snapped=!1,r._snapInfo=void 0,this._fireUnsnap(a.marker,a),this._fireUnsnap(this._layer,a));return!0},_createSnapList(){let t=[],e=[],i=this._map;i.off("layerremove",this._handleSnapLayerRemoval,this),i.on("layerremove",this._handleSnapLayerRemoval,this),i.eachLayer(i=>{if((i instanceof L.Polyline||i instanceof L.Marker||i instanceof L.CircleMarker||i instanceof L.ImageOverlay)&&!0!==i.options.snapIgnore){if(void 0===i.options.snapIgnore&&(!L.PM.optIn&&!0===i.options.pmIgnore||L.PM.optIn&&!1!==i.options.pmIgnore))return;(i instanceof L.Circle||i instanceof L.CircleMarker)&&i.pm&&i.pm._hiddenPolyCircle?t.push(i.pm._hiddenPolyCircle):i instanceof L.ImageOverlay&&(i=L.rectangle(i.getBounds())),t.push(i);let n=L.polyline([],{color:"red",pmIgnore:!0});n._pmTempLayer=!0,e.push(n),(i instanceof L.Circle||i instanceof L.CircleMarker)&&e.push(n)}}),t=(t=(t=t.filter(t=>this._layer!==t)).filter(t=>t._latlng||t._latlngs&&eu(t._latlngs))).filter(t=>!t._pmTempLayer),this._otherSnapLayers?(this._otherSnapLayers.forEach(()=>{let t=L.polyline([],{color:"red",pmIgnore:!0});t._pmTempLayer=!0,e.push(t)}),this._snapList=t.concat(this._otherSnapLayers)):this._snapList=t,this.debugIndicatorLines=e},_handleSnapLayerRemoval({layer:t}){if(!t._leaflet_id)return;let e=this._snapList.findIndex(e=>e._leaflet_id===t._leaflet_id);e>-1&&this._snapList.splice(e,1)},_calcClosestLayer(t,e){return this._calcClosestLayers(t,e,1)[0]},_calcClosestLayers(t,e,i=1){let n=[],r={};e.forEach((e,o)=>{if(e._parentCopy&&e._parentCopy===this._layer||e.getLatLngs?.().flat(5).length<2)return;let s=this._calcLayerDistances(t,e);if(s.distance=Math.floor(s.distance),this.debugIndicatorLines){if(!this.debugIndicatorLines[o]){let t=L.polyline([],{color:"red",pmIgnore:!0});t._pmTempLayer=!0,this.debugIndicatorLines[o]=t}this.debugIndicatorLines[o].setLatLngs([t,s.latlng])}1===i&&(void 0===r.distance||s.distance-5<=r.distance)?(s.distance+5t.distance-e.distance)),-1===i&&(i=n.length);let o=this._getClosestLayerByPriority(n,i);return L.Util.isArray(o)?o:[o]},_calcLayerDistances(t,e){let i=this._map,n=e instanceof L.Marker||e instanceof L.CircleMarker,r=e instanceof L.Polygon;if(n){let n=e.getLatLng();return{latlng:{...n},distance:this._getDistance(i,n,t)}}return this._calcLatLngDistances(t,e.getLatLngs(),i,r)},_calcLatLngDistances(t,e,i,n=!1){let r,o,s,a=e=>{e.forEach((l,h)=>{if(Array.isArray(l))return void a(l);if(this.options.snapSegment){let r;r=n?h+1===e.length?0:h+1:h+1===e.length?void 0:h+1;let a=e[r];if(a){let e=this._getDistanceToSegment(i,t,l,a);(void 0===o||et._leaflet_id-e._leaflet_id);let i=this._map.pm.globalOptions.snappingOrder||[],n=0,r={};return i.concat(["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"]).forEach(t=>{r[t]||(n+=1,r[t]=n)}),t.sort(function(t,e,i="asc"){if(!e||0===Object.keys(e).length)return(t,e)=>t-e;let n=Object.keys(e),r,o=n.length-1,s={};for(;o>=0;)s[(r=n[o]).toLowerCase()]=e[r],o-=1;function a(t){return t instanceof L.Marker?"Marker":t instanceof L.Circle?"Circle":t instanceof L.CircleMarker?"CircleMarker":t instanceof L.Rectangle?"Rectangle":t instanceof L.Polygon?"Polygon":t instanceof L.Polyline?"Line":void 0}return(e,n)=>{let r,o;if("instanceofShape"===t){if(r=a(e.layer).toLowerCase(),o=a(n.layer).toLowerCase(),!r||!o)return 0}else{if(!e.hasOwnProperty(t)||!n.hasOwnProperty(t))return 0;r=e[t].toLowerCase(),o=n[t].toLowerCase()}let l=r in s?s[r]:Number.MAX_SAFE_INTEGER,h=o in s?s[o]:Number.MAX_SAFE_INTEGER,u=0;return lh&&(u=1),"desc"===i?-1*u:u}}("instanceofShape",r)),1===e?t[0]||{}:t.slice(0,e)},_checkPrioritiySnapping(t){let e=this._map,i=t.segment[0],n=t.segment[1],r=t.latlng,o=r;if(this.options.snapVertex){let t=this._getDistance(e,i,r),s=this._getDistance(e,n,r),a=tt.latLngToContainerPoint(e).distanceTo(t.latLngToContainerPoint(i))},eM=L.Class.extend({includes:[ek,ea],options:{snappable:!0,snapDistance:20,snapMiddle:!1,allowSelfIntersection:!0,tooltips:!0,templineStyle:{},hintlineStyle:{color:"#3388ff",dashArray:"5,5"},pathOptions:null,cursorMarker:!0,finishOn:null,markerStyle:{draggable:!0,icon:L.icon()},hideMiddleMarkers:!1,minRadiusCircle:null,maxRadiusCircle:null,minRadiusCircleMarker:null,maxRadiusCircleMarker:null,resizeableCircleMarker:!1,resizeableCircle:!0,markerEditable:!0,continueDrawing:!1,snapSegment:!0,requireSnapToFinish:!1,rectangleAngle:0,textOptions:{text:null,focusAfterDraw:null,removeIfEmpty:null,className:null},snapVertex:!0},setOptions(t){L.Util.setOptions(this,t),this.setStyle(this.options)},setStyle(){},getOptions(){return this.options},initialize(t){let e=new L.Icon.Default;e.options.tooltipAnchor=[0,0],this.options.markerStyle.icon=e,this._map=t,this.shapes=["Marker","CircleMarker","Line","Polygon","Rectangle","Circle","Cut","Text"],this.shapes.forEach(t=>{this[t]=new L.PM.Draw[t](this._map)}),this.Marker.setOptions({continueDrawing:!0}),this.CircleMarker.setOptions({continueDrawing:!0})},setPathOptions(t,e=!1){e?this.options.pathOptions=(0,eb.default)(this.options.pathOptions,t):this.options.pathOptions=t},getShapes(){return this.shapes},getShape(){return this._shape},enable(t,e){if(!t)throw Error(`Error: Please pass a shape as a parameter. Possible shapes are: ${this.getShapes().join(",")}`);this.disable(),this[t].enable(e)},disable(){this.shapes.forEach(t=>{this[t].disable()})},addControls(){this.shapes.forEach(t=>{this[t].addButton()})},getActiveShape(){let t;return this.shapes.forEach(e=>{this[e]._enabled&&(t=e)}),t},_setGlobalDrawMode(){"Cut"===this._shape?this._fireGlobalCutModeToggled():this._fireGlobalDrawModeToggled();let t=[];this._map.eachLayer(e=>{(e instanceof L.Polyline||e instanceof L.Marker||e instanceof L.Circle||e instanceof L.CircleMarker||e instanceof L.ImageOverlay)&&(e._pmTempLayer||t.push(e))}),this._enabled?t.forEach(t=>{L.PM.Utils.disablePopup(t)}):t.forEach(t=>{L.PM.Utils.enablePopup(t)})},createNewDrawInstance(t,e){let i=this._getShapeFromBtnName(e);if(this[t])throw TypeError("Draw Type already exists");if(!L.PM.Draw[i])throw TypeError(`There is no class L.PM.Draw.${i}`);return this[t]=new L.PM.Draw[i](this._map),this[t].toolbarButtonName=t,this[t]._shape=t,this.shapes.push(t),this[e]&&this[t].setOptions(this[e].options),this[t].setOptions(this[t].options),this[t]},_getShapeFromBtnName(t){let e={drawMarker:"Marker",drawCircle:"Circle",drawPolygon:"Polygon",drawPolyline:"Line",drawRectangle:"Rectangle",drawCircleMarker:"CircleMarker",editMode:"Edit",dragMode:"Drag",cutPolygon:"Cut",removalMode:"Removal",rotateMode:"Rotate",drawText:"Text"};return e[t]?e[t]:this[t]?this[t]._shape:t},_finishLayer(t){t.pm&&(t.pm.setOptions(this.options),t.pm._shape=this._shape,t.pm._map=this._map),this._addDrawnLayerProp(t)},_addDrawnLayerProp(t){t._drawnByGeoman=!0},_setPane(t,e){"layerPane"===e?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":"vertexPane"===e?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":"markerPane"===e&&(t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},_isFirstLayer(){return 0===(this._map||this._layer._map).pm.getGeomanLayers().length}});eM.Marker=eM.extend({initialize(t){this._map=t,this._shape="Marker",this.toolbarButtonName="drawMarker",this._layerIsDragging=!1},enable(t){L.Util.setOptions(this,t),this._enabled=!0,this._isTouchDevice=!(!window.matchMedia||!window.matchMedia("(pointer: coarse)").matches),this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._isTouchDevice?(this._createTouchHint(),this._hintMarker=L.marker(this._map.getCenter(),{...this.options.markerStyle,opacity:0,interactive:!1}),this._setPane(this._hintMarker,"markerPane"),this._hintMarker._pmTempLayer=!0):(this._hintMarker=L.marker(this._map.getCenter(),this.options.markerStyle),this._setPane(this._hintMarker,"markerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.tooltips&&this._hintMarker.bindTooltip(eh("tooltips.placeMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._map.on("mousemove",this._syncHintMarker,this)),this._layer=this._hintMarker,this.options.markerEditable&&this._map.eachLayer(t=>{this.isRelevantMarker(t)&&t.pm.enable()}),this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._createMarker,this),this._isTouchDevice?(this._removeTouchHint(),this._hintMarker=null):(this._hintMarker.remove(),this._map.off("mousemove",this._syncHintMarker,this)),this._map.eachLayer(t=>{this.isRelevantMarker(t)&&t.pm.disable()}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},isRelevantMarker:t=>t instanceof L.Marker&&t.pm&&!t._pmTempLayer&&!t.pm._initTextMarker,_syncHintMarker(t){this._hintMarker.setLatLng(t.latlng),this.options.snappable&&(t.target=this._hintMarker,this._handleSnapping(t)),this._fireChange(this._hintMarker.getLatLng(),"Draw")},_createMarker(t){if(!t.latlng||this._layerIsDragging||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=new L.Marker(e,this.options.markerStyle);this._setPane(i,"markerPane"),this._finishLayer(i),i.pm||(i.options.draggable=!1),i.addTo(this._map.pm._getContainingLayer()),i.pm&&this.options.markerEditable?i.pm.enable():i.dragging&&i.dragging.disable(),this._fireCreate(i),this._cleanupSnapping(),this.options.continueDrawing||this.disable()},setStyle(){this.options.markerStyle?.icon&&this._hintMarker?.setIcon(this.options.markerStyle.icon)},_createTouchHint(){this.options.tooltips&&(this._touchHint=L.DomUtil.create("div","leaflet-pm-touch-hint"),this._touchHint.textContent=eh("tooltips.placeMarkerTouch"),this._map.getContainer().appendChild(this._touchHint))},_removeTouchHint(){this._touchHint&&this._touchHint.parentNode&&(this._touchHint.parentNode.removeChild(this._touchHint),this._touchHint=null)}});var ex={centimeters:0x25f96350,centimetres:0x25f96350,degrees:360/(2*Math.PI),feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:6371008.8,metres:6371008.8,miles:3958.761333810546,millimeters:0x17bbde120,millimetres:0x17bbde120,nauticalmiles:6371008.8/1852,radians:1,yards:6967335.223679999};function ew(t,e,i={}){let n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function eC(t,e,i={}){if(!t)throw Error("coordinates is required");if(!Array.isArray(t))throw Error("coordinates must be an Array");if(t.length<2)throw Error("coordinates must be at least 2 numbers long");if(!eB(t[0])||!eB(t[1]))throw Error("coordinates must contain numbers");return ew({type:"Point",coordinates:t},e,i)}function eP(t,e,i={}){if(t.length<2)throw Error("coordinates must be an array of two or more positions");return ew({type:"LineString",coordinates:t},e,i)}function eE(t,e={}){let i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function eT(t){return t%(2*Math.PI)*180/Math.PI}function eS(t){return t%360*Math.PI/180}function eB(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}var eO=function(t){let e,i,n={type:"FeatureCollection",features:[]};if("LineString"===(i="Feature"===t.type?t.geometry:t).type)e=[i.coordinates];else if("MultiLineString"===i.type)e=i.coordinates;else if("MultiPolygon"===i.type)e=[].concat(...i.coordinates);else if("Polygon"===i.type)e=i.coordinates;else throw Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");return e.forEach(t=>{e.forEach(e=>{for(let i=0;i=0&&h<=1&&(d.onLine1=!0),u>=0&&u<=1&&(d.onLine2=!0),!!d.onLine1&&!!d.onLine2&&[d.x,d.y])}(t[i][0],t[i][1],t[i+1][0],t[i+1][1],e[r][0],e[r][1],e[r+1][0],e[r+1][1]);o&&n.features.push(eC([o[0],o[1]]))}})}),n};eM.Line=eM.extend({initialize(t){this._map=t,this._shape="Line",this.toolbarButtonName="drawPolyline",this._doesSelfIntersect=!1},enable(t){L.Util.setOptions(this,t),this._enabled=!0,this._markers=[],this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.polyline([],{...this.options.templineStyle,pmIgnore:!1}),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._layerGroup.addLayer(this._layer),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._hintMarker=L.marker(this._map.getCenter(),{interactive:!1,zIndexOffset:100,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(eh("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._createVertex,this),this.options.finishOn&&"snap"!==this.options.finishOn&&this._map.on(this.options.finishOn,this._finishShape,this),"dblclick"===this.options.finishOn&&(this.tempMapDoubleClickZoomState=this._map.doubleClickZoom._enabled,this.tempMapDoubleClickZoomState&&this._map.doubleClickZoom.disable()),this._map.on("mousemove",this._syncHintMarker,this),this._hintMarker.on("move",this._syncHintLine,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this.isRed=!1,this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._createVertex,this),this._map.off("mousemove",this._syncHintMarker,this),this.options.finishOn&&"snap"!==this.options.finishOn&&this._map.off(this.options.finishOn,this._finishShape,this),this.tempMapDoubleClickZoomState&&this._map.doubleClickZoom.enable(),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},_syncHintLine(){let t=this._layer.getLatLngs();if(t.length>0){let e=t[t.length-1];this._hintline.setLatLngs([e,this._hintMarker.getLatLng()])}},_syncHintMarker(t){(this._hintMarker.setLatLng(t.latlng),this.options.snappable)?(t.target=this._hintMarker,this._handleSnapping(t)):this._otherSnapLayers&&this._otherSnapLayers.length>0&&(t.target=this._hintMarker,this._handleSnapping(t,!0)),this.options.allowSelfIntersection||this._handleSelfIntersection(!0,this._hintMarker.getLatLng());let e=this._layer._defaultShape().slice();e.push(this._hintMarker.getLatLng()),this._change(e)},hasSelfIntersection(){return eO(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersection(t,e){let i=L.polyline(this._layer.getLatLngs());t&&(e||(e=this._hintMarker.getLatLng()),i.addLatLng(e));let n=eO(i.toGeoJSON(15));this._doesSelfIntersect=n.features.length>0,this._doesSelfIntersect?this.isRed||(this.isRed=!0,this._hintline.setStyle({color:"#f00000ff"}),this._fireIntersect(n,this._map,"Draw")):this._hintline.isEmpty()||(this.isRed=!1,this._hintline.setStyle(this.options.hintlineStyle))},_createVertex(t){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,t.latlng),this._doesSelfIntersect))return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=this._layer.getLatLngs(),n=i[i.length-1];if(e.equals(i[0])||i.length>0&&e.equals(n))return void this._finishShape();this._layer._latlngInfo=this._layer._latlngInfo||[],this._layer._latlngInfo.push({latlng:e,snapInfo:this._hintMarker._snapInfo}),this._layer.addLatLng(e);let r=this._createMarker(e);this._setTooltipText(),this._setHintLineAfterNewVertex(e),this._fireVertexAdded(r,void 0,e,"Draw"),this._change(this._layer.getLatLngs()),"snap"===this.options.finishOn&&this._hintMarker._snapped&&this._finishShape(t)},_setHintLineAfterNewVertex(t){this._hintline.setLatLngs([t,t])},_removeLastVertex(){let t=this._markers;if(t.length<=1)return void this.disable();let e=this._layer.getLatLngs(),i=t[t.length-1],{indexPath:n}=L.PM.Utils.findDeepMarkerIndex(t,i);t.pop(),this._layerGroup.removeLayer(i);let r=t[t.length-1],o=e.indexOf(r.getLatLng());e=e.slice(0,o+1),this._layer.setLatLngs(e),this._layer._latlngInfo.pop(),this._syncHintLine(),this._setTooltipText(),this._fireVertexRemoved(i,n,"Draw"),this._change(this._layer.getLatLngs())},_finishShape(){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!1),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let t=this._layer.getLatLngs();if(t.length<=1)return;let e=L.polyline(t,this.options.pathOptions);this._setPane(e,"layerPane"),this._finishLayer(e),e.addTo(this._map.pm._getContainingLayer()),this._fireCreate(e),this.options.snappable&&this._cleanupSnapping();let i=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(i))},_createMarker(t){let e=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._pmTempLayer=!0,this._layerGroup.addLayer(e),this._markers.push(e),e.on("click",this._finishShape,this),e},_setTooltipText(){let{length:t}=this._layer.getLatLngs().flat(),e="";e=t<=1?eh("tooltips.continueLine"):eh("tooltips.finishLine"),this._hintMarker.setTooltipContent(e)},_change(t){this._fireChange(t,"Draw")},setStyle(){this._layer?.setStyle(this.options.templineStyle),this._hintline?.setStyle(this.options.hintlineStyle)}}),eM.Polygon=eM.Line.extend({initialize(t){this._map=t,this._shape="Polygon",this.toolbarButtonName="drawPolygon"},enable(t){L.PM.Draw.Line.prototype.enable.call(this,t),this._layer.pm._shape="Polygon"},_createMarker(t){let e=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._pmTempLayer=!0,this._layerGroup.addLayer(e),this._markers.push(e),1===this._layer.getLatLngs().flat().length?(e.on("click",this._finishShape,this),this._tempSnapLayerIndex=this._otherSnapLayers.push(e)-1,this.options.snappable&&this._cleanupSnapping()):e.on("click",()=>1),e},_setTooltipText(){let{length:t}=this._layer.getLatLngs().flat(),e="";e=t<=2?eh("tooltips.continueLine"):eh("tooltips.finishPoly"),this._hintMarker.setTooltipContent(e)},_finishShape(){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let t=this._layer.getLatLngs();if(t.length<=2)return;let e=L.polygon(t,this.options.pathOptions);this._setPane(e,"layerPane"),this._finishLayer(e),e.addTo(this._map.pm._getContainingLayer()),this._fireCreate(e),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex;let i=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(i))}}),eM.Rectangle=eM.extend({initialize(t){this._map=t,this._shape="Rectangle",this.toolbarButtonName="drawRectangle"},enable(t){if(L.Util.setOptions(this,t),this._enabled=!0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.rectangle([[0,0],[0,0]],this.options.pathOptions),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._startMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-start-marker"}),draggable:!1,zIndexOffset:-100,opacity:+!!this.options.cursorMarker}),this._setPane(this._startMarker,"vertexPane"),this._startMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._startMarker),this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:150,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(eh("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this.options.cursorMarker){this._styleMarkers=[];for(let t=0;t<2;t+=1){let t=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-style-marker"}),draggable:!1,zIndexOffset:100});this._setPane(t,"vertexPane"),t._pmTempLayer=!0,this._layerGroup.addLayer(t),this._styleMarkers.push(t)}}this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._placeStartingMarkers,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._finishShape,this),this._map.off("click",this._placeStartingMarkers,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},_placeStartingMarkers(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng();L.DomUtil.addClass(this._startMarker._icon,"visible"),this._startMarker.setLatLng(e),this.options.cursorMarker&&this._styleMarkers&&this._styleMarkers.forEach(t=>{L.DomUtil.addClass(t._icon,"visible"),t.setLatLng(e)}),this._map.off("click",this._placeStartingMarkers,this),this._map.on("click",this._finishShape,this),this._hintMarker.setTooltipContent(eh("tooltips.finishRect")),this._setRectangleOrigin()},_setRectangleOrigin(){let t=this._startMarker.getLatLng();t&&(this._layerGroup.addLayer(this._layer),this._layer.setLatLngs([t,t]),this._hintMarker.on("move",this._syncRectangleSize,this))},_syncHintMarker(t){this._hintMarker.setLatLng(t.latlng),this.options.snappable&&(t.target=this._hintMarker,this._handleSnapping(t));let e=this._layerGroup&&this._layerGroup.hasLayer(this._layer)?this._layer.getLatLngs():[this._hintMarker.getLatLng()];this._fireChange(e,"Draw")},_syncRectangleSize(){let t=em(this._startMarker.getLatLng(),this._map),e=em(this._hintMarker.getLatLng(),this._map),i=L.PM.Utils._getRotatedRectangle(t,e,this.options.rectangleAngle||0,this._map);if(this._layer.setLatLngs(i),this.options.cursorMarker&&this._styleMarkers){let n=[];i.forEach(i=>{i.equals(t,1e-8)||i.equals(e,1e-8)||n.push(i)}),n.forEach((t,e)=>{try{this._styleMarkers[e].setLatLng(t)}catch{}})}},_findCorners(){let t=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(t[0],t[2],this.options.rectangleAngle||0,this._map)},_finishShape(t){t?.latlng&&!this._hintMarker._snapped&&this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=this._startMarker.getLatLng();if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer()||i.equals(e))return;let n=L.rectangle([i,e],this.options.pathOptions);if(this.options.rectangleAngle){let t=L.PM.Utils._getRotatedRectangle(i,e,this.options.rectangleAngle||0,this._map);n.setLatLngs(t),n.pm&&n.pm._setAngle(this.options.rectangleAngle||0)}this._setPane(n,"layerPane"),this._finishLayer(n),n.addTo(this._map.pm._getContainingLayer()),this._fireCreate(n);let r=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(r))},setStyle(){this._layer?.setStyle(this.options.pathOptions)}}),eM.CircleMarker=eM.extend({initialize(t){this._map=t,this._shape="CircleMarker",this.toolbarButtonName="drawCircleMarker",this._layerIsDragging=!1,this._BaseCircleClass=L.CircleMarker,this._minRadiusOption="minRadiusCircleMarker",this._maxRadiusOption="maxRadiusCircleMarker",this._editableOption="resizeableCircleMarker",this._defaultRadius=10},enable(t){if(L.Util.setOptions(this,t),this.options.editable&&(this.options.resizeableCircleMarker=this.options.editable,delete this.options.editable),this._enabled=!0,this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._map.getContainer().classList.add("geoman-draw-cursor"),this.options[this._editableOption]){let t={};L.extend(t,this.options.templineStyle),t.radius=0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=new this._BaseCircleClass(this._map.getCenter(),t),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._centerMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon"}),draggable:!1,zIndexOffset:100}),this._setPane(this._centerMarker,"vertexPane"),this._centerMarker._pmTempLayer=!0,this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:110,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(eh("tooltips.startCircle"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._map.on("click",this._placeCenterMarker,this)}else this._map.on("click",this._createMarker,this),this._hintMarker=new this._BaseCircleClass(this._map.getCenter(),{radius:this._defaultRadius,...this.options.templineStyle}),this._setPane(this._hintMarker,"layerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this._layer=this._hintMarker,this.options.tooltips&&this._hintMarker.bindTooltip(eh("tooltips.placeCircleMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip();this._map.on("mousemove",this._syncHintMarker,this),this._extendingEnable(),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},_extendingEnable(){!this.options[this._editableOption]&&this.options.markerEditable&&this._map.eachLayer(t=>{this.isRelevantMarker(t)&&t.pm.enable()}),this._layer.bringToBack()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this.options[this._editableOption]?(this._map.off("click",this._finishShape,this),this._map.off("click",this._placeCenterMarker,this),this._map.removeLayer(this._layerGroup)):(this._map.off("click",this._createMarker,this),this._extendingDisable(),this._hintMarker.remove()),this._map.off("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},_extendingDisable(){this._map.eachLayer(t=>{this.isRelevantMarker(t)&&t.pm.disable()})},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},_placeCenterMarker(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng),this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker);let e=this._hintMarker.getLatLng();this._centerMarker.setLatLng(e),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter(){let t=this._centerMarker.getLatLng();t&&(this._layer.setLatLng(t),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(eh("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_syncHintLine(){let t=this._centerMarker.getLatLng(),e=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([t,e])},_syncCircleRadius(){let t=this._centerMarker.getLatLng(),e=this._hintMarker.getLatLng(),i=this._distanceCalculation(t,e);this.options[this._minRadiusOption]&&ithis.options[this._maxRadiusOption]?this._layer.setRadius(this.options[this._maxRadiusOption]):this._layer.setRadius(i)},_syncHintMarker(t){this._hintMarker.setLatLng(t.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable&&(t.target=this._hintMarker,this._handleSnapping(t)),this._handleHintMarkerSnapping();let e=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(e,"Draw")},isRelevantMarker:t=>t instanceof L.CircleMarker&&!(t instanceof L.Circle)&&t.pm&&!t._pmTempLayer,_createMarker(t){if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer()||!t.latlng||this._layerIsDragging)return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=new this._BaseCircleClass(e,{radius:this._defaultRadius,...this.options.pathOptions});this._setPane(i,"layerPane"),this._finishLayer(i),i.addTo(this._map.pm._getContainingLayer()),this._extendingCreateMarker(i),this._fireCreate(i),this._cleanupSnapping(),this.options.continueDrawing||this.disable()},_extendingCreateMarker(t){t.pm&&this.options.markerEditable&&t.pm.enable()},_finishShape(t){if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;t?.latlng&&!this._hintMarker._snapped&&this._hintMarker.setLatLng(t.latlng);let e=this._centerMarker.getLatLng(),i=this._defaultRadius;if(this.options[this._editableOption]){let t=this._hintMarker.getLatLng();i=this._distanceCalculation(e,t),this.options[this._minRadiusOption]&&ithis.options[this._maxRadiusOption]&&(i=this.options[this._maxRadiusOption])}let n={...this.options.pathOptions,radius:i},r=new this._BaseCircleClass(e,n);this._setPane(r,"layerPane"),this._finishLayer(r),r.addTo(this._map.pm._getContainingLayer()),r.pm&&r.pm._updateHiddenPolyCircle(),this._fireCreate(r);let o=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(o))},_getNewDestinationOfHintMarker(){let t=this._hintMarker.getLatLng();if(this.options[this._editableOption]){if(!this._layerGroup.hasLayer(this._centerMarker))return t;let e=this._centerMarker.getLatLng(),i=this._distanceCalculation(e,t);this.options[this._minRadiusOption]&&ithis.options[this._maxRadiusOption]&&(t=e_(this._map,e,t,this._getMaxDistanceInMeter()))}return t},_getMinDistanceInMeter(){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._minRadiusOption],this._map,this._centerMarker.getLatLng())},_getMaxDistanceInMeter(){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._maxRadiusOption],this._map,this._centerMarker.getLatLng())},_handleHintMarkerSnapping(){if(this.options[this._editableOption]){if(this._hintMarker._snapped){let t=this._centerMarker.getLatLng(),e=this._hintMarker.getLatLng(),i=this._distanceCalculation(t,e);this._layerGroup.hasLayer(this._centerMarker)&&(this.options[this._minRadiusOption]&&ithis.options[this._maxRadiusOption]&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng))}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())}},setStyle(){let t={};L.extend(t,this.options.templineStyle),this.options[this._editableOption]&&(t.radius=0),this._layer?.setStyle(t),this._hintline?.setStyle(this.options.hintlineStyle)},_distanceCalculation(t,e){return this._map.project(t).distanceTo(this._map.project(e))}}),eM.Circle=eM.CircleMarker.extend({initialize(t){this._map=t,this._shape="Circle",this.toolbarButtonName="drawCircle",this._BaseCircleClass=L.Circle,this._minRadiusOption="minRadiusCircle",this._maxRadiusOption="maxRadiusCircle",this._editableOption="resizeableCircle",this._defaultRadius=100},_extendingEnable(){},_extendingDisable(){},_extendingCreateMarker(){},isRelevantMarker(){},_getMinDistanceInMeter(){return this.options[this._minRadiusOption]},_getMaxDistanceInMeter(){return this.options[this._maxRadiusOption]},_distanceCalculation(t,e){return this._map.distance(t,e)}});var eD=class{constructor(t=[],e=eR){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;let t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:i}=this,n=e[t];for(;t>0;){let r=t-1>>1,o=e[r];if(i(n,o)>=0)break;e[t]=o,t=r}e[t]=n}_down(t){let{data:e,compare:i}=this,n=this.length>>1,r=e[t];for(;ti(e[s],o)&&(n=s,o=e[s]),i(o,r)>=0)break;e[t]=o,t=n}e[t]=r}};function eR(t,e){return te)}function eI(t,e){return t.p.x>e.p.x?1:t.p.xe.p.y?1:-1:1}function eA(t,e){return t.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:t.rightSweepEvent.p.x0?(l.isLeftEndpoint=!0,a.isLeftEndpoint=!1):(a.isLeftEndpoint=!0,l.isLeftEndpoint=!1),e.push(a),e.push(l),r=o,eG+=1}}eN+=1}var eF=class{constructor(t){this.leftSweepEvent=t,this.rightSweepEvent=t.otherEvent}},eU=function(t,e){let i=new eD([],eI);return function(t,e){if("FeatureCollection"===t.type){let i=t.features;for(let t=0;t=0&&p<=1&&c>=0&&c<=1&&[i+p*(r-i),n+p*(o-n)]}(t,s);!1!==a&&i.push(a)}n.push(t)}else!1===r.isLeftEndpoint&&n.pop()}return i}(i,e)};function eV(t,e,i={}){let{removeDuplicates:n=!0,ignoreSelfIntersections:r=!0}=i,o=[];"FeatureCollection"===t.type?o=o.concat(t.features):"Feature"===t.type?o.push(t):("LineString"===t.type||"Polygon"===t.type||"MultiLineString"===t.type||"MultiPolygon"===t.type)&&o.push(ew(t)),"FeatureCollection"===e.type?o=o.concat(e.features):"Feature"===e.type?o.push(e):("LineString"===e.type||"Polygon"===e.type||"MultiLineString"===e.type||"MultiPolygon"===e.type)&&o.push(ew(e));let s=eU(eE(o),r),a=[];if(n){let t={};s.forEach(e=>{let i=e.join(",");t[i]||(t[i]=!0,a.push(e))})}else a=s;return eE(a.map(t=>eC(t)))}var eH=u(ei(),1);function eq(t,e,i){if(null!==t)for(var n,r,o,s,a,l,h,u,p=0,c=0,d=t.type,_="FeatureCollection"===d,f="Feature"===d,m=_?t.features.length:1,g=0;g{i[0]>t[0]&&(i[0]=t[0]),i[1]>t[1]&&(i[1]=t[1]),i[2]=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return[...t];throw Error("coord must be GeoJSON Point or an Array of numbers")}function eQ(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function e0(t){return"Feature"===t.type?t.geometry:t}function e1(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}function e2(t,e,i={}){var n=e$(t),r=e$(e),o=Math.pow(Math.sin(eS(r[1]-n[1])/2),2)+Math.pow(Math.sin(eS(r[0]-n[0])/2),2)*Math.cos(eS(n[1]))*Math.cos(eS(r[1]));return function(t,e="kilometers"){let i=ex[e];if(!i)throw Error(e+" units is invalid");return t*i}(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)),i.units)}var e3=Object.defineProperty,e4=Object.defineProperties,e8=Object.getOwnPropertyDescriptors,e5=Object.getOwnPropertySymbols,e6=Object.prototype.hasOwnProperty,e9=Object.prototype.propertyIsEnumerable,e7=(t,e,i)=>e in t?e3(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,it=(t,e)=>{for(var i in e||(e={}))e6.call(e,i)&&e7(t,i,e[i]);if(e5)for(var i of e5(e))e9.call(e,i)&&e7(t,i,e[i]);return t},ie=(t,e)=>e4(t,e8(e));function ii(t,e){let[i,n,r]=t,[o,s,a]=e;return i*o+n*s+r*a}function ir(t,e){let[i,n,r]=t,[o,s,a]=e;return[n*a-r*s,r*o-i*a,i*s-n*o]}function io(t){let e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2));return[t[0]/e,t[1]/e,t[2]/e]}function is(t){let e=eS(t[1]),i=eS(t[0]);return[Math.cos(e)*Math.cos(i),Math.cos(e)*Math.sin(i),Math.sin(e)]}function ia(t,e){if(!t)throw Error("line is required");if(!e)throw Error("splitter is required");let i=e1(t),n=e1(e);if("LineString"!==i)throw Error("line must be LineString");if("FeatureCollection"===n)throw Error("splitter cannot be a FeatureCollection");if("GeometryCollection"===n)throw Error("splitter cannot be a GeometryCollection");var r=function(t,e){if(!(null!==(i=e=e??{})&&"object"==typeof i&&!Array.isArray(i)))throw Error("options is invalid");var i,n=e.precision,r=e.coordinates,o=e.mutate;if(n=null==n||isNaN(n)?6:n,r=null==r||isNaN(r)?3:r,!t)throw Error(" is required");if("number"!=typeof n)throw Error(" must be a number");if("number"!=typeof r)throw Error(" must be a number");(!1===o||void 0===o)&&(t=JSON.parse(JSON.stringify(t)));var s=Math.pow(10,n);return eq(t,function(t){var e=t,i=s,n=r;e.length>n&&e.splice(n,e.length);for(var o=0;o{var i=t,n=e;let r=[],o=i.geometry;if(null!==o){switch(o.type){case"Polygon":r=eQ(o);break;case"LineString":r=[eQ(o)]}r.forEach(t=>{var e,r;let o;(e=t,r=i.properties,o=[],e.reduce((t,e)=>{var i,n;let s,a,l,h,u=eP([t,e],r);return i=t,n=e,s=i[0],a=i[1],u.bbox=[s<(l=n[0])?s:l,a<(h=n[1])?a:h,s>l?s:l,a>h?a:h],o.push(u),e}),o).forEach(t=>{t.id=n.length,n.push(t)})})}}),eE(e)}(t);l.load(h);var u=l.search(e);if(!u.features.length)return eE([t]);var p=iu(e,u),c=(i=function(t,i,n){var r=eQ(i)[1],s=e$(e);return n===p.id?(t.push(s),o.push(eP(t)),ip(s,r)?[s]:[s,r]):(t.push(r),t)},r=n=[s],eK(h,function(t,e){r=0===e&&void 0===n?t:i(r,t,e)}),r);return c.length>1&&o.push(eP(c)),eE(o)}function iu(t,e){if(!e.features.length)throw Error("lines must contain features");if(1===e.features.length)return e.features[0];var i,n=1/0;return eK(e,function(e){var r=function(t,e,i={}){if(!t||!e)throw Error("lines and inputPoint are required arguments");let n=e$(e),r=eC([1/0,1/0],{lineStringIndex:-1,segmentIndex:-1,totalDistance:-1,lineDistance:-1,segmentDistance:-1,pointDistance:1/0,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),o=0,s=0,a=-1;return eW(t,function(t,l,h){a!==h&&(a=h,s=0);let u=eQ(t),p=u.length-2;for(let t=0;t0?[[...e],!0]:[[...i],!1];let a=ir(s,o);if(0===a[0]&&0===a[1]&&0===a[2])return[[...e],!0];let l=io(ir(a,s)),h=[-l[0],-l[1],-l[2]],u=ii(o,l)>ii(o,h)?l:h,p=io(s),c=ii(ir(n,u),p),d=ii(ir(u,r),p);return c>=0&&d>=0?[function(t){let[e,i,n]=t,r=eT(Math.asin(Math.min(Math.max(n,-1),1)));return[eT(Math.atan2(i,e)),r]}(u),!1]:ii(n,o)>ii(r,o)?[[...t],!1]:[[...e],!0]}(l,d,n);let g=e2(e,f,i);if(gh==u>-h?(o=h,h=e[++p]):(o=u,u=n[++c]);let d=0;if(ph==u>-h?(s=h+o,a=o-(s-h),h=e[++p]):(s=u+o,a=o-(s-u),u=n[++c]),o=s,0!==a&&(r[d++]=a);ph==u>-h?(l=(s=o+h)-o,a=o-(s-l)+(h-l),h=e[++p]):(l=(s=o+u)-o,a=o-(s-l)+(u-l),u=n[++c]),o=s,0!==a&&(r[d++]=a);for(;p=h[0]&&u[3]>=h[1]))return!1;"Polygon"===o&&(a=[a]);let l=!1;for(var h,u,p=0;p=0||o<=0&&a>=0)return 0}else if(l>=0&&s<=0||l<=0&&s>=0){if(0===(r=function(t,e,i,n,r,o){let s=(e-0)*(i-0),a=(t-0)*(n-0),l=s-a,h=Math.abs(s+a);return Math.abs(l)>=im*h?l:-function(t,e,i,n,r,o,s){let a,l,h,u,p,c,d,_,f,m,g,y,v,b,k,M,x,w,C=t-0,P=i-0,E=e-0,T=n-0;b=C*T,d=(c=0x8000001*C)-(c-C),_=C-d,f=(c=0x8000001*T)-(c-T),k=_*(m=T-f)-(b-d*f-_*f-d*m),M=E*P,d=(c=0x8000001*E)-(c-E),_=E-d,f=(c=0x8000001*P)-(c-P),g=k-(x=_*(m=P-f)-(M-d*f-_*f-d*m)),p=k-g,iv[0]=k-(g+p)+(p-x),p=(y=b+g)-b,g=(v=b-(y-p)+(g-p))-M,p=v-g,iv[1]=v-(g+p)+(p-M),p=(w=y+g)-y,iv[2]=y-(w-p)+(g-p),iv[3]=w;let S=function(t,e){let i=e[0];for(let t=1;t<4;t++)i+=e[t];return i}(0,iv),B=ig*s;if(S>=B||-S>=B||(p=t-C,a=t-(C+p)+(p-0),p=i-P,h=i-(P+p)+(p-0),p=e-E,l=e-(E+p)+(p-0),p=n-T,u=n-(T+p)+(p-0),0===a&&0===l&&0===h&&0===u)||(B=iy*s+ic*Math.abs(S),(S+=C*u+T*a-(E*h+P*l))>=B||-S>=B))return S;b=a*T,d=(c=0x8000001*a)-(c-a),_=a-d,f=(c=0x8000001*T)-(c-T),k=_*(m=T-f)-(b-d*f-_*f-d*m),M=l*P,d=(c=0x8000001*l)-(c-l),_=l-d,f=(c=0x8000001*P)-(c-P),g=k-(x=_*(m=P-f)-(M-d*f-_*f-d*m)),p=k-g,iM[0]=k-(g+p)+(p-x),p=(y=b+g)-b,g=(v=b-(y-p)+(g-p))-M,p=v-g,iM[1]=v-(g+p)+(p-M),p=(w=y+g)-y,iM[2]=y-(w-p)+(g-p),iM[3]=w;let O=id(4,iv,4,iM,iL);b=C*u,d=(c=0x8000001*C)-(c-C),_=C-d,f=(c=0x8000001*u)-(c-u),k=_*(m=u-f)-(b-d*f-_*f-d*m),M=E*h,d=(c=0x8000001*E)-(c-E),_=E-d,f=(c=0x8000001*h)-(c-h),g=k-(x=_*(m=h-f)-(M-d*f-_*f-d*m)),p=k-g,iM[0]=k-(g+p)+(p-x),p=(y=b+g)-b,g=(v=b-(y-p)+(g-p))-M,p=v-g,iM[1]=v-(g+p)+(p-M),p=(w=y+g)-y,iM[2]=y-(w-p)+(g-p),iM[3]=w;let D=id(O,iL,4,iM,ib);b=a*u,d=(c=0x8000001*a)-(c-a),_=a-d,f=(c=0x8000001*u)-(c-u),k=_*(m=u-f)-(b-d*f-_*f-d*m),M=l*h,d=(c=0x8000001*l)-(c-l),_=l-d,f=(c=0x8000001*h)-(c-h),g=k-(x=_*(m=h-f)-(M-d*f-_*f-d*m)),p=k-g,iM[0]=k-(g+p)+(p-x),p=(y=b+g)-b,g=(v=b-(y-p)+(g-p))-M,p=v-g,iM[1]=v-(g+p)+(p-M),p=(w=y+g)-y,iM[2]=y-(w-p)+(g-p),iM[3]=w;let R=id(D,ib,4,iM,ik);return ik[R-1]}(t,e,i,n,0,0,h)}(o,a,s,l,0,0)))return 0;(r>0&&l>0&&s<=0||r<0&&l<=0&&s>0)&&p++}h=u,s=l,o=a}}return p%2!=0}(n,a[p]);if(0===t)return!i.ignoreBoundary;t&&(l=!0)}return l}function iw(t,e,i={}){let n=e$(t),r=eQ(e);for(let t=0;tr)return!1}else if(0!==f)return!1;return Math.abs(d)===Math.abs(_)&&0===Math.abs(d)?!n&&i[0]===t[0]&&i[1]===t[1]:n?"start"===n?Math.abs(d)>=Math.abs(_)?d>0?a0?l=Math.abs(_)?d>0?a<=o&&o0?l<=s&&s=Math.abs(_)?d>0?a0?l=Math.abs(_)?d>0?a<=o&&o<=h:h<=o&&o<=a:_>0?l<=s&&s<=u:u<=s&&s<=l}(r[t],r[t+1],n,e,typeof i.epsilon>"u"?null:i.epsilon))return!0}return!1}function iC(t,e){if("Feature"===t.type&&null===t.geometry||"Feature"===e.type&&null===e.geometry||!iP(eY(t),eY(e)))return!1;for(let i of e0(e).coordinates)for(let e of i)if(!ix(e,t))return!1;return!0}function iP(t,e){return!(t[0]>e[0]||t[2]e[1]||t[3]iC(M,{type:"Polygon",coordinates:t}));default:throw Error("feature2 "+o+" geometry not supported")}case"MultiPolygon":if("Polygon"===o){return l=i,h=n,l.coordinates.some(t=>iC({type:"Polygon",coordinates:t},h))}throw Error("feature2 "+o+" geometry not supported");default:throw Error("feature1 "+r+" geometry not supported")}},iS=u(ee()),iB=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,iO=Math.ceil,iD=Math.floor,iR="[BigNumber Error] ",iI=iR+"Number primitive has more than 15 significant digits: ",iA=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function iz(t){var e=0|t;return t>0||t===e?e:e-1}function iN(t){for(var e,i,n=1,r=t.length,o=t[0]+"";nh^i?1:-1;for(a=(l=r.length)<(h=o.length)?l:h,s=0;so[s]^i?1:-1;return l==h?0:l>h^i?1:-1}function iG(t,e,i,n){if(ti||t!==iD(t))throw Error(iR+(n||"Argument")+("number"==typeof t?ti?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function iZ(t){var e=t.c.length-1;return iz(t.e/14)==e&&t.c[e]%2!=0}function iF(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function iU(t,e,i){var n,r;if(e<0){for(r=i+".";++e;r+=i);t=r+t}else if(n=t.length,++e>n){for(r=i,e-=n;--e;r+=i);t+=r}else ey?c.c=c.e=null:t.e=10;s/=10,o++);o>y?c.c=c.e=null:(c.e=o,c.c=[t]);return}p=String(t)}else{if(!iB.test(p=String(t)))return u(c,p,a);c.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(o=p.indexOf("."))>-1&&(p=p.replace(".","")),(s=p.search(/e/i))>0?(o<0&&(o=s),o+=+p.slice(s+1),p=p.substring(0,s)):o<0&&(o=p.length)}else{if(iG(e,2,x.length,"Base"),10==e&&w)return S(c=new C(t),d+c.e+1,_);if(p=String(t),a="number"==typeof t){if(0*t!=0)return u(c,p,a,e);if(c.s=1/t<0?(p=p.slice(1),-1):1,C.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(iI+t)}else c.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(i=x.slice(0,e),o=s=0,l=p.length;si.indexOf(n=p.charAt(s))){if("."==n){if(s>o){o=l;continue}}else if(!r&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){r=!0,s=-1,o=0;continue}return u(c,String(t),a,e)}a=!1,(o=(p=h(p,e,10,c.s)).indexOf("."))>-1?p=p.replace(".",""):o=p.length}for(s=0;48===p.charCodeAt(s);s++);for(l=p.length;48===p.charCodeAt(--l););if(p=p.slice(s,++l)){if(l-=s,a&&C.DEBUG&&l>15&&(t>0x1fffffffffffff||t!==iD(t)))throw Error(iI+c.s*t);if((o=o-s-1)>y)c.c=c.e=null;else if(o=m)?iF(l,s):iU(l,s,"0");else if(o=(t=S(new C(t),e,i)).e,a=(l=iN(t.c)).length,1==n||2==n&&(e<=o||o<=f)){for(;as),l=iU(l,o,"0"),o+1>a){if(--e>0)for(l+=".";e--;l+="0");}else if((e+=o-a)>0)for(o+1==a&&(l+=".");e--;l+="0");return t.s<0&&r?"-"+l:l}function E(t,e){for(var i,n,r=1,o=new C(t[0]);r=10;r/=10,n++);return(i=n+14*i-1)>y?t.c=t.e=null:i=10;a/=10,r++);if((o=e-r)<0)o+=14,s=e,u=iD((l=p[h=0])/iA[r-s-1]%10);else if((h=iO((o+1)/14))>=p.length)if(n){for(;p.length<=h;p.push(0));l=u=0,r=1,o%=14,s=o-14+1}else break t;else{for(l=a=p[h],r=1;a>=10;a/=10,r++);o%=14,u=(s=o-14+r)<0?0:iD(l/iA[r-s-1]%10)}if(n=n||e<0||null!=p[h+1]||(s<0?l:l%iA[r-s-1]),n=i<4?(u||n)&&(0==i||i==(t.s<0?3:2)):u>5||5==u&&(4==i||n||6==i&&(o>0?s>0?l/iA[r-s]:0:p[h-1])%10&1||i==(t.s<0?8:7)),e<1||!p[0])return p.length=0,n?(e-=t.e+1,p[0]=iA[(14-e%14)%14],t.e=-e||0):p[0]=t.e=0,t;if(0==o?(p.length=h,a=1,h--):(p.length=h+1,a=iA[14-o],p[h]=s>0?iD(l/iA[r-s]%iA[s])*a:0),n)for(;;)if(0==h){for(o=1,s=p[0];s>=10;s/=10,o++);for(s=p[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(t.e++,1e14==p[0]&&(p[0]=1));break}else{if(p[h]+=a,1e14!=p[h])break;p[h--]=0,a=1}for(o=p.length;0===p[--o];p.pop());}t.e>y?t.c=t.e=null:t.e=m?iF(e,i):iU(e,i,"0"),t.s<0?"-"+e:e)}return C.clone=t,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(t){var e,i;if(null!=t)if("object"==typeof t){if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(iG(i=t[e],0,1e9,e),d=i),t.hasOwnProperty(e="ROUNDING_MODE")&&(iG(i=t[e],0,8,e),_=i),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((i=t[e])&&i.pop?(iG(i[0],-1e9,0,e),iG(i[1],0,1e9,e),f=i[0],m=i[1]):(iG(i,-1e9,1e9,e),f=-(m=i<0?-i:i))),t.hasOwnProperty(e="RANGE"))if((i=t[e])&&i.pop)iG(i[0],-1e9,-1,e),iG(i[1],1,1e9,e),g=i[0],y=i[1];else if(iG(i,-1e9,1e9,e),i)g=-(y=i<0?-i:i);else throw Error(iR+e+" cannot be zero: "+i);if(t.hasOwnProperty(e="CRYPTO"))if(!!(i=t[e])===i)if(i)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))v=i;else throw v=!i,Error(iR+"crypto unavailable");else v=i;else throw Error(iR+e+" not true or false: "+i);if(t.hasOwnProperty(e="MODULO_MODE")&&(iG(i=t[e],0,9,e),b=i),t.hasOwnProperty(e="POW_PRECISION")&&(iG(i=t[e],0,1e9,e),k=i),t.hasOwnProperty(e="FORMAT"))if("object"==typeof(i=t[e]))M=i;else throw Error(iR+e+" not an object: "+i);if(t.hasOwnProperty(e="ALPHABET"))if("string"!=typeof(i=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(i))throw Error(iR+e+" invalid: "+i);else w="0123456789"==i.slice(0,10),x=i}else throw Error(iR+"Object expected: "+t);return{DECIMAL_PLACES:d,ROUNDING_MODE:_,EXPONENTIAL_AT:[f,m],RANGE:[g,y],CRYPTO:v,MODULO_MODE:b,POW_PRECISION:k,FORMAT:M,ALPHABET:x}},C.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!C.DEBUG)return!0;var e,i,n=t.c,r=t.e,o=t.s;t:if("[object Array]"==({}).toString.call(n)){if((1===o||-1===o)&&r>=-1e9&&r<=1e9&&r===iD(r)){if(0===n[0]){if(0===r&&1===n.length)return!0;break t}if((e=(r+1)%14)<1&&(e+=14),String(n[0]).length==e){for(e=0;e=1e14||i!==iD(i))break t;if(0!==i)return!0}}}else if(null===n&&null===r&&(null===o||1===o||-1===o))return!0;throw Error(iR+"Invalid BigNumber: "+t)},C.maximum=C.max=function(){return E(arguments,-1)},C.minimum=C.min=function(){return E(arguments,1)},i=0x20000000000000*Math.random()&2097151?function(){return iD(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},C.random=function(t){var e,n,r,o,s,a=0,l=[],h=new C(c);if(null==t?t=d:iG(t,0,1e9),o=iO(t/14),v)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(o*=2));a>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),e[a]=n[0],e[a+1]=n[1]):(l.push(s%1e14),a+=2);a=o/2}else if(crypto.randomBytes){for(e=crypto.randomBytes(o*=7);a=9e15?crypto.randomBytes(7).copy(e,a):(l.push(s%1e14),a+=7);a=o/7}else throw v=!1,Error(iR+"crypto unavailable");if(!v)for(;a=10;s/=10,a++);a<14&&(r-=14-a)}return h.e=r,h.c=l,h},C.sum=function(){for(var t=1,e=arguments,i=new C(e[0]);ti-1&&(null==s[r+1]&&(s[r+1]=0),s[r+1]+=s[r]/i|0,s[r]%=i)}return s.reverse()}return function(i,n,r,o,s){var a,h,u,p,c,f,m,g,y=i.indexOf("."),v=d,b=_;for(y>=0&&(p=k,k=0,i=i.replace(".",""),f=(g=new C(n)).pow(i.length-y),k=p,g.c=e(iU(iN(f.c),f.e,"0"),10,r,t),g.e=g.c.length),u=p=(m=e(i,n,r,s?(a=x,t):(a=t,x))).length;0==m[--p];m.pop());if(!m[0])return a.charAt(0);if(y<0?--u:(f.c=m,f.e=u,f.s=o,m=(f=l(f,g,v,b,r)).c,c=f.r,u=f.e),y=m[h=u+v+1],p=r/2,c=c||h<0||null!=m[h+1],c=b<4?(null!=y||c)&&(0==b||b==(f.s<0?3:2)):y>p||y==p&&(4==b||c||6==b&&1&m[h-1]||b==(f.s<0?8:7)),h<1||!m[0])i=c?iU(a.charAt(1),-v,a.charAt(0)):a.charAt(0);else{if(m.length=h,c)for(--r;++m[--h]>r;)m[h]=0,h||(++u,m=[1].concat(m));for(p=m.length;!m[--p];);for(y=0,i="";y<=p;i+=a.charAt(m[y++]));i=iU(i,u,a.charAt(0))}return i}}(),l=function(){function t(t,e,i){var n,r,o,s,a=0,l=t.length,h=e%1e7,u=e/1e7|0;for(t=t.slice();l--;)n=u*(o=t[l]%1e7)+(s=t[l]/1e7|0)*h,a=((r=h*o+n%1e7*1e7+a)/i|0)+(n/1e7|0)+u*s,t[l]=r%i;return a&&(t=[a].concat(t)),t}function e(t,e,i,n){var r,o;if(i!=n)o=i>n?1:-1;else for(r=o=0;re[r]?1:-1;break}return o}function i(t,e,i,n){for(var r=0;i--;)t[i]-=r,r=+(t[i]1;t.splice(0,1));}return function(n,r,o,s,a){var l,h,u,p,c,d,_,f,m,g,y,v,b,k,M,x,w,P=n.s==r.s?1:-1,E=n.c,T=r.c;if(!E||!E[0]||!T||!T[0])return new C(!n.s||!r.s||(E?T&&E[0]==T[0]:!T)?NaN:E&&0==E[0]||!T?0*P:P/0);for(m=(f=new C(P)).c=[],P=o+(h=n.e-r.e)+1,a||(a=1e14,h=iz(n.e/14)-iz(r.e/14),P=P/14|0),u=0;T[u]==(E[u]||0);u++);if(T[u]>(E[u]||0)&&h--,P<0)m.push(1),p=!0;else{for(k=E.length,x=T.length,u=0,P+=2,(c=iD(a/(T[0]+1)))>1&&(T=t(T,c,a),E=t(E,c,a),x=T.length,k=E.length),b=x,y=(g=E.slice(0,x)).length;y=a/2&&M++;do{if(c=0,(l=e(T,g,x,y))<0){if(v=g[0],x!=y&&(v=v*a+(g[1]||0)),(c=iD(v/M))>1)for(c>=a&&(c=a-1),_=(d=t(T,c,a)).length,y=g.length;1==e(d,g,_,y);)c--,i(d,x<_?w:T,_,a),_=d.length,l=1;else 0==c&&(l=c=1),_=(d=T.slice()).length;if(_e(T,g,x,y);)c++,i(g,x=10;P/=10,u++);S(f,o+(f.e=u+14*h-1)+1,s,p)}else f.e=h,f.r=+p;return f}}(),n=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,o=/^\.([^.]+)$/,s=/^-?(Infinity|NaN)$/,a=/^\s*\+(?=[\w.])|^\s+|\s+$/g,u=function(t,e,i,l){var h,u=i?e:e.replace(a,"");if(s.test(u))t.s=isNaN(u)?null:u<0?-1:1;else{if(!i&&(u=u.replace(n,function(t,e,i){return h="x"==(i=i.toLowerCase())?16:"b"==i?2:8,l&&l!=h?t:e}),l&&(h=l,u=u.replace(r,"$1").replace(o,"0.$1")),e!=u))return new C(u,h);if(C.DEBUG)throw Error(iR+"Not a"+(l?" base "+l:"")+" number: "+e);t.s=null}t.c=t.e=null},p.absoluteValue=p.abs=function(){var t=new C(this);return t.s<0&&(t.s=1),t},p.comparedTo=function(t,e){return ij(this,new C(t,e))},p.decimalPlaces=p.dp=function(t,e){var i,n,r;if(null!=t)return iG(t,0,1e9),null==e?e=_:iG(e,0,8),S(new C(this),t+this.e+1,e);if(!(i=this.c))return null;if(n=((r=i.length-1)-iz(this.e/14))*14,r=i[r])for(;r%10==0;r/=10,n--);return n<0&&(n=0),n},p.dividedBy=p.div=function(t,e){return l(this,new C(t,e),d,_)},p.dividedToIntegerBy=p.idiv=function(t,e){return l(this,new C(t,e),0,1)},p.exponentiatedBy=p.pow=function(t,e){var i,n,r,o,s,a,l,h,u,p=this;if((t=new C(t)).c&&!t.isInteger())throw Error(iR+"Exponent not an integer: "+B(t));if(null!=e&&(e=new C(e)),a=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return u=new C(Math.pow(+B(p),a?t.s*(2-iZ(t)):+B(t))),e?u.mod(e):u;if(l=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new C(NaN);(n=!l&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return o=p.s<0&&iZ(t)?-0:0,p.e>-1&&(o=1/o),new C(l?1/o:o);k&&(o=iO(k/14+2))}for(a?(i=new C(.5),l&&(t.s=1),h=iZ(t)):h=(r=Math.abs(+B(t)))%2,u=new C(c);;){if(h){if(!(u=u.times(p)).c)break;o?u.c.length>o&&(u.c.length=o):n&&(u=u.mod(e))}if(r){if(0===(r=iD(r/2)))break;h=r%2}else if(S(t=t.times(i),t.e+1,1),t.e>14)h=iZ(t);else{if(0==(r=+B(t)))break;h=r%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(e))}return n?u:(l&&(u=c.div(u)),e?u.mod(e):o?S(u,k,_,s):u)},p.integerValue=function(t){var e=new C(this);return null==t?t=_:iG(t,0,8),S(e,e.e+1,t)},p.isEqualTo=p.eq=function(t,e){return 0===ij(this,new C(t,e))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(t,e){return ij(this,new C(t,e))>0},p.isGreaterThanOrEqualTo=p.gte=function(t,e){return 1===(e=ij(this,new C(t,e)))||0===e},p.isInteger=function(){return!!this.c&&iz(this.e/14)>this.c.length-2},p.isLessThan=p.lt=function(t,e){return 0>ij(this,new C(t,e))},p.isLessThanOrEqualTo=p.lte=function(t,e){return -1===(e=ij(this,new C(t,e)))||0===e},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(t,e){var i,n,r,o,s=this.s;if(e=(t=new C(t,e)).s,!s||!e)return new C(NaN);if(s!=e)return t.s=-e,this.plus(t);var a=this.e/14,l=t.e/14,h=this.c,u=t.c;if(!a||!l){if(!h||!u)return h?(t.s=-e,t):new C(u?this:NaN);if(!h[0]||!u[0])return u[0]?(t.s=-e,t):new C(h[0]?this:3==_?-0:0)}if(a=iz(a),l=iz(l),h=h.slice(),s=a-l){for((o=s<0)?(s=-s,r=h):(l=a,r=u),r.reverse(),e=s;e--;r.push(0));r.reverse()}else for(n=(o=(s=h.length)<(e=u.length))?s:e,s=e=0;e0)for(;e--;h[i++]=0);for(e=1e14-1;n>s;){if(h[--n]=0;){for(i=0,c=m[r]%1e7,d=m[r]/1e7|0,o=r+(s=l);o>r;)a=d*(h=f[--s]%1e7)+(u=f[s]/1e7|0)*c,i=((h=c*h+a%1e7*1e7+_[o]+i)/1e14|0)+(a/1e7|0)+d*u,_[o--]=h%1e14;_[o]=i}return i?++n:_.splice(0,1),T(t,_,n)},p.negated=function(){var t=new C(this);return t.s=-t.s||null,t},p.plus=function(t,e){var i,n=this.s;if(e=(t=new C(t,e)).s,!n||!e)return new C(NaN);if(n!=e)return t.s=-e,this.minus(t);var r=this.e/14,o=t.e/14,s=this.c,a=t.c;if(!r||!o){if(!s||!a)return new C(n/0);if(!s[0]||!a[0])return a[0]?t:new C(s[0]?this:0*n)}if(r=iz(r),o=iz(o),s=s.slice(),n=r-o){for(n>0?(o=r,i=a):(n=-n,i=s),i.reverse();n--;i.push(0));i.reverse()}for((n=s.length)-(e=a.length)<0&&(i=a,a=s,s=i,e=n),n=0;e;)n=(s[--e]=s[e]+a[e]+n)/1e14|0,s[e]=1e14===s[e]?0:s[e]%1e14;return n&&(s=[n].concat(s),++o),T(t,s,o)},p.precision=p.sd=function(t,e){var i,n,r;if(null!=t&&!!t!==t)return iG(t,1,1e9),null==e?e=_:iG(e,0,8),S(new C(this),t,e);if(!(i=this.c))return null;if(n=14*(r=i.length-1)+1,r=i[r]){for(;r%10==0;r/=10,n--);for(r=i[0];r>=10;r/=10,n++);}return t&&this.e+1>n&&(n=this.e+1),n},p.shiftedBy=function(t){return iG(t,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+t)},p.squareRoot=p.sqrt=function(){var t,e,i,n,r,o=this.c,s=this.s,a=this.e,h=d+4,u=new C("0.5");if(1!==s||!o||!o[0])return new C(!s||s<0&&(!o||o[0])?NaN:o?this:1/0);if(0==(s=Math.sqrt(+B(this)))||s==1/0?(((e=iN(o)).length+a)%2==0&&(e+="0"),s=Math.sqrt(+e),a=iz((a+1)/2)-(a<0||a%2),i=new C(e=s==1/0?"5e"+a:(e=s.toExponential()).slice(0,e.indexOf("e")+1)+a)):i=new C(s+""),i.c[0]){for((s=(a=i.e)+h)<3&&(s=0);;)if(r=i,i=u.times(r.plus(l(this,r,h,1))),iN(r.c).slice(0,s)===(e=iN(i.c)).slice(0,s))if(i.e0&&d>0){for(r=d%s||s,h=c.substr(0,r);r0&&(h+=l+c.slice(r)),p&&(h="-"+h)}n=u?h+(i.decimalSeparator||"")+((a=+i.fractionGroupSize)?u.replace(RegExp("\\d{"+a+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):u):h}return(i.prefix||"")+n+(i.suffix||"")},p.toFraction=function(t){var e,i,n,r,o,s,a,h,u,p,d,f,m=this.c;if(null!=t&&(!(a=new C(t)).isInteger()&&(a.c||1!==a.s)||a.lt(c)))throw Error(iR+"Argument "+(a.isInteger()?"out of range: ":"not an integer: ")+B(a));if(!m)return new C(this);for(e=new C(c),u=i=new C(c),n=h=new C(c),f=iN(m),o=e.e=f.length-this.e-1,e.c[0]=iA[(s=o%14)<0?14+s:s],t=!t||a.comparedTo(e)>0?o>0?e:u:a,s=y,y=1/0,a=new C(f),h.c[0]=0;p=l(a,e,0,1),1!=(r=i.plus(p.times(n))).comparedTo(t);)i=n,n=r,u=h.plus(p.times(r=u)),h=r,e=a.minus(p.times(r=e)),a=r;return r=l(t.minus(i),n,0,1),h=h.plus(r.times(u)),i=i.plus(r.times(n)),h.s=u.s=this.s,o*=2,d=1>l(u,n,o,_).minus(this).abs().comparedTo(l(h,i,o,_).minus(this).abs())?[u,n]:[h,i],y=s,d},p.toNumber=function(){return+B(this)},p.toPrecision=function(t,e){return null!=t&&iG(t,1,1e9),P(this,t,e,2)},p.toString=function(t){var e,i=this,n=i.s,r=i.e;return null===r?n?(e="Infinity",n<0&&(e="-"+e)):e="NaN":(null==t?e=r<=f||r>=m?iF(iN(i.c),r):iU(iN(i.c),r,"0"):10===t&&w?e=iU(iN((i=S(new C(i),d+r+1,_)).c),i.e,"0"):(iG(t,2,x.length,"Base"),e=h(iU(iN(i.c),r,"0"),10,t,n,!0)),n<0&&i.c[0]&&(e="-"+e)),e},p.valueOf=p.toJSON=function(){return B(this)},p._isBigNumber=!0,p[Symbol.toStringTag]="BigNumber",p[Symbol.for("nodejs.util.inspect.custom")]=p.valueOf,null!=e&&C.set(e),C}(),iH=class{key;left=null;right=null;constructor(t){this.key=t}},iq=class extends iH{constructor(t){super(t)}},iK=class{size=0;modificationCount=0;splayCount=0;splay(t){let e=this.root;if(null==e)return this.compare(t,t),-1;let i=null,n=null,r=null,o=null,s=e,a=this.compare,l;for(;;)if((l=a(s.key,t))>0){let e=s.left;if(null==e||(l=a(e.key,t))>0&&(s.left=e.right,e.right=s,null==(e=(s=e).left)))break;null==i?n=s:i.left=s,i=s,s=e}else if(l<0){let e=s.right;if(null==e||(l=a(e.key,t))<0&&(s.right=e.left,e.left=s,null==(e=(s=e).right)))break;null==r?o=s:r.right=s,r=s,s=e}else break;return null!=r&&(r.right=s.left,s.left=o),null!=i&&(i.left=s.right,s.right=n),this.root!==s&&(this.root=s,this.splayCount++),l}splayMin(t){let e=t,i=e.left;for(;null!=i;){let t=i;e.left=t.right,t.right=e,i=(e=t).left}return e}splayMax(t){let e=t,i=e.right;for(;null!=i;){let t=i;e.right=t.left,t.left=e,i=(e=t).right}return e}_delete(t){if(null==this.root||0!=this.splay(t))return null;let e=this.root,i=e,n=e.left;if(this.size--,null==n)this.root=e.right;else{let t=e.right;(e=this.splayMax(n)).right=t,this.root=e}return this.modificationCount++,i}addNewRoot(t,e){this.size++,this.modificationCount++;let i=this.root;if(null==i){this.root=t;return}e<0?(t.left=i,t.right=i.right,i.right=null):(t.right=i,t.left=i.left,i.left=null),this.root=t}_first(){let t=this.root;return null==t?null:(this.root=this.splayMin(t),this.root)}_last(){let t=this.root;return null==t?null:(this.root=this.splayMax(t),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(t){return this.validKey(t)&&0==this.splay(t)}defaultCompare(){return(t,e)=>te)}wrap(){return{getRoot:()=>this.root,setRoot:t=>{this.root=t},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:t=>{this.splayCount=t},splay:t=>this.splay(t),has:t=>this.has(t)}}},iW=class t extends iK{root=null;compare;validKey;constructor(t,e){super(),this.compare=t??this.defaultCompare(),this.validKey=e??(t=>null!=t&&null!=t)}delete(t){return!!this.validKey(t)&&null!=this._delete(t)}deleteAll(t){for(let e of t)this.delete(e)}forEach(t){let e=this[Symbol.iterator](),i;for(;!(i=e.next()).done;)t(i.value,i.value,this)}add(t){let e=this.splay(t);return 0!=e&&this.addNewRoot(new iq(t),e),this}addAndReturn(t){let e=this.splay(t);return 0!=e&&this.addNewRoot(new iq(t),e),this.root.key}addAll(t){for(let e of t)this.add(e)}isEmpty(){return null==this.root}isNotEmpty(){return null!=this.root}single(){if(0==this.size)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(0==this.size)throw"Bad state: No element";return this._first().key}last(){if(0==this.size)throw"Bad state: No element";return this._last().key}lastBefore(t){if(null==t)throw"Invalid arguments(s)";if(null==this.root)return null;if(0>this.splay(t))return this.root.key;let e=this.root.left;if(null==e)return null;let i=e.right;for(;null!=i;)i=(e=i).right;return e.key}firstAfter(t){if(null==t)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(t)>0)return this.root.key;let e=this.root.right;if(null==e)return null;let i=e.left;for(;null!=i;)i=(e=i).left;return e.key}retainAll(e){let i=new t(this.compare,this.validKey),n=this.modificationCount;for(let t of e){if(n!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(t)&&0==this.splay(t)&&i.add(this.root.key)}i.size!=this.size&&(this.root=i.root,this.size=i.size,this.modificationCount++)}lookup(t){return this.validKey(t)&&0==this.splay(t)?this.root.key:null}intersection(e){let i=new t(this.compare,this.validKey);for(let t of this)e.has(t)&&i.add(t);return i}difference(e){let i=new t(this.compare,this.validKey);for(let t of this)e.has(t)||i.add(t);return i}union(t){let e=this.clone();return e.addAll(t),e}clone(){let e=new t(this.compare,this.validKey);return e.size=this.size,e.root=this.copyNode(this.root),e}copyNode(t){if(null==t)return null;let e=new iq(t.key);return function t(e,i){let n,r;do{if(n=e.left,r=e.right,null!=n){let e=new iq(n.key);i.left=e,t(n,e)}if(null!=r){let t=new iq(r.key);i.right=t,e=r,i=t}}while(null!=r)}(t,e),e}toSet(){return this.clone()}entries(){return new iJ(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[Symbol.iterator](){return new iX(this.wrap())}[Symbol.toStringTag]="[object Set]"},iY=class{tree;path=[];modificationCount=null;splayCount;constructor(t){this.tree=t,this.splayCount=t.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;let t=this.path[this.path.length-1];return this.getValue(t)}rebuildPath(t){this.path.splice(0,this.path.length),this.tree.splay(t),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(t){for(;null!=t;)this.path.push(t),t=t.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(null==this.modificationCount){this.modificationCount=this.tree.getModificationCount();let t=this.tree.getRoot();for(;null!=t;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let t=this.path[this.path.length-1],e=t.right;if(null!=e){for(;null!=e;)this.path.push(e),e=e.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===t;)t=this.path.pop();return this.path.length>0}},iX=class extends iY{getValue(t){return t.key}},iJ=class extends iY{getValue(t){return[t.key,t.key]}},i$=t=>()=>t,iQ=t=>{let e=t?(e,i)=>i.minus(e).abs().isLessThanOrEqualTo(t):i$(!1);return(t,i)=>e(t,i)?0:t.comparedTo(i)},i0=t=>t,i1=t=>{let e;return{set:t=>{i2=i1(t)},reset:()=>i1(t),compare:iQ(t),snap:(t=>{if(t){let e=new iW(iQ(t)),i=new iW(iQ(t)),n=t=>{let n,r;return{x:(n=t.x,e.addAndReturn(n)),y:(r=t.y,i.addAndReturn(r))}};return n({x:new iV(0),y:new iV(0)}),n}return i0})(t),orient:(e=t?(e,i,n,r,o)=>e.exponentiatedBy(2).isLessThanOrEqualTo(r.minus(i).exponentiatedBy(2).plus(o.minus(n).exponentiatedBy(2)).times(t)):i$(!1),(t,i,n)=>{let r=t.x,o=t.y,s=n.x,a=n.y,l=o.minus(a).times(i.x.minus(s)).minus(r.minus(s).times(i.y.minus(a)));return e(l,r,o,s,a)?0:l.comparedTo(0)})}},i2=i1(),i3=(t,e)=>t.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(t.ur.x)&&t.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(t.ur.y),i4=(t,e)=>{if(e.ur.x.isLessThan(t.ll.x)||t.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(t.ll.y)||t.ur.y.isLessThan(e.ll.y))return null;let i=t.ll.x.isLessThan(e.ll.x)?e.ll.x:t.ll.x,n=t.ur.x.isLessThan(e.ur.x)?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y.isLessThan(e.ll.y)?e.ll.y:t.ll.y},ur:{x:n,y:t.ur.y.isLessThan(e.ur.y)?t.ur.y:e.ur.y}}},i8=(t,e)=>t.x.times(e.y).minus(t.y.times(e.x)),i5=(t,e)=>t.x.times(e.x).plus(t.y.times(e.y)),i6=t=>i5(t,t).sqrt(),i9=(t,e,i)=>e.y.isZero()?null:{x:t.x.plus(e.x.div(e.y).times(i.minus(t.y))),y:i},i7=(t,e,i)=>e.x.isZero()?null:{x:i,y:t.y.plus(e.y.div(e.x).times(i.minus(t.x)))},nt=class t{point;isLeft;segment;otherSE;consumedBy;static compare(e,i){let n=t.comparePoints(e.point,i.point);return 0!==n?n:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:na.compare(e.segment,i.segment))}static comparePoints(t,e){return t.x.isLessThan(e.x)?-1:t.x.isGreaterThan(e.x)?1:t.y.isLessThan(e.y)?-1:+!!t.y.isGreaterThan(e.y)}constructor(t,e){void 0===t.events?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw Error("Tried to link already linked events");let e=t.point.events;for(let t=0,i=e.length;t{var n,r,o,s,a,l;let h,u,p,c,d=i.otherSE;e.set(i,{sine:(n=this.point,r=t.point,o=d.point,h={x:r.x.minus(n.x),y:r.y.minus(n.y)},i8(u={x:o.x.minus(n.x),y:o.y.minus(n.y)},h).div(i6(u)).div(i6(h))),cosine:(s=this.point,a=t.point,l=d.point,p={x:a.x.minus(s.x),y:a.y.minus(s.y)},i5(c={x:l.x.minus(s.x),y:l.y.minus(s.y)},p).div(i6(c)).div(i6(p)))})};return(t,n)=>{e.has(t)||i(t),e.has(n)||i(n);let{sine:r,cosine:o}=e.get(t),{sine:s,cosine:a}=e.get(n);return r.isGreaterThanOrEqualTo(0)&&s.isGreaterThanOrEqualTo(0)?o.isLessThan(a)?1:o.isGreaterThan(a)?-1:0:r.isLessThan(0)&&s.isLessThan(0)?o.isLessThan(a)?-1:+!!o.isGreaterThan(a):s.isLessThan(r)?-1:+!!s.isGreaterThan(r)}}},ne=class t{events;poly;_isExteriorRing;_enclosingRing;static factory(e){let i=[];for(let n=0,r=e.length;n0&&(t=i)}let e=t.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut?.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut?.enclosingRing();i=(e=i.prevInResult())?e.prevInResult():null}}},ni=class{exteriorRing;interiorRings;constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){let t=this.exteriorRing.getGeom();if(null===t)return null;let e=[t];for(let t=0,i=this.interiorRings.length;t=nt.comparePoints(o,s)?o:s,this.queue.delete(e.rightSE),i.push(e.rightSE);let n=e.split(t);for(let t=0,e=n.length;t0?(this.tree.delete(e),i.push(t)):(this.segments.push(e),e.prev=n)}else{if(n&&r){let t=n.getIntersection(r);if(null!==t){if(!n.isAnEndpoint(t)){let e=this._splitSafely(n,t);for(let t=0,n=e.length;t0)return -1;let n=e.comparePoint(t.rightSE.point);return 0!==n?n:-1}if(i.isGreaterThan(n)){if(s.isLessThan(a)&&s.isLessThan(h))return -1;if(s.isGreaterThan(a)&&s.isGreaterThan(h))return 1;let i=e.comparePoint(t.leftSE.point);if(0!==i)return i;let n=t.comparePoint(e.rightSE.point);return n<0?1:n>0?-1:1}if(s.isLessThan(a))return -1;if(s.isGreaterThan(a))return 1;if(r.isLessThan(o)){let i=e.comparePoint(t.rightSE.point);if(0!==i)return i}if(r.isGreaterThan(o)){let i=t.comparePoint(e.rightSE.point);if(i<0)return 1;if(i>0)return -1}if(!r.eq(o)){let t=l.minus(s),e=r.minus(i),u=h.minus(a),p=o.minus(n);if(t.isGreaterThan(e)&&u.isLessThan(p))return 1;if(t.isLessThan(e)&&u.isGreaterThan(p))return -1}return r.isGreaterThan(o)?1:r.isLessThan(o)||l.isLessThan(h)?-1:l.isGreaterThan(h)?1:t.ide.id)}constructor(t,e,i,n){this.id=++ns,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=i,this.windings=n}static fromRing(e,i,n){let r,o,s,a=nt.comparePoints(e,i);if(a<0)r=e,o=i,s=1;else if(a>0)r=i,o=e,s=-1;else throw Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);return new t(new nt(r,!0),new nt(o,!1),[n],[s])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t.isLessThan(e)?t:e},ur:{x:this.rightSE.point.x,y:t.isGreaterThan(e)?t:e}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(t){return t.x.eq(this.leftSE.point.x)&&t.y.eq(this.leftSE.point.y)||t.x.eq(this.rightSE.point.x)&&t.y.eq(this.rightSE.point.y)}comparePoint(t){return i2.orient(this.leftSE.point,t,this.rightSE.point)}getIntersection(t){let e=this.bbox(),i=t.bbox(),n=i4(e,i);if(null===n)return null;let r=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,l=i3(e,s)&&0===this.comparePoint(s),h=i3(i,r)&&0===t.comparePoint(r),u=i3(e,a)&&0===this.comparePoint(a),p=i3(i,o)&&0===t.comparePoint(o);if(h&&l)return p&&!u?o:!p&&u?a:null;if(h)return u&&r.x.eq(a.x)&&r.y.eq(a.y)?null:r;if(l)return p&&o.x.eq(s.x)&&o.y.eq(s.y)?null:s;if(p&&u)return null;if(p)return o;if(u)return a;let c=((t,e,i,n)=>{if(e.x.isZero())return i7(i,n,t.x);if(n.x.isZero())return i7(t,e,i.x);if(e.y.isZero())return i9(i,n,t.y);if(n.y.isZero())return i9(t,e,i.y);let r=i8(e,n);if(r.isZero())return null;let o={x:i.x.minus(t.x),y:i.y.minus(t.y)},s=i8(o,e).div(r),a=i8(o,n).div(r),l=t.x.plus(a.times(e.x)),h=i.x.plus(s.times(n.x)),u=t.y.plus(a.times(e.y)),p=i.y.plus(s.times(n.y));return{x:l.plus(h).div(2),y:u.plus(p).div(2)}})(r,this.vector(),s,t.vector());return null!==c&&i3(n,c)?i2.snap(c):null}split(e){let i=[],n=void 0!==e.events,r=new nt(e,!0),o=new nt(e,!1),s=this.rightSE;this.replaceRightSE(o),i.push(o),i.push(r);let a=new t(r,s,this.rings.slice(),this.windings.slice());return nt.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),nt.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),i}swapEvents(){let t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,e=this.windings.length;t0){let t=i;i=n,n=t}if(i.prev===n){let t=i;i=n,n=t}for(let t=0,e=n.rings.length;t1===t.length&&t[0].isSubject;this._isInResult=i(t)!==i(e)}}return this._isInResult}},nl=class{poly;isExterior;segments;bbox;constructor(t,e,i){if(!Array.isArray(t)||0===t.length||(this.poly=e,this.isExterior=i,this.segments=[],"number"!=typeof t[0][0]||"number"!=typeof t[0][1]))throw Error("Input geometry is not a valid Polygon or MultiPolygon");let n=i2.snap({x:new iV(t[0][0]),y:new iV(t[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let e=1,i=t.length;e{this._fireCut(e,t,e),this._fireCut(this._map,t,e),e.pm._fireEdit()}),this._editedLayers=[];let i=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(i))},cut(t){let e=this._map._layers,i=t._latlngInfos||[];Object.keys(e).map(t=>e[t]).filter(t=>t.pm).filter(t=>!t._pmTempLayer).filter(t=>!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore).filter(t=>t instanceof L.Polyline).filter(e=>e!==t).filter(t=>t.pm.options.allowCutting).filter(t=>!(this.options.layersToCut&&L.Util.isArray(this.options.layersToCut))||!(this.options.layersToCut.length>0)||this.options.layersToCut.indexOf(t)>-1).filter(t=>!this._layerGroup.hasLayer(t)).filter(e=>{try{var i,n;let r,o,s,a=!!eV(t.toGeoJSON(15),e.toGeoJSON(15)).features.length>0;return a||e instanceof L.Polyline&&!(e instanceof L.Polygon)?a:(i=t.toGeoJSON(15),n=e.toGeoJSON(15),r=nc(i),o=nc(n),s=((t,...e)=>no.run("intersection",t,e))(r.coordinates,o.coordinates),0!==s.length&&(1===s.length?!!n_(s[0]):!!nf(s)))}catch{return e instanceof L.Polygon&&console.error("You can't cut polygons with self-intersections"),!1}}).forEach(e=>{let n;if(e instanceof L.Polygon){let t=(n=L.polygon(e.getLatLngs())).getLatLngs();i.forEach(e=>{if(e&&e.snapInfo){let{latlng:i}=e,r=this._calcClosestLayer(i,[n]);if(r&&r.segment&&r.distance1?(0,iS.default)(t,r):t).splice(o,0,i)}}}})}else n=e;let r=this._cutLayer(t,n),o=L.geoJSON(r,e.options);1===o.getLayers().length&&([o]=o.getLayers()),this._setPane(o,"layerPane");let s=o.addTo(this._map.pm._getContainingLayer());if(s.pm.enable(e.pm.options),s.pm.disable(),e._pmTempLayer=!0,t._pmTempLayer=!0,e.remove(),e.removeFrom(this._map.pm._getContainingLayer()),t.remove(),t.removeFrom(this._map.pm._getContainingLayer()),s.getLayers&&0===s.getLayers().length&&this._map.pm.removeLayer({target:s}),s instanceof L.LayerGroup&&s.eachLayer(t=>{this._addDrawnLayerProp(t)}),this._addDrawnLayerProp(s),this.options.layersToCut&&L.Util.isArray(this.options.layersToCut)&&this.options.layersToCut.length>0){let t=this.options.layersToCut.indexOf(e);t>-1&&this.options.layersToCut.splice(t,1)}this._editedLayers.push({layer:s,originalLayer:e})})},_cutLayer(t,e){var i,n,r;let o=L.geoJSON(),s;if(e instanceof L.Polygon){let r,o,a;i=e.toGeoJSON(15),n=t.toGeoJSON(15),r=nc(i),o=nc(n),s=0===(a=((t,...e)=>no.run("difference",t,e))(r.coordinates,o.coordinates)).length?null:1===a.length?n_(a[0]):nf(a)}else{let i,n,a,l,h=((r=e)instanceof L.Polyline&&(r=r.toGeoJSON(15)),a=function t(e){return Array.isArray(e)?1+t(e[0]):-1}(n=nd(r)),l=[],a>1?n.forEach(t=>{l.push(np({type:"LineString",coordinates:t}))}):l.push(r),l);h.forEach(e=>{let i=ia(e,t.toGeoJSON(15));(i&&i.features.length>0?L.geoJSON(i):L.geoJSON(e)).getLayers().forEach(e=>{iT(t.toGeoJSON(15),e.toGeoJSON(15))||e.addTo(o)})}),s=h.length>1?(i=[],o.eachLayer(t=>{i.push(nd(t.toGeoJSON(15)))}),np({type:"MultiLineString",coordinates:i})):o.toGeoJSON(15)}return s},_change:L.Util.falseFn}),eM.Text=eM.extend({initialize(t){this._map=t,this._shape="Text",this.toolbarButtonName="drawText"},enable(t){L.Util.setOptions(this,t),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.marker(this._map.getCenter(),{interactive:!1,zIndexOffset:100,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(eh("tooltips.placeText"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this._map.getContainer().classList.add("geoman-draw-cursor"),this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.off("click",this._createMarker,this),this._hintMarker?.remove(),this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("mousemove",this._syncHintMarker,this),this._map.off("mousemove",this._showHintMarkerAfterMoving,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},_syncHintMarker(t){this._hintMarker.setLatLng(t.latlng),this.options.snappable&&(t.target=this._hintMarker,this._handleSnapping(t))},_createMarker(t){if(!t.latlng||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng();if(this.textArea=this._createTextArea(),this.options.textOptions?.className){let t=this.options.textOptions.className.split(" ");this.textArea.classList.add(...t)}let i=this._createTextIcon(this.textArea),n=new L.Marker(e,{textMarker:!0,_textMarkerOverPM:!0,icon:i});if(this._setPane(n,"markerPane"),this._finishLayer(n),n.pm||(n.options.draggable=!1),n.addTo(this._map.pm._getContainingLayer()),n.pm){n.pm.textArea=this.textArea,L.setOptions(n.pm,{removeIfEmpty:this.options.textOptions?.removeIfEmpty??!0});let t=this.options.textOptions?.focusAfterDraw??!0;n.pm._createTextMarker(t),this.options.textOptions?.text&&n.pm.setText(this.options.textOptions.text)}this._fireCreate(n),this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this._map.once("mousemove",this._showHintMarkerAfterMoving,this)},_showHintMarkerAfterMoving(t){this.enable(),this._hintMarker.setLatLng(t.latlng)},_createTextArea(){let t=document.createElement("textarea");return t.readOnly=!0,t.classList.add("pm-textarea","pm-disabled"),t},_createTextIcon:t=>L.divIcon({className:"pm-text-marker",html:t})});var nm=u(ee());function ng(t,e){e instanceof L.Layer&&(e=e.getLatLng());let i=t.getMaxZoom();return i===1/0&&(i=t.getZoom()),t.project(e,i)}function ny(t,e){let i=t.getMaxZoom();return i===1/0&&(i=t.getZoom()),t.unproject(e,i)}var nv=L.Class.extend({includes:[{enableLayerDrag(){if(!this.options.draggable||!this._layer._map)return;this.disable(),this._layerDragEnabled=!0,this._map||(this._map=this._layer._map),(this._layer instanceof L.Marker||this._layer instanceof L.ImageOverlay)&&L.DomEvent.on(this._getDOMElem(),"dragstart",this._stopDOMImageDrag),this._layer.dragging&&this._layer.dragging.disable(),this._tempDragCoord=null,eg(this._layer)instanceof L.Canvas?(this._layer.on("mouseout",this.removeDraggingClass,this),this._layer.on("mouseover",this.addDraggingClass,this)):this.addDraggingClass(),this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!0;let t=this._getDOMElem();t&&(eg(this._layer)instanceof L.Canvas?(this._layer.on("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._addTouchEvents(t)):L.DomEvent.on(t,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._fireDragEnable()},disableLayerDrag(){this._layerDragEnabled=!1,eg(this._layer)instanceof L.Canvas?(this._layer.off("mouseout",this.removeDraggingClass,this),this._layer.off("mouseover",this.addDraggingClass,this)):this.removeDraggingClass(),this._originalMapDragState&&this._dragging&&this._map.dragging.enable(),this._safeToCacheDragState=!1,this._layer.dragging&&this._layer.dragging.disable();let t=this._getDOMElem();t&&(eg(this._layer)instanceof L.Canvas?(this._layer.off("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._removeTouchEvents(t)):L.DomEvent.off(t,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._layerDragged&&this._fireUpdate(),this._layerDragged=!1,this._fireDragDisable()},dragging(){return this._dragging},layerDragEnabled(){return!!this._layerDragEnabled},_simulateMouseDownEvent(t){let e=t.touches?t.touches[0]:t,i={originalEvent:e,target:this._layer};return i.containerPoint=this._map.mouseEventToContainerPoint(e),i.latlng=this._map.containerPointToLatLng(i.containerPoint),this._dragMixinOnMouseDown(i),!1},_simulateMouseMoveEvent(t){let e=t.touches?t.touches[0]:t,i={originalEvent:e,target:this._layer};return i.containerPoint=this._map.mouseEventToContainerPoint(e),i.latlng=this._map.containerPointToLatLng(i.containerPoint),this._dragMixinOnMouseMove(i),!1},_simulateMouseUpEvent(t){let e={originalEvent:t.touches?t.touches[0]:t,target:this._layer};return -1===t.type.indexOf("touch")&&(e.containerPoint=this._map.mouseEventToContainerPoint(t),e.latlng=this._map.containerPointToLatLng(e.containerPoint)),this._dragMixinOnMouseUp(e),!1},_dragMixinOnMouseDown(t){if(t.originalEvent.button>0)return;this._overwriteEventIfItComesFromMarker(t);let e=t._fromLayerSync,i=this._syncLayers("_dragMixinOnMouseDown",t);if(this._layer instanceof L.Marker&&(!this.options.snappable||e||i?this._disableSnapping():this._initSnappableMarkers()),this._layer instanceof L.CircleMarker){let t="resizeableCircleMarker";this._layer instanceof L.Circle&&(t="resizeableCircle"),!this.options.snappable||e||i?this._layer.pm.options[t]?this._layer.pm._disableSnapping():this._layer.pm._disableSnappingDrag():this._layer.pm.options[t]||this._initSnappableMarkersDrag()}this._safeToCacheDragState&&(this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!1),this._tempDragCoord=t.latlng,L.DomEvent.on(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),L.DomEvent.on(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this)},_dragMixinOnMouseMove(t){this._overwriteEventIfItComesFromMarker(t);let e=this._getDOMElem();this._syncLayers("_dragMixinOnMouseMove",t),this._dragging||(this._dragging=!0,L.DomUtil.addClass(e,"leaflet-pm-dragging"),this._layer instanceof L.Marker||this._layer.bringToFront(),this._originalMapDragState&&this._map.dragging.disable(),this._fireDragStart()),this._tempDragCoord||(this._tempDragCoord=t.latlng),this._onLayerDrag(t),this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle()},_dragMixinOnMouseUp(t){let e=this._getDOMElem();return this._syncLayers("_dragMixinOnMouseUp",t),this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0,L.DomEvent.off(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this),L.DomEvent.off(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),!!this._dragging&&(this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle(),this._layerDragged=!0,window.setTimeout(()=>{this._dragging=!1,e&&L.DomUtil.removeClass(e,"leaflet-pm-dragging"),this._fireDragEnd(),this._fireEdit(),this._layerEdited=!0},10),!0)},_onLayerDrag(t){let{latlng:e}=t,i={lat:e.lat-this._tempDragCoord.lat,lng:e.lng-this._tempDragCoord.lng},n=t=>t.map(t=>{if(Array.isArray(t))return n(t);let e={lat:t.lat+i.lat,lng:t.lng+i.lng};return(t.alt||0===t.alt)&&(e.alt=t.alt),e});if(this._layer instanceof L.Circle&&this._layer.options.resizeableCircle||this._layer instanceof L.CircleMarker&&this._layer.options.resizeableCircleMarker){let t=n([this._layer.getLatLng()]);this._layer.setLatLng(t[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.CircleMarker||this._layer instanceof L.Marker){let t=this._layer.getLatLng();this._layer._snapped&&(t=this._layer._orgLatLng);let e=n([t]);this._layer.setLatLng(e[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.ImageOverlay){let t=n([this._layer.getBounds().getNorthWest(),this._layer.getBounds().getSouthEast()]);this._layer.setBounds(t),this._fireChange(this._layer.getBounds(),"Edit")}else{let t=n(this._layer.getLatLngs());this._layer.setLatLngs(t),this._fireChange(this._layer.getLatLngs(),"Edit")}this._tempDragCoord=e,t.layer=this._layer,this._fireDrag(t)},addDraggingClass(){let t=this._getDOMElem();t&&L.DomUtil.addClass(t,"leaflet-pm-draggable")},removeDraggingClass(){let t=this._getDOMElem();t&&L.DomUtil.removeClass(t,"leaflet-pm-draggable")},_getDOMElem(){let t=null;return this._layer._path?t=this._layer._path:this._layer._renderer&&this._layer._renderer._container?t=this._layer._renderer._container:this._layer._image?t=this._layer._image:this._layer._icon&&(t=this._layer._icon),t},_overwriteEventIfItComesFromMarker(t){t.target.getLatLng&&(!t.target._radius||t.target._radius<=10)&&(t.containerPoint=this._map.mouseEventToContainerPoint(t.originalEvent),t.latlng=this._map.containerPointToLatLng(t.containerPoint))},_syncLayers(t,e){if(this.enabled())return!1;if(!e._fromLayerSync&&this._layer===e.target&&this.options.syncLayersOnDrag){e._fromLayerSync=!0;let i=[];if(L.Util.isArray(this.options.syncLayersOnDrag))i=this.options.syncLayersOnDrag,this.options.syncLayersOnDrag.forEach(t=>{t instanceof L.LayerGroup&&(i=i.concat(t.pm.getLayers(!0)))});else if(!0===this.options.syncLayersOnDrag&&this._parentLayerGroup)for(let t in this._parentLayerGroup){let e=this._parentLayerGroup[t];e.pm&&(i=e.pm.getLayers(!0))}return L.Util.isArray(i)&&i.length>0&&(i=i.filter(t=>!!t.pm).filter(t=>!!t.pm.options.draggable)).forEach(i=>{i!==this._layer&&i.pm[t]&&(i._snapped=!1,i.pm[t](e))}),i.length>0}return!1},_stopDOMImageDrag:t=>(t.preventDefault(),!1)},ek,{_onRotateStart(t){this._preventRenderingMarkers(!0),this._rotationOriginLatLng=this._getRotationCenter().clone(),this._rotationOriginPoint=ng(this._map,this._rotationOriginLatLng),this._rotationStartPoint=ng(this._map,t.target.getLatLng()),this._initialRotateLatLng=ef(this._layer),this._startAngle=this.getAngle();let e=ef(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._fireRotationStart(this._rotationLayer,e),this._fireRotationStart(this._map,e)},_onRotate(t){let e=ng(this._map,t.target.getLatLng()),i=this._rotationStartPoint,n=this._rotationOriginPoint,r=Math.atan2(e.y-n.y,e.x-n.x)-Math.atan2(i.y-n.y,i.x-n.x);this._layer.setLatLngs(this._rotateLayer(r,this._initialRotateLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));let o=this;!function t(e,i=[],n=-1){if(n>-1&&i.push(n),L.Util.isArray(e[0]))e.forEach((e,n)=>t(e,i.slice(),n));else{let t=i.length>0?(0,nm.default)(o._markers,i):o._markers[0];e.forEach((e,i)=>{t[i].setLatLng(e)})}}(this._layer.getLatLngs());let s=ef(this._rotationLayer);this._rotationLayer.setLatLngs(this._rotateLayer(r,this._rotationLayer.pm._rotateOrgLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));let a=180*r/Math.PI,l=(a=a<0?a+360:a)+this._startAngle;this._setAngle(l),this._rotationLayer.pm._setAngle(l),this._fireRotation(this._rotationLayer,a,s),this._fireRotation(this._map,a,s),this._rotationLayer.pm._fireChange(this._rotationLayer.getLatLngs(),"Rotation")},_onRotateEnd(){let t=this._startAngle;delete this._rotationOriginLatLng,delete this._rotationOriginPoint,delete this._rotationStartPoint,delete this._initialRotateLatLng,delete this._startAngle;let e=ef(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._rotationLayer.pm._rotateOrgLatLng=ef(this._rotationLayer),this._fireRotationEnd(this._rotationLayer,t,e),this._fireRotationEnd(this._map,t,e),this._rotationLayer.pm._fireEdit(this._rotationLayer,"Rotation"),this._preventRenderingMarkers(!1),this._layerRotated=!0},_rotateLayer(t,e,i,n,r){let o=ng(r,i);return this._matrix=n.clone().rotate(t,o).flip(),function t(e,i,n){var r;let o=n.getMaxZoom();if(o===1/0&&(o=n.getZoom()),L.Util.isArray(e)){let r=[];return e.forEach(e=>{r.push(t(e,i,n))}),r}return e instanceof L.LatLng?(r=o,n.unproject(i.transform(n.project(e,r)),r)):null}(e,this._matrix,r)},_setAngle(t){t=t<0?t+360:t,this._angle=t%360},_getRotationCenter(){if(this._rotationCenter)return this._rotationCenter;let t=L.polygon(this._layer.getLatLngs(),{stroke:!1,fill:!1,pmIgnore:!0}).addTo(this._layer._map),e=t.getCenter();return t.removeFrom(this._layer._map),e},enableRotate(){this.options.allowRotation?(this.rotateEnabled()&&this.disableRotate(),this._layer instanceof L.Rectangle&&void 0===this._angle&&this.setInitAngle(ed(this._layer._map,this._layer.getLatLngs()[0][0],this._layer.getLatLngs()[0][1])||0),this._rotatePoly=L.polygon(this._layer.getLatLngs(),{fill:!1,stroke:!1,pmIgnore:!1,snapIgnore:!0}),this._rotatePoly._pmTempLayer=!0,this._rotatePoly.addTo(this._layer._map),this._rotatePoly.pm._setAngle(this.getAngle()),this._rotatePoly.pm.setRotationCenter(this.getRotationCenter()),this._rotatePoly.pm.setOptions(this._layer._map.pm.getGlobalOptions()),this._rotatePoly.pm.setOptions({rotate:!0,snappable:!1,hideMiddleMarkers:!0}),this._rotatePoly.pm._rotationLayer=this._layer,this._rotatePoly.pm.enable(),this._rotateOrgLatLng=ef(this._layer),this._rotateEnabled=!0,this._layer.on("remove",this.disableRotate,this),this._fireRotationEnable(this._layer),this._fireRotationEnable(this._layer._map)):this.disableRotate()},disableRotate(){this.rotateEnabled()&&(this._rotatePoly.pm._layerRotated&&this._fireUpdate(),this._rotatePoly.pm._layerRotated=!1,this._rotatePoly.pm.disable(),this._rotatePoly.remove(),this._rotatePoly.pm.setOptions({rotate:!1}),this._rotatePoly=void 0,this._rotateOrgLatLng=void 0,this._layer.off("remove",this.disableRotate,this),this._rotateEnabled=!1,this._fireRotationDisable(this._layer),this._fireRotationDisable(this._layer._map))},rotateEnabled(){return!!this._rotateEnabled},rotateLayer(t){let e=this.getAngle(),i=this._layer.getLatLngs(),n=Math.PI/180*t;this._layer.setLatLngs(this._rotateLayer(n,this._layer.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._layer._map)),this._rotateOrgLatLng=L.polygon(this._layer.getLatLngs()).getLatLngs(),this._setAngle(this.getAngle()+t),this.rotateEnabled()&&this._rotatePoly&&this._rotatePoly.pm.enabled()&&(this._rotatePoly.setLatLngs(this._rotateLayer(n,this._rotatePoly.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._rotatePoly._map)),this._rotatePoly.pm._initMarkers());let r=this.getAngle()-e;r=r<0?r+360:r,this._startAngle=e,this._fireRotation(this._layer,r,i,this._layer),this._fireRotation(this._map||this._layer._map,r,i,this._layer),delete this._startAngle,this._fireChange(this._layer.getLatLngs(),"Rotation")},rotateLayerToAngle(t){let e=t-this.getAngle();this.rotateLayer(e)},getAngle(){return this._angle||0},setInitAngle(t){this._setAngle(t)},getRotationCenter(){return this._getRotationCenter()},setRotationCenter(t){this._rotationCenter=t,this._rotatePoly&&this._rotatePoly.pm.setRotationCenter(t)}},ea],options:{snappable:!0,snapDistance:20,allowSelfIntersection:!0,allowSelfIntersectionEdit:!1,preventMarkerRemoval:!1,removeLayerBelowMinVertexCount:!0,limitMarkersToCount:-1,hideMiddleMarkers:!1,snapSegment:!0,syncLayersOnDrag:!1,draggable:!0,allowEditing:!0,allowRemoval:!0,allowCutting:!0,allowRotation:!0,addVertexOn:"click",removeVertexOn:"contextmenu",removeVertexValidation:void 0,addVertexValidation:void 0,moveVertexValidation:void 0,resizeableCircleMarker:!1,resizeableCircle:!0,snapMiddle:!1,snapVertex:!0},setOptions(t){L.Util.setOptions(this,t)},getOptions(){return this.options},applyOptions(){},isPolygon(){return this._layer instanceof L.Polygon},getShape(){return this._shape},_setPane(t,e){"layerPane"===e?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":"vertexPane"===e?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":"markerPane"===e&&(t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},remove(){(this._map||this._layer._map).pm.removeLayer({target:this._layer})},_vertexValidation(t,e){let i=e.target,n={layer:this._layer,marker:i,event:e},r="";return"move"===t?r="moveVertexValidation":"add"===t?r="addVertexValidation":"remove"===t&&(r="removeVertexValidation"),this.options[r]&&"function"==typeof this.options[r]&&!this.options[r](n)?("move"===t&&(i._cancelDragEventChain=i.getLatLng()),!1):(i._cancelDragEventChain=null,!0)},_vertexValidationDrag:t=>!t._cancelDragEventChain||(t._latlng=t._cancelDragEventChain,t.update(),!1),_vertexValidationDragEnd:t=>!t._cancelDragEventChain||(t._cancelDragEventChain=null,!1)});nv.LayerGroup=L.Class.extend({initialize(t){this._layerGroup=t,this._layers=this.getLayers(),this._getMap(),this._layers.forEach(t=>this._initLayer(t));let e=t=>{if(t.layer._pmTempLayer)return;this._layers=this.getLayers();let e=this._layers.filter(t=>!t.pm._parentLayerGroup||!(this._layerGroup._leaflet_id in t.pm._parentLayerGroup));e.forEach(t=>{this._initLayer(t)}),e.length>0&&this._getMap()&&this._getMap().pm.globalEditModeEnabled()&&this.enabled()&&this.enable(this.getOptions())};this._layerGroup.on("layeradd",L.Util.throttle(e,100,this),this),this._layerGroup.on("layerremove",t=>{this._removeLayerFromGroup(t.target)},this);let i=t=>{t.target._pmTempLayer||(this._layers=this.getLayers())};this._layerGroup.on("layerremove",L.Util.throttle(i,100,this),this)},enable(t,e=[]){0===e.length&&(this._layers=this.getLayers()),this._options=t,this._layers.forEach(i=>{i instanceof L.LayerGroup?-1===e.indexOf(i._leaflet_id)&&(e.push(i._leaflet_id),i.pm.enable(t,e)):i.pm.enable(t)})},disable(t=[]){0===t.length&&(this._layers=this.getLayers()),this._layers.forEach(e=>{e instanceof L.LayerGroup?-1===t.indexOf(e._leaflet_id)&&(t.push(e._leaflet_id),e.pm.disable(t)):e.pm.disable()})},enabled(t=[]){return 0===t.length&&(this._layers=this.getLayers()),!!this._layers.find(e=>e instanceof L.LayerGroup?-1===t.indexOf(e._leaflet_id)&&(t.push(e._leaflet_id),e.pm.enabled(t)):e.pm.enabled())},toggleEdit(t,e=[]){0===e.length&&(this._layers=this.getLayers()),this._options=t,this._layers.forEach(i=>{i instanceof L.LayerGroup?-1===e.indexOf(i._leaflet_id)&&(e.push(i._leaflet_id),i.pm.toggleEdit(t,e)):i.pm.toggleEdit(t)})},_initLayer(t){let e=L.Util.stamp(this._layerGroup);t.pm._parentLayerGroup||(t.pm._parentLayerGroup={}),t.pm._parentLayerGroup[e]=this._layerGroup},_removeLayerFromGroup(t){if(t.pm&&t.pm._layerGroup){let e=L.Util.stamp(this._layerGroup);delete t.pm._layerGroup[e]}},dragging(){return this._layers=this.getLayers(),!!this._layers&&!!this._layers.find(t=>t.pm.dragging())},getOptions(){return this.options},_getMap(){return this._map||this._layers.find(t=>!!t._map)?._map||null},getLayers(t=!1,e=!0,i=!0,n=[]){let r=[];return t?this._layerGroup.getLayers().forEach(t=>{r.push(t),t instanceof L.LayerGroup&&-1===n.indexOf(t._leaflet_id)&&(n.push(t._leaflet_id),r=r.concat(t.pm.getLayers(!0,!0,!0,n)))}):r=this._layerGroup.getLayers(),i&&(r=r.filter(t=>!(t instanceof L.LayerGroup))),e&&(r=(r=(r=r.filter(t=>!!t.pm)).filter(t=>!t._pmTempLayer)).filter(t=>!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)),r},setOptions(t,e=[]){0===e.length&&(this._layers=this.getLayers()),this.options=t,this._layers.forEach(i=>{i.pm&&(i instanceof L.LayerGroup?-1===e.indexOf(i._leaflet_id)&&(e.push(i._leaflet_id),i.pm.setOptions(t,e)):i.pm.setOptions(t))})}}),nv.Marker=nv.extend({_shape:"Marker",initialize(t){this._layer=t,this._enabled=!1,this._layer.on("dragend",this._onDragEnd,this)},enable(t={draggable:!0}){(L.Util.setOptions(this,t),this.options.allowEditing&&this._layer._map)?(this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._layer.on("pm:dragstart",this._onDragStart,this),this._layer.on("pm:dragend",this._onMarkerDragEnd,this),this._fireEnable()):this.disable()},disable(){this.enabled()&&(this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this._layer.off("contextmenu",this._removeMarker,this),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1)},enabled(){return this._enabled},toggleEdit(t){this.enabled()?this.disable():this.enable(t)},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this.options.draggable?this.enableLayerDrag():this.disableLayerDrag(),this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_removeMarker(t){let e=t.target;e.remove(),this._fireRemove(e),this._fireRemove(this._map,e)},_onDragStart(){this._map.pm.Draw.Marker._layerIsDragging=!0},_onMarkerDragEnd(){this._map.pm.Draw.Marker._layerIsDragging=!1},_onDragEnd(){this._fireEdit(),this._layerEdited=!0},_initSnappableMarkers(){let t=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=void 0===this.options.snapSegment||this.options.snapSegment,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){let t=this._layer;t.off("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this)}});var nL=u(ee());nv.Line=nv.extend({includes:[{filterMarkerGroup(){this.markerCache=[],this.createCache(),this._layer.on("pm:edit",this.createCache,this),this.applyLimitFilters({}),this.throttledApplyLimitFilters||(this.throttledApplyLimitFilters=L.Util.throttle(this.applyLimitFilters,100,this)),this._layer.on("pm:disable",this._removeMarkerLimitEvents,this),this._layer.on("remove",this._removeMarkerLimitEvents,this),this.options.limitMarkersToCount>-1&&(this._layer.on("pm:vertexremoved",this._initMarkers,this),this._map.on("mousemove",this.throttledApplyLimitFilters,this))},_removeMarkerLimitEvents(){this._map.off("mousemove",this.throttledApplyLimitFilters,this),this._layer.off("pm:edit",this.createCache,this),this._layer.off("pm:disable",this._removeMarkerLimitEvents,this),this._layer.off("pm:vertexremoved",this._initMarkers,this)},createCache(){let t=[...this._markerGroup.getLayers(),...this.markerCache];this.markerCache=t.filter((t,e,i)=>i.indexOf(t)===e)},_removeFromCache(t){let e=this.markerCache.indexOf(t);e>-1&&this.markerCache.splice(e,1)},renderLimits(t){this.markerCache.forEach(e=>{t.includes(e)?this._markerGroup.addLayer(e):this._markerGroup.removeLayer(e)})},applyLimitFilters({latlng:t={lat:0,lng:0}}){if(this._preventRenderMarkers)return;let e=[...this._filterClosestMarkers(t)];this.renderLimits(e)},_filterClosestMarkers(t){let e=[...this.markerCache],i=this.options.limitMarkersToCount;return -1===i?e:(e.sort((e,i)=>e._latlng.distanceTo(t)-i._latlng.distanceTo(t)),e.filter((t,e)=>!(i>-1)||e{if(Array.isArray(t[0]))return t.map(i,this);let e=t.map(this._createMarker,this);return!0!==this.options.hideMiddleMarkers&&t.map((i,n)=>{let r=this.isPolygon()?(n+1)%t.length:n+1;return this._createMiddleMarker(e[n],e[r])}),e};this._markers=i(e),this.filterMarkerGroup(),t.addLayer(this._markerGroup)},_createMarker(t){let e=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._pmTempLayer=!0,this.options.rotate?(e.on("dragstart",this._onRotateStart,this),e.on("drag",this._onRotate,this),e.on("dragend",this._onRotateEnd,this)):(e.on("click",this._onVertexClick,this),e.on("dragstart",this._onMarkerDragStart,this),e.on("move",this._onMarkerDrag,this),e.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||e.on(this.options.removeVertexOn,this._removeMarker,this)),this._markerGroup.addLayer(e),e},_createMiddleMarker(t,e){if(!t||!e)return!1;let i=L.PM.Utils.calcMiddleLatLng(this._map,t.getLatLng(),e.getLatLng()),n=this._createMarker(i),r=L.divIcon({className:"marker-icon marker-icon-middle"});return n.setIcon(r),n.leftM=t,n.rightM=e,t._middleMarkerNext=n,e._middleMarkerPrev=n,n.on(this.options.addVertexOn,this._onMiddleMarkerClick,this),n.on("movestart",this._onMiddleMarkerMoveStart,this),n},_onMiddleMarkerClick(t){let e=t.target;if(!this._vertexValidation("add",t))return;let i=L.divIcon({className:"marker-icon"});e.setIcon(i),this._addMarker(e,e.leftM,e.rightM)},_onMiddleMarkerMoveStart(t){let e=t.target;(e.on("moveend",this._onMiddleMarkerMoveEnd,this),this._vertexValidation("add",t))?(e._dragging=!0,this._addMarker(e,e.leftM,e.rightM)):e.on("move",this._onMiddleMarkerMovePrevent,this)},_onMiddleMarkerMovePrevent(t){let e=t.target;this._vertexValidationDrag(e)},_onMiddleMarkerMoveEnd(t){let e=t.target;if(e.off("move",this._onMiddleMarkerMovePrevent,this),e.off("moveend",this._onMiddleMarkerMoveEnd,this),!this._vertexValidationDragEnd(e))return;let i=L.divIcon({className:"marker-icon"});e.setIcon(i),setTimeout(()=>{delete e._dragging},100)},_addMarker(t,e,i){t.off("movestart",this._onMiddleMarkerMoveStart,this),t.off(this.options.addVertexOn,this._onMiddleMarkerClick,this);let n=t.getLatLng(),r=this._layer._latlngs;delete t.leftM,delete t.rightM;let{indexPath:o,index:s,parentPath:a}=L.PM.Utils.findDeepMarkerIndex(this._markers,e),l=o.length>1?(0,nL.default)(r,a):r,h=o.length>1?(0,nL.default)(this._markers,a):this._markers;l.splice(s+1,0,n),h.splice(s+1,0,t),this._layer.setLatLngs(r),!0!==this.options.hideMiddleMarkers&&(this._createMiddleMarker(e,t),this._createMiddleMarker(t,i)),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"),this._fireVertexAdded(t,L.PM.Utils.findDeepMarkerIndex(this._markers,t).indexPath,n),this.options.snappable&&this._initSnappableMarkers()},hasSelfIntersection(){return eO(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersectionOnVertexRemoval(){this._handleLayerStyle(!0)&&(this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers())},_handleLayerStyle(t){let e=this._layer,i,n;if(i=!this.options.allowSelfIntersection&&(n=eO(this._layer.toGeoJSON(15))).features.length>0){if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!0),this.isRed)return i;t?this._flashLayer():(e.setStyle({color:"#f00000ff"}),this.isRed=!0),this._fireIntersect(n)}else e.setStyle({color:this.cachedColor}),this.isRed=!1,!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!1);return i},_flashLayer(){this.cachedColor||(this.cachedColor=this._layer.options.color),this._layer.setStyle({color:"#f00000ff"}),this.isRed=!0,window.setTimeout(()=>{this._layer.setStyle({color:this.cachedColor}),this.isRed=!1},200)},_updateDisabledMarkerStyle(t,e){t.forEach(t=>{Array.isArray(t)?this._updateDisabledMarkerStyle(t,e):t._icon&&(e&&!this._checkMarkerAllowedToDrag(t)?L.DomUtil.addClass(t._icon,"vertexmarker-disabled"):L.DomUtil.removeClass(t._icon,"vertexmarker-disabled"))})},_removeMarker(t){let e=t.target;if(!this._vertexValidation("remove",t))return;this.options.allowSelfIntersection||(this._coordsBeforeEdit=ef(this._layer,this._layer.getLatLngs()));let i=this._layer.getLatLngs(),{indexPath:n,index:r,parentPath:o}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);if(!n)return;let s=n.length>1?(0,nL.default)(i,o):i,a=n.length>1?(0,nL.default)(this._markers,o):this._markers,l=o[o.length-1]>0&&this._layer instanceof L.Polygon;if(!this.options.removeLayerBelowMinVertexCount&&!l&&(s.length<=2||this.isPolygon()&&s.length<=3))return void this._flashLayer();s.splice(r,1),this._layer.setLatLngs(i),this.isPolygon()&&s.length<=2&&s.splice(0,s.length);let h=!1;if(s.length<=1&&(s.splice(0,s.length),o.length>1&&n.length>1&&(i=ep(i)),this._layer.setLatLngs(i),this._initMarkers(),h=!0),eu(i)||this._layer.remove(),i=ep(i),this._layer.setLatLngs(i),this._markers=ep(this._markers),!h&&(a=n.length>1?(0,nL.default)(this._markers,o):this._markers,e._middleMarkerPrev&&(this._markerGroup.removeLayer(e._middleMarkerPrev),this._removeFromCache(e._middleMarkerPrev)),e._middleMarkerNext&&(this._markerGroup.removeLayer(e._middleMarkerNext),this._removeFromCache(e._middleMarkerNext)),this._markerGroup.removeLayer(e),this._removeFromCache(e),a)){let t,e;if(this.isPolygon()?(t=(r+1)%a.length,e=(r+(a.length-1))%a.length):(e=r-1<0?void 0:r-1,t=r+1>=a.length?void 0:r+1),t!==e){let i=a[e],n=a[t];!0!==this.options.hideMiddleMarkers&&this._createMiddleMarker(i,n)}a.splice(r,1)}this._fireEdit(),this._layerEdited=!0,this._fireVertexRemoved(e,n),this._fireChange(this._layer.getLatLngs(),"Edit")},updatePolygonCoordsFromMarkerDrag(t){let e=this._layer.getLatLngs(),i=t.getLatLng(),{indexPath:n,index:r,parentPath:o}=L.PM.Utils.findDeepMarkerIndex(this._markers,t),s=n.length>1?(0,nL.default)(e,o):e;i.alt=s[r].alt,s.splice(r,1,i),this._layer.setLatLngs(e)},_getNeighborMarkers(t){let{indexPath:e,index:i,parentPath:n}=L.PM.Utils.findDeepMarkerIndex(this._markers,t),r=e.length>1?(0,nL.default)(this._markers,n):this._markers,o=(i+1)%r.length,s=(i+(r.length-1))%r.length;return{prevMarker:r[s],nextMarker:r[o]}},_checkMarkerAllowedToDrag(t){let{prevMarker:e,nextMarker:i}=this._getNeighborMarkers(t),n=L.polyline([e.getLatLng(),t.getLatLng()]),r=L.polyline([t.getLatLng(),i.getLatLng()]),o=eV(this._layer.toGeoJSON(15),n.toGeoJSON(15)).features.filter(i=>{let n=i.geometry.coordinates,r=L.latLng(n[1],n[0]);return!r.equals(e.getLatLng())&&!r.equals(t.getLatLng())}).length,s=eV(this._layer.toGeoJSON(15),r.toGeoJSON(15)).features.filter(e=>{let n=e.geometry.coordinates,r=L.latLng(n[1],n[0]);return!r.equals(i.getLatLng())&&!r.equals(t.getLatLng())}).length;return!(o<1&&s<1)},_onMarkerDragStart(t){let e=t.target;if(this._preventRenderingMarkers(!0),this.cachedColor||(this.cachedColor=this._layer.options.color),!this._vertexValidation("move",t))return;let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireMarkerDragStart(t,i),this.options.allowSelfIntersection||(this._coordsBeforeEdit=ef(this._layer,this._layer.getLatLngs())),!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()?this._markerAllowedToDrag=this._checkMarkerAllowedToDrag(e):this._markerAllowedToDrag=null},_onMarkerDrag(t){let e=t.target;if(!this._vertexValidationDrag(e))return;let{indexPath:i,index:n,parentPath:r}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);if(!i)return;if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()&&!1===this._markerAllowedToDrag){this._layer.setLatLngs(this._coordsBeforeEdit),this._initMarkers(),this._handleLayerStyle();return}this.updatePolygonCoordsFromMarkerDrag(e);let o=i.length>1?(0,nL.default)(this._markers,r):this._markers,s=(n+1)%o.length,a=(n+(o.length-1))%o.length,l=e.getLatLng(),h=o[a].getLatLng(),u=o[s].getLatLng();if(e._middleMarkerNext){let t=L.PM.Utils.calcMiddleLatLng(this._map,l,u);e._middleMarkerNext.setLatLng(t)}if(e._middleMarkerPrev){let t=L.PM.Utils.calcMiddleLatLng(this._map,l,h);e._middleMarkerPrev.setLatLng(t)}this.options.allowSelfIntersection||this._handleLayerStyle(),this._fireMarkerDrag(t,i),this._fireChange(this._layer.getLatLngs(),"Edit")},_onMarkerDragEnd(t){let e=t.target;if(this._preventRenderingMarkers(!1),!this._vertexValidationDragEnd(e))return;let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e),n=!this.options.allowSelfIntersection&&this.hasSelfIntersection();n&&this.options.allowSelfIntersectionEdit&&this._markerAllowedToDrag&&(n=!1);let r=!this.options.allowSelfIntersection&&n;if(this._fireMarkerDragEnd(t,i,r),r){this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers(),this.options.snappable&&this._initSnappableMarkers(),this._handleLayerStyle(),this._fireLayerReset(t,i);return}!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._handleLayerStyle(),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")},_onVertexClick(t){let e=t.target;if(e._dragging)return;let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireVertexClick(t,i)}}),nv.Polygon=nv.Line.extend({_shape:"Polygon",_checkMarkerAllowedToDrag(t){let{prevMarker:e,nextMarker:i}=this._getNeighborMarkers(t),n=L.polyline([e.getLatLng(),t.getLatLng()]),r=L.polyline([t.getLatLng(),i.getLatLng()]),o=eV(this._layer.toGeoJSON(15),n.toGeoJSON(15)).features.filter(i=>{let n=i.geometry.coordinates,r=L.latLng(n[1],n[0]);return!r.equals(e.getLatLng())&&!r.equals(t.getLatLng())}).length,s=eV(this._layer.toGeoJSON(15),r.toGeoJSON(15)).features.filter(e=>{let n=e.geometry.coordinates,r=L.latLng(n[1],n[0]);return!r.equals(i.getLatLng())&&!r.equals(t.getLatLng())}).length;return!(o<1&&s<1)}}),nv.Rectangle=nv.Polygon.extend({_shape:"Rectangle",_initMarkers(){let t=this._map,e=this._findCorners();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0,t.addLayer(this._markerGroup),this._markers=[],this._markers[0]=e.map(this._createMarker,this),[this._cornerMarkers]=this._markers,this._layer.getLatLngs()[0].forEach((t,e)=>{let i=this._cornerMarkers.find(t=>t._index===e);i&&i.setLatLng(t)})},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this._addMarkerEvents()},_createMarker(t,e){let i=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(i,"vertexPane"),i._origLatLng=t,i._index=e,i._pmTempLayer=!0,i.on("click",this._onVertexClick,this),this._markerGroup.addLayer(i),i},_addMarkerEvents(){this._markers[0].forEach(t=>{t.on("dragstart",this._onMarkerDragStart,this),t.on("drag",this._onMarkerDrag,this),t.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||t.on("contextmenu",this._removeMarker,this)})},_removeMarker:()=>null,_onMarkerDragStart(t){if(!this._vertexValidation("move",t))return;let e=t.target;e._oppositeCornerLatLng=this._cornerMarkers.find(t=>t._index===(e._index+2)%4).getLatLng(),e._snapped=!1;let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireMarkerDragStart(t,i)},_onMarkerDrag(t){let e=t.target;if(!this._vertexValidationDrag(e)||void 0===e._index)return;this._adjustRectangleForMarkerMove(e);let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireMarkerDrag(t,i),this._fireChange(this._layer.getLatLngs(),"Edit")},_onMarkerDragEnd(t){let e=t.target;if(!this._vertexValidationDragEnd(e))return;this._cornerMarkers.forEach(t=>{delete t._oppositeCornerLatLng});let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireMarkerDragEnd(t,i),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")},_adjustRectangleForMarkerMove(t){L.extend(t._origLatLng,t._latlng);let e=L.PM.Utils._getRotatedRectangle(t.getLatLng(),t._oppositeCornerLatLng,this.getAngle(),this._map);this._layer.setLatLngs(e),this._adjustAllMarkers(t),this._layer.redraw()},_adjustAllMarkers(t){let e=this._layer.getLatLngs()[0];if(e&&4!==e.length&&e.length>0)e.forEach((t,e)=>{this._cornerMarkers[e].setLatLng(t)}),this._cornerMarkers.slice(e.length).forEach(t=>{t.setLatLng(e[0])});else if(e&&e.length){let i=e.findIndex(e=>t.getLatLng().equals(e));i>-1?(this._cornerMarkers[(t._index+1)%4].setLatLng(e[(i+1)%4]),this._cornerMarkers[(t._index+2)%4].setLatLng(e[(i+2)%4]),this._cornerMarkers[(t._index+3)%4].setLatLng(e[(i+3)%4])):this._cornerMarkers.forEach(t=>{t.setLatLng(e[t._index])})}else console.error("The layer has no LatLngs")},_findCorners(){void 0===this._angle&&this.setInitAngle(ed(this._map,this._layer.getLatLngs()[0][0],this._layer.getLatLngs()[0][1])||0);let t=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(t[0],t[2],this.getAngle(),this._map||this)}}),nv.CircleMarker=nv.extend({_shape:"CircleMarker",initialize(t){this._layer=t,this._enabled=!1,this._minRadiusOption="minRadiusCircleMarker",this._maxRadiusOption="maxRadiusCircleMarker",this._editableOption="resizeableCircleMarker",this._updateHiddenPolyCircle()},enable(t={draggable:!0,snappable:!0}){(L.Util.setOptions(this,t),this.options.editable&&(this.options.resizeableCircleMarker=this.options.editable,delete this.options.editable),this.options.allowEditing&&this._layer._map)?(this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._extendingEnable(),this._updateHiddenPolyCircle(),this._fireEnable()):this.disable()},_extendingEnable(){this._layer.on("pm:dragstart",this._onDragStart,this),this._layer.on("pm:drag",this._onMarkerDrag,this),this._layer.on("pm:dragend",this._onMarkerDragEnd,this)},disable(){this.dragging()||(this._map||(this._map=this._layer._map),this._map&&this.enabled()&&(this.layerDragEnabled()&&this.disableLayerDrag(),this._helperLayers&&(this._helperLayers.clearLayers(),this._helperLayers.removeFrom(this._map)),this.options[this._editableOption]?(this._map.off("move",this._syncMarkers,this),this._outerMarker.off("drag",this._handleOuterMarkerSnapping,this)):this._map.off("move",this._updateHiddenPolyCircle,this),this._extendingDisable(),this._layer.off("remove",this.disable,this),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1))},_extendingDisable(){this._layer.off("contextmenu",this._removeMarker,this)},enabled(){return this._enabled},toggleEdit(t){this.enabled()?this.disable():this.enable(t)},applyOptions(){this.options[this._editableOption]?(this._initMarkers(),this._map.on("move",this._syncMarkers,this),this.options.snappable?(this._initSnappableMarkers(),this._outerMarker.on("drag",this._handleOuterMarkerSnapping,this),this._outerMarker.on("move",this._syncHintLine,this),this._outerMarker.on("move",this._syncCircleRadius,this)):this._disableSnapping()):(this.options.draggable&&this.enableLayerDrag(),this._map.on("move",this._updateHiddenPolyCircle,this),this.options.snappable?this._initSnappableMarkersDrag():this._disableSnappingDrag()),this._extendingApplyOptions()},_extendingApplyOptions(){this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_initMarkers(){let t=this._map;this._helperLayers&&(this._helperLayers.removeFrom(t),this._helperLayers.clearLayers()),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(t);let e=this._layer.getLatLng(),i=this._layer._radius,n=this._getLatLngOnCircle(e,i);this._centerMarker=this._createCenterMarker(e),this._outerMarker=this._createOuterMarker(n),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker)},_getLatLngOnCircle(t,e){let i=this._map.project(t),n=L.point(i.x+e,i.y);return this._map.unproject(n)},_createHintLine(t,e){let i=t.getLatLng(),n=e.getLatLng();this._hintline=L.polyline([i,n],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker(t){let e=this._createMarker(t);return this.options.draggable?(L.DomUtil.addClass(e._icon,"leaflet-pm-draggable"),e.on("move",this._moveCircle,this)):e.dragging.disable(),e},_createOuterMarker(t){let e=this._createMarker(t);return e.on("drag",this._resizeCircle,this),e},_createMarker(t){let e=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._origLatLng=t,e._pmTempLayer=!0,e.on("dragstart",this._onMarkerDragStart,this),e.on("drag",this._onMarkerDrag,this),e.on("dragend",this._onMarkerDragEnd,this),e.on("click",this._onVertexClick,this),this._helperLayers.addLayer(e),e},_moveCircle(t){if(t.target._cancelDragEventChain)return;let e=this._centerMarker.getLatLng();this._layer.setLatLng(e);let i=this._layer._radius,n=this._getLatLngOnCircle(e,i);this._outerMarker._latlng=n,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")},_syncMarkers(){let t=this._layer.getLatLng(),e=this._layer._radius,i=this._getLatLngOnCircle(t,e);this._outerMarker.setLatLng(i),this._centerMarker.setLatLng(t),this._syncHintLine(),this._updateHiddenPolyCircle()},_resizeCircle(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_syncCircleRadius(){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),i=this._distanceCalculation(t,e);this.options[this._minRadiusOption]&&ithis.options[this._maxRadiusOption]?this._layer.setRadius(this.options[this._maxRadiusOption]):this._layer.setRadius(i),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine(){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng();this._hintline.setLatLngs([t,e])},_removeMarker(){this.options[this._editableOption]&&this.disable(),this._layer.remove(),this._fireRemove(this._layer),this._fireRemove(this._map,this._layer)},_onDragStart(){this._map.pm.Draw.CircleMarker._layerIsDragging=!0},_onMarkerDragStart(t){this._vertexValidation("move",t)&&this._fireMarkerDragStart(t)},_onMarkerDrag(t){let e=t.target;e instanceof L.Marker&&!this._vertexValidationDrag(e)||this._fireMarkerDrag(t)},_onMarkerDragEnd(t){this._extedingMarkerDragEnd();let e=t.target;this._vertexValidationDragEnd(e)&&(this.options[this._editableOption]&&(this._fireEdit(),this._layerEdited=!0),this._fireMarkerDragEnd(t))},_extedingMarkerDragEnd(){this._map.pm.Draw.CircleMarker._layerIsDragging=!1},_initSnappableMarkersDrag(){let t=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=void 0===this.options.snapSegment||this.options.snapSegment,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)},_disableSnappingDrag(){let t=this._layer;t.off("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this)},_updateHiddenPolyCircle(){let t=this._layer._map||this._map;if(t){let e=L.PM.Utils.pxRadiusToMeterRadius(this._layer.getRadius(),t,this._layer.getLatLng()),i=L.circle(this._layer.getLatLng(),this._layer.options);i.setRadius(e);let n=t&&t.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(i,200,!n).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(i,200,!n),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)}},_getNewDestinationOfOuterMarker(){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),i=this._distanceCalculation(t,e);return this.options[this._minRadiusOption]&&ithis.options[this._maxRadiusOption]&&(e=e_(this._map,t,e,this._getMaxDistanceInMeter(t))),e},_handleOuterMarkerSnapping(){if(this._outerMarker._snapped){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),i=this._distanceCalculation(t,e);this.options[this._minRadiusOption]&&ithis.options[this._maxRadiusOption]&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())},_distanceCalculation(t,e){return this._map.project(t).distanceTo(this._map.project(e))},_getMinDistanceInMeter(t){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._minRadiusOption],this._map,t)},_getMaxDistanceInMeter(t){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._maxRadiusOption],this._map,t)},_onVertexClick(t){t.target._dragging||this._fireVertexClick(t,void 0)}}),nv.Circle=nv.CircleMarker.extend({_shape:"Circle",initialize(t){this._layer=t,this._enabled=!1,this._minRadiusOption="minRadiusCircle",this._maxRadiusOption="maxRadiusCircle",this._editableOption="resizeableCircle",this._updateHiddenPolyCircle()},enable(t){L.PM.Edit.CircleMarker.prototype.enable.call(this,t||{})},_extendingEnable(){},_extendingDisable(){this._layer.off("remove",this.disable,this);let t=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(t,"leaflet-pm-draggable")},_extendingApplyOptions(){},_syncMarkers(){},_removeMarker(){},_onDragStart(){},_extedingMarkerDragEnd(){},_updateHiddenPolyCircle(){let t=this._map&&this._map.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(this._layer,200,!t).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(this._layer,200,!t),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)},_distanceCalculation(t,e){return this._map.distance(t,e)},_getMinDistanceInMeter(){return this.options[this._minRadiusOption]},_getMaxDistanceInMeter(){return this.options[this._maxRadiusOption]},_onVertexClick(t){t.target._dragging||this._fireVertexClick(t,void 0)}}),nv.ImageOverlay=nv.extend({_shape:"ImageOverlay",initialize(t){this._layer=t,this._enabled=!1},toggleEdit(t){this.enabled()?this.disable():this.enable(t)},enabled(){return this._enabled},enable(t={draggable:!0,snappable:!0}){if(L.Util.setOptions(this,t),this._map=this._layer._map,this._map){if(!this.options.allowEditing)return void this.disable();this.enabled()||this.disable(),this.enableLayerDrag(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._otherSnapLayers=this._findCorners(),this._fireEnable()}},disable(){this._dragging||(this._map||(this._map=this._layer._map),this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this.enabled()||(this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()),this._enabled=!1)},_findCorners(){let t=this._layer.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest()]}}),nv.Text=nv.extend({_shape:"Text",initialize(t){this._layer=t,this._enabled=!1},enable(t){if(L.Util.setOptions(this,t),this.textArea){if(!this.options.allowEditing||!this._layer._map)return void this.disable();this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._safeToCacheDragState=!0,this._focusChange(),this.textArea.readOnly=!1,this.textArea.classList.remove("pm-disabled"),this._layer.on("remove",this.disable,this),L.DomEvent.on(this.textArea,"input",this._autoResize,this),L.DomEvent.on(this.textArea,"focus",this._focusChange,this),L.DomEvent.on(this.textArea,"blur",this._focusChange,this),this._layer.on("dblclick",L.DomEvent.stop),L.DomEvent.off(this.textArea,"mousedown",this._preventTextSelection),this._enabled=!0,this._fireEnable()}},disable(){if(!this.enabled())return;this._layer.off("remove",this.disable,this),L.DomEvent.off(this.textArea,"input",this._autoResize,this),L.DomEvent.off(this.textArea,"focus",this._focusChange,this),L.DomEvent.off(this.textArea,"blur",this._focusChange,this),document.removeEventListener("click",this._documentClickThis,{capture:!0}),this._focusChange(),this.textArea.readOnly=!0,this.textArea.classList.add("pm-disabled");let t=document.activeElement;this.textArea.focus(),this.textArea.selectionStart=0,this.textArea.selectionEnd=0,L.DomEvent.on(this.textArea,"mousedown",this._preventTextSelection),t.focus(),this._disableOnBlurActive=!1,this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1},enabled(){return this._enabled},toggleEdit(t){this.enabled()?this.disable():this.enable(t)},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initSnappableMarkers(){let t=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=void 0===this.options.snapSegment||this.options.snapSegment,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){let t=this._layer;t.off("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this)},_autoResize(){this.textArea.style.height="1px",this.textArea.style.width="1px";let t=this.textArea.scrollHeight>21?this.textArea.scrollHeight:21,e=this.textArea.scrollWidth>16?this.textArea.scrollWidth:16;this.textArea.style.height=`${t}px`,this.textArea.style.width=`${e}px`,this._layer.options.text=this.getText(),this._fireTextChange(this.getText())},_disableOnBlur(){this._disableOnBlurActive=!0,setTimeout(()=>{this.enabled()&&(this._documentClickThis=this._documentClickThis||this._documentClick.bind(this),document.addEventListener("click",this._documentClickThis,{capture:!0}))},100)},_documentClick(t){t.target!==this.textArea&&(this.disable(),!this.getText()&&this.options.removeIfEmpty&&this.remove())},_focusChange(t={}){let e=this._hasFocus;this._hasFocus="focus"===t.type,!e!=!this._hasFocus&&(this._hasFocus?(this._applyFocus(),this._focusText=this.getText(),this._fireTextFocus()):(this._removeFocus(),this._fireTextBlur(),this._focusText!==this.getText()&&(this._fireEdit(),this._layerEdited=!0)))},_applyFocus(){this.textArea.classList.add("pm-hasfocus"),this._map.dragging&&(this._safeToCacheDragState&&(this._originalMapDragState=this._map.dragging._enabled,this._safeToCacheDragState=!1),this._map.dragging.disable())},_removeFocus(){this._map.dragging&&(this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0),this.textArea.classList.remove("pm-hasfocus")},focus(){if(!this.enabled())throw TypeError("Layer is not enabled");this.textArea.focus()},blur(){if(!this.enabled())throw TypeError("Layer is not enabled");this.textArea.blur(),this._disableOnBlurActive&&this.disable()},hasFocus(){return this._hasFocus},getElement(){return this.textArea},setText(t){t&&(this.textArea.value=t),this._autoResize()},getText(){return this.textArea.value},_initTextMarker(){if(this.textArea=L.PM.Draw.Text.prototype._createTextArea.call(this),this.options.className){let t=this.options.className.split(" ");this.textArea.classList.add(...t)}let t=L.PM.Draw.Text.prototype._createTextIcon.call(this,this.textArea);this._layer.setIcon(t),this._layer.once("add",this._createTextMarker,this)},_createTextMarker(t=!1){this._layer.off("add",this._createTextMarker,this),this._layer.getElement().tabIndex=-1,this.textArea.wrap="off",this.textArea.style.overflow="hidden",this.textArea.style.height=L.DomUtil.getStyle(this.textArea,"font-size"),this.textArea.style.width="1px",this._layer.options.text&&this.setText(this._layer.options.text),this._autoResize(),!0===t&&(this.enable(),this.focus(),this._disableOnBlur())},_preventTextSelection(t){t.preventDefault()}});var nb=function(t,e,i,n,r,o){this._matrix=[t,e,i,n,r,o]};nb.init=()=>new L.PM.Matrix(1,0,0,1,0,0),nb.prototype={transform(t){return this._transform(t.clone())},_transform(t){let e=this._matrix,{x:i,y:n}=t;return t.x=e[0]*i+e[1]*n+e[4],t.y=e[2]*i+e[3]*n+e[5],t},untransform(t){let e=this._matrix;return new L.Point((t.x/e[0]-e[4])/e[0],(t.y/e[2]-e[5])/e[2])},clone(){let t=this._matrix;return new L.PM.Matrix(t[0],t[1],t[2],t[3],t[4],t[5])},translate(t){let e,i;return void 0===t?new L.Point(this._matrix[4],this._matrix[5]):("number"==typeof t?(e=t,i=t):(e=t.x,i=t.y),this._add(1,0,0,1,e,i))},scale(t,e){let i,n;return void 0===t?new L.Point(this._matrix[0],this._matrix[3]):(e=e||L.point(0,0),"number"==typeof t?(i=t,n=t):(i=t.x,n=t.y),this._add(i,0,0,n,e.x,e.y)._add(1,0,0,1,-e.x,-e.y))},rotate(t,e){let i=Math.cos(t),n=Math.sin(t);return e=e||new L.Point(0,0),this._add(i,n,-n,i,e.x,e.y)._add(1,0,0,1,-e.x,-e.y)},flip(){return this._matrix[1]*=-1,this._matrix[2]*=-1,this},_add(t,e,i,n,r,o){let s=[[],[],[]],a=this._matrix,l=[[a[0],a[2],a[4]],[a[1],a[3],a[5]],[0,0,1]],h=[[t,i,r],[e,n,o],[0,0,1]],u;t&&t instanceof L.PM.Matrix&&(h=[[(a=t._matrix)[0],a[2],a[4]],[a[1],a[3],a[5]],[0,0,1]]);for(let t=0;t<3;t+=1)for(let e=0;e<3;e+=1){u=0;for(let i=0;i<3;i+=1)u+=l[t][i]*h[i][e];s[t][e]=u}return this._matrix=[s[0][0],s[1][0],s[0][1],s[1][1],s[0][2],s[1][2]],this}},L.PM=L.PM||{version:"2.19.2",Map:ey,Toolbar:eL,Draw:eM,Edit:nv,Utils:{calcMiddleLatLng(t,e,i){let n=t.project(e),r=t.project(i);return t.unproject(n._add(r)._divideBy(2))},findLayers(t){let e=[];return t.eachLayer(t=>{(t instanceof L.Polyline||t instanceof L.Marker||t instanceof L.Circle||t instanceof L.CircleMarker||t instanceof L.ImageOverlay)&&e.push(t)}),e=(e=(e=e.filter(t=>!!t.pm)).filter(t=>!t._pmTempLayer)).filter(t=>!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&!1===t.options.pmIgnore)},circleToPolygon(t,e=60,i=!0){let n=ec(t.getLatLng(),t.getRadius(),e,0,i),r=[];for(let t=0;t{t.fire(e,i,n)})},getAllParentGroups(t){let e=[],i=[],n=t=>{for(let r in t._eventParents)if(-1===e.indexOf(r)){e.push(r);let o=t._eventParents[r];i.push(o),n(o)}};return!t._pmLastGroupFetch||!t._pmLastGroupFetch.time||new Date().getTime()-t._pmLastGroupFetch.time>1e3?(n(t),t._pmLastGroupFetch={time:new Date().getTime(),groups:i,groupIds:e},{groupIds:e,groups:i}):{groups:t._pmLastGroupFetch.groups,groupIds:t._pmLastGroupFetch.groupIds}},createGeodesicPolygon:ec,getTranslation:eh,findDeepCoordIndex(t,e,i=!0){let n,r=t=>(o,s)=>{let a=t.concat(s);if(i){if(o.lat&&o.lat===e.lat&&o.lng===e.lng)return n=a,!0}else if(o.lat&&L.latLng(o).equals(e))return n=a,!0;return Array.isArray(o)&&o.some(r(a))};t.some(r([]));let o={};return n&&(o={indexPath:n,index:n[n.length-1],parentPath:n.slice(0,n.length-1)}),o},findDeepMarkerIndex(t,e){let i,n=t=>(r,o)=>{let s=t.concat(o);return r._leaflet_id===e._leaflet_id?(i=s,!0):Array.isArray(r)&&r.some(n(s))};t.some(n([]));let r={};return i&&(r={indexPath:i,index:i[i.length-1],parentPath:i.slice(0,i.length-1)}),r},_getIndexFromSegment(t,e){if(e&&2===e.length){let i=this.findDeepCoordIndex(t,e[0]),n=this.findDeepCoordIndex(t,e[1]),r=Math.max(i.index,n.index);return(0===i.index||0===n.index)&&1!==r&&(r+=1),{indexA:i,indexB:n,newIndex:r,indexPath:i.indexPath,parentPath:i.parentPath}}return null},_getRotatedRectangle(t,e,i,n){let r=ng(n,t),o=ng(n,e),s=i*Math.PI/180,a=Math.cos(s),l=Math.sin(s),h=(o.x-r.x)*a+(o.y-r.y)*l,u=(o.y-r.y)*a-(o.x-r.x)*l,p=h*a+r.x,c=h*l+r.y,d=-u*l+r.x,_=u*a+r.y;return[ny(n,r),ny(n,{x:p,y:c}),ny(n,o),ny(n,{x:d,y:_})]},pxRadiusToMeterRadius(t,e,i){let n=e.project(i),r=L.point(n.x+t,n.y);return e.distance(e.unproject(r),i)}},Matrix:nb,activeLang:"en",optIn:!1,initialize(t){this.addInitHooks(t)},setOptIn(t){this.optIn=!!t},addInitHooks(){L.Map.addInitHook(function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Map(this)):this.options.pmIgnore||(this.pm=new L.PM.Map(this)),this.pm&&this.pm.setGlobalOptions({})}),L.LayerGroup.addInitHook(function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.LayerGroup(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.LayerGroup(this))}),L.Marker.addInitHook(function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this)):this.options.pmIgnore||(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this))}),L.CircleMarker.addInitHook(function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.CircleMarker(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.CircleMarker(this))}),L.Polyline.addInitHook(function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Line(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Line(this))}),L.Polygon.addInitHook(function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Polygon(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Polygon(this))}),L.Rectangle.addInitHook(function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Rectangle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Rectangle(this))}),L.Circle.addInitHook(function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.Circle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Circle(this))}),L.ImageOverlay.addInitHook(function(){this.pm=void 0,L.PM.optIn?!1===this.options.pmIgnore&&(this.pm=new L.PM.Edit.ImageOverlay(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.ImageOverlay(this))})},reInitLayer(t){t instanceof L.LayerGroup&&t.eachLayer(t=>{this.reInitLayer(t)}),t.pm||L.PM.optIn&&!1!==t.options.pmIgnore||t.options.pmIgnore||(t instanceof L.Map?t.pm=new L.PM.Map(t):t instanceof L.Marker?t.options.textMarker?(t.pm=new L.PM.Edit.Text(t),t.pm._initTextMarker(),t.pm._createTextMarker(!1)):t.pm=new L.PM.Edit.Marker(t):t instanceof L.Circle?t.pm=new L.PM.Edit.Circle(t):t instanceof L.CircleMarker?t.pm=new L.PM.Edit.CircleMarker(t):t instanceof L.Rectangle?t.pm=new L.PM.Edit.Rectangle(t):t instanceof L.Polygon?t.pm=new L.PM.Edit.Polygon(t):t instanceof L.Polyline?t.pm=new L.PM.Edit.Line(t):t instanceof L.LayerGroup?t.pm=new L.PM.Edit.LayerGroup(t):t instanceof L.ImageOverlay&&(t.pm=new L.PM.Edit.ImageOverlay(t)))}},"1.7.1"===L.version&&L.Canvas.include({_onClick(t){let e=this._map.mouseEventToLayerPoint(t),i,n;for(let r=this._drawFirst;r;r=r.next)(i=r.layer).options.interactive&&i._containsPoint(e)&&("click"!==t.type&&"preclick"!==t.type||!this._map._draggableMoved(i))&&(n=i);n&&(L.DomEvent.fakeStop(t),this._fireEvent([n],t))}}),L.PM.initialize()})()},80094,t=>{"use strict";var e=t.i(43476),i=t.i(32322);t.i(15258),t.i(70462);var n=t.i(71645);function r({members:t,onPolygonChange:r,clearTrigger:o,loadPolygon:s}){let a=(0,n.useRef)(null),l=(0,n.useRef)(null),h=(0,n.useRef)(null),u=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!a.current||l.current)return;let t=i.default.map(a.current).setView([46.5,2.5],6);i.default.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© OpenStreetMap'}).addTo(t);let e=i.default.markerClusterGroup();return t.addLayer(e),t.pm&&(t.pm.addControls({position:"topleft",drawCircle:!1,drawCircleMarker:!1,drawMarker:!1,drawPolyline:!1,drawText:!1,editMode:!1,dragMode:!1,cutPolygon:!1,rotateMode:!1}),t.pm.setLang("fr")),t.on("pm:create",e=>{u.current&&t.removeLayer(u.current),u.current=e.layer,r(e.layer.getLatLngs()[0].map(t=>[t.lat,t.lng]))}),t.on("pm:remove",()=>{u.current=null,r(null)}),l.current=t,h.current=e,()=>{t.remove(),l.current=null,h.current=null}},[]),(0,n.useEffect)(()=>{o&&l.current&&u.current&&(l.current.removeLayer(u.current),u.current=null,r(null))},[o]),(0,n.useEffect)(()=>{let t=l.current;if(!t||!s)return;u.current&&(t.removeLayer(u.current),u.current=null);let e=s.coords.map(([t,e])=>i.default.latLng(t,e)),n=i.default.polygon(e,{color:"#3388ff"}).addTo(t);u.current=n,t.fitBounds(n.getBounds(),{padding:[20,20]}),r(s.coords)},[s]),(0,n.useEffect)(()=>{let e=h.current;if(!e)return;e.clearLayers();let n=t.map(t=>i.default.circleMarker([t.lat,t.lon],{radius:6,color:"#f59e0b",fillColor:"#f59e0b",fillOpacity:.7}).bindPopup(`${t.title||t.pubkey.slice(0,8)}${t.city?"
"+t.city:""}`));e.addLayers(n)},[t]),(0,e.jsx)("div",{ref:a,style:{height:"500px",width:"100%",borderRadius:"0.75rem"}})}t.s(["default",()=>r])},5618,t=>{t.n(t.i(80094))}]);