/*! For license information please see app_Site.Controllers.MapElementController.js.LICENSE.txt */ !function(){"use strict";var t={198:function(t){function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}t.exports=function equal(t,r){if(t===r)return!0;if(t&&r&&"object"==_typeof(t)&&"object"==_typeof(r)){if(t.constructor!==r.constructor)return!1;var o,a,i;if(Array.isArray(t)){if((o=t.length)!=r.length)return!1;for(a=o;0!==a--;)if(!equal(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((o=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(a=o;0!==a--;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=o;0!==a--;){var l=i[a];if(!equal(t[l],r[l]))return!1}return!0}return t!==t&&r!==r}}},r={};function __webpack_require__(o){var a=r[o];if(void 0!==a)return a.exports;var i=r[o]={exports:{}};return t[o](i,i.exports,__webpack_require__),i.exports}__webpack_require__.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(r,{a:r}),r},__webpack_require__.d=function(t,r){for(var o in r)__webpack_require__.o(r,o)&&!__webpack_require__.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},__webpack_require__.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},function(){var t="ajax-load",r="load-ready",o="map-loaded",a="map-api-loaded",i="map-marker-click",l="map-popup-close",u=__webpack_require__(198),c=__webpack_require__.n(u);function sortKD(t,r,o,a,i,l){if(!(i-a<=o)){var u=a+i>>1;sort_select(t,r,u,a,i,l%2),sortKD(t,r,o,a,u-1,l+1),sortKD(t,r,o,u+1,i,l+1)}}function sort_select(t,r,o,a,i,l){for(;i>a;){if(i-a>600){var u=i-a+1,c=o-a+1,p=Math.log(u),d=.5*Math.exp(2*p/3),m=.5*Math.sqrt(p*d*(u-d)/u)*(c-u/2<0?-1:1);sort_select(t,r,o,Math.max(a,Math.floor(o-c*d/u+m)),Math.min(i,Math.floor(o+(u-c)*d/u+m)),l)}var g=r[2*o+l],h=a,y=i;for(swapItem(t,r,a,o),r[2*i+l]>g&&swapItem(t,r,a,i);hg;)y--}r[2*a+l]===g?swapItem(t,r,a,y):swapItem(t,r,++y,i),y<=o&&(a=y+1),o<=y&&(i=y-1)}}function swapItem(t,r,o,a){swap(t,o,a),swap(r,2*o,2*a),swap(r,2*o+1,2*a+1)}function swap(t,r,o){var a=t[r];t[r]=t[o],t[o]=a}function sqDist(t,r,o,a){var i=t-o,l=r-a;return i*i+l*l}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:p,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Float64Array;_classCallCheck(this,KDBush),this.nodeSize=a,this.points=t;for(var l=t.length<65536?Uint16Array:Uint32Array,u=this.ids=new l(t.length),c=this.coords=new i(2*t.length),m=0;m=o&&c<=i&&p>=a&&p<=l&&m.push(t[v]);else{var _=Math.floor((y+h)/2);c=r[2*_],p=r[2*_+1],c>=o&&c<=i&&p>=a&&p<=l&&m.push(t[_]);var k=(g+1)%2;(0===g?o<=c:a<=p)&&(d.push(y),d.push(_-1),d.push(k)),(0===g?i>=c:l>=p)&&(d.push(_+1),d.push(h),d.push(k))}}return m}(this.ids,this.coords,t,r,o,a,this.nodeSize)}},{key:"within",value:function within(t,r,o){return function within_within(t,r,o,a,i,l){for(var u=[0,t.length-1,0],c=[],p=i*i;u.length;){var d=u.pop(),m=u.pop(),g=u.pop();if(m-g<=l)for(var h=g;h<=m;h++)sqDist(r[2*h],r[2*h+1],o,a)<=p&&c.push(t[h]);else{var y=Math.floor((g+m)/2),v=r[2*y],_=r[2*y+1];sqDist(v,_,o,a)<=p&&c.push(t[y]);var k=(d+1)%2;(0===d?o-i<=v:a-i<=_)&&(u.push(g),u.push(y-1),u.push(k)),(0===d?o+i>=v:a+i>=_)&&(u.push(y+1),u.push(m),u.push(k))}}return c}(this.ids,this.coords,t,r,o,this.nodeSize)}}]),KDBush}();function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var a,i,l=[],u=!0,c=!1;try{for(o=o.call(t);!(u=(a=o.next()).done)&&(l.push(a.value),!r||l.length!==r);u=!0);}catch(p){c=!0,i=p}finally{try{u||null==o.return||o.return()}finally{if(c)throw i}}return l}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"===typeof t.length){o&&(t=o);var a=0,i=function F(){};return{s:i,n:function n(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,u=!0,c=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return u=t.done,t},e:function e(t){c=!0,l=t},f:function f(){try{u||null==o.return||o.return()}finally{if(c)throw l}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"===typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,a=new Array(r);o=a;k--){var b=+Date.now();v=this._cluster(v,k),this.trees[k]=new m(v,getX,getY,l,Float32Array),o&&console.log("z%d: %d clusters in %dms",k,v.length,+Date.now()-b)}return o&&console.timeEnd("total time"),this}},{key:"getClusters",value:function getClusters(t,r){var o=((t[0]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,l=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)o=-180,i=180;else if(o>i){var u=this.getClusters([o,a,180,l],r),c=this.getClusters([-180,a,i,l],r);return u.concat(c)}var p,d=this.trees[this._limitZoom(r)],m=[],g=_createForOfIteratorHelper(d.range(lngX(o),latY(l),lngX(i),latY(a)));try{for(g.s();!(p=g.n()).done;){var h=p.value,y=d.points[h];m.push(y.numPoints?getClusterJSON(y):this.points[y.index])}}catch(v){g.e(v)}finally{g.f()}return m}},{key:"getChildren",value:function getChildren(t){var r=this._getOriginId(t),o=this._getOriginZoom(t),a="No cluster with the specified id.",i=this.trees[o];if(!i)throw new Error(a);var l=i.points[r];if(!l)throw new Error(a);var u,c=this.options.radius/(this.options.extent*Math.pow(2,o-1)),p=[],d=_createForOfIteratorHelper(i.within(l.x,l.y,c));try{for(d.s();!(u=d.n()).done;){var m=u.value,g=i.points[m];g.parentId===t&&p.push(g.numPoints?getClusterJSON(g):this.points[g.index])}}catch(h){d.e(h)}finally{d.f()}if(0===p.length)throw new Error(a);return p}},{key:"getLeaves",value:function getLeaves(t,r,o){r=r||10,o=o||0;var a=[];return this._appendLeaves(a,t,r,o,0),a}},{key:"getTile",value:function getTile(t,r,o){var a=this.trees[this._limitZoom(t)],i=Math.pow(2,t),l=this.options,u=l.extent,c=l.radius/u,p=(o-c)/i,d=(o+1+c)/i,m={features:[]};return this._addTileFeatures(a.range((r-c)/i,p,(r+1+c)/i,d),a.points,r,o,i,m),0===r&&this._addTileFeatures(a.range(1-c/i,p,1,d),a.points,i,o,i,m),r===i-1&&this._addTileFeatures(a.range(0,p,c/i,d),a.points,-1,o,i,m),m.features.length?m:null}},{key:"getClusterExpansionZoom",value:function getClusterExpansionZoom(t){for(var r=this._getOriginZoom(t)-1;r<=this.options.maxZoom;){var o=this.getChildren(t);if(r++,1!==o.length)break;t=o[0].properties.cluster_id}return r}},{key:"_appendLeaves",value:function _appendLeaves(t,r,o,a,i){var l,u=_createForOfIteratorHelper(this.getChildren(r));try{for(u.s();!(l=u.n()).done;){var c=l.value,p=c.properties;if(p&&p.cluster?i+p.point_count<=a?i+=p.point_count:i=this._appendLeaves(t,p.cluster_id,o,a,i):ir&&(_+=w.numPoints||1)}}catch(Z){k.e(Z)}finally{k.f()}if(_>v&&_>=c){var x,C=m.x*v,M=m.y*v,P=u&&v>1?this._map(m,!0):null,O=(d<<5)+(r+1)+this.points.length,S=_createForOfIteratorHelper(y);try{for(S.s();!(x=S.n()).done;){var A=x.value,I=h.points[A];if(!(I.zoom<=r)){I.zoom=r;var j=I.numPoints||1;C+=I.x*j,M+=I.y*j,I.parentId=O,u&&(P||(P=this._map(m,!0)),u(P,this._map(I)))}}}catch(Z){S.e(Z)}finally{S.f()}m.parentId=O,o.push(createCluster(C/_,M/_,O,_,P))}else if(o.push(m),_>1){var E,L=_createForOfIteratorHelper(y);try{for(L.s();!(E=L.n()).done;){var T=E.value,D=h.points[T];D.zoom<=r||(D.zoom=r,o.push(D))}}catch(Z){L.e(Z)}finally{L.f()}}}}return o}},{key:"_getOriginId",value:function _getOriginId(t){return t-this.points.length>>5}},{key:"_getOriginZoom",value:function _getOriginZoom(t){return(t-this.points.length)%32}},{key:"_map",value:function _map(t,r){if(t.numPoints)return r?extend({},t.properties):t.properties;var o=this.points[t.index].properties,a=this.options.map(o);return r&&a===o?extend({},a):a}}]),Supercluster}();function createCluster(t,r,o,a,i){return{x:y(t),y:y(r),zoom:1/0,id:o,parentId:-1,numPoints:a,properties:i}}function getClusterJSON(t){return{type:"Feature",id:t.id,properties:getClusterProperties(t),geometry:{type:"Point",coordinates:[(a=t.x,360*(a-.5)),(r=t.y,o=(180-360*r)*Math.PI/180,360*Math.atan(Math.exp(o))/Math.PI-90)]}};var r,o,a}function getClusterProperties(t){var r=t.numPoints,o=r>=1e4?"".concat(Math.round(r/1e3),"k"):r>=1e3?"".concat(Math.round(r/100)/10,"k"):r;return extend(extend({},t.properties),{cluster:!0,cluster_id:t.id,point_count:r,point_count_abbreviated:o})}function lngX(t){return t/360+.5}function latY(t){var r=Math.sin(t*Math.PI/180),o=.5-.25*Math.log((1+r)/(1-r))/Math.PI;return o<0?0:o>1?1:o}function extend(t,r){for(var o in r)t[o]=r[o];return t}function getX(t){return t.x}function getY(t){return t.y}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function index_esm_slicedToArray(t,r){return function index_esm_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function index_esm_iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var a,i,l=[],u=!0,c=!1;try{for(o=o.call(t);!(u=(a=o.next()).done)&&(l.push(a.value),!r||l.length!==r);u=!0);}catch(p){c=!0,i=p}finally{try{u||null==o.return||o.return()}finally{if(c)throw i}}return l}(t,r)||index_esm_unsupportedIterableToArray(t,r)||function index_esm_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return index_esm_arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||index_esm_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function index_esm_unsupportedIterableToArray(t,r){if(t){if("string"===typeof t)return index_esm_arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?index_esm_arrayLikeToArray(t,r):void 0}}function index_esm_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,a=new Array(r);othis.maxZoom&&a.zoom>this.maxZoom||(r=r||!c()(this.state,a)),this.state=a,r&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:r}}},{key:"cluster",value:function cluster(t){var r=t.map;return this.superCluster.getClusters([-180,-90,180,90],Math.round(r.getZoom())).map(this.transformCluster.bind(this))}},{key:"transformCluster",value:function transformCluster(t){var r=index_esm_slicedToArray(t.geometry.coordinates,2),o=r[0],a=r[1],i=t.properties;if(i.cluster)return new _({markers:this.superCluster.getLeaves(i.cluster_id,1/0).map((function(t){return t.properties.marker})),position:new google.maps.LatLng({lat:a,lng:o})});var l=i.marker;return new _({markers:[l],position:l.getPosition()})}}]),SuperClusterAlgorithm}(k),x=index_esm_createClass((function ClusterStats(t,r){index_esm_classCallCheck(this,ClusterStats),this.markers={sum:t.length};var o=r.map((function(t){return t.count})),a=o.reduce((function(t,r){return t+r}),0);this.clusters={count:r.length,markers:{mean:a/r.length,sum:a,min:Math.min.apply(Math,_toConsumableArray(o)),max:Math.max.apply(Math,_toConsumableArray(o))}}})),C=function(){function DefaultRenderer(){index_esm_classCallCheck(this,DefaultRenderer)}return index_esm_createClass(DefaultRenderer,[{key:"render",value:function render(t,r){var o=t.count,a=t.position,i=o>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff",l=window.btoa('\n \n \n \n \n '));return new google.maps.Marker({position:a,icon:{url:"data:image/svg+xml;base64,".concat(l),scaledSize:new google.maps.Size(45,45)},label:{text:String(o),color:"rgba(255,255,255,0.9)",fontSize:"12px"},title:"Cluster of ".concat(o," markers"),zIndex:Number(google.maps.Marker.MAX_ZINDEX)+o})}}]),DefaultRenderer}();var M,P=index_esm_createClass((function OverlayViewSafe(){index_esm_classCallCheck(this,OverlayViewSafe),function index_esm_extend(t,r){for(var o in r.prototype)t.prototype[o]=r.prototype[o]}(OverlayViewSafe,google.maps.OverlayView)}));!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"}(M||(M={}));var O=function defaultOnClusterClickHandler(t,r,o){o.fitBounds(r.bounds)},S=function(t){_inherits(MarkerClusterer,t);var r=_createSuper(MarkerClusterer);function MarkerClusterer(t){var o,a=t.map,i=t.markers,l=void 0===i?[]:i,u=t.algorithm,c=void 0===u?new w({}):u,p=t.renderer,d=void 0===p?new C:p,m=t.onClusterClick,g=void 0===m?O:m;return index_esm_classCallCheck(this,MarkerClusterer),(o=r.call(this)).markers=_toConsumableArray(l),o.clusters=[],o.algorithm=c,o.renderer=d,o.onClusterClick=g,a&&o.setMap(a),o}return index_esm_createClass(MarkerClusterer,[{key:"addMarker",value:function addMarker(t,r){this.markers.includes(t)||(this.markers.push(t),r||this.render())}},{key:"addMarkers",value:function addMarkers(t,r){var o=this;t.forEach((function(t){o.addMarker(t,!0)})),r||this.render()}},{key:"removeMarker",value:function removeMarker(t,r){var o=this.markers.indexOf(t);return-1!==o&&(t.setMap(null),this.markers.splice(o,1),r||this.render(),!0)}},{key:"removeMarkers",value:function removeMarkers(t,r){var o=this,a=!1;return t.forEach((function(t){a=o.removeMarker(t,!0)||a})),a&&!r&&this.render(),a}},{key:"clearMarkers",value:function clearMarkers(t){this.markers.length=0,t||this.render()}},{key:"render",value:function render(){var t=this.getMap();if(t instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,M.CLUSTERING_BEGIN,this);var r=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()}),o=r.clusters,a=r.changed;(a||void 0==a)&&(this.reset(),this.clusters=o,this.renderClusters()),google.maps.event.trigger(this,M.CLUSTERING_END,this)}}},{key:"onAdd",value:function onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}},{key:"onRemove",value:function onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}},{key:"reset",value:function reset(){this.markers.forEach((function(t){return t.setMap(null)})),this.clusters.forEach((function(t){return t.delete()})),this.clusters=[]}},{key:"renderClusters",value:function renderClusters(){var t=this,r=new x(this.markers,this.clusters),o=this.getMap();this.clusters.forEach((function(a){1===a.markers.length?a.marker=a.markers[0]:(a.marker=t.renderer.render(a,r),t.onClusterClick&&a.marker.addListener("click",(function(r){google.maps.event.trigger(t,M.CLUSTER_CLICK,a),t.onClusterClick(r,a,o)}))),a.marker.setMap(o)}))}}]),MarkerClusterer}(P);function map_google_marker_typeof(t){return map_google_marker_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},map_google_marker_typeof(t)}function map_google_marker_defineProperties(t,r){for(var o=0;o',a.divClass=t.divClass,a.align=t.align,a.isDebugMode=t.debug,a.onClick=t.onClick,a.onMouseOver=t.onMouseOver,a.isBoolean=function(t){return"boolean"===typeof t},a.isNotUndefined=function(t){return"undefined"!==typeof t},a.hasContent=function(t){return t.length>0},a.isString=function(t){return"string"===typeof t},a.isFunction=function(t){return"function"===typeof t},o}return function map_google_marker_createClass(t,r,o){return r&&map_google_marker_defineProperties(t.prototype,r),o&&map_google_marker_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(GoogleMapsHtmlOverlay,[{key:"onAdd",value:function onAdd(){var t=this;t.div=document.createElement("div"),t.div.style.position="absolute",t.isNotUndefined(t.divClass)&&t.hasContent(t.divClass)&&(t.div.className=t.divClass),t.isNotUndefined(t.html)&&t.hasContent(t.html)&&t.isString(t.html)&&(t.div.innerHTML=t.html),t.isBoolean(t.isDebugMode)&&t.isDebugMode&&(t.div.className="debug-mode",t.div.innerHTML='
Debug mode
',t.div.setAttribute("style","position: absolute;border: 5px dashed red;height: 150px;width: 150px;display: flex;justify-content: center;align-items: center;")),t.getPanes().overlayMouseTarget.appendChild(t.div),t.div.addEventListener("click",(function(r){window.google.maps.event.trigger(t,"click"),t.isFunction(t.onClick)&&t.onClick(),r.stopPropagation()})),t.div.addEventListener("mouseover",(function(r){window.google.maps.event.trigger(t,"mouseover"),t.isFunction(t.onMouseOver)&&t.onMouseOver(),r.stopPropagation()}))}},{key:"draw",value:function draw(){var t=this,r=document.querySelector(".popup");r.length||(r=t.div);var o=t.getProjection();if(!o)return console.log("GoogleMapsHtmlOverlay: current map is missing"),null;var a=o.fromLatLngToDivPixel(t.getPosition()),i={y:void 0,x:void 0},l=r.offsetWidth,u=r.offsetHeight;switch(Array.isArray(t.align)?t.align.join(" "):""){case"left top":i.y=u,i.x=l;break;case"left center":i.y=u/2,i.x=l;break;case"left bottom":i.y=0,i.x=l;break;case"center top":i.y=u,i.x=l/2;break;case"center center":default:i.y=u/2,i.x=l/2;break;case"center bottom":i.y=0,i.x=l/2;break;case"right top":i.y=u,i.x=0;break;case"right center":i.y=u/2,i.x=0;break;case"right bottom":i.y=0,i.x=0}t.div.style.top="".concat(a.y-i.y,"px"),t.div.style.left="".concat(a.x-i.x,"px")}},{key:"getPosition",value:function getPosition(){return new window.google.maps.LatLng(this.position)}},{key:"getDiv",value:function getDiv(){return this.div}},{key:"setPosition",value:function setPosition(t,r){var o=this;o.position=t,o.align=r,o.draw()}},{key:"remove",value:function remove(){this.setMap(null),this.div.remove()}},{key:"getDraggable",value:function getDraggable(){return!1}}]),GoogleMapsHtmlOverlay}()}};function map_google_defineProperties(t,r){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:[],a=this;a.el=r,a.config=o,a.markers=[],t["init".concat(a.getName())]=function(){a.googleApiLoaded()};var i=document.createElement("script");i.src="https://maps.googleapis.com/maps/api/js?key=".concat(o.key,"&callback=init").concat(a.getName()),i.async=!0,i.defer=!0,document.head.appendChild(i)}},{key:"googleApiLoaded",value:function googleApiLoaded(){var r=this,o=r.el,i=r.config,l=o.querySelector(".mapAPI-map"),u=i.mapZoom&&"0"!==i.mapZoom?parseInt(i.mapZoom):10,c=i.center&&","!==i.center?{lat:i.center[1],lng:i.center[0]}:{lat:0,lng:0},p=i.style?i.style:null;console.log("".concat(r.getName(),": API is loaded")),r.MarkerUI=A.init(),r.map=new t.google.maps.Map(l,{zoom:u,center:c,fullscreenControl:!0,styles:p}),r.default_zoom=u,l.classList.add("mapboxgl-map"),r.popup=new r.MarkerUI({map:r.map,align:["center","top"],divClass:"mapboxgl-popup popup mapboxgl-popup-anchor-bottom d-none",html:'
\xd7
'}),r.popup.setMap(r.map),r.geocoder=new t.google.maps.Geocoder,r.cluster=new S(r.map,null,{styles:[{width:30,height:30,className:"mapboxgl-cluster"}]}),o.dispatchEvent(new Event(a))}},{key:"addMarker",value:function addMarker(t,r){var o=this,a={lat:t[1],lng:t[0]},l=new o.MarkerUI({position:a,map:o.map,align:["center","top"],html:'
').concat(r.icon,"
"),onClick:function onClick(){var t=document.querySelector("#Marker".concat(r.id));o.showPopup(a,r.content),t.dispatchEvent(new Event(i))}});return o.markers.push(l),o.cluster.addMarker(l),l.setMap(o.map),l}},{key:"showPopup",value:function showPopup(t,r){var o=this,a=o.popup.getDiv();o.config.flyToMarker&&(o.map.setCenter(t),o.config.noZoom||o.map.setZoom(18)),a.style.opacity="0",a.classList.remove("d-none"),a.querySelector(".mapboxgl-popup-content .html").innerHTML=r,a.querySelector(".mapboxgl-popup-close-button").addEventListener("click",(function(t){t.preventDefault(),o.hidePopup()})),o.popup.setPosition(t,["center","top"]),a.style.opacity="1",a.style["margin-top"]="-1rem"}},{key:"hidePopup",value:function hidePopup(){var t=this;t.popup.getDiv().classList.add("d-none"),t.config.noRestoreBounds&&!t.config.flyToBounds||t.restoreBounds(),t.el.dispatchEvent(new Event(l))}},{key:"geocode",value:function geocode(t,r){var o=this;o.geocoder.geocode({address:t},(function(t,a){if("OK"===a)return"function"===typeof r&&r(t),t;console.error("".concat(o.getName(),": Geocode was not successful for the following reason: ").concat(a))}))}},{key:"reverseGeocode",value:function reverseGeocode(t,r){var o=this;o.geocoder.geocode({location:latlng},(function(t,a){if("OK"===a)return"function"===typeof r&&r(t),t;console.error("".concat(o.getName(),": Reverse Geocoding was not successful for the following reason: ").concat(a))}))}},{key:"addGeoJson",value:function addGeoJson(r){var o=this,a=JSON.parse(r.geojson),i=new t.google.maps.LatLngBounds;a.features.forEach((function(t){var a=t.id,l=t.geometry.coordinates,u=t.properties.content;o.addMarker(l,{id:a,content:u,icon:t.icon,flyToMarker:r.flyToMarker}),i.extend({lat:parseFloat(l[1]),lng:parseFloat(l[0])})})),o.markers.length>1?o.map.fitBounds(i,{padding:30}):o.markers[0]&&o.map.setCenter(o.markers[0].getPosition()),o.default_bounds=i,o.default_zoom=o.map.getZoom()}},{key:"getMap",value:function getMap(){return this.map}},{key:"getPopup",value:function getPopup(){return this.popup}},{key:"restoreBounds",value:function restoreBounds(){var t=this;t.default_bounds&&t.markers.length>1?t.map.fitBounds(t.default_bounds,{padding:30}):(t.markers[0]&&t.map.setCenter(t.markers[0].getPosition()),t.restoreZoom())}},{key:"restoreZoom",value:function restoreZoom(){this.map.setZoom(this.default_zoom)}}]),GoogleMapsDriver}();return r}(window),j={ENVS:["xs","sm","md","lg","xl","xxl","xxxl"],MAP_DRIVER:I};function map_api_defineProperties(t,r){for(var o=0;o'),console.log("".concat(l,": init ").concat(o.getName(),"...")),r.drv=o,r.el=t,r.config=c,o.init(t,c),t.addEventListener(a,(function(){r.addMarkers()}))}return function map_api_createClass(t,r,o){return r&&map_api_defineProperties(t.prototype,r),o&&map_api_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(MapAPI,[{key:"getMap",value:function getMap(){return this.map}},{key:"dispose",value:function dispose(){this.el=null,this.el.classList.remove("".concat(l,"-active"))}},{key:"addMarkers",value:function addMarkers(){console.log("".concat(l,": addMarkers"));var t=this,r=t.el,a=t.drv,i=t.config;if(t.map=a.getMap(),i.geojson)console.log("".concat(l,": setting up geocode data")),a.addGeoJson(i);else if(i.address)console.log(i.address),console.log("".concat(l,": setting up address marker")),a.geocode(i.address,(function(r){console.log(r);var o=parseFloat(r[0].geometry.location.lat()),u=parseFloat(r[0].geometry.location.lng());console.log("".concat(l,": setting up single lat/lng marker lat: ").concat(o," lng: ").concat(u," #1")),a.addMarker([u,o],i),t.map.setCenter({lat:o,lng:u})}));else if(i.lat&&i.lng){var u=parseFloat(i.lat),c=parseFloat(i.lng);console.log("".concat(l,": setting up single lat/lng marker lat: ").concat(u," lng: ").concat(c," #2")),a.addMarker([c,u],i),t.map.setCenter({lat:u,lng:c})}r.classList.add("".concat(l,"-active")),r.dispatchEvent(new Event(o)),console.log("".concat(l,": Map is loaded"))}}]),MapAPI}(),p=function init(){console.log("".concat(l,": init")),document.querySelectorAll(".".concat(l)).forEach((function(t,r){new c(t)}))};i.addEventListener("".concat(r),p),i.addEventListener("".concat(t),p)}(window)}()}();