Comparing version 1.3.3 to 1.3.4
{ | ||
"name": "mpulse", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"homepage": "https://github.com/akamai/mpulse.js", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -1,4 +0,4 @@ | ||
/*! mpulse v1.2.0 */ | ||
/*! mpulse v1.3.4 */ | ||
var CryptoJS=CryptoJS||function(e,t){var n={},i=n.lib={},o=i.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var n=new e;return t&&n.mixIn(t),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),r=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,o=e.sigBytes;if(this.clamp(),i%4)for(s=0;s<o;s++){var r=n[s>>>2]>>>24-s%4*8&255;t[i+s>>>2]|=r<<24-(i+s)%4*8}else if(n.length>65535)for(var s=0;s<o;s+=4)t[i+s>>>2]=n[s>>>2];else t.push.apply(t,n);return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],i=0;i<t;i+=4)n.push(4294967296*e.random()|0);return new r.init(n,t)}}),s=n.enc={},a=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],o=0;o<n;o++){var r=t[o>>>2]>>>24-o%4*8&255;i.push((r>>>4).toString(16)),i.push((15&r).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new r.init(n,t/2)}},f=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],o=0;o<n;o++){var r=t[o>>>2]>>>24-o%4*8&255;i.push(String.fromCharCode(r))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new r.init(n,t)}},u=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},c=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,o=n.sigBytes,s=this.blockSize,a=o/(4*s),f=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,u=e.min(4*f,o);if(f){for(var c=0;c<f;c+=s)this._doProcessBlock(i,c);var p=i.splice(0,f);n.sigBytes-=u}return new r.init(p,u)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(i.Hasher=c.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);return this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}}),n.algo={});return n}(Math);!function(e){var t=CryptoJS,n=t.lib,i=n.WordArray,o=n.Hasher,r=t.algo,s=[],a=[];!function(){function t(t){for(var n=e.sqrt(t),i=2;i<=n;i++)if(!(t%i))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var i=2,o=0;o<64;)t(i)&&(o<8&&(s[o]=n(e.pow(i,.5))),a[o]=n(e.pow(i,1/3)),o++),i++}();var f=[],u=r.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],o=n[1],r=n[2],s=n[3],u=n[4],c=n[5],p=n[6],d=n[7],h=0;h<64;h++){if(h<16)f[h]=0|e[t+h];else{var m=f[h-15],l=(m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3,g=f[h-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;f[h]=l+f[h-7]+v+f[h-16]}var y=i&o^i&r^o&r,w=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),S=d+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&p)+a[h]+f[h];d=p,p=c,c=u,u=s+S|0,s=r,r=o,o=i,i=S+(w+y)|0}n[0]=n[0]+i|0,n[1]=n[1]+o|0,n[2]=n[2]+r|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+p|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(i/4294967296),n[15+(o+64>>>9<<4)]=i,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(u),t.HmacSHA256=o._createHmacHelper(u)}(Math),function(){var e=CryptoJS,t=e.lib.Base,n=e.enc.Utf8;e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var i=e.blockSize,o=4*i;t.sigBytes>o&&(t=e.finalize(t)),t.clamp();for(var r=this._oKey=t.clone(),s=this._iKey=t.clone(),a=r.words,f=s.words,u=0;u<i;u++)a[u]^=1549556828,f[u]^=909522486;r.sigBytes=s.sigBytes=o,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);t.reset();return t.finalize(this._oKey.clone().concat(n))}})}(),function(e){"use strict";function t(t,n){r||("function"==typeof XDomainRequest||"object"==typeof XDomainRequest?(h=!0,r=function(){return new XDomainRequest}):"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest?r=function(){return new XMLHttpRequest}:"undefined"!=typeof Ti&&Ti.Network&&"function"==typeof Ti.Network.createHTTPClient?r=Ti.Network.createHTTPClient:"function"==typeof require?r=function(){return new(0,require("xmlhttprequest").XMLHttpRequest)}:e&&void 0!==e.ActiveXObject&&(r=function(){return new e.ActiveXObject("Microsoft.XMLHTTP")}));var i=r();"function"==typeof n&&(h?i.onload=function(){n(i.responseText)}:i.onreadystatechange=function(){4===i.readyState&&n(i.responseText)}),i.open("GET",t,!0),i.send()}function n(e){"object"==typeof console&&"function"==typeof console.warn&&console.warn("mPulse: "+e)}function i(i,o,r){function c(t){return-1!==t.indexOf("http://")||-1!==t.indexOf("https://")?t:(C?t="https:"+t:void 0===e?-1===t.indexOf("http:")&&(t="http:"+t):void 0!==e&&"file:"===e.location.protocol&&-1===t.indexOf("http:")&&(t="http:"+t),t)}function h(){var e=H,t=+new Date;return-1!==e.indexOf("?")?e+="&":e+="?",e+="key="+M,e+="&t="+t,e+="&s="+function(e,t,i){var o=void 0!==CryptoJS&&CryptoJS.HmacSHA256;return"function"!=typeof o&&"function"==typeof require&&(o=require("crypto-js/hmac-sha256")),"function"!=typeof o?(n("CryptoJS libraries not found! mpulse.js will not work."),""):o("key="+e+"&t="+i,t).toString()}(M,D,t),c(e)}function l(e){try{var t=JSON.parse(e);for(var n in t)t.hasOwnProperty(n)&&(R[n]=t[n])}catch(e){return void(k=!1)}if(U||B(R.session_id),J={},N={},X={},R.PageParams){var i=R.PageParams.customMetrics,o=R.PageParams.customTimers,r=R.PageParams.customDimensions;if(i)for(d=0;d<i.length;d++){var f=i[d];J[f.name]=f.label}if(o)for(d=0;d<o.length;d++){var u=o[d];N[u.name]=u.label}if(r)for(d=0;d<r.length;d++){var c=r[d];X[c.name]=c.label}}k=!0,I=!0,setTimeout(g,a),s(y)}function g(){if(""!==H){var e=h();I&&(e+="&r="),t(e,l)}}function v(e,t,n){A.push({type:e,name:t,value:n,group:q,ab:L,dimensions:function(){var e={};for(var t in j)j.hasOwnProperty(t)&&(e[t]=j[t]);return e}(),when:+new Date})}function y(e){if(0!==A.length)if(k){var t=A.shift(),i=t.type,o=t.name,r=t.value,a={};"boolean"!=typeof t.group&&(a["h.pg"]=t.group),"boolean"!=typeof t.ab&&(a["h.ab"]=t.ab),a["rt.tstart"]=a["rt.end"]=t.when;for(var u in t.dimensions)t.dimensions.hasOwnProperty(u)&&(void 0!==X[u]?a[X[u]]=t.dimensions[u]:n("Custom Dimension '"+u+"' is not defined"));"metric"===i?void 0!==J[o]?(a[J[o]]=r,w(a)):n("Custom Metric '"+o+"' is not defined"):"timer"===i&&(void 0!==N[o]?(a.t_other=N[o]+"|"+r,w(a)):n("Custom Timer '"+o+"' is not defined")),s(y)}else z&&!e||(z=!0,setTimeout(function(){y(!0)},f))}function w(e){e.d=R.site_domain,e["h.key"]=R["h.key"],e["h.d"]=R["h.d"],e["h.cr"]=R["h.cr"],e["h.t"]=R["h.t"],e["http.initiator"]="api",e["rt.start"]="api",!1!==U&&(e["rt.si"]=U,e["rt.ss"]=F,e["rt.sl"]=$),e.api=1,e["api.v"]=2,e["api.l"]="js",e["api.lv"]=u,P("before_beacon",e);var n=[];for(var i in e)e.hasOwnProperty(i)&&n.push(encodeURIComponent(i)+"="+(void 0===e[i]||null===e[i]?"":encodeURIComponent(e[i])));var o=c(R.beacon_url),r=o+(o.indexOf("?")>-1?"&":"?")+n.join("&");P("beacon",e),t(r)}function S(e,t){return"string"!=typeof e?-1:"number"!=typeof t||t<0?-1:(t=Math.round(t),v("timer",e,t),s(y),t)}function x(e){void 0!==e&&void 0!==j[e]&&delete j[e]}function b(e){"string"!=typeof e&&"number"!=typeof e||("number"==typeof e&&(e=""+e),U=e)}function _(){return U}function B(e){return b(e||"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),O(0),T(m()),_()}function O(e){"number"!=typeof e||e<0||($=e)}function T(e){"number"!=typeof e||e<0||(F=e)}function P(e,t){for(var n=0;n<E[e].length;n++)E[e][n](t)}r=r||{};var M=i,D=o,H="//c.go-mpulse.net/api/v2/config.json",C=!1,R={},I=!1,k=!1,A=[],z=!1,q=!1,L=!1,j={},X={},U=!1,J={},G={},N={},K=-1,F=m(),$=0,E={};for(d=0;d<p.length;d++)E[p[d]]=[];void 0!==r.configUrl&&(H=r.configUrl),r.forceSSL&&(C=!0),g();return{startTimer:function(e){return"string"!=typeof e?-1:(K++,G[K]={time:m(),name:e},K)},stopTimer:function(e){if("number"!=typeof e||e<0)return-1;var t=G[e],n=0;return t?(n=Math.round(m()-t.time),S(t.name,n),delete G[e],n):-1},sendTimer:S,sendMetric:function(e,t){"string"==typeof e&&(void 0!==t&&"number"!=typeof t||(void 0===t&&(t=1),v("metric",e,t),s(y)))},setPageGroup:function(e){"string"==typeof e&&(q=e)},getPageGroup:function(){return q},resetPageGroup:function(){q=!1},setABTest:function(e){return"string"==typeof e&&!1!==/^[a-zA-Z0-9_ -]{1,25}$/.test(e)&&(L=e,!0)},getABTest:function(){return L},resetABTest:function(){L=!1},setDimension:function(e,t){void 0!==e&&(void 0!==t?j[e]=t:x(e))},resetDimension:x,setSessionID:b,getSessionID:_,startSession:B,incrementSessionLength:function(){$++},setSessionLength:O,getSessionLength:function(){return $},setSessionStart:T,getSessionStart:function(){return F},transferBoomerangSession:function(t){return void 0===t&&void 0!==e&&(t=e),!!(void 0!==t&&t.BOOMR&&t.BOOMR.session&&t.BOOMR.session.ID&&t.BOOMR.session.start&&t.BOOMR.session.length)&&(b(t.BOOMR.session.ID+"-"+Math.round(t.BOOMR.session.start/1e3).toString(36)),O(t.BOOMR.session.length),T(t.BOOMR.session.start),!0)},subscribe:function(e,t){E.hasOwnProperty(e)&&"function"==typeof t&&E[e].push(t)},parseConfig:l}}function o(){}var r,s,a=3e5,f=5e3,u="1.2.0",c=["startTimer","stopTimer","sendTimer","sendMetric","setPageGroup","getPageGroup","resetPageGroup","setABTest","getABTest","resetABTest","setDimension","resetDimension","setSessionID","getSessionID","startSession","incrementSessionLength","setSessionLength","getSessionLength","setSessionStart","getSessionStart","transferBoomerangSession","subscribe"],p=["before_beacon","beacon"],d=0,h=!1,m=!1,l=+new Date;if(s="undefined"!=typeof process&&"function"==typeof process.nextTick?process.nextTick.bind(process):void 0!==e?e.setImmediate?e.setImmediate.bind(e):e.msSetImmediate?e.msSetImmediate.bind(e):e.webkitSetImmediate?e.webkitSetImmediate.bind(e):e.mozSetImmediate?e.mozSetImmediate.bind(e):function(e){setTimeout(e,10)}:function(e){setTimeout(e,10)},void 0!==e)if(void 0!==e.performance&&"function"==typeof e.performance.now)m=e.performance.now.bind(e.performance);else if(void 0!==e.performance){var g=["webkitNow","msNow","mozNow"];for(d=0;d<g.length;d++)if("function"==typeof e.performance[g[d]]){m=e.performance[g[d]];break}}void 0!==e&&"performance"in e&&e.performance&&e.performance.timing&&e.performance.timing.navigationStart&&(l=e.performance.timing.navigationStart),m||(m="undefined"!=typeof Date&&Date.now?function(){return Date.now()-l}:function(){return+new Date-l});var v,y,w,S=!1,x={};for(void 0!==e&&(w=(y=e).mPulse),v={version:u,noConflict:function(){return y.mPulse=w,v},init:function(e,t,o){if(o=o||{},void 0!==e){if(void 0!==t){if(void 0!==o.name&&void 0!==x[o.name])return x[o.name];var r=i(e,t,o);if(!1===S){S=r;for(var s=0;s<c.length;s++){var a=c[s];v[a]=S[a]}}return void 0!==o.name&&(x[o.name]=r),r}n("init(): You need to specify a secretKey")}else n("init(): You need to specify an apiKey")},getApp:function(e){return x[e]},stop:function(e){void 0!==x[e]&&delete x[e]},now:m},d=0;d<c.length;d++)v[c[d]]=o;"function"==typeof define&&define.amd?define([],function(){return v}):"undefined"!=typeof module&&module.exports?module.exports=v:void 0!==y&&(y.mPulse=v)}("undefined"!=typeof window?window:void 0); | ||
var CryptoJS=CryptoJS||function(e,t){var n={},i=n.lib={},o=i.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var n=new e;return t&&n.mixIn(t),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),r=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,o=e.sigBytes;if(this.clamp(),i%4)for(s=0;s<o;s++){var r=n[s>>>2]>>>24-s%4*8&255;t[i+s>>>2]|=r<<24-(i+s)%4*8}else if(n.length>65535)for(var s=0;s<o;s+=4)t[i+s>>>2]=n[s>>>2];else t.push.apply(t,n);return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],i=0;i<t;i+=4)n.push(4294967296*e.random()|0);return new r.init(n,t)}}),s=n.enc={},a=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],o=0;o<n;o++){var r=t[o>>>2]>>>24-o%4*8&255;i.push((r>>>4).toString(16)),i.push((15&r).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new r.init(n,t/2)}},f=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],o=0;o<n;o++){var r=t[o>>>2]>>>24-o%4*8&255;i.push(String.fromCharCode(r))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new r.init(n,t)}},u=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},c=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,o=n.sigBytes,s=this.blockSize,a=o/(4*s),f=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,u=e.min(4*f,o);if(f){for(var c=0;c<f;c+=s)this._doProcessBlock(i,c);var p=i.splice(0,f);n.sigBytes-=u}return new r.init(p,u)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(i.Hasher=c.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);return this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}}),n.algo={});return n}(Math);!function(e){var t=CryptoJS,n=t.lib,i=n.WordArray,o=n.Hasher,r=t.algo,s=[],a=[];!function(){function t(t){for(var n=e.sqrt(t),i=2;i<=n;i++)if(!(t%i))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var i=2,o=0;o<64;)t(i)&&(o<8&&(s[o]=n(e.pow(i,.5))),a[o]=n(e.pow(i,1/3)),o++),i++}();var f=[],u=r.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],o=n[1],r=n[2],s=n[3],u=n[4],c=n[5],p=n[6],d=n[7],h=0;h<64;h++){if(h<16)f[h]=0|e[t+h];else{var m=f[h-15],l=(m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3,g=f[h-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;f[h]=l+f[h-7]+v+f[h-16]}var y=i&o^i&r^o&r,w=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),S=d+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&p)+a[h]+f[h];d=p,p=c,c=u,u=s+S|0,s=r,r=o,o=i,i=S+(w+y)|0}n[0]=n[0]+i|0,n[1]=n[1]+o|0,n[2]=n[2]+r|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+p|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(i/4294967296),n[15+(o+64>>>9<<4)]=i,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(u),t.HmacSHA256=o._createHmacHelper(u)}(Math),function(){var e=CryptoJS,t=e.lib.Base,n=e.enc.Utf8;e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var i=e.blockSize,o=4*i;t.sigBytes>o&&(t=e.finalize(t)),t.clamp();for(var r=this._oKey=t.clone(),s=this._iKey=t.clone(),a=r.words,f=s.words,u=0;u<i;u++)a[u]^=1549556828,f[u]^=909522486;r.sigBytes=s.sigBytes=o,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);t.reset();return t.finalize(this._oKey.clone().concat(n))}})}(),function(e){"use strict";function t(t,n){var i="string"==typeof t?t:t.url,o=t&&t.ua;r||("function"==typeof XDomainRequest||"object"==typeof XDomainRequest?(h=!0,r=function(){return new XDomainRequest}):"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest?r=function(){return new XMLHttpRequest}:"undefined"!=typeof Ti&&Ti.Network&&"function"==typeof Ti.Network.createHTTPClient?r=Ti.Network.createHTTPClient:"function"==typeof require?r=function(){return new(0,require("xmlhttprequest").XMLHttpRequest)}:e&&void 0!==e.ActiveXObject&&(r=function(){return new e.ActiveXObject("Microsoft.XMLHTTP")}));var s=r();"function"==typeof n&&(h?s.onload=function(){n(s.responseText)}:s.onreadystatechange=function(){4===s.readyState&&n(s.responseText)}),s.open("GET",i,!0),o&&s.setRequestHeader("User-Agent",o),s.send()}function n(e){"object"==typeof console&&"function"==typeof console.warn&&console.warn("mPulse: "+e)}function i(i,o,r){function c(t){return-1!==t.indexOf("http://")||-1!==t.indexOf("https://")?t:(C?t="https:"+t:void 0===e?-1===t.indexOf("http:")&&(t="http:"+t):void 0!==e&&"file:"===e.location.protocol&&-1===t.indexOf("http:")&&(t="http:"+t),t)}function h(){var e=H,t=+new Date;return-1!==e.indexOf("?")?e+="&":e+="?",e+="key="+M,e+="&t="+t,e+="&s="+function(e,t,i){var o=void 0!==CryptoJS&&CryptoJS.HmacSHA256;return"function"!=typeof o&&"function"==typeof require&&(o=require("crypto-js/hmac-sha256")),"function"!=typeof o?(n("CryptoJS libraries not found! mpulse.js will not work."),""):o("key="+e+"&t="+i,t).toString()}(M,D,t),c(e)}function l(e){try{var t=JSON.parse(e);for(var i in t)t.hasOwnProperty(i)&&(A[i]=t[i])}catch(e){return n("config.json could not be parsed!"),void(k=!1)}if(X||B(A.session_id),J={},K={},U={},A.PageParams){var o=A.PageParams.customMetrics,r=A.PageParams.customTimers,f=A.PageParams.customDimensions;if(o)for(d=0;d<o.length;d++){var u=o[d];J[u.name]=u.label}if(r)for(d=0;d<r.length;d++){var c=r[d];K[c.name]=c.label}if(f)for(d=0;d<f.length;d++){var p=f[d];U[p.name]=p.label}}k=!0,I=!0,setTimeout(g,a),s(y)}function g(){if(""!==H){var e=h();I&&(e+="&r="),t({url:e,ua:R},l)}else n("No config.json URL specified!")}function v(e,t,n){z.push({type:e,name:t,value:n,group:L,ab:q,dimensions:function(){var e={};for(var t in N)N.hasOwnProperty(t)&&(e[t]=N[t]);return e}(),when:+new Date})}function y(e){if(0!==z.length){if(!k)return n("processQueue: Not yet initialized for "+M+", waiting "+f),void(j&&!e||(j=!0,setTimeout(function(){y(!0)},f)));var t=z.shift(),i=t.type,o=t.name,r=t.value,a={};"boolean"!=typeof t.group&&(a["h.pg"]=t.group),"boolean"!=typeof t.ab&&(a["h.ab"]=t.ab),a["rt.tstart"]=a["rt.end"]=t.when;for(var u in t.dimensions)t.dimensions.hasOwnProperty(u)&&(void 0!==U[u]?a[U[u]]=t.dimensions[u]:n("Custom Dimension '"+u+"' is not defined"));"metric"===i?void 0!==J[o]?(a[J[o]]=r,w(a)):n("Custom Metric '"+o+"' is not defined"):"timer"===i&&(void 0!==K[o]?(a.t_other=K[o]+"|"+r,w(a)):n("Custom Timer '"+o+"' is not defined")),s(y)}}function w(e){var i;if(!k)return n("sendBeacon: Not yet initialized for "+M+", waiting 1000"),setTimeout(function(){w(e)},1e3);e.ua&&(i=e.ua,delete e.ua),e.d=A.site_domain,e["h.key"]=A["h.key"],e["h.d"]=A["h.d"],e["h.cr"]=A["h.cr"],e["h.t"]=A["h.t"],e["http.initiator"]="api",e["rt.start"]="api",!1!==X&&(e["rt.si"]=X,e["rt.ss"]=$,e["rt.sl"]=E),e.api=1,e["api.v"]=2,e["api.l"]="js",e["api.lv"]=u,P("before_beacon",e);var o=[];for(var r in e)e.hasOwnProperty(r)&&o.push(encodeURIComponent(r)+"="+(void 0===e[r]||null===e[r]?"":encodeURIComponent(e[r])));var s=function(){var e=A.beacon_url;return e||n("No URL from config: "+JSON.stringify(A)),c(e)}(),a=s+(s.indexOf("?")>-1?"&":"?")+o.join("&");P("beacon",e),t({url:a,ua:i})}function S(e,t){return"string"!=typeof e?-1:"number"!=typeof t||t<0?-1:(t=Math.round(t),v("timer",e,t),s(y),t)}function x(e){void 0!==e&&void 0!==N[e]&&delete N[e]}function b(e){"string"!=typeof e&&"number"!=typeof e||("number"==typeof e&&(e=""+e),X=e)}function _(){return X}function B(e){return b(e||"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),O(0),T(m()),_()}function O(e){"number"!=typeof e||e<0||(E=e)}function T(e){"number"!=typeof e||e<0||($=e)}function P(e,t){for(var n=0;n<W[e].length;n++)W[e][n](t)}var M=i,D=o,H="//c.go-mpulse.net/api/v2/config.json",R=(r=r||{}).ua||"mpulse.js",C=!1,A={},I=!1,k=!1,z=[],j=!1,L=!1,q=!1,N={},U={},X=!1,J={},G={},K={},F=-1,$=m(),E=0,W={};for(d=0;d<p.length;d++)W[p[d]]=[];void 0!==r.configUrl&&(H=r.configUrl),r.forceSSL&&(C=!0),g();return{startTimer:function(e){return"string"!=typeof e?-1:(F++,G[F]={time:m(),name:e},F)},stopTimer:function(e){if("number"!=typeof e||e<0)return-1;var t=G[e],n=0;return t?(n=Math.round(m()-t.time),S(t.name,n),delete G[e],n):-1},sendTimer:S,sendMetric:function(e,t){"string"==typeof e&&(void 0!==t&&"number"!=typeof t||(void 0===t&&(t=1),v("metric",e,t),s(y)))},setPageGroup:function(e){"string"==typeof e&&(L=e)},getPageGroup:function(){return L},resetPageGroup:function(){L=!1},setABTest:function(e){return"string"==typeof e&&!1!==/^[a-zA-Z0-9_ -]{1,25}$/.test(e)&&(q=e,!0)},getABTest:function(){return q},resetABTest:function(){q=!1},setDimension:function(e,t){void 0!==e&&(void 0!==t?N[e]=t:x(e))},resetDimension:x,setSessionID:b,getSessionID:_,startSession:B,incrementSessionLength:function(){E++},setSessionLength:O,getSessionLength:function(){return E},setSessionStart:T,getSessionStart:function(){return $},transferBoomerangSession:function(t){return void 0===t&&void 0!==e&&(t=e),!!(void 0!==t&&t.BOOMR&&t.BOOMR.session&&t.BOOMR.session.ID&&t.BOOMR.session.start&&t.BOOMR.session.length)&&(b(t.BOOMR.session.ID+"-"+Math.round(t.BOOMR.session.start/1e3).toString(36)),O(t.BOOMR.session.length),T(t.BOOMR.session.start),!0)},subscribe:function(e,t){W.hasOwnProperty(e)&&"function"==typeof t&&W[e].push(t)},sendBeacon:w,parseConfig:l}}function o(){}var r,s,a=3e5,f=5e3,u="1.3.4",c=["startTimer","stopTimer","sendTimer","sendMetric","setPageGroup","getPageGroup","resetPageGroup","setABTest","getABTest","resetABTest","setDimension","resetDimension","setSessionID","getSessionID","startSession","incrementSessionLength","setSessionLength","getSessionLength","setSessionStart","getSessionStart","transferBoomerangSession","subscribe","sendBeacon"],p=["before_beacon","beacon"],d=0,h=!1,m=!1,l=+new Date;if(s="undefined"!=typeof process&&"function"==typeof process.nextTick?process.nextTick.bind(process):void 0!==e?e.setImmediate?e.setImmediate.bind(e):e.msSetImmediate?e.msSetImmediate.bind(e):e.webkitSetImmediate?e.webkitSetImmediate.bind(e):e.mozSetImmediate?e.mozSetImmediate.bind(e):function(e){setTimeout(e,10)}:function(e){setTimeout(e,10)},void 0!==e)if(void 0!==e.performance&&"function"==typeof e.performance.now)m=e.performance.now.bind(e.performance);else if(void 0!==e.performance){var g=["webkitNow","msNow","mozNow"];for(d=0;d<g.length;d++)if("function"==typeof e.performance[g[d]]){m=e.performance[g[d]];break}}void 0!==e&&"performance"in e&&e.performance&&e.performance.timing&&e.performance.timing.navigationStart&&(l=e.performance.timing.navigationStart),m||(m="undefined"!=typeof Date&&Date.now?function(){return Date.now()-l}:function(){return+new Date-l});var v,y,w,S=!1,x={};for(void 0!==e&&(w=(y=e).mPulse),v={version:u,noConflict:function(){return y.mPulse=w,v},init:function(e,t,o){if(o=o||{},void 0!==e){if(void 0!==t){if(void 0!==o.name&&void 0!==x[o.name])return x[o.name];var r=i(e,t,o);if(!1===S){S=r;for(var s=0;s<c.length;s++){var a=c[s];v[a]=S[a]}}return void 0!==o.name&&(x[o.name]=r),r}n("init(): You need to specify a secretKey")}else n("init(): You need to specify an apiKey")},getApp:function(e){return x[e]},stop:function(e){void 0!==x[e]&&delete x[e]},now:m},d=0;d<c.length;d++)v[c[d]]=o;"function"==typeof define&&define.amd?define([],function(){return v}):"undefined"!=typeof module&&module.exports?module.exports=v:void 0!==y&&(y.mPulse=v)}("undefined"!=typeof window?window:void 0); | ||
//# sourceMappingURL=mpulse.min.js.map |
@@ -6,3 +6,3 @@ { | ||
"author": "Akamai", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
@@ -34,3 +34,3 @@ # mPulse.js | ||
* Switched `node-XMLHttpRequest` dependency to fix https://github.com/driverdan/node-XMLHttpRequest/pull/128 so `User-Agent` header is set | ||
* v1.3.3 - March 4, 2020 | ||
* v1.3.4 - March 4, 2020 | ||
* Updated to `crypto-js@4.0.0` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
448064
12079