(()=>{function e(e,t){var a=null;return e&&("string"==typeof t?a=e.properties[t]:"function"==typeof t&&(a=t(e))),a}function t(a,o){var i=[];if(null==a)return i;if("string"==typeof a&&(a=JSON.parse(a)),"Topology"===a.type){var r=[];for(var n in a.objects){var s=topojson.feature(a,a.objects[n]);L.Util.isArray(s)?r=r.concat(s):"features"in s?r=r.concat(s.features):r.push(s)}return t(r,o)}var l=L.Util.isArray(a)?a:a.features;return l?$.each(l,(function(a,r){var n=null,s=null;"Point"===r.geometry.type?(n=parseFloat(r.geometry.coordinates[1]),s=parseFloat(r.geometry.coordinates[0]),n&&s&&(o?i.push([n,s,e(r,o)]):i.push([n,s]))):"MultiPoint"===r.geometry.type&&(i=i.concat(t(r,o)))})):"Feature"===a.type&&$.each(a.geometry.coordinates,(function(t,r){var n,s;n=parseFloat(r[1]),s=parseFloat(r[0]),n&&s&&(o?i.push([n,s,e(a,o)]):i.push([n,s]))})),i}function a(e,a,o,i,r,n){var s=t(a,o);if(!$.isEmptyObject(s)){var l=L.heatLayer(s,n);e.layerManager.addLayer(l,"heatmap",i,r)}}LeafletWidget.methods.addHeatmap=function(e,t,a,o){if(!$.isEmptyObject(e)){var i=L.heatLayer(e,o);this.layerManager.addLayer(i,"heatmap",t,a)}},LeafletWidget.methods.addGeoJSONHeatmap=function(e,t,o,i,r){var n=this;LeafletWidget.utils.isURL(e)?$.getJSON(e,(function(e){a(n,e,t,o,i,r)})):a(n,e,t,o,i,r)},LeafletWidget.methods.addKMLHeatmap=function(e,t,o,i,r){var n=this;if(LeafletWidget.utils.isURL(e))$.getJSON(e,(function(e){var s=toGeoJSON.kml(LeafletWidget.utils.parseXML(e));a(n,s,t,o,i,r)}));else{var s=toGeoJSON.kml(LeafletWidget.utils.parseXML(e));a(n,s,t,o,i,r)}},LeafletWidget.methods.addCSVHeatmap=function(e,t,o,i,r,n){var s=this;LeafletWidget.utils.isURL(e)?$.getJSON(e,(function(e){csv2geojson.csv2geojson(e,n||{},(function(e,n){a(s,n,t,o,i,r)}))})):csv2geojson.csv2geojson(e,n||{},(function(e,n){a(s,n,t,o,i,r)}))},LeafletWidget.methods.addGPXHeatmap=function(e,t,o,i,r){var n=this;if(LeafletWidget.utils.isURL(e))$.getJSON(e,(function(e){var s=toGeoJSON.gpx(LeafletWidget.utils.parseXML(e));a(n,s,t,o,i,r)}));else{var s=toGeoJSON.gpx(LeafletWidget.utils.parseXML(e));a(n,s,t,o,i,r)}},LeafletWidget.methods.removeHeatmap=function(e){this.layerManager.removeLayer("heatmap",e)},LeafletWidget.methods.clearHeatmap=function(){this.layerManager.clearLayers("heatmap")}})();