text: !function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).ConfigBootstrapper=f()}}(function(){return function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({1:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};function ConfigBootstrapper(options){var cbs=this;(options="object"==(void 0===options?"undefined":_typeof(options))?options:{}).refreshRate=options.refreshRate||300,options.refreshRateMs=1e3*options.refreshRate,options.dataStorageKey=options.dataStorageKey||"configBootstrapper.data",options.timestampStorageKey=options.timestampStorageKey||"configBootstrapper.timestamp",options.timeout=options.timeout||4e3,cbs.options=options,cbs.isReady=!1,cbs.timeoutCounter=0,cbs.readyPollRate=50,cbs._loadData(),setTimeout(function refreshHandler(){cbs._loadData(),setTimeout(refreshHandler,options.refreshRateMs)},options.refreshRateMs)}(exports.default=ConfigBootstrapper).prototype.markAsReady=function(){this.isReady=!0},ConfigBootstrapper.prototype.ready=function(callback){var cbs=this;cbs.isReady?callback(cbs.getData()):cbs.timeoutCounter<=cbs.options.timeout?(cbs.timeoutCounter=cbs.timeoutCounter+cbs.readyPollRate,setTimeout(function(){cbs.ready(callback)},cbs.readyPollRate)):callback(cbs.getData())},ConfigBootstrapper.prototype.getData=function(){var data={};try{data=JSON.parse(localStorage.getItem(this.options.dataStorageKey))||{}}catch(e){}return data},ConfigBootstrapper.prototype._loadData=function(){var cbs,ts,now,xhr;cbs=this,ts=parseInt(localStorage.getItem(cbs.options.timestampStorageKey),10),now=Date.now(),!ts||now>=ts+cbs.options.refreshRateMs?((xhr=new XMLHttpRequest).open("GET",cbs.options.url,!0),xhr.onreadystatechange=function(){4==xhr.readyState&&(200==xhr.status&&(localStorage.setItem(cbs.options.dataStorageKey,xhr.responseText),localStorage.setItem(cbs.options.timestampStorageKey,now)),cbs.markAsReady())},xhr.send()):cbs.markAsReady()}},{}]},{},[1])(1)});
  //# sourceMappingURL=config-bootstrapper.min.js.map
  