text: !function(e,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a(require("babel-runtime/helpers/toConsumableArray"),require("babel-runtime/core-js/promise"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/createClass"),require("babel-polyfill"));else if("function"==typeof define&&define.amd)define(["babel-runtime/helpers/toConsumableArray","babel-runtime/core-js/promise","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/createClass","babel-polyfill"],a);else{var t="object"==typeof exports?a(require("babel-runtime/helpers/toConsumableArray"),require("babel-runtime/core-js/promise"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/createClass"),require("babel-polyfill")):a(e["babel-runtime/helpers/toConsumableArray"],e["babel-runtime/core-js/promise"],e["babel-runtime/helpers/classCallCheck"],e["babel-runtime/helpers/createClass"],e["babel-polyfill"]);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(this,function(e,a,t,r,o){return function(e){function a(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}var t={};return a.m=e,a.c=t,a.p="",a(0)}([function(e,a,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,a){return a?[].concat((0,i.default)(document.querySelectorAll(e))).map(function(e){return new b(e,a)}):void s()}function s(){console.warn("No Google Maps API key provided, please pass key as second argument.")}Object.defineProperty(a,"__esModule",{value:!0}),a.lazymaps=a.GMap=a.GOOGLE_MAPS_API=void 0;var l=t(1),i=r(l),n=t(2),p=r(n),u=t(3),c=r(u),m=t(4),d=r(m);t(5);var f=a.GOOGLE_MAPS_API="https://maps.googleapis.com/maps/api/js",b=function(){function e(a,t){return(0,c.default)(this,e),t?(this.map=a,this.googleMap={},this.markers=[],this.infoWindows=[],this.googleMapsSrc=f+"?key="+t,this.setUpGoogleMaps()):void s()}return(0,d.default)(e,[{key:"setUpGoogleMaps",value:function(){return this.installGoogleMapsApi().then(this.createMap.bind(this))}},{key:"installGoogleMapsApi",value:function(){if(!this.isGoogleMapsApiInstalled()){var e=document.createElement("script");e.src=this.googleMapsSrc,document.head.appendChild(e)}return new p.default(function(e){function a(){if(window.google&&window.google.maps)return void e();setTimeout(a,100)}setTimeout(a,100)})}},{key:"isGoogleMapsApiInstalled",value:function(){var e=this;return!![].concat((0,i.default)(document.scripts)).find(function(a){return a.src===e.googleMapsSrc})}},{key:"createMap",value:function(){var e=this;return new p.default(function(a,t){e.map.dataset.coordinates&&e.map.dataset.zoom||(s(),t());var r=parseFloat(e.map.dataset.coordinates.split(",")[0]),o=parseFloat(e.map.dataset.coordinates.split(",")[1]),l=parseInt(e.map.dataset.zoom),i=e.map.dataset.markers?JSON.parse(e.map.dataset.markers):[],n=e.map.dataset.disableDefaultUi||!1,p=e.map.dataset.disableInfoWindows||!1,u=e.map.dataset.infowindow?JSON.parse(e.map.dataset.infowindow):{};r&&o&&l||(console.warn("Parsing failed, please provide data-coordinates as commas separated lat/lng pair and data-zoom as number."),t()),e.googleMap=new google.maps.Map(e.map,{center:{lat:r,lng:o},zoom:l,disableDefaultUI:n}),e.markers=i.map(function(a){var t=parseFloat(a.latitude),r=parseFloat(a.longitude),o=new google.maps.Marker({map:e.googleMap,position:{lat:t,lng:r},title:a.title,optimized:!1});if(!p){var s=new google.maps.InfoWindow(u);s.setContent(a.html||"<h1>"+a.title+"</h1><p>"+a.description+"</p>"),o.addListener("click",function(){s.open(e.googleMap,o)}),e.infoWindows.push(s)}return o}),a(e)})}}]),e}();a.default=b,a.GMap=b,a.lazymaps=o},function(e,a){e.exports=require("babel-runtime/helpers/toConsumableArray")},function(e,a){e.exports=require("babel-runtime/core-js/promise")},function(e,a){e.exports=require("babel-runtime/helpers/classCallCheck")},function(e,a){e.exports=require("babel-runtime/helpers/createClass")},function(e,a){e.exports=require("babel-polyfill")}])});