Skip to content

Instantly share code, notes, and snippets.

@avilaj
Created August 23, 2017 22:36
Show Gist options
  • Save avilaj/ac8faae397a0b849ce77e257d17e2bab to your computer and use it in GitHub Desktop.
Save avilaj/ac8faae397a0b849ce77e257d17e2bab to your computer and use it in GitHub Desktop.
/*
* Copyright (c) 2011, Yahoo! Inc. All rights reserved.
* Copyright (c) 2011-2012, Log-Normal, Inc. All rights reserved.
* Copyright (c) 2012-2016, SOASTA, Inc. All rights reserved.
* Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms.
*/
/* JavaScript MD5 1.0.1 Copyright 2011, Sebastian Tschan. Licensed under the MIT license. */
/* Boomerang Version: 1.0.1503526070 */
function BOOMR_check_doc_domain(a){if(window){if(!a){if(window.parent===window||!document.getElementById("boomr-if-as"))return;if(window.BOOMR&&BOOMR.boomerang_frame&&BOOMR.window)try{BOOMR.boomerang_frame.document.domain!==BOOMR.window.document.domain&&(BOOMR.boomerang_frame.document.domain=BOOMR.window.document.domain)}catch(b){BOOMR.isCrossOriginError(b)||BOOMR.addError(b,"BOOMR_check_doc_domain.domainFix")}a=document.domain}if(-1!==a.indexOf(".")){try{window.parent.document;return}catch(b){document.domain=a}try{window.parent.document;return}catch(b){a=a.replace(/^[\w\-]+\./,"")}BOOMR_check_doc_domain(a)}}}BOOMR_start=(new Date).getTime();BOOMR_check_doc_domain();!function(a){var b,c,d,e,f,g,h,i,j=a;if(a.parent!==a&&document.getElementById("boomr-if-as")&&"script"===document.getElementById("boomr-if-as").nodeName.toLowerCase()){a=a.parent;e=document.getElementById("boomr-if-as").src}d=a.document;a.BOOMR||(a.BOOMR={});BOOMR=a.BOOMR;if(!BOOMR.version){BOOMR.version="1.0.1503526070";BOOMR.window=a;BOOMR.boomerang_frame=j;BOOMR.plugins||(BOOMR.plugins={});!function(){try{void 0!==new a.CustomEvent("CustomEvent")&&(f=function(b,c){return new a.CustomEvent(b,c)})}catch(b){}try{!f&&d.createEvent&&d.createEvent("CustomEvent")&&(f=function(a,b){var c=d.createEvent("CustomEvent");b=b||{cancelable:!1,bubbles:!1};c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail);return c})}catch(b){}!f&&d.createEventObject&&(f=function(a,b){var c=d.createEventObject();c.type=c.propertyName=a;c.detail=b.detail;return c});f||(f=function(){})}();g=function(a,b,c){function e(){try{d.dispatchEvent?d.dispatchEvent(g):d.fireEvent&&d.fireEvent("onpropertychange",g)}catch(b){BOOMR.debug("Error when dispatching "+a)}}var g=f(a,{detail:b});g&&(c?BOOMR.setImmediate(e):e())};if(void 0!==document.hidden){h="visibilityState";i="visibilitychange"}else if(void 0!==document.mozHidden){h="mozVisibilityState";i="mozvisibilitychange"}else if(void 0!==document.msHidden){h="msVisibilityState";i="msvisibilitychange"}else if(void 0!==document.webkitHidden){h="webkitVisibilityState";i="webkitvisibilitychange"}b={beacon_url:"",beacon_type:"AUTO",beacon_auth_key:"Authorization",beacon_auth_token:void 0,site_domain:a.location.hostname.replace(/.*?([^.]+\.[^.]+)\.?$/,"$1").toLowerCase(),user_ip:"",autorun:!0,hasSentPageLoadBeacon:!1,r:void 0,r2:void 0,events:{page_ready:[],page_unload:[],before_unload:[],dom_loaded:[],visibility_changed:[],prerender_to_visible:[],before_beacon:[],onbeacon:[],page_load_beacon:[],xhr_load:[],click:[],form_submit:[],onconfig:[],xhr_init:[],spa_init:[],spa_navigation:[],xhr_send:[]},public_events:{before_beacon:"onBeforeBoomerangBeacon",onbeacon:"onBoomerangBeacon",onboomerangloaded:"onBoomerangLoaded"},listenerCallbacks:{},vars:{},varPriority:{"-1":{},1:{}},errors:{},disabled_plugins:{},xb_handler:function(c){return function(d){var e;d||(d=a.event);d.target?e=d.target:d.srcElement&&(e=d.srcElement);3===e.nodeType&&(e=e.parentNode);e&&"OBJECT"===e.nodeName.toUpperCase()&&"application/x-shockwave-flash"===e.type||b.fireEvent(c,e)}},clearEvents:function(){var a;for(a in this.events)this.events.hasOwnProperty(a)&&(this.events[a]=[])},clearListeners:function(){var a;for(a in b.listenerCallbacks)if(b.listenerCallbacks.hasOwnProperty(a))for(;b.listenerCallbacks[a].length;)BOOMR.utils.removeListener(b.listenerCallbacks[a][0].el,a,b.listenerCallbacks[a][0].fn);b.listenerCallbacks={}},fireEvent:function(a,b){var c,d,e,f;a=a.toLowerCase();if(this.events.hasOwnProperty(a)){this.public_events.hasOwnProperty(a)&&g(this.public_events[a],b);e=this.events[a];"before_beacon"!==a&&"onbeacon"!==a&&BOOMR.real_sendBeacon();f=e.length;for(c=0;c<f;c++)try{d=e[c];d.fn.call(d.scope,b,d.cb_data)}catch(h){BOOMR.addError(h,"fireEvent."+a+"<"+c+">")}for(c=0;c<f;c++)if(e[c].once){e.splice(c,1);f--;c--}}},spaNavigation:function(){b.onloadfired=!0}};c={t_start:BOOMR_start,url:e,constants:{BEACON_TYPE_SPAS:["spa","spa_hard"],MAX_GET_LENGTH:2e3},utils:{objectToString:function(a,b,c){var d,e=[];if(!a||"object"!=typeof a)return a;void 0===b&&(b="\n\t");c||(c=0);if("[object Array]"===Object.prototype.toString.call(a)){for(d=0;d<a.length;d++)c>0&&null!==a[d]&&"object"==typeof a[d]?e.push(this.objectToString(a[d],b+("\n\t"===b?"\t":""),c-1)):"&"===b?e.push(encodeURIComponent(a[d])):e.push(a[d]);b=","}else for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c>0&&null!==a[d]&&"object"==typeof a[d]?e.push(encodeURIComponent(d)+"="+this.objectToString(a[d],b+("\n\t"===b?"\t":""),c-1)):"&"===b?e.push(encodeURIComponent(d)+"="+encodeURIComponent(a[d])):e.push(d+"="+a[d]));return e.join(b)},getCookie:function(a){if(!a)return null;a=" "+a+"=";var b,c;c=" "+d.cookie+";";if((b=c.indexOf(a))>=0){b+=a.length;c=c.substring(b,c.indexOf(";",b)).replace(/^"/,"").replace(/"$/,"");return c}},setCookie:function(a,c,e){var f,g,h,i,j;if(!a||!b.site_domain){BOOMR.debug("No cookie name or site domain: "+a+"/"+b.site_domain);return!1}f=this.objectToString(c,"&");g=a+'="'+f+'"';i=[g,"path=/","domain="+b.site_domain];if(e){j=new Date;j.setTime(j.getTime()+1e3*e);j=j.toGMTString();i.push("expires="+j)}if(g.length<500){d.cookie=i.join("; ");h=this.getCookie(a);if(f===h)return!0;BOOMR.warn("Saved cookie value doesn't match what we tried to set:\n"+f+"\n"+h)}else BOOMR.warn("Cookie too long: "+g.length+" "+g);return!1},getSubCookies:function(a){var b,c,d,e,f=!1,g={};if(!a)return null;if("string"!=typeof a){BOOMR.debug("TypeError: cookie is not a string: "+typeof a);return null}b=a.split("&");for(c=0,d=b.length;c<d;c++){e=b[c].split("=");if(e[0]){e.push("");g[decodeURIComponent(e[0])]=decodeURIComponent(e[1]);f=!0}}return f?g:null},removeCookie:function(a){return this.setCookie(a,{},-86400)},cleanupURL:function(a,c){if(!a||"[object Array]"===Object.prototype.toString.call(a))return"";b.strip_query_string&&(a=a.replace(/\?.*/,"?qs-redacted"));if(void 0!==c&&a&&a.length>c){var d=a.indexOf("?");a=-1!==d&&d<c?a.substr(0,d)+"?...":a.substr(0,c-3)+"..."}return a},hashQueryString:function(a,b){if(!a)return a;if(!a.match){BOOMR.addError("TypeError: Not a string","hashQueryString",typeof a);return""}a.match(/^\/\//)&&(a=location.protocol+a);if(!a.match(/^(https?|file):/)){BOOMR.error("Passed in URL is invalid: "+a);return""}b&&(a=a.replace(/#.*/,""));return BOOMR.utils.MD5?a.replace(/\?([^#]*)/,function(a,b){return"?"+(b.length>10?BOOMR.utils.MD5(b):b)}):a},pluginConfig:function(a,b,c,d){var e,f=0;if(!b||!b[c])return!1;for(e=0;e<d.length;e++)if(void 0!==b[c][d[e]]){a[d[e]]=b[c][d[e]];f++}return f>0},arrayFilter:function(a,b){var c=[];if("function"==typeof a.filter)c=a.filter(b);else for(var d,e=-1,f=a.length;++e<f;){d=a[e];b(d,e,a)&&(c[c.length]=d)}return c},addObserver:function(a,b,c,d,e,f){function g(a){var b=!1;if(h.timer){clearTimeout(h.timer);h.timer=null}if(d){b=d.call(f,a,e);b||(d=null)}if(!b&&h.observer){h.observer.disconnect();h.observer=null}"number"==typeof b&&b>0&&(h.timer=setTimeout(g,b))}var h={observer:null,timer:null};if(!(BOOMR.window&&BOOMR.window.MutationObserver&&d&&a))return null;h.observer=new BOOMR.window.MutationObserver(g);c&&(h.timer=setTimeout(g,h.timeout));h.observer.observe(a,b);return h},addListener:function(a,c,d){a.addEventListener?a.addEventListener(c,d,!1):a.attachEvent&&a.attachEvent("on"+c,d);b.listenerCallbacks[c]=b.listenerCallbacks[c]||[];b.listenerCallbacks[c].push({el:a,fn:d})},removeListener:function(a,c,d){var e;a.removeEventListener?a.removeEventListener(c,d,!1):a.detachEvent&&a.detachEvent("on"+c,d);if(b.listenerCallbacks.hasOwnProperty(c))for(var e=0;e<b.listenerCallbacks[c].length;e++)if(d===b.listenerCallbacks[c][e].fn&&a===b.listenerCallbacks[c][e].el){b.listenerCallbacks[c].splice(e,1);return}},pushVars:function(a,b,c){var d,e,f,g=0;for(d in b)if(b.hasOwnProperty(d))if("[object Array]"===Object.prototype.toString.call(b[d]))for(e=0;e<b[d].length;++e)g+=BOOMR.utils.pushVars(a,b[d][e],d+"["+e+"]");else{f=document.createElement("input");f.type="hidden";f.name=c?c+"["+d+"]":d;f.value=void 0===b[d]||null===b[d]?"":b[d];a.appendChild(f);g+=encodeURIComponent(f.name).length+encodeURIComponent(f.value).length+2}return g},isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},inArray:function(a,b){var c;if(void 0===a||void 0===b||!b.length)return!1;for(c=0;c<b.length;c++)if(b[c]===a)return!0;return!1},getQueryParamValue:function(a,b){var c,d,e,f;if(!a)return null;if("string"==typeof b){c=BOOMR.window.document.createElement("a");c.href=b}else c="object"==typeof b&&"string"==typeof b.search?b:BOOMR.window.location;d=c.search.slice(1).split(/&/);for(e=0;e<d.length;e++)if(d[e]){f=d[e].split("=");if(f.length&&f[0]===a)return decodeURIComponent(f[1].replace(/\+/g," "))}return null},generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)})},generateId:function(a){return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".substr(0,a||40).replace(/x/g,function(a){var a=(Math.random()||.01).toString(36);return"0"===a?"0":a.substr(2,1)})}},init:function(c){var e,f,g=["beacon_url","beacon_type","beacon_auth_key","beacon_auth_token","site_domain","user_ip","strip_query_string","secondary_beacons","autorun","site_domain"];BOOMR_check_doc_domain();c||(c={});this.pageId||(this.pageId=BOOMR.utils.generateId(8));if(c.primary&&b.handlers_attached)return this;void 0!==c.log&&(this.log=c.log);this.log||(this.log=function(){});void 0!==c.autorun&&(b.autorun=c.autorun);for(f in this.plugins)if(this.plugins.hasOwnProperty(f)){if(c[f]&&c[f].hasOwnProperty("enabled")&&!1===c[f].enabled){b.disabled_plugins[f]=1;"function"==typeof this.plugins[f].disable&&this.plugins[f].disable();continue}if(b.disabled_plugins[f]){if(!c[f]||!c[f].hasOwnProperty("enabled")||!0!==c[f].enabled)continue;"function"==typeof this.plugins[f].enable&&this.plugins[f].enable();delete b.disabled_plugins[f]}if("function"==typeof this.plugins[f].init)try{this.plugins[f].init(c)}catch(h){BOOMR.addError(h,f+".init")}}for(e=0;e<g.length;e++)void 0!==c[g[e]]&&(b[g[e]]=c[g[e]]);if(b.handlers_attached)return this;if(!b.onloadfired&&(void 0===c.autorun||!1!==c.autorun))if(d.readyState&&"complete"===d.readyState){BOOMR.loadedLate=!0;this.setImmediate(BOOMR.page_ready_autorun,null,null,BOOMR)}else a.onpagehide||null===a.onpagehide?BOOMR.utils.addListener(a,"pageshow",BOOMR.page_ready_autorun):BOOMR.utils.addListener(a,"load",BOOMR.page_ready_autorun);BOOMR.utils.addListener(a,"DOMContentLoaded",function(){b.fireEvent("dom_loaded")});BOOMR.fireEvent("onconfig",c);BOOMR.subscribe("onconfig",function(a){a.beacon_url&&(b.beacon_url=a.beacon_url)});BOOMR.subscribe("spa_navigation",b.spaNavigation,null,b);!function(){var c,e;if(void 0!==i){BOOMR.utils.addListener(d,i,function(){b.fireEvent("visibility_changed")});b.lastVisibilityState=BOOMR.visibilityState();BOOMR.subscribe("visibility_changed",function(){var a=BOOMR.visibilityState();BOOMR.lastVisibilityEvent[a]=BOOMR.now();BOOMR.debug("Visibility changed from "+b.lastVisibilityState+" to "+a);if("prerender"===b.lastVisibilityState&&"prerender"!==a){BOOMR.addVar("vis.pre","1");b.fireEvent("prerender_to_visible")}b.lastVisibilityState=a})}BOOMR.utils.addListener(d,"mouseup",b.xb_handler("click"));c=d.getElementsByTagName("form");for(e=0;e<c.length;e++)BOOMR.utils.addListener(c[e],"submit",b.xb_handler("form_submit"));a.onpagehide||null===a.onpagehide||BOOMR.utils.addListener(a,"unload",function(){BOOMR.window=a=null})}();b.handlers_attached=!0;return this},attach_page_ready:function(b){d.readyState&&"complete"===d.readyState?this.setImmediate(b,null,null,BOOMR):a.onpagehide||null===a.onpagehide?BOOMR.utils.addListener(a,"pageshow",b):BOOMR.utils.addListener(a,"load",b)},page_ready_autorun:function(a){b.autorun&&BOOMR.page_ready(a)},page_ready:function(c){c||(c=a.event);c||(c={name:"load"});if(b.onloadfired)return this;b.fireEvent("page_ready",c);b.onloadfired=!0;return this},onloadFired:function(){return b.onloadfired},setImmediate:function(b,c,d,e){var f,g;if("undefined"!=typeof Error){g=new Error;g=g.stack?g.stack.replace(/^Error/,"Called"):void 0}f=function(){b.call(e||null,c,d||{},g);f=null};a.requestIdleCallback?a.requestIdleCallback(f):a.setImmediate?a.setImmediate(f):setTimeout(f,10)},now:function(){return Date.now||function(){return(new Date).getTime()}}(),getPerformance:function(){try{if(BOOMR.window)return"performance"in BOOMR.window&&BOOMR.window.performance?BOOMR.window.performance:BOOMR.window.msPerformance||BOOMR.window.webkitPerformance||BOOMR.window.mozPerformance}catch(a){}},visibilityState:void 0===h?function(){return"visible"}:function(){return d[h]},lastVisibilityEvent:{},registerEvent:function(a){if(b.events.hasOwnProperty(a))return this;b.events[a]=[];return this},disable:function(){b.clearEvents();b.clearListeners()},fireEvent:function(a,c){return b.fireEvent(a,c)},subscribe:function(c,d,e,f,g){var h,i,j;c=c.toLowerCase();b.events.hasOwnProperty(c)||(b.events[c]=[]);j=b.events[c];for(h=0;h<j.length;h++){i=j[h];if(i&&i.fn===d&&i.cb_data===e&&i.scope===f)return this}j.push({fn:d,cb_data:e||{},scope:f||null,once:g||!1});"page_ready"===c&&b.onloadfired&&b.autorun&&this.setImmediate(d,null,e,f);"page_unload"!==c&&"before_unload"!==c||function(){var g,h=j.length;g=function(g){d&&d.call(f,g||a.event,e);"page_unload"===c&&h===b.events[c].length&&BOOMR.real_sendBeacon()};"page_unload"===c&&(a.onpagehide||null===a.onpagehide?BOOMR.utils.addListener(a,"pagehide",g):BOOMR.utils.addListener(a,"unload",g));BOOMR.utils.addListener(a,"beforeunload",g)}();return this},addError:function(a,c,d){var e,f=BOOMR.plugins.Errors;if(f&&f.is_supported())if("string"==typeof a)f.send({message:a,extra:d,functionName:c,noStack:!0},f.VIA_APP,f.SOURCE_BOOMERANG);else{"string"==typeof c&&(a.functionName=c);void 0!==d&&(a.extra=d);f.send(a,f.VIA_APP,f.SOURCE_BOOMERANG)}else{if("string"!=typeof a){e=String(a);e.match(/^\[object/)&&(e=a.name+": "+(a.description||a.message).replace(/\r\n$/,""));a=e}void 0!==c&&(a="["+c+":"+BOOMR.now()+"] "+a);d&&(a+=":: "+d);b.errors[a]?b.errors[a]++:b.errors[a]=1}},isCrossOriginError:function(a){return"SecurityError"===a.name||"TypeError"===a.name&&"Permission denied"===a.message||"Error"===a.name&&a.message&&a.message.match(/^(Permission|Access is) denied/)},addVar:function(a,c){if("string"==typeof a)b.vars[a]=c;else if("object"==typeof a){var d,e=a;for(d in e)e.hasOwnProperty(d)&&(b.vars[d]=e[d])}return this},removeVar:function(a){var c,d;if(!arguments.length)return this;d=1===arguments.length&&"[object Array]"===Object.prototype.toString.apply(a)?a:arguments;for(c=0;c<d.length;c++)b.vars.hasOwnProperty(d[c])&&delete b.vars[d[c]];return this},hasVar:function(a){return b.vars.hasOwnProperty(a)},setVarPriority:function(a,c){if("number"!=typeof c||1!==Math.abs(c))return this;b.varPriority[c][a]=1;return this},setReferrer:function(a,c){b.r=a;b.r2=c&&a!==c?c:void 0},requestStart:function(a){var b=BOOMR.now();BOOMR.plugins.RT.startTimer("xhr_"+a,b);return{loaded:function(c){BOOMR.responseEnd(a,b,c)}}},readyToSend:function(){var a;for(a in this.plugins)if(this.plugins.hasOwnProperty(a)){if(b.disabled_plugins[a])continue;if("function"==typeof this.plugins[a].readyToSend&&!1===this.plugins[a].readyToSend()){BOOMR.debug("Plugin "+a+" is not ready to send");return!1}}return!0},responseEnd:function(a,c,d,e){c="number"==typeof c?c:BOOMR.now();e="number"==typeof e?e:BOOMR.now();if(BOOMR.readyToSend())if(BOOMR.hasSentPageLoadBeacon()||BOOMR.utils.inArray(a.initiator,BOOMR.constants.BEACON_TYPE_SPAS))if("object"==typeof a){if(!a.url){BOOMR.debug("BOOMR.responseEnd: First argument must have a url property if it's an object");return}b.fireEvent("xhr_load",a)}else{BOOMR.real_sendBeacon();BOOMR.addVar("xhr.pg",a);BOOMR.plugins.RT.startTimer("xhr_"+a,c);b.fireEvent("xhr_load",{name:"xhr_"+a,data:d,timing:{loadEventEnd:e}})}else BOOMR.subscribe("page_load_beacon",function(){BOOMR.responseEnd(a,c,d,e)},null,BOOMR,!0);else{BOOMR.debug("Attempted to call responseEnd before all plugins were Ready to Send, trying again...");setTimeout(function(){BOOMR.responseEnd(a,c,d,e)},1e3)}},uninstrumentXHR:function(){},instrumentXHR:function(){},sendBeacon:function(a){a&&(b.beacon_url_override=a);if(!b.beaconQueued){b.beaconQueued=!0;BOOMR.setImmediate(BOOMR.real_sendBeacon,null,null,BOOMR)}return!0},real_sendBeacon:function(){var c,e,f,g,h,i=[],j=[],k=1,l={},m={},n=[],o=[];if(!b.beaconQueued)return!1;b.beaconQueued=!1;BOOMR.debug("Checking if we can send beacon");for(c in this.plugins)if(this.plugins.hasOwnProperty(c)){if(b.disabled_plugins[c])continue;if(!this.plugins[c].is_complete()){BOOMR.debug("Plugin "+c+" is not complete, deferring beacon send");return!1}}if(!(window&&window.Image&&window.navigator&&BOOMR.window)){BOOMR.debug("DOM not fully available, not sending a beacon");return!1}var p=BOOMR.utils.inArray(b.vars["http.initiator"],BOOMR.constants.BEACON_TYPE_SPAS),q=void 0===b.vars["http.initiator"]||p,r=p?d.URL:d.URL.replace(/#.*/,"");b.vars.pgu=BOOMR.utils.cleanupURL(r);b.vars.u&&!p||(b.vars.u=b.vars.pgu);b.vars.pgu===b.vars.u&&delete b.vars.pgu;b.r?b.vars.r=BOOMR.utils.cleanupURL(b.r):delete b.vars.r;b.r2?b.vars.r2=BOOMR.utils.cleanupURL(b.r2):delete b.vars.r2;b.vars.v=BOOMR.version;if(BOOMR.visibilityState()){b.vars["vis.st"]=BOOMR.visibilityState();BOOMR.lastVisibilityEvent.visible&&(b.vars["vis.lv"]=BOOMR.now()-BOOMR.lastVisibilityEvent.visible);BOOMR.lastVisibilityEvent.hidden&&(b.vars["vis.lh"]=BOOMR.now()-BOOMR.lastVisibilityEvent.hidden)}b.vars["ua.plt"]=navigator.platform;b.vars["ua.vnd"]=navigator.vendor;this.pageId&&(b.vars.pid=this.pageId);a!==window&&(b.vars.if="");for(c in b.errors)b.errors.hasOwnProperty(c)&&i.push(c+(b.errors[c]>1?" (*"+b.errors[c]+")":""));i.length>0&&(b.vars.errors=i.join("\n"));b.errors={};b.fireEvent("before_beacon",b.vars);b.beacon_url=b.beacon_url_override||b.beacon_url;BOOMR.debug("Ready to send beacon: "+BOOMR.utils.objectToString(b.vars));if(!b.beacon_url){BOOMR.debug("No beacon URL, so skipping.");return!0}for(c in b.vars)if(b.vars.hasOwnProperty(c)){l[c]=b.vars[c];m[c]=b.vars[c]}n=this.getVarsOfPriority(m,-1);o=this.getVarsOfPriority(m,1);j=n.concat(this.getVarsOfPriority(m,0),o);g=j.join("&");e=b.beacon_url+(b.beacon_url.indexOf("?")>-1?"&":"?")+g;("POST"===b.beacon_type||e.length>BOOMR.constants.MAX_GET_LENGTH)&&(k=!1);BOOMR.removeVar("qt");b.fireEvent("onbeacon",l);if(!b.hasSentPageLoadBeacon&&q){b.hasSentPageLoadBeacon=!0;BOOMR.setImmediate(function(){b.fireEvent("page_load_beacon",l)})}if(0===j.length)return this;BOOMR.orig_XMLHttpRequest||BOOMR.window&&BOOMR.window.XMLHttpRequest||(k=!0);if(k){try{f=new Image}catch(s){BOOMR.debug("Image is not a constructor, not sending a beacon");return!1}f.src=e;if(b.secondary_beacons)for(c=0;c<b.secondary_beacons.length;c++){e=b.secondary_beacons[c]+"?"+g;f=new Image;f.src=e}}else{h=new(BOOMR.window.orig_XMLHttpRequest||BOOMR.orig_XMLHttpRequest||BOOMR.window.XMLHttpRequest);try{this.sendXhrPostBeacon(h,g)}catch(s){h=new BOOMR.boomerang_frame.XMLHttpRequest;this.sendXhrPostBeacon(h,g)}}return!0},hasSentPageLoadBeacon:function(){return b.hasSentPageLoadBeacon},sendXhrPostBeacon:function(a,c){a.open("POST",b.beacon_url);a.setRequestHeader("Content-type","application/x-www-form-urlencoded");if(void 0!==b.beacon_auth_token){void 0===b.beacon_auth_key&&(b.beacon_auth_key="Authorization");a.setRequestHeader(b.beacon_auth_key,b.beacon_auth_token)}a.send(c)},getVarsOfPriority:function(a,c){var d,e=[];if(0!==c){for(d in b.varPriority[c])if(b.varPriority[c].hasOwnProperty(d)&&a.hasOwnProperty(d)){e.push(this.getUriEncodedVar(d,a[d]));delete a[d]}}else for(d in a)a.hasOwnProperty(d)&&e.push(this.getUriEncodedVar(d,a[d]));return e},getUriEncodedVar:function(a,b){return encodeURIComponent(a)+"="+(void 0===b||null===b?"":encodeURIComponent(b))},getResourceTiming:function(a,b){var c;try{if(BOOMR.getPerformance()&&"function"==typeof BOOMR.getPerformance().getEntriesByName){c=BOOMR.getPerformance().getEntriesByName(a);if(c&&c.length){"function"==typeof b&&c.sort(b);return c[c.length-1]}}}catch(d){}}};delete BOOMR_start;if("number"==typeof BOOMR_lstart){c.t_lstart=BOOMR_lstart;delete BOOMR_lstart}else"number"==typeof BOOMR.window.BOOMR_lstart&&(c.t_lstart=BOOMR.window.BOOMR_lstart);"number"==typeof BOOMR.window.BOOMR_onload&&(c.t_onload=BOOMR.window.BOOMR_onload);!function(){var a;"object"==typeof console&&void 0!==console.log&&(c.log=function(a,b,c){console.log(c+": ["+b+"] "+a)});a=function(a){return function(b,c){this.log(b,a,"boomerang"+(c?"."+c:""));return this}};c.debug=a("debug");c.info=a("info");c.warn=a("warn");c.error=a("error")}();try{var k=c.getPerformance();k&&"function"==typeof k.now&&/\[native code\]/.test(String(k.now))&&k.timing&&k.timing.navigationStart&&(c.now=function(){return Math.round(k.now()+k.timing.navigationStart)})}catch(l){}!function(){var a;for(a in c)c.hasOwnProperty(a)&&(BOOMR[a]=c[a]);BOOMR.xhr_excludes||(BOOMR.xhr_excludes={})}();g("onBoomerangLoaded",{BOOMR:BOOMR},!0)}}(window);!function(){function a(a){BOOMR.debug(a,"AutoXHR")}function b(a){if(!a)return null;a.href=a.href;var b=a.pathname;"/"!==b.charAt(0)&&(b="/"+b);return b}function c(a){return!(!a.href||!a.href.match(/^(about:|javascript:|data:)/i))||(BOOMR.xhr_excludes.hasOwnProperty(a.href)||BOOMR.xhr_excludes.hasOwnProperty(a.hostname)||BOOMR.xhr_excludes.hasOwnProperty(b(a)))}function d(){this.watch=0;this.timer=null;this.pending_events=[]}function e(){BOOMR.subscribe("click",function(){if(!n){var a={timing:{},initiator:"click"};if(BOOMR.orig_XMLHttpRequest&&BOOMR.orig_XMLHttpRequest!==BOOMR.window.XMLHttpRequest){a.timing.requestStart=BOOMR.now();j.addEvent(a)}}})}function f(){if(!BOOMR.proxy_XMLHttpRequest||BOOMR.proxy_XMLHttpRequest!==BOOMR.window.XMLHttpRequest)if(BOOMR.proxy_XMLHttpRequest&&BOOMR.orig_XMLHttpRequest&&BOOMR.orig_XMLHttpRequest===BOOMR.window.XMLHttpRequest){BOOMR.window.XMLHttpRequest=BOOMR.proxy_XMLHttpRequest;d.start()}else{BOOMR.orig_XMLHttpRequest=BOOMR.window.orig_XMLHttpRequest||BOOMR.window.XMLHttpRequest;d.start();e();BOOMR.proxy_XMLHttpRequest=function(){var a,b,c,e={timing:{},initiator:"xhr"},f=!1;a=new BOOMR.orig_XMLHttpRequest;b=a.open;c=a.send;a.open=function(c,g,h){function loadFinished(){var a,b,c,d,f=!1,g=BOOMR.now();if(!e.timing.loadEventEnd){e.status&&BOOMR.fireEvent("onxhrerror",e);e.timing.loadEventEnd=g;a=BOOMR.getResourceTiming(e.url,function(a,b){return a.responseEnd-b.responseEnd});if(a){b=BOOMR.getPerformance().timing.navigationStart;e.timing.loadEventEnd=BOOMR.now();c=Math.floor(b+a.startTime);if(e.timing.requestStart-c>=2)f=!1;else{if(0!==a.responseEnd){d=Math.floor(b+a.responseEnd);if(d<=e.timing.loadEventEnd){e.timing.responseEnd=d;f=!0;e.restiming=a}}if(f){e.timing.requestStart=c;e.timing.fetchStart=c;0!==a.responseStart&&(e.timing.responseStart=Math.floor(b+a.responseStart))}}}e.index>-1?j.load_finished(e.index,e.timing.responseEnd):p?j.sendResource(e):n&&!o||j.addEvent(e)}}function i(b,c){a.addEventListener(b,function(){if("readystatechange"===b){e.timing[q[a.readyState]]=BOOMR.now();if(l.ie1011fix&&m&&4===a.readyState){d.pause();a.responseXML;d.resume()}if(4===a.readyState&&0!==a.status){(a.status<200||a.status>=400)&&(e.status=a.status);e.response={text:""===a.responseType||"text"===a.responseType?a.responseText:null,xml:""===a.responseType||"document"===a.responseType?a.responseXML:null,raw:a.response,json:a.responseJSON};loadFinished()}}else{e.status=void 0===c?a.status:c;loadFinished()}},!1)}k.href=g;if(l.excludeFilter(k)){BOOMR.debug("Exclude found for resource: "+k.href+" Skipping instrumentation!","AutoXHR");return b.apply(a,arguments)}void 0===h&&(h=!0);BOOMR.fireEvent("xhr_init","xhr");if(!f){n&&j.watch&&!p&&j.add_event_resource(e);h&&i("readystatechange");i("load");i("timeout",s);i("error",u);i("abort",t)}e.url=k.href;e.method=c;delete e.status;h||(e.synchronous=!0);f=!0;try{return b.apply(a,arguments)}catch(r){e.status=v;loadFinished()}};a.send=function(b){a.resource.requestPayload=b;BOOMR.fireEvent("xhr_send",a);e.timing.requestStart=BOOMR.now();if(void 0===e.status||e.status!==v)return c.apply(a,arguments)};a.resource=e;return a};BOOMR.proxy_XMLHttpRequest.UNSENT=0;BOOMR.proxy_XMLHttpRequest.OPENED=1;BOOMR.proxy_XMLHttpRequest.HEADERS_RECEIVED=2;BOOMR.proxy_XMLHttpRequest.LOADING=3;BOOMR.proxy_XMLHttpRequest.DONE=4;BOOMR.proxy_XMLHttpRequest.prototype=BOOMR.orig_XMLHttpRequest.prototype;BOOMR.window.XMLHttpRequest=BOOMR.proxy_XMLHttpRequest}}function g(){BOOMR.orig_XMLHttpRequest&&BOOMR.orig_XMLHttpRequest!==BOOMR.window.XMLHttpRequest&&(BOOMR.window.XMLHttpRequest=BOOMR.orig_XMLHttpRequest)}function h(a){a.initiator="xhr";BOOMR.responseEnd(a)}var i,j,k,l,m,n=!1,o=!1,p=!1,q=["uninitialized","open","responseStart","domInteractive","responseEnd"],r=1e3,s=-1001,t=-999,u=-998,v=-997,w=["xmlhttprequest","script"];if(window.XMLHttpRequest&&(new XMLHttpRequest).addEventListener){m=window.navigator&&navigator.appVersion&&-1!==navigator.appVersion.indexOf("MSIE 10")||window.navigator&&navigator.userAgent&&navigator.userAgent.match(/Trident.*rv[ :]*11\./);BOOMR=window.BOOMR||{};if(!BOOMR.plugins.AutoXHR){d.stop=function(){d.pause();d.observer=null};d.pause=function(){if(d.observer&&d.observer.observer&&!d.isPaused){d.isPaused=!0;d.observer.observer.disconnect()}};d.resume=function(){if(d.observer&&d.observer.observer&&d.isPaused){d.isPaused=!1;d.observer.observer.observe(i,d.observer.config)}};d.start=function(){if(!d.observer){var a={childList:!0,attributes:!0,subtree:!0,attributeFilter:["src","href"]};d.observer=BOOMR.utils.addObserver(i,a,null,j.mutation_cb,null,j);if(d.observer){d.observer.config=a;BOOMR.subscribe("page_unload",d.stop,null,d)}}};d.prototype.addEvent=function(a){var b,c,e={type:a.initiator,resource:a,nodes_to_wait:0,resources:[],complete:!1},f=this.pending_events.length;for(b=f-1;b>=0;b--)if(this.pending_events[b]&&!this.pending_events[b].complete){c=this.pending_events[b];break}if(c)if("click"===c.type){if(0===c.nodes_to_wait||!c.resource.url){this.pending_events[b]=void 0;return null}}else if("xhr"===c.type){if("click"===e.type)return null}else if(BOOMR.utils.inArray(c.type,BOOMR.constants.BEACON_TYPE_SPAS)&&"xhr"===e.type)return null;this.watch++;this.pending_events.push(e);if(d.observer){BOOMR.utils.inArray(e.type,BOOMR.constants.BEACON_TYPE_SPAS)?this.setTimeout(r,f):this.setTimeout(50,f);return f}if(BOOMR.utils.inArray(e.type,BOOMR.constants.BEACON_TYPE_SPAS)){d.start();this.setTimeout(r,f);return f}a.url&&a.timing.loadEventEnd&&this.sendEvent(f);return null};d.prototype.sendEvent=function(a){var b=this.pending_events[a],c=this;if(b&&!b.complete){this.clearTimeout();if(BOOMR.readyToSend()){b.complete=!0;this.watch--;b.resource.resources=b.resources;BOOMR.utils.inArray(b.type,BOOMR.constants.BEACON_TYPE_SPAS)&&0===b.resources.length&&(b.resource.timing.loadEventEnd=BOOMR.now()-r);this.sendResource(b.resource,a)}else setTimeout(function(){c.sendEvent(a)},500)}};d.prototype.sendResource=function(a,b){var c=this,d=a.timing?a.timing.requestStart:void 0,e=function(e){e&&(a.timing.loadEventEnd=BOOMR.now());BOOMR.real_sendBeacon();a.onComplete&&a.onComplete(a);if(BOOMR.plugins.ResourceTiming&&BOOMR.plugins.ResourceTiming.is_supported()&&a.timing&&a.timing.requestStart){var f=BOOMR.plugins.ResourceTiming.getCompressedResourceTiming(a.timing.requestStart,a.timing.loadEventEnd);BOOMR.addVar({restiming:JSON.stringify(f.restiming)})}BOOMR.utils.inArray(a.initiator,BOOMR.constants.BEACON_TYPE_SPAS)&&c.calculateSpaTimings(a);BOOMR.responseEnd(a,d,a);b&&(c.pending_events[b]=void 0)};if(a.wait)a.waitComplete=function(){e(!0)};else{if(BOOMR.utils.inArray(a.initiator,BOOMR.constants.BEACON_TYPE_SPAS)&&i&&i.readyState&&"complete"!==i.readyState){BOOMR.window.addEventListener("load",function(){e(!0)});return}e(!1)}};d.prototype.calculateSpaTimings=function(a){var b=BOOMR.getPerformance();if(b&&b.timing)if("spa_hard"===a.initiator){a.timing.responseEnd=b.timing.responseStart;a.timing.fetchStart=b.timing.navigationStart}else{if(!BOOMR.plugins.ResourceTiming)return;var c=BOOMR.plugins.ResourceTiming.getFilteredResourceTiming(a.timing.requestStart,a.timing.loadEventEnd,l.spaBackEndResources),d=Math.round(a.timing.loadEventEnd-a.timing.requestStart);if(!c||!c.length){BOOMR.plugins.ResourceTiming.is_supported()&&(a.timers={t_resp:0,t_page:d,t_done:d});return}for(var e=a.timing.loadEventEnd-b.timing.navigationStart,f=0;f<c.length;f++)if(c[f].responseStart>e){c[f].responseStart=e;c[f].responseEnd=e}else c[f].responseEnd>e&&(c[f].responseEnd=e);var g=Math.round(BOOMR.plugins.ResourceTiming.calculateResourceTimingUnion(c)),h=d-g;if(g<0||d<0||h<0){BOOMR.addError("Incorrect SPA time calculation");return}a.timers={t_resp:g,t_page:h,t_done:d}}};d.prototype.setTimeout=function(a,b){var c=this;if(a){this.clearTimeout();this.timer=setTimeout(function(){c.timedout(b)},a)}};d.prototype.timedout=function(a){var b;this.clearTimeout();b=this.pending_events[a];if(b&&BOOMR.utils.inArray(b.type,BOOMR.constants.BEACON_TYPE_SPAS.concat("xhr")))0===b.nodes_to_wait&&this.sendEvent(a);else{this.watch>0&&this.watch--;this.pending_events[a]=void 0}};d.prototype.clearTimeout=function(){if(this.timer){clearTimeout(this.timer);this.timer=null}};d.prototype.load_cb=function(a,b){var c,d,e=BOOMR.now();c=a.target||a.srcElement;if(c&&c._bmr){d=c._bmr.idx;b=void 0!==b?b:c._bmr.res||0;if(!c._bmr.end[b]){c._bmr.end[b]=e;this.load_finished(d,e)}}};d.prototype.load_finished=function(a,b){var c=this.pending_events[a];if(c){c.nodes_to_wait--;if(0===c.nodes_to_wait){c.resource.timing.loadEventEnd=b||BOOMR.now();BOOMR.utils.inArray(c.type,BOOMR.constants.BEACON_TYPE_SPAS)?this.setTimeout(r,a):this.sendEvent(a)}}};d.prototype.wait_for_node=function(a,b){var c,d,e,f,g,h,i=this,j=!1,m=!1;if(a.nodeName.toUpperCase().match(/^(IMG|SCRIPT|IFRAME|IMAGE)$/)||"LINK"===a.nodeName&&a.rel&&a.rel.match(/\<stylesheet\>/i)){a._bmr&&a._bmr.res&&a._bmr.end[a._bmr.res]&&(m=!0);g=a.src||a.getAttribute("xlink:href")||a.href;if("IMG"===a.nodeName){if(a.naturalWidth&&!m)return!1;if(""===a.getAttribute("src"))return!1}if(!g||g.match(/^(about:|javascript:|data:)/i))return!1;c=this.pending_events[b];if(!c)return!1;h=c.resources.length;a._bmr||(a._bmr={end:{}});c.urls||(c.urls={});if(c.urls[g])return!1;if("SCRIPT"===a.nodeName&&n)return!1;if(!c.resource.url){k.href=g;if(l.excludeFilter(k)){BOOMR.debug("Exclude for "+k.href+" matched. Excluding","AutoXHR");return!1}c.resource.url=k.href}a._bmr.res=h;a._bmr.idx=b;a.addEventListener("load",function(a){i.load_cb(a,h)});a.addEventListener("error",function(a){i.load_cb(a,h)});c.nodes_to_wait++;c.resources.push(a);c.urls[g]=1;j=!0}else a.nodeType===Node.ELEMENT_NODE&&["IMAGE","IMG"].forEach(function(c){d=a.getElementsByTagName(c);if(d&&d.length)for(e=0,f=d.length;e<f;e++)j|=this.wait_for_node(d[e],b)},this);return j};d.prototype.add_event_resource=function(a){var b,c=this.pending_events.length-1;if(c<0)return-1;b=this.pending_events[c];if(!b)return-1;if(!a)return-1;b.nodes_to_wait++;a.index=c;return c};d.prototype.mutation_cb=function(a){var b,c,d;if(!this.watch)return!0;b=this;c=this.pending_events.length-1;if(c<0||!this.pending_events[c])return!0;d=this.pending_events[c];void 0===d.interesting&&(d.interesting=!1);if(a&&a.length){d.resource.timing.domComplete=BOOMR.now();a.forEach(function(a){var e,f,g;if("attributes"===a.type)d.interesting|=b.wait_for_node(a.target,c);else if("childList"===a.type){f=a.addedNodes.length;for(e=0;e<f;e++)d.interesting|=b.wait_for_node(a.addedNodes[e],c);f=a.removedNodes.length;for(e=0;e<f;e++){g=a.removedNodes[e];"IFRAME"===g.nodeName&&g._bmr&&b.load_cb({target:g,type:"removed"})}}})}d.interesting||this.setTimeout(r,c);return!0};d.prototype.queue_is_empty=function(){if(0===this.pending_events.length)return!0;var a=this.pending_events.length-1;return!this.pending_events[a]||0===this.pending_events[a].nodes_to_wait};j=new d;l={spaBackEndResources:w,ie1011fix:!0,excludeFilters:[],initialized:!1,excludeFilter:function(b){
var c,d,e;if(!b||!b.href)return!1;for(c=0;c<l.excludeFilters.length;c++)if("function"==typeof l.excludeFilters[c].cb){e=l.excludeFilters[c].ctx;l.excludeFilters[c].name&&a("Running filter: "+l.excludeFilters[c].name+" on URL: "+b.href);try{d=l.excludeFilters[c].cb.call(e,b);if(d){BOOMR.debug("Found matching filter at: "+l.excludeFilters[c].name+" for URL: "+b.href,"AutoXHR");return!0}}catch(f){BOOMR.addError(f,"BOOMR.plugins.AutoXHR.impl.excludeFilter()")}}return!1}};BOOMR.plugins.AutoXHR={is_complete:function(){return!0},init:function(a){function b(a){if(a.length)for(d=0;d<a.length;d++)h(a[d]);else h(a)}var d,e;if(BOOMR.window&&BOOMR.window.document){i=BOOMR.window.document;k=BOOMR.window.document.createElement("A");BOOMR.utils.pluginConfig(l,a,"AutoXHR",["spaBackEndResources","ie1011fix"]);BOOMR.instrumentXHR=f;BOOMR.uninstrumentXHR=g;if(!l.initialized){this.addExcludeFilter(c,null,"shouldExcludeXhr");l.initialized=!0}if(a&&a.AutoXHR&&a.AutoXHR.excludeFilters&&a.AutoXHR.excludeFilters.length>0)for(e=0;e<a.AutoXHR.excludeFilters.length;e++)l.excludeFilters.push(a.AutoXHR.excludeFilters[e]);o=a.instrument_xhr;if(BOOMR.plugins.SPA&&BOOMR.plugins.SPA.supported_frameworks){var j=BOOMR.plugins.SPA.supported_frameworks();for(d=0;d<j.length;d++){var m=j[d];if(a[m]&&a[m].enabled){n=!0;break}}}p=a.AutoXHR&&a.AutoXHR.alwaysSendXhr;if(p&&o&&BOOMR.xhr&&"function"==typeof BOOMR.xhr.stop){var q=BOOMR.xhr.stop(b);q&&q.length&&BOOMR.setImmediate(b,q)}if(n){p||(o=!1);o&&BOOMR.instrumentXHR()}else o?BOOMR.instrumentXHR():!1===o&&BOOMR.uninstrumentXHR();BOOMR.registerEvent("onxhrerror")}},getMutationHandler:function(){return j},getPathname:b,enableAutoXhr:function(){o||BOOMR.instrumentXHR();o=!0},addExcludeFilter:function(a,b,c){l.excludeFilters.push({cb:a,ctx:b,name:c})}}}}}();!function(){var a,b=!1,c=!1,d=!1,e="",f=!1,g=!0,h=!1,i=!1,j=[],k=!1;if(!BOOMR.plugins.SPA){var l={spaHardMissedOnComplete:function(a){k=!1;var b,c,d=BOOMR.getPerformance();if(d&&d.timing&&d.timing.navigationStart&&d.timing.loadEventStart){b=d.timing.navigationStart;c=d.timing.loadEventStart}else b=BOOMR.t_start;BOOMR.addVar("spa.missed","1");BOOMR.plugins.RT.clearTimer("t_done");a.timing.requestStart=b;0===a.resources.length&&c&&(a.timing.loadEventEnd=c)}};BOOMR.plugins.SPA={is_complete:function(){return!k},init:function(a){if(a&&a.instrument_xhr){f=a.instrument_xhr;c&&f&&BOOMR.plugins.AutoXHR.enableAutoXhr()}},register:function(a){j.push(a)},supported_frameworks:function(){return j},onLoadSpaHardMissed:function(){if(!c){d=!0;f&&BOOMR.plugins.AutoXHR.enableAutoXhr();k=!0;BOOMR.plugins.SPA.route_change(l.spaHardMissedOnComplete)}},hook:function(a,c){c=c||{};if(b)return this;a&&BOOMR.attach_page_ready(this.onLoadSpaHardMissed);"function"==typeof c.routeFilter&&(h=c.routeFilter);"function"==typeof c.routeChangeWaitFilter&&(i=c.routeChangeWaitFilter);b=!0;return this},route_change:function(b){if(h)try{if(!h.apply(null,arguments))return}catch(m){BOOMR.addError(m,"SPA.route_change.routeFilter")}c=!0;var j=d?BOOMR.now():BOOMR.plugins.RT.navigationStart(),k=e||BOOMR.window.document.URL,l={timing:{requestStart:j},initiator:g?"spa_hard":"spa",url:k};g=!1;d&&"function"!=typeof b||(l.onComplete=function(a){if(!d){d=!0;BOOMR.fireEvent("spa_navigation")}"function"==typeof b&&b(a)});if(i)try{if(i.apply(null,arguments)){l.wait=!0;a=l}}catch(m){BOOMR.addError(m,"SPA.route_change.routeChangeWaitFilter")}l.index=BOOMR.plugins.AutoXHR.getMutationHandler().addEvent(l);f&&BOOMR.plugins.AutoXHR.enableAutoXhr()},last_location:function(a){e=a},current_spa_nav:function(){return d?"spa":"spa_hard"},wait_complete:function(){if(a){a.wait=!1;a.waitComplete&&a.waitComplete();a=null}}}}}(BOOMR.window);!function(){function a(a){function b(b){BOOMR.debug(a.$id+": "+b,"angular")}if(void 0===a)return!1;if(!BOOMR.plugins.AutoXHR||!BOOMR.plugins.SPA)return!1;b("Startup");a.$on("$routeChangeStart",function(a,e,f){if(c){b("$routeChangeStart: "+(e?e.templateUrl:""));BOOMR.plugins.SPA.route_change(a,e,f)}else d=!0});a.$on("$locationChangeStart",function(a,d){if(c){b("$locationChangeStart: "+d);BOOMR.fireEvent("spa_init",[BOOMR.plugins.SPA.current_spa_nav(),d]);BOOMR.plugins.SPA.last_location(d)}});a.$on("$stateChangeStart",function(a,e,f,g,h){if(c){b("$stateChangeStart: "+e);BOOMR.plugins.SPA.route_change(a,e,f,g,h)}else d=!0});a.$on("$stateChangeSuccess",function(a,d,e,f,g){if(c){var h=window.location.pathname+window.location.search;b("$stateChangeSuccess: "+h);BOOMR.plugins.SPA.last_location(h)}});return!0}var b=!1,c=!0,d=!1;if(!BOOMR.plugins.Angular&&void 0!==BOOMR.plugins.SPA){BOOMR.plugins.SPA.register("Angular");BOOMR.plugins.Angular={is_complete:function(){return!0},hook:function(c,d,e){if(b)return this;if(a(c)){BOOMR.plugins.SPA.hook(d,e);b=!0}return this},disable:function(){c=!1;return this},enable:function(){c=!0;if(b&&d){d=!1;BOOMR.plugins.SPA.route_change()}return this}}}}(BOOMR.window);!function(){function a(a){function b(a){BOOMR.debug(a,"backbone")}if(void 0===BOOMR.window.Backbone||void 0===a)return!1;if(!BOOMR.plugins.AutoXHR||!BOOMR.plugins.SPA)return!1;b("Startup");a.on("route",function(){if(c){BOOMR.fireEvent("spa_init",[BOOMR.plugins.SPA.current_spa_nav(),BOOMR.window.document.URL]);b("route");BOOMR.plugins.SPA.route_change()}else d=!0});return!0}var b=!1,c=!0,d=!1;if(!BOOMR.plugins.Backbone&&void 0!==BOOMR.plugins.SPA){BOOMR.plugins.SPA.register("Backbone");BOOMR.plugins.Backbone={is_complete:function(){return!0},hook:function(c,d,e){if(b)return this;if(a(c)){BOOMR.plugins.SPA.hook(d,e);b=!0}return this},disable:function(){c=!1;return this},enable:function(){c=!0;if(b&&d){d=!1;BOOMR.plugins.SPA.route_change()}return this}}}}(BOOMR.window);!function(){function a(a){function b(a){BOOMR.debug(a,"Ember")}function f(a){this._super(a);if(!d){e=!0;return!0}b("beforeModel");if(a&&a.intent&&a.intent.url){b("[beforeModel] LastLocation: "+a.intent.url);BOOMR.plugins.SPA.last_location(a.intent.url);a.promise.then(function(){BOOMR.fireEvent("spa_init",[BOOMR.plugins.SPA.current_spa_nav(),BOOMR.window.document.URL])})}if(!c){BOOMR.plugins.SPA.route_change();c=!0}return!0}function g(a){this._super(a);if(!d){e=!0;return!0}b("willTransition");if(a&&a.intent&&a.intent.url){b("[willTransition] LastLocation: "+a.intent.url);BOOMR.plugins.SPA.last_location(a.intent.url);a.promise.then(function(){BOOMR.fireEvent("spa_init",[BOOMR.plugins.SPA.current_spa_nav(),BOOMR.window.document.URL])})}if(!c){BOOMR.plugins.SPA.route_change();c=!0}return!0}function h(a){this._super(a);if(!d)return!0;b("didTransition");c=!1}if(void 0===a)return!1;if(!BOOMR.plugins.AutoXHR||!BOOMR.plugins.SPA)return!1;b("Startup");a.ApplicationRoute?a.ApplicationRoute.reopen({beforeModel:f,actions:{willTransition:g,didTransition:h}}):a.ApplicationRoute=BOOMR.window.Ember.Route.extend({beforeModel:f,actions:{willTransition:g,didTransition:h}});return!0}var b=!1,c=!1,d=!0,e=!1;if(!BOOMR.plugins.Ember&&void 0!==BOOMR.plugins.SPA){BOOMR.plugins.SPA.register("Ember");BOOMR.plugins.Ember={is_complete:function(){return!0},hook:function(c,d,e){if(b)return this;if(a(c)){BOOMR.plugins.SPA.hook(d,e);b=!0}return this},disable:function(){d=!1;return this},enable:function(){d=!0;if(b&&e){e=!1;BOOMR.plugins.SPA.route_change()}return this}}}}();!function(){function a(a){BOOMR.debug(a,"History")}function b(){if(d.enabled)if(d.routeChangeInProgress)a("routeChangeInProgress, not triggering");else{a("routeChange triggered, sending route_change() event");d.routeChangeInProgress=!0;BOOMR.plugins.SPA.route_change()}else{a("Not enabled - we've missed a routeChange");d.hadMissedRouteChange=!0;d.routeChangeInProgress=!1}}function c(c){function e(a,b){d.routeChangeInProgress||(a&&b?BOOMR.fireEvent("spa_init",[BOOMR.plugins.SPA.current_spa_nav(),b]):a&&!b&&BOOMR.fireEvent("spa_init",[BOOMR.plugins.SPA.current_spa_nav(),a]))}c||(c=BOOMR.window.history);var f={listen:c.listen,transitionTo:c.transitionTo,pushState:c.pushState,setState:c.setState,replaceState:c.replaceState,go:c.go};c.setState=function(){a("setState");b();f.setState.apply(this,arguments)};c.listen=function(){a("listen");b();f.listen.apply(this,arguments)};c.transitionTo=function(){a("transitionTo");b();f.transitionTo.apply(this,arguments)};c.pushState=function(c,d,g){a("pushState");e(d,g);b();f.pushState.apply(this,arguments)};c.replaceState=function(c,d,g){a("replaceState");e(d,g);b();f.replaceState.apply(this,arguments)};c.go=function(){a("go");b();f.go.apply(this,arguments)};BOOMR.window.addEventListener("hashchange",function(c){a("hashchange");!d.routeChangeInProgress&&c&&BOOMR.fireEvent("spa_init",[BOOMR.plugins.SPA.current_spa_nav(),c.newURL]);b()});BOOMR.subscribe("onbeacon",function(){a("Beacon sending, resetting routeChangeInProgress.");d.routeChangeInProgress=!1});return!0}var d={auto:!1,enabled:!0,hooked:!1,routeHooked:!1,hadMissedRouteChange:!1,routeChangeInProgress:!1};if(!BOOMR.plugins.History&&void 0!==BOOMR.plugins.SPA&&void 0!==BOOMR.plugins.AutoXHR&&BOOMR.window&&BOOMR.window.history){BOOMR.plugins.SPA.register("History");BOOMR.plugins.History={is_complete:function(){return!0},hook:function(a,b,e){if(d.hooked)return this;if(c(a)){BOOMR.plugins.SPA.hook(b,e);d.hooked=!0}return this},init:function(a){BOOMR.utils.pluginConfig(d,a,"History",["auto","enabled"]);d.auto&&d.enabled&&this.hook(void 0,!0,{})},disable:function(){d.enabled=!1;return this},enable:function(){d.enabled=!0;if(d.hooked&&d.hadMissedRouteChange){d.hadMissedRouteChange=!1;BOOMR.plugins.SPA.route_change();d.routeChangeInProgress=!0;a("Hooked and hadMissedRouteChange sending route_change!")}return this}}}}();!function(a){var b,c;if(!BOOMR.plugins.RT){c={onloadfired:!1,unloadfired:!1,visiblefired:!1,initialized:!1,complete:!1,autorun:!0,timers:{},cookie:"RT",cookie_exp:604800,strict_referrer:!0,navigationType:0,navigationStart:void 0,responseStart:void 0,t_start:void 0,cached_t_start:void 0,cached_xhr_start:void 0,t_fb_approx:void 0,r:void 0,r2:void 0,basic_timers:{t_done:1,t_resp:1,t_page:1},addedVars:[],updateCookie:function(a,b){var d,e,f,g;if(!this.cookie)return!1;f=BOOMR.utils.getSubCookies(BOOMR.utils.getCookie(this.cookie))||{};if("object"==typeof a)for(g in a)if(a.hasOwnProperty(g))if(void 0===a[g])f.hasOwnProperty(g)&&delete f[g];else{"nu"!==g&&"r"!==g||(a[g]=BOOMR.utils.hashQueryString(a[g],!0));f[g]=a[g]}e=BOOMR.now();if(b){f[b]=e;c.lastActionTime=e}BOOMR.debug("Setting cookie (timer="+b+")\n"+BOOMR.utils.objectToString(f),"rt");if(!BOOMR.utils.setCookie(this.cookie,f,this.cookie_exp)){BOOMR.error("cannot set start cookie","rt");return!1}d=BOOMR.now();if(d-e>50){BOOMR.utils.removeCookie(this.cookie);BOOMR.error("took more than 50ms to set cookie... aborting: "+e+" -> "+d,"rt")}return!0},initFromCookie:function(){var a,c;c=BOOMR.utils.getSubCookies(BOOMR.utils.getCookie(this.cookie));if(c){c.s=Math.max(+c.ld||0,Math.max(+c.ul||0,+c.cl||0));BOOMR.debug("Read from cookie "+BOOMR.utils.objectToString(c),"rt");if(c.s&&(c.r||c.nu)){this.r=c.r;a=BOOMR.utils.hashQueryString(b.URL,!0);BOOMR.debug(this.r+" =?= "+this.r2,"rt");BOOMR.debug(c.s+" <? "+(+c.cl+15),"rt");BOOMR.debug(c.nu+" =?= "+a,"rt");if(!this.strict_referrer||c.nu&&c.nu===a&&c.s<+c.cl+15||c.s===+c.ul&&this.r===this.r2){this.t_start=c.s;+c.hd>c.s&&(this.t_fb_approx=parseInt(c.hd,10))}else this.t_start=this.t_fb_approx=void 0}this.updateCookie({s:void 0,r:void 0,nu:void 0,ul:void 0,cl:void 0,hd:void 0,ld:void 0,rl:void 0})}},getBoomerangTimings:function(){function a(a,b){var c=Math.round(a||0),d=Math.round(b||0);c=0===c?0:c-d;return c||""}var b,d,e,f,g;if(BOOMR.t_start){BOOMR.plugins.RT.startTimer("boomerang",BOOMR.t_start);BOOMR.plugins.RT.endTimer("boomerang",BOOMR.t_end);BOOMR.plugins.RT.endTimer("boomr_fb",BOOMR.t_start);if(BOOMR.t_lstart){BOOMR.plugins.RT.endTimer("boomr_ld",BOOMR.t_lstart);BOOMR.plugins.RT.setTimer("boomr_lat",BOOMR.t_start-BOOMR.t_lstart)}}try{if(window&&"performance"in window&&window.performance&&"function"==typeof window.performance.getEntriesByName){d={"rt.bmr":BOOMR.url};for(e in d)if(d.hasOwnProperty(e)&&d[e]){b=window.performance.getEntriesByName(d[e]);if(!b||0===b.length||!b[0])continue;b=b[0];f=a(b.startTime,0);g=[f,a(b.responseEnd,f),a(b.responseStart,f),a(b.requestStart,f),a(b.connectEnd,f),a(b.secureConnectionStart,f),a(b.connectStart,f),a(b.domainLookupEnd,f),a(b.domainLookupStart,f),a(b.redirectEnd,f),a(b.redirectStart,f)].join(",").replace(/,+$/,"");BOOMR.addVar(e,g);c.addedVars.push(e)}}}catch(h){BOOMR.addError(h,"rt.getBoomerangTimings")}},checkPreRender:function(){if("prerender"!==BOOMR.visibilityState())return!1;BOOMR.plugins.RT.startTimer("t_load",this.navigationStart);BOOMR.plugins.RT.endTimer("t_load");BOOMR.plugins.RT.startTimer("t_prerender",this.navigationStart);BOOMR.plugins.RT.startTimer("t_postrender");return!0},initFromNavTiming:function(){var b,c,d;if(!this.navigationStart){c=BOOMR.getPerformance();c&&c.navigation&&(this.navigationType=c.navigation.type);if(c&&c.timing)b=c.timing;else if(a.chrome&&a.chrome.csi&&a.chrome.csi().startE){b={navigationStart:a.chrome.csi().startE};d="csi"}else if(a.gtbExternal&&a.gtbExternal.startE()){b={navigationStart:a.gtbExternal.startE()};d="gtb"}if(b){BOOMR.addVar("rt.start",d||"navigation");this.navigationStart=b.navigationStart||b.fetchStart||void 0;this.responseStart=b.responseStart||void 0;navigator.userAgent.match(/Firefox\/[78]\./)&&(this.navigationStart=b.unloadEventStart||b.fetchStart||void 0)}else BOOMR.warn("This browser doesn't support the WebTiming API","rt")}},validateLoadTimestamp:function(a,b,c){var d;if(b&&b.timing&&b.timing.loadEventEnd)return b.timing.loadEventEnd;if(!("xhr"!==c||b&&BOOMR.utils.inArray(b.initiator,BOOMR.constants.BEACON_TYPE_SPAS)))return a;if(BOOMR.loadedLate){d=BOOMR.getPerformance();if(!d||!d.timing)return BOOMR.t_onload||BOOMR.t_lstart||BOOMR.t_start||a;if(d.timing.loadEventStart&&d.timing.loadEventStart<BOOMR.t_end)return d.timing.loadEventStart}return a},setPageLoadTimers:function(a,b,d){var e,f;if("xhr"!==a){c.initFromCookie();c.initFromNavTiming();if(c.checkPreRender())return!1}if("xhr"===a){if(d.timers)for(var g in d.timers)d.timers.hasOwnProperty(g)&&BOOMR.plugins.RT.setTimer(g,d.timers[g]);else if(d&&d.timing){f=d.timing.fetchStart;(void 0===f||d.timing.responseEnd>=f)&&(e=d.timing.responseEnd)}}else c.responseStart?c.responseStart>=c.cached_t_start&&(e=c.responseStart):c.timers.hasOwnProperty("t_page")?BOOMR.plugins.RT.endTimer("t_page"):c.t_fb_approx&&(e=c.t_fb_approx);if(e){f?BOOMR.plugins.RT.setTimer("t_resp",f,e):BOOMR.plugins.RT.endTimer("t_resp",e);"load"===a&&c.timers.t_load?BOOMR.plugins.RT.setTimer("t_page",c.timers.t_load.end-e):b<e?BOOMR.addVar("t_page.inv",1):BOOMR.plugins.RT.setTimer("t_page",b-e)}if("load"===a&&c.timers.hasOwnProperty("t_postrender")){BOOMR.plugins.RT.endTimer("t_postrender");BOOMR.plugins.RT.endTimer("t_prerender")}return!0},setSupportingTimestamps:function(a){a&&BOOMR.addVar("rt.tstart",a);"number"==typeof c.navigationStart&&c.navigationStart!==a&&BOOMR.addVar("rt.nstart",c.navigationStart);"number"==typeof c.t_start&&c.t_start!==a&&BOOMR.addVar("rt.cstart",c.t_start);BOOMR.addVar("rt.bstart",BOOMR.t_start);BOOMR.t_lstart&&BOOMR.addVar("rt.blstart",BOOMR.t_lstart);BOOMR.addVar("rt.end",c.timers.t_done.end)},determineTStart:function(a,b){var d;if("xhr"===a){b&&b.name&&c.timers[b.name]?d=c.timers[b.name].start:b&&b.timing&&b.timing.requestStart&&(d=b.timing.requestStart);void 0===d&&b&&BOOMR.utils.inArray(b.initiator,BOOMR.constants.BEACON_TYPE_SPAS)?BOOMR.addVar("rt.start","none"):BOOMR.addVar("rt.start","manual");c.cached_xhr_start=d}else{if(c.navigationStart)d=c.navigationStart;else if(c.t_start&&2!==c.navigationType){d=c.t_start;BOOMR.addVar("rt.start","cookie")}else if(c.cached_t_start)d=c.cached_t_start;else{BOOMR.addVar("rt.start","none");d=void 0}c.cached_t_start=d}BOOMR.debug("Got start time: "+d,"rt");return d},page_ready:function(){this.onloadfired=!0},check_visibility:function(){"visible"===BOOMR.visibilityState()&&(c.visiblefired=!0)},prerenderToVisible:function(){if(c.onloadfired&&c.autorun){BOOMR.debug("Transitioned from prerender to "+BOOMR.visibilityState(),"rt");BOOMR.addVar("vis.pre","1");BOOMR.plugins.RT.done(null,"visible")}},page_unload:function(a){BOOMR.debug("Unload called when unloadfired = "+this.unloadfired,"rt");this.unloadfired||BOOMR.plugins.RT.done(a,"unload");this.updateCookie({r:b.URL},"beforeunload"===a.type?"ul":"hd");this.unloadfired=!0},_iterable_click:function(a,b,d,e){var f;if(d){BOOMR.debug(a+" called with "+d.nodeName,"rt");for(;d&&d.nodeName.toUpperCase()!==b;)d=d.parentNode;if(d&&d.nodeName.toUpperCase()===b){BOOMR.debug("passing through","rt");f=e(d);this.updateCookie({nu:f},"cl");BOOMR.addVar("nu",BOOMR.utils.cleanupURL(f));c.addedVars.push("nu")}}},onclick:function(a){c._iterable_click("Click","A",a,function(a){return a.href})},onerror:function(){this.onloadfired&&(c.complete=!0)},onsubmit:function(a){c._iterable_click("Submit","FORM",a,function(a){var c=a.getAttribute("action")||b.URL||"";return c.match(/\?/)?c:c+"?"})},onconfig:function(a){a.beacon_url&&(c.beacon_url=a.beacon_url);if(a.RT){a.RT.oboError&&!isNaN(a.RT.oboError)&&a.RT.oboError>c.oboError&&(c.oboError=a.RT.oboError);if(a.RT.loadTime&&!isNaN(a.RT.loadTime)&&a.RT.loadTime>c.loadTime){c.loadTime=a.RT.loadTime;isNaN(c.timers.t_done.delta)||(c.loadTime+=c.timers.t_done.delta)}}},domloaded:function(){BOOMR.plugins.RT.endTimer("t_domloaded")},clear:function(){BOOMR.removeVar("rt.start");if(c.addedVars&&c.addedVars.length>0){BOOMR.removeVar(c.addedVars);c.addedVars=[]}},spaNavigation:function(){c.onloadfired=!0}};BOOMR.plugins.RT={init:function(d){BOOMR.debug("init RT","rt");a!==BOOMR.window&&(a=BOOMR.window);if(a&&a.document){b=a.document;BOOMR.utils.pluginConfig(c,d,"RT",["cookie","cookie_exp","session_exp","strict_referrer"]);d&&void 0!==d.autorun&&(c.autorun=d.autorun);void 0!==b&&(c.r=c.r2=BOOMR.utils.hashQueryString(b.referrer,!0));c.initFromCookie();if(c.initialized)return this;c.complete=!1;c.timers={};c.check_visibility();BOOMR.subscribe("page_ready",c.page_ready,null,c);BOOMR.subscribe("visibility_changed",c.check_visibility,null,c);BOOMR.subscribe("prerender_to_visible",c.prerenderToVisible,null,c);BOOMR.subscribe("page_ready",this.done,"load",this);BOOMR.subscribe("xhr_load",this.done,"xhr",this);BOOMR.subscribe("dom_loaded",c.domloaded,null,c);BOOMR.subscribe("page_unload",c.page_unload,null,c);BOOMR.subscribe("click",c.onclick,null,c);BOOMR.subscribe("form_submit",c.onsubmit,null,c);BOOMR.subscribe("before_beacon",this.addTimersToBeacon,"beacon",this);BOOMR.subscribe("onbeacon",c.clear,null,c);BOOMR.subscribe("onerror",c.onerror,null,c);BOOMR.subscribe("onconfig",c.onconfig,null,c);BOOMR.subscribe("spa_navigation",c.spaNavigation,null,c);BOOMR.getBeaconURL=function(){return c.beacon_url};c.initialized=!0;return this}},startTimer:function(a,b){if(a){"t_page"===a&&this.endTimer("t_resp",b);c.timers[a]={start:"number"==typeof b?b:BOOMR.now()}}return this},endTimer:function(a,b){if(a){c.timers[a]=c.timers[a]||{};void 0===c.timers[a].end&&(c.timers[a].end="number"==typeof b?b:BOOMR.now())}return this},clearTimer:function(a){a&&delete c.timers[a];return this},setTimer:function(a,b,d){a&&(c.timers[a]=void 0!==d?{start:b,end:d,delta:d-b}:{delta:b});return this},addTimersToBeacon:function(a,b){var d,e,f=[];for(d in c.timers)if(c.timers.hasOwnProperty(d)){e=c.timers[d];if("number"!=typeof e.delta){"number"!=typeof e.start&&(e.start="xhr"===b?c.cached_xhr_start:c.cached_t_start);e.delta=e.end-e.start}if(isNaN(e.delta))continue;if(c.basic_timers.hasOwnProperty(d)){BOOMR.addVar(d,e.delta);c.addedVars.push(d)}else f.push(d+"|"+e.delta)}if(f.length){BOOMR.addVar("t_other",f.join(","));c.addedVars.push("t_other")}if("beacon"===b){c.timers={};c.complete=!1}},done:function(a,b){BOOMR.debug("Called done: "+b,"rt");var d,e,f=BOOMR.now(),g=!1;c.complete=!1;e=c.validateLoadTimestamp(f,a,b);if(("load"===b||"visible"===b||"xhr"===b)&&!c.setPageLoadTimers(b,e,a))return this;("load"===b||"visible"===b||"xhr"===b&&a&&"spa_hard"===a.initiator)&&c.getBoomerangTimings();d=c.determineTStart(b,a);this.endTimer("t_done",e);a&&"xhr"===a.initiator&&this.setTimer("t_done",a.timing.requestStart,a.timing.loadEventEnd);BOOMR.removeVar("t_done","t_page","t_resp","t_postrender","t_prerender","t_load","t_other","rt.tstart","rt.nstart","rt.cstart","rt.bstart","rt.end","rt.subres","rt.abld","http.errno","http.method","xhr.sync");c.setSupportingTimestamps(d);this.addTimersToBeacon(null,b);BOOMR.setReferrer(c.r,c.r2);"xhr"===b&&a&&a&&a.data&&(a=a.data);if("xhr"===b&&a){g=a.subresource;if(a.url){BOOMR.addVar("u",BOOMR.utils.cleanupURL(a.url.replace(/#.*/,"")));c.addedVars.push("u")}a.status&&(a.status<-1||a.status>=400)&&BOOMR.addVar("http.errno",a.status);a.method&&"GET"!==a.method&&BOOMR.addVar("http.method",a.method);a.headers&&BOOMR.addVar("http.hdr",a.headers);a.synchronous&&BOOMR.addVar("xhr.sync",1);a.initiator&&BOOMR.addVar("http.initiator",a.initiator);c.addedVars.push("http.errno","http.method","http.hdr","xhr.sync","http.initiator")}if(g&&"passive"!==g){BOOMR.addVar("rt.subres",1);c.addedVars.push("rt.subres")}c.updateCookie();if("unload"===b){BOOMR.addVar("rt.quit","");c.onloadfired||BOOMR.addVar("rt.abld","");c.visiblefired||BOOMR.addVar("rt.ntvu","")}c.complete=!0;BOOMR.sendBeacon(c.beacon_url);return this},is_complete:function(){return c.complete},updateCookie:function(){c.updateCookie()},navigationStart:function(){c.navigationStart||c.initFromNavTiming();return c.navigationStart}}}}(window);!function(){var a,b;if(!BOOMR.plugins.BW){b=[{name:"image-0.png",size:11773,timeout:1400},{name:"image-1.png",size:40836,timeout:1200},{name:"image-2.png",size:165544,timeout:1300},{name:"image-3.png",size:382946,timeout:1500},{name:"image-4.png",size:1236278,timeout:1200},{name:"image-5.png",size:4511798,timeout:1200},{name:"image-6.png",size:9092136,timeout:1200}];b.end=b.length;b.start=0;b.l={name:"image-l.gif",size:35,timeout:1e3};a={base_url:"",timeout:15e3,nruns:5,latency_runs:10,user_ip:"",block_beacon:!1,test_https:!1,cookie_exp:604800,cookie:"BA",results:[],latencies:[],latency:null,runs_left:0,aborted:!1,complete:!0,running:!1,initialized:!1,ncmp:function(a,b){return a-b},iqr:function(a){var b,c,d,e,f=a.length-1,g=[];b=(a[Math.floor(.25*f)]+a[Math.ceil(.25*f)])/2;c=(a[Math.floor(.75*f)]+a[Math.ceil(.75*f)])/2;d=1.5*(c-b);if(0===d)return a;f++;for(e=0;e<f&&a[e]<c+d;e++)a[e]>b-d&&g.push(a[e]);return g},calc_latency:function(){var a,b,c,d,e,f,g,h=0,i=0;this.latencies.shift();g=this.iqr(this.latencies.sort(this.ncmp));b=g.length;BOOMR.debug("latencies: "+this.latencies,"bw");BOOMR.debug("lat_filtered: "+g,"bw");for(a=0;a<b;a++){h+=g[a];i+=g[a]*g[a]}c=Math.round(h/b);e=Math.sqrt(i/b-h*h/(b*b));f=(1.96*e/Math.sqrt(b)).toFixed(2);e=e.toFixed(2);d=Math.round((g[Math.floor(b/2)]+g[Math.ceil(b/2)])/2);return{mean:c,median:d,stddev:e,stderr:f}},calc_bw:function(){var a,c,d,e,f,g,h,i,j,k,l,m,n,o,p=0,q=[],r=[],s=0,t=0,u=0,v=0,w=[];for(a=0;a<this.nruns;a++)if(this.results[a]&&this.results[a].r){d=this.results[a].r;m=0;for(c=d.length-1;c>=0&&m<3&&d[c];c--)if(null!==d[c].t){p++;m++;n=1e3*b[c].size/d[c].t;q.push(n);if(d[c].t>this.latency.mean){o=1e3*b[c].size/(d[c].t-this.latency.mean);r.push(o)}else w.push(c+"_"+d[c].t)}}BOOMR.debug("got "+p+" readings","bw");BOOMR.debug("bandwidths: "+q,"bw");BOOMR.debug("corrected: "+r,"bw");if(q.length>3){q=this.iqr(q.sort(this.ncmp));r=this.iqr(r.sort(this.ncmp))}else{q=q.sort(this.ncmp);r=r.sort(this.ncmp)}BOOMR.debug("after iqr: "+q,"bw");BOOMR.debug("corrected: "+r,"bw");p=Math.max(q.length,r.length);for(a=0;a<p;a++){if(a<q.length){s+=q[a];t+=Math.pow(q[a],2)}if(a<r.length){u+=r[a];v+=Math.pow(r[a],2)}}p=q.length;e=Math.round(s/p);f=Math.sqrt(t/p-Math.pow(s/p,2));g=Math.round(1.96*f/Math.sqrt(p));f=Math.round(f);p=q.length-1;h=Math.round((q[Math.floor(p/2)]+q[Math.ceil(p/2)])/2);if(r.length<1){BOOMR.debug("not enough valid corrected datapoints, falling back to uncorrected","bw");w.push("l=="+r.length);i=e;j=f;k=g;l=h}else{p=r.length;i=Math.round(u/p);j=Math.sqrt(v/p-Math.pow(u/p,2));k=(1.96*j/Math.sqrt(p)).toFixed(2);j=j.toFixed(2);p=r.length-1;l=Math.round((r[Math.floor(p/2)]+r[Math.ceil(p/2)])/2)}BOOMR.debug("amean: "+e+", median: "+h,"bw");BOOMR.debug("corrected amean: "+i+", median: "+l,"bw");return{mean:e,stddev:f,stderr:g,median:h,mean_corrected:i,stddev_corrected:j,stderr_corrected:k,median_corrected:l,debug_info:w}},load_img:function(a,c,d){function e(b){return function(){d&&d.call(j,a,h,c,b);if(null!==b){i.onload=i.onerror=null;i=null;clearTimeout(g);j=d=null}}}var f=this.base_url+b[a].name+"?t="+BOOMR.utils.generateId(10),g=0,h=0,i=new Image,j=this;i.onload=e(!0);i.onerror=e(!1);g=setTimeout(e(null),b[a].timeout+Math.min(400,this.latency?this.latency.mean:400));h=BOOMR.now();i.src=f},lat_loaded:function(a,b,c,d){if(c===this.latency_runs+1){if(null!==d){var e=BOOMR.now()-b;this.latencies.push(e)}0===this.latency_runs&&(this.latency=this.calc_latency());BOOMR.setImmediate(this.iterate,null,null,this)}},img_loaded:function(a,c,d,e){if(d===this.runs_left+1&&!this.results[this.nruns-d].r[a])if(null!==e){var f={start:c,end:BOOMR.now(),t:null,state:e,run:d};e&&(f.t=f.end-f.start);this.results[this.nruns-d].r[a]=f;if(a>=b.end-1||void 0!==this.results[this.nruns-d].r[a+1]){BOOMR.debug(BOOMR.utils.objectToString(this.results[this.nruns-d],void 0,2),"bw");d===this.nruns&&(b.start=a);BOOMR.setImmediate(this.iterate,null,null,this)}else this.load_img(a+1,d,this.img_loaded)}else this.results[this.nruns-d].r[a+1]={t:null,state:null,run:d}},finish:function(){this.latency||(this.latency=this.calc_latency());var a=this.calc_bw(),b={bw:a.median_corrected,bw_err:parseFloat(a.stderr_corrected,10),lat:this.latency.mean,lat_err:parseFloat(this.latency.stderr,10),bw_time:Math.round(BOOMR.now()/1e3)};BOOMR.addVar(b);a.debug_info.length>0&&BOOMR.addVar("bw_debug",a.debug_info.join(","));!isNaN(b.bw)&&b.bw>0&&BOOMR.utils.setCookie(this.cookie,{ba:Math.round(b.bw),be:b.bw_err,l:b.lat,le:b.lat_err,ip:this.user_ip,t:b.bw_time},this.user_ip?this.cookie_exp:0);this.complete=!0;!0===this.block_beacon&&BOOMR.sendBeacon();this.running=!1},iterate:function(){if(!this.aborted)if(this.runs_left)if(this.latency_runs)this.load_img("l",this.latency_runs--,this.lat_loaded);else{this.results.push({r:[]});this.load_img(b.start,this.runs_left--,this.img_loaded)}else this.finish()},setVarsFromCookie:function(){var b,c,d,e,f,g,h,i,j;b=BOOMR.utils.getSubCookies(BOOMR.utils.getCookie(a.cookie));if(b&&b.ba){c=parseInt(b.ba,10);d=parseFloat(b.be,10);e=parseInt(b.l,10)||0;f=parseFloat(b.le,10)||0;g=b.ip.replace(/\.\d+$/,"0");h=parseInt(b.t,10);i=this.user_ip.replace(/\.\d+$/,"0");j=Math.round(BOOMR.now()/1e3);if(g===i&&h>=j-this.cookie_exp&&c>0){this.complete=!0;BOOMR.addVar({bw:c,lat:e,bw_err:d,lat_err:f,bw_time:h});return!0}}return!1}};BOOMR.plugins.BW={init:function(c){if(a.initialized)return this;BOOMR.utils.pluginConfig(a,c,"BW",["base_url","timeout","nruns","cookie","cookie_exp","test_https","block_beacon"]);c&&c.user_ip&&(a.user_ip=c.user_ip);if(!a.base_url)return this;b.start=0;a.runs_left=a.nruns;a.latency_runs=10;a.results=[];a.latencies=[];a.latency=null;a.complete=a.aborted=!1;BOOMR.removeVar("ba","ba_err","lat","lat_err");a.setVarsFromCookie()||BOOMR.subscribe("page_ready",this.run,null,this);a.initialized=!0;return this},run:function(){var b;if(a.running||a.complete)return this;b=BOOMR.window.document.createElement("a");b.href=a.base_url;if(!a.test_https&&"https:"===b.protocol){BOOMR.info("HTTPS detected, skipping bandwidth test","bw");a.complete=!0;!0===a.block_beacon&&BOOMR.sendBeacon();return this}a.base_url=b.href;a.running=!0;setTimeout(this.abort,a.timeout);a.iterate();return this},abort:function(){a.aborted=!0;a.running&&a.finish()},is_complete:function(){return!0!==a.block_beacon||a.complete}}}}();!function(){if(!BOOMR.plugins.NavigationTiming){var a={complete:!1,sendBeacon:function(){this.complete=!0;BOOMR.sendBeacon()},xhr_done:function(b){var c;if(b&&"spa_hard"===b.initiator)a.done(b);else if(b&&"spa"===b.initiator)a.sendBeacon();else{var d,e,f=(BOOMR.window,{});if(b){b.data&&(b=b.data);c=BOOMR.getPerformance();if(c&&b.restiming){f={nt_red_st:b.restiming.redirectStart,nt_red_end:b.restiming.redirectEnd,nt_fet_st:b.restiming.fetchStart,nt_dns_st:b.restiming.domainLookupStart,nt_dns_end:b.restiming.domainLookupEnd,nt_con_st:b.restiming.connectStart,nt_con_end:b.restiming.connectEnd,nt_req_st:b.restiming.requestStart,nt_res_st:b.restiming.responseStart,nt_res_end:b.restiming.responseEnd};b.restiming.secureConnectionStart&&(f.nt_ssl_st=b.restiming.secureConnectionStart);for(e in f)if(f.hasOwnProperty(e)&&f[e]){f[e]+=c.timing.navigationStart;f[e]=Math.floor(f[e])}}if(b.timing){d=b.timing;f.nt_req_st||(f.nt_req_st=d.requestStart);f.nt_res_st||(f.nt_res_st=d.responseStart);f.nt_res_end||(f.nt_res_end=d.responseEnd);f.nt_domint=d.domInteractive;f.nt_domcomp=d.domComplete;f.nt_load_st=d.loadEventEnd;f.nt_load_end=d.loadEventEnd}for(e in f)f.hasOwnProperty(e)&&!f[e]&&delete f[e];BOOMR.addVar(f);try{a.addedVars.push.apply(a.addedVars,Object.keys(f))}catch(g){}a.sendBeacon()}}},done:function(){var b,c,d,e,f=BOOMR.window;if(this.complete)return this;a.addedVars=[];b=BOOMR.getPerformance();if(b&&b.timing&&b.navigation){BOOMR.info("This user agent supports NavigationTiming.","nt");c=b.navigation;d=b.timing;e={nt_red_cnt:c.redirectCount,nt_nav_type:c.type,nt_nav_st:d.navigationStart,nt_red_st:d.redirectStart,nt_red_end:d.redirectEnd,nt_fet_st:d.fetchStart,nt_dns_st:d.domainLookupStart,nt_dns_end:d.domainLookupEnd,nt_con_st:d.connectStart,nt_con_end:d.connectEnd,nt_req_st:d.requestStart,nt_res_st:d.responseStart,nt_res_end:d.responseEnd,nt_domloading:d.domLoading,nt_domint:d.domInteractive,nt_domcontloaded_st:d.domContentLoadedEventStart,nt_domcontloaded_end:d.domContentLoadedEventEnd,nt_domcomp:d.domComplete,nt_load_st:d.loadEventStart,nt_load_end:d.loadEventEnd,nt_unload_st:d.unloadEventStart,nt_unload_end:d.unloadEventEnd};d.secureConnectionStart&&(e.nt_ssl_st=d.secureConnectionStart);d.msFirstPaint&&(e.nt_first_paint=d.msFirstPaint);BOOMR.addVar(e);if(d.requestStart&&d.navigationStart&&d.requestStart<d.navigationStart||d.responseStart&&d.navigationStart&&d.responseStart<d.navigationStart||d.responseStart&&d.fetchStart&&d.responseStart<d.fetchStart||d.navigationStart&&d.fetchStart<d.navigationStart||d.responseEnd&&d.responseEnd>BOOMR.now()+864e5){BOOMR.addVar("nt_bad",1);a.addedVars.push("nt_bad")}try{a.addedVars.push.apply(a.addedVars,Object.keys(e))}catch(g){}}if(f.chrome&&f.chrome.loadTimes){d=f.chrome.loadTimes();if(d){e={nt_spdy:d.wasFetchedViaSpdy?1:0,nt_cinf:d.connectionInfo,nt_first_paint:d.firstPaintTime};BOOMR.addVar(e);try{a.addedVars.push.apply(a.addedVars,Object.keys(e))}catch(g){}}}a.sendBeacon()},clear:function(){if(a.addedVars&&a.addedVars.length>0){BOOMR.removeVar(a.addedVars);a.addedVars=[]}this.complete=!1},prerenderToVisible:function(){this.complete=!1;this.done()}};BOOMR.plugins.NavigationTiming={init:function(){if(!a.initialized){BOOMR.subscribe("page_ready",a.done,null,a);BOOMR.subscribe("prerender_to_visible",a.prerenderToVisible,null,a);BOOMR.subscribe("xhr_load",a.xhr_done,null,a);BOOMR.subscribe("before_unload",a.done,null,a);BOOMR.subscribe("onbeacon",a.clear,null,a);a.initialized=!0}return this},is_complete:function(){return!0}}}}();!function(){function a(a){var b,c,d,e,f,g,h,i,j={};for(b in a){c=b;for(d=0;d<q.xssBreakWords.length;d++)c=c.replace(q.xssBreakWords[d],"$1"+t+"$2");if(a.hasOwnProperty(b)){e=a[b];f=c.split("");h=j;for(d=0;d<f.length;d++){g=f[d];i=h[g];void 0===i?h=h[g]=d===f.length-1?e:{}:"string"==typeof i?h=h[g]={"|":i}:d===f.length-1?h[g]["|"]=e:h=h[g]}}}return j}function b(a,c){var d,e,f,g=0,h=[];for(d in a)a.hasOwnProperty(d)&&h.push(d);for(var i=0;i<h.length;i++){d=h[i];if("object"==typeof a[d]){e=b(a[d],!1);if(e){delete a[d];if(d===t){d=e.name;g++}else d+=e.name;a[d]=e.value}}g++}if(1===g){if(c){f={};f[d]=a[d];return f}return{name:d,
value:a[d]}}return!!c&&a}function c(a,b){"number"!=typeof a&&(a=0);"number"!=typeof b&&(b=0);var c=Math.round(a||0),d=Math.round(b||0);return 0===c?0:c-d}function d(a){try{a.location&&a.location.href;a.document;if("performance"in a&&a.performance)return!0}catch(b){}return!1}function e(a){var b=0;d(a)&&a.performance.timing&&a.performance.timing.navigationStart&&(b=a.performance.timing.navigationStart);return b}function f(a,b,c,g,i){var j,k,m,n,o,p,q,r,s,t,u,v=[],w={};void 0===b&&(b=!0);void 0===c&&(c=0);void 0===g&&(g=0);if(g>10)return v;try{if(!d(a))return v;m=e(a);t=h(a,i);u=a.document.createElement("a");Array.prototype.forEach.call(a.document.getElementsByTagName("script"),function(a){u.href=a.src;u.href.match(/^https?:\/\//)&&(w[u.href]=a)});p=a.document.getElementsByTagName("iframe");if(p&&p.length)for(j=0;j<p.length;j++){n=e(p[j].contentWindow);o=0;n>m&&(o=c+(n-m));u.href=p[j].src;v=v.concat(f(a.frames[j],!1,o,g+1,t[u.href]))}if("function"!=typeof a.performance.getEntriesByType)return v;if(b){k=a.performance.getEntriesByType("navigation");if(k&&1===k.length){q=k[0];v.push({name:a.location.href,startTime:0,initiatorType:"html",redirectStart:q.redirectStart,redirectEnd:q.redirectEnd,fetchStart:q.fetchStart,domainLookupStart:q.domainLookupStart,domainLookupEnd:q.domainLookupEnd,connectStart:q.connectStart,secureConnectionStart:q.secureConnectionStart,connectEnd:q.connectEnd,requestStart:q.requestStart,responseStart:q.responseStart,responseEnd:q.responseEnd,workerStart:q.workerStart,encodedBodySize:q.encodedBodySize,decodedBodySize:q.decodedBodySize,transferSize:q.transferSize})}else if(a.performance.timing){r=a.performance.timing;0!==r.navigationStart&&r.responseEnd<=r.navigationStart+36e5&&v.push({name:a.location.href,startTime:0,initiatorType:"html",redirectStart:r.redirectStart?r.redirectStart-r.navigationStart:0,redirectEnd:r.redirectEnd?r.redirectEnd-r.navigationStart:0,fetchStart:r.fetchStart?r.fetchStart-r.navigationStart:0,domainLookupStart:r.domainLookupStart?r.domainLookupStart-r.navigationStart:0,domainLookupEnd:r.domainLookupEnd?r.domainLookupEnd-r.navigationStart:0,connectStart:r.connectStart?r.connectStart-r.navigationStart:0,secureConnectionStart:r.secureConnectionStart?r.secureConnectionStart-r.navigationStart:0,connectEnd:r.connectEnd?r.connectEnd-r.navigationStart:0,requestStart:r.requestStart?r.requestStart-r.navigationStart:0,responseStart:r.responseStart?r.responseStart-r.navigationStart:0,responseEnd:r.responseEnd?r.responseEnd-r.navigationStart:0})}}var x=a.performance.getEntriesByType("resource"),B=[];for(j=0;x&&j<x.length;j++){r=x[j];s={name:r.name,initiatorType:r.initiatorType,startTime:r.startTime+c,redirectStart:r.redirectStart?r.redirectStart+c:0,redirectEnd:r.redirectEnd?r.redirectEnd+c:0,fetchStart:r.fetchStart?r.fetchStart+c:0,domainLookupStart:r.domainLookupStart?r.domainLookupStart+c:0,domainLookupEnd:r.domainLookupEnd?r.domainLookupEnd+c:0,connectStart:r.connectStart?r.connectStart+c:0,secureConnectionStart:r.secureConnectionStart?r.secureConnectionStart+c:0,connectEnd:r.connectEnd?r.connectEnd+c:0,requestStart:r.requestStart?r.requestStart+c:0,responseStart:r.responseStart?r.responseStart+c:0,responseEnd:r.responseEnd?r.responseEnd+c:0,workerStart:r.workerStart?r.workerStart+c:0,encodedBodySize:r.encodedBodySize,decodedBodySize:r.decodedBodySize,transferSize:r.transferSize,visibleDimensions:t[r.name],latestTime:l(r)};if("script"===r.initiatorType&&w[r.name]){var C=w[r.name];s.scriptAttrs=(C.async?y:0)|(C.defer?z:0);for(;1===C.nodeType&&"BODY"!==C.nodeName;)C=C.parentNode;s.scriptAttrs|="BODY"===C.nodeName?A:0}B.push(s)}v=v.concat(B)}catch(D){return v}return v}function g(a){return"number"==typeof a&&0!==a?a.toString(36):"string"==typeof a?a:""}function h(a,b){var c,d,e=["img","iframe","image"],f={},g=a.document,h=g.createElement("A");b=b||[0,0,0,0];c=b[3]+(void 0!==a.pageXOffset)?a.pageXOffset:(g.documentElement||g.body.parentNode||g.body).scrollLeft;d=b[2]+(void 0!==a.pageYOffset)?a.pageYOffset:(g.documentElement||g.body.parentNode||g.body).scrollTop;e.forEach(function(a){var b,e,i,j,k=g.getElementsByTagName(a);for(e=0;e<k.length;e++){b=k[e];if(b){j=b.src||b.getAttribute("src")||b.getAttribute("xlink:href");h.href=j;j=h.href;if(j&&!f[j]){i=b.getBoundingClientRect();if((i.height||b.offsetHeight)&&(i.width||b.offsetWidth)){f[j]=[i.height||b.offsetHeight,i.width||b.offsetWidth,Math.round(i.top+d),Math.round(i.left+c)];!b.naturalHeight&&!b.naturalWidth||f[j][0]===b.naturalHeight&&f[j][1]===b.naturalWidth||f[j].push(b.naturalHeight,b.naturalWidth)}}}}});return f}function i(a,b,c){var d,g,h=f(BOOMR.window,!0,0,0),i=e(BOOMR.window);if(!h||!h.length)return[];h.sort(function(a,b){return a.startTime-b.startTime});var j=[];for(d=0;d<h.length;d++){g=h[d];if(0!==g.name.indexOf("about:")&&0!==g.name.indexOf("javascript:")&&0!==g.name.indexOf("res:")&&!(g.name.indexOf(BOOMR.url)>-1||g.name.indexOf(BOOMR.config_url)>-1||"function"==typeof BOOMR.getBeaconURL&&BOOMR.getBeaconURL()&&g.name.indexOf(BOOMR.getBeaconURL())>-1||a&&i+g.startTime<a)){if(b&&i+g.startTime>b)break;(void 0===c||"*"===c||!c.length||g.initiatorType&&BOOMR.utils.inArray(g.initiatorType,c))&&j.push(g)}}return j}function j(a){var b,c,d,e;if(a.encodedBodySize||a.decodedBodySize||a.transferSize){b=a.transferSize;c=a.encodedBodySize;d=a.decodedBodySize;e=[c,b?b-c:"_",d?d-c:0];return e.map(g).join(",").replace(/,+$/,"")}return""}function k(a,b){var c,d,e;if(a&&b)for(c=0;c<b.length;c++){e=b[c];if("string"==typeof e){d=a.indexOf(e);if(-1!==d){a=a.substr(0,d+e.length)+"...";break}}else e instanceof RegExp&&e.test(a)&&(a=a.replace(e,"$1")+"...")}return BOOMR.utils.cleanupURL(a,q.urlLimit)}function l(a){return a.responseEnd?a.responseEnd:a.responseStart&&a.startTime?a.responseStart+.2*(a.responseStart-a.startTime):1/0}function m(d,e){var f,h,l,m,n,o=i(d,e,q.trackedResourceTypes),p={},s={};if(!o||!o.length)return{};for(f=0;f<o.length;f++){h=o[f];l=r[h.initiatorType];void 0===l&&(l=0);n=l+[c(h.startTime,0),c(h.responseEnd,h.startTime),c(h.responseStart,h.startTime),c(h.requestStart,h.startTime),c(h.connectEnd,h.startTime),c(h.secureConnectionStart,h.startTime),c(h.connectStart,h.startTime),c(h.domainLookupEnd,h.startTime),c(h.domainLookupStart,h.startTime),c(h.redirectEnd,h.startTime),c(h.redirectStart,h.startTime)].map(g).join(",").replace(/,+$/,"");var t=j(h);""!==t&&(n+=u+w+t);h.hasOwnProperty("scriptAttrs")&&(n+=u+x+h.scriptAttrs);m=k(h.name,q.trimUrls);void 0!==p[m]?p[m]+="|"+n:h.visibleDimensions?p[m]=u+v+h.visibleDimensions.map(Math.round).map(g).join(",").replace(/,+$/,"")+"|"+n:p[m]=n;if(h.visibleDimensions){s[h.latestTime]||(s[h.latestTime]=[]);s[h.latestTime].push(h.visibleDimensions)}}return{restiming:b(a(p),!0)}}function n(a){var b=[];if(!a||!a.length)return b;for(var c=0;c<a.length;c++){var d=a[c];c!==a.length-1&&d.fetchStart===a[c+1].fetchStart||b.push({fetchStart:d.fetchStart,responseEnd:d.responseStart||d.responseEnd})}return b}function o(a){var b;if(!a||!a.length)return 0;a.sort(function(a,b){return a.fetchStart!==b.fetchStart?a.fetchStart-b.fetchStart:(a.responseStart||a.responseEnd)-(b.responseStart||b.responseEnd)});var c=n(a),d=[],e=0;for(b=0;b<c.length;b++){var f=c[b];f.fetchStart<e&&(f.fetchStart=e);if(f.fetchStart<f.responseEnd){d.push(f);e=f.responseEnd}}var g=n(d),h=0;for(b=0;b<g.length;b++)h+=g[b].responseEnd-g[b].fetchStart;return h}function p(a,b){var c;if("undefined"!=typeof JSON){BOOMR.removeVar("restiming");c=m(a,b);if(c){BOOMR.info("Client supports Resource Timing API","restiming");BOOMR.addVar({restiming:JSON.stringify(c.restiming)})}}}var q;if(!BOOMR.plugins.ResourceTiming){var r={other:0,img:1,link:2,script:3,css:4,xmlhttprequest:5,html:6,image:7,beacon:8,fetch:9},s=[/(h)(ref)/gi,/(s)(rc)/gi,/(a)(ction)/gi],t="\n",u="*",v="0",w="1",x="2",y=1,z=2,A=4;q={complete:!1,sentNavBeacon:!1,initialized:!1,supported:!1,xhr_load:function(){if(!this.complete){this.complete=!0;BOOMR.sendBeacon()}},xssBreakWords:s,urlLimit:500,clearOnBeacon:!1,trimUrls:[],trackedResourceTypes:"*",done:function(){if(!this.sentNavBeacon){p();this.complete=!0;this.sentNavBeacon=!0;BOOMR.sendBeacon()}},onBeacon:function(a){var b=BOOMR.getPerformance();a.hasOwnProperty("restiming")&&BOOMR.removeVar("restiming");if(q.clearOnBeacon&&b){var c=b.clearResourceTimings||b.webkitClearResourceTimings;c&&"function"==typeof c&&c.call(b)}},prerenderToVisible:function(){this.sentNavBeacon=!1;this.done()}};BOOMR.plugins.ResourceTiming={init:function(a){var b=BOOMR.getPerformance();BOOMR.utils.pluginConfig(q,a,"ResourceTiming",["xssBreakWords","clearOnBeacon","urlLimit","trimUrls","trackedResourceTypes"]);if(q.initialized)return this;if(b&&"function"==typeof b.getEntriesByType){BOOMR.subscribe("page_ready",q.done,null,q);BOOMR.subscribe("prerender_to_visible",q.prerenderToVisible,null,q);BOOMR.subscribe("xhr_load",q.xhr_load,null,q);BOOMR.subscribe("onbeacon",q.onBeacon,null,q);BOOMR.subscribe("before_unload",q.done,null,q);q.supported=!0}else q.complete=!0;q.initialized=!0;return this},is_complete:function(){return!0},is_supported:function(){return q.initialized&&q.supported},getCompressedResourceTiming:m,getFilteredResourceTiming:i,calculateResourceTimingUnion:o,addResourceTimingToBeacon:p}}}();!function(){var a;"object"==typeof navigator&&(a=navigator.connection||navigator.mozConnection||navigator.webkitConnection||navigator.msConnection);if(a){BOOMR.addVar({"mob.ct":a.type,"mob.bw":a.bandwidth,"mob.mt":a.metered});a.downlinkMax&&BOOMR.addVar("mob.lm",a.downlinkMax)}}();!function(){function a(a,b){var c,e,f,g,h;try{c=d.getElementsByTagName(a);e=c.length;if(b&&b.length){f={};f[b[0]]=e;for(g=2;e>0&&g<arguments.length&&g-1<b.length;g++){h=arguments[g];if("function"==typeof h)try{c=BOOMR.utils.arrayFilter(c,h);if(c.length!==e){e=c.length;f[b[g-1]]=e}}catch(i){BOOMR.addError(i,"Memory.nodeList."+a+".filter["+(g-2)+"]")}}}return f||e}catch(i){BOOMR.addError(i,"Memory.nodeList."+a);return 0}}function b(a,b,c){if(a)try{b()}catch(d){BOOMR.addError(d,"Memory.done."+c)}}var c,d,e,f,g,h,i,j={};if(!BOOMR.plugins.Memory){i={done:function(){if(c){BOOMR.removeVar("dom.res");b(!0,function(){var a,b,c={};if(j&&"function"==typeof j.getEntriesByType){a=j.getEntriesByType("resource");if(a&&a.length){BOOMR.addVar("dom.res",a.length);b=BOOMR.window.document.createElement("a");[].forEach.call(a,function(a){b.href=a.name;c[b.hostname]=!0});BOOMR.addVar("dom.doms",Object.keys(c).length)}}},"resources");e&&BOOMR.addVar({"mem.total":e.totalJSHeapSize,"mem.limit":e.jsHeapSizeLimit,"mem.used":e.usedJSHeapSize});b(f,function(){var a,b;BOOMR.addVar({"scr.xy":f.width+"x"+f.height,"scr.bpp":f.colorDepth+"/"+(f.pixelDepth||"")});f.orientation&&BOOMR.addVar("scr.orn",f.orientation.angle+"/"+f.orientation.type);c.devicePixelRatio>1&&BOOMR.addVar("scr.dpx",c.devicePixelRatio);if(c.scrollX||c.scrollY){a="function"==typeof c.scrollX?c.scrollX():c.scrollX;b="function"==typeof c.scrollY?c.scrollY():c.scrollY;"number"==typeof a&&"number"==typeof b&&BOOMR.addVar("scr.sxy",a+"x"+b)}},"screen");b(g,function(){g.hardwareConcurrency&&BOOMR.addVar("cpu.cnc",g.hardwareConcurrency);g.maxTouchPoints&&BOOMR.addVar("scr.mtp",g.maxTouchPoints)},"navigator");b(h,function(){BOOMR.addVar("bat.lvl",h.level)},"battery");b(!0,function(){var b;BOOMR.addVar({"dom.ln":a("*"),"dom.sz":d.documentElement.innerHTML.length});b={};BOOMR.addVar(a("img",["dom.img","dom.img.ext","dom.img.uniq"],function(a){return a.src&&!a.src.toLowerCase().match(/^(?:about:|javascript:|data:|#)/)},function(a){return!(b[a.src]=b.hasOwnProperty(a.src))}));b={};BOOMR.addVar(a("script",["dom.script","dom.script.ext","dom.script.uniq"],function(a){return a.src&&!a.src.toLowerCase().match(/^(?:about:|javascript:|#)/)},function(a){return!(b[a.src]=b.hasOwnProperty(a.src))}));b={};BOOMR.addVar(a("iframe",["dom.iframe","dom.iframe.ext","dom.iframe.uniq"],function(a){return a.src&&!a.src.toLowerCase().match(/^(?:about:|javascript:|#)/)},function(a){return!(b[a.src]=b.hasOwnProperty(a.src))}));b={};BOOMR.addVar(a("link",["dom.link","dom.link.css","dom.link.css.uniq"],function(a){return a.rel&&"stylesheet"===a.rel.toLowerCase()&&a.href&&!a.href.toLowerCase().match(/^(?:about:|javascript:|#)/)},function(a){return!(b[a.href]=b.hasOwnProperty(a.href))}))},"dom")}}};BOOMR.plugins.Memory={init:function(){var a;try{c=BOOMR.window;d=c.document;j=BOOMR.getPerformance();a=c.console;f=c.screen;g=c.navigator;if(g&&g.battery)h=g.battery;else if(g&&"function"==typeof g.getBattery){var b=g.getBattery();b&&"function"==typeof b.then?b.then(function(a){h=a}):"object"==typeof b&&b.hasOwnProperty("level")&&(h=b)}}catch(k){BOOMR.addError(k,"Memory.init")}e=j&&j.memory?j.memory:a&&a.memory?a.memory:null;if(i.initialized)return this;i.initialized=!0;BOOMR.subscribe("before_beacon",i.done,null,i);return this},is_complete:function(){return!0}}}}();!function(){if(!BOOMR.plugins.CACHE_RELOAD){var a={url:""};BOOMR.plugins.CACHE_RELOAD={init:function(b){BOOMR.utils.pluginConfig(a,b,"CACHE_RELOAD",["url"]);if(!a.url)return this;var c=document.createElement("iframe");c.style.display="none";c.src=a.url;document.body.appendChild(c);return this},is_complete:function(){return!0}}}}();!function(){"use strict";function a(a,b){var c=(65535&a)+(65535&b);return(a>>16)+(b>>16)+(c>>16)<<16|65535&c}function b(a,b){return a<<b|a>>>32-b}function c(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)}function d(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)}function e(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)}function f(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)}function g(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)}function h(b,c){b[c>>5]|=128<<c%32;b[14+(c+64>>>9<<4)]=c;var h,i,j,k,l,m=1732584193,n=-271733879,o=-1732584194,p=271733878;for(h=0;h<b.length;h+=16){i=m;j=n;k=o;l=p;m=d(m,n,o,p,b[h],7,-680876936);p=d(p,m,n,o,b[h+1],12,-389564586);o=d(o,p,m,n,b[h+2],17,606105819);n=d(n,o,p,m,b[h+3],22,-1044525330);m=d(m,n,o,p,b[h+4],7,-176418897);p=d(p,m,n,o,b[h+5],12,1200080426);o=d(o,p,m,n,b[h+6],17,-1473231341);n=d(n,o,p,m,b[h+7],22,-45705983);m=d(m,n,o,p,b[h+8],7,1770035416);p=d(p,m,n,o,b[h+9],12,-1958414417);o=d(o,p,m,n,b[h+10],17,-42063);n=d(n,o,p,m,b[h+11],22,-1990404162);m=d(m,n,o,p,b[h+12],7,1804603682);p=d(p,m,n,o,b[h+13],12,-40341101);o=d(o,p,m,n,b[h+14],17,-1502002290);n=d(n,o,p,m,b[h+15],22,1236535329);m=e(m,n,o,p,b[h+1],5,-165796510);p=e(p,m,n,o,b[h+6],9,-1069501632);o=e(o,p,m,n,b[h+11],14,643717713);n=e(n,o,p,m,b[h],20,-373897302);m=e(m,n,o,p,b[h+5],5,-701558691);p=e(p,m,n,o,b[h+10],9,38016083);o=e(o,p,m,n,b[h+15],14,-660478335);n=e(n,o,p,m,b[h+4],20,-405537848);m=e(m,n,o,p,b[h+9],5,568446438);p=e(p,m,n,o,b[h+14],9,-1019803690);o=e(o,p,m,n,b[h+3],14,-187363961);n=e(n,o,p,m,b[h+8],20,1163531501);m=e(m,n,o,p,b[h+13],5,-1444681467);p=e(p,m,n,o,b[h+2],9,-51403784);o=e(o,p,m,n,b[h+7],14,1735328473);n=e(n,o,p,m,b[h+12],20,-1926607734);m=f(m,n,o,p,b[h+5],4,-378558);p=f(p,m,n,o,b[h+8],11,-2022574463);o=f(o,p,m,n,b[h+11],16,1839030562);n=f(n,o,p,m,b[h+14],23,-35309556);m=f(m,n,o,p,b[h+1],4,-1530992060);p=f(p,m,n,o,b[h+4],11,1272893353);o=f(o,p,m,n,b[h+7],16,-155497632);n=f(n,o,p,m,b[h+10],23,-1094730640);m=f(m,n,o,p,b[h+13],4,681279174);p=f(p,m,n,o,b[h],11,-358537222);o=f(o,p,m,n,b[h+3],16,-722521979);n=f(n,o,p,m,b[h+6],23,76029189);m=f(m,n,o,p,b[h+9],4,-640364487);p=f(p,m,n,o,b[h+12],11,-421815835);o=f(o,p,m,n,b[h+15],16,530742520);n=f(n,o,p,m,b[h+2],23,-995338651);m=g(m,n,o,p,b[h],6,-198630844);p=g(p,m,n,o,b[h+7],10,1126891415);o=g(o,p,m,n,b[h+14],15,-1416354905);n=g(n,o,p,m,b[h+5],21,-57434055);m=g(m,n,o,p,b[h+12],6,1700485571);p=g(p,m,n,o,b[h+3],10,-1894986606);o=g(o,p,m,n,b[h+10],15,-1051523);n=g(n,o,p,m,b[h+1],21,-2054922799);m=g(m,n,o,p,b[h+8],6,1873313359);p=g(p,m,n,o,b[h+15],10,-30611744);o=g(o,p,m,n,b[h+6],15,-1560198380);n=g(n,o,p,m,b[h+13],21,1309151649);m=g(m,n,o,p,b[h+4],6,-145523070);p=g(p,m,n,o,b[h+11],10,-1120210379);o=g(o,p,m,n,b[h+2],15,718787259);n=g(n,o,p,m,b[h+9],21,-343485551);m=a(m,i);n=a(n,j);o=a(o,k);p=a(p,l)}return[m,n,o,p]}function i(a){var b,c="";for(b=0;b<32*a.length;b+=8)c+=String.fromCharCode(a[b>>5]>>>b%32&255);return c}function j(a){var b,c=[];c[(a.length>>2)-1]=void 0;for(b=0;b<c.length;b+=1)c[b]=0;for(b=0;b<8*a.length;b+=8)c[b>>5]|=(255&a.charCodeAt(b/8))<<b%32;return c}function k(a){return i(h(j(a),8*a.length))}function l(a,b){var c,d,e=j(a),f=[],g=[];f[15]=g[15]=void 0;e.length>16&&(e=h(e,8*a.length));for(c=0;c<16;c+=1){f[c]=909522486^e[c];g[c]=1549556828^e[c]}d=h(f.concat(j(b)),512+8*b.length);return i(h(g.concat(d),640))}function m(a){var b,c,d="0123456789abcdef",e="";for(c=0;c<a.length;c+=1){b=a.charCodeAt(c);e+=d.charAt(b>>>4&15)+d.charAt(15&b)}return e}function n(a){return unescape(encodeURIComponent(a))}function o(a){return k(n(a))}function p(a){return m(o(a))}function q(a,b){return l(n(a),n(b))}function r(a,b){return m(q(a,b))}function s(a,b,c){return b?c?q(b,a):r(b,a):c?o(a):p(a)}if(!BOOMR.utils||!BOOMR.utils.md5){BOOMR.utils=BOOMR.utils||{};BOOMR.utils.MD5=s}}();!function(){if(!BOOMR.utils||!BOOMR.utils.Compression){var a=BOOMR.utils.Compression={};a.jsUrl=function(b){function c(a){if(!/[^\w-.]/.test(a))return a;a=a.replace(/[^\w-.]/g,function(a){if("$"===a)return"!";a=a.charCodeAt(0);return a<256?"*"+("00"+a.toString(16)).slice(-2):"**"+("0000"+a.toString(16)).slice(-4)});return a}var d=[];switch(typeof b){case"number":return isFinite(b)?"~"+b:"~null";case"string":return"~'"+c(b);case"boolean":return"~"+b;case"object":if(!b)return"~null";if(BOOMR.utils.isArray(b)){for(var e=0;e<b.length;e++)e in b&&(d[e]=a.jsUrl(b[e])||"~null");return"~("+(d.join("")||"~")+")"}for(var f in b)if(b.hasOwnProperty(f)){var g=a.jsUrl(b[f]);g&&d.push(c(f)+g)}return"~("+d.sort().join("~")+")";default:return}}}}();!function(a,b){"use strict";a.ErrorStackParser=b()}(this,function(){"use strict";function a(a,b,c){if("function"==typeof Array.prototype.map)return a.map(b,c);for(var d=new Array(a.length),e=0;e<a.length;e++)d[e]=b.call(c,a[e]);return d}function b(a,b,c){if("function"==typeof Array.prototype.filter)return a.filter(b,c);for(var d=[],e=0;e<a.length;e++)b.call(c,a[e])&&d.push(a[e]);return d}var c=/(^|@)\S+\:\d+/,d=/^\s*at .*(\S+\:\d+|\(native\))/m,e=/^(eval@)?(\[native code\])?$/;return{parse:function(a){if(void 0!==a.stacktrace||void 0!==a["opera#sourceloc"])return this.parseOpera(a);if(a.stack&&a.stack.match(d))return this.parseV8OrIE(a);if(a.stack)return this.parseFFOrSafari(a);throw new Error("Cannot parse given Error object")},extractLocation:function(a){if(-1===a.indexOf(":"))return[a];var b=a.replace(/[\(\)\s]/g,"").split(":"),c=b.pop(),d=b[b.length-1];if(!isNaN(parseFloat(d))&&isFinite(d)){var e=b.pop();return[b.join(":"),e,c]}return[b.join(":"),c,void 0]},parseV8OrIE:function(c){return a(b(c.stack.split("\n"),function(a){return!!a.match(d)},this),function(a){a.indexOf("(eval ")>-1&&(a=a.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var b=a.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),c=this.extractLocation(b.pop());return{functionName:b.join(" ")||void 0,fileName:"eval"===c[0]?void 0:c[0],lineNumber:c[1],columnNumber:c[2],source:a}},this)},parseFFOrSafari:function(c){return a(b(c.stack.split("\n"),function(a){return!a.match(e)},this),function(a){a.indexOf(" > eval")>-1&&(a=a.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1"));if(-1===a.indexOf("@")&&-1===a.indexOf(":"))return{functionName:a};var b=a.split("@"),c=this.extractLocation(b.pop());return{functionName:b.join("@")||void 0,fileName:c[0],lineNumber:c[1],columnNumber:c[2],source:a}},this)},parseOpera:function(a){return!a.stacktrace||a.message.indexOf("\n")>-1&&a.message.split("\n").length>a.stacktrace.split("\n").length?this.parseOpera9(a):a.stack?this.parseOpera11(a):this.parseOpera10(a)},parseOpera9:function(a){for(var b=/Line (\d+).*script (?:in )?(\S+)/i,c=a.message.split("\n"),d=[],e=2,f=c.length;e<f;e+=2){var g=b.exec(c[e]);g&&d.push({fileName:g[2],lineNumber:g[1],source:c[e]})}return d},parseOpera10:function(a){for(var b=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,c=a.stacktrace.split("\n"),d=[],e=0,f=c.length;e<f;e+=2){var g=b.exec(c[e]);g&&d.push({functionName:g[3]||void 0,fileName:g[2],lineNumber:g[1],source:c[e]})}return d},parseOpera11:function(d){return a(b(d.stack.split("\n"),function(a){return!!a.match(c)&&!a.match(/^Error created at/)},this),function(a){var b,c=a.split("@"),d=this.extractLocation(c.pop()),e=c.shift()||"",f=e.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;e.match(/\(([^\)]*)\)/)&&(b=e.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));return{functionName:f,args:void 0===b||"[arguments not available]"===b?void 0:b.split(","),fileName:d[0],lineNumber:d[1],columnNumber:d[2],source:a}},this)}}});!function(){function a(a){a=a||{};"number"==typeof a.count||"string"==typeof a.count?this.count=parseInt(a.count,10):this.count=1;"number"==typeof a.timestamp?this.timestamp=a.timestamp:this.timestamp=BOOMR.now();"number"!=typeof a.code&&"string"!=typeof a.code||(this.code=parseInt(a.code,10));"string"==typeof a.message&&(this.message=a.message);"string"==typeof a.functionName&&(this.functionName=a.functionName);"string"==typeof a.fileName&&(this.fileName=a.fileName);"number"!=typeof a.lineNumber&&"string"!=typeof a.lineNumber||(this.lineNumber=parseInt(a.lineNumber,10));"number"!=typeof a.columnNumber&&"string"!=typeof a.columnNumber||(this.columnNumber=parseInt(a.columnNumber,10));"string"==typeof a.stack&&(this.stack=a.stack);"string"==typeof a.type&&(this.type=a.type);void 0!==a.extra&&(this.extra=a.extra);this.source="number"==typeof a.source||"string"==typeof a.source?parseInt(a.source,10):BOOMR.plugins.Errors.SOURCE_APP;"number"!=typeof a.via&&"string"!=typeof a.via||(this.via=parseInt(a.via,10));BOOMR.utils.isArray(a.frames)?this.frames=a.frames:this.frames=[];BOOMR.utils.isArray(a.events)?this.events=a.events:this.events=[]}var b;if(!BOOMR.plugins.Errors){var c=["BOOMR_addError","createStackForSend","BOOMR.window.console.error","BOOMR.plugins.Errors.init","BOOMR.window.onerror","BOOMR_plugins_errors_"],d=5e3;a.prototype.equals=function(a){return"object"==typeof a&&(this.code===a.code&&(this.message===a.message&&(this.functionName===a.functionName&&(this.fileName===a.fileName&&(this.lineNumber===a.lineNumber&&(this.columnNumber===a.columnNumber&&(this.stack===a.stack&&(this.type===a.type&&this.source===a.source))))))))};a.fromError=function(b,e,f){var g,h,i,j,k=!1,l=BOOMR.now();if(!b)return null;if(b.stack){b.stack.length>d&&(b.stack=b.stack.substr(0,d));h=ErrorStackParser.parse(b);if(h&&h.length){if(b.generatedStack){if(h.length>=4&&h[1].functionName&&-1!==h[1].functionName.indexOf("createStackForSend")){h=h.slice(3);k=!0}if(h.length>=3&&h[0].functionName&&-1!==h[0].functionName.indexOf("createStackForSend")){h=h[1].fileName===h[2].fileName?h.slice(3):h.slice(2);k=!0}if(h.length>=1&&h[0].functionName&&-1!==h[0].functionName.indexOf("BOOMR_plugins_errors")){h=h.slice(1);k=!0}}for(i=0;i<h.length;i++)if(h[i].functionName)for(j=0;j<c.length;j++)if(-1!==h[i].functionName.indexOf(c[j])){h.splice(i,1);k=!0;i--;break}if(h.length){g=h[0];(k||void 0===b.lineNumber)&&(b.lineNumber=g.lineNumber);(k||void 0===b.columnNumber)&&(b.columnNumber=g.columnNumber);(k||void 0===b.functionName)&&(b.functionName=g.functionName);(k||void 0===b.fileName)&&(b.fileName=g.fileName)}b.stack&&(b.stack=b.stack.replace(/\s\s+/g," "))}}else(b.functionName||b.fileName||b.lineNumber||b.columnNumber)&&(h=[{lineNumber:b.lineNumber,columnNumber:b.columnNumber,fileName:b.fileName,functionName:b.functionName}]);b.message&&-1!==b.message.indexOf("ReferenceError:")&&"Error"===b.name&&(b.name="ReferenceError");return new a({code:b.code?b.code:void 0,message:b.message?b.message:void 0,functionName:b.functionName?b.functionName:void 0,fileName:b.fileName?b.fileName:void 0,lineNumber:b.lineNumber?b.lineNumber:void 0,columnNumber:b.columnNumber?b.columnNumber:void 0,stack:b.stack?b.stack:void 0,type:b.name?b.name:void 0,source:f,via:e,frames:h,extra:b.extra?b.extra:void 0,timestamp:b.timestamp?b.timestamp:l})};b={onError:void 0,monitorGlobal:!0,monitorNetwork:!0,monitorConsole:!0,monitorEvents:!0,monitorTimeout:!0,sendAfterOnload:!1,isDuringLoad:!0,maxErrors:10,sendInterval:1e3,sendIntervalId:-1,maxEvents:10,initialized:!1,supported:!1,errors:[],q:[],events:[],send:function(a,c,d){function createStackForSend(){try{throw Error(a)}catch(f){a=f;a.generatedStack=!0;a.timestamp=e;b.addError(a,c,d)}}var e=BOOMR.now();if(a){c=c||BOOMR.plugins.Errors.VIA_APP;d=d||BOOMR.plugins.Errors.SOURCE_APP;if(a.stack||a.noStack){a.timestamp=e;b.addError(a,c,d)}else createStackForSend()}},addError:function(c,d,e){var f,g,h=!1;if(b.isDuringLoad||b.sendAfterOnload){if(b.onError){try{f=b.onError(c)}catch(i){f=!1}if(!f)return}if(!(b.errors.length>=b.maxErrors)){g=a.fromError(c,d,e);h=b.mergeDuplicateErrors(b.errors,g,!1);BOOMR.fireEvent("onerror",h||g);b.mergeDuplicateErrors(b.q,g,!0);if(!b.isDuringLoad&&-1===b.sendIntervalId){if(h)return;b.sendIntervalId=setTimeout(function(){b.sendIntervalId=-1;BOOMR.addVar("http.initiator","error");BOOMR.addVar("api",1);b.addErrorsToBeacon();BOOMR.sendBeacon()},b.sendInterval)}}}},findDuplicateError:function(a,b){if(BOOMR.utils.isArray(a)&&void 0!==b)for(var c=0;c<a.length;c++)if(a[c].equals(b))return a[c]},mergeDuplicateErrors:function(a,c,d){if(BOOMR.utils.isArray(a)&&void 0!==c){var e=b.findDuplicateError(a,c);if(e){d&&(e.count+=c.count);return e}a.push(c)}},onBeacon:function(){BOOMR.removeVar("err");BOOMR.removeVar("api");BOOMR.removeVar("http.initiator")},pageReady:function(){b.isDuringLoad=!1},getErrors:function(){return 0!==b.errors.length&&b.errors},getErrorsForUrl:function(a){a=b.compressErrors(a);if(BOOMR.utils.Compression&&BOOMR.utils.Compression.jsUrl)return BOOMR.utils.Compression.jsUrl(a);if(window.JSON)return JSON.stringify(a);BOOMR.debug("JSON is not supported","Errors");return""},addErrorsToBeacon:function(){if(b.q.length){var a=this.getErrorsForUrl(b.q);a&&BOOMR.addVar("err",a);b.q=[]}},beforeBeacon:function(){b.addErrorsToBeacon()},wrapFn:function(a,c,d,e,f){var g=c[a];"function"==typeof g&&(c[a]=function(){try{var h=Array.prototype.slice.call(arguments),i=h[e],j=d?this:c,k=b.wrap(i,j,f);h[e]=k;"addEventListener"===a&&b.trackFn(j,h[0],i,h[2],k);return g.apply(j,h)}catch(l){b.send(l,f)}})},trackFn:function(a,c,d,e,f){if(a&&-1===b.trackedFnIdx(a,c,d,e)){a._bmrEvents||(a._bmrEvents=[]);a._bmrEvents.push([c,d,!!e,f])}},trackedFnIdx:function(a,b,c,d){var e,f;if(a){a._bmrEvents||(a._bmrEvents=[]);for(e=0;e<a._bmrEvents.length;e++){f=a._bmrEvents[e];if(f[0]===b&&f[1]===c&&f[2]===!!d)return e}return-1}},wrapRemoveEventListener:function(a){var c,d,e="removeEventListener",f=a[e];"function"==typeof f&&(a[e]=function(a,e,g){c=b.trackedFnIdx(this,a,e,g);if(-1!==c){d=this._bmrEvents[c][3];f.call(this,a,d,g);this._bmrEvents.splice(c,1)}else f.call(this,a,e,g)})},wrap:function(a,c,d){if("function"!=typeof a)return a;d=d||BOOMR.plugins.Errors.VIA_APP;BOOMR_check_doc_domain();return function(){try{return a.apply(c,arguments)}catch(e){b.send(e,d)}}},test:function(){var a,c,d;if(0!==arguments.length){a=arguments[0];if("function"==typeof a){c=arguments.length>1?arguments[1]:BOOMR.window;var d=Array.prototype.slice.call(arguments,2);return b.wrap(a,c).apply(c,d)}}},normalizeToString:function(a){return void 0===a?"undefined":null===a?"null":"number"==typeof a&&isNaN(a)?"NaN":""===a?"(empty string)":0===a?"0":a?"function"==typeof a?"(function)":a&&"function"==typeof a.toString?a.toString():"(unknown)":"false"},compressErrors:function(a){var b,c,d,e,f,g,h,i,j,k=0;i=BOOMR.window.location.origin;for(b=0;b<a.length;b++){d=a[b];j={};1!==d.count&&(j.n=d.count);if("number"==typeof d.timestamp){k=d.timestamp;j.d=d.timestamp.toString(36)}if(d.frames.length){j.f=[];for(c=0;c<d.frames.length;c++){e=d.frames[c];e.lineNumber&&(e.lineNumber=parseInt(e.lineNumber,10));e.columnNumber&&(e.columnNumber=parseInt(e.columnNumber,10));g={l:e.lineNumber,c:e.columnNumber};"string"==typeof e.fileName&&(-1!==e.fileName.indexOf(i)?g.wo=e.fileName.replace(i,""):g.w=e.fileName);"string"==typeof e.functionName&&(g.f=e.functionName);j.f.push(g)}}if(d.events.length){j.e=[];for(c=0;c<d.events.length;c++){f=d.events[c];h={t:f.type,d:k?k-f.timestamp:f.timestamp};if(f.type===BOOMR.plugins.Errors.EVENT_CLICK){f.id&&(h.i=f.id);f.name&&(h.n=f.name);f.tagName&&(h.g=f.tagName)}else if(f.type===BOOMR.plugins.Errors.EVENT_NETWORK){f.url&&(h.u=f.url);f.method&&(h.m=f.method);f.result&&(h.r=f.result)}else if(f.type===BOOMR.plugins.Errors.EVENT_LOG){f.severity&&(h.s=f.severity);f.message&&(h.m=f.message)}j.e.push(h)}}d.source!==BOOMR.plugins.Errors.SOURCE_APP&&(j.s=d.source);void 0!==d.via&&d.via!==BOOMR.plugins.Errors.VIA_APP&&(j.v=d.via);void 0!==d.type&&"Error"!==d.type&&(j.t=d.type);d.code&&(j.c=d.code);d.message&&(j.m=d.message);d.extra&&(j.x=d.extra);a[b]=j}return a}};var e=BOOMR.plugins.Errors={init:function(a){BOOMR.utils.pluginConfig(b,a,"Errors",["onError","monitorGlobal","monitorNetwork","monitorConsole","monitorEvents","monitorTimeout","sendAfterOnload","sendInterval","maxErrors"]);if(b.initialized)return this;b.initialized=!0;b.supported=!0;if(!b.supported)return this;BOOMR.subscribe("before_beacon",b.beforeBeacon,null,b);BOOMR.subscribe("onbeacon",b.onBeacon,null,b);BOOMR.subscribe("page_ready",b.pageReady,null,b);BOOMR.registerEvent("onerror");if(b.monitorGlobal)try{var c=BOOMR.window.onerror;BOOMR.window.onerror=function(a,d,f,g,h){void 0!==h&&null!==h?b.send(h,e.VIA_GLOBAL_EXCEPTION_HANDLER):b.send({message:a,fileName:d,lineNumber:f,columnNumber:g,noStack:!0},e.VIA_GLOBAL_EXCEPTION_HANDLER);"function"==typeof c&&c.apply(window,arguments)}}catch(f){BOOMR.debug("Exception in the window.onerror handler","Errors")}b.monitorNetwork&&BOOMR.subscribe("onxhrerror",function(a){b.send({code:a.status,message:a.url,noStack:!0},e.VIA_NETWORK)});if(b.monitorConsole){BOOMR.window.console||(BOOMR.window.console={});var d=BOOMR.window.console.error;try{BOOMR.window.console.error=function(){var a=Array.prototype.slice.call(arguments);1===a.length?b.send(b.normalizeToString(a[0]),e.VIA_CONSOLE):b.send(b.normalizeToString(a),e.VIA_CONSOLE);"function"==typeof d&&("function"==typeof d.apply?d.apply(this,a):d(a[0],a[1],a[2]))}}catch(g){BOOMR.debug("Exception in the window.console.error handler","Errors")}}if(b.monitorEvents&&BOOMR.window.addEventListener&&BOOMR.window.Element){b.wrapFn("addEventListener",BOOMR.window,!1,1,e.VIA_EVENTHANDLER);b.wrapFn("addEventListener",BOOMR.window.Element.prototype,!0,1,e.VIA_EVENTHANDLER);b.wrapFn("addEventListener",BOOMR.window.XMLHttpRequest.prototype,!0,1,e.VIA_EVENTHANDLER);b.wrapRemoveEventListener(BOOMR.window);b.wrapRemoveEventListener(BOOMR.window.Element.prototype);b.wrapRemoveEventListener(BOOMR.window.XMLHttpRequest.prototype)}if(b.monitorTimeout){b.wrapFn("setTimeout",BOOMR.window,!1,0,e.VIA_TIMEOUT);b.wrapFn("setInterval",BOOMR.window,!1,0,e.VIA_TIMEOUT)}return this},is_complete:function(){return!0},is_supported:function(){return b.initialized&&b.supported},SOURCE_APP:1,SOURCE_BOOMERANG:2,VIA_APP:1,VIA_GLOBAL_EXCEPTION_HANDLER:2,VIA_NETWORK:3,VIA_CONSOLE:4,VIA_EVENTHANDLER:5,VIA_TIMEOUT:6,EVENT_CLICK:1,EVENT_NETWORK:2,EVENT_LOG:3,send:b.send,wrap:b.wrap,test:b.test,BoomerangError:a}}}();!function(){"use strict";if(!BOOMR.plugins.TPAnalytics){var a={addedVars:[],clientids:!1,dropParams:[],googleAnalytics:function(){var b,c,d,e,f,g={},h=BOOMR.window,i=["utm_source","utm_medium","utm_term","utm_content","utm_campaign"];if(a.clientids){if("function"==typeof h.ga)try{h.ga(function(a){a&&(g.clientid=a.get("clientId"))});if(!g.clientid&&"function"==typeof h.ga.getAll){f=h.ga.getAll();f&&f.length>0&&(g.clientid=f[0].get("clientId"))}}catch(j){BOOMR.addError(j,"TPAnalytics googleAnalytics")}if(!g.clientid){e=BOOMR.utils.getCookie("_ga");if(e){e=e.split(".");e&&4===e.length&&(g.clientid=e[2]+"."+e[3])}else{e=BOOMR.utils.getCookie("__utma");if(e){e=e.split(".")
;e&&6===e.length&&(g.clientid=e[1]+"."+e[2])}}}}for(b=0;b<i.length;b++){c=i[b];d=BOOMR.utils.getQueryParamValue(c);d&&(g[c]=d)}return g},adobeAnalytics:function(){var b,c,d,e,f,g={},h=BOOMR.window,i=/AMCV_([A-Z0-9]+)%40AdobeOrg/,j=/\|([^\[]+)/;if(void 0!==h._satellite||"function"==typeof h.mboxCreate||"function"==typeof h.Visitor||"object"==typeof h.s){if(a.clientids)if("object"==typeof h.s&&"object"==typeof h.s.visitor&&"function"==typeof h.s.visitor.getAnalyticsVisitorID&&"function"==typeof h.s.visitor.getMarketingCloudVisitorID)try{c=h.s.visitor.getMarketingCloudVisitorID();c&&(g.mid=c);b=h.s.visitor.getAnalyticsVisitorID();b&&(g.aid=h.s.visitor.getAnalyticsVisitorID())}catch(k){BOOMR.addError(k,"TPAnalytics adobeAnalytics")}else{d=i.exec(h.document.cookie);if(d&&"function"==typeof h.Visitor&&"function"==typeof h.Visitor.getInstance)try{e=h.Visitor.getInstance(d[1]+"@AdobeOrg");if(e&&"function"==typeof e.getAnalyticsVisitorID&&"function"==typeof e.getMarketingCloudVisitorID){c=e.getMarketingCloudVisitorID();c&&(g.mid=c);b=e.getAnalyticsVisitorID();b&&(g.aid=e.getAnalyticsVisitorID())}}catch(k){BOOMR.addError(k,"TPAnalytics adobeAnalytics")}else{b=BOOMR.utils.getCookie("s_vi");if(b){f=j.exec(b);b=f&&f.length>0?f[1]:""}else b=BOOMR.utils.getCookie("s_fid");b&&(g.aid=b)}}if("object"==typeof h.s){"string"==typeof h.s.campaign&&h.s.campaign&&(g.campaign=h.s.campaign);"string"==typeof h.s.purchaseID&&h.s.purchaseID&&(g.purchaseid=h.s.purchaseID)}}return g},ibmAnalytics:function(){var b,c,d,e,f,g,h={},i=BOOMR.window,j={cm_mmc:[/([^&#]+?)-_-([^&#]+?)-_-([^&#]+?)-_-([^&#]+)/,["mmc_vendor","mmc_category","mmc_placement","mmc_item"]],cm_sp:[/([^&#]+?)-_-([^&#]+?)-_-([^&#]+)/,["sp_type","sp_promotion","sp_link"]],cm_re:[/([^&#]+?)-_-([^&#]+?)-_-([^&#]+)/,["re_version","re_pagearea","re_link"]]};if(a.clientids&&"function"==typeof i.cmRetrieveUserID)try{i.cmRetrieveUserID(function(a){h.coreid=a})}catch(k){BOOMR.addError(k,"TPAnalytics ibmAnalytics")}for(e in j)if(j.hasOwnProperty(e)){b=BOOMR.utils.getQueryParamValue(e);if(b){f=j[e][0];g=j[e][1];c=f.exec(b);if(c&&c.length>g.length)for(d=0;d<g.length;d++)c[d+1]&&(h[g[d]]=decodeURIComponent(c[d+1]))}}return h},pageReady:function(){this.addedVars=[];var b,c,d,e,f={ga:this.googleAnalytics,aa:this.adobeAnalytics,ia:this.ibmAnalytics};for(b in f){c=f[b]();for(var d in c){var e="tp."+b+"."+d;if(!BOOMR.utils.inArray(e,this.dropParams)){BOOMR.addVar(e,c[d]);a.addedVars.push(e)}}}this.addedVars.length>0&&BOOMR.sendBeacon()},onBeacon:function(){if(this.addedVars&&this.addedVars.length>0){BOOMR.removeVar(this.addedVars);this.addedVars=[]}}};BOOMR.plugins.TPAnalytics={init:function(b){BOOMR.utils.pluginConfig(a,b,"TPAnalytics",["clientids","dropParams"]);if(!a.initialized){BOOMR.utils.isArray(a.dropParams)||(a.dropParams=[]);BOOMR.subscribe("page_ready",a.pageReady,null,a);BOOMR.subscribe("onbeacon",a.onBeacon,null,a);BOOMR.subscribe("prerender_to_visible",a.pageReady,null,a);a.initialized=!0}return this},is_complete:function(){return!0}}}}();!function(a){"use strict";var b,c;if(void 0!==a){b=a;c=b.UserTimingCompression}else b={};var d,e=d={};e.noConflict=function(){b.UserTimingCompression=c;return e};e.trimTiming=function(a,b){"number"!=typeof a&&(a=0);"number"!=typeof b&&(b=0);var c=Math.round(a),d=Math.round(b);return 0===c?0:c-d};e.toBase36=function(a){return"number"==typeof a?a.toString(36):""};e.findUserTimingForFrame=function(a){var b;if(!a)return[];try{a.location&&a.location.href;if(!("performance"in a&&a.performance&&a.performance.getEntriesByType))return b;b=a.performance.getEntriesByType("mark");b=b.concat(a.performance.getEntriesByType("measure"))}catch(c){return b}return b};e.compressUserTiming=function(a,b){var c,e,f,g=0,h={};b=b||{};if(!a||!a.length)return[];for(c=0;c<a.length;c++){e=a[c];void 0===h[e.name]&&(h[e.name]=[]);"mark"===e.entryType?h[e.name].push({startTime:e.startTime}):"measure"===e.entryType&&h[e.name].push({startTime:e.startTime,duration:e.duration})}for(var i in h)if(h.hasOwnProperty(i)){if(b.map&&void 0===b.map[i])continue;var j=h[i];if(b.map&&void 0!==b.map[i]){delete h[i];i=b.map[i]}g=0;for(c=0;c<j.length;c++){var k=j[c];f=d.toBase36(d.trimTiming(k.startTime,g));"0"===f&&(f="");var l=f;if("number"==typeof k.duration){var m=d.toBase36(Math.round(k.duration));l+="_";"0"!==m&&(l+=m)}g=k.startTime;j[c]=l}h[i]=d.compressArray(j)}return h};e.convertToTrie=function(a){var b,c,d,e,f,g,h,i={};if(!a)return{};for(b in a)if(a.hasOwnProperty(b)){d=a[b];e=b.split("");g=i;for(c=0;c<e.length;c++){f=e[c];h=g[f];void 0===h?g=g[f]=c===e.length-1?d:{}:"string"==typeof h?g=g[f]={"!":h}:c===e.length-1?g[f]["!"]=d:g=g[f]}}return i};e.optimizeTrie=function(a,b){var c,d,e,f=0;if(!a)return{};for(c in a){if("object"==typeof a[c]){d=this.optimizeTrie(a[c],!1);if(d){delete a[c];c+=d.name;a[c]=d.value}}f++}if(1===f){if(b){e={};e[c]=a[c];return e}return{name:c,value:a[c]}}return!!b&&a};e.compressArray=function(a){var b=0,c="";if(!a||0===a.length||a.constructor!==Array)return"";for(var d=0;d<a.length;d++){var e=a[d];if(d<a.length-1&&e===a[d+1])b++;else if(b>0){c+=(""!==c?".":"")+e+"*";b>=2&&(c+=b+1);b=0}else c+=(""!==c?".":"")+e}return/^\d+$/.test(c)?parseInt(c,10):c};e.getCompressedUserTiming=function(b){var c,e;b=b||{};c=b.window||a;e=this.findUserTimingForFrame(c);b.from&&(e=e.filter(function(a){return a.startTime+a.duration>=b.from}));b.to&&(e=e.filter(function(a){return a.startTime<=b.to}));return d.compressUserTiming(e,b)};e.compressForUri=function(a){if("object"!=typeof a)return"";var b=!1;for(var c in a)if(a.hasOwnProperty(c)){if(isNaN(c)){b=!1;break}b=!0}if(b)return"1"+d.flattenMap(a);var e=d.convertToTrie(a),f=d.optimizeTrie(e,!0),g=d.jsUrl(f),h=d.flattenArray(a);if("string"!=typeof h||0===h.length)return"";var i=encodeURIComponent(g),j=encodeURIComponent(h);return i.length<j.length?g:"0"+h};e.flattenArray=function(a){var b=[];if("object"!=typeof a)return"";for(var c in a)if(a.hasOwnProperty(c)){var d=(a[c]+"").replace("~","%7E");c=c.replace("~","%7E");b.push(c+"~"+d)}b=b.join("~");return b};e.flattenMap=function(a){var b=[];if("object"!=typeof a)return"";for(var c in a)if(a.hasOwnProperty(c)){var e=parseInt(c,10),f=d.toBase36(e);if(e>1331)continue;if(f.length>1){f=d.toBase36(e-36);f="-"+(1===f.length?"0":"")+f}b.push(f+a[c])}b.sort();b=b.join("~");return b};e.jsUrl=function(a){function b(a){if(!/[^\w-.]/.test(a))return a;a=a.replace(/[^\w-.]/g,function(a){if("$"===a)return"!";a=a.charCodeAt(0);return a<256?"*"+("00"+a.toString(16)).slice(-2):"**"+("0000"+a.toString(16)).slice(-4)});return a}switch(typeof a){case"number":return isFinite(a)?"~"+a:"~null";case"string":return"~'"+b(a);case"boolean":return"~"+a;case"object":return a?Array.isArray(a)?"~("+(a.map(function(a){return d.jsUrl(a)||"~null"}).join("")||"~")+")":"~("+Object.keys(a).map(function(c){var e=d.jsUrl(a[c]);return e&&b(c)+e}).filter(function(a){return a}).sort().join("~")+")":"~null";default:return}};"function"==typeof define&&define.amd?define([],function(){return e}):"undefined"!=typeof module&&module.exports?module.exports=e:void 0!==b&&(b.UserTimingCompression=e)}("undefined"!=typeof window?window:void 0);!function(){if(!BOOMR.plugins.UserTiming){var a={complete:!1,initialized:!1,supported:!1,options:{from:0,window:BOOMR.window},getUserTiming:function(){var b,c,d=BOOMR.now(),e=window.UserTimingCompression||BOOMR.window.UserTimingCompression;b=e.getCompressedUserTiming(a.options);c=e.compressForUri(b);this.options.from=d;return c},addEntriesToBeacon:function(){var a;if(!this.complete){BOOMR.removeVar("usertiming");a=this.getUserTiming();a&&BOOMR.addVar({usertiming:a});this.complete=!0}},clearMetrics:function(a){a.hasOwnProperty("usertiming")&&BOOMR.removeVar("usertiming");this.complete=!1},subscribe:function(){BOOMR.subscribe("before_beacon",this.addEntriesToBeacon,null,this);BOOMR.subscribe("onbeacon",this.clearMetrics,null,this)},pageReady:function(){this.checkSupport()&&this.subscribe()},checkSupport:function(){if(this.supported)return!0;if(void 0===(window.UserTimingCompression||BOOMR.window.UserTimingCompression)){BOOMR.warn("UserTimingCompression library not found","usertiming");return!1}var a=BOOMR.getPerformance();if(a&&"function"==typeof a.getEntriesByType){var b=a.getEntriesByType("mark"),c=a.getEntriesByType("measure");if(BOOMR.utils.isArray(b)&&BOOMR.utils.isArray(c)){BOOMR.info("Client supports User Timing API","usertiming");this.supported=!0;return!0}}return!1}};BOOMR.plugins.UserTiming={init:function(b){if(a.initialized)return this;a.checkSupport()?a.subscribe():BOOMR.subscribe("page_ready",a.pageReady,null,a);a.initialized=!0;return this},is_complete:function(){return!0},is_supported:function(){return a.initialized&&a.supported}}}}();!function(){function a(a,b,c){var d=a.shift();if("string"==typeof d){var e=d.split("."),f=BOOMR,g=BOOMR;"BOOMR"===e[0]&&e.shift();for(;e.length&&f&&("object"==typeof f||"function"==typeof f);){var h=e.shift();f=f[h];e.length&&(g=g[h])}if(!e.length&&"function"==typeof f){var i=f.apply(g,a);"function"==typeof b&&b.call(c,i)}}}function b(b){for(var c=0;c<b.length;c++){var d=b[c];d&&(BOOMR.utils.isArray(d)?a(d):"object"==typeof d&&BOOMR.utils.isArray(d.arguments)&&a(d.arguments,d.callback,d.thisArg))}}var c=BOOMR.window.BOOMR_mq;BOOMR.utils.isArray(c)&&b(c);BOOMR.window.BOOMR_mq={push:function(){b(arguments)}}}();BOOMR.t_end=(new Date).getTime();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment