text: import*as t from"react";import{createContext as e,useContext as s,PureComponent as n,useState as i,useEffect as o}from"react";import*as r from"react-dom";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var a=process.env.NODE_ENV,l=function(t,e,s,n,i,o,r,l){if("production"!==a&&void 0===e)throw new Error("invariant requires an error message argument");if(!t){var h;if(void 0===e)h=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[s,n,i,o,r,l],c=0;(h=new Error(e.replace(/%s/g,(function(){return p[c++]})))).name="Invariant Violation"}throw h.framesToPop=1,h}};const h=e(null);function p(){l(!!s,"useGoogleMap is React hook and requires React version 16.8+");const t=s(h);return l(!!t,"useGoogleMap needs a GoogleMap available up in the tree"),t}const c=(t,e,s,n)=>{const i={};var o,r;return o=t,r=(t,o)=>{const r=s[o];r!==e[o]&&(i[o]=r,t(n,r))},Object.keys(o).forEach((function(t){return r(o[t],t)})),i};function u(t,e,s){const n=(i=s,o=function(s,n,i){return"function"==typeof t[i]&&s.push(google.maps.event.addListener(e,n,t[i])),s},r=[],Object.keys(i).reduce((function(t,e){return o(t,i[e],e)}),r));var i,o,r;return n}function d(t){google.maps.event.removeListener(t)}function g(t=[]){t.forEach(d)}function m({updaterMap:t,eventMap:e,prevProps:s,nextProps:n,instance:i}){const o=u(n,i,e);return c(t,s,n,i),o}const f={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},v={extraMapTypes(t,e){e.forEach((function(e,s){t.mapTypes.set(String(s),e)}))},center(t,e){t.setCenter(e)},clickableIcons(t,e){t.setClickableIcons(e)},heading(t,e){t.setHeading(e)},mapTypeId(t,e){t.setMapTypeId(e)},options(t,e){t.setOptions(e)},streetView(t,e){t.setStreetView(e)},tilt(t,e){t.setTilt(e)},zoom(t,e){t.setZoom(e)}};class y extends t.PureComponent{constructor(){super(...arguments),this.state={map:null},this.registeredEvents=[],this.mapRef=null,this.getInstance=()=>null===this.mapRef?null:new google.maps.Map(this.mapRef,this.props.options),this.panTo=t=>{const e=this.getInstance();e&&e.panTo(t)},this.setMapCallback=()=>{null!==this.state.map&&this.props.onLoad&&this.props.onLoad(this.state.map)},this.getRef=t=>{this.mapRef=t}}componentDidMount(){const t=this.getInstance();this.registeredEvents=m({updaterMap:v,eventMap:f,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{map:t}}),this.setMapCallback)}componentDidUpdate(t){null!==this.state.map&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:v,eventMap:f,prevProps:t,nextProps:this.props,instance:this.state.map}))}componentWillUnmount(){null!==this.state.map&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),g(this.registeredEvents))}render(){return t.createElement("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName},t.createElement(h.Provider,{value:this.state.map},null!==this.state.map?this.props.children:t.createElement(t.Fragment,null)))}}
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** */function x(t,e){var s={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(s[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(s[n[i]]=t[n[i]])}return s}function b(t,e,s,n){return new(s||(s=Promise))((function(i,o){function r(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(r,a)}l((n=n.apply(t,e||[])).next())}))}const M="undefined"!=typeof document,C=({url:t,id:e,nonce:s})=>M?new Promise((function(n,i){const o=document.getElementById(e),r=window;if(o){const s=o.getAttribute("data-state");if(o.src===t&&"error"!==s){if("ready"===s)return n(e);{const t=r.initMap,s=o.onerror;return r.initMap=function(){t&&t(),n(e)},void(o.onerror=function(t){s&&s(t),i(t)})}}o.remove()}const a=document.createElement("script");a.type="text/javascript",a.src=t,a.id=e,a.async=!0,a.nonce=s,a.onerror=function(t){a.setAttribute("data-state","error"),i(t)},r.initMap=function(){a.setAttribute("data-state","ready"),n(e)},document.head.appendChild(a)})).catch((t=>{throw console.error("injectScript error: ",t),t})):Promise.reject(new Error("document is undefined")),k=t=>!(!t.href||0!==t.href.indexOf("https://fonts.googleapis.com/css?family=Roboto"))||("style"===t.tagName.toLowerCase()&&t.styleSheet&&t.styleSheet.cssText&&0===t.styleSheet.cssText.replace("\r\n","").indexOf(".gm-style")?(t.styleSheet.cssText="",!0):"style"===t.tagName.toLowerCase()&&t.innerHTML&&0===t.innerHTML.replace("\r\n","").indexOf(".gm-style")?(t.innerHTML="",!0):"style"===t.tagName.toLowerCase()&&!t.styleSheet&&!t.innerHTML),w=()=>{const t=document.getElementsByTagName("head")[0],e=t.insertBefore.bind(t);t.insertBefore=function(s,n){k(s)||Reflect.apply(e,t,[s,n])};const s=t.appendChild.bind(t);t.appendChild=function(e){k(e)||Reflect.apply(s,t,[e])}};function P({googleMapsApiKey:t,googleMapsClientId:e,version:s="weekly",language:n,region:i,libraries:o,channel:r,mapIds:a}){const h=[];return l(t&&e||!(t&&e),"You need to specify either googleMapsApiKey or googleMapsClientId for @react-google-maps/api load script to work. You cannot use both at the same time."),t?h.push(`key=${t}`):e&&h.push(`client=${e}`),s&&h.push(`v=${s}`),n&&h.push(`language=${n}`),i&&h.push(`region=${i}`),o&&o.length&&h.push(`libraries=${o.sort().join(",")}`),r&&h.push(`channel=${r}`),a&&a.length&&h.push(`map_ids=${a.join(",")}`),h.push("callback=initMap"),`https://maps.googleapis.com/maps/api/js?${h.join("&")}`}let L=!1;function E(){return t.createElement("div",null,"Loading...")}const S={id:"script-loader",version:"weekly"};class _ extends t.PureComponent{constructor(){super(...arguments),this.check=t.createRef(),this.state={loaded:!1},this.cleanupCallback=()=>{delete window.google.maps,this.injectScript()},this.isCleaningUp=()=>b(this,void 0,void 0,(function*(){return new Promise((function(t){if(L){if(M){const e=window.setInterval((function(){L||(window.clearInterval(e),t())}),1)}}else t()}))})),this.cleanup=()=>{L=!0;const t=document.getElementById(this.props.id);t&&t.parentNode&&t.parentNode.removeChild(t),Array.prototype.slice.call(document.getElementsByTagName("script")).filter((function(t){return"string"==typeof t.src&&t.src.includes("maps.googleapis")})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})),Array.prototype.slice.call(document.getElementsByTagName("link")).filter((function(t){return"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"===t.href})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})),Array.prototype.slice.call(document.getElementsByTagName("style")).filter((function(t){return void 0!==t.innerText&&t.innerText.length>0&&t.innerText.includes(".gm-")})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)}))},this.injectScript=()=>{this.props.preventGoogleFontsLoading&&w(),l(!!this.props.id,'LoadScript requires "id" prop to be a string: %s',this.props.id);const t={id:this.props.id,nonce:this.props.nonce,url:P(this.props)};C(t).then((()=>{this.props.onLoad&&this.props.onLoad(),this.setState((function(){return{loaded:!0}}))})).catch((t=>{this.props.onError&&this.props.onError(t),console.error(`\n          There has been an Error with loading Google Maps API script, please check that you provided correct google API key (${this.props.googleMapsApiKey||"-"}) or Client ID (${this.props.googleMapsClientId||"-"}) to <LoadScript />\n          Otherwise it is a Network issue.\n        `)}))}}componentDidMount(){if(M){if(window.google&&window.google.maps&&!L)return void console.error("google api is already presented");this.isCleaningUp().then(this.injectScript).catch((function(t){console.error("Error at injecting script after cleaning up: ",t)}))}}componentDidUpdate(t){this.props.libraries!==t.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),M&&t.language!==this.props.language&&(this.cleanup(),this.setState((function(){return{loaded:!1}}),this.cleanupCallback))}componentWillUnmount(){if(M){this.cleanup();const t=()=>{this.check.current||(delete window.google,L=!1)};window.setTimeout(t,1),this.props.onUnmount&&this.props.onUnmount()}}render(){return t.createElement(t.Fragment,null,t.createElement("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||t.createElement(E,null))}}let O;function I({id:e=S.id,version:s=S.version,nonce:n,googleMapsApiKey:i,googleMapsClientId:o,language:r,region:a,libraries:h,preventGoogleFontsLoading:p,channel:c,mapIds:u}){const d=t.useRef(!1),[g,m]=t.useState(!1),[f,v]=t.useState(void 0);t.useEffect((function(){return d.current=!0,()=>{d.current=!1}}),[]),t.useEffect((function(){M&&p&&w()}),[p]),t.useEffect((function(){g&&l(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")}),[g]);const y=P({version:s,googleMapsApiKey:i,googleMapsClientId:o,language:r,region:a,libraries:h,channel:c,mapIds:u});t.useEffect((function(){function t(){d.current&&(m(!0),O=y)}M&&(window.google&&window.google.maps&&O===y?t():C({id:e,url:y,nonce:n}).then(t).catch((function(t){d.current&&v(t),console.warn(`\n        There has been an Error with loading Google Maps API script, please check that you provided correct google API key (${i||"-"}) or Client ID (${o||"-"})\n        Otherwise it is a Network issue.\n      `),console.error(t)})))}),[e,y,n]);const x=t.useRef();return t.useEffect((function(){x.current&&h!==x.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),x.current=h}),[h]),{isLoaded:g,loadError:f,url:y}}_.defaultProps=S;const D=t.createElement(E,null);var T=t.memo((function(e){var{loadingElement:s,onLoad:n,onError:i,onUnmount:o,children:r}=e,a=x(e,["loadingElement","onLoad","onError","onUnmount","children"]);const{isLoaded:l,loadError:h}=I(a);return t.useEffect((function(){l&&"function"==typeof n&&n()}),[l,n]),t.useEffect((function(){h&&"function"==typeof i&&i(h)}),[h,i]),t.useEffect((function(){return()=>{o&&o()}}),[o]),l?r:s||D})),B=function t(e,s){if(e===s)return!0;if(e&&s&&"object"==typeof e&&"object"==typeof s){if(e.constructor!==s.constructor)return!1;var n,i,o;if(Array.isArray(e)){if((n=e.length)!=s.length)return!1;for(i=n;0!=i--;)if(!t(e[i],s[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===s.source&&e.flags===s.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===s.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===s.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(s).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(s,o[i]))return!1;for(i=n;0!=i--;){var r=o[i];if(!t(e[r],s[r]))return!1}return!0}return e!=e&&s!=s};class U{constructor({apiKey:t,channel:e,client:s,id:n="__googleMapsScriptId",libraries:i=[],language:o,region:r,version:a,mapIds:l,nonce:h,retries:p=3,url:c="https://maps.googleapis.com/maps/api/js"}){if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.version=a,this.apiKey=t,this.channel=e,this.client=s,this.id=n||"__googleMapsScriptId",this.libraries=i,this.language=o,this.region=r,this.mapIds=l,this.nonce=h,this.retries=p,this.url=c,U.instance){if(!B(this.options,U.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(U.instance.options)}`);return U.instance}U.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url}}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let t=this.url;return t+=`?callback=${this.CALLBACK}`,this.apiKey&&(t+=`&key=${this.apiKey}`),this.channel&&(t+=`&channel=${this.channel}`),this.client&&(t+=`&client=${this.client}`),this.libraries.length>0&&(t+=`&libraries=${this.libraries.join(",")}`),this.language&&(t+=`&language=${this.language}`),this.region&&(t+=`&region=${this.region}`),this.version&&(t+=`&v=${this.version}`),this.mapIds&&(t+=`&map_ids=${this.mapIds.join(",")}`),t}deleteScript(){const t=document.getElementById(this.id);t&&t.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise(((t,e)=>{this.loadCallback((s=>{s?e(s.error):t(window.google)}))}))}loadCallback(t){this.callbacks.push(t),this.execute()}setScript(){if(document.getElementById(this.id))return void this.callback();const t=this.createUrl(),e=document.createElement("script");e.id=this.id,e.type="text/javascript",e.src=t,e.onerror=this.loadErrorCallback.bind(this),e.defer=!0,e.async=!0,this.nonce&&(e.nonce=this.nonce),document.head.appendChild(e)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(t){if(this.errors.push(t),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.log(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout((()=>{this.deleteScript(),this.setScript()}),t)}else this.onerrorEvent=t,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach((t=>{t(this.onerrorEvent)})),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}function z({id:e=S.id,version:s=S.version,nonce:n,googleMapsApiKey:i,language:o,region:r,libraries:a,preventGoogleFontsLoading:l,mapIds:h,url:p}){const c=t.useRef(!1),[u,d]=t.useState(!1),[g,m]=t.useState(void 0);t.useEffect((function(){return c.current=!0,()=>{c.current=!1}}),[]);const f=t.useMemo((function(){return new U({id:e,apiKey:i,version:s,libraries:a,language:o,region:r,mapIds:h,nonce:n,url:p})}),[e,i,s,a,o,r,h,n]);t.useEffect((function(){u||f.load().then((function(){c.current&&d(!0)})).catch((function(t){m(t)}))}),[]),t.useEffect((function(){M&&l&&w()}),[l]);const v=t.useRef();return t.useEffect((function(){v.current&&a!==v.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),v.current=a}),[a]),{isLoaded:u,loadError:g}}const A={},R={options(t,e){t.setOptions(e)}};class j extends n{constructor(){super(...arguments),this.state={trafficLayer:null},this.setTrafficLayerCallback=()=>{null!==this.state.trafficLayer&&this.props.onLoad&&this.props.onLoad(this.state.trafficLayer)},this.registeredEvents=[]}componentDidMount(){const t=new google.maps.TrafficLayer(Object.assign(Object.assign({},this.props.options||{}),{map:this.context}));this.registeredEvents=m({updaterMap:R,eventMap:A,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{trafficLayer:t}}),this.setTrafficLayerCallback)}componentDidUpdate(t){null!==this.state.trafficLayer&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:R,eventMap:A,prevProps:t,nextProps:this.props,instance:this.state.trafficLayer}))}componentWillUnmount(){null!==this.state.trafficLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),g(this.registeredEvents),this.state.trafficLayer.setMap(null))}render(){return null}}j.contextType=h;class W extends t.PureComponent{constructor(){super(...arguments),this.state={bicyclingLayer:null},this.setBicyclingLayerCallback=()=>{null!==this.state.bicyclingLayer&&(this.state.bicyclingLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.bicyclingLayer))}}componentDidMount(){const t=new google.maps.BicyclingLayer;this.setState((function(){return{bicyclingLayer:t}}),this.setBicyclingLayerCallback)}componentWillUnmount(){null!==this.state.bicyclingLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))}render(){return null}}W.contextType=h;class N extends t.PureComponent{constructor(){super(...arguments),this.state={transitLayer:null},this.setTransitLayerCallback=()=>{null!==this.state.transitLayer&&(this.state.transitLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.transitLayer))}}componentDidMount(){const t=new google.maps.TransitLayer;this.setState((function(){return{transitLayer:t}}),this.setTransitLayerCallback)}componentWillUnmount(){null!==this.state.transitLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))}render(){return null}}N.contextType=h;const V={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},Z={drawingMode(t,e){t.setDrawingMode(e)},options(t,e){t.setOptions(e)}};class F extends t.PureComponent{constructor(t){super(t),this.registeredEvents=[],this.state={drawingManager:null},this.setDrawingManagerCallback=()=>{null!==this.state.drawingManager&&this.props.onLoad&&this.props.onLoad(this.state.drawingManager)},l(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing)}componentDidMount(){const t=new google.maps.drawing.DrawingManager(Object.assign(Object.assign({},this.props.options||{}),{map:this.context}));this.registeredEvents=m({updaterMap:Z,eventMap:V,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{drawingManager:t}}),this.setDrawingManagerCallback)}componentDidUpdate(t){null!==this.state.drawingManager&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:Z,eventMap:V,prevProps:t,nextProps:this.props,instance:this.state.drawingManager}))}componentWillUnmount(){null!==this.state.drawingManager&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),g(this.registeredEvents),this.state.drawingManager.setMap(null))}render(){return t.createElement(t.Fragment,null)}}F.contextType=h;const H={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},G={animation(t,e){t.setAnimation(e)},clickable(t,e){t.setClickable(e)},cursor(t,e){t.setCursor(e)},draggable(t,e){t.setDraggable(e)},icon(t,e){t.setIcon(e)},label(t,e){t.setLabel(e)},map(t,e){t.setMap(e)},opacity(t,e){t.setOpacity(e)},options(t,e){t.setOptions(e)},position(t,e){t.setPosition(e)},shape(t,e){t.setShape(e)},title(t,e){t.setTitle(e)},visible(t,e){t.setVisible(e)},zIndex(t,e){t.setZIndex(e)}};class q extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[]}componentDidMount(){const t=Object.assign(Object.assign(Object.assign({},this.props.options||{}),this.props.clusterer?{}:{map:this.context}),{position:this.props.position});this.marker=new google.maps.Marker(t),this.props.clusterer?this.props.clusterer.addMarker(this.marker,!!this.props.noClustererRedraw):this.marker.setMap(this.context),this.registeredEvents=m({updaterMap:G,eventMap:H,prevProps:{},nextProps:this.props,instance:this.marker}),this.props.onLoad&&this.props.onLoad(this.marker)}componentDidUpdate(t){this.marker&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:G,eventMap:H,prevProps:t,nextProps:this.props,instance:this.marker}))}componentWillUnmount(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),g(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))}render(){let e=null;return this.props.children&&(e=t.Children.map(this.props.children,(e=>{if(!t.isValidElement(e))return e;let s=e;return t.cloneElement(s,{anchor:this.marker})}))),e||null}}q.contextType=h;var $=function(){function t(e,s){e.getClusterer().extend(t,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=s,this.center=void 0,this.div=null,this.sums=null,this.visible=!1,this.boundsChangedListener=null,this.url="",this.height=0,this.width=0,this.anchorText=[0,0],this.anchorIcon=[0,0],this.textColor="black",this.textSize=11,this.textDecoration="none",this.fontWeight="bold",this.fontStyle="normal",this.fontFamily="Arial,sans-serif",this.backgroundPosition="0 0",this.setMap(e.getMap())}return t.prototype.onAdd=function(){var t,e,s=this;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(),"boundschanged",(function(){e=t})),google.maps.event.addDomListener(this.div,"mousedown",(function(){t=!0,e=!1})),google.maps.event.addDomListener(this.div,"click",(function(n){if(t=!1,!e){var i=s.cluster.getClusterer();if(google.maps.event.trigger(i,"click",s.cluster),google.maps.event.trigger(i,"clusterclick",s.cluster),i.getZoomOnClick()){var o=i.getMaxZoom(),r=s.cluster.getBounds();i.getMap().fitBounds(r),setTimeout((function(){i.getMap().fitBounds(r),null!==o&&i.getMap().getZoom()>o&&i.getMap().setZoom(o+1)}),100)}n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation()}})),google.maps.event.addDomListener(this.div,"mouseover",(function(){google.maps.event.trigger(s.cluster.getClusterer(),"mouseover",s.cluster)})),google.maps.event.addDomListener(this.div,"mouseout",(function(){google.maps.event.trigger(s.cluster.getClusterer(),"mouseout",s.cluster)}))},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),null!==this.boundsChangedListener&&google.maps.event.removeListener(this.boundsChangedListener),google.maps.event.clearInstanceListeners(this.div),this.div.parentNode.removeChild(this.div),this.div=null)},t.prototype.draw=function(){if(this.visible&&null!==this.div&&this.center){var t=this.getPosFromLatLng(this.center),e=t.x,s=t.y;this.div.style.top=s+"px",this.div.style.left=e+"px"}},t.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},t.prototype.show=function(){if(this.div&&this.center){var t="",e="",s=this.backgroundPosition.split(" "),n=parseInt(s[0].replace(/^\s+|\s+$/g,""),10),i=parseInt(s[1].replace(/^\s+|\s+$/g,""),10),o=this.getPosFromLatLng(this.center);e=null===this.sums||void 0===this.sums.title||""===this.sums.title?this.cluster.getClusterer().getTitle():this.sums.title,this.div.style.cssText=this.createCss(o),t="<img alt='"+e+"' src='"+this.url+"' style='position: absolute; top: "+i+"px; left: "+n+"px; ",this.cluster.getClusterer().enableRetinaIcons||(t+="clip: rect("+-1*i+"px, "+(-1*n+this.width)+"px, "+(-1*i+this.height)+"px, "+-1*n+"px);"),t+="'>",this.div.innerHTML=t+"<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>",this.div.title=e,this.div.style.display=""}this.visible=!0},t.prototype.useStyle=function(t){this.sums=t;var e=this.cluster.getClusterer().getStyles(),s=e[Math.min(e.length-1,Math.max(0,t.index-1))];this.url=s.url,this.height=s.height,this.width=s.width,s.className&&(this.className=this.clusterClassName+" "+s.className),this.anchorText=s.anchorText||[0,0],this.anchorIcon=s.anchorIcon||[this.height/2,this.width/2],this.textColor=s.textColor||"black",this.textSize=s.textSize||11,this.textDecoration=s.textDecoration||"none",this.fontWeight=s.fontWeight||"bold",this.fontStyle=s.fontStyle||"normal",this.fontFamily=s.fontFamily||"Arial,sans-serif",this.backgroundPosition=s.backgroundPosition||"0 0"},t.prototype.setCenter=function(t){this.center=t},t.prototype.createCss=function(t){var e=[];return e.push("cursor: pointer;"),e.push("position: absolute; top: "+t.y+"px; left: "+t.x+"px;"),e.push("width: "+this.width+"px; height: "+this.height+"px;"),e.join("")},t.prototype.getPosFromLatLng=function(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x-=this.anchorIcon[1],e.y-=this.anchorIcon[0],e},t}(),K=function(){function t(t){this.markerClusterer=t,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new $(this,this.markerClusterer.getStyles())}return t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var t=new google.maps.LatLngBounds(this.center,this.center),e=this.getMarkers(),s=0;s<e.length;s++){var n=e[s].getPosition();n&&t.extend(n)}return t},t.prototype.remove=function(){this.clusterIcon.setMap(null),this.markers=[],delete this.markers},t.prototype.addMarker=function(t){if(this.isMarkerAlreadyAdded(t))return!1;var e;if(this.center){if(this.averageCenter&&(e=t.getPosition())){var s=this.markers.length+1;this.center=new google.maps.LatLng((this.center.lat()*(s-1)+e.lat())/s,(this.center.lng()*(s-1)+e.lng())/s),this.calculateBounds()}}else(e=t.getPosition())&&(this.center=e,this.calculateBounds());t.isAdded=!0,this.markers.push(t);var n=this.markers.length,i=this.markerClusterer.getMaxZoom(),o=this.map.getZoom();if(null!==i&&void 0!==o&&o>i)t.getMap()!==this.map&&t.setMap(this.map);else if(n<this.minClusterSize)t.getMap()!==this.map&&t.setMap(this.map);else if(n===this.minClusterSize)for(var r=0;r<n;r++)this.markers[r].setMap(null);else t.setMap(null);return!0},t.prototype.isMarkerInClusterBounds=function(t){if(null!==this.bounds){var e=t.getPosition();if(e)return this.bounds.contains(e)}return!1},t.prototype.calculateBounds=function(){this.bounds=this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center,this.center))},t.prototype.updateIcon=function(){var t=this.markers.length,e=this.markerClusterer.getMaxZoom(),s=this.map.getZoom();null!==e&&void 0!==s&&s>e||t<this.minClusterSize?this.clusterIcon.hide():(this.center&&this.clusterIcon.setCenter(this.center),this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers,this.markerClusterer.getStyles().length)),this.clusterIcon.show())},t.prototype.isMarkerAlreadyAdded=function(t){if(this.markers.includes)return this.markers.includes(t);for(var e=0;e<this.markers.length;e++)if(t===this.markers[e])return!0;return!1},t}(),Y=function(t,e){var s=t.length,n=s.toString().length,i=Math.min(n,e);return{text:s.toString(),index:i,title:""}},Q=[53,56,66,78,90],J=function(){function t(e,s,n){void 0===s&&(s=[]),void 0===n&&(n={}),this.extend(t,google.maps.OverlayView),this.markers=[],this.clusters=[],this.listeners=[],this.activeMap=null,this.ready=!1,this.gridSize=n.gridSize||60,this.minClusterSize=n.minimumClusterSize||2,this.maxZoom=n.maxZoom||null,this.styles=n.styles||[],this.title=n.title||"",this.zoomOnClick=!0,void 0!==n.zoomOnClick&&(this.zoomOnClick=n.zoomOnClick),this.averageCenter=!1,void 0!==n.averageCenter&&(this.averageCenter=n.averageCenter),this.ignoreHidden=!1,void 0!==n.ignoreHidden&&(this.ignoreHidden=n.ignoreHidden),this.enableRetinaIcons=!1,void 0!==n.enableRetinaIcons&&(this.enableRetinaIcons=n.enableRetinaIcons),this.imagePath=n.imagePath||"https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",this.imageExtension=n.imageExtension||"png",this.imageSizes=n.imageSizes||Q,this.calculator=n.calculator||Y,this.batchSize=n.batchSize||2e3,this.batchSizeIE=n.batchSizeIE||500,this.clusterClass=n.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize=this.batchSizeIE),this.timerRefStatic=null,this.setupStyles(),this.addMarkers(s,!0),this.setMap(e)}return t.prototype.onAdd=function(){var t=this;this.activeMap=this.getMap(),this.ready=!0,this.repaint(),this.listeners=[google.maps.event.addListener(this.getMap(),"zoom_changed",(function(){t.resetViewport(!1),t.getMap().getZoom()!==(t.get("minZoom")||0)&&t.getMap().getZoom()!==t.get("maxZoom")||google.maps.event.trigger(t,"idle")})),google.maps.event.addListener(this.getMap(),"idle",(function(){t.redraw()}))]},t.prototype.onRemove=function(){for(var t=0;t<this.markers.length;t++)this.markers[t].getMap()!==this.activeMap&&this.markers[t].setMap(this.activeMap);for(t=0;t<this.clusters.length;t++)this.clusters[t].remove();this.clusters=[];for(t=0;t<this.listeners.length;t++)google.maps.event.removeListener(this.listeners[t]);this.listeners=[],this.activeMap=null,this.ready=!1},t.prototype.draw=function(){},t.prototype.setupStyles=function(){if(!(this.styles.length>0))for(var t=0;t<this.imageSizes.length;t++)this.styles.push({url:this.imagePath+(t+1)+"."+this.imageExtension,height:this.imageSizes[t],width:this.imageSizes[t]})},t.prototype.fitMapToMarkers=function(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,s=0;s<t.length;s++){var n=t[s].getPosition();n&&e.extend(n)}this.getMap().fitBounds(e)},t.prototype.getGridSize=function(){return this.gridSize},t.prototype.setGridSize=function(t){this.gridSize=t},t.prototype.getMinimumClusterSize=function(){return this.minClusterSize},t.prototype.setMinimumClusterSize=function(t){this.minClusterSize=t},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.setMaxZoom=function(t){this.maxZoom=t},t.prototype.getStyles=function(){return this.styles},t.prototype.setStyles=function(t){this.styles=t},t.prototype.getTitle=function(){return this.title},t.prototype.setTitle=function(t){this.title=t},t.prototype.getZoomOnClick=function(){return this.zoomOnClick},t.prototype.setZoomOnClick=function(t){this.zoomOnClick=t},t.prototype.getAverageCenter=function(){return this.averageCenter},t.prototype.setAverageCenter=function(t){this.averageCenter=t},t.prototype.getIgnoreHidden=function(){return this.ignoreHidden},t.prototype.setIgnoreHidden=function(t){this.ignoreHidden=t},t.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons},t.prototype.setEnableRetinaIcons=function(t){this.enableRetinaIcons=t},t.prototype.getImageExtension=function(){return this.imageExtension},t.prototype.setImageExtension=function(t){this.imageExtension=t},t.prototype.getImagePath=function(){return this.imagePath},t.prototype.setImagePath=function(t){this.imagePath=t},t.prototype.getImageSizes=function(){return this.imageSizes},t.prototype.setImageSizes=function(t){this.imageSizes=t},t.prototype.getCalculator=function(){return this.calculator},t.prototype.setCalculator=function(t){this.calculator=t},t.prototype.getBatchSizeIE=function(){return this.batchSizeIE},t.prototype.setBatchSizeIE=function(t){this.batchSizeIE=t},t.prototype.getClusterClass=function(){return this.clusterClass},t.prototype.setClusterClass=function(t){this.clusterClass=t},t.prototype.getMarkers=function(){return this.markers},t.prototype.getTotalMarkers=function(){return this.markers.length},t.prototype.getClusters=function(){return this.clusters},t.prototype.getTotalClusters=function(){return this.clusters.length},t.prototype.addMarker=function(t,e){this.pushMarkerTo(t),e||this.redraw()},t.prototype.addMarkers=function(t,e){for(var s in t)t.hasOwnProperty(s)&&this.pushMarkerTo(t[s]);e||this.redraw()},t.prototype.pushMarkerTo=function(t){var e=this;t.getDraggable()&&google.maps.event.addListener(t,"dragend",(function(){e.ready&&(t.isAdded=!1,e.repaint())})),t.isAdded=!1,this.markers.push(t)},t.prototype.removeMarker_=function(t){var e=-1;if(this.markers.indexOf)e=this.markers.indexOf(t);else for(var s=0;s<this.markers.length;s++)if(t===this.markers[s]){e=s;break}return-1!==e&&(t.setMap(null),this.markers.splice(e,1),!0)},t.prototype.removeMarker=function(t,e){var s=this.removeMarker_(t);return!e&&s&&this.repaint(),s},t.prototype.removeMarkers=function(t,e){for(var s=!1,n=0;n<t.length;n++)s=s||this.removeMarker_(t[n]);return!e&&s&&this.repaint(),s},t.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers=[]},t.prototype.repaint=function(){var t=this.clusters.slice();this.clusters=[],this.resetViewport(!1),this.redraw(),setTimeout((function(){for(var e=0;e<t.length;e++)t[e].remove()}),0)},t.prototype.getExtendedBounds=function(t){var e=this.getProjection(),s=e.fromLatLngToDivPixel(new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()));s.x+=this.gridSize,s.y-=this.gridSize;var n=e.fromLatLngToDivPixel(new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()));return n.x-=this.gridSize,n.y+=this.gridSize,t.extend(e.fromDivPixelToLatLng(s)),t.extend(e.fromDivPixelToLatLng(n)),t},t.prototype.redraw=function(){this.createClusters(0)},t.prototype.resetViewport=function(t){for(var e=0;e<this.clusters.length;e++)this.clusters[e].remove();this.clusters=[];for(e=0;e<this.markers.length;e++){var s=this.markers[e];s.isAdded=!1,t&&s.setMap(null)}},t.prototype.distanceBetweenPoints=function(t,e){var s=(e.lat()-t.lat())*Math.PI/180,n=(e.lng()-t.lng())*Math.PI/180,i=Math.sin(s/2)*Math.sin(s/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(n/2)*Math.sin(n/2);return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))*6371},t.prototype.isMarkerInBounds=function(t,e){var s=t.getPosition();return!!s&&e.contains(s)},t.prototype.addToClosestCluster=function(t){for(var e,s=4e4,n=null,i=0;i<this.clusters.length;i++){var o=(e=this.clusters[i]).getCenter(),r=t.getPosition();if(o&&r){var a=this.distanceBetweenPoints(o,r);a<s&&(s=a,n=e)}}n&&n.isMarkerInClusterBounds(t)?n.addMarker(t):((e=new K(this)).addMarker(t),this.clusters.push(e))},t.prototype.createClusters=function(t){var e=this;if(this.ready){0===t&&(google.maps.event.trigger(this,"clusteringbegin",this),null!==this.timerRefStatic&&(window.clearTimeout(this.timerRefStatic),delete this.timerRefStatic));for(var s=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)),n=this.getExtendedBounds(s),i=Math.min(t+this.batchSize,this.markers.length),o=t;o<i;o++){var r=this.markers[o];!r.isAdded&&this.isMarkerInBounds(r,n)&&(!this.ignoreHidden||this.ignoreHidden&&r.getVisible())&&this.addToClosestCluster(r)}if(i<this.markers.length)this.timerRefStatic=window.setTimeout((function(){e.createClusters(i)}),0);else{this.timerRefStatic=null,google.maps.event.trigger(this,"clusteringend",this);for(o=0;o<this.clusters.length;o++)this.clusters[o].updateIcon()}}},t.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype[e]=t.prototype[e];return this}.apply(t,[e])},t}();const X={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},tt={averageCenter(t,e){t.setAverageCenter(e)},batchSizeIE(t,e){t.setBatchSizeIE(e)},calculator(t,e){t.setCalculator(e)},clusterClass(t,e){t.setClusterClass(e)},enableRetinaIcons(t,e){t.setEnableRetinaIcons(e)},gridSize(t,e){t.setGridSize(e)},ignoreHidden(t,e){t.setIgnoreHidden(e)},imageExtension(t,e){t.setImageExtension(e)},imagePath(t,e){t.setImagePath(e)},imageSizes(t,e){t.setImageSizes(e)},maxZoom(t,e){t.setMaxZoom(e)},minimumClusterSize(t,e){t.setMinimumClusterSize(e)},styles(t,e){t.setStyles(e)},title(t,e){t.setTitle(e)},zoomOnClick(t,e){t.setZoomOnClick(e)}};class et extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.state={markerClusterer:null},this.setClustererCallback=()=>{null!==this.state.markerClusterer&&this.props.onLoad&&this.props.onLoad(this.state.markerClusterer)}}componentDidMount(){if(this.context){const t=new J(this.context,[],this.props.options);this.registeredEvents=m({updaterMap:tt,eventMap:X,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{markerClusterer:t}}),this.setClustererCallback)}}componentDidUpdate(t){this.state.markerClusterer&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:tt,eventMap:X,prevProps:t,nextProps:this.props,instance:this.state.markerClusterer}))}componentWillUnmount(){null!==this.state.markerClusterer&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),g(this.registeredEvents),this.state.markerClusterer.setMap(null))}render(){return null!==this.state.markerClusterer?this.props.children(this.state.markerClusterer):null}}et.contextType=h;var st=function(){function t(e){void 0===e&&(e={}),this.extend(t,google.maps.OverlayView),this.content=e.content||"",this.disableAutoPan=e.disableAutoPan||!1,this.maxWidth=e.maxWidth||0,this.pixelOffset=e.pixelOffset||new google.maps.Size(0,0),this.position=e.position||new google.maps.LatLng(0,0),this.zIndex=e.zIndex||null,this.boxClass=e.boxClass||"infoBox",this.boxStyle=e.boxStyle||{},this.closeBoxMargin=e.closeBoxMargin||"2px",this.closeBoxURL=e.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===e.closeBoxURL&&(this.closeBoxURL=""),this.infoBoxClearance=e.infoBoxClearance||new google.maps.Size(1,1),void 0===e.visible&&(void 0===e.isHidden?e.visible=!0:e.visible=!e.isHidden),this.isHidden=!e.visible,this.alignBottom=e.alignBottom||!1,this.pane=e.pane||"floatPane",this.enableEventPropagation=e.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}return t.prototype.createInfoBoxDiv=function(){var t=this;function e(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}if(!this.div){if(this.div=document.createElement("div"),this.setBoxStyle(),"string"==typeof this.content?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content)),this.getPanes()[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(0!==this.maxWidth&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var s=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-s.left-s.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var n=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],i=0;i<n.length;i++)this.eventListeners.push(google.maps.event.addDomListener(this.div,n[i],e));this.eventListeners.push(google.maps.event.addDomListener(this.div,"mouseover",(function(){t.div&&(t.div.style.cursor="default")})))}this.contextListener=google.maps.event.addDomListener(this.div,"contextmenu",(function(s){s.returnValue=!1,s.preventDefault&&s.preventDefault(),t.enableEventPropagation||e(s)})),google.maps.event.trigger(this,"domready")}},t.prototype.getCloseBoxImg=function(){var t="";return""!==this.closeBoxURL&&(t='<img alt=""',t+=' aria-hidden="true"',t+=" src='"+this.closeBoxURL+"'",t+=" align=right",t+=" style='",t+=" position: relative;",t+=" cursor: pointer;",t+=" margin: "+this.closeBoxMargin+";",t+="'>"),t},t.prototype.addClickHandler=function(){if(this.div&&this.div.firstChild&&""!==this.closeBoxURL){var t=this.div.firstChild;this.closeListener=google.maps.event.addDomListener(t,"click",this.getCloseClickHandler())}else this.closeListener=null},t.prototype.getCloseClickHandler=function(){var t=this;return function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),google.maps.event.trigger(t,"closeclick"),t.close()}},t.prototype.panBox=function(t){if(this.div&&!t){var e=this.getMap();if(e instanceof google.maps.Map){var s=0,n=0,i=e.getBounds();i&&!i.contains(this.position)&&e.setCenter(this.position);var o=e.getDiv(),r=o.offsetWidth,a=o.offsetHeight,l=this.pixelOffset.width,h=this.pixelOffset.height,p=this.div.offsetWidth,c=this.div.offsetHeight,u=this.infoBoxClearance.width,d=this.infoBoxClearance.height,g=this.getProjection().fromLatLngToContainerPixel(this.position);null!==g&&(g.x<-l+u?s=g.x+l-u:g.x+p+l+u>r&&(s=g.x+p+l+u-r),this.alignBottom?g.y<-h+d+c?n=g.y+h-d-c:g.y+h+d>a&&(n=g.y+h+d-a):g.y<-h+d?n=g.y+h-d:g.y+c+h+d>a&&(n=g.y+c+h+d-a)),0===s&&0===n||e.panBy(s,n)}}},t.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var t=this.boxStyle;for(var e in t)t.hasOwnProperty(e)&&(this.div.style[e]=t[e]);if(this.div.style.webkitTransform="translateZ(0)",void 0!==this.div.style.opacity&&""!==this.div.style.opacity){var s=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*s+')"',this.div.style.filter="alpha(opacity="+100*s+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",null!==this.zIndex&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},t.prototype.getBoxWidths=function(){var t={top:0,bottom:0,left:0,right:0};if(!this.div)return t;if(document.defaultView&&document.defaultView.getComputedStyle){var e=this.div.ownerDocument,s=e&&e.defaultView?e.defaultView.getComputedStyle(this.div,""):null;s&&(t.top=parseInt(s.borderTopWidth||"",10)||0,t.bottom=parseInt(s.borderBottomWidth||"",10)||0,t.left=parseInt(s.borderLeftWidth||"",10)||0,t.right=parseInt(s.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var n=this.div.currentStyle;n&&(t.top=parseInt(n.borderTopWidth||"",10)||0,t.bottom=parseInt(n.borderBottomWidth||"",10)||0,t.left=parseInt(n.borderLeftWidth||"",10)||0,t.right=parseInt(n.borderRightWidth||"",10)||0)}return t},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},t.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var t=this.getProjection().fromLatLngToDivPixel(this.position);null!==t&&(this.div.style.left=t.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(t.y+this.pixelOffset.height)+"px":this.div.style.top=t.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},t.prototype.setOptions=function(t){void 0===t&&(t={}),void 0!==t.boxClass&&(this.boxClass=t.boxClass,this.setBoxStyle()),void 0!==t.boxStyle&&(this.boxStyle=t.boxStyle,this.setBoxStyle()),void 0!==t.content&&this.setContent(t.content),void 0!==t.disableAutoPan&&(this.disableAutoPan=t.disableAutoPan),void 0!==t.maxWidth&&(this.maxWidth=t.maxWidth),void 0!==t.pixelOffset&&(this.pixelOffset=t.pixelOffset),void 0!==t.alignBottom&&(this.alignBottom=t.alignBottom),void 0!==t.position&&this.setPosition(t.position),void 0!==t.zIndex&&this.setZIndex(t.zIndex),void 0!==t.closeBoxMargin&&(this.closeBoxMargin=t.closeBoxMargin),void 0!==t.closeBoxURL&&(this.closeBoxURL=t.closeBoxURL),void 0!==t.infoBoxClearance&&(this.infoBoxClearance=t.infoBoxClearance),void 0!==t.isHidden&&(this.isHidden=t.isHidden),void 0!==t.visible&&(this.isHidden=!t.visible),void 0!==t.enableEventPropagation&&(this.enableEventPropagation=t.enableEventPropagation),this.div&&this.draw()},t.prototype.setContent=function(t){this.content=t,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),"string"==typeof t?this.div.innerHTML=this.getCloseBoxImg()+t:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(t)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px","string"==typeof t?this.div.innerHTML=this.getCloseBoxImg()+t:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(t))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},t.prototype.setPosition=function(t){this.position=t,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},t.prototype.setVisible=function(t){this.isHidden=!t,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},t.prototype.setZIndex=function(t){this.zIndex=t,this.div&&(this.div.style.zIndex=t+""),google.maps.event.trigger(this,"zindex_changed")},t.prototype.getContent=function(){return this.content},t.prototype.getPosition=function(){return this.position},t.prototype.getZIndex=function(){return this.zIndex},t.prototype.getVisible=function(){var t=this.getMap();return null!=t&&!this.isHidden},t.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},t.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},t.prototype.open=function(t,e){var s=this;e&&(this.position=e.getPosition(),this.moveListener=google.maps.event.addListener(e,"position_changed",(function(){var t=e.getPosition();s.setPosition(t)})),this.mapListener=google.maps.event.addListener(e,"map_changed",(function(){s.setMap(e.map)}))),this.setMap(t),this.div&&this.panBox()},t.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var t=0;t<this.eventListeners.length;t++)google.maps.event.removeListener(this.eventListeners[t]);this.eventListeners=null}this.moveListener&&(google.maps.event.removeListener(this.moveListener),this.moveListener=null),this.mapListener&&(google.maps.event.removeListener(this.mapListener),this.mapListener=null),this.contextListener&&(google.maps.event.removeListener(this.contextListener),this.contextListener=null),this.setMap(null)},t.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype.hasOwnProperty(e)||(this.prototype[e]=t.prototype[e]);return this}.apply(t,[e])},t}();const nt={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},it={options(t,e){t.setOptions(e)},position(t,e){e instanceof google.maps.LatLng?t.setPosition(e):t.setPosition(new google.maps.LatLng(e.lat,e.lng))},visible(t,e){t.setVisible(e)},zIndex(t,e){t.setZIndex(e)}};class ot extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.containerElement=null,this.state={infoBox:null},this.open=(t,e)=>{e?t.open(this.context,e):t.getPosition()?t.open(this.context):l(!1,"You must provide either an anchor or a position prop for <InfoBox>.")},this.setInfoBoxCallback=()=>{const{anchor:t,onLoad:e}=this.props,{infoBox:s}=this.state;null!==s&&null!==this.containerElement&&(s.setContent(this.containerElement),this.open(s,t),e&&e(s))}}componentDidMount(){const{options:t}=this.props,e=t||{},{position:s}=e,n=x(e,["position"]);let i;!s||s instanceof google.maps.LatLng||(i=new google.maps.LatLng(s.lat,s.lng));const o=new st(Object.assign(Object.assign({},n),i?{position:i}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=m({updaterMap:it,eventMap:nt,prevProps:{},nextProps:this.props,instance:o}),this.setState({infoBox:o},this.setInfoBoxCallback)}componentDidUpdate(t){const{infoBox:e}=this.state;null!==e&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:it,eventMap:nt,prevProps:t,nextProps:this.props,instance:e}))}componentWillUnmount(){const{onUnmount:t}=this.props,{infoBox:e}=this.state;null!==e&&(t&&t(e),g(this.registeredEvents),e.close())}render(){return this.containerElement?r.createPortal(t.Children.only(this.props.children),this.containerElement):null}}ot.contextType=h;var rt={centimeters:637100880,centimetres:637100880,degrees:6371008.8/111325,feet:20902260.511392,inches:6371008.8*39.37,kilometers:6371.0088,kilometres:6371.0088,meters:6371008.8,metres:6371008.8,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:6371008.8/1852,radians:1,yards:6371008.8*1.0936};function at(t,e,s){if(void 0===s&&(s={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ut(t[0])||!ut(t[1]))throw new Error("coordinates must contain numbers");return function(t,e,s){void 0===s&&(s={});var n={type:"Feature"};return(0===s.id||s.id)&&(n.id=s.id),s.bbox&&(n.bbox=s.bbox),n.properties=e||{},n.geometry=t,n}({type:"Point",coordinates:t},e,s)}function lt(t,e){void 0===e&&(e={});var s={type:"FeatureCollection"};return e.id&&(s.id=e.id),e.bbox&&(s.bbox=e.bbox),s.features=t,s}function ht(t,e){void 0===e&&(e="kilometers");var s=rt[e];if(!s)throw new Error(e+" units is invalid");return t*s}function pt(t){return t%360*Math.PI/180}function ct(t,e,s){if(void 0===e&&(e="kilometers"),void 0===s&&(s="kilometers"),!(t>=0))throw new Error("length must be a positive number");return ht(function(t,e){void 0===e&&(e="kilometers");var s=rt[e];if(!s)throw new Error(e+" units is invalid");return t/s}(t,e),s)}function ut(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function dt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return gt(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(s){switch(s){case"type":case"features":return;default:e[s]=t[s]}})),e.features=t.features.map((function(t){return gt(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return ft(t);default:throw new Error("unknown GeoJSON type")}}function gt(t){var e={type:"Feature"};return Object.keys(t).forEach((function(s){switch(s){case"type":case"properties":case"geometry":return;default:e[s]=t[s]}})),e.properties=mt(t.properties),e.geometry=ft(t.geometry),e}function mt(t){var e={};return t?(Object.keys(t).forEach((function(s){var n=t[s];"object"==typeof n?null===n?e[s]=null:Array.isArray(n)?e[s]=n.map((function(t){return t})):e[s]=mt(n):e[s]=n})),e):e}function ft(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return ft(t)})),e):(e.coordinates=vt(t.coordinates),e)}function vt(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return vt(t)}))}function yt(t,e,s){if(null!==t)for(var n,i,o,r,a,l,h,p,c=0,u=0,d=t.type,g="FeatureCollection"===d,m="Feature"===d,f=g?t.features.length:1,v=0;v<f;v++){a=(p=!!(h=g?t.features[v].geometry:m?t.geometry:t)&&"GeometryCollection"===h.type)?h.geometries.length:1;for(var y=0;y<a;y++){var x=0,b=0;if(null!==(r=p?h.geometries[y]:h)){l=r.coordinates;var M=r.type;switch(c=!s||"Polygon"!==M&&"MultiPolygon"!==M?0:1,M){case null:break;case"Point":if(!1===e(l,u,v,x,b))return!1;u++,x++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],u,v,x,b))return!1;u++,"MultiPoint"===M&&x++}"LineString"===M&&x++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(i=0;i<l[n].length-c;i++){if(!1===e(l[n][i],u,v,x,b))return!1;u++}"MultiLineString"===M&&x++,"Polygon"===M&&b++}"Polygon"===M&&x++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(b=0,i=0;i<l[n].length;i++){for(o=0;o<l[n][i].length-c;o++){if(!1===e(l[n][i][o],u,v,x,b))return!1;u++}b++}x++}break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(!1===yt(r.geometries[n],e,s))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function xt(t){var e=[];return yt(t,(function(t){e.push(t)})),e}var bt={eudist:function(t,e,s){for(var n=t.length,i=0,o=0;o<n;o++){var r=(t[o]||0)-(e[o]||0);i+=r*r}return s?Math.sqrt(i):i},mandist:function(t,e,s){for(var n=t.length,i=0,o=0;o<n;o++)i+=Math.abs((t[o]||0)-(e[o]||0));return s?Math.sqrt(i):i},dist:function(t,e,s){var n=Math.abs(t-e);return s?n:n*n}},Mt=bt.eudist,Ct=bt.dist,kt={kmrand:function(t,e){for(var s={},n=[],i=e<<2,o=t.length,r=t[0].length>0;n.length<e&&i-- >0;){var a=t[Math.floor(Math.random()*o)],l=r?a.join("_"):""+a;s[l]||(s[l]=!0,n.push(a))}if(n.length<e)throw new Error("Error initializating clusters");return n},kmpp:function(t,e){var s=t[0].length?Mt:Ct,n=[],i=t.length,o=t[0].length>0,r=t[Math.floor(Math.random()*i)];o&&r.join("_");for(n.push(r);n.length<e;){for(var a=[],l=n.length,h=0,p=[],c=0;c<i;c++){for(var u=1/0,d=0;d<l;d++){var g=s(t[c],n[d]);g<=u&&(u=g)}a[c]=u}for(var m=0;m<i;m++)h+=a[m];for(var f=0;f<i;f++)p[f]={i:f,v:t[f],pr:a[f]/h,cs:0};p.sort((function(t,e){return t.pr-e.pr})),p[0].cs=p[0].pr;for(var v=1;v<i;v++)p[v].cs=p[v-1].cs+p[v].pr;for(var y=Math.random(),x=0;x<i-1&&p[x++].cs<y;);n.push(p[x-1].v)}return n}},wt=bt.eudist,Pt=kt.kmrand,Lt=kt.kmpp;function Et(t,e,s){s=s||[];for(var n=0;n<t;n++)s[n]=e;return s}var St=function(t,e,s,n){var i=[],o=[],r=[],a=[],l=!1,h=n||1e4,p=t.length,c=t[0].length,u=c>0,d=[];if(s)i="kmrand"==s?Pt(t,e):"kmpp"==s?Lt(t,e):s;else for(var g={};i.length<e;){var m=Math.floor(Math.random()*p);g[m]||(g[m]=!0,i.push(t[m]))}do{Et(e,0,d);for(var f=0;f<p;f++){for(var v=1/0,y=0,x=0;x<e;x++){(a=u?wt(t[f],i[x]):Math.abs(t[f]-i[x]))<=v&&(v=a,y=x)}r[f]=y,d[y]++}for(var b=[],M=(o=[],0);M<e;M++)b[M]=u?Et(c,0,b[M]):0,o[M]=i[M];if(u){for(var C=0;C<e;C++)i[C]=[];for(var k=0;k<p;k++)for(var w=b[r[k]],P=t[k],L=0;L<c;L++)w[L]+=P[L];l=!0;for(var E=0;E<e;E++){for(var S=i[E],_=b[E],O=o[E],I=d[E],D=0;D<c;D++)S[D]=_[D]/I||0;if(l)for(var T=0;T<c;T++)if(O[T]!=S[T]){l=!1;break}}}else{for(var B=0;B<p;B++){b[r[B]]+=t[B]}for(var U=0;U<e;U++)i[U]=b[U]/d[U]||0;l=!0;for(var z=0;z<e;z++)if(o[z]!=i[z]){l=!1;break}}l=l||--h<=0}while(!l);return{it:1e4-h,k:e,idxs:r,centroids:i}};function _t(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ot(t,e,s){void 0===s&&(s={});var n=_t(t),i=_t(e),o=pt(i[1]-n[1]),r=pt(i[0]-n[0]),a=pt(n[1]),l=pt(i[1]),h=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(r/2),2)*Math.cos(a)*Math.cos(l);return ht(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),s.units)}var It={exports:{}},Dt={exports:{}};
  /**
   * DBSCAN - Density based clustering
   *
   * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>
   * @copyright MIT
   */
  !function(t){function e(t,e,s,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,s,n)}e.prototype.run=function(t,e,s,n){this._init(t,e,s,n);for(var i=0;i<this._datasetLength;i++)if(1!==this._visited[i]){this._visited[i]=1;var o=this._regionQuery(i);if(o.length<this.minPts)this.noise.push(i);else{var r=this.clusters.length;this.clusters.push([]),this._addToCluster(i,r),this._expandCluster(r,o)}}return this.clusters},e.prototype._init=function(t,e,s,n){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),s&&(this.minPts=s),n&&(this.distance=n)},e.prototype._expandCluster=function(t,e){for(var s=0;s<e.length;s++){var n=e[s];if(1!==this._visited[n]){this._visited[n]=1;var i=this._regionQuery(n);i.length>=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[n]&&this._addToCluster(n,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],s=0;s<this._datasetLength;s++){this.distance(this.dataset[t],this.dataset[s])<this.epsilon&&e.push(s)}return e},e.prototype._mergeArrays=function(t,e){for(var s=e.length,n=0;n<s;n++){var i=e[n];t.indexOf(i)<0&&t.push(i)}return t},e.prototype._euclideanDistance=function(t,e){for(var s=0,n=Math.min(t.length,e.length);n--;)s+=(t[n]-e[n])*(t[n]-e[n]);return Math.sqrt(s)},t.exports&&(t.exports=e)}(Dt);var Tt={exports:{}};!function(t){
  /**
   * KMEANS clustering
   *
   * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>
   * @copyright MIT
   */
  function e(t,e,s){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,s)}e.prototype.init=function(t,e,s){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==s&&(this.distance=s)},e.prototype.run=function(t,e){this.init(t,e);for(var s=this.dataset.length,n=0;n<this.k;n++)this.centroids[n]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var o=0;o<this.k;o++){for(var r=new Array(p),a=0,l=0;l<p;l++)r[l]=0;for(var h=0;h<s;h++){var p=this.dataset[h].length;if(o===this.assignments[h]){for(l=0;l<p;l++)r[l]+=this.dataset[h][l];a++}}if(a>0){for(l=0;l<p;l++)r[l]/=a;this.centroids[o]=r}else this.centroids[o]=this.randomCentroid(),i=!0}}return this.getClusters()},e.prototype.randomCentroid=function(){var t,e,s=this.dataset.length-1;do{e=Math.round(Math.random()*s),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},e.prototype.assign=function(){for(var t,e=!1,s=this.dataset.length,n=0;n<s;n++)(t=this.argmin(this.dataset[n],this.centroids,this.distance))!=this.assignments[n]&&(this.assignments[n]=t,e=!0);return e},e.prototype.getClusters=function(){for(var t,e=new Array(this.k),s=0;s<this.assignments.length;s++)void 0===e[t=this.assignments[s]]&&(e[t]=[]),e[t].push(s);return e},e.prototype.argmin=function(t,e,s){for(var n,i=Number.MAX_VALUE,o=0,r=e.length,a=0;a<r;a++)(n=s(t,e[a]))<i&&(i=n,o=a);return o},e.prototype.distance=function(t,e){for(var s=0,n=Math.min(t.length,e.length);n--;){var i=t[n]-e[n];s+=i*i}return Math.sqrt(s)},t.exports&&(t.exports=e)}(Tt);var Bt,Ut={exports:{}},zt={exports:{}};
  /**
   * PriorityQueue
   * Elements in this queue are sorted according to their value
   *
   * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>
   * @copyright MIT
   */
  !function(t){function e(t,e,s){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,s)}e.prototype.insert=function(t,e){for(var s=this._queue.length,n=s;n--;){var i=this._priorities[n];"desc"===this._sorting?e>i&&(s=n):e<i&&(s=n)}this._insertAt(t,e,s)},e.prototype.remove=function(t){for(var e=this._queue.length;e--;){if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}}},e.prototype.forEach=function(t){this._queue.forEach(t)},e.prototype.getElements=function(){return this._queue},e.prototype.getElementPriority=function(t){return this._priorities[t]},e.prototype.getPriorities=function(){return this._priorities},e.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,s=this._queue.length;e<s;e++)t.push([this._queue[e],this._priorities[e]]);return t},e.prototype._init=function(t,e,s){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var n=0;n<t.length;n++)this.insert(t[n],e[n])}s&&(this._sorting=s)},e.prototype._insertAt=function(t,e,s){this._queue.length===s?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(s,0,t),this._priorities.splice(s,0,e))},t.exports&&(t.exports=e)}(zt),function(t){if(t.exports)var e=zt.exports;
  /**
   * OPTICS - Ordering points to identify the clustering structure
   *
   * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>
   * @copyright MIT
   */function s(t,e,s,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,s,n)}s.prototype.run=function(t,s,n,i){this._init(t,s,n,i);for(var o=0,r=this.dataset.length;o<r;o++)if(1!==this._processed[o]){this._processed[o]=1,this.clusters.push([o]);var a=this.clusters.length-1;this._orderedList.push(o);var l=new e(null,null,"asc"),h=this._regionQuery(o);void 0!==this._distanceToCore(o)&&(this._updateQueue(o,h,l),this._expandCluster(a,l))}return this.clusters},s.prototype.getReachabilityPlot=function(){for(var t=[],e=0,s=this._orderedList.length;e<s;e++){var n=this._orderedList[e],i=this._reachability[n];t.push([n,i])}return t},s.prototype._init=function(t,e,s,n){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),s&&(this.minPts=s),n&&(this.distance=n)},s.prototype._updateQueue=function(t,e,s){var n=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===n._processed[e]){var i=n.distance(n.dataset[t],n.dataset[e]),o=Math.max(n._coreDistance,i);void 0===n._reachability[e]?(n._reachability[e]=o,s.insert(e,o)):o<n._reachability[e]&&(n._reachability[e]=o,s.remove(e),s.insert(e,o))}}))},s.prototype._expandCluster=function(t,e){for(var s=e.getElements(),n=0,i=s.length;n<i;n++){var o=s[n];if(void 0===this._processed[o]){var r=this._regionQuery(o);this._processed[o]=1,this.clusters[t].push(o),this._orderedList.push(o),void 0!==this._distanceToCore(o)&&(this._updateQueue(o,r,e),this._expandCluster(t,e))}}},s.prototype._distanceToCore=function(t){for(var e=this.epsilon,s=0;s<e;s++){if(this._regionQuery(t,s).length>=this.minPts)return s}},s.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var s=[],n=0,i=this.dataset.length;n<i;n++)this.distance(this.dataset[t],this.dataset[n])<e&&s.push(n);return s},s.prototype._euclideanDistance=function(t,e){for(var s=0,n=Math.min(t.length,e.length);n--;)s+=(t[n]-e[n])*(t[n]-e[n]);return Math.sqrt(s)},t.exports&&(t.exports=s)}(Ut),(Bt=It).exports&&(Bt.exports={DBSCAN:Dt.exports,KMEANS:Tt.exports,OPTICS:Ut.exports,PriorityQueue:zt.exports});var At=It.exports;var Rt={exports:{}},jt=Rt.exports=function(){function t(s,n,i,o,r,a){if(!(r-o<=i)){var l=o+r>>1;e(s,n,l,o,r,a%2),t(s,n,i,o,l-1,a+1),t(s,n,i,l+1,r,a+1)}}function e(t,n,i,o,r,a){for(;r>o;){if(r-o>600){var l=r-o+1,h=i-o+1,p=Math.log(l),c=.5*Math.exp(2*p/3),u=.5*Math.sqrt(p*c*(l-c)/l)*(h-l/2<0?-1:1);e(t,n,i,Math.max(o,Math.floor(i-h*c/l+u)),Math.min(r,Math.floor(i+(l-h)*c/l+u)),a)}var d=n[2*i+a],g=o,m=r;for(s(t,n,o,i),n[2*r+a]>d&&s(t,n,o,r);g<m;){for(s(t,n,g,m),g++,m--;n[2*g+a]<d;)g++;for(;n[2*m+a]>d;)m--}n[2*o+a]===d?s(t,n,o,m):s(t,n,++m,r),m<=i&&(o=m+1),i<=m&&(r=m-1)}}function s(t,e,s,i){n(t,s,i),n(e,2*s,2*i),n(e,2*s+1,2*i+1)}function n(t,e,s){var n=t[e];t[e]=t[s],t[s]=n}function i(t,e,s,n,i,o,r){for(var a,l,h=[0,t.length-1,0],p=[];h.length;){var c=h.pop(),u=h.pop(),d=h.pop();if(u-d<=r)for(var g=d;g<=u;g++)a=e[2*g],l=e[2*g+1],a>=s&&a<=i&&l>=n&&l<=o&&p.push(t[g]);else{var m=Math.floor((d+u)/2);a=e[2*m],l=e[2*m+1],a>=s&&a<=i&&l>=n&&l<=o&&p.push(t[m]);var f=(c+1)%2;(0===c?s<=a:n<=l)&&(h.push(d),h.push(m-1),h.push(f)),(0===c?i>=a:o>=l)&&(h.push(m+1),h.push(u),h.push(f))}}return p}function o(t,e,s,n,i,o){for(var a=[0,t.length-1,0],l=[],h=i*i;a.length;){var p=a.pop(),c=a.pop(),u=a.pop();if(c-u<=o)for(var d=u;d<=c;d++)r(e[2*d],e[2*d+1],s,n)<=h&&l.push(t[d]);else{var g=Math.floor((u+c)/2),m=e[2*g],f=e[2*g+1];r(m,f,s,n)<=h&&l.push(t[g]);var v=(p+1)%2;(0===p?s-i<=m:n-i<=f)&&(a.push(u),a.push(g-1),a.push(v)),(0===p?s+i>=m:n+i>=f)&&(a.push(g+1),a.push(c),a.push(v))}}return l}function r(t,e,s,n){var i=t-s,o=e-n;return i*i+o*o}var a=function(t){return t[0]},l=function(t){return t[1]},h=function(e,s,n,i,o){void 0===s&&(s=a),void 0===n&&(n=l),void 0===i&&(i=64),void 0===o&&(o=Float64Array),this.nodeSize=i,this.points=e;for(var r=e.length<65536?Uint16Array:Uint32Array,h=this.ids=new r(e.length),p=this.coords=new o(2*e.length),c=0;c<e.length;c++)h[c]=c,p[2*c]=s(e[c]),p[2*c+1]=n(e[c]);t(h,p,i,0,h.length-1,0)};h.prototype.range=function(t,e,s,n){return i(this.ids,this.coords,t,e,s,n,this.nodeSize)},h.prototype.within=function(t,e,s){return o(this.ids,this.coords,t,e,s,this.nodeSize)};var p,c={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},u=Math.fround||(p=new Float32Array(1),function(t){return p[0]=+t,p[0]}),d=function(t){this.options=C(Object.create(c),t),this.trees=new Array(this.options.maxZoom+1)};function g(t,e,s,n,i){return{x:u(t),y:u(e),zoom:1/0,id:s,parentId:-1,numPoints:n,properties:i}}function m(t,e){var s=t.geometry.coordinates,n=s[0],i=s[1];return{x:u(y(n)),y:u(x(i)),zoom:1/0,index:e,parentId:-1}}function f(t){return{type:"Feature",id:t.id,properties:v(t),geometry:{type:"Point",coordinates:[b(t.x),M(t.y)]}}}function v(t){var e=t.numPoints,s=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return C(C({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:s})}function y(t){return t/360+.5}function x(t){var e=Math.sin(t*Math.PI/180),s=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return s<0?0:s>1?1:s}function b(t){return 360*(t-.5)}function M(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function C(t,e){for(var s in e)t[s]=e[s];return t}function k(t){return t.x}function w(t){return t.y}return d.prototype.load=function(t){var e=this.options,s=e.log,n=e.minZoom,i=e.maxZoom,o=e.nodeSize;s&&console.time("total time");var r="prepare "+t.length+" points";s&&console.time(r),this.points=t;for(var a=[],l=0;l<t.length;l++)t[l].geometry&&a.push(m(t[l],l));this.trees[i+1]=new h(a,k,w,o,Float32Array),s&&console.timeEnd(r);for(var p=i;p>=n;p--){var c=+Date.now();a=this._cluster(a,p),this.trees[p]=new h(a,k,w,o,Float32Array),s&&console.log("z%d: %d clusters in %dms",p,a.length,+Date.now()-c)}return s&&console.timeEnd("total time"),this},d.prototype.getClusters=function(t,e){var s=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)s=-180,i=180;else if(s>i){var r=this.getClusters([s,n,180,o],e),a=this.getClusters([-180,n,i,o],e);return r.concat(a)}for(var l=this.trees[this._limitZoom(e)],h=[],p=0,c=l.range(y(s),x(o),y(i),x(n));p<c.length;p+=1){var u=c[p],d=l.points[u];h.push(d.numPoints?f(d):this.points[d.index])}return h},d.prototype.getChildren=function(t){var e=this._getOriginId(t),s=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[s];if(!i)throw new Error(n);var o=i.points[e];if(!o)throw new Error(n);for(var r=this.options.radius/(this.options.extent*Math.pow(2,s-1)),a=[],l=0,h=i.within(o.x,o.y,r);l<h.length;l+=1){var p=h[l],c=i.points[p];c.parentId===t&&a.push(c.numPoints?f(c):this.points[c.index])}if(0===a.length)throw new Error(n);return a},d.prototype.getLeaves=function(t,e,s){e=e||10,s=s||0;var n=[];return this._appendLeaves(n,t,e,s,0),n},d.prototype.getTile=function(t,e,s){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,r=o.extent,a=o.radius/r,l=(s-a)/i,h=(s+1+a)/i,p={features:[]};return this._addTileFeatures(n.range((e-a)/i,l,(e+1+a)/i,h),n.points,e,s,i,p),0===e&&this._addTileFeatures(n.range(1-a/i,l,1,h),n.points,i,s,i,p),e===i-1&&this._addTileFeatures(n.range(0,l,a/i,h),n.points,-1,s,i,p),p.features.length?p:null},d.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var s=this.getChildren(t);if(e++,1!==s.length)break;t=s[0].properties.cluster_id}return e},d.prototype._appendLeaves=function(t,e,s,n,i){for(var o=0,r=this.getChildren(e);o<r.length;o+=1){var a=r[o],l=a.properties;if(l&&l.cluster?i+l.point_count<=n?i+=l.point_count:i=this._appendLeaves(t,l.cluster_id,s,n,i):i<n?i++:t.push(a),t.length===s)break}return i},d.prototype._addTileFeatures=function(t,e,s,n,i,o){for(var r=0,a=t;r<a.length;r+=1){var l=e[a[r]],h=l.numPoints,p=void 0,c=void 0,u=void 0;if(h)p=v(l),c=l.x,u=l.y;else{var d=this.points[l.index];p=d.properties,c=y(d.geometry.coordinates[0]),u=x(d.geometry.coordinates[1])}var g={type:1,geometry:[[Math.round(this.options.extent*(c*i-s)),Math.round(this.options.extent*(u*i-n))]],tags:p},m=void 0;h?m=l.id:this.options.generateId?m=l.index:this.points[l.index].id&&(m=this.points[l.index].id),void 0!==m&&(g.id=m),o.features.push(g)}},d.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},d.prototype._cluster=function(t,e){for(var s=[],n=this.options,i=n.radius,o=n.extent,r=n.reduce,a=n.minPoints,l=i/(o*Math.pow(2,e)),h=0;h<t.length;h++){var p=t[h];if(!(p.zoom<=e)){p.zoom=e;for(var c=this.trees[e+1],u=c.within(p.x,p.y,l),d=p.numPoints||1,m=d,f=0,v=u;f<v.length;f+=1){var y=v[f],x=c.points[y];x.zoom>e&&(m+=x.numPoints||1)}if(m>d&&m>=a){for(var b=p.x*d,M=p.y*d,C=r&&d>1?this._map(p,!0):null,k=(h<<5)+(e+1)+this.points.length,w=0,P=u;w<P.length;w+=1){var L=P[w],E=c.points[L];if(!(E.zoom<=e)){E.zoom=e;var S=E.numPoints||1;b+=E.x*S,M+=E.y*S,E.parentId=k,r&&(C||(C=this._map(p,!0)),r(C,this._map(E)))}}p.parentId=k,s.push(g(b/m,M/m,k,m,C))}else if(s.push(p),m>1)for(var _=0,O=u;_<O.length;_+=1){var I=O[_],D=c.points[I];D.zoom<=e||(D.zoom=e,s.push(D))}}}return s},d.prototype._getOriginId=function(t){return t-this.points.length>>5},d.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},d.prototype._map=function(t,e){if(t.numPoints)return e?C({},t.properties):t.properties;var s=this.points[t.index].properties,n=this.options.map(s);return e&&n===s?C({},n):n},d}(),Wt=function t(e,s){if(e===s)return!0;if(e&&s&&"object"==typeof e&&"object"==typeof s){if(e.constructor!==s.constructor)return!1;var n,i,o;if(Array.isArray(e)){if((n=e.length)!=s.length)return!1;for(i=n;0!=i--;)if(!t(e[i],s[i]))return!1;return!0}if(e instanceof Map&&s instanceof Map){if(e.size!==s.size)return!1;for(i of e.entries())if(!s.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],s.get(i[0])))return!1;return!0}if(e instanceof Set&&s instanceof Set){if(e.size!==s.size)return!1;for(i of e.entries())if(!s.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(s)){if((n=e.length)!=s.length)return!1;for(i=n;0!=i--;)if(e[i]!==s[i])return!1;return!0}if(e.constructor===RegExp)return e.source===s.source&&e.flags===s.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===s.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===s.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(s).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(s,o[i]))return!1;for(i=n;0!=i--;){var r=o[i];if(!t(e[r],s[r]))return!1}return!0}return e!=e&&s!=s};
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** */
  function Nt(t,e){var s={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(s[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(s[n[i]]=t[n[i]])}return s}class Vt{constructor({markers:t,position:e}){this.markers=t,e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(0!==this.markers.length||this._position)return this.markers.reduce(((t,e)=>t.extend(e.getPosition())),new google.maps.LatLngBounds(this._position,this._position))}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter((t=>t.getVisible())).length}push(t){this.markers.push(t)}delete(){this.marker&&(this.marker.setMap(null),delete this.marker),this.markers.length=0}}const Zt=(t,e,s,n)=>{const i=Ft(t.getBounds(),e,n);return s.filter((t=>i.contains(t.getPosition())))},Ft=(t,e,s)=>{const{northEast:n,southWest:i}=Gt(t,e),o=qt({northEast:n,southWest:i},s);return $t(o,e)},Ht=(t,e)=>{const s=(e.lat-t.lat)*Math.PI/180,n=(e.lng-t.lng)*Math.PI/180,i=Math.sin(s/2)*Math.sin(s/2)+Math.cos(t.lat*Math.PI/180)*Math.cos(e.lat*Math.PI/180)*Math.sin(n/2)*Math.sin(n/2);return 6371*(2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i)))},Gt=(t,e)=>({northEast:e.fromLatLngToDivPixel(t.getNorthEast()),southWest:e.fromLatLngToDivPixel(t.getSouthWest())}),qt=({northEast:t,southWest:e},s)=>(t.x+=s,t.y-=s,e.x-=s,e.y+=s,{northEast:t,southWest:e}),$t=({northEast:t,southWest:e},s)=>{const n=new google.maps.LatLngBounds;return n.extend(s.fromDivPixelToLatLng(t)),n.extend(s.fromDivPixelToLatLng(e)),n};class Kt{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return Qt(t)}}class Yt extends Kt{constructor(t){var{viewportPadding:e=60}=t;super(Nt(t,["viewportPadding"])),this.viewportPadding=60,this.viewportPadding=e}calculate({markers:t,map:e,mapCanvasProjection:s}){return e.getZoom()>=this.maxZoom?{clusters:this.noop({markers:t,map:e,mapCanvasProjection:s}),changed:!1}:{clusters:this.cluster({markers:Zt(e,s,t,this.viewportPadding),map:e,mapCanvasProjection:s})}}}const Qt=t=>t.map((t=>new Vt({position:t.getPosition(),markers:[t]})));const Jt={units:"kilometers",mutate:!1,minPoints:1};class Xt extends Kt{constructor(t){var{maxZoom:e,radius:s=60}=t,n=Nt(t,["maxZoom","radius"]);super({maxZoom:e}),this.superCluster=new jt(Object.assign({maxZoom:this.maxZoom,radius:s},n)),this.state={zoom:null}}calculate(t){let e=!1;if(!Wt(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const s=this.markers.map((t=>({type:"Feature",geometry:{type:"Point",coordinates:[t.getPosition().lng(),t.getPosition().lat()]},properties:{marker:t}})));this.superCluster.load(s)}const s={zoom:t.map.getZoom()};return e||this.state.zoom>this.maxZoom&&s.zoom>this.maxZoom||(e=e||!Wt(this.state,s)),this.state=s,e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e}}cluster({map:t}){return this.superCluster.getClusters([-180,-90,180,90],t.getZoom()).map(this.transformCluster.bind(this))}transformCluster({geometry:{coordinates:[t,e]},properties:s}){if(s.cluster)return new Vt({markers:this.superCluster.getLeaves(s.cluster_id,1/0).map((t=>t.properties.marker)),position:new google.maps.LatLng({lat:e,lng:t})});{const t=s.marker;return new Vt({markers:[t],position:t.getPosition()})}}}class te{constructor(t,e){this.markers={sum:t.length};const s=e.map((t=>t.count)),n=s.reduce(((t,e)=>t+e),0);this.clusters={count:e.length,markers:{mean:n/e.length,sum:n,min:Math.min(...s),max:Math.max(...s)}}}}class ee{render({count:t,position:e},s){const n=t>Math.max(10,s.clusters.markers.mean)?"#ff0000":"#0000ff",i=window.btoa(`\n  <svg fill="${n}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">\n    <circle cx="120" cy="120" opacity=".6" r="70" />\n    <circle cx="120" cy="120" opacity=".3" r="90" />\n    <circle cx="120" cy="120" opacity=".2" r="110" />\n  </svg>`);return new google.maps.Marker({position:e,icon:{url:`data:image/svg+xml;base64,${i}`,scaledSize:new google.maps.Size(45,45)},label:{text:String(t),color:"rgba(255,255,255,0.9)",fontSize:"12px"},zIndex:Number(google.maps.Marker.MAX_ZINDEX)+t})}}class se{constructor(){!function(t,e){for(let s in e.prototype)t.prototype[s]=e.prototype[s]}(se,google.maps.OverlayView)}}var ne;!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"}(ne||(ne={}));const ie=(t,e,s)=>{s.fitBounds(e.bounds)};class oe extends se{constructor({map:t,markers:e=[],algorithm:s=new Xt({}),renderer:n=new ee,onClusterClick:i=ie}){super(),this.markers=[...e],this.clusters=[],this.algorithm=s,this.renderer=n,this.onClusterClick=i,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach((t=>{this.addMarker(t,!0)})),e||this.render()}removeMarker(t,e){const s=this.markers.indexOf(t);return-1!==s&&(t.setMap(null),this.markers.splice(s,1),e||this.render(),!0)}removeMarkers(t,e){let s=!1;return t.forEach((t=>{s=this.removeMarker(t,!0)||s})),s&&!e&&this.render(),s}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,ne.CLUSTERING_BEGIN,this);const{clusters:e,changed:s}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});(s||null==s)&&(this.reset(),this.clusters=e,this.renderClusters()),google.maps.event.trigger(this,ne.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach((t=>t.setMap(null))),this.clusters.forEach((t=>t.delete())),this.clusters=[]}renderClusters(){const t=new te(this.markers,this.clusters),e=this.getMap();this.clusters.forEach((s=>{1===s.markers.length?s.marker=s.markers[0]:(s.marker=this.renderer.render(s,t),this.onClusterClick&&s.marker.addListener("click",(t=>{google.maps.event.trigger(this,ne.CLUSTER_CLICK,s),this.onClusterClick(t,s,e)}))),s.marker.setMap(e)}))}}var re=Object.freeze({__proto__:null,AbstractAlgorithm:Kt,AbstractViewportAlgorithm:Yt,Cluster:Vt,ClusterStats:te,DBScanAlgorithm:class extends Yt{constructor(t){var{maxDistance:e=200,minPoints:s=Jt.minPoints}=t;super(Nt(t,["maxDistance","minPoints"])),this.maxDistance=e,this.options=Object.assign(Object.assign({},Jt),{minPoints:s})}cluster({markers:t,mapCanvasProjection:e}){const s=lt(t.map((t=>{const s=e.fromLatLngToContainerPixel(t.getPosition());return at([s.x,s.y])}))),n=[];return function(t,e,s){void 0===s&&(s={}),!0!==s.mutate&&(t=dt(t)),s.minPoints=s.minPoints||3;var n=new At.DBSCAN,i=n.run(xt(t),ct(e,s.units),s.minPoints,Ot),o=-1;return i.forEach((function(e){o++,e.forEach((function(e){var s=t.features[e];s.properties||(s.properties={}),s.properties.cluster=o,s.properties.dbscan="core"}))})),n.noise.forEach((function(e){var s=t.features[e];s.properties||(s.properties={}),s.properties.cluster?s.properties.dbscan="edge":s.properties.dbscan="noise"})),t}(s,this.maxDistance,this.options).features.forEach(((e,s)=>{n[e.properties.cluster]||(n[e.properties.cluster]=[]),n[e.properties.cluster].push(t[s])})),n.map((t=>new Vt({markers:t})))}},DefaultRenderer:ee,GridAlgorithm:class extends Yt{constructor(t){var{maxDistance:e=4e4,gridSize:s=40}=t;super(Nt(t,["maxDistance","gridSize"])),this.clusters=[],this.maxDistance=e,this.gridSize=s}cluster({markers:t,map:e,mapCanvasProjection:s}){return this.clusters=[],t.forEach((t=>{this.addToClosestCluster(t,e,s)})),this.clusters}addToClosestCluster(t,e,s){let n=this.maxDistance,i=null;for(let e=0;e<this.clusters.length;e++){const s=this.clusters[e],o=Ht(s.bounds.getCenter().toJSON(),t.getPosition().toJSON());o<n&&(n=o,i=s)}if(i&&Ft(i.bounds,s,this.gridSize).contains(t.getPosition()))i.push(t);else{const e=new Vt({markers:[t]});this.clusters.push(e)}}},KmeansAlgorithm:class extends Yt{constructor(t){var{numberOfClusters:e}=t;super(Nt(t,["numberOfClusters"])),this.numberOfClusters=e}cluster({markers:t,map:e}){const s=[];if(0===t.length)return s;const n=lt(t.map((t=>at([t.getPosition().lng(),t.getPosition().lat()]))));let i;return i=this.numberOfClusters instanceof Function?this.numberOfClusters(t.length,e.getZoom()):this.numberOfClusters,function(t,e){void 0===e&&(e={});var s=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(s/2)),e.numberOfClusters>s&&(e.numberOfClusters=s),!0!==e.mutate&&(t=dt(t));var n=xt(t),i=n.slice(0,e.numberOfClusters),o=St(n,e.numberOfClusters,i),r={};return o.centroids.forEach((function(t,e){r[e]=t})),function(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var s=0;s<t.features.length&&!1!==e(t.features[s],s);s++);}(t,(function(t,e){var s=o.idxs[e];t.properties.cluster=s,t.properties.centroid=r[s]})),t}(n,{numberOfClusters:i}).features.forEach(((e,n)=>{s[e.properties.cluster]||(s[e.properties.cluster]=new Vt({position:{lng:e.properties.centroid[0],lat:e.properties.centroid[1]},markers:[]})),s[e.properties.cluster].push(t[n])})),s}},MarkerClusterer:oe,get MarkerClustererEvents(){return ne},NoopAlgorithm:class extends Kt{constructor(t){super(Nt(t,[]))}calculate({markers:t,map:e,mapCanvasProjection:s}){return{clusters:this.cluster({markers:t,map:e,mapCanvasProjection:s}),changed:!1}}cluster(t){return this.noop(t)}},SuperClusterAlgorithm:Xt,defaultOnClusterClickHandler:ie,distanceBetweenPoints:Ht,extendBoundsToPaddedViewport:Ft,extendPixelBounds:qt,filterMarkersToPaddedViewport:Zt,noop:Qt,pixelBoundsToLatLngBounds:$t});const ae=({children:t,options:e})=>{const s=(t=>{const e=p(),[s,n]=i(null);return o((()=>{if(e&&null===s){const s=new oe(Object.assign(Object.assign({},t),{map:e}));n(s)}}),[e]),s})(e);return null!==s?t(s):null},le={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},he={options(t,e){t.setOptions(e)},position(t,e){t.setPosition(e)},zIndex(t,e){t.setZIndex(e)}};class pe extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.containerElement=null,this.state={infoWindow:null},this.open=(t,e)=>{e?t.open(this.context,e):t.getPosition()?t.open(this.context):l(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>.")},this.setInfoWindowCallback=()=>{null!==this.state.infoWindow&&null!==this.containerElement&&(this.state.infoWindow.setContent(this.containerElement),this.open(this.state.infoWindow,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoWindow))}}componentDidMount(){const t=new google.maps.InfoWindow(Object.assign({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=m({updaterMap:he,eventMap:le,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{infoWindow:t}}),this.setInfoWindowCallback)}componentDidUpdate(t){null!==this.state.infoWindow&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:he,eventMap:le,prevProps:t,nextProps:this.props,instance:this.state.infoWindow}))}componentWillUnmount(){null!==this.state.infoWindow&&(g(this.registeredEvents),this.state.infoWindow.close())}render(){return this.containerElement?r.createPortal(t.Children.only(this.props.children),this.containerElement):t.createElement(t.Fragment,null)}}pe.contextType=h;const ce={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ue={draggable(t,e){t.setDraggable(e)},editable(t,e){t.setEditable(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},path(t,e){t.setPath(e)},visible(t,e){t.setVisible(e)}};class de extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.state={polyline:null},this.setPolylineCallback=()=>{null!==this.state.polyline&&this.props.onLoad&&this.props.onLoad(this.state.polyline)}}componentDidMount(){const t=new google.maps.Polyline(Object.assign(Object.assign({},this.props.options||{}),{map:this.context}));this.registeredEvents=m({updaterMap:ue,eventMap:ce,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{polyline:t}}),this.setPolylineCallback)}componentDidUpdate(t){null!==this.state.polyline&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:ue,eventMap:ce,prevProps:t,nextProps:this.props,instance:this.state.polyline}))}componentWillUnmount(){null!==this.state.polyline&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),g(this.registeredEvents),this.state.polyline.setMap(null))}render(){return t.createElement(t.Fragment,null)}}de.contextType=h;const ge={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},me={draggable(t,e){t.setDraggable(e)},editable(t,e){t.setEditable(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},path(t,e){t.setPath(e)},paths(t,e){t.setPaths(e)},visible(t,e){t.setVisible(e)}};class fe extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.state={polygon:null},this.setPolygonCallback=()=>{null!==this.state.polygon&&this.props.onLoad&&this.props.onLoad(this.state.polygon)}}componentDidMount(){const t=new google.maps.Polygon(Object.assign(Object.assign({},this.props.options||{}),{map:this.context}));this.registeredEvents=m({updaterMap:me,eventMap:ge,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{polygon:t}}),this.setPolygonCallback)}componentDidUpdate(t){null!==this.state.polygon&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:me,eventMap:ge,prevProps:t,nextProps:this.props,instance:this.state.polygon}))}componentWillUnmount(){null!==this.state.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),g(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))}render(){return null}}fe.contextType=h;const ve={onBoundsChanged:"bounds_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ye={bounds(t,e){t.setBounds(e)},draggable(t,e){t.setDraggable(e)},editable(t,e){t.setEditable(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},visible(t,e){t.setVisible(e)}};class xe extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.state={rectangle:null},this.setRectangleCallback=()=>{null!==this.state.rectangle&&this.props.onLoad&&this.props.onLoad(this.state.rectangle)}}componentDidMount(){const t=new google.maps.Rectangle(Object.assign(Object.assign({},this.props.options||{}),{map:this.context}));this.registeredEvents=m({updaterMap:ye,eventMap:ve,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{rectangle:t}}),this.setRectangleCallback)}componentDidUpdate(t){null!==this.state.rectangle&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:ye,eventMap:ve,prevProps:t,nextProps:this.props,instance:this.state.rectangle}))}componentWillUnmount(){null!==this.state.rectangle&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),g(this.registeredEvents),this.state.rectangle.setMap(null))}render(){return t.createElement(t.Fragment,null)}}xe.contextType=h;const be={onCenterChanged:"center_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRadiusChanged:"radius_changed",onRightClick:"rightclick"},Me={center(t,e){t.setCenter(e)},draggable(t,e){t.setDraggable(e)},editable(t,e){t.setEditable(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},radius(t,e){t.setRadius(e)},visible(t,e){t.setVisible(e)}};class Ce extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.state={circle:null},this.setCircleCallback=()=>{null!==this.state.circle&&this.props.onLoad&&this.props.onLoad(this.state.circle)}}componentDidMount(){const t=new google.maps.Circle(Object.assign(Object.assign({},this.props.options||{}),{map:this.context}));this.registeredEvents=m({updaterMap:Me,eventMap:be,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{circle:t}}),this.setCircleCallback)}componentDidUpdate(t){null!==this.state.circle&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:Me,eventMap:be,prevProps:t,nextProps:this.props,instance:this.state.circle}))}componentWillUnmount(){null!==this.state.circle&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),g(this.registeredEvents),this.state.circle&&this.state.circle.setMap(null))}render(){return t.createElement(t.Fragment,null)}}Ce.contextType=h;const ke={onAddFeature:"addfeature",onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onRightClick:"rightclick",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},we={add(t,e){t.add(e)},addgeojson(t,e,s){t.addGeoJson(e,s)},contains(t,e){t.contains(e)},foreach(t,e){t.forEach(e)},loadgeojson(t,e,s,n){t.loadGeoJson(e,s,n)},overridestyle(t,e,s){t.overrideStyle(e,s)},remove(t,e){t.remove(e)},revertstyle(t,e){t.revertStyle(e)},controlposition(t,e){t.setControlPosition(e)},controls(t,e){t.setControls(e)},drawingmode(t,e){t.setDrawingMode(e)},map(t,e){t.setMap(e)},style(t,e){t.setStyle(e)},togeojson(t,e){t.toGeoJson(e)}};class Pe extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.state={data:null},this.setDataCallback=()=>{null!==this.state.data&&this.props.onLoad&&this.props.onLoad(this.state.data)}}componentDidMount(){const t=new google.maps.Data(Object.assign(Object.assign({},this.props.options||{}),{map:this.context}));this.registeredEvents=m({updaterMap:we,eventMap:ke,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{data:t}}),this.setDataCallback)}componentDidUpdate(t){null!==this.state.data&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:we,eventMap:ke,prevProps:t,nextProps:this.props,instance:this.state.data}))}componentWillUnmount(){null!==this.state.data&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),g(this.registeredEvents),this.state.data&&this.state.data.setMap(null))}render(){return null}}Pe.contextType=h;const Le={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},Ee={options(t,e){t.setOptions(e)},url(t,e){t.setUrl(e)},zIndex(t,e){t.setZIndex(e)}};class Se extends n{constructor(){super(...arguments),this.registeredEvents=[],this.state={kmlLayer:null},this.setKmlLayerCallback=()=>{null!==this.state.kmlLayer&&this.props.onLoad&&this.props.onLoad(this.state.kmlLayer)}}componentDidMount(){const t=new google.maps.KmlLayer(Object.assign(Object.assign({},this.props.options),{map:this.context}));this.registeredEvents=m({updaterMap:Ee,eventMap:Le,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{kmlLayer:t}}),this.setKmlLayerCallback)}componentDidUpdate(t){null!==this.state.kmlLayer&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:Ee,eventMap:Le,prevProps:t,nextProps:this.props,instance:this.state.kmlLayer}))}componentWillUnmount(){null!==this.state.kmlLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),g(this.registeredEvents),this.state.kmlLayer.setMap(null))}render(){return null}}Se.contextType=h;const _e=(t,e)=>new e(t.lat,t.lng),Oe=(t,e)=>new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng)),Ie=(t,e,s)=>t instanceof e?t:s(t,e);function De(t){if(!t)return"";return(t instanceof google.maps.LatLng?t:new google.maps.LatLng(t.lat,t.lng))+""}function Te(t){if(!t)return"";return(t instanceof google.maps.LatLngBounds?t:new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.east),new google.maps.LatLng(t.north,t.west)))+""}class Be extends t.PureComponent{constructor(e){super(e),this.state={paneEl:null,containerStyle:{position:"absolute"}},this.updatePane=()=>{const t=this.props.mapPaneName,e=this.overlayView.getPanes();l(!!t,"OverlayView requires props.mapPaneName but got %s",t),e?this.setState({paneEl:e[t]}):this.setState({paneEl:null})},this.onAdd=()=>{var t,e;this.updatePane(),null===(e=(t=this.props).onLoad)||void 0===e||e.call(t,this.overlayView)},this.onPositionElement=()=>{var t,e;const s=((t,e,s,n)=>void 0!==s?((t,e,s)=>{const n=t&&t.fromLatLngToDivPixel(s.getNorthEast()),i=t&&t.fromLatLngToDivPixel(s.getSouthWest());return n&&i?{left:`${i.x+e.x}px`,top:`${n.y+e.y}px`,width:n.x-i.x-e.x+"px",height:i.y-n.y-e.y+"px"}:{left:"-9999px",top:"-9999px"}})(t,e,Ie(s,google.maps.LatLngBounds,Oe)):((t,e,s)=>{const n=t&&t.fromLatLngToDivPixel(s);if(n){const{x:t,y:s}=n;return{left:`${t+e.x}px`,top:`${s+e.y}px`}}return{left:"-9999px",top:"-9999px"}})(t,e,Ie(n,google.maps.LatLng,_e)))(this.overlayView.getProjection(),Object.assign({x:0,y:0},this.containerRef.current?(t=this.containerRef.current,"function"==typeof(e=this.props.getPixelPositionOffset)?e(t.offsetWidth,t.offsetHeight):{}):{}),this.props.bounds,this.props.position),{left:n,top:i,width:o,height:r}=this.state.containerStyle;var a,l;l={left:n,top:i,width:o,height:r},((a=s).left!==l.left||a.top!==l.top||a.width!==l.height||a.height!==l.height)&&this.setState({containerStyle:Object.assign(Object.assign({},s),{position:"absolute"})})},this.draw=()=>{this.onPositionElement()},this.onRemove=()=>{var t,e;this.setState((()=>({paneEl:null}))),null===(e=(t=this.props).onUnmount)||void 0===e||e.call(t,this.overlayView)},this.containerRef=t.createRef();const s=new google.maps.OverlayView;s.onAdd=this.onAdd,s.draw=this.draw,s.onRemove=this.onRemove,this.overlayView=s}componentDidMount(){this.overlayView.setMap(this.context)}componentDidUpdate(t){const e=De(t.position),s=De(this.props.position),n=Te(t.bounds),i=Te(this.props.bounds);e===s&&n===i||this.overlayView.draw(),t.mapPaneName!==this.props.mapPaneName&&this.updatePane()}componentWillUnmount(){this.overlayView.setMap(null)}render(){const e=this.state.paneEl;return e?r.createPortal(t.createElement("div",{ref:this.containerRef,style:this.state.containerStyle},t.Children.only(this.props.children)),e):null}}Be.FLOAT_PANE="floatPane",Be.MAP_PANE="mapPane",Be.MARKER_LAYER="markerLayer",Be.OVERLAY_LAYER="overlayLayer",Be.OVERLAY_MOUSE_TARGET="overlayMouseTarget",Be.contextType=h;const Ue={onDblClick:"dblclick",onClick:"click"},ze={opacity(t,e){t.setOpacity(e)}};class Ae extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.state={groundOverlay:null},this.setGroundOverlayCallback=()=>{null!==this.state.groundOverlay&&this.props.onLoad&&this.props.onLoad(this.state.groundOverlay)}}componentDidMount(){l(!!this.props.url||!!this.props.bounds,"For GroundOverlay, url and bounds are passed in to constructor and are immutable after instantiated. This is the behavior of Google Maps JavaScript API v3 ( See https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay) Hence, use the corresponding two props provided by `react-google-maps-api`, url and bounds. In some cases, you'll need the GroundOverlay component to reflect the changes of url and bounds. You can leverage the React's key property to remount the component. Typically, just `key={url}` would serve your need. See https://github.com/tomchentw/react-google-maps/issues/655");const t=new google.maps.GroundOverlay(this.props.url,this.props.bounds,Object.assign(Object.assign({},this.props.options),{map:this.context}));this.registeredEvents=m({updaterMap:ze,eventMap:Ue,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{groundOverlay:t}}),this.setGroundOverlayCallback)}componentDidUpdate(t){null!==this.state.groundOverlay&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:ze,eventMap:Ue,prevProps:t,nextProps:this.props,instance:this.state.groundOverlay}))}componentWillUnmount(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))}render(){return null}}Ae.defaultProps={onLoad:function(){}},Ae.contextType=h;const Re={},je={data(t,e){t.setData(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)}};class We extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.state={heatmapLayer:null},this.setHeatmapLayerCallback=()=>{null!==this.state.heatmapLayer&&this.props.onLoad&&this.props.onLoad(this.state.heatmapLayer)}}componentDidMount(){l(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} to <LoadScript />? %s',google.maps.visualization),l(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);const t=new google.maps.visualization.HeatmapLayer(Object.assign(Object.assign({},this.props.options||{}),{data:this.props.data,map:this.context}));this.registeredEvents=m({updaterMap:je,eventMap:Re,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{heatmapLayer:t}}),this.setHeatmapLayerCallback)}componentDidUpdate(t){g(this.registeredEvents),this.registeredEvents=m({updaterMap:je,eventMap:Re,prevProps:t,nextProps:this.props,instance:this.state.heatmapLayer})}componentWillUnmount(){null!==this.state.heatmapLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),g(this.registeredEvents),this.state.heatmapLayer.setMap(null))}render(){return null}}We.contextType=h;const Ne={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},Ve={register(t,e,s){t.registerPanoProvider(e,s)},links(t,e){t.setLinks(e)},motionTracking(t,e){t.setMotionTracking(e)},options(t,e){t.setOptions(e)},pano(t,e){t.setPano(e)},position(t,e){t.setPosition(e)},pov(t,e){t.setPov(e)},visible(t,e){t.setVisible(e)},zoom(t,e){t.setZoom(e)}};class Ze extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.state={streetViewPanorama:null},this.setStreetViewPanoramaCallback=()=>{null!==this.state.streetViewPanorama&&this.props.onLoad&&this.props.onLoad(this.state.streetViewPanorama)}}componentDidMount(){const t=this.context.getStreetView();this.registeredEvents=m({updaterMap:Ve,eventMap:Ne,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{streetViewPanorama:t}}),this.setStreetViewPanoramaCallback)}componentDidUpdate(t){null!==this.state.streetViewPanorama&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:Ve,eventMap:Ne,prevProps:t,nextProps:this.props,instance:this.state.streetViewPanorama}))}componentWillUnmount(){null!==this.state.streetViewPanorama&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),g(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))}render(){return null}}Ze.contextType=h;class Fe extends t.PureComponent{constructor(){super(...arguments),this.state={streetViewService:null},this.setStreetViewServiceCallback=()=>{null!==this.state.streetViewService&&this.props.onLoad&&this.props.onLoad(this.state.streetViewService)}}componentDidMount(){const t=new google.maps.StreetViewService;this.setState((function(){return{streetViewService:t}}),this.setStreetViewServiceCallback)}componentWillUnmount(){null!==this.state.streetViewService&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)}render(){return null}}Fe.contextType=h;class He extends t.PureComponent{constructor(){super(...arguments),this.state={directionsService:null},this.setDirectionsServiceCallback=()=>{null!==this.state.directionsService&&this.props.onLoad&&this.props.onLoad(this.state.directionsService)}}componentDidMount(){l(!!this.props.options,"DirectionsService expected options object as parameter, but got %s",this.props.options);const t=new google.maps.DirectionsService;this.setState((function(){return{directionsService:t}}),this.setDirectionsServiceCallback)}componentDidUpdate(){null!==this.state.directionsService&&this.state.directionsService.route(this.props.options,this.props.callback)}componentWillUnmount(){null!==this.state.directionsService&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)}render(){return t.createElement(t.Fragment,null)}}const Ge={onDirectionsChanged:"directions_changed"},qe={directions(t,e){t.setDirections(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},panel(t,e){t.setPanel(e)},routeIndex(t,e){t.setRouteIndex(e)}};class $e extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.state={directionsRenderer:null},this.setDirectionsRendererCallback=()=>{null!==this.state.directionsRenderer&&(this.state.directionsRenderer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.directionsRenderer))}}componentDidMount(){const t=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=m({updaterMap:qe,eventMap:Ge,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{directionsRenderer:t}}),this.setDirectionsRendererCallback)}componentDidUpdate(t){null!==this.state.directionsRenderer&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:qe,eventMap:Ge,prevProps:t,nextProps:this.props,instance:this.state.directionsRenderer}))}componentWillUnmount(){null!==this.state.directionsRenderer&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),g(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))}render(){return t.createElement(t.Fragment,null)}}$e.contextType=h;class Ke extends t.PureComponent{constructor(){super(...arguments),this.state={distanceMatrixService:null},this.setDistanceMatrixServiceCallback=()=>{null!==this.state.distanceMatrixService&&this.props.onLoad&&this.props.onLoad(this.state.distanceMatrixService)}}componentDidMount(){l(!!this.props.options,"DistanceMatrixService expected options object as parameter, but go %s",this.props.options);const t=new google.maps.DistanceMatrixService;this.setState((function(){return{distanceMatrixService:t}}),this.setDistanceMatrixServiceCallback)}componentDidUpdate(){null!==this.state.distanceMatrixService&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)}componentWillUnmount(){null!==this.state.distanceMatrixService&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)}render(){return t.createElement(t.Fragment,null)}}const Ye={onPlacesChanged:"places_changed"},Qe={bounds(t,e){t.setBounds(e)}};class Je extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.containerElement=t.createRef(),this.state={searchBox:null},this.setSearchBoxCallback=()=>{null!==this.state.searchBox&&this.props.onLoad&&this.props.onLoad(this.state.searchBox)}}componentDidMount(){if(l(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places),null!==this.containerElement&&null!==this.containerElement.current){const t=this.containerElement.current.querySelector("input");if(null!==t){const e=new google.maps.places.SearchBox(t,this.props.options);this.registeredEvents=m({updaterMap:Qe,eventMap:Ye,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{searchBox:e}}),this.setSearchBoxCallback)}}}componentDidUpdate(t){null!==this.state.searchBox&&(g(this.registeredEvents),this.registeredEvents=m({updaterMap:Qe,eventMap:Ye,prevProps:t,nextProps:this.props,instance:this.state.searchBox}))}componentWillUnmount(){null!==this.state.searchBox&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),g(this.registeredEvents))}render(){return t.createElement("div",{ref:this.containerElement},t.Children.only(this.props.children))}}Je.contextType=h;const Xe={onPlaceChanged:"place_changed"},ts={bounds(t,e){t.setBounds(e)},restrictions(t,e){t.setComponentRestrictions(e)},fields(t,e){t.setFields(e)},options(t,e){t.setOptions(e)},types(t,e){t.setTypes(e)}};class es extends t.PureComponent{constructor(){super(...arguments),this.registeredEvents=[],this.containerElement=t.createRef(),this.state={autocomplete:null},this.setAutocompleteCallback=()=>{null!==this.state.autocomplete&&this.props.onLoad&&this.props.onLoad(this.state.autocomplete)}}componentDidMount(){l(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places);const t=this.containerElement.current.querySelector("input");if(t){const e=new google.maps.places.Autocomplete(t,this.props.options);this.registeredEvents=m({updaterMap:ts,eventMap:Xe,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{autocomplete:e}}),this.setAutocompleteCallback)}}componentDidUpdate(t){g(this.registeredEvents),this.registeredEvents=m({updaterMap:ts,eventMap:Xe,prevProps:t,nextProps:this.props,instance:this.state.autocomplete})}componentWillUnmount(){null!==this.state.autocomplete&&g(this.registeredEvents)}render(){return t.createElement("div",{ref:this.containerElement,className:this.props.className||""},t.Children.only(this.props.children))}}es.contextType=h;export{es as Autocomplete,W as BicyclingLayer,Ce as Circle,Pe as Data,$e as DirectionsRenderer,He as DirectionsService,Ke as DistanceMatrixService,F as DrawingManager,y as GoogleMap,re as GoogleMapsMarkerClusterer,ae as GoogleMarkerClusterer,Ae as GroundOverlay,We as HeatmapLayer,ot as InfoBox,pe as InfoWindow,Se as KmlLayer,_ as LoadScript,T as LoadScriptNext,h as MapContext,q as Marker,et as MarkerClusterer,Be as OverlayView,fe as Polygon,de as Polyline,xe as Rectangle,Je as StandaloneSearchBox,Ze as StreetViewPanorama,Fe as StreetViewService,j as TrafficLayer,N as TransitLayer,p as useGoogleMap,z as useJsApiLoader,I as useLoadScript};
  //# sourceMappingURL=esm.min.js.map
  