{"version":3,"sources":["snazzy-info-window.js"],"names":["copyKeys","target","source","Object","keys","forEach","key","mergeDefaultOptions","opts","copy","_defaultOptions","obj","_typeof","objCopy","parseAttribute","attribute","defaultValue","re","test","match","exec","value","units","original","setHTML","container","content","firstChild","removeChild","innerHTML","appendChild","oppositePlacement","p","capitalizePlacement","charAt","toUpperCase","slice","toLatLng","v","undefined","google","maps","LatLng","lat","lng","_defaultShadow","h","blur","spread","color","placement","pointer","openOnMarkerClick","closeOnMapClick","closeWhenOthersOpen","showCloseButton","panOnOpen","edgeOffset","top","right","bottom","left","SnazzyInfoWindow","_classCallCheck","this","_this","_possibleConstructorReturn","__proto__","getPrototypeOf","call","console","warn","_html","_opts","_callbacks","callbacks","_marker","marker","_map","map","_position","position","_isOpen","_listeners","trackListener","event","addListener","getMap","open","offset","String","toLowerCase","border","shadow","callback","lambda","apply","listener","persistent","push","clearPersistent","e","removeListener","filter","result","activateCallback","setMap","clearListeners","latLng","draw","resize","reposition","wrapperClass","wrapper","w","className","_classPrefix","style","marginLeft","marginTop","bg","backgroundColor","contentWrapper","pointerBg","padding","shadowFrame","borderRadius","fontSize","fontColor","shadowPointer","width","height","pointerBorder","borderWidth","bWidth","Math","round","offsetWidth","clientWidth","pLength","min","offsetHeight","triangleDiff","reverseP","borderColor","isSet","hOffset","vOffset","formatBoxShadow","boxShadow","hRotated","vRotated","shadowPointerInner","opacity","shadowWrapper","divPixel","getProjection","fromLatLngToDivPixel","floatWrapper","floor","y","x","trigger","_eventPrefix","_this2","applyCss","element","args","i","length","newElement","_len","arguments","Array","_key","document","createElement","setWrapperClass","closeButtonMarkup","d","closeButton","setAttribute","getPanes","floatPane","close","other","_previousWidth","_previousHeight","getDiv","ow","oh","pw","ph","addDomListener","cancelBubble","stopPropagation","parent","parentElement","mb","getBoundingClientRect","mib","getMapInnerBounds","wb","dx","dy","panBy","maxWidth","maxHeight","OverlayView"],"mappings":"k0BA6BA,QAASA,GAASC,EAAQC,GAClBD,GAAUC,GACVC,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C,EAAK1I,KAAKQ,MAAMyC,QAAQsF,wBAC1BI,EAAK,EACLC,EAAK,CACLJ,GAAI3I,MAAQ6I,EAAG7I,KACf8I,EAAKD,EAAG7I,KAAO2I,EAAI3I,KACZ2I,EAAI7I,OAAS+I,EAAG/I,QACvBgJ,EAAKD,EAAG7I,MAAQ2I,EAAI7I,MAAQ+I,EAAGxE,QAE/BsE,EAAI9I,KAAOgJ,EAAGhJ,IACdkJ,EAAKF,EAAGhJ,IAAM8I,EAAI9I,IACX8I,EAAI5I,QAAU8I,EAAG9I,SACxBgJ,EAAKF,EAAGhJ,KAAO8I,EAAI5I,OAAS8I,EAAGvE,SAExB,IAAPwE,GAAmB,IAAPC,GACZ5I,KAAKuB,SAASsH,MAAMF,EAAIC,qCAM5B,GAAK5I,KAAKQ,MAAV,CAGA,GAAMgI,GAAMxI,KAAKyI,oBAEbK,EAAWN,EAAItE,KACS3F,UAAxByB,KAAKS,MAAMqI,WACXA,EAAWvE,KAAKK,IAAIkE,EAAU9I,KAAKS,MAAMqI,WAE7CA,GAAa9I,KAAKQ,MAAMyC,QAAQwB,YAAczE,KAAKQ,MAAM9C,QAAQ+G,YACjEzE,KAAKQ,MAAM9C,QAAQ2F,MAAMyF,SAAcA,EAAvC,IAGA,IAAIC,GAAYP,EAAIrE,MACS5F,UAAzByB,KAAKS,MAAMsI,YACXA,EAAYxE,KAAKK,IAAImE,EAAW/I,KAAKS,MAAMsI,YAE/CA,GAAc/I,KAAKQ,MAAMyC,QAAQ4B,aAAe7E,KAAKQ,MAAM9C,QAAQmH,aACnE7E,KAAKQ,MAAM9C,QAAQ2F,MAAM0F,UAAeA,EAAxC,aA7jBe,WACnB,MAAyB,mBAAXvK,QAAyBA,OAAOC,KAAKuK,YAAc,2BAEhDlJ","file":"snazzy-info-window.min.js","sourcesContent":["// Global variables\nconst _classPrefix = 'si-';\nconst _root2 = 1.41421356237;\nconst _inverseRoot2 = 0.7071067811865474;\nconst _eventPrefix = 'snazzy-info-window-';\nconst _defaultShadow = {\n    h: '0px',\n    v: '3px',\n    blur: '6px',\n    spread: '0px',\n    color: '#000'\n};\nconst _defaultOptions = {\n    placement: 'top',\n    pointer: true,\n    openOnMarkerClick: true,\n    closeOnMapClick: true,\n    closeWhenOthersOpen: false,\n    showCloseButton: true,\n    panOnOpen: true,\n    edgeOffset: {\n        top: 20,\n        right: 20,\n        bottom: 20,\n        left: 20\n    }\n};\n\n// Copy keys from the source into the target\nfunction copyKeys(target, source) {\n    if (target && source) {\n        Object.keys(source).forEach((key) => {\n            target[key] = source[key];\n        });\n    }\n}\n\n// We need to safely merge options from the defaults. This will make\n// sure settings like edgeOffset are properly assigned.\nfunction mergeDefaultOptions(opts) {\n    const copy = {};\n    copyKeys(copy, _defaultOptions);\n    copyKeys(copy, opts);\n    Object.keys(_defaultOptions).forEach((key) => {\n        const obj = _defaultOptions[key];\n        if (typeof obj === 'object') {\n            const objCopy = {};\n            copyKeys(objCopy, obj);\n            copyKeys(objCopy, copy[key]);\n            copy[key] = objCopy;\n        }\n    });\n    return copy;\n}\n\n// Parse a css attribute into the numeric portion and the units\nfunction parseAttribute(attribute, defaultValue) {\n    // 1em, 1.0em, 0.1em, .1em, 1.    em\n    const re = /^(-{0,1}\\.{0,1}\\d+(\\.\\d+)?)[\\s|\\.]*(\\w*)$/;\n    if (attribute && re.test(attribute)) {\n        const match = re.exec(attribute);\n        const number = match[1];\n        const units = match[3] || 'px';\n        return { value: number * 1, units, original: attribute };\n    }\n    if (defaultValue) {\n        return parseAttribute(defaultValue);\n    }\n    return { original: defaultValue };\n}\n\n// Set the html of a container. Should support both raw text and a single\n// DOM Element.\nfunction setHTML(container, content) {\n    if (container) {\n        // Clear out everything in the container\n        while (container.firstChild) {\n            container.removeChild(container.firstChild);\n        }\n        if (content) {\n            if (typeof content === 'string') {\n                container.innerHTML = content;\n            } else {\n                container.appendChild(content);\n            }\n        }\n    }\n}\n\n// Get the opposite of a given placement\nfunction oppositePlacement(p) {\n    if (p === 'top') {\n        return 'bottom';\n    } else if (p === 'bottom') {\n        return 'top';\n    } else if (p === 'left') {\n        return 'right';\n    } else if (p === 'right') {\n        return 'left';\n    }\n    return p;\n}\n\n// Return the placement with the first letter capitalized\nfunction capitalizePlacement(p) {\n    return p.charAt(0).toUpperCase() + p.slice(1);\n}\n\n// Convert the value into a Google Map LatLng\nfunction toLatLng(v) {\n    if (v !== undefined && v !== null) {\n        if (v instanceof google.maps.LatLng) {\n            return v;\n        } else if (v.lat !== undefined && v.lng !== undefined) {\n            return new google.maps.LatLng(v);\n        }\n    }\n    return null;\n}\n\n// Export SnazzyInfoWindow even if google is not yet defined.\nconst getGoogleClass = () => {\n    return typeof google !== 'undefined' ? google.maps.OverlayView : function noop() {};\n};\nexport default class SnazzyInfoWindow extends getGoogleClass() {\n\n    constructor(opts) {\n        super(opts);\n        if (typeof google === 'undefined') {\n            console.warn('Snazzy Info Window: Google Maps is not defined!'); //eslint-disable-line\n            return;\n        }\n        // Private properties\n        this._html = null;\n        this._opts = mergeDefaultOptions(opts);\n        this._callbacks = this._opts.callbacks || {};\n        this._marker = this._opts.marker;\n        this._map = this._opts.map;\n        this._position = toLatLng(this._opts.position);\n        this._isOpen = false;\n        this._listeners = [];\n\n        // This listener remains active when the info window is closed.\n        if (this._marker && this._opts.openOnMarkerClick) {\n            this.trackListener(google.maps.event.addListener(this._marker, 'click', () => {\n                if (!this.getMap()) {\n                    this.open();\n                }\n            }), true);\n        }\n\n        // When using a position the default option for the offset is 0\n        if (this._position && !this._opts.offset) {\n            this._opts.offset = {\n                top: '0px',\n                left: '0px'\n            };\n        }\n\n        // Validate the placement option\n        let p = opts.placement || this._opts.position;\n        // The position variable was renamed to placement so we must type check\n        if (typeof p === 'string' || p instanceof String) {\n            p = p.toLowerCase();\n        }\n        if (p !== 'top' && p !== 'bottom' &&\n            p !== 'left' && p !== 'right') {\n            this._opts.placement = _defaultOptions.placement;\n        } else {\n            this._opts.placement = p;\n        }\n\n        // Validate the position option\n        p = this._opts.position;\n        if (p !== undefined && p !== null &&\n            typeof p !== 'string' && !(p instanceof String)) {\n            this._opts.position = p;\n        }\n\n        // Validate the other options\n        if (this._opts.border === undefined || this._opts.border === true) {\n            this._opts.border = {};\n        }\n        if (this._opts.pointer === undefined) {\n            this._opts.pointer = _defaultOptions.pointer;\n        }\n        if (this._opts.shadow === undefined || this._opts.shadow === true) {\n            this._opts.shadow = {};\n        }\n    }\n\n    // Activate the specified callback and return the result\n    activateCallback(callback) {\n        const lambda = this._callbacks[callback];\n        return lambda ? lambda.apply(this) : undefined;\n    }\n\n    // Track the provided listener. A persistent listener means it remains\n    // tracked even if the info window is closed.\n    trackListener(listener, persistent) {\n        this._listeners.push({ listener, persistent });\n    }\n\n    // Will clear all listeners that are used during the open state.\n    clearListeners(clearPersistent) {\n        if (this._listeners) {\n            this._listeners.forEach((e) => {\n                if (clearPersistent || !e.persistent) {\n                    google.maps.event.removeListener(e.listener);\n                    e.listener = null;\n                }\n            });\n            this._listeners = this._listeners.filter((e) => {\n                return e.listener != null;\n            });\n        }\n    }\n\n    isOpen() {\n        return this._isOpen;\n    }\n\n    // Open the info window after attaching to a specific marker.\n    open() {\n        const result = this.activateCallback('beforeOpen');\n        if (result !== undefined && !result) {\n            return;\n        }\n        if (this._marker) {\n            this.setMap(this._marker.getMap());\n        } else if (this._map && this._position) {\n            this.setMap(this._map);\n        }\n    }\n\n    // Close the info window.\n    close() {\n        const result = this.activateCallback('beforeClose');\n        if (result !== undefined && !result) {\n            return;\n        }\n        this.clearListeners();\n        this.setMap(null);\n    }\n\n    // Force close the map and remove any event listeners attached to google\n    destroy() {\n        if (this.getMap()) {\n            this.setMap(null);\n        }\n        // Make sure to clear all persistent listeners\n        this.clearListeners(true);\n    }\n\n    setContent(content) {\n        this._opts.content = content;\n        if (this._html && this._html.content) {\n            setHTML(this._html.content, content);\n        }\n    }\n\n    setPosition(latLng) {\n        this._position = toLatLng(latLng);\n        if (this._isOpen && this._position) {\n            this.draw();\n            this.resize();\n            this.reposition();\n        }\n    }\n\n    setWrapperClass(wrapperClass) {\n        if (this._html && this._html.wrapper) {\n            const w = this._html.wrapper;\n            w.className = `${_classPrefix}wrapper-${this._opts.placement}`;\n            if (this._opts.border) {\n                w.className += ` ${_classPrefix}has-border`;\n            }\n            if (wrapperClass) {\n                w.className += ` ${wrapperClass}`;\n            }\n        }\n        this._opts.wrapperClass = wrapperClass;\n    }\n\n    getWrapper() {\n        if (this._html) {\n            return this._html.wrapper;\n        }\n        return null;\n    }\n\n    // Implementation of OverlayView draw method.\n    draw() {\n        if (!this.getMap() || !this._html) {\n            return;\n        }\n        if (!this._marker && !this._position) {\n            return;\n        }\n\n        // 1. Assign offset\n        const offset = this._opts.offset;\n        if (offset) {\n            if (offset.left) {\n                this._html.wrapper.style.marginLeft = offset.left;\n            }\n            if (offset.top) {\n                this._html.wrapper.style.marginTop = offset.top;\n            }\n        }\n        // 2. Set the background color\n        const bg = this._opts.backgroundColor;\n        if (bg) {\n            this._html.contentWrapper.style.backgroundColor = bg;\n            if (this._opts.pointer) {\n                this._html.pointerBg.style[`border${capitalizePlacement(this._opts.placement)}Color`] = bg;\n            }\n        }\n        // 3. Padding\n        if (this._opts.padding) {\n            this._html.contentWrapper.style.padding = this._opts.padding;\n            if (this._opts.shadow) {\n                this._html.shadowFrame.style.padding = this._opts.padding;\n            }\n        }\n        // 4. Border radius\n        if (this._opts.borderRadius) {\n            this._html.contentWrapper.style.borderRadius = this._opts.borderRadius;\n            if (this._opts.shadow) {\n                this._html.shadowFrame.style.borderRadius = this._opts.borderRadius;\n            }\n        }\n        // 5. Font Size\n        if (this._opts.fontSize) {\n            this._html.wrapper.style.fontSize = this._opts.fontSize;\n        }\n        // 6. Font Color\n        if (this._opts.fontColor) {\n            this._html.contentWrapper.style.color = this._opts.fontColor;\n        }\n        // 7. Pointer\n        // Check if the pointer is enabled. Also make sure the value isn't just the boolean true.\n        if (this._opts.pointer && this._opts.pointer !== true) {\n            if (this._opts.shadow) {\n                this._html.shadowPointer.style.width = this._opts.pointer;\n                this._html.shadowPointer.style.height = this._opts.pointer;\n            }\n            if (this._html.pointerBorder) {\n                this._html.pointerBorder.style.borderWidth = this._opts.pointer;\n            }\n            this._html.pointerBg.style.borderWidth = this._opts.pointer;\n        }\n\n        // 8. Border\n        if (this._opts.border) {\n            // Calculate the border width\n            let bWidth = 0;\n            if (this._opts.border.width !== undefined) {\n                bWidth = parseAttribute(this._opts.border.width, '0px');\n                this._html.contentWrapper.style.borderWidth = bWidth.value + bWidth.units;\n            }\n            bWidth = Math.round((this._html.contentWrapper.offsetWidth -\n                     this._html.contentWrapper.clientWidth) / 2.0);\n            bWidth = parseAttribute(`${bWidth}px`, '0px');\n\n            if (this._opts.pointer) {\n                // Calculate the pointer length\n                let pLength = Math.min(this._html.pointerBorder.offsetHeight,\n                                       this._html.pointerBorder.offsetWidth);\n                pLength = parseAttribute(`${pLength}px`, '0px');\n\n                let triangleDiff = Math.round(bWidth.value * (_root2 - 1));\n                triangleDiff = Math.min(triangleDiff, pLength.value);\n\n                this._html.pointerBg.style.borderWidth =\n                    (pLength.value - triangleDiff) + pLength.units;\n\n                const reverseP = capitalizePlacement(oppositePlacement(this._opts.placement));\n                this._html.pointerBg.style[`margin${reverseP}`] =\n                    triangleDiff + bWidth.units;\n                this._html.pointerBg.style[this._opts.placement] =\n                    -bWidth.value + bWidth.units;\n            }\n            const color = this._opts.border.color;\n            if (color) {\n                this._html.contentWrapper.style.borderColor = color;\n                if (this._html.pointerBorder) {\n                    this._html.pointerBorder.style[`border${capitalizePlacement(this._opts.placement)}Color`] = color;\n                }\n            }\n        }\n        // 9. Shadow\n        if (this._opts.shadow) {\n            // Check if any of the shadow settings have actually been set\n            const shadow = this._opts.shadow;\n            const isSet = (attribute) => {\n                const v = shadow[attribute];\n                return v !== undefined && v != null;\n            };\n\n            if (isSet('h') || isSet('v') || isSet('blur') || isSet('spread') || isSet('color')) {\n                const hOffset = parseAttribute(shadow.h, _defaultShadow.h);\n                const vOffset = parseAttribute(shadow.v, _defaultShadow.v);\n                const blur = parseAttribute(shadow.blur, _defaultShadow.blur);\n                const spread = parseAttribute(shadow.spread, _defaultShadow.spread);\n                const color = shadow.color || _defaultShadow.color;\n                const formatBoxShadow = (h, v) => {\n                    return `${h} ${v} ${blur.original} ${spread.original} ${color}`;\n                };\n\n                this._html.shadowFrame.style.boxShadow =\n                    formatBoxShadow(hOffset.original, vOffset.original);\n\n                // Correctly rotate the shadows before the css transform\n                const hRotated = (_inverseRoot2 * (hOffset.value - vOffset.value)) + hOffset.units;\n                const vRotated = (_inverseRoot2 * (hOffset.value + vOffset.value)) + vOffset.units;\n                if (this._html.shadowPointerInner) {\n                    this._html.shadowPointerInner.style.boxShadow =\n                        formatBoxShadow(hRotated, vRotated);\n                }\n            }\n            if (this._opts.shadow.opacity) {\n                this._html.shadowWrapper.style.opacity = this._opts.shadow.opacity;\n            }\n        }\n\n        const divPixel = this.getProjection()\n            .fromLatLngToDivPixel(this._position || this._marker.position);\n        if (divPixel) {\n            this._html.floatWrapper.style.top = `${Math.floor(divPixel.y)}px`;\n            this._html.floatWrapper.style.left = `${Math.floor(divPixel.x)}px`;\n        }\n        if (!this._isOpen) {\n            this._isOpen = true;\n            this.resize();\n            this.reposition();\n            this.activateCallback('afterOpen');\n            google.maps.event.trigger(this.getMap(), `${_eventPrefix}opened`, this);\n        }\n    }\n\n    // Implementation of OverlayView onAdd method.\n    onAdd() {\n        if (this._html) {\n            return;\n        }\n        // Used for creating new elements\n        const applyCss = (element, args) => {\n            if (element && args) {\n                for (let i = 0; i < args.length; i++) {\n                    const className = args[i];\n                    if (className) {\n                        if (element.className) {\n                            element.className += ' ';\n                        }\n                        element.className += _classPrefix + className;\n                    }\n                }\n            }\n        };\n        const newElement = (...args) => {\n            const element = document.createElement('div');\n            applyCss(element, args);\n            return element;\n        };\n\n        this._html = {};\n\n        // 1. Create the wrapper\n        this._html.wrapper = newElement();\n        this.setWrapperClass(this._opts.wrapperClass);\n\n        // 2. Create the shadow\n        if (this._opts.shadow) {\n            this._html.shadowWrapper = newElement(\n                `shadow-wrapper-${this._opts.placement}`\n            );\n            this._html.shadowFrame = newElement(\n                'frame',\n                'shadow-frame'\n            );\n            this._html.shadowWrapper.appendChild(this._html.shadowFrame);\n\n            if (this._opts.pointer) {\n                this._html.shadowPointer = newElement(\n                    `shadow-pointer-${this._opts.placement}`\n                );\n                this._html.shadowPointerInner = newElement(\n                    `shadow-inner-pointer-${this._opts.placement}`\n                );\n                this._html.shadowPointer.appendChild(this._html.shadowPointerInner);\n                this._html.shadowWrapper.appendChild(this._html.shadowPointer);\n            }\n\n            this._html.wrapper.appendChild(this._html.shadowWrapper);\n        }\n\n        // 3. Create the content\n        this._html.contentWrapper = newElement(\n            'frame',\n            'content-wrapper'\n        );\n        this._html.content = newElement(\n            'content'\n        );\n        if (this._opts.content) {\n            setHTML(this._html.content, this._opts.content);\n        }\n\n        // 4. Create the close button\n        if (this._opts.showCloseButton) {\n            if (this._opts.closeButtonMarkup) {\n                const d = document.createElement('div');\n                setHTML(d, this._opts.closeButtonMarkup);\n                this._html.closeButton = d.firstChild;\n            } else {\n                this._html.closeButton = document.createElement('button');\n                this._html.closeButton.setAttribute('type', 'button');\n                this._html.closeButton.innerHTML = '&#215;';\n                applyCss(this._html.closeButton, ['close-button']);\n            }\n            this._html.contentWrapper.appendChild(this._html.closeButton);\n        }\n        this._html.contentWrapper.appendChild(this._html.content);\n        this._html.wrapper.appendChild(this._html.contentWrapper);\n\n        // 5. Create the pointer\n        if (this._opts.pointer) {\n            if (this._opts.border) {\n                this._html.pointerBorder = newElement(\n                    `pointer-${this._opts.placement}`,\n                    `pointer-border-${this._opts.placement}`\n                );\n                this._html.wrapper.appendChild(this._html.pointerBorder);\n            }\n            this._html.pointerBg = newElement(\n                `pointer-${this._opts.placement}`,\n                `pointer-bg-${this._opts.placement}`\n            );\n            this._html.wrapper.appendChild(this._html.pointerBg);\n        }\n\n        // Create an outer wrapper\n        this._html.floatWrapper = newElement(\n            'float-wrapper'\n        );\n        this._html.floatWrapper.appendChild(this._html.wrapper);\n\n        // Add the wrapper to the Google Maps float pane\n        this.getPanes().floatPane.appendChild(this._html.floatWrapper);\n\n        // Now add all the event listeners\n        const map = this.getMap();\n        this.clearListeners();\n        if (this._opts.closeOnMapClick) {\n            this.trackListener(google.maps.event.addListener(map, 'click', () => {\n                this.close();\n            }));\n        }\n        if (this._opts.closeWhenOthersOpen) {\n            this.trackListener(google.maps.event.addListener(map, `${_eventPrefix}opened`, (other) => {\n                if (this !== other) {\n                    this.close();\n                }\n            }));\n        }\n\n        // Clear out the previous map bounds\n        this._previousWidth = null;\n        this._previousHeight = null;\n        this.trackListener(google.maps.event.addListener(map, 'bounds_changed', () => {\n            const d = map.getDiv();\n            const ow = d.offsetWidth;\n            const oh = d.offsetHeight;\n            const pw = this._previousWidth;\n            const ph = this._previousHeight;\n            if (pw === null || ph === null || pw !== ow || ph !== oh) {\n                this._previousWidth = ow;\n                this._previousHeight = oh;\n                this.resize();\n            }\n        }));\n\n        // Marker moves\n        if (this._marker) {\n            this.trackListener(google.maps.event.addListener(this._marker,\n                'position_changed', () => {\n                    this.draw();\n                }));\n        }\n\n        // Close button\n        if (this._opts.showCloseButton && !this._opts.closeButtonMarkup) {\n            this.trackListener(google.maps.event.addDomListener(this._html.closeButton,\n                'click', (e) => {\n                    e.cancelBubble = true;\n                    if (e.stopPropagation) {\n                        e.stopPropagation();\n                    }\n                    this.close();\n                }));\n        }\n\n        // Stop the mouse event propagation\n        const mouseEvents = ['click', 'dblclick', 'rightclick', 'contextmenu',\n            'drag', 'dragend', 'dragstart',\n            'mousedown', 'mouseout', 'mouseover', 'mouseup',\n            'touchstart', 'touchend', 'touchmove',\n            'wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'];\n        mouseEvents.forEach((event) => {\n            this.trackListener(google.maps.event.addDomListener(this._html.wrapper,\n                event, (e) => {\n                    e.cancelBubble = true;\n                    if (e.stopPropagation) {\n                        e.stopPropagation();\n                    }\n                }));\n        });\n\n        this.activateCallback('open');\n    }\n\n    // Implementation of OverlayView onRemove method\n    onRemove() {\n        this.activateCallback('close');\n        if (this._html) {\n            const parent = this._html.floatWrapper.parentElement;\n            if (parent) {\n                parent.removeChild(this._html.floatWrapper);\n            }\n            this._html = null;\n        }\n        this._isOpen = false;\n        this.activateCallback('afterClose');\n    }\n\n    // The map inner bounds used for panning and resizing\n    getMapInnerBounds() {\n        const mb = this.getMap().getDiv().getBoundingClientRect();\n        const mib = {\n            top: mb.top + this._opts.edgeOffset.top,\n            right: mb.right - this._opts.edgeOffset.right,\n            bottom: mb.bottom - this._opts.edgeOffset.bottom,\n            left: mb.left + this._opts.edgeOffset.left\n        };\n        mib.width = mib.right - mib.left;\n        mib.height = mib.bottom - mib.top;\n        return mib;\n    }\n\n    // Pan the Google Map such that the info window is visible\n    reposition() {\n        if (!this._opts.panOnOpen || !this._html) {\n            return;\n        }\n        const mib = this.getMapInnerBounds();\n        const wb = this._html.wrapper.getBoundingClientRect();\n        let dx = 0;\n        let dy = 0;\n        if (mib.left >= wb.left) {\n            dx = wb.left - mib.left;\n        } else if (mib.right <= wb.right) {\n            dx = wb.left - (mib.right - wb.width);\n        }\n        if (mib.top >= wb.top) {\n            dy = wb.top - mib.top;\n        } else if (mib.bottom <= wb.bottom) {\n            dy = wb.top - (mib.bottom - wb.height);\n        }\n        if (dx !== 0 || dy !== 0) {\n            this.getMap().panBy(dx, dy);\n        }\n    }\n\n    // Resize the info window to fit within the map bounds and edge offset\n    resize() {\n        if (!this._html) {\n            return;\n        }\n        const mib = this.getMapInnerBounds();\n        // Handle the max width\n        let maxWidth = mib.width;\n        if (this._opts.maxWidth !== undefined) {\n            maxWidth = Math.min(maxWidth, this._opts.maxWidth);\n        }\n        maxWidth -= (this._html.wrapper.offsetWidth - this._html.content.offsetWidth);\n        this._html.content.style.maxWidth = `${maxWidth}px`;\n\n        // Handle the max height\n        let maxHeight = mib.height;\n        if (this._opts.maxHeight !== undefined) {\n            maxHeight = Math.min(maxHeight, this._opts.maxHeight);\n        }\n        maxHeight -= (this._html.wrapper.offsetHeight - this._html.content.offsetHeight);\n        this._html.content.style.maxHeight = `${maxHeight}px`;\n    }\n}\n"]}