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,KAAK,QACP,EAEA,EAAe,UAAU,QAAU,SAAS,GAC1C,GAAI,EAAa,OAAS,EAEtB,IADA,IAAI,EAAM,EAAa,OACjB,KACJ,KAAK,QAAQ,EAAa,QAEvB,CACL,IAAI,EAAW,KAAK,IAAI,UAAY,MAChC,EAAW,KAAK,IAAI,UAAY,MAChC,EAAa,KAAK,IAAI,YAAc,QACpC,EAAQ,EAER,EAAU,CAAE,OADH,IAAI,EAAM,OAAO,EAAM,GAAW,EAAM,KAGrD,EAAQ,GAAc,EAAM,GACxB,EAAM,SACR,EAAQ,OAAS,EAAM,QAEzB,KAAK,IAAM,KAAK,IAAI,KAAK,IAAK,EAAQ,IACtC,KAAK,IAAM,KAAK,IAAI,KAAK,IAAK,EAAQ,IACtC,KAAK,KAAK,KAAK,GACf,KAAK,QACP,CACJ,EAEO,CAET","file":"/npm/heatmap.js@2.0.5/plugins/gmaps-heatmap/gmaps-heatmap.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/heatmap.js@2.0.5/plugins/gmaps-heatmap/gmaps-heatmap.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*\n* heatmap.js Google Maps Overlay\n*\n* Copyright (c) 2008-2016, Patrick Wied (https://www.patrick-wied.at)\n* Dual-licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)\n* and the Beerware (http://en.wikipedia.org/wiki/Beerware) license.\n*/\n;(function (name, context, factory) {\n  // Supports UMD. AMD, CommonJS/Node.js and browser context\n  if (typeof module !== \"undefined\" && module.exports) {\n    module.exports = factory(\n      require('heatmap.js'),\n      require('google-maps')\n    );\n  } else if (typeof define === \"function\" && define.amd) {\n    define(['heatmap.js', 'google-maps'], factory);\n  } else {\n    // browser globals\n    if (typeof window.h337 === 'undefined') {\n      throw new Error('heatmap.js must be loaded before the gmaps heatmap plugin');\n    }\n    if (typeof window.google === 'undefined') {\n      throw new Error('Google Maps must be loaded before the gmaps heatmap plugin');\n    }\n    context[name] = factory(window.h337, window.google.maps);\n  }\n\n})(\"HeatmapOverlay\", this, function(h337, gmaps) {\n  'use strict';\n\n  var HeatmapOverlay = function(map, cfg){ \n    this.setMap(map);\n    this.initialize(cfg || {});\n  };\n\n  HeatmapOverlay.prototype = new gmaps.OverlayView();\n\n  HeatmapOverlay.CSS_TRANSFORM = (function() {\n    var div = document.createElement('div');\n    var props = [\n      'transform',\n      'WebkitTransform',\n      'MozTransform',\n      'OTransform',\n      'msTransform'\n    ];\n\n    for (var i = 0; i < props.length; i++) {\n      var prop = props[i];\n      if (div.style[prop] !== undefined) {\n        return prop;\n      }\n    }\n\n    return props[0];\n  })();\n\n  HeatmapOverlay.prototype.initialize = function(cfg) {\n    this.cfg = cfg;\n    \n    var map = this.map = this.getMap();\n    var container = this.container = document.createElement('div');\n    var mapDiv = map.getDiv();\n    var width = this.width = mapDiv.clientWidth;\n    var height = this.height = mapDiv.clientHeight;\n\n    container.style.cssText = 'width:' + width +'px;height:' + height+'px;';\n\n    this.data = [];\n    this.max = 1;\n    this.min = 0;\n\n    cfg.container = container;\n  };\n\n  HeatmapOverlay.prototype.onAdd = function(){\n    var that = this;\n\n    this.getPanes().overlayLayer.appendChild(this.container);\n\n\n    this.changeHandler = gmaps.event.addListener(\n      this.map,\n      'bounds_changed',\n      function() { return that.draw(); }\n    );\n   \n    if (!this.heatmap) {\n      this.heatmap = h337.create(this.cfg);\n    }\n    this.draw();\n  };\n\n  HeatmapOverlay.prototype.onRemove = function() { \n    if (!this.map) { return; }\n\n    this.map = null;\n\n    this.container.parentElement.removeChild(this.container);\n\n    if (this.changeHandler) {\n      gmaps.event.removeListener(this.changeHandler);\n      this.changeHandler = null;\n    }\n\n  };\n\n  HeatmapOverlay.prototype.draw = function() {\n    if (!this.map) { return; }\n\n    var bounds = this.map.getBounds();\n\n    var topLeft = new gmaps.LatLng(\n      bounds.getNorthEast().lat(),\n      bounds.getSouthWest().lng()\n    );\n\n    var projection = this.getProjection();\n    var point = projection.fromLatLngToDivPixel(topLeft);\n\n    this.container.style[HeatmapOverlay.CSS_TRANSFORM] = 'translate(' +\n        Math.round(point.x) + 'px,' +\n        Math.round(point.y) + 'px)';\n\n    this.update();\n  };\n\n  HeatmapOverlay.prototype.resize = function() {\n\n    if (!this.map){ return; }\n\n    var div = this.map.getDiv(),\n      width = div.clientWidth,\n      height = div.clientHeight;\n\n    if (width == this.width && height == this.height){ return; }\n\n    this.width = width;\n    this.height = height;\n\n    // update heatmap dimensions\n    this.heatmap._renderer.setDimensions(width, height);\n    // then redraw all datapoints with update\n    this.update();\n  };\n\n  HeatmapOverlay.prototype.update = function() {\n    var projection = this.getProjection(),\n      zoom, scale, bounds, topLeft;\n    var generatedData = { max: this.max, min: this.min, data: [] };\n\n    if (!projection){ return; }\n\n    bounds = this.map.getBounds();\n\n    topLeft = new gmaps.LatLng(\n      bounds.getNorthEast().lat(),\n      bounds.getSouthWest().lng()\n    );\n\n    zoom = this.map.getZoom();\n    scale = Math.pow(2, zoom);\n\n    this.resize();\n\n    if (this.data.length == 0) {\n      if (this.heatmap) {\n        this.heatmap.setData(generatedData);\n      }\n      return;\n    }\n\n\n    var latLngPoints = [];\n    // iterate through data \n    var len = this.data.length;\n    var layerProjection = this.getProjection();\n    var layerOffset = layerProjection.fromLatLngToDivPixel(topLeft);\n    var radiusMultiplier = this.cfg.scaleRadius ? scale : 1;\n    var localMax = 0;\n    var localMin = 0;\n    var valueField = this.cfg.valueField;\n\n\n    while (len--) {\n      var entry = this.data[len];\n      var value = entry[valueField];\n      var latlng = entry.latlng;\n\n\n      // we don't wanna render points that are not even on the map ;-)\n      if (!bounds.contains(latlng)) {\n        continue;\n      }\n      // local max is the maximum within current bounds\n      localMax = Math.max(value, localMax);\n      localMin = Math.min(value, localMin);\n\n      var point = layerProjection.fromLatLngToDivPixel(latlng);\n      var latlngPoint = { x: Math.round(point.x - layerOffset.x), y: Math.round(point.y - layerOffset.y) };\n      latlngPoint[valueField] = value;\n\n      var radius;\n\n      if (entry.radius) {\n        radius = entry.radius * radiusMultiplier;\n      } else {\n        radius = (this.cfg.radius || 2) * radiusMultiplier;\n      }\n      latlngPoint.radius = radius;\n      latLngPoints.push(latlngPoint);\n    }\n    if (this.cfg.useLocalExtrema) {\n      generatedData.max = localMax;\n      generatedData.min = localMin;\n    }\n\n    generatedData.data = latLngPoints;\n\n    this.heatmap.setData(generatedData);\n\n  };\n\n  HeatmapOverlay.prototype.setData = function(data) { \n    this.max = data.max;\n    this.min = data.min;\n\n    var latField = this.cfg.latField || 'lat';\n    var lngField = this.cfg.lngField || 'lng';\n    var valueField = this.cfg.valueField || 'value';\n\n    // transform data to latlngs\n    var data = data.data;\n    var len = data.length;\n    var d = [];\n\n    while (len--) {\n      var entry = data[len];\n      var latlng = new gmaps.LatLng(entry[latField], entry[lngField]);\n      var dataObj = { latlng: latlng };\n      dataObj[valueField] = entry[valueField];\n      if (entry.radius) {\n        dataObj.radius = entry.radius;\n      }\n      d.push(dataObj);\n    }\n    this.data = d;\n    this.update();\n  };\n  // experimential. not ready yet.\n  HeatmapOverlay.prototype.addData = function(pointOrArray) {\n    if (pointOrArray.length > 0) {\n        var len = pointOrArray.length;\n        while(len--) {\n          this.addData(pointOrArray[len]);\n        }\n      } else {\n        var latField = this.cfg.latField || 'lat';\n        var lngField = this.cfg.lngField || 'lng';\n        var valueField = this.cfg.valueField || 'value';\n        var entry = pointOrArray;\n        var latlng = new gmaps.LatLng(entry[latField], entry[lngField]);\n        var dataObj = { latlng: latlng };\n        \n        dataObj[valueField] = entry[valueField];\n        if (entry.radius) {\n          dataObj.radius = entry.radius;\n        }\n        this.max = Math.max(this.max, dataObj[valueField]);\n        this.min = Math.min(this.min, dataObj[valueField]);\n        this.data.push(dataObj);\n        this.update();\n      }\n  };\n\n  return HeatmapOverlay;\n\n});\n"]}