<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* @public_path/build/secto.4f6521d9.js */
class __TwigTemplate_1cd9d55d051e36350056164dddc6a4d328eadbd002e87b31c9d5c726273214ff extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@public_path/build/secto.4f6521d9.js"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@public_path/build/secto.4f6521d9.js"));

        yield "(self.webpackChunk=self.webpackChunk||[]).push([[516],{80739:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/agents.ff1dc136.png\"},46951:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/bdd.be7d3a77.png\"},80258:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/circle.b491ce2e.png\"},33804:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/clients30.fbd5fcb9.png\"},368:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/clientsOut.56de179b.png\"},59434:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/creation_assist.e7cd96e2.png\"},47102:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/densite1.43286f31.png\"},62104:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/icon_marker_black.bfa480fc.png\"},33258:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/icon_marker_red.d988b994.png\"},72863:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/maison.6000e52e.png\"},81311:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/number.f29d5d5a.png\"},73385:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/pastille.9a231ce3.png\"},82270:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/refresh.961546ea.png\"},20508:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/save.86e68346.png\"},92938:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/undo.9cb1531e.png\"},94979:(t,e,o)=>{var n,r,s;o(74916),o(23123),o(41539),o(32564),o(15306),o(24603),o(39714),o(82772),o(83710),o(91058),o(64765),r=[o(45243)],void 0===(s=\"function\"==typeof(n=function(t){return t.Control.Search=t.Control.extend({includes:\"1\"===t.version[0]?t.Evented.prototype:t.Mixin.Events,options:{url:\"\",layer:null,sourceData:null,jsonpParam:null,propertyLoc:\"loc\",propertyName:\"title\",formatData:null,filterData:null,moveToLocation:null,buildTip:null,container:\"\",zoom:null,minLength:1,initial:!0,casesensitive:!1,autoType:!0,delayType:400,tooltipLimit:-1,tipAutoSubmit:!0,firstTipSubmit:!1,autoResize:!0,collapsed:!0,autoCollapse:!1,autoCollapseTime:1200,textErr:\"Location not found\",textCancel:\"Cancel\",textPlaceholder:\"Search...\",hideMarkerOnCollapse:!1,position:\"topleft\",marker:{icon:!1,animate:!0,circle:{radius:10,weight:3,color:\"#e03\",stroke:!0,fill:!1}}},_getPath:function(t,e){var i=e.split(\".\"),o=i.pop(),n=i.length,r=i[0],s=1;if(n>0)for(;(t=t[r])&&s<n;)r=i[s++];if(t)return t[o]},_isObject:function(t){return\"[object Object]\"===Object.prototype.toString.call(t)},initialize:function(e){t.Util.setOptions(this,e||{}),this._inputMinSize=this.options.textPlaceholder?this.options.textPlaceholder.length:10,this._layer=this.options.layer||new t.LayerGroup,this._filterData=this.options.filterData||this._defaultFilterData,this._formatData=this.options.formatData||this._defaultFormatData,this._moveToLocation=this.options.moveToLocation||this._defaultMoveToLocation,this._autoTypeTmp=this.options.autoType,this._countertips=0,this._recordsCache={},this._curReq=null},onAdd:function(e){return this._map=e,this._container=t.DomUtil.create(\"div\",\"leaflet-control-search\"),this._input=this._createInput(this.options.textPlaceholder,\"search-input\"),this._tooltip=this._createTooltip(\"search-tooltip\"),this._cancel=this._createCancel(this.options.textCancel,\"search-cancel\"),this._button=this._createButton(this.options.textPlaceholder,\"search-button\"),this._alert=this._createAlert(\"search-alert\"),!1===this.options.collapsed&&this.expand(this.options.collapsed),this.options.marker&&(this.options.marker instanceof t.Marker||this.options.marker instanceof t.CircleMarker?this._markerSearch=this.options.marker:this._isObject(this.options.marker)&&(this._markerSearch=new t.Control.Search.Marker([0,0],this.options.marker)),this._markerSearch._isMarkerSearch=!0),this.setLayer(this._layer),e.on({resize:this._handleAutoresize},this),this._container},addTo:function(e){return this.options.container?(this._container=this.onAdd(e),this._wrapper=t.DomUtil.get(this.options.container),this._wrapper.style.position=\"relative\",this._wrapper.appendChild(this._container)):t.Control.prototype.addTo.call(this,e),this},onRemove:function(t){this._recordsCache={},t.off({resize:this._handleAutoresize},this)},setLayer:function(t){return this._layer=t,this._layer.addTo(this._map),this},showAlert:function(t){var e=this;return t=t||this.options.textErr,this._alert.style.display=\"block\",this._alert.innerHTML=t,clearTimeout(this.timerAlert),this.timerAlert=setTimeout((function(){e.hideAlert()}),this.options.autoCollapseTime),this},hideAlert:function(){return this._alert.style.display=\"none\",this},cancel:function(){return this._input.value=\"\",this._handleKeypress({keyCode:8}),this._input.size=this._inputMinSize,this._input.focus(),this._cancel.style.display=\"none\",this._hideTooltip(),this.fire(\"search:cancel\"),this},expand:function(e){return e=\"boolean\"!=typeof e||e,this._input.style.display=\"block\",t.DomUtil.addClass(this._container,\"search-exp\"),!1!==e&&(this._input.focus(),this._map.on(\"dragstart click\",this.collapse,this)),this.fire(\"search:expanded\"),this},collapse:function(){return this._hideTooltip(),this.cancel(),this._alert.style.display=\"none\",this._input.blur(),this.options.collapsed&&(this._input.style.display=\"none\",this._cancel.style.display=\"none\",t.DomUtil.removeClass(this._container,\"search-exp\"),this.options.hideMarkerOnCollapse&&this._map.removeLayer(this._markerSearch),this._map.off(\"dragstart click\",this.collapse,this)),this.fire(\"search:collapsed\"),this},collapseDelayed:function(){var t=this;return this.options.autoCollapse?(clearTimeout(this.timerCollapse),this.timerCollapse=setTimeout((function(){t.collapse()}),this.options.autoCollapseTime),this):this},collapseDelayedStop:function(){return clearTimeout(this.timerCollapse),this},_createAlert:function(e){var i=t.DomUtil.create(\"div\",e,this._container);return i.style.display=\"none\",t.DomEvent.on(i,\"click\",t.DomEvent.stop,this).on(i,\"click\",this.hideAlert,this),i},_createInput:function(e,i){var o=this,n=t.DomUtil.create(\"label\",i,this._container),r=t.DomUtil.create(\"input\",i,this._container);return r.type=\"text\",r.size=this._inputMinSize,r.value=\"\",r.autocomplete=\"off\",r.autocorrect=\"off\",r.autocapitalize=\"off\",r.placeholder=e,r.style.display=\"none\",r.role=\"search\",r.id=r.role+r.type+r.size,n.htmlFor=r.id,n.style.display=\"none\",n.value=e,t.DomEvent.disableClickPropagation(r).on(r,\"keyup\",this._handleKeypress,this).on(r,\"paste\",(function(t){setTimeout((function(t){o._handleKeypress(t)}),10,t)}),this).on(r,\"blur\",this.collapseDelayed,this).on(r,\"focus\",this.collapseDelayedStop,this),r},_createCancel:function(e,i){var o=t.DomUtil.create(\"a\",i,this._container);return o.href=\"#\",o.title=e,o.style.display=\"none\",o.innerHTML=\"<span>&otimes;</span>\",t.DomEvent.on(o,\"click\",t.DomEvent.stop,this).on(o,\"click\",this.cancel,this),o},_createButton:function(e,i){var o=t.DomUtil.create(\"a\",i,this._container);return o.href=\"#\",o.title=e,t.DomEvent.on(o,\"click\",t.DomEvent.stop,this).on(o,\"click\",this._handleSubmit,this).on(o,\"focus\",this.collapseDelayedStop,this).on(o,\"blur\",this.collapseDelayed,this),o},_createTooltip:function(e){var i=this,o=t.DomUtil.create(\"ul\",e,this._container);return o.style.display=\"none\",t.DomEvent.disableClickPropagation(o).on(o,\"blur\",this.collapseDelayed,this).on(o,\"mousewheel\",(function(e){i.collapseDelayedStop(),t.DomEvent.stopPropagation(e)}),this).on(o,\"mouseover\",(function(t){i.collapseDelayedStop()}),this),o},_createTip:function(e,i){var o;if(this.options.buildTip){if(\"string\"==typeof(o=this.options.buildTip.call(this,e,i))){var n=t.DomUtil.create(\"div\");n.innerHTML=o,o=n.firstChild}}else(o=t.DomUtil.create(\"li\",\"\")).innerHTML=e;return t.DomUtil.addClass(o,\"search-tip\"),o._text=e,this.options.tipAutoSubmit&&t.DomEvent.disableClickPropagation(o).on(o,\"click\",t.DomEvent.stop,this).on(o,\"click\",(function(t){this._input.value=e,this._handleAutoresize(),this._input.focus(),this._hideTooltip(),this._handleSubmit()}),this),o},_getUrl:function(t){return\"function\"==typeof this.options.url?this.options.url(t):this.options.url},_defaultFilterData:function(t,e){var i,o,n,r={};if(\"\"===(t=t.replace(/[.*+?^\${}()|[\\]\\\\]/g,\"\")))return[];for(var s in i=this.options.initial?\"^\":\"\",o=this.options.casesensitive?void 0:\"i\",n=new RegExp(i+t,o),e)n.test(s)&&(r[s]=e[s]);return r},showTooltip:function(t){if(this._countertips=0,this._tooltip.innerHTML=\"\",this._tooltip.currentSelection=-1,this.options.tooltipLimit)for(var e in t){if(this._countertips===this.options.tooltipLimit)break;this._countertips++,this._tooltip.appendChild(this._createTip(e,t[e]))}return this._countertips>0?(this._tooltip.style.display=\"block\",this._autoTypeTmp&&this._autoType(),this._autoTypeTmp=this.options.autoType):this._hideTooltip(),this._tooltip.scrollTop=0,this._countertips},_hideTooltip:function(){return this._tooltip.style.display=\"none\",this._tooltip.innerHTML=\"\",0},_defaultFormatData:function(e){var i,o=this,n=this.options.propertyName,r=this.options.propertyLoc,s={};if(t.Util.isArray(r))for(i in e)s[o._getPath(e[i],n)]=t.latLng(e[i][r[0]],e[i][r[1]]);else for(i in e)s[o._getPath(e[i],n)]=t.latLng(o._getPath(e[i],r));return s},_recordsFromJsonp:function(e,i){t.Control.Search.callJsonp=i;var o=t.DomUtil.create(\"script\",\"leaflet-search-jsonp\",document.getElementsByTagName(\"body\")[0]),n=t.Util.template(this._getUrl(e)+\"&\"+this.options.jsonpParam+\"=L.Control.Search.callJsonp\",{s:e});return o.type=\"text/javascript\",o.src=n,{abort:function(){o.parentNode.removeChild(o)}}},_recordsFromAjax:function(e,i){void 0===window.XMLHttpRequest&&(window.XMLHttpRequest=function(){try{return new ActiveXObject(\"Microsoft.XMLHTTP.6.0\")}catch(t){try{return new ActiveXObject(\"Microsoft.XMLHTTP.3.0\")}catch(t){throw new Error(\"XMLHttpRequest is not supported\")}}});var o=t.Browser.ie&&!window.atob&&document.querySelector?new XDomainRequest:new XMLHttpRequest,n=t.Util.template(this._getUrl(e),{s:e});return o.open(\"GET\",n),o.onload=function(){i(JSON.parse(o.responseText))},o.onreadystatechange=function(){4===o.readyState&&200===o.status&&this.onload()},o.send(),o},_searchInLayer:function(e,i,o){var n,r=this;e instanceof t.Control.Search.Marker||(e instanceof t.Marker||e instanceof t.CircleMarker?r._getPath(e.options,o)?((n=e.getLatLng()).layer=e,i[r._getPath(e.options,o)]=n):r._getPath(e.feature.properties,o)?((n=e.getLatLng()).layer=e,i[r._getPath(e.feature.properties,o)]=n):console.warn(\"propertyName '\"+o+\"' not found in marker\"):e instanceof t.Path||e instanceof t.Polyline||e instanceof t.Polygon?r._getPath(e.options,o)?((n=e.getBounds().getCenter()).layer=e,i[r._getPath(e.options,o)]=n):r._getPath(e.feature.properties,o)?((n=e.getBounds().getCenter()).layer=e,i[r._getPath(e.feature.properties,o)]=n):console.warn(\"propertyName '\"+o+\"' not found in shape\"):e.hasOwnProperty(\"feature\")?e.feature.properties.hasOwnProperty(o)?e.getLatLng&&\"function\"==typeof e.getLatLng?((n=e.getLatLng()).layer=e,i[e.feature.properties[o]]=n):e.getBounds&&\"function\"==typeof e.getBounds?((n=e.getBounds().getCenter()).layer=e,i[e.feature.properties[o]]=n):console.warn(\"Unknown type of Layer\"):console.warn(\"propertyName '\"+o+\"' not found in feature\"):e instanceof t.LayerGroup&&e.eachLayer((function(t){r._searchInLayer(t,i,o)})))},_recordsFromLayer:function(){var t=this,e={},i=this.options.propertyName;return this._layer.eachLayer((function(o){t._searchInLayer(o,e,i)})),e},_autoType:function(){var t=this._input.value.length,e=this._tooltip.firstChild?this._tooltip.firstChild._text:\"\",i=e.length;if(0===e.indexOf(this._input.value))if(this._input.value=e,this._handleAutoresize(),this._input.createTextRange){var o=this._input.createTextRange();o.collapse(!0),o.moveStart(\"character\",t),o.moveEnd(\"character\",i),o.select()}else this._input.setSelectionRange?this._input.setSelectionRange(t,i):this._input.selectionStart&&(this._input.selectionStart=t,this._input.selectionEnd=i)},_hideAutoType:function(){var t;if((t=this._input.selection)&&t.empty)t.empty();else if(this._input.createTextRange){(t=this._input.createTextRange()).collapse(!0);var e=this._input.value.length;t.moveStart(\"character\",e),t.moveEnd(\"character\",e),t.select()}else this._input.getSelection&&this._input.getSelection().removeAllRanges(),this._input.selectionStart=this._input.selectionEnd},_handleKeypress:function(t){var e=this;switch(t.keyCode){case 27:this.collapse();break;case 13:(1==this._countertips||this.options.firstTipSubmit&&this._countertips>0)&&-1==this._tooltip.currentSelection&&this._handleArrowSelect(1),this._handleSubmit();break;case 38:this._handleArrowSelect(-1);break;case 40:this._handleArrowSelect(1);break;case 8:case 45:case 46:this._autoTypeTmp=!1;break;case 37:case 39:case 16:case 17:case 35:case 36:break;default:this._input.value.length?this._cancel.style.display=\"block\":this._cancel.style.display=\"none\",this._input.value.length>=this.options.minLength?(clearTimeout(this.timerKeypress),this.timerKeypress=setTimeout((function(){e._fillRecordsCache()}),this.options.delayType)):this._hideTooltip()}this._handleAutoresize()},searchText:function(e){var i=e.charCodeAt(e.length);this._input.value=e,this._input.style.display=\"block\",t.DomUtil.addClass(this._container,\"search-exp\"),this._autoTypeTmp=!1,this._handleKeypress({keyCode:i})},_fillRecordsCache:function(){var e,i=this,o=this._input.value;this._curReq&&this._curReq.abort&&this._curReq.abort(),t.DomUtil.addClass(this._container,\"search-load\"),this.options.sourceData?this._retrieveData=this.options.sourceData:this.options.url&&(this._retrieveData=this.options.jsonpParam?this._recordsFromJsonp:this._recordsFromAjax),this._curReq=this._retrieveData.call(this,o,(function(o){i._recordsCache=i._formatData.call(i,o),e=i.options.sourceData?i._filterData(i._input.value,i._recordsCache):i._recordsCache,i.showTooltip(e),t.DomUtil.removeClass(i._container,\"search-load\")}))},_handleAutoresize:function(){var t;this._input.style.maxWidth!==this._map._container.offsetWidth&&(t=this._map._container.clientWidth,t-=83,this._input.style.maxWidth=t.toString()+\"px\"),this.options.autoResize&&this._container.offsetWidth+20<this._map._container.offsetWidth&&(this._input.size=this._input.value.length<this._inputMinSize?this._inputMinSize:this._input.value.length)},_handleArrowSelect:function(e){var o=this._tooltip.hasChildNodes()?this._tooltip.childNodes:[];for(i=0;i<o.length;i++)t.DomUtil.removeClass(o[i],\"search-tip-select\");if(1==e&&this._tooltip.currentSelection>=o.length-1)t.DomUtil.addClass(o[this._tooltip.currentSelection],\"search-tip-select\");else if(-1==e&&this._tooltip.currentSelection<=0)this._tooltip.currentSelection=-1;else if(\"none\"!=this._tooltip.style.display){this._tooltip.currentSelection+=e,t.DomUtil.addClass(o[this._tooltip.currentSelection],\"search-tip-select\"),this._input.value=o[this._tooltip.currentSelection]._text;var n=o[this._tooltip.currentSelection].offsetTop;n+o[this._tooltip.currentSelection].clientHeight>=this._tooltip.scrollTop+this._tooltip.clientHeight?this._tooltip.scrollTop=n-this._tooltip.clientHeight+o[this._tooltip.currentSelection].clientHeight:n<=this._tooltip.scrollTop&&(this._tooltip.scrollTop=n)}},_handleSubmit:function(){if(this._hideAutoType(),this.hideAlert(),this._hideTooltip(),\"none\"==this._input.style.display)this.expand();else if(\"\"===this._input.value)this.collapse();else{var t=this._getLocation(this._input.value);!1===t?this.showAlert():(this.showLocation(t,this._input.value),this.fire(\"search:locationfound\",{latlng:t,text:this._input.value,layer:t.layer?t.layer:null}))}},_getLocation:function(t){return!!this._recordsCache.hasOwnProperty(t)&&this._recordsCache[t]},_defaultMoveToLocation:function(t,e,i){this.options.zoom?this._map.setView(t,this.options.zoom):this._map.panTo(t)},showLocation:function(t,e){var i=this;return i._map.once(\"moveend zoomend\",(function(e){i._markerSearch&&i._markerSearch.addTo(i._map).setLatLng(t)})),i._moveToLocation(t,e,i._map),i.options.autoCollapse&&i.collapse(),i}}),t.Control.Search.Marker=t.Marker.extend({includes:\"1\"===t.version[0]?t.Evented.prototype:t.Mixin.Events,options:{icon:new t.Icon.Default,animate:!0,circle:{radius:10,weight:3,color:\"#e03\",stroke:!0,fill:!1}},initialize:function(e,i){t.setOptions(this,i),!0===i.icon&&(i.icon=new t.Icon.Default),t.Marker.prototype.initialize.call(this,e,i),t.Control.Search.prototype._isObject(this.options.circle)&&(this._circleLoc=new t.CircleMarker(e,this.options.circle))},onAdd:function(e){t.Marker.prototype.onAdd.call(this,e),this._circleLoc&&(e.addLayer(this._circleLoc),this.options.animate&&this.animate())},onRemove:function(e){t.Marker.prototype.onRemove.call(this,e),this._circleLoc&&e.removeLayer(this._circleLoc)},setLatLng:function(e){return t.Marker.prototype.setLatLng.call(this,e),this._circleLoc&&this._circleLoc.setLatLng(e),this},_initIcon:function(){this.options.icon&&t.Marker.prototype._initIcon.call(this)},_removeIcon:function(){this.options.icon&&t.Marker.prototype._removeIcon.call(this)},animate:function(){if(this._circleLoc){var t=this._circleLoc,e=200,i=5,o=parseInt(t._radius/i),n=this.options.circle.radius,r=2*t._radius,s=0;t._timerAnimLoc=setInterval((function(){r-=o+=s+=.5,t.setRadius(r),r<n&&(clearInterval(t._timerAnimLoc),t.setRadius(n))}),e)}return this}}),t.Map.addInitHook((function(){this.options.searchControl&&(this.searchControl=t.control.search(this.options.searchControl),this.addControl(this.searchControl))})),t.control.search=function(e){return new t.Control.Search(e)},t.Control.Search})?n.apply(e,r):n)||(t.exports=s)},42295:(t,e,i)=>{function o(t){return(o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}i(40561),i(26699),i(32564),i(24812),i(56977),i(91058),i(92222),i(43290),i(82772),i(79753),i(54678),i(74916),i(23123),i(15306),i(82526),i(41817),i(41539),i(32165),i(66992),i(78783),i(33948),function(t,e,i){var n;L.drawVersion=\"0.4.12\",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:\"Cancel drawing\",text:\"Cancel\"},finish:{title:\"Finish drawing\",text:\"Finish\"},undo:{title:\"Delete last point drawn\",text:\"Delete last point\"},buttons:{polyline:\"Draw a polyline\",polygon:\"Draw a polygon\",rectangle:\"Draw a rectangle\",circle:\"Draw a circle\",marker:\"Draw a marker\",circlemarker:\"Draw a circlemarker\"}},handlers:{circle:{tooltip:{start:\"Click and drag to draw circle.\"},radius:\"Radius\"},circlemarker:{tooltip:{start:\"Click map to place circle marker.\"}},marker:{tooltip:{start:\"Click map to place marker.\"}},polygon:{tooltip:{start:\"Click to start drawing shape.\",cont:\"Click to continue drawing shape.\",end:\"Click first point to close this shape.\"}},polyline:{error:\"<strong>Error:</strong> shape edges cannot cross!\",tooltip:{start:\"Click to start drawing line.\",cont:\"Click to continue drawing line.\",end:\"Click last point to finish line.\"}},rectangle:{tooltip:{start:\"Click and drag to draw rectangle.\"}},simpleshape:{tooltip:{end:\"Release mouse to finish drawing.\"}}}},edit:{toolbar:{actions:{save:{title:\"Save changes\",text:\"Save\"},cancel:{title:\"Cancel editing, discards all changes\",text:\"Cancel\"},clearAll:{title:\"Clear all layers\",text:\"Clear All\"}},buttons:{edit:\"Edit layers\",editDisabled:\"No layers to edit\",remove:\"Delete layers\",removeDisabled:\"No layers to delete\"}},handlers:{edit:{tooltip:{text:\"Drag handles or markers to edit features.\",subtext:\"Click cancel to undo changes.\"}},remove:{tooltip:{text:\"Click on a feature to remove.\"}}}}},L.Draw.Event={},L.Draw.Event.CREATED=\"draw:created\",L.Draw.Event.EDITED=\"draw:edited\",L.Draw.Event.DELETED=\"draw:deleted\",L.Draw.Event.DRAWSTART=\"draw:drawstart\",L.Draw.Event.DRAWSTOP=\"draw:drawstop\",L.Draw.Event.DRAWVERTEX=\"draw:drawvertex\",L.Draw.Event.EDITSTART=\"draw:editstart\",L.Draw.Event.EDITMOVE=\"draw:editmove\",L.Draw.Event.EDITRESIZE=\"draw:editresize\",L.Draw.Event.EDITVERTEX=\"draw:editvertex\",L.Draw.Event.EDITSTOP=\"draw:editstop\",L.Draw.Event.DELETESTART=\"draw:deletestart\",L.Draw.Event.DELETESTOP=\"draw:deletestop\",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({includes:L.Mixin.Events,initialize:function(t,e){this._map=t,this._container=t._container,this._overlayPane=t._panes.overlayPane,this._popupPane=t._panes.popupPane,e&&e.shapeOptions&&(e.shapeOptions=L.Util.extend({},this.options.shapeOptions,e.shapeOptions)),L.setOptions(this,e)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire(\"enabled\",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire(\"disabled\",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(L.DomUtil.disableTextSelection(),t.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,\"keyup\",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,\"keyup\",this._cancelDrawing,this))},setOptions:function(t){L.setOptions(this,t)},_fireCreatedEvent:function(t){this._map.fire(L.Draw.Event.CREATED,{layer:t,layerType:this.type})},_cancelDrawing:function(t){27===t.keyCode&&(this._map.fire(\"draw:canceled\",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:\"polyline\"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:\"#b00b00\",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:\"leaflet-div-icon leaflet-editing-icon\"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon\"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1},initialize:function(t,e){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,e&&e.drawError&&(e.drawError=L.Util.extend({},this.options.drawError,e.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:\"leaflet-mouse-marker\",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on(\"mouseout\",this._onMouseOut,this).on(\"mousemove\",this._onMouseMove,this).on(\"mousedown\",this._onMouseDown,this).on(\"mouseup\",this._onMouseUp,this).addTo(this._map),this._map.on(\"mouseup\",this._onMouseUp,this).on(\"mousemove\",this._onMouseMove,this).on(\"zoomlevelschange\",this._onZoomEnd,this).on(\"touchstart\",this._onTouch,this).on(\"zoomend\",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off(\"mousedown\",this._onMouseDown,this).off(\"mouseout\",this._onMouseOut,this).off(\"mouseup\",this._onMouseUp,this).off(\"mousemove\",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off(\"mouseup\",this._onMouseUp,this).off(\"mousemove\",this._onMouseMove,this).off(\"zoomlevelschange\",this._onZoomEnd,this).off(\"zoomend\",this._onZoomEnd,this).off(\"touchstart\",this._onTouch,this).off(\"click\",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var t=this._markers.pop(),e=this._poly,i=e.getLatLngs(),o=i.splice(-1,1)[0];this._poly.setLatLngs(i),this._markerGroup.removeLayer(t),e.getLatLngs().length<2&&this._map.removeLayer(e),this._vertexChanged(o,!1)}},isMarkerInsidePolygon:function(t,e){for(var i=!1,o=t.lat,n=t.lng,r=0;r<e.getLatLngs().length;r++)for(var s=e.getLatLngs()[r],a=0,l=s.length-1;a<s.length;l=a++){var h=s[a].lat,c=s[a].lng,d=s[l].lat,p=s[l].lng;c>n!=p>n&&o<(d-h)*(n-c)/(p-c)+h&&(i=!i)}return i},addVertex:function(t,e){var i=this._markers.length,o=!1;if(e)this._map.eachLayer((function(e){if(e instanceof L.Polygon){for(var i=!1,n=t.lat,r=t.lng,s=0;s<e.getLatLngs().length;s++)for(var a=e.getLatLngs()[s],l=0,h=a.length-1;l<a.length;h=l++){var c=a[l].lat,d=a[l].lng,p=a[h].lat,u=a[h].lng;d>r!=u>r&&n<(p-c)*(r-d)/(u-d)+c&&(i=!i)}i&&(o=!0)}}));else var n=this.pointSnap();if(!o&&i>=1){var r=t,s=this._markers[i-1].getLatLng();o=this.lineInPolygon(r,s);L.polyline([s,r],{opacity:\"0\"}).addTo(this._map)}i>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(t)||o||!n&&!e?this._showErrorTooltip():(this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(t)),this._poly.addLatLng(t),2===this._poly.getLatLngs().length&&this._map.addLayer(this._poly),this._vertexChanged(t,!0))},pointSnap:function(){for(var t=this._snapper._guides,e=0;e<t.length;e++)for(var i=0;i<t[e]._latlngs.length;i++)for(var o=0;o<t[e]._latlngs[i].length;o++)if(t[e]._latlngs[i][o].lat){if(this._snapper._markers[0]._latlng.lat==t[e]._latlngs[i][o].lat&&this._snapper._markers[0]._latlng.lng==t[e]._latlngs[i][o].lng)return!0}else for(var n=0;n<t[e]._latlngs[i][o].length;n++)if(this._snapper._markers[0]._latlng.lat==t[e]._latlngs[i][o][n].lat&&this._snapper._markers[0]._latlng.lng==t[e]._latlngs[i][o][n].lng)return!0;return!1},completeShape:function(){this._markers.length<=1||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},is_in_polygon:function(t,e,i){for(\$c=!1,\$i=\$j=\$c=0,\$longitude_x=i.lng,\$latitude_y=i.lat,\$i=0,\$j=1;\$i<2;\$j=\$i++)e[\$i]>\$latitude_y!=e[\$j]>\$latitude_y&&\$longitude_x<(t[\$j]-t[\$i])*(\$latitude_y-e[\$i])/(e[\$j]-e[\$i])+t[\$i]&&(\$c=!\$c);return \$c},pointOnPolygon:function(t){return this._map.eachLayer((function(e){if(e instanceof L.Polygon&&e.getBounds().contains(t))for(var i=e._latlngs[0],o=i.length,n=0,r=1;n<o;){r==o&&(r=0);var s=L.polyline([e._latlngs[0][n],e._latlngs[0][r]],{opacity:\"0\"}).addTo(e._map);if(s.getBounds().contains(t)){if(0==n&&r==o-1||0==r&&n==o-1)i.splice(0,0,L.latLng(t.lat,t.lng));else{var a=n+r;a/=2,i.splice(Math.ceil(a),0,L.latLng(t.lat,t.lng))}return e._map.removeLayer(s),e._latlngs[0]=i,e.editing.latlngs[0][0]=i,e.redraw(),!0}e._map.removeLayer(s),n++,r++}})),!1},lineInPolygon:function(t,e){var i=!1,o=L.polyline([e,t],{opacity:\"0\"}).addTo(this._map);t.lng=Math.round(1e6*t.lng)/1e6,t.lat=Math.round(1e6*t.lat)/1e6,e.lng=Math.round(1e6*e.lng)/1e6,e.lat=Math.round(1e6*e.lat)/1e6;for(var n=.1;n<=.9;n+=.1){var r=L.GeometryUtil.interpolateOnLine(this._map,o,n),s=[];this._map.eachLayer((function(i){if(i instanceof L.Polygon)for(var o,n=0,r=0;r<i.getLatLngs().length;r++){var a=i.getLatLngs()[r];a[0].lat||(a=a[0]);for(var l=0;l<a.length;l++)a[l].equals(e)&&(o=l-1,n=l+1,0==l?o=a.length-1:l==a.length-1&&(n=0),(a[o].equals(t)||a[n].equals(t))&&s.push(i.options.id))}})),this._map.eachLayer((function(t){if(t instanceof L.Polygon){if(s.includes(t.options.id))return;for(var e=!1,o=r.latLng.lat,n=r.latLng.lng,a=0;a<t.getLatLngs().length;a++)for(var l=t.getLatLngs()[a],h=0,c=l.length-1;h<l.length;c=h++){var d=l[h].lat,p=l[h].lng,u=l[c].lat,_=l[c].lng;p>n!=_>n&&o<(u-d)*(n-p)/(_-p)+d&&(e=!e)}e&&(i=!0)}}))}return this._map.removeLayer(o),i},_finishShape:function(){console.info(\"finishshape\");var t=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),e=this._poly.newLatLngIntersects(t[t.length-1]),i=this._markers.length,o=this._markers[0].getLatLng(),n=this._markers[i-1].getLatLng(),r=this.lineInPolygon(o,n);!this.options.allowIntersection&&e||!this._shapeIsValid()||r?this._showErrorTooltip():(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_shapeIsValid:function(){return!0},_onZoomEnd:function(){null!==this._markers&&this._updateGuide()},_onMouseMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent),i=this._map.layerPointToLatLng(e);this._currentLatLng=i,this._updateTooltip(i),this._updateGuide(e),this._mouseMarker.setLatLng(i),L.DomEvent.preventDefault(t.originalEvent)},_vertexChanged:function(t,e){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(t,e),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(t){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(t),this._clickHandled=!0,this._disableNewMarkers();var e=t.originalEvent,i=e.clientX,o=e.clientY;this._startPoint.call(this,i,o)}},_startPoint:function(t,e){this._mouseDownOrigin=L.point(t,e)},_onMouseUp:function(t){var e=t.originalEvent,i=e.clientX,o=e.clientY;this._endPoint.call(this,i,o,t),this._clickHandled=null},_endPoint:function(e,i,o){if(this._mouseDownOrigin){var n=L.point(e,i).distanceTo(this._mouseDownOrigin);if(this._calculateFinishDistance(o.latlng)<10&&L.Browser.touch)this._finishShape();else if(Math.abs(n)<9*(t.devicePixelRatio||1))if(this._snapper){var r=!1;this._snapper._markers[0]._latlng.lat==o.latlng.lat&&this._snapper._markers[0]._latlng.lng==o.latlng.lng&&(r=!0),this.addVertex(this._snapper._markers[0]._latlng,r)}else this.addVertex(o.latlng,!1);this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(t){var e,i,o=t.originalEvent;!o.touches||!o.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(e=o.touches[0].clientX,i=o.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,e,i),this._endPoint.call(this,e,i,t),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(t){var e;if(this._markers.length>0){var i;if(this.type===L.Draw.Polyline.TYPE)i=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;i=this._markers[0]}var o=this._map.latLngToContainerPoint(i.getLatLng()),n=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),r=this._map.latLngToContainerPoint(n.getLatLng());e=o.distanceTo(r)}else e=1/0;return e},_updateFinishHandler:function(){var t=this._markers.length;t>1&&this._markers[t-1].on(\"click\",this._finishShape,this),t>2&&this._markers[t-2].off(\"click\",this._finishShape,this)},_createMarker:function(t){var e=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(e),e},_updateGuide:function(t){var e=this._markers?this._markers.length:0;e>0&&(t=t||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[e-1].getLatLng()),t))},_updateTooltip:function(t){var e=this._getTooltipText();t&&this._tooltip.updatePosition(t),this._errorShown||this._tooltip.updateContent(e)},_drawGuide:function(t,e){var i,o,n,r=Math.floor(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))),s=this.options.guidelineDistance,a=this.options.maxGuideLineLength,l=r>a?r-a:s;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create(\"div\",\"leaflet-draw-guides\",this._overlayPane));l<r;l+=this.options.guidelineDistance)i=l/r,o={x:Math.floor(t.x*(1-i)+i*e.x),y:Math.floor(t.y*(1-i)+i*e.y)},(n=L.DomUtil.create(\"div\",\"leaflet-draw-guide-dash\",this._guidesContainer)).style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(n,o)},_updateGuideColor:function(t){if(this._guidesContainer)for(var e=0,i=this._guidesContainer.childNodes.length;e<i;e++)this._guidesContainer.childNodes[e].style.backgroundColor=t},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var t,e,i=this.options.showLength;return L.Browser.touch&&(i=!1),0===this._markers.length?t={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(e=i?this._getMeasurementString():\"\",t=1===this._markers.length?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:e}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:e}),t},_updateRunningMeasure:function(t,e){var i,o,n=this._markers.length;1===this._markers.length?this._measurementRunningTotal=0:(i=n-(e?2:1),o=this._map.distance(t,this._markers[i].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=o*(e?1:-1))},_getMeasurementString:function(){var t,e=this._currentLatLng,i=this._markers[this._markers.length-1].getLatLng();return t=i&&e?this._measurementRunningTotal+this._map.distance(e,i)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(t,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout(function(){this._disableMarkers=!1}.bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off(\"click\",this._finishShape,this)},_fireCreatedEvent:function(){var t=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:\"polygon\"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(t,e){L.Draw.Polyline.prototype.initialize.call(this,t,e),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var t=this._markers.length;1===t&&this._markers[0].on(\"click\",this._finishShape,this),t>2&&(this._markers[t-1].on(\"dblclick\",this._finishShape,this),t>3&&this._markers[t-2].off(\"dblclick\",this._finishShape,this))},_getTooltipText:function(){var t,e;return 0===this._markers.length?t=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(t=L.drawLocal.draw.handlers.polygon.tooltip.cont,e=this._getMeasurementString()):(t=L.drawLocal.draw.handlers.polygon.tooltip.end,e=this._getMeasurementString()),{text:t,subtext:e}},_getMeasurementString:function(){var t=this._area,e=\"\";return t||this.options.showLength?(this.options.showLength&&(e=L.Draw.Polyline.prototype._getMeasurementString.call(this)),t&&(e+=\"<br>\"+L.GeometryUtil.readableArea(t,this.options.metric,this.options.precision)),e):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(t,e){var i;!this.options.allowIntersection&&this.options.showArea&&(i=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(i)),L.Draw.Polyline.prototype._vertexChanged.call(this,t,e)},_cleanUpShape:function(){var t=this._markers.length;t>0&&(this._markers[0].off(\"click\",this._finishShape,this),t>2&&this._markers[t-1].off(\"dblclick\",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(t,e){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor=\"crosshair\",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on(\"mousedown\",this._onMouseDown,this).on(\"mousemove\",this._onMouseMove,this).on(\"touchstart\",this._onMouseDown,this).on(\"touchmove\",this._onMouseMove,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor=\"\",this._map.off(\"mousedown\",this._onMouseDown,this).off(\"mousemove\",this._onMouseMove,this).off(\"touchstart\",this._onMouseDown,this).off(\"touchmove\",this._onMouseMove,this),L.DomEvent.off(e,\"mouseup\",this._onMouseUp,this),L.DomEvent.off(e,\"touchend\",this._onMouseUp,this),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(t){this._isDrawing=!0,this._startLatLng=t.latlng,L.DomEvent.on(e,\"mouseup\",this._onMouseUp,this).on(e,\"touchend\",this._onMouseUp,this).preventDefault(t.originalEvent)},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(e))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:\"rectangle\"},options:{shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,showArea:!0,clickable:!0},metric:!0},initialize:function(t,e){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(t){this._shape||this._isCurrentlyTwoClickDrawing?this._isCurrentlyTwoClickDrawing&&!function(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}(t.target,\"leaflet-pane\")||L.Draw.SimpleShape.prototype._onMouseUp.call(this):this._isCurrentlyTwoClickDrawing=!0},_drawShape:function(t){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,t)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,t),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_getTooltipText:function(){var t,e,i,o=L.Draw.SimpleShape.prototype._getTooltipText.call(this),n=this._shape,r=this.options.showArea;return n&&(t=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),e=L.GeometryUtil.geodesicArea(t),i=r?L.GeometryUtil.readableArea(e,this.options.metric):\"\"),{text:o.text,subtext:i}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:\"marker\"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:\"leaflet-mouse-marker\",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on(\"click\",this._onClick,this).addTo(this._map),this._map.on(\"mousemove\",this._onMouseMove,this),this._map.on(\"click\",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._marker&&(this._marker.off(\"click\",this._onClick,this),this._map.off(\"click\",this._onClick,this).off(\"click\",this._onTouch,this).removeLayer(this._marker),delete this._marker),this._mouseMarker.off(\"click\",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off(\"mousemove\",this._onMouseMove,this))},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._mouseMarker.setLatLng(e),this._marker?(e=this._mouseMarker.getLatLng(),this._marker.setLatLng(e)):(this._marker=this._createMarker(e),this._marker.on(\"click\",this._onClick,this),this._map.on(\"click\",this._onClick,this).addLayer(this._marker))},_createMarker:function(t){return new L.Marker(t,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(t){this._onMouseMove(t),this._onClick()},_fireCreatedEvent:function(){var t=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:\"circlemarker\"},options:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t,e)},_fireCreatedEvent:function(){var t=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)},_createMarker:function(t){return new L.CircleMarker(t,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:\"circle\"},options:{shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(t,e){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},_drawShape:function(t){var e=this._map.distance(this._startLatLng,t);this._shape?this._shape.setRadius(e):(this._shape=new L.Circle(this._startLatLng,e,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_onMouseMove:function(t){var e,i=t.latlng,o=this.options.showRadius,n=this.options.metric;if(this._tooltip.updatePosition(i),this._isDrawing){this._drawShape(i),e=this._shape.getRadius().toFixed(1);var r=\"\";o&&(r=L.drawLocal.draw.handlers.circle.radius+\": \"+L.GeometryUtil.readableDistance(e,n,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:r})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(t,e){this._marker=t,L.setOptions(this,e)},addHooks:function(){var t=this._marker;t.dragging.enable(),t.on(\"dragend\",this._onDragEnd,t),this._toggleMarkerHighlight()},removeHooks:function(){var t=this._marker;t.dragging.disable(),t.off(\"dragend\",this._onDragEnd,t),this._toggleMarkerHighlight()},_onDragEnd:function(t){var e=t.target;e.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e})},_toggleMarkerHighlight:function(){var t=this._marker._icon;t&&(t.style.display=\"none\",L.DomUtil.hasClass(t,\"leaflet-edit-marker-selected\")?(L.DomUtil.removeClass(t,\"leaflet-edit-marker-selected\"),this._offsetMarker(t,-4)):(L.DomUtil.addClass(t,\"leaflet-edit-marker-selected\"),this._offsetMarker(t,4)),t.style.display=\"\")},_offsetMarker:function(t,e){var i=parseInt(t.style.marginTop,10)-e,o=parseInt(t.style.marginLeft,10)-e;t.style.marginTop=i+\"px\",t.style.marginLeft=o+\"px\"}}),L.Marker.addInitHook((function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())})),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({options:{},initialize:function(t,e){this.latlngs=[t._latlngs],t._holes&&(this.latlngs=this.latlngs.concat(t._holes)),this._poly=t,L.setOptions(this,e),this._poly.on(\"revert-edited\",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(t){for(var e=0;e<this._verticesHandlers.length;e++)t(this._verticesHandlers[e])},addHooks:function(){this._initHandlers(),this._eachVertexHandler((function(t){t.addHooks()}))},removeHooks:function(){this._eachVertexHandler((function(t){t.removeHooks()}))},updateMarkers:function(){this._eachVertexHandler((function(t){t.updateMarkers()}))},_initHandlers:function(){this._verticesHandlers=[];for(var t=0;t<this.latlngs.length;t++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[t],this.options))},_updateLatLngs:function(t){this.latlngs=[t.layer._latlngs],t.layer._holes&&(this.latlngs=this.latlngs.concat(t.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{allowIntersection:!1,icon:new L.DivIcon({iconSize:new L.Point(8,8),className:\"leaflet-div-icon leaflet-editing-icon\"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon\"}),drawError:{color:\"#b00b00\",timeout:1e3}},initialize:function(t,e,i){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=t,i&&i.drawError&&(i.drawError=L.Util.extend({},this.options.drawError,i.drawError)),this._latlngs=e,L.setOptions(this,i)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var t=this._poly;t instanceof L.Polygon||(t.options.fill=!1,t.options.editing&&(t.options.editing.fill=!1)),t.setStyle(t.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var t=this._poly;t.setStyle(t.options.original),t._map&&(t._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,t.fire(\"editstop\"))},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var t,e,i,o,n,r,s=this._defaultShape();for(t=0,i=s.length;t<i;t++)o=this._createMarker(s[t],t),this._markers.push(o);for(t=0,e=i-1;t<i;e=t++)(0!==t||L.Polygon&&this._poly instanceof L.Polygon)&&(n=this._markers[e],r=this._markers[t],this._createMiddleMarker(n,r),this._updatePrevNext(n,r))},_createMarker:function(t,e){var i=new L.Marker.Touch(t,{draggable:!0,icon:this.options.icon});return i._origLatLng=t,i._index=e,i.on(\"dragstart\",this._onMarkerDragStart,this).on(\"drag\",this._onMarkerDrag,this).on(\"dragend\",this._fireEdit,this).on(\"touchmove\",this._onTouchMove,this).on(\"touchend\",this._fireEdit,this).on(\"MSPointerMove\",this._onTouchMove,this).on(\"MSPointerUp\",this._fireEdit,this),this._markerGroup.addLayer(i),i},_onMarkerDragStart:function(){this._poly.fire(\"editstart\")},_spliceLatLngs:function(){var t=this._defaultShape(),e=[].splice.apply(t,arguments);return this._poly._convertLatLngs(t,!0),this._poly.redraw(),e},_removeMarker:function(t){var e=t._index;this._markerGroup.removeLayer(t),this._markers.splice(e,1),this._spliceLatLngs(e,1),this._updateIndexes(e,-1),t.off(\"dragstart\",this._onMarkerDragStart,this).off(\"drag\",this._onMarkerDrag,this).off(\"dragend\",this._fireEdit,this).off(\"touchmove\",this._onMarkerDrag,this).off(\"touchend\",this._fireEdit,this).off(\"MSPointerMove\",this._onTouchMove,this).off(\"MSPointerUp\",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire(\"edit\"),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(t){var e=t.target;this._poly;L.extend(e._origLatLng,e._latlng),e._middleLeft&&e._middleLeft.setLatLng(this._getMiddleLatLng(e._prev,e)),e._middleRight&&e._middleRight.setLatLng(this._getMiddleLatLng(e,e._next));var i=[];for(var o in this._markers)i.push(this._markers[o].getLatLng());this._poly.setLatLngs(i),this._poly.editing.latlngs[0][0]=i,this._poly.redraw(),this._poly.fire(\"editdrag\")},_onMarkerClick:function(t){var e=L.Polygon&&this._poly instanceof L.Polygon?4:3,i=t.target;this._defaultShape().length<e||(this._removeMarker(i),this._updatePrevNext(i._prev,i._next),i._middleLeft&&this._markerGroup.removeLayer(i._middleLeft),i._middleRight&&this._markerGroup.removeLayer(i._middleRight),i._prev&&i._next?this._createMiddleMarker(i._prev,i._next):i._prev?i._next||(i._prev._middleRight=null):i._next._middleLeft=null,this._fireEdit())},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),i=this._map.layerPointToLatLng(e),o=t.target;L.extend(o._origLatLng,i),o._middleLeft&&o._middleLeft.setLatLng(this._getMiddleLatLng(o._prev,o)),o._middleRight&&o._middleRight.setLatLng(this._getMiddleLatLng(o,o._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(t,e){this._markerGroup.eachLayer((function(i){i._index>t&&(i._index+=e)}))},_createMiddleMarker:function(t,e){var i,o,n,r=this._getMiddleLatLng(t,e),s=this._createMarker(r);s.setOpacity(.6),t._middleRight=e._middleLeft=s,o=function(){s.off(\"touchmove\",o,this);var n=e._index;s._index=n,s.off(\"click\",i,this).on(\"click\",this._onMarkerClick,this),r.lat=s.getLatLng().lat,r.lng=s.getLatLng().lng,this._spliceLatLngs(n,0,r),this._markers.splice(n,0,s),s.setOpacity(1),this._updateIndexes(n,1),e._index++,this._updatePrevNext(t,s),this._updatePrevNext(s,e),this._poly.fire(\"editstart\")},n=function(){if(s.off(\"dragstart\",o,this),s.off(\"dragend\",n,this),s.off(\"touchmove\",o,this),this.intersect){e._index--;var i=e._index;this._spliceLatLngs(i,1),this._updateIndexes(i,-1),this._updatePrevNext(t,e),s.setOpacity(.6),this._poly.redraw(),this.updateMarkers()}else this._createMiddleMarker(t,s),this._createMiddleMarker(s,e)},i=function(){o.call(this),n.call(this),this._fireEdit()},s.on(\"dragstart\",o,this).on(\"dragend\",n,this).on(\"touchmove\",o,this),this._markerGroup.addLayer(s)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,o=i.project(t.getLatLng()),n=i.project(e.getLatLng());return i.unproject(o._add(n)._divideBy(2))}}),L.Polyline.addInitHook((function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this,this.options.poly),this.options.editable&&this.editing.enable()),this.on(\"add\",(function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()})),this.on(\"remove\",(function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})))})),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-move\"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize\"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon\"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon\"})},initialize:function(t,e){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=t,L.Util.setOptions(this,e)},addHooks:function(){var t=this._shape;this._shape._map&&(this._map=this._shape._map,t.setStyle(t.options.editing),t._map&&(this._map=t._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var t=this._shape;if(t.setStyle(t.options.original),t._map){this._unbindMarker(this._moveMarker);for(var e=0,i=this._resizeMarkers.length;e<i;e++)this._unbindMarker(this._resizeMarkers[e]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(t,e){var i=new L.Marker.Touch(t,{draggable:!0,icon:e,zIndexOffset:10});return this._bindMarker(i),this._markerGroup.addLayer(i),i},_bindMarker:function(t){t.on(\"dragstart\",this._onMarkerDragStart,this).on(\"drag\",this._onMarkerDrag,this).on(\"dragend\",this._onMarkerDragEnd,this).on(\"touchstart\",this._onTouchStart,this).on(\"touchmove\",this._onTouchMove,this).on(\"MSPointerMove\",this._onTouchMove,this).on(\"touchend\",this._onTouchEnd,this).on(\"MSPointerUp\",this._onTouchEnd,this)},_unbindMarker:function(t){t.off(\"dragstart\",this._onMarkerDragStart,this).off(\"drag\",this._onMarkerDrag,this).off(\"dragend\",this._onMarkerDragEnd,this).off(\"touchstart\",this._onTouchStart,this).off(\"touchmove\",this._onTouchMove,this).off(\"MSPointerMove\",this._onTouchMove,this).off(\"touchend\",this._onTouchEnd,this).off(\"MSPointerUp\",this._onTouchEnd,this)},_onMarkerDragStart:function(t){t.target.setOpacity(0),this._shape.fire(\"editstart\")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire(\"edit\")},_onMarkerDrag:function(t){var e=t.target,i=e.getLatLng();e===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw(),this._shape.fire(\"editdrag\")},_onMarkerDragEnd:function(t){t.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(t){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t),\"function\"==typeof this._getCorners){var e=this._getCorners(),i=t.target,o=i._cornerIndex;i.setOpacity(0),this._oppositeCorner=e[(o+2)%4],this._toggleCornerMarkers(0,o)}this._shape.fire(\"editstart\")},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),i=this._map.layerPointToLatLng(e);return t.target===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw(),!1},_onTouchEnd:function(t){t.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getBounds().getCenter();this._moveMarker=this._createMarker(t,this.options.moveIcon)},_createResizeMarker:function(){var t=this._getCorners();this._resizeMarkers=[];for(var e=0,i=t.length;e<i;e++)this._resizeMarkers.push(this._createMarker(t[e],this.options.resizeIcon)),this._resizeMarkers[e]._cornerIndex=e},_onMarkerDragStart:function(t){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t);var e=this._getCorners(),i=t.target._cornerIndex;this._oppositeCorner=e[(i+2)%4],this._toggleCornerMarkers(0,i)},_onMarkerDragEnd:function(t){var e,i=t.target;i===this._moveMarker&&(e=this._shape.getBounds().getCenter(),i.setLatLng(e)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,t)},_move:function(t){for(var e,i=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),o=this._shape.getBounds().getCenter(),n=[],r=0,s=i.length;r<s;r++)e=[i[r].lat-o.lat,i[r].lng-o.lng],n.push([t.lat+e[0],t.lng+e[1]]);this._shape.setLatLngs(n),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(t){var e;this._shape.setBounds(L.latLngBounds(t,this._oppositeCorner)),e=this._shape.getBounds(),this._moveMarker.setLatLng(e.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var t=this._shape.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest()]},_toggleCornerMarkers:function(t){for(var e=0,i=this._resizeMarkers.length;e<i;e++)this._resizeMarkers[e].setOpacity(t)},_repositionCornerMarkers:function(){for(var t=this._getCorners(),e=0,i=this._resizeMarkers.length;e<i;e++)this._resizeMarkers[e].setLatLng(t[e])}}),L.Rectangle.addInitHook((function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())})),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getLatLng();this._moveMarker=this._createMarker(t,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(t){if(this._resizeMarkers.length){var e=this._getResizeMarkerPoint(t);this._resizeMarkers[0].setLatLng(e)}this._shape.setLatLng(t),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook((function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on(\"add\",(function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()})),this.on(\"remove\",(function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))})),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var t=this._shape.getLatLng(),e=this._getResizeMarkerPoint(t);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(e,this.options.resizeIcon))},_getResizeMarkerPoint:function(t){var e=this._shape._radius*Math.cos(Math.PI/4),i=this._map.project(t);return this._map.unproject([i.x+e,i.y-e])},_resize:function(t){var e=this._moveMarker.getLatLng(),i=this._map.distance(e,t);this._shape.setRadius(i),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook((function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable()),this.on(\"add\",(function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()})),this.on(\"remove\",(function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))})),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,\"touchstart\",this._onTouchStart,this),L.DomEvent.on(this._container,\"touchend\",this._onTouchEnd,this),L.DomEvent.on(this._container,\"touchmove\",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,\"MSPointerDown\",this._onTouchStart,this),L.DomEvent.on(this._container,\"MSPointerUp\",this._onTouchEnd,this),L.DomEvent.on(this._container,\"MSPointerMove\",this._onTouchMove,this),L.DomEvent.on(this._container,\"MSPointerCancel\",this._onTouchCancel,this)):(L.DomEvent.on(this._container,\"touchcancel\",this._onTouchCancel,this),L.DomEvent.on(this._container,\"touchleave\",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,\"touchstart\",this._onTouchStart),L.DomEvent.off(this._container,\"touchend\",this._onTouchEnd),L.DomEvent.off(this._container,\"touchmove\",this._onTouchMove),this._detectIE()?(L.DomEvent.off(this._container,\"MSPointerDowm\",this._onTouchStart),L.DomEvent.off(this._container,\"MSPointerUp\",this._onTouchEnd),L.DomEvent.off(this._container,\"MSPointerMove\",this._onTouchMove),L.DomEvent.off(this._container,\"MSPointerCancel\",this._onTouchCancel)):(L.DomEvent.off(this._container,\"touchcancel\",this._onTouchCancel),L.DomEvent.off(this._container,\"touchleave\",this._onTouchLeave))},_touchEvent:function(t,e){var i={};if(void 0!==t.touches){if(!t.touches.length)return;i=t.touches[0]}else{if(\"touch\"!==t.pointerType)return;if(i=t,!this._filterClick(t))return}var o=this._map.mouseEventToContainerPoint(i),n=this._map.mouseEventToLayerPoint(i),r=this._map.layerPointToLatLng(n);this._map.fire(e,{latlng:r,layerPoint:n,containerPoint:o,pageX:i.pageX,pageY:i.pageY,originalEvent:t})},_filterClick:function(t){var e=t.timeStamp||t.originalEvent.timeStamp,i=L.DomEvent._lastClick&&e-L.DomEvent._lastClick;return i&&i>100&&i<500||t.target._simulatedClick&&!t._simulated?(L.DomEvent.stop(t),!1):(L.DomEvent._lastClick=e,!0)},_onTouchStart:function(t){if(this._map._loaded){this._touchEvent(t,\"touchstart\")}},_onTouchEnd:function(t){if(this._map._loaded){this._touchEvent(t,\"touchend\")}},_onTouchCancel:function(t){if(this._map._loaded){var e=\"touchcancel\";this._detectIE()&&(e=\"pointercancel\"),this._touchEvent(t,e)}},_onTouchLeave:function(t){if(this._map._loaded){this._touchEvent(t,\"touchleave\")}},_onTouchMove:function(t){if(this._map._loaded){this._touchEvent(t,\"touchmove\")}},_detectIE:function(){var e=t.navigator.userAgent,i=e.indexOf(\"MSIE \");if(i>0)return parseInt(e.substring(i+5,e.indexOf(\".\",i)),10);if(e.indexOf(\"Trident/\")>0){var o=e.indexOf(\"rv:\");return parseInt(e.substring(o+3,e.indexOf(\".\",o)),10)}var n=e.indexOf(\"Edge/\");return n>0&&parseInt(e.substring(n+5,e.indexOf(\".\",n)),10)}}),L.Map.addInitHook(\"addHandler\",\"touchExtend\",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var t=this._icon,e=[\"dblclick\",\"mousedown\",\"mouseover\",\"mouseout\",\"contextmenu\",\"touchstart\",\"touchend\",\"touchmove\"];this._detectIE?e.concat([\"MSPointerDown\",\"MSPointerUp\",\"MSPointerMove\",\"MSPointerCancel\"]):e.concat([\"touchcancel\"]),L.DomUtil.addClass(t,\"leaflet-clickable\"),L.DomEvent.on(t,\"click\",this._onMouseClick,this),L.DomEvent.on(t,\"keypress\",this._onKeyPress,this);for(var i=0;i<e.length;i++)L.DomEvent.on(t,e[i],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var e=t.navigator.userAgent,i=e.indexOf(\"MSIE \");if(i>0)return parseInt(e.substring(i+5,e.indexOf(\".\",i)),10);if(e.indexOf(\"Trident/\")>0){var o=e.indexOf(\"rv:\");return parseInt(e.substring(o+3,e.indexOf(\".\",o)),10)}var n=e.indexOf(\"Edge/\");return n>0&&parseInt(e.substring(n+5,e.indexOf(\".\",n)),10)}}),L.LatLngUtil={cloneLatLngs:function(t){for(var e=[],i=0,o=t.length;i<o;i++)Array.isArray(t[i])?e.push(L.LatLngUtil.cloneLatLngs(t[i])):e.push(this.cloneLatLng(t[i]));return e},cloneLatLng:function(t){return L.latLng(t.lat,t.lng)}},n={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2},L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(t){var e,i,o=t.length,n=0,r=Math.PI/180;if(o>2){for(var s=0;s<o;s++)e=t[s],n+=((i=t[(s+1)%o]).lng-e.lng)*r*(2+Math.sin(e.lat*r)+Math.sin(i.lat*r));n=6378137*n*6378137/2}return Math.abs(n)},formattedNumber:function(t,e){var i=parseFloat(t).toFixed(e),o=L.drawLocal.format&&L.drawLocal.format.numeric,n=o&&o.delimiters,r=n&&n.thousands,s=n&&n.decimal;if(r||s){var a=i.split(\".\");i=r?a[0].replace(/(\\d)(?=(\\d{3})+(?!\\d))/g,\"\$1\"+r):a[0],s=s||\".\",a.length>1&&(i=i+s+a[1])}return i},readableArea:function(t,e,i){var r,s;return i=L.Util.extend({},n,i),e?(s=[\"ha\",\"m\"],type=o(e),\"string\"===type?s=[e]:\"boolean\"!==type&&(s=e),r=t>=1e6&&-1!==s.indexOf(\"km\")?L.GeometryUtil.formattedNumber(1e-6*t,i.km)+\" km²\":t>=1e4&&-1!==s.indexOf(\"ha\")?L.GeometryUtil.formattedNumber(1e-4*t,i.ha)+\" ha\":L.GeometryUtil.formattedNumber(t,i.m)+\" m²\"):r=(t/=.836127)>=3097600?L.GeometryUtil.formattedNumber(t/3097600,i.mi)+\" mi²\":t>=4840?L.GeometryUtil.formattedNumber(t/4840,i.ac)+\" acres\":L.GeometryUtil.formattedNumber(t,i.yd)+\" yd²\",r},readableDistance:function(t,e,i,o,r){var s;switch(r=L.Util.extend({},n,r),e?\"string\"==typeof e?e:\"metric\":i?\"feet\":o?\"nauticalMile\":\"yards\"){case\"metric\":s=t>1e3?L.GeometryUtil.formattedNumber(t/1e3,r.km)+\" km\":L.GeometryUtil.formattedNumber(t,r.m)+\" m\";break;case\"feet\":t*=3.28083,s=L.GeometryUtil.formattedNumber(t,r.ft)+\" ft\";break;case\"nauticalMile\":t*=.53996,s=L.GeometryUtil.formattedNumber(t/1e3,r.nm)+\" nm\";break;case\"yards\":default:s=(t*=1.09361)>1760?L.GeometryUtil.formattedNumber(t/1760,r.mi)+\" miles\":L.GeometryUtil.formattedNumber(t,r.yd)+\" yd\"}return s}}),L.Util.extend(L.LineUtil,{segmentsIntersect:function(t,e,i,o){return this._checkCounterclockwise(t,i,o)!==this._checkCounterclockwise(e,i,o)&&this._checkCounterclockwise(t,e,i)!==this._checkCounterclockwise(t,e,o)},_checkCounterclockwise:function(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}}),L.Polyline.include({intersects:function(){var t,e,i,o=this._getProjectedPoints(),n=o?o.length:0;if(this._tooFewPointsForIntersection())return!1;for(t=n-1;t>=3;t--)if(e=o[t-1],i=o[t],this._lineSegmentsIntersectsRange(e,i,t-2))return!0;return!1},newLatLngIntersects:function(t,e){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(t),e)},newPointIntersects:function(t,e){var i=this._getProjectedPoints(),o=i?i.length:0,n=i?i[o-1]:null,r=o-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(n,t,r,e?1:0)},_tooFewPointsForIntersection:function(t){var e=this._getProjectedPoints(),i=e?e.length:0;return!e||(i+=t||0)<=3},_lineSegmentsIntersectsRange:function(t,e,i,o){var n,r,s=this._getProjectedPoints();o=o||0;for(var a=i;a>o;a--)if(n=s[a-1],r=s[a],L.LineUtil.segmentsIntersect(t,e,n,r))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var t=[],e=this._defaultShape(),i=0;i<e.length;i++)t.push(this._map.latLngToLayerPoint(e[i]));return t}}),L.Polygon.include({intersects:function(){var t,e,i,o,n=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(t=n.length,e=n[0],i=n[t-1],o=t-2,this._lineSegmentsIntersectsRange(i,e,o,1)))}}),L.Control.Draw=L.Control.extend({options:{position:\"topleft\",draw:{},edit:!1},initialize:function(t){if(L.version<\"0.7\")throw new Error(\"Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/\");var e;L.Control.prototype.initialize.call(this,t),this._toolbars={},L.DrawToolbar&&this.options.draw&&(e=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=e,this._toolbars[L.DrawToolbar.TYPE].on(\"enable\",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(e=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=e,this._toolbars[L.EditToolbar.TYPE].on(\"enable\",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(t){var e,i=L.DomUtil.create(\"div\",\"leaflet-draw\"),o=!1,n=\"leaflet-draw-toolbar-top\";for(var r in this._toolbars)this._toolbars.hasOwnProperty(r)&&(e=this._toolbars[r].addToolbar(t))&&(o||(L.DomUtil.hasClass(e,n)||L.DomUtil.addClass(e.childNodes[0],n),o=!0),i.appendChild(e));return i},onRemove:function(){for(var t in this._toolbars)this._toolbars.hasOwnProperty(t)&&this._toolbars[t].removeToolbar()},setDrawingOptions:function(t){for(var e in this._toolbars)this._toolbars[e]instanceof L.DrawToolbar&&this._toolbars[e].setOptions(t)},_toolbarEnabled:function(t){var e=t.target;for(var i in this._toolbars)this._toolbars[i]!==e&&this._toolbars[i].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook((function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))})),L.Toolbar=L.Class.extend({includes:[L.Mixin.Events],initialize:function(t){L.setOptions(this,t),this._modes={},this._actionButtons=[],this._activeMode=null},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(t){var e,i=L.DomUtil.create(\"div\",\"leaflet-draw-section\"),o=0,n=this._toolbarClass||\"\",r=this.getModeHandlers(t);for(this._toolbarContainer=L.DomUtil.create(\"div\",\"leaflet-draw-toolbar leaflet-bar\"),this._map=t,e=0;e<r.length;e++)r[e].enabled&&this._initModeHandler(r[e].handler,this._toolbarContainer,o++,n,r[e].title);if(o)return this._lastButtonIndex=--o,this._actionsContainer=L.DomUtil.create(\"ul\",\"leaflet-draw-actions\"),i.appendChild(this._toolbarContainer),i.appendChild(this._actionsContainer),i},removeToolbar:function(){for(var t in this._modes)this._modes.hasOwnProperty(t)&&(this._disposeButton(this._modes[t].button,this._modes[t].handler.enable,this._modes[t].handler),this._modes[t].handler.disable(),this._modes[t].handler.off(\"enabled\",this._handlerActivated,this).off(\"disabled\",this._handlerDeactivated,this));this._modes={};for(var e=0,i=this._actionButtons.length;e<i;e++)this._disposeButton(this._actionButtons[e].button,this._actionButtons[e].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(t,e,i,o,n){var r=t.type;this._modes[r]={},this._modes[r].handler=t,this._modes[r].button=this._createButton({type:r,title:n,className:o+\"-\"+r,container:e,callback:this._modes[r].handler.enable,context:this._modes[r].handler}),this._modes[r].buttonIndex=i,this._modes[r].handler.on(\"enabled\",this._handlerActivated,this).on(\"disabled\",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!t.MSStream},_createButton:function(t){var e=L.DomUtil.create(\"a\",t.className||\"\",t.container),i=L.DomUtil.create(\"span\",\"sr-only\",t.container);e.href=\"#\",e.appendChild(i),t.title&&(e.title=t.title,i.innerHTML=t.title),t.text&&(e.innerHTML=t.text,i.innerHTML=t.text);var o=this._detectIOS()?\"touchstart\":\"click\";return L.DomEvent.on(e,\"click\",L.DomEvent.stopPropagation).on(e,\"mousedown\",L.DomEvent.stopPropagation).on(e,\"dblclick\",L.DomEvent.stopPropagation).on(e,\"touchstart\",L.DomEvent.stopPropagation).on(e,\"click\",L.DomEvent.preventDefault).on(e,o,t.callback,t.context),e},_disposeButton:function(t,e){var i=this._detectIOS()?\"touchstart\":\"click\";L.DomEvent.off(t,\"click\",L.DomEvent.stopPropagation).off(t,\"mousedown\",L.DomEvent.stopPropagation).off(t,\"dblclick\",L.DomEvent.stopPropagation).off(t,\"touchstart\",L.DomEvent.stopPropagation).off(t,\"click\",L.DomEvent.preventDefault).off(t,i,e)},_handlerActivated:function(t){this.disable(),this._activeMode=this._modes[t.handler],L.DomUtil.addClass(this._activeMode.button,\"leaflet-draw-toolbar-button-enabled\"),this._showActionsToolbar(),this.fire(\"enable\")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,\"leaflet-draw-toolbar-button-enabled\"),this._activeMode=null,this.fire(\"disable\")},_createActions:function(t){var e,i,o,n,r=this._actionsContainer,s=this.getActions(t),a=s.length;for(i=0,o=this._actionButtons.length;i<o;i++)this._disposeButton(this._actionButtons[i].button,this._actionButtons[i].callback);for(this._actionButtons=[];r.firstChild;)r.removeChild(r.firstChild);for(var l=0;l<a;l++)\"enabled\"in s[l]&&!s[l].enabled||(e=L.DomUtil.create(\"li\",\"\",r),n=this._createButton({title:s[l].title,text:s[l].text,container:e,callback:s[l].callback,context:s[l].context}),this._actionButtons.push({button:n,callback:s[l].callback}))},_showActionsToolbar:function(){var t=this._activeMode.buttonIndex,e=this._lastButtonIndex,i=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=i+\"px\",0===t&&(L.DomUtil.addClass(this._toolbarContainer,\"leaflet-draw-toolbar-notop\"),L.DomUtil.addClass(this._actionsContainer,\"leaflet-draw-actions-top\")),t===e&&(L.DomUtil.addClass(this._toolbarContainer,\"leaflet-draw-toolbar-nobottom\"),L.DomUtil.addClass(this._actionsContainer,\"leaflet-draw-actions-bottom\")),this._actionsContainer.style.display=\"block\"},_hideActionsToolbar:function(){this._actionsContainer.style.display=\"none\",L.DomUtil.removeClass(this._toolbarContainer,\"leaflet-draw-toolbar-notop\"),L.DomUtil.removeClass(this._toolbarContainer,\"leaflet-draw-toolbar-nobottom\"),L.DomUtil.removeClass(this._actionsContainer,\"leaflet-draw-actions-top\"),L.DomUtil.removeClass(this._actionsContainer,\"leaflet-draw-actions-bottom\")}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(t){this._map=t,this._popupPane=t._panes.popupPane,this._visible=!1,this._container=t.options.drawControlTooltips?L.DomUtil.create(\"div\",\"leaflet-draw-tooltip\",this._popupPane):null,this._singleLineLabel=!1,this._map.on(\"mouseout\",this._onMouseOut,this)},dispose:function(){this._map.off(\"mouseout\",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(t){return this._container?(t.subtext=t.subtext||\"\",0!==t.subtext.length||this._singleLineLabel?t.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,\"leaflet-draw-tooltip-single\"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,\"leaflet-draw-tooltip-single\"),this._singleLineLabel=!0),this._container.innerHTML=(t.subtext.length>0?'<span class=\"leaflet-draw-tooltip-subtext\">'+t.subtext+\"</span><br />\":\"\")+\"<span>\"+t.text+\"</span>\",t.text||t.subtext?(this._visible=!0,this._container.style.visibility=\"inherit\"):(this._visible=!1,this._container.style.visibility=\"hidden\"),this):this},updatePosition:function(t){var e=this._map.latLngToLayerPoint(t),i=this._container;return this._container&&(this._visible&&(i.style.visibility=\"inherit\"),L.DomUtil.setPosition(i,e)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,\"leaflet-error-draw-tooltip\"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,\"leaflet-error-draw-tooltip\"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility=\"hidden\")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:\"draw\"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(t){for(var e in this.options)this.options.hasOwnProperty(e)&&t[e]&&(t[e]=L.extend({},this.options[e],t[e]));this._toolbarClass=\"leaflet-draw-draw\",L.Toolbar.prototype.initialize.call(this,t)},getModeHandlers:function(t){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(t,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(t,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(t,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(t,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(t,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(t,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(t){return[{enabled:t.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:t.deleteLastVertex,context:t},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(t){for(var e in L.setOptions(this,t),this._modes)this._modes.hasOwnProperty(e)&&t.hasOwnProperty(e)&&this._modes[e].handler.setOptions(t[e])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:\"edit\"},options:{edit:{selectedPathOptions:{dashArray:\"10, 10\",fill:!0,fillColor:\"#fe57a1\",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(t){t.edit&&(void 0===t.edit.selectedPathOptions&&(t.edit.selectedPathOptions=this.options.edit.selectedPathOptions),t.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,t.edit.selectedPathOptions)),t.remove&&(t.remove=L.extend({},this.options.remove,t.remove)),t.poly&&(t.poly=L.extend({},this.options.poly,t.poly)),this._toolbarClass=\"leaflet-draw-edit\",L.Toolbar.prototype.initialize.call(this,t),this._selectedFeatureCount=0},getModeHandlers:function(t){var e=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(t,{featureGroup:e,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(t,{featureGroup:e}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(t){var e=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return t.removeAllLayers&&e.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),e},addToolbar:function(t){var e=L.Toolbar.prototype.addToolbar.call(this,t);return this._checkDisabled(),this.options.featureGroup.on(\"layeradd layerremove\",this._checkDisabled,this),e},removeToolbar:function(){this.options.featureGroup.off(\"layeradd layerremove\",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var t,e=0!==this.options.featureGroup.getLayers().length;this.options.edit&&(t=this._modes[L.EditToolbar.Edit.TYPE].button,e?L.DomUtil.removeClass(t,\"leaflet-disabled\"):L.DomUtil.addClass(t,\"leaflet-disabled\"),t.setAttribute(\"title\",e?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(t=this._modes[L.EditToolbar.Delete.TYPE].button,e?L.DomUtil.removeClass(t,\"leaflet-disabled\"):L.DomUtil.addClass(t,\"leaflet-disabled\"),t.setAttribute(\"title\",e?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:\"edit\"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.setOptions(this,e),this._featureGroup=e.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error(\"options.featureGroup must be a L.FeatureGroup\");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire(\"enabled\",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on(\"layeradd\",this._enableLayerEdit,this).on(\"layerremove\",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off(\"layeradd\",this._enableLayerEdit,this).off(\"layerremove\",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire(\"disabled\",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),t._editTooltip=this._tooltip,this._updateTooltip(),this._map.on(\"mousemove\",this._onMouseMove,this).on(\"touchmove\",this._onMouseMove,this).on(\"MSPointerMove\",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off(\"mousemove\",this._onMouseMove,this).off(\"touchmove\",this._onMouseMove,this).off(\"MSPointerMove\",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer((function(t){this._revertLayer(t)}),this)},save:function(){var t=new L.LayerGroup;this._featureGroup.eachLayer((function(e){e.edited&&(t.addLayer(e),e.edited=!1)})),this._map.fire(L.Draw.Event.EDITED,{layers:t})},_backupLayer:function(t){var e=L.Util.stamp(t);this._uneditedLayerProps[e]||(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?this._uneditedLayerProps[e]={latlngs:L.LatLngUtil.cloneLatLngs(t.getLatLngs())}:t instanceof L.Circle?this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng()),radius:t.getRadius()}:(t instanceof L.Marker||t instanceof L.CircleMarker)&&(this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(t){var e=L.Util.stamp(t);t.edited=!1,this._uneditedLayerProps.hasOwnProperty(e)&&(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?t.setLatLngs(this._uneditedLayerProps[e].latlngs):t instanceof L.Circle?(t.setLatLng(this._uneditedLayerProps[e].latlng),t.setRadius(this._uneditedLayerProps[e].radius)):(t instanceof L.Marker||t instanceof L.CircleMarker)&&t.setLatLng(this._uneditedLayerProps[e].latlng),t.fire(\"revert-edited\",{layer:t}))},_enableLayerEdit:function(t){var e,i,o=t.layer||t.target||t;this._backupLayer(o),this.options.poly&&(i=L.Util.extend({},this.options.poly),o.options.poly=i),this.options.selectedPathOptions&&((e=L.Util.extend({},this.options.selectedPathOptions)).maintainColor&&(e.color=o.options.color,e.fillColor=o.options.fillColor),o.options.original=L.extend({},o.options),o.options.editing=e),o instanceof L.Marker?(o.editing&&o.editing.enable(),o.dragging.enable(),o.on(\"dragend\",this._onMarkerDragEnd).on(\"touchmove\",this._onTouchMove,this).on(\"MSPointerMove\",this._onTouchMove,this).on(\"touchend\",this._onMarkerDragEnd,this).on(\"MSPointerUp\",this._onMarkerDragEnd,this)):o.editing.enable()},_disableLayerEdit:function(t){var e=t.layer||t.target||t;e.edited=!1,e.editing&&e.editing.disable(),delete e.options.editing,delete e.options.original,this._selectedPathOptions&&(e instanceof L.Marker?this._toggleMarkerHighlight(e):(e.setStyle(e.options.previousOptions),delete e.options.previousOptions)),e instanceof L.Marker?(e.dragging.disable(),e.off(\"dragend\",this._onMarkerDragEnd,this).off(\"touchmove\",this._onTouchMove,this).off(\"MSPointerMove\",this._onTouchMove,this).off(\"touchend\",this._onMarkerDragEnd,this).off(\"MSPointerUp\",this._onMarkerDragEnd,this)):e.editing.disable()},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_onMarkerDragEnd:function(t){var e=t.target;e.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e})},_onTouchMove:function(t){var e=t.originalEvent.changedTouches[0],i=this._map.mouseEventToLayerPoint(e),o=this._map.layerPointToLatLng(i);t.target.setLatLng(o)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:\"remove\"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.Util.setOptions(this,e),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error(\"options.featureGroup must be a L.FeatureGroup\");this.type=L.EditToolbar.Delete.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire(\"enabled\",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on(\"layeradd\",this._enableLayerDelete,this).on(\"layerremove\",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off(\"layeradd\",this._enableLayerDelete,this).off(\"layerremove\",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire(\"disabled\",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on(\"mousemove\",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off(\"mousemove\",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer((function(t){this._deletableLayers.addLayer(t),t.fire(\"revert-deleted\",{layer:t})}),this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer((function(t){this._removeLayer({layer:t})}),this),this.save()},_enableLayerDelete:function(t){(t.layer||t.target||t).on(\"click\",this._removeLayer,this)},_disableLayerDelete:function(t){var e=t.layer||t.target||t;e.off(\"click\",this._removeLayer,this),this._deletedLayers.removeLayer(e)},_removeLayer:function(t){var e=t.layer||t.target||t;this._deletableLayers.removeLayer(e),this._deletedLayers.addLayer(e),e.fire(\"deleted\")},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})}(window,document)},49931:(t,e,i)=>{\"use strict\";i(21249),i(26699),i(69826),i(9653),i(74916),i(15306),i(82772),i(23123),i(83710),i(85827),i(89554),i(54747),i(5212),i(40561);var o=i(20508),n=i(62104),r=i(33258),s=i(80258),a=i(72863),l=i(92938),h=i(82270),c=i(73385),d=i(46951),p=i(59434),u=i(33804),_=i(80739),f=i(81311),m=i(47102),g=i(368),v=(i(45243),i(58646),i(83782),i(42295),i(94979),i(19755));v(document).on(\"ready turbo:load\",(function(){v(window).resize((function(){var t=344,e=60;v(\"#filter-container\").hasClass(\"active\")&&(t=482),v(\"#blocRight\").hasClass(\"active\")||(e=97),v(\"#sectorisationMap\").css(\"width\",e+\"%\");var i=v(window).height()-t;v(\"#sectorisationMap\").css(\"height\",i+30+\"px\"),v(\"#blocTab\").css(\"height\",i+\"px\"),v(\"#explainMe\").css(\"height\",i+\"px\"),v(\"#containerMap\").css(\"height\",i+30+\"px\")})),v(\".dx-datagrid-search-panel\").css(\"width\",\"250px\"),v(window).trigger(\"resize\"),document.getElementById(\"filter-image\").addEventListener(\"click\",(function(){v(\"#listeAgents\").hasClass(\"visible\")||(v(\"#listeAgents\").addClass(\"visible\"),v(\"#listeAgents\").show()),v(window).trigger(\"resize\")})),v(\"#minimize-tab\").click((function(){v(\"#blocRight\").toggleClass(\"active\"),v(window).trigger(\"resize\")}));var t=[\"SPRINGGREEN\",\"aqua\",\"yellow\",\"DEEPPINK\",\"STEELBLUE\",\"green\",\"GOLDENROD\",\"DEEPSKYBLUE\",\"magenta\",\"purple\",\"orange\",\"DARKRED\",\"maroon\"],e=[\"VERGNIEUX\",\"HANNIQUET\",\"GOSNET\",\"CHEZE\",\"LAHALLE\"],i=[],y=JSON.parse(v(\"#tabAgents\")[0].innerHTML),k=v(\"#site\")[0].innerHTML;console.info(K);var w=[];for(var b in y)w[y[b].code_agent]||(w[y[b].code_agent]=[]),w[y[b].code_agent].nbClients=y[b].nb_clients,w[y[b].code_agent].famille0=y[b].famille0,w[y[b].code_agent].famille1=y[b].famille1,w[y[b].code_agent].famille2=y[b].famille2,w[y[b].code_agent].famille3=y[b].famille3;new L.layerGroup;var M=!1,E=!0,D=!0,x=!1,T=new L.FeatureGroup,C=!1,P=[],S=L.icon({iconUrl:n,iconAnchor:[12,21]}),A=(L.icon({iconUrl:r,iconAnchor:[12,21]}),L.icon({iconUrl:s,iconSize:[14,14],iconAnchor:[7,7]})),O=(L.icon({iconUrl:a,iconSize:[20,20],iconAnchor:[10,10]}),11),I=[48.876457644366816,2.3644638061523438];\"BRON\"==k?I=[45.75,4.85]:\"HANNIQUET\"==k?(I=[48.385,2.951],O=10):\"GOSNET\"==k?(I=[49.429,2.08],O=9):\"LAHALLE\"==k?(I=[48.8,2.1900052],O=12):\"VERGNIEUX\"==k?(I=[48.62,1.7800076],O=10):\"CHEZE\"==k&&(I=[48.5309275,2.1939081],O=10);var z=L.map(\"sectorisationMap\").setView(I,O);z.zoomControl._zoomInButton.title=\"Zoom avant\",z.zoomControl._zoomOutButton.title=\"Zoom arrière\";L.control.scale({position:\"bottomright\"}).addTo(z);var U=L.tileLayer(\"http://sfcp.frisquet.com/?t={z}/{x}/{y}&th=ggl\",{maxZoom:18,detectRetina:!0,attribution:'<a target=\"_blank\" href=\"https://icones8.fr\">Icons8</a>'});U.addTo(z);var H=L.tileLayer(\"http://{s}.tile.osm.org/{z}/{x}/{y}.png\",{attribution:'&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors | &copy <a target=\"_blank\" href=\"https://icones8.fr\">Icons8</a>'}),G=L.tileLayer(\"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}\",{attribution:'Tiles &copy; Esri | &copy <a target=\"_blank\" href=\"https://icones8.fr\">Icons8</a>'}),R=L.tileLayer(\"https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}\",{attribution:'Tiles &copy; Esri | &copy <a target=\"_blank\" href=\"https://icones8.fr\">Icons8</a>'}),N=L.tileLayer(\"http://{s}.tile.osm.org/{z}/{x}/{y}.png\",{attribution:'&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors | &copy <a target=\"_blank\" href=\"https://icones8.fr\">Icons8</a>'}),F=L.map(\"histoMap\").setView(I,11);F.zoomControl._zoomInButton.title=\"Zoom avant\",F.zoomControl._zoomOutButton.title=\"Zoom arrière\",N.addTo(F);var B={\"Google Map\":U,Plan:H,Satellite:G,Topographique:R};L.control.layers(B).addTo(z);var V=[],j=(new L.FeatureGroup,new L.FeatureGroup,new L.FeatureGroup),W=new L.FeatureGroup;z.addLayer(W);var Y=new L.FeatureGroup;z.addLayer(Y);var \$=new L.FeatureGroup;z.addLayer(\$);var q=new L.FeatureGroup;z.addLayer(q);var X=new L.FeatureGroup;z.addLayer(X);var Z=new L.FeatureGroup;F.addLayer(Z);var K=new L.FeatureGroup;if(z.addLayer(K),e.includes(k))var J={position:\"topright\",draw:{polyline:!1,polygon:!1,circle:!1,rectangle:!1,marker:!1,circlemarker:!1},edit:!1};else J={position:\"topright\",draw:{polyline:!1,polygon:{shapeOptions:{color:\"#000\",opacity:1,weight:2},allowIntersection:!1,showArea:!0,drawError:{color:\"red\",message:\"<strong>Oh non !<strong> Vous ne pouvez pas tracer ça !\"},guideLayers:V},circle:!1,rectangle:!1,marker:!1,circlemarker:!1},edit:!1};var Q=new L.Control.Draw(J);z.addControl(Q),z.addControl(new L.Control.Search({url:\"https://nominatim.openstreetmap.org/search?format=json&q={s}\",textPlaceholder:\"Adresse, ville...\",textErr:\"Localisation non trouvé\",jsonpParam:\"json_callback\",propertyName:\"display_name\",propertyLoc:[\"lat\",\"lon\"],hideMarkerOnCollapse:!0,autoCollapse:!0,autoType:!1,minLength:2,zoom:14}));var tt=L.Control.extend({options:{position:\"topleft\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Retour arrière\"),e.setAttribute(\"id\",\"undo\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+l+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.style.position=\"relative\",e.style.display=\"none\",e.onclick=function(){undo()},e}});z.addControl(new tt);var et=L.Control.extend({options:{position:\"topleft\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Rafraîchir / Effacer les modifications non enregistrées\"),e.setAttribute(\"id\",\"refresh\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+h+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.onclick=function(){refresh(\"\",\"\",!0)},e}});z.addControl(new et);var it=L.Control.extend({options:{position:\"topleft\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Sauvegarde des secteurs\"),e.setAttribute(\"id\",\"save\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+o+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\"> <img src=\"'+c+'\" id=\"pastille\" style=\"position: absolute;right:0;bottom: 0;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.style.position=\"relative\",e.onclick=function(){if(P.length>1){for(var t in v(\"#saveMe #historiqueActions\")[0].innerHTML=\"\",P)t>0&&(v(\"#saveMe #historiqueActions\")[0].innerHTML+=\"<li>\"+P[t].texte+\"</li>\");v(\"#saveModif\")[0].disabled=!1,v(\"#deleteModif\")[0].disabled=!1}else v(\"#saveMe #historiqueActions\")[0].innerHTML=\"Aucune modification en cours.\",v(\"#saveModif\")[0].disabled=!0,v(\"#deleteModif\")[0].disabled=!0;v(\"#saveMe\").modal(\"show\"),v(\"#deleteModif\").off(\"click\"),v(\"#deleteModif\").on(\"click\",(function(t){v(\"#saveMe\").modal(\"hide\"),refresh()}))},e}});if(z.addControl(new it),\"MEAUX\"==k){it=L.Control.extend({options:{position:\"topleft\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Synchronisation\"),e.setAttribute(\"id\",\"synchro\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+d+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.style.position=\"relative\",e.onclick=function(){synchro()},e}});z.addControl(new it)}v(\"body\").on(\"submit\",\"form#form_save\",(function(t){v(this);if(t.preventDefault(),P.length>0){for(var e=document.getElementsByClassName(\"dateMep\"),i=!1,o=0;o<e.length;o++)if(e[o].innerHTML==v(\"#dateMep\").val()){i=!0;break}i?(v(\"#saveMe\").modal(\"hide\"),v(\"#alertDate\").modal(\"show\"),v(\"#confirmEcrase\").off(\"click\"),v(\"#confirmEcrase\").on(\"click\",(function(t){v(\"#alertDate\").modal(\"hide\"),saveVersion()}))):saveVersion()}}));var ot=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Création assistée secteur\"),e.setAttribute(\"id\",\"creationAssist\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+p+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.style.position=\"relative\",e.onclick=function(){hideFunctions(),v(\"#legende p#texte\")[0].innerHTML=\"Sélectionnez deux points non adjacent pour créer un secteur\",v(\"#explainMe\").show(),!0,!0,j=new L.FeatureGroup,t.addLayer(j),!1;for(var e=0;e<\$._latlngs.length;e++)for(var i=0;i<\$._latlngs[e].length;i++)if(\$._latlngs[e][i].lat){var o=new L.Marker(\$._latlngs[e][i],{pos:i,icon:S});j.addLayer(o),o.on(\"click\",(function(t){clickMarkerAssist(this)}))}else for(var n=0;n<\$._latlngs[e][i].length;n++){o=new L.Marker(\$._latlngs[e][i][n],{pos:n,icon:S});j.addLayer(o),o.on(\"click\",(function(t){clickMarkerAssist(this)}))}},e}});e.includes(k)||z.addControl(new ot);var nt=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Afficher le nombre de clients par secteurs\"),e.setAttribute(\"id\",\"nbClients\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+u+'\"  style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.onclick=function(){t.eachLayer((function(t){t instanceof L.Polygon&&t.toggleTooltip()})),M=!M},e}});z.addControl(new nt);var rt=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Afficher les agents\"),e.setAttribute(\"id\",\"agents\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+_+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.onclick=function(){E=bt(E,K)},e}});z.addControl(new rt);var st=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Afficher l'agent principal des secteurs\"),e.setAttribute(\"id\",\"principal\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+f+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.onclick=function(){D=bt(D,X)},e}});z.addControl(new st);var at=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Afficher la densité client\"),e.setAttribute(\"id\",\"densite\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+m+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.onclick=function(){x=bt(x,\"\")},e}});z.addControl(new at);var lt,ht=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Afficher les clients hors secteurs\"),e.setAttribute(\"id\",\"clients\"),e.style.backgroundColor=\"white\",e.innerHTML='<div id=\"nbClientHorsSecteur\" class=\"alertes\" style=\"font-size:10px;margin:0px;\">0</div><img src=\"'+g+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"45px\",e.onclick=function(){C=bt(C,T)},e}});z.addControl(new ht),v.ajax({method:\"POST\",dataType:\"json\",url:\"/map/get_secteurs\",data:JSON.stringify({version:lt}),success:function(e){var o=[],n=0;e.forEach((function(e){if(\"Polygon\"==e.coordonnees.type){e.coordonnees.coordinates[0].forEach((function(t){o.push([t[1],t[0]])}));var r=L.polygon(o,{}).addTo(z),s=!0;e.agentSecteurs.some((function(e){if(1==e.rang_tri){i[e.utilisateur_agent.groupe_affectation]||(i[e.utilisateur_agent.groupe_affectation]=t[n],n+=1),r.setStyle(wt(e.utilisateur_agent.groupe_affectation)),s=!1;var o=new L.CircleMarker(r.getCenter(),{radius:.1,opacity:0,codeAgent:e.utilisateur_agent.initiales}).bindTooltip(\"\"+e.utilisateur_agent.initiales,{permanent:!0,direction:\"center\",className:\"my-labels\"});return X.addLayer(o),!0}})),s&&r.setStyle(wt(\"\")),function(t,e){e.bindTooltip(t.nbEquipement.nb_total+\" clients\",{permanent:!0,direction:\"center\"}).closeTooltip()}(e,r),o=[],function(t){t.on(\"mouseover mouseout\",(function(e){t.toggleTooltip()}))}(r)}}))}}),v.ajax({dataType:\"json\",url:\"/agents/domicile\",success:function(t){console.info(t),t.forEach((function(t){var e=[0,0];null!=t.coordonnees&&(e=[t.coordonnees.latitude,t.coordonnees.longitude]);var i=L.marker(e,{radius:6,fillColor:\"#28529a\",color:\"#fff\",weight:1,opacity:1,fillOpacity:1,icon:A}).addTo(z);i.bindPopup(t.nomComplet),K.addLayer(i)}))}});var ct=v(\".cd-horizontal-timeline\"),dt=17;function pt(t,e,i,o){var n=Lt(t.eventsWrapper),r=Number(t.timelineWrapper.css(\"width\").replace(\"px\",\"\"));\"next\"==i?_t(t,(n-r+dt)*o,r-e):_t(t,n+r-dt)}function ut(t,e,i){var o=t.eventsContent.find(\".selected\");if((\"next\"==i?o.next():o.prev()).length>0){var n=t.eventsWrapper.find(\".selected\"),r=\"next\"==i?n.parent(\"li\").next(\"li\").children(\"a\"):n.parent(\"li\").prev(\"li\").children(\"a\");ft(r,t.fillingLine,e),mt(r,t.eventsContent),r.addClass(\"selected\"),n.removeClass(\"selected\"),gt(r),function(t,e,i,o){var n=window.getComputedStyle(e.get(0),null),r=Number(n.getPropertyValue(\"left\").replace(\"px\",\"\")),s=Number(i.timelineWrapper.css(\"width\").replace(\"px\",\"\")),a=(o=Number(i.eventsWrapper.css(\"width\").replace(\"px\",\"\")),Lt(i.eventsWrapper));(\"next\"==t&&r>s-a||\"prev\"==t&&r<-a)&&_t(i,s/2-r,s-o)}(i,r,t,e)}}function _t(t,e,i){e=e>0?0:e,vt(t.eventsWrapper.get(0),\"translateX\",(e=void 0!==i&&e<i?i:e)+\"px\"),0==e?t.timelineNavigation.find(\".prev\").addClass(\"inactive\"):t.timelineNavigation.find(\".prev\").removeClass(\"inactive\"),e==i?t.timelineNavigation.find(\".next\").addClass(\"inactive\"):t.timelineNavigation.find(\".next\").removeClass(\"inactive\")}function ft(t,e,i){var o=window.getComputedStyle(t.get(0),null),n=o.getPropertyValue(\"left\"),r=o.getPropertyValue(\"width\"),s=(n=Number(n.replace(\"%\",\"\"))+Number(r.replace(\"%\",\"\"))/2)/i;vt(e.get(0),\"scaleX\",s)}function mt(t,e){var i=t.data(\"date\"),o=e.find(\".selected\"),n=e.find('[data-date=\"'+i+'\"]'),r=n.height();if(n.index()>o.index())var s=\"selected enter-right\",a=\"leave-left\";else s=\"selected enter-left\",a=\"leave-right\";n.attr(\"class\",s),o.attr(\"class\",a).one(\"webkitAnimationEnd oanimationend msAnimationEnd animationend\",(function(){o.removeClass(\"leave-right leave-left\"),n.removeClass(\"enter-left enter-right\")})),e.css(\"height\",r+\"px\")}function gt(t){t.parent(\"li\").prevAll(\"li\").children(\"a\").addClass(\"older-event\").end().end().nextAll(\"li\").children(\"a\").removeClass(\"older-event\")}function Lt(t){var e=window.getComputedStyle(t.get(0),null);if((i=e.getPropertyValue(\"-webkit-transform\")||e.getPropertyValue(\"-moz-transform\")||e.getPropertyValue(\"-ms-transform\")||e.getPropertyValue(\"-o-transform\")||e.getPropertyValue(\"transform\")).indexOf(\"(\")>=0)var i,o=(i=(i=(i=i.split(\"(\")[1]).split(\")\")[0]).split(\",\"))[4];else o=0;return Number(o)}function vt(t,e,i){t.style[\"-webkit-transform\"]=e+\"(\"+i+\")\",t.style[\"-moz-transform\"]=e+\"(\"+i+\")\",t.style[\"-ms-transform\"]=e+\"(\"+i+\")\",t.style[\"-o-transform\"]=e+\"(\"+i+\")\",t.style.transform=e+\"(\"+i+\")\"}function yt(t){for(var e=t.offsetTop,i=t.offsetLeft,o=t.offsetWidth,n=t.offsetHeight;t.offsetParent;)e+=(t=t.offsetParent).offsetTop,i+=t.offsetLeft;return e<window.pageYOffset+window.innerHeight&&i<window.pageXOffset+window.innerWidth&&e+n>window.pageYOffset&&i+o>window.pageXOffset}function kt(){return window.getComputedStyle(document.querySelector(\".cd-horizontal-timeline\"),\"::before\").getPropertyValue(\"content\").replace(/'/g,\"\").replace(/\"/g,\"\")}function wt(t){var e={fillOpacity:.2,color:\"red\",weight:2,fillColor:\"black\"};return\"\"!=t&&(e={fillOpacity:.2,color:\"#000\",weight:2,fillColor:i[t]}),e}function bt(t,e){return t?z.removeLayer(e):z.addLayer(e),!t}ct.length>0&&function(t,e){t.each((function(){var t=v(this),i={};i.timelineWrapper=t.find(\".events-wrapper\"),i.eventsWrapper=i.timelineWrapper.children(\".events\"),i.fillingLine=i.eventsWrapper.children(\".filling-line\"),i.timelineEvents=i.eventsWrapper.find(\"li.listeHisto\"),i.timelineVersion=i.eventsWrapper.find(\"li.listeHisto.versionActuelle\"),i.timelineLinks=i.eventsWrapper.find(\"a\"),i.timelineDates=i.timelineEvents,i.timelineNavigation=t.find(\".cd-timeline-navigation\"),i.eventsContent=t.children(\".events-content\"),dt=250;var o=(i.timelineDates.length+1)*dt;if(function(t,e){for(b=0;b<t.timelineDates.length;b++)t.timelineEvents.eq(b).css(\"left\",b*e+\"px\")}(i,dt),function(t,e){t.eventsWrapper.css(\"width\",e+\"px\"),ft(t.timelineEvents.eq(0),t.fillingLine,e)}(i,o),t.addClass(\"loaded\"),!e){var n=Number(i.timelineWrapper.css(\"width\").replace(\"px\",\"\")),r=n/2,s=Number(i.timelineVersion.css(\"left\").replace(\"px\",\"\")),a=0;for(b=n;b<s;b+=r)a++;a>0&&pt(i,o,\"next\",a)}i.timelineNavigation.on(\"click\",\".next\",(function(t){t.preventDefault(),pt(i,o,\"next\",1)})),i.timelineNavigation.on(\"click\",\".prev\",(function(t){t.preventDefault(),pt(i,o,\"prev\",1)})),i.eventsWrapper.off(\"click\"),i.eventsWrapper.on(\"click\",\"a\",(function(t){t.preventDefault();var e=v(this),n=e[0].id;P.length<=2?(showLoadModal(),refresh(n,e[0].firstElementChild.innerHTML),i.timelineLinks.removeClass(\"selected\"),e.addClass(\"selected\"),gt(e),ft(e,i.fillingLine,o),mt(e,i.eventsContent),hideLoadModal()):(v(\"#alertVersion\").modal(\"show\"),v(\"#confirmVersion\").off(\"click\"),v(\"#confirmVersion\").on(\"click\",(function(t){v(\"#alertVersion\").modal(\"hide\"),showLoadModal(),refresh(n,e[0].firstElementChild.innerHTML),i.timelineLinks.removeClass(\"selected\"),e.addClass(\"selected\"),gt(e),ft(e,i.fillingLine,o),mt(e,i.eventsContent),hideLoadModal()})))})),i.eventsContent.on(\"swipeleft\",(function(){\"mobile\"==kt()&&ut(i,o,\"next\")})),i.eventsContent.on(\"swiperight\",(function(){\"mobile\"==kt()&&ut(i,o,\"prev\")})),v(document).keyup((function(e){\"37\"==e.which&&yt(t.get(0))?ut(i,o,\"prev\"):\"39\"==e.which&&yt(t.get(0))&&ut(i,o,\"next\")}))}))}(ct,!1)}))}},t=>{\"use strict\";t.O(0,[818,755,235,356,717],(()=>{return e=49931,t(t.s=e);var e}));t.O()}]);";
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        return; yield '';
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName()
    {
        return "@public_path/build/secto.4f6521d9.js";
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array ();
    }

    public function getSourceContext()
    {
        return new Source("(self.webpackChunk=self.webpackChunk||[]).push([[516],{80739:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/agents.ff1dc136.png\"},46951:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/bdd.be7d3a77.png\"},80258:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/circle.b491ce2e.png\"},33804:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/clients30.fbd5fcb9.png\"},368:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/clientsOut.56de179b.png\"},59434:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/creation_assist.e7cd96e2.png\"},47102:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/densite1.43286f31.png\"},62104:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/icon_marker_black.bfa480fc.png\"},33258:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/icon_marker_red.d988b994.png\"},72863:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/maison.6000e52e.png\"},81311:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/number.f29d5d5a.png\"},73385:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/pastille.9a231ce3.png\"},82270:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/refresh.961546ea.png\"},20508:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/save.86e68346.png\"},92938:(t,e,i)=>{\"use strict\";t.exports=i.p+\"images/undo.9cb1531e.png\"},94979:(t,e,o)=>{var n,r,s;o(74916),o(23123),o(41539),o(32564),o(15306),o(24603),o(39714),o(82772),o(83710),o(91058),o(64765),r=[o(45243)],void 0===(s=\"function\"==typeof(n=function(t){return t.Control.Search=t.Control.extend({includes:\"1\"===t.version[0]?t.Evented.prototype:t.Mixin.Events,options:{url:\"\",layer:null,sourceData:null,jsonpParam:null,propertyLoc:\"loc\",propertyName:\"title\",formatData:null,filterData:null,moveToLocation:null,buildTip:null,container:\"\",zoom:null,minLength:1,initial:!0,casesensitive:!1,autoType:!0,delayType:400,tooltipLimit:-1,tipAutoSubmit:!0,firstTipSubmit:!1,autoResize:!0,collapsed:!0,autoCollapse:!1,autoCollapseTime:1200,textErr:\"Location not found\",textCancel:\"Cancel\",textPlaceholder:\"Search...\",hideMarkerOnCollapse:!1,position:\"topleft\",marker:{icon:!1,animate:!0,circle:{radius:10,weight:3,color:\"#e03\",stroke:!0,fill:!1}}},_getPath:function(t,e){var i=e.split(\".\"),o=i.pop(),n=i.length,r=i[0],s=1;if(n>0)for(;(t=t[r])&&s<n;)r=i[s++];if(t)return t[o]},_isObject:function(t){return\"[object Object]\"===Object.prototype.toString.call(t)},initialize:function(e){t.Util.setOptions(this,e||{}),this._inputMinSize=this.options.textPlaceholder?this.options.textPlaceholder.length:10,this._layer=this.options.layer||new t.LayerGroup,this._filterData=this.options.filterData||this._defaultFilterData,this._formatData=this.options.formatData||this._defaultFormatData,this._moveToLocation=this.options.moveToLocation||this._defaultMoveToLocation,this._autoTypeTmp=this.options.autoType,this._countertips=0,this._recordsCache={},this._curReq=null},onAdd:function(e){return this._map=e,this._container=t.DomUtil.create(\"div\",\"leaflet-control-search\"),this._input=this._createInput(this.options.textPlaceholder,\"search-input\"),this._tooltip=this._createTooltip(\"search-tooltip\"),this._cancel=this._createCancel(this.options.textCancel,\"search-cancel\"),this._button=this._createButton(this.options.textPlaceholder,\"search-button\"),this._alert=this._createAlert(\"search-alert\"),!1===this.options.collapsed&&this.expand(this.options.collapsed),this.options.marker&&(this.options.marker instanceof t.Marker||this.options.marker instanceof t.CircleMarker?this._markerSearch=this.options.marker:this._isObject(this.options.marker)&&(this._markerSearch=new t.Control.Search.Marker([0,0],this.options.marker)),this._markerSearch._isMarkerSearch=!0),this.setLayer(this._layer),e.on({resize:this._handleAutoresize},this),this._container},addTo:function(e){return this.options.container?(this._container=this.onAdd(e),this._wrapper=t.DomUtil.get(this.options.container),this._wrapper.style.position=\"relative\",this._wrapper.appendChild(this._container)):t.Control.prototype.addTo.call(this,e),this},onRemove:function(t){this._recordsCache={},t.off({resize:this._handleAutoresize},this)},setLayer:function(t){return this._layer=t,this._layer.addTo(this._map),this},showAlert:function(t){var e=this;return t=t||this.options.textErr,this._alert.style.display=\"block\",this._alert.innerHTML=t,clearTimeout(this.timerAlert),this.timerAlert=setTimeout((function(){e.hideAlert()}),this.options.autoCollapseTime),this},hideAlert:function(){return this._alert.style.display=\"none\",this},cancel:function(){return this._input.value=\"\",this._handleKeypress({keyCode:8}),this._input.size=this._inputMinSize,this._input.focus(),this._cancel.style.display=\"none\",this._hideTooltip(),this.fire(\"search:cancel\"),this},expand:function(e){return e=\"boolean\"!=typeof e||e,this._input.style.display=\"block\",t.DomUtil.addClass(this._container,\"search-exp\"),!1!==e&&(this._input.focus(),this._map.on(\"dragstart click\",this.collapse,this)),this.fire(\"search:expanded\"),this},collapse:function(){return this._hideTooltip(),this.cancel(),this._alert.style.display=\"none\",this._input.blur(),this.options.collapsed&&(this._input.style.display=\"none\",this._cancel.style.display=\"none\",t.DomUtil.removeClass(this._container,\"search-exp\"),this.options.hideMarkerOnCollapse&&this._map.removeLayer(this._markerSearch),this._map.off(\"dragstart click\",this.collapse,this)),this.fire(\"search:collapsed\"),this},collapseDelayed:function(){var t=this;return this.options.autoCollapse?(clearTimeout(this.timerCollapse),this.timerCollapse=setTimeout((function(){t.collapse()}),this.options.autoCollapseTime),this):this},collapseDelayedStop:function(){return clearTimeout(this.timerCollapse),this},_createAlert:function(e){var i=t.DomUtil.create(\"div\",e,this._container);return i.style.display=\"none\",t.DomEvent.on(i,\"click\",t.DomEvent.stop,this).on(i,\"click\",this.hideAlert,this),i},_createInput:function(e,i){var o=this,n=t.DomUtil.create(\"label\",i,this._container),r=t.DomUtil.create(\"input\",i,this._container);return r.type=\"text\",r.size=this._inputMinSize,r.value=\"\",r.autocomplete=\"off\",r.autocorrect=\"off\",r.autocapitalize=\"off\",r.placeholder=e,r.style.display=\"none\",r.role=\"search\",r.id=r.role+r.type+r.size,n.htmlFor=r.id,n.style.display=\"none\",n.value=e,t.DomEvent.disableClickPropagation(r).on(r,\"keyup\",this._handleKeypress,this).on(r,\"paste\",(function(t){setTimeout((function(t){o._handleKeypress(t)}),10,t)}),this).on(r,\"blur\",this.collapseDelayed,this).on(r,\"focus\",this.collapseDelayedStop,this),r},_createCancel:function(e,i){var o=t.DomUtil.create(\"a\",i,this._container);return o.href=\"#\",o.title=e,o.style.display=\"none\",o.innerHTML=\"<span>&otimes;</span>\",t.DomEvent.on(o,\"click\",t.DomEvent.stop,this).on(o,\"click\",this.cancel,this),o},_createButton:function(e,i){var o=t.DomUtil.create(\"a\",i,this._container);return o.href=\"#\",o.title=e,t.DomEvent.on(o,\"click\",t.DomEvent.stop,this).on(o,\"click\",this._handleSubmit,this).on(o,\"focus\",this.collapseDelayedStop,this).on(o,\"blur\",this.collapseDelayed,this),o},_createTooltip:function(e){var i=this,o=t.DomUtil.create(\"ul\",e,this._container);return o.style.display=\"none\",t.DomEvent.disableClickPropagation(o).on(o,\"blur\",this.collapseDelayed,this).on(o,\"mousewheel\",(function(e){i.collapseDelayedStop(),t.DomEvent.stopPropagation(e)}),this).on(o,\"mouseover\",(function(t){i.collapseDelayedStop()}),this),o},_createTip:function(e,i){var o;if(this.options.buildTip){if(\"string\"==typeof(o=this.options.buildTip.call(this,e,i))){var n=t.DomUtil.create(\"div\");n.innerHTML=o,o=n.firstChild}}else(o=t.DomUtil.create(\"li\",\"\")).innerHTML=e;return t.DomUtil.addClass(o,\"search-tip\"),o._text=e,this.options.tipAutoSubmit&&t.DomEvent.disableClickPropagation(o).on(o,\"click\",t.DomEvent.stop,this).on(o,\"click\",(function(t){this._input.value=e,this._handleAutoresize(),this._input.focus(),this._hideTooltip(),this._handleSubmit()}),this),o},_getUrl:function(t){return\"function\"==typeof this.options.url?this.options.url(t):this.options.url},_defaultFilterData:function(t,e){var i,o,n,r={};if(\"\"===(t=t.replace(/[.*+?^\${}()|[\\]\\\\]/g,\"\")))return[];for(var s in i=this.options.initial?\"^\":\"\",o=this.options.casesensitive?void 0:\"i\",n=new RegExp(i+t,o),e)n.test(s)&&(r[s]=e[s]);return r},showTooltip:function(t){if(this._countertips=0,this._tooltip.innerHTML=\"\",this._tooltip.currentSelection=-1,this.options.tooltipLimit)for(var e in t){if(this._countertips===this.options.tooltipLimit)break;this._countertips++,this._tooltip.appendChild(this._createTip(e,t[e]))}return this._countertips>0?(this._tooltip.style.display=\"block\",this._autoTypeTmp&&this._autoType(),this._autoTypeTmp=this.options.autoType):this._hideTooltip(),this._tooltip.scrollTop=0,this._countertips},_hideTooltip:function(){return this._tooltip.style.display=\"none\",this._tooltip.innerHTML=\"\",0},_defaultFormatData:function(e){var i,o=this,n=this.options.propertyName,r=this.options.propertyLoc,s={};if(t.Util.isArray(r))for(i in e)s[o._getPath(e[i],n)]=t.latLng(e[i][r[0]],e[i][r[1]]);else for(i in e)s[o._getPath(e[i],n)]=t.latLng(o._getPath(e[i],r));return s},_recordsFromJsonp:function(e,i){t.Control.Search.callJsonp=i;var o=t.DomUtil.create(\"script\",\"leaflet-search-jsonp\",document.getElementsByTagName(\"body\")[0]),n=t.Util.template(this._getUrl(e)+\"&\"+this.options.jsonpParam+\"=L.Control.Search.callJsonp\",{s:e});return o.type=\"text/javascript\",o.src=n,{abort:function(){o.parentNode.removeChild(o)}}},_recordsFromAjax:function(e,i){void 0===window.XMLHttpRequest&&(window.XMLHttpRequest=function(){try{return new ActiveXObject(\"Microsoft.XMLHTTP.6.0\")}catch(t){try{return new ActiveXObject(\"Microsoft.XMLHTTP.3.0\")}catch(t){throw new Error(\"XMLHttpRequest is not supported\")}}});var o=t.Browser.ie&&!window.atob&&document.querySelector?new XDomainRequest:new XMLHttpRequest,n=t.Util.template(this._getUrl(e),{s:e});return o.open(\"GET\",n),o.onload=function(){i(JSON.parse(o.responseText))},o.onreadystatechange=function(){4===o.readyState&&200===o.status&&this.onload()},o.send(),o},_searchInLayer:function(e,i,o){var n,r=this;e instanceof t.Control.Search.Marker||(e instanceof t.Marker||e instanceof t.CircleMarker?r._getPath(e.options,o)?((n=e.getLatLng()).layer=e,i[r._getPath(e.options,o)]=n):r._getPath(e.feature.properties,o)?((n=e.getLatLng()).layer=e,i[r._getPath(e.feature.properties,o)]=n):console.warn(\"propertyName '\"+o+\"' not found in marker\"):e instanceof t.Path||e instanceof t.Polyline||e instanceof t.Polygon?r._getPath(e.options,o)?((n=e.getBounds().getCenter()).layer=e,i[r._getPath(e.options,o)]=n):r._getPath(e.feature.properties,o)?((n=e.getBounds().getCenter()).layer=e,i[r._getPath(e.feature.properties,o)]=n):console.warn(\"propertyName '\"+o+\"' not found in shape\"):e.hasOwnProperty(\"feature\")?e.feature.properties.hasOwnProperty(o)?e.getLatLng&&\"function\"==typeof e.getLatLng?((n=e.getLatLng()).layer=e,i[e.feature.properties[o]]=n):e.getBounds&&\"function\"==typeof e.getBounds?((n=e.getBounds().getCenter()).layer=e,i[e.feature.properties[o]]=n):console.warn(\"Unknown type of Layer\"):console.warn(\"propertyName '\"+o+\"' not found in feature\"):e instanceof t.LayerGroup&&e.eachLayer((function(t){r._searchInLayer(t,i,o)})))},_recordsFromLayer:function(){var t=this,e={},i=this.options.propertyName;return this._layer.eachLayer((function(o){t._searchInLayer(o,e,i)})),e},_autoType:function(){var t=this._input.value.length,e=this._tooltip.firstChild?this._tooltip.firstChild._text:\"\",i=e.length;if(0===e.indexOf(this._input.value))if(this._input.value=e,this._handleAutoresize(),this._input.createTextRange){var o=this._input.createTextRange();o.collapse(!0),o.moveStart(\"character\",t),o.moveEnd(\"character\",i),o.select()}else this._input.setSelectionRange?this._input.setSelectionRange(t,i):this._input.selectionStart&&(this._input.selectionStart=t,this._input.selectionEnd=i)},_hideAutoType:function(){var t;if((t=this._input.selection)&&t.empty)t.empty();else if(this._input.createTextRange){(t=this._input.createTextRange()).collapse(!0);var e=this._input.value.length;t.moveStart(\"character\",e),t.moveEnd(\"character\",e),t.select()}else this._input.getSelection&&this._input.getSelection().removeAllRanges(),this._input.selectionStart=this._input.selectionEnd},_handleKeypress:function(t){var e=this;switch(t.keyCode){case 27:this.collapse();break;case 13:(1==this._countertips||this.options.firstTipSubmit&&this._countertips>0)&&-1==this._tooltip.currentSelection&&this._handleArrowSelect(1),this._handleSubmit();break;case 38:this._handleArrowSelect(-1);break;case 40:this._handleArrowSelect(1);break;case 8:case 45:case 46:this._autoTypeTmp=!1;break;case 37:case 39:case 16:case 17:case 35:case 36:break;default:this._input.value.length?this._cancel.style.display=\"block\":this._cancel.style.display=\"none\",this._input.value.length>=this.options.minLength?(clearTimeout(this.timerKeypress),this.timerKeypress=setTimeout((function(){e._fillRecordsCache()}),this.options.delayType)):this._hideTooltip()}this._handleAutoresize()},searchText:function(e){var i=e.charCodeAt(e.length);this._input.value=e,this._input.style.display=\"block\",t.DomUtil.addClass(this._container,\"search-exp\"),this._autoTypeTmp=!1,this._handleKeypress({keyCode:i})},_fillRecordsCache:function(){var e,i=this,o=this._input.value;this._curReq&&this._curReq.abort&&this._curReq.abort(),t.DomUtil.addClass(this._container,\"search-load\"),this.options.sourceData?this._retrieveData=this.options.sourceData:this.options.url&&(this._retrieveData=this.options.jsonpParam?this._recordsFromJsonp:this._recordsFromAjax),this._curReq=this._retrieveData.call(this,o,(function(o){i._recordsCache=i._formatData.call(i,o),e=i.options.sourceData?i._filterData(i._input.value,i._recordsCache):i._recordsCache,i.showTooltip(e),t.DomUtil.removeClass(i._container,\"search-load\")}))},_handleAutoresize:function(){var t;this._input.style.maxWidth!==this._map._container.offsetWidth&&(t=this._map._container.clientWidth,t-=83,this._input.style.maxWidth=t.toString()+\"px\"),this.options.autoResize&&this._container.offsetWidth+20<this._map._container.offsetWidth&&(this._input.size=this._input.value.length<this._inputMinSize?this._inputMinSize:this._input.value.length)},_handleArrowSelect:function(e){var o=this._tooltip.hasChildNodes()?this._tooltip.childNodes:[];for(i=0;i<o.length;i++)t.DomUtil.removeClass(o[i],\"search-tip-select\");if(1==e&&this._tooltip.currentSelection>=o.length-1)t.DomUtil.addClass(o[this._tooltip.currentSelection],\"search-tip-select\");else if(-1==e&&this._tooltip.currentSelection<=0)this._tooltip.currentSelection=-1;else if(\"none\"!=this._tooltip.style.display){this._tooltip.currentSelection+=e,t.DomUtil.addClass(o[this._tooltip.currentSelection],\"search-tip-select\"),this._input.value=o[this._tooltip.currentSelection]._text;var n=o[this._tooltip.currentSelection].offsetTop;n+o[this._tooltip.currentSelection].clientHeight>=this._tooltip.scrollTop+this._tooltip.clientHeight?this._tooltip.scrollTop=n-this._tooltip.clientHeight+o[this._tooltip.currentSelection].clientHeight:n<=this._tooltip.scrollTop&&(this._tooltip.scrollTop=n)}},_handleSubmit:function(){if(this._hideAutoType(),this.hideAlert(),this._hideTooltip(),\"none\"==this._input.style.display)this.expand();else if(\"\"===this._input.value)this.collapse();else{var t=this._getLocation(this._input.value);!1===t?this.showAlert():(this.showLocation(t,this._input.value),this.fire(\"search:locationfound\",{latlng:t,text:this._input.value,layer:t.layer?t.layer:null}))}},_getLocation:function(t){return!!this._recordsCache.hasOwnProperty(t)&&this._recordsCache[t]},_defaultMoveToLocation:function(t,e,i){this.options.zoom?this._map.setView(t,this.options.zoom):this._map.panTo(t)},showLocation:function(t,e){var i=this;return i._map.once(\"moveend zoomend\",(function(e){i._markerSearch&&i._markerSearch.addTo(i._map).setLatLng(t)})),i._moveToLocation(t,e,i._map),i.options.autoCollapse&&i.collapse(),i}}),t.Control.Search.Marker=t.Marker.extend({includes:\"1\"===t.version[0]?t.Evented.prototype:t.Mixin.Events,options:{icon:new t.Icon.Default,animate:!0,circle:{radius:10,weight:3,color:\"#e03\",stroke:!0,fill:!1}},initialize:function(e,i){t.setOptions(this,i),!0===i.icon&&(i.icon=new t.Icon.Default),t.Marker.prototype.initialize.call(this,e,i),t.Control.Search.prototype._isObject(this.options.circle)&&(this._circleLoc=new t.CircleMarker(e,this.options.circle))},onAdd:function(e){t.Marker.prototype.onAdd.call(this,e),this._circleLoc&&(e.addLayer(this._circleLoc),this.options.animate&&this.animate())},onRemove:function(e){t.Marker.prototype.onRemove.call(this,e),this._circleLoc&&e.removeLayer(this._circleLoc)},setLatLng:function(e){return t.Marker.prototype.setLatLng.call(this,e),this._circleLoc&&this._circleLoc.setLatLng(e),this},_initIcon:function(){this.options.icon&&t.Marker.prototype._initIcon.call(this)},_removeIcon:function(){this.options.icon&&t.Marker.prototype._removeIcon.call(this)},animate:function(){if(this._circleLoc){var t=this._circleLoc,e=200,i=5,o=parseInt(t._radius/i),n=this.options.circle.radius,r=2*t._radius,s=0;t._timerAnimLoc=setInterval((function(){r-=o+=s+=.5,t.setRadius(r),r<n&&(clearInterval(t._timerAnimLoc),t.setRadius(n))}),e)}return this}}),t.Map.addInitHook((function(){this.options.searchControl&&(this.searchControl=t.control.search(this.options.searchControl),this.addControl(this.searchControl))})),t.control.search=function(e){return new t.Control.Search(e)},t.Control.Search})?n.apply(e,r):n)||(t.exports=s)},42295:(t,e,i)=>{function o(t){return(o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}i(40561),i(26699),i(32564),i(24812),i(56977),i(91058),i(92222),i(43290),i(82772),i(79753),i(54678),i(74916),i(23123),i(15306),i(82526),i(41817),i(41539),i(32165),i(66992),i(78783),i(33948),function(t,e,i){var n;L.drawVersion=\"0.4.12\",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:\"Cancel drawing\",text:\"Cancel\"},finish:{title:\"Finish drawing\",text:\"Finish\"},undo:{title:\"Delete last point drawn\",text:\"Delete last point\"},buttons:{polyline:\"Draw a polyline\",polygon:\"Draw a polygon\",rectangle:\"Draw a rectangle\",circle:\"Draw a circle\",marker:\"Draw a marker\",circlemarker:\"Draw a circlemarker\"}},handlers:{circle:{tooltip:{start:\"Click and drag to draw circle.\"},radius:\"Radius\"},circlemarker:{tooltip:{start:\"Click map to place circle marker.\"}},marker:{tooltip:{start:\"Click map to place marker.\"}},polygon:{tooltip:{start:\"Click to start drawing shape.\",cont:\"Click to continue drawing shape.\",end:\"Click first point to close this shape.\"}},polyline:{error:\"<strong>Error:</strong> shape edges cannot cross!\",tooltip:{start:\"Click to start drawing line.\",cont:\"Click to continue drawing line.\",end:\"Click last point to finish line.\"}},rectangle:{tooltip:{start:\"Click and drag to draw rectangle.\"}},simpleshape:{tooltip:{end:\"Release mouse to finish drawing.\"}}}},edit:{toolbar:{actions:{save:{title:\"Save changes\",text:\"Save\"},cancel:{title:\"Cancel editing, discards all changes\",text:\"Cancel\"},clearAll:{title:\"Clear all layers\",text:\"Clear All\"}},buttons:{edit:\"Edit layers\",editDisabled:\"No layers to edit\",remove:\"Delete layers\",removeDisabled:\"No layers to delete\"}},handlers:{edit:{tooltip:{text:\"Drag handles or markers to edit features.\",subtext:\"Click cancel to undo changes.\"}},remove:{tooltip:{text:\"Click on a feature to remove.\"}}}}},L.Draw.Event={},L.Draw.Event.CREATED=\"draw:created\",L.Draw.Event.EDITED=\"draw:edited\",L.Draw.Event.DELETED=\"draw:deleted\",L.Draw.Event.DRAWSTART=\"draw:drawstart\",L.Draw.Event.DRAWSTOP=\"draw:drawstop\",L.Draw.Event.DRAWVERTEX=\"draw:drawvertex\",L.Draw.Event.EDITSTART=\"draw:editstart\",L.Draw.Event.EDITMOVE=\"draw:editmove\",L.Draw.Event.EDITRESIZE=\"draw:editresize\",L.Draw.Event.EDITVERTEX=\"draw:editvertex\",L.Draw.Event.EDITSTOP=\"draw:editstop\",L.Draw.Event.DELETESTART=\"draw:deletestart\",L.Draw.Event.DELETESTOP=\"draw:deletestop\",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({includes:L.Mixin.Events,initialize:function(t,e){this._map=t,this._container=t._container,this._overlayPane=t._panes.overlayPane,this._popupPane=t._panes.popupPane,e&&e.shapeOptions&&(e.shapeOptions=L.Util.extend({},this.options.shapeOptions,e.shapeOptions)),L.setOptions(this,e)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire(\"enabled\",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire(\"disabled\",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(L.DomUtil.disableTextSelection(),t.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,\"keyup\",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,\"keyup\",this._cancelDrawing,this))},setOptions:function(t){L.setOptions(this,t)},_fireCreatedEvent:function(t){this._map.fire(L.Draw.Event.CREATED,{layer:t,layerType:this.type})},_cancelDrawing:function(t){27===t.keyCode&&(this._map.fire(\"draw:canceled\",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:\"polyline\"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:\"#b00b00\",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:\"leaflet-div-icon leaflet-editing-icon\"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon\"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1},initialize:function(t,e){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,e&&e.drawError&&(e.drawError=L.Util.extend({},this.options.drawError,e.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:\"leaflet-mouse-marker\",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on(\"mouseout\",this._onMouseOut,this).on(\"mousemove\",this._onMouseMove,this).on(\"mousedown\",this._onMouseDown,this).on(\"mouseup\",this._onMouseUp,this).addTo(this._map),this._map.on(\"mouseup\",this._onMouseUp,this).on(\"mousemove\",this._onMouseMove,this).on(\"zoomlevelschange\",this._onZoomEnd,this).on(\"touchstart\",this._onTouch,this).on(\"zoomend\",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off(\"mousedown\",this._onMouseDown,this).off(\"mouseout\",this._onMouseOut,this).off(\"mouseup\",this._onMouseUp,this).off(\"mousemove\",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off(\"mouseup\",this._onMouseUp,this).off(\"mousemove\",this._onMouseMove,this).off(\"zoomlevelschange\",this._onZoomEnd,this).off(\"zoomend\",this._onZoomEnd,this).off(\"touchstart\",this._onTouch,this).off(\"click\",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var t=this._markers.pop(),e=this._poly,i=e.getLatLngs(),o=i.splice(-1,1)[0];this._poly.setLatLngs(i),this._markerGroup.removeLayer(t),e.getLatLngs().length<2&&this._map.removeLayer(e),this._vertexChanged(o,!1)}},isMarkerInsidePolygon:function(t,e){for(var i=!1,o=t.lat,n=t.lng,r=0;r<e.getLatLngs().length;r++)for(var s=e.getLatLngs()[r],a=0,l=s.length-1;a<s.length;l=a++){var h=s[a].lat,c=s[a].lng,d=s[l].lat,p=s[l].lng;c>n!=p>n&&o<(d-h)*(n-c)/(p-c)+h&&(i=!i)}return i},addVertex:function(t,e){var i=this._markers.length,o=!1;if(e)this._map.eachLayer((function(e){if(e instanceof L.Polygon){for(var i=!1,n=t.lat,r=t.lng,s=0;s<e.getLatLngs().length;s++)for(var a=e.getLatLngs()[s],l=0,h=a.length-1;l<a.length;h=l++){var c=a[l].lat,d=a[l].lng,p=a[h].lat,u=a[h].lng;d>r!=u>r&&n<(p-c)*(r-d)/(u-d)+c&&(i=!i)}i&&(o=!0)}}));else var n=this.pointSnap();if(!o&&i>=1){var r=t,s=this._markers[i-1].getLatLng();o=this.lineInPolygon(r,s);L.polyline([s,r],{opacity:\"0\"}).addTo(this._map)}i>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(t)||o||!n&&!e?this._showErrorTooltip():(this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(t)),this._poly.addLatLng(t),2===this._poly.getLatLngs().length&&this._map.addLayer(this._poly),this._vertexChanged(t,!0))},pointSnap:function(){for(var t=this._snapper._guides,e=0;e<t.length;e++)for(var i=0;i<t[e]._latlngs.length;i++)for(var o=0;o<t[e]._latlngs[i].length;o++)if(t[e]._latlngs[i][o].lat){if(this._snapper._markers[0]._latlng.lat==t[e]._latlngs[i][o].lat&&this._snapper._markers[0]._latlng.lng==t[e]._latlngs[i][o].lng)return!0}else for(var n=0;n<t[e]._latlngs[i][o].length;n++)if(this._snapper._markers[0]._latlng.lat==t[e]._latlngs[i][o][n].lat&&this._snapper._markers[0]._latlng.lng==t[e]._latlngs[i][o][n].lng)return!0;return!1},completeShape:function(){this._markers.length<=1||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},is_in_polygon:function(t,e,i){for(\$c=!1,\$i=\$j=\$c=0,\$longitude_x=i.lng,\$latitude_y=i.lat,\$i=0,\$j=1;\$i<2;\$j=\$i++)e[\$i]>\$latitude_y!=e[\$j]>\$latitude_y&&\$longitude_x<(t[\$j]-t[\$i])*(\$latitude_y-e[\$i])/(e[\$j]-e[\$i])+t[\$i]&&(\$c=!\$c);return \$c},pointOnPolygon:function(t){return this._map.eachLayer((function(e){if(e instanceof L.Polygon&&e.getBounds().contains(t))for(var i=e._latlngs[0],o=i.length,n=0,r=1;n<o;){r==o&&(r=0);var s=L.polyline([e._latlngs[0][n],e._latlngs[0][r]],{opacity:\"0\"}).addTo(e._map);if(s.getBounds().contains(t)){if(0==n&&r==o-1||0==r&&n==o-1)i.splice(0,0,L.latLng(t.lat,t.lng));else{var a=n+r;a/=2,i.splice(Math.ceil(a),0,L.latLng(t.lat,t.lng))}return e._map.removeLayer(s),e._latlngs[0]=i,e.editing.latlngs[0][0]=i,e.redraw(),!0}e._map.removeLayer(s),n++,r++}})),!1},lineInPolygon:function(t,e){var i=!1,o=L.polyline([e,t],{opacity:\"0\"}).addTo(this._map);t.lng=Math.round(1e6*t.lng)/1e6,t.lat=Math.round(1e6*t.lat)/1e6,e.lng=Math.round(1e6*e.lng)/1e6,e.lat=Math.round(1e6*e.lat)/1e6;for(var n=.1;n<=.9;n+=.1){var r=L.GeometryUtil.interpolateOnLine(this._map,o,n),s=[];this._map.eachLayer((function(i){if(i instanceof L.Polygon)for(var o,n=0,r=0;r<i.getLatLngs().length;r++){var a=i.getLatLngs()[r];a[0].lat||(a=a[0]);for(var l=0;l<a.length;l++)a[l].equals(e)&&(o=l-1,n=l+1,0==l?o=a.length-1:l==a.length-1&&(n=0),(a[o].equals(t)||a[n].equals(t))&&s.push(i.options.id))}})),this._map.eachLayer((function(t){if(t instanceof L.Polygon){if(s.includes(t.options.id))return;for(var e=!1,o=r.latLng.lat,n=r.latLng.lng,a=0;a<t.getLatLngs().length;a++)for(var l=t.getLatLngs()[a],h=0,c=l.length-1;h<l.length;c=h++){var d=l[h].lat,p=l[h].lng,u=l[c].lat,_=l[c].lng;p>n!=_>n&&o<(u-d)*(n-p)/(_-p)+d&&(e=!e)}e&&(i=!0)}}))}return this._map.removeLayer(o),i},_finishShape:function(){console.info(\"finishshape\");var t=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),e=this._poly.newLatLngIntersects(t[t.length-1]),i=this._markers.length,o=this._markers[0].getLatLng(),n=this._markers[i-1].getLatLng(),r=this.lineInPolygon(o,n);!this.options.allowIntersection&&e||!this._shapeIsValid()||r?this._showErrorTooltip():(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_shapeIsValid:function(){return!0},_onZoomEnd:function(){null!==this._markers&&this._updateGuide()},_onMouseMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent),i=this._map.layerPointToLatLng(e);this._currentLatLng=i,this._updateTooltip(i),this._updateGuide(e),this._mouseMarker.setLatLng(i),L.DomEvent.preventDefault(t.originalEvent)},_vertexChanged:function(t,e){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(t,e),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(t){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(t),this._clickHandled=!0,this._disableNewMarkers();var e=t.originalEvent,i=e.clientX,o=e.clientY;this._startPoint.call(this,i,o)}},_startPoint:function(t,e){this._mouseDownOrigin=L.point(t,e)},_onMouseUp:function(t){var e=t.originalEvent,i=e.clientX,o=e.clientY;this._endPoint.call(this,i,o,t),this._clickHandled=null},_endPoint:function(e,i,o){if(this._mouseDownOrigin){var n=L.point(e,i).distanceTo(this._mouseDownOrigin);if(this._calculateFinishDistance(o.latlng)<10&&L.Browser.touch)this._finishShape();else if(Math.abs(n)<9*(t.devicePixelRatio||1))if(this._snapper){var r=!1;this._snapper._markers[0]._latlng.lat==o.latlng.lat&&this._snapper._markers[0]._latlng.lng==o.latlng.lng&&(r=!0),this.addVertex(this._snapper._markers[0]._latlng,r)}else this.addVertex(o.latlng,!1);this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(t){var e,i,o=t.originalEvent;!o.touches||!o.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(e=o.touches[0].clientX,i=o.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,e,i),this._endPoint.call(this,e,i,t),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(t){var e;if(this._markers.length>0){var i;if(this.type===L.Draw.Polyline.TYPE)i=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;i=this._markers[0]}var o=this._map.latLngToContainerPoint(i.getLatLng()),n=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),r=this._map.latLngToContainerPoint(n.getLatLng());e=o.distanceTo(r)}else e=1/0;return e},_updateFinishHandler:function(){var t=this._markers.length;t>1&&this._markers[t-1].on(\"click\",this._finishShape,this),t>2&&this._markers[t-2].off(\"click\",this._finishShape,this)},_createMarker:function(t){var e=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(e),e},_updateGuide:function(t){var e=this._markers?this._markers.length:0;e>0&&(t=t||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[e-1].getLatLng()),t))},_updateTooltip:function(t){var e=this._getTooltipText();t&&this._tooltip.updatePosition(t),this._errorShown||this._tooltip.updateContent(e)},_drawGuide:function(t,e){var i,o,n,r=Math.floor(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))),s=this.options.guidelineDistance,a=this.options.maxGuideLineLength,l=r>a?r-a:s;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create(\"div\",\"leaflet-draw-guides\",this._overlayPane));l<r;l+=this.options.guidelineDistance)i=l/r,o={x:Math.floor(t.x*(1-i)+i*e.x),y:Math.floor(t.y*(1-i)+i*e.y)},(n=L.DomUtil.create(\"div\",\"leaflet-draw-guide-dash\",this._guidesContainer)).style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(n,o)},_updateGuideColor:function(t){if(this._guidesContainer)for(var e=0,i=this._guidesContainer.childNodes.length;e<i;e++)this._guidesContainer.childNodes[e].style.backgroundColor=t},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var t,e,i=this.options.showLength;return L.Browser.touch&&(i=!1),0===this._markers.length?t={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(e=i?this._getMeasurementString():\"\",t=1===this._markers.length?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:e}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:e}),t},_updateRunningMeasure:function(t,e){var i,o,n=this._markers.length;1===this._markers.length?this._measurementRunningTotal=0:(i=n-(e?2:1),o=this._map.distance(t,this._markers[i].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=o*(e?1:-1))},_getMeasurementString:function(){var t,e=this._currentLatLng,i=this._markers[this._markers.length-1].getLatLng();return t=i&&e?this._measurementRunningTotal+this._map.distance(e,i)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(t,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout(function(){this._disableMarkers=!1}.bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off(\"click\",this._finishShape,this)},_fireCreatedEvent:function(){var t=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:\"polygon\"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(t,e){L.Draw.Polyline.prototype.initialize.call(this,t,e),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var t=this._markers.length;1===t&&this._markers[0].on(\"click\",this._finishShape,this),t>2&&(this._markers[t-1].on(\"dblclick\",this._finishShape,this),t>3&&this._markers[t-2].off(\"dblclick\",this._finishShape,this))},_getTooltipText:function(){var t,e;return 0===this._markers.length?t=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(t=L.drawLocal.draw.handlers.polygon.tooltip.cont,e=this._getMeasurementString()):(t=L.drawLocal.draw.handlers.polygon.tooltip.end,e=this._getMeasurementString()),{text:t,subtext:e}},_getMeasurementString:function(){var t=this._area,e=\"\";return t||this.options.showLength?(this.options.showLength&&(e=L.Draw.Polyline.prototype._getMeasurementString.call(this)),t&&(e+=\"<br>\"+L.GeometryUtil.readableArea(t,this.options.metric,this.options.precision)),e):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(t,e){var i;!this.options.allowIntersection&&this.options.showArea&&(i=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(i)),L.Draw.Polyline.prototype._vertexChanged.call(this,t,e)},_cleanUpShape:function(){var t=this._markers.length;t>0&&(this._markers[0].off(\"click\",this._finishShape,this),t>2&&this._markers[t-1].off(\"dblclick\",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(t,e){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor=\"crosshair\",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on(\"mousedown\",this._onMouseDown,this).on(\"mousemove\",this._onMouseMove,this).on(\"touchstart\",this._onMouseDown,this).on(\"touchmove\",this._onMouseMove,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor=\"\",this._map.off(\"mousedown\",this._onMouseDown,this).off(\"mousemove\",this._onMouseMove,this).off(\"touchstart\",this._onMouseDown,this).off(\"touchmove\",this._onMouseMove,this),L.DomEvent.off(e,\"mouseup\",this._onMouseUp,this),L.DomEvent.off(e,\"touchend\",this._onMouseUp,this),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(t){this._isDrawing=!0,this._startLatLng=t.latlng,L.DomEvent.on(e,\"mouseup\",this._onMouseUp,this).on(e,\"touchend\",this._onMouseUp,this).preventDefault(t.originalEvent)},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(e))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:\"rectangle\"},options:{shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,showArea:!0,clickable:!0},metric:!0},initialize:function(t,e){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(t){this._shape||this._isCurrentlyTwoClickDrawing?this._isCurrentlyTwoClickDrawing&&!function(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}(t.target,\"leaflet-pane\")||L.Draw.SimpleShape.prototype._onMouseUp.call(this):this._isCurrentlyTwoClickDrawing=!0},_drawShape:function(t){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,t)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,t),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_getTooltipText:function(){var t,e,i,o=L.Draw.SimpleShape.prototype._getTooltipText.call(this),n=this._shape,r=this.options.showArea;return n&&(t=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),e=L.GeometryUtil.geodesicArea(t),i=r?L.GeometryUtil.readableArea(e,this.options.metric):\"\"),{text:o.text,subtext:i}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:\"marker\"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:\"leaflet-mouse-marker\",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on(\"click\",this._onClick,this).addTo(this._map),this._map.on(\"mousemove\",this._onMouseMove,this),this._map.on(\"click\",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._marker&&(this._marker.off(\"click\",this._onClick,this),this._map.off(\"click\",this._onClick,this).off(\"click\",this._onTouch,this).removeLayer(this._marker),delete this._marker),this._mouseMarker.off(\"click\",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off(\"mousemove\",this._onMouseMove,this))},_onMouseMove:function(t){var e=t.latlng;this._tooltip.updatePosition(e),this._mouseMarker.setLatLng(e),this._marker?(e=this._mouseMarker.getLatLng(),this._marker.setLatLng(e)):(this._marker=this._createMarker(e),this._marker.on(\"click\",this._onClick,this),this._map.on(\"click\",this._onClick,this).addLayer(this._marker))},_createMarker:function(t){return new L.Marker(t,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(t){this._onMouseMove(t),this._onClick()},_fireCreatedEvent:function(){var t=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:\"circlemarker\"},options:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(t,e){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t,e)},_fireCreatedEvent:function(){var t=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t)},_createMarker:function(t){return new L.CircleMarker(t,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:\"circle\"},options:{shapeOptions:{stroke:!0,color:\"#3388ff\",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(t,e){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t,e)},_drawShape:function(t){var e=this._map.distance(this._startLatLng,t);this._shape?this._shape.setRadius(e):(this._shape=new L.Circle(this._startLatLng,e,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t)},_onMouseMove:function(t){var e,i=t.latlng,o=this.options.showRadius,n=this.options.metric;if(this._tooltip.updatePosition(i),this._isDrawing){this._drawShape(i),e=this._shape.getRadius().toFixed(1);var r=\"\";o&&(r=L.drawLocal.draw.handlers.circle.radius+\": \"+L.GeometryUtil.readableDistance(e,n,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:r})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(t,e){this._marker=t,L.setOptions(this,e)},addHooks:function(){var t=this._marker;t.dragging.enable(),t.on(\"dragend\",this._onDragEnd,t),this._toggleMarkerHighlight()},removeHooks:function(){var t=this._marker;t.dragging.disable(),t.off(\"dragend\",this._onDragEnd,t),this._toggleMarkerHighlight()},_onDragEnd:function(t){var e=t.target;e.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e})},_toggleMarkerHighlight:function(){var t=this._marker._icon;t&&(t.style.display=\"none\",L.DomUtil.hasClass(t,\"leaflet-edit-marker-selected\")?(L.DomUtil.removeClass(t,\"leaflet-edit-marker-selected\"),this._offsetMarker(t,-4)):(L.DomUtil.addClass(t,\"leaflet-edit-marker-selected\"),this._offsetMarker(t,4)),t.style.display=\"\")},_offsetMarker:function(t,e){var i=parseInt(t.style.marginTop,10)-e,o=parseInt(t.style.marginLeft,10)-e;t.style.marginTop=i+\"px\",t.style.marginLeft=o+\"px\"}}),L.Marker.addInitHook((function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())})),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({options:{},initialize:function(t,e){this.latlngs=[t._latlngs],t._holes&&(this.latlngs=this.latlngs.concat(t._holes)),this._poly=t,L.setOptions(this,e),this._poly.on(\"revert-edited\",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(t){for(var e=0;e<this._verticesHandlers.length;e++)t(this._verticesHandlers[e])},addHooks:function(){this._initHandlers(),this._eachVertexHandler((function(t){t.addHooks()}))},removeHooks:function(){this._eachVertexHandler((function(t){t.removeHooks()}))},updateMarkers:function(){this._eachVertexHandler((function(t){t.updateMarkers()}))},_initHandlers:function(){this._verticesHandlers=[];for(var t=0;t<this.latlngs.length;t++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[t],this.options))},_updateLatLngs:function(t){this.latlngs=[t.layer._latlngs],t.layer._holes&&(this.latlngs=this.latlngs.concat(t.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{allowIntersection:!1,icon:new L.DivIcon({iconSize:new L.Point(8,8),className:\"leaflet-div-icon leaflet-editing-icon\"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon\"}),drawError:{color:\"#b00b00\",timeout:1e3}},initialize:function(t,e,i){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=t,i&&i.drawError&&(i.drawError=L.Util.extend({},this.options.drawError,i.drawError)),this._latlngs=e,L.setOptions(this,i)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var t=this._poly;t instanceof L.Polygon||(t.options.fill=!1,t.options.editing&&(t.options.editing.fill=!1)),t.setStyle(t.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var t=this._poly;t.setStyle(t.options.original),t._map&&(t._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,t.fire(\"editstop\"))},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var t,e,i,o,n,r,s=this._defaultShape();for(t=0,i=s.length;t<i;t++)o=this._createMarker(s[t],t),this._markers.push(o);for(t=0,e=i-1;t<i;e=t++)(0!==t||L.Polygon&&this._poly instanceof L.Polygon)&&(n=this._markers[e],r=this._markers[t],this._createMiddleMarker(n,r),this._updatePrevNext(n,r))},_createMarker:function(t,e){var i=new L.Marker.Touch(t,{draggable:!0,icon:this.options.icon});return i._origLatLng=t,i._index=e,i.on(\"dragstart\",this._onMarkerDragStart,this).on(\"drag\",this._onMarkerDrag,this).on(\"dragend\",this._fireEdit,this).on(\"touchmove\",this._onTouchMove,this).on(\"touchend\",this._fireEdit,this).on(\"MSPointerMove\",this._onTouchMove,this).on(\"MSPointerUp\",this._fireEdit,this),this._markerGroup.addLayer(i),i},_onMarkerDragStart:function(){this._poly.fire(\"editstart\")},_spliceLatLngs:function(){var t=this._defaultShape(),e=[].splice.apply(t,arguments);return this._poly._convertLatLngs(t,!0),this._poly.redraw(),e},_removeMarker:function(t){var e=t._index;this._markerGroup.removeLayer(t),this._markers.splice(e,1),this._spliceLatLngs(e,1),this._updateIndexes(e,-1),t.off(\"dragstart\",this._onMarkerDragStart,this).off(\"drag\",this._onMarkerDrag,this).off(\"dragend\",this._fireEdit,this).off(\"touchmove\",this._onMarkerDrag,this).off(\"touchend\",this._fireEdit,this).off(\"MSPointerMove\",this._onTouchMove,this).off(\"MSPointerUp\",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire(\"edit\"),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(t){var e=t.target;this._poly;L.extend(e._origLatLng,e._latlng),e._middleLeft&&e._middleLeft.setLatLng(this._getMiddleLatLng(e._prev,e)),e._middleRight&&e._middleRight.setLatLng(this._getMiddleLatLng(e,e._next));var i=[];for(var o in this._markers)i.push(this._markers[o].getLatLng());this._poly.setLatLngs(i),this._poly.editing.latlngs[0][0]=i,this._poly.redraw(),this._poly.fire(\"editdrag\")},_onMarkerClick:function(t){var e=L.Polygon&&this._poly instanceof L.Polygon?4:3,i=t.target;this._defaultShape().length<e||(this._removeMarker(i),this._updatePrevNext(i._prev,i._next),i._middleLeft&&this._markerGroup.removeLayer(i._middleLeft),i._middleRight&&this._markerGroup.removeLayer(i._middleRight),i._prev&&i._next?this._createMiddleMarker(i._prev,i._next):i._prev?i._next||(i._prev._middleRight=null):i._next._middleLeft=null,this._fireEdit())},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),i=this._map.layerPointToLatLng(e),o=t.target;L.extend(o._origLatLng,i),o._middleLeft&&o._middleLeft.setLatLng(this._getMiddleLatLng(o._prev,o)),o._middleRight&&o._middleRight.setLatLng(this._getMiddleLatLng(o,o._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(t,e){this._markerGroup.eachLayer((function(i){i._index>t&&(i._index+=e)}))},_createMiddleMarker:function(t,e){var i,o,n,r=this._getMiddleLatLng(t,e),s=this._createMarker(r);s.setOpacity(.6),t._middleRight=e._middleLeft=s,o=function(){s.off(\"touchmove\",o,this);var n=e._index;s._index=n,s.off(\"click\",i,this).on(\"click\",this._onMarkerClick,this),r.lat=s.getLatLng().lat,r.lng=s.getLatLng().lng,this._spliceLatLngs(n,0,r),this._markers.splice(n,0,s),s.setOpacity(1),this._updateIndexes(n,1),e._index++,this._updatePrevNext(t,s),this._updatePrevNext(s,e),this._poly.fire(\"editstart\")},n=function(){if(s.off(\"dragstart\",o,this),s.off(\"dragend\",n,this),s.off(\"touchmove\",o,this),this.intersect){e._index--;var i=e._index;this._spliceLatLngs(i,1),this._updateIndexes(i,-1),this._updatePrevNext(t,e),s.setOpacity(.6),this._poly.redraw(),this.updateMarkers()}else this._createMiddleMarker(t,s),this._createMiddleMarker(s,e)},i=function(){o.call(this),n.call(this),this._fireEdit()},s.on(\"dragstart\",o,this).on(\"dragend\",n,this).on(\"touchmove\",o,this),this._markerGroup.addLayer(s)},_updatePrevNext:function(t,e){t&&(t._next=e),e&&(e._prev=t)},_getMiddleLatLng:function(t,e){var i=this._poly._map,o=i.project(t.getLatLng()),n=i.project(e.getLatLng());return i.unproject(o._add(n)._divideBy(2))}}),L.Polyline.addInitHook((function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this,this.options.poly),this.options.editable&&this.editing.enable()),this.on(\"add\",(function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()})),this.on(\"remove\",(function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})))})),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-move\"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize\"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon\"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:\"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon\"})},initialize:function(t,e){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=t,L.Util.setOptions(this,e)},addHooks:function(){var t=this._shape;this._shape._map&&(this._map=this._shape._map,t.setStyle(t.options.editing),t._map&&(this._map=t._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var t=this._shape;if(t.setStyle(t.options.original),t._map){this._unbindMarker(this._moveMarker);for(var e=0,i=this._resizeMarkers.length;e<i;e++)this._unbindMarker(this._resizeMarkers[e]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(t,e){var i=new L.Marker.Touch(t,{draggable:!0,icon:e,zIndexOffset:10});return this._bindMarker(i),this._markerGroup.addLayer(i),i},_bindMarker:function(t){t.on(\"dragstart\",this._onMarkerDragStart,this).on(\"drag\",this._onMarkerDrag,this).on(\"dragend\",this._onMarkerDragEnd,this).on(\"touchstart\",this._onTouchStart,this).on(\"touchmove\",this._onTouchMove,this).on(\"MSPointerMove\",this._onTouchMove,this).on(\"touchend\",this._onTouchEnd,this).on(\"MSPointerUp\",this._onTouchEnd,this)},_unbindMarker:function(t){t.off(\"dragstart\",this._onMarkerDragStart,this).off(\"drag\",this._onMarkerDrag,this).off(\"dragend\",this._onMarkerDragEnd,this).off(\"touchstart\",this._onTouchStart,this).off(\"touchmove\",this._onTouchMove,this).off(\"MSPointerMove\",this._onTouchMove,this).off(\"touchend\",this._onTouchEnd,this).off(\"MSPointerUp\",this._onTouchEnd,this)},_onMarkerDragStart:function(t){t.target.setOpacity(0),this._shape.fire(\"editstart\")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire(\"edit\")},_onMarkerDrag:function(t){var e=t.target,i=e.getLatLng();e===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw(),this._shape.fire(\"editdrag\")},_onMarkerDragEnd:function(t){t.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(t){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t),\"function\"==typeof this._getCorners){var e=this._getCorners(),i=t.target,o=i._cornerIndex;i.setOpacity(0),this._oppositeCorner=e[(o+2)%4],this._toggleCornerMarkers(0,o)}this._shape.fire(\"editstart\")},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),i=this._map.layerPointToLatLng(e);return t.target===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw(),!1},_onTouchEnd:function(t){t.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getBounds().getCenter();this._moveMarker=this._createMarker(t,this.options.moveIcon)},_createResizeMarker:function(){var t=this._getCorners();this._resizeMarkers=[];for(var e=0,i=t.length;e<i;e++)this._resizeMarkers.push(this._createMarker(t[e],this.options.resizeIcon)),this._resizeMarkers[e]._cornerIndex=e},_onMarkerDragStart:function(t){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t);var e=this._getCorners(),i=t.target._cornerIndex;this._oppositeCorner=e[(i+2)%4],this._toggleCornerMarkers(0,i)},_onMarkerDragEnd:function(t){var e,i=t.target;i===this._moveMarker&&(e=this._shape.getBounds().getCenter(),i.setLatLng(e)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,t)},_move:function(t){for(var e,i=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),o=this._shape.getBounds().getCenter(),n=[],r=0,s=i.length;r<s;r++)e=[i[r].lat-o.lat,i[r].lng-o.lng],n.push([t.lat+e[0],t.lng+e[1]]);this._shape.setLatLngs(n),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(t){var e;this._shape.setBounds(L.latLngBounds(t,this._oppositeCorner)),e=this._shape.getBounds(),this._moveMarker.setLatLng(e.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var t=this._shape.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest()]},_toggleCornerMarkers:function(t){for(var e=0,i=this._resizeMarkers.length;e<i;e++)this._resizeMarkers[e].setOpacity(t)},_repositionCornerMarkers:function(){for(var t=this._getCorners(),e=0,i=this._resizeMarkers.length;e<i;e++)this._resizeMarkers[e].setLatLng(t[e])}}),L.Rectangle.addInitHook((function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())})),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getLatLng();this._moveMarker=this._createMarker(t,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(t){if(this._resizeMarkers.length){var e=this._getResizeMarkerPoint(t);this._resizeMarkers[0].setLatLng(e)}this._shape.setLatLng(t),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook((function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on(\"add\",(function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()})),this.on(\"remove\",(function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))})),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var t=this._shape.getLatLng(),e=this._getResizeMarkerPoint(t);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(e,this.options.resizeIcon))},_getResizeMarkerPoint:function(t){var e=this._shape._radius*Math.cos(Math.PI/4),i=this._map.project(t);return this._map.unproject([i.x+e,i.y-e])},_resize:function(t){var e=this._moveMarker.getLatLng(),i=this._map.distance(e,t);this._shape.setRadius(i),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook((function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable()),this.on(\"add\",(function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()})),this.on(\"remove\",(function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))})),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,\"touchstart\",this._onTouchStart,this),L.DomEvent.on(this._container,\"touchend\",this._onTouchEnd,this),L.DomEvent.on(this._container,\"touchmove\",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,\"MSPointerDown\",this._onTouchStart,this),L.DomEvent.on(this._container,\"MSPointerUp\",this._onTouchEnd,this),L.DomEvent.on(this._container,\"MSPointerMove\",this._onTouchMove,this),L.DomEvent.on(this._container,\"MSPointerCancel\",this._onTouchCancel,this)):(L.DomEvent.on(this._container,\"touchcancel\",this._onTouchCancel,this),L.DomEvent.on(this._container,\"touchleave\",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,\"touchstart\",this._onTouchStart),L.DomEvent.off(this._container,\"touchend\",this._onTouchEnd),L.DomEvent.off(this._container,\"touchmove\",this._onTouchMove),this._detectIE()?(L.DomEvent.off(this._container,\"MSPointerDowm\",this._onTouchStart),L.DomEvent.off(this._container,\"MSPointerUp\",this._onTouchEnd),L.DomEvent.off(this._container,\"MSPointerMove\",this._onTouchMove),L.DomEvent.off(this._container,\"MSPointerCancel\",this._onTouchCancel)):(L.DomEvent.off(this._container,\"touchcancel\",this._onTouchCancel),L.DomEvent.off(this._container,\"touchleave\",this._onTouchLeave))},_touchEvent:function(t,e){var i={};if(void 0!==t.touches){if(!t.touches.length)return;i=t.touches[0]}else{if(\"touch\"!==t.pointerType)return;if(i=t,!this._filterClick(t))return}var o=this._map.mouseEventToContainerPoint(i),n=this._map.mouseEventToLayerPoint(i),r=this._map.layerPointToLatLng(n);this._map.fire(e,{latlng:r,layerPoint:n,containerPoint:o,pageX:i.pageX,pageY:i.pageY,originalEvent:t})},_filterClick:function(t){var e=t.timeStamp||t.originalEvent.timeStamp,i=L.DomEvent._lastClick&&e-L.DomEvent._lastClick;return i&&i>100&&i<500||t.target._simulatedClick&&!t._simulated?(L.DomEvent.stop(t),!1):(L.DomEvent._lastClick=e,!0)},_onTouchStart:function(t){if(this._map._loaded){this._touchEvent(t,\"touchstart\")}},_onTouchEnd:function(t){if(this._map._loaded){this._touchEvent(t,\"touchend\")}},_onTouchCancel:function(t){if(this._map._loaded){var e=\"touchcancel\";this._detectIE()&&(e=\"pointercancel\"),this._touchEvent(t,e)}},_onTouchLeave:function(t){if(this._map._loaded){this._touchEvent(t,\"touchleave\")}},_onTouchMove:function(t){if(this._map._loaded){this._touchEvent(t,\"touchmove\")}},_detectIE:function(){var e=t.navigator.userAgent,i=e.indexOf(\"MSIE \");if(i>0)return parseInt(e.substring(i+5,e.indexOf(\".\",i)),10);if(e.indexOf(\"Trident/\")>0){var o=e.indexOf(\"rv:\");return parseInt(e.substring(o+3,e.indexOf(\".\",o)),10)}var n=e.indexOf(\"Edge/\");return n>0&&parseInt(e.substring(n+5,e.indexOf(\".\",n)),10)}}),L.Map.addInitHook(\"addHandler\",\"touchExtend\",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var t=this._icon,e=[\"dblclick\",\"mousedown\",\"mouseover\",\"mouseout\",\"contextmenu\",\"touchstart\",\"touchend\",\"touchmove\"];this._detectIE?e.concat([\"MSPointerDown\",\"MSPointerUp\",\"MSPointerMove\",\"MSPointerCancel\"]):e.concat([\"touchcancel\"]),L.DomUtil.addClass(t,\"leaflet-clickable\"),L.DomEvent.on(t,\"click\",this._onMouseClick,this),L.DomEvent.on(t,\"keypress\",this._onKeyPress,this);for(var i=0;i<e.length;i++)L.DomEvent.on(t,e[i],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var e=t.navigator.userAgent,i=e.indexOf(\"MSIE \");if(i>0)return parseInt(e.substring(i+5,e.indexOf(\".\",i)),10);if(e.indexOf(\"Trident/\")>0){var o=e.indexOf(\"rv:\");return parseInt(e.substring(o+3,e.indexOf(\".\",o)),10)}var n=e.indexOf(\"Edge/\");return n>0&&parseInt(e.substring(n+5,e.indexOf(\".\",n)),10)}}),L.LatLngUtil={cloneLatLngs:function(t){for(var e=[],i=0,o=t.length;i<o;i++)Array.isArray(t[i])?e.push(L.LatLngUtil.cloneLatLngs(t[i])):e.push(this.cloneLatLng(t[i]));return e},cloneLatLng:function(t){return L.latLng(t.lat,t.lng)}},n={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2},L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(t){var e,i,o=t.length,n=0,r=Math.PI/180;if(o>2){for(var s=0;s<o;s++)e=t[s],n+=((i=t[(s+1)%o]).lng-e.lng)*r*(2+Math.sin(e.lat*r)+Math.sin(i.lat*r));n=6378137*n*6378137/2}return Math.abs(n)},formattedNumber:function(t,e){var i=parseFloat(t).toFixed(e),o=L.drawLocal.format&&L.drawLocal.format.numeric,n=o&&o.delimiters,r=n&&n.thousands,s=n&&n.decimal;if(r||s){var a=i.split(\".\");i=r?a[0].replace(/(\\d)(?=(\\d{3})+(?!\\d))/g,\"\$1\"+r):a[0],s=s||\".\",a.length>1&&(i=i+s+a[1])}return i},readableArea:function(t,e,i){var r,s;return i=L.Util.extend({},n,i),e?(s=[\"ha\",\"m\"],type=o(e),\"string\"===type?s=[e]:\"boolean\"!==type&&(s=e),r=t>=1e6&&-1!==s.indexOf(\"km\")?L.GeometryUtil.formattedNumber(1e-6*t,i.km)+\" km²\":t>=1e4&&-1!==s.indexOf(\"ha\")?L.GeometryUtil.formattedNumber(1e-4*t,i.ha)+\" ha\":L.GeometryUtil.formattedNumber(t,i.m)+\" m²\"):r=(t/=.836127)>=3097600?L.GeometryUtil.formattedNumber(t/3097600,i.mi)+\" mi²\":t>=4840?L.GeometryUtil.formattedNumber(t/4840,i.ac)+\" acres\":L.GeometryUtil.formattedNumber(t,i.yd)+\" yd²\",r},readableDistance:function(t,e,i,o,r){var s;switch(r=L.Util.extend({},n,r),e?\"string\"==typeof e?e:\"metric\":i?\"feet\":o?\"nauticalMile\":\"yards\"){case\"metric\":s=t>1e3?L.GeometryUtil.formattedNumber(t/1e3,r.km)+\" km\":L.GeometryUtil.formattedNumber(t,r.m)+\" m\";break;case\"feet\":t*=3.28083,s=L.GeometryUtil.formattedNumber(t,r.ft)+\" ft\";break;case\"nauticalMile\":t*=.53996,s=L.GeometryUtil.formattedNumber(t/1e3,r.nm)+\" nm\";break;case\"yards\":default:s=(t*=1.09361)>1760?L.GeometryUtil.formattedNumber(t/1760,r.mi)+\" miles\":L.GeometryUtil.formattedNumber(t,r.yd)+\" yd\"}return s}}),L.Util.extend(L.LineUtil,{segmentsIntersect:function(t,e,i,o){return this._checkCounterclockwise(t,i,o)!==this._checkCounterclockwise(e,i,o)&&this._checkCounterclockwise(t,e,i)!==this._checkCounterclockwise(t,e,o)},_checkCounterclockwise:function(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}}),L.Polyline.include({intersects:function(){var t,e,i,o=this._getProjectedPoints(),n=o?o.length:0;if(this._tooFewPointsForIntersection())return!1;for(t=n-1;t>=3;t--)if(e=o[t-1],i=o[t],this._lineSegmentsIntersectsRange(e,i,t-2))return!0;return!1},newLatLngIntersects:function(t,e){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(t),e)},newPointIntersects:function(t,e){var i=this._getProjectedPoints(),o=i?i.length:0,n=i?i[o-1]:null,r=o-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(n,t,r,e?1:0)},_tooFewPointsForIntersection:function(t){var e=this._getProjectedPoints(),i=e?e.length:0;return!e||(i+=t||0)<=3},_lineSegmentsIntersectsRange:function(t,e,i,o){var n,r,s=this._getProjectedPoints();o=o||0;for(var a=i;a>o;a--)if(n=s[a-1],r=s[a],L.LineUtil.segmentsIntersect(t,e,n,r))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var t=[],e=this._defaultShape(),i=0;i<e.length;i++)t.push(this._map.latLngToLayerPoint(e[i]));return t}}),L.Polygon.include({intersects:function(){var t,e,i,o,n=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(t=n.length,e=n[0],i=n[t-1],o=t-2,this._lineSegmentsIntersectsRange(i,e,o,1)))}}),L.Control.Draw=L.Control.extend({options:{position:\"topleft\",draw:{},edit:!1},initialize:function(t){if(L.version<\"0.7\")throw new Error(\"Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/\");var e;L.Control.prototype.initialize.call(this,t),this._toolbars={},L.DrawToolbar&&this.options.draw&&(e=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=e,this._toolbars[L.DrawToolbar.TYPE].on(\"enable\",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(e=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=e,this._toolbars[L.EditToolbar.TYPE].on(\"enable\",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(t){var e,i=L.DomUtil.create(\"div\",\"leaflet-draw\"),o=!1,n=\"leaflet-draw-toolbar-top\";for(var r in this._toolbars)this._toolbars.hasOwnProperty(r)&&(e=this._toolbars[r].addToolbar(t))&&(o||(L.DomUtil.hasClass(e,n)||L.DomUtil.addClass(e.childNodes[0],n),o=!0),i.appendChild(e));return i},onRemove:function(){for(var t in this._toolbars)this._toolbars.hasOwnProperty(t)&&this._toolbars[t].removeToolbar()},setDrawingOptions:function(t){for(var e in this._toolbars)this._toolbars[e]instanceof L.DrawToolbar&&this._toolbars[e].setOptions(t)},_toolbarEnabled:function(t){var e=t.target;for(var i in this._toolbars)this._toolbars[i]!==e&&this._toolbars[i].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook((function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))})),L.Toolbar=L.Class.extend({includes:[L.Mixin.Events],initialize:function(t){L.setOptions(this,t),this._modes={},this._actionButtons=[],this._activeMode=null},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(t){var e,i=L.DomUtil.create(\"div\",\"leaflet-draw-section\"),o=0,n=this._toolbarClass||\"\",r=this.getModeHandlers(t);for(this._toolbarContainer=L.DomUtil.create(\"div\",\"leaflet-draw-toolbar leaflet-bar\"),this._map=t,e=0;e<r.length;e++)r[e].enabled&&this._initModeHandler(r[e].handler,this._toolbarContainer,o++,n,r[e].title);if(o)return this._lastButtonIndex=--o,this._actionsContainer=L.DomUtil.create(\"ul\",\"leaflet-draw-actions\"),i.appendChild(this._toolbarContainer),i.appendChild(this._actionsContainer),i},removeToolbar:function(){for(var t in this._modes)this._modes.hasOwnProperty(t)&&(this._disposeButton(this._modes[t].button,this._modes[t].handler.enable,this._modes[t].handler),this._modes[t].handler.disable(),this._modes[t].handler.off(\"enabled\",this._handlerActivated,this).off(\"disabled\",this._handlerDeactivated,this));this._modes={};for(var e=0,i=this._actionButtons.length;e<i;e++)this._disposeButton(this._actionButtons[e].button,this._actionButtons[e].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(t,e,i,o,n){var r=t.type;this._modes[r]={},this._modes[r].handler=t,this._modes[r].button=this._createButton({type:r,title:n,className:o+\"-\"+r,container:e,callback:this._modes[r].handler.enable,context:this._modes[r].handler}),this._modes[r].buttonIndex=i,this._modes[r].handler.on(\"enabled\",this._handlerActivated,this).on(\"disabled\",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!t.MSStream},_createButton:function(t){var e=L.DomUtil.create(\"a\",t.className||\"\",t.container),i=L.DomUtil.create(\"span\",\"sr-only\",t.container);e.href=\"#\",e.appendChild(i),t.title&&(e.title=t.title,i.innerHTML=t.title),t.text&&(e.innerHTML=t.text,i.innerHTML=t.text);var o=this._detectIOS()?\"touchstart\":\"click\";return L.DomEvent.on(e,\"click\",L.DomEvent.stopPropagation).on(e,\"mousedown\",L.DomEvent.stopPropagation).on(e,\"dblclick\",L.DomEvent.stopPropagation).on(e,\"touchstart\",L.DomEvent.stopPropagation).on(e,\"click\",L.DomEvent.preventDefault).on(e,o,t.callback,t.context),e},_disposeButton:function(t,e){var i=this._detectIOS()?\"touchstart\":\"click\";L.DomEvent.off(t,\"click\",L.DomEvent.stopPropagation).off(t,\"mousedown\",L.DomEvent.stopPropagation).off(t,\"dblclick\",L.DomEvent.stopPropagation).off(t,\"touchstart\",L.DomEvent.stopPropagation).off(t,\"click\",L.DomEvent.preventDefault).off(t,i,e)},_handlerActivated:function(t){this.disable(),this._activeMode=this._modes[t.handler],L.DomUtil.addClass(this._activeMode.button,\"leaflet-draw-toolbar-button-enabled\"),this._showActionsToolbar(),this.fire(\"enable\")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,\"leaflet-draw-toolbar-button-enabled\"),this._activeMode=null,this.fire(\"disable\")},_createActions:function(t){var e,i,o,n,r=this._actionsContainer,s=this.getActions(t),a=s.length;for(i=0,o=this._actionButtons.length;i<o;i++)this._disposeButton(this._actionButtons[i].button,this._actionButtons[i].callback);for(this._actionButtons=[];r.firstChild;)r.removeChild(r.firstChild);for(var l=0;l<a;l++)\"enabled\"in s[l]&&!s[l].enabled||(e=L.DomUtil.create(\"li\",\"\",r),n=this._createButton({title:s[l].title,text:s[l].text,container:e,callback:s[l].callback,context:s[l].context}),this._actionButtons.push({button:n,callback:s[l].callback}))},_showActionsToolbar:function(){var t=this._activeMode.buttonIndex,e=this._lastButtonIndex,i=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=i+\"px\",0===t&&(L.DomUtil.addClass(this._toolbarContainer,\"leaflet-draw-toolbar-notop\"),L.DomUtil.addClass(this._actionsContainer,\"leaflet-draw-actions-top\")),t===e&&(L.DomUtil.addClass(this._toolbarContainer,\"leaflet-draw-toolbar-nobottom\"),L.DomUtil.addClass(this._actionsContainer,\"leaflet-draw-actions-bottom\")),this._actionsContainer.style.display=\"block\"},_hideActionsToolbar:function(){this._actionsContainer.style.display=\"none\",L.DomUtil.removeClass(this._toolbarContainer,\"leaflet-draw-toolbar-notop\"),L.DomUtil.removeClass(this._toolbarContainer,\"leaflet-draw-toolbar-nobottom\"),L.DomUtil.removeClass(this._actionsContainer,\"leaflet-draw-actions-top\"),L.DomUtil.removeClass(this._actionsContainer,\"leaflet-draw-actions-bottom\")}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(t){this._map=t,this._popupPane=t._panes.popupPane,this._visible=!1,this._container=t.options.drawControlTooltips?L.DomUtil.create(\"div\",\"leaflet-draw-tooltip\",this._popupPane):null,this._singleLineLabel=!1,this._map.on(\"mouseout\",this._onMouseOut,this)},dispose:function(){this._map.off(\"mouseout\",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(t){return this._container?(t.subtext=t.subtext||\"\",0!==t.subtext.length||this._singleLineLabel?t.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,\"leaflet-draw-tooltip-single\"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,\"leaflet-draw-tooltip-single\"),this._singleLineLabel=!0),this._container.innerHTML=(t.subtext.length>0?'<span class=\"leaflet-draw-tooltip-subtext\">'+t.subtext+\"</span><br />\":\"\")+\"<span>\"+t.text+\"</span>\",t.text||t.subtext?(this._visible=!0,this._container.style.visibility=\"inherit\"):(this._visible=!1,this._container.style.visibility=\"hidden\"),this):this},updatePosition:function(t){var e=this._map.latLngToLayerPoint(t),i=this._container;return this._container&&(this._visible&&(i.style.visibility=\"inherit\"),L.DomUtil.setPosition(i,e)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,\"leaflet-error-draw-tooltip\"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,\"leaflet-error-draw-tooltip\"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility=\"hidden\")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:\"draw\"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(t){for(var e in this.options)this.options.hasOwnProperty(e)&&t[e]&&(t[e]=L.extend({},this.options[e],t[e]));this._toolbarClass=\"leaflet-draw-draw\",L.Toolbar.prototype.initialize.call(this,t)},getModeHandlers:function(t){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(t,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(t,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(t,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(t,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(t,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(t,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(t){return[{enabled:t.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:t.deleteLastVertex,context:t},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(t){for(var e in L.setOptions(this,t),this._modes)this._modes.hasOwnProperty(e)&&t.hasOwnProperty(e)&&this._modes[e].handler.setOptions(t[e])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:\"edit\"},options:{edit:{selectedPathOptions:{dashArray:\"10, 10\",fill:!0,fillColor:\"#fe57a1\",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(t){t.edit&&(void 0===t.edit.selectedPathOptions&&(t.edit.selectedPathOptions=this.options.edit.selectedPathOptions),t.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,t.edit.selectedPathOptions)),t.remove&&(t.remove=L.extend({},this.options.remove,t.remove)),t.poly&&(t.poly=L.extend({},this.options.poly,t.poly)),this._toolbarClass=\"leaflet-draw-edit\",L.Toolbar.prototype.initialize.call(this,t),this._selectedFeatureCount=0},getModeHandlers:function(t){var e=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(t,{featureGroup:e,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(t,{featureGroup:e}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(t){var e=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return t.removeAllLayers&&e.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),e},addToolbar:function(t){var e=L.Toolbar.prototype.addToolbar.call(this,t);return this._checkDisabled(),this.options.featureGroup.on(\"layeradd layerremove\",this._checkDisabled,this),e},removeToolbar:function(){this.options.featureGroup.off(\"layeradd layerremove\",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var t,e=0!==this.options.featureGroup.getLayers().length;this.options.edit&&(t=this._modes[L.EditToolbar.Edit.TYPE].button,e?L.DomUtil.removeClass(t,\"leaflet-disabled\"):L.DomUtil.addClass(t,\"leaflet-disabled\"),t.setAttribute(\"title\",e?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(t=this._modes[L.EditToolbar.Delete.TYPE].button,e?L.DomUtil.removeClass(t,\"leaflet-disabled\"):L.DomUtil.addClass(t,\"leaflet-disabled\"),t.setAttribute(\"title\",e?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:\"edit\"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.setOptions(this,e),this._featureGroup=e.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error(\"options.featureGroup must be a L.FeatureGroup\");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire(\"enabled\",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on(\"layeradd\",this._enableLayerEdit,this).on(\"layerremove\",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off(\"layeradd\",this._enableLayerEdit,this).off(\"layerremove\",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire(\"disabled\",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),t._editTooltip=this._tooltip,this._updateTooltip(),this._map.on(\"mousemove\",this._onMouseMove,this).on(\"touchmove\",this._onMouseMove,this).on(\"MSPointerMove\",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off(\"mousemove\",this._onMouseMove,this).off(\"touchmove\",this._onMouseMove,this).off(\"MSPointerMove\",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer((function(t){this._revertLayer(t)}),this)},save:function(){var t=new L.LayerGroup;this._featureGroup.eachLayer((function(e){e.edited&&(t.addLayer(e),e.edited=!1)})),this._map.fire(L.Draw.Event.EDITED,{layers:t})},_backupLayer:function(t){var e=L.Util.stamp(t);this._uneditedLayerProps[e]||(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?this._uneditedLayerProps[e]={latlngs:L.LatLngUtil.cloneLatLngs(t.getLatLngs())}:t instanceof L.Circle?this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng()),radius:t.getRadius()}:(t instanceof L.Marker||t instanceof L.CircleMarker)&&(this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(t){var e=L.Util.stamp(t);t.edited=!1,this._uneditedLayerProps.hasOwnProperty(e)&&(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?t.setLatLngs(this._uneditedLayerProps[e].latlngs):t instanceof L.Circle?(t.setLatLng(this._uneditedLayerProps[e].latlng),t.setRadius(this._uneditedLayerProps[e].radius)):(t instanceof L.Marker||t instanceof L.CircleMarker)&&t.setLatLng(this._uneditedLayerProps[e].latlng),t.fire(\"revert-edited\",{layer:t}))},_enableLayerEdit:function(t){var e,i,o=t.layer||t.target||t;this._backupLayer(o),this.options.poly&&(i=L.Util.extend({},this.options.poly),o.options.poly=i),this.options.selectedPathOptions&&((e=L.Util.extend({},this.options.selectedPathOptions)).maintainColor&&(e.color=o.options.color,e.fillColor=o.options.fillColor),o.options.original=L.extend({},o.options),o.options.editing=e),o instanceof L.Marker?(o.editing&&o.editing.enable(),o.dragging.enable(),o.on(\"dragend\",this._onMarkerDragEnd).on(\"touchmove\",this._onTouchMove,this).on(\"MSPointerMove\",this._onTouchMove,this).on(\"touchend\",this._onMarkerDragEnd,this).on(\"MSPointerUp\",this._onMarkerDragEnd,this)):o.editing.enable()},_disableLayerEdit:function(t){var e=t.layer||t.target||t;e.edited=!1,e.editing&&e.editing.disable(),delete e.options.editing,delete e.options.original,this._selectedPathOptions&&(e instanceof L.Marker?this._toggleMarkerHighlight(e):(e.setStyle(e.options.previousOptions),delete e.options.previousOptions)),e instanceof L.Marker?(e.dragging.disable(),e.off(\"dragend\",this._onMarkerDragEnd,this).off(\"touchmove\",this._onTouchMove,this).off(\"MSPointerMove\",this._onTouchMove,this).off(\"touchend\",this._onMarkerDragEnd,this).off(\"MSPointerUp\",this._onMarkerDragEnd,this)):e.editing.disable()},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_onMarkerDragEnd:function(t){var e=t.target;e.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e})},_onTouchMove:function(t){var e=t.originalEvent.changedTouches[0],i=this._map.mouseEventToLayerPoint(e),o=this._map.layerPointToLatLng(i);t.target.setLatLng(o)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:\"remove\"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.Util.setOptions(this,e),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error(\"options.featureGroup must be a L.FeatureGroup\");this.type=L.EditToolbar.Delete.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire(\"enabled\",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on(\"layeradd\",this._enableLayerDelete,this).on(\"layerremove\",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off(\"layeradd\",this._enableLayerDelete,this).off(\"layerremove\",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire(\"disabled\",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on(\"mousemove\",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off(\"mousemove\",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer((function(t){this._deletableLayers.addLayer(t),t.fire(\"revert-deleted\",{layer:t})}),this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer((function(t){this._removeLayer({layer:t})}),this),this.save()},_enableLayerDelete:function(t){(t.layer||t.target||t).on(\"click\",this._removeLayer,this)},_disableLayerDelete:function(t){var e=t.layer||t.target||t;e.off(\"click\",this._removeLayer,this),this._deletedLayers.removeLayer(e)},_removeLayer:function(t){var e=t.layer||t.target||t;this._deletableLayers.removeLayer(e),this._deletedLayers.addLayer(e),e.fire(\"deleted\")},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})}(window,document)},49931:(t,e,i)=>{\"use strict\";i(21249),i(26699),i(69826),i(9653),i(74916),i(15306),i(82772),i(23123),i(83710),i(85827),i(89554),i(54747),i(5212),i(40561);var o=i(20508),n=i(62104),r=i(33258),s=i(80258),a=i(72863),l=i(92938),h=i(82270),c=i(73385),d=i(46951),p=i(59434),u=i(33804),_=i(80739),f=i(81311),m=i(47102),g=i(368),v=(i(45243),i(58646),i(83782),i(42295),i(94979),i(19755));v(document).on(\"ready turbo:load\",(function(){v(window).resize((function(){var t=344,e=60;v(\"#filter-container\").hasClass(\"active\")&&(t=482),v(\"#blocRight\").hasClass(\"active\")||(e=97),v(\"#sectorisationMap\").css(\"width\",e+\"%\");var i=v(window).height()-t;v(\"#sectorisationMap\").css(\"height\",i+30+\"px\"),v(\"#blocTab\").css(\"height\",i+\"px\"),v(\"#explainMe\").css(\"height\",i+\"px\"),v(\"#containerMap\").css(\"height\",i+30+\"px\")})),v(\".dx-datagrid-search-panel\").css(\"width\",\"250px\"),v(window).trigger(\"resize\"),document.getElementById(\"filter-image\").addEventListener(\"click\",(function(){v(\"#listeAgents\").hasClass(\"visible\")||(v(\"#listeAgents\").addClass(\"visible\"),v(\"#listeAgents\").show()),v(window).trigger(\"resize\")})),v(\"#minimize-tab\").click((function(){v(\"#blocRight\").toggleClass(\"active\"),v(window).trigger(\"resize\")}));var t=[\"SPRINGGREEN\",\"aqua\",\"yellow\",\"DEEPPINK\",\"STEELBLUE\",\"green\",\"GOLDENROD\",\"DEEPSKYBLUE\",\"magenta\",\"purple\",\"orange\",\"DARKRED\",\"maroon\"],e=[\"VERGNIEUX\",\"HANNIQUET\",\"GOSNET\",\"CHEZE\",\"LAHALLE\"],i=[],y=JSON.parse(v(\"#tabAgents\")[0].innerHTML),k=v(\"#site\")[0].innerHTML;console.info(K);var w=[];for(var b in y)w[y[b].code_agent]||(w[y[b].code_agent]=[]),w[y[b].code_agent].nbClients=y[b].nb_clients,w[y[b].code_agent].famille0=y[b].famille0,w[y[b].code_agent].famille1=y[b].famille1,w[y[b].code_agent].famille2=y[b].famille2,w[y[b].code_agent].famille3=y[b].famille3;new L.layerGroup;var M=!1,E=!0,D=!0,x=!1,T=new L.FeatureGroup,C=!1,P=[],S=L.icon({iconUrl:n,iconAnchor:[12,21]}),A=(L.icon({iconUrl:r,iconAnchor:[12,21]}),L.icon({iconUrl:s,iconSize:[14,14],iconAnchor:[7,7]})),O=(L.icon({iconUrl:a,iconSize:[20,20],iconAnchor:[10,10]}),11),I=[48.876457644366816,2.3644638061523438];\"BRON\"==k?I=[45.75,4.85]:\"HANNIQUET\"==k?(I=[48.385,2.951],O=10):\"GOSNET\"==k?(I=[49.429,2.08],O=9):\"LAHALLE\"==k?(I=[48.8,2.1900052],O=12):\"VERGNIEUX\"==k?(I=[48.62,1.7800076],O=10):\"CHEZE\"==k&&(I=[48.5309275,2.1939081],O=10);var z=L.map(\"sectorisationMap\").setView(I,O);z.zoomControl._zoomInButton.title=\"Zoom avant\",z.zoomControl._zoomOutButton.title=\"Zoom arrière\";L.control.scale({position:\"bottomright\"}).addTo(z);var U=L.tileLayer(\"http://sfcp.frisquet.com/?t={z}/{x}/{y}&th=ggl\",{maxZoom:18,detectRetina:!0,attribution:'<a target=\"_blank\" href=\"https://icones8.fr\">Icons8</a>'});U.addTo(z);var H=L.tileLayer(\"http://{s}.tile.osm.org/{z}/{x}/{y}.png\",{attribution:'&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors | &copy <a target=\"_blank\" href=\"https://icones8.fr\">Icons8</a>'}),G=L.tileLayer(\"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}\",{attribution:'Tiles &copy; Esri | &copy <a target=\"_blank\" href=\"https://icones8.fr\">Icons8</a>'}),R=L.tileLayer(\"https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}\",{attribution:'Tiles &copy; Esri | &copy <a target=\"_blank\" href=\"https://icones8.fr\">Icons8</a>'}),N=L.tileLayer(\"http://{s}.tile.osm.org/{z}/{x}/{y}.png\",{attribution:'&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors | &copy <a target=\"_blank\" href=\"https://icones8.fr\">Icons8</a>'}),F=L.map(\"histoMap\").setView(I,11);F.zoomControl._zoomInButton.title=\"Zoom avant\",F.zoomControl._zoomOutButton.title=\"Zoom arrière\",N.addTo(F);var B={\"Google Map\":U,Plan:H,Satellite:G,Topographique:R};L.control.layers(B).addTo(z);var V=[],j=(new L.FeatureGroup,new L.FeatureGroup,new L.FeatureGroup),W=new L.FeatureGroup;z.addLayer(W);var Y=new L.FeatureGroup;z.addLayer(Y);var \$=new L.FeatureGroup;z.addLayer(\$);var q=new L.FeatureGroup;z.addLayer(q);var X=new L.FeatureGroup;z.addLayer(X);var Z=new L.FeatureGroup;F.addLayer(Z);var K=new L.FeatureGroup;if(z.addLayer(K),e.includes(k))var J={position:\"topright\",draw:{polyline:!1,polygon:!1,circle:!1,rectangle:!1,marker:!1,circlemarker:!1},edit:!1};else J={position:\"topright\",draw:{polyline:!1,polygon:{shapeOptions:{color:\"#000\",opacity:1,weight:2},allowIntersection:!1,showArea:!0,drawError:{color:\"red\",message:\"<strong>Oh non !<strong> Vous ne pouvez pas tracer ça !\"},guideLayers:V},circle:!1,rectangle:!1,marker:!1,circlemarker:!1},edit:!1};var Q=new L.Control.Draw(J);z.addControl(Q),z.addControl(new L.Control.Search({url:\"https://nominatim.openstreetmap.org/search?format=json&q={s}\",textPlaceholder:\"Adresse, ville...\",textErr:\"Localisation non trouvé\",jsonpParam:\"json_callback\",propertyName:\"display_name\",propertyLoc:[\"lat\",\"lon\"],hideMarkerOnCollapse:!0,autoCollapse:!0,autoType:!1,minLength:2,zoom:14}));var tt=L.Control.extend({options:{position:\"topleft\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Retour arrière\"),e.setAttribute(\"id\",\"undo\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+l+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.style.position=\"relative\",e.style.display=\"none\",e.onclick=function(){undo()},e}});z.addControl(new tt);var et=L.Control.extend({options:{position:\"topleft\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Rafraîchir / Effacer les modifications non enregistrées\"),e.setAttribute(\"id\",\"refresh\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+h+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.onclick=function(){refresh(\"\",\"\",!0)},e}});z.addControl(new et);var it=L.Control.extend({options:{position:\"topleft\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Sauvegarde des secteurs\"),e.setAttribute(\"id\",\"save\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+o+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\"> <img src=\"'+c+'\" id=\"pastille\" style=\"position: absolute;right:0;bottom: 0;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.style.position=\"relative\",e.onclick=function(){if(P.length>1){for(var t in v(\"#saveMe #historiqueActions\")[0].innerHTML=\"\",P)t>0&&(v(\"#saveMe #historiqueActions\")[0].innerHTML+=\"<li>\"+P[t].texte+\"</li>\");v(\"#saveModif\")[0].disabled=!1,v(\"#deleteModif\")[0].disabled=!1}else v(\"#saveMe #historiqueActions\")[0].innerHTML=\"Aucune modification en cours.\",v(\"#saveModif\")[0].disabled=!0,v(\"#deleteModif\")[0].disabled=!0;v(\"#saveMe\").modal(\"show\"),v(\"#deleteModif\").off(\"click\"),v(\"#deleteModif\").on(\"click\",(function(t){v(\"#saveMe\").modal(\"hide\"),refresh()}))},e}});if(z.addControl(new it),\"MEAUX\"==k){it=L.Control.extend({options:{position:\"topleft\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Synchronisation\"),e.setAttribute(\"id\",\"synchro\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+d+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.style.position=\"relative\",e.onclick=function(){synchro()},e}});z.addControl(new it)}v(\"body\").on(\"submit\",\"form#form_save\",(function(t){v(this);if(t.preventDefault(),P.length>0){for(var e=document.getElementsByClassName(\"dateMep\"),i=!1,o=0;o<e.length;o++)if(e[o].innerHTML==v(\"#dateMep\").val()){i=!0;break}i?(v(\"#saveMe\").modal(\"hide\"),v(\"#alertDate\").modal(\"show\"),v(\"#confirmEcrase\").off(\"click\"),v(\"#confirmEcrase\").on(\"click\",(function(t){v(\"#alertDate\").modal(\"hide\"),saveVersion()}))):saveVersion()}}));var ot=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Création assistée secteur\"),e.setAttribute(\"id\",\"creationAssist\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+p+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.style.position=\"relative\",e.onclick=function(){hideFunctions(),v(\"#legende p#texte\")[0].innerHTML=\"Sélectionnez deux points non adjacent pour créer un secteur\",v(\"#explainMe\").show(),!0,!0,j=new L.FeatureGroup,t.addLayer(j),!1;for(var e=0;e<\$._latlngs.length;e++)for(var i=0;i<\$._latlngs[e].length;i++)if(\$._latlngs[e][i].lat){var o=new L.Marker(\$._latlngs[e][i],{pos:i,icon:S});j.addLayer(o),o.on(\"click\",(function(t){clickMarkerAssist(this)}))}else for(var n=0;n<\$._latlngs[e][i].length;n++){o=new L.Marker(\$._latlngs[e][i][n],{pos:n,icon:S});j.addLayer(o),o.on(\"click\",(function(t){clickMarkerAssist(this)}))}},e}});e.includes(k)||z.addControl(new ot);var nt=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Afficher le nombre de clients par secteurs\"),e.setAttribute(\"id\",\"nbClients\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+u+'\"  style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.onclick=function(){t.eachLayer((function(t){t instanceof L.Polygon&&t.toggleTooltip()})),M=!M},e}});z.addControl(new nt);var rt=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Afficher les agents\"),e.setAttribute(\"id\",\"agents\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+_+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.onclick=function(){E=bt(E,K)},e}});z.addControl(new rt);var st=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Afficher l'agent principal des secteurs\"),e.setAttribute(\"id\",\"principal\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+f+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.onclick=function(){D=bt(D,X)},e}});z.addControl(new st);var at=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Afficher la densité client\"),e.setAttribute(\"id\",\"densite\"),e.style.backgroundColor=\"white\",e.innerHTML='<img src=\"'+m+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"30px\",e.onclick=function(){x=bt(x,\"\")},e}});z.addControl(new at);var lt,ht=L.Control.extend({options:{position:\"topright\"},onAdd:function(t){var e=L.DomUtil.create(\"div\",\"leaflet-bar leaflet-control leaflet-control-custom\");return e.setAttribute(\"title\",\"Afficher les clients hors secteurs\"),e.setAttribute(\"id\",\"clients\"),e.style.backgroundColor=\"white\",e.innerHTML='<div id=\"nbClientHorsSecteur\" class=\"alertes\" style=\"font-size:10px;margin:0px;\">0</div><img src=\"'+g+'\" style=\"height: 24px;margin: 1px;cursor: pointer;\">',e.style.backgroundSize=\"30px 30px\",e.style.width=\"30px\",e.style.height=\"45px\",e.onclick=function(){C=bt(C,T)},e}});z.addControl(new ht),v.ajax({method:\"POST\",dataType:\"json\",url:\"/map/get_secteurs\",data:JSON.stringify({version:lt}),success:function(e){var o=[],n=0;e.forEach((function(e){if(\"Polygon\"==e.coordonnees.type){e.coordonnees.coordinates[0].forEach((function(t){o.push([t[1],t[0]])}));var r=L.polygon(o,{}).addTo(z),s=!0;e.agentSecteurs.some((function(e){if(1==e.rang_tri){i[e.utilisateur_agent.groupe_affectation]||(i[e.utilisateur_agent.groupe_affectation]=t[n],n+=1),r.setStyle(wt(e.utilisateur_agent.groupe_affectation)),s=!1;var o=new L.CircleMarker(r.getCenter(),{radius:.1,opacity:0,codeAgent:e.utilisateur_agent.initiales}).bindTooltip(\"\"+e.utilisateur_agent.initiales,{permanent:!0,direction:\"center\",className:\"my-labels\"});return X.addLayer(o),!0}})),s&&r.setStyle(wt(\"\")),function(t,e){e.bindTooltip(t.nbEquipement.nb_total+\" clients\",{permanent:!0,direction:\"center\"}).closeTooltip()}(e,r),o=[],function(t){t.on(\"mouseover mouseout\",(function(e){t.toggleTooltip()}))}(r)}}))}}),v.ajax({dataType:\"json\",url:\"/agents/domicile\",success:function(t){console.info(t),t.forEach((function(t){var e=[0,0];null!=t.coordonnees&&(e=[t.coordonnees.latitude,t.coordonnees.longitude]);var i=L.marker(e,{radius:6,fillColor:\"#28529a\",color:\"#fff\",weight:1,opacity:1,fillOpacity:1,icon:A}).addTo(z);i.bindPopup(t.nomComplet),K.addLayer(i)}))}});var ct=v(\".cd-horizontal-timeline\"),dt=17;function pt(t,e,i,o){var n=Lt(t.eventsWrapper),r=Number(t.timelineWrapper.css(\"width\").replace(\"px\",\"\"));\"next\"==i?_t(t,(n-r+dt)*o,r-e):_t(t,n+r-dt)}function ut(t,e,i){var o=t.eventsContent.find(\".selected\");if((\"next\"==i?o.next():o.prev()).length>0){var n=t.eventsWrapper.find(\".selected\"),r=\"next\"==i?n.parent(\"li\").next(\"li\").children(\"a\"):n.parent(\"li\").prev(\"li\").children(\"a\");ft(r,t.fillingLine,e),mt(r,t.eventsContent),r.addClass(\"selected\"),n.removeClass(\"selected\"),gt(r),function(t,e,i,o){var n=window.getComputedStyle(e.get(0),null),r=Number(n.getPropertyValue(\"left\").replace(\"px\",\"\")),s=Number(i.timelineWrapper.css(\"width\").replace(\"px\",\"\")),a=(o=Number(i.eventsWrapper.css(\"width\").replace(\"px\",\"\")),Lt(i.eventsWrapper));(\"next\"==t&&r>s-a||\"prev\"==t&&r<-a)&&_t(i,s/2-r,s-o)}(i,r,t,e)}}function _t(t,e,i){e=e>0?0:e,vt(t.eventsWrapper.get(0),\"translateX\",(e=void 0!==i&&e<i?i:e)+\"px\"),0==e?t.timelineNavigation.find(\".prev\").addClass(\"inactive\"):t.timelineNavigation.find(\".prev\").removeClass(\"inactive\"),e==i?t.timelineNavigation.find(\".next\").addClass(\"inactive\"):t.timelineNavigation.find(\".next\").removeClass(\"inactive\")}function ft(t,e,i){var o=window.getComputedStyle(t.get(0),null),n=o.getPropertyValue(\"left\"),r=o.getPropertyValue(\"width\"),s=(n=Number(n.replace(\"%\",\"\"))+Number(r.replace(\"%\",\"\"))/2)/i;vt(e.get(0),\"scaleX\",s)}function mt(t,e){var i=t.data(\"date\"),o=e.find(\".selected\"),n=e.find('[data-date=\"'+i+'\"]'),r=n.height();if(n.index()>o.index())var s=\"selected enter-right\",a=\"leave-left\";else s=\"selected enter-left\",a=\"leave-right\";n.attr(\"class\",s),o.attr(\"class\",a).one(\"webkitAnimationEnd oanimationend msAnimationEnd animationend\",(function(){o.removeClass(\"leave-right leave-left\"),n.removeClass(\"enter-left enter-right\")})),e.css(\"height\",r+\"px\")}function gt(t){t.parent(\"li\").prevAll(\"li\").children(\"a\").addClass(\"older-event\").end().end().nextAll(\"li\").children(\"a\").removeClass(\"older-event\")}function Lt(t){var e=window.getComputedStyle(t.get(0),null);if((i=e.getPropertyValue(\"-webkit-transform\")||e.getPropertyValue(\"-moz-transform\")||e.getPropertyValue(\"-ms-transform\")||e.getPropertyValue(\"-o-transform\")||e.getPropertyValue(\"transform\")).indexOf(\"(\")>=0)var i,o=(i=(i=(i=i.split(\"(\")[1]).split(\")\")[0]).split(\",\"))[4];else o=0;return Number(o)}function vt(t,e,i){t.style[\"-webkit-transform\"]=e+\"(\"+i+\")\",t.style[\"-moz-transform\"]=e+\"(\"+i+\")\",t.style[\"-ms-transform\"]=e+\"(\"+i+\")\",t.style[\"-o-transform\"]=e+\"(\"+i+\")\",t.style.transform=e+\"(\"+i+\")\"}function yt(t){for(var e=t.offsetTop,i=t.offsetLeft,o=t.offsetWidth,n=t.offsetHeight;t.offsetParent;)e+=(t=t.offsetParent).offsetTop,i+=t.offsetLeft;return e<window.pageYOffset+window.innerHeight&&i<window.pageXOffset+window.innerWidth&&e+n>window.pageYOffset&&i+o>window.pageXOffset}function kt(){return window.getComputedStyle(document.querySelector(\".cd-horizontal-timeline\"),\"::before\").getPropertyValue(\"content\").replace(/'/g,\"\").replace(/\"/g,\"\")}function wt(t){var e={fillOpacity:.2,color:\"red\",weight:2,fillColor:\"black\"};return\"\"!=t&&(e={fillOpacity:.2,color:\"#000\",weight:2,fillColor:i[t]}),e}function bt(t,e){return t?z.removeLayer(e):z.addLayer(e),!t}ct.length>0&&function(t,e){t.each((function(){var t=v(this),i={};i.timelineWrapper=t.find(\".events-wrapper\"),i.eventsWrapper=i.timelineWrapper.children(\".events\"),i.fillingLine=i.eventsWrapper.children(\".filling-line\"),i.timelineEvents=i.eventsWrapper.find(\"li.listeHisto\"),i.timelineVersion=i.eventsWrapper.find(\"li.listeHisto.versionActuelle\"),i.timelineLinks=i.eventsWrapper.find(\"a\"),i.timelineDates=i.timelineEvents,i.timelineNavigation=t.find(\".cd-timeline-navigation\"),i.eventsContent=t.children(\".events-content\"),dt=250;var o=(i.timelineDates.length+1)*dt;if(function(t,e){for(b=0;b<t.timelineDates.length;b++)t.timelineEvents.eq(b).css(\"left\",b*e+\"px\")}(i,dt),function(t,e){t.eventsWrapper.css(\"width\",e+\"px\"),ft(t.timelineEvents.eq(0),t.fillingLine,e)}(i,o),t.addClass(\"loaded\"),!e){var n=Number(i.timelineWrapper.css(\"width\").replace(\"px\",\"\")),r=n/2,s=Number(i.timelineVersion.css(\"left\").replace(\"px\",\"\")),a=0;for(b=n;b<s;b+=r)a++;a>0&&pt(i,o,\"next\",a)}i.timelineNavigation.on(\"click\",\".next\",(function(t){t.preventDefault(),pt(i,o,\"next\",1)})),i.timelineNavigation.on(\"click\",\".prev\",(function(t){t.preventDefault(),pt(i,o,\"prev\",1)})),i.eventsWrapper.off(\"click\"),i.eventsWrapper.on(\"click\",\"a\",(function(t){t.preventDefault();var e=v(this),n=e[0].id;P.length<=2?(showLoadModal(),refresh(n,e[0].firstElementChild.innerHTML),i.timelineLinks.removeClass(\"selected\"),e.addClass(\"selected\"),gt(e),ft(e,i.fillingLine,o),mt(e,i.eventsContent),hideLoadModal()):(v(\"#alertVersion\").modal(\"show\"),v(\"#confirmVersion\").off(\"click\"),v(\"#confirmVersion\").on(\"click\",(function(t){v(\"#alertVersion\").modal(\"hide\"),showLoadModal(),refresh(n,e[0].firstElementChild.innerHTML),i.timelineLinks.removeClass(\"selected\"),e.addClass(\"selected\"),gt(e),ft(e,i.fillingLine,o),mt(e,i.eventsContent),hideLoadModal()})))})),i.eventsContent.on(\"swipeleft\",(function(){\"mobile\"==kt()&&ut(i,o,\"next\")})),i.eventsContent.on(\"swiperight\",(function(){\"mobile\"==kt()&&ut(i,o,\"prev\")})),v(document).keyup((function(e){\"37\"==e.which&&yt(t.get(0))?ut(i,o,\"prev\"):\"39\"==e.which&&yt(t.get(0))&&ut(i,o,\"next\")}))}))}(ct,!1)}))}},t=>{\"use strict\";t.O(0,[818,755,235,356,717],(()=>{return e=49931,t(t.s=e);var e}));t.O()}]);", "@public_path/build/secto.4f6521d9.js", "/builds/dev/refonte_sav/public/build/secto.4f6521d9.js");
    }
}
