diff --git a/dist/keen-tracking.js b/dist/keen-tracking.js index 5fc356cf..d81c5092 100644 --- a/dist/keen-tracking.js +++ b/dist/keen-tracking.js @@ -2350,19 +2350,23 @@ function initAutoTrackingCore(lib) { shareUuidAcrossDomains: false, collectIpAddress: true, collectUuid: true, - catchError: undefined // optional, function(error) - error handler + catchError: undefined // optional, function(someError) - error handler }, obj); - if (client.config.requestType === 'jsonp') { - // jsonp is deprecated, let's switch to beaconAPI - client.config.requestType = 'beaconAPI'; - } - if (client.config.requestType === 'beaconAPI' && options.catchError) { throw 'You cannot use the BeaconAPI and catchError function in the same time, because BeaconAPI ignores errors. For requests with error handling - use requestType: \'fetch\''; return; } + if (client.config.requestType === 'jsonp' // jsonp is deprecated, it's the default value from old keen's client + ) { + if (options.catchError) { + client.config.requestType = 'fetch'; + } else { + client.config.requestType = 'beaconAPI'; + } + } + var now = new Date(); var cookie = new utils.cookie('keen'); diff --git a/dist/keen-tracking.js.map b/dist/keen-tracking.js.map index e2abc9a7..06e8f3e3 100644 --- a/dist/keen-tracking.js.map +++ b/dist/keen-tracking.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./node_modules/keen-core/lib/utils/each.js","webpack:///./node_modules/keen-core/lib/utils/extend.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/promise-polyfill/src/finally.js","webpack:///./node_modules/whatwg-fetch/fetch.js","webpack:///./node_modules/promise-polyfill/src/polyfill.js","webpack:///./node_modules/component-emitter/index.js","webpack:///./lib/index.js","webpack:///./lib/helpers/getDomNodePath.js","webpack:///./lib/helpers/getWindowProfile.js","webpack:///./lib/helpers/getScreenProfile.js","webpack:///./lib/utils/md5.js","webpack:///./lib/utils/deepExtend.js","webpack:///./lib/extend-events.js","webpack:///./lib/config-default.js","webpack:///./lib/utils/queue.js","webpack:///./node_modules/promise-polyfill/src/index.js","webpack:///./lib/utils/timer.js","webpack:///./lib/utils/serializeForm.js","webpack:///./node_modules/js-cookie/src/js.cookie.js","webpack:///./lib/utils/cookie.js","webpack:///./lib/helpers/getUniqueId.js","webpack:///./lib/helpers/getScrollState.js","webpack:///./lib/helpers/getDomNodeProfile.js","webpack:///./lib/helpers/getDomainName.js","webpack:///./lib/helpers/getDatetimeIndex.js","webpack:///./lib/helpers/getBrowserProfile.js","webpack:///./lib/browser-auto-tracking.js","webpack:///./lib/defer-events.js","webpack:///./lib/utils/cache-browser.js","webpack:///./lib/utils/unique.js","webpack:///./lib/utils/fetchRetry.js","webpack:///./node_modules/keen-core/lib/utils/base64.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/setimmediate/setImmediate.js","webpack:///./node_modules/timers-browserify/main.js","webpack:///./lib/record-events-browser.js","webpack:///./lib/utils/listener.js","webpack:///./node_modules/keen-core/lib/utils/serialize.js","webpack:///./node_modules/keen-core/lib/utils/parse-params.js","webpack:///./node_modules/keen-core/lib/index.js","webpack:///./lib/browser.js"],"names":["KeenCore","helpers","on","client","extensions","events","collections","queue","config","recordDeferredEvents","prototype","writeKey","str","arguments","length","String","referrerPolicy","setGlobalProperties","props","log","emit","globalProperties","getDomNodePath","el","nodeName","stack","parentNode","sibCount","sibIndex","i","childNodes","sib","hasAttribute","id","unshift","toLowerCase","slice","join","getWindowProfile","body","html","output","document","documentElement","window","innerHeight","offsetHeight","innerWidth","offsetWidth","Math","max","scrollHeight","clientHeight","screen","ratio","availHeight","parseFloat","toFixed","availWidth","getScreenProfile","keys","orientation","MD5","d","result","M","V","Y","X","_","m","f","r","charCodeAt","charAt","Array","fromCharCode","n","h","t","g","e","md5_ii","md5_hh","md5_gg","md5_ff","safe_add","md5_cmn","bit_rol","deepExtend","target","j","indexOf","push","prop","clone","undefined","input","JSON","parse","stringify","extendEvent","extendEvents","getExtendedEventBody","eventCollection","eventModifier","handleValidationError","call","eventsModifier","message","err","modifierResult","configDefault","capacity","interval","retry","limit","initialDelay","retryOnResponseStatuses","configQueue","timer","check","shouldFlushQueue","flush","pause","clearInterval","start","self","setInterval","num","count","value","clear","serializeForm","k_r_submitter","k_r_success_contrls","brackets","form","options","hash","serializer","hash_serializer","str_serialize","elements","radio_store","Object","create","element","ignoreTypes","type","disabled","name","test","key","val","checked","empty","selectOptions","isSelectedOptions","option","allowedEmpty","hasValue","selected","parse_keys","string","prefix","children","RegExp","match","exec","hash_assign","shift","between","isArray","_values","index","isNaN","matches","existing","replace","encodeURIComponent","cookie","expires","data","get","Cookies","getJSON","set","enabled","expire","daysUntilExpire","remove","obj","navigator","cookieEnabled","getUniqueId","crypto","getRandomValues","c","Uint8Array","toString","random","v","getScrollState","state","pixel","pixel_max","ratio_max","getScrollOffset","getWindowHeight","Number","getScrollableArea","pageYOffset","scrollTop","getDomNodeProfile","action","class","className","href","method","node_name","selector","text","title","x_position","offsetLeft","clientLeft","y_position","offsetTop","clientTop","getDomainName","extractHostname","url","hostname","split","domain","splitArr","arrLen","getDatetimeIndex","date","Date","getHours","parseInt","getDay","getDate","getMonth","getFullYear","getBrowserProfile","appCodeName","getDocumentDescription","language","appName","onLine","platform","userAgent","appVersion","querySelector","content","initAutoTrackingCore","lib","utils","extend","ignoreDisabledFormFields","ignoreFormFieldTypes","recordClicks","recordFormSubmits","recordPageViews","recordPageViewsOnExit","recordScrollState","shareUuidAcrossDomains","collectIpAddress","collectUuid","catchError","requestType","now","domainName","location","cookieDomain","uuid","initialReferrer","referrer","scrollState","listener","addons","ua_string","date_time","ip_address","ip","remove_ip_property","browserProfile","tracked_by","pkg","version","local_time_full","toISOString","user","page","description","scroll_state","time_on_page","getSecondsSinceDate","time_on_page_ms","getMiliSecondsSinceDate","geo","user_agent","tech","profile","full","info","initial","time","local","utc","keen","timestamp","event","recordEvent","collection","catch","serializerOptions","fields","addEventListener","round","getTime","deferEvent","deferEvents","queueCapacity","queueInterval","eventBody","eventsHash","eventList","concat","clonedQueueConfig","clonedQueueEvents","recordEvents","res","indexedDBAvailable","cachingEnabled","db","cacheConfig","dbName","dbCollectionName","dbCollectionKey","maxAge","initializeIndexedDb","requestCacheConfig","Promise","resolve","reject","dbConnectionRequest","indexedDB","open","onerror","onupgradeneeded","objectStore","createObjectStore","keyPath","createIndex","unique","onsuccess","saveToCache","configOptions","cache","then","transactionSave","transaction","requestSave","add","expiryTime","getFromCache","transactionCleanUp","indexCleanUp","upperBoundOpenKeyRange","IDBKeyRange","upperBound","openCursor","cursor","transactionDelete","delete","continue","transactionIndex","responseFromCache","uniqueIds","isUnique","extendedEventBody","stringifiedEvent","hashingMethod","item","filter","alreadySentEvent","find","storage","retriesLimit","retryInitialDelay","retryOn","retriesCount","wrappedFetch","fetch","response","status","error","setTimeout","addEvent","addEvents","eventCollectionOrConfigObject","callback","asyncMode","useBeaconApi","configObject","clientConfig","cb","getRequestUrl","getRequestUrlOkLength","isAsync","checkValidation","console","isUniqueResult","created","Keen","api_key","base64","encode","modified","getUrlMaxLength","sendBeacon","sendXhr","attemptPostXhr","sendFetch","sendJSONp","sendSynchronousXhr","extendedEventsHash","getXhr","apply","projectId","noXhrError","mode","redirect","headers","connectionError","ok","json","error_code","responseJSON","statusText","eventsSavedSuccessfuly","checkEventsSavedSuccessfuly","responseKeys","notSavedEvents","map","success","payload","xhr","onreadystatechange","readyState","responseText","setRequestHeader","toUpperCase","send","root","XMLHttpRequest","protocol","ActiveXObject","script","createElement","parent","getElementsByTagName","callbackName","loaded","cleanup","src","appendChild","handleError","removeChild","img","onload","naturalHeight","naturalWidth","width","height","listenerCore","ctx","domListeners","fn","addListener","eventHandler","once","off","survivors","handler","eventType","evt","srcElement","handlers","deferClickEvent","deferFormSubmit","attachEvent","elem","nodeList","querySelectorAll","anchor","timeout","targetAttr","cbResponse","getAttribute","defaultPrevented","returnValue","preventDefault","metaKey","submit","initAutoTracking","trackExternalLink","listenTo","listenerHash","jsEvent","timeoutCallback","currentTarget","triggered","win","trigger","elt","len","from","ceil","floor","keenGlobals","webpackKeenGlobals","extendLibrary","KeenTracking"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;ACnEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,YAAY;AACzB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1BA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;;;;;;;ACTA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;ACdA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC,mBAAmB;AAC3D;AACA;;AAEA;AACA;AACA,kCAAkC,oBAAoB;AACtD;AACA;;AAEA;AACA;AACA,wCAAwC,4BAA4B;AACpE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,uDAAuD;AACvD,SAAS;AACT;AACA,SAAS;AACT,8EAA8E;AAC9E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,8BAA8B,uBAAuB;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,uCAAuC,0BAA0B;AACjE;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,+BAA+B,0BAA0B,eAAe;AACxE;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA,KAAK;AACL;AACA;AACA,CAAC;;;;;;;;;;;ACldD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;AACD;AACA;;;;;;;;;ACtBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,YAAY;AACZ;AACA;;AAEA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A;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA,mBAAmB,iBAAiB;AACpC;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,+DAA+D;AAC/D;AACA;;AAEA;;;;;;;;;;;;;;QCnOgBO,K,GAAAA,K;AAAT,SAASA,KAAT,CAAeS,GAAf,EAAmB;AACxB,MAAI,gBAAgBT,KAAhB,KAA0B,KAA9B,EAAqC;A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G,YAA5B;AACD,OAFH,EAEK,IAAEA,eAAeF,iBAFtB;AAGD;;AAEDG,iBAAaJ,eAAeG,YAA5B;AACD,GA/BM,CAAP;AAgCD,C;;AAvDD;;AACA;;AAEA;;;;;;AAoDC,C;;;;;;ACvDD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wBAAwB;AACrD,qBAAqB,oCAAoC;AACzD;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,oCAAoC;AACpC,iCAAiC;AACjC;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;;;;;;AC7CA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;ACvLtC;AACA;;AAEA;AACA;AACA;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C,sBAAsB,EAAE;AAClE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;ACzL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D,oBAAoB,SAAS,IAAI,KAAK,eAAe,UAAU;AAC/D,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA,kDAAkD,SAAS,IAAI,KAAK;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,CAAC,sIAAsI;;;;;;;;;;;;;;;;ACnOvI;;;;AACA;;;;AACA;;;;AACA;;AACA;;AAMA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEE;AACA;AACA;AACA,sBAAOpf,gBAASU,SAAhB,EAA2B;AACzBkT,+CADyB;AAEzBkB,iDAFyB;AAGzBoE,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gB,sCAAe7G,IAArB;kBACQA,I","file":"keen-tracking.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 43);\n","module.exports = each;\n\nfunction each(o, cb, s){\n var n;\n if (!o){\n return 0;\n }\n s = !s ? o : s;\n if (o instanceof Array){\n // Indexed arrays, needed for Safari\n for (n=0; n -1\n }\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue+','+value : value\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this, { body: this._bodyInit })\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = 'statusText' in options ? options.statusText : 'OK'\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n var xhr = new XMLHttpRequest()\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import Promise from './index';\nimport promiseFinally from './finally';\n\nvar globalNS = (function() {\n // the only reliable means to get the global object is\n // `Function('return this')()`\n // However, this causes CSP violations in Chrome apps.\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('unable to locate global object');\n})();\n\nif (!globalNS.Promise) {\n globalNS.Promise = Promise;\n} else if (!globalNS.Promise.prototype['finally']) {\n globalNS.Promise.prototype['finally'] = promiseFinally;\n}\n","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n var args = [].slice.call(arguments, 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n","import KeenCore from 'keen-core';\nimport each from 'keen-core/lib/utils/each';\nimport extend from 'keen-core/lib/utils/extend';\nimport { queue } from'./utils/queue';\n\nKeenCore.helpers = KeenCore.helpers || {};\n\n// Install internal queue\nKeenCore.on('client', function(client){\n client.extensions = {\n events: [],\n collections: {}\n };\n client.queue = queue(client.config.queue);\n client.queue.on('flush', function(){\n client.recordDeferredEvents();\n });\n});\n\n// Accessors\nKeenCore.prototype.writeKey = function(str){\n if (!arguments.length) return this.config.writeKey;\n this.config.writeKey = (str ? String(str) : null);\n return this;\n};\n\nKeenCore.prototype.referrerPolicy = function(str){\n if (!arguments.length) return this.config.referrerPolicy;\n this.config.referrerPolicy = (str ? String(str) : null);\n return this;\n};\n\n// DEPRECATED\nKeenCore.prototype.setGlobalProperties = function(props){\n KeenCore.log('This method has been deprecated. Check out #extendEvents: https://github.com/keen/keen-tracking.js#extend-events');\n if (!props || typeof props !== 'function') {\n this.emit('error', 'Invalid value for global properties: ' + props);\n return;\n }\n this.config.globalProperties = props;\n return this;\n};\n\nexport default KeenCore;\n","export function getDomNodePath(el){\n if (!el.nodeName) return '';\n\n var stack = [];\n while ( el.parentNode != null ) {\n // console.log(el.nodeName);\n var sibCount = 0;\n var sibIndex = 0;\n for ( var i = 0; i < el.parentNode.childNodes.length; i++ ) {\n var sib = el.parentNode.childNodes[i];\n if ( sib.nodeName == el.nodeName ) {\n if ( sib === el ) {\n sibIndex = sibCount;\n }\n sibCount++;\n }\n }\n if ( el.hasAttribute('id') && el.id != '' ) {\n stack.unshift(el.nodeName.toLowerCase() + '#' + el.id);\n } else if ( sibCount > 1 ) {\n stack.unshift(el.nodeName.toLowerCase() + ':eq(' + sibIndex + ')');\n } else {\n stack.unshift(el.nodeName.toLowerCase());\n }\n el = el.parentNode;\n }\n\n return stack.slice(1).join(' > ');\n}\n\n\n// via: http://stackoverflow.com/a/16742828/2511985\n","export function getWindowProfile(){\n var body, html, output;\n\n if ('undefined' == typeof document) return {};\n\n body = document.body;\n html = document.documentElement;\n\n output = {\n 'height': ('innerHeight' in window) ? window.innerHeight : document.documentElement.offsetHeight,\n 'width': ('innerWidth' in window) ? window.innerWidth : document.documentElement.offsetWidth,\n 'scrollHeight': Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ) || null\n };\n\n if (window.screen) {\n output.ratio = {\n 'height': (window.screen.availHeight) ? parseFloat( (window.innerHeight/window.screen.availHeight).toFixed(2) ) : null,\n 'width': (window.screen.availWidth) ? parseFloat( (window.innerWidth/window.screen.availWidth).toFixed(2) ) : null\n };\n }\n\n return output;\n}\n\n/*\n Notes:\n document.documentElement.offsetHeight/Width is a workaround for IE8 and below, where window.innerHeight/Width is undefined\n*/\n","export function getScreenProfile(){\n var keys, output;\n\n if ('undefined' == typeof window || !window.screen) return {};\n\n keys = ['height', 'width', 'colorDepth', 'pixelDepth', 'availHeight', 'availWidth'];\n output = {};\n\n for (var i = 0; i < keys.length; i++) {\n output[keys[i]] = window.screen[keys[i]] ? window.screen[keys[i]] : null;\n }\n\n output.orientation = {\n 'angle' : window.screen.orientation ? window.screen.orientation['angle'] : 0,\n 'type' : window.innerWidth > window.innerHeight ? 'landscape': 'portrait'\n };\n\n return output;\n}\n","export const MD5 = function(d){const result = M(V(Y(X(d),8*d.length)));return result.toLowerCase()};function M(d){for(var _,m=\"0123456789ABCDEF\",f=\"\",r=0;r>>4&15)+m.charAt(15&_);return f}function X(d){for(var _=Array(d.length>>2),m=0;m<_.length;m++)_[m]=0;for(m=0;m<8*d.length;m+=8)_[m>>5]|=(255&d.charCodeAt(m/8))<>5]>>>m%32&255);return _}function Y(d,_){d[_>>5]|=128<<_%32,d[14+(_+64>>>9<<4)]=_;for(var m=1732584193,f=-271733879,r=-1732584194,i=271733878,n=0;n>16)+(_>>16)+(m>>16)<<16|65535&m}function bit_rol(d,_){return d<<_|d>>>32-_}\n\nexport default MD5;\n","export const deepExtend = function(target){\n for (var i = 1; i < arguments.length; i++) {\n // Copy unique items from incoming array\n if (target instanceof Array && arguments[i] instanceof Array) {\n for (var j = 0; j < arguments[i].length; j++) {\n if (target.indexOf(arguments[i][j]) < 0) {\n target.push(arguments[i][j]);\n }\n }\n }\n // Blend objects\n else {\n for (var prop in arguments[i]){\n // Recurse when both contain objects of same name\n // and incoming is not a null object\n if (typeof target[prop] !== 'undefined'\n && typeof arguments[i][prop] === 'object'\n && arguments[i][prop] !== null) {\n deepExtend(target[prop], clone(arguments[i][prop]));\n }\n // Otherwise just copy it over...\n else if (\n arguments[i][prop] !== undefined &&\n typeof arguments[i][prop] !== 'function') {\n target[prop] = clone(arguments[i][prop]);\n }\n }\n }\n }\n return target;\n}\n\nfunction clone(input){\n return JSON.parse( JSON.stringify(input) );\n}\n","import { deepExtend } from './utils/deepExtend';\nimport each from 'keen-core/lib/utils/each';\n\nexport function extendEvent(eventCollection, eventModifier){\n if (arguments.length !== 2 || typeof eventCollection !== 'string'\n || ('object' !== typeof eventModifier && 'function' !== typeof eventModifier)) {\n handleValidationError.call(this, 'Incorrect arguments provided to #extendEvent method');\n return;\n }\n this.extensions.collections[eventCollection] = this.extensions.collections[eventCollection] || [];\n this.extensions.collections[eventCollection].push(eventModifier);\n this.emit('extendEvent', eventCollection, eventModifier);\n return this;\n}\n\nexport function extendEvents(eventsModifier){\n if (arguments.length !== 1 || ('object' !== typeof eventsModifier && 'function' !== typeof eventsModifier)) {\n handleValidationError.call(this, 'Incorrect arguments provided to #extendEvents method');\n return;\n }\n this.extensions.events.push(eventsModifier);\n this.emit('extendEvents', eventsModifier);\n return this;\n}\n\nfunction handleValidationError(message){\n var err = 'Event(s) not extended: ' + message;\n this.emit('error', err);\n}\n\nexport function getExtendedEventBody(result, queue){\n if (queue && queue.length > 0) {\n each(queue, function(eventModifier, i){\n var modifierResult = (typeof eventModifier === 'function') ? eventModifier() : eventModifier;\n deepExtend(result, modifierResult);\n });\n }\n return result;\n}\n","export const configDefault = {\n\n // defer events - queue\n // https://github.com/keen/keen-tracking.js/blob/master/docs/defer-events.md\n queue: {\n capacity: 5000,\n interval: 15,\n },\n\n // connection problems - retry request\n retry: {\n limit: 10,\n initialDelay: 200,\n retryOnResponseStatuses: [\n 408,\n 500,\n 502,\n 503,\n 504\n ]\n }\n}\n\nexport default configDefault;\n","import Emitter from 'component-emitter';\n\nimport configDefault from '../config-default.js';\n\nexport function queue(configQueue = {}) {\n if (this instanceof queue === false) {\n return new queue(configQueue);\n }\n this.capacity = 0;\n this.config = {\n ...configDefault.queue,\n ...configQueue\n };\n this.events = {\n // \"collection-1\": [],\n // \"collection-2\": []\n };\n this.interval = 0;\n this.timer = null;\n return this;\n}\n\nEmitter(queue.prototype);\n\nqueue.prototype.check = function() {\n if (shouldFlushQueue(this)) {\n this.flush();\n }\n if (this.config.interval === 0 || this.capacity === 0) {\n this.pause();\n }\n return this;\n};\n\nqueue.prototype.flush = function() {\n this.emit('flush');\n this.interval = 0;\n return this;\n};\n\nqueue.prototype.pause = function() {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n return this;\n};\n\nqueue.prototype.start = function() {\n var self = this;\n self.pause();\n self.timer = setInterval(function() {\n self.interval++;\n self.check();\n }, 1000);\n return self;\n};\n\nfunction shouldFlushQueue(props) {\n if (props.capacity > 0 && props.interval >= props.config.interval) {\n return true;\n }\n else if (props.capacity >= props.config.capacity) {\n return true;\n }\n return false;\n}\n","import promiseFinally from './finally';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n this._state = 0;\n this._handled = false;\n this._value = undefined;\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!arr || typeof arr.length === 'undefined')\n throw new TypeError('Promise.all accepts an array');\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(values) {\n return new Promise(function(resolve, reject) {\n for (var i = 0, len = values.length; i < len; i++) {\n values[i].then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n (typeof setImmediate === 'function' &&\n function(fn) {\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","export function timer(num){\n if (this instanceof timer === false) {\n return new timer(num);\n }\n this.count = num || 0;\n return this;\n}\n\ntimer.prototype.start = function(){\n var self = this;\n this.pause();\n this.interval = setInterval(function(){\n self.count++;\n }, 1000);\n return this;\n};\n\ntimer.prototype.pause = function(){\n clearInterval(this.interval);\n return this;\n};\n\ntimer.prototype.value = function(){\n return this.count;\n};\n\ntimer.prototype.clear = function(){\n this.count = 0;\n return this;\n};\n","/*\n This is a modified copy of https://github.com/defunctzombie/form-serialize/ v0.7.1\n Includes a new configuration option:\n * ignoreTypes - Array, Default: [], Example: [ 'password' ]\n*/\n\n// types which indicate a submit action and are not successful controls\n// these will be ignored\nvar k_r_submitter = /^(?:submit|button|image|reset|file)$/i;\n\n// node names which could be successful controls\nvar k_r_success_contrls = /^(?:input|select|textarea|keygen)/i;\n\n// Matches bracket notation.\nvar brackets = /(\\[[^\\[\\]]*\\])/g;\n\n// serializes form fields\n// @param form MUST be an HTMLForm element\n// @param options is an optional argument to configure the serialization. Default output\n// with no options specified is a url encoded string\n// - hash: [true | false] Configure the output type. If true, the output will\n// be a js object.\n// - serializer: [function] Optional serializer function to override the default one.\n// The function takes 3 arguments (result, key, value) and should return new result\n// hash and url encoded str serializers are provided with this module\n// - disabled: [true | false]. If true serialize disabled fields.\n// - empty: [true | false]. If true serialize empty fields\nexport function serializeForm(form, options) {\n if (typeof options != 'object') {\n options = { hash: !!options };\n }\n else if (options.hash === undefined) {\n options.hash = true;\n }\n\n var result = (options.hash) ? {} : '';\n var serializer = options.serializer || ((options.hash) ? hash_serializer : str_serialize);\n\n var elements = form && form.elements ? form.elements : [];\n\n // Object store each radio and set if it's empty or not\n var radio_store = Object.create(null);\n\n for (var i=0 ; i -1) {\n continue;\n }\n // ingore disabled fields\n if ((!options.disabled && element.disabled) || !element.name) {\n continue;\n }\n // ignore anyhting that is not considered a success field\n if (!k_r_success_contrls.test(element.nodeName) ||\n k_r_submitter.test(element.type)) {\n continue;\n }\n\n var key = element.name;\n var val = element.value;\n\n // we can't just use element.value for checkboxes cause some browsers lie to us\n // they say \"on\" for value when the box isn't checked\n if ((element.type === 'checkbox' || element.type === 'radio') && !element.checked) {\n val = undefined;\n }\n\n // If we want empty elements\n if (options.empty) {\n if (element.type === 'checkbox' && !element.checked) {\n val = '';\n }\n\n // for radio\n if (element.type === 'radio') {\n if (!radio_store[element.name] && !element.checked) {\n radio_store[element.name] = false;\n }\n else if (element.checked) {\n radio_store[element.name] = true;\n }\n }\n\n // if options empty is true, continue only if its radio\n if (val == undefined && element.type == 'radio') {\n continue;\n }\n }\n else {\n // value-less fields are ignored unless options.empty is true\n if (!val) {\n continue;\n }\n }\n\n // multi select boxes\n if (element.type === 'select-multiple') {\n val = [];\n\n var selectOptions = element.options;\n var isSelectedOptions = false;\n for (var j=0 ; j 1) {\n\t\t\t\tattributes = extend({\n\t\t\t\t\tpath: '/'\n\t\t\t\t}, api.defaults, attributes);\n\n\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\n\t\t\t\tif (!converter.write) {\n\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t}\n\n\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\n\t\t\t\treturn (document.cookie = [\n\t\t\t\t\tkey, '=', value,\n\t\t\t\t\tattributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE\n\t\t\t\t\tattributes.path && '; path=' + attributes.path,\n\t\t\t\t\tattributes.domain && '; domain=' + attributes.domain,\n\t\t\t\t\tattributes.secure ? '; secure' : ''\n\t\t\t\t].join(''));\n\t\t\t}\n\n\t\t\t// Read\n\n\t\t\tif (!key) {\n\t\t\t\tresult = {};\n\t\t\t}\n\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t// calling \"get()\"\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\n\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!key) {\n\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tapi.get = api.set = api;\n\t\tapi.getJSON = function () {\n\t\t\treturn api.apply({\n\t\t\t\tjson: true\n\t\t\t}, [].slice.call(arguments));\n\t\t};\n\t\tapi.defaults = {};\n\n\t\tapi.remove = function (key, attributes) {\n\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n","import Cookies from 'js-cookie';\nimport extend from 'keen-core/lib/utils/extend';\n\nexport const cookie = function(str){\n if (!arguments.length) return;\n if (this instanceof cookie === false) {\n return new cookie(str);\n }\n\n this.config = {\n key: str,\n options: {\n expires: 365\n }\n };\n this.data = this.get();\n return this;\n}\n\ncookie.prototype.get = function(str){\n var data = {};\n\n if (Cookies.get(this.config.key)) {\n data = Cookies.getJSON(this.config.key);\n }\n if (str && typeof data === 'object' && typeof data !== null) {\n return (typeof data[str] !== 'undefined') ? data[str] : null;\n }\n else {\n return data;\n }\n};\n\ncookie.prototype.set = function(str, value, options){\n if (!arguments.length || !this.enabled()) return this;\n if (typeof str === 'string' && arguments.length >= 2) {\n this.data[str] = value ? value : null;\n }\n else if (typeof str === 'object' && arguments.length === 1) {\n extend(this.data, str);\n }\n Cookies.set(\n this.config.key,\n this.data,\n extend(this.config.options, options || {})\n );\n return this;\n};\n\ncookie.prototype.expire = function(daysUntilExpire){\n if (daysUntilExpire) {\n Cookies.set(\n this.config.key,\n this.data,\n extend(this.config.options, { expires: daysUntilExpire })\n );\n } else {\n Cookies.remove(this.config.key);\n this.data = {};\n }\n return this;\n};\n\ncookie.prototype.options = function(obj){\n if (!arguments.length) return this.config.options;\n this.config.options = (typeof obj === 'object') ? obj : {};\n return this;\n};\n\ncookie.prototype.enabled = function(){\n return navigator.cookieEnabled;\n};\n","export function getUniqueId() {\n // uuidv4\n if (typeof crypto !== 'undefined' && crypto.getRandomValues) {\n // browser\n return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>\n (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n )\n } else {\n // node & older browsers\n let str = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n return str.replace(/[xy]/g, function(c) {\n let r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n }\n}\n","import extend from 'keen-core/lib/utils/extend';\n\nexport function getScrollState(obj){\n var config = typeof obj === 'object' ? obj : {};\n var state = extend({\n pixel: 0,\n pixel_max: 0,\n ratio: null,\n ratio_max: null\n }, config);\n\n if (typeof window !== undefined || typeof document !== undefined) {\n state.pixel = getScrollOffset() + getWindowHeight();\n if (state.pixel > state.pixel_max) {\n state.pixel_max = state.pixel;\n }\n state.ratio = parseFloat(Number(state.pixel / getScrollableArea()).toFixed(2));\n state.ratio_max = parseFloat(Number(state.pixel_max / getScrollableArea()).toFixed(2));\n }\n\n return state;\n}\n\nfunction getScrollableArea() {\n var body = document.body;\n var html = document.documentElement;\n return Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ) || null;\n}\n\nfunction getScrollOffset() {\n return (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;\n}\n\nfunction getWindowHeight() {\n return window.innerHeight || document.documentElement.clientHeight;\n}\n","import { getDomNodePath } from './getDomNodePath';\n\nexport function getDomNodeProfile(el) {\n return {\n action: el.action,\n class: el.className,\n href: el.href || null,\n id: el.id,\n method: el.method,\n name: el.name,\n node_name: el.nodeName,\n selector: getDomNodePath(el),\n text: el.text,\n title: el.title,\n type: el.type,\n x_position: el.offsetLeft || el.clientLeft || null,\n y_position: el.offsetTop || el.clientTop || null\n };\n}\n","function extractHostname(url) {\n var hostname;\n //find & remove protocol (http, ftp, etc.) and get hostname\n\n if (url.indexOf(\"://\") > -1) {\n hostname = url.split('/')[2];\n }\n else {\n hostname = url.split('/')[0];\n }\n\n //find & remove port number\n hostname = hostname.split(':')[0];\n //find & remove \"?\"\n hostname = hostname.split('?')[0];\n\n return hostname;\n}\n\n// To address those who want the \"root domain,\" use this function:\nexport function getDomainName(url) {\n var domain = extractHostname(url),\n splitArr = domain.split('.'),\n arrLen = splitArr.length;\n\n //extracting the root domain here\n //if there is a subdomain\n if (arrLen > 2) {\n domain = splitArr[arrLen - 2] + '.' + splitArr[arrLen - 1];\n //check to see if it's using a Country Code Top Level Domain (ccTLD) (i.e. \".me.uk\")\n if (splitArr[arrLen - 2].length == 2 && splitArr[arrLen - 1].length == 2) {\n //this is using a ccTLD\n domain = splitArr[arrLen - 3] + '.' + domain;\n }\n }\n return domain;\n}\n","export function getDatetimeIndex(input){\n var date = input || new Date();\n return {\n 'hour_of_day' : date.getHours(),\n 'day_of_week' : parseInt( 1 + date.getDay() ),\n 'day_of_month' : date.getDate(),\n 'month' : parseInt( 1 + date.getMonth() ),\n 'year' : date.getFullYear()\n };\n}\n","import { getScreenProfile } from './getScreenProfile';\nimport { getWindowProfile } from './getWindowProfile';\n\nexport function getBrowserProfile() {\n return {\n 'cookies' : ('undefined' !== typeof navigator.cookieEnabled) ? navigator.cookieEnabled : false,\n 'codeName' : navigator.appCodeName,\n 'description': getDocumentDescription(),\n 'language' : navigator.language,\n 'name' : navigator.appName,\n 'online' : navigator.onLine,\n 'platform' : navigator.platform,\n 'useragent' : navigator.userAgent,\n 'version' : navigator.appVersion,\n 'screen' : getScreenProfile(),\n 'window' : getWindowProfile()\n }\n}\n\nfunction getDocumentDescription() {\n var el;\n if (document && typeof document.querySelector === 'function') {\n el = document.querySelector('meta[name=\"description\"]');\n }\n return el ? el.content : '';\n}\n","import pkg from '../package.json';\n\nexport function initAutoTrackingCore(lib) {\n return function(obj) {\n const client = this;\n const helpers = lib.helpers;\n const utils = lib.utils;\n\n const options = utils.extend({\n ignoreDisabledFormFields: false,\n ignoreFormFieldTypes: ['password'],\n recordClicks: true,\n recordFormSubmits: true,\n recordPageViews: true,\n recordPageViewsOnExit: false,\n recordScrollState: true,\n shareUuidAcrossDomains: false,\n collectIpAddress: true,\n collectUuid: true,\n catchError: undefined // optional, function(error) - error handler\n }, obj);\n\n if (client.config.requestType === 'jsonp') {\n // jsonp is deprecated, let's switch to beaconAPI\n client.config.requestType = 'beaconAPI';\n }\n\n if (client.config.requestType === 'beaconAPI' && options.catchError) {\n throw `You cannot use the BeaconAPI and catchError function in the same time, because BeaconAPI ignores errors. For requests with error handling - use requestType: 'fetch'`;\n return;\n }\n\n const now = new Date();\n const cookie = new utils.cookie('keen');\n\n const domainName = helpers.getDomainName(window.location.hostname);\n const cookieDomain = domainName && options.shareUuidAcrossDomains ? {\n domain: '.' + domainName\n } : {};\n\n let uuid;\n if (options.collectUuid) {\n uuid = cookie.get('uuid');\n if (!uuid) {\n uuid = helpers.getUniqueId();\n cookie.set('uuid', uuid, cookieDomain);\n }\n }\n\n let initialReferrer = cookie.get('initialReferrer');\n if (!initialReferrer){\n initialReferrer = document && document.referrer || undefined;\n cookie.set('initialReferrer', initialReferrer, cookieDomain);\n }\n\n let scrollState = {};\n if (options.recordScrollState) {\n scrollState = helpers.getScrollState();\n utils.listener('window').on('scroll', () => {\n scrollState = helpers.getScrollState(scrollState);\n });\n }\n\n const addons = [\n {\n name: 'keen:ua_parser',\n input: {\n ua_string: 'user_agent'\n },\n output: 'tech'\n },\n {\n name: 'keen:url_parser',\n input: {\n url: 'url.full'\n },\n output: 'url.info'\n },\n {\n name: 'keen:url_parser',\n input: {\n url: 'referrer.full'\n },\n output: 'referrer.info'\n },\n {\n name: 'keen:date_time_parser',\n input: {\n date_time: 'keen.timestamp'\n },\n output: 'time.utc'\n },\n {\n name: 'keen:date_time_parser',\n input: {\n date_time: 'local_time_full'\n },\n output: 'time.local'\n }\n ];\n\n let ip_address = '${keen.ip}';\n addons.push({\n name: 'keen:ip_to_geo',\n input: {\n ip: 'ip_address',\n remove_ip_property: !options.collectIpAddress\n },\n output : 'geo'\n });\n\n client.extendEvents(function() {\n const browserProfile = helpers.getBrowserProfile();\n return {\n tracked_by: pkg.name + '-' + pkg.version,\n local_time_full: new Date().toISOString(),\n user: {\n uuid\n },\n page: {\n title: document ? document.title : null,\n description: browserProfile.description,\n scroll_state: scrollState,\n time_on_page: getSecondsSinceDate(now),\n time_on_page_ms: getMiliSecondsSinceDate(now)\n },\n\n ip_address,\n geo: { /* Enriched */ },\n\n user_agent: '${keen.user_agent}',\n tech: {\n profile: browserProfile\n /* Enriched */\n },\n\n url: {\n full: window ? window.location.href : '',\n info: { /* Enriched */ }\n },\n\n referrer: {\n initial: initialReferrer,\n full: document ? document.referrer : '',\n info: { /* Enriched */ }\n },\n\n time: {\n local: { /* Enriched */ },\n utc: { /* Enriched */ }\n },\n\n keen: {\n timestamp: new Date().toISOString(),\n addons,\n }\n };\n });\n\n if (options.recordClicks === true) {\n utils.listener('a, a *').on('click', function(e) {\n const el = e.target;\n const event = {\n element: helpers.getDomNodeProfile(el),\n local_time_full: new Date().toISOString()\n };\n\n if (options.catchError) {\n return client\n .recordEvent({\n collection: 'clicks',\n event\n }).catch(err => {\n options.catchError(err);\n });\n }\n\n return client\n .recordEvent({\n collection: 'clicks',\n event\n });\n });\n }\n\n if (options.recordFormSubmits === true) {\n utils.listener('form').on('submit', function(e) {\n const el = e.target;\n const serializerOptions = {\n disabled: options.ignoreDisabledFormFields,\n ignoreTypes: options.ignoreFormFieldTypes\n };\n const event = {\n form: {\n action: el.action,\n fields: utils.serializeForm(el, serializerOptions),\n method: el.method\n },\n element: helpers.getDomNodeProfile(el),\n local_time_full: new Date().toISOString()\n };\n\n if (options.catchError) {\n return client\n .recordEvent({\n collection: 'form_submissions',\n event\n })\n .catch(err => {\n options.catchError(err);\n });\n }\n\n return client.recordEvent({\n collection: 'form_submissions',\n event\n });\n });\n }\n\n if (options.recordPageViews === true && !options.recordPageViewsOnExit) {\n if (options.catchError) {\n client\n .recordEvent({\n collection: 'pageviews'\n })\n .catch(err => {\n options.catchError(err);\n });\n } else {\n client\n .recordEvent({\n collection: 'pageviews'\n });\n }\n }\n\n if (options.recordPageViewsOnExit && typeof window !== 'undefined') {\n window.addEventListener('beforeunload', () => {\n client.config.requestType = 'beaconAPI'; // you can run beforeunload only with beaconAPI\n client.recordEvent({\n collection: 'pageviews'\n });\n });\n }\n\n return client;\n };\n}\n\nfunction getSecondsSinceDate(date) {\n return Math.round(getMiliSecondsSinceDate(date) / 1000);\n}\n\nfunction getMiliSecondsSinceDate(date) {\n return new Date().getTime() - date.getTime();\n}\n","import Keen from './index';\nimport each from 'keen-core/lib/utils/each';\nimport { queue } from './utils/queue';\n\nexport function deferEvent(eventCollection, eventBody){\n\n if (arguments.length !== 2 || typeof eventCollection !== 'string') {\n handleValidationError.call(this, 'Incorrect arguments provided to #deferEvent method');\n return;\n }\n\n this.queue.events[eventCollection] = this.queue.events[eventCollection] || [];\n this.queue.events[eventCollection].push(eventBody);\n this.queue.capacity++;\n if (!this.queue.timer) {\n this.queue.start();\n }\n this.emit('deferEvent', eventCollection, eventBody);\n return this;\n}\n\nexport function deferEvents(eventsHash){\n var self = this;\n\n if (arguments.length !== 1 || typeof eventsHash !== 'object') {\n handleValidationError.call(this, 'Incorrect arguments provided to #deferEvents method');\n return;\n }\n\n each(eventsHash, function(eventList, eventCollection){\n self.queue.events[eventCollection] = self.queue.events[eventCollection] || [];\n self.queue.events[eventCollection] = self.queue.events[eventCollection].concat(eventList);\n self.queue.capacity = self.queue.capacity + eventList.length;\n if (!self.queue.timer) {\n self.queue.start();\n }\n });\n self.emit('deferEvents', eventsHash);\n return self;\n}\n\nexport function queueCapacity(num){\n if (!arguments.length) return this.queue.config.capacity;\n this.queue.config.capacity = num ? Number(num): 0;\n this.queue.check();\n return this;\n}\n\nexport function queueInterval(num){\n if (!arguments.length) return this.queue.config.interval;\n this.queue.config.interval = num ? Number(num): 0;\n this.queue.check();\n return this;\n}\n\nexport function recordDeferredEvents(){\n const self = this;\n\n if (self.queue.capacity > 0) {\n self.queue.pause();\n let clonedQueueConfig = { ...self.queue.config };\n let clonedQueueEvents = { ...self.queue.events };\n self.queue = queue();\n self.queue.config = clonedQueueConfig;\n self.queue.on('flush', function(){\n self.recordDeferredEvents();\n });\n self.emit('recordDeferredEvents', clonedQueueEvents);\n self.recordEvents(clonedQueueEvents, (err, res) => {\n if (err) {\n self.emit('recordDeferredEventsError', err, clonedQueueEvents);\n }\n });\n }\n return self;\n}\n\nfunction handleValidationError(message){\n var err = 'Event(s) not deferred: ' + message;\n this.emit('error', err);\n}\n","import 'promise-polyfill/src/polyfill';\nimport 'whatwg-fetch';\n\nimport md5 from './md5';\n\nconst indexedDBAvailable = 'indexedDB' in self;\nlet cachingEnabled = true;\n\nif (!indexedDBAvailable) {\n // console.log(\"Your browser doesn't support a stable version of IndexedDB.\");\n cachingEnabled = false; // graceful degradation\n}\n\nlet db;\nlet cacheConfig = {\n dbName: 'keenTrackingIndexedDB',\n dbCollectionName: 'requests',\n dbCollectionKey: 'hash',\n maxAge: 60 * 1000\n};\n\nfunction initializeIndexedDb(requestCacheConfig = {}){\n if (db) { return Promise.resolve(); }\n if (!cachingEnabled) { return Promise.resolve(); }\n cacheConfig = {\n ...cacheConfig,\n ...requestCacheConfig\n };\n return new Promise((resolve, reject) => {\n const dbConnectionRequest = self.indexedDB.open(cacheConfig.dbName);\n dbConnectionRequest.onerror = function(event) {\n cachingEnabled = false;\n resolve();\n };\n\n dbConnectionRequest.onupgradeneeded = function(event) {\n const db = event.target.result;\n const objectStore = db\n .createObjectStore(cacheConfig.dbCollectionName,\n { keyPath: cacheConfig.dbCollectionKey });\n objectStore.createIndex(\n cacheConfig.dbCollectionKey,\n cacheConfig.dbCollectionKey,\n { unique: true }\n );\n objectStore.createIndex('expiryTime', 'expiryTime', { unique: false });\n };\n\n dbConnectionRequest.onsuccess = function(event) {\n db = event.target.result;\n db.onerror = function(event) {\n cachingEnabled = false; // graceful degradation\n };\n resolve(db);\n };\n });\n}\n\nexport const saveToCache = (hash, configOptions = {}) => {\n return initializeIndexedDb(configOptions.cache).then(() => {\n const transactionSave = db\n .transaction(cacheConfig.dbCollectionName, \"readwrite\")\n .objectStore(cacheConfig.dbCollectionName);\n const requestSave = transactionSave.add({\n hash,\n expiryTime: Date.now() + cacheConfig.maxAge\n });\n requestSave.onsuccess = function(event) {\n };\n requestSave.onerror = function(event) {\n cachingEnabled = false;\n };\n });\n}\n\nexport const getFromCache = (hash, configOptions = {}) => {\n return initializeIndexedDb(configOptions.cache).then(() => {\n return new Promise((resolve, reject) => {\n if (!cachingEnabled) {\n return resolve(null);\n }\n\n const transactionCleanUp = db\n .transaction(cacheConfig.dbCollectionName, \"readwrite\")\n .objectStore(cacheConfig.dbCollectionName);\n const indexCleanUp = transactionCleanUp.index('expiryTime');\n const upperBoundOpenKeyRange = IDBKeyRange.upperBound(Date.now(), true);\n indexCleanUp.openCursor(upperBoundOpenKeyRange).onsuccess = function(event) {\n let cursor = event.target.result;\n if (cursor) {\n let transactionDelete = db\n .transaction(cacheConfig.dbCollectionName, \"readwrite\")\n .objectStore(cacheConfig.dbCollectionName)\n .delete(event.target.result.value[cacheConfig.dbCollectionKey]);\n cursor.continue();\n }\n };\n\n const transactionIndex = db\n .transaction(cacheConfig.dbCollectionName, \"readwrite\")\n .objectStore(cacheConfig.dbCollectionName);\n const index = transactionIndex.index(cacheConfig.dbCollectionKey);\n const responseFromCache = index.get(hash);\n responseFromCache.onsuccess = function(event) {\n if (!event.target.result ||\n event.target.result.expiryTime < Date.now()\n ) {\n if (event.target.result && event.target.result.expiryTime < Date.now()){\n const transactionDelete = db\n .transaction(cacheConfig.dbCollectionName, \"readwrite\")\n .objectStore(cacheConfig.dbCollectionName)\n .delete(event.target.result[cacheConfig.dbCollectionKey]);\n transactionDelete.onsuccess = (event) => {\n resolve(getFromCache(hash, configOptions));\n };\n transactionDelete.onerror = (event) => {\n cachingEnabled = false;\n resolve(getFromCache(hash, configOptions));\n };\n return resolve(null);\n }\n return resolve(null);\n } else {\n return resolve(event.target.result);\n }\n };\n responseFromCache.onerror = function(event) {\n cachingEnabled = false;\n resolve(getFromCache(hash, configOptions));\n };\n });\n });\n}\n","import md5 from './md5';\nimport { getFromCache, saveToCache } from './cache-browser';\n\nlet uniqueIds = [];\n\nexport const isUnique = (config, extendedEventBody) => {\n const stringifiedEvent = JSON.stringify(extendedEventBody);\n const hash = config.cache.hashingMethod && config.cache.hashingMethod.toLowerCase() === 'md5'\n ? md5(stringifiedEvent) : stringifiedEvent;\n const expiryTime = config.cache.maxAge ? (Date.now() + config.cache.maxAge) : undefined;\n const item = {\n hash,\n expiryTime\n };\n\n if (expiryTime){\n const now = Date.now();\n uniqueIds = uniqueIds.filter(item => item.expiryTime > now);\n }\n\n const alreadySentEvent = uniqueIds.find(item => item.hash === hash);\n if (alreadySentEvent) {\n if (alreadySentEvent.expiryTime && alreadySentEvent.expiryTime < Date.now()) {\n uniqueIds = uniqueIds.filter(item => item.hash !== hash);\n } else {\n return Promise.resolve(false);\n }\n }\n uniqueIds.push(item);\n\n if (config.cache.storage && config.cache.storage.toLowerCase() === 'indexeddb') {\n return getFromCache(hash, config).then(alreadySentEvent => {\n if (alreadySentEvent) {\n return false;\n }\n saveToCache(hash, config);\n return true;\n });\n }\n\n return Promise.resolve(true);\n}\n\nexport default isUnique;\n","import 'promise-polyfill/src/polyfill';\nimport 'whatwg-fetch';\n\nimport configDefault from '../config-default.js';\n\nexport default function(url, options) {\n const config = {\n ...configDefault,\n ...(options.retry || {})\n };\n\n const retriesLimit = config.retry.limit;\n const retryInitialDelay = config.retry.initialDelay;\n const retryOn = config.retry.retryOnResponseStatuses;\n let retriesCount = 0;\n\n if (retryOn && !(retryOn instanceof Array)) {\n throw {\n name: 'ArgumentError',\n message: 'retryOn property expects an array'\n }\n }\n\n return new Promise(function(resolve, reject) {\n const wrappedFetch = function(n) {\n fetch(url, options)\n .then(function(response) {\n if (retryOn.indexOf(response.status) === -1) {\n resolve(response);\n } else {\n if (n > 0) {\n retry();\n } else {\n reject(response);\n }\n }\n })\n .catch(function(error) {\n if (n > 0) {\n retry();\n } else {\n reject(error);\n }\n });\n };\n\n function retry() {\n retriesCount = retriesCount + 1;\n setTimeout(function() {\n wrappedFetch(retriesLimit - retriesCount);\n }, 2^retriesCount * retryInitialDelay);\n }\n\n wrappedFetch(retriesLimit - retriesCount);\n });\n};\n","module.exports = {\n map: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\n encode: function (n) {\n \"use strict\";\n var o = \"\", i = 0, m = this.map, i1, i2, i3, e1, e2, e3, e4;\n n = this.utf8.encode(n);\n while (i < n.length) {\n i1 = n.charCodeAt(i++); i2 = n.charCodeAt(i++); i3 = n.charCodeAt(i++);\n e1 = (i1 >> 2); e2 = (((i1 & 3) << 4) | (i2 >> 4)); e3 = (isNaN(i2) ? 64 : ((i2 & 15) << 2) | (i3 >> 6));\n e4 = (isNaN(i2) || isNaN(i3)) ? 64 : i3 & 63;\n o = o + m.charAt(e1) + m.charAt(e2) + m.charAt(e3) + m.charAt(e4);\n } return o;\n },\n decode: function (n) {\n \"use strict\";\n var o = \"\", i = 0, m = this.map, cc = String.fromCharCode, e1, e2, e3, e4, c1, c2, c3;\n n = n.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n while (i < n.length) {\n e1 = m.indexOf(n.charAt(i++)); e2 = m.indexOf(n.charAt(i++));\n e3 = m.indexOf(n.charAt(i++)); e4 = m.indexOf(n.charAt(i++));\n c1 = (e1 << 2) | (e2 >> 4); c2 = ((e2 & 15) << 4) | (e3 >> 2);\n c3 = ((e3 & 3) << 6) | e4;\n o = o + (cc(c1) + ((e3 != 64) ? cc(c2) : \"\")) + (((e4 != 64) ? cc(c3) : \"\"));\n } return this.utf8.decode(o);\n },\n utf8: {\n encode: function (n) {\n \"use strict\";\n var o = \"\", i = 0, cc = String.fromCharCode, c;\n while (i < n.length) {\n c = n.charCodeAt(i++); o = o + ((c < 128) ? cc(c) : ((c > 127) && (c < 2048)) ?\n (cc((c >> 6) | 192) + cc((c & 63) | 128)) : (cc((c >> 12) | 224) + cc(((c >> 6) & 63) | 128) + cc((c & 63) | 128)));\n } return o;\n },\n decode: function (n) {\n \"use strict\";\n var o = \"\", i = 0, cc = String.fromCharCode, c2, c;\n while (i < n.length) {\n c = n.charCodeAt(i);\n o = o + ((c < 128) ? [cc(c), i++][0] : ((c > 191) && (c < 224)) ?\n [cc(((c & 31) << 6) | ((c2 = n.charCodeAt(i + 1)) & 63)), (i += 2)][0] :\n [cc(((c & 15) << 12) | (((c2 = n.charCodeAt(i + 1)) & 63) << 6) | ((c3 = n.charCodeAt(i + 2)) & 63)), (i += 3)][0]);\n } return o;\n }\n }\n};\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a