From 842a2c5309fe93c9aa960247ac3c3222c1a68442 Mon Sep 17 00:00:00 2001 From: "pawel.gaca" Date: Tue, 16 Jan 2024 08:38:18 +0100 Subject: [PATCH] =?UTF-8?q?Powi=C4=99kszenie=20wysoko=C5=9Bci=20toggle=20p?= =?UTF-8?q?assword?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 +- mapy/oneMap.js | 128 +++++++------- style.css | 63 ++++--- wydzielonyScript.js | 417 ++++++++++++++++++++++---------------------- 4 files changed, 315 insertions(+), 305 deletions(-) diff --git a/README.md b/README.md index c109eb1..f2baa43 100644 --- a/README.md +++ b/README.md @@ -40,19 +40,21 @@ Trzeba je później podmienić w kodzie w Wydzielonym Javascript na np.: - Zablokowana edycja danych osobowych w trakcie zamówienia(klient dalej może wysłać zamówienie na inny adres). - Zmiana sposobów dostaw zależnie od państwa(Czasami się buguje, może to być zależne od plików cookies) - Sprawdzenie czy wpisano dobry bon towarowy przed złożeniem zamówienia -- lepiej zabezpieczony numer telefonu(na standardzie to +2+++++++++1 przejdzie) -- autouzupełnianie metod płatności i dostawy w edycji -- autouzupełnianie metod płatności i dostawy na podstawie poprzednio wykonanego zakupu +- Lepiej zabezpieczony numer telefonu(na standardzie to +2+++++++++1 przejdzie) +- Autouzupełnianie metod płatności i dostawy w edycji +- Autouzupełnianie metod płatności i dostawy na podstawie poprzednio wykonanego zakupu ### Wady ### -- nie ma faktury na inne dane(żeby nie używać tego samego zapytania co OSCOP Idosella, na wszelki wypadek żeby nie pobierało opłat) +- Nie ma faktury na inne dane(żeby nie używać tego samego zapytania co OSCOP Idosella, na wszelki wypadek żeby nie pobierało opłat) ### Dodatkowe pomysły do zrealizowania ### -- sprawdzanie logina w trakcie pisania(może być słabe dla ochrony danych klienta) +- Sprawdzanie logina w trakcie pisania(może być słabe dla ochrony danych klienta) - Limit znaków | Wydłużanie się okienka od uwag do sklepu|kuriera - W przypadku punktów odbioru na jednej mapie, można zamienić metody dostawy wymagające punkty odbioru na jeden wspólny. - Na mobilce przyklejenie zamów na dół ekranu na wypadek gdyby zalogowany użytkownik miał już wybrany punkt odbioru +- Przekreślona cena|Omnibus w wypadku gdy produkt jest w promocji ### Uwagi ### +- Długie zdjęcia produktu źle wyglądają(najlepsze kwadratowe) - W przypadku edycji zamówienia z zapłatą za pobraniem nie można pobrać danych takiego zamówienia przed dokonaniem zapłaty. Idosell sprawdza ten problem w komunikacie na zooart6. - Dziwna rzecz którą zauważyłem. Jak składasz zamówienie wraz z zakładaniem konta, ale okazuje się że brakuje któregoś produktu w koszyku, to konto dalej się zakłada(ponieważ w takiej sytuacji najpierw zakłada się konto, a później składa się zamówienie) \ No newline at end of file diff --git a/mapy/oneMap.js b/mapy/oneMap.js index a562293..a7d3a64 100644 --- a/mapy/oneMap.js +++ b/mapy/oneMap.js @@ -1,8 +1,9 @@ var stocks_list_more_txt=;var stocks_list_choose=;var pickupl_nopoints=;var mapTooltipLink_class="btn-small",autocompleteData=[],ajaxGetPickupNoMap=function(){$(".mapContainer_pickup, .pickupl_submit").show();var t={courierId:pickup_sites.courierId,isCod:pickup_sites.isCod};$.ajax({type:"GET",url:"/ajax/getPickups.php",data:t,dataType:"json",success:function(t){return t.pickupPoints.length?void setPickupPointsNoMap(t):(Alertek.show_alert(pickupl_nopoints),$(".loadingMap").hide(),!1)},error:function(){orderdetails_payments.ajaxLoadSite(0),$(".no_google_api_key div.asideContainer_pickup").show(),Alertek.show_alert(pickupl_error)}})},setPickupPointsNoMap=function(r){const e=document.getElementById("payitem_cash").checked?0:1;var s=$("#pickup_copy").clone(),t="";for(i in r.pickupPoints){const o=document.querySelector(`#item_${r.pickupPoints[i].courierId}-${e}`).parentElement,a=o.querySelector(".name").innerHTML,d=o.querySelector(".photo").innerHTML;var l=r.pickupPoints[i],n=""==l.address.buildingAndHouseNumber?l.address.street:l.address.street+" "+l.address.buildingAndHouseNumber;pickup_clone=s.clone(),pickup_clone.find("input[name=pickup_point], input[name=stock]").attr("id","pickup_point_"+l.id).val(l.id),pickup_clone.find("label").attr({id:"pp_"+l.id,"data-latitude":l.coordinates.latitude,"data-longitude":l.coordinates.longitude,"data-id":l.id,"data-requires_client_number":l.requiresClientNumber,"data-courier-id":r.pickupPoints[i].courierId,for:"pickup_point_"+l.id}),pickup_clone.find(".zipcodePickup").after(`${r.pickupPoints[i].price}`),l.coordinates.longitude?pickup_clone.find("label .map_dir").attr("href","https://www.google.com/maps/dir/?api=1&destination="+l.coordinates.latitude+","+l.coordinates.longitude):pickup_clone.find("label .map_dir").attr("href","https://maps.google.com?saddr=Current+Location&daddr="+l.address.street+"+"+l.address.postcode+"+"+l.address.city),pickup_clone.find("b.headerText").text(l.name),pickup_clone.find("span.streetText").text(n),pickup_clone.find("span.zipcodePickup").html(l.address.postcode+" "+l.address.city+""),pickup_clone.find("div.moreText").text(l.location),pickup_clone.find("a.moreLink").attr("href",l.link),pickup_clone.find(".headerText").before(`

${d}${a}

