Files
2024-10-25 14:16:28 +02:00

4 lines
98 KiB
JavaScript

var SensbitFedexMapWidget;!function(){"use strict";"undefined"==typeof SensbitFedexMapWidget?(SensbitFedexMapWidget=function(){function a(b,c){b.getMarkerClusterer().extend(a,google.maps.OverlayView),this.cluster_=b,this.className_=b.getMarkerClusterer().getClusterClass(),this.styles_=c,this.center_=null,this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(b.getMap())}function b(b){this.markerClusterer_=b,this.map_=b.getMap(),this.gridSize_=b.getGridSize(),this.minClusterSize_=b.getMinimumClusterSize(),this.averageCenter_=b.getAverageCenter(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new a(this,b.getStyles())}function c(a,b,d){this.extend(c,google.maps.OverlayView),b=b||[],d=d||{},this.markers_=[],this.clusters_=[],this.listeners_=[],this.activeMap_=null,this.ready_=!1,this.gridSize_=d.gridSize||60,this.minClusterSize_=d.minimumClusterSize||2,this.maxZoom_=d.maxZoom||null,this.styles_=d.styles||[],this.title_=d.title||"",this.zoomOnClick_=!0,void 0!==d.zoomOnClick&&(this.zoomOnClick_=d.zoomOnClick),this.averageCenter_=!1,void 0!==d.averageCenter&&(this.averageCenter_=d.averageCenter),this.ignoreHidden_=!1,void 0!==d.ignoreHidden&&(this.ignoreHidden_=d.ignoreHidden),this.enableRetinaIcons_=!1,void 0!==d.enableRetinaIcons&&(this.enableRetinaIcons_=d.enableRetinaIcons),this.imagePath_=d.imagePath||c.IMAGE_PATH,this.imageExtension_=d.imageExtension||c.IMAGE_EXTENSION,this.imageSizes_=d.imageSizes||c.IMAGE_SIZES,this.calculator_=d.calculator||c.CALCULATOR,this.batchSize_=d.batchSize||c.BATCH_SIZE,this.batchSizeIE_=d.batchSizeIE||c.BATCH_SIZE_IE,this.clusterClass_=d.clusterClass||"cluster",navigator.userAgent.toLowerCase().indexOf("msie")!==-1&&(this.batchSize_=this.batchSizeIE_),this.setupStyles_(),this.addMarkers(b,!0),this.setMap(a)}function d(a,b){for(var c=0,d=a;c<d.length;c++){var e=d[c];if(b(e))return e}return null}function e(a,b){return!!d(a,b)}function f(a,b){for(var c=[],d=0,e=a;d<e.length;d++){var f=e[d];c.push(b(f))}return c}function g(a,b){return a.classList?a.classList.contains(b):new RegExp("(^| )"+b+"( |$)","gi").test(a.className)}function h(a,b){a&&(a.classList?a.classList.add(b):a.className+=" "+b)}function i(a,b){a&&(a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp("(^|\\b)"+b.split(" ").join("|")+"(\\b|$)","gi")," "))}function j(a){return a.operator+"/"+a.code}a.prototype.onAdd=function(){var a,b,c=this,d=google.maps.version.split(".");d=parseInt(100*d[0],10)+parseInt(d[1],10),this.div_=document.createElement("div"),this.div_.className=this.className_,this.visible_&&this.show(),this.getPanes().overlayMouseTarget.appendChild(this.div_),this.boundsChangedListener_=google.maps.event.addListener(this.getMap(),"bounds_changed",function(){b=a}),google.maps.event.addDomListener(this.div_,"mousedown",function(){a=!0,b=!1}),d>=332&&google.maps.event.addDomListener(this.div_,"touchstart",function(a){a.stopPropagation()}),google.maps.event.addDomListener(this.div_,"click",function(d){if(a=!1,!b){var e,f,g=c.cluster_.getMarkerClusterer();google.maps.event.trigger(g,"click",c.cluster_),google.maps.event.trigger(g,"clusterclick",c.cluster_),g.getZoomOnClick()&&(f=g.getMaxZoom(),e=c.cluster_.getBounds(),g.getMap().fitBounds(e),setTimeout(function(){g.getMap().fitBounds(e),null!==f&&g.getMap().getZoom()>f&&g.getMap().setZoom(f+1)},100)),d.cancelBubble=!0,d.stopPropagation&&d.stopPropagation()}}),google.maps.event.addDomListener(this.div_,"mouseover",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseover",c.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseout",c.cluster_)})},a.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},a.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px",this.div_.style.left=a.x+"px",this.div_.style.zIndex=google.maps.Marker.MAX_ZINDEX+1}},a.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},a.prototype.show=function(){if(this.div_){var a="",b=this.backgroundPosition_.split(" "),c=parseInt(b[0].replace(/^\s+|\s+$/g,""),10),d=parseInt(b[1].replace(/^\s+|\s+$/g,""),10),e=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(e),a="<img src='"+this.url_+"' style='position: absolute; top: "+d+"px; left: "+c+"px; ",a+=this.cluster_.getMarkerClusterer().enableRetinaIcons_?"width: "+this.width_+"px; height: "+this.height_+"px;":"clip: rect("+-1*d+"px, "+(-1*c+this.width_)+"px, "+(-1*d+this.height_)+"px, "+-1*c+"px);",a+="'>",this.div_.innerHTML=a+"<div style='position: absolute;top: "+this.anchorText_[0]+"px;left: "+this.anchorText_[1]+"px;color: "+this.textColor_+";font-size: "+this.textSize_+"px;font-family: "+this.fontFamily_+";font-weight: "+this.fontWeight_+";font-style: "+this.fontStyle_+";text-decoration: "+this.textDecoration_+";text-align: center;width: "+this.width_+"px;line-height:"+this.height_+"px;'>"+this.sums_.text+"</div>","undefined"==typeof this.sums_.title||""===this.sums_.title?this.div_.title=this.cluster_.getMarkerClusterer().getTitle():this.div_.title=this.sums_.title,this.div_.style.display=""}this.visible_=!0},a.prototype.useStyle=function(a){this.sums_=a;var b=Math.max(0,a.index-1);b=Math.min(this.styles_.length-1,b);var c=this.styles_[b];this.url_=c.url,this.height_=c.height,this.width_=c.width,this.anchorText_=c.anchorText||[0,0],this.anchorIcon_=c.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)],this.textColor_=c.textColor||"black",this.textSize_=c.textSize||11,this.textDecoration_=c.textDecoration||"none",this.fontWeight_=c.fontWeight||"bold",this.fontStyle_=c.fontStyle||"normal",this.fontFamily_=c.fontFamily||"Arial,sans-serif",this.backgroundPosition_=c.backgroundPosition||"0 0"},a.prototype.setCenter=function(a){this.center_=a},a.prototype.createCss=function(a){var b=[];return b.push("cursor: pointer;"),b.push("position: absolute; top: "+a.y+"px; left: "+a.x+"px;"),b.push("width: "+this.width_+"px; height: "+this.height_+"px;"),b.push("-webkit-user-select: none;"),b.push("-khtml-user-select: none;"),b.push("-moz-user-select: none;"),b.push("-o-user-select: none;"),b.push("user-select: none;"),b.join("")},a.prototype.getPosFromLatLng_=function(a){var b=this.getProjection().fromLatLngToDivPixel(a);return b.x-=this.anchorIcon_[1],b.y-=this.anchorIcon_[0],b.x=parseInt(b.x,10),b.y=parseInt(b.y,10),b},b.prototype.getSize=function(){return this.markers_.length},b.prototype.getMarkers=function(){return this.markers_},b.prototype.getCenter=function(){return this.center_},b.prototype.getMap=function(){return this.map_},b.prototype.getMarkerClusterer=function(){return this.markerClusterer_},b.prototype.getBounds=function(){var a,b=new google.maps.LatLngBounds(this.center_,this.center_),c=this.getMarkers();for(a=0;a<c.length;a++)b.extend(c[a].getPosition());return b},b.prototype.remove=function(){this.clusterIcon_.setMap(null),this.markers_=[],delete this.markers_},b.prototype.addMarker=function(a){var b,c,d;if(this.isMarkerAlreadyAdded_(a))return!1;if(this.center_){if(this.averageCenter_){var e=this.markers_.length+1,f=(this.center_.lat()*(e-1)+a.getPosition().lat())/e,g=(this.center_.lng()*(e-1)+a.getPosition().lng())/e;this.center_=new google.maps.LatLng(f,g),this.calculateBounds_()}}else this.center_=a.getPosition(),this.calculateBounds_();if(a.isAdded=!0,this.markers_.push(a),c=this.markers_.length,d=this.markerClusterer_.getMaxZoom(),null!==d&&this.map_.getZoom()>d)a.getMap()!==this.map_&&a.setMap(this.map_);else if(c<this.minClusterSize_)a.getMap()!==this.map_&&a.setMap(this.map_);else if(c===this.minClusterSize_)for(b=0;b<c;b++)this.markers_[b].setMap(null);else a.setMap(null);return this.updateIcon_(),!0},b.prototype.isMarkerInClusterBounds=function(a){return this.bounds_.contains(a.getPosition())},b.prototype.calculateBounds_=function(){var a=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(a)},b.prototype.updateIcon_=function(){var a=this.markers_.length,b=this.markerClusterer_.getMaxZoom();if(null!==b&&this.map_.getZoom()>b)return void this.clusterIcon_.hide();if(a<this.minClusterSize_)return void this.clusterIcon_.hide();var c=this.markerClusterer_.getStyles().length,d=this.markerClusterer_.getCalculator()(this.markers_,c);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.useStyle(d),this.clusterIcon_.show()},b.prototype.isMarkerAlreadyAdded_=function(a){var b;if(this.markers_.indexOf)return this.markers_.indexOf(a)!==-1;for(b=0;b<this.markers_.length;b++)if(a===this.markers_[b])return!0;return!1},c.prototype.onAdd=function(){var a=this;this.activeMap_=this.getMap(),this.ready_=!0,this.repaint(),this.prevZoom_=this.getMap().getZoom(),this.listeners_=[google.maps.event.addListener(this.getMap(),"zoom_changed",function(){var a=this.getMap().getZoom(),b=this.getMap().minZoom||0,c=Math.min(this.getMap().maxZoom||100,this.getMap().mapTypes[this.getMap().getMapTypeId()].maxZoom);a=Math.min(Math.max(a,b),c),this.prevZoom_!=a&&(this.prevZoom_=a,this.resetViewport_(!1))}.bind(this)),google.maps.event.addListener(this.getMap(),"idle",function(){a.redraw_()})]},c.prototype.onRemove=function(){var a;for(a=0;a<this.markers_.length;a++)this.markers_[a].getMap()!==this.activeMap_&&this.markers_[a].setMap(this.activeMap_);for(a=0;a<this.clusters_.length;a++)this.clusters_[a].remove();for(this.clusters_=[],a=0;a<this.listeners_.length;a++)google.maps.event.removeListener(this.listeners_[a]);this.listeners_=[],this.activeMap_=null,this.ready_=!1},c.prototype.draw=function(){},c.prototype.setupStyles_=function(){var a,b;if(!(this.styles_.length>0))for(a=0;a<this.imageSizes_.length;a++)b=this.imageSizes_[a],this.styles_.push({url:this.imagePath_+(a+1)+"."+this.imageExtension_,height:b,width:b})},c.prototype.fitMapToMarkers=function(){var a,b=this.getMarkers(),c=new google.maps.LatLngBounds;for(a=0;a<b.length;a++)!b[a].getVisible()&&this.getIgnoreHidden()||c.extend(b[a].getPosition());this.getMap().fitBounds(c)},c.prototype.getGridSize=function(){return this.gridSize_},c.prototype.setGridSize=function(a){this.gridSize_=a},c.prototype.getMinimumClusterSize=function(){return this.minClusterSize_},c.prototype.setMinimumClusterSize=function(a){this.minClusterSize_=a},c.prototype.getMaxZoom=function(){return this.maxZoom_},c.prototype.setMaxZoom=function(a){this.maxZoom_=a},c.prototype.getStyles=function(){return this.styles_},c.prototype.setStyles=function(a){this.styles_=a},c.prototype.getTitle=function(){return this.title_},c.prototype.setTitle=function(a){this.title_=a},c.prototype.getZoomOnClick=function(){return this.zoomOnClick_},c.prototype.setZoomOnClick=function(a){this.zoomOnClick_=a},c.prototype.getAverageCenter=function(){return this.averageCenter_},c.prototype.setAverageCenter=function(a){this.averageCenter_=a},c.prototype.getIgnoreHidden=function(){return this.ignoreHidden_},c.prototype.setIgnoreHidden=function(a){this.ignoreHidden_=a},c.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons_},c.prototype.setEnableRetinaIcons=function(a){this.enableRetinaIcons_=a},c.prototype.getImageExtension=function(){return this.imageExtension_},c.prototype.setImageExtension=function(a){this.imageExtension_=a},c.prototype.getImagePath=function(){return this.imagePath_},c.prototype.setImagePath=function(a){this.imagePath_=a},c.prototype.getImageSizes=function(){return this.imageSizes_},c.prototype.setImageSizes=function(a){this.imageSizes_=a},c.prototype.getCalculator=function(){return this.calculator_},c.prototype.setCalculator=function(a){this.calculator_=a},c.prototype.getBatchSizeIE=function(){return this.batchSizeIE_},c.prototype.setBatchSizeIE=function(a){this.batchSizeIE_=a},c.prototype.getClusterClass=function(){return this.clusterClass_},c.prototype.setClusterClass=function(a){this.clusterClass_=a},c.prototype.getMarkers=function(){return this.markers_},c.prototype.getTotalMarkers=function(){return this.markers_.length},c.prototype.getClusters=function(){return this.clusters_},c.prototype.getTotalClusters=function(){return this.clusters_.length},c.prototype.addMarker=function(a,b){this.pushMarkerTo_(a),b||this.redraw_()},c.prototype.addMarkers=function(a,b){var c;for(c in a)a.hasOwnProperty(c)&&this.pushMarkerTo_(a[c]);b||this.redraw_()},c.prototype.pushMarkerTo_=function(a){if(a.getDraggable()){var b=this;google.maps.event.addListener(a,"dragend",function(){b.ready_&&(this.isAdded=!1,b.repaint())})}a.isAdded=!1,this.markers_.push(a)},c.prototype.removeMarker=function(a,b){var c=this.removeMarker_(a);return!b&&c&&this.repaint(),c},c.prototype.removeMarkers=function(a,b){var c,d,e=!1;for(c=0;c<a.length;c++)d=this.removeMarker_(a[c]),e=e||d;return!b&&e&&this.repaint(),e},c.prototype.removeMarker_=function(a){var b,c=-1;if(this.markers_.indexOf)c=this.markers_.indexOf(a);else for(b=0;b<this.markers_.length;b++)if(a===this.markers_[b]){c=b;break}return c!==-1&&(a.setMap(null),this.markers_.splice(c,1),!0)},c.prototype.clearMarkers=function(){this.resetViewport_(!0),this.markers_=[]},c.prototype.repaint=function(){var a=this.clusters_.slice();this.clusters_=[],this.resetViewport_(!1),this.redraw_(),setTimeout(function(){var b;for(b=0;b<a.length;b++)a[b].remove()},0)},c.prototype.getExtendedBounds=function(a){var b=this.getProjection(),c=new google.maps.LatLng(a.getNorthEast().lat(),a.getNorthEast().lng()),d=new google.maps.LatLng(a.getSouthWest().lat(),a.getSouthWest().lng()),e=b.fromLatLngToDivPixel(c);e.x+=this.gridSize_,e.y-=this.gridSize_;var f=b.fromLatLngToDivPixel(d);f.x-=this.gridSize_,f.y+=this.gridSize_;var g=b.fromDivPixelToLatLng(e),h=b.fromDivPixelToLatLng(f);return a.extend(g),a.extend(h),a},c.prototype.redraw_=function(){this.createClusters_(0)},c.prototype.resetViewport_=function(a){var b,c;for(b=0;b<this.clusters_.length;b++)this.clusters_[b].remove();for(this.clusters_=[],b=0;b<this.markers_.length;b++)c=this.markers_[b],c.isAdded=!1,a&&c.setMap(null)},c.prototype.distanceBetweenPoints_=function(a,b){var c=6371,d=(b.lat()-a.lat())*Math.PI/180,e=(b.lng()-a.lng())*Math.PI/180,f=Math.sin(d/2)*Math.sin(d/2)+Math.cos(a.lat()*Math.PI/180)*Math.cos(b.lat()*Math.PI/180)*Math.sin(e/2)*Math.sin(e/2),g=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),h=c*g;return h},c.prototype.isMarkerInBounds_=function(a,b){return b.contains(a.getPosition())},c.prototype.addToClosestCluster_=function(a){var c,d,e,f,g=4e4,h=null;for(c=0;c<this.clusters_.length;c++)e=this.clusters_[c],f=e.getCenter(),f&&(d=this.distanceBetweenPoints_(f,a.getPosition()),d<g&&(g=d,h=e));h&&h.isMarkerInClusterBounds(a)?h.addMarker(a):(e=new b(this),e.addMarker(a),this.clusters_.push(e))},c.prototype.createClusters_=function(a){var b,c,d,e=this;if(this.ready_){0===a&&(google.maps.event.trigger(this,"clusteringbegin",this),"undefined"!=typeof this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic)),d=this.getMap().getZoom()>3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var f=this.getExtendedBounds(d),g=Math.min(a+this.batchSize_,this.markers_.length);for(b=a;b<g;b++)c=this.markers_[b],!c.isAdded&&this.isMarkerInBounds_(c,f)&&(!this.ignoreHidden_||this.ignoreHidden_&&c.getVisible())&&this.addToClosestCluster_(c);g<this.markers_.length?this.timerRefStatic=setTimeout(function(){e.createClusters_(g)},0):(delete this.timerRefStatic,google.maps.event.trigger(this,"clusteringend",this))}},c.prototype.extend=function(a,b){return function(a){var b;for(b in a.prototype)this.prototype[b]=a.prototype[b];return this}.apply(a,[b])},c.CALCULATOR=function(a,b){for(var c=0,d="",e=a.length.toString(),f=e;0!==f;)f=parseInt(f/10,10),c++;return c=Math.min(c,b),{text:e,index:c,title:d}},c.BATCH_SIZE=2e3,c.BATCH_SIZE_IE=500,c.IMAGE_PATH="https://cdn.rawgit.com/googlemaps/js-marker-clusterer/gh-pages/images/m",c.IMAGE_EXTENSION="png",c.IMAGE_SIZES=[53,56,66,78,90],"object"==typeof module&&(module.exports=c);var k;!function(a){a[a.DELIVERY="DELIVERY"]="DELIVERY",a[a.POSTING="POSTING"]="POSTING"}(k||(k={}));var l,m=function(){function a(a){void 0===a&&(a=!1);var b=a?"https://pos.sandbox-bliskapaczka.pl":"https://pos.bliskapaczka.pl";this.posEndpointUrl=b+"/api/v1/pos",this.requestCounterUrl=a?"https://api.sandbox-bliskapaczka.pl":"https://api.bliskapaczka.pl"}return a.prototype.loadScript=function(a){var b=document.createElement("script");b.type="application/javascript",b.src=a,document.body.appendChild(b)},a.prototype.getPos=function(a,b,c){var d=this.posEndpointUrl+"/"+a;this.xhrRequest(d,"GET",b,c)},a.prototype.listPos=function(a,b,c,d){var e="?operators="+b.join(","),f="&fields=operator,code,latitude,longitude,brand,brandPretty,operatorPretty,cod,available",g=this.posEndpointUrl+e+f;a&&(g+="&posType="+k[a].toLowerCase()),this.xhrRequest(g,"GET",c,d)},a.prototype.countPointSelection=function(a,b){var c=this.requestCounterUrl+"/point/select/"+a+"/"+b;this.xhrRequest(c,"POST",function(){},function(a){return console.error(a)})},a.prototype.xhrRequest=function(a,b,c,d){var e=new XMLHttpRequest;e.open(b,a,!0),e.onload=function(){if(e.readyState==XMLHttpRequest.DONE)if(200==e.status){var a=e.responseText?JSON.parse(e.responseText):null;c(a)}else d&&d(e.responseText)},e.onerror=function(){d(e.responseText)},e.send()},a}(),n=function(){function a(){}return a.asset=function(a){if(a.indexOf('http') !== -1) return a;return "https://widget.bliskapaczka.pl/vppo/" + a},a.posImage=function(a){return"https://pos.bliskapaczka.pl/assets/images/"+a},a.submitButton=function(a){var b=a?"Wybierz":"Wybierz punkt";return'\n <button type="button" class="bp-map-submit-button">\n '+b+"\n </button>\n "},a.submitButtonOrText=function(a,b){return b?this.submitButton(a):"<span>Punkt czasowo niedostępny</span>"},a.addressDescription=function(a){var b=a.postalCode||"";return"\n <address>ul. "+a.street+"<br/>"+b+" "+a.city+"</address>\n "},a.operatorLogo=function(a){var b=this.posImage(a+".png");return'<img src="'+b+'" alt="'+a+'"/>'},a.brandLogo=function(a){var b=this.asset("images/brand/"+a+".png");return'<img src="'+b+'" alt="'+a+'"/>'},a.rwdButtons=function(){var b=a.asset("images/icons/icon_target.svg"),c=a.asset("images/icons/icon_filter.svg");return'<div class="bp-rwd-button" id="BPFindMeRWD">\n <div>\n <img class="bp-rwd-button-icon" src="'+b+'"/>\n </div>\n </div>\n <div class="bp-rwd-button" id="SensbitFedexMapWidgetFiltersButtonRWD">\n <div>\n <img class="bp-rwd-button-icon" src="'+c+'"/>\n </div>\n </div>'},a.footer=function(){var a=this.asset("images/bp_log.svg");return'<div class="bp-footer-content">\n <a href="https://bliskapaczka.pl" target="_blank">\n <img class="bp-footer-logo" src="'+a+'">\n </a>\n <div class="points-count">\n <div id="BPPosCount" class="points-count-label">\n\n </div>\n <div id="BPPosLoader" class="points-count-loader">\n <div class="points-count-label">\n <span>Ładowanie...</span>\n </div>\n <div class="loader">\n <div class="bp-sk-fading-circle">\n <div class="sk-circle1 sk-circle"></div>\n <div class="sk-circle2 sk-circle"></div>\n <div class="sk-circle3 sk-circle"></div>\n <div class="sk-circle4 sk-circle"></div>\n <div class="sk-circle5 sk-circle"></div>\n <div class="sk-circle6 sk-circle"></div>\n <div class="sk-circle7 sk-circle"></div>\n <div class="sk-circle8 sk-circle"></div>\n <div class="sk-circle9 sk-circle"></div>\n <div class="sk-circle10 sk-circle"></div>\n <div class="sk-circle11 sk-circle"></div>\n <div class="sk-circle12 sk-circle"></div>\n </div>\n </div>\n </div>\n </div>\n </div>'},a.parcelPrice=function(a){if(a&&(a.price||0==a.price)){var b=a.price.toFixed(2).replace(".",",");return b+" zł"}return""},a.posType=function(a){return a.deliveryPoint&&!a.postingPoint?'<span class="bp-text-bold">UWAGA!</span> Punkt tylko odbiorczy':a.postingPoint&&!a.deliveryPoint?'<span class="bp-text-bold">UWAGA!</span> Punkt tylko nadawczy':""},a.posTags=function(a){var b="";return a.deliveryPoint&&(b+='<div class="bp-tag">Punkt odbiorczy</div>'),a.postingPoint&&(b+='<div class="bp-tag">Punkt nadawczy</div>'),a.cod&&(b+='<div class="bp-tag">Pobranie</div>'),"INPOST"==a.brand&&(b+='<div class="bp-tag">Dostęp 24h</div>'),b},a.openingHoursDescription=function(a){function b(a){function b(a){for(var b={},c=0,e=d;c<e.length;c++){var f=e[c],g=a[f];b[f]=g?g.from+" - "+g.to:"nieczynne"}return b}function c(a,b){for(var c=a,e=a;e<d.length;e++){var g=d[e],h=f[g];if(b!=h)break;c=e}return c}for(var d=["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"],e=["Pn","Wt","Sr","Czw","Pt","So","Nd"],f=b(a),g="",h=0;h<d.length;h++){var i=d[h],j=f[i],k=c(h,j),l=e[h],m=e[k],n=h!=k?l+"-"+m:l;g+="<div>"+n+": "+j+"</div>",h=k}return"<div>Pn-Nd: 00:00 - 23:59</div>"==g?"Pn-Nd: 24h":g}var c=a.openingHoursMap,d=c&&Object.keys(c).length?b(c):"brak danych";return'\n <div style="font-weight:bold;">Godziny otwarcia: </div>\n <div>\n '+d+"\n </div>\n "},a}(),o=function(){function a(){}return Object.defineProperty(a,"styles",{get:function(){return[{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#322e2d"}]},{featureType:"administrative",elementType:"labels.text.stroke",stylers:[{color:"#fffaf2"},{weight:4.68},{gamma:1}]},{featureType:"landscape",elementType:"all",stylers:[{lightness:20},{color:"#efe9e4"}]},{featureType:"landscape",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape.man_made",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry",stylers:[{visibility:"on"},{color:"#f0e4d3"}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"on"},{saturation:-24},{lightness:0}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{lightness:16},{saturation:-100},{hue:"#ffd800"}]},{featureType:"poi",elementType:"labels.icon",stylers:[{saturation:-100},{hue:"#ffd800"}]},{featureType:"poi.sports_complex",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{lightness:-100},{saturation:-77}]},{featureType:"road",elementType:"labels.text.stroke",stylers:[{lightness:100}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#efe9e4"},{lightness:-10}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#efe9e4"},{lightness:-25}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{lightness:41}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{weight:.01}]},{featureType:"road.highway",elementType:"labels.icon",stylers:[{lightness:43},{visibility:"off"}]},{featureType:"road.arterial",elementType:"geometry.fill",stylers:[{color:"#efe9e4"},{lightness:-6}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{color:"#efe9e4"},{lightness:-20}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{lightness:47}]},{featureType:"road.arterial",elementType:"labels.text.stroke",stylers:[{lightness:1},{weight:.01}]},{featureType:"road.local",elementType:"geometry.fill",stylers:[{color:"#f4f0f0"},{lightness:14}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{lightness:65}]},{featureType:"transit.station",elementType:"labels.text",stylers:[{saturation:-100}]},{featureType:"transit.station",elementType:"labels.icon",stylers:[{saturation:-100}]},{featureType:"transit.station.bus",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:"#19a0d8"},{gamma:1},{lightness:52}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{lightness:-100}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{lightness:100}]}]},enumerable:!0,configurable:!0}),a}();!function(a){a[a.OPERATOR="OPERATOR"]="OPERATOR",a[a.COD="COD"]="COD"}(l||(l={}));var p=function(){function a(){}return a.prototype.init=function(a,b){var c=this;this.filters=this.createFilters(a,b),this.filtersElement.innerHTML=this.display(),this.forEachFilterElement(function(a){a&&(a.checked=!0)});var d=this.findCodFilterElement();d&&(d.checked=b.filterValue),this.filtersButtonElement.addEventListener("click",function(){c.isCollapsed()?c.expandFilters():c.collapseFilters()}),this.rwdFiltersButtonElement.addEventListener("click",function(){c.isCollapsed()?c.expandFilters():c.collapseFilters()}),this.filtersContent.addEventListener("scroll",function(){c.processFiltersInsetShadow()}),window.addEventListener("resize",function(){c.filtersContent&&c.processFiltersInsetShadow()}),this.processFiltersInsetShadow()},a.prototype.processFiltersInsetShadow=function(){var a=this.filtersContent.offsetWidth,b=this.filtersContent.scrollWidth,c=this.filtersContent.scrollLeft;a<b?0==c?(i(this.filtersContent,"left-scroll"),h(this.filtersContent,"right-scroll")):c+a==b?(h(this.filtersContent,"left-scroll"),i(this.filtersContent,"right-scroll")):(h(this.filtersContent,"left-scroll"),h(this.filtersContent,"right-scroll")):(i(this.filtersContent,"left-scroll"),i(this.filtersContent,"right-scroll"))},a.prototype.getValues=function(){var a=this,b=[];return this.forEachFilter(function(c){var d=a.findFilterElement(c);d&&d.checked&&c.operator&&b.push(c.operator)}),b},a.prototype.getCod=function(){var a=this,b=!1;return this.forEachFilter(function(c){var d=a.findFilterElement(c);d?d.checked&&c.type==l.COD&&(b=!0):b=Boolean(c.value)}),b},a.prototype.onChange=function(a){this.forEachFilterElement(function(b){b&&b.addEventListener("change",a)})},a.prototype.updateFiltersDisplay=function(a){var b=this;this.forEachFilter(function(c){var d=b.findFilterElement(c);d&&(e(a,function(a){return a==c.operator})?d.disabled=!1:c.type!=l.COD&&(d.disabled=!0,d.checked=!1))}),1==this.filters.length&&this.forEachFilterElement(function(a){return a.disabled=!0})},a.prototype.createFilters=function(a,b){return this.createOperatorsFilters(a).concat([this.createCODFilter(b)])},a.prototype.createOperatorsFilters=function(a){for(var b=[],c=0,d=a;c<d.length;c++){var e=d[c],f={type:l.OPERATOR,operator:e.operator,value:e.price,elementId:"BPFilter"+e.operator};b.push(f)}return b},a.prototype.createCODFilter=function(a){return{value:a.filterValue,show:null==a.showFilter||a.showFilter,type:l.COD,elementId:"BPFilterCOD"}},a.prototype.findFilterElement=function(a){var b=a.elementId;return document.getElementById(b)},a.prototype.forEachFilter=function(a){for(var b=0,c=this.filters;b<c.length;b++){var d=c[b];a(d)}},a.prototype.findCodFilterElement=function(){return document.getElementById("BPFilterCOD")},a.prototype.forEachFilterElement=function(a){var b=this;this.forEachFilter(function(c){return a(b.findFilterElement(c))})},a.prototype.expandFilters=function(){i(document.getElementById("SensbitFedexMapWidget"),"bp-filters-collapsed"),i(this.filtersElement,"bp-filters-collapsed"),this.filtersButtonElement&&(this.filtersButtonElement.title="Zwiń filtry"),this.processFiltersInsetShadow()},a.prototype.collapseFilters=function(){this.isCollapsed()||(h(this.filtersElement,"bp-filters-collapsed"),h(document.getElementById("SensbitFedexMapWidget"),"bp-filters-collapsed")),this.filtersButtonElement&&(this.filtersButtonElement.title="Rozwiń filtry"),this.processFiltersInsetShadow()},a.prototype.isCollapsed=function(){var a=this.filtersElement;return a.className.indexOf("bp-filters-collapsed")!==-1},Object.defineProperty(a.prototype,"filtersElement",{get:function(){return document.getElementById("SensbitFedexMapWidgetFilters")},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"filtersButtonElement",{get:function(){return document.getElementById("SensbitFedexMapWidgetFiltersButton")},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"rwdFiltersButtonElement",{get:function(){return document.getElementById("SensbitFedexMapWidgetFiltersButtonRWD")},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"filtersContent",{get:function(){return document.getElementById("SensbitFedexMapWidgetFiltersContent")},enumerable:!0,configurable:!0}),a.prototype.display=function(){var a=this.createFiltersDisplay(),b=n.asset("images/icons/marker.svg");return'\n <div class="bp-filters-content" id="SensbitFedexMapWidgetFiltersContent">\n <div class="bp-filters-logo"><img class="bp-filters-icon" src="'+b+'"/></div>\n <div class="bp-filters-wrapper">'+a+"</div>\n </div>\n "},a.prototype.createFiltersDisplay=function(){for(var a=[],b=0,c=this.filters;b<c.length;b++){var d=c[b],e="",f=d.elementId,g="bp-filter";if(d.operator){var h=d.operator.toLowerCase(),i=n.operatorLogo(d.operator),j="";(d.value||0===d.value)&&(g="bp-filter bp-filter-show-price",j=Number(d.value).toFixed(2).replace(".",",")+"zł"),e='\n <label class="'+g+'">\n <input id="'+f+'" type="checkbox" name="'+h+'" />\n <div class="bp-filter-wrapper">\n <div class="bp-filter-logo">'+i+'</div>\n <div class="bp-filter-price">\n <span>'+j+"</span>\n </div>\n </div>\n </label>\n "}else if(d.show){var k=d.show&&d.value?" disabled ":"";e='\n <div class="checkbox-filter">\n <label class="checkbox-block">\n <input type="checkbox" id="'+f+'" name="codFilter" '+k+' />\n <span class="checkbox" tabindex="0"></span>\n <span class="checkbox-desc '+k+'">Płatność za pobraniem</span>\n </label> \n </div>\n '}""!=e&&a.push(e)}return a.join("")},a}(),q=function(){function a(){this.POS_AVAILABLE_HANDLING_OPERATORS=["FEDEX"]}return a.prototype.init=function(b,d,e,f){var g=this;this.map=b,this.operators=d,this.selectPointCallback=e,this.submitPointCallback=f,this.markerClusterer=new c(b,[],{batchSize:4e4,batchSizeIE:1e4,ignoreHidden:!0,minimumClusterSize:4,styles:[{url:n.asset("images/markers/m1.png"),height:30,width:31,textColor:"white"},{url:n.asset("images/markers/m2.png"),height:34,width:35,textColor:"white"},{url:n.asset("images/markers/m3.png"),height:39,width:40,textColor:"white"},{url:n.asset("images/markers/m4.png"),height:43,width:45,textColor:"white"},{url:n.asset("images/markers/m5.png"),height:49,width:51,textColor:"white"}]}),this.oms=new SensbitFedexMapWidget.OverlappingMarkerSpiderfier(b,{markersWontMove:!0,markersWontHide:!1,keepSpiderfied:!0,ignoreMapClick:!0,nearbyDistance:10,circleFootSeparation:35}),this.siw=SensbitFedexMapWidget.SnazzyInfoWindow(google.maps.OverlayView),
this.posListElement.innerHTML=a.displayPointDescription(),google.maps.event.addListener(b,"click",function(){g.unselectMarker()});var h=document.getElementById("SensbitFedexMapWidgetMap");h.addEventListener("touchmove",function(){g.markerClusterer.setZoomOnClick(!1)}),h.addEventListener("touchend",function(){setTimeout(function(){g.markerClusterer.setZoomOnClick(!0)})}),b.addListener("dragstart",function(){g.markerClusterer.setZoomOnClick(!1)}),b.addListener("dragend",function(){setTimeout(function(){g.markerClusterer.setZoomOnClick(!0)})})},a.prototype.clearMarkers=function(){this.oms.forgetAllMarkers(),this.markerClusterer.clearMarkers()},a.prototype.updateMarkers=function(a){for(var b=[],c=0,d=a;c<d.length;c++){var e=d[c],f=this.createMarker(e);b.push(f),this.oms.trackMarker(f)}this.markerClusterer.addMarkers(b,!1)},a.prototype.findMarker=function(a){for(var b=0,c=this.markerClusterer.getMarkers();b<c.length;b++){var d=c[b];if(j(a)==d.get("posId"))return d}return null},a.prototype.selectMarker=function(a,b,c){c&&(this.map.panTo(a.getPosition()),this.map.setZoom(16)),this.isPosAvailable(b)&&(this.currentMarker&&this.currentMarker.setIcon(n.asset("https://www.interblue.pl//modules/sensbitfedex/views/img/marker.png")),this.currentMarker=a,this.currentMarker.setIcon(n.asset("https://www.interblue.pl//modules/sensbitfedex/views/img/marker_active.png"))),this.updateMarkerDescription(b)},a.prototype.unselectMarker=function(){this.currentMarker&&this.currentMarker.setIcon(n.asset("https://www.interblue.pl//modules/sensbitfedex/views/img/marker.png")),this.currentMarker=null,this.updateMarkerDescription(null)},a.prototype.errorMarker=function(a,b){console.error(b),this.currentMarker&&this.currentMarker.setIcon(n.asset("https://www.interblue.pl//modules/sensbitfedex/views/img/marker.png")),this.currentMarker=a,this.currentMarker.setIcon(n.asset("https://www.interblue.pl//modules/sensbitfedex/views/img/marker_active.png")),this.updateErrorDescription(a.get("operatorPretty"),a.get("code"),a.get("brandPretty"))},a.prototype.filterMarkers=function(a,b){var c=this.markerClusterer.getMarkers();this.markerClusterer.clearMarkers();for(var d=0,e=0,f=c;e<f.length;e++){var g=f[e];g.setVisible(!1);for(var h=0,i=a;h<i.length;h++){var j=i[h];g.get("operator")==j&&(!b||b&&1==g.get("cod"))&&(g.setVisible(!0),d++)}}return this.markerClusterer.addMarkers(c,!0),this.markerClusterer.repaint(),this.isCurrentVisible()||this.selectPointCallback(),0==c.length?-1:d},a.prototype.getAvailableOperators=function(){for(var a=[],b=function(b){var c=b.get("operator");e(a,function(a){return a==c})||a.push(c)},c=0,d=this.markerClusterer.getMarkers();c<d.length;c++){var f=d[c];b(f)}return a},a.prototype.isCurrentVisible=function(){return!!this.currentMarker&&this.currentMarker.getVisible()},a.prototype.createMarker=function(b){var c=this,d=new google.maps.LatLng(b.latitude,b.longitude),e=new google.maps.Marker({position:d,map:this.map,icon:this.isPosAvailable(b)?n.asset("https://www.interblue.pl//modules/sensbitfedex/views/img/marker.png"):n.asset("images/markers/marker_disabled.png")});e.setValues({posId:j(b),operator:b.operator,operatorPretty:b.operatorPretty,brandPretty:b.brandPretty,code:b.code,cod:b.cod});var f;return e.addListener("spider_click",function(){c.selectPointCallback(e)}),e.addListener("mouseover",function(){c.isPosAvailable(b)&&e.setIcon(n.asset("https://www.interblue.pl//modules/sensbitfedex/views/img/marker_active.png")),f=new c.siw({marker:e,offset:{left:"25px"},border:!1,pointer:!1,placement:"right",showCloseButton:!1,closeWhenOthersOpen:!0,openOnMarkerClick:!1,panOnOpen:!1}),f.setContent(a.createMarkerShortDescription(b)),f.open(),setTimeout(function(){h(document.getElementsByClassName("si-wrapper-right")[0],"active")},50)}),e.addListener("mouseout",function(){e!=c.currentMarker&&c.isPosAvailable(b)&&e.setIcon(n.asset("https://www.interblue.pl//modules/sensbitfedex/views/img/marker.png")),f&&f.destroy()}),e.setVisible(!1),e},a.createErrorDescription=function(a,b,c){var d=n.asset("images/icons/icon_anuluj.svg"),e=n.submitButton(!1);return'\n <div class="bp-point-desc">\n <div class="bp-point-desc-header">\n <div class="bp-point-desc-header-top">\n <div class="bp-point-desc-header-top-button">\n </div>\n </div>\n <div class="bp-point-desc-point-block">\n <div class="bp-point-desc-point-block-brand">\n '+c+'\n </div>\n <div class="bp-point-desc-point-block-code">\n '+b+'\n </div>\n </div>\n <div class="bp-point-desc-point-block-close">\n <img src="'+d+'">\n </div>\n </div>\n <div class="bp-point-desc-description-row">\n <div class="bp-point-desc-description-row-content">\n <span>Wybrany punkt nie jest w tym momencie dostępny</span>\n </div>\n </div>\n <div class="bp-point-desc-submit-row">\n <div class="bp-point-desc-submit-row-submit-button centered">\n '+e+'\n </div>\n </div>\n <div class="bp-point-desc-operator-row">\n Punkt obsługuje: '+a+"\n </div>\n </div>\n "},a.prototype.createMarkerDescription=function(a){var b=n.brandLogo(a.brand),c=a.brandPretty,e=a.operatorPretty,f=a.description?'<div class="bp-point-desc-description-row-content">'+a.description+"</div>":"",g=n.posTags(a),h=n.addressDescription(a),i=n.parcelPrice(d(this.operators,function(b){return b.operator==a.operator})),j=n.openingHoursDescription(a),k=""!=i,l=n.submitButtonOrText(k,this.isPosAvailable(a)),m=n.asset("images/icons/icon_anuluj.svg"),o=k?"bp-point-desc-submit-row-submit-button":"bp-point-desc-submit-row-submit-button centered";return'\n <div class="bp-point-desc">\n <div class="bp-point-desc-header">\n <div class="bp-point-desc-header-top">\n <div class="bp-point-desc-header-top-button">\n </div>\n </div>\n <div class="bp-point-desc-point-block">\n <div class="bp-point-desc-point-block-brand">\n '+c+'\n </div>\n <div class="bp-point-desc-point-block-code">\n '+a.code+'\n </div>\n </div>\n <div class="bp-point-desc-point-block-close">\n <img src="'+m+'">\n </div>\n </div>\n <div class="bp-point-desc-address-row">\n <div class="bp-point-desc-address-row-address">\n '+h+'\n </div>\n <div class="bp-point-desc-address-row-brand">\n '+b+'\n </div>\n </div>\n <div class="bp-point-desc-submit-row">\n <div class="bp-point-desc-submit-row-price">\n '+i+'\n </div>\n <div class="'+o+'">\n '+l+'\n </div>\n </div>\n <div class="bp-point-desc-description-row">\n '+f+'\n </div>\n <div class="bp-point-desc-opening-hours-row">\n '+j+'\n </div>\n <div class="bp-point-desc-tags-row">\n '+g+'\n </div>\n <div class="bp-point-desc-operator-row">\n Punkt obsługuje: '+e+"\n </div>\n </div>\n "},a.createMarkerShortDescription=function(a){var b=n.brandLogo(a.brand),c=a.brandPretty,d=a.operatorPretty;return'\n <div class="bp-marker-desc">\n <div class="bp-brand-logo-wrapper">\n <div class="bp-brand-logo">'+b+'</div>\n </div>\n <div class="bp-marker-desc-operator-block-wrapper">\n <div class="bp-marker-desc-operator-block">\n <div class="bp-marker-desc-brand">'+c+'</div>\n <div class="bp-marker-desc-operator">'+d+"</div>\n </div>\n </div>\n </div>\n "},a.prototype.showMarkerDescription=function(){i(this.posListElement,"bp-info-hidden")},a.prototype.hideMarkerDescription=function(){h(this.posListElement,"bp-info-hidden")},a.displayPointDescription=function(){return'\n <div id="SensbitFedexMapWidgetPOSInfoContent" class="bp-pos-info-content"></div>\n '},a.prototype.updateMarkerDescription=function(a){if(a){var b=this.createMarkerDescription(a);this.updateMarkerDescriptionWithTemplate(b,a)}else this.hideMarkerDescription(),this.cleanup()},a.prototype.updateErrorDescription=function(b,c,d){var e=a.createErrorDescription(b,c,d);this.updateMarkerDescriptionWithTemplate(e,null),a.submitButton().disabled=!0},a.prototype.updateMarkerDescriptionWithTemplate=function(a,b){var c=this;this.showMarkerDescription();var d=document.createElement("DIV");d.className="bp-pos-info-element",d.id="SensbitFedexMapWidgetPOSInfoElement",d.innerHTML=a,b&&this.isPosAvailable(b)&&d.getElementsByClassName("bp-map-submit-button")[0].addEventListener("click",function(a){a.stopPropagation(),a.cancelBubble=!0,c.submitPointCallback(b)}),d.getElementsByClassName("bp-point-desc-point-block-close")[0].addEventListener("click",function(a){a.stopPropagation(),a.cancelBubble=!0,c.unselectMarker(),i(c.posListElement,"open")}),d.getElementsByClassName("bp-point-desc-header")[0].addEventListener("click",function(a){a.stopPropagation(),a.cancelBubble=!0,g(c.posListElement,"open")?i(c.posListElement,"open"):h(c.posListElement,"open")}),delete Hammer.defaults.cssProps.userSelect,this.hammerTime=new Hammer(d.getElementsByClassName("bp-point-desc-header")[0]),this.hammerTime.get("swipe").set({direction:Hammer.DIRECTION_VERTICAL}),this.hammerTime.on("swipeup",function(){g(c.posListElement,"open")||h(c.posListElement,"open")}),this.hammerTime.on("swipedown",function(){g(c.posListElement,"open")&&i(c.posListElement,"open")}),this.findPosElement()?this.posListContentElement.replaceChild(d,this.findPosElement()):this.posListContentElement.appendChild(d)},a.prototype.cleanup=function(){var a=this;this.findPosElement()&&setTimeout(function(){a.findPosElement().outerHTML=""},200)},Object.defineProperty(a.prototype,"posListElement",{get:function(){return document.getElementById("SensbitFedexMapWidgetPOSInfo")},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"posListContentElement",{get:function(){return document.getElementById("SensbitFedexMapWidgetPOSInfoContent")},enumerable:!0,configurable:!0}),a.prototype.findPosElement=function(){return document.getElementById("SensbitFedexMapWidgetPOSInfoElement")},a.submitButton=function(){return document.getElementsByClassName("bp-map-submit-button").item(0)},a.prototype.isPosAvailable=function(a){return a.available||!this.posAvailableHandling(a)},a.prototype.posAvailableHandling=function(a){return this.POS_AVAILABLE_HANDLING_OPERATORS.some(function(b){return b===a.operator})},a}(),r=function(){function a(){this.searchInputs=[],this.searchCallback=function(){}}return a.prototype.init=function(a,b){this.map=a,this.places=new google.maps.places.PlacesService(this.map),this.searchCallback=b||this.searchCallback},a.prototype.initAutocomplete=function(a){var b=this,c=new google.maps.places.Autocomplete(a,{componentRestrictions:{country:"pl"}});c.addListener("place_changed",function(){var d=c.getPlace();d.geometry?b.handleSearchResult(d,a.value):b.search(d.name)}),this.searchInputs.push(a)},a.prototype.search=function(a){var b=this;this.places.textSearch({query:a,bounds:new google.maps.LatLngBounds(new google.maps.LatLng(49.02317,14.544465),new google.maps.LatLng(54.763658,23.828641))},function(c){c&&c.length?b.handleSearchResult(c[0],a):console.warn("no place found for query:",a)})},a.prototype.handleSearchResult=function(a,b){this.changeMapBounds(a),this.updateInputsValue(b),this.searchCallback(b)},a.prototype.changeMapBounds=function(a){var b=new google.maps.LatLngBounds,c=!1;a.geometry.viewport?b.union(a.geometry.viewport):(b.extend(a.geometry.location),c=!0),this.map.fitBounds(b),c&&this.map.setZoom(this.map.getZoom()-6)},a.prototype.updateInputsValue=function(a){for(var b=0,c=this.searchInputs;b<c.length;b++){var d=c[b];d.value=a}},a}(),s=function(){function a(){var a=this;this.searchMyLocation=function(){a.userDataQuery&&a.places.search(a.userDataQuery)},this.findMe=function(){navigator.geolocation.getCurrentPosition(function(b){a.map.setZoom(15),a.map.setCenter({lat:b.coords.latitude,lng:b.coords.longitude})})}}return a.prototype.init=function(a,b,c){this.map=a,this.places=b,this.userDataQuery=c,this.searchElement.innerHTML=this.display(),this.places.initAutocomplete(document.getElementById("SensbitFedexMapWidgetAutocomplete")),this.initButtons()},a.prototype.initButtons=function(){this.userDataQuery?document.getElementById("BPMyLocation").addEventListener("click",this.searchMyLocation):document.getElementById("BPMyLocation").style.display="none",navigator.geolocation&&this.secureLocation()?(document.getElementById("BPFindMe").addEventListener("click",this.findMe),document.getElementById("BPFindMeRWD").addEventListener("click",this.findMe)):(document.getElementById("BPFindMe").style.display="none",document.getElementById("BPFindMeRWD").style.display="none")},Object.defineProperty(a.prototype,"searchElement",{get:function(){return document.getElementById("SensbitFedexMapWidgetSearch")},enumerable:!0,configurable:!0}),a.prototype.display=function(){var a=n.asset("images/icons/icon_home.svg"),b=n.asset("images/icons/icon_target.svg"),c=n.asset("images/icons/icon_filter.svg");return'\n <div class="bp-search-wrapper">\n <div class="bp-search-buttons">\n <div class="bp-search-panel-button" id="BPMyLocation" data-test="my-location">\n <div>\n <img class="bp-search-panel-button-icon" src="'+a+'"/>\n </div>\n <div class="bp-search-button-label">\n Mój adres\n </div>\n </div>\n <div class="bp-search-panel-button" id="BPFindMe" data-test="find-me">\n <div>\n <img class="bp-search-panel-button-icon" src="'+b+'"/>\n </div>\n <div class="bp-search-button-label">\n Znajdź mnie\n </div>\n </div>\n <div class="bp-search-panel-button-hidden" id="SensbitFedexMapWidgetFiltersButton" data-test="filters">\n <div>\n <img class="bp-search-panel-button-icon" src="'+c+'"/>\n </div>\n <div class="bp-search-button-label">\n Filtry\n </div>\n </div>\n </div>\n <div class="bp-search-box">\n <label for="SensbitFedexMapWidgetAutocomplete" class="bp-search-label">\n Szukaj w pobliżu lokalizacji:\n </label>\n <input id="SensbitFedexMapWidgetAutocomplete" class="bp-search-input"\n placeholder="Wpisz kod pocztowy, adres, ulicę, itp."\n data-test="map_search"\n type="text"/>\n </div>\n </div>\n '},a.prototype.secureLocation=function(){return"https:"===location.protocol||"localhost"===location.hostname||"127.0.0.1"===location.hostname},a}(),t=function(){function a(){var a=this;this.submit=function(b){a.http.countPointSelection(b.operator,b.code),a.options.callback&&a.options.callback({code:b.code,operator:b.operator,street:b.street,postalCode:b.postalCode,city:b.city,province:b.province,description:b.description,latitude:b.latitude,longitude:b.longitude,openingHoursMap:b.openingHoursMap,cod:b.cod,brand:b.brand})},this.updateRwd=function(){var b="bp-media-lg",c=a.rootElement;c.offsetWidth<=576?b="bp-media-xs":c.offsetWidth<=768?b="bp-media-sm":c.offsetWidth<=992&&(b="bp-media-md"),c.className=c.className.replace(/bp-media-(xs|sm|md|lg)/,b)},this.selectPoint=function(b,c){if(b){var d=b.get("posId");a.http.getPos(d,function(d){a.markers.selectMarker(b,d,c)},function(c){return a.markers.errorMarker(b,c)})}else a.markers.unselectMarker()}}return a.prototype.init=function(a,b){this.options=b,this.options.operators=this.options.operators||[{operator:"FEDEX"}],this.http=new m(b.testMode),a.innerHTML=this.display(),this.updateRwd(),SensbitFedexMapWidget.ResizeSensor(this.rootElement,this.updateRwd),this.createModules(),this.options.callback||(this.rootElement.className+=" bp-no-callback"),this.options.mapOnly&&h(this.rootElement,"map-only"),window.google&&google.maps?this.initMap():this.http.loadScript("https://maps.googleapis.com/maps/api/js?v=3.exp&key="+this.options.googleMapApiKey+"&libraries=places&language=pl&region=PL&callback=SensbitFedexMapWidget.initMap")},a.prototype.initMap=function(){var a=this,b=this.createMapOptions(this.options.mapOptions);if(this.map=new google.maps.Map(document.getElementById("SensbitFedexMapWidgetMap"),b),this.options.readyCallback&&google.maps.event.addListenerOnce(this.map,"tilesloaded",this.options.readyCallback),this.markers.init(this.map,this.options.operators,this.selectPoint,this.submit),this.places.init(this.map,this.options.searchCallback),this.options.externalSearch&&this.places.initAutocomplete(this.options.externalSearch),this.options.initialAddress&&!this.options.selectedPos&&this.places.search(this.options.initialAddress),this.search&&this.search.init(this.map,this.places,this.options.userDataQuery),this.filters){var c={showFilter:!1,filterValue:this.options.codOnly};this.filters.init(this.options.operators,c),this.filters.onChange(function(){return a.updatePointsVisibility()})}this.updatePoints(function(){var b=a.options.selectedPos;if(b){var c=a.markers.findMarker(b);c&&a.selectPoint(c,!0)}var d=a.markers.getAvailableOperators();a.filters.updateFiltersDisplay(d),a.updatePointsVisibility()})},a.prototype.createModules=function(){this.markers=new q,this.places=new r,this.filters=new p,this.search=new s},a.prototype.createMapOptions=function(a){void 0===a&&(a={});var b={center:{lat:52.0693235,lng:19.4803114},zoom:6,styles:o.styles,mapTypeControl:!1,gestureHandling:"cooperative"};return a.center=a.center||b.center,a.zoom=void 0!==a.zoom?a.zoom:b.zoom,a.styles=a.styles||b.styles,a.mapTypeControl=void 0!==a.mapTypeControl?a.mapTypeControl:b.mapTypeControl,a.gestureHandling=void 0!==a.gestureHandling?a.gestureHandling:b.gestureHandling,a.fullscreenControl=!1,a},a.prototype.updatePoints=function(a){var b=this,c=this.getOperatorsToUpdate();return this.markers.clearMarkers(),c.length?void this.http.listPos(this.options.posType,c,function(c){b.markers.updateMarkers(c),b.hidePosLoader(),a()},function(a){console.error(a),b.hidePosLoader(),b.displayPosCount(-1)}):(console.warn("Operators array is empty"),void this.hidePosLoader())},a.prototype.setStatusMessage=function(a){var b=document.getElementById("BPPosCount");b.innerHTML=a},a.prototype.hidePosLoader=function(){var a=document.getElementById("BPPosLoader");h(a,"hide")},a.prototype.updatePointsVisibility=function(){var a=this.getOperatorsToUpdate(),b=this.getCodFilter(),c=this.markers.filterMarkers(a,b);this.displayPosCount(c)},a.prototype.displayPosCount=function(a){a>0?this.setStatusMessage(a+" punktów"):0==a?this.setStatusMessage("0 punktów"):this.setStatusMessage("Błąd ładowania punktów")},a.prototype.getOperatorsToUpdate=function(){return this.filters?this.filters.getValues():f(this.options.operators,function(a){return a.operator})},a.prototype.getCodFilter=function(){return this.filters.getCod()},Object.defineProperty(a.prototype,"rootElement",{get:function(){return document.getElementById("SensbitFedexMapWidget")},enumerable:!0,configurable:!0}),a.prototype.display=function(){var a=n.rwdButtons(),b=n.footer();return'\n <div id="SensbitFedexMapWidget" class="bp-media-lg bp-filters-collapsed">\n <div id="SensbitFedexMapWidgetSearch" class="bp-search-panel"></div>\n <div id="SensbitFedexMapWidgetFilters" class="bp-filters"></div>\n <div id="SensbitFedexMapWidgetMap" class="bp-map" data-test="map"></div>\n <div id="SensbitFedexMapWidgetPOSInfo" class="bp-pos-info bp-info-hidden"></div>\n <div id="SensbitFedexMapWidgetRWDButtons" class="bp-rwd-buttons">\n '+a+'\n </div>\n <div id="SensbitFedexMapWidgetFooter" class="bp-footer">\n '+b+"\n </div>\n </div>\n "},a}();return new t}(),function(){!function(a,b){"object"==typeof exports?module.exports=b():a.ResizeSensor=b()}(this,function(){function a(a,b){var c=Object.prototype.toString.call(a),d="[object Array]"===c||"[object NodeList]"===c||"[object HTMLCollection]"===c||"[object Object]"===c||"undefined"!=typeof jQuery&&a instanceof jQuery||"undefined"!=typeof Elements&&a instanceof Elements,e=0,f=a.length;if(d)for(;e<f;e++)b(a[e]);else b(a)}if("undefined"==typeof window)return null;var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},c=function(d,e){function f(){var a=[];this.add=function(b){a.push(b)};var b,c;this.call=function(){for(b=0,c=a.length;b<c;b++)a[b].call()},this.remove=function(d){var e=[];for(b=0,c=a.length;b<c;b++)a[b]!==d&&e.push(a[b]);a=e},this.length=function(){return a.length}}function g(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function h(a,c){if(a.resizedAttached){if(a.resizedAttached)return void a.resizedAttached.add(c)}else a.resizedAttached=new f,a.resizedAttached.add(c);a.resizeSensor=document.createElement("div"),a.resizeSensor.className="resize-sensor";var d="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;",e="position: absolute; left: 0; top: 0; transition: 0s;";a.resizeSensor.style.cssText=d,a.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="'+d+'"><div style="'+e+'"></div></div><div class="resize-sensor-shrink" style="'+d+'"><div style="'+e+' width: 200%; height: 200%"></div></div>',a.appendChild(a.resizeSensor),"static"==g(a,"position")&&(a.style.position="relative");var h,i,j,k,l=a.resizeSensor.childNodes[0],m=l.childNodes[0],n=a.resizeSensor.childNodes[1],o=a.offsetWidth,p=a.offsetHeight,q=function(){m.style.width="100000px",m.style.height="100000px",l.scrollLeft=1e5,l.scrollTop=1e5,n.scrollLeft=1e5,n.scrollTop=1e5};q();var r=function(){i=0,h&&(o=j,p=k,a.resizedAttached&&a.resizedAttached.call())},s=function(){j=a.offsetWidth,k=a.offsetHeight,h=j!=o||k!=p,h&&!i&&(i=b(r)),q()},t=function(a,b,c){a.attachEvent?a.attachEvent("on"+b,c):a.addEventListener(b,c)};t(l,"scroll",s),t(n,"scroll",s)}a(d,function(a){h(a,e)}),this.detach=function(a){c.detach(d,a)}};return c.detach=function(b,c){a(b,function(a){a.resizedAttached&&"function"==typeof c&&(a.resizedAttached.remove(c),a.resizedAttached.length())||a.resizeSensor&&(a.contains(a.resizeSensor)&&a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)})},c}),function(){var a,b,c,d,e,f={}.hasOwnProperty,g=[].slice;this.OverlappingMarkerSpiderfier=function(){function a(a,d){var e,g,j;this.map=a,null==d&&(d={}),null==this.constructor.N&&(this.constructor.N=!0,c=google.maps,b=c.event,h=c.MapTypeId,i.keepSpiderfied=!1,i.ignoreMapClick=!1,i.markersWontHide=!1,i.markersWontMove=!1,i.basicFormatEvents=!1,i.nearbyDistance=20,i.circleSpiralSwitchover=9,i.circleFootSeparation=23,i.circleStartAngle=k/12,i.spiralFootSeparation=26,i.spiralLengthStart=11,i.spiralLengthFactor=4,i.spiderfiedZIndex=c.Marker.MAX_ZINDEX+2e4,i.highlightedLegZIndex=c.Marker.MAX_ZINDEX+1e4,i.usualLegZIndex=c.Marker.MAX_ZINDEX+1,i.legWeight=1.5,i.legColors={usual:{},highlighted:{}},j=i.legColors.usual,g=i.legColors.highlighted,j[h.HYBRID]=j[h.SATELLITE]="#fff",g[h.HYBRID]=g[h.SATELLITE]="#f00",j[h.TERRAIN]=j[h.ROADMAP]="#444",g[h.TERRAIN]=g[h.ROADMAP]="#f00",this.constructor.j=function(a){return this.setMap(a)},this.constructor.j.prototype=new c.OverlayView,this.constructor.j.prototype.draw=function(){});for(e in d)f.call(d,e)&&(g=d[e],this[e]=g);this.g=new this.constructor.j(this.map),this.C(),this.c={},this.B=this.l=null,this.addListener("click",function(a,c){return b.trigger(a,"spider_click",c)}),this.addListener("format",function(a,c){return b.trigger(a,"spider_format",c)}),this.ignoreMapClick||b.addListener(this.map,"click",function(a){return function(){return a.unspiderfy()}}(this)),b.addListener(this.map,"maptypeid_changed",function(a){return function(){return a.unspiderfy()}}(this)),b.addListener(this.map,"zoom_changed",function(a){return function(){if(a.unspiderfy(),!a.basicFormatEvents)return a.h()}}(this))}var b,c,d,e,h,i,j,k,l;for(i=a.prototype,j=[a,i],d=0,e=j.length;d<e;d++)l=j[d],l.VERSION="1.0.3";return k=2*Math.PI,c=b=h=null,a.markerStatus={SPIDERFIED:"SPIDERFIED",SPIDERFIABLE:"SPIDERFIABLE",UNSPIDERFIABLE:"UNSPIDERFIABLE",UNSPIDERFIED:"UNSPIDERFIED"},i.C=function(){this.a=[],this.s=[]},i.addMarker=function(a,b){return a.setMap(this.map),this.trackMarker(a,b)},i.trackMarker=function(a,c){var d;return null!=a._oms?this:(a._oms=!0,d=[b.addListener(a,"click",function(b){return function(c){return b.V(a,c)}}(this))],this.markersWontHide||d.push(b.addListener(a,"visible_changed",function(b){return function(){return b.D(a,!1)}}(this))),this.markersWontMove||d.push(b.addListener(a,"position_changed",function(b){return function(){return b.D(a,!0)}}(this))),null!=c&&d.push(b.addListener(a,"spider_click",c)),this.s.push(d),this.a.push(a),this.basicFormatEvents?this.trigger("format",a,this.constructor.markerStatus.UNSPIDERFIED):(this.trigger("format",a,this.constructor.markerStatus.UNSPIDERFIABLE),this.h()),this)},i.D=function(a,b){if(!this.J&&!this.K)return null==a._omsData||!b&&a.getVisible()||this.unspiderfy(b?a:null),this.h()},i.getMarkers=function(){return this.a.slice(0)},i.removeMarker=function(a){return this.forgetMarker(a),a.setMap(null)},i.forgetMarker=function(a){var c,d,e,f,g;if(null!=a._omsData&&this.unspiderfy(),c=this.A(this.a,a),0>c)return this;for(g=this.s.splice(c,1)[0],d=0,e=g.length;d<e;d++)f=g[d],b.removeListener(f);return delete a._oms,this.a.splice(c,1),this.h(),this},i.removeAllMarkers=i.clearMarkers=function(){var a,b,c,d;for(d=this.getMarkers(),this.forgetAllMarkers(),a=0,b=d.length;a<b;a++)c=d[a],c.setMap(null);return this},i.forgetAllMarkers=function(){var a,c,d,e,f,g,h,i;for(this.unspiderfy(),i=this.a,a=c=0,d=i.length;c<d;a=++c){for(g=i[a],f=this.s[a],h=0,a=f.length;h<a;h++)e=f[h],b.removeListener(e);delete g._oms}return this.C(),this},i.addListener=function(a,b){var c;return(null!=(c=this.c)[a]?c[a]:c[a]=[]).push(b),this},i.removeListener=function(a,b){var c;return c=this.A(this.c[a],b),0>c||this.c[a].splice(c,1),this},i.clearListeners=function(a){return this.c[a]=[],this},i.trigger=function(){var a,b,c,d,e,f;for(b=arguments[0],a=2<=arguments.length?g.call(arguments,1):[],b=null!=(c=this.c[b])?c:[],f=[],d=0,e=b.length;d<e;d++)c=b[d],f.push(c.apply(null,a));return f},i.L=function(a,b){var d,e,f,g,h;for(g=this.circleFootSeparation*(2+a)/k,e=k/a,h=[],d=f=0;0<=a?f<a:f>a;d=0<=a?++f:--f)d=this.circleStartAngle+d*e,h.push(new c.Point(b.x+g*Math.cos(d),b.y+g*Math.sin(d)));return h},i.M=function(a,b){var d,e,f,g,h;for(g=this.spiralLengthStart,d=0,h=[],e=f=0;0<=a?f<a:f>a;e=0<=a?++f:--f)d+=this.spiralFootSeparation/g+5e-4*e,e=new c.Point(b.x+g*Math.cos(d),b.y+g*Math.sin(d)),g+=k*this.spiralLengthFactor/d,h.push(e);return h},i.V=function(a,b){var c,d,e,f,g,h,i,j,k;if((h=null!=a._omsData)&&this.keepSpiderfied||this.unspiderfy(),h||this.map.getStreetView().getVisible()||"GoogleEarthAPI"===this.map.getMapTypeId())return this.trigger("click",a,b);for(h=[],i=[],c=this.nearbyDistance,j=c*c,g=this.f(a.position),k=this.a,c=0,d=k.length;c<d;c++)e=k[c],null!=e.map&&e.getVisible()&&(f=this.f(e.position),this.i(f,g)<j?h.push({R:e,G:f}):i.push(e));return 1===h.length?this.trigger("click",a,b):this.W(h,i)},i.markersNearMarker=function(a,b){var c,d,e,f,g,h,i,j,k,l;if(null==b&&(b=!1),null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearMarker";for(c=this.nearbyDistance,i=c*c,g=this.f(a.position),h=[],j=this.a,c=0,d=j.length;c<d&&(e=j[c],!(e!==a&&null!=e.map&&e.getVisible()&&(f=this.f(null!=(k=null!=(l=e._omsData)?l.v:void 0)?k:e.position),this.i(f,g)<i&&(h.push(e),b))));c++);return h},i.F=function(){var a,b,c,d,e,f,g,h,i,j,k;if(null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearAnyOtherMarker";i=this.nearbyDistance,i*=i;var l;for(e=this.a,l=[],j=0,b=e.length;j<b;j++)d=e[j],l.push({H:this.f(null!=(a=null!=(c=d._omsData)?c.v:void 0)?a:d.position),b:!1});for(j=this.a,a=c=0,d=j.length;c<d;a=++c)if(b=j[a],null!=b.getMap()&&b.getVisible()&&(f=l[a],!f.b))for(k=this.a,b=h=0,e=k.length;h<e;b=++h)if(g=k[b],b!==a&&null!=g.getMap()&&g.getVisible()&&(g=l[b],(!(b<a)||g.b)&&this.i(f.H,g.H)<i)){f.b=g.b=!0;break}return l},i.markersNearAnyOtherMarker=function(){var a,b,c,d,e,f,g;for(e=this.F(),f=this.a,g=[],a=b=0,c=f.length;b<c;a=++b)d=f[a],e[a].b&&g.push(d);return g},i.setImmediate=function(a){return window.setTimeout(a,0)},i.h=function(){if(!this.basicFormatEvents&&null==this.l)return this.l=this.setImmediate(function(a){return function(){return a.l=null,null!=a.g.getProjection()?a.w():null!=a.B?void 0:a.B=b.addListenerOnce(a.map,"idle",function(){return a.w()})}}(this))},i.w=function(){var a,b,c,d,e,f,g;if(this.basicFormatEvents){for(e=[],b=0,c=markers.length;b<c;b++)d=markers[b],a=null!=d._omsData?"SPIDERFIED":"UNSPIDERFIED",e.push(this.trigger("format",d,this.constructor.markerStatus[a]));return e}for(e=this.F(),f=this.a,g=[],a=c=0,b=f.length;c<b;a=++c)d=f[a],a=null!=d._omsData?"SPIDERFIED":e[a].b?"SPIDERFIABLE":"UNSPIDERFIABLE",g.push(this.trigger("format",d,this.constructor.markerStatus[a]));return g},i.P=function(a){return{m:function(b){return function(){return a._omsData.o.setOptions({strokeColor:b.legColors.highlighted[b.map.mapTypeId],zIndex:b.highlightedLegZIndex})}}(this),u:function(b){return function(){return a._omsData.o.setOptions({strokeColor:b.legColors.usual[b.map.mapTypeId],zIndex:b.usualLegZIndex})}}(this)}},i.W=function(a,d){var e,f,g,h,i,j,k,l,m,n;return this.J=!0,n=a.length,e=this.T(function(){var b,c,d;for(d=[],b=0,c=a.length;b<c;b++)l=a[b],d.push(l.G);return d}()),h=n>=this.circleSpiralSwitchover?this.M(n,e).reverse():this.L(n,e),e=function(){var d,e,l;for(l=[],d=0,e=h.length;d<e;d++)g=h[d],f=this.U(g),m=this.S(a,function(a){return function(b){return a.i(b.G,g)}}(this)),k=m.R,j=new c.Polyline({map:this.map,path:[k.position,f],strokeColor:this.legColors.usual[this.map.mapTypeId],strokeWeight:this.legWeight,zIndex:this.usualLegZIndex}),k._omsData={v:k.getPosition(),X:k.getZIndex(),o:j},this.legColors.highlighted[this.map.mapTypeId]!==this.legColors.usual[this.map.mapTypeId]&&(i=this.P(k),k._omsData.O={m:b.addListener(k,"mouseover",i.m),u:b.addListener(k,"mouseout",i.u)}),this.trigger("format",k,this.constructor.markerStatus.SPIDERFIED),k.setPosition(f),k.setZIndex(Math.round(this.spiderfiedZIndex+g.y)),l.push(k);return l}.call(this),delete this.J,
this.I=!0,this.trigger("spiderfy",e,d)},i.unspiderfy=function(a){var c,d,e,f,g,h,i;if(null==a&&(a=null),null==this.I)return this;for(this.K=!0,i=[],g=[],h=this.a,c=0,d=h.length;c<d;c++)f=h[c],null!=f._omsData?(f._omsData.o.setMap(null),f!==a&&f.setPosition(f._omsData.v),f.setZIndex(f._omsData.X),e=f._omsData.O,null!=e&&(b.removeListener(e.m),b.removeListener(e.u)),delete f._omsData,f!==a&&(e=this.basicFormatEvents?"UNSPIDERFIED":"SPIDERFIABLE",this.trigger("format",f,this.constructor.markerStatus[e])),i.push(f)):g.push(f);return delete this.K,delete this.I,this.trigger("unspiderfy",i,g),this},i.i=function(a,b){var c,d;return c=a.x-b.x,d=a.y-b.y,c*c+d*d},i.T=function(a){var b,d,e,f,g;for(b=f=g=0,d=a.length;b<d;b++)e=a[b],f+=e.x,g+=e.y;return a=a.length,new c.Point(f/a,g/a)},i.f=function(a){return this.g.getProjection().fromLatLngToDivPixel(a)},i.U=function(a){return this.g.getProjection().fromDivPixelToLatLng(a)},i.S=function(a,b){var c,d,e,f,g,h;for(e=g=0,h=a.length;g<h;e=++g)f=a[e],f=b(f),("undefined"==typeof c||null===c||f<d)&&(d=f,c=e);return a.splice(c,1)[0]},i.A=function(a,b){var c,d,e,f;if(null!=a.indexOf)return a.indexOf(b);for(c=d=0,e=a.length;d<e;c=++d)if(f=a[c],f===b)return c;return-1},a}(),b=/(\?.*(&|&amp;)|\?)spiderfier_callback=(\w+)/,a=document.currentScript,null==a&&(a=function(){var a,c,d,f,g;for(d=document.getElementsByTagName("script"),g=[],a=0,c=d.length;a<c;a++)e=d[a],null!=(f=e.getAttribute("src"))&&f.match(b)&&g.push(e);return g}()[0]),null!=a&&(a=null!=(c=a.getAttribute("src"))&&null!=(d=c.match(b))?d[3]:void 0)&&"function"==typeof window[a]&&window[a](),"function"==typeof window.spiderfier_callback&&window.spiderfier_callback()}.call(this),function(a,b){if("undefined"!=typeof exports)b(module,exports);else{var c={exports:{}};b(c,c.exports),a.SnazzyInfoWindow=c.exports}}(this,function(a,b){function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function e(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function f(a,b){a&&b&&Object.keys(b).forEach(function(c){a[c]=b[c]})}function g(a){var b={};return f(b,t),f(b,a),Object.keys(t).forEach(function(a){var c=t[a];if("object"===("undefined"==typeof c?"undefined":n(c))){var d={};f(d,c),f(d,b[a]),b[a]=d}}),b}function h(a,b){var c=/^(-{0,1}\.{0,1}\d+(\.\d+)?)[\s|\.]*(\w*)$/;if(a&&c.test(a)){var d=c.exec(a),e=d[1],f=d[3]||"px";return{value:1*e,units:f,original:a}}return b?h(b):{original:b}}function i(a,b){if(a){for(;a.firstChild;)a.removeChild(a.firstChild);b&&("string"==typeof b?a.innerHTML=b:a.appendChild(b))}}function j(a){return"top"===a?"bottom":"bottom"===a?"top":"left"===a?"right":"right"===a?"left":a}function k(a){return a.charAt(0).toUpperCase()+a.slice(1)}function l(a){if(void 0!==a&&null!==a){if(a instanceof google.maps.LatLng)return a;if(void 0!==a.lat&&void 0!==a.lng)return new google.maps.LatLng(a)}return null}Object.defineProperty(b,"__esModule",{value:!0});var m=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},o="si-",p=1.41421356237,q=.7071067811865474,r="snazzy-info-window-",s={h:"0px",v:"3px",blur:"6px",spread:"0px",color:"#000"},t={placement:"top",pointer:!0,openOnMarkerClick:!0,closeOnMapClick:!0,closeWhenOthersOpen:!1,showCloseButton:!0,panOnOpen:!0,edgeOffset:{top:20,right:20,bottom:20,left:20}},u=function(a){function b(a){c(this,b);var e=d(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a));if("undefined"==typeof google)return console.warn("Snazzy Info Window: Google Maps is not defined!"),d(e);e._html=null,e._opts=g(a),e._callbacks=e._opts.callbacks||{},e._marker=e._opts.marker,e._map=e._opts.map,e._position=l(e._opts.position),e._isOpen=!1,e._listeners=[],e._marker&&e._opts.openOnMarkerClick&&e.trackListener(google.maps.event.addListener(e._marker,"click",function(){e.getMap()||e.open()}),!0),e._position&&!e._opts.offset&&(e._opts.offset={top:"0px",left:"0px"});var f=a.placement||e._opts.position;return("string"==typeof f||f instanceof String)&&(f=f.toLowerCase()),"top"!==f&&"bottom"!==f&&"left"!==f&&"right"!==f?e._opts.placement=t.placement:e._opts.placement=f,f=e._opts.position,void 0===f||null===f||"string"==typeof f||f instanceof String||(e._opts.position=f),void 0!==e._opts.border&&e._opts.border!==!0||(e._opts.border={}),void 0===e._opts.pointer&&(e._opts.pointer=t.pointer),void 0!==e._opts.shadow&&e._opts.shadow!==!0||(e._opts.shadow={}),e}return e(b,a),m(b,[{key:"activateCallback",value:function(a){var b=this._callbacks[a];return b?b.apply(this):void 0}},{key:"trackListener",value:function(a,b){this._listeners.push({listener:a,persistent:b})}},{key:"clearListeners",value:function(a){this._listeners&&(this._listeners.forEach(function(b){!a&&b.persistent||(google.maps.event.removeListener(b.listener),b.listener=null)}),this._listeners=this._listeners.filter(function(a){return null!=a.listener}))}},{key:"isOpen",value:function(){return this._isOpen}},{key:"open",value:function(){var a=this.activateCallback("beforeOpen");(void 0===a||a)&&(this._marker?this.setMap(this._marker.getMap()):this._map&&this._position&&this.setMap(this._map))}},{key:"close",value:function(){var a=this.activateCallback("beforeClose");(void 0===a||a)&&(this.clearListeners(),this.setMap(null))}},{key:"destroy",value:function(){this.getMap()&&this.setMap(null),this.clearListeners(!0)}},{key:"setContent",value:function(a){this._opts.content=a,this._html&&this._html.content&&i(this._html.content,a)}},{key:"setPosition",value:function(a){this._position=l(a),this._isOpen&&this._position&&(this.draw(),this.resize(),this.reposition())}},{key:"setWrapperClass",value:function(a){if(this._html&&this._html.wrapper){var b=this._html.wrapper;b.className=o+"wrapper-"+this._opts.placement,this._opts.border&&(b.className+=" "+o+"has-border"),a&&(b.className+=" "+a)}this._opts.wrapperClass=a}},{key:"getWrapper",value:function(){return this._html?this._html.wrapper:null}},{key:"draw",value:function(){if(this.getMap()&&this._html&&(this._marker||this._position)){var a=this._opts.offset;a&&(a.left&&(this._html.wrapper.style.marginLeft=a.left),a.top&&(this._html.wrapper.style.marginTop=a.top));var b=this._opts.backgroundColor;if(b&&(this._html.contentWrapper.style.backgroundColor=b,this._opts.pointer&&(this._html.pointerBg.style["border"+k(this._opts.placement)+"Color"]=b)),this._opts.padding&&(this._html.contentWrapper.style.padding=this._opts.padding,this._opts.shadow&&(this._html.shadowFrame.style.padding=this._opts.padding)),this._opts.borderRadius&&(this._html.contentWrapper.style.borderRadius=this._opts.borderRadius,this._opts.shadow&&(this._html.shadowFrame.style.borderRadius=this._opts.borderRadius)),this._opts.fontSize&&(this._html.wrapper.style.fontSize=this._opts.fontSize),this._opts.fontColor&&(this._html.contentWrapper.style.color=this._opts.fontColor),this._opts.pointer&&this._opts.pointer!==!0&&(this._opts.shadow&&(this._html.shadowPointer.style.width=this._opts.pointer,this._html.shadowPointer.style.height=this._opts.pointer),this._html.pointerBorder&&(this._html.pointerBorder.style.borderWidth=this._opts.pointer),this._html.pointerBg.style.borderWidth=this._opts.pointer),this._opts.border){var c=0;if(void 0!==this._opts.border.width&&(c=h(this._opts.border.width,"0px"),this._html.contentWrapper.style.borderWidth=c.value+c.units),c=Math.round((this._html.contentWrapper.offsetWidth-this._html.contentWrapper.clientWidth)/2),c=h(c+"px","0px"),this._opts.pointer){var d=Math.min(this._html.pointerBorder.offsetHeight,this._html.pointerBorder.offsetWidth);d=h(d+"px","0px");var e=Math.round(c.value*(p-1));e=Math.min(e,d.value),this._html.pointerBg.style.borderWidth=d.value-e+d.units;var f=k(j(this._opts.placement));this._html.pointerBg.style["margin"+f]=e+c.units,this._html.pointerBg.style[this._opts.placement]=-c.value+c.units}var g=this._opts.border.color;g&&(this._html.contentWrapper.style.borderColor=g,this._html.pointerBorder&&(this._html.pointerBorder.style["border"+k(this._opts.placement)+"Color"]=g))}if(this._opts.shadow){var i=this._opts.shadow,l=function(a){var b=i[a];return void 0!==b&&null!=b};if(l("h")||l("v")||l("blur")||l("spread")||l("color")){var m=h(i.h,s.h),n=h(i.v,s.v),o=h(i.blur,s.blur),t=h(i.spread,s.spread),u=i.color||s.color,v=function(a,b){return a+" "+b+" "+o.original+" "+t.original+" "+u};this._html.shadowFrame.style.boxShadow=v(m.original,n.original);var w=q*(m.value-n.value)+m.units,x=q*(m.value+n.value)+n.units;this._html.shadowPointerInner&&(this._html.shadowPointerInner.style.boxShadow=v(w,x))}this._opts.shadow.opacity&&(this._html.shadowWrapper.style.opacity=this._opts.shadow.opacity)}var y=this.getProjection().fromLatLngToDivPixel(this._position||this._marker.position);y&&(this._html.floatWrapper.style.top=Math.floor(y.y)+"px",this._html.floatWrapper.style.left=Math.floor(y.x)+"px"),this._isOpen||(this._isOpen=!0,this.resize(),this.reposition(),this.activateCallback("afterOpen"),google.maps.event.trigger(this.getMap(),r+"opened",this))}}},{key:"onAdd",value:function(){var a=this;if(!this._html){var b=function(a,b){if(a&&b)for(var c=0;c<b.length;c++){var d=b[c];d&&(a.className&&(a.className+=" "),a.className+=o+d)}},c=function(){for(var a=arguments.length,c=Array(a),d=0;d<a;d++)c[d]=arguments[d];var e=document.createElement("div");return b(e,c),e};if(this._html={},this._html.wrapper=c(),this.setWrapperClass(this._opts.wrapperClass),this._opts.shadow&&(this._html.shadowWrapper=c("shadow-wrapper-"+this._opts.placement),this._html.shadowFrame=c("frame","shadow-frame"),this._html.shadowWrapper.appendChild(this._html.shadowFrame),this._opts.pointer&&(this._html.shadowPointer=c("shadow-pointer-"+this._opts.placement),this._html.shadowPointerInner=c("shadow-inner-pointer-"+this._opts.placement),this._html.shadowPointer.appendChild(this._html.shadowPointerInner),this._html.shadowWrapper.appendChild(this._html.shadowPointer)),this._html.wrapper.appendChild(this._html.shadowWrapper)),this._html.contentWrapper=c("frame","content-wrapper"),this._html.content=c("content"),this._opts.content&&i(this._html.content,this._opts.content),this._opts.showCloseButton){if(this._opts.closeButtonMarkup){var d=document.createElement("div");i(d,this._opts.closeButtonMarkup),this._html.closeButton=d.firstChild}else this._html.closeButton=document.createElement("button"),this._html.closeButton.setAttribute("type","button"),this._html.closeButton.innerHTML="&#215;",b(this._html.closeButton,["close-button"]);this._html.contentWrapper.appendChild(this._html.closeButton)}this._html.contentWrapper.appendChild(this._html.content),this._html.wrapper.appendChild(this._html.contentWrapper),this._opts.pointer&&(this._opts.border&&(this._html.pointerBorder=c("pointer-"+this._opts.placement,"pointer-border-"+this._opts.placement),this._html.wrapper.appendChild(this._html.pointerBorder)),this._html.pointerBg=c("pointer-"+this._opts.placement,"pointer-bg-"+this._opts.placement),this._html.wrapper.appendChild(this._html.pointerBg)),this._html.floatWrapper=c("float-wrapper"),this._html.floatWrapper.appendChild(this._html.wrapper),this.getPanes().floatPane.appendChild(this._html.floatWrapper);var e=this.getMap();this.clearListeners(),this._opts.closeOnMapClick&&this.trackListener(google.maps.event.addListener(e,"click",function(){a.close()})),this._opts.closeWhenOthersOpen&&this.trackListener(google.maps.event.addListener(e,r+"opened",function(b){a!==b&&a.close()})),this._previousWidth=null,this._previousHeight=null,this.trackListener(google.maps.event.addListener(e,"bounds_changed",function(){var b=e.getDiv(),c=b.offsetWidth,d=b.offsetHeight,f=a._previousWidth,g=a._previousHeight;null!==f&&null!==g&&f===c&&g===d||(a._previousWidth=c,a._previousHeight=d,a.resize())})),this._marker&&this.trackListener(google.maps.event.addListener(this._marker,"position_changed",function(){a.draw()})),this._opts.showCloseButton&&!this._opts.closeButtonMarkup&&this.trackListener(google.maps.event.addDomListener(this._html.closeButton,"click",function(b){b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation(),a.close()}));var f=["click","dblclick","rightclick","contextmenu","drag","dragend","dragstart","mousedown","mouseout","mouseover","mouseup","touchstart","touchend","touchmove","wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"];f.forEach(function(b){a.trackListener(google.maps.event.addDomListener(a._html.wrapper,b,function(a){a.cancelBubble=!0,a.stopPropagation&&a.stopPropagation()}))}),this.activateCallback("open")}}},{key:"onRemove",value:function(){if(this.activateCallback("close"),this._html){var a=this._html.floatWrapper.parentElement;a&&a.removeChild(this._html.floatWrapper),this._html=null}this._isOpen=!1,this.activateCallback("afterClose")}},{key:"getMapInnerBounds",value:function(){var a=this.getMap().getDiv().getBoundingClientRect(),b={top:a.top+this._opts.edgeOffset.top,right:a.right-this._opts.edgeOffset.right,bottom:a.bottom-this._opts.edgeOffset.bottom,left:a.left+this._opts.edgeOffset.left};return b.width=b.right-b.left,b.height=b.bottom-b.top,b}},{key:"reposition",value:function(){if(this._opts.panOnOpen&&this._html){var a=this.getMapInnerBounds(),b=this._html.wrapper.getBoundingClientRect(),c=0,d=0;a.left>=b.left?c=b.left-a.left:a.right<=b.right&&(c=b.left-(a.right-b.width)),a.top>=b.top?d=b.top-a.top:a.bottom<=b.bottom&&(d=b.top-(a.bottom-b.height)),0===c&&0===d||this.getMap().panBy(c,d)}}},{key:"resize",value:function(){if(this._html){var a=this.getMapInnerBounds(),b=a.width;void 0!==this._opts.maxWidth&&(b=Math.min(b,this._opts.maxWidth)),b-=this._html.wrapper.offsetWidth-this._html.content.offsetWidth,this._html.content.style.maxWidth=b+"px";var c=a.height;void 0!==this._opts.maxHeight&&(c=Math.min(c,this._opts.maxHeight)),c-=this._html.wrapper.offsetHeight-this._html.content.offsetHeight,this._html.content.style.maxHeight=c+"px"}}}]),b};b.default=u,a.exports=b.default}),!function(a,b,c,d){function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return!!Array.isArray(a)&&(g(a,c[b],c),!0)}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=!c||a.CSS.supports("touch-action",d)}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=!this.pTime||a.timeStamp-this.pTime<b.interval,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,
this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.7",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define(function(){return ha}):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer")}.bind(SensbitFedexMapWidget)()):console.error("SensbitFedexMapWidget already defined")}();