1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2671],{4808:function(i,n,e){e.r(n),e.d(n,{default:function(){return u}});var t,a=e(4575),s=e.n(a),o=e(3913),r=e.n(o),d=e(9713),h=e.n(d),p=e(7041),l=e(4466),u=function(){function i(n){var e=n.outerEl,t=n.latKey,a=void 0===t?"lat":t,o=n.lngKey,r=void 0===o?"lng":o,d=n.mapOptions,l=void 0===d?{}:d,u=n.onMapReady,c=void 0===u?function(){}:u,v=n.onMarkerClick,f=void 0===v?function(){}:v,m=n.onMarkerDragEnd,y=void 0===m?function(){}:m,g=n.onMarkersBoundsChange,k=void 0===g?function(){}:g,M=n.points,C=void 0===M?[]:M,E=n.mapElSelector,w=void 0===E?"[data-map]":E;s()(this,i),h()(this,"latKey",void 0),h()(this,"lngKey",void 0),h()(this,"map",null),h()(this,"markers",[]),h()(this,"onMarkersBoundsChange",void 0),h()(this,"onMapReady",void 0),h()(this,"onMarkerClick",void 0),h()(this,"onMarkerDragEnd",void 0),h()(this,"outerEl",void 0),h()(this,"points",void 0),h()(this,"isApiReady",void 0),h()(this,"isMapReady",void 0),h()(this,"mapEl",void 0),h()(this,"apiKey",void 0),h()(this,"mapOptions",void 0),h()(this,"listenerBoss",void 0),h()(this,"loadingClass","loading"),h()(this,"boundsHaveChanged",!0),this.isMapReady=!1,this.isApiReady=!1,this.outerEl=e,this.latKey=a,this.lngKey=r,this.mapOptions=l,this.onMapReady=c,this.onMarkerClick=f,this.onMarkerDragEnd=y,this.onMarkersBoundsChange=k,this.points=C,this.listenerBoss=new p.Z,this.mapEl=this.outerEl.querySelector(w),this.mapEl?this.loadTheApi():console.error("the map element could not be found",w)}return r()(i,[{key:"loadTheApi",value:function(){var i=this;this.mapEl.classList.add(this.loadingClass),new l.Z((function(n){t=n,i.apiIsReady()}))}},{key:"apiIsReady",value:function(){this.isApiReady=!0,this.mapEl.classList.remove(this.loadingClass),this.map=new t.maps.Map(this.mapEl,this.mapOptions),this.initialSetup()}},{key:"initialSetup",value:function(){var i=this;this.mapEl&&this.isApiReady&&(this.isMapReady?this.mapReady():t.maps.event.addListenerOnce(this.map,"idle",(function(){i.isMapReady=!0,i.mapReady()})))}},{key:"mapReady",value:function(){var i=this;this.setUpMarkers(),this.listenerBoss.register(window,"resize",(function(){i.boundsHaveChanged=!0,i.centerMap()})),this.listenerBoss.register(window,"site.print",(function(){i.updateMapBounds(!0),i.boundsHaveChanged=!0,i.centerMap()})),"function"==typeof this.onMapReady&&this.onMapReady.call(this,this.map,this.markers)}},{key:"setUpMarkers",value:function(){var i=this;this.points.forEach((function(n,e){var a=n[i.latKey],s=n[i.lngKey];if(a&&s){var o=(null==n?void 0:n.isDraggable)||!1,r=new t.maps.Marker({icon:n.hasOwnProperty("icon")?n.icon:null,map:i.map,opacity:n.hasOwnProperty("opacity")?n.opacity:1,optimized:!1,point:n,position:{lat:parseFloat(n[i.latKey]),lng:parseFloat(n[i.lngKey])},title:n.hasOwnProperty("title")?n.title:null,zIndex:e,draggable:o});i.markers.push(r),"function"==typeof i.onMarkerClick&&r.addListener("click",(function(){return i.onMarkerClick(r,i.map)})),o&&"function"==typeof i.onMarkerDragEnd&&r.addListener("dragend",(function(){return i.onMarkerDragEnd(r,i.map)}))}else console.error("Missing lat and/or lng",n)})),this.updateMapBounds()}},{key:"removePoints",value:function(){this.markers.length&&(this.markers.forEach((function(i){i.setMap(null)})),this.markers=[]),this.points=[]}},{key:"changePoints",value:function(i){this.removePoints(),this.points=i,this.initialSetup()}},{key:"centerMap",value:function(){if(this.map&&this.boundsHaveChanged){var i=this.map.getCenter();t.maps.event.trigger(this.map,"resize"),this.map.setCenter(i)}}},{key:"updateMapBounds",value:function(){var i=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.map&&(this.boundsHaveChanged||n)){this.boundsHaveChanged=!1;var e=!1,a=new t.maps.LatLngBounds;this.markers.forEach((function(i){i.getVisible()&&(e=!0,a.extend(i.getPosition()))})),e&&(t.maps.event.addListenerOnce(this.map,"bounds_changed",(function(){"function"==typeof i.onMarkersBoundsChange&&i.onMarkersBoundsChange(i.map),t.maps.event.addListenerOnce(i.map,"bounds_changed",(function(){i.boundsHaveChanged=!0}))}
1)),this.map.fitBounds(a))}}},{key:"resetMarkerZIndexes",value:function(){this.markers.forEach((function(i,n){i.setZIndex(n)}))}}]),i}()},4466:function(i,n,e){e.d(n,{Z:function(){return u}});var t=e(4575),a=e.n(t),s=e(3913),o=e.n(s),r=["places"],d=!1,h=!1,p=[],l=null,u=function(){function i(n){a()(this,i),h?n(l):(p.push(n),d||(d=!0,this.load()))}return o()(i,[{key:"load",value:function(){var i=window.mapsKey||"";i?e.e(567).then(e.bind(e,7708)).then((function(n){new(0,n.Loader)(i,{libraries:r}).load().then((function(i){l=i,h=!0,p.forEach((function(i){i(l)})),p=[]}))})):console.warn('No Google Maps API key was found. Please assign it to "windows.mapsKey".')}}]),i}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.