From 8579594f5f1715873a91d20a9e31fa6acfaeb28f Mon Sep 17 00:00:00 2001 From: Paul Boocock Date: Mon, 27 Jan 2020 14:25:52 +0000 Subject: [PATCH] Prepare for release --- CHANGELOG | 13 +++++++++++++ dist/.gitignore | 1 + examples/sp.js | 2 +- npm-shrinkwrap.json | 43 +++++++++++++++++++++++++++++++------------ package.json | 2 +- 5 files changed, 47 insertions(+), 14 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 630c9e168..69064db89 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,16 @@ +Version 2.13.0 (2019-02-07) +--------------------------- +Add activity tracking callback mechanism (#774) +Reset activity on page view (#750) +Update beacon support to handle "gotchas" (#716) +Remove user_fingerprint (#549) +Change setup process to use Docker (#782) +Handle errors in tracker callback (#784) +Fix al.optimizely.get is not a function error (#619) +Further harden the Optimizely integrations (#654) +Use local sp.js for example pages (#790) +Change deprecation strings to constants and reuse (close #791) + Version 2.12.0 (2019-10-31) --------------------------- Core: Add function to allow setting Useragent (#744) diff --git a/dist/.gitignore b/dist/.gitignore index 9170fd96c..772552e83 100644 --- a/dist/.gitignore +++ b/dist/.gitignore @@ -2,3 +2,4 @@ bundle.js snowplow.js sp.js +bundle-postbabel.js diff --git a/examples/sp.js b/examples/sp.js index 10f937e4d..94ab6ace3 100644 --- a/examples/sp.js +++ b/examples/sp.js @@ -20,4 +20,4 @@ * - Safari 8 */ -"use strict";function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(t){for(var e=1;e>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-a)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n>>6-2*r);return t}},t.exports=r},{}],4:[function(e,t,n){function a(e){var t=-e.getTimezoneOffset();return null!==t?t:0}function r(e,t,n){var r=new Date;return void 0!==e&&r.setFullYear(e),r.setMonth(t),r.setDate(n),r}function o(e){return a(r(e,0,2))}function i(e){return a(r(e,5,2))}var c,s;c=this,(s={determine:function(){var e=function(){var e=o(),t=i(),n=e-t;return n<0?e+",1":0>5]|=128<<24-n%32,t[15+(64+n>>>9<<4)]=n;for(var u=0;u>>31}var g=(a<<5|a>>>27)+s+(r[h]>>>0)+(h<20?1518500249+(o&i|~o&c):h<40?1859775393+(o^i^c):h<60?(o&i|o&c|i&c)-1894007588:(o^i^c)-899497514);s=c,c=i,i=o<<30|o>>>2,o=a,a=g}a+=l,o+=f,i+=d,c+=p,s+=m}return[a,o,i,c,s]}(e));return t&&t.asBytes?n:t&&t.asString?a.bytesToString(n):y.bytesToHex(n)}var y,_,a;y=e("crypt"),_=e("charenc").utf8,a=e("charenc").bin,r._blocksize=16,r._digestsize=20,t.exports=r},{charenc:2,crypt:3}],154:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r=e("./lib/core");n.trackerCore=r.trackerCore},{"./lib/core":157}],155:[function(e,t,n){function r(e){var t,n,r,a,o,i,c,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=0,l=0,f="",d=[];if(!e)return e;for(e+="";t=(i=s.indexOf(e.charAt(u++))<<18|s.indexOf(e.charAt(u++))<<12|(a=s.indexOf(e.charAt(u++)))<<6|(o=s.indexOf(e.charAt(u++))))>>16&255,n=i>>8&255,r=255&i,d[l++]=64===a?String.fromCharCode(t):64===o?String.fromCharCode(t,n):String.fromCharCode(t,n,r),u>18&63,n=o>>12&63,r=o>>6&63,a=63&o,l[u++]=c.charAt(t)+c.charAt(n)+c.charAt(r)+c.charAt(a),s>>((3&t)<<3)&255;return a}}o.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],160:[function(e,t,n){for(var i=e("./rng"),a=[],o={},r=0;r<256;r++)a[r]=(r+256).toString(16).substr(1),o[a[r]]=r;function p(e,t){var n=t||0,r=a;return r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]}var c=i(),m=[1|c[0],c[1],c[2],c[3],c[4],c[5]],h=16383&(c[6]<<8|c[7]),v=0,g=0;function s(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||i)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var o=0;o<16;o++)t[r+o]=a[o];return t||p(a)}var u=s;u.v1=function(e,t,n){var r=t&&n||0,a=t||[],o=void 0!==(e=e||{}).clockseq?e.clockseq:h,i=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:g+1,s=i-v+(c-g)/1e4;if(s<0&&void 0===e.clockseq&&(o=o+1&16383),(s<0||v>>24&255,a[r++]=u>>>16&255,a[r++]=u>>>8&255,a[r++]=255&u;var l=i/4294967296*1e4&268435455;a[r++]=l>>>8&255,a[r++]=255&l,a[r++]=l>>>24&15|16,a[r++]=l>>>16&255,a[r++]=o>>>8|128,a[r++]=255&o;for(var f=e.node||m,d=0;d<6;d++)a[r+d]=f[d];return t||p(a)},u.v4=s,u.parse=function(e,t,n){var r=t&&n||0,a=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){a<16&&(t[r+a++]=o[e])});a<16;)t[r+a++]=0;return t},u.unparse=p,t.exports=u},{"./rng":159}],161:[function(e,t,n){var r=e("./v1"),a=e("./v4"),o=a;o.v1=r,o.v4=a,t.exports=o},{"./v1":164,"./v4":165}],162:[function(e,t,n){for(var a=[],r=0;r<256;++r)a[r]=(r+256).toString(16).substr(1);t.exports=function(e,t){var n=t||0,r=a;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}},{}],163:[function(e,t,n){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var a=new Uint8Array(16);t.exports=function(){return r(a),a}}else{var o=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},{}],164:[function(e,t,n){var m,h,v=e("./lib/rng"),g=e("./lib/bytesToUuid"),y=0,_=0;t.exports=function(e,t,n){var r=t&&n||0,a=t||[],o=(e=e||{}).node||m,i=void 0!==e.clockseq?e.clockseq:h;if(null==o||null==i){var c=v();null==o&&(o=m=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==i&&(i=h=16383&(c[6]<<8|c[7]))}var s=void 0!==e.msecs?e.msecs:(new Date).getTime(),u=void 0!==e.nsecs?e.nsecs:_+1,l=s-y+(u-_)/1e4;if(l<0&&void 0===e.clockseq&&(i=i+1&16383),(l<0||y>>24&255,a[r++]=f>>>16&255,a[r++]=f>>>8&255,a[r++]=255&f;var d=s/4294967296*1e4&268435455;a[r++]=d>>>8&255,a[r++]=255&d,a[r++]=d>>>24&15|16,a[r++]=d>>>16&255,a[r++]=i>>>8|128,a[r++]=255&i;for(var p=0;p<6;++p)a[r+p]=o[p];return t||g(a)}},{"./lib/bytesToUuid":162,"./lib/rng":163}],165:[function(e,t,n){var i=e("./lib/rng"),c=e("./lib/bytesToUuid");t.exports=function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||i)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var o=0;o<16;++o)t[r+o]=a[o];return t||c(a)}},{"./lib/bytesToUuid":162,"./lib/rng":163}],166:[function(e,t,n){var o=e("lodash/isFunction"),i=e("./lib/helpers"),s=window;(void 0!==n?n:this).errorManager=function(c){function a(e,t,n,r,a,o){var i=a&&a.stack?a.stack:null;c.trackSelfDescribingEvent({schema:"iglu:com.snowplowanalytics.snowplow/application_error/jsonschema/1-0-1",data:{programmingLanguage:"JAVASCRIPT",message:e||"JS Exception. Browser doesn't support ErrorEvent API",stackTrace:i,lineNumber:n,lineColumn:r,fileName:t}},o)}return{trackError:a,enableErrorTracking:function(t,n,r){i.addEventListener(s,"error",function(e){(o(t)&&t(e)||null==t)&&function(e,t,n){var r;r=o(n)?t.concat(n(e)):t,a(e.message,e.filename,e.lineno,e.colno,e.error,r)}(e,r,n)},!0)}}}},{"./lib/helpers":172,"lodash/isFunction":133}],167:[function(e,t,n){var p=e("lodash/forEach"),m=e("lodash/filter"),h=e("lodash/find"),v=e("./lib/helpers");(void 0!==n?n:this).getFormTrackingManager=function(i,e,c){var a=["textarea","input","select"],o=e+"form",r=function(){return!0},s=function(){return!0},u=function(e){return e};function l(t){return t[h(["name","id","type","nodeName"],function(e){return t[e]&&"string"==typeof t[e]})]}function f(a,o){return function(e){var t=e.target,n=t.nodeName&&"INPUT"===t.nodeName.toUpperCase()?t.type:null,r="checkbox"!==t.type||t.checked?u(t.value):null;("change_form"===a||"checkbox"!==n&&"radio"!==n)&&i.trackFormFocusOrChange(a,function(e){for(;e&&e.nodeName&&"HTML"!==e.nodeName.toUpperCase()&&"FORM"!==e.nodeName.toUpperCase();)e=e.parentNode;if(e&&e.nodeName&&"FORM"===e.nodeName.toUpperCase())return l(e)}(t),l(t),t.nodeName,n,v.getCssClasses(t),r,c(v.resolveDynamicContexts(o,t,n,r)))}}function d(r){return function(e){var t=e.target,n=function(n){var r=[];return p(a,function(e){var t=m(n.getElementsByTagName(e),function(e){return e.hasOwnProperty(o)});p(t,function(e){if("submit"!==e.type){var t={name:l(e),value:e.value,nodeName:e.nodeName};e.type&&"INPUT"===e.nodeName.toUpperCase()&&(t.type=e.type),"checkbox"!==e.type&&"radio"!==e.type||e.checked||(t.value=null),r.push(t)}})}),r}(t);p(n,function(e){e.value=u(e.value)}),i.trackFormSubmission(l(t),v.getCssClasses(t),n,c(v.resolveDynamicContexts(r,t,n)))}}return{configureFormTracking:function(e){e&&(r=v.getFilter(e.forms,!0),s=v.getFilter(e.fields,!1),u=v.getTransform(e.fields))},addFormListeners:function(n){p(document.getElementsByTagName("form"),function(t){r(t)&&!t[o]&&(p(a,function(e){p(t.getElementsByTagName(e),function(e){s(e)&&!e[o]&&"password"!==e.type.toLowerCase()&&(v.addEventListener(e,"focus",f("focus_form",n),!1),v.addEventListener(e,"change",f("change_form",n),!1),e[o]=!0)})}),v.addEventListener(t,"submit",d(n)),t[o]=!0)})}}}},{"./lib/helpers":172,"lodash/filter":120,"lodash/find":121,"lodash/forEach":123}],168:[function(e,t,n){n.productionize=function(r){var a={};return"object"===_typeof(r)&&null!==r&&Object.getOwnPropertyNames(r).forEach(function(e,t,n){"function"==typeof r[e]&&(a[e]=function(e){return function(){try{return e.apply(this,arguments)}catch(e){}}}(r[e]))}),a}},{}],169:[function(e,t,n){!function(){var c=e("lodash/map"),v=e("lodash/isUndefined"),g=e("lodash/isFunction"),y=e("./lib/helpers");(void 0!==n?n:this).InQueueManager=function(r,a,o,e,i){var p={};function m(e){var t=[];if(e&&0!==e.length)for(var n=0;nDate.now()?localStorage.getItem(e):(localStorage.removeItem(e),void localStorage.removeItem(e+".expires"))}catch(e){}},u.attemptWriteLocalStorage=function(e,t){var n=2=l)return T.warn("Event of size "+n.bytes+" is too long - the maximum size is "+l),void w(m).send(k(A([n.evt])));h.push(n)}else h.push(function(e){var t="?",n={co:!0,cx:!0},r=!0;for(var a in e)e.hasOwnProperty(a)&&!n.hasOwnProperty(a)&&(r?r=!1:t+="&",t+=encodeURIComponent(a)+"="+encodeURIComponent(e[a]));for(var o in n)e.hasOwnProperty(o)&&n.hasOwnProperty(o)&&(t+="&"+o+"="+encodeURIComponent(e[o]));return t}(e));var r=!1;u&&(r=T.attemptWriteLocalStorage(p,JSON.stringify(h.slice(0,d)))),g||r&&!(h.length>=o)||b()},executeQueue:b}}}()},{"./lib/detectors":171,"./lib/helpers":172,"lodash/isString":138,"lodash/map":143,"lodash/mapValues":144}],176:[function(e,t,n){!function(){e("uuid");var s=e("lodash/forEach"),u=e("lodash/filter"),l=e("./lib/helpers"),f=e("./in_queue"),d=e("./tracker");(void 0!==n?n:this).Snowplow=function(e,n){var t,r=document,a=window,o="js-2.13.0",i={outQueues:[],bufferFlushers:[],expireDateTime:null,hasLoaded:!1,registeredOnLoadHandlers:[],pageViewId:null};function c(){var e;if(!i.hasLoaded)for(i.hasLoaded=!0,e=0;e1e3*X&&(b=ht.v4(),fe++);e.add("vp",ct.detectViewport()),e.add("ds",ct.detectDocumentSize()),e.add("vid",fe),e.add("sid",b),e.add("duid",s),e.add("uid",w),je(),e.add("refr",Pe(m||F)),e.add("url",Pe(h||N)),"none"!=ae&&(Ge(s,u,fe,n,d,b),Be());ue=(new Date).getTime()}(e),function(e,t){var n,r=new Date;n=!!v&&!!it.cookie(v);Q||n||(ve.enqueueRequest(e.build(),a),u.expireDateTime=r.getTime()+t)}(e,q)}),j=!1,T={},O={},P={},E=document,I=window,D=navigator,L=ot.fixupUrl(E.domain,I.location.href,at.getReferrer()),M=at.fixupDomain(L[0]),N=L[1],F=L[2],z=null,U=null,B=r.hasOwnProperty("platform")?r.platform:"web",G=r.hasOwnProperty("postPath")?r.postPath:"/com.snowplowanalytics.snowplow/tp2",R=r.hasOwnProperty("appId")?r.appId:"",V=E.title,q=r.hasOwnProperty("pageUnloadTimer")?r.pageUnloadTimer:500,H=!r.hasOwnProperty("resetActivityTrackingOnPageView")||r.resetActivityTrackingOnPageView,K=r.hasOwnProperty("cookieName")?r.cookieName:"_sp_",W=r.hasOwnProperty("cookieDomain")?r.cookieDomain:null,J="/",Y=D.doNotTrack||D.msDoNotTrack||I.doNotTrack,Q=!!r.hasOwnProperty("respectDoNotTrack")&&(r.respectDoNotTrack&&("yes"===Y||"1"===Y)),$=r.hasOwnProperty("cookieLifetime")?r.cookieLifetime:63072e3,X=r.hasOwnProperty("sessionCookieTimeout")?r.sessionCookieTimeout:1800,Z=E.characterSet||E.charset,ee=!!r.hasOwnProperty("forceSecureTracker")&&!0===r.forceSecureTracker,te=!(ee||!r.hasOwnProperty("forceUnsecureTracker"))&&!0===r.forceUnsecureTracker,ne=!r.hasOwnProperty("useLocalStorage")||(at.warn("argmap.useLocalStorage is deprecated. Use argmap.stateStorageStrategy instead."),r.useLocalStorage),re=!r.hasOwnProperty("useCookies")||(at.warn("argmap.useCookies is deprecated. Use argmap.stateStorageStrategy instead."),r.useCookies),ae=r.hasOwnProperty("stateStorageStrategy")?r.stateStorageStrategy:re||ne?re&&ne?"cookieAndLocalStorage":re?"cookie":"localStorage":"none",oe=D.userLanguage||D.language,ie=ct.detectBrowserFeatures("cookie"==ae||"cookieAndLocalStorage"==ae,Ie("testcookie")),ce=e+"_"+t,se=!1,ue=(new Date).getTime(),le=st,fe=1,de={transaction:{},items:[]},pe=ut.getLinkTrackingManager(C,ce,He),me=lt.getFormTrackingManager(C,ce,He),he=ft.errorManager(C),ve=new dt.OutQueueManager(e,t,u,"localStorage"==ae||"cookieAndLocalStorage"==ae,r.eventMethod,G,r.bufferSize,r.maxPostBytes||4e4,r.useStm,r.maxLocalStorageQueueSize||1e3),ge=!1,ye=r.contexts||{},_e=[],be=[],we=!1,ke=!1,Ae={},xe={},Se={};for(var Ce in r.hasOwnProperty("discoverRootDomain")&&r.discoverRootDomain&&(W=at.findRootDomain()),ye.gaCookies&&_e.push((k={},nt(["__utma","__utmb","__utmc","__utmv","__utmz","_ga"],function(e){var t=it.cookie(e);t&&(k[e]=t)}),{schema:"iglu:com.google.analytics/cookies/jsonschema/1-0-0",data:k})),ye.geolocation&&Ye(),C.setBase64Encoding(!r.hasOwnProperty("encodeBase64")||r.encodeBase64),C.setTrackerVersion(n),C.setTrackerNamespace(t),C.setAppId(R),C.setPlatform(B),C.setTimezone(ct.detectTimezone()),C.addPayloadPair("lang",oe),C.addPayloadPair("cs",Z),ie)Object.prototype.hasOwnProperty.call(ie,Ce)&&("res"===Ce||"cd"===Ce||"cookie"===Ce?C.addPayloadPair(Ce,ie[Ce]):C.addPayloadPair("f_"+Ce,ie[Ce]));function je(){(L=ot.fixupUrl(E.domain,I.location.href,at.getReferrer()))[1]!==N&&(F=at.getReferrer(N)),M=at.fixupDomain(L[0]),N=L[1]}function Te(){var e=(new Date).getTime();this.href&&(this.href=at.decorateQuerystring(this.href,"_sp",_+"."+e))}function Oe(e){for(var t=0;te.getTime()&&r>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-a)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n>>6-2*r);return t}},t.exports=r},{}],4:[function(e,t,n){function a(e){var t=-e.getTimezoneOffset();return null!==t?t:0}function r(e,t,n){var r=new Date;return void 0!==e&&r.setFullYear(e),r.setMonth(t),r.setDate(n),r}function o(e){return a(r(e,0,2))}function i(e){return a(r(e,5,2))}var c,s;c=this,(s={determine:function(){var e=function(){var e=o(),t=i(),n=e-t;return n<0?e+",1":0>5]|=128<<24-n%32,t[15+(64+n>>>9<<4)]=n;for(var u=0;u>>31}var g=(a<<5|a>>>27)+s+(r[v]>>>0)+(v<20?1518500249+(o&i|~o&c):v<40?1859775393+(o^i^c):v<60?(o&i|o&c|i&c)-1894007588:(o^i^c)-899497514);s=c,c=i,i=o<<30|o>>>2,o=a,a=g}a+=l,o+=f,i+=d,c+=p,s+=m}return[a,o,i,c,s]}(e));return t&&t.asBytes?n:t&&t.asString?a.bytesToString(n):y.bytesToHex(n)}var y,_,a;y=e("crypt"),_=e("charenc").utf8,a=e("charenc").bin,r._blocksize=16,r._digestsize=20,t.exports=r},{charenc:2,crypt:3}],154:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r=e("./lib/core");n.trackerCore=r.trackerCore},{"./lib/core":157}],155:[function(e,t,n){function r(e){var t,n,r,a,o,i,c,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=0,l=0,f="",d=[];if(!e)return e;for(e+="";t=(i=s.indexOf(e.charAt(u++))<<18|s.indexOf(e.charAt(u++))<<12|(a=s.indexOf(e.charAt(u++)))<<6|(o=s.indexOf(e.charAt(u++))))>>16&255,n=i>>8&255,r=255&i,d[l++]=64===a?String.fromCharCode(t):64===o?String.fromCharCode(t,n):String.fromCharCode(t,n,r),u>18&63,n=o>>12&63,r=o>>6&63,a=63&o,l[u++]=c.charAt(t)+c.charAt(n)+c.charAt(r)+c.charAt(a),s>>((3&t)<<3)&255;return a}}o.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],160:[function(e,t,n){for(var i=e("./rng"),a=[],o={},r=0;r<256;r++)a[r]=(r+256).toString(16).substr(1),o[a[r]]=r;function p(e,t){var n=t||0,r=a;return r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]}var c=i(),m=[1|c[0],c[1],c[2],c[3],c[4],c[5]],v=16383&(c[6]<<8|c[7]),h=0,g=0;function s(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||i)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var o=0;o<16;o++)t[r+o]=a[o];return t||p(a)}var u=s;u.v1=function(e,t,n){var r=t&&n||0,a=t||[],o=void 0!==(e=e||{}).clockseq?e.clockseq:v,i=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:g+1,s=i-h+(c-g)/1e4;if(s<0&&void 0===e.clockseq&&(o=o+1&16383),(s<0||h>>24&255,a[r++]=u>>>16&255,a[r++]=u>>>8&255,a[r++]=255&u;var l=i/4294967296*1e4&268435455;a[r++]=l>>>8&255,a[r++]=255&l,a[r++]=l>>>24&15|16,a[r++]=l>>>16&255,a[r++]=o>>>8|128,a[r++]=255&o;for(var f=e.node||m,d=0;d<6;d++)a[r+d]=f[d];return t||p(a)},u.v4=s,u.parse=function(e,t,n){var r=t&&n||0,a=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){a<16&&(t[r+a++]=o[e])});a<16;)t[r+a++]=0;return t},u.unparse=p,t.exports=u},{"./rng":159}],161:[function(e,t,n){var r=e("./v1"),a=e("./v4"),o=a;o.v1=r,o.v4=a,t.exports=o},{"./v1":164,"./v4":165}],162:[function(e,t,n){for(var a=[],r=0;r<256;++r)a[r]=(r+256).toString(16).substr(1);t.exports=function(e,t){var n=t||0,r=a;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}},{}],163:[function(e,t,n){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var a=new Uint8Array(16);t.exports=function(){return r(a),a}}else{var o=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},{}],164:[function(e,t,n){var m,v,h=e("./lib/rng"),g=e("./lib/bytesToUuid"),y=0,_=0;t.exports=function(e,t,n){var r=t&&n||0,a=t||[],o=(e=e||{}).node||m,i=void 0!==e.clockseq?e.clockseq:v;if(null==o||null==i){var c=h();null==o&&(o=m=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==i&&(i=v=16383&(c[6]<<8|c[7]))}var s=void 0!==e.msecs?e.msecs:(new Date).getTime(),u=void 0!==e.nsecs?e.nsecs:_+1,l=s-y+(u-_)/1e4;if(l<0&&void 0===e.clockseq&&(i=i+1&16383),(l<0||y>>24&255,a[r++]=f>>>16&255,a[r++]=f>>>8&255,a[r++]=255&f;var d=s/4294967296*1e4&268435455;a[r++]=d>>>8&255,a[r++]=255&d,a[r++]=d>>>24&15|16,a[r++]=d>>>16&255,a[r++]=i>>>8|128,a[r++]=255&i;for(var p=0;p<6;++p)a[r+p]=o[p];return t||g(a)}},{"./lib/bytesToUuid":162,"./lib/rng":163}],165:[function(e,t,n){var i=e("./lib/rng"),c=e("./lib/bytesToUuid");t.exports=function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||i)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var o=0;o<16;++o)t[r+o]=a[o];return t||c(a)}},{"./lib/bytesToUuid":162,"./lib/rng":163}],166:[function(e,t,n){var o=e("lodash/isFunction"),i=e("./lib/helpers"),s=window;(void 0!==n?n:this).errorManager=function(c){function a(e,t,n,r,a,o){var i=a&&a.stack?a.stack:null;c.trackSelfDescribingEvent({schema:"iglu:com.snowplowanalytics.snowplow/application_error/jsonschema/1-0-1",data:{programmingLanguage:"JAVASCRIPT",message:e||"JS Exception. Browser doesn't support ErrorEvent API",stackTrace:i,lineNumber:n,lineColumn:r,fileName:t}},o)}return{trackError:a,enableErrorTracking:function(t,n,r){i.addEventListener(s,"error",function(e){(o(t)&&t(e)||null==t)&&function(e,t,n){var r;r=o(n)?t.concat(n(e)):t,a(e.message,e.filename,e.lineno,e.colno,e.error,r)}(e,r,n)},!0)}}}},{"./lib/helpers":172,"lodash/isFunction":133}],167:[function(e,t,n){var p=e("lodash/forEach"),m=e("lodash/filter"),v=e("lodash/find"),h=e("./lib/helpers");(void 0!==n?n:this).getFormTrackingManager=function(i,e,c){var a=["textarea","input","select"],o=e+"form",r=function(){return!0},s=function(){return!0},u=function(e){return e};function l(t){return t[v(["name","id","type","nodeName"],function(e){return t[e]&&"string"==typeof t[e]})]}function f(a,o){return function(e){var t=e.target,n=t.nodeName&&"INPUT"===t.nodeName.toUpperCase()?t.type:null,r="checkbox"!==t.type||t.checked?u(t.value):null;("change_form"===a||"checkbox"!==n&&"radio"!==n)&&i.trackFormFocusOrChange(a,function(e){for(;e&&e.nodeName&&"HTML"!==e.nodeName.toUpperCase()&&"FORM"!==e.nodeName.toUpperCase();)e=e.parentNode;if(e&&e.nodeName&&"FORM"===e.nodeName.toUpperCase())return l(e)}(t),l(t),t.nodeName,n,h.getCssClasses(t),r,c(h.resolveDynamicContexts(o,t,n,r)))}}function d(r){return function(e){var t=e.target,n=function(n){var r=[];return p(a,function(e){var t=m(n.getElementsByTagName(e),function(e){return e.hasOwnProperty(o)});p(t,function(e){if("submit"!==e.type){var t={name:l(e),value:e.value,nodeName:e.nodeName};e.type&&"INPUT"===e.nodeName.toUpperCase()&&(t.type=e.type),"checkbox"!==e.type&&"radio"!==e.type||e.checked||(t.value=null),r.push(t)}})}),r}(t);p(n,function(e){e.value=u(e.value)}),i.trackFormSubmission(l(t),h.getCssClasses(t),n,c(h.resolveDynamicContexts(r,t,n)))}}return{configureFormTracking:function(e){e&&(r=h.getFilter(e.forms,!0),s=h.getFilter(e.fields,!1),u=h.getTransform(e.fields))},addFormListeners:function(n){p(document.getElementsByTagName("form"),function(t){r(t)&&!t[o]&&(p(a,function(e){p(t.getElementsByTagName(e),function(e){s(e)&&!e[o]&&"password"!==e.type.toLowerCase()&&(h.addEventListener(e,"focus",f("focus_form",n),!1),h.addEventListener(e,"change",f("change_form",n),!1),e[o]=!0)})}),h.addEventListener(t,"submit",d(n)),t[o]=!0)})}}}},{"./lib/helpers":172,"lodash/filter":120,"lodash/find":121,"lodash/forEach":123}],168:[function(e,t,n){n.productionize=function(r){var a={};return"object"===_typeof(r)&&null!==r&&Object.getOwnPropertyNames(r).forEach(function(e,t,n){"function"==typeof r[e]&&(a[e]=function(e){return function(){try{return e.apply(this,arguments)}catch(e){}}}(r[e]))}),a}},{}],169:[function(e,t,n){!function(){var c=e("lodash/map"),h=e("lodash/isUndefined"),g=e("lodash/isFunction"),y=e("./lib/helpers");(void 0!==n?n:this).InQueueManager=function(r,a,o,e,i){var p={};function m(e){var t=[];if(e&&0!==e.length)for(var n=0;nDate.now()?localStorage.getItem(e):(localStorage.removeItem(e),void localStorage.removeItem(e+".expires"))}catch(e){}},u.attemptWriteLocalStorage=function(e,t){var n=2=l)return T.warn("Event of size "+n.bytes+" is too long - the maximum size is "+l),void k(m).send(A(x([n.evt])));v.push(n)}else v.push(function(e){var t="?",n={co:!0,cx:!0},r=!0;for(var a in e)e.hasOwnProperty(a)&&!n.hasOwnProperty(a)&&(r?r=!1:t+="&",t+=encodeURIComponent(a)+"="+encodeURIComponent(e[a]));for(var o in n)e.hasOwnProperty(o)&&n.hasOwnProperty(o)&&(t+="&"+o+"="+encodeURIComponent(e[o]));return t}(e));var r=!1;u&&(r=T.attemptWriteLocalStorage(p,JSON.stringify(v.slice(0,d)))),y||r&&!(v.length>=o)||w()},executeQueue:w}}}()},{"./lib/detectors":171,"./lib/helpers":172,"lodash/isString":138,"lodash/map":143,"lodash/mapValues":144}],176:[function(e,t,n){!function(){e("uuid");var s=e("lodash/forEach"),u=e("lodash/filter"),l=e("./lib/helpers"),f=e("./in_queue"),d=e("./tracker");(void 0!==n?n:this).Snowplow=function(e,n){var t,r=document,a=window,o="js-2.13.0",i={outQueues:[],bufferFlushers:[],expireDateTime:null,hasLoaded:!1,registeredOnLoadHandlers:[],pageViewId:null};function c(){var e;if(!i.hasLoaded)for(i.hasLoaded=!0,e=0;e1e3*Q&&(b=vt.v4(),se++);e.add("vp",ct.detectViewport()),e.add("ds",ct.detectDocumentSize()),e.add("vid",se),e.add("sid",b),e.add("duid",s),e.add("uid",w),Ae(),e.add("refr",Ce(m||F)),e.add("url",Ce(v||N)),"none"!=ne&&(Fe(s,u,se,n,d,b),Ne());ie=(new Date).getTime()}(e),function(e,t){var n,r=new Date;n=!!h&&!!it.cookie(h);J||n||(pe.enqueueRequest(e.build(),a),f.expireDateTime=r.getTime()+t)}(e,R)}),j=!1,O={},T={},P={},I=document,E=window,D=navigator,L=ot.fixupUrl(I.domain,E.location.href,at.getReferrer()),M=at.fixupDomain(L[0]),N=L[1],F=L[2],z=r.hasOwnProperty("platform")?r.platform:"web",U=r.hasOwnProperty("postPath")?r.postPath:"/com.snowplowanalytics.snowplow/tp2",B=r.hasOwnProperty("appId")?r.appId:"",G=I.title,R=r.hasOwnProperty("pageUnloadTimer")?r.pageUnloadTimer:500,q=!r.hasOwnProperty("resetActivityTrackingOnPageView")||r.resetActivityTrackingOnPageView,V=r.hasOwnProperty("cookieName")?r.cookieName:"_sp_",H=r.hasOwnProperty("cookieDomain")?r.cookieDomain:null,K="/",W=D.doNotTrack||D.msDoNotTrack||E.doNotTrack,J=!!r.hasOwnProperty("respectDoNotTrack")&&(r.respectDoNotTrack&&("yes"===W||"1"===W)),Y=r.hasOwnProperty("cookieLifetime")?r.cookieLifetime:63072e3,Q=r.hasOwnProperty("sessionCookieTimeout")?r.sessionCookieTimeout:1800,$=I.characterSet||I.charset,X=!!r.hasOwnProperty("forceSecureTracker")&&!0===r.forceSecureTracker,Z=!(X||!r.hasOwnProperty("forceUnsecureTracker"))&&!0===r.forceUnsecureTracker,ee=!r.hasOwnProperty("useLocalStorage")||(at.warn("argmap.useLocalStorage is deprecated. Use argmap.stateStorageStrategy instead."),r.useLocalStorage),te=!r.hasOwnProperty("useCookies")||(at.warn("argmap.useCookies is deprecated. Use argmap.stateStorageStrategy instead."),r.useCookies),ne=r.hasOwnProperty("stateStorageStrategy")?r.stateStorageStrategy:te||ee?te&&ee?"cookieAndLocalStorage":te?"cookie":"localStorage":"none",re=D.userLanguage||D.language,ae=ct.detectBrowserFeatures("cookie"==ne||"cookieAndLocalStorage"==ne,Oe("testcookie")),oe=e+"_"+t,ie=(new Date).getTime(),ce=st,se=1,ue={transaction:{},items:[]},le=ut.getLinkTrackingManager(C,oe,Ge),fe=lt.getFormTrackingManager(C,oe,Ge),de=ft.errorManager(C),pe=new dt.OutQueueManager(e,t,f,"localStorage"==ne||"cookieAndLocalStorage"==ne,r.eventMethod,U,r.bufferSize,r.maxPostBytes||4e4,r.useStm,r.maxLocalStorageQueueSize||1e3),me=!1,ve=r.contexts||{},he=[],ge=[],ye=!1,_e=!1,be={enabled:!1,installed:!1,configurations:{}},we={};for(var ke in r.hasOwnProperty("discoverRootDomain")&&r.discoverRootDomain&&(H=at.findRootDomain()),ve.gaCookies&&he.push((k={},nt(["__utma","__utmb","__utmc","__utmv","__utmz","_ga"],function(e){var t=it.cookie(e);t&&(k[e]=t)}),{schema:"iglu:com.google.analytics/cookies/jsonschema/1-0-0",data:k})),ve.geolocation&&He(),C.setBase64Encoding(!r.hasOwnProperty("encodeBase64")||r.encodeBase64),C.setTrackerVersion(n),C.setTrackerNamespace(t),C.setAppId(B),C.setPlatform(z),C.setTimezone(ct.detectTimezone()),C.addPayloadPair("lang",re),C.addPayloadPair("cs",$),ae)Object.prototype.hasOwnProperty.call(ae,ke)&&("res"===ke||"cd"===ke||"cookie"===ke?C.addPayloadPair(ke,ae[ke]):C.addPayloadPair("f_"+ke,ae[ke]));function Ae(){(L=ot.fixupUrl(I.domain,E.location.href,at.getReferrer()))[1]!==N&&(F=at.getReferrer(N)),M=at.fixupDomain(L[0]),N=L[1]}function xe(){var e=(new Date).getTime();this.href&&(this.href=at.decorateQuerystring(this.href,"_sp",_+"."+e))}function Se(e){for(var t=0;te.getTime()&&r+1e3*n