{"version":3,"sources":["webpack:///./node_modules/querystring-es3/decode.js","webpack:///./node_modules/querystring-es3/encode.js","webpack:///./node_modules/@react-google-maps/api/dist/esm.js","webpack:///./node_modules/lodash/_root.js","webpack:///./node_modules/lodash/debounce.js","webpack:///./node_modules/lodash/_Symbol.js","webpack:///./node_modules/lodash/isObject.js","webpack:///./node_modules/lodash/isObjectLike.js","webpack:///./node_modules/querystring-es3/index.js","webpack:///./node_modules/lodash/isSymbol.js","webpack:///./node_modules/lodash/_baseGetTag.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/lodash/toNumber.js","webpack:///./node_modules/lodash/_freeGlobal.js","webpack:///./node_modules/lodash/now.js","webpack:///./node_modules/lodash/_baseTrim.js","webpack:///./node_modules/lodash/_trimmedEndIndex.js","webpack:///./node_modules/lodash/_getRawTag.js","webpack:///./node_modules/lodash/_objectToString.js"],"names":["hasOwnProperty","obj","prop","Object","prototype","call","module","exports","qs","sep","eq","options","length","regexp","split","maxKeys","len","i","kstr","vstr","k","v","x","replace","idx","indexOf","substr","decodeURIComponent","isArray","push","Array","xs","toString","stringifyPrimitive","isFinite","name","undefined","map","objectKeys","ks","encodeURIComponent","join","f","res","keys","key","invariant_1","globalThis","window","global","self","condition","format","a","b","c","d","e","error","Error","args","argIndex","framesToPop","MapContext","applyUpdaterToNextProps","updaterMap","prevProps","nextProps","instance","fn","forEach","nextValue","registerEvents","props","eventMap","acc","reduce","newAcc","googleEventName","onEventName","google","maps","event","addListener","unregisterEvent","registered","removeListener","unregisterEvents","events","applyUpdatersToPropsAndRegisterEvents","registeredEvents","eventMap$i","onDblClick","onDragEnd","onDragStart","onMapTypeIdChanged","onMouseMove","onMouseOut","onMouseOver","onMouseDown","onMouseUp","onRightClick","onTilesLoaded","onBoundsChanged","onCenterChanged","onClick","onDrag","onHeadingChanged","onIdle","onProjectionChanged","onResize","onTiltChanged","onZoomChanged","updaterMap$i","extra","it","mapTypes","set","String","center","setCenter","clickable","setClickableIcons","heading","setHeading","mapTypeId","setMapTypeId","setOptions","streetView","setStreetView","tilt","setTilt","zoom","setZoom","GoogleMap","super","arguments","this","state","mapRef","getInstance","Map","panTo","latLng","setMapCallback","onLoad","getRef","ref","setState","onUnmount","id","style","mapContainerStyle","className","mapContainerClassName","Provider","value","children","__rest$1","s","t","p","getOwnPropertySymbols","propertyIsEnumerable","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","result","done","then","apply","isBrowser","document","injectScript","url","nonce","existingScript","getElementById","windowWithGoogleMap","dataStateAttribute","getAttribute","src","originalInitMap","initMap","originalErrorCallback","onerror","err","remove","script","createElement","type","async","setAttribute","head","appendChild","catch","console","isRobotoStyle","element","href","tagName","toLowerCase","styleSheet","cssText","innerHTML","preventGoogleFonts","getElementsByTagName","trueInsertBefore","insertBefore","bind","newElement","referenceElement","Reflect","trueAppend","textNode","makeLoadScriptUrl","googleMapsApiKey","googleMapsClientId","version","language","region","libraries","channel","mapIds","params","sort","cleaningUp","DefaultLoadingElement","defaultLoadScriptProps","LoadScript","check","loaded","cleanupCallback","isCleaningUp","timer","setInterval","clearInterval","cleanup","parentNode","removeChild","slice","filter","includes","link","innerText","preventGoogleFontsLoading","injectScriptOptions","onError","warn","timeoutCallback","current","setTimeout","loadingElement","previouslyLoadedUrl","defaultProps","defaultLoadingElement","_a","hookOptions","isLoaded","loadError","isMounted","setLoaded","setLoadError","setLoadedIfMounted","prevLibraries","useLoadScript","Loader","apiKey","client","retries","CALLBACK","callbacks","loading","errors","equal","constructor","RegExp","source","flags","valueOf","fastDeepEqual","JSON","stringify","loadPromise","loadCallback","execute","callback","createUrl","loadErrorCallback","defer","deleteScript","onerrorEvent","failed","reset","delay","Math","pow","log","setScript","__googleMapsCallback","cb","resetIfRetryingFailed","setCallback","useJsApiLoader","loader","load","eventMap$h","updaterMap$h","TrafficLayer","trafficLayer","setTrafficLayerCallback","assign","context","setMap","contextType","BicyclingLayer","bicyclingLayer","setBicyclingLayerCallback","TransitLayer","transitLayer","setTransitLayerCallback","eventMap$g","onCircleComplete","onMarkerComplete","onOverlayComplete","onPolygonComplete","onPolylineComplete","onRectangleComplete","updaterMap$g","drawingMode","setDrawingMode","DrawingManager","drawingManager","setDrawingManagerCallback","drawing","eventMap$f","onAnimationChanged","onClickableChanged","onCursorChanged","onDraggableChanged","onFlatChanged","onIconChanged","onPositionChanged","onShapeChanged","onTitleChanged","onVisibleChanged","onZindexChanged","updaterMap$f","animation","setAnimation","setClickable","cursor","setCursor","draggable","setDraggable","icon","setIcon","label","setLabel","opacity","setOpacity","position","setPosition","shape","setShape","title","setTitle","visible","setVisible","zIndex","setZIndex","Marker","markerOptions","clusterer","marker","addMarker","noClustererRedraw","removeMarker","child","elementChild","anchor","ClusterIcon","cluster","styles","getClusterer","extend","OverlayView","clusterClassName","getClusterClass","div","sums","boundsChangedListener","height","width","anchorText","anchorIcon","textColor","textSize","textDecoration","fontWeight","fontStyle","fontFamily","backgroundPosition","getMap","onAdd","cMouseDownInCluster","cDraggingMapByCluster","_this","show","getPanes","overlayMouseTarget","addDomListener","markerClusterer_1","trigger","getZoomOnClick","maxZoom_1","getMaxZoom","bounds_1","getBounds","fitBounds","getZoom","cancelBubble","stopPropagation","onRemove","hide","clearInstanceListeners","draw","getPosFromLatLng","y","top","left","display","img","divTitle","bp","spriteH","parseInt","spriteV","pos","getTitle","createCss","enableRetinaIcons","text","useStyle","getStyles","min","max","index","latlng","getProjection","fromLatLngToDivPixel","Cluster$1","Cluster","markerClusterer","gridSize","getGridSize","minClusterSize","getMinimumClusterSize","averageCenter","getAverageCenter","markers","bounds","clusterIcon","getSize","getMarkers","getCenter","LatLngBounds","getPosition","isMarkerAlreadyAdded","length_1","LatLng","lat","lng","calculateBounds","isAdded","mCount","maxZoom","isMarkerInClusterBounds","contains","getExtendedBounds","updateIcon","getCalculator","CALCULATOR","numStyles","count","numberOfDigits","IMAGE_SIZES","Clusterer","optMarkers","optOptions","clusters","listeners","activeMap","ready","minimumClusterSize","zoomOnClick","ignoreHidden","imagePath","imageExtension","imageSizes","calculator","batchSize","batchSizeIE","clusterClass","navigator","userAgent","timerRefStatic","setupStyles","addMarkers","repaint","resetViewport","get","redraw","fitMapToMarkers","setGridSize","setMinimumClusterSize","setMaxZoom","setStyles","setZoomOnClick","setAverageCenter","getIgnoreHidden","setIgnoreHidden","getEnableRetinaIcons","setEnableRetinaIcons","getImageExtension","setImageExtension","getImagePath","setImagePath","getImageSizes","setImageSizes","setCalculator","getBatchSizeIE","setBatchSizeIE","setClusterClass","getTotalMarkers","getClusters","getTotalClusters","optNoDraw","pushMarkerTo","getDraggable","removeMarker_","splice","removed","removeMarkers","clearMarkers","oldClusters","projection","trPix","getNorthEast","blPix","getSouthWest","fromDivPixelToLatLng","createClusters","optHide","distanceBetweenPoints","p1","p2","dLat","PI","dLon","sin","cos","atan2","sqrt","isMarkerInBounds","addToClosestCluster","distance","clusterToAddTo","iFirst","clearTimeout","mapBounds","iLast","getVisible","obj1","obj2","object","property","eventMap$e","onClusteringBegin","onClusteringEnd","updaterMap$e","ClustererComponent","setClustererCallback","InfoBox","content","disableAutoPan","maxWidth","pixelOffset","Size","boxClass","boxStyle","closeBoxMargin","closeBoxURL","infoBoxClearance","isHidden","alignBottom","pane","enableEventPropagation","closeListener","moveListener","mapListener","contextListener","eventListeners","fixedWidthSet","createInfoBoxDiv","cancelHandler","setBoxStyle","getCloseBoxImg","addClickHandler","offsetWidth","bw","getBoxWidths","right","panBox","returnValue","preventDefault","firstChild","closeBox","getCloseClickHandler","close","disablePan","xOffset","yOffset","mapDiv","getDiv","mapWidth","mapHeight","offsetHeight","iwOffsetX","iwOffsetY","iwWidth","iwHeight","padX","padY","pixPosition","fromLatLngToContainerPixel","panBy","webkitTransform","parseFloat","msFilter","visibility","overflow","bottom","defaultView","getComputedStyle","ownerDocument","computedStyle","borderTopWidth","borderBottomWidth","borderLeftWidth","borderRightWidth","documentElement","currentStyle","setContent","isVisible","getContent","getZIndex","open","eventMap$d","onCloseClick","onContentChanged","onDomReady","updaterMap$d","InfoBoxComponent","containerElement","infoBox","setInfoBoxCallback","infoBoxOptions","positionLatLng","only","lib","DBSCAN","dataset","epsilon","minPts","distanceFunction","_euclideanDistance","noise","_visited","_assigned","_datasetLength","_init","run","pointId","neighbors","_regionQuery","clusterId","_addToCluster","_expandCluster","pointId2","neighbors2","_mergeArrays","q","sum","KMEANS","assignments","centroids","init","randomCentroid","change","centroidId","mean","maxDim","dim","j","centroid","maxId","round","random","closestCentroid","argmin","point","Number","MAX_VALUE","arg","diff","OPTICS","PriorityQueue","elements","priorities","sorting","_queue","_priorities","_sorting","insert","ele","priority","indexToInsert","priority2","_insertAt","func","getElements","getElementPriority","getPriorities","getElementsWithPriorities","l","PriorityQueue$1","_reachability","_processed","_coreDistance","_orderedList","priorityQueue","_distanceToCore","_updateQueue","getReachabilityPlot","reachabilityPlot","queue","dist","newReachableDistance","queueElements","coreDistCand","supercluster","sortKD","ids","coords","nodeSize","depth","m","select","inc","n","z","exp","sd","newLeft","floor","newRight","swapItem","swap","arr","tmp","sqDist","ax","ay","bx","by","dx","dy","defaultGetX","defaultGetY","KDBush","points","getX","getY","ArrayType","Float64Array","IndexArrayType","Uint16Array","Uint32Array","range","minX","minY","maxX","maxY","stack","axis","pop","nextAxis","within","r","qx","qy","r2","defaultOptions","minZoom","minPoints","radius","extent","generateId","fround","Float32Array","Supercluster","create","trees","createCluster","numPoints","properties","Infinity","parentId","createPointCluster","geometry","coordinates","lngX","latY","getClusterJSON","getClusterProperties","y2","atan","abbrev","cluster_id","point_count","point_count_abbreviated","dest","time","timerId","timeEnd","now","Date","_cluster","bbox","minLng","minLat","maxLng","maxLat","easternHem","westernHem","concat","tree","_limitZoom","list","getChildren","originId","_getOriginId","originZoom","_getOriginZoom","errorMsg","origin","getLeaves","limit","offset","leaves","_appendLeaves","getTile","z2","tile","features","_addTileFeatures","getClusterExpansionZoom","expansionZoom","skipped","i$1","isCluster","tags","px","py","neighborIds","numPointsOrigin","neighborId","wx","wy","clusterProperties","_map","i$2","list$1","neighborId$1","b$1","numPoints2","i$3","list$2","neighborId$2","b$2","clone","original","factory","MarkerClustererEvents","eventMap$c","updaterMap$c","InfoWindow","infoWindow","setInfoWindowCallback","eventMap$b","updaterMap$b","editable","setEditable","path","setPath","Polyline","polyline","setPolylineCallback","eventMap$a","updaterMap$a","paths","setPaths","Polygon","polygon","setPolygonCallback","eventMap$9","updaterMap$9","setBounds","Rectangle","rectangle","setRectangleCallback","eventMap$8","onRadiusChanged","updaterMap$8","setRadius","Circle","circle","setCircleCallback","eventMap$7","onAddFeature","onRemoveFeature","onRemoveProperty","onSetGeometry","onSetProperty","updaterMap$7","add","geojson","addGeoJson","feature","loadGeoJson","overrideStyle","revertStyle","controlPosition","setControlPosition","controls","setControls","mode","setStyle","toGeoJson","Data","data","setDataCallback","eventMap$6","onDefaultViewportChanged","onStatusChanged","updaterMap$6","setUrl","KmlLayer","kmlLayer","setKmlLayerCallback","createLatLng","inst","Type","createLatLngBounds","ne","sw","ensureOfType","convertToLatLngString","latLngLike","convertToLatLngBoundsString","latLngBoundsLike","south","east","north","west","paneEl","containerStyle","updatePane","mapPaneName","mapPanes","overlayView","_b","onPositionElement","getPixelPositionOffset","layoutStyles","mapCanvasProjection","getLayoutStylesByBounds","getLayoutStylesByPosition","getLayoutStyles","containerRef","currentPosition","previousPosition","prevPositionString","positionString","prevBoundsString","boundsString","FLOAT_PANE","MAP_PANE","MARKER_LAYER","OVERLAY_LAYER","OVERLAY_MOUSE_TARGET","eventMap$5","updaterMap$5","GroundOverlay","groundOverlay","setGroundOverlayCallback","eventMap$4","updaterMap$4","setData","HeatmapLayer","heatmapLayer","setHeatmapLayerCallback","visualization","eventMap$3","onPanoChanged","onPovChanged","updaterMap$3","provider","registerPanoProvider","links","setLinks","motionTracking","setMotionTracking","pano","setPano","pov","setPov","StreetViewPanorama","streetViewPanorama","setStreetViewPanoramaCallback","getStreetView","StreetViewService","streetViewService","setStreetViewServiceCallback","eventMap$2","onDirectionsChanged","updaterMap$2","directions","setDirections","panel","setPanel","routeIndex","setRouteIndex","DirectionsRenderer","directionsRenderer","setDirectionsRendererCallback","eventMap$1","onPlacesChanged","updaterMap$1","StandaloneSearchBox","searchBox","setSearchBoxCallback","places","input","querySelector","SearchBox","onPlaceChanged","restrictions","setComponentRestrictions","fields","setFields","types","setTypes","Autocomplete","autocomplete","setAutocompleteCallback","freeGlobal","freeSelf","root","Function","isObject","toNumber","nativeMax","nativeMin","wait","lastArgs","lastThis","maxWait","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","leadingEdge","timerExpired","shouldInvoke","timeSinceLastCall","trailingEdge","timeWaiting","remainingWait","debounced","isInvoking","cancel","flush","Symbol","decode","parse","encode","baseGetTag","isObjectLike","getRawTag","objectToString","symToStringTag","toStringTag","g","baseTrim","isSymbol","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","other","isBinary","test","trimmedEndIndex","reTrimStart","string","reWhitespace","charAt","objectProto","nativeObjectToString","isOwn","tag","unmasked"],"mappings":"uGA0BA,SAASA,EAAeC,EAAKC,GAC3B,OAAOC,OAAOC,UAAUJ,eAAeK,KAAKJ,EAAKC,GAGnDI,EAAOC,QAAU,SAASC,EAAIC,EAAKC,EAAIC,GACrCF,EAAMA,GAAO,IACbC,EAAKA,GAAM,IACX,IAAIT,EAAM,GAEV,GAAkB,iBAAPO,GAAiC,IAAdA,EAAGI,OAC/B,OAAOX,EAGT,IAAIY,EAAS,MACbL,EAAKA,EAAGM,MAAML,GAEd,IAAIM,EAAU,IACVJ,GAAsC,iBAApBA,EAAQI,UAC5BA,EAAUJ,EAAQI,SAGpB,IAAIC,EAAMR,EAAGI,OAETG,EAAU,GAAKC,EAAMD,IACvBC,EAAMD,GAGR,IAAK,IAAIE,EAAI,EAAGA,EAAID,IAAOC,EAAG,CAC5B,IAEIC,EAAMC,EAAMC,EAAGC,EAFfC,EAAId,EAAGS,GAAGM,QAAQV,EAAQ,OAC1BW,EAAMF,EAA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GACjB,IAAIi9B,EAAQ7mC,EAAeK,KAAKuJ,EAAO87B,GACnCoB,EAAMl9B,EAAM87B,GAEhB,IACE97B,EAAM87B,QAAkBtjC,EACxB,IAAI2kC,GAAW,EACf,MAAOtjC,IAET,IAAIuH,EAAS47B,EAAqBvmC,KAAKuJ,GAQvC,OAPIm9B,IACEF,EACFj9B,EAAM87B,GAAkBoB,SAEjBl9B,EAAM87B,IAGV16B,I,iBCzCT,IAOI47B,EAPczmC,OAAOC,UAOc4B,SAavC1B,EAAOC,QAJP,SAAwBqJ,GACtB,OAAOg9B,EAAqBvmC,KAAKuJ","file":"vendors~DepotLocator-c0f21d0c7502270043d0.js","sourcesContent":["// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n","import * as React from 'react';\nimport { createContext, useContext, PureComponent, useState, useEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar NODE_ENV = process.env.NODE_ENV;\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nvar invariant_1 = invariant;\n\nconst MapContext = createContext(null);\nfunction useGoogleMap() {\n invariant_1(!!useContext, 'useGoogleMap is React hook and requires React version 16.8+');\n const map = useContext(MapContext);\n invariant_1(!!map, 'useGoogleMap needs a GoogleMap available up in the tree');\n return map;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst reduce = (obj, fn, acc) => {\n return Object.keys(obj).reduce(function reducer(newAcc, key) {\n return fn(newAcc, obj[key], key);\n }, acc);\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction forEach(obj, fn) {\n Object.keys(obj).forEach(function iterator(key) {\n return fn(obj[key], key);\n });\n}\n\n/* global google */\nconst applyUpdaterToNextProps = (\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nupdaterMap, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nprevProps, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nnextProps, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninstance\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const map = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const iter = (fn, key) => {\n const nextValue = nextProps[key];\n if (nextValue !== prevProps[key]) {\n map[key] = nextValue;\n fn(instance, nextValue);\n }\n };\n forEach(updaterMap, iter);\n return map;\n};\nfunction registerEvents(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nprops, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninstance, eventMap) {\n const registeredList = reduce(eventMap, function reducer(acc, googleEventName, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onEventName) {\n if (typeof props[onEventName] === 'function') {\n acc.push(google.maps.event.addListener(instance, googleEventName, props[onEventName]));\n }\n return acc;\n }, []);\n return registeredList;\n}\nfunction unregisterEvent(registered) {\n google.maps.event.removeListener(registered);\n}\nfunction unregisterEvents(events = []) {\n events.forEach(unregisterEvent);\n}\nfunction applyUpdatersToPropsAndRegisterEvents({ updaterMap, eventMap, prevProps, nextProps, instance, }) {\n const registeredEvents = registerEvents(nextProps, instance, eventMap);\n applyUpdaterToNextProps(updaterMap, prevProps, nextProps, instance);\n return registeredEvents;\n}\n\nconst eventMap$i = {\n onDblClick: 'dblclick',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMapTypeIdChanged: 'maptypeid_changed',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseDown: 'mousedown',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n onTilesLoaded: 'tilesloaded',\n onBoundsChanged: 'bounds_changed',\n onCenterChanged: 'center_changed',\n onClick: 'click',\n onDrag: 'drag',\n onHeadingChanged: 'heading_changed',\n onIdle: 'idle',\n onProjectionChanged: 'projection_changed',\n onResize: 'resize',\n onTiltChanged: 'tilt_changed',\n onZoomChanged: 'zoom_changed',\n};\nconst updaterMap$i = {\n extraMapTypes(map, extra) {\n extra.forEach(function forEachExtra(it, i) {\n map.mapTypes.set(String(i), it);\n });\n },\n center(map, center) {\n map.setCenter(center);\n },\n clickableIcons(map, clickable) {\n map.setClickableIcons(clickable);\n },\n heading(map, heading) {\n map.setHeading(heading);\n },\n mapTypeId(map, mapTypeId) {\n map.setMapTypeId(mapTypeId);\n },\n options(map, options) {\n map.setOptions(options);\n },\n streetView(map, streetView) {\n map.setStreetView(streetView);\n },\n tilt(map, tilt) {\n map.setTilt(tilt);\n },\n zoom(map, zoom) {\n map.setZoom(zoom);\n },\n};\n// function GoogleMapFunctional({ children, options, id, mapContainerStyle, center, clickableIcons, extraMapTypes, heading, mapContainerClassName, mapTypeId, onBoundsChanged, onCenterChanged, onClick, onDblClick, onDrag, onDragEnd, onDragStart, onHeadingChanged, onIdle, onProjectionChanged, onResize, onTiltChanged, onLoad }: GoogleMapProps): JSX.Element {\n// const [map, setMap] = React.useState(null)\n// const ref = React.useRef(null)\n// const getInstance = React.useCallback(() => {\n// if (ref.current === null) {\n// return null\n// }\n// return new google.maps.Map(ref.current, options)\n// }, [options])\n// React.useEffect(() => {\n// }, [])\n// const panTo = React.useCallback((latLng: google.maps.LatLng | google.maps.LatLngLiteral): void => {\n// const map = getInstance()\n// if (map) {\n// map.panTo(latLng)\n// }\n// }, [])\n// React.useEffect(() => {\n// const map = getInstance()\n// }, [])\n// return (\n// \n// \n// {map !== null ? children : <>}\n// \n// \n// )\n// }\nclass GoogleMap extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.state = {\n map: null,\n };\n this.registeredEvents = [];\n this.mapRef = null;\n this.getInstance = () => {\n if (this.mapRef === null) {\n return null;\n }\n return new google.maps.Map(this.mapRef, this.props.options);\n };\n this.panTo = (latLng) => {\n const map = this.getInstance();\n if (map) {\n map.panTo(latLng);\n }\n };\n this.setMapCallback = () => {\n if (this.state.map !== null) {\n if (this.props.onLoad) {\n this.props.onLoad(this.state.map);\n }\n }\n };\n this.getRef = (ref) => {\n this.mapRef = ref;\n };\n }\n componentDidMount() {\n const map = this.getInstance();\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$i,\n eventMap: eventMap$i,\n prevProps: {},\n nextProps: this.props,\n instance: map,\n });\n this.setState(function setMap() {\n return {\n map,\n };\n }, this.setMapCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.map !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$i,\n eventMap: eventMap$i,\n prevProps,\n nextProps: this.props,\n instance: this.state.map,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.map !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.map);\n }\n unregisterEvents(this.registeredEvents);\n }\n }\n render() {\n return (React.createElement(\"div\", { id: this.props.id, ref: this.getRef, style: this.props.mapContainerStyle, className: this.props.mapContainerClassName },\n React.createElement(MapContext.Provider, { value: this.state.map }, this.state.map !== null ? this.props.children : React.createElement(React.Fragment, null))));\n }\n}\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest$1(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\n\nconst isBrowser = typeof document !== 'undefined';\n\nconst injectScript = ({ url, id, nonce }) => {\n if (!isBrowser) {\n return Promise.reject(new Error('document is undefined'));\n }\n return new Promise(function injectScriptCallback(resolve, reject) {\n const existingScript = document.getElementById(id);\n const windowWithGoogleMap = window;\n if (existingScript) {\n // Same script id/url: keep same script\n const dataStateAttribute = existingScript.getAttribute('data-state');\n if (existingScript.src === url && dataStateAttribute !== 'error') {\n if (dataStateAttribute === 'ready') {\n return resolve(id);\n }\n else {\n const originalInitMap = windowWithGoogleMap.initMap;\n const originalErrorCallback = existingScript.onerror;\n windowWithGoogleMap.initMap = function initMap() {\n if (originalInitMap) {\n originalInitMap();\n }\n resolve(id);\n };\n existingScript.onerror = function (err) {\n if (originalErrorCallback) {\n originalErrorCallback(err);\n }\n reject(err);\n };\n return;\n }\n }\n // Same script id, but either\n // 1. requested URL is different\n // 2. script failed to load\n else {\n existingScript.remove();\n }\n }\n const script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url;\n script.id = id;\n script.async = true;\n script.nonce = nonce;\n script.onerror = function onerror(err) {\n script.setAttribute('data-state', 'error');\n reject(err);\n };\n windowWithGoogleMap.initMap = function onload() {\n script.setAttribute('data-state', 'ready');\n resolve(id);\n };\n document.head.appendChild(script);\n }).catch(err => {\n console.error('injectScript error: ', err);\n throw err;\n });\n};\n\nconst isRobotoStyle = (element) => {\n // roboto font download\n if (element.href &&\n element.href.indexOf('https://fonts.googleapis.com/css?family=Roboto') ===\n 0) {\n return true;\n }\n // roboto style elements\n if (element.tagName.toLowerCase() === 'style' &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n element.styleSheet &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n element.styleSheet.cssText &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n element.styleSheet.cssText.replace('\\r\\n', '').indexOf('.gm-style') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n element.styleSheet.cssText = '';\n return true;\n }\n // roboto style elements for other browsers\n if (element.tagName.toLowerCase() === 'style' &&\n element.innerHTML &&\n element.innerHTML.replace('\\r\\n', '').indexOf('.gm-style') === 0) {\n element.innerHTML = '';\n return true;\n }\n // when google tries to add empty style\n if (element.tagName.toLowerCase() === 'style' &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n !element.styleSheet &&\n !element.innerHTML) {\n return true;\n }\n return false;\n};\n// Preventing the Google Maps library from downloading an extra font\nconst preventGoogleFonts = () => {\n // we override these methods only for one particular head element\n // default methods for other elements are not affected\n const head = document.getElementsByTagName('head')[0];\n const trueInsertBefore = head.insertBefore.bind(head);\n // TODO: adding return before reflect solves the TS issue\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n head.insertBefore = function insertBefore(newElement, referenceElement) {\n if (!isRobotoStyle(newElement)) {\n Reflect.apply(trueInsertBefore, head, [newElement, referenceElement]);\n }\n };\n const trueAppend = head.appendChild.bind(head);\n // TODO: adding return before reflect solves the TS issue\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n head.appendChild = function appendChild(textNode) {\n if (!isRobotoStyle(textNode)) {\n Reflect.apply(trueAppend, head, [textNode]);\n }\n };\n};\n\nfunction makeLoadScriptUrl({ googleMapsApiKey, googleMapsClientId, version = 'weekly', language, region, libraries, channel, mapIds }) {\n const params = [];\n invariant_1((googleMapsApiKey && googleMapsClientId) || !(googleMapsApiKey && googleMapsClientId), '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.');\n if (googleMapsApiKey) {\n params.push(`key=${googleMapsApiKey}`);\n }\n else if (googleMapsClientId) {\n params.push(`client=${googleMapsClientId}`);\n }\n if (version) {\n params.push(`v=${version}`);\n }\n if (language) {\n params.push(`language=${language}`);\n }\n if (region) {\n params.push(`region=${region}`);\n }\n if (libraries && libraries.length) {\n params.push(`libraries=${libraries.sort().join(',')}`);\n }\n if (channel) {\n params.push(`channel=${channel}`);\n }\n if (mapIds && mapIds.length) {\n params.push(`map_ids=${mapIds.join(',')}`);\n }\n params.push('callback=initMap');\n return `https://maps.googleapis.com/maps/api/js?${params.join('&')}`;\n}\n\nlet cleaningUp = false;\nfunction DefaultLoadingElement() {\n return React.createElement(\"div\", null, `Loading...`);\n}\nconst defaultLoadScriptProps = {\n id: 'script-loader',\n version: 'weekly',\n};\nclass LoadScript extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.check = React.createRef();\n this.state = {\n loaded: false,\n };\n this.cleanupCallback = () => {\n // @ts-ignore\n delete window.google.maps;\n this.injectScript();\n };\n this.isCleaningUp = () => __awaiter(this, void 0, void 0, function* () {\n function promiseCallback(resolve) {\n if (!cleaningUp) {\n resolve();\n }\n else {\n if (isBrowser) {\n const timer = window.setInterval(function interval() {\n if (!cleaningUp) {\n window.clearInterval(timer);\n resolve();\n }\n }, 1);\n }\n }\n return;\n }\n return new Promise(promiseCallback);\n });\n this.cleanup = () => {\n cleaningUp = true;\n const script = document.getElementById(this.props.id);\n if (script && script.parentNode) {\n script.parentNode.removeChild(script);\n }\n Array.prototype.slice\n .call(document.getElementsByTagName('script'))\n .filter(function filter(script) {\n return typeof script.src === 'string' && script.src.includes('maps.googleapis');\n })\n .forEach(function forEach(script) {\n if (script.parentNode) {\n script.parentNode.removeChild(script);\n }\n });\n Array.prototype.slice\n .call(document.getElementsByTagName('link'))\n .filter(function filter(link) {\n return (link.href === 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans');\n })\n .forEach(function forEach(link) {\n if (link.parentNode) {\n link.parentNode.removeChild(link);\n }\n });\n Array.prototype.slice\n .call(document.getElementsByTagName('style'))\n .filter(function filter(style) {\n return (style.innerText !== undefined &&\n style.innerText.length > 0 &&\n style.innerText.includes('.gm-'));\n })\n .forEach(function forEach(style) {\n if (style.parentNode) {\n style.parentNode.removeChild(style);\n }\n });\n };\n this.injectScript = () => {\n if (this.props.preventGoogleFontsLoading) {\n preventGoogleFonts();\n }\n invariant_1(!!this.props.id, 'LoadScript requires \"id\" prop to be a string: %s', this.props.id);\n const injectScriptOptions = {\n id: this.props.id,\n nonce: this.props.nonce,\n url: makeLoadScriptUrl(this.props),\n };\n injectScript(injectScriptOptions)\n .then(() => {\n if (this.props.onLoad) {\n this.props.onLoad();\n }\n this.setState(function setLoaded() {\n return {\n loaded: true,\n };\n });\n return;\n })\n .catch(err => {\n if (this.props.onError) {\n this.props.onError(err);\n }\n console.error(`\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (${this\n .props.googleMapsApiKey || '-'}) or Client ID (${this.props.googleMapsClientId ||\n '-'}) to \n Otherwise it is a Network issue.\n `);\n });\n };\n }\n componentDidMount() {\n if (isBrowser) {\n if (window.google && window.google.maps && !cleaningUp) {\n console.error('google api is already presented');\n return;\n }\n this.isCleaningUp()\n .then(this.injectScript)\n .catch(function error(err) {\n console.error('Error at injecting script after cleaning up: ', err);\n });\n }\n }\n componentDidUpdate(prevProps) {\n if (this.props.libraries !== prevProps.libraries) {\n 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');\n }\n if (isBrowser && prevProps.language !== this.props.language) {\n this.cleanup();\n // TODO: refactor to use gDSFP maybe... wait for hooks refactoring.\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState(function setLoaded() {\n return {\n loaded: false,\n };\n }, this.cleanupCallback);\n }\n }\n componentWillUnmount() {\n if (isBrowser) {\n this.cleanup();\n const timeoutCallback = () => {\n if (!this.check.current) {\n // @ts-ignore\n delete window.google;\n cleaningUp = false;\n }\n };\n window.setTimeout(timeoutCallback, 1);\n if (this.props.onUnmount) {\n this.props.onUnmount();\n }\n }\n }\n render() {\n return (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { ref: this.check }),\n this.state.loaded\n ? this.props.children\n : this.props.loadingElement || React.createElement(DefaultLoadingElement, null)));\n }\n}\nLoadScript.defaultProps = defaultLoadScriptProps;\n\n/* eslint-disable filenames/match-regex */\nlet previouslyLoadedUrl;\nfunction useLoadScript({ id = defaultLoadScriptProps.id, version = defaultLoadScriptProps.version, nonce, googleMapsApiKey, googleMapsClientId, language, region, libraries, preventGoogleFontsLoading, channel, mapIds, }) {\n const isMounted = React.useRef(false);\n const [isLoaded, setLoaded] = React.useState(false);\n const [loadError, setLoadError] = React.useState(undefined);\n React.useEffect(function trackMountedState() {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n React.useEffect(function applyPreventGoogleFonts() {\n if (isBrowser && preventGoogleFontsLoading) {\n preventGoogleFonts();\n }\n }, [preventGoogleFontsLoading]);\n React.useEffect(function validateLoadedState() {\n if (isLoaded) {\n invariant_1(!!window.google, 'useLoadScript was marked as loaded, but window.google is not present. Something went wrong.');\n }\n }, [isLoaded]);\n const url = makeLoadScriptUrl({\n version,\n googleMapsApiKey,\n googleMapsClientId,\n language,\n region,\n libraries,\n channel,\n mapIds\n });\n React.useEffect(function loadScriptAndModifyLoadedState() {\n if (!isBrowser) {\n return;\n }\n function setLoadedIfMounted() {\n if (isMounted.current) {\n setLoaded(true);\n previouslyLoadedUrl = url;\n }\n }\n if (window.google && window.google.maps && previouslyLoadedUrl === url) {\n setLoadedIfMounted();\n return;\n }\n injectScript({ id, url, nonce })\n .then(setLoadedIfMounted)\n .catch(function handleInjectError(err) {\n if (isMounted.current) {\n setLoadError(err);\n }\n console.warn(`\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (${googleMapsApiKey ||\n '-'}) or Client ID (${googleMapsClientId || '-'})\n Otherwise it is a Network issue.\n `);\n console.error(err);\n });\n }, [id, url, nonce]);\n const prevLibraries = React.useRef();\n React.useEffect(function checkPerformance() {\n if (prevLibraries.current && libraries !== prevLibraries.current) {\n 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');\n }\n prevLibraries.current = libraries;\n }, [libraries]);\n return { isLoaded, loadError, url };\n}\n\nconst defaultLoadingElement = React.createElement(DefaultLoadingElement, null);\nfunction LoadScriptNext(_a) {\n var { loadingElement, onLoad, onError, onUnmount, children } = _a, hookOptions = __rest$1(_a, [\"loadingElement\", \"onLoad\", \"onError\", \"onUnmount\", \"children\"]);\n const { isLoaded, loadError } = useLoadScript(hookOptions);\n React.useEffect(function handleOnLoad() {\n if (isLoaded && typeof onLoad === 'function') {\n onLoad();\n }\n }, [isLoaded, onLoad]);\n React.useEffect(function handleOnError() {\n if (loadError && typeof onError === 'function') {\n onError(loadError);\n }\n }, [loadError, onError]);\n React.useEffect(function handleOnUnmount() {\n return () => {\n if (onUnmount) {\n onUnmount();\n }\n };\n }, [onUnmount]);\n return isLoaded ? children : loadingElement || defaultLoadingElement;\n}\nvar LoadScriptNext$1 = React.memo(LoadScriptNext);\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nvar fastDeepEqual = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at.\r\n *\r\n * Http://www.apache.org/licenses/LICENSE-2.0.\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst DEFAULT_ID = \"__googleMapsScriptId\";\r\n/**\r\n * [[Loader]] makes it easier to add Google Maps JavaScript API to your application\r\n * dynamically using\r\n * [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\r\n * It works by dynamically creating and appending a script node to the the\r\n * document head and wrapping the callback function so as to return a promise.\r\n *\r\n * ```\r\n * const loader = new Loader({\r\n * apiKey: \"\",\r\n * version: \"weekly\",\r\n * libraries: [\"places\"]\r\n * });\r\n *\r\n * loader.load().then((google) => {\r\n * const map = new google.maps.Map(...)\r\n * })\r\n * ```\r\n */\r\nclass Loader {\r\n /**\r\n * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set\r\n * using this library, instead the defaults are set by the Google Maps\r\n * JavaScript API server.\r\n *\r\n * ```\r\n * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});\r\n * ```\r\n */\r\n constructor({ apiKey, channel, client, id = DEFAULT_ID, libraries = [], language, region, version, mapIds, nonce, retries = 3, url = \"https://maps.googleapis.com/maps/api/js\", }) {\r\n this.CALLBACK = \"__googleMapsCallback\";\r\n this.callbacks = [];\r\n this.done = false;\r\n this.loading = false;\r\n this.errors = [];\r\n this.version = version;\r\n this.apiKey = apiKey;\r\n this.channel = channel;\r\n this.client = client;\r\n this.id = id || DEFAULT_ID; // Do not allow empty string\r\n this.libraries = libraries;\r\n this.language = language;\r\n this.region = region;\r\n this.mapIds = mapIds;\r\n this.nonce = nonce;\r\n this.retries = retries;\r\n this.url = url;\r\n if (Loader.instance) {\r\n if (!fastDeepEqual(this.options, Loader.instance.options)) {\r\n throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Loader.instance.options)}`);\r\n }\r\n return Loader.instance;\r\n }\r\n Loader.instance = this;\r\n }\r\n get options() {\r\n return {\r\n version: this.version,\r\n apiKey: this.apiKey,\r\n channel: this.channel,\r\n client: this.client,\r\n id: this.id,\r\n libraries: this.libraries,\r\n language: this.language,\r\n region: this.region,\r\n mapIds: this.mapIds,\r\n nonce: this.nonce,\r\n url: this.url,\r\n };\r\n }\r\n get failed() {\r\n return this.done && !this.loading && this.errors.length >= this.retries + 1;\r\n }\r\n /**\r\n * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].\r\n *\r\n * @ignore\r\n */\r\n createUrl() {\r\n let url = this.url;\r\n url += `?callback=${this.CALLBACK}`;\r\n if (this.apiKey) {\r\n url += `&key=${this.apiKey}`;\r\n }\r\n if (this.channel) {\r\n url += `&channel=${this.channel}`;\r\n }\r\n if (this.client) {\r\n url += `&client=${this.client}`;\r\n }\r\n if (this.libraries.length > 0) {\r\n url += `&libraries=${this.libraries.join(\",\")}`;\r\n }\r\n if (this.language) {\r\n url += `&language=${this.language}`;\r\n }\r\n if (this.region) {\r\n url += `®ion=${this.region}`;\r\n }\r\n if (this.version) {\r\n url += `&v=${this.version}`;\r\n }\r\n if (this.mapIds) {\r\n url += `&map_ids=${this.mapIds.join(\",\")}`;\r\n }\r\n return url;\r\n }\r\n deleteScript() {\r\n const script = document.getElementById(this.id);\r\n if (script) {\r\n script.remove();\r\n }\r\n }\r\n /**\r\n * Load the Google Maps JavaScript API script and return a Promise.\r\n */\r\n load() {\r\n return this.loadPromise();\r\n }\r\n /**\r\n * Load the Google Maps JavaScript API script and return a Promise.\r\n *\r\n * @ignore\r\n */\r\n loadPromise() {\r\n return new Promise((resolve, reject) => {\r\n this.loadCallback((err) => {\r\n if (!err) {\r\n resolve(window.google);\r\n }\r\n else {\r\n reject(err.error);\r\n }\r\n });\r\n });\r\n }\r\n /**\r\n * Load the Google Maps JavaScript API script with a callback.\r\n */\r\n loadCallback(fn) {\r\n this.callbacks.push(fn);\r\n this.execute();\r\n }\r\n /**\r\n * Set the script on document.\r\n */\r\n setScript() {\r\n if (document.getElementById(this.id)) {\r\n // TODO wrap onerror callback for cases where the script was loaded elsewhere\r\n this.callback();\r\n return;\r\n }\r\n const url = this.createUrl();\r\n const script = document.createElement(\"script\");\r\n script.id = this.id;\r\n script.type = \"text/javascript\";\r\n script.src = url;\r\n script.onerror = this.loadErrorCallback.bind(this);\r\n script.defer = true;\r\n script.async = true;\r\n if (this.nonce) {\r\n script.nonce = this.nonce;\r\n }\r\n document.head.appendChild(script);\r\n }\r\n /**\r\n * Reset the loader state.\r\n */\r\n reset() {\r\n this.deleteScript();\r\n this.done = false;\r\n this.loading = false;\r\n this.errors = [];\r\n this.onerrorEvent = null;\r\n }\r\n resetIfRetryingFailed() {\r\n if (this.failed) {\r\n this.reset();\r\n }\r\n }\r\n loadErrorCallback(e) {\r\n this.errors.push(e);\r\n if (this.errors.length <= this.retries) {\r\n const delay = this.errors.length * Math.pow(2, this.errors.length);\r\n console.log(`Failed to load Google Maps script, retrying in ${delay} ms.`);\r\n setTimeout(() => {\r\n this.deleteScript();\r\n this.setScript();\r\n }, delay);\r\n }\r\n else {\r\n this.onerrorEvent = e;\r\n this.callback();\r\n }\r\n }\r\n setCallback() {\r\n window.__googleMapsCallback = this.callback.bind(this);\r\n }\r\n callback() {\r\n this.done = true;\r\n this.loading = false;\r\n this.callbacks.forEach((cb) => {\r\n cb(this.onerrorEvent);\r\n });\r\n this.callbacks = [];\r\n }\r\n execute() {\r\n this.resetIfRetryingFailed();\r\n if (this.done) {\r\n this.callback();\r\n }\r\n else {\r\n // short circuit and warn if google.maps is already loaded\r\n if (window.google && window.google.maps && window.google.maps.version) {\r\n console.warn(\"Google Maps already loaded outside @googlemaps/js-api-loader.\" +\r\n \"This may result in undesirable behavior as options and script parameters may not match.\");\r\n this.callback();\r\n return;\r\n }\r\n if (this.loading) ;\r\n else {\r\n this.loading = true;\r\n this.setCallback();\r\n this.setScript();\r\n }\r\n }\r\n }\r\n}\n\n/* eslint-disable filenames/match-regex */\nfunction useJsApiLoader({ id = defaultLoadScriptProps.id, version = defaultLoadScriptProps.version, nonce, googleMapsApiKey, \n// googleMapsClientId,\nlanguage, region, libraries, preventGoogleFontsLoading, \n// channel,\nmapIds, }) {\n const isMounted = React.useRef(false);\n const [isLoaded, setLoaded] = React.useState(false);\n const [loadError, setLoadError] = React.useState(undefined);\n React.useEffect(function trackMountedState() {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n const loader = React.useMemo(function memo() {\n return new Loader({\n id,\n apiKey: googleMapsApiKey,\n version,\n libraries,\n language,\n region,\n mapIds,\n nonce,\n });\n }, [id, googleMapsApiKey, version, libraries, language, region, mapIds, nonce]);\n React.useEffect(function effect() {\n if (isLoaded) {\n return;\n }\n else {\n loader.load().then(function then() {\n if (isMounted.current)\n setLoaded(true);\n })\n .catch(function onrejected(error) {\n setLoadError(error);\n });\n }\n }, []);\n React.useEffect(function applyPreventGoogleFonts() {\n if (isBrowser && preventGoogleFontsLoading) {\n preventGoogleFonts();\n }\n }, [preventGoogleFontsLoading]);\n const prevLibraries = React.useRef();\n React.useEffect(function effect() {\n if (prevLibraries.current && libraries !== prevLibraries.current) {\n 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');\n }\n prevLibraries.current = libraries;\n }, [libraries]);\n return { isLoaded, loadError };\n}\n\nconst eventMap$h = {};\nconst updaterMap$h = {\n options(instance, options) {\n instance.setOptions(options);\n },\n};\nclass TrafficLayer extends PureComponent {\n constructor() {\n super(...arguments);\n this.state = {\n trafficLayer: null,\n };\n this.setTrafficLayerCallback = () => {\n if (this.state.trafficLayer !== null) {\n if (this.props.onLoad) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.props.onLoad(this.state.trafficLayer);\n }\n }\n };\n this.registeredEvents = [];\n }\n componentDidMount() {\n const trafficLayer = new google.maps.TrafficLayer(Object.assign(Object.assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$h,\n eventMap: eventMap$h,\n prevProps: {},\n nextProps: this.props,\n instance: trafficLayer,\n });\n this.setState(function setTrafficLayer() {\n return {\n trafficLayer,\n };\n }, this.setTrafficLayerCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.trafficLayer !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$h,\n eventMap: eventMap$h,\n prevProps,\n nextProps: this.props,\n instance: this.state.trafficLayer,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.trafficLayer !== null) {\n if (this.props.onUnmount) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.props.onUnmount(this.state.trafficLayer);\n }\n unregisterEvents(this.registeredEvents);\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.state.trafficLayer.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\nTrafficLayer.contextType = MapContext;\n\nclass BicyclingLayer extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.state = {\n bicyclingLayer: null,\n };\n this.setBicyclingLayerCallback = () => {\n if (this.state.bicyclingLayer !== null) {\n // TODO: how is this possibly null if we're doing a null check\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.state.bicyclingLayer.setMap(this.context);\n if (this.props.onLoad) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.props.onLoad(this.state.bicyclingLayer);\n }\n }\n };\n }\n componentDidMount() {\n const bicyclingLayer = new google.maps.BicyclingLayer();\n this.setState(function setBicyclingLayer() {\n return {\n bicyclingLayer,\n };\n }, this.setBicyclingLayerCallback);\n }\n componentWillUnmount() {\n if (this.state.bicyclingLayer !== null) {\n if (this.props.onUnmount) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.props.onUnmount(this.state.bicyclingLayer);\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.state.bicyclingLayer.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\nBicyclingLayer.contextType = MapContext;\n\nclass TransitLayer extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.state = {\n transitLayer: null,\n };\n this.setTransitLayerCallback = () => {\n if (this.state.transitLayer !== null) {\n // TODO: how is this possibly null if we're doing a null check\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.state.transitLayer.setMap(this.context);\n if (this.props.onLoad) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.props.onLoad(this.state.transitLayer);\n }\n }\n };\n }\n componentDidMount() {\n const transitLayer = new google.maps.TransitLayer();\n this.setState(function setTransitLayer() {\n return {\n transitLayer,\n };\n }, this.setTransitLayerCallback);\n }\n componentWillUnmount() {\n if (this.state.transitLayer !== null) {\n if (this.props.onUnmount) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.props.onUnmount(this.state.transitLayer);\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.state.transitLayer.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\nTransitLayer.contextType = MapContext;\n\n/* globals google */\nconst eventMap$g = {\n onCircleComplete: 'circlecomplete',\n onMarkerComplete: 'markercomplete',\n onOverlayComplete: 'overlaycomplete',\n onPolygonComplete: 'polygoncomplete',\n onPolylineComplete: 'polylinecomplete',\n onRectangleComplete: 'rectanglecomplete',\n};\nconst updaterMap$g = {\n drawingMode(instance, drawingMode) {\n instance.setDrawingMode(drawingMode);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n};\nclass DrawingManager extends React.PureComponent {\n constructor(props) {\n super(props);\n this.registeredEvents = [];\n this.state = {\n drawingManager: null,\n };\n this.setDrawingManagerCallback = () => {\n if (this.state.drawingManager !== null && this.props.onLoad) {\n this.props.onLoad(this.state.drawingManager);\n }\n };\n invariant_1(!!google.maps.drawing, `Did you include prop libraries={['drawing']} in the URL? %s`, google.maps.drawing);\n }\n componentDidMount() {\n const drawingManager = new google.maps.drawing.DrawingManager(Object.assign(Object.assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$g,\n eventMap: eventMap$g,\n prevProps: {},\n nextProps: this.props,\n instance: drawingManager,\n });\n this.setState(function setDrawingManager() {\n return {\n drawingManager,\n };\n }, this.setDrawingManagerCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.drawingManager !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$g,\n eventMap: eventMap$g,\n prevProps,\n nextProps: this.props,\n instance: this.state.drawingManager,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.drawingManager !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.drawingManager);\n }\n unregisterEvents(this.registeredEvents);\n this.state.drawingManager.setMap(null);\n }\n }\n render() {\n return React.createElement(React.Fragment, null);\n }\n}\nDrawingManager.contextType = MapContext;\n\nconst eventMap$f = {\n onAnimationChanged: 'animation_changed',\n onClick: 'click',\n onClickableChanged: 'clickable_changed',\n onCursorChanged: 'cursor_changed',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDraggableChanged: 'draggable_changed',\n onDragStart: 'dragstart',\n onFlatChanged: 'flat_changed',\n onIconChanged: 'icon_changed',\n onMouseDown: 'mousedown',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onPositionChanged: 'position_changed',\n onRightClick: 'rightclick',\n onShapeChanged: 'shape_changed',\n onTitleChanged: 'title_changed',\n onVisibleChanged: 'visible_changed',\n onZindexChanged: 'zindex_changed',\n};\nconst updaterMap$f = {\n animation(instance, animation) {\n instance.setAnimation(animation);\n },\n clickable(instance, clickable) {\n instance.setClickable(clickable);\n },\n cursor(instance, cursor) {\n instance.setCursor(cursor);\n },\n draggable(instance, draggable) {\n instance.setDraggable(draggable);\n },\n icon(instance, icon) {\n instance.setIcon(icon);\n },\n label(instance, label) {\n instance.setLabel(label);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n opacity(instance, opacity) {\n instance.setOpacity(opacity);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n position(instance, position) {\n instance.setPosition(position);\n },\n shape(instance, shape) {\n instance.setShape(shape);\n },\n title(instance, title) {\n instance.setTitle(title);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n },\n zIndex(instance, zIndex) {\n instance.setZIndex(zIndex);\n },\n};\nclass Marker extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n }\n componentDidMount() {\n const markerOptions = Object.assign(Object.assign(Object.assign({}, (this.props.options || {})), (this.props.clusterer ? {} : { map: this.context })), { position: this.props.position });\n // Unfortunately we can't just do this in the contstructor, because the\n // `MapContext` might not be filled in yet.\n this.marker = new google.maps.Marker(markerOptions);\n if (this.props.clusterer) {\n this.props.clusterer.addMarker(this.marker, !!this.props.noClustererRedraw);\n }\n else {\n this.marker.setMap(this.context);\n }\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$f,\n eventMap: eventMap$f,\n prevProps: {},\n nextProps: this.props,\n instance: this.marker,\n });\n if (this.props.onLoad) {\n this.props.onLoad(this.marker);\n }\n }\n componentDidUpdate(prevProps) {\n if (this.marker) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$f,\n eventMap: eventMap$f,\n prevProps,\n nextProps: this.props,\n instance: this.marker,\n });\n }\n }\n componentWillUnmount() {\n if (this.marker) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.marker);\n }\n unregisterEvents(this.registeredEvents);\n if (this.props.clusterer) {\n this.props.clusterer.removeMarker(this.marker, !!this.props.noClustererRedraw);\n }\n else {\n this.marker && this.marker.setMap(null);\n }\n }\n }\n render() {\n let children = null;\n if (this.props.children) {\n children = React.Children.map(this.props.children, child => {\n if (!React.isValidElement(child)) {\n return child;\n }\n let elementChild = child;\n return React.cloneElement(elementChild, { anchor: this.marker });\n });\n }\n return children || null;\n }\n}\nMarker.contextType = MapContext;\n\nvar ClusterIcon = /** @class */ (function () {\n function ClusterIcon(cluster, styles) {\n cluster.getClusterer().extend(ClusterIcon, google.maps.OverlayView);\n this.cluster = cluster;\n this.clusterClassName = this.cluster.getClusterer().getClusterClass();\n this.className = this.clusterClassName;\n this.styles = styles;\n this.center = undefined;\n this.div = null;\n this.sums = null;\n this.visible = false;\n this.boundsChangedListener = null;\n this.url = '';\n this.height = 0;\n this.width = 0;\n this.anchorText = [0, 0];\n this.anchorIcon = [0, 0];\n this.textColor = 'black';\n this.textSize = 11;\n this.textDecoration = 'none';\n this.fontWeight = 'bold';\n this.fontStyle = 'normal';\n this.fontFamily = 'Arial,sans-serif';\n this.backgroundPosition = '0 0';\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.setMap(cluster.getMap()); // Note: this causes onAdd to be called\n }\n ClusterIcon.prototype.onAdd = function () {\n var _this = this;\n var cMouseDownInCluster;\n var cDraggingMapByCluster;\n this.div = document.createElement('div');\n this.div.className = this.className;\n if (this.visible) {\n this.show();\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getPanes().overlayMouseTarget.appendChild(this.div);\n // Fix for Issue 157\n this.boundsChangedListener = google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(), 'boundschanged', function boundsChanged() {\n cDraggingMapByCluster = cMouseDownInCluster;\n });\n google.maps.event.addDomListener(this.div, 'mousedown', function onMouseDown() {\n cMouseDownInCluster = true;\n cDraggingMapByCluster = false;\n });\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n google.maps.event.addDomListener(this.div, 'click', \n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n function (event) {\n cMouseDownInCluster = false;\n if (!cDraggingMapByCluster) {\n var markerClusterer_1 = _this.cluster.getClusterer();\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(markerClusterer_1, 'click', _this.cluster);\n google.maps.event.trigger(markerClusterer_1, 'clusterclick', _this.cluster); // deprecated name\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (markerClusterer_1.getZoomOnClick()) {\n // Zoom into the cluster.\n var maxZoom_1 = markerClusterer_1.getMaxZoom();\n var bounds_1 = _this.cluster.getBounds();\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n markerClusterer_1.getMap().fitBounds(bounds_1);\n // There is a fix for Issue 170 here:\n setTimeout(function timeout() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n markerClusterer_1.getMap().fitBounds(bounds_1);\n // Don't zoom beyond the max zoom level\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n if (maxZoom_1 !== null && markerClusterer_1.getMap().getZoom() > maxZoom_1) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n markerClusterer_1.getMap().setZoom(maxZoom_1 + 1);\n }\n }, 100);\n }\n // Prevent event propagation to the map:\n event.cancelBubble = true;\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n }\n });\n google.maps.event.addDomListener(this.div, 'mouseover', \n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n function () {\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(_this.cluster.getClusterer(), 'mouseover', _this.cluster);\n });\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n google.maps.event.addDomListener(this.div, 'mouseout', \n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n function () {\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(_this.cluster.getClusterer(), 'mouseout', _this.cluster);\n });\n };\n ClusterIcon.prototype.onRemove = function () {\n if (this.div && this.div.parentNode) {\n this.hide();\n if (this.boundsChangedListener !== null) {\n google.maps.event.removeListener(this.boundsChangedListener);\n }\n google.maps.event.clearInstanceListeners(this.div);\n this.div.parentNode.removeChild(this.div);\n this.div = null;\n }\n };\n ClusterIcon.prototype.draw = function () {\n if (this.visible && this.div !== null && this.center) {\n var _a = this.getPosFromLatLng(this.center), x = _a.x, y = _a.y;\n this.div.style.top = y + 'px';\n this.div.style.left = x + 'px';\n }\n };\n ClusterIcon.prototype.hide = function () {\n if (this.div) {\n this.div.style.display = 'none';\n }\n this.visible = false;\n };\n ClusterIcon.prototype.show = function () {\n if (this.div && this.center) {\n var img = '', divTitle = '';\n // NOTE: values must be specified in px units\n var bp = this.backgroundPosition.split(' ');\n var spriteH = parseInt(bp[0].replace(/^\\s+|\\s+$/g, ''), 10);\n var spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, ''), 10);\n var pos = this.getPosFromLatLng(this.center);\n if (this.sums === null || typeof this.sums.title === 'undefined' || this.sums.title === '') {\n divTitle = this.cluster.getClusterer().getTitle();\n }\n else {\n divTitle = this.sums.title;\n }\n this.div.style.cssText = this.createCss(pos);\n img =\n \"\" +\n                    divTitle +\n                    \"\";\n this.div.innerHTML =\n img +\n \"
\" +\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.sums.text +\n '
';\n this.div.title = divTitle;\n this.div.style.display = '';\n }\n this.visible = true;\n };\n ClusterIcon.prototype.useStyle = function (sums) {\n this.sums = sums;\n var styles = this.cluster.getClusterer().getStyles();\n var style = styles[Math.min(styles.length - 1, Math.max(0, sums.index - 1))];\n this.url = style.url;\n this.height = style.height;\n this.width = style.width;\n if (style.className)\n this.className = this.clusterClassName + \" \" + style.className;\n this.anchorText = style.anchorText || [0, 0];\n this.anchorIcon = style.anchorIcon || [this.height / 2, this.width / 2];\n this.textColor = style.textColor || 'black';\n this.textSize = style.textSize || 11;\n this.textDecoration = style.textDecoration || 'none';\n this.fontWeight = style.fontWeight || 'bold';\n this.fontStyle = style.fontStyle || 'normal';\n this.fontFamily = style.fontFamily || 'Arial,sans-serif';\n this.backgroundPosition = style.backgroundPosition || '0 0';\n };\n ClusterIcon.prototype.setCenter = function (center) {\n this.center = center;\n };\n ClusterIcon.prototype.createCss = function (pos) {\n var style = [];\n style.push('cursor: pointer;');\n style.push('position: absolute; top: ' + pos.y + 'px; left: ' + pos.x + 'px;');\n style.push('width: ' + this.width + 'px; height: ' + this.height + 'px;');\n return style.join('');\n };\n ClusterIcon.prototype.getPosFromLatLng = function (latlng) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n pos.x -= this.anchorIcon[1];\n pos.y -= this.anchorIcon[0];\n // pos.x = pos.x\n // pos.y = pos.y\n return pos;\n };\n return ClusterIcon;\n}());\n\nvar Cluster$1 = /** @class */ (function () {\n function Cluster(markerClusterer) {\n this.markerClusterer = markerClusterer;\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.map = this.markerClusterer.getMap();\n this.gridSize = this.markerClusterer.getGridSize();\n this.minClusterSize = this.markerClusterer.getMinimumClusterSize();\n this.averageCenter = this.markerClusterer.getAverageCenter();\n this.markers = [];\n this.center = undefined;\n this.bounds = null;\n this.clusterIcon = new ClusterIcon(this, this.markerClusterer.getStyles());\n }\n Cluster.prototype.getSize = function () {\n return this.markers.length;\n };\n Cluster.prototype.getMarkers = function () {\n return this.markers;\n };\n Cluster.prototype.getCenter = function () {\n return this.center;\n };\n Cluster.prototype.getMap = function () {\n return this.map;\n };\n Cluster.prototype.getClusterer = function () {\n return this.markerClusterer;\n };\n Cluster.prototype.getBounds = function () {\n var bounds = new google.maps.LatLngBounds(this.center, this.center);\n var markers = this.getMarkers();\n for (var i = 0; i < markers.length; i++) {\n var position = markers[i].getPosition();\n if (position) {\n bounds.extend(position);\n }\n }\n return bounds;\n };\n Cluster.prototype.remove = function () {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.clusterIcon.setMap(null);\n this.markers = [];\n // @ts-ignore\n delete this.markers;\n };\n Cluster.prototype.addMarker = function (marker) {\n if (this.isMarkerAlreadyAdded(marker)) {\n return false;\n }\n if (!this.center) {\n var position = marker.getPosition();\n if (position) {\n this.center = position;\n this.calculateBounds();\n }\n }\n else {\n if (this.averageCenter) {\n var position = marker.getPosition();\n if (position) {\n var length_1 = this.markers.length + 1;\n this.center = new google.maps.LatLng((this.center.lat() * (length_1 - 1) + position.lat()) / length_1, (this.center.lng() * (length_1 - 1) + position.lng()) / length_1);\n this.calculateBounds();\n }\n }\n }\n marker.isAdded = true;\n this.markers.push(marker);\n var mCount = this.markers.length;\n var maxZoom = this.markerClusterer.getMaxZoom();\n var zoom = this.map.getZoom();\n if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map) {\n marker.setMap(this.map);\n }\n }\n else if (mCount < this.minClusterSize) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map) {\n marker.setMap(this.map);\n }\n }\n else if (mCount === this.minClusterSize) {\n // Hide the markers that were showing.\n for (var i = 0; i < mCount; i++) {\n this.markers[i].setMap(null);\n }\n }\n else {\n marker.setMap(null);\n }\n return true;\n };\n Cluster.prototype.isMarkerInClusterBounds = function (marker) {\n if (this.bounds !== null) {\n var position = marker.getPosition();\n if (position) {\n return this.bounds.contains(position);\n }\n }\n return false;\n };\n Cluster.prototype.calculateBounds = function () {\n this.bounds = this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center, this.center));\n };\n Cluster.prototype.updateIcon = function () {\n var mCount = this.markers.length;\n var maxZoom = this.markerClusterer.getMaxZoom();\n var zoom = this.map.getZoom();\n if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {\n this.clusterIcon.hide();\n return;\n }\n if (mCount < this.minClusterSize) {\n // Min cluster size not yet reached.\n this.clusterIcon.hide();\n return;\n }\n if (this.center) {\n this.clusterIcon.setCenter(this.center);\n }\n this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers, this.markerClusterer.getStyles().length));\n this.clusterIcon.show();\n };\n Cluster.prototype.isMarkerAlreadyAdded = function (marker) {\n if (this.markers.includes) {\n return this.markers.includes(marker);\n }\n else {\n for (var i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n return true;\n }\n }\n }\n return false;\n };\n return Cluster;\n}());\n\n/* global google */\n/**\n * Supports up to 9007199254740991 (Number.MAX_SAFE_INTEGER) markers\n * which is not a problem as max array length is 4294967296 (2**32)\n */\nvar CALCULATOR = function CALCULATOR(markers, numStyles) {\n var count = markers.length;\n var numberOfDigits = count.toString().length;\n var index = Math.min(numberOfDigits, numStyles);\n return {\n text: count.toString(),\n index: index,\n title: '',\n };\n};\nvar BATCH_SIZE = 2000;\nvar BATCH_SIZE_IE = 500;\nvar IMAGE_PATH = 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m';\nvar IMAGE_EXTENSION = 'png';\nvar IMAGE_SIZES = [53, 56, 66, 78, 90];\nvar CLUSTERER_CLASS = 'cluster';\nvar Clusterer = /** @class */ (function () {\n function Clusterer(map, optMarkers, optOptions) {\n if (optMarkers === void 0) { optMarkers = []; }\n if (optOptions === void 0) { optOptions = {}; }\n this.extend(Clusterer, google.maps.OverlayView);\n this.markers = [];\n this.clusters = [];\n this.listeners = [];\n this.activeMap = null;\n this.ready = false;\n this.gridSize = optOptions.gridSize || 60;\n this.minClusterSize = optOptions.minimumClusterSize || 2;\n this.maxZoom = optOptions.maxZoom || null;\n this.styles = optOptions.styles || [];\n this.title = optOptions.title || '';\n this.zoomOnClick = true;\n if (optOptions.zoomOnClick !== undefined) {\n this.zoomOnClick = optOptions.zoomOnClick;\n }\n this.averageCenter = false;\n if (optOptions.averageCenter !== undefined) {\n this.averageCenter = optOptions.averageCenter;\n }\n this.ignoreHidden = false;\n if (optOptions.ignoreHidden !== undefined) {\n this.ignoreHidden = optOptions.ignoreHidden;\n }\n this.enableRetinaIcons = false;\n if (optOptions.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons = optOptions.enableRetinaIcons;\n }\n this.imagePath = optOptions.imagePath || IMAGE_PATH;\n this.imageExtension = optOptions.imageExtension || IMAGE_EXTENSION;\n this.imageSizes = optOptions.imageSizes || IMAGE_SIZES;\n this.calculator = optOptions.calculator || CALCULATOR;\n this.batchSize = optOptions.batchSize || BATCH_SIZE;\n this.batchSizeIE = optOptions.batchSizeIE || BATCH_SIZE_IE;\n this.clusterClass = optOptions.clusterClass || CLUSTERER_CLASS;\n if (navigator.userAgent.toLowerCase().indexOf('msie') !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize = this.batchSizeIE;\n }\n this.timerRefStatic = null;\n this.setupStyles();\n this.addMarkers(optMarkers, true);\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.setMap(map); // Note: this causes onAdd to be called\n }\n Clusterer.prototype.onAdd = function () {\n var _this = this;\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.activeMap = this.getMap();\n this.ready = true;\n this.repaint();\n // Add the map event listeners\n this.listeners = [\n google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(), 'zoom_changed', \n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n function () {\n _this.resetViewport(false);\n // Workaround for this Google bug: when map is at level 0 and \"-\" of\n // zoom slider is clicked, a \"zoom_changed\" event is fired even though\n // the map doesn't zoom out any further. In this situation, no \"idle\"\n // event is triggered so the cluster markers that have been removed\n // do not get redrawn. Same goes for a zoom in at maxZoom.\n if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n _this.getMap().getZoom() === (_this.get('minZoom') || 0) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n _this.getMap().getZoom() === _this.get('maxZoom')) {\n google.maps.event.trigger(_this, 'idle');\n }\n }),\n google.maps.event.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap(), 'idle', \n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n function () {\n _this.redraw();\n }),\n ];\n };\n // eslint-disable-next-line @getify/proper-arrows/this\n Clusterer.prototype.onRemove = function () {\n // Put all the managed markers back on the map:\n for (var i = 0; i < this.markers.length; i++) {\n if (this.markers[i].getMap() !== this.activeMap) {\n this.markers[i].setMap(this.activeMap);\n }\n }\n // Remove all clusters:\n for (var i = 0; i < this.clusters.length; i++) {\n this.clusters[i].remove();\n }\n this.clusters = [];\n // Remove map event listeners:\n for (var i = 0; i < this.listeners.length; i++) {\n google.maps.event.removeListener(this.listeners[i]);\n }\n this.listeners = [];\n this.activeMap = null;\n this.ready = false;\n };\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n Clusterer.prototype.draw = function () { };\n Clusterer.prototype.setupStyles = function () {\n if (this.styles.length > 0) {\n return;\n }\n for (var i = 0; i < this.imageSizes.length; i++) {\n this.styles.push({\n url: this.imagePath + (i + 1) + '.' + this.imageExtension,\n height: this.imageSizes[i],\n width: this.imageSizes[i],\n });\n }\n };\n Clusterer.prototype.fitMapToMarkers = function () {\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (var i = 0; i < markers.length; i++) {\n var position = markers[i].getPosition();\n if (position) {\n bounds.extend(position);\n }\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap().fitBounds(bounds);\n };\n Clusterer.prototype.getGridSize = function () {\n return this.gridSize;\n };\n Clusterer.prototype.setGridSize = function (gridSize) {\n this.gridSize = gridSize;\n };\n Clusterer.prototype.getMinimumClusterSize = function () {\n return this.minClusterSize;\n };\n Clusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) {\n this.minClusterSize = minimumClusterSize;\n };\n Clusterer.prototype.getMaxZoom = function () {\n return this.maxZoom;\n };\n Clusterer.prototype.setMaxZoom = function (maxZoom) {\n this.maxZoom = maxZoom;\n };\n Clusterer.prototype.getStyles = function () {\n return this.styles;\n };\n Clusterer.prototype.setStyles = function (styles) {\n this.styles = styles;\n };\n Clusterer.prototype.getTitle = function () {\n return this.title;\n };\n Clusterer.prototype.setTitle = function (title) {\n this.title = title;\n };\n Clusterer.prototype.getZoomOnClick = function () {\n return this.zoomOnClick;\n };\n Clusterer.prototype.setZoomOnClick = function (zoomOnClick) {\n this.zoomOnClick = zoomOnClick;\n };\n Clusterer.prototype.getAverageCenter = function () {\n return this.averageCenter;\n };\n Clusterer.prototype.setAverageCenter = function (averageCenter) {\n this.averageCenter = averageCenter;\n };\n Clusterer.prototype.getIgnoreHidden = function () {\n return this.ignoreHidden;\n };\n Clusterer.prototype.setIgnoreHidden = function (ignoreHidden) {\n this.ignoreHidden = ignoreHidden;\n };\n Clusterer.prototype.getEnableRetinaIcons = function () {\n return this.enableRetinaIcons;\n };\n Clusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) {\n this.enableRetinaIcons = enableRetinaIcons;\n };\n Clusterer.prototype.getImageExtension = function () {\n return this.imageExtension;\n };\n Clusterer.prototype.setImageExtension = function (imageExtension) {\n this.imageExtension = imageExtension;\n };\n Clusterer.prototype.getImagePath = function () {\n return this.imagePath;\n };\n Clusterer.prototype.setImagePath = function (imagePath) {\n this.imagePath = imagePath;\n };\n Clusterer.prototype.getImageSizes = function () {\n return this.imageSizes;\n };\n Clusterer.prototype.setImageSizes = function (imageSizes) {\n this.imageSizes = imageSizes;\n };\n Clusterer.prototype.getCalculator = function () {\n return this.calculator;\n };\n Clusterer.prototype.setCalculator = function (calculator) {\n this.calculator = calculator;\n };\n Clusterer.prototype.getBatchSizeIE = function () {\n return this.batchSizeIE;\n };\n Clusterer.prototype.setBatchSizeIE = function (batchSizeIE) {\n this.batchSizeIE = batchSizeIE;\n };\n Clusterer.prototype.getClusterClass = function () {\n return this.clusterClass;\n };\n Clusterer.prototype.setClusterClass = function (clusterClass) {\n this.clusterClass = clusterClass;\n };\n Clusterer.prototype.getMarkers = function () {\n return this.markers;\n };\n Clusterer.prototype.getTotalMarkers = function () {\n return this.markers.length;\n };\n Clusterer.prototype.getClusters = function () {\n return this.clusters;\n };\n Clusterer.prototype.getTotalClusters = function () {\n return this.clusters.length;\n };\n Clusterer.prototype.addMarker = function (marker, optNoDraw) {\n this.pushMarkerTo(marker);\n if (!optNoDraw) {\n this.redraw();\n }\n };\n Clusterer.prototype.addMarkers = function (markers, optNoDraw) {\n for (var key in markers) {\n if (markers.hasOwnProperty(key)) {\n this.pushMarkerTo(markers[key]);\n }\n }\n if (!optNoDraw) {\n this.redraw();\n }\n };\n Clusterer.prototype.pushMarkerTo = function (marker) {\n var _this = this;\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n // eslint-disable-next-line @getify/proper-arrows/name, @getify/proper-arrows/this\n google.maps.event.addListener(marker, 'dragend', function () {\n if (_this.ready) {\n marker.isAdded = false;\n _this.repaint();\n }\n });\n }\n marker.isAdded = false;\n this.markers.push(marker);\n };\n Clusterer.prototype.removeMarker_ = function (marker) {\n var index = -1;\n if (this.markers.indexOf) {\n index = this.markers.indexOf(marker);\n }\n else {\n for (var i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n index = i;\n break;\n }\n }\n }\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n marker.setMap(null);\n this.markers.splice(index, 1); // Remove the marker from the list of managed markers\n return true;\n };\n Clusterer.prototype.removeMarker = function (marker, optNoDraw) {\n var removed = this.removeMarker_(marker);\n if (!optNoDraw && removed) {\n this.repaint();\n }\n return removed;\n };\n Clusterer.prototype.removeMarkers = function (markers, optNoDraw) {\n var removed = false;\n for (var i = 0; i < markers.length; i++) {\n removed = removed || this.removeMarker_(markers[i]);\n }\n if (!optNoDraw && removed) {\n this.repaint();\n }\n return removed;\n };\n Clusterer.prototype.clearMarkers = function () {\n this.resetViewport(true);\n this.markers = [];\n };\n Clusterer.prototype.repaint = function () {\n var oldClusters = this.clusters.slice();\n this.clusters = [];\n this.resetViewport(false);\n this.redraw();\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function timeout() {\n for (var i = 0; i < oldClusters.length; i++) {\n oldClusters[i].remove();\n }\n }, 0);\n };\n Clusterer.prototype.getExtendedBounds = function (bounds) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var projection = this.getProjection();\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(\n // Turn the bounds into latlng.\n new google.maps.LatLng(bounds.getNorthEast().lat(), bounds.getNorthEast().lng()));\n trPix.x += this.gridSize;\n trPix.y -= this.gridSize;\n var blPix = projection.fromLatLngToDivPixel(\n // Turn the bounds into latlng.\n new google.maps.LatLng(bounds.getSouthWest().lat(), bounds.getSouthWest().lng()));\n blPix.x -= this.gridSize;\n blPix.y += this.gridSize;\n // Extend the bounds to contain the new bounds.\n bounds.extend(\n // Convert the pixel points back to LatLng nw\n projection.fromDivPixelToLatLng(trPix));\n bounds.extend(\n // Convert the pixel points back to LatLng sw\n projection.fromDivPixelToLatLng(blPix));\n return bounds;\n };\n Clusterer.prototype.redraw = function () {\n // Redraws all the clusters.\n this.createClusters(0);\n };\n Clusterer.prototype.resetViewport = function (optHide) {\n // Remove all the clusters\n for (var i = 0; i < this.clusters.length; i++) {\n this.clusters[i].remove();\n }\n this.clusters = [];\n // Reset the markers to not be added and to be removed from the map.\n for (var i = 0; i < this.markers.length; i++) {\n var marker = this.markers[i];\n marker.isAdded = false;\n if (optHide) {\n marker.setMap(null);\n }\n }\n };\n Clusterer.prototype.distanceBetweenPoints = function (p1, p2) {\n var R = 6371; // Radius of the Earth in km\n var dLat = ((p2.lat() - p1.lat()) * Math.PI) / 180;\n var dLon = ((p2.lng() - p1.lng()) * Math.PI) / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos((p1.lat() * Math.PI) / 180) *\n Math.cos((p2.lat() * Math.PI) / 180) *\n Math.sin(dLon / 2) *\n Math.sin(dLon / 2);\n return R * (2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)));\n };\n Clusterer.prototype.isMarkerInBounds = function (marker, bounds) {\n var position = marker.getPosition();\n if (position) {\n return bounds.contains(position);\n }\n return false;\n };\n Clusterer.prototype.addToClosestCluster = function (marker) {\n var cluster;\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n for (var i = 0; i < this.clusters.length; i++) {\n cluster = this.clusters[i];\n var center = cluster.getCenter();\n var position = marker.getPosition();\n if (center && position) {\n var d = this.distanceBetweenPoints(center, position);\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n }\n else {\n cluster = new Cluster$1(this);\n cluster.addMarker(marker);\n this.clusters.push(cluster);\n }\n };\n Clusterer.prototype.createClusters = function (iFirst) {\n var _this = this;\n if (!this.ready) {\n return;\n }\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the Clusterer begins\n * clustering markers.\n * @name Clusterer#clusteringbegin\n * @param {Clusterer} mc The Clusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringbegin', this);\n if (this.timerRefStatic !== null) {\n window.clearTimeout(this.timerRefStatic);\n // @ts-ignore\n delete this.timerRefStatic;\n }\n }\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n var mapBounds = \n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap().getZoom() > 3\n ? new google.maps.LatLngBounds(\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap()\n .getBounds()\n .getSouthWest(), \n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.getMap()\n .getBounds()\n .getNorthEast())\n : new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n var bounds = this.getExtendedBounds(mapBounds);\n var iLast = Math.min(iFirst + this.batchSize, this.markers.length);\n for (var i = iFirst; i < iLast; i++) {\n var marker = this.markers[i];\n if (!marker.isAdded && this.isMarkerInBounds(marker, bounds)) {\n if (!this.ignoreHidden || (this.ignoreHidden && marker.getVisible())) {\n this.addToClosestCluster(marker);\n }\n }\n }\n if (iLast < this.markers.length) {\n this.timerRefStatic = window.setTimeout(\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n function () {\n _this.createClusters(iLast);\n }, 0);\n }\n else {\n this.timerRefStatic = null;\n /**\n * This event is fired when the Clusterer stops\n * clustering markers.\n * @name Clusterer#clusteringend\n * @param {Clusterer} mc The Clusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringend', this);\n for (var i = 0; i < this.clusters.length; i++) {\n this.clusters[i].updateIcon();\n }\n }\n };\n Clusterer.prototype.extend = function (obj1, obj2) {\n return function applyExtend(object) {\n // eslint-disable-next-line guard-for-in\n for (var property in object.prototype) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.prototype[property] = object.prototype[property];\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n return this;\n }.apply(obj1, [obj2]);\n };\n return Clusterer;\n}());\n\n/* eslint-disable filenames/match-exported */\nconst eventMap$e = {\n onClick: 'click',\n onClusteringBegin: 'clusteringbegin',\n onClusteringEnd: 'clusteringend',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n};\nconst updaterMap$e = {\n averageCenter(instance, averageCenter) {\n instance.setAverageCenter(averageCenter);\n },\n batchSizeIE(instance, batchSizeIE) {\n instance.setBatchSizeIE(batchSizeIE);\n },\n calculator(instance, calculator) {\n instance.setCalculator(calculator);\n },\n clusterClass(instance, clusterClass) {\n instance.setClusterClass(clusterClass);\n },\n enableRetinaIcons(instance, enableRetinaIcons) {\n instance.setEnableRetinaIcons(enableRetinaIcons);\n },\n gridSize(instance, gridSize) {\n instance.setGridSize(gridSize);\n },\n ignoreHidden(instance, ignoreHidden) {\n instance.setIgnoreHidden(ignoreHidden);\n },\n imageExtension(instance, imageExtension) {\n instance.setImageExtension(imageExtension);\n },\n imagePath(instance, imagePath) {\n instance.setImagePath(imagePath);\n },\n imageSizes(instance, imageSizes) {\n instance.setImageSizes(imageSizes);\n },\n maxZoom(instance, maxZoom) {\n instance.setMaxZoom(maxZoom);\n },\n minimumClusterSize(instance, minimumClusterSize) {\n instance.setMinimumClusterSize(minimumClusterSize);\n },\n styles(instance, styles) {\n instance.setStyles(styles);\n },\n title(instance, title) {\n instance.setTitle(title);\n },\n zoomOnClick(instance, zoomOnClick) {\n instance.setZoomOnClick(zoomOnClick);\n },\n};\nclass ClustererComponent extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n markerClusterer: null,\n };\n this.setClustererCallback = () => {\n if (this.state.markerClusterer !== null && this.props.onLoad) {\n this.props.onLoad(this.state.markerClusterer);\n }\n };\n }\n componentDidMount() {\n if (this.context) {\n const markerClusterer = new Clusterer(this.context, [], this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$e,\n eventMap: eventMap$e,\n prevProps: {},\n nextProps: this.props,\n instance: markerClusterer,\n });\n this.setState(function setClusterer() {\n return {\n markerClusterer,\n };\n }, this.setClustererCallback);\n }\n }\n componentDidUpdate(prevProps) {\n if (this.state.markerClusterer) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$e,\n eventMap: eventMap$e,\n prevProps,\n nextProps: this.props,\n instance: this.state.markerClusterer,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.markerClusterer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.markerClusterer);\n }\n unregisterEvents(this.registeredEvents);\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.state.markerClusterer.setMap(null);\n }\n }\n render() {\n return this.state.markerClusterer !== null\n ? this.props.children(this.state.markerClusterer)\n : null;\n }\n}\nClustererComponent.contextType = MapContext;\n\nvar InfoBox = /** @class */ (function () {\n function InfoBox(options) {\n if (options === void 0) { options = {}; }\n this.extend(InfoBox, google.maps.OverlayView);\n // Standard options (in common with google.maps.InfoWindow):\n this.content = options.content || '';\n this.disableAutoPan = options.disableAutoPan || false;\n this.maxWidth = options.maxWidth || 0;\n this.pixelOffset = options.pixelOffset || new google.maps.Size(0, 0);\n this.position = options.position || new google.maps.LatLng(0, 0);\n this.zIndex = options.zIndex || null;\n // Additional options (unique to InfoBox):\n this.boxClass = options.boxClass || 'infoBox';\n this.boxStyle = options.boxStyle || {};\n this.closeBoxMargin = options.closeBoxMargin || '2px';\n this.closeBoxURL = options.closeBoxURL || 'http://www.google.com/intl/en_us/mapfiles/close.gif';\n if (options.closeBoxURL === '') {\n this.closeBoxURL = '';\n }\n this.infoBoxClearance = options.infoBoxClearance || new google.maps.Size(1, 1);\n if (typeof options.visible === 'undefined') {\n if (typeof options.isHidden === 'undefined') {\n options.visible = true;\n }\n else {\n options.visible = !options.isHidden;\n }\n }\n this.isHidden = !options.visible;\n this.alignBottom = options.alignBottom || false;\n this.pane = options.pane || 'floatPane';\n this.enableEventPropagation = options.enableEventPropagation || false;\n this.div = null;\n this.closeListener = null;\n this.moveListener = null;\n this.mapListener = null;\n this.contextListener = null;\n this.eventListeners = null;\n this.fixedWidthSet = null;\n }\n InfoBox.prototype.createInfoBoxDiv = function () {\n var _this = this;\n // This handler prevents an event in the InfoBox from being passed on to the map.\n function cancelHandler(event) {\n event.cancelBubble = true;\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n }\n // This handler ignores the current event in the InfoBox and conditionally prevents\n // the event from being passed on to the map. It is used for the contextmenu event.\n // eslint-disable-next-line @getify/proper-arrows/this\n var ignoreHandler = function (event) {\n event.returnValue = false;\n if (event.preventDefault) {\n event.preventDefault();\n }\n if (!_this.enableEventPropagation) {\n cancelHandler(event);\n }\n };\n if (!this.div) {\n this.div = document.createElement('div');\n this.setBoxStyle();\n if (typeof this.content === 'string') {\n this.div.innerHTML = this.getCloseBoxImg() + this.content;\n }\n else {\n this.div.innerHTML = this.getCloseBoxImg();\n this.div.appendChild(this.content);\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var panes = this.getPanes();\n panes[this.pane].appendChild(this.div); // Add the InfoBox div to the DOM\n this.addClickHandler();\n if (this.div.style.width) {\n this.fixedWidthSet = true;\n }\n else {\n if (this.maxWidth !== 0 && this.div.offsetWidth > this.maxWidth) {\n this.div.style.width = this.maxWidth + 'px';\n this.fixedWidthSet = true;\n }\n else {\n // The following code is needed to overcome problems with MSIE\n var bw = this.getBoxWidths();\n this.div.style.width = this.div.offsetWidth - bw.left - bw.right + 'px';\n this.fixedWidthSet = false;\n }\n }\n this.panBox(this.disableAutoPan);\n if (!this.enableEventPropagation) {\n this.eventListeners = [];\n // Cancel event propagation.\n // Note: mousemove not included (to resolve Issue 152)\n var events = [\n 'mousedown',\n 'mouseover',\n 'mouseout',\n 'mouseup',\n 'click',\n 'dblclick',\n 'touchstart',\n 'touchend',\n 'touchmove',\n ];\n for (var i = 0; i < events.length; i++) {\n this.eventListeners.push(google.maps.event.addDomListener(this.div, events[i], cancelHandler));\n }\n // Workaround for Google bug that causes the cursor to change to a pointer\n // when the mouse moves over a marker underneath InfoBox.\n this.eventListeners.push(google.maps.event.addDomListener(this.div, 'mouseover', \n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n function () {\n if (_this.div) {\n _this.div.style.cursor = 'default';\n }\n }));\n }\n this.contextListener = google.maps.event.addDomListener(this.div, 'contextmenu', ignoreHandler);\n /**\n * This event is fired when the DIV containing the InfoBox's content is attached to the DOM.\n * @name InfoBox#domready\n * @event\n */\n google.maps.event.trigger(this, 'domready');\n }\n };\n InfoBox.prototype.getCloseBoxImg = function () {\n var img = '';\n if (this.closeBoxURL !== '') {\n img = '\"\"';\n\";\n }\n return img;\n };\n InfoBox.prototype.addClickHandler = function () {\n if (this.div && this.div.firstChild && this.closeBoxURL !== '') {\n var closeBox = this.div.firstChild;\n this.closeListener = google.maps.event.addDomListener(closeBox, 'click', this.getCloseClickHandler());\n }\n else {\n this.closeListener = null;\n }\n };\n InfoBox.prototype.getCloseClickHandler = function () {\n var _this = this;\n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n return function (event) {\n // 1.0.3 fix: Always prevent propagation of a close box click to the map:\n event.cancelBubble = true;\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n /**\n * This event is fired when the InfoBox's close box is clicked.\n * @name InfoBox#closeclick\n * @event\n */\n google.maps.event.trigger(_this, 'closeclick');\n _this.close();\n };\n };\n InfoBox.prototype.panBox = function (disablePan) {\n if (this.div && !disablePan) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var map = this.getMap();\n // Only pan if attached to map, not panorama\n if (map instanceof google.maps.Map) {\n var xOffset = 0;\n var yOffset = 0;\n var bounds = map.getBounds();\n if (bounds && !bounds.contains(this.position)) {\n // Marker not in visible area of map, so set center\n // of map to the marker position first.\n map.setCenter(this.position);\n }\n var mapDiv = map.getDiv();\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var mapWidth = mapDiv.offsetWidth;\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var mapHeight = mapDiv.offsetHeight;\n var iwOffsetX = this.pixelOffset.width;\n var iwOffsetY = this.pixelOffset.height;\n var iwWidth = this.div.offsetWidth;\n var iwHeight = this.div.offsetHeight;\n var padX = this.infoBoxClearance.width;\n var padY = this.infoBoxClearance.height;\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var projection = this.getProjection();\n var pixPosition = projection.fromLatLngToContainerPixel(this.position);\n if (pixPosition !== null) {\n if (pixPosition.x < -iwOffsetX + padX) {\n xOffset = pixPosition.x + iwOffsetX - padX;\n }\n else if (pixPosition.x + iwWidth + iwOffsetX + padX > mapWidth) {\n xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;\n }\n if (this.alignBottom) {\n if (pixPosition.y < -iwOffsetY + padY + iwHeight) {\n yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;\n }\n else if (pixPosition.y + iwOffsetY + padY > mapHeight) {\n yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;\n }\n }\n else {\n if (pixPosition.y < -iwOffsetY + padY) {\n yOffset = pixPosition.y + iwOffsetY - padY;\n }\n else if (pixPosition.y + iwHeight + iwOffsetY + padY > mapHeight) {\n yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;\n }\n }\n }\n if (!(xOffset === 0 && yOffset === 0)) {\n // Move the map to the shifted center.\n map.panBy(xOffset, yOffset);\n }\n }\n }\n };\n InfoBox.prototype.setBoxStyle = function () {\n if (this.div) {\n // Apply style values from the style sheet defined in the boxClass parameter:\n this.div.className = this.boxClass;\n // Clear existing inline style values:\n this.div.style.cssText = '';\n // Apply style values defined in the boxStyle parameter:\n var boxStyle = this.boxStyle;\n for (var i in boxStyle) {\n if (boxStyle.hasOwnProperty(i)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.div.style[i] = boxStyle[i];\n }\n }\n // Fix for iOS disappearing InfoBox problem\n // See http://stackoverflow.com/questions/9229535/google-maps-markers-disappear-at-certain-zoom-level-only-on-iphone-ipad\n this.div.style.webkitTransform = 'translateZ(0)';\n // Fix up opacity style for benefit of MSIE\n if (typeof this.div.style.opacity !== 'undefined' && this.div.style.opacity !== '') {\n // See http://www.quirksmode.org/css/opacity.html\n var opacity = parseFloat(this.div.style.opacity || '');\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.div.style.msFilter =\n '\"progid:DXImageTransform.Microsoft.Alpha(Opacity=' + opacity * 100 + ')\"';\n this.div.style.filter = 'alpha(opacity=' + opacity * 100 + ')';\n }\n // Apply required styles\n this.div.style.position = 'absolute';\n this.div.style.visibility = 'hidden';\n if (this.zIndex !== null) {\n this.div.style.zIndex = this.zIndex + '';\n }\n if (!this.div.style.overflow) {\n this.div.style.overflow = 'auto';\n }\n }\n };\n InfoBox.prototype.getBoxWidths = function () {\n var bw = { top: 0, bottom: 0, left: 0, right: 0 };\n if (!this.div) {\n return bw;\n }\n if (document.defaultView && document.defaultView.getComputedStyle) {\n var ownerDocument = this.div.ownerDocument;\n var computedStyle = ownerDocument && ownerDocument.defaultView\n ? ownerDocument.defaultView.getComputedStyle(this.div, '')\n : null;\n if (computedStyle) {\n // The computed styles are always in pixel units (good!)\n bw.top = parseInt(computedStyle.borderTopWidth || '', 10) || 0;\n bw.bottom = parseInt(computedStyle.borderBottomWidth || '', 10) || 0;\n bw.left = parseInt(computedStyle.borderLeftWidth || '', 10) || 0;\n bw.right = parseInt(computedStyle.borderRightWidth || '', 10) || 0;\n }\n }\n else if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n document.documentElement.currentStyle // MSIE\n ) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var currentStyle = this.div.currentStyle;\n if (currentStyle) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // The current styles may not be in pixel units, but assume they are (bad!)\n bw.top = parseInt(currentStyle.borderTopWidth || '', 10) || 0;\n bw.bottom = parseInt(currentStyle.borderBottomWidth || '', 10) || 0;\n bw.left = parseInt(currentStyle.borderLeftWidth || '', 10) || 0;\n bw.right = parseInt(currentStyle.borderRightWidth || '', 10) || 0;\n }\n }\n return bw;\n };\n InfoBox.prototype.onRemove = function () {\n if (this.div && this.div.parentNode) {\n this.div.parentNode.removeChild(this.div);\n this.div = null;\n }\n };\n InfoBox.prototype.draw = function () {\n this.createInfoBoxDiv();\n if (this.div) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var projection = this.getProjection();\n var pixPosition = projection.fromLatLngToDivPixel(this.position);\n if (pixPosition !== null) {\n this.div.style.left = pixPosition.x + this.pixelOffset.width + 'px';\n if (this.alignBottom) {\n this.div.style.bottom = -(pixPosition.y + this.pixelOffset.height) + 'px';\n }\n else {\n this.div.style.top = pixPosition.y + this.pixelOffset.height + 'px';\n }\n }\n if (this.isHidden) {\n this.div.style.visibility = 'hidden';\n }\n else {\n this.div.style.visibility = 'visible';\n }\n }\n };\n InfoBox.prototype.setOptions = function (options) {\n if (options === void 0) { options = {}; }\n if (typeof options.boxClass !== 'undefined') {\n // Must be first\n this.boxClass = options.boxClass;\n this.setBoxStyle();\n }\n if (typeof options.boxStyle !== 'undefined') {\n // Must be second\n this.boxStyle = options.boxStyle;\n this.setBoxStyle();\n }\n if (typeof options.content !== 'undefined') {\n this.setContent(options.content);\n }\n if (typeof options.disableAutoPan !== 'undefined') {\n this.disableAutoPan = options.disableAutoPan;\n }\n if (typeof options.maxWidth !== 'undefined') {\n this.maxWidth = options.maxWidth;\n }\n if (typeof options.pixelOffset !== 'undefined') {\n this.pixelOffset = options.pixelOffset;\n }\n if (typeof options.alignBottom !== 'undefined') {\n this.alignBottom = options.alignBottom;\n }\n if (typeof options.position !== 'undefined') {\n this.setPosition(options.position);\n }\n if (typeof options.zIndex !== 'undefined') {\n this.setZIndex(options.zIndex);\n }\n if (typeof options.closeBoxMargin !== 'undefined') {\n this.closeBoxMargin = options.closeBoxMargin;\n }\n if (typeof options.closeBoxURL !== 'undefined') {\n this.closeBoxURL = options.closeBoxURL;\n }\n if (typeof options.infoBoxClearance !== 'undefined') {\n this.infoBoxClearance = options.infoBoxClearance;\n }\n if (typeof options.isHidden !== 'undefined') {\n this.isHidden = options.isHidden;\n }\n if (typeof options.visible !== 'undefined') {\n this.isHidden = !options.visible;\n }\n if (typeof options.enableEventPropagation !== 'undefined') {\n this.enableEventPropagation = options.enableEventPropagation;\n }\n if (this.div) {\n this.draw();\n }\n };\n InfoBox.prototype.setContent = function (content) {\n this.content = content;\n if (this.div) {\n if (this.closeListener) {\n google.maps.event.removeListener(this.closeListener);\n this.closeListener = null;\n }\n // Odd code required to make things work with MSIE.\n if (!this.fixedWidthSet) {\n this.div.style.width = '';\n }\n if (typeof content === 'string') {\n this.div.innerHTML = this.getCloseBoxImg() + content;\n }\n else {\n this.div.innerHTML = this.getCloseBoxImg();\n this.div.appendChild(content);\n }\n // Perverse code required to make things work with MSIE.\n // (Ensures the close box does, in fact, float to the right.)\n if (!this.fixedWidthSet) {\n this.div.style.width = this.div.offsetWidth + 'px';\n if (typeof content === 'string') {\n this.div.innerHTML = this.getCloseBoxImg() + content;\n }\n else {\n this.div.innerHTML = this.getCloseBoxImg();\n this.div.appendChild(content);\n }\n }\n this.addClickHandler();\n }\n /**\n * This event is fired when the content of the InfoBox changes.\n * @name InfoBox#content_changed\n * @event\n */\n google.maps.event.trigger(this, 'content_changed');\n };\n InfoBox.prototype.setPosition = function (latLng) {\n this.position = latLng;\n if (this.div) {\n this.draw();\n }\n /**\n * This event is fired when the position of the InfoBox changes.\n * @name InfoBox#position_changed\n * @event\n */\n google.maps.event.trigger(this, 'position_changed');\n };\n InfoBox.prototype.setVisible = function (isVisible) {\n this.isHidden = !isVisible;\n if (this.div) {\n this.div.style.visibility = this.isHidden ? 'hidden' : 'visible';\n }\n };\n InfoBox.prototype.setZIndex = function (index) {\n this.zIndex = index;\n if (this.div) {\n this.div.style.zIndex = index + '';\n }\n /**\n * This event is fired when the zIndex of the InfoBox changes.\n * @name InfoBox#zindex_changed\n * @event\n */\n google.maps.event.trigger(this, 'zindex_changed');\n };\n InfoBox.prototype.getContent = function () {\n return this.content;\n };\n InfoBox.prototype.getPosition = function () {\n return this.position;\n };\n InfoBox.prototype.getZIndex = function () {\n return this.zIndex;\n };\n InfoBox.prototype.getVisible = function () {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var map = this.getMap();\n var isVisible;\n if (typeof map === 'undefined' || map === null) {\n isVisible = false;\n }\n else {\n isVisible = !this.isHidden;\n }\n return isVisible;\n };\n InfoBox.prototype.show = function () {\n this.isHidden = false;\n if (this.div) {\n this.div.style.visibility = 'visible';\n }\n };\n InfoBox.prototype.hide = function () {\n this.isHidden = true;\n if (this.div) {\n this.div.style.visibility = 'hidden';\n }\n };\n InfoBox.prototype.open = function (map, anchor) {\n var _this = this;\n if (anchor) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.position = anchor.getPosition();\n this.moveListener = google.maps.event.addListener(anchor, 'position_changed', \n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n function () {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n var position = anchor.getPosition();\n _this.setPosition(position);\n });\n this.mapListener = google.maps.event.addListener(anchor, 'map_changed', \n // eslint-disable-next-line @getify/proper-arrows/this, @getify/proper-arrows/name\n function () {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n _this.setMap(anchor.map);\n });\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.setMap(map);\n if (this.div) {\n this.panBox();\n }\n };\n InfoBox.prototype.close = function () {\n if (this.closeListener) {\n google.maps.event.removeListener(this.closeListener);\n this.closeListener = null;\n }\n if (this.eventListeners) {\n for (var i = 0; i < this.eventListeners.length; i++) {\n google.maps.event.removeListener(this.eventListeners[i]);\n }\n this.eventListeners = null;\n }\n if (this.moveListener) {\n google.maps.event.removeListener(this.moveListener);\n this.moveListener = null;\n }\n if (this.mapListener) {\n google.maps.event.removeListener(this.mapListener);\n this.mapListener = null;\n }\n if (this.contextListener) {\n google.maps.event.removeListener(this.contextListener);\n this.contextListener = null;\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.setMap(null);\n };\n InfoBox.prototype.extend = function (obj1, obj2) {\n return function applyExtend(object) {\n // eslint-disable-next-line guard-for-in\n for (var property in object.prototype) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n if (!this.prototype.hasOwnProperty(property)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.prototype[property] = object.prototype[property];\n }\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n return this;\n }.apply(obj1, [obj2]);\n };\n return InfoBox;\n}());\n\nconst eventMap$d = {\n onCloseClick: 'closeclick',\n onContentChanged: 'content_changed',\n onDomReady: 'domready',\n onPositionChanged: 'position_changed',\n onZindexChanged: 'zindex_changed',\n};\nconst updaterMap$d = {\n options(instance, options) {\n instance.setOptions(options);\n },\n position(instance, position) {\n if (position instanceof google.maps.LatLng) {\n instance.setPosition(position);\n }\n else {\n instance.setPosition(new google.maps.LatLng(position.lat, position.lng));\n }\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n },\n zIndex(instance, zIndex) {\n instance.setZIndex(zIndex);\n },\n};\nclass InfoBoxComponent extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.containerElement = null;\n this.state = {\n infoBox: null,\n };\n this.open = (infoBox, anchor) => {\n if (anchor) {\n infoBox.open(this.context, anchor);\n }\n else if (infoBox.getPosition()) {\n infoBox.open(this.context);\n }\n else {\n invariant_1(false, 'You must provide either an anchor or a position prop for .');\n }\n };\n this.setInfoBoxCallback = () => {\n const { anchor, onLoad } = this.props;\n const { infoBox } = this.state;\n if (infoBox !== null && this.containerElement !== null) {\n infoBox.setContent(this.containerElement);\n this.open(infoBox, anchor);\n if (onLoad) {\n onLoad(infoBox);\n }\n }\n };\n }\n componentDidMount() {\n const { options } = this.props;\n const _a = options || {}, { position } = _a, infoBoxOptions = __rest$1(_a, [\"position\"]);\n let positionLatLng;\n if (position && !(position instanceof google.maps.LatLng)) {\n positionLatLng = new google.maps.LatLng(position.lat, position.lng);\n }\n const infoBox = new InfoBox(Object.assign(Object.assign({}, infoBoxOptions), (positionLatLng ? { position: positionLatLng } : {})));\n this.containerElement = document.createElement('div');\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$d,\n eventMap: eventMap$d,\n prevProps: {},\n nextProps: this.props,\n instance: infoBox,\n });\n this.setState({ infoBox }, this.setInfoBoxCallback);\n }\n componentDidUpdate(prevProps) {\n const { infoBox } = this.state;\n if (infoBox !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$d,\n eventMap: eventMap$d,\n prevProps,\n nextProps: this.props,\n instance: infoBox,\n });\n }\n }\n componentWillUnmount() {\n const { onUnmount } = this.props;\n const { infoBox } = this.state;\n if (infoBox !== null) {\n if (onUnmount) {\n onUnmount(infoBox);\n }\n unregisterEvents(this.registeredEvents);\n infoBox.close();\n }\n }\n render() {\n if (!this.containerElement) {\n return null;\n }\n return ReactDOM.createPortal(React.Children.only(this.props.children), this.containerElement);\n }\n}\nInfoBoxComponent.contextType = MapContext;\n\n/**\n * @module helpers\n */\n/**\n * Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.\n *\n * @memberof helpers\n * @type {number}\n */\nvar earthRadius = 6371008.8;\n/**\n * Unit of measurement factors using a spherical (non-ellipsoid) earth radius.\n *\n * @memberof helpers\n * @type {Object}\n */\nvar factors = {\n centimeters: earthRadius * 100,\n centimetres: earthRadius * 100,\n degrees: earthRadius / 111325,\n feet: earthRadius * 3.28084,\n inches: earthRadius * 39.37,\n kilometers: earthRadius / 1000,\n kilometres: earthRadius / 1000,\n meters: earthRadius,\n metres: earthRadius,\n miles: earthRadius / 1609.344,\n millimeters: earthRadius * 1000,\n millimetres: earthRadius * 1000,\n nauticalmiles: earthRadius / 1852,\n radians: 1,\n yards: earthRadius * 1.0936,\n};\n/**\n * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.\n *\n * @name feature\n * @param {Geometry} geometry input geometry\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a GeoJSON Feature\n * @example\n * var geometry = {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 50]\n * };\n *\n * var feature = turf.feature(geometry);\n *\n * //=feature\n */\nfunction feature(geom, properties, options) {\n if (options === void 0) { options = {}; }\n var feat = { type: \"Feature\" };\n if (options.id === 0 || options.id) {\n feat.id = options.id;\n }\n if (options.bbox) {\n feat.bbox = options.bbox;\n }\n feat.properties = properties || {};\n feat.geometry = geom;\n return feat;\n}\n/**\n * Creates a {@link Point} {@link Feature} from a Position.\n *\n * @name point\n * @param {Array} coordinates longitude, latitude position (each in decimal degrees)\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a Point feature\n * @example\n * var point = turf.point([-75.343, 39.984]);\n *\n * //=point\n */\nfunction point(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n if (!coordinates) {\n throw new Error(\"coordinates is required\");\n }\n if (!Array.isArray(coordinates)) {\n throw new Error(\"coordinates must be an Array\");\n }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be at least 2 numbers long\");\n }\n if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {\n throw new Error(\"coordinates must contain numbers\");\n }\n var geom = {\n type: \"Point\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}.\n *\n * @name featureCollection\n * @param {Feature[]} features input features\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {FeatureCollection} FeatureCollection of Features\n * @example\n * var locationA = turf.point([-75.343, 39.984], {name: 'Location A'});\n * var locationB = turf.point([-75.833, 39.284], {name: 'Location B'});\n * var locationC = turf.point([-75.534, 39.123], {name: 'Location C'});\n *\n * var collection = turf.featureCollection([\n * locationA,\n * locationB,\n * locationC\n * ]);\n *\n * //=collection\n */\nfunction featureCollection(features, options) {\n if (options === void 0) { options = {}; }\n var fc = { type: \"FeatureCollection\" };\n if (options.id) {\n fc.id = options.id;\n }\n if (options.bbox) {\n fc.bbox = options.bbox;\n }\n fc.features = features;\n return fc;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name radiansToLength\n * @param {number} radians in radians across the sphere\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} distance\n */\nfunction radiansToLength(radians, units) {\n if (units === void 0) { units = \"kilometers\"; }\n var factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return radians * factor;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name lengthToRadians\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} radians\n */\nfunction lengthToRadians(distance, units) {\n if (units === void 0) { units = \"kilometers\"; }\n var factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return distance / factor;\n}\n/**\n * Converts an angle in degrees to radians\n *\n * @name degreesToRadians\n * @param {number} degrees angle between 0 and 360 degrees\n * @returns {number} angle in radians\n */\nfunction degreesToRadians(degrees) {\n var radians = degrees % 360;\n return (radians * Math.PI) / 180;\n}\n/**\n * Converts a length to the requested unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @param {number} length to be converted\n * @param {Units} [originalUnit=\"kilometers\"] of the length\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted length\n */\nfunction convertLength(length, originalUnit, finalUnit) {\n if (originalUnit === void 0) { originalUnit = \"kilometers\"; }\n if (finalUnit === void 0) { finalUnit = \"kilometers\"; }\n if (!(length >= 0)) {\n throw new Error(\"length must be a positive number\");\n }\n return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);\n}\n/**\n * isNumber\n *\n * @param {*} num Number to validate\n * @returns {boolean} true/false\n * @example\n * turf.isNumber(123)\n * //=true\n * turf.isNumber('foo')\n * //=false\n */\nfunction isNumber(num) {\n return !isNaN(num) && num !== null && !Array.isArray(num);\n}\n\n/**\n * Returns a cloned copy of the passed GeoJSON Object, including possible 'Foreign Members'.\n * ~3-5x faster than the common JSON.parse + JSON.stringify combo method.\n *\n * @name clone\n * @param {GeoJSON} geojson GeoJSON Object\n * @returns {GeoJSON} cloned GeoJSON Object\n * @example\n * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]], {color: 'red'});\n *\n * var lineCloned = turf.clone(line);\n */\nfunction clone(geojson) {\n if (!geojson) {\n throw new Error(\"geojson is required\");\n }\n switch (geojson.type) {\n case \"Feature\":\n return cloneFeature(geojson);\n case \"FeatureCollection\":\n return cloneFeatureCollection(geojson);\n case \"Point\":\n case \"LineString\":\n case \"Polygon\":\n case \"MultiPoint\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n case \"GeometryCollection\":\n return cloneGeometry(geojson);\n default:\n throw new Error(\"unknown GeoJSON type\");\n }\n}\n/**\n * Clone Feature\n *\n * @private\n * @param {Feature} geojson GeoJSON Feature\n * @returns {Feature} cloned Feature\n */\nfunction cloneFeature(geojson) {\n var cloned = { type: \"Feature\" };\n // Preserve Foreign Members\n Object.keys(geojson).forEach(function (key) {\n switch (key) {\n case \"type\":\n case \"properties\":\n case \"geometry\":\n return;\n default:\n cloned[key] = geojson[key];\n }\n });\n // Add properties & geometry last\n cloned.properties = cloneProperties(geojson.properties);\n cloned.geometry = cloneGeometry(geojson.geometry);\n return cloned;\n}\n/**\n * Clone Properties\n *\n * @private\n * @param {Object} properties GeoJSON Properties\n * @returns {Object} cloned Properties\n */\nfunction cloneProperties(properties) {\n var cloned = {};\n if (!properties) {\n return cloned;\n }\n Object.keys(properties).forEach(function (key) {\n var value = properties[key];\n if (typeof value === \"object\") {\n if (value === null) {\n // handle null\n cloned[key] = null;\n }\n else if (Array.isArray(value)) {\n // handle Array\n cloned[key] = value.map(function (item) {\n return item;\n });\n }\n else {\n // handle generic Object\n cloned[key] = cloneProperties(value);\n }\n }\n else {\n cloned[key] = value;\n }\n });\n return cloned;\n}\n/**\n * Clone Feature Collection\n *\n * @private\n * @param {FeatureCollection} geojson GeoJSON Feature Collection\n * @returns {FeatureCollection} cloned Feature Collection\n */\nfunction cloneFeatureCollection(geojson) {\n var cloned = { type: \"FeatureCollection\" };\n // Preserve Foreign Members\n Object.keys(geojson).forEach(function (key) {\n switch (key) {\n case \"type\":\n case \"features\":\n return;\n default:\n cloned[key] = geojson[key];\n }\n });\n // Add features\n cloned.features = geojson.features.map(function (feature) {\n return cloneFeature(feature);\n });\n return cloned;\n}\n/**\n * Clone Geometry\n *\n * @private\n * @param {Geometry} geometry GeoJSON Geometry\n * @returns {Geometry} cloned Geometry\n */\nfunction cloneGeometry(geometry) {\n var geom = { type: geometry.type };\n if (geometry.bbox) {\n geom.bbox = geometry.bbox;\n }\n if (geometry.type === \"GeometryCollection\") {\n geom.geometries = geometry.geometries.map(function (g) {\n return cloneGeometry(g);\n });\n return geom;\n }\n geom.coordinates = deepSlice(geometry.coordinates);\n return geom;\n}\n/**\n * Deep Slice coordinates\n *\n * @private\n * @param {Coordinates} coords Coordinates\n * @returns {Coordinates} all coordinates sliced\n */\nfunction deepSlice(coords) {\n var cloned = coords;\n if (typeof cloned[0] !== \"object\") {\n return cloned.slice();\n }\n return cloned.map(function (coord) {\n return deepSlice(coord);\n });\n}\n\n/**\n * Callback for coordEach\n *\n * @callback coordEachCallback\n * @param {Array} currentCoord The current coordinate being processed.\n * @param {number} coordIndex The current index of the coordinate being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n */\n\n/**\n * Iterate over coordinates in any GeoJSON object, similar to Array.forEach()\n *\n * @name coordEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex)\n * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration.\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {\"foo\": \"bar\"}),\n * turf.point([36, 53], {\"hello\": \"world\"})\n * ]);\n *\n * turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=currentCoord\n * //=coordIndex\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * });\n */\nfunction coordEach(geojson, callback, excludeWrapCoord) {\n // Handles null Geometry -- Skips this GeoJSON\n if (geojson === null) return;\n var j,\n k,\n l,\n geometry,\n stopG,\n coords,\n geometryMaybeCollection,\n wrapShrink = 0,\n coordIndex = 0,\n isGeometryCollection,\n type = geojson.type,\n isFeatureCollection = type === \"FeatureCollection\",\n isFeature = type === \"Feature\",\n stop = isFeatureCollection ? geojson.features.length : 1;\n\n // This logic may look a little weird. The reason why it is that way\n // is because it's trying to be fast. GeoJSON supports multiple kinds\n // of objects at its root: FeatureCollection, Features, Geometries.\n // This function has the responsibility of handling all of them, and that\n // means that some of the `for` loops you see below actually just don't apply\n // to certain inputs. For instance, if you give this just a\n // Point geometry, then both loops are short-circuited and all we do\n // is gradually rename the input until it's called 'geometry'.\n //\n // This also aims to allocate as few resources as possible: just a\n // few numbers and booleans, rather than any temporary arrays as would\n // be required with the normalization approach.\n for (var featureIndex = 0; featureIndex < stop; featureIndex++) {\n geometryMaybeCollection = isFeatureCollection\n ? geojson.features[featureIndex].geometry\n : isFeature\n ? geojson.geometry\n : geojson;\n isGeometryCollection = geometryMaybeCollection\n ? geometryMaybeCollection.type === \"GeometryCollection\"\n : false;\n stopG = isGeometryCollection\n ? geometryMaybeCollection.geometries.length\n : 1;\n\n for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {\n var multiFeatureIndex = 0;\n var geometryIndex = 0;\n geometry = isGeometryCollection\n ? geometryMaybeCollection.geometries[geomIndex]\n : geometryMaybeCollection;\n\n // Handles null Geometry -- Skips this geometry\n if (geometry === null) continue;\n coords = geometry.coordinates;\n var geomType = geometry.type;\n\n wrapShrink =\n excludeWrapCoord &&\n (geomType === \"Polygon\" || geomType === \"MultiPolygon\")\n ? 1\n : 0;\n\n switch (geomType) {\n case null:\n break;\n case \"Point\":\n if (\n callback(\n coords,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n multiFeatureIndex++;\n break;\n case \"LineString\":\n case \"MultiPoint\":\n for (j = 0; j < coords.length; j++) {\n if (\n callback(\n coords[j],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n if (geomType === \"MultiPoint\") multiFeatureIndex++;\n }\n if (geomType === \"LineString\") multiFeatureIndex++;\n break;\n case \"Polygon\":\n case \"MultiLineString\":\n for (j = 0; j < coords.length; j++) {\n for (k = 0; k < coords[j].length - wrapShrink; k++) {\n if (\n callback(\n coords[j][k],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n }\n if (geomType === \"MultiLineString\") multiFeatureIndex++;\n if (geomType === \"Polygon\") geometryIndex++;\n }\n if (geomType === \"Polygon\") multiFeatureIndex++;\n break;\n case \"MultiPolygon\":\n for (j = 0; j < coords.length; j++) {\n geometryIndex = 0;\n for (k = 0; k < coords[j].length; k++) {\n for (l = 0; l < coords[j][k].length - wrapShrink; l++) {\n if (\n callback(\n coords[j][k][l],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n }\n geometryIndex++;\n }\n multiFeatureIndex++;\n }\n break;\n case \"GeometryCollection\":\n for (j = 0; j < geometry.geometries.length; j++)\n if (\n coordEach(geometry.geometries[j], callback, excludeWrapCoord) ===\n false\n )\n return false;\n break;\n default:\n throw new Error(\"Unknown Geometry Type\");\n }\n }\n }\n}\n\n/**\n * Callback for featureEach\n *\n * @callback featureEachCallback\n * @param {Feature} currentFeature The current Feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Iterate over features in any GeoJSON object, similar to\n * Array.forEach.\n *\n * @name featureEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentFeature, featureIndex)\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.featureEach(features, function (currentFeature, featureIndex) {\n * //=currentFeature\n * //=featureIndex\n * });\n */\nfunction featureEach(geojson, callback) {\n if (geojson.type === \"Feature\") {\n callback(geojson, 0);\n } else if (geojson.type === \"FeatureCollection\") {\n for (var i = 0; i < geojson.features.length; i++) {\n if (callback(geojson.features[i], i) === false) break;\n }\n }\n}\n\n/**\n * Get all coordinates from any GeoJSON object.\n *\n * @name coordAll\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @returns {Array>} coordinate position array\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * var coords = turf.coordAll(features);\n * //= [[26, 37], [36, 53]]\n */\nfunction coordAll(geojson) {\n var coords = [];\n coordEach(geojson, function (coord) {\n coords.push(coord);\n });\n return coords;\n}\n\nvar distance$1 = {\n\t/**\n * Euclidean distance\n */\n\teudist: function eudist(v1, v2, sqrt) {\n\t\tvar len = v1.length;\n\t\tvar sum = 0;\n\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar d = (v1[i] || 0) - (v2[i] || 0);\n\t\t\tsum += d * d;\n\t\t}\n\t\t// Square root not really needed\n\t\treturn sqrt ? Math.sqrt(sum) : sum;\n\t},\n\tmandist: function mandist(v1, v2, sqrt) {\n\t\tvar len = v1.length;\n\t\tvar sum = 0;\n\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tsum += Math.abs((v1[i] || 0) - (v2[i] || 0));\n\t\t}\n\n\t\t// Square root not really needed\n\t\treturn sqrt ? Math.sqrt(sum) : sum;\n\t},\n\n\n\t/**\n * Unidimensional distance\n */\n\tdist: function dist(v1, v2, sqrt) {\n\t\tvar d = Math.abs(v1 - v2);\n\t\treturn sqrt ? d : d * d;\n\t}\n};\n\nvar Distance$1 = distance$1,\n eudist$1 = Distance$1.eudist,\n dist = Distance$1.dist;\n\nvar kinit = {\n\tkmrand: function kmrand(data, k) {\n\t\tvar map = {},\n\t\t ks = [],\n\t\t t = k << 2;\n\t\tvar len = data.length;\n\t\tvar multi = data[0].length > 0;\n\n\t\twhile (ks.length < k && t-- > 0) {\n\t\t\tvar d = data[Math.floor(Math.random() * len)];\n\t\t\tvar key = multi ? d.join(\"_\") : \"\" + d;\n\t\t\tif (!map[key]) {\n\t\t\t\tmap[key] = true;\n\t\t\t\tks.push(d);\n\t\t\t}\n\t\t}\n\n\t\tif (ks.length < k) throw new Error(\"Error initializating clusters\");else return ks;\n\t},\n\n\n\t/**\n * K-means++ initial centroid selection\n */\n\tkmpp: function kmpp(data, k) {\n\t\tvar distance = data[0].length ? eudist$1 : dist;\n\t\tvar ks = [],\n\t\t len = data.length;\n\t\tvar multi = data[0].length > 0;\n\t\tvar map = {};\n\n\t\t// First random centroid\n\t\tvar c = data[Math.floor(Math.random() * len)];\n\t\tvar key = multi ? c.join(\"_\") : \"\" + c;\n\t\tks.push(c);\n\t\tmap[key] = true;\n\n\t\t// Retrieve next centroids\n\t\twhile (ks.length < k) {\n\t\t\t// Min Distances between current centroids and data points\n\t\t\tvar dists = [],\n\t\t\t lk = ks.length;\n\t\t\tvar dsum = 0,\n\t\t\t prs = [];\n\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tvar min = Infinity;\n\t\t\t\tfor (var j = 0; j < lk; j++) {\n\t\t\t\t\tvar _dist = distance(data[i], ks[j]);\n\t\t\t\t\tif (_dist <= min) min = _dist;\n\t\t\t\t}\n\t\t\t\tdists[i] = min;\n\t\t\t}\n\n\t\t\t// Sum all min distances\n\t\t\tfor (var _i = 0; _i < len; _i++) {\n\t\t\t\tdsum += dists[_i];\n\t\t\t}\n\n\t\t\t// Probabilities and cummulative prob (cumsum)\n\t\t\tfor (var _i2 = 0; _i2 < len; _i2++) {\n\t\t\t\tprs[_i2] = { i: _i2, v: data[_i2], pr: dists[_i2] / dsum, cs: 0 };\n\t\t\t}\n\n\t\t\t// Sort Probabilities\n\t\t\tprs.sort(function (a, b) {\n\t\t\t\treturn a.pr - b.pr;\n\t\t\t});\n\n\t\t\t// Cummulative Probabilities\n\t\t\tprs[0].cs = prs[0].pr;\n\t\t\tfor (var _i3 = 1; _i3 < len; _i3++) {\n\t\t\t\tprs[_i3].cs = prs[_i3 - 1].cs + prs[_i3].pr;\n\t\t\t}\n\n\t\t\t// Randomize\n\t\t\tvar rnd = Math.random();\n\n\t\t\t// Gets only the items whose cumsum >= rnd\n\t\t\tvar idx = 0;\n\t\t\twhile (idx < len - 1 && prs[idx++].cs < rnd) {}\n\t\t\tks.push(prs[idx - 1].v);\n\t\t\t/*\n let done = false;\n while(!done) {\n \t// this is our new centroid\n \tc = prs[idx-1].v\n \tkey = multi? c.join(\"_\") : `${c}`;\n \tif(!map[key]) {\n \t\tmap[key] = true;\n \t\tks.push(c);\n \t\tdone = true;\n \t}\n \telse {\n \t\tidx++;\n \t}\n }\n */\n\t\t}\n\n\t\treturn ks;\n\t}\n};\n\n/*jshint esversion: 6 */\n\nvar Distance = distance$1,\n ClusterInit = kinit,\n eudist = Distance.eudist,\n kmrand = ClusterInit.kmrand,\n kmpp = ClusterInit.kmpp;\n\nvar MAX = 10000;\n\n/**\n * Inits an array with values\n */\nfunction init(len, val, v) {\n\tv = v || [];\n\tfor (var i = 0; i < len; i++) {\n\t\tv[i] = val;\n\t}return v;\n}\n\nfunction skmeans(data, k, initial, maxit) {\n\tvar ks = [],\n\t old = [],\n\t idxs = [],\n\t dist = [];\n\tvar conv = false,\n\t it = maxit || MAX;\n\tvar len = data.length,\n\t vlen = data[0].length,\n\t multi = vlen > 0;\n\tvar count = [];\n\n\tif (!initial) {\n\t\tvar _idxs = {};\n\t\twhile (ks.length < k) {\n\t\t\tvar idx = Math.floor(Math.random() * len);\n\t\t\tif (!_idxs[idx]) {\n\t\t\t\t_idxs[idx] = true;\n\t\t\t\tks.push(data[idx]);\n\t\t\t}\n\t\t}\n\t} else if (initial == \"kmrand\") {\n\t\tks = kmrand(data, k);\n\t} else if (initial == \"kmpp\") {\n\t\tks = kmpp(data, k);\n\t} else {\n\t\tks = initial;\n\t}\n\n\tdo {\n\t\t// Reset k count\n\t\tinit(k, 0, count);\n\n\t\t// For each value in data, find the nearest centroid\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar min = Infinity,\n\t\t\t _idx = 0;\n\t\t\tfor (var j = 0; j < k; j++) {\n\t\t\t\t// Multidimensional or unidimensional\n\t\t\t\tvar dist = multi ? eudist(data[i], ks[j]) : Math.abs(data[i] - ks[j]);\n\t\t\t\tif (dist <= min) {\n\t\t\t\t\tmin = dist;\n\t\t\t\t\t_idx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tidxs[i] = _idx; // Index of the selected centroid for that value\n\t\t\tcount[_idx]++; // Number of values for this centroid\n\t\t}\n\n\t\t// Recalculate centroids\n\t\tvar sum = [],\n\t\t old = [];\n\t\tfor (var _j = 0; _j < k; _j++) {\n\t\t\t// Multidimensional or unidimensional\n\t\t\tsum[_j] = multi ? init(vlen, 0, sum[_j]) : 0;\n\t\t\told[_j] = ks[_j];\n\t\t}\n\n\t\t// If multidimensional\n\t\tif (multi) {\n\t\t\tfor (var _j2 = 0; _j2 < k; _j2++) {\n\t\t\t\tks[_j2] = [];\n\t\t\t} // Sum values and count for each centroid\n\t\t\tfor (var _i = 0; _i < len; _i++) {\n\t\t\t\tvar _idx2 = idxs[_i],\n\t\t\t\t // Centroid for that item\n\t\t\t\tvsum = sum[_idx2],\n\t\t\t\t // Sum values for this centroid\n\t\t\t\tvect = data[_i]; // Current vector\n\n\t\t\t\t// Accumulate value on the centroid for current vector\n\t\t\t\tfor (var h = 0; h < vlen; h++) {\n\t\t\t\t\tvsum[h] += vect[h];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Calculate the average for each centroid\n\t\t\tconv = true;\n\t\t\tfor (var _j3 = 0; _j3 < k; _j3++) {\n\t\t\t\tvar ksj = ks[_j3],\n\t\t\t\t // Current centroid\n\t\t\t\tsumj = sum[_j3],\n\t\t\t\t // Accumulated centroid values\n\t\t\t\toldj = old[_j3],\n\t\t\t\t // Old centroid value\n\t\t\t\tcj = count[_j3]; // Number of elements for this centroid\n\n\t\t\t\t// New average\n\t\t\t\tfor (var _h = 0; _h < vlen; _h++) {\n\t\t\t\t\tksj[_h] = sumj[_h] / cj || 0; // New centroid\n\t\t\t\t}\n\n\t\t\t\t// Find if centroids have moved\n\t\t\t\tif (conv) {\n\t\t\t\t\tfor (var _h2 = 0; _h2 < vlen; _h2++) {\n\t\t\t\t\t\tif (oldj[_h2] != ksj[_h2]) {\n\t\t\t\t\t\t\tconv = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// If unidimensional\n\t\telse {\n\t\t\t\t// Sum values and count for each centroid\n\t\t\t\tfor (var _i2 = 0; _i2 < len; _i2++) {\n\t\t\t\t\tvar _idx3 = idxs[_i2];\n\t\t\t\t\tsum[_idx3] += data[_i2];\n\t\t\t\t}\n\t\t\t\t// Calculate the average for each centroid\n\t\t\t\tfor (var _j4 = 0; _j4 < k; _j4++) {\n\t\t\t\t\tks[_j4] = sum[_j4] / count[_j4] || 0; // New centroid\n\t\t\t\t}\n\t\t\t\t// Find if centroids have moved\n\t\t\t\tconv = true;\n\t\t\t\tfor (var _j5 = 0; _j5 < k; _j5++) {\n\t\t\t\t\tif (old[_j5] != ks[_j5]) {\n\t\t\t\t\t\tconv = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tconv = conv || --it <= 0;\n\t} while (!conv);\n\n\treturn {\n\t\tit: MAX - it,\n\t\tk: k,\n\t\tidxs: idxs,\n\t\tcentroids: ks\n\t};\n}\n\nvar main = skmeans;\n\n/**\n * Takes a set of {@link Point|points} and partition them into clusters using the k-mean .\n * It uses the [k-means algorithm](https://en.wikipedia.org/wiki/K-means_clustering)\n *\n * @name clustersKmeans\n * @param {FeatureCollection} points to be clustered\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.numberOfClusters=Math.sqrt(numberOfPoints/2)] numberOfClusters that will be generated\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {FeatureCollection} Clustered Points with an additional two properties associated to each Feature:\n * - {number} cluster - the associated clusterId\n * - {[number, number]} centroid - Centroid of the cluster [Longitude, Latitude]\n * @example\n * // create random points with random z-values in their properties\n * var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});\n * var options = {numberOfClusters: 7};\n * var clustered = turf.clustersKmeans(points, options);\n *\n * //addToMap\n * var addToMap = [clustered];\n */\nfunction clustersKmeans(points, options) {\n if (options === void 0) { options = {}; }\n // Default Params\n var count = points.features.length;\n options.numberOfClusters =\n options.numberOfClusters || Math.round(Math.sqrt(count / 2));\n // numberOfClusters can't be greater than the number of points\n // fallbacks to count\n if (options.numberOfClusters > count)\n options.numberOfClusters = count;\n // Clone points to prevent any mutations (enabled by default)\n if (options.mutate !== true)\n points = clone(points);\n // collect points coordinates\n var data = coordAll(points);\n // create seed to avoid skmeans to drift\n var initialCentroids = data.slice(0, options.numberOfClusters);\n // create skmeans clusters\n var skmeansResult = main(data, options.numberOfClusters, initialCentroids);\n // store centroids {clusterId: [number, number]}\n var centroids = {};\n skmeansResult.centroids.forEach(function (coord, idx) {\n centroids[idx] = coord;\n });\n // add associated cluster number\n featureEach(points, function (point, index) {\n var clusterId = skmeansResult.idxs[index];\n point.properties.cluster = clusterId;\n point.properties.centroid = centroids[clusterId];\n });\n return points;\n}\n\n/**\n * Unwrap a coordinate from a Point Feature, Geometry or a single coordinate.\n *\n * @name getCoord\n * @param {Array|Geometry|Feature} coord GeoJSON Point or an Array of numbers\n * @returns {Array} coordinates\n * @example\n * var pt = turf.point([10, 10]);\n *\n * var coord = turf.getCoord(pt);\n * //= [10, 10]\n */\nfunction getCoord(coord) {\n if (!coord) {\n throw new Error(\"coord is required\");\n }\n if (!Array.isArray(coord)) {\n if (coord.type === \"Feature\" &&\n coord.geometry !== null &&\n coord.geometry.type === \"Point\") {\n return coord.geometry.coordinates;\n }\n if (coord.type === \"Point\") {\n return coord.coordinates;\n }\n }\n if (Array.isArray(coord) &&\n coord.length >= 2 &&\n !Array.isArray(coord[0]) &&\n !Array.isArray(coord[1])) {\n return coord;\n }\n throw new Error(\"coord must be GeoJSON Point or an Array of numbers\");\n}\n\n//http://en.wikipedia.org/wiki/Haversine_formula\n//http://www.movable-type.co.uk/scripts/latlong.html\n/**\n * Calculates the distance between two {@link Point|points} in degrees, radians, miles, or kilometers.\n * This uses the [Haversine formula](http://en.wikipedia.org/wiki/Haversine_formula) to account for global curvature.\n *\n * @name distance\n * @param {Coord | Point} from origin point or coordinate\n * @param {Coord | Point} to destination point or coordinate\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers\n * @returns {number} distance between the two points\n * @example\n * var from = turf.point([-75.343, 39.984]);\n * var to = turf.point([-75.534, 39.123]);\n * var options = {units: 'miles'};\n *\n * var distance = turf.distance(from, to, options);\n *\n * //addToMap\n * var addToMap = [from, to];\n * from.properties.distance = distance;\n * to.properties.distance = distance;\n */\nfunction distance(from, to, options) {\n if (options === void 0) { options = {}; }\n var coordinates1 = getCoord(from);\n var coordinates2 = getCoord(to);\n var dLat = degreesToRadians(coordinates2[1] - coordinates1[1]);\n var dLon = degreesToRadians(coordinates2[0] - coordinates1[0]);\n var lat1 = degreesToRadians(coordinates1[1]);\n var lat2 = degreesToRadians(coordinates2[1]);\n var a = Math.pow(Math.sin(dLat / 2), 2) +\n Math.pow(Math.sin(dLon / 2), 2) * Math.cos(lat1) * Math.cos(lat2);\n return radiansToLength(2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), options.units);\n}\n\nvar lib = {exports: {}};\n\nvar DBSCAN = {exports: {}};\n\n/**\r\n * DBSCAN - Density based clustering\r\n *\r\n * @author Lukasz Krawczyk \r\n * @copyright MIT\r\n */\n\n(function (module) {\n/**\r\n * DBSCAN class construcotr\r\n * @constructor\r\n *\r\n * @param {Array} dataset\r\n * @param {number} epsilon\r\n * @param {number} minPts\r\n * @param {function} distanceFunction\r\n * @returns {DBSCAN}\r\n */\r\nfunction DBSCAN(dataset, epsilon, minPts, distanceFunction) {\r\n /** @type {Array} */\r\n this.dataset = [];\r\n /** @type {number} */\r\n this.epsilon = 1;\r\n /** @type {number} */\r\n this.minPts = 2;\r\n /** @type {function} */\r\n this.distance = this._euclideanDistance;\r\n /** @type {Array} */\r\n this.clusters = [];\r\n /** @type {Array} */\r\n this.noise = [];\r\n\r\n // temporary variables used during computation\r\n\r\n /** @type {Array} */\r\n this._visited = [];\r\n /** @type {Array} */\r\n this._assigned = [];\r\n /** @type {number} */\r\n this._datasetLength = 0;\r\n\r\n this._init(dataset, epsilon, minPts, distanceFunction);\r\n}\r\n/******************************************************************************/\r\n// public functions\r\n\r\n/**\r\n * Start clustering\r\n *\r\n * @param {Array} dataset\r\n * @param {number} epsilon\r\n * @param {number} minPts\r\n * @param {function} distanceFunction\r\n * @returns {undefined}\r\n * @access public\r\n */\r\nDBSCAN.prototype.run = function(dataset, epsilon, minPts, distanceFunction) {\r\n this._init(dataset, epsilon, minPts, distanceFunction);\r\n\r\n for (var pointId = 0; pointId < this._datasetLength; pointId++) {\r\n // if point is not visited, check if it forms a cluster\r\n if (this._visited[pointId] !== 1) {\r\n this._visited[pointId] = 1;\r\n\r\n // if closest neighborhood is too small to form a cluster, mark as noise\r\n var neighbors = this._regionQuery(pointId);\r\n\r\n if (neighbors.length < this.minPts) {\r\n this.noise.push(pointId);\r\n } else {\r\n // create new cluster and add point\r\n var clusterId = this.clusters.length;\r\n this.clusters.push([]);\r\n this._addToCluster(pointId, clusterId);\r\n\r\n this._expandCluster(clusterId, neighbors);\r\n }\r\n }\r\n }\r\n\r\n return this.clusters;\r\n};\r\n\r\n/******************************************************************************/\r\n// protected functions\r\n\r\n/**\r\n * Set object properties\r\n *\r\n * @param {Array} dataset\r\n * @param {number} epsilon\r\n * @param {number} minPts\r\n * @param {function} distance\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nDBSCAN.prototype._init = function(dataset, epsilon, minPts, distance) {\r\n\r\n if (dataset) {\r\n\r\n if (!(dataset instanceof Array)) {\r\n throw Error('Dataset must be of type array, ' +\r\n typeof dataset + ' given');\r\n }\r\n\r\n this.dataset = dataset;\r\n this.clusters = [];\r\n this.noise = [];\r\n\r\n this._datasetLength = dataset.length;\r\n this._visited = new Array(this._datasetLength);\r\n this._assigned = new Array(this._datasetLength);\r\n }\r\n\r\n if (epsilon) {\r\n this.epsilon = epsilon;\r\n }\r\n\r\n if (minPts) {\r\n this.minPts = minPts;\r\n }\r\n\r\n if (distance) {\r\n this.distance = distance;\r\n }\r\n};\r\n\r\n/**\r\n * Expand cluster to closest points of given neighborhood\r\n *\r\n * @param {number} clusterId\r\n * @param {Array} neighbors\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nDBSCAN.prototype._expandCluster = function(clusterId, neighbors) {\r\n\r\n /**\r\n * It's very important to calculate length of neighbors array each time,\r\n * as the number of elements changes over time\r\n */\r\n for (var i = 0; i < neighbors.length; i++) {\r\n var pointId2 = neighbors[i];\r\n\r\n if (this._visited[pointId2] !== 1) {\r\n this._visited[pointId2] = 1;\r\n var neighbors2 = this._regionQuery(pointId2);\r\n\r\n if (neighbors2.length >= this.minPts) {\r\n neighbors = this._mergeArrays(neighbors, neighbors2);\r\n }\r\n }\r\n\r\n // add to cluster\r\n if (this._assigned[pointId2] !== 1) {\r\n this._addToCluster(pointId2, clusterId);\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Add new point to cluster\r\n *\r\n * @param {number} pointId\r\n * @param {number} clusterId\r\n */\r\nDBSCAN.prototype._addToCluster = function(pointId, clusterId) {\r\n this.clusters[clusterId].push(pointId);\r\n this._assigned[pointId] = 1;\r\n};\r\n\r\n/**\r\n * Find all neighbors around given point\r\n *\r\n * @param {number} pointId,\r\n * @param {number} epsilon\r\n * @returns {Array}\r\n * @access protected\r\n */\r\nDBSCAN.prototype._regionQuery = function(pointId) {\r\n var neighbors = [];\r\n\r\n for (var id = 0; id < this._datasetLength; id++) {\r\n var dist = this.distance(this.dataset[pointId], this.dataset[id]);\r\n if (dist < this.epsilon) {\r\n neighbors.push(id);\r\n }\r\n }\r\n\r\n return neighbors;\r\n};\r\n\r\n/******************************************************************************/\r\n// helpers\r\n\r\n/**\r\n * @param {Array} a\r\n * @param {Array} b\r\n * @returns {Array}\r\n * @access protected\r\n */\r\nDBSCAN.prototype._mergeArrays = function(a, b) {\r\n var len = b.length;\r\n\r\n for (var i = 0; i < len; i++) {\r\n var P = b[i];\r\n if (a.indexOf(P) < 0) {\r\n a.push(P);\r\n }\r\n }\r\n\r\n return a;\r\n};\r\n\r\n/**\r\n * Calculate euclidean distance in multidimensional space\r\n *\r\n * @param {Array} p\r\n * @param {Array} q\r\n * @returns {number}\r\n * @access protected\r\n */\r\nDBSCAN.prototype._euclideanDistance = function(p, q) {\r\n var sum = 0;\r\n var i = Math.min(p.length, q.length);\r\n\r\n while (i--) {\r\n sum += (p[i] - q[i]) * (p[i] - q[i]);\r\n }\r\n\r\n return Math.sqrt(sum);\r\n};\r\n\r\nif (module.exports) {\r\n module.exports = DBSCAN;\r\n}\n}(DBSCAN));\n\nvar KMEANS = {exports: {}};\n\n(function (module) {\n/**\r\n * KMEANS clustering\r\n *\r\n * @author Lukasz Krawczyk \r\n * @copyright MIT\r\n */\r\n\r\n/**\r\n * KMEANS class constructor\r\n * @constructor\r\n *\r\n * @param {Array} dataset\r\n * @param {number} k - number of clusters\r\n * @param {function} distance - distance function\r\n * @returns {KMEANS}\r\n */\r\n function KMEANS(dataset, k, distance) {\r\n this.k = 3; // number of clusters\r\n this.dataset = []; // set of feature vectors\r\n this.assignments = []; // set of associated clusters for each feature vector\r\n this.centroids = []; // vectors for our clusters\r\n\r\n this.init(dataset, k, distance);\r\n}\r\n\r\n/**\r\n * @returns {undefined}\r\n */\r\nKMEANS.prototype.init = function(dataset, k, distance) {\r\n this.assignments = [];\r\n this.centroids = [];\r\n\r\n if (typeof dataset !== 'undefined') {\r\n this.dataset = dataset;\r\n }\r\n\r\n if (typeof k !== 'undefined') {\r\n this.k = k;\r\n }\r\n\r\n if (typeof distance !== 'undefined') {\r\n this.distance = distance;\r\n }\r\n};\r\n\r\n/**\r\n * @returns {undefined}\r\n */\r\nKMEANS.prototype.run = function(dataset, k) {\r\n this.init(dataset, k);\r\n\r\n var len = this.dataset.length;\r\n\r\n // initialize centroids\r\n for (var i = 0; i < this.k; i++) {\r\n this.centroids[i] = this.randomCentroid();\r\n\t}\r\n\r\n var change = true;\r\n while(change) {\r\n\r\n // assign feature vectors to clusters\r\n change = this.assign();\r\n\r\n // adjust location of centroids\r\n for (var centroidId = 0; centroidId < this.k; centroidId++) {\r\n var mean = new Array(maxDim);\r\n var count = 0;\r\n\r\n // init mean vector\r\n for (var dim = 0; dim < maxDim; dim++) {\r\n mean[dim] = 0;\r\n }\r\n\r\n for (var j = 0; j < len; j++) {\r\n var maxDim = this.dataset[j].length;\r\n\r\n // if current cluster id is assigned to point\r\n if (centroidId === this.assignments[j]) {\r\n for (var dim = 0; dim < maxDim; dim++) {\r\n mean[dim] += this.dataset[j][dim];\r\n }\r\n count++;\r\n }\r\n }\r\n\r\n if (count > 0) {\r\n // if cluster contain points, adjust centroid position\r\n for (var dim = 0; dim < maxDim; dim++) {\r\n mean[dim] /= count;\r\n }\r\n this.centroids[centroidId] = mean;\r\n } else {\r\n // if cluster is empty, generate new random centroid\r\n this.centroids[centroidId] = this.randomCentroid();\r\n change = true;\r\n }\r\n }\r\n }\r\n\r\n return this.getClusters();\r\n};\r\n\r\n/**\r\n * Generate random centroid\r\n *\r\n * @returns {Array}\r\n */\r\nKMEANS.prototype.randomCentroid = function() {\r\n var maxId = this.dataset.length -1;\r\n var centroid;\r\n var id;\r\n\r\n do {\r\n id = Math.round(Math.random() * maxId);\r\n centroid = this.dataset[id];\r\n } while (this.centroids.indexOf(centroid) >= 0);\r\n\r\n return centroid;\r\n};\r\n\r\n/**\r\n * Assign points to clusters\r\n *\r\n * @returns {boolean}\r\n */\r\nKMEANS.prototype.assign = function() {\r\n var change = false;\r\n var len = this.dataset.length;\r\n var closestCentroid;\r\n\r\n for (var i = 0; i < len; i++) {\r\n closestCentroid = this.argmin(this.dataset[i], this.centroids, this.distance);\r\n\r\n if (closestCentroid != this.assignments[i]) {\r\n this.assignments[i] = closestCentroid;\r\n change = true;\r\n }\r\n }\r\n\r\n return change;\r\n};\r\n\r\n/**\r\n * Extract information about clusters\r\n *\r\n * @returns {undefined}\r\n */\r\nKMEANS.prototype.getClusters = function() {\r\n var clusters = new Array(this.k);\r\n var centroidId;\r\n\r\n for (var pointId = 0; pointId < this.assignments.length; pointId++) {\r\n centroidId = this.assignments[pointId];\r\n\r\n // init empty cluster\r\n if (typeof clusters[centroidId] === 'undefined') {\r\n clusters[centroidId] = [];\r\n }\r\n\r\n clusters[centroidId].push(pointId);\r\n }\r\n\r\n return clusters;\r\n};\r\n\r\n// utils\r\n\r\n/**\r\n * @params {Array} point\r\n * @params {Array.} set\r\n * @params {Function} f\r\n * @returns {number}\r\n */\r\nKMEANS.prototype.argmin = function(point, set, f) {\r\n var min = Number.MAX_VALUE;\r\n var arg = 0;\r\n var len = set.length;\r\n var d;\r\n\r\n for (var i = 0; i < len; i++) {\r\n d = f(point, set[i]);\r\n if (d < min) {\r\n min = d;\r\n arg = i;\r\n }\r\n }\r\n\r\n return arg;\r\n};\r\n\r\n/**\r\n * Euclidean distance\r\n *\r\n * @params {number} p\r\n * @params {number} q\r\n * @returns {number}\r\n */\r\nKMEANS.prototype.distance = function(p, q) {\r\n var sum = 0;\r\n var i = Math.min(p.length, q.length);\r\n\r\n while (i--) {\r\n var diff = p[i] - q[i];\r\n sum += diff * diff;\r\n }\r\n\r\n return Math.sqrt(sum);\r\n};\r\n\r\nif (module.exports) {\r\n module.exports = KMEANS;\r\n}\n}(KMEANS));\n\nvar OPTICS = {exports: {}};\n\nvar PriorityQueue = {exports: {}};\n\n/**\r\n * PriorityQueue\r\n * Elements in this queue are sorted according to their value\r\n *\r\n * @author Lukasz Krawczyk \r\n * @copyright MIT\r\n */\n\n(function (module) {\n/**\r\n * PriorityQueue class construcotr\r\n * @constructor\r\n *\r\n * @example\r\n * queue: [1,2,3,4]\r\n * priorities: [4,1,2,3]\r\n * > result = [1,4,2,3]\r\n *\r\n * @param {Array} elements\r\n * @param {Array} priorities\r\n * @param {string} sorting - asc / desc\r\n * @returns {PriorityQueue}\r\n */\r\nfunction PriorityQueue(elements, priorities, sorting) {\r\n /** @type {Array} */\r\n this._queue = [];\r\n /** @type {Array} */\r\n this._priorities = [];\r\n /** @type {string} */\r\n this._sorting = 'desc';\r\n\r\n this._init(elements, priorities, sorting);\r\n}\r\n/**\r\n * Insert element\r\n *\r\n * @param {Object} ele\r\n * @param {Object} priority\r\n * @returns {undefined}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.insert = function(ele, priority) {\r\n var indexToInsert = this._queue.length;\r\n var index = indexToInsert;\r\n\r\n while (index--) {\r\n var priority2 = this._priorities[index];\r\n if (this._sorting === 'desc') {\r\n if (priority > priority2) {\r\n indexToInsert = index;\r\n }\r\n } else {\r\n if (priority < priority2) {\r\n indexToInsert = index;\r\n }\r\n }\r\n }\r\n\r\n this._insertAt(ele, priority, indexToInsert);\r\n};\r\n\r\n/**\r\n * Remove element\r\n *\r\n * @param {Object} ele\r\n * @returns {undefined}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.remove = function(ele) {\r\n var index = this._queue.length;\r\n\r\n while (index--) {\r\n var ele2 = this._queue[index];\r\n if (ele === ele2) {\r\n this._queue.splice(index, 1);\r\n this._priorities.splice(index, 1);\r\n break;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * For each loop wrapper\r\n *\r\n * @param {function} func\r\n * @returs {undefined}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.forEach = function(func) {\r\n this._queue.forEach(func);\r\n};\r\n\r\n/**\r\n * @returns {Array}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.getElements = function() {\r\n return this._queue;\r\n};\r\n\r\n/**\r\n * @param {number} index\r\n * @returns {Object}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.getElementPriority = function(index) {\r\n return this._priorities[index];\r\n};\r\n\r\n/**\r\n * @returns {Array}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.getPriorities = function() {\r\n return this._priorities;\r\n};\r\n\r\n/**\r\n * @returns {Array}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.getElementsWithPriorities = function() {\r\n var result = [];\r\n\r\n for (var i = 0, l = this._queue.length; i < l; i++) {\r\n result.push([this._queue[i], this._priorities[i]]);\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Set object properties\r\n *\r\n * @param {Array} elements\r\n * @param {Array} priorities\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nPriorityQueue.prototype._init = function(elements, priorities, sorting) {\r\n\r\n if (elements && priorities) {\r\n this._queue = [];\r\n this._priorities = [];\r\n\r\n if (elements.length !== priorities.length) {\r\n throw new Error('Arrays must have the same length');\r\n }\r\n\r\n for (var i = 0; i < elements.length; i++) {\r\n this.insert(elements[i], priorities[i]);\r\n }\r\n }\r\n\r\n if (sorting) {\r\n this._sorting = sorting;\r\n }\r\n};\r\n\r\n/**\r\n * Insert element at given position\r\n *\r\n * @param {Object} ele\r\n * @param {number} index\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nPriorityQueue.prototype._insertAt = function(ele, priority, index) {\r\n if (this._queue.length === index) {\r\n this._queue.push(ele);\r\n this._priorities.push(priority);\r\n } else {\r\n this._queue.splice(index, 0, ele);\r\n this._priorities.splice(index, 0, priority);\r\n }\r\n};\r\n\r\nif (module.exports) {\r\n module.exports = PriorityQueue;\r\n}\n}(PriorityQueue));\n\n(function (module) {\n/**\r\n * @requires ./PriorityQueue.js\r\n */\r\n\r\nif (module.exports) {\r\n var PriorityQueue$1 = PriorityQueue.exports;\r\n}\r\n\r\n/**\r\n * OPTICS - Ordering points to identify the clustering structure\r\n *\r\n * @author Lukasz Krawczyk \r\n * @copyright MIT\r\n */\r\n\r\n/**\r\n * OPTICS class constructor\r\n * @constructor\r\n *\r\n * @param {Array} dataset\r\n * @param {number} epsilon\r\n * @param {number} minPts\r\n * @param {function} distanceFunction\r\n * @returns {OPTICS}\r\n */\r\nfunction OPTICS(dataset, epsilon, minPts, distanceFunction) {\r\n /** @type {number} */\r\n this.epsilon = 1;\r\n /** @type {number} */\r\n this.minPts = 1;\r\n /** @type {function} */\r\n this.distance = this._euclideanDistance;\r\n\r\n // temporary variables used during computation\r\n\r\n /** @type {Array} */\r\n this._reachability = [];\r\n /** @type {Array} */\r\n this._processed = [];\r\n /** @type {number} */\r\n this._coreDistance = 0;\r\n /** @type {Array} */\r\n this._orderedList = [];\r\n\r\n this._init(dataset, epsilon, minPts, distanceFunction);\r\n}\r\n\r\n/******************************************************************************/\r\n// pulic functions\r\n\r\n/**\r\n * Start clustering\r\n *\r\n * @param {Array} dataset\r\n * @returns {undefined}\r\n * @access public\r\n */\r\nOPTICS.prototype.run = function(dataset, epsilon, minPts, distanceFunction) {\r\n this._init(dataset, epsilon, minPts, distanceFunction);\r\n\r\n for (var pointId = 0, l = this.dataset.length; pointId < l; pointId++) {\r\n if (this._processed[pointId] !== 1) {\r\n this._processed[pointId] = 1;\r\n this.clusters.push([pointId]);\r\n var clusterId = this.clusters.length - 1;\r\n\r\n this._orderedList.push(pointId);\r\n var priorityQueue = new PriorityQueue$1(null, null, 'asc');\r\n var neighbors = this._regionQuery(pointId);\r\n\r\n // using priority queue assign elements to new cluster\r\n if (this._distanceToCore(pointId) !== undefined) {\r\n this._updateQueue(pointId, neighbors, priorityQueue);\r\n this._expandCluster(clusterId, priorityQueue);\r\n }\r\n }\r\n }\r\n\r\n return this.clusters;\r\n};\r\n\r\n/**\r\n * Generate reachability plot for all points\r\n *\r\n * @returns {array}\r\n * @access public\r\n */\r\nOPTICS.prototype.getReachabilityPlot = function() {\r\n var reachabilityPlot = [];\r\n\r\n for (var i = 0, l = this._orderedList.length; i < l; i++) {\r\n var pointId = this._orderedList[i];\r\n var distance = this._reachability[pointId];\r\n\r\n reachabilityPlot.push([pointId, distance]);\r\n }\r\n\r\n return reachabilityPlot;\r\n};\r\n\r\n/******************************************************************************/\r\n// protected functions\r\n\r\n/**\r\n * Set object properties\r\n *\r\n * @param {Array} dataset\r\n * @param {number} epsilon\r\n * @param {number} minPts\r\n * @param {function} distance\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nOPTICS.prototype._init = function(dataset, epsilon, minPts, distance) {\r\n\r\n if (dataset) {\r\n\r\n if (!(dataset instanceof Array)) {\r\n throw Error('Dataset must be of type array, ' +\r\n typeof dataset + ' given');\r\n }\r\n\r\n this.dataset = dataset;\r\n this.clusters = [];\r\n this._reachability = new Array(this.dataset.length);\r\n this._processed = new Array(this.dataset.length);\r\n this._coreDistance = 0;\r\n this._orderedList = [];\r\n }\r\n\r\n if (epsilon) {\r\n this.epsilon = epsilon;\r\n }\r\n\r\n if (minPts) {\r\n this.minPts = minPts;\r\n }\r\n\r\n if (distance) {\r\n this.distance = distance;\r\n }\r\n};\r\n\r\n/**\r\n * Update information in queue\r\n *\r\n * @param {number} pointId\r\n * @param {Array} neighbors\r\n * @param {PriorityQueue} queue\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nOPTICS.prototype._updateQueue = function(pointId, neighbors, queue) {\r\n var self = this;\r\n\r\n this._coreDistance = this._distanceToCore(pointId);\r\n neighbors.forEach(function(pointId2) {\r\n if (self._processed[pointId2] === undefined) {\r\n var dist = self.distance(self.dataset[pointId], self.dataset[pointId2]);\r\n var newReachableDistance = Math.max(self._coreDistance, dist);\r\n\r\n if (self._reachability[pointId2] === undefined) {\r\n self._reachability[pointId2] = newReachableDistance;\r\n queue.insert(pointId2, newReachableDistance);\r\n } else {\r\n if (newReachableDistance < self._reachability[pointId2]) {\r\n self._reachability[pointId2] = newReachableDistance;\r\n queue.remove(pointId2);\r\n queue.insert(pointId2, newReachableDistance);\r\n }\r\n }\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Expand cluster\r\n *\r\n * @param {number} clusterId\r\n * @param {PriorityQueue} queue\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nOPTICS.prototype._expandCluster = function(clusterId, queue) {\r\n var queueElements = queue.getElements();\r\n\r\n for (var p = 0, l = queueElements.length; p < l; p++) {\r\n var pointId = queueElements[p];\r\n if (this._processed[pointId] === undefined) {\r\n var neighbors = this._regionQuery(pointId);\r\n this._processed[pointId] = 1;\r\n\r\n this.clusters[clusterId].push(pointId);\r\n this._orderedList.push(pointId);\r\n\r\n if (this._distanceToCore(pointId) !== undefined) {\r\n this._updateQueue(pointId, neighbors, queue);\r\n this._expandCluster(clusterId, queue);\r\n }\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Calculating distance to cluster core\r\n *\r\n * @param {number} pointId\r\n * @returns {number}\r\n * @access protected\r\n */\r\nOPTICS.prototype._distanceToCore = function(pointId) {\r\n var l = this.epsilon;\r\n for (var coreDistCand = 0; coreDistCand < l; coreDistCand++) {\r\n var neighbors = this._regionQuery(pointId, coreDistCand);\r\n if (neighbors.length >= this.minPts) {\r\n return coreDistCand;\r\n }\r\n }\r\n\r\n return;\r\n};\r\n\r\n/**\r\n * Find all neighbors around given point\r\n *\r\n * @param {number} pointId\r\n * @param {number} epsilon\r\n * @returns {Array}\r\n * @access protected\r\n */\r\nOPTICS.prototype._regionQuery = function(pointId, epsilon) {\r\n epsilon = epsilon || this.epsilon;\r\n var neighbors = [];\r\n\r\n for (var id = 0, l = this.dataset.length; id < l; id++) {\r\n if (this.distance(this.dataset[pointId], this.dataset[id]) < epsilon) {\r\n neighbors.push(id);\r\n }\r\n }\r\n\r\n return neighbors;\r\n};\r\n\r\n/******************************************************************************/\r\n// helpers\r\n\r\n/**\r\n * Calculate euclidean distance in multidimensional space\r\n *\r\n * @param {Array} p\r\n * @param {Array} q\r\n * @returns {number}\r\n * @access protected\r\n */\r\nOPTICS.prototype._euclideanDistance = function(p, q) {\r\n var sum = 0;\r\n var i = Math.min(p.length, q.length);\r\n\r\n while (i--) {\r\n sum += (p[i] - q[i]) * (p[i] - q[i]);\r\n }\r\n\r\n return Math.sqrt(sum);\r\n};\r\n\r\nif (module.exports) {\r\n module.exports = OPTICS;\r\n}\n}(OPTICS));\n\n(function (module) {\nif (module.exports) {\r\n module.exports = {\r\n DBSCAN: DBSCAN.exports,\r\n KMEANS: KMEANS.exports,\r\n OPTICS: OPTICS.exports,\r\n PriorityQueue: PriorityQueue.exports\r\n };\r\n}\n}(lib));\n\nvar clustering = lib.exports;\n\n/**\n * Takes a set of {@link Point|points} and partition them into clusters according to {@link DBSCAN's|https://en.wikipedia.org/wiki/DBSCAN} data clustering algorithm.\n *\n * @name clustersDbscan\n * @param {FeatureCollection} points to be clustered\n * @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers only)\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units=\"kilometers\"] in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers\n * @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated\n * @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,\n * points which do not meet this requirement will be classified as an 'edge' or 'noise'.\n * @returns {FeatureCollection} Clustered Points with an additional two properties associated to each Feature:\n * - {number} cluster - the associated clusterId\n * - {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')\n * @example\n * // create random points with random z-values in their properties\n * var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});\n * var maxDistance = 100;\n * var clustered = turf.clustersDbscan(points, maxDistance);\n *\n * //addToMap\n * var addToMap = [clustered];\n */\nfunction clustersDbscan(points, maxDistance, options) {\n // Input validation being handled by Typescript\n // collectionOf(points, 'Point', 'points must consist of a FeatureCollection of only Points');\n // if (maxDistance === null || maxDistance === undefined) throw new Error('maxDistance is required');\n // if (!(Math.sign(maxDistance) > 0)) throw new Error('maxDistance is invalid');\n // if (!(minPoints === undefined || minPoints === null || Math.sign(minPoints) > 0)) throw new Error('options.minPoints is invalid');\n if (options === void 0) { options = {}; }\n // Clone points to prevent any mutations\n if (options.mutate !== true)\n points = clone(points);\n // Defaults\n options.minPoints = options.minPoints || 3;\n // create clustered ids\n var dbscan = new clustering.DBSCAN();\n var clusteredIds = dbscan.run(coordAll(points), convertLength(maxDistance, options.units), options.minPoints, distance);\n // Tag points to Clusters ID\n var clusterId = -1;\n clusteredIds.forEach(function (clusterIds) {\n clusterId++;\n // assign cluster ids to input points\n clusterIds.forEach(function (idx) {\n var clusterPoint = points.features[idx];\n if (!clusterPoint.properties)\n clusterPoint.properties = {};\n clusterPoint.properties.cluster = clusterId;\n clusterPoint.properties.dbscan = \"core\";\n });\n });\n // handle noise points, if any\n // edges points are tagged by DBSCAN as both 'noise' and 'cluster' as they can \"reach\" less than 'minPoints' number of points\n dbscan.noise.forEach(function (noiseId) {\n var noisePoint = points.features[noiseId];\n if (!noisePoint.properties)\n noisePoint.properties = {};\n if (noisePoint.properties.cluster)\n noisePoint.properties.dbscan = \"edge\";\n else\n noisePoint.properties.dbscan = \"noise\";\n });\n return points;\n}\n\nvar supercluster = {exports: {}};\n\n(function (module, exports) {\n(function (global, factory) {\nmodule.exports = factory() ;\n})(commonjsGlobal, (function () {\nfunction sortKD(ids, coords, nodeSize, left, right, depth) {\n if (right - left <= nodeSize) { return; }\n\n var m = (left + right) >> 1;\n\n select(ids, coords, m, left, right, depth % 2);\n\n sortKD(ids, coords, nodeSize, left, m - 1, depth + 1);\n sortKD(ids, coords, nodeSize, m + 1, right, depth + 1);\n}\n\nfunction select(ids, coords, k, left, right, inc) {\n\n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n select(ids, coords, k, newLeft, newRight, inc);\n }\n\n var t = coords[2 * k + inc];\n var i = left;\n var j = right;\n\n swapItem(ids, coords, left, k);\n if (coords[2 * right + inc] > t) { swapItem(ids, coords, left, right); }\n\n while (i < j) {\n swapItem(ids, coords, i, j);\n i++;\n j--;\n while (coords[2 * i + inc] < t) { i++; }\n while (coords[2 * j + inc] > t) { j--; }\n }\n\n if (coords[2 * left + inc] === t) { swapItem(ids, coords, left, j); }\n else {\n j++;\n swapItem(ids, coords, j, right);\n }\n\n if (j <= k) { left = j + 1; }\n if (k <= j) { right = j - 1; }\n }\n}\n\nfunction swapItem(ids, coords, i, j) {\n swap(ids, i, j);\n swap(coords, 2 * i, 2 * j);\n swap(coords, 2 * i + 1, 2 * j + 1);\n}\n\nfunction swap(arr, i, j) {\n var tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction range(ids, coords, minX, minY, maxX, maxY, nodeSize) {\n var stack = [0, ids.length - 1, 0];\n var result = [];\n var x, y;\n\n while (stack.length) {\n var axis = stack.pop();\n var right = stack.pop();\n var left = stack.pop();\n\n if (right - left <= nodeSize) {\n for (var i = left; i <= right; i++) {\n x = coords[2 * i];\n y = coords[2 * i + 1];\n if (x >= minX && x <= maxX && y >= minY && y <= maxY) { result.push(ids[i]); }\n }\n continue;\n }\n\n var m = Math.floor((left + right) / 2);\n\n x = coords[2 * m];\n y = coords[2 * m + 1];\n\n if (x >= minX && x <= maxX && y >= minY && y <= maxY) { result.push(ids[m]); }\n\n var nextAxis = (axis + 1) % 2;\n\n if (axis === 0 ? minX <= x : minY <= y) {\n stack.push(left);\n stack.push(m - 1);\n stack.push(nextAxis);\n }\n if (axis === 0 ? maxX >= x : maxY >= y) {\n stack.push(m + 1);\n stack.push(right);\n stack.push(nextAxis);\n }\n }\n\n return result;\n}\n\nfunction within(ids, coords, qx, qy, r, nodeSize) {\n var stack = [0, ids.length - 1, 0];\n var result = [];\n var r2 = r * r;\n\n while (stack.length) {\n var axis = stack.pop();\n var right = stack.pop();\n var left = stack.pop();\n\n if (right - left <= nodeSize) {\n for (var i = left; i <= right; i++) {\n if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) { result.push(ids[i]); }\n }\n continue;\n }\n\n var m = Math.floor((left + right) / 2);\n\n var x = coords[2 * m];\n var y = coords[2 * m + 1];\n\n if (sqDist(x, y, qx, qy) <= r2) { result.push(ids[m]); }\n\n var nextAxis = (axis + 1) % 2;\n\n if (axis === 0 ? qx - r <= x : qy - r <= y) {\n stack.push(left);\n stack.push(m - 1);\n stack.push(nextAxis);\n }\n if (axis === 0 ? qx + r >= x : qy + r >= y) {\n stack.push(m + 1);\n stack.push(right);\n stack.push(nextAxis);\n }\n }\n\n return result;\n}\n\nfunction sqDist(ax, ay, bx, by) {\n var dx = ax - bx;\n var dy = ay - by;\n return dx * dx + dy * dy;\n}\n\nvar defaultGetX = function (p) { return p[0]; };\nvar defaultGetY = function (p) { return p[1]; };\n\nvar KDBush = function KDBush(points, getX, getY, nodeSize, ArrayType) {\n if ( getX === void 0 ) getX = defaultGetX;\n if ( getY === void 0 ) getY = defaultGetY;\n if ( nodeSize === void 0 ) nodeSize = 64;\n if ( ArrayType === void 0 ) ArrayType = Float64Array;\n\n this.nodeSize = nodeSize;\n this.points = points;\n\n var IndexArrayType = points.length < 65536 ? Uint16Array : Uint32Array;\n\n var ids = this.ids = new IndexArrayType(points.length);\n var coords = this.coords = new ArrayType(points.length * 2);\n\n for (var i = 0; i < points.length; i++) {\n ids[i] = i;\n coords[2 * i] = getX(points[i]);\n coords[2 * i + 1] = getY(points[i]);\n }\n\n sortKD(ids, coords, nodeSize, 0, ids.length - 1, 0);\n};\n\nKDBush.prototype.range = function range$1 (minX, minY, maxX, maxY) {\n return range(this.ids, this.coords, minX, minY, maxX, maxY, this.nodeSize);\n};\n\nKDBush.prototype.within = function within$1 (x, y, r) {\n return within(this.ids, this.coords, x, y, r, this.nodeSize);\n};\n\nvar defaultOptions = {\n minZoom: 0, // min zoom to generate clusters on\n maxZoom: 16, // max zoom level to cluster the points on\n minPoints: 2, // minimum points to form a cluster\n radius: 40, // cluster radius in pixels\n extent: 512, // tile extent (radius is calculated relative to it)\n nodeSize: 64, // size of the KD-tree leaf node, affects performance\n log: false, // whether to log timing info\n\n // whether to generate numeric ids for input features (in vector tiles)\n generateId: false,\n\n // a reduce function for calculating custom cluster properties\n reduce: null, // (accumulated, props) => { accumulated.sum += props.sum; }\n\n // properties to use for individual points when running the reducer\n map: function (props) { return props; } // props => ({sum: props.my_value})\n};\n\nvar fround = Math.fround || (function (tmp) { return (function (x) { tmp[0] = +x; return tmp[0]; }); })(new Float32Array(1));\n\nvar Supercluster = function Supercluster(options) {\n this.options = extend(Object.create(defaultOptions), options);\n this.trees = new Array(this.options.maxZoom + 1);\n};\n\nSupercluster.prototype.load = function load (points) {\n var ref = this.options;\n var log = ref.log;\n var minZoom = ref.minZoom;\n var maxZoom = ref.maxZoom;\n var nodeSize = ref.nodeSize;\n\n if (log) { console.time('total time'); }\n\n var timerId = \"prepare \" + (points.length) + \" points\";\n if (log) { console.time(timerId); }\n\n this.points = points;\n\n // generate a cluster object for each point and index input points into a KD-tree\n var clusters = [];\n for (var i = 0; i < points.length; i++) {\n if (!points[i].geometry) { continue; }\n clusters.push(createPointCluster(points[i], i));\n }\n this.trees[maxZoom + 1] = new KDBush(clusters, getX, getY, nodeSize, Float32Array);\n\n if (log) { console.timeEnd(timerId); }\n\n // cluster points on max zoom, then cluster the results on previous zoom, etc.;\n // results in a cluster hierarchy across zoom levels\n for (var z = maxZoom; z >= minZoom; z--) {\n var now = +Date.now();\n\n // create a new set of clusters for the zoom and index them with a KD-tree\n clusters = this._cluster(clusters, z);\n this.trees[z] = new KDBush(clusters, getX, getY, nodeSize, Float32Array);\n\n if (log) { console.log('z%d: %d clusters in %dms', z, clusters.length, +Date.now() - now); }\n }\n\n if (log) { console.timeEnd('total time'); }\n\n return this;\n};\n\nSupercluster.prototype.getClusters = function getClusters (bbox, zoom) {\n var minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180;\n var minLat = Math.max(-90, Math.min(90, bbox[1]));\n var maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180;\n var maxLat = Math.max(-90, Math.min(90, bbox[3]));\n\n if (bbox[2] - bbox[0] >= 360) {\n minLng = -180;\n maxLng = 180;\n } else if (minLng > maxLng) {\n var easternHem = this.getClusters([minLng, minLat, 180, maxLat], zoom);\n var westernHem = this.getClusters([-180, minLat, maxLng, maxLat], zoom);\n return easternHem.concat(westernHem);\n }\n\n var tree = this.trees[this._limitZoom(zoom)];\n var ids = tree.range(lngX(minLng), latY(maxLat), lngX(maxLng), latY(minLat));\n var clusters = [];\n for (var i = 0, list = ids; i < list.length; i += 1) {\n var id = list[i];\n\n var c = tree.points[id];\n clusters.push(c.numPoints ? getClusterJSON(c) : this.points[c.index]);\n }\n return clusters;\n};\n\nSupercluster.prototype.getChildren = function getChildren (clusterId) {\n var originId = this._getOriginId(clusterId);\n var originZoom = this._getOriginZoom(clusterId);\n var errorMsg = 'No cluster with the specified id.';\n\n var index = this.trees[originZoom];\n if (!index) { throw new Error(errorMsg); }\n\n var origin = index.points[originId];\n if (!origin) { throw new Error(errorMsg); }\n\n var r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1));\n var ids = index.within(origin.x, origin.y, r);\n var children = [];\n for (var i = 0, list = ids; i < list.length; i += 1) {\n var id = list[i];\n\n var c = index.points[id];\n if (c.parentId === clusterId) {\n children.push(c.numPoints ? getClusterJSON(c) : this.points[c.index]);\n }\n }\n\n if (children.length === 0) { throw new Error(errorMsg); }\n\n return children;\n};\n\nSupercluster.prototype.getLeaves = function getLeaves (clusterId, limit, offset) {\n limit = limit || 10;\n offset = offset || 0;\n\n var leaves = [];\n this._appendLeaves(leaves, clusterId, limit, offset, 0);\n\n return leaves;\n};\n\nSupercluster.prototype.getTile = function getTile (z, x, y) {\n var tree = this.trees[this._limitZoom(z)];\n var z2 = Math.pow(2, z);\n var ref = this.options;\n var extent = ref.extent;\n var radius = ref.radius;\n var p = radius / extent;\n var top = (y - p) / z2;\n var bottom = (y + 1 + p) / z2;\n\n var tile = {\n features: []\n };\n\n this._addTileFeatures(\n tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom),\n tree.points, x, y, z2, tile);\n\n if (x === 0) {\n this._addTileFeatures(\n tree.range(1 - p / z2, top, 1, bottom),\n tree.points, z2, y, z2, tile);\n }\n if (x === z2 - 1) {\n this._addTileFeatures(\n tree.range(0, top, p / z2, bottom),\n tree.points, -1, y, z2, tile);\n }\n\n return tile.features.length ? tile : null;\n};\n\nSupercluster.prototype.getClusterExpansionZoom = function getClusterExpansionZoom (clusterId) {\n var expansionZoom = this._getOriginZoom(clusterId) - 1;\n while (expansionZoom <= this.options.maxZoom) {\n var children = this.getChildren(clusterId);\n expansionZoom++;\n if (children.length !== 1) { break; }\n clusterId = children[0].properties.cluster_id;\n }\n return expansionZoom;\n};\n\nSupercluster.prototype._appendLeaves = function _appendLeaves (result, clusterId, limit, offset, skipped) {\n var children = this.getChildren(clusterId);\n\n for (var i = 0, list = children; i < list.length; i += 1) {\n var child = list[i];\n\n var props = child.properties;\n\n if (props && props.cluster) {\n if (skipped + props.point_count <= offset) {\n // skip the whole cluster\n skipped += props.point_count;\n } else {\n // enter the cluster\n skipped = this._appendLeaves(result, props.cluster_id, limit, offset, skipped);\n // exit the cluster\n }\n } else if (skipped < offset) {\n // skip a single point\n skipped++;\n } else {\n // add a single point\n result.push(child);\n }\n if (result.length === limit) { break; }\n }\n\n return skipped;\n};\n\nSupercluster.prototype._addTileFeatures = function _addTileFeatures (ids, points, x, y, z2, tile) {\n for (var i$1 = 0, list = ids; i$1 < list.length; i$1 += 1) {\n var i = list[i$1];\n\n var c = points[i];\n var isCluster = c.numPoints;\n\n var tags = (void 0), px = (void 0), py = (void 0);\n if (isCluster) {\n tags = getClusterProperties(c);\n px = c.x;\n py = c.y;\n } else {\n var p = this.points[c.index];\n tags = p.properties;\n px = lngX(p.geometry.coordinates[0]);\n py = latY(p.geometry.coordinates[1]);\n }\n\n var f = {\n type: 1,\n geometry: [[\n Math.round(this.options.extent * (px * z2 - x)),\n Math.round(this.options.extent * (py * z2 - y))\n ]],\n tags: tags\n };\n\n // assign id\n var id = (void 0);\n if (isCluster) {\n id = c.id;\n } else if (this.options.generateId) {\n // optionally generate id\n id = c.index;\n } else if (this.points[c.index].id) {\n // keep id if already assigned\n id = this.points[c.index].id;\n }\n\n if (id !== undefined) { f.id = id; }\n\n tile.features.push(f);\n }\n};\n\nSupercluster.prototype._limitZoom = function _limitZoom (z) {\n return Math.max(this.options.minZoom, Math.min(+z, this.options.maxZoom + 1));\n};\n\nSupercluster.prototype._cluster = function _cluster (points, zoom) {\n var clusters = [];\n var ref = this.options;\n var radius = ref.radius;\n var extent = ref.extent;\n var reduce = ref.reduce;\n var minPoints = ref.minPoints;\n var r = radius / (extent * Math.pow(2, zoom));\n\n // loop through each point\n for (var i = 0; i < points.length; i++) {\n var p = points[i];\n // if we've already visited the point at this zoom level, skip it\n if (p.zoom <= zoom) { continue; }\n p.zoom = zoom;\n\n // find all nearby points\n var tree = this.trees[zoom + 1];\n var neighborIds = tree.within(p.x, p.y, r);\n\n var numPointsOrigin = p.numPoints || 1;\n var numPoints = numPointsOrigin;\n\n // count the number of points in a potential cluster\n for (var i$1 = 0, list = neighborIds; i$1 < list.length; i$1 += 1) {\n var neighborId = list[i$1];\n\n var b = tree.points[neighborId];\n // filter out neighbors that are already processed\n if (b.zoom > zoom) { numPoints += b.numPoints || 1; }\n }\n\n // if there were neighbors to merge, and there are enough points to form a cluster\n if (numPoints > numPointsOrigin && numPoints >= minPoints) {\n var wx = p.x * numPointsOrigin;\n var wy = p.y * numPointsOrigin;\n\n var clusterProperties = reduce && numPointsOrigin > 1 ? this._map(p, true) : null;\n\n // encode both zoom and point index on which the cluster originated -- offset by total length of features\n var id = (i << 5) + (zoom + 1) + this.points.length;\n\n for (var i$2 = 0, list$1 = neighborIds; i$2 < list$1.length; i$2 += 1) {\n var neighborId$1 = list$1[i$2];\n\n var b$1 = tree.points[neighborId$1];\n\n if (b$1.zoom <= zoom) { continue; }\n b$1.zoom = zoom; // save the zoom (so it doesn't get processed twice)\n\n var numPoints2 = b$1.numPoints || 1;\n wx += b$1.x * numPoints2; // accumulate coordinates for calculating weighted center\n wy += b$1.y * numPoints2;\n\n b$1.parentId = id;\n\n if (reduce) {\n if (!clusterProperties) { clusterProperties = this._map(p, true); }\n reduce(clusterProperties, this._map(b$1));\n }\n }\n\n p.parentId = id;\n clusters.push(createCluster(wx / numPoints, wy / numPoints, id, numPoints, clusterProperties));\n\n } else { // left points as unclustered\n clusters.push(p);\n\n if (numPoints > 1) {\n for (var i$3 = 0, list$2 = neighborIds; i$3 < list$2.length; i$3 += 1) {\n var neighborId$2 = list$2[i$3];\n\n var b$2 = tree.points[neighborId$2];\n if (b$2.zoom <= zoom) { continue; }\n b$2.zoom = zoom;\n clusters.push(b$2);\n }\n }\n }\n }\n\n return clusters;\n};\n\n// get index of the point from which the cluster originated\nSupercluster.prototype._getOriginId = function _getOriginId (clusterId) {\n return (clusterId - this.points.length) >> 5;\n};\n\n// get zoom of the point from which the cluster originated\nSupercluster.prototype._getOriginZoom = function _getOriginZoom (clusterId) {\n return (clusterId - this.points.length) % 32;\n};\n\nSupercluster.prototype._map = function _map (point, clone) {\n if (point.numPoints) {\n return clone ? extend({}, point.properties) : point.properties;\n }\n var original = this.points[point.index].properties;\n var result = this.options.map(original);\n return clone && result === original ? extend({}, result) : result;\n};\n\nfunction createCluster(x, y, id, numPoints, properties) {\n return {\n x: fround(x), // weighted cluster center; round for consistency with Float32Array index\n y: fround(y),\n zoom: Infinity, // the last zoom the cluster was processed at\n id: id, // encodes index of the first child of the cluster and its zoom level\n parentId: -1, // parent cluster id\n numPoints: numPoints,\n properties: properties\n };\n}\n\nfunction createPointCluster(p, id) {\n var ref = p.geometry.coordinates;\n var x = ref[0];\n var y = ref[1];\n return {\n x: fround(lngX(x)), // projected point coordinates\n y: fround(latY(y)),\n zoom: Infinity, // the last zoom the point was processed at\n index: id, // index of the source feature in the original input array,\n parentId: -1 // parent cluster id\n };\n}\n\nfunction getClusterJSON(cluster) {\n return {\n type: 'Feature',\n id: cluster.id,\n properties: getClusterProperties(cluster),\n geometry: {\n type: 'Point',\n coordinates: [xLng(cluster.x), yLat(cluster.y)]\n }\n };\n}\n\nfunction getClusterProperties(cluster) {\n var count = cluster.numPoints;\n var abbrev =\n count >= 10000 ? ((Math.round(count / 1000)) + \"k\") :\n count >= 1000 ? ((Math.round(count / 100) / 10) + \"k\") : count;\n return extend(extend({}, cluster.properties), {\n cluster: true,\n cluster_id: cluster.id,\n point_count: count,\n point_count_abbreviated: abbrev\n });\n}\n\n// longitude/latitude to spherical mercator in [0..1] range\nfunction lngX(lng) {\n return lng / 360 + 0.5;\n}\nfunction latY(lat) {\n var sin = Math.sin(lat * Math.PI / 180);\n var y = (0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI);\n return y < 0 ? 0 : y > 1 ? 1 : y;\n}\n\n// spherical mercator to longitude/latitude\nfunction xLng(x) {\n return (x - 0.5) * 360;\n}\nfunction yLat(y) {\n var y2 = (180 - y * 360) * Math.PI / 180;\n return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;\n}\n\nfunction extend(dest, src) {\n for (var id in src) { dest[id] = src[id]; }\n return dest;\n}\n\nfunction getX(p) {\n return p.x;\n}\nfunction getY(p) {\n return p.y;\n}\n\nreturn Supercluster;\n\n}));\n}(supercluster));\n\nvar SuperCluster = supercluster.exports;\n\nvar es6 = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n if ((a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n for (i of a.entries())\n if (!b.has(i[0])) return false;\n for (i of a.entries())\n if (!equal(i[1], b.get(i[0]))) return false;\n return true;\n }\n\n if ((a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n for (i of a.entries())\n if (!b.has(i[0])) return false;\n return true;\n }\n\n if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\n\n/**\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nclass Cluster {\r\n constructor({ markers, position }) {\r\n this.markers = markers;\r\n if (position) {\r\n if (position instanceof google.maps.LatLng) {\r\n this._position = position;\r\n }\r\n else {\r\n this._position = new google.maps.LatLng(position);\r\n }\r\n }\r\n }\r\n get bounds() {\r\n if (this.markers.length === 0 && !this._position) {\r\n return undefined;\r\n }\r\n return this.markers.reduce((bounds, marker) => {\r\n return bounds.extend(marker.getPosition());\r\n }, new google.maps.LatLngBounds(this._position, this._position));\r\n }\r\n get position() {\r\n return this._position || this.bounds.getCenter();\r\n }\r\n /**\r\n * Get the count of **visible** markers.\r\n */\r\n get count() {\r\n return this.markers.filter((m) => m.getVisible())\r\n .length;\r\n }\r\n /**\r\n * Add a marker to the cluster.\r\n */\r\n push(marker) {\r\n this.markers.push(marker);\r\n }\r\n /**\r\n * Cleanup references and remove marker from map.\r\n */\r\n delete() {\r\n if (this.marker) {\r\n this.marker.setMap(null);\r\n delete this.marker;\r\n }\r\n this.markers.length = 0;\r\n }\r\n}\n\n/**\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst filterMarkersToPaddedViewport = (map, mapCanvasProjection, markers, viewportPadding) => {\r\n const extendedMapBounds = extendBoundsToPaddedViewport(map.getBounds(), mapCanvasProjection, viewportPadding);\r\n return markers.filter((marker) => extendedMapBounds.contains(marker.getPosition()));\r\n};\r\n/**\r\n * Extends a bounds by a number of pixels in each direction.\r\n */\r\nconst extendBoundsToPaddedViewport = (bounds, projection, pixels) => {\r\n const { northEast, southWest } = latLngBoundsToPixelBounds(bounds, projection);\r\n const extendedPixelBounds = extendPixelBounds({ northEast, southWest }, pixels);\r\n return pixelBoundsToLatLngBounds(extendedPixelBounds, projection);\r\n};\r\n/**\r\n * @hidden\r\n */\r\nconst distanceBetweenPoints = (p1, p2) => {\r\n const R = 6371; // Radius of the Earth in km\r\n const dLat = ((p2.lat - p1.lat) * Math.PI) / 180;\r\n const dLon = ((p2.lng - p1.lng) * Math.PI) / 180;\r\n const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\r\n Math.cos((p1.lat * Math.PI) / 180) *\r\n Math.cos((p2.lat * Math.PI) / 180) *\r\n Math.sin(dLon / 2) *\r\n Math.sin(dLon / 2);\r\n const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\r\n return R * c;\r\n};\r\n/**\r\n * @hidden\r\n */\r\nconst latLngBoundsToPixelBounds = (bounds, projection) => {\r\n return {\r\n northEast: projection.fromLatLngToDivPixel(bounds.getNorthEast()),\r\n southWest: projection.fromLatLngToDivPixel(bounds.getSouthWest()),\r\n };\r\n};\r\n/**\r\n * @hidden\r\n */\r\nconst extendPixelBounds = ({ northEast, southWest }, pixels) => {\r\n northEast.x += pixels;\r\n northEast.y -= pixels;\r\n southWest.x -= pixels;\r\n southWest.y += pixels;\r\n return { northEast, southWest };\r\n};\r\n/**\r\n * @hidden\r\n */\r\nconst pixelBoundsToLatLngBounds = ({ northEast, southWest }, projection) => {\r\n const bounds = new google.maps.LatLngBounds();\r\n bounds.extend(projection.fromDivPixelToLatLng(northEast));\r\n bounds.extend(projection.fromDivPixelToLatLng(southWest));\r\n return bounds;\r\n};\n\n/**\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @hidden\r\n */\r\nclass AbstractAlgorithm {\r\n constructor({ maxZoom = 16 }) {\r\n this.maxZoom = maxZoom;\r\n }\r\n /**\r\n * Helper function to bypass clustering based upon some map state such as\r\n * zoom, number of markers, etc.\r\n *\r\n * ```typescript\r\n * cluster({markers, map}: AlgorithmInput): Cluster[] {\r\n * if (shouldBypassClustering(map)) {\r\n * return this.noop({markers, map})\r\n * }\r\n * }\r\n * ```\r\n */\r\n noop({ markers }) {\r\n return noop$1(markers);\r\n }\r\n}\r\n/**\r\n * Abstract viewport algorithm proves a class to filter markers by a padded\r\n * viewport. This is a common optimization.\r\n *\r\n * @hidden\r\n */\r\nclass AbstractViewportAlgorithm extends AbstractAlgorithm {\r\n constructor(_a) {\r\n var { viewportPadding = 60 } = _a, options = __rest(_a, [\"viewportPadding\"]);\r\n super(options);\r\n this.viewportPadding = 60;\r\n this.viewportPadding = viewportPadding;\r\n }\r\n calculate({ markers, map, mapCanvasProjection, }) {\r\n if (map.getZoom() >= this.maxZoom) {\r\n return {\r\n clusters: this.noop({\r\n markers,\r\n map,\r\n mapCanvasProjection,\r\n }),\r\n changed: false,\r\n };\r\n }\r\n return {\r\n clusters: this.cluster({\r\n markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding),\r\n map,\r\n mapCanvasProjection,\r\n }),\r\n };\r\n }\r\n}\r\n/**\r\n * @hidden\r\n */\r\nconst noop$1 = (markers) => {\r\n const clusters = markers.map((marker) => new Cluster({\r\n position: marker.getPosition(),\r\n markers: [marker],\r\n }));\r\n return clusters;\r\n};\n\n/**\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * The default Grid algorithm historically used in Google Maps marker\r\n * clustering.\r\n *\r\n * The Grid algorithm does not implement caching and markers may flash as the\r\n * viewport changes. Instead use {@link SuperClusterAlgorithm}.\r\n */\r\nclass GridAlgorithm extends AbstractViewportAlgorithm {\r\n constructor(_a) {\r\n var { maxDistance = 40000, gridSize = 40 } = _a, options = __rest(_a, [\"maxDistance\", \"gridSize\"]);\r\n super(options);\r\n this.clusters = [];\r\n this.maxDistance = maxDistance;\r\n this.gridSize = gridSize;\r\n }\r\n cluster({ markers, map, mapCanvasProjection, }) {\r\n this.clusters = [];\r\n markers.forEach((marker) => {\r\n this.addToClosestCluster(marker, map, mapCanvasProjection);\r\n });\r\n return this.clusters;\r\n }\r\n addToClosestCluster(marker, map, projection) {\r\n let maxDistance = this.maxDistance; // Some large number\r\n let cluster = null;\r\n for (let i = 0; i < this.clusters.length; i++) {\r\n const candidate = this.clusters[i];\r\n const distance = distanceBetweenPoints(candidate.bounds.getCenter().toJSON(), marker.getPosition().toJSON());\r\n if (distance < maxDistance) {\r\n maxDistance = distance;\r\n cluster = candidate;\r\n }\r\n }\r\n if (cluster &&\r\n extendBoundsToPaddedViewport(cluster.bounds, projection, this.gridSize).contains(marker.getPosition())) {\r\n cluster.push(marker);\r\n }\r\n else {\r\n const cluster = new Cluster({ markers: [marker] });\r\n this.clusters.push(cluster);\r\n }\r\n }\r\n}\n\n/**\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Noop algorithm does not generate any clusters or filter markers by the an extended viewport.\r\n */\r\nclass NoopAlgorithm extends AbstractAlgorithm {\r\n constructor(_a) {\r\n var options = __rest(_a, []);\r\n super(options);\r\n }\r\n calculate({ markers, map, mapCanvasProjection, }) {\r\n return {\r\n clusters: this.cluster({ markers, map, mapCanvasProjection }),\r\n changed: false,\r\n };\r\n }\r\n cluster(input) {\r\n return this.noop(input);\r\n }\r\n}\n\n/**\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Experimental algorithm using Kmeans.\r\n *\r\n * The Grid algorithm does not implement caching and markers may flash as the\r\n * viewport changes. Instead use {@link SuperClusterAlgorithm}.\r\n *\r\n * @see https://www.npmjs.com/package/@turf/clusters-kmeans\r\n */\r\nclass KmeansAlgorithm extends AbstractViewportAlgorithm {\r\n constructor(_a) {\r\n var { numberOfClusters } = _a, options = __rest(_a, [\"numberOfClusters\"]);\r\n super(options);\r\n this.numberOfClusters = numberOfClusters;\r\n }\r\n cluster({ markers, map }) {\r\n const clusters = [];\r\n if (markers.length === 0) {\r\n return clusters;\r\n }\r\n const points = featureCollection(markers.map((marker) => {\r\n return point([marker.getPosition().lng(), marker.getPosition().lat()]);\r\n }));\r\n let numberOfClusters;\r\n if (this.numberOfClusters instanceof Function) {\r\n numberOfClusters = this.numberOfClusters(markers.length, map.getZoom());\r\n }\r\n else {\r\n numberOfClusters = this.numberOfClusters;\r\n }\r\n clustersKmeans(points, { numberOfClusters }).features.forEach((point, i) => {\r\n if (!clusters[point.properties.cluster]) {\r\n clusters[point.properties.cluster] = new Cluster({\r\n position: {\r\n lng: point.properties.centroid[0],\r\n lat: point.properties.centroid[1],\r\n },\r\n markers: [],\r\n });\r\n }\r\n clusters[point.properties.cluster].push(markers[i]);\r\n });\r\n return clusters;\r\n }\r\n}\n\n/**\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst DEFAULT_INTERNAL_DBSCAN_OPTION = {\r\n units: \"kilometers\",\r\n mutate: false,\r\n minPoints: 1,\r\n};\r\n/**\r\n *\r\n * **This algorithm is not yet ready for use!**\r\n *\r\n * Experimental algorithm using DBScan.\r\n *\r\n * The Grid algorithm does not implement caching and markers may flash as the\r\n * viewport changes. Instead use {@link SuperClusterAlgorithm}.\r\n *\r\n * @see https://www.npmjs.com/package/@turf/clusters-dbscan\r\n */\r\nclass DBScanAlgorithm extends AbstractViewportAlgorithm {\r\n constructor(_a) {\r\n var { maxDistance = 200, minPoints = DEFAULT_INTERNAL_DBSCAN_OPTION.minPoints } = _a, options = __rest(_a, [\"maxDistance\", \"minPoints\"]);\r\n super(options);\r\n this.maxDistance = maxDistance;\r\n this.options = Object.assign(Object.assign({}, DEFAULT_INTERNAL_DBSCAN_OPTION), { minPoints });\r\n }\r\n cluster({ markers, mapCanvasProjection, }) {\r\n const points = featureCollection(markers.map((marker) => {\r\n const projectedPoint = mapCanvasProjection.fromLatLngToContainerPixel(marker.getPosition());\r\n return point([projectedPoint.x, projectedPoint.y]);\r\n }));\r\n const grouped = [];\r\n clustersDbscan(points, this.maxDistance, this.options).features.forEach((point, i) => {\r\n if (!grouped[point.properties.cluster]) {\r\n grouped[point.properties.cluster] = [];\r\n }\r\n grouped[point.properties.cluster].push(markers[i]);\r\n });\r\n return grouped.map((markers) => new Cluster({ markers }));\r\n }\r\n}\n\n/**\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A very fast JavaScript algorithm for geospatial point clustering using KD trees.\r\n *\r\n * @see https://www.npmjs.com/package/supercluster for more information on options.\r\n */\r\nclass SuperClusterAlgorithm extends AbstractAlgorithm {\r\n constructor(_a) {\r\n var { maxZoom, radius = 60 } = _a, options = __rest(_a, [\"maxZoom\", \"radius\"]);\r\n super({ maxZoom });\r\n this.superCluster = new SuperCluster(Object.assign({ maxZoom: this.maxZoom, radius }, options));\r\n this.state = { zoom: null };\r\n }\r\n calculate(input) {\r\n let changed = false;\r\n if (!es6(input.markers, this.markers)) {\r\n changed = true;\r\n // TODO use proxy to avoid copy?\r\n this.markers = [...input.markers];\r\n const points = this.markers.map((marker) => {\r\n return {\r\n type: \"Feature\",\r\n geometry: {\r\n type: \"Point\",\r\n coordinates: [\r\n marker.getPosition().lng(),\r\n marker.getPosition().lat(),\r\n ],\r\n },\r\n properties: { marker },\r\n };\r\n });\r\n this.superCluster.load(points);\r\n }\r\n const state = { zoom: input.map.getZoom() };\r\n if (!changed) {\r\n if (this.state.zoom > this.maxZoom && state.zoom > this.maxZoom) ;\r\n else {\r\n changed = changed || !es6(this.state, state);\r\n }\r\n }\r\n this.state = state;\r\n if (changed) {\r\n this.clusters = this.cluster(input);\r\n }\r\n return { clusters: this.clusters, changed };\r\n }\r\n cluster({ map }) {\r\n return this.superCluster\r\n .getClusters([-180, -90, 180, 90], map.getZoom())\r\n .map(this.transformCluster.bind(this));\r\n }\r\n transformCluster({ geometry: { coordinates: [lng, lat], }, properties, }) {\r\n if (properties.cluster) {\r\n return new Cluster({\r\n markers: this.superCluster\r\n .getLeaves(properties.cluster_id, Infinity)\r\n .map((leaf) => leaf.properties.marker),\r\n position: new google.maps.LatLng({ lat, lng }),\r\n });\r\n }\r\n else {\r\n const marker = properties.marker;\r\n return new Cluster({\r\n markers: [marker],\r\n position: marker.getPosition(),\r\n });\r\n }\r\n }\r\n}\n\n/**\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provides statistics on all clusters in the current render cycle for use in {@link Renderer.render}.\r\n */\r\nclass ClusterStats {\r\n constructor(markers, clusters) {\r\n this.markers = { sum: markers.length };\r\n const clusterMarkerCounts = clusters.map((a) => a.count);\r\n const clusterMarkerSum = clusterMarkerCounts.reduce((a, b) => a + b, 0);\r\n this.clusters = {\r\n count: clusters.length,\r\n markers: {\r\n mean: clusterMarkerSum / clusters.length,\r\n sum: clusterMarkerSum,\r\n min: Math.min(...clusterMarkerCounts),\r\n max: Math.max(...clusterMarkerCounts),\r\n },\r\n };\r\n }\r\n}\r\nclass DefaultRenderer {\r\n /**\r\n * The default render function for the library used by {@link MarkerClusterer}.\r\n *\r\n * Currently set to use the following:\r\n *\r\n * ```typescript\r\n * // change color if this cluster has more markers than the mean cluster\r\n * const color =\r\n * count > Math.max(10, stats.clusters.markers.mean)\r\n * ? \"#ff0000\"\r\n * : \"#0000ff\";\r\n *\r\n * // create svg url with fill color\r\n * const svg = window.btoa(`\r\n * \r\n * \r\n * \r\n * \r\n * \r\n * `);\r\n *\r\n * // create marker using svg icon\r\n * return new google.maps.Marker({\r\n * position,\r\n * icon: {\r\n * url: `data:image/svg+xml;base64,${svg}`,\r\n * scaledSize: new google.maps.Size(45, 45),\r\n * },\r\n * label: {\r\n * text: String(count),\r\n * color: \"rgba(255,255,255,0.9)\",\r\n * fontSize: \"12px\",\r\n * },\r\n * // adjust zIndex to be above other markers\r\n * zIndex: 1000 + count,\r\n * });\r\n * ```\r\n */\r\n render({ count, position }, stats) {\r\n // change color if this cluster has more markers than the mean cluster\r\n const color = count > Math.max(10, stats.clusters.markers.mean) ? \"#ff0000\" : \"#0000ff\";\r\n // create svg url with fill color\r\n const svg = window.btoa(`\n \n \n \n \n `);\r\n // create marker using svg icon\r\n return new google.maps.Marker({\r\n position,\r\n icon: {\r\n url: `data:image/svg+xml;base64,${svg}`,\r\n scaledSize: new google.maps.Size(45, 45),\r\n },\r\n label: {\r\n text: String(count),\r\n color: \"rgba(255,255,255,0.9)\",\r\n fontSize: \"12px\",\r\n },\r\n // adjust zIndex to be above other markers\r\n zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count,\r\n });\r\n }\r\n}\n\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Extends an object's prototype by another's.\r\n *\r\n * @param type1 The Type to be extended.\r\n * @param type2 The Type to extend with.\r\n * @ignore\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nfunction extend(type1, type2) {\r\n /* istanbul ignore next */\r\n // eslint-disable-next-line prefer-const\r\n for (let property in type2.prototype) {\r\n type1.prototype[property] = type2.prototype[property];\r\n }\r\n}\r\n/**\r\n * @ignore\r\n */\r\nclass OverlayViewSafe {\r\n constructor() {\r\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\r\n // extend function to extend MarkerClusterer with google.maps.OverlayView\r\n // because it might not always be available when the code is defined so we\r\n // look for it at the last possible moment. If it doesn't exist now then\r\n // there is no point going ahead :)\r\n extend(OverlayViewSafe, google.maps.OverlayView);\r\n }\r\n}\n\n/**\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar MarkerClustererEvents;\r\n(function (MarkerClustererEvents) {\r\n MarkerClustererEvents[\"CLUSTERING_BEGIN\"] = \"clusteringbegin\";\r\n MarkerClustererEvents[\"CLUSTERING_END\"] = \"clusteringend\";\r\n MarkerClustererEvents[\"CLUSTER_CLICK\"] = \"click\";\r\n})(MarkerClustererEvents || (MarkerClustererEvents = {}));\r\nconst defaultOnClusterClickHandler = (_, cluster, map) => {\r\n map.fitBounds(cluster.bounds);\r\n};\r\n/**\r\n * MarkerClusterer creates and manages per-zoom-level clusters for large amounts\r\n * of markers. See {@link MarkerClustererOptions} for more details.\r\n *\r\n * \r\n */\r\nclass MarkerClusterer extends OverlayViewSafe {\r\n constructor({ map, markers = [], algorithm = new SuperClusterAlgorithm({}), renderer = new DefaultRenderer(), onClusterClick = defaultOnClusterClickHandler, }) {\r\n super();\r\n this.markers = [...markers];\r\n this.clusters = [];\r\n this.algorithm = algorithm;\r\n this.renderer = renderer;\r\n this.onClusterClick = onClusterClick;\r\n if (map) {\r\n this.setMap(map);\r\n }\r\n }\r\n addMarker(marker, noDraw) {\r\n if (this.markers.includes(marker)) {\r\n return;\r\n }\r\n this.markers.push(marker);\r\n if (!noDraw) {\r\n this.render();\r\n }\r\n }\r\n addMarkers(markers, noDraw) {\r\n markers.forEach((marker) => {\r\n this.addMarker(marker, true);\r\n });\r\n if (!noDraw) {\r\n this.render();\r\n }\r\n }\r\n removeMarker(marker, noDraw) {\r\n const index = this.markers.indexOf(marker);\r\n if (index === -1) {\r\n // Marker is not in our list of markers, so do nothing:\r\n return false;\r\n }\r\n marker.setMap(null);\r\n this.markers.splice(index, 1); // Remove the marker from the list of managed markers\r\n if (!noDraw) {\r\n this.render();\r\n }\r\n return true;\r\n }\r\n removeMarkers(markers, noDraw) {\r\n let removed = false;\r\n markers.forEach((marker) => {\r\n removed = this.removeMarker(marker, true) || removed;\r\n });\r\n if (removed && !noDraw) {\r\n this.render();\r\n }\r\n return removed;\r\n }\r\n clearMarkers(noDraw) {\r\n this.markers.length = 0;\r\n if (!noDraw) {\r\n this.render();\r\n }\r\n }\r\n /**\r\n * Recalculates and draws all the marker clusters.\r\n */\r\n render() {\r\n const map = this.getMap();\r\n if (map instanceof google.maps.Map && this.getProjection()) {\r\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_BEGIN, this);\r\n const { clusters, changed } = this.algorithm.calculate({\r\n markers: this.markers,\r\n map,\r\n mapCanvasProjection: this.getProjection(),\r\n });\r\n // allow algorithms to return flag on whether the clusters/markers have changed\r\n if (changed || changed == undefined) {\r\n // reset visibility of markers and clusters\r\n this.reset();\r\n // store new clusters\r\n this.clusters = clusters;\r\n this.renderClusters();\r\n }\r\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_END, this);\r\n }\r\n }\r\n onAdd() {\r\n this.idleListener = this.getMap().addListener(\"idle\", this.render.bind(this));\r\n this.render();\r\n }\r\n onRemove() {\r\n google.maps.event.removeListener(this.idleListener);\r\n this.reset();\r\n }\r\n reset() {\r\n this.markers.forEach((marker) => marker.setMap(null));\r\n this.clusters.forEach((cluster) => cluster.delete());\r\n this.clusters = [];\r\n }\r\n renderClusters() {\r\n // generate stats to pass to renderers\r\n const stats = new ClusterStats(this.markers, this.clusters);\r\n const map = this.getMap();\r\n this.clusters.forEach((cluster) => {\r\n if (cluster.markers.length === 1) {\r\n cluster.marker = cluster.markers[0];\r\n }\r\n else {\r\n cluster.marker = this.renderer.render(cluster, stats);\r\n if (this.onClusterClick) {\r\n cluster.marker.addListener(\"click\", \r\n /* istanbul ignore next */\r\n (event) => {\r\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTER_CLICK, cluster);\r\n this.onClusterClick(event, cluster, map);\r\n });\r\n }\r\n }\r\n cluster.marker.setMap(map);\r\n });\r\n }\r\n}\n\nvar index_esm = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tAbstractAlgorithm: AbstractAlgorithm,\n\tAbstractViewportAlgorithm: AbstractViewportAlgorithm,\n\tCluster: Cluster,\n\tClusterStats: ClusterStats,\n\tDBScanAlgorithm: DBScanAlgorithm,\n\tDefaultRenderer: DefaultRenderer,\n\tGridAlgorithm: GridAlgorithm,\n\tKmeansAlgorithm: KmeansAlgorithm,\n\tMarkerClusterer: MarkerClusterer,\n\tget MarkerClustererEvents () { return MarkerClustererEvents; },\n\tNoopAlgorithm: NoopAlgorithm,\n\tSuperClusterAlgorithm: SuperClusterAlgorithm,\n\tdefaultOnClusterClickHandler: defaultOnClusterClickHandler,\n\tdistanceBetweenPoints: distanceBetweenPoints,\n\textendBoundsToPaddedViewport: extendBoundsToPaddedViewport,\n\textendPixelBounds: extendPixelBounds,\n\tfilterMarkersToPaddedViewport: filterMarkersToPaddedViewport,\n\tnoop: noop$1,\n\tpixelBoundsToLatLngBounds: pixelBoundsToLatLngBounds\n});\n\nconst useGoogleMarkerClusterer = (options) => {\n const map = useGoogleMap();\n const [markerClusterer, setMarkerClusterer] = useState(null);\n useEffect(() => {\n if (map && markerClusterer === null) {\n const markerCluster = new MarkerClusterer(Object.assign(Object.assign({}, options), { map }));\n setMarkerClusterer(markerCluster);\n }\n }, [map]);\n return markerClusterer;\n};\n/** Wrapper around [@googlemaps/markerclusterer](https://github.com/googlemaps/js-markerclusterer)\n *\n * Accepts {@link MarkerClustererOptionsSubset} which is a subset of {@link MarkerClustererOptions}\n */\nconst GoogleMarkerClusterer = ({ children, options }) => {\n const markerClusterer = useGoogleMarkerClusterer(options);\n return markerClusterer !== null ? children(markerClusterer) : null;\n};\n\n/* global google */\nconst eventMap$c = {\n onCloseClick: 'closeclick',\n onContentChanged: 'content_changed',\n onDomReady: 'domready',\n onPositionChanged: 'position_changed',\n onZindexChanged: 'zindex_changed',\n};\nconst updaterMap$c = {\n options(instance, options) {\n instance.setOptions(options);\n },\n position(instance, position) {\n instance.setPosition(position);\n },\n zIndex(instance, zIndex) {\n instance.setZIndex(zIndex);\n },\n};\nclass InfoWindow extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.containerElement = null;\n this.state = {\n infoWindow: null,\n };\n this.open = (infoWindow, anchor) => {\n if (anchor) {\n infoWindow.open(this.context, anchor);\n }\n else if (infoWindow.getPosition()) {\n infoWindow.open(this.context);\n }\n else {\n invariant_1(false, `You must provide either an anchor (typically render it inside a ) or a position props for .`);\n }\n };\n this.setInfoWindowCallback = () => {\n if (this.state.infoWindow !== null && this.containerElement !== null) {\n this.state.infoWindow.setContent(this.containerElement);\n this.open(this.state.infoWindow, this.props.anchor);\n if (this.props.onLoad) {\n this.props.onLoad(this.state.infoWindow);\n }\n }\n };\n }\n componentDidMount() {\n const infoWindow = new google.maps.InfoWindow(Object.assign({}, (this.props.options || {})));\n this.containerElement = document.createElement('div');\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$c,\n eventMap: eventMap$c,\n prevProps: {},\n nextProps: this.props,\n instance: infoWindow,\n });\n this.setState(function setInfoWindow() {\n return {\n infoWindow,\n };\n }, this.setInfoWindowCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.infoWindow !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$c,\n eventMap: eventMap$c,\n prevProps,\n nextProps: this.props,\n instance: this.state.infoWindow,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.infoWindow !== null) {\n unregisterEvents(this.registeredEvents);\n this.state.infoWindow.close();\n }\n }\n render() {\n return this.containerElement ? (ReactDOM.createPortal(React.Children.only(this.props.children), this.containerElement)) : (React.createElement(React.Fragment, null));\n }\n}\nInfoWindow.contextType = MapContext;\n\nconst eventMap$b = {\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n};\nconst updaterMap$b = {\n draggable(instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable(instance, editable) {\n instance.setEditable(editable);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n path(instance, path) {\n instance.setPath(path);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n },\n};\nclass Polyline extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n polyline: null,\n };\n this.setPolylineCallback = () => {\n if (this.state.polyline !== null && this.props.onLoad) {\n this.props.onLoad(this.state.polyline);\n }\n };\n }\n componentDidMount() {\n const polyline = new google.maps.Polyline(Object.assign(Object.assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$b,\n eventMap: eventMap$b,\n prevProps: {},\n nextProps: this.props,\n instance: polyline,\n });\n this.setState(function setPolyline() {\n return {\n polyline,\n };\n }, this.setPolylineCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.polyline !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$b,\n eventMap: eventMap$b,\n prevProps,\n nextProps: this.props,\n instance: this.state.polyline,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.polyline !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.polyline);\n }\n unregisterEvents(this.registeredEvents);\n this.state.polyline.setMap(null);\n }\n }\n render() {\n return React.createElement(React.Fragment, null);\n }\n}\nPolyline.contextType = MapContext;\n\n/* global google */\nconst eventMap$a = {\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n};\nconst updaterMap$a = {\n draggable(instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable(instance, editable) {\n instance.setEditable(editable);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n path(instance, path) {\n instance.setPath(path);\n },\n paths(instance, paths) {\n instance.setPaths(paths);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n },\n};\nclass Polygon extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n polygon: null,\n };\n this.setPolygonCallback = () => {\n if (this.state.polygon !== null && this.props.onLoad) {\n this.props.onLoad(this.state.polygon);\n }\n };\n }\n componentDidMount() {\n const polygon = new google.maps.Polygon(Object.assign(Object.assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$a,\n eventMap: eventMap$a,\n prevProps: {},\n nextProps: this.props,\n instance: polygon,\n });\n this.setState(function setPolygon() {\n return {\n polygon,\n };\n }, this.setPolygonCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.polygon !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$a,\n eventMap: eventMap$a,\n prevProps,\n nextProps: this.props,\n instance: this.state.polygon,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.polygon !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.polygon);\n }\n unregisterEvents(this.registeredEvents);\n this.state.polygon && this.state.polygon.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\nPolygon.contextType = MapContext;\n\nconst eventMap$9 = {\n onBoundsChanged: 'bounds_changed',\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n};\nconst updaterMap$9 = {\n bounds(instance, bounds) {\n instance.setBounds(bounds);\n },\n draggable(instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable(instance, editable) {\n instance.setEditable(editable);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n },\n};\nclass Rectangle extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n rectangle: null,\n };\n this.setRectangleCallback = () => {\n if (this.state.rectangle !== null && this.props.onLoad) {\n this.props.onLoad(this.state.rectangle);\n }\n };\n }\n componentDidMount() {\n const rectangle = new google.maps.Rectangle(Object.assign(Object.assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$9,\n eventMap: eventMap$9,\n prevProps: {},\n nextProps: this.props,\n instance: rectangle,\n });\n this.setState(function setRectangle() {\n return {\n rectangle,\n };\n }, this.setRectangleCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.rectangle !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$9,\n eventMap: eventMap$9,\n prevProps,\n nextProps: this.props,\n instance: this.state.rectangle,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.rectangle !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.rectangle);\n }\n unregisterEvents(this.registeredEvents);\n this.state.rectangle.setMap(null);\n }\n }\n render() {\n return React.createElement(React.Fragment, null);\n }\n}\nRectangle.contextType = MapContext;\n\nconst eventMap$8 = {\n onCenterChanged: 'center_changed',\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRadiusChanged: 'radius_changed',\n onRightClick: 'rightclick',\n};\nconst updaterMap$8 = {\n center(instance, center) {\n instance.setCenter(center);\n },\n draggable(instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable(instance, editable) {\n instance.setEditable(editable);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n radius(instance, radius) {\n instance.setRadius(radius);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n },\n};\nclass Circle extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n circle: null,\n };\n this.setCircleCallback = () => {\n if (this.state.circle !== null && this.props.onLoad) {\n this.props.onLoad(this.state.circle);\n }\n };\n }\n componentDidMount() {\n const circle = new google.maps.Circle(Object.assign(Object.assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$8,\n eventMap: eventMap$8,\n prevProps: {},\n nextProps: this.props,\n instance: circle,\n });\n this.setState(function setCircle() {\n return {\n circle,\n };\n }, this.setCircleCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.circle !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$8,\n eventMap: eventMap$8,\n prevProps,\n nextProps: this.props,\n instance: this.state.circle,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.circle !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.circle);\n }\n unregisterEvents(this.registeredEvents);\n this.state.circle && this.state.circle.setMap(null);\n }\n }\n render() {\n return React.createElement(React.Fragment, null);\n }\n}\nCircle.contextType = MapContext;\n\nconst eventMap$7 = {\n onAddFeature: 'addfeature',\n onClick: 'click',\n onDblClick: 'dblclick',\n onMouseDown: 'mousedown',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRemoveFeature: 'removefeature',\n onRemoveProperty: 'removeproperty',\n onRightClick: 'rightclick',\n onSetGeometry: 'setgeometry',\n onSetProperty: 'setproperty',\n};\nconst updaterMap$7 = {\n add(instance, features) {\n instance.add(features);\n },\n addgeojson(instance, geojson, options) {\n instance.addGeoJson(geojson, options);\n },\n contains(instance, feature) {\n instance.contains(feature);\n },\n foreach(instance, callback) {\n instance.forEach(callback);\n },\n loadgeojson(instance, url, options, callback) {\n instance.loadGeoJson(url, options, callback);\n },\n overridestyle(instance, feature, style) {\n instance.overrideStyle(feature, style);\n },\n remove(instance, feature) {\n instance.remove(feature);\n },\n revertstyle(instance, feature) {\n instance.revertStyle(feature);\n },\n controlposition(instance, controlPosition) {\n instance.setControlPosition(controlPosition);\n },\n controls(instance, controls) {\n instance.setControls(controls);\n },\n drawingmode(instance, mode) {\n instance.setDrawingMode(mode);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n style(instance, style) {\n instance.setStyle(style);\n },\n togeojson(instance, callback) {\n instance.toGeoJson(callback);\n },\n};\nclass Data extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n data: null,\n };\n this.setDataCallback = () => {\n if (this.state.data !== null && this.props.onLoad) {\n this.props.onLoad(this.state.data);\n }\n };\n }\n componentDidMount() {\n const data = new google.maps.Data(Object.assign(Object.assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$7,\n eventMap: eventMap$7,\n prevProps: {},\n nextProps: this.props,\n instance: data,\n });\n this.setState(function setData() {\n return {\n data,\n };\n }, this.setDataCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.data !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$7,\n eventMap: eventMap$7,\n prevProps,\n nextProps: this.props,\n instance: this.state.data,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.data !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.data);\n }\n unregisterEvents(this.registeredEvents);\n if (this.state.data) {\n this.state.data.setMap(null);\n }\n }\n }\n render() {\n return null;\n }\n}\nData.contextType = MapContext;\n\nconst eventMap$6 = {\n onClick: 'click',\n onDefaultViewportChanged: 'defaultviewport_changed',\n onStatusChanged: 'status_changed',\n};\nconst updaterMap$6 = {\n options(instance, options) {\n instance.setOptions(options);\n },\n url(instance, url) {\n instance.setUrl(url);\n },\n zIndex(instance, zIndex) {\n instance.setZIndex(zIndex);\n },\n};\nclass KmlLayer extends PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n kmlLayer: null,\n };\n this.setKmlLayerCallback = () => {\n if (this.state.kmlLayer !== null && this.props.onLoad) {\n this.props.onLoad(this.state.kmlLayer);\n }\n };\n }\n componentDidMount() {\n const kmlLayer = new google.maps.KmlLayer(Object.assign(Object.assign({}, this.props.options), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$6,\n eventMap: eventMap$6,\n prevProps: {},\n nextProps: this.props,\n instance: kmlLayer,\n });\n this.setState(function setLmlLayer() {\n return {\n kmlLayer,\n };\n }, this.setKmlLayerCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.kmlLayer !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$6,\n eventMap: eventMap$6,\n prevProps,\n nextProps: this.props,\n instance: this.state.kmlLayer,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.kmlLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.kmlLayer);\n }\n unregisterEvents(this.registeredEvents);\n this.state.kmlLayer.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\nKmlLayer.contextType = MapContext;\n\n/* eslint-disable filenames/match-regex */\nfunction getOffsetOverride(containerElement, getPixelPositionOffset) {\n return typeof getPixelPositionOffset === 'function'\n ? getPixelPositionOffset(containerElement.offsetWidth, containerElement.offsetHeight)\n : {};\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst createLatLng = (inst, Type) => new Type(inst.lat, inst.lng);\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst createLatLngBounds = (inst, Type) => new Type(new google.maps.LatLng(inst.ne.lat, inst.ne.lng), new google.maps.LatLng(inst.sw.lat, inst.sw.lng));\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst ensureOfType = (inst, type, factory) => {\n return inst instanceof type ? inst : factory(inst, type);\n};\nconst getLayoutStylesByBounds = (mapCanvasProjection, offset, bounds) => {\n const ne = mapCanvasProjection && mapCanvasProjection.fromLatLngToDivPixel(bounds.getNorthEast());\n const sw = mapCanvasProjection && mapCanvasProjection.fromLatLngToDivPixel(bounds.getSouthWest());\n if (ne && sw) {\n return {\n left: `${sw.x + offset.x}px`,\n top: `${ne.y + offset.y}px`,\n width: `${ne.x - sw.x - offset.x}px`,\n height: `${sw.y - ne.y - offset.y}px`,\n };\n }\n return {\n left: '-9999px',\n top: '-9999px',\n };\n};\nconst getLayoutStylesByPosition = (mapCanvasProjection, offset, position) => {\n const point = mapCanvasProjection && mapCanvasProjection.fromLatLngToDivPixel(position);\n if (point) {\n const { x, y } = point;\n return {\n left: `${x + offset.x}px`,\n top: `${y + offset.y}px`,\n };\n }\n return {\n left: '-9999px',\n top: '-9999px',\n };\n};\nconst getLayoutStyles = (mapCanvasProjection, offset, bounds, position) => {\n return bounds !== undefined\n ? getLayoutStylesByBounds(mapCanvasProjection, offset, ensureOfType(bounds, google.maps.LatLngBounds, createLatLngBounds))\n : getLayoutStylesByPosition(mapCanvasProjection, offset, ensureOfType(position, google.maps.LatLng, createLatLng));\n};\nconst arePositionsEqual = (currentPosition, previousPosition) => {\n return currentPosition.left === previousPosition.left\n && currentPosition.top === previousPosition.top\n && currentPosition.width === previousPosition.height\n && currentPosition.height === previousPosition.height;\n};\n\nfunction convertToLatLngString(latLngLike) {\n if (!latLngLike) {\n return '';\n }\n const latLng = latLngLike instanceof google.maps.LatLng\n ? latLngLike\n : new google.maps.LatLng(latLngLike.lat, latLngLike.lng);\n return latLng + '';\n}\nfunction convertToLatLngBoundsString(latLngBoundsLike) {\n if (!latLngBoundsLike) {\n return '';\n }\n const latLngBounds = latLngBoundsLike instanceof google.maps.LatLngBounds\n ? latLngBoundsLike\n : new google.maps.LatLngBounds(new google.maps.LatLng(latLngBoundsLike.south, latLngBoundsLike.east), new google.maps.LatLng(latLngBoundsLike.north, latLngBoundsLike.west));\n return latLngBounds + '';\n}\nclass OverlayView extends React.PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n paneEl: null,\n containerStyle: {\n // set initial position\n position: 'absolute'\n },\n };\n this.updatePane = () => {\n const mapPaneName = this.props.mapPaneName;\n // https://developers.google.com/maps/documentation/javascript/3.exp/reference#MapPanes\n const mapPanes = this.overlayView.getPanes();\n invariant_1(!!mapPaneName, `OverlayView requires props.mapPaneName but got %s`, mapPaneName);\n if (mapPanes) {\n this.setState({\n paneEl: mapPanes[mapPaneName]\n });\n }\n else {\n this.setState({\n paneEl: null\n });\n }\n };\n this.onAdd = () => {\n var _a, _b;\n this.updatePane();\n (_b = (_a = this.props).onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, this.overlayView);\n };\n this.onPositionElement = () => {\n const mapCanvasProjection = this.overlayView.getProjection();\n const offset = Object.assign({ x: 0, y: 0 }, (this.containerRef.current\n ? getOffsetOverride(this.containerRef.current, this.props.getPixelPositionOffset)\n : {}));\n const layoutStyles = getLayoutStyles(mapCanvasProjection, offset, this.props.bounds, this.props.position);\n const { left, top, width, height } = this.state.containerStyle;\n if (!arePositionsEqual(layoutStyles, { left, top, width, height })) {\n this.setState({\n containerStyle: Object.assign(Object.assign({}, layoutStyles), { position: 'absolute' }),\n });\n }\n };\n this.draw = () => {\n this.onPositionElement();\n };\n this.onRemove = () => {\n var _a, _b;\n this.setState(() => ({\n paneEl: null\n }));\n // this.mapPaneEl = null\n (_b = (_a = this.props).onUnmount) === null || _b === void 0 ? void 0 : _b.call(_a, this.overlayView);\n };\n this.containerRef = React.createRef();\n // You must implement three methods: onAdd(), draw(), and onRemove().\n const overlayView = new google.maps.OverlayView();\n overlayView.onAdd = this.onAdd;\n overlayView.draw = this.draw;\n overlayView.onRemove = this.onRemove;\n this.overlayView = overlayView;\n }\n componentDidMount() {\n // You must call setMap() with a valid Map object to trigger the call to\n // the onAdd() method and setMap(null) in order to trigger the onRemove() method.\n this.overlayView.setMap(this.context);\n }\n componentDidUpdate(prevProps) {\n const prevPositionString = convertToLatLngString(prevProps.position);\n const positionString = convertToLatLngString(this.props.position);\n const prevBoundsString = convertToLatLngBoundsString(prevProps.bounds);\n const boundsString = convertToLatLngBoundsString(this.props.bounds);\n if (prevPositionString !== positionString || prevBoundsString !== boundsString) {\n this.overlayView.draw();\n }\n if (prevProps.mapPaneName !== this.props.mapPaneName) {\n this.updatePane();\n }\n }\n componentWillUnmount() {\n this.overlayView.setMap(null);\n }\n render() {\n const paneEl = this.state.paneEl;\n if (paneEl) {\n return ReactDOM.createPortal(React.createElement(\"div\", { ref: this.containerRef, style: this.state.containerStyle }, React.Children.only(this.props.children)), paneEl);\n }\n else {\n return null;\n }\n }\n}\nOverlayView.FLOAT_PANE = `floatPane`;\nOverlayView.MAP_PANE = `mapPane`;\nOverlayView.MARKER_LAYER = `markerLayer`;\nOverlayView.OVERLAY_LAYER = `overlayLayer`;\nOverlayView.OVERLAY_MOUSE_TARGET = `overlayMouseTarget`;\nOverlayView.contextType = MapContext;\n\nfunction noop() { }\n\nconst eventMap$5 = {\n onDblClick: 'dblclick',\n onClick: 'click',\n};\nconst updaterMap$5 = {\n opacity(instance, opacity) {\n instance.setOpacity(opacity);\n },\n};\nclass GroundOverlay extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n groundOverlay: null,\n };\n this.setGroundOverlayCallback = () => {\n if (this.state.groundOverlay !== null && this.props.onLoad) {\n this.props.onLoad(this.state.groundOverlay);\n }\n };\n }\n componentDidMount() {\n invariant_1(!!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`);\n const groundOverlay = new google.maps.GroundOverlay(this.props.url, this.props.bounds, Object.assign(Object.assign({}, this.props.options), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$5,\n eventMap: eventMap$5,\n prevProps: {},\n nextProps: this.props,\n instance: groundOverlay,\n });\n this.setState(function setGroundOverlay() {\n return {\n groundOverlay,\n };\n }, this.setGroundOverlayCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.groundOverlay !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$5,\n eventMap: eventMap$5,\n prevProps,\n nextProps: this.props,\n instance: this.state.groundOverlay,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.groundOverlay) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.groundOverlay);\n }\n this.state.groundOverlay.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\nGroundOverlay.defaultProps = {\n onLoad: noop,\n};\nGroundOverlay.contextType = MapContext;\n\nconst eventMap$4 = {};\nconst updaterMap$4 = {\n data(instance, data) {\n instance.setData(data);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n};\nclass HeatmapLayer extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n heatmapLayer: null,\n };\n this.setHeatmapLayerCallback = () => {\n if (this.state.heatmapLayer !== null && this.props.onLoad) {\n this.props.onLoad(this.state.heatmapLayer);\n }\n };\n }\n componentDidMount() {\n invariant_1(!!google.maps.visualization, 'Did you include prop libraries={[\"visualization\"]} to ? %s', google.maps.visualization);\n invariant_1(!!this.props.data, 'data property is required in HeatmapLayer %s', this.props.data);\n const heatmapLayer = new google.maps.visualization.HeatmapLayer(Object.assign(Object.assign({}, (this.props.options || {})), { data: this.props.data, map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$4,\n eventMap: eventMap$4,\n prevProps: {},\n nextProps: this.props,\n instance: heatmapLayer,\n });\n this.setState(function setHeatmapLayer() {\n return {\n heatmapLayer,\n };\n }, this.setHeatmapLayerCallback);\n }\n componentDidUpdate(prevProps) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$4,\n eventMap: eventMap$4,\n prevProps,\n nextProps: this.props,\n instance: this.state.heatmapLayer,\n });\n }\n componentWillUnmount() {\n if (this.state.heatmapLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.heatmapLayer);\n }\n unregisterEvents(this.registeredEvents);\n this.state.heatmapLayer.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\nHeatmapLayer.contextType = MapContext;\n\nconst eventMap$3 = {\n onCloseClick: 'closeclick',\n onPanoChanged: 'pano_changed',\n onPositionChanged: 'position_changed',\n onPovChanged: 'pov_changed',\n onResize: 'resize',\n onStatusChanged: 'status_changed',\n onVisibleChanged: 'visible_changed',\n onZoomChanged: 'zoom_changed',\n};\nconst updaterMap$3 = {\n register(instance, provider, options) {\n instance.registerPanoProvider(provider, options);\n },\n links(instance, links) {\n instance.setLinks(links);\n },\n motionTracking(instance, motionTracking) {\n instance.setMotionTracking(motionTracking);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n pano(instance, pano) {\n instance.setPano(pano);\n },\n position(instance, position) {\n instance.setPosition(position);\n },\n pov(instance, pov) {\n instance.setPov(pov);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n },\n zoom(instance, zoom) {\n instance.setZoom(zoom);\n },\n};\nclass StreetViewPanorama extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n streetViewPanorama: null,\n };\n this.setStreetViewPanoramaCallback = () => {\n if (this.state.streetViewPanorama !== null && this.props.onLoad) {\n this.props.onLoad(this.state.streetViewPanorama);\n }\n };\n }\n componentDidMount() {\n const streetViewPanorama = this.context.getStreetView();\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$3,\n eventMap: eventMap$3,\n prevProps: {},\n nextProps: this.props,\n instance: streetViewPanorama,\n });\n this.setState(function setStreetViewPanorama() {\n return {\n streetViewPanorama,\n };\n }, this.setStreetViewPanoramaCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.streetViewPanorama !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$3,\n eventMap: eventMap$3,\n prevProps,\n nextProps: this.props,\n instance: this.state.streetViewPanorama,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.streetViewPanorama !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.streetViewPanorama);\n }\n unregisterEvents(this.registeredEvents);\n this.state.streetViewPanorama.setVisible(false);\n }\n }\n render() {\n return null;\n }\n}\nStreetViewPanorama.contextType = MapContext;\n\nclass StreetViewService extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.state = {\n streetViewService: null,\n };\n this.setStreetViewServiceCallback = () => {\n if (this.state.streetViewService !== null && this.props.onLoad) {\n this.props.onLoad(this.state.streetViewService);\n }\n };\n }\n componentDidMount() {\n const streetViewService = new google.maps.StreetViewService();\n this.setState(function setStreetViewService() {\n return {\n streetViewService,\n };\n }, this.setStreetViewServiceCallback);\n }\n componentWillUnmount() {\n if (this.state.streetViewService !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.streetViewService);\n }\n }\n }\n render() {\n return null;\n }\n}\nStreetViewService.contextType = MapContext;\n\nclass DirectionsService extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.state = {\n directionsService: null,\n };\n this.setDirectionsServiceCallback = () => {\n if (this.state.directionsService !== null && this.props.onLoad) {\n this.props.onLoad(this.state.directionsService);\n }\n };\n }\n componentDidMount() {\n invariant_1(!!this.props.options, 'DirectionsService expected options object as parameter, but got %s', this.props.options);\n const directionsService = new google.maps.DirectionsService();\n this.setState(function setDirectionsService() {\n return {\n directionsService,\n };\n }, this.setDirectionsServiceCallback);\n }\n componentDidUpdate() {\n if (this.state.directionsService !== null) {\n this.state.directionsService.route(this.props.options, this.props.callback);\n }\n }\n componentWillUnmount() {\n if (this.state.directionsService !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.directionsService);\n }\n }\n }\n render() {\n return React.createElement(React.Fragment, null);\n }\n}\n\nconst eventMap$2 = {\n onDirectionsChanged: 'directions_changed',\n};\nconst updaterMap$2 = {\n directions(instance, directions) {\n instance.setDirections(directions);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n panel(instance, panel) {\n instance.setPanel(panel);\n },\n routeIndex(instance, routeIndex) {\n instance.setRouteIndex(routeIndex);\n },\n};\nclass DirectionsRenderer extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.state = {\n directionsRenderer: null,\n };\n this.setDirectionsRendererCallback = () => {\n if (this.state.directionsRenderer !== null) {\n this.state.directionsRenderer.setMap(this.context);\n if (this.props.onLoad) {\n this.props.onLoad(this.state.directionsRenderer);\n }\n }\n };\n }\n componentDidMount() {\n const directionsRenderer = new google.maps.DirectionsRenderer(this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$2,\n eventMap: eventMap$2,\n prevProps: {},\n nextProps: this.props,\n instance: directionsRenderer,\n });\n this.setState(function setDirectionsRenderer() {\n return {\n directionsRenderer,\n };\n }, this.setDirectionsRendererCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.directionsRenderer !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$2,\n eventMap: eventMap$2,\n prevProps,\n nextProps: this.props,\n instance: this.state.directionsRenderer,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.directionsRenderer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.directionsRenderer);\n }\n unregisterEvents(this.registeredEvents);\n if (this.state.directionsRenderer) {\n this.state.directionsRenderer.setMap(null);\n }\n }\n }\n render() {\n return React.createElement(React.Fragment, null);\n }\n}\nDirectionsRenderer.contextType = MapContext;\n\nclass DistanceMatrixService extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.state = {\n distanceMatrixService: null,\n };\n this.setDistanceMatrixServiceCallback = () => {\n if (this.state.distanceMatrixService !== null && this.props.onLoad) {\n this.props.onLoad(this.state.distanceMatrixService);\n }\n };\n }\n componentDidMount() {\n invariant_1(!!this.props.options, 'DistanceMatrixService expected options object as parameter, but go %s', this.props.options);\n const distanceMatrixService = new google.maps.DistanceMatrixService();\n this.setState(function setDistanceMatrixService() {\n return {\n distanceMatrixService,\n };\n }, this.setDistanceMatrixServiceCallback);\n }\n componentDidUpdate() {\n if (this.state.distanceMatrixService !== null) {\n this.state.distanceMatrixService.getDistanceMatrix(this.props.options, this.props.callback);\n }\n }\n componentWillUnmount() {\n if (this.state.distanceMatrixService !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.distanceMatrixService);\n }\n }\n }\n render() {\n return React.createElement(React.Fragment, null);\n }\n}\n\nconst eventMap$1 = {\n onPlacesChanged: 'places_changed',\n};\nconst updaterMap$1 = {\n bounds(instance, bounds) {\n instance.setBounds(bounds);\n },\n};\nclass StandaloneSearchBox extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.containerElement = React.createRef();\n this.state = {\n searchBox: null,\n };\n this.setSearchBoxCallback = () => {\n if (this.state.searchBox !== null && this.props.onLoad) {\n this.props.onLoad(this.state.searchBox);\n }\n };\n }\n componentDidMount() {\n invariant_1(!!google.maps.places, 'You need to provide libraries={[\"places\"]} prop to component %s', google.maps.places);\n if (this.containerElement !== null && this.containerElement.current !== null) {\n const input = this.containerElement.current.querySelector('input');\n if (input !== null) {\n const searchBox = new google.maps.places.SearchBox(input, this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$1,\n eventMap: eventMap$1,\n prevProps: {},\n nextProps: this.props,\n instance: searchBox,\n });\n this.setState(function setSearchBox() {\n return {\n searchBox,\n };\n }, this.setSearchBoxCallback);\n }\n }\n }\n componentDidUpdate(prevProps) {\n if (this.state.searchBox !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$1,\n eventMap: eventMap$1,\n prevProps,\n nextProps: this.props,\n instance: this.state.searchBox,\n });\n }\n }\n componentWillUnmount() {\n if (this.state.searchBox !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.searchBox);\n }\n unregisterEvents(this.registeredEvents);\n }\n }\n render() {\n return React.createElement(\"div\", { ref: this.containerElement }, React.Children.only(this.props.children));\n }\n}\nStandaloneSearchBox.contextType = MapContext;\n\nconst eventMap = {\n onPlaceChanged: 'place_changed',\n};\nconst updaterMap = {\n bounds(instance, bounds) {\n instance.setBounds(bounds);\n },\n restrictions(instance, restrictions) {\n instance.setComponentRestrictions(restrictions);\n },\n fields(instance, fields) {\n instance.setFields(fields);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n types(instance, types) {\n instance.setTypes(types);\n },\n};\nclass Autocomplete extends React.PureComponent {\n constructor() {\n super(...arguments);\n this.registeredEvents = [];\n this.containerElement = React.createRef();\n this.state = {\n autocomplete: null,\n };\n this.setAutocompleteCallback = () => {\n if (this.state.autocomplete !== null && this.props.onLoad) {\n this.props.onLoad(this.state.autocomplete);\n }\n };\n }\n componentDidMount() {\n invariant_1(!!google.maps.places, 'You need to provide libraries={[\"places\"]} prop to component %s', google.maps.places);\n // TODO: why current could be equal null?\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n const input = this.containerElement.current.querySelector('input');\n if (input) {\n const autocomplete = new google.maps.places.Autocomplete(input, this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap,\n eventMap,\n prevProps: {},\n nextProps: this.props,\n instance: autocomplete,\n });\n this.setState(function setAutocomplete() {\n return {\n autocomplete,\n };\n }, this.setAutocompleteCallback);\n }\n }\n componentDidUpdate(prevProps) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap,\n eventMap,\n prevProps,\n nextProps: this.props,\n instance: this.state.autocomplete,\n });\n }\n componentWillUnmount() {\n if (this.state.autocomplete !== null) {\n unregisterEvents(this.registeredEvents);\n }\n }\n render() {\n return React.createElement(\"div\", { ref: this.containerElement, className: this.props.className || '' }, React.Children.only(this.props.children));\n }\n}\nAutocomplete.contextType = MapContext;\n\nexport { Autocomplete, BicyclingLayer, Circle, Data, DirectionsRenderer, DirectionsService, DistanceMatrixService, DrawingManager, GoogleMap, index_esm as GoogleMapsMarkerClusterer, GoogleMarkerClusterer, GroundOverlay, HeatmapLayer, InfoBoxComponent as InfoBox, InfoWindow, KmlLayer, LoadScript, LoadScriptNext$1 as LoadScriptNext, MapContext, Marker, ClustererComponent as MarkerClusterer, OverlayView, Polygon, Polyline, Rectangle, StandaloneSearchBox, StreetViewPanorama, StreetViewService, TrafficLayer, TransitLayer, useGoogleMap, useJsApiLoader, useLoadScript };\n//# sourceMappingURL=esm.js.map\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n"],"sourceRoot":""}