{"version":3,"file":"webpack-chunks/chunk.node_modules_load-google-maps-api_index_js.a7ba402b94f53d17c915.js","mappings":";;;;;;;;AAAA;AACA;;AAEA;;AAEA;;AAEA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,cAAc;AAChD;AACA;AACA,yBAAyB,IAAI,GAAG,aAAa;AAC7C;AACA,OAAO;AACP;AACA,iCAAiC,4BAA4B;AAC7D;AACA,6BAA6B,0BAA0B,GAAG,iBAAiB;;AAE3E;AACA;AACA,KAAK;AACL;AACA","sources":["webpack://freightliner/./node_modules/load-google-maps-api/index.js"],"sourcesContent":["const API_URL = 'https://maps.googleapis.com/maps/api/js'\nconst CALLBACK_NAME = '__googleMapsApiOnLoadCallback'\n\nconst optionsKeys = ['channel', 'client', 'key', 'language', 'region', 'v']\n\nlet promise = null\n\nmodule.exports = function (options = {}) {\n promise =\n promise ||\n new Promise(function (resolve, reject) {\n // Reject the promise after a timeout\n const timeoutId = setTimeout(function () {\n window[CALLBACK_NAME] = function () {} // Set the on load callback to a no-op\n reject(new Error('Could not load the Google Maps API'))\n }, options.timeout || 10000)\n\n // Hook up the on load callback\n window[CALLBACK_NAME] = function () {\n if (timeoutId !== null) {\n clearTimeout(timeoutId)\n }\n resolve(window.google.maps)\n delete window[CALLBACK_NAME]\n }\n\n // Prepare the `script` tag to be inserted into the page\n const scriptElement = document.createElement('script')\n const params = [`callback=${CALLBACK_NAME}`]\n optionsKeys.forEach(function (key) {\n if (options[key]) {\n params.push(`${key}=${options[key]}`)\n }\n })\n if (options.libraries && options.libraries.length) {\n params.push(`libraries=${options.libraries.join(',')}`)\n }\n scriptElement.src = `${options.apiUrl || API_URL}?${params.join('&')}`\n\n // Insert the `script` tag\n document.body.appendChild(scriptElement)\n })\n return promise\n}\n"],"names":[],"sourceRoot":""}