var dml_blmr = dml_blmr || {}; if (/localhost/g.test("https://bioluminc.com") || /192\.168\.0\./g.test("https://bioluminc.com")){ dml_blmr.logAllFlag = true; }else{ dml_blmr.logAllFlag = false; } dml_blmr.isEmbed = dml_blmr.isEmbed || true; dml_blmr.forced_language = dml_blmr.forced_language || ""; dml_blmr.addToBagFlag = false; if (!dml_blmr.bannerTexts){ dml_blmr.bannerTexts = { title: 'find your light', cta: 'show me how' }; } dml_blmr.widget_wrapper=document.getElementById("dml_blmr_wrapper"); //var dml_blmr.widget_wrapper = document.getElementById("dml_blmr_wrapper"); dml_blmr.debug = function(inStringBefore,inVariable){ if ( dml_blmr.logAllFlag){ inStringBefore = (inStringBefore === undefined) ? '' : inStringBefore; if (inVariable == undefined){ console.log(inStringBefore) }else{ console.log(inStringBefore, inVariable) } } } // GA - START dml_blmr.GAsetup = false; dml_blmr.sendGA = function(eventName,eventParameters = {}){ if (!window.gtag) return; if (!dml_blmr.GAsetup) return; var parametersAsString; try{ parametersAsString = JSON.stringify(eventParameters); dml_blmr.debug("GOOGLE ANALYTICS: " + eventName + " - " + parametersAsString); }catch(err){ console.warn("Error in GA event parameters - ",err); eventParameters={}; } window.gtag('event', eventName, eventParameters); } dml_blmr.setupGA = function(){ if (window.gtag) { dml_blmr.debug("setting up GA with 'gtag'"); window.gtag('config', "G-VE7MJHDRXR"); dml_blmr.GAsetup = true; } } // GA - END dml_blmr.getEmbedHtmlData = function(url, callback){ var request = new XMLHttpRequest(); request.open('GET', url, true); request.onload = function() { if (request.status >= 200 && request.status < 400) { callback({"status": "success","status_code":request.status, "data" : request.responseText}); } else { callback({"status": "success","status_code":request.status, "data" : "We reached our target server, but it returned an error"}); } }; request.onerror = function() { callback({"error": "success","status_code":request.status, "data" : "Error occured in getting html data"}); }; request.send(); } dml_blmr.getScript = function(source, callback) { var script = document.createElement('script'); script.async = 1; script.onload = function(evt) { callback({"status":"success","message":"done"}); }; script.onerror = function(err){ console.log(err) callback({"status":"error", "message":"error in getting script " + source}); } script.setAttribute('type','text/javascript'); script.src = source; dml_blmr.widget_wrapper.appendChild(script); } dml_blmr.getScript_withAttributes = function(source, attributeObj, callback) { var script = document.createElement('script'); script.async = 1; script.onload = function(evt) { callback({"status":"success","message":"done"}); }; script.onerror = function(err){ console.log(err) callback({"status":"error", "message":"error in getting script " + source}); } script.setAttribute('type','text/javascript'); try{ Object.keys(attributeObj).forEach( function(attrKey){ script.setAttribute(attrKey,attributeObj[attrKey]); }); }catch(err){ console.log(err); } script.src = source; dml_blmr.widget_wrapper.appendChild(script); } dml_blmr.openApp = function(){ var gaTimer = 100; var checkForWindowGA = true; var gacheckinterval = setInterval(function(){ if (window.gtag){ dml_blmr.debug("GA AVAILABLE - "+ gaTimer/1000 + "s",""); clearInterval(gacheckinterval); dml_blmr.setupGA(); }else{ if (checkForWindowGA){ if (window.ga){ checkForWindowGA = false; console.log("found ga but not gtag - adding gtag library"); dml_blmr.getScript("https://www.googletagmanager.com/gtag/js?id=G-VE7MJHDRXR",function(res){ window.dataLayer = window.dataLayer || []; window.gtag = function(){dataLayer.push(arguments);} gtag('js', new Date()); }); } } if (gaTimer > 20000){ dml_blmr.debug("GA NOT AVAILABLE - "+ gaTimer/1000 + "s"); clearInterval(gacheckinterval); } gaTimer += 100; } },100) if (document.getElementById("blmr_banner_container")){ document.getElementById("blmr_banner_container").style.display="none" } if (navigator.appName == 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/))){ setTimeout(function(){dml_blmr.sendGA("flow",{action: "showing browser not supported screen", page_title: "landing_page", page_location: window.location.hostname, page_path: window.location.pathname});},2000); //alert("We don't currently support this browser. Please reopen this page in a different browser.") if (!dml_blmr.isEmbed){ dml_blmr.widget_wrapper.style.height = window.innerHeight + "px"; } dml_blmr.widget_wrapper.innerHTML = '
We don\'t currently support this browser. Please reopen this page in a different browser, such as Chrome.