`),l.requiresClientNumber||pickup_clone.find("input[name=client_courier_number]").remove(),t+=pickup_clone.html(),autocompleteData.push({label:l.address.city+", "+l.address.street+" "+l.address.buildingAndHouseNumber+" "+l.address.postcode+" "+l.id,value:l.address.city+", "+l.address.street+" "+l.address.buildingAndHouseNumber+", "+l.id,description:l.location,id:l.id})}$("#pickup_site .asideContainer_pickup").html(t)},pickup_sites={geokoder:0,mapa:0,zoom:0,markerIcon:0,language:0,markersArray:[],contentsArray:[],markerInfo:0,timeout:0,loadNavBoolPickup:!1,pickupCount:0,pickupIteration:0,pickupFind:0,pickupFirstActive:!0,calendar:{},markerAnimation:0,pickupsType:0,google_api_key:"",courierId:app_shop.vars.courierId,isCod:!1,search_lat:"",search_lng:"",markerClusters:"",ClusterMaxZoom:13,minimumClusterSize:10,autocomplete:!1,adress:{street_number:"",route:"",locality:"",administrative_area_level_1:"",country:"",postal_code:""},fillInAddress:function(l,e){pickup_sites.adress={street_number:"",route:"",locality:"",administrative_area_level_1:"",country:"",postal_code:""};var t={street_number:"short_name",route:"long_name",locality:"long_name",administrative_area_level_1:"short_name",country:"long_name",postal_code:"short_name"};if(pickup_sites.search_lat="",pickup_sites.search_lng="",l&&!l.geometry)return!1;if(!l)return $("div.asideContainer_pickup").prepend("
"+pickupl_select_adress+"
"),$(".loadingMap").hide(),!1;$(".mapContainer_pickup, .asideContainer_pickup, .pickupl_submit, #pickup_map").show(),pickup_sites.search_lat=l.geometry.location.lat(),pickup_sites.search_lng=l.geometry.location.lng();for(var o,d=0;d"+pickupl_select_adress+""),$(".loadingMap").hide(),!1;$(".mapContainer_pickup, .asideContainer_pickup, .pickupl_submit, #pickup_map").show(),$("label.pickup_point").hide(),$("div.loadingMap").fadeIn("normal",function(){}),$("span.loadingMarkers").hide();var e={courierId:pickup_sites.courierId,"location[latitude]":pickup_sites.search_lat,"location[longitude]":pickup_sites.search_lng,isCod:pickup_sites.isCod};if(n)var e={courierId:pickup_sites.courierId,"location[latitude]":pickup_sites.search_lat,"location[longitude]":pickup_sites.search_lng,radius:function(){var t=pickup_sites.mapa.getZoom();return 15<=t?1:14==t?2:13==t?4:12==t?7:11==t?10:10==t?15:20}(),isCod:pickup_sites.isCod};$.ajax({type:"GET",url:"/ajax/getPickups.php",data:e,dataType:"json",success:function(t){if(!jQuery.isEmptyObject(selected_pickup_point)){for(i in t.pickupPoints)t.pickupPoints[i].id==selected_pickup_point.id&&delete t.pickupPoints[i];t.pickupPoints.unshift(selected_pickup_point)}if(!t.pickupPoints.length)return n?$("div.asideContainer_pickup").prepend("
"+pickupl_nopoints_in_area+"
"):$("div.asideContainer_pickup").prepend("
"+pickupl_nopoints+"
"),$(".loadingMap").hide(),!1;if(!pickup_sites.adress.route)for(i in t.pickupPoints)if($.trim(t.pickupPoints[i].address.city).toLowerCase()==$.trim(pickup_sites.adress.locality).toLowerCase())return e.radius=30,$.ajax({type:"GET",url:"/ajax/getPickups.php",data:e,dataType:"json",success:function(t){setPickupPoints(t,!0)},error:function(){}}),!1;setPickupPoints(t,!1)},error:function(){$("div.asideContainer_pickup").prepend("
"+pickupl_error+"
")}})},showSel:function(){pickup_sites.pickupCount=$(".asideContainer_pickup .pickup_point").length,pickup_sites.pickupIteration=0,$("div.loadingMap").fadeIn("normal",function(){}),$("span.loadingMap").hide(),$("span.loadingMarkers").css("display","block"),$("span.loadingMarkersCount").text(pickup_sites.pickupCount),$("span.loadingMarkersComplete").text(pickup_sites.pickupIteration),pickup_sites.markersArray=[];var o=[];$(".asideContainer_pickup .pickup_point").each(function(e){$this=$(this),o[e]={},o[e].idek=$this.data("id"),o[e].headerText=$.trim($this.find(".headerText").text()),o[e].streetText=$this.find(".streetText").text(),o[e].cityText=$.trim($this.find(".cityText").text()),o[e].moreText=$.trim($this.find(".moreLink").text()),o[e].moreLink=$.trim($this.find(".moreLink").attr("href")),o[e].infoText=$.trim($this.find(".infoText").text()),o[e].timeText=$.trim($this.find(".timeText").text()),o[e].latitude=$.trim($this.data("latitude")),o[e].longitude=$.trim($this.data("longitude")),o[e].icon=$.trim($this.data("icon"))});for(var e="";e=o.pop();)e.latitude&&e.longitude?pickup_sites.findAdres(e.headerText,e.streetText,e.cityText,e.moreText,e.moreLink,e.infoText,e.timeText,"none","another",!1,e.idek,e.latitude,e.longitude,e.icon):function(t){setTimeout(function(){pickup_sites.findAdres(t.headerText,t.streetText,t.cityText,t.moreText,t.moreLink,t.infoText,t.timeText,"none","another",!1,t.idek,t.latitude,t.longitude,t.icon)},pickup_sites.timeout)}(e)},printDates:function(t){return!!$("#selectPickupDay").size()&&void $.ajax({type:"GET",url:"/ajax/basket-delivery.php",data:{stock_id:t},dataType:"json",success:function(t){return t?void($("#selectPickupDay").html(""),$.each(t,function(o,e){$("#selectPickupDay").append("")}),$("#selectPickupDayWrapper").show(),$(".pickupl_hour_wrapper").show(),$("#selectPickupDay [name=\"calendar_select_date\"]").eq(1).prop("checked",!0)):($("#selectPickupDayWrapper").hide(),!1)},error:function(){Alertek.show_alert(pickupl_error)}})},setZoom:function(){var o=new google.maps.LatLngBounds;for(var e in pickup_sites.markersArray)o.extend(pickup_sites.markersArray[e].getPosition());pickup_sites.mapa.setCenter(o.getCenter()),pickup_sites.mapa.fitBounds(o),pickup_sites.mapa.setZoom(pickup_sites.mapa.getZoom()),15"+t+"";y+="
"+o+"  "+n+"
",s&&(y+="
"+s+"
"),y+="
"+l+"
",r&&(y+=""),y+="";var k={title:t,pickupPointID:m};k.position=P,k.map=pickup_sites.mapa,pickup_sites.markerAnimation&&(k.animation=google.maps.Animation.DROP),g&&""!=g?k.icon=g:""!=$("img.marker_face").attr("src")&&markerPickupsCustomIcon&&(k.icon=pickup_sites.markerIcon);var f=new google.maps.Marker(k);pickup_sites.markersArray.push(f),google.maps.event.addListener(f,"click",function(e){return function(t){t.cancelBubble=!0,t.returnValue=!1,t.stopPropagation&&(t.stopPropagation(),t.preventDefault()),pickup_sites.markerInfo.setContent(y),pickup_sites.markerInfo.open(pickup_sites.mapa,e),$(".asideContainer_pickup [value=\""+e.pickupPointID+"\"]").prop("checked",!0),$(".asideContainer_pickup").scrollTop(0),$(".asideContainer_pickup").scrollTop($("#pickup_site [name=\"pickup_point\"]:checked + label").position().top)}}(f,i));var v=$(".asideContainer_pickup [value=\""+f.pickupPointID+"\"]").get(0);$("label[for=\"pickup_point_"+f.pickupPointID+"\"]").show().fadeTo("slow",1),google.maps.event.addDomListener(v,"click",function(t){return function(){$(".asideContainer_pickup [value=\""+t.pickupPointID+"\"]").prop("checked",!0),pickup_sites.markerInfo.setContent(y),pickup_sites.mapa.setCenter(k.position),pickup_sites.mapa.getZoom()=pickup_sites.pickupCount&&setTimeout(function(){$("div.loadingMap").fadeOut("normal",function(){});var n=$(".markerCluster[src*=\"m1.png\"]").attr("src"),e=n.substring(0,n.indexOf("1.png"));pickup_sites.setZoom();var t=!0;pickup_sites.mapa.zoom=pickup_sites.pickupCount&&setTimeout(function(){$("div.loadingMap").fadeOut("normal",function(){});var n=$(".markerCluster[src*=\"m1.png\"]").attr("src"),e=n.substring(0,n.indexOf("1.png")-1);pickup_sites.setZoom();var t=!0;pickup_sites.mapa.zoom${d.price}`),a.find("input[name=pickup_point]").val(d.id),a.find("label").attr("data-latitude",d.coordinates.latitude),a.find("label").attr("data-longitude",d.coordinates.longitude),a.find("label").attr("data-id",d.id),a.find("label").attr("data-requires_client_number",d.requiresClientNumber),a.find("label").attr("for","pickup_point_"+d.id),a.find("label").hide().css("opacity","0"),d.markerIconUrl&&(a.find("label").attr("data-icon",d.markerIconUrl),a.find("label").find("svg").replaceWith("\""+d.id+"\"/")),d.coordinates.longitude?a.find("label .map_dir").attr("href","https://www.google.com/maps/dir/?api=1&destination="+d.coordinates.latitude+","+d.coordinates.longitude):a.find("label .map_dir").attr("href","https://maps.google.com?saddr=Current+Location&daddr="+d.address.street+"+"+d.address.postcode+"+"+d.address.city),a.find("b.headerText").text(d.name);var r=""!=d.address.buildingAndHouseNumber&&null!=d.address.buildingAndHouseNumber?d.address.street+" "+d.address.buildingAndHouseNumber:d.address.street;a.find("span.streetText").text(r),a.find("span.zipcodePickup").html(d.address.postcode+" "+d.address.city+""),a.find("div.moreText").text(d.location),a.find("a.moreLink").attr("href",d.link),a.find(".headerText").before(`

${o}${t}

`),d.requiresClientNumber||a.find("input[name=client_courier_number]").remove(),$("#pickup_site .asideContainer_pickup").append(a.find(" > *"))}pickup_sites.showSel()};function geolocate(){pickup_sites.search_lat="",pickup_sites.search_lng="",navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(n){var e={lat:n.coords.latitude,lng:n.coords.longitude},t=new google.maps.Circle({center:e,radius:n.coords.accuracy});pickup_sites.autocomplete.setBounds(t.getBounds())})}$(document).on("click","#locationField .btn",function(){return $("#mymap").length?(leafletGetTextLocation(),$(".leafleat-suggestions").remove()):pickup_sites.getLocation(),!1}),$(document).on("click","div.morePickup",function(){var t=$("label.pickup_point.moreInfoShow");$(this).parents("label.pickup_point").addClass("moreInfoShow"),t.removeClass("moreInfoShow")}),$(document).on("click","#pickup_site [name=\"pickup_point\"], #pickup_site [name=\"stock\"]",function(){$("#pickup_site [name=\"client_courier_number\"]").prop("disabled",!0),$(this).find("+ label [name=\"client_courier_number\"]").prop("disabled",!1).focus(),pickup_sites.printDates($(this).val())}),app_shop.run(function(){pickup_sites.country_code=app_shop.vars.country_code,pickup_sites.language=app_shop.vars.language,pickup_sites.isCod=app_shop.vars.isCod,pickup_sites.courierId=app_shop.vars.courierId,init_pickupl_site();var o="https://maps.googleapis.com/maps/api/js?key="+app_shop.vars.apiKey+"&libraries=places&callback=pickup_sites.mapInit",e=document.createElement("script");e.setAttribute("src",o),document.body.appendChild(e)},"all","#pickup_site");function MarkerClusterer(r,e,t){this.extend(MarkerClusterer,google.maps.OverlayView),this.map_=r,this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var o=t||{};this.gridSize_=o.gridSize||60,this.minClusterSize_=o.minimumClusterSize||2,this.maxZoom_=o.maxZoom||null,this.styles_=o.styles||[],this.imagePath_=o.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=o.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,null!=o.zoomOnClick&&(this.zoomOnClick_=o.zoomOnClick),this.averageCenter_=!1,null!=o.averageCenter&&(this.averageCenter_=o.averageCenter),this.setupStyles_(),this.setMap(r),this.prevZoom_=this.map_.getZoom();var n=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var a=n.map_.getZoom(),r=n.map_.minZoom||0,t=Math.min(n.map_.maxZoom||100,n.map_.mapTypes[n.map_.getMapTypeId()].maxZoom);a=Math.min(Math.max(a,r),t),n.prevZoom_!=a&&(n.prevZoom_=a,n.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){n.redraw()}),e&&(e.length||Object.keys(e).length)&&this.addMarkers(e,!1)}MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="../images/m",MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png",MarkerClusterer.prototype.extend=function(o,e){return function(o){for(var e in o.prototype)this.prototype[e]=o.prototype[e];return this}.apply(o,[e])},MarkerClusterer.prototype.onAdd=function(){this.setReady_(!0)},MarkerClusterer.prototype.draw=function(){},MarkerClusterer.prototype.setupStyles_=function(){if(!this.styles_.length)for(var o,n=0;o=this.sizes[n];n++)this.styles_.push({url:this.imagePath_+(n+1)+"."+this.imageExtension_,height:o,width:o})},MarkerClusterer.prototype.fitMapToMarkers=function(){for(var a,r=this.getMarkers(),t=new google.maps.LatLngBounds,o=0;a=r[o];o++)t.extend(a.getPosition());this.map_.fitBounds(t)},MarkerClusterer.prototype.setStyles=function(t){this.styles_=t},MarkerClusterer.prototype.getStyles=function(){return this.styles_},MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_},MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_},MarkerClusterer.prototype.getMarkers=function(){return this.markers_},MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length},MarkerClusterer.prototype.setMaxZoom=function(t){this.maxZoom_=t},MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_},MarkerClusterer.prototype.calculator_=function(r,e){for(var t=0,s=r.length,n=s;0!==n;)n=parseInt(n/10,10),t++;return t=Math.min(t,e),{text:s,index:t}},MarkerClusterer.prototype.setCalculator=function(t){this.calculator_=t},MarkerClusterer.prototype.getCalculator=function(){return this.calculator_},MarkerClusterer.prototype.addMarkers=function(a,e){if(a.length)for(var t,r=0;t=a[r];r++)this.pushMarkerTo_(t);else if(Object.keys(a).length)for(var t in a)this.pushMarkerTo_(a[t]);e||this.redraw()},MarkerClusterer.prototype.pushMarkerTo_=function(o){if(o.isAdded=!1,o.draggable){var e=this;google.maps.event.addListener(o,"dragend",function(){o.isAdded=!1,e.repaint()})}this.markers_.push(o)},MarkerClusterer.prototype.addMarker=function(o,e){this.pushMarkerTo_(o),e||this.redraw()},MarkerClusterer.prototype.removeMarker_=function(a){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(a);else for(var r,s=0;r=this.markers_[s];s++)if(r==a){e=s;break}return-1!=e&&(a.setMap(null),this.markers_.splice(e,1),!0)},MarkerClusterer.prototype.removeMarker=function(n,e){var t=this.removeMarker_(n);return!e&&t&&(this.resetViewport(),this.redraw(),!0)},MarkerClusterer.prototype.removeMarkers=function(r,e){for(var t,l,d=!1,p=0;t=r[p];p++)l=this.removeMarker_(t),d=d||l;if(!e&&d)return this.resetViewport(),this.redraw(),!0},MarkerClusterer.prototype.setReady_=function(t){this.ready_||(this.ready_=t,this.createClusters_())},MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length},MarkerClusterer.prototype.getMap=function(){return this.map_},MarkerClusterer.prototype.setMap=function(t){this.map_=t},MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_},MarkerClusterer.prototype.setGridSize=function(t){this.gridSize_=t},MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_},MarkerClusterer.prototype.setMinClusterSize=function(t){this.minClusterSize_=t},MarkerClusterer.prototype.getExtendedBounds=function(d){var e=this.getProjection(),t=new google.maps.LatLng(d.getNorthEast().lat(),d.getNorthEast().lng()),o=new google.maps.LatLng(d.getSouthWest().lat(),d.getSouthWest().lng()),n=e.fromLatLngToDivPixel(t);n.x+=this.gridSize_,n.y-=this.gridSize_;var a=e.fromLatLngToDivPixel(o);a.x-=this.gridSize_,a.y+=this.gridSize_;var r=e.fromDivPixelToLatLng(n),s=e.fromDivPixelToLatLng(a);return d.extend(r),d.extend(s),d},MarkerClusterer.prototype.isMarkerInBounds_=function(o,e){return e.contains(o.getPosition())},MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers_=[]},MarkerClusterer.prototype.resetViewport=function(a){for(var e,r=0;e=this.clusters_[r];r++)e.remove();for(var s,r=0;s=this.markers_[r];r++)s.isAdded=!1,a&&s.setMap(null);this.clusters_=[]},MarkerClusterer.prototype.repaint=function(){var n=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),window.setTimeout(function(){for(var e,a=0;e=n[a];a++)e.remove()},0)},MarkerClusterer.prototype.redraw=function(){this.createClusters_()},MarkerClusterer.prototype.distanceBetweenPoints_=function(s,e){if(!s||!e)return 0;var t=(e.lat()-s.lat())*Math.PI/180,o=(e.lng()-s.lng())*Math.PI/180,n=Math.sin(t/2)*Math.sin(t/2)+Math.cos(s.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2),r=2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n));return 6371*r},MarkerClusterer.prototype.addToClosestCluster_=function(d){for(var e,p,_=4e4,m=null,c=d.getPosition(),r=0;e=this.clusters_[r];r++)if(p=e.getCenter(),p){var u=this.distanceBetweenPoints_(p,d.getPosition());u<_&&(_=u,m=e)}if(m&&m.isMarkerInClusterBounds(d))m.addMarker(d);else{var e=new Cluster(this);e.addMarker(d),this.clusters_.push(e)}},MarkerClusterer.prototype.createClusters_=function(){if(this.ready_)for(var a,r=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),t=this.getExtendedBounds(r),o=0;a=this.markers_[o];o++)!a.isAdded&&this.isMarkerInBounds_(a,t)&&this.addToClosestCluster_(a)};function Cluster(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new ClusterIcon(this,t.getStyles(),t.getGridSize())}Cluster.prototype.isMarkerAlreadyAdded=function(n){if(this.markers_.indexOf)return-1!=this.markers_.indexOf(n);for(var e,a=0;e=this.markers_[a];a++)if(e==n)return!0;return!1},Cluster.prototype.addMarker=function(s){if(this.isMarkerAlreadyAdded(s))return!1;if(!this.center_)this.center_=s.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var e=this.markers_.length+1,t=(this.center_.lat()*(e-1)+s.getPosition().lat())/e,o=(this.center_.lng()*(e-1)+s.getPosition().lng())/e;this.center_=new google.maps.LatLng(t,o),this.calculateBounds_()}s.isAdded=!0,this.markers_.push(s);var n=this.markers_.length;if(n=this.minClusterSize_&&s.setMap(null),this.updateIcon(),!0},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){for(var a,r=new google.maps.LatLngBounds(this.center_,this.center_),t=this.getMarkers(),o=0;a=t[o];o++)r.extend(a.getPosition());return r},Cluster.prototype.remove=function(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_},Cluster.prototype.getSize=function(){return this.markers_.length},Cluster.prototype.getMarkers=function(){return this.markers_},Cluster.prototype.getCenter=function(){return this.center_},Cluster.prototype.calculateBounds_=function(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)},Cluster.prototype.isMarkerInClusterBounds=function(t){return this.bounds_.contains(t.getPosition())},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.updateIcon=function(){var s=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&s>e){for(var t,l=0;t=this.markers_[l];l++)t.setMap(this.map_);return}if(this.markers_.length .pickup_search_here",function(){pickup_sites.search_lat=pickup_sites.mapa.center.lat(),pickup_sites.search_lng=pickup_sites.mapa.center.lng(),pickup_sites.ajaxGetPickup(!0)});var mymap,isLoaded=!1,isWaitingEnd=!1,leafletGetPickups=function(l,e,t){radius=15<=t?1:14==t?2:13==t?4:12==t?7:11==t?10:10==t?15:20;const s=pickup_sites.courierId.split("-")[1],o=document.querySelectorAll(`#osc_order1_${"1"==s?"prepaid":"dvp"} input[data-pickuppoint="y"]`),d=[];o.forEach(o=>{let n;const r=o.value.split("-")[0];n=t?{courierId:r,"location[latitude]":l,"location[longitude]":e,radius:radius,isCod:pickup_sites.isCod}:{courierId:r,"location[latitude]":l,"location[longitude]":e,isCod:pickup_sites.isCod},d.push($.ajax({type:"GET",url:"/ajax/getPickups.php",data:n,dataType:"json"}))}),Promise.all(d).then(n=>{const r={cities:[],pickupPoints:[]};if(n.forEach(t=>{0"+pickupl_nopoints_in_area+"")):$("div.asideContainer_pickup").prepend("
"+pickupl_nopoints+"
"),$(".loadingMap").hide(),!1;for(i in leafletItems=[],r.pickupPoints){var t=r.pickupPoints[i].coordinates.latitude,l=r.pickupPoints[i].coordinates.longitude;(""==t||""==l)&&($.ajaxSetup({async:!1}),$.get(location.protocol+"//nominatim.openstreetmap.org/search?format=json&q="+r.pickupPoints[i].address.street+", "+r.pickupPoints[i].address.city+" "+r.pickupPoints[i].address.city+" "+r.pickupPoints[i].address.country,function(o){jQuery.isEmptyObject(o)?console.log("nie mog\u0119 znale\u017A\u0107 korodynat\xF3w adresu!"):(t=o[0].lat,l=o[0].lon)})),r.pickupPoints[i].iconOptions=getMarkerIcon(r.pickupPoints[i].courierId),r.pickupPoints[i].price=document.getElementById(`item_${r.pickupPoints[i].courierId}-${s}`).parentElement.querySelector(".price").innerHTML,leafletItems.push({id:r.pickupPoints[i].id,name:r.pickupPoints[i].name,link:r.pickupPoints[i].link,address:r.pickupPoints[i].address,courierId:r.pickupPoints[i].courierId,price:r.pickupPoints[i].price,iconOptions:r.pickupPoints[i].iconOptions,lat:t,lon:l})}setPickupPointsNoMap(r,!1,!0),jQuery.isEmptyObject(leafletItems)||leafletStartMap(leafletItems[0].lat,leafletItems[0].lon,!0)})},leafletMarker=[],leafletItems=[];function leafletDelMarkers(){for(i=0;iOpenStreetMap contributors"}).addTo(mymap),isLoaded=!0,isWaitingEnd=!0),$(".loadingPoints").remove(),i=0;i`+stocks_list_more_txt+``+stocks_list_choose+``,e="";e=null==leafletItems[i].address.street?`
`+leafletItems[i].address+`
`:`
`+leafletItems[i].address.street+` `+leafletItems[i].address.buildingAndHouseNumber+` `+leafletItems[i].address.city+`
`;const t=`${leafletItems[i].price}`,o=document.querySelector(`#item_${leafletItems[i].courierId}-${a}`).parentElement,s=o.querySelector(".name").innerHTML,l=o.querySelector(".photo").innerHTML;let d=`

${l}${s}

`+leafletItems[i].name+`
`+e+t+`
`+r;markersList.push(leafletItems[i].id),markers[leafletItems[i].id]=L.marker([leafletItems[i].lat,leafletItems[i].lon],{icon:leafletItems[i].iconOptions}).addTo(mymap).on("click",leafletOnClick).bindPopup(d)}mymap.setView(new L.LatLng(n,e));let r=$(".asideContainer_pickup label.pickup_point").eq(0).attr("data-id");$(".asideContainer_pickup input[value=\""+r+"\"]").click(),$("img.leaflet-marker-icon").each(function(){var n=$(this).attr("src"),a=n.includes("preview/");a&&(n=n.replace("preview/",""));var t=n.includes("marker-icon");t&&(n=n.replace("-2x","")),$(this).attr("src",n)})},timeoutLeafLet=null;$(document).on("input","#autocomplete_location.autocomplete_nomap",function(){var t=$(this);clearTimeout(timeoutLeafLet),timeoutLeafLet=setTimeout(function(){3 .pickup_search_here_leaflet",function(){var o=mymap.getCenter(),e=mymap.getZoom();leafletDelMarkers(),selected_pickup_point={},leafletGetPickups(o.lat,o.lng,e)}),$(document).on("click","#pickup_site [name=\"pickup_point\"], #pickup_site [name=\"stock\"]",function(){const o=$(this).val();if(markers[o]){let e=markers[o].getLatLng();mymap.setView(new L.LatLng(e.lat,e.lng)),markers[o].openPopup()}});var leafletGetCoords=function(n){let a="",r="";n?$.get(location.protocol+"//nominatim.openstreetmap.org/search?format=json&q="+n,function(t){jQuery.isEmptyObject(t)?($(".asideContainer_pickup label.pickup_point").length&&($(".asideContainer_pickup label.pickup_point").each(function(){var s=$(this).data("id"),e=$(this).find(".headerText").text(),t=$(this).find(".map_dir").attr("href"),o=$(this).find(".streetText").text()+"
"+$(this).find(".zipcodePickup").text(),n=$(this).data("latitude"),a=$(this).data("longitude");leafletItems.push({id:s,name:e,link:t,address:o,lat:n,lon:a})}),leafletStartMap(leafletItems[0].lat,leafletItems[0].lon,!0)),$("div.asideContainer_pickup .menu_messages_message").length&&$("div.asideContainer_pickup .menu_messages_message").remove(),$("div.asideContainer_pickup").prepend("
"+pickupl_nopoints+"
")):(a=t[0].lat,r=t[0].lon,leafletGetPickups(a,r))}):$(".asideContainer_pickup label.pickup_point").length&&($(".asideContainer_pickup label.pickup_point").each(function(){var s=$(this).data("id"),e=$(this).find(".headerText").text(),t=$(this).find(".map_dir").attr("href"),o=$(this).find(".streetText").text()+"
"+$(this).find(".zipcodePickup").text(),n=$(this).data("latitude"),a=$(this).data("longitude");leafletItems.push({id:s,name:e,link:t,address:o,lat:n,lon:a})}),leafletStartMap(leafletItems[0].lat,leafletItems[0].lon,!0))},leafletGetLocation=function(t){$.get(location.protocol+"//nominatim.openstreetmap.org/search?format=json&q="+t,function(t){if(!jQuery.isEmptyObject(t))for(i in $("#locationField").append("
"),t)$(".leafleat-suggestions").append("
"+t[i].display_name+"
");else leafletStartMap(53.428,14.552,!0),$("div.asideContainer_pickup .menu_messages_message").length&&$("div.asideContainer_pickup .menu_messages_message").remove(),$("div.asideContainer_pickup").prepend("
"+pickupl_nopoints+"
")})},leafletGetTextLocation=function(){$("#mymap").prepend(`
${}...
`);var t=$("#autocomplete_location").val();selected_pickup_point={},$.get(location.protocol+"//nominatim.openstreetmap.org/search?format=json&q="+t,function(e){if(!jQuery.isEmptyObject(e))leafletDelMarkers(),leafletGetPickups(e[0].lat,e[0].lon),$("#autocomplete_location").val(e[0].display_name);else{if(t.search(",")){var a=t.split(","),o=a[a.length-1].trim();leafletGetCoords(o)}$("div.asideContainer_pickup .menu_messages_message").length&&$("div.asideContainer_pickup .menu_messages_message").remove(),$("div.asideContainer_pickup").prepend("
"+pickupl_nopoints+"
")}})};app_shop.run(function(){if($("#autocomplete_location").length&&""!=$("#autocomplete_location").val()){let t=$("#autocomplete_location").val();leafletGetCoords(t)}else leafletGetCoords(!1)},"all","#mymap"),app_shop.run(function(){$("#mymap").before($(".map_button_search"))},1,"#mymap"),app_shop.run(function(){$("#mymap").prepend($(".map_button_search"))},[2,3,4],"#mymap"),!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(o.L={})}(this,function(n){"use strict";function v(e){var o,n,a,d;for(n=1,a=arguments.length;nRt.indexOf(t.target.tagName)))return;go(t)}Q(t,o)});n["_leaflet_touchstart"+a]=t,n.addEventListener(kt,t,!1),Dt||(document.documentElement.addEventListener(kt,W,!0),document.documentElement.addEventListener(At,G,!0),document.documentElement.addEventListener(It,K,!0),document.documentElement.addEventListener(Ot,K,!0),Dt=!0)}(n,t,a):"touchmove"===o?function(n,o,a){function t(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Q(t,o)}n["_leaflet_touchmove"+a]=t,n.addEventListener(At,t,!1)}(n,t,a):"touchend"==o&&function(n,o,a){function t(t){Q(t,o)}n["_leaflet_touchend"+a]=t,n.addEventListener(It,t,!1),n.addEventListener(Ot,t,!1)}(n,t,a),this}function W(t){Nt[t.pointerId]=t,Cn++}function G(t){Nt[t.pointerId]&&(Nt[t.pointerId]=t)}function K(t){delete Nt[t.pointerId],Cn--}function Q(e,o){for(var t in e.touches=[],Nt)e.touches.push(Nt[t]);e.changedTouches=[e],o(e)}function re(n,s,a){function t(n){var o;if(xt){if(!it||"mouse"===n.pointerType)return;o=Cn}else o=n.touches.length;if(!(1=a,l=r}}function o(e){if(c&&!d.cancelBubble){if(xt){if(!it||"mouse"===e.pointerType)return;var o,n,p={};for(n in d)o=d[n],p[n]=o&&o.bind?o.bind(d):o;d=p}d.type="dblclick",d.button=0,s(d),l=null}}var l,d,c=!1;return n["_leaflet_"+An+a]=t,n["_leaflet_"+Ko+a]=o,n["_leaflet_dblclick"+a]=s,n.addEventListener(An,t,!!zt&&{passive:!1}),n.addEventListener(Ko,o,!!zt&&{passive:!1}),n.addEventListener("dblclick",s,!1),this}function Pe(o,a){var t=o["_leaflet_"+An+a],r=o["_leaflet_"+Ko+a],e=o["_leaflet_dblclick"+a];return o.removeEventListener(An,t,!!zt&&{passive:!1}),o.removeEventListener(Ko,r,!!zt&&{passive:!1}),it||o.removeEventListener("dblclick",e,!1),this}function Qe(t){return"string"==typeof t?document.getElementById(t):t}function Pt(e,o){var t=e.style[o]||e.currentStyle&&e.currentStyle[o];if((!t||"auto"===t)&&document.defaultView){var n=document.defaultView.getComputedStyle(e,null);t=n?n[o]:null}return"auto"===t?null:t}function wt(n,o,t){var a=document.createElement(n);return a.className=o||"",t&&t.appendChild(a),a}function Mt(o){var e=o.parentNode;e&&e.removeChild(o)}function Bt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Ht(o){var e=o.parentNode;e&&e.lastChild!==o&&e.appendChild(o)}function Wt(o){var e=o.parentNode;e&&e.firstChild!==o&&e.insertBefore(o,e.firstChild)}function Ft(e,o){if(void 0!==e.classList)return e.classList.contains(o);var t=Gt(e);return 0a||n.target._simulatedClick&&!n._simulated?yo(n):void(Jo=t,o(n))}(t,d)}),a.addEventListener(r,t,!1)):"attachEvent"in a&&a.attachEvent("on"+r,t):re(a,t,e),a._leaflet_events=a._leaflet_events||{},a._leaflet_events[e]=t}function _o(a,r,t,s){var e=r+H(t)+(s?"_"+H(s):""),n=a._leaflet_events&&a._leaflet_events[e];return n?void(xt&&0===r.indexOf("touch")?function(n,o,t){var a=n["_leaflet_"+o+t];"touchstart"===o?n.removeEventListener(kt,a,!1):"touchmove"===o?n.removeEventListener(At,a,!1):"touchend"==o&&(n.removeEventListener(It,a,!1),n.removeEventListener(Ot,a,!1))}(a,r,e):!Lt||"dblclick"!==r||xt&&ht?"removeEventListener"in a?"mousewheel"===r?a.removeEventListener("onwheel"in a?"wheel":"mousewheel",n,!!zt&&{passive:!1}):a.removeEventListener("mouseenter"===r?"mouseover":"mouseleave"===r?"mouseout":r,n,!1):"detachEvent"in a&&a.detachEvent("on"+r,n):Pe(a,e),a._leaflet_events[e]=null):this}function mo(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,xo(t),this}function co(t){return po(t,"mousewheel",mo),this}function uo(t){return so(t,"mousedown touchstart dblclick",mo),po(t,"click",vo),this}function go(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function yo(t){return go(t),mo(t),this}function ho(n,o){if(!o)return new y(n.clientX,n.clientY);var t=ro(o),a=t.boundingClientRect;return new y((n.clientX-a.left)/t.x-o.clientLeft,(n.clientY-a.top)/t.y-o.clientTop)}function fo(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/$o:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&32765>Math.abs(t.detail)?20*-t.detail:t.detail?60*(t.detail/-32765):0}function vo(t){ln[t.type]=!0}function xo(o){var e=ln[o.type];return ln[o.type]=!1,e}function Po(e,o){var t=o.relatedTarget;if(!t)return!0;try{for(;t&&t!==e;)t=t.parentNode}catch(t){return!1}return t!==e}function ko(t){return new kn(t)}function bo(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=function(o,a){var t=o.length,r=new("undefined"==typeof Uint8Array?Array:Uint8Array)(t);r[0]=r[t-1]=1,function a(r,t,l,e,n){var o,d,c,u=0;for(d=e+1;d<=n-1;d++)c=me(r[d],r[e],r[n],!0),uo.max.x&&(t|=2),e.yo.max.y&&(t|=8),t}function me(o,a,t,r){var e,s=a.x,l=a.y,d=t.x-s,u=t.y-l,h=d*d+u*u;return 0l;l++){for(c=h[l],a=[],r=0,s=(m=t.length)-1;r=this.min.x&&r.x<=this.max.x&&t.y>=this.min.y&&r.y<=this.max.y},intersects:function(t){t=w(t);var r=this.min,l=this.max,d=t.min,e=t.max,n=e.x>=r.x&&d.x<=l.x,o=e.y>=r.y&&d.y<=l.y;return n&&o},overlaps:function(t){t=w(t);var r=this.min,l=this.max,d=t.min,e=t.max,n=e.x>r.x&&d.xr.y&&d.y=d.lat&&o.lat<=l.lat&&t.lng>=d.lng&&o.lng<=l.lng},intersects:function(t){t=S(t);var r=this._southWest,l=this._northEast,d=t.getSouthWest(),e=t.getNorthEast(),n=e.lat>=r.lat&&d.lat<=l.lat,o=e.lng>=r.lng&&d.lng<=l.lng;return n&&o},overlaps:function(t){t=S(t);var r=this._southWest,l=this._northEast,d=t.getSouthWest(),e=t.getNorthEast(),n=e.lat>r.lat&&d.latr.lng&&d.lngst&&!("AudioNode"in window),at=!!window.opera,ht=N("chrome"),ut=N("gecko")&&!et&&!at&&!J,lt=!ht&&N("safari"),ct=N("phantom"),_t=("OTransition"in X),dt=0===navigator.platform.indexOf("Win"),pt=J&&"transition"in X,mt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ot,ft=("MozPerspective"in X),gt=!window.L_DISABLE_3D&&(pt||mt||ft)&&!_t&&!ct,vt="undefined"!=typeof orientation||N("mobile"),yt=!window.PointerEvent&&window.MSPointerEvent,xt=!et&&(window.PointerEvent||yt),Lt=!window.L_NO_TOUCH&&(xt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),bt=vt&&at,Tt=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),zt=function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",Y,n),window.removeEventListener("testPassiveEventSupport",Y,n)}catch(t){}return t},Ct=!!document.createElement("canvas").getContext,Et=document.createElementNS&&R("svg").createSVGRect,St=!Et&&function(){try{var o=document.createElement("div");o.innerHTML="";var e=o.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),Zt=(Object.freeze||Object)({ie:J,ielt9:tt,edge:it,webkit:et,android:nt,android23:ot,androidStock:rt,opera:at,chrome:ht,gecko:ut,safari:lt,phantom:ct,opera12:_t,win:dt,ie3d:pt,webkit3d:mt,gecko3d:ft,any3d:gt,mobile:vt,mobileWebkit:vt&&et,mobileWebkit3d:vt&&mt,msPointer:yt,pointer:xt,touch:Lt,mobileOpera:bt,mobileGecko:vt&&ut,retina:Tt,passiveEvents:zt,canvas:Ct,svg:Et,vml:St}),kt=yt?"MSPointerDown":"pointerdown",At=yt?"MSPointerMove":"pointermove",It=yt?"MSPointerUp":"pointerup",Ot=yt?"MSPointerCancel":"pointercancel",Rt=["INPUT","SELECT","OPTION"],Nt={},Dt=!1,Cn=0,An=yt?"MSPointerDown":xt?"pointerdown":"touchstart",Ko=yt?"MSPointerUp":xt?"pointerup":"touchend",Kt=Jt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Yt=Jt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Yo="webkitTransition"===Yt||"OTransition"===Yt?Yt+"End":"transitionend";if("onselectstart"in document)Bo=function(){so(window,"selectstart",go)},Oo=function(){lo(window,"selectstart",go)};else{var Xo=Jt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Bo=function(){if(Xo){var t=document.documentElement.style;Ro=t[Xo],t[Xo]="none"}},Oo=function(){Xo&&(document.documentElement.style[Xo]=Ro,Ro=void 0)}}var Jo,Mn=(Object.freeze||Object)({TRANSFORM:Kt,TRANSITION:Yt,TRANSITION_END:Yo,get:Qe,getStyle:Pt,create:wt,remove:Mt,empty:Bt,toFront:Ht,toBack:Wt,hasClass:Ft,addClass:qt,removeClass:Vt,setClass:Ut,getClass:Gt,setOpacity:Xt,testProp:Jt,setTransform:Qt,setPosition:$t,getPosition:eo,disableTextSelection:Bo,enableTextSelection:Oo,disableImageDrag:to,enableImageDrag:oo,preventOutline:no,restoreOutline:ao,getSizedParentNode:io,getScale:ro}),$o=dt&&ht?2*window.devicePixelRatio:ut?window.devicePixelRatio:1,ln={},pn=(Object.freeze||Object)({on:so,off:lo,stopPropagation:mo,disableScrollPropagation:co,disableClickPropagation:uo,preventDefault:go,stop:yo,getMousePosition:ho,getWheelDelta:fo,fakeStop:vo,skipped:xo,isExternalTarget:Po,addListener:so,removeListener:lo}),yn=E.extend({run:function(n,o,t,a){this.stop(),this._el=n,this._inProgress=!0,this._duration=t||.25,this._easeOutPower=1/Math.max(a||.5,.2),this._startPos=eo(n),this._offset=o.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=ae(this._animate,this),this._step()},_step:function(e){var o=+new Date-this._startTime,t=1e3*this._duration;ot?-18:Math.log(t)}function n(t){return(Math.exp(t)-Math.exp(-t))/2}function T(t){return(Math.exp(t)+Math.exp(-t))/2}function e(e){return f*(T(c)*function(e){return n(e)/T(e)}(c+u*e)-n(c))/l}if(!1===(t=t||{}).animate||!gt)return this.setView(y,b,t);this._stop();var d=this.project(this.getCenter()),p=this.project(y),s=this.getSize(),r=this._zoom;y=M(y),b=void 0===b?r:b;var f=Math.max(s.x,s.y),a=f*this.getZoomScale(r,b),h=p.distanceTo(d)||1,u=1.42,l=u*u,c=o(0),_=Date.now(),m=(o(1)-c)/u,g=t.duration?1e3*t.duration:.8*(1e3*m);return this._moveStart(!0,t.noMoveStart),function a(){var o=(Date.now()-_)/g,t=function(t){return 1-Math.pow(1-t,1.5)}(o)*m;1>=o?(this._flyToFrame=ae(a,this),this._move(this.unproject(d.add(p.subtract(d).multiplyBy(e(t)/h)),r),this.getScaleZoom(f/function(t){return f*(T(c)/T(c+u*t))}(t),r),{flyTo:!0})):this._move(y,b)._moveEnd(!0)}.call(this),this},flyToBounds:function(e,o){var t=this._getBoundsCenterZoom(e,o);return this.flyTo(t.center,t.zoom,o)},setMaxBounds:function(t){return(t=S(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(o){var e=this.options.minZoom;return this.options.minZoom=o,this._loaded&&e!==o&&(this.fire("zoomlevelschange"),this.getZoom()this.options.maxZoom)?this.setZoom(o):this},panInsideBounds:function(n,o){this._enforcingBounds=!0;var t=this.getCenter(),a=this._limitCenter(t,this._zoom,S(n));return t.equals(a)||this.panTo(a,o),this._enforcingBounds=!1,this},panInside:function(c,d){var u=b((d=d||{}).paddingTopLeft||d.padding||[0,0]),p=b(d.paddingBottomRight||d.padding||[0,0]),e=this.getCenter(),n=this.project(e),o=this.project(c),s=this.getPixelBounds(),r=s.getSize().divideBy(2),a=w([s.min.add(u),s.max.subtract(p)]);if(!a.contains(o)){this._enforcingBounds=!0;var _=n.subtract(o),m=b(o.x+_.x,o.y+_.y);(o.xa.max.x)&&(m.x=n.x-_.x,0<_.x?m.x+=r.x-u.x:m.x-=r.x-p.x),(o.ya.max.y)&&(m.y=n.y-_.y,0<_.y?m.y+=r.y-u.y:m.y-=r.y-p.y),this.panTo(this.unproject(m),d),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=v({animate:!1,pan:!0},!0===t?{animate:!0}:t);var s=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var r=this.getSize(),l=s.divideBy(2).round(),e=r.divideBy(2).round(),n=l.subtract(e);return n.x||n.y?(t.animate&&t.pan?this.panBy(n):(t.pan&&this._rawPanBy(n),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:s,newSize:r})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=v({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=h(this._handleGeolocationResponse,this),n=h(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,n,e):navigator.geolocation.getCurrentPosition(t,n,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){var o=e.code,t=e.message||(1===o?"permission denied":2===o?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:o,message:"Geolocation error: "+t+"."})},_handleGeolocationResponse:function(r){var a=new I(r.coords.latitude,r.coords.longitude),t=a.toBounds(2*r.coords.accuracy),l=this._locateOptions;if(l.setView){var e=this.getBoundsZoom(t);this.setView(a,l.maxZoom?Math.min(e,l.maxZoom):e)}var n={latlng:a,bounds:t,timestamp:r.timestamp};for(var o in r.coords)"number"==typeof r.coords[o]&&(n[o]=r.coords[o]);this.fire("locationfound",n)},addHandler:function(e,o){if(!o)return this;var t=this[e]=new o(this);return this._handlers.push(t),this.options[e]&&t.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),Mt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(p(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)Mt(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,o){var t=wt("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),o||this._mapPane);return e&&(this._panes[e]=t),t},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new g(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=S(e),n=b(n||[0,0]);var d=this.getZoom()||0,m=this.getMinZoom(),f=this.getMaxZoom(),o=e.getNorthWest(),s=e.getSouthEast(),r=this.getSize().subtract(n),a=w(this.project(s,d),this.project(o,d)).getSize(),h=gt?this.options.zoomSnap:1,u=r.x/a.x,l=r.y/a.y,c=t?Math.max(u,l):Math.min(u,l);return d=this.getScaleZoom(c,d),h&&(d=Math.round(d/(h/100))*(h/100),d=t?Math.ceil(d/h)*h:Math.floor(d/h)*h),Math.max(m,Math.min(f,d))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new y(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,o){var t=this._getTopLeftPoint(e,o);return new C(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,o){var a=this.options.crs;return o=void 0===o?this._zoom:o,a.scale(e)/a.scale(o)},getScaleZoom:function(n,o){var r=this.options.crs;o=void 0===o?this._zoom:o;var a=r.zoom(n*r.scale(o));return isNaN(a)?1/0:a},project:function(o,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(M(o),e)},unproject:function(o,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(b(o),e)},layerPointToLatLng:function(o){var e=b(o).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(M(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(M(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(S(t))},distance:function(o,e){return this.options.crs.distance(M(o),M(e))},containerPointToLayerPoint:function(t){return b(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return b(t).add(this._getMapPanePos())},containerPointToLatLng:function(o){var e=this.containerPointToLayerPoint(b(o));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(M(t)))},mouseEventToContainerPoint:function(t){return ho(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(o){var e=this._container=Qe(o);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");so(e,"scroll",this._onScroll,this),this._containerId=H(e)},_initLayout:function(){var o=this._container;this._fadeAnimated=this.options.fadeAnimation&>,qt(o,"leaflet-container"+(Lt?" leaflet-touch":"")+(Tt?" leaflet-retina":"")+(tt?" leaflet-oldie":"")+(lt?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=Pt(o,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(o.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),$t(this._mapPane,new y(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(qt(t.markerPane,"leaflet-zoom-hide"),qt(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(n,o){$t(this._mapPane,new y(0,0));var r=!this._loaded;this._loaded=!0,o=this._limitZoom(o),this.fire("viewprereset");var a=this._zoom!==o;this._moveStart(a,!1)._move(n,o)._moveEnd(a),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(o,e){return o&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(n,o,r){void 0===o&&(o=this._zoom);var a=this._zoom!==o;return this._zoom=o,this._lastCenter=n,this._pixelOrigin=this._getNewPixelOrigin(n),(a||r&&r.pinch)&&this.fire("zoom",r),this.fire("move",r)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return p(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){$t(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(o){this._targets={};var e=o?lo:so;e((this._targets[H(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),gt&&this.options.transform3DLimit&&(o?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){p(this._resizeRequest),this._resizeRequest=ae(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,n){for(var t,a=[],r="mouseout"===n||"mouseover"===n,s=e.target||e.srcElement,l=!1;s;){if((t=this._targets[H(s)])&&("click"===n||"preclick"===n)&&!e._simulated&&this._draggableMoved(t)){l=!0;break}if(t&&t.listens(n,!0)){if(r&&!Po(s,e))break;if(a.push(t),r)break}if(s===this._container)break;s=s.parentNode}return a.length||l||r||!Po(s,e)||(a=[this]),a},_handleDOMEvent:function(o){if(this._loaded&&!xo(o)){var e=o.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||no(o.target||o.srcElement),this._fireDOMEvent(o,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,t,a){if("click"===e.type){var l=v({},e);l.type="preclick",this._fireDOMEvent(l,l.type,a)}if(!e._stopped&&(a=(a||[]).concat(this._findEventTargets(e,t))).length){var d=a[0];"contextmenu"===t&&d.listens(t,!0)&&go(e);var n={originalEvent:e};if("keypress"!==e.type&&"keydown"!==e.type&&"keyup"!==e.type){var o=d.getLatLng&&(!d._radius||10>=d._radius);n.containerPoint=o?this.latLngToContainerPoint(d.getLatLng()):this.mouseEventToContainerPoint(e),n.layerPoint=this.containerPointToLayerPoint(n.containerPoint),n.latlng=o?d.getLatLng():this.layerPointToLatLng(n.layerPoint)}for(var s=0;sthis.options.zoomAnimationThreshold)return!1;var a=this.getZoomScale(o),s=this._getCenterOffset(e)._divideBy(1-1/a);return(!0===t.animate||this.getSize().contains(s))&&(ae(function(){this._moveStart(!0,!1)._animateZoom(e,o,!0)},this),!0)},_animateZoom:function(n,o,t,a){this._mapPane&&(t&&(this._animatingZoom=!0,this._animateToCenter=n,this._animateToZoom=o,qt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:n,zoom:o,noUpdate:a}),setTimeout(h(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Vt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),ae(function(){this._moveEnd(!0)},this))}}),kn=c.extend({options:{position:"topright"},initialize:function(t){l(this,t)},getPosition:function(){return this.options.position},setPosition:function(o){var e=this._map;return e&&e.removeControl(this),this.options.position=o,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(n){this.remove(),this._map=n;var o=this._container=this.onAdd(n),t=this.getPosition(),a=n._controlCorners[t];return qt(o,"leaflet-control"),-1===t.indexOf("bottom")?a.appendChild(o):a.insertBefore(o,a.firstChild),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(Mt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",a=document.createElement("div");return a.innerHTML=t,a.firstChild},_addItem:function(a){var r,s=document.createElement("label"),l=this._map.hasLayer(a.layer);a.overlay?((r=document.createElement("input")).type="checkbox",r.className="leaflet-control-layers-selector",r.defaultChecked=l):r=this._createRadioElement("leaflet-base-layers_"+H(this),l),this._layerControlInputs.push(r),r.layerId=H(a.layer),so(r,"click",this._onInputClick,this);var e=document.createElement("span");e.innerHTML=" "+a.name;var n=document.createElement("div");return s.appendChild(n),n.appendChild(r),n.appendChild(e),(a.overlay?this._overlaysList:this._baseLayersList).appendChild(s),this._checkDisabledLayers(),s},_onInputClick:function(){var t,s,d=this._layerControlInputs,l=[],e=[];this._handlingClick=!0;for(var n=d.length-1;0<=n;n--)t=d[n],s=this._getLayer(t.layerId).layer,t.checked?l.push(s):t.checked||e.push(s);for(n=0;no.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),te=kn.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(n){var o=wt("div","leaflet-control-zoom leaflet-bar"),t=this.options;return this._zoomInButton=this._createButton(t.zoomInText,t.zoomInTitle,"leaflet-control-zoom-in",o,this._zoomIn),this._zoomOutButton=this._createButton(t.zoomOutText,t.zoomOutTitle,"leaflet-control-zoom-out",o,this._zoomOut),this._updateDisabled(),n.on("zoomend zoomlevelschange",this._updateDisabled,this),o},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(s,a,t,r,e){var n=wt("a",t,r);return n.innerHTML=s,n.href="#",n.title=a,n.setAttribute("role","button"),n.setAttribute("aria-label",a),uo(n),so(n,"click",yo),so(n,"click",e,this),so(n,"click",this._refocusOnMap,this),n},_updateDisabled:function(){var t=this._map;Vt(this._zoomInButton,"leaflet-disabled"),Vt(this._zoomOutButton,"leaflet-disabled"),(this._disabled||t._zoom===t.getMinZoom())&&qt(this._zoomOutButton,"leaflet-disabled"),(this._disabled||t._zoom===t.getMaxZoom())&&qt(this._zoomInButton,"leaflet-disabled")}});fn.mergeOptions({zoomControl:!0}),fn.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new te,this.addControl(this.zoomControl))});var ie=kn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(n){var o=wt("div","leaflet-control-scale"),t=this.options;return this._addScales(t,"leaflet-control-scale-line",o),n.on(t.updateWhenIdle?"moveend":"move",this._update,this),n.whenReady(this._update,this),o},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,o,t){e.metric&&(this._mScale=wt("div",o,t)),e.imperial&&(this._iScale=wt("div",o,t))},_update:function(){var e=this._map,o=e.getSize().y/2,t=e.distance(e.containerPointToLatLng([0,o]),e.containerPointToLatLng([this.options.maxWidth,o]));this._updateScales(t)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(e){var o=this._getRoundNum(e),t=1e3>o?o+" m":o/1e3+" km";this._updateScale(this._mScale,t,o/e)},_updateImperial:function(e){var o,n,a,d=3.2808399*e;5280Leaflet"},initialize:function(t){l(this,t),this._attributions={}},onAdd:function(o){for(var e in(o.attributionControl=this)._container=wt("div","leaflet-control-attribution"),uo(this._container),o._layers)o._layers[e].getAttribution&&this.addAttribution(o._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var e=[];for(var o in this._attributions)this._attributions[o]&&e.push(o);var t=[];this.options.prefix&&t.push(this.options.prefix),e.length&&t.push(e.join(", ")),this._container.innerHTML=t.join(" | ")}}});fn.mergeOptions({attributionControl:!0}),fn.addInitHook(function(){this.options.attributionControl&&new ee().addTo(this)}),kn.Layers=Sn,kn.Zoom=te,kn.Scale=ie,kn.Attribution=ee,ko.layers=function(e,o,t){return new Sn(e,o,t)},ko.zoom=function(t){return new te(t)},ko.scale=function(t){return new ie(t)},ko.attribution=function(t){return new ee(t)};var ne=c.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});ne.addTo=function(o,e){return o.addHandler(e,this),this};var oe,Bn,On=Lt?"touchstart mousedown":"mousedown",En={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},he={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},ue=E.extend({options:{clickTolerance:3},initialize:function(n,o,t,a){l(this,a),this._element=n,this._dragStartTarget=o||n,this._preventOutline=t},enable:function(){this._enabled||(so(this._dragStartTarget,On,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ue._dragging===this&&this.finishDrag(),lo(this._dragStartTarget,On,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(!e._simulated&&this._enabled&&(this._moved=!1,!Ft(this._element,"leaflet-zoom-anim")&&!(ue._dragging||e.shiftKey||1!==e.which&&1!==e.button&&!e.touches||((ue._dragging=this)._preventOutline&&no(this._element),to(),Bo(),this._moving)))){this.fire("down");var o=e.touches?e.touches[0]:e,t=io(this._element);this._startPoint=new y(o.clientX,o.clientY),this._parentScale=ro(t),so(document,he[e.type],this._onMove,this),so(document,En[e.type],this._onUp,this)}},_onMove:function(e){if(!e._simulated&&this._enabled)if(e.touches&&1c&&1e-7this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()n.opacity&&this._updateOpacity(),r&&this.getPane().appendChild(this._icon),this._initInteraction(),s&&l&&this.getPane(n.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),Mt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Mt(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&$t(this._icon,t),this._shadow&&$t(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(o){var e=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(qt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Be)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Be(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&Xt(this._icon,t),this._shadow&&Xt(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}}),Ie=Ce.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return l(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&t.hasOwnProperty("weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),Oe=Ie.extend({options:{fill:!0,radius:10},initialize:function(o,e){l(this,e),this._latlng=M(o),this._radius=this.options.radius},setLatLng:function(o){var e=this._latlng;return this._latlng=M(o),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(o){var e=o&&o.radius||this._radius;return Ie.prototype.setStyle.call(this,o),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var n=this._radius,o=this._radiusY||n,t=this._clickTolerance(),a=[n+t,o+t];this._pxBounds=new C(this._point.subtract(a),this._point.add(a))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}}),Re=Oe.extend({initialize:function(e,o,a){if("number"==typeof o&&(o=v({},a,{radius:o})),l(this,o),this._latlng=M(e),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new g(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Ie.prototype.setStyle,_project:function(){var l=this._latlng.lng,d=this._latlng.lat,t=this._map,p=t.options.crs;if(p.distance===Mo.distance){var e=Math.PI/180,n=this._mRadius/Mo.R/e,o=t.project([d+n,l]),s=t.project([d-n,l]),r=o.add(s).divideBy(2),a=t.unproject(r).lat,_=Math.acos((Math.cos(n*e)-Math.sin(d*e)*Math.sin(a*e))/(Math.cos(d*e)*Math.cos(a*e)))/e;(isNaN(_)||0===_)&&(_=n/Math.cos(Math.PI/180*d)),this._point=r.subtract(t.getPixelOrigin()),this._radius=isNaN(_)?0:r.x-t.project([a,l-_]).x,this._radiusY=r.y-o.y}else{var c=p.unproject(p.project(this._latlng).subtract([this._mRadius,0]));this._point=t.latLngToLayerPoint(this._latlng),this._radius=this._point.x-t.latLngToLayerPoint(c).x}this._updateBounds()}}),Ne=Ie.extend({options:{smoothFactor:1,noClip:!1},initialize:function(o,e){l(this,e),this._setLatLngs(o)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var o,n,r=1/0,l=null,d=me,c=0,u=this._parts.length;ce.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(v=!v);return v||Ne.prototype._containsPoint.call(this,e,!0)}}),je=Se.extend({initialize:function(o,e){l(this,e),this._layers={},o&&this.addData(o)},addData:function(e){var n,a,r,_=Ao(e)?e:e.features;if(_){for(n=0,a=_.length;nthis.options.opacity&&this._updateOpacity()),this.options.interactive&&(qt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Mt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&Ht(this._image),this},bringToBack:function(){return this._map&&Wt(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=S(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var o="IMG"===this._url.tagName,e=this._image=o?this._url:wt("img");qt(e,"leaflet-image-layer"),this._zoomAnimated&&qt(e,"leaflet-zoom-animated"),this.options.className&&qt(e,this.options.className),e.onselectstart=Y,e.onmousemove=Y,e.onload=h(this.fire,this,"load"),e.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),o?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(e){var o=this._map.getZoomScale(e.zoom),t=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Qt(this._image,t,o)},_reset:function(){var e=this._image,o=new C(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),t=o.getSize();$t(e,o.min),e.style.width=t.x+"px",e.style.height=t.y+"px"},_updateOpacity:function(){Xt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),Je=He.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var o="VIDEO"===this._url.tagName,a=this._image=o?this._url:wt("video");if(qt(a,"leaflet-image-layer"),this._zoomAnimated&&qt(a,"leaflet-zoom-animated"),this.options.className&&qt(a,this.options.className),a.onselectstart=Y,a.onmousemove=Y,a.onloadeddata=h(this.fire,this,"load"),o){for(var t=a.getElementsByTagName("source"),r=[],e=0;ea.x&&(_=n.x+p-a.x+r.x),0>n.x-_-s.x&&(_=n.x-s.x),n.y+t+r.y>a.y&&(c=n.y+t-a.y+r.y),0>n.y-c-s.y&&(c=n.y-s.y),(_||c)&&l.fire("autopanstart").panBy([_,c])}},_onCloseButtonClick:function(t){this._close(),yo(t)},_getAnchor:function(){return b(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});fn.mergeOptions({closePopupOnClick:!0}),fn.include({openPopup:function(e,t,n){return e instanceof nn||(e=new nn(n).setContent(e)),t&&e.setLatLng(t),this.hasLayer(e)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=e,this.addLayer(e))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Ce.include({bindPopup:function(o,e){return o instanceof nn?(l(o,e),(this._popup=o)._source=this):(this._popup&&!e||(this._popup=new nn(e,this)),this._popup.setContent(o)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(o,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,o,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(o){var e=o.layer||o.target;this._popup&&this._map&&(yo(o),e instanceof Ie?this.openPopup(o.layer||o.target,o.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,o.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var on=en.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){en.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){en.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=en.prototype.getEvents.call(this);return Lt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=wt("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var s=this._map,d=this._container,p=s.latLngToContainerPoint(s.getCenter()),e=s.layerPointToContainerPoint(t),n=this.options.direction,c=d.offsetWidth,_=d.offsetHeight,r=b(this.options.offset),a=this._getAnchor();t="top"===n?t.add(b(-c/2+r.x,-_+r.y+a.y,!0)):"bottom"===n?t.subtract(b(c/2-r.x,-r.y,!0)):"center"===n?t.subtract(b(c/2+r.x,_/2-a.y+r.y,!0)):"right"===n||"auto"===n&&e.xn?a=!0:(l.active?s=!0:this._onOpaqueTile(l),l.active=!0)}}s&&!this._noPrune&&this._pruneTiles(),a&&(p(this._fadeFrame),this._fadeFrame=ae(this._updateOpacity,this))}},_onOpaqueTile:Y,_initContainer:function(){this._container||(this._container=wt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),1>this.options.opacity&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var o=this._tileZoom,n=this.options.maxZoom;if(void 0!==o){for(var t in this._levels)this._levels[t].el.children.length||t===o?(this._levels[t].el.style.zIndex=n-Math.abs(o-t),this._onUpdateLevel(t)):(Mt(this._levels[t].el),this._removeTilesAtZoom(t),this._onRemoveLevel(t),delete this._levels[t]);var a=this._levels[o],r=this._map;return a||((a=this._levels[o]={}).el=wt("div","leaflet-tile-container leaflet-zoom-animated",this._container),a.el.style.zIndex=n,a.origin=r.project(r.unproject(r.getPixelOrigin()),o).round(),a.zoom=o,this._setZoomTransform(a,r.getCenter(),r.getZoom()),a.el.offsetWidth,this._onCreateLevel(a)),this._level=a}},_onUpdateLevel:Y,_onRemoveLevel:Y,_onCreateLevel:Y,_pruneTiles:function(){if(this._map){var t,n,s=this._map.getZoom();if(s>this.options.maxZoom||sthis.options.maxZoom||void 0!==this.options.minZoom&&et.max.x)||!o.wrapLat&&(n.yt.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(n);return S(this.options.bounds).overlaps(a)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(o){var a=this._map,t=this.getTileSize(),r=o.scaleBy(t),e=r.add(t);return[a.unproject(r,o.z),a.unproject(e,o.z)]},_tileCoordsToBounds:function(e){var o=this._tileCoordsToNwSe(e),t=new g(o[0],o[1]);return this.options.noWrap||(t=this._map.wrapLatLngBounds(t)),t},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(e){var o=e.split(":"),t=new y(+o[0],+o[1]);return t.z=+o[2],t},_removeTile:function(o){var e=this._tiles[o];e&&(Mt(e.el),delete this._tiles[o],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(o)}))},_initTile:function(o){qt(o,"leaflet-tile");var e=this.getTileSize();o.style.width=e.x+"px",o.style.height=e.y+"px",o.onselectstart=Y,o.onmousemove=Y,tt&&1>this.options.opacity&&Xt(o,this.options.opacity),nt&&!ot&&(o.style.WebkitBackfaceVisibility="hidden")},_addTile:function(o,a){var t=this._getTilePos(o),r=this._tileCoordsToKey(o),e=this.createTile(this._wrapCoords(o),h(this._tileReady,this,o));this._initTile(e),2>this.createTile.length&&ae(h(this._tileReady,this,o,null,e)),$t(e,t),this._tiles[r]={el:e,coords:o,current:!0},a.appendChild(e),this.fire("tileloadstart",{tile:e,coords:o})},_tileReady:function(e,o,t){o&&this.fire("tileerror",{error:o,tile:t,coords:e});var n=this._tileCoordsToKey(e);(t=this._tiles[n])&&(t.loaded=+new Date,this._map._fadeAnimated?(Xt(t.el,0),p(this._fadeFrame),this._fadeFrame=ae(this._updateOpacity,this)):(t.active=!0,this._pruneTiles()),o||(qt(t.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:t.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),tt||!this._map._fadeAnimated?ae(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(o){var e=new y(this._wrapX?V(o.x,this._wrapX):o.x,this._wrapY?V(o.y,this._wrapY):o.y);return e.z=o.z,e},_pxBoundsToTileRange:function(o){var e=this.getTileSize();return new C(o.min.unscaleBy(e).floor(),o.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),an=rn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(o,e){this._url=o,(e=l(this,e)).detectRetina&&Tt&&0")}}catch(t){return function(t){return document.createElement("<"+t+" xmlns=\"urn:schemas-microsoft.com:vml\" class=\"lvml\">")}}}(),dn=St?_n:R,mn=un.extend({getEvents:function(){var t=un.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=dn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=dn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Mt(this._container),lo(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){un.prototype._update.call(this);var e=this._bounds,o=e.getSize(),t=this._container;this._svgSize&&this._svgSize.equals(o)||(this._svgSize=o,t.setAttribute("width",o.x),t.setAttribute("height",o.y)),$t(t,e.min),t.setAttribute("viewBox",[e.min.x,e.min.y,o.x,o.y].join(" ")),this.fire("update")}},_initPath:function(o){var e=o._path=dn("path");o.options.className&&qt(e,o.options.className),o.options.interactive&&qt(e,"leaflet-interactive"),this._updateStyle(o),this._layers[H(o)]=o},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){Mt(t._path),t.removeInteractiveTarget(t._path),delete this._layers[H(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(e){var o=e._path,t=e.options;o&&(t.stroke?(o.setAttribute("stroke",t.color),o.setAttribute("stroke-opacity",t.opacity),o.setAttribute("stroke-width",t.weight),o.setAttribute("stroke-linecap",t.lineCap),o.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?o.setAttribute("stroke-dasharray",t.dashArray):o.removeAttribute("stroke-dasharray"),t.dashOffset?o.setAttribute("stroke-dashoffset",t.dashOffset):o.removeAttribute("stroke-dashoffset")):o.setAttribute("stroke","none"),t.fill?(o.setAttribute("fill",t.fillColor||t.color),o.setAttribute("fill-opacity",t.fillOpacity),o.setAttribute("fill-rule",t.fillRule||"evenodd")):o.setAttribute("fill","none"))},_updatePoly:function(o,e){this._setPath(o,D(o._parts,e))},_updateCircle:function(o){var a=o._point,t=Math.max(Math.round(o._radius),1),r="a"+t+","+(Math.max(Math.round(o._radiusY),1)||t)+" 0 1,0 ",e=o._empty()?"M0 0":"M"+(a.x-t)+","+a.y+r+2*t+",0 "+r+2*-t+",0 ";this._setPath(o,e)},_setPath:function(o,e){o._path.setAttribute("d",e)},_bringToFront:function(t){Ht(t._path)},_bringToBack:function(t){Wt(t._path)}});St&&mn.include({_initContainer:function(){this._container=wt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(un.prototype._update.call(this),this.fire("update"))},_initPath:function(o){var e=o._container=_n("shape");qt(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",o._path=_n("path"),e.appendChild(o._path),this._updateStyle(o),this._layers[H(o)]=o},_addPath:function(o){var e=o._container;this._container.appendChild(e),o.options.interactive&&o.addInteractiveTarget(e)},_removePath:function(o){var e=o._container;Mt(e),o.removeInteractiveTarget(e),delete this._layers[H(o)]},_updateStyle:function(e){var o=e._stroke,a=e._fill,l=e.options,s=e._container;s.stroked=!!l.stroke,s.filled=!!l.fill,l.stroke?(o||(o=e._stroke=_n("stroke")),s.appendChild(o),o.weight=l.weight+"px",o.color=l.color,o.opacity=l.opacity,o.dashStyle=l.dashArray?Ao(l.dashArray)?l.dashArray.join(" "):l.dashArray.replace(/( *, *)/g," "):"",o.endcap=l.lineCap.replace("butt","flat"),o.joinstyle=l.lineJoin):o&&(s.removeChild(o),e._stroke=null),l.fill?(a||(a=e._fill=_n("fill")),s.appendChild(a),a.color=l.fillColor||l.color,a.opacity=l.fillOpacity):a&&(s.removeChild(a),e._fill=null)},_updateCircle:function(n){var o=n._point.round(),t=Math.round(n._radius),a=Math.round(n._radiusY||t);this._setPath(n,n._empty()?"M0 0":"AL "+o.x+","+o.y+" "+t+","+a+" 0,23592600")},_setPath:function(o,e){o._path.v=e},_bringToFront:function(t){Ht(t._container)},_bringToBack:function(t){Wt(t._container)}}),fn.include({getRenderer:function(o){var e=o.options.renderer||this._getPaneRenderer(o.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(o){if("overlayPane"===o||void 0===o)return!1;var e=this._paneRenderers[o];return void 0===e&&(e=this._createRenderer({pane:o}),this._paneRenderers[o]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&$e(t)||To(t)}});var gn=De.extend({initialize:function(o,e){De.prototype.initialize.call(this,this._boundsToLatLngs(o),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=S(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});mn.create=dn,mn.pointsToPath=D,je.geometryToLayer=ye,je.coordsToLatLng=Fe,je.coordsToLatLngs=Ue,je.latLngToCoords=Ve,je.latLngsToCoords=qe,je.getFeature=Ge,je.asFeature=Ke,fn.mergeOptions({boxZoom:!0});var vn=ne.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){so(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){lo(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Mt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){return!!(t.shiftKey&&(1===t.which||1===t.button))&&void(this._clearDeferredResetState(),this._resetState(),Bo(),to(),this._startPoint=this._map.mouseEventToContainerPoint(t),so(document,{contextmenu:yo,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this))},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=wt("div","leaflet-zoom-box",this._container),qt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var o=new C(this._point,this._startPoint),t=o.getSize();$t(this._box,o.min),this._box.style.width=t.x+"px",this._box.style.height=t.y+"px"},_finish:function(){this._moved&&(Mt(this._box),Vt(this._container,"leaflet-crosshair")),Oo(),oo(),lo(document,{contextmenu:yo,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(o){if((1===o.which||1===o.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var e=new g(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});fn.addInitHook("addHandler","boxZoom",vn),fn.mergeOptions({doubleClickZoom:!0});var xn=ne.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(o){var a=this._map,t=a.getZoom(),r=a.options.zoomDelta,e=o.originalEvent.shiftKey?t-r:t+r;"center"===a.options.doubleClickZoom?a.setZoom(e):a.setZoomAround(o.containerPoint,e)}});fn.addInitHook("addHandler","doubleClickZoom",xn),fn.mergeOptions({dragging:!0,inertia:!ot,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var wn=ne.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new ue(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}qt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Vt(this._map._container,"leaflet-grab"),Vt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var o=this._map;if(o._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=S(this._map.options.maxBounds);this._offsetLimit=w(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;o.fire("movestart").fire("dragstart"),o.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var o=this._lastTime=+new Date,t=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(t),this._times.push(o),this._prunePositions(o)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(t){for(;1e.max.x&&(o.x=this._viscousLimit(o.x,e.max.x)),o.y>e.max.y&&(o.y=this._viscousLimit(o.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(o)}},_onPreDragWrap:function(){var r=this._worldWidth,a=Math.round(r/2),t=this._initialWorldOffset,l=this._draggable._newPos.x,e=(l-a+t)%r+a-t,n=(l+a+t)%r-a-t,o=Math.abs(e+t)this._times.length;if(d.fire("dragend",_),p)d.fire("moveend");else{this._prunePositions(+new Date);var e=this._lastPos.subtract(this._positions[0]),n=(this._lastTime-this._times[0])/1e3,o=t.easeLinearity,s=e.multiplyBy(o/n),r=s.distanceTo([0,0]),a=Math.min(t.inertiaMaxSpeed,r),m=s.multiplyBy(a/r),u=a/(t.inertiaDeceleration*o),l=m.multiplyBy(-u/2).round();l.x||l.y?(l=d._limitOffset(l,d.options.maxBounds),ae(function(){d.panBy(l,{duration:u,easeLinearity:o,noMoveStart:!0,animate:!0})})):d.fire("moveend")}}});fn.addInitHook("addHandler","dragging",wn),fn.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Pn=ne.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;0>=t.tabIndex&&(t.tabIndex="0"),so(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),lo(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var n=document.body,o=document.documentElement,t=n.scrollTop||o.scrollTop,a=n.scrollLeft||o.scrollLeft;this._map._container.focus(),window.scrollTo(a,t)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(e){var o,a,l=this._panKeys={},s=this.keyCodes;for(o=0,a=s.left.length;oe||this._zoom>a.getMaxZoom()&&1 @@ -99,7 +100,7 @@ function loadMap() { `; - // funkcja wyszukująca markery na mapie + // Funkcja wyszukująca markery na mapie function runSearchPickup() { if (typeof mymap !== 'undefined') { mymap.eachLayer(function (layer) { @@ -178,7 +179,7 @@ function loadMap() { if (window.innerWidth < 757) document.getElementById("pickup_list_form").insertAdjacentElement("beforebegin",document.querySelector('.map_button_search')); if (!oscItem.querySelector('.fselectedPoint')) oscItem.insertAdjacentHTML("beforeend",``); - // wyszukiwanie punktów odbioru na mapie + // Wyszukiwanie punktów odbioru na mapie if (finpostjs) { pickup_sites.courierId = ITEM_ID; runSearchPickup(); @@ -207,7 +208,7 @@ function loadMap() { const selectedPoint = document.querySelector('[name="shipping"]:checked').closest('.osc_item').querySelector('.fselectedPoint'); selectedPoint.innerHTML = ""; - // utworzenie informacji o punkcie odbioru + // Utworzenie informacji o punkcie odbioru const deliveryId = document.querySelector('[name="pickup_point"]:checked').value; const chosenPoint = document.querySelector(`.asideContainer_pickup label[data-id="${deliveryId}"]`); const pickupName = chosenPoint.querySelector(".headerText").innerHTML; @@ -228,7 +229,7 @@ function loadMap() { } deliveryPickupPoints.forEach(point => createEventsInpost(point)); } -// zamknięcie mapy +// Zamknięcie mapy function closeMap(){ document.getElementById("fbs_z02_cover").style.display = "none"; enablePageScroll(); @@ -240,7 +241,7 @@ function getAddressInfo(query){ }; return document.getElementById(`client_${query}`).value; } -// utworzenie informacji o punkcie odbioru +// Utworzenie informacji o punkcie odbioru function createPickuppointInfo(selectedPoint, deliveryPointId, name, streetText, cityText, zipcodeText, courierId){ // Pokazanie elementu fselectedPoint selectedPoint.style.display = "block"; @@ -289,7 +290,7 @@ function toggleMapList(e){ e.target.dataset.show = ifList ? "map" : "list"; } -/////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// // DANE KLIENTA document.getElementById("cop_seection1").addEventListener("click", (e) => { @@ -371,10 +372,10 @@ function showDeliveryForm(style){ const deliveryWrapper = document.querySelector(".ajax_cop #client_new_additional .delivery_box.cn_wrapper"); if((style && deliveryWrapper.classList.contains("--more")) || (!style && !deliveryWrapper.classList.contains("--more"))) return; - // formularz dostawy na inny adres + // Formularz dostawy na inny adres style ? deliveryWrapper.classList.add("--more") : deliveryWrapper.classList.remove("--more"); - // przycisk od wybierania z listy adresów + // Przycisk od wybierania z listy adresów listBtn = document.querySelector(".delivery__address-list-button"); if(listBtn) style ? listBtn.classList.add("--fade-in") : listBtn.classList.remove("--fade-in"); @@ -417,7 +418,7 @@ function handleClickAddressList(e){ changeRegion(); } - // nadanie klasy aktywnemu adresowi + // Nadanie klasy aktywnemu adresowi e.target.closest("ul").querySelectorAll("li").forEach(el => el.classList.remove("--active-address")); addressLi.classList.add("--active-address"); @@ -501,20 +502,20 @@ function getClientNew(){ }); }; -///////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// // WALIDACJA -// wyczyść klasy walidacji +// Wyczyść klasy walidacji function clearValidation(input){ const wrapper = input.closest(".has-feedback") wrapper.classList.remove('--success', '--error', 'has-error', 'has-success'); }; -// wyczyść wiadomość błędu +// Wyczyść wiadomość błędu function removeErrorMessage(input) { const valMessage = input.closest('.has-feedback').querySelector('.validate_message'); if(valMessage) valMessage.remove(); }; -// dodaj klasy błędu +// Dodaj klasy błędu function addError(input){ clearValidation(input); removeErrorMessage(input); @@ -522,7 +523,7 @@ function addError(input){ clearValidation(wrapper); wrapper.classList.add('--error', 'has-error'); }; -// dodaj klasy sukcesu +// Dodaj klasy sukcesu function addSuccess(input){ clearValidation(input); removeErrorMessage(input); @@ -530,12 +531,12 @@ function addSuccess(input){ clearValidation(wrapper); wrapper.classList.add('--success', 'has-success'); }; -// dodaj error wraz z wiadomością +// Dodaj error wraz z wiadomością function addErrorMessage(input, message){ addError(input); input.closest('.has-feedback').insertAdjacentHTML("beforeend",`${message}.`); } -// waliduj elementy wymagające wysłania requesta (zipcode, nip) +// Waliduj elementy wymagające wysłania requesta (zipcode, nip) async function validateRequest(target, order=false){ const wrapper = target.closest(".has-feedback"); let reqData = `${target.name}=${target.value}`; @@ -635,14 +636,14 @@ function handleShowSigninModalFromEmailModal(e){ showSigninModal(); } -// event listener zmian w kontenerze cop_seection1 +// EventListener zmian w kontenerze cop_seection1 const validateRequestId = ["client_zipcode", "delivery_zipcode", "client_nip", "client_email"]; const notEmptyFieldsId = ["client_firstname", "client_lastname", "client_city", "delivery_firstname", "delivery_lastname", "delivery_city", "client_firm"]; document.getElementById("cop_seection1").addEventListener("change", (e) => { - // walidacja zipcode, nipu i emaila + // Walidacja zipcode, nipu i emaila if(validateRequestId.includes(e.target.id)) return validateRequest(e.target); - // zmiana regionu + // Zmiana regionu if(e.target.name === "client_region" || e.target.name === "delivery_region") { const clientType = e.target.name.split("_")[0]; validateRequest(document.getElementById(`${clientType}_zipcode`)); @@ -667,7 +668,7 @@ document.getElementById("cop_seection1").addEventListener("change", (e) => { else clearValidation(e.target); }; }); -// funkcje walidacji poszczególnych elementów +// Funkcje walidacji poszczególnych elementów function validateStreet(streetEl){ const streetParts = streetEl.value.split(" "); const addressNumber = Number(streetParts[streetParts.length-1][0]); @@ -742,7 +743,7 @@ document.querySelector("body").addEventListener("change", (e) => { } }) -/////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////// // DOSTAWA I PŁATNOSĆI const SET_REGION = (setRegionInput) => JSON.stringify({ @@ -783,7 +784,7 @@ async function changeRegion(payAndDelData = null, firstLoad = false) { getNewPaymentsAndDeliveries(payAndDelData, firstLoad); }; -// załadowanie metod dostaw i płatności +// Załadowanie metod dostaw i płatności function getNewPaymentsAndDeliveries(data = null, firstLoad = false) { console.log("fn: order1_new"); // Wyczyszczenie zapisanych poprzednich metod płatności @@ -867,7 +868,7 @@ const checkedPayment = paymentValue === method.id; } else{ prepaidsMethodMarkup += markup; - // okienko vouchera + // Okienko vouchera if(method.id === 2){ prepaidsMethodMarkup += `
@@ -944,13 +945,13 @@ const checkedPayment = paymentValue === method.id; cloneElement(document.getElementById(paymentMethodId)); } - // poprzednia dostawa + // Poprzednia dostawa const prevDeliveryMethod = JSON.parse(localStorage.getItem("prevDeliveryMethod")); const prevDeliveryInput = document.querySelector(`input#${prevDeliveryMethod.id}`); - // Sprawdzenie czy istnieje metoda płatności(na wypadek gdyby była usunięta lub klient zamawiał do innego kraju) + // Sprawdzenie czy istnieje metoda dostawy (na wypadek gdyby była usunięta lub klient zamawiał do innego kraju) if(prevDeliveryInput){ - // sprawdzenie czy dostawa miała punkt odbioru + // Sprawdzenie czy dostawa miała punkt odbioru if(prevDeliveryMethod.fselectedPoint){ checkPrevPickupPoint( prevDeliveryInput.parentElement.querySelector(".fselectedPoint"), @@ -1006,7 +1007,7 @@ function createPaymentContainerMarkup(method){ // Przygotowanie html dla metod dostaw function prepareDeliveryMarkup(method, deliveryId){ - // zapisanie do listy dostaw z mapą + // Zapisanie do listy dostaw z mapą if (method.pickuppoint === "y" && !deliveryPickupPoints.includes(method.id)) deliveryPickupPoints.push(method.id); const cost = Number(method.cost) === 0 ? : method.cost_formatted; const disabled = method.minworthreached === "false" ? 'disabled="disabled"' : ""; @@ -1018,7 +1019,7 @@ function prepareDeliveryMarkup(method, deliveryId){ date.setDate(date.getDate()+method.time); const deliveryDate = date.toLocaleDateString('en-GB').replaceAll("/", "."); - // uzupełnienie markupa dla metod dostaw dvp + // Uzupełnienie markupa dla metod dostaw dvp return `
");$(".loadingMap").hide();return false}else{$(".mapContainer_pickup, .asideContainer_pickup, .pickupl_submit, #pickup_map").show()}$("label.pickup_point").hide();$("div.loadingMap").fadeIn("normal",function(){});$("span.loadingMarkers").hide();var options={courierId:pickup_sites.courierId,"location[latitude]":pickup_sites.search_lat,"location[longitude]":pickup_sites.search_lng,isCod:pickup_sites.isCod};if(radius){function getRadius(){var curr_zoom=pickup_sites.mapa.getZoom();if(curr_zoom>=15){return 1}else if(curr_zoom==14){return 2}else if(curr_zoom==13){return 4}else if(curr_zoom==12){return 7}else if(curr_zoom==11){return 10}else if(curr_zoom==10){return 15}else{return 20}}var options={courierId:pickup_sites.courierId,"location[latitude]":pickup_sites.search_lat,"location[longitude]":pickup_sites.search_lng,radius:getRadius(),isCod:pickup_sites.isCod}}$.ajax({type:"GET",url:"/ajax/getPickups.php",data:options,dataType:"json",success:function(json){if(!jQuery.isEmptyObject(selected_pickup_point)){for(i in json.pickupPoints){if(json.pickupPoints[i].id==selected_pickup_point.id){delete json.pickupPoints[i]}}json.pickupPoints.unshift(selected_pickup_point)}if(!json.pickupPoints.length){if(radius){$("div.asideContainer_pickup").prepend('")}else{$("div.asideContainer_pickup").prepend('")}$(".loadingMap").hide();return false}if(!pickup_sites.adress.route){for(i in json.pickupPoints){if($.trim(json.pickupPoints[i].address.city).toLowerCase()==$.trim(pickup_sites.adress.locality).toLowerCase()){options.radius=30;$.ajax({type:"GET",url:"/ajax/getPickups.php",data:options,dataType:"json",success:function(json){setPickupPoints(json,true)},error:function(){}});return false}}}setPickupPoints(json,false)},error:function(){$("div.asideContainer_pickup").prepend('")}})},showSel:function(){pickup_sites.pickupCount=$(".asideContainer_pickup .pickup_point").length;pickup_sites.pickupIteration=0;$("div.loadingMap").fadeIn("normal",function(){});$("span.loadingMap").hide();$("span.loadingMarkers").css("display","block");$("span.loadingMarkersCount").text(pickup_sites.pickupCount);$("span.loadingMarkersComplete").text(pickup_sites.pickupIteration);pickup_sites.markersArray=[];var adresData=[];$(".asideContainer_pickup .pickup_point").each(function(index){$this=$(this);adresData[index]={};adresData[index].idek=$this.data("id");adresData[index].headerText=$.trim($this.find(".headerText").text());adresData[index].streetText=$this.find(".streetText").text();adresData[index].cityText=$.trim($this.find(".cityText").text());adresData[index].moreText=$.trim($this.find(".moreLink").text());adresData[index].moreLink=$.trim($this.find(".moreLink").attr("href"));adresData[index].infoText=$.trim($this.find(".infoText").text());adresData[index].timeText=$.trim($this.find(".timeText").text());adresData[index].latitude=$.trim($this.data("latitude"));adresData[index].longitude=$.trim($this.data("longitude"));adresData[index].icon=$.trim($this.data("icon"))});var adresRow="";while(adresRow=adresData.pop()){if(adresRow.latitude&&adresRow.longitude){pickup_sites.findAdres(adresRow.headerText,adresRow.streetText,adresRow.cityText,adresRow.moreText,adresRow.moreLink,adresRow.infoText,adresRow.timeText,"none","another",false,adresRow.idek,adresRow.latitude,adresRow.longitude,adresRow.icon)}else{(function(adresRow){setTimeout(function(){pickup_sites.findAdres(adresRow.headerText,adresRow.streetText,adresRow.cityText,adresRow.moreText,adresRow.moreLink,adresRow.infoText,adresRow.timeText,"none","another",false,adresRow.idek,adresRow.latitude,adresRow.longitude,adresRow.icon)},pickup_sites.timeout)})(adresRow)}}},printDates:function(stockId){if(!$("#selectPickupDay").size())return false;var postData={stock_id:stockId};$.ajax({type:"GET",url:"/ajax/basket-delivery.php",data:postData,dataType:"json",success:function(json){if(!json){$("#selectPickupDayWrapper").hide();return false}$("#selectPickupDay").html("");$.each(json,function(index,data){$("#selectPickupDay").append('")});$("#selectPickupDayWrapper").show();$(".pickupl_hour_wrapper").show();$('#selectPickupDay [name="calendar_select_date"]').eq(1).prop("checked",true)},error:function(){Alertek.show_alert(pickupl_error)}})},setZoom:function(){var bounds=new google.maps.LatLngBounds;for(var i in pickup_sites.markersArray){bounds.extend(pickup_sites.markersArray[i].getPosition())}pickup_sites.mapa.setCenter(bounds.getCenter());pickup_sites.mapa.fitBounds(bounds);pickup_sites.mapa.setZoom(pickup_sites.mapa.getZoom());if(pickup_sites.mapa.getZoom()>15){pickup_sites.mapa.setZoom(15)}},mapInit:function(){if($("#mymap").length){return false}if($("#autocomplete_location").size()&&!$("#mymap").size()){pickup_sites.autocomplete=new google.maps.places.Autocomplete(document.getElementById("autocomplete_location"));$("label.pickup_point").hide()}pickup_sites.zoom=pickupsZoom;pickup_sites.geokoder=new google.maps.Geocoder;var wspolrzedne=new google.maps.LatLng(parseInt(bCordPickups),parseInt(lCordPickups));if(markersAnimationPickups!="")pickup_sites.markerAnimation=true;else pickup_sites.markerAnimation=false;if(markerPickupsCustomIcon!="")markerPickupsCustomIcon=true;else markerPickupsCustomIcon=false;if(mapTypePickups=="ROADMAP")var mapStyle=google.maps.MapTypeId.ROADMAP;else if(mapTypePickups=="SATELLITE")var mapStyle=google.maps.MapTypeId.SATELLITE;else if(mapTypePickups=="HYBRID")var mapStyle=google.maps.MapTypeId.HYBRID;else if(mapTypePickups=="TERRAIN")var mapStyle=google.maps.MapTypeId.TERRAIN;else var mapStyle=google.maps.MapTypeId.ROADMAP;if(navControlPickups!="")navControlPickups=true;else navControlPickups=false;if(mapTypeControlPickups!="")mapTypeControlPickups=true;else mapTypeControlPickups=false;if(scControlPickups!="")scControlPickups=true;else scControlPickups=false;if(controlTypePickups=="ZOOM_PAN")var controlStyle=google.maps.NavigationControlStyle.ZOOM_PAN;else if(controlTypePickups=="SMALL")var controlStyle=google.maps.NavigationControlStyle.SMALL;else if(controlTypePickups=="ANDROID")var controlStyle=google.maps.NavigationControlStyle.ANDROID;else var controlStyle=google.maps.NavigationControlStyle.ZOOM_PAN;if(mapTypeControlStylePickups=="DROPDOWN_MENU")var TypeControlStyle=google.maps.MapTypeControlStyle.DROPDOWN_MENU;else if(mapTypeControlStylePickups=="HORIZONTAL_BAR")var TypeControltyle=google.maps.MapTypeControlStyle.HORIZONTAL_BAR;else var TypeControlStyle=google.maps.MapTypeControlStyle.DROPDOWN_MENU;if($("img.marker_face").attr("src")!=""&&markerPickupsCustomIcon){var markerIconSize=new google.maps.Size($("img.marker_face").width(),$("img.marker_face").height());var punkt_startowy=new google.maps.Point(0,0);var punkt_zaczepienia=new google.maps.Point(parseInt($("img.marker_face").width()/2),parseInt($("img.marker_face").height()/2));pickup_sites.markerIcon=new google.maps.MarkerImage($("img.marker_face").attr("src"),markerIconSize,punkt_startowy,punkt_zaczepienia)}if(window["google_map_style_array"]){var mapOptions={gestureHandling:"cooperative",zoom:pickup_sites.zoom,center:wspolrzedne,mapTypeId:mapStyle,navigationControl:navControlPickups,mapTypeControl:mapTypeControlPickups,scaleControl:scControlPickups,styles:google_map_style_array,navigationControlOptions:{style:controlStyle},mapTypeControlOptions:{style:TypeControlStyle}}}else{var mapOptions={gestureHandling:"cooperative",zoom:pickup_sites.zoom,center:wspolrzedne,mapTypeId:mapStyle,navigationControl:navControlPickups,mapTypeControl:mapTypeControlPickups,scaleControl:scControlPickups,navigationControlOptions:{style:controlStyle},mapTypeControlOptions:{style:TypeControlStyle}}}if(pickup_sites.google_api_key===""){$(".pickupl_sel").removeAttr("disabled");$("div#ps_other").css("opacity","1.0");$("div#ps_other").css("cursor","pointer")}pickup_sites.mapa=new google.maps.Map(document.getElementById("pickup_map"),mapOptions);pickup_sites.markerInfo=new google.maps.InfoWindow;google.maps.event.addListener(pickup_sites.mapa,"idle",function(){$("span.loadingMap").text($("span.loadingNav").text())});if(pickup_sites.autocomplete){pickup_sites.autocomplete.addListener("place_changed",function(){var place=pickup_sites.autocomplete.getPlace();pickup_sites.fillInAddress(place,false);pickup_sites.getLocation()});pickup_sites.getLocation()}else{pickup_sites.showSel()}},markerClickFunction:function(latlng,content){return function(e){e.cancelBubble=true;e.returnValue=false;if(e.stopPropagation){e.stopPropagation();e.preventDefault()}pickup_sites.infoWindow.setContent(content);pickup_sites.infoWindow.setPosition(latlng);pickup_sites.infoWindow.open(pickup_sites.mapa)}},geokoderPrepare:function(point,status,headerText,streetText,cityText,moreText,moreLink,infoText,timeText,className,other,open,idek,latitude,longitude,icon){if(status==google.maps.GeocoderStatus.OK){pickup_sites.timeout=100;pickup_sites.pickupIteration++;pickup_sites.pickupFind++;var content='
'+headerText+"";content+='
'+streetText+"  "+cityText+"
";if(infoText){content+='
'+infoText+"
"}content+='
'+timeText+"
";if(moreLink){if(mapTooltipLink_class==="")content+='";else content+='"}content+="
";var opcjeMarkera={title:headerText,pickupPointID:idek};opcjeMarkera.position=point;opcjeMarkera.map=pickup_sites.mapa;if(pickup_sites.markerAnimation)opcjeMarkera.animation=google.maps.Animation.DROP;if(icon&&icon!=""){opcjeMarkera.icon=icon}else{if($("img.marker_face").attr("src")!=""&&markerPickupsCustomIcon){opcjeMarkera.icon=pickup_sites.markerIcon}}var marker=new google.maps.Marker(opcjeMarkera);pickup_sites.markersArray.push(marker);google.maps.event.addListener(marker,"click",function(marker,i){return function(e){e.cancelBubble=true;e.returnValue=false;if(e.stopPropagation){e.stopPropagation();e.preventDefault()}pickup_sites.markerInfo.setContent(content);pickup_sites.markerInfo.open(pickup_sites.mapa,marker);$('.asideContainer_pickup [value="'+marker.pickupPointID+'"]').prop("checked",true);$(".asideContainer_pickup").scrollTop(0);$(".asideContainer_pickup").scrollTop($('#pickup_site [name="pickup_point"]:checked + label').position().top)}}(marker,i));var pickupItem=$('.asideContainer_pickup [value="'+marker.pickupPointID+'"]').get(0);$('label[for="pickup_point_'+marker.pickupPointID+'"]').show().fadeTo("slow",1);google.maps.event.addDomListener(pickupItem,"click",function(marker,i){return function(e){$('.asideContainer_pickup [value="'+marker.pickupPointID+'"]').prop("checked",true);pickup_sites.markerInfo.setContent(content);pickup_sites.mapa.setCenter(opcjeMarkera.position);if(pickup_sites.mapa.getZoom()=pickup_sites.pickupCount){setTimeout(function(){$("div.loadingMap").fadeOut("normal",function(){});var _src=$('.markerCluster[src*="m1.png"]').attr("src");var _imagePath=_src.substring(0,_src.indexOf("1.png"));pickup_sites.setZoom();var create_map_selected_point=true;if(pickup_sites.mapa.zoom=pickup_sites.pickupCount){setTimeout(function(){$("div.loadingMap").fadeOut("normal",function(){});var _src=$('.markerCluster[src*="m1.png"]').attr("src");var _imagePath=_src.substring(0,_src.indexOf("1.png")-1);pickup_sites.setZoom();var create_map_selected_point=true;if(pickup_sites.mapa.zoom')}if(pickup.coordinates.longitude){pickup_clone.find("label .map_dir").attr("href","https://www.google.com/maps/dir/?api=1&destination="+pickup.coordinates.latitude+","+pickup.coordinates.longitude)}else{pickup_clone.find("label .map_dir").attr("href","https://maps.google.com?saddr=Current+Location&daddr="+pickup.address.street+"+"+pickup.address.postcode+"+"+pickup.address.city)}pickup_clone.find("b.headerText").text(pickup.name);var pickup_street=pickup.address.buildingAndHouseNumber!=""&&pickup.address.buildingAndHouseNumber!=null?pickup.address.street+" "+pickup.address.buildingAndHouseNumber:pickup.address.street;pickup_clone.find("span.streetText").text(pickup_street);pickup_clone.find("span.zipcodePickup").html(pickup.address.postcode+' '+pickup.address.city+"");pickup_clone.find("div.moreText").text(pickup.location);pickup_clone.find("a.moreLink").attr("href",pickup.link);if(pickup.requiresClientNumber){}else{pickup_clone.find("input[name=client_courier_number]").remove()}$("#pickup_site .asideContainer_pickup").append(pickup_clone.find(" > *"))}pickup_sites.showSel()};function geolocate(){pickup_sites.search_lat="";pickup_sites.search_lng="";if(navigator.geolocation){navigator.geolocation.getCurrentPosition(function(position){var geolocation={lat:position.coords.latitude,lng:position.coords.longitude};var circle=new google.maps.Circle({center:geolocation,radius:position.coords.accuracy});pickup_sites.autocomplete.setBounds(circle.getBounds())})}}$(document).on("click","#locationField .btn",function(){if(!$("#mymap").length){pickup_sites.getLocation()}else{leafletGetTextLocation();$(".leafleat-suggestions").remove()}return false});$(document).on("click","div.morePickup",function(){var activePoints=$("label.pickup_point.moreInfoShow");$(this).parents("label.pickup_point").addClass("moreInfoShow");activePoints.removeClass("moreInfoShow")});$(document).on("click",'#pickup_site [name="pickup_point"], #pickup_site [name="stock"]',function(){$('#pickup_site [name="client_courier_number"]').prop("disabled",true);$(this).find('+ label [name="client_courier_number"]').prop("disabled",false).focus();pickup_sites.printDates($(this).val())});app_shop.run(function(){pickup_sites.country_code=app_shop.vars.country_code;pickup_sites.language=app_shop.vars.language;pickup_sites.isCod=app_shop.vars.isCod;pickup_sites.courierId=app_shop.vars.courierId;init_pickupl_site();var mapLink="https://maps.googleapis.com/maps/api/js?key="+app_shop.vars.apiKey+"&libraries=places&callback=pickup_sites.mapInit";var pickup_src=document.createElement("script");pickup_src.setAttribute("src",mapLink);document.body.appendChild(pickup_src)},"all","#pickup_site");function MarkerClusterer(map,opt_markers,opt_options){this.extend(MarkerClusterer,google.maps.OverlayView);this.map_=map;this.markers_=[];this.clusters_=[];this.sizes=[53,56,66,78,90];this.styles_=[];this.ready_=false;var options=opt_options||{};this.gridSize_=options["gridSize"]||60;this.minClusterSize_=options["minimumClusterSize"]||2;this.maxZoom_=options["maxZoom"]||null;this.styles_=options["styles"]||[];this.imagePath_=options["imagePath"]||this.MARKER_CLUSTER_IMAGE_PATH_;this.imageExtension_=options["imageExtension"]||this.MARKER_CLUSTER_IMAGE_EXTENSION_;this.zoomOnClick_=true;if(options["zoomOnClick"]!=undefined){this.zoomOnClick_=options["zoomOnClick"]}this.averageCenter_=false;if(options["averageCenter"]!=undefined){this.averageCenter_=options["averageCenter"]}this.setupStyles_();this.setMap(map);this.prevZoom_=this.map_.getZoom();var that=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var zoom=that.map_.getZoom();var minZoom=that.map_.minZoom||0;var maxZoom=Math.min(that.map_.maxZoom||100,that.map_.mapTypes[that.map_.getMapTypeId()].maxZoom);zoom=Math.min(Math.max(zoom,minZoom),maxZoom);if(that.prevZoom_!=zoom){that.prevZoom_=zoom;that.resetViewport()}});google.maps.event.addListener(this.map_,"idle",function(){that.redraw()});if(opt_markers&&(opt_markers.length||Object.keys(opt_markers).length)){this.addMarkers(opt_markers,false)}}MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="../images/m";MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png";MarkerClusterer.prototype.extend=function(obj1,obj2){return function(object){for(var property in object.prototype){this.prototype[property]=object.prototype[property]}return this}.apply(obj1,[obj2])};MarkerClusterer.prototype.onAdd=function(){this.setReady_(true)};MarkerClusterer.prototype.draw=function(){};MarkerClusterer.prototype.setupStyles_=function(){if(this.styles_.length){return}for(var i=0,size;size=this.sizes[i];i++){this.styles_.push({url:this.imagePath_+(i+1)+"."+this.imageExtension_,height:size,width:size})}};MarkerClusterer.prototype.fitMapToMarkers=function(){var markers=this.getMarkers();var bounds=new google.maps.LatLngBounds;for(var i=0,marker;marker=markers[i];i++){bounds.extend(marker.getPosition())}this.map_.fitBounds(bounds)};MarkerClusterer.prototype.setStyles=function(styles){this.styles_=styles};MarkerClusterer.prototype.getStyles=function(){return this.styles_};MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_};MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_};MarkerClusterer.prototype.getMarkers=function(){return this.markers_};MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length};MarkerClusterer.prototype.setMaxZoom=function(maxZoom){this.maxZoom_=maxZoom};MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_};MarkerClusterer.prototype.calculator_=function(markers,numStyles){var index=0;var count=markers.length;var dv=count;while(dv!==0){dv=parseInt(dv/10,10);index++}index=Math.min(index,numStyles);return{text:count,index:index}};MarkerClusterer.prototype.setCalculator=function(calculator){this.calculator_=calculator};MarkerClusterer.prototype.getCalculator=function(){return this.calculator_};MarkerClusterer.prototype.addMarkers=function(markers,opt_nodraw){if(markers.length){for(var i=0,marker;marker=markers[i];i++){this.pushMarkerTo_(marker)}}else if(Object.keys(markers).length){for(var marker in markers){this.pushMarkerTo_(markers[marker])}}if(!opt_nodraw){this.redraw()}};MarkerClusterer.prototype.pushMarkerTo_=function(marker){marker.isAdded=false;if(marker["draggable"]){var that=this;google.maps.event.addListener(marker,"dragend",function(){marker.isAdded=false;that.repaint()})}this.markers_.push(marker)};MarkerClusterer.prototype.addMarker=function(marker,opt_nodraw){this.pushMarkerTo_(marker);if(!opt_nodraw){this.redraw()}};MarkerClusterer.prototype.removeMarker_=function(marker){var index=-1;if(this.markers_.indexOf){index=this.markers_.indexOf(marker)}else{for(var i=0,m;m=this.markers_[i];i++){if(m==marker){index=i;break}}}if(index==-1){return false}marker.setMap(null);this.markers_.splice(index,1);return true};MarkerClusterer.prototype.removeMarker=function(marker,opt_nodraw){var removed=this.removeMarker_(marker);if(!opt_nodraw&&removed){this.resetViewport();this.redraw();return true}else{return false}};MarkerClusterer.prototype.removeMarkers=function(markers,opt_nodraw){var removed=false;for(var i=0,marker;marker=markers[i];i++){var r=this.removeMarker_(marker);removed=removed||r}if(!opt_nodraw&&removed){this.resetViewport();this.redraw();return true}};MarkerClusterer.prototype.setReady_=function(ready){if(!this.ready_){this.ready_=ready;this.createClusters_()}};MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length};MarkerClusterer.prototype.getMap=function(){return this.map_};MarkerClusterer.prototype.setMap=function(map){this.map_=map};MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_};MarkerClusterer.prototype.setGridSize=function(size){this.gridSize_=size};MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_};MarkerClusterer.prototype.setMinClusterSize=function(size){this.minClusterSize_=size};MarkerClusterer.prototype.getExtendedBounds=function(bounds){var projection=this.getProjection();var tr=new google.maps.LatLng(bounds.getNorthEast().lat(),bounds.getNorthEast().lng());var bl=new google.maps.LatLng(bounds.getSouthWest().lat(),bounds.getSouthWest().lng());var trPix=projection.fromLatLngToDivPixel(tr);trPix.x+=this.gridSize_;trPix.y-=this.gridSize_;var blPix=projection.fromLatLngToDivPixel(bl);blPix.x-=this.gridSize_;blPix.y+=this.gridSize_;var ne=projection.fromDivPixelToLatLng(trPix);var sw=projection.fromDivPixelToLatLng(blPix);bounds.extend(ne);bounds.extend(sw);return bounds};MarkerClusterer.prototype.isMarkerInBounds_=function(marker,bounds){return bounds.contains(marker.getPosition())};MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(true);this.markers_=[]};MarkerClusterer.prototype.resetViewport=function(opt_hide){for(var i=0,cluster;cluster=this.clusters_[i];i++){cluster.remove()}for(var i=0,marker;marker=this.markers_[i];i++){marker.isAdded=false;if(opt_hide){marker.setMap(null)}}this.clusters_=[]};MarkerClusterer.prototype.repaint=function(){var oldClusters=this.clusters_.slice();this.clusters_.length=0;this.resetViewport();this.redraw();window.setTimeout(function(){for(var i=0,cluster;cluster=oldClusters[i];i++){cluster.remove()}},0)};MarkerClusterer.prototype.redraw=function(){this.createClusters_()};MarkerClusterer.prototype.distanceBetweenPoints_=function(p1,p2){if(!p1||!p2){return 0}var R=6371;var dLat=(p2.lat()-p1.lat())*Math.PI/180;var dLon=(p2.lng()-p1.lng())*Math.PI/180;var a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(p1.lat()*Math.PI/180)*Math.cos(p2.lat()*Math.PI/180)*Math.sin(dLon/2)*Math.sin(dLon/2);var c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));var d=R*c;return d};MarkerClusterer.prototype.addToClosestCluster_=function(marker){var distance=4e4;var clusterToAddTo=null;var pos=marker.getPosition();for(var i=0,cluster;cluster=this.clusters_[i];i++){var center=cluster.getCenter();if(center){var d=this.distanceBetweenPoints_(center,marker.getPosition());if(d=this.minClusterSize_){marker.setMap(null)}this.updateIcon();return true};Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_};Cluster.prototype.getBounds=function(){var bounds=new google.maps.LatLngBounds(this.center_,this.center_);var markers=this.getMarkers();for(var i=0,marker;marker=markers[i];i++){bounds.extend(marker.getPosition())}return bounds};Cluster.prototype.remove=function(){this.clusterIcon_.remove();this.markers_.length=0;delete this.markers_};Cluster.prototype.getSize=function(){return this.markers_.length};Cluster.prototype.getMarkers=function(){return this.markers_};Cluster.prototype.getCenter=function(){return this.center_};Cluster.prototype.calculateBounds_=function(){var bounds=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(bounds)};Cluster.prototype.isMarkerInClusterBounds=function(marker){return this.bounds_.contains(marker.getPosition())};Cluster.prototype.getMap=function(){return this.map_};Cluster.prototype.updateIcon=function(){var zoom=this.map_.getZoom();var mz=this.markerClusterer_.getMaxZoom();if(mz&&zoom>mz){for(var i=0,marker;marker=this.markers_[i];i++){marker.setMap(this.map_)}return}if(this.markers_.length0&&this.anchor_[0]0&&this.anchor_[1] .pickup_search_here",function(){pickup_sites.search_lat=pickup_sites.mapa.center.lat();pickup_sites.search_lng=pickup_sites.mapa.center.lng();pickup_sites.ajaxGetPickup(true)});var mymap;var isLoaded=false;var isWaitingEnd=false;var leafletGetPickups=function(lat,long,current_zoom){if(current_zoom>=15){radius=1}else if(current_zoom==14){radius=2}else if(current_zoom==13){radius=4}else if(current_zoom==12){radius=7}else if(current_zoom==11){radius=10}else if(current_zoom==10){radius=15}else{radius=20}if(current_zoom){var options={courierId:pickup_sites.courierId,"location[latitude]":lat,"location[longitude]":long,radius:radius,isCod:pickup_sites.isCod}}else{var options={courierId:pickup_sites.courierId,"location[latitude]":lat,"location[longitude]":long,isCod:pickup_sites.isCod}}$.ajax({type:"GET",url:"/ajax/getPickups.php",data:options,dataType:"json",success:function(json){if(!jQuery.isEmptyObject(selected_pickup_point)){for(i in json.pickupPoints){if(json.pickupPoints[i].id==selected_pickup_point.id){delete json.pickupPoints[i]}}json.pickupPoints.unshift(selected_pickup_point);console.log("pickupPoints unshift")}if(!json.pickupPoints.length){if($("div.asideContainer_pickup .menu_messages_message").length)$("div.asideContainer_pickup .menu_messages_message").remove();if(radius){if($("div.asideContainer_pickup .menu_messages_message").length)$("div.asideContainer_pickup .menu_messages_message").remove();$("div.asideContainer_pickup").prepend('")}else{$("div.asideContainer_pickup").prepend('")}$(".loadingMap").hide();return false}leafletItems=[];for(i in json.pickupPoints){var pickupLat=json.pickupPoints[i].coordinates.latitude;var pickupLon=json.pickupPoints[i].coordinates.longitude;if(pickupLat==""||pickupLon==""){$.ajaxSetup({async:false});$.get(location.protocol+"//nominatim.openstreetmap.org/search?format=json&q="+json.pickupPoints[i].address.street+", "+json.pickupPoints[i].address.city+" "+json.pickupPoints[i].address.city+" "+json.pickupPoints[i].address.country,function(data){if(!jQuery.isEmptyObject(data)){pickupLat=data[0].lat;pickupLon=data[0].lon}else{console.log("nie mogę znaleźć korodynatów adresu!")}})}leafletItems.push({id:json.pickupPoints[i].id,name:json.pickupPoints[i].name,link:json.pickupPoints[i].link,address:json.pickupPoints[i].address,lat:pickupLat,lon:pickupLon})}setPickupPointsNoMap(json,false,true);if(!jQuery.isEmptyObject(leafletItems)){leafletStartMap(leafletItems[0].lat,leafletItems[0].lon,true)}},error:function(){if($("div.asideContainer_pickup .menu_messages_message").length)$("div.asideContainer_pickup .menu_messages_message").remove();$("div.asideContainer_pickup").prepend('");$(".asideContainer_pickup label.pickup_point").each(function(){var aId=$(this).data("id");var aName=$(this).find(".headerText").text();var aLink=$(this).find(".map_dir").attr("href");var aAddress=$(this).find(".streetText").text()+"
"+$(this).find(".zipcodePickup").text();var aLat=$(this).data("latitude");var aLon=$(this).data("longitude");leafletItems.push({id:aId,name:aName,link:aLink,address:aAddress,lat:aLat,lon:aLon})});if(leafletItems[0].lat&&leafletItems[0].lon)leafletStartMap(leafletItems[0].lat,leafletItems[0].lon,true)}})};var leafletMarker=new Array;var leafletItems=[];function leafletDelMarkers(){for(i=0;iOpenStreetMap contributors'}).addTo(mymap);isLoaded=true;isWaitingEnd=true}$(".loadingPoints").remove();for(i=0;i`+stocks_list_more_txt+``+stocks_list_choose+``;let addressTxt="";if(leafletItems[i].address.street!=undefined){addressTxt=`
`+leafletItems[i].address.street+` `+leafletItems[i].address.buildingAndHouseNumber+` `+leafletItems[i].address.city+`
`}else{addressTxt=`
`+leafletItems[i].address+`
`}let button_text=``+leafletItems[i].name+`
`+addressTxt+`
`+href;markersList.push(leafletItems[i].id);markers[leafletItems[i].id]=L.marker([leafletItems[i].lat,leafletItems[i].lon],{icon:newMarkerIcon}).addTo(mymap).on("click",leafletOnClick).bindPopup(button_text)}mymap.setView(new L.LatLng(lat,long));let pointId=$(".asideContainer_pickup label.pickup_point").eq(0).attr("data-id");$('.asideContainer_pickup input[value="'+pointId+'"]').click();$("img.leaflet-marker-icon").each(function(){var href=$(this).attr("src");var href_prev=href.includes("preview/");if(href_prev)href=href.replace("preview/","");var href_2x=href.includes("marker-icon");if(href_2x)href=href.replace("-2x","");$(this).attr("src",href)})};var timeoutLeafLet=null;$(document).on("input","#autocomplete_location.autocomplete_nomap",function(){var that=$(this);clearTimeout(timeoutLeafLet);timeoutLeafLet=setTimeout(function(){if(that.val().length>3){leafletGetLocation(that.val())}},500)});$(document).off("click.suggestions").on("click.suggestions",".leafleat-suggestions div",function(){$("#autocomplete_location").val($(this).text());$(".leafleat-suggestions").remove();const lat=$(this).attr("data-lat");const lon=$(this).attr("data-lon");leafletDelMarkers();selected_pickup_point={};leafletGetPickups(lat,lon)});$(document).on("click",".map_button_search > .pickup_search_here_leaflet",function(){var cords=mymap.getCenter();var zoom=mymap.getZoom();leafletDelMarkers();selected_pickup_point={};leafletGetPickups(cords.lat,cords.lng,zoom)});$(document).on("click",'#pickup_site [name="pickup_point"], #pickup_site [name="stock"]',function(){const id=$(this).val();if(markers[id]){let thatMarkerCoords=markers[id].getLatLng();mymap.setView(new L.LatLng(thatMarkerCoords.lat,thatMarkerCoords.lng));markers[id].openPopup()}});var leafletGetCoords=function(address){let mymapLat="",mymapLong="";if(address){$.get(location.protocol+"//nominatim.openstreetmap.org/search?format=json&q="+address,function(data){if(!jQuery.isEmptyObject(data)){mymapLat=data[0].lat;mymapLong=data[0].lon;leafletGetPickups(mymapLat,mymapLong)}else{if($(".asideContainer_pickup label.pickup_point").length){$(".asideContainer_pickup label.pickup_point").each(function(){var aId=$(this).data("id");var aName=$(this).find(".headerText").text();var aLink=$(this).find(".map_dir").attr("href");var aAddress=$(this).find(".streetText").text()+"
"+$(this).find(".zipcodePickup").text();var aLat=$(this).data("latitude");var aLon=$(this).data("longitude");leafletItems.push({id:aId,name:aName,link:aLink,address:aAddress,lat:aLat,lon:aLon})});leafletStartMap(leafletItems[0].lat,leafletItems[0].lon,true)}if($("div.asideContainer_pickup .menu_messages_message").length)$("div.asideContainer_pickup .menu_messages_message").remove();$("div.asideContainer_pickup").prepend('")}})}else{if($(".asideContainer_pickup label.pickup_point").length){$(".asideContainer_pickup label.pickup_point").each(function(){var aId=$(this).data("id");var aName=$(this).find(".headerText").text();var aLink=$(this).find(".map_dir").attr("href");var aAddress=$(this).find(".streetText").text()+"
"+$(this).find(".zipcodePickup").text();var aLat=$(this).data("latitude");var aLon=$(this).data("longitude");leafletItems.push({id:aId,name:aName,link:aLink,address:aAddress,lat:aLat,lon:aLon})});leafletStartMap(leafletItems[0].lat,leafletItems[0].lon,true)}}};var leafletGetLocation=function(address){$.get(location.protocol+"//nominatim.openstreetmap.org/search?format=json&q="+address,function(data){if(!jQuery.isEmptyObject(data)){$("#locationField").append('
');for(i in data){$(".leafleat-suggestions").append('
'+data[i].display_name+"
")}}else{leafletStartMap(53.428,14.552,true);if($("div.asideContainer_pickup .menu_messages_message").length)$("div.asideContainer_pickup .menu_messages_message").remove();$("div.asideContainer_pickup").prepend('")}})};var leafletGetTextLocation=function(){$("#mymap").prepend(`
${}...
`);var text=$("#autocomplete_location").val();selected_pickup_point={};$.get(location.protocol+"//nominatim.openstreetmap.org/search?format=json&q="+text,function(data){if(!jQuery.isEmptyObject(data)){leafletDelMarkers();leafletGetPickups(data[0].lat,data[0].lon);$("#autocomplete_location").val(data[0].display_name)}else{if(text.search(",")){var srp=text.split(",");var new_address=srp[srp.length-1].trim();leafletGetCoords(new_address)}if($("div.asideContainer_pickup .menu_messages_message").length)$("div.asideContainer_pickup .menu_messages_message").remove();$("div.asideContainer_pickup").prepend('")}})};app_shop.run(function(){if($("#autocomplete_location").length&&$("#autocomplete_location").val()!=""){let leafletAddress=$("#autocomplete_location").val();leafletGetCoords(leafletAddress)}else{leafletGetCoords(false)}},"all","#mymap");app_shop.run(function(){$("#mymap").before($(".map_button_search"))},1,"#mymap");app_shop.run(function(){$("#mymap").prepend($(".map_button_search"))},[2,3,4],"#mymap");!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";var i=Object.freeze;function h(t){var i,e,n,o;for(e=1,n=arguments.length;e=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=R(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=R(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.xi.y&&n.y=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=D(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=D(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lati.lng&&n.lng';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}();function Bt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var At=(Object.freeze||Object)({ie:it,ielt9:et,edge:nt,webkit:ot,android:st,android23:rt,androidStock:ht,opera:ut,chrome:lt,gecko:ct,safari:_t,phantom:dt,opera12:pt,win:mt,ie3d:ft,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:xt,mobileWebkit:wt,mobileWebkit3d:Pt,msPointer:Lt,pointer:bt,touch:Tt,mobileOpera:zt,mobileGecko:Mt,retina:Ct,passiveEvents:Et,canvas:St,svg:Zt,vml:kt}),It=Lt?"MSPointerDown":"pointerdown",Ot=Lt?"MSPointerMove":"pointermove",Rt=Lt?"MSPointerUp":"pointerup",Nt=Lt?"MSPointerCancel":"pointercancel",Dt=["INPUT","SELECT","OPTION"],jt={},Wt=!1,Ht=0;function Ft(t,i,e,n){return"touchstart"===i?function(t,i,e){var n=a(function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Dt.indexOf(t.target.tagName)<0))return;ji(t)}Gt(t,i)});t["_leaflet_touchstart"+e]=n,t.addEventListener(It,n,!1),Wt||(document.documentElement.addEventListener(It,Ut,!0),document.documentElement.addEventListener(Ot,Vt,!0),document.documentElement.addEventListener(Rt,qt,!0),document.documentElement.addEventListener(Nt,qt,!0),Wt=!0)}(t,e,n):"touchmove"===i?function(t,i,e){function n(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Gt(t,i)}t["_leaflet_touchmove"+e]=n,t.addEventListener(Ot,n,!1)}(t,e,n):"touchend"===i&&function(t,i,e){function n(t){Gt(t,i)}t["_leaflet_touchend"+e]=n,t.addEventListener(Rt,n,!1),t.addEventListener(Nt,n,!1)}(t,e,n),this}function Ut(t){jt[t.pointerId]=t,Ht++}function Vt(t){jt[t.pointerId]&&(jt[t.pointerId]=t)}function qt(t){delete jt[t.pointerId],Ht--}function Gt(t,i){for(var e in t.touches=[],jt)t.touches.push(jt[e]);t.changedTouches=[t],i(t)}var Kt=Lt?"MSPointerDown":bt?"pointerdown":"touchstart",Yt=Lt?"MSPointerUp":bt?"pointerup":"touchend",Xt="_leaflet_";function Jt(t,o,i){var s,r,a=!1;function e(t){var i;if(bt){if(!nt||"mouse"===t.pointerType)return;i=Ht}else i=t.touches.length;if(!(1this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,D(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},panInside:function(t,i){var e=I((i=i||{}).paddingTopLeft||i.padding||[0,0]),n=I(i.paddingBottomRight||i.padding||[0,0]),o=this.getCenter(),s=this.project(o),r=this.project(t),a=this.getPixelBounds(),h=a.getSize().divideBy(2),u=R([a.min.add(e),a.max.subtract(n)]);if(!u.contains(r)){this._enforcingBounds=!0;var l=s.subtract(r),c=I(r.x+l.x,r.y+l.y);(r.xu.max.x)&&(c.x=s.x-l.x,0u.max.y)&&(c.y=s.y-l.y,0=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,n=[],o="mouseout"===i||"mouseover"===i,s=t.target||t.srcElement,r=!1;s;){if((e=this._targets[u(s)])&&("click"===i||"preclick"===i)&&!t._simulated&&this._draggableMoved(e)){r=!0;break}if(e&&e.listens(i,!0)){if(o&&!Yi(s,t))break;if(n.push(e),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Yi(s,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Ki(t)){var i=t.type;"mousedown"!==i&&"keypress"!==i&&"keyup"!==i&&"keydown"!==i||Mi(t.target||t.srcElement),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,e){if("click"===t.type){var n=h({},t);n.type="preclick",this._fireDOMEvent(n,n.type,e)}if(!t._stopped&&(e=(e||[]).concat(this._findEventTargets(t,i))).length){var o=e[0];"contextmenu"===i&&o.listens(i,!0)&&ji(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var r=o.getLatLng&&(!o._radius||o._radius<=10);s.containerPoint=r?this.latLngToContainerPoint(o.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=r?o.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var a=0;athis.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o))&&(M(function(){this._moveStart(!0,!1)._animateZoom(t,i,!0)},this),!0)},_animateZoom:function(t,i,e,n){this._mapPane&&(e&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,mi(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:n}),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&fi(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),M(function(){this._moveEnd(!0)},this))}});function Qi(t){return new te(t)}var te=S.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return mi(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(li(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((i=document.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=n):i=this._createRadioElement("leaflet-base-layers_"+u(this),n),this._layerControlInputs.push(i),i.layerId=u(t.layer),ki(i,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return e.appendChild(s),s.appendChild(i),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=e.length-1;0<=s;s--)t=e[s],i=this._getLayer(t.layerId).layer,t.checked?n.push(i):t.checked||o.push(i);for(s=0;si.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ee=te.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=ui("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){var s=ui("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),Di(s),ki(s,"click",Wi),ki(s,"click",o,this),ki(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";fi(this._zoomInButton,i),fi(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMinZoom()||mi(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMaxZoom()||mi(this._zoomInButton,i)}});$i.mergeOptions({zoomControl:!0}),$i.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ee,this.addControl(this.zoomControl))});var ne=te.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i="leaflet-control-scale",e=ui("div",i),n=this.options;return this._addScales(n,i+"-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=ui("div",i,e)),t.imperial&&(this._iScale=ui("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;5280Leaflet'},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var i in(t.attributionControl=this)._container=ui("div","leaflet-control-attribution"),Di(this._container),t._layers)t._layers[i].getAttribution&&this.addAttribution(t._layers[i].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t=[];for(var i in this._attributions)this._attributions[i]&&t.push(i);var e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(" | ")}}});$i.mergeOptions({attributionControl:!0}),$i.addInitHook(function(){this.options.attributionControl&&(new oe).addTo(this)});te.Layers=ie,te.Zoom=ee,te.Scale=ne,te.Attribution=oe,Qi.layers=function(t,i,e){return new ie(t,i,e)},Qi.zoom=function(t){return new ee(t)},Qi.scale=function(t){return new ne(t)},Qi.attribution=function(t){return new oe(t)};var se=S.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});se.addTo=function(t,i){return t.addHandler(i,this),this};var re,ae={Events:Z},he=Tt?"touchstart mousedown":"mousedown",ue={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},le={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},ce=k.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){p(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(ki(this._dragStartTarget,he,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ce._dragging===this&&this.finishDrag(),Ai(this._dragStartTarget,he,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!pi(this._element,"leaflet-zoom-anim")&&!(ce._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((ce._dragging=this)._preventOutline&&Mi(this._element),Ti(),Qt(),this._moving)))){this.fire("down");var i=t.touches?t.touches[0]:t,e=Ei(this._element);this._startPoint=new B(i.clientX,i.clientY),this._parentScale=Si(e),ki(document,le[t.type],this._onMove,this),ki(document,ue[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&1i.max.x&&(e|=2),t.yi.max.y&&(e|=8),e}function ge(t,i,e,n){var o,s=i.x,r=i.y,a=e.x-s,h=e.y-r,u=a*a+h*h;return 0this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(u=!u);return u||je.prototype._containsPoint.call(this,t,!0)}});var He=ke.extend({initialize:function(t,i){p(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=v(t)?t:t.features;if(o){for(i=0,e=o.length;iu.x&&(l=s.x+n-u.x+h.x),s.x-l-a.x<0&&(l=s.x-a.x),s.y+e+h.y>u.y&&(c=s.y+e-u.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c])}},_onCloseButtonClick:function(t){this._close(),Wi(t)},_getAnchor:function(){return I(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});$i.mergeOptions({closePopupOnClick:!0}),$i.include({openPopup:function(t,i,e){return t instanceof sn||(t=new sn(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Se.include({bindPopup:function(t,i){return t instanceof sn?(p(t,i),(this._popup=t)._source=this):(this._popup&&!i||(this._popup=new sn(i,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,i){return this._popup&&this._map&&(i=this._popup._prepareOpen(this,t,i),this._map.openPopup(this._popup,i)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var i=t.layer||t.target;this._popup&&this._map&&(Wi(t),i instanceof Re?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===i?this.closePopup():this.openPopup(i,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var rn=on.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){on.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){on.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=on.prototype.getEvents.call(this);return Tt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ui("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i=this._map,e=this._container,n=i.latLngToContainerPoint(i.getCenter()),o=i.layerPointToContainerPoint(t),s=this.options.direction,r=e.offsetWidth,a=e.offsetHeight,h=I(this.options.offset),u=this._getAnchor();t="top"===s?t.add(I(-r/2+h.x,-a+h.y+u.y,!0)):"bottom"===s?t.subtract(I(r/2-h.x,-h.y,!0)):"center"===s?t.subtract(I(r/2+h.x,a/2-u.y+h.y,!0)):"right"===s||"auto"===s&&o.xthis.options.maxZoom||ethis.options.maxZoom||void 0!==this.options.minZoom&&oe.max.x)||!i.wrapLat&&(t.ye.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return D(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),o=n.add(e);return[i.unproject(n,t.z),i.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var i=this._tileCoordsToNwSe(t),e=new N(i[0],i[1]);return this.options.noWrap||(e=this._map.wrapLatLngBounds(e)),e},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var i=t.split(":"),e=new B(+i[0],+i[1]);return e.z=+i[2],e},_removeTile:function(t){var i=this._tiles[t];i&&(li(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){mi(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=l,t.onmousemove=l,et&&this.options.opacity<1&&yi(t,this.options.opacity),st&&!rt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,i){var e=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),a(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&M(a(this._tileReady,this,t,null,o)),Pi(o,e),this._tiles[n]={el:o,coords:t,current:!0},i.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,i,e){i&&this.fire("tileerror",{error:i,tile:e,coords:t});var n=this._tileCoordsToKey(t);(e=this._tiles[n])&&(e.loaded=+new Date,this._map._fadeAnimated?(yi(e.el,0),C(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(e.active=!0,this._pruneTiles()),i||(mi(e.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:e.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new B(this._wrapX?r(t.x,this._wrapX):t.x,this._wrapY?r(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new O(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var un=hn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,i){this._url=t,(i=p(this,i)).detectRetina&&Ct&&0')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),fn={_initContainer:function(){this._container=ui("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(_n.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=mn("shape");mi(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=mn("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[u(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;li(i),t.removeInteractiveTarget(i),delete this._layers[u(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i||(i=t._stroke=mn("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=v(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e||(e=t._fill=mn("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){_i(t._container)},_bringToBack:function(t){di(t._container)}},gn=kt?mn:$,vn=_n.extend({getEvents:function(){var t=_n.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=gn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=gn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){li(this._container),Ai(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){_n.prototype._update.call(this);var t=this._bounds,i=t.getSize(),e=this._container;this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),Pi(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update")}},_initPath:function(t){var i=t._path=gn("path");t.options.className&&mi(i,t.options.className),t.options.interactive&&mi(i,"leaflet-interactive"),this._updateStyle(t),this._layers[u(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){li(t._path),t.removeInteractiveTarget(t._path),delete this._layers[u(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,e=t.options;i&&(e.stroke?(i.setAttribute("stroke",e.color),i.setAttribute("stroke-opacity",e.opacity),i.setAttribute("stroke-width",e.weight),i.setAttribute("stroke-linecap",e.lineCap),i.setAttribute("stroke-linejoin",e.lineJoin),e.dashArray?i.setAttribute("stroke-dasharray",e.dashArray):i.removeAttribute("stroke-dasharray"),e.dashOffset?i.setAttribute("stroke-dashoffset",e.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),e.fill?(i.setAttribute("fill",e.fillColor||e.color),i.setAttribute("fill-opacity",e.fillOpacity),i.setAttribute("fill-rule",e.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,Q(t._parts,i))},_updateCircle:function(t){var i=t._point,e=Math.max(Math.round(t._radius),1),n="a"+e+","+(Math.max(Math.round(t._radiusY),1)||e)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,o)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){_i(t._path)},_bringToBack:function(t){di(t._path)}});function yn(t){return Zt||kt?new vn(t):null}kt&&vn.include(fn),$i.include({getRenderer:function(t){var i=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return i||(i=this._renderer=this._createRenderer()),this.hasLayer(i)||this.addLayer(i),i},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=this._createRenderer({pane:t}),this._paneRenderers[t]=i),i},_createRenderer:function(t){return this.options.preferCanvas&&pn(t)||yn(t)}});var xn=We.extend({initialize:function(t,i){We.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=D(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});vn.create=gn,vn.pointsToPath=Q,He.geometryToLayer=Fe,He.coordsToLatLng=Ve,He.coordsToLatLngs=qe,He.latLngToCoords=Ge,He.latLngsToCoords=Ke,He.getFeature=Ye,He.asFeature=Xe,$i.mergeOptions({boxZoom:!0});var wn=se.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ki(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ai(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){li(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Qt(),Ti(),this._startPoint=this._map.mouseEventToContainerPoint(t),ki(document,{contextmenu:Wi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ui("div","leaflet-zoom-box",this._container),mi(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var i=new O(this._point,this._startPoint),e=i.getSize();Pi(this._box,i.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(li(this._box),fi(this._container,"leaflet-crosshair")),ti(),zi(),Ai(document,{contextmenu:Wi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var i=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(i).fire("boxzoomend",{boxZoomBounds:i})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});$i.addInitHook("addHandler","boxZoom",wn),$i.mergeOptions({doubleClickZoom:!0});var Pn=se.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,o=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(o):i.setZoomAround(t.containerPoint,o)}});$i.addInitHook("addHandler","doubleClickZoom",Pn),$i.mergeOptions({dragging:!0,inertia:!rt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Ln=se.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new ce(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}mi(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){fi(this._map._container,"leaflet-grab"),fi(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var i=D(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(i.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(i.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(e),this._times.push(i),this._prunePositions(i)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1i.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,s=(n+i+e)%t-i-e,r=Math.abs(o+e)i.getMaxZoom()&&1 @@ -103,7 +103,7 @@ function loadMap() { `; - // funkcja wyszukująca markery na mapie + // Funkcja wyszukująca markery na mapie function runSearchPickup() { if (typeof mymap !== 'undefined') { mymap.eachLayer(function (layer) { @@ -185,7 +185,7 @@ function loadMap() { if (window.innerWidth < 757) document.getElementById("pickup_list_form").insertAdjacentElement("beforebegin",document.querySelector('.map_button_search')); if (!oscItem.querySelector('.fselectedPoint')) oscItem.insertAdjacentHTML("beforeend",``); - // wyszukiwanie punktów odbioru na mapie + // Wyszukiwanie punktów odbioru na mapie if (finpostjs) { pickup_sites.courierId = ITEM_ID; runSearchPickup(); @@ -204,7 +204,7 @@ function loadMap() { const selectedPoint = document.querySelector('[name="shipping"]:checked').closest('.osc_item').querySelector('.fselectedPoint'); selectedPoint.innerHTML = ""; - // utworzenie informacji o punkcie odbioru + // Utworzenie informacji o punkcie odbioru const deliveryId = document.querySelector('[name="pickup_point"]:checked').value; const chosenPoint = document.querySelector(`.asideContainer_pickup label[data-id="${deliveryId}"]`); const pickupName = chosenPoint.querySelector(".headerText").innerHTML; @@ -225,7 +225,7 @@ function loadMap() { } deliveryPickupPoints.forEach(point => createEventsInpost(point)); } -// zamknięcie mapy +// Zamknięcie mapy function closeMap(){ document.getElementById("fbs_z02_cover").style.display = "none"; enablePageScroll(); @@ -237,7 +237,7 @@ function getAddressInfo(query){ }; return document.getElementById(`client_${query}`).value; } -// utworzenie informacji o punkcie odbioru +// Utworzenie informacji o punkcie odbioru function createPickuppointInfo(selectedPoint, deliveryPointId, name, streetText, cityText, zipcodeText, courierId){ // Pokazanie elementu fselectedPoint selectedPoint.style.display = "block"; @@ -286,7 +286,7 @@ function toggleMapList(e){ e.target.dataset.show = ifList ? "map" : "list"; } -/////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// // DANE KLIENTA document.getElementById("cop_seection1").addEventListener("click", (e) => { @@ -368,10 +368,10 @@ function showDeliveryForm(style){ const deliveryWrapper = document.querySelector(".ajax_cop #client_new_additional .delivery_box.cn_wrapper"); if((style && deliveryWrapper.classList.contains("--more")) || (!style && !deliveryWrapper.classList.contains("--more"))) return; - // formularz dostawy na inny adres + // Formularz dostawy na inny adres style ? deliveryWrapper.classList.add("--more") : deliveryWrapper.classList.remove("--more"); - // przycisk od wybierania z listy adresów + // Przycisk od wybierania z listy adresów listBtn = document.querySelector(".delivery__address-list-button"); if(listBtn) style ? listBtn.classList.add("--fade-in") : listBtn.classList.remove("--fade-in"); @@ -414,7 +414,7 @@ function handleClickAddressList(e){ changeRegion(); } - // nadanie klasy aktywnemu adresowi + // Nadanie klasy aktywnemu adresowi e.target.closest("ul").querySelectorAll("li").forEach(el => el.classList.remove("--active-address")); addressLi.classList.add("--active-address"); @@ -498,20 +498,20 @@ function getClientNew(){ }); }; -///////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////// // WALIDACJA -// wyczyść klasy walidacji +// Wyczyść klasy walidacji function clearValidation(input){ const wrapper = input.closest(".has-feedback") wrapper.classList.remove('--success', '--error', 'has-error', 'has-success'); }; -// wyczyść wiadomość błędu +// Wyczyść wiadomość błędu function removeErrorMessage(input) { const valMessage = input.closest('.has-feedback').querySelector('.validate_message'); if(valMessage) valMessage.remove(); }; -// dodaj klasy błędu +// Dodaj klasy błędu function addError(input){ clearValidation(input); removeErrorMessage(input); @@ -519,7 +519,7 @@ function addError(input){ clearValidation(wrapper); wrapper.classList.add('--error', 'has-error'); }; -// dodaj klasy sukcesu +// Dodaj klasy sukcesu function addSuccess(input){ clearValidation(input); removeErrorMessage(input); @@ -527,12 +527,12 @@ function addSuccess(input){ clearValidation(wrapper); wrapper.classList.add('--success', 'has-success'); }; -// dodaj error wraz z wiadomością +// Dodaj error wraz z wiadomością function addErrorMessage(input, message){ addError(input); input.closest('.has-feedback').insertAdjacentHTML("beforeend",`${message}.`); } -// waliduj elementy wymagające wysłania requesta (zipcode, nip) +// Waliduj elementy wymagające wysłania requesta (zipcode, nip) async function validateRequest(target, order=false){ const wrapper = target.closest(".has-feedback"); let reqData = `${target.name}=${target.value}`; @@ -632,14 +632,14 @@ function handleShowSigninModalFromEmailModal(e){ showSigninModal(); } -// event listener zmian w kontenerze cop_seection1 +// EventListener zmian w kontenerze cop_seection1 const validateRequestId = ["client_zipcode", "delivery_zipcode", "client_nip", "client_email"]; const notEmptyFieldsId = ["client_firstname", "client_lastname", "client_city", "delivery_firstname", "delivery_lastname", "delivery_city", "client_firm"]; document.getElementById("cop_seection1").addEventListener("change", (e) => { - // walidacja zipcode, nipu i emaila + // Walidacja zipcode, nipu i emaila if(validateRequestId.includes(e.target.id)) return validateRequest(e.target); - // zmiana regionu + // Zmiana regionu if(e.target.name === "client_region" || e.target.name === "delivery_region") { const clientType = e.target.name.split("_")[0]; validateRequest(document.getElementById(`${clientType}_zipcode`)); @@ -664,7 +664,7 @@ document.getElementById("cop_seection1").addEventListener("change", (e) => { else clearValidation(e.target); }; }); -// funkcje walidacji poszczególnych elementów +// Funkcje walidacji poszczególnych elementów function validateStreet(streetEl){ const streetParts = streetEl.value.split(" "); const addressNumber = Number(streetParts[streetParts.length-1][0]); @@ -739,7 +739,7 @@ document.querySelector("body").addEventListener("change", (e) => { } }) -/////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////// // DOSTAWA I PŁATNOSĆI const SET_REGION = (setRegionInput) => JSON.stringify({ @@ -780,7 +780,7 @@ async function changeRegion(payAndDelData = null, firstLoad = false) { getNewPaymentsAndDeliveries(payAndDelData, firstLoad); }; -// załadowanie metod dostaw i płatności +// Załadowanie metod dostaw i płatności function getNewPaymentsAndDeliveries(data = null, firstLoad = false) { console.log("fn: order1_new"); // Wyczyszczenie zapisanych poprzednich metod płatności @@ -864,7 +864,7 @@ function getNewPaymentsAndDeliveries(data = null, firstLoad = false) { } else{ prepaidsMethodMarkup += markup; - // okienko vouchera + // Okienko vouchera if(method.id === 2){ prepaidsMethodMarkup += `
@@ -941,13 +941,13 @@ function getNewPaymentsAndDeliveries(data = null, firstLoad = false) { cloneElement(document.getElementById(paymentMethodId)); } - // poprzednia dostawa + // Poprzednia dostawa const prevDeliveryMethod = JSON.parse(localStorage.getItem("prevDeliveryMethod")); const prevDeliveryInput = document.querySelector(`input#${prevDeliveryMethod.id}`); - // Sprawdzenie czy istnieje metoda płatności(na wypadek gdyby była usunięta lub klient zamawiał do innego kraju) + // Sprawdzenie czy istnieje metoda dostawy (na wypadek gdyby była usunięta lub klient zamawiał do innego kraju) if(prevDeliveryInput){ - // sprawdzenie czy dostawa miała punkt odbioru + // Sprawdzenie czy dostawa miała punkt odbioru if(prevDeliveryMethod.fselectedPoint){ checkPrevPickupPoint( prevDeliveryInput.parentElement.querySelector(".fselectedPoint"), @@ -1003,7 +1003,7 @@ function createPaymentContainerMarkup(method){ // Przygotowanie html dla metod dostaw function prepareDeliveryMarkup(method, deliveryId){ - // zapisanie do listy dostaw z mapą + // Zapisanie do listy dostaw z mapą if (method.pickuppoint === "y" && !deliveryPickupPoints.includes(method.id)) deliveryPickupPoints.push(method.id); const cost = Number(method.cost) === 0 ? : method.cost_formatted; const disabled = method.minworthreached === "false" ? 'disabled="disabled"' : ""; @@ -1015,7 +1015,7 @@ function prepareDeliveryMarkup(method, deliveryId){ date.setDate(date.getDate()+method.time); const deliveryDate = date.toLocaleDateString('en-GB').replaceAll("/", "."); - // uzupełnienie markupa dla metod dostaw dvp + // Uzupełnienie markupa dla metod dostaw dvp return `