New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

amplitude-js

Package Overview
Dependencies
Maintainers
2
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amplitude-js - npm Package Compare versions

Comparing version 4.6.0 to 4.7.0-react-native

2

amplitude-snippet.min.js
(function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement("script")
;r.type="text/javascript";r.async=true
;r.src="https://cdn.amplitude.com/libs/amplitude-4.6.0-min.gz.js"
;r.src="https://cdn.amplitude.com/libs/amplitude-4.7.0-react-native-min.gz.js"
;r.onload=function(){if(e.amplitude.runQueuedFunctions){

@@ -5,0 +5,0 @@ e.amplitude.runQueuedFunctions()}else{

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.amplitude=t()}(this,function(){"use strict";var u="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(e,t){return e(t={exports:{}},t.exports),t.exports}e(function(s,a){(function(){var M={function:!0,object:!0},e=M.object&&a&&!a.nodeType&&a,B=M[typeof window]&&window||this,t=e&&M.object&&s&&!s.nodeType&&"object"==typeof u&&u;function L(e,u){e||(e=B.Object()),u||(u=B.Object());var c=e.Number||B.Number,p=e.String||B.String,t=e.Object||B.Object,l=e.Date||B.Date,n=e.SyntaxError||B.SyntaxError,S=e.TypeError||B.TypeError,i=e.Math||B.Math,r=e.JSON||B.JSON;"object"==typeof r&&r&&(u.stringify=r.stringify,u.parse=r.parse);var O,E,N,o=t.prototype,x=o.toString,d=new l(-0xc782b5b800cec);try{d=-109252==d.getUTCFullYear()&&0===d.getUTCMonth()&&1===d.getUTCDate()&&10==d.getUTCHours()&&37==d.getUTCMinutes()&&6==d.getUTCSeconds()&&708==d.getUTCMilliseconds()}catch(e){}function f(e){if(f[e]!==N)return f[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=f("json-stringify")&&f("json-parse");else{var n,i='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=u.stringify,o="function"==typeof r&&d;if(o){(n=function(){return 1}).toJSON=n;try{o="0"===r(0)&&"0"===r(new c)&&'""'==r(new p)&&r(x)===N&&r(N)===N&&r()===N&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([N])&&"null"==r(null)&&"[null,null,null]"==r([N,x,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==i&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==r(new l(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==r(new l(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new l(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==r(new l(-1))}catch(e){o=!1}}t=o}if("json-parse"==e){var s=u.parse;if("function"==typeof s)try{if(0===s("0")&&!s(!1)){var a=5==(n=s(i)).a.length&&1===n.a[0];if(a){try{a=!s('"\t"')}catch(e){}if(a)try{a=1!==s("01")}catch(e){}if(a)try{a=1!==s("1.")}catch(e){}}}}catch(e){a=!1}t=a}}return f[e]=!!t}if(!f("json")){var h="[object Function]",k="[object Number]",A="[object String]",T="[object Array]",a=f("bug-string-char-index");if(!d)var j=i.floor,s=[0,31,59,90,120,151,181,212,243,273,304,334],C=function(e,t){return s[t]+365*(e-1970)+j((e-1969+(t=+(1<t)))/4)-j((e-1901+t)/100)+j((e-1601+t)/400)};if((O=o.hasOwnProperty)||(O=function(e){var n,t={};return O=(t.__proto__=null,t.__proto__={toString:1},t).toString!=x?function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(n=t.constructor,function(e){var t=(this.constructor||n).prototype;return e in this&&!(e in t&&this[e]===t[e])}),t=null,O.call(this,e)}),E=function(e,t){var n,s,i,r=0;for(i in(n=function(){this.valueOf=0}).prototype.valueOf=0,s=new n)O.call(s,i)&&r++;return n=s=null,(E=r?2==r?function(e,t){var n,i={},r=x.call(e)==h;for(n in e)r&&"prototype"==n||O.call(i,n)||!(i[n]=1)||!O.call(e,n)||t(n)}:function(e,t){var n,i,r=x.call(e)==h;for(n in e)r&&"prototype"==n||!O.call(e,n)||(i="constructor"===n)||t(n);(i||O.call(e,n="constructor"))&&t(n)}:(s=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],function(e,t){var n,i,r=x.call(e)==h,o=!r&&"function"!=typeof e.constructor&&M[typeof e.hasOwnProperty]&&e.hasOwnProperty||O;for(n in e)r&&"prototype"==n||!o.call(e,n)||t(n);for(i=s.length;n=s[--i];o.call(e,n)&&t(n));}))(e,t)},!f("json-stringify")){var g={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},P=function(e,t){return("000000"+(t||0)).slice(-e)},R=function(e){for(var t='"',n=0,i=e.length,r=!a||10<i,o=r&&(a?e.split(""):e);n<i;n++){var s=e.charCodeAt(n);switch(s){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=g[s];break;default:if(s<32){t+="\\u00"+P(2,s.toString(16));break}t+=r?o[n]:e.charAt(n)}}return t+'"'},q=function(e,t,n,i,r,o,s){var a,u,c,p,l,d,f,h,g,v,y,m,_,w,b,I;try{a=t[e]}catch(e){}if("object"==typeof a&&a)if("[object Date]"!=(u=x.call(a))||O.call(a,"toJSON"))"function"==typeof a.toJSON&&(u!=k&&u!=A&&u!=T||O.call(a,"toJSON"))&&(a=a.toJSON(e));else if(-1/0<a&&a<1/0){if(C){for(l=j(a/864e5),c=j(l/365.2425)+1970-1;C(c+1,0)<=l;c++);for(p=j((l-C(c,0))/30.42);C(c,p+1)<=l;p++);l=1+l-C(c,p),f=j((d=(a%864e5+864e5)%864e5)/36e5)%24,h=j(d/6e4)%60,g=j(d/1e3)%60,v=d%1e3}else c=a.getUTCFullYear(),p=a.getUTCMonth(),l=a.getUTCDate(),f=a.getUTCHours(),h=a.getUTCMinutes(),g=a.getUTCSeconds(),v=a.getUTCMilliseconds();a=(c<=0||1e4<=c?(c<0?"-":"+")+P(6,c<0?-c:c):P(4,c))+"-"+P(2,p+1)+"-"+P(2,l)+"T"+P(2,f)+":"+P(2,h)+":"+P(2,g)+"."+P(3,v)+"Z"}else a=null;if(n&&(a=n.call(t,e,a)),null===a)return"null";if("[object Boolean]"==(u=x.call(a)))return""+a;if(u==k)return-1/0<a&&a<1/0?""+a:"null";if(u==A)return R(""+a);if("object"==typeof a){for(w=s.length;w--;)if(s[w]===a)throw S();if(s.push(a),y=[],b=o,o+=r,u==T){for(_=0,w=a.length;_<w;_++)m=q(_,a,n,i,r,o,s),y.push(m===N?"null":m);I=y.length?r?"[\n"+o+y.join(",\n"+o)+"\n"+b+"]":"["+y.join(",")+"]":"[]"}else E(i||a,function(e){var t=q(e,a,n,i,r,o,s);t!==N&&y.push(R(e)+":"+(r?" ":"")+t)}),I=y.length?r?"{\n"+o+y.join(",\n"+o)+"\n"+b+"}":"{"+y.join(",")+"}":"{}";return s.pop(),I}};u.stringify=function(e,t,n){var i,r,o,s;if(M[typeof t]&&t)if((s=x.call(t))==h)r=t;else if(s==T){o={};for(var a,u=0,c=t.length;u<c;a=t[u++],((s=x.call(a))==A||s==k)&&(o[a]=1));}if(n)if((s=x.call(n))==k){if(0<(n-=n%1))for(i="",10<n&&(n=10);i.length<n;i+=" ");}else s==A&&(i=n.length<=10?n:n.slice(0,10));return q("",((a={})[""]=e,a),r,o,i,"",[])}}if(!f("json-parse")){var v,y,m=p.fromCharCode,_={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},w=function(){throw v=y=null,n()},b=function(){for(var e,t,n,i,r,o=y,s=o.length;v<s;)switch(r=o.charCodeAt(v)){case 9:case 10:case 13:case 32:v++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=a?o.charAt(v):o[v],v++,e;case 34:for(e="@",v++;v<s;)if((r=o.charCodeAt(v))<32)w();else if(92==r)switch(r=o.charCodeAt(++v)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=_[r],v++;break;case 117:for(t=++v,n=v+4;v<n;v++)48<=(r=o.charCodeAt(v))&&r<=57||97<=r&&r<=102||65<=r&&r<=70||w();e+=m("0x"+o.slice(t,v));break;default:w()}else{if(34==r)break;for(r=o.charCodeAt(v),t=v;32<=r&&92!=r&&34!=r;)r=o.charCodeAt(++v);e+=o.slice(t,v)}if(34==o.charCodeAt(v))return v++,e;w();default:if(t=v,45==r&&(i=!0,r=o.charCodeAt(++v)),48<=r&&r<=57){for(48==r&&(48<=(r=o.charCodeAt(v+1))&&r<=57)&&w(),i=!1;v<s&&(48<=(r=o.charCodeAt(v))&&r<=57);v++);if(46==o.charCodeAt(v)){for(n=++v;n<s&&(48<=(r=o.charCodeAt(n))&&r<=57);n++);n==v&&w(),v=n}if(101==(r=o.charCodeAt(v))||69==r){for(43!=(r=o.charCodeAt(++v))&&45!=r||v++,n=v;n<s&&(48<=(r=o.charCodeAt(n))&&r<=57);n++);n==v&&w(),v=n}return+o.slice(t,v)}if(i&&w(),"true"==o.slice(v,v+4))return v+=4,!0;if("false"==o.slice(v,v+5))return v+=5,!1;if("null"==o.slice(v,v+4))return v+=4,null;w()}return"$"},I=function(e){var t,n;if("$"==e&&w(),"string"==typeof e){if("@"==(a?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=b());n||(n=!0))n&&(","==e?"]"==(e=b())&&w():w()),","==e&&w(),t.push(I(e));return t}if("{"==e){for(t={};"}"!=(e=b());n||(n=!0))n&&(","==e?"}"==(e=b())&&w():w()),","!=e&&"string"==typeof e&&"@"==(a?e.charAt(0):e[0])&&":"==b()||w(),t[e.slice(1)]=I(b());return t}w()}return e},U=function(e,t,n){var i=D(e,t,n);i===N?delete e[t]:e[t]=i},D=function(e,t,n){var i,r=e[t];if("object"==typeof r&&r)if(x.call(r)==T)for(i=r.length;i--;)U(r,i,n);else E(r,function(e){U(r,e,n)});return n.call(e,t,r)};u.parse=function(e,t){var n,i;return v=0,y=""+e,n=I(b()),"$"!=b()&&w(),v=y=null,t&&x.call(t)==h?D(((i={})[""]=n,i),"",t):n}}}return u.runInContext=L,u}if(!t||t.global!==t&&t.window!==t&&t.self!==t||(B=t),e)L(B,e);else{var n=B.JSON,i=B.JSON3,r=!1,o=L(B,B.JSON3={noConflict:function(){return r||(r=!0,B.JSON=n,B.JSON3=i,n=i=null),o}});B.JSON={parse:o.parse,stringify:o.stringify}}}).call(u)});var d="$default_instance",p=2,t=4096,a=1e3,f="$identify",h="$groupidentify",g="amplitude_lastEventId",v="amplitude_lastEventTime",y="amplitude_lastIdentifyId",m="amplitude_lastSequenceNumber",_="amplitude_sessionId",w="amplitude_deviceId",b="amplitude_optOut",I="amplitude_userId",n="amplitude_cookie_test",i="revenue_amount",r="$productId",o="$quantity",s="$price",c="$revenueType",l="amp_device_id",S="referrer",O="utm_source",E="utm_medium",N="utm_campaign",x="utm_term",k="utm_content",A=function(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):(127<i&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(63&i|128))}return t},T=function(e){for(var t="",n=0,i=0,r=0,o=0;n<e.length;)(i=e.charCodeAt(n))<128?(t+=String.fromCharCode(i),n++):191<i&&i<224?(r=e.charCodeAt(n+1),t+=String.fromCharCode((31&i)<<6|63&r),n+=2):(r=e.charCodeAt(n+1),o=e.charCodeAt(n+2),t+=String.fromCharCode((15&i)<<12|(63&r)<<6|63&o),n+=3);return t},j={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){try{if(window.btoa&&window.atob)return window.btoa(unescape(encodeURIComponent(e)))}catch(e){}return j._encode(e)},_encode:function(e){var t,n,i,r,o,s,a,u="",c=0;for(e=A(e);c<e.length;)r=(t=e.charCodeAt(c++))>>2,o=(3&t)<<4|(n=e.charCodeAt(c++))>>4,s=(15&n)<<2|(i=e.charCodeAt(c++))>>6,a=63&i,isNaN(n)?s=a=64:isNaN(i)&&(a=64),u=u+j._keyStr.charAt(r)+j._keyStr.charAt(o)+j._keyStr.charAt(s)+j._keyStr.charAt(a);return u},decode:function(e){try{if(window.btoa&&window.atob)return decodeURIComponent(escape(window.atob(e)))}catch(e){}return j._decode(e)},_decode:function(e){var t,n,i,r,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)t=j._keyStr.indexOf(e.charAt(u++))<<2|(r=j._keyStr.indexOf(e.charAt(u++)))>>4,n=(15&r)<<4|(o=j._keyStr.indexOf(e.charAt(u++)))>>2,i=(3&o)<<6|(s=j._keyStr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(i));return a=T(a)}},C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},R=Object.prototype.toString;function q(e){switch(R.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)?"buffer":void 0===(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e))?"undefined":C(e)}var U,D={DISABLE:0,ERROR:1,WARN:2,INFO:3},M=D.WARN,B={error:function(e){M>=D.ERROR&&L(e)},warn:function(e){M>=D.WARN&&L(e)},info:function(e){M>=D.INFO&&L(e)}},L=function(e){try{console.log("[Amplitude] "+e)}catch(e){}},F=function(e){return"string"===q(e)&&e.length>t?e.substring(0,t):e},K=function(e){var t=q(e);if("object"!==t)return B.error("Error: invalid properties format. Expecting Javascript object, received "+t+", ignoring"),{};if(Object.keys(e).length>a)return B.error("Error: too many properties (more than 1000), ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=i,o=q(r);"string"!==o&&(r=String(r),B.warn("WARNING: Non-string property key, received type "+o+', coercing to string "'+r+'"'));var s=G(r,e[i]);null!==s&&(n[r]=s)}return n},z=["null","nan","undefined","function","arguments","regexp","element"],G=function e(t,n){var i=q(n);if(-1!==z.indexOf(i))B.warn('WARNING: Property key "'+t+'" with invalid value type '+i+", ignoring"),n=null;else if("error"===i)n=String(n),B.warn('WARNING: Property key "'+t+'" with value type error, coercing to '+n);else if("array"===i){for(var r=[],o=0;o<n.length;o++){var s=n[o],a=q(s);"array"!==a&&"object"!==a?r.push(e(t,s)):B.warn("WARNING: Cannot have "+a+" nested in an array property value, skipping")}n=r}else"object"===i&&(n=K(n));return n},J=function(e,t){var n=q(t);if("string"===n)return t;if("date"===n||"number"===n||"boolean"===n)return t=String(t),B.warn("WARNING: Non-string groupName, received type "+n+', coercing to string "'+t+'"'),t;if("array"===n){for(var i=[],r=0;r<t.length;r++){var o=t[r],s=q(o);"array"!==s&&"object"!==s?"string"===s?i.push(o):"date"!==s&&"number"!==s&&"boolean"!==s||(o=String(o),B.warn("WARNING: Non-string groupName, received type "+s+', coercing to string "'+o+'"'),i.push(o)):B.warn("WARNING: Skipping nested "+s+" in array groupName")}return i}B.warn("WARNING: Non-string groupName, received type "+n+". Please use strings or array of strings for groupName")},W=function(e){D.hasOwnProperty(e)&&(M=D[e])},V=B,$=function(e){return!e||0===e.length},X=function(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?void 0:decodeURIComponent(n[1].replace(/\+/g," "))},H=function e(t){if("array"===q(t))for(var n=0;n<t.length;n++)t[n]=e(t[n]);else if("object"===q(t))for(var i in t)t.hasOwnProperty(i)&&(t[i]=e(t[i]));else t=F(t);return t},Q=function(e){var t=q(e);if("object"!==t)return B.error("Error: invalid groups format. Expecting Javascript object, received "+t+", ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=i,o=q(r);"string"!==o&&(r=String(r),B.warn("WARNING: Non-string groupType, received type "+o+', coercing to string "'+r+'"'));var s=J(r,e[i]);null!==s&&(n[r]=s)}return n},Z=function(e,t,n){return q(e)===n||(B.error("Invalid "+t+" input type. Expected "+n+" but received "+q(e)),!1)},Y=K,ee=function(e,t,n){var i=null!==t?n.expirationDays:-1;if(i){var r=new Date;r.setTime(r.getTime()+24*i*60*60*1e3),i=r}var o=e+"="+t;i&&(o+="; expires="+i.toUTCString()),o+="; path=/",n.domain&&(o+="; domain="+n.domain),n.secure&&(o+="; Secure"),document.cookie=o},te=function(e){try{for(var t=document.cookie.split(";"),n=null,i=0;i<t.length;i++){for(var r=t[i];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e)){n=r.substring(e.length,r.length);break}}return n}catch(e){return null}},ne={expirationDays:void 0,domain:void 0},ie=function(e){var t,n,i=(t=e,(n=document.createElement("a")).href=t,n.hostname||location.hostname).split("."),r=i[i.length-1],o=[];if(4===i.length&&r===parseInt(r,10))return o;if(i.length<=1)return o;for(var s=i.length-2;0<=s;--s)o.push(i.slice(s).join("."));for(var a=0;a<o.length;++a){var u="__tld_test__",c=o[a],p={domain:"."+c};if(ee(u,1,p),te(u))return ee(u,null,p),c}return""},re=function(e){var t="";return ne.domain&&(t="."===ne.domain.charAt(0)?ne.domain.substring(1):ne.domain),e+t},oe=function(e){var t=re(e)+"=",n=te(t);try{if(n)return JSON.parse(j.decode(n))}catch(e){return null}return null},se=function(e,t){try{return ee(re(e),j.encode(JSON.stringify(t)),ne),!0}catch(e){return!1}},ae=function(e){try{return ee(re(e),null,ne),!0}catch(e){return!1}},ue={reset:function(){ne={expirationDays:void 0,domain:void 0}},options:function(e){if(0===arguments.length)return ne;e=e||{},ne.expirationDays=e.expirationDays,ne.secure=e.secure;var t=$(e.domain)?"."+ie(window.location.href):e.domain,n=Math.random();ne.domain=t,se("amplitude_test",n);var i=oe("amplitude_test");return i&&i===n||(t=null),ae("amplitude_test"),ne.domain=t,ne},get:oe,set:se,remove:ae};if(function(){var e,t=new Date;try{return window.localStorage.setItem(t,t),e=window.localStorage.getItem(t)===String(t),window.localStorage.removeItem(t),e}catch(e){}return!1}())U=window.localStorage;else if(window.globalStorage)try{U=window.globalStorage[window.location.hostname]}catch(e){}else{var ce=document.createElement("div"),pe="localStorage";ce.style.display="none",document.getElementsByTagName("head")[0].appendChild(ce),ce.addBehavior&&(ce.addBehavior("#default#userdata"),U={length:0,setItem:function(e,t){ce.load(pe),ce.getAttribute(e)||this.length++,ce.setAttribute(e,t),ce.save(pe)},getItem:function(e){return ce.load(pe),ce.getAttribute(e)},removeItem:function(e){ce.load(pe),ce.getAttribute(e)&&this.length--,ce.removeAttribute(e),ce.save(pe)},clear:function(){ce.load(pe);for(var e,t=0;e=ce.XMLDocument.documentElement.attributes[t++];)ce.removeAttribute(e.name);ce.save(pe),this.length=0},key:function(e){return ce.load(pe),ce.XMLDocument.documentElement.attributes[e]}},ce.load(pe),U.length=ce.XMLDocument.documentElement.attributes.length)}U||(U={length:0,setItem:function(e,t){},getItem:function(e){},removeItem:function(e){},clear:function(){},key:function(e){}});var le=U,de=function(){this.storage=null};de.prototype._cookiesEnabled=function(){var e,t=String(new Date);try{return ue.set(n,t),e=ue.get(n)===t,ue.remove(n),e}catch(e){}return!1},de.prototype.getStorage=function(){if(null!==this.storage)return this.storage;if(this._cookiesEnabled())this.storage=ue;else{var n="amp_cookiestore_";this.storage={_options:{expirationDays:void 0,domain:void 0,secure:!1},reset:function(){this._options={expirationDays:void 0,domain:void 0,secure:!1}},options:function(e){return 0===arguments.length?this._options:(e=e||{},this._options.expirationDays=e.expirationDays||this._options.expirationDays,this._options.domain=e.domain||this._options.domain||window.location.hostname,this._options.secure=e.secure||!1)},get:function(e){try{return JSON.parse(le.getItem(n+e))}catch(e){}return null},set:function(e,t){try{return le.setItem(n+e,JSON.stringify(t)),!0}catch(e){}return!1},remove:function(e){try{le.removeItem(n+e)}catch(e){return!1}}}}return this.storage};var fe="$clearAll",he=function(){this.userPropertiesOperations={},this.properties=[]};he.prototype.add=function(e,t){return"number"===q(t)||"string"===q(t)?this._addOperation("$add",e,t):V.error("Unsupported type for value: "+q(t)+", expecting number or string"),this},he.prototype.append=function(e,t){return this._addOperation("$append",e,t),this},he.prototype.clearAll=function(){return 0<Object.keys(this.userPropertiesOperations).length?this.userPropertiesOperations.hasOwnProperty(fe)||V.error("Need to send $clearAll on its own Identify object without any other operations, skipping $clearAll"):this.userPropertiesOperations[fe]="-",this},he.prototype.prepend=function(e,t){return this._addOperation("$prepend",e,t),this},he.prototype.set=function(e,t){return this._addOperation("$set",e,t),this},he.prototype.setOnce=function(e,t){return this._addOperation("$setOnce",e,t),this},he.prototype.unset=function(e){return this._addOperation("$unset",e,"-"),this},he.prototype._addOperation=function(e,t,n){this.userPropertiesOperations.hasOwnProperty(fe)?V.error("This identify already contains a $clearAll operation, skipping operation "+e):-1===this.properties.indexOf(t)?(this.userPropertiesOperations.hasOwnProperty(e)||(this.userPropertiesOperations[e]={}),this.userPropertiesOperations[e][t]=n,this.properties.push(t)):V.error('User property "'+t+'" already used in this identify, skipping operation '+e)};var ge=e(function(s){!function(e){function l(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t,n,i,r,o){return l((s=l(l(t,e),l(i,o)))<<(a=r)|s>>>32-a,n);var s,a}function d(e,t,n,i,r,o,s){return a(t&n|~t&i,e,t,r,o,s)}function f(e,t,n,i,r,o,s){return a(t&i|n&~i,e,t,r,o,s)}function h(e,t,n,i,r,o,s){return a(t^n^i,e,t,r,o,s)}function g(e,t,n,i,r,o,s){return a(n^(t|~i),e,t,r,o,s)}function u(e,t){var n,i,r,o,s;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var a=1732584193,u=-271733879,c=-1732584194,p=271733878;for(n=0;n<e.length;n+=16)u=g(u=g(u=g(u=g(u=h(u=h(u=h(u=h(u=f(u=f(u=f(u=f(u=d(u=d(u=d(u=d(r=u,c=d(o=c,p=d(s=p,a=d(i=a,u,c,p,e[n],7,-680876936),u,c,e[n+1],12,-389564586),a,u,e[n+2],17,606105819),p,a,e[n+3],22,-1044525330),c=d(c,p=d(p,a=d(a,u,c,p,e[n+4],7,-176418897),u,c,e[n+5],12,1200080426),a,u,e[n+6],17,-1473231341),p,a,e[n+7],22,-45705983),c=d(c,p=d(p,a=d(a,u,c,p,e[n+8],7,1770035416),u,c,e[n+9],12,-1958414417),a,u,e[n+10],17,-42063),p,a,e[n+11],22,-1990404162),c=d(c,p=d(p,a=d(a,u,c,p,e[n+12],7,1804603682),u,c,e[n+13],12,-40341101),a,u,e[n+14],17,-1502002290),p,a,e[n+15],22,1236535329),c=f(c,p=f(p,a=f(a,u,c,p,e[n+1],5,-165796510),u,c,e[n+6],9,-1069501632),a,u,e[n+11],14,643717713),p,a,e[n],20,-373897302),c=f(c,p=f(p,a=f(a,u,c,p,e[n+5],5,-701558691),u,c,e[n+10],9,38016083),a,u,e[n+15],14,-660478335),p,a,e[n+4],20,-405537848),c=f(c,p=f(p,a=f(a,u,c,p,e[n+9],5,568446438),u,c,e[n+14],9,-1019803690),a,u,e[n+3],14,-187363961),p,a,e[n+8],20,1163531501),c=f(c,p=f(p,a=f(a,u,c,p,e[n+13],5,-1444681467),u,c,e[n+2],9,-51403784),a,u,e[n+7],14,1735328473),p,a,e[n+12],20,-1926607734),c=h(c,p=h(p,a=h(a,u,c,p,e[n+5],4,-378558),u,c,e[n+8],11,-2022574463),a,u,e[n+11],16,1839030562),p,a,e[n+14],23,-35309556),c=h(c,p=h(p,a=h(a,u,c,p,e[n+1],4,-1530992060),u,c,e[n+4],11,1272893353),a,u,e[n+7],16,-155497632),p,a,e[n+10],23,-1094730640),c=h(c,p=h(p,a=h(a,u,c,p,e[n+13],4,681279174),u,c,e[n],11,-358537222),a,u,e[n+3],16,-722521979),p,a,e[n+6],23,76029189),c=h(c,p=h(p,a=h(a,u,c,p,e[n+9],4,-640364487),u,c,e[n+12],11,-421815835),a,u,e[n+15],16,530742520),p,a,e[n+2],23,-995338651),c=g(c,p=g(p,a=g(a,u,c,p,e[n],6,-198630844),u,c,e[n+7],10,1126891415),a,u,e[n+14],15,-1416354905),p,a,e[n+5],21,-57434055),c=g(c,p=g(p,a=g(a,u,c,p,e[n+12],6,1700485571),u,c,e[n+3],10,-1894986606),a,u,e[n+10],15,-1051523),p,a,e[n+1],21,-2054922799),c=g(c,p=g(p,a=g(a,u,c,p,e[n+8],6,1873313359),u,c,e[n+15],10,-30611744),a,u,e[n+6],15,-1560198380),p,a,e[n+13],21,1309151649),c=g(c,p=g(p,a=g(a,u,c,p,e[n+4],6,-145523070),u,c,e[n+11],10,-1120210379),a,u,e[n+2],15,718787259),p,a,e[n+9],21,-343485551),a=l(a,i),u=l(u,r),c=l(c,o),p=l(p,s);return[a,u,c,p]}function c(e){var t,n="",i=32*e.length;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function p(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var i=8*e.length;for(t=0;t<i;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function i(e){var t,n,i="0123456789abcdef",r="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),r+=i.charAt(t>>>4&15)+i.charAt(15&t);return r}function n(e){return unescape(encodeURIComponent(e))}function r(e){return c(u(p(t=n(e)),8*t.length));var t}function o(e,t){return function(e,t){var n,i,r=p(e),o=[],s=[];for(o[15]=s[15]=void 0,16<r.length&&(r=u(r,8*e.length)),n=0;n<16;n+=1)o[n]=909522486^r[n],s[n]=1549556828^r[n];return i=u(o.concat(p(t)),512+8*t.length),c(u(s.concat(i),640))}(n(e),n(t))}function t(e,t,n){return t?n?o(t,e):i(o(t,e)):n?r(e):i(r(e))}s.exports?s.exports=t:e.md5=t}(u)}),ve=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})},ye=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var we=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,r=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var s in n=Object(arguments[o]))me.call(n,s)&&(r[s]=n[s]);if(ye){i=ye(n);for(var a=0;a<i.length;a++)_e.call(n,i[a])&&(r[i[a]]=n[i[a]])}}return r},be="%[a-f0-9]{2}";new RegExp(be,"gi"),new RegExp("("+be+")+","gi");function Ie(e,t){return t.encode?t.strict?ve(e):encodeURIComponent(e):e}var Se=function(i,r){!1===(r=we({encode:!0,strict:!0,arrayFormat:"none"},r)).sort&&(r.sort=function(){});var o=function(i){switch(i.arrayFormat){case"index":return function(e,t,n){return null===t?[Ie(e,i),"[",n,"]"].join(""):[Ie(e,i),"[",Ie(n,i),"]=",Ie(t,i)].join("")};case"bracket":return function(e,t){return null===t?Ie(e,i):[Ie(e,i),"[]=",Ie(t,i)].join("")};default:return function(e,t){return null===t?Ie(e,i):[Ie(e,i),"=",Ie(t,i)].join("")}}}(r);return i?Object.keys(i).sort(r.sort).map(function(t){var e=i[t];if(void 0===e)return"";if(null===e)return Ie(t,r);if(Array.isArray(e)){var n=[];return e.slice().forEach(function(e){void 0!==e&&n.push(o(t,e,n.length))}),n.join("&")}return Ie(t,r)+"="+Ie(e,r)}).filter(function(e){return 0<e.length}).join("&"):""},Oe=function(e,t){this.url=e,this.data=t||{}};Oe.prototype.send=function(e){if(!!window.XDomainRequest){var t=new window.XDomainRequest;t.open("POST",this.url,!0),t.onload=function(){e(200,t.responseText)},t.onerror=function(){"Request Entity Too Large"===t.responseText?e(413,t.responseText):e(500,t.responseText)},t.ontimeout=function(){},t.onprogress=function(){},t.send(Se(this.data))}else{var n=new XMLHttpRequest;n.open("POST",this.url,!0),n.onreadystatechange=function(){4===n.readyState&&e(n.status,n.responseText)},n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),n.send(Se(this.data))}};var Ee=function(){this._price=null,this._productId=null,this._quantity=1,this._revenueType=null,this._properties=null};Ee.prototype.setProductId=function(e){return"string"!==q(e)?V.error("Unsupported type for productId: "+q(e)+", expecting string"):$(e)?V.error("Invalid empty productId"):this._productId=e,this},Ee.prototype.setQuantity=function(e){return"number"!==q(e)?V.error("Unsupported type for quantity: "+q(e)+", expecting number"):this._quantity=parseInt(e),this},Ee.prototype.setPrice=function(e){return"number"!==q(e)?V.error("Unsupported type for price: "+q(e)+", expecting number"):this._price=e,this},Ee.prototype.setRevenueType=function(e){return"string"!==q(e)?V.error("Unsupported type for revenueType: "+q(e)+", expecting string"):this._revenueType=e,this},Ee.prototype.setEventProperties=function(e){return"object"!==q(e)?V.error("Unsupported type for eventProperties: "+q(e)+", expecting object"):this._properties=Y(e),this},Ee.prototype._isValidRevenue=function(){return"number"===q(this._price)||(V.error("Invalid revenue, need to set price field"),!1)},Ee.prototype._toJSONObject=function(){var e="object"===q(this._properties)?this._properties:{};return null!==this._productId&&(e[r]=this._productId),null!==this._quantity&&(e[o]=this._quantity),null!==this._price&&(e[s]=this._price),null!==this._revenueType&&(e[c]=this._revenueType),e};var Ne=e(function(S,O){!function(r,l){var d="function",f="undefined",h="object",e="model",t="name",n="type",i="vendor",o="version",s="architecture",a="console",u="mobile",c="tablet",p="smarttv",g="wearable",v={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.split(".")[0]:l}},y={rgx:function(){for(var e,t,n,i,r,o,s,a=0,u=arguments;a<u.length&&!o;){var c=u[a],p=u[a+1];if(typeof e===f)for(i in e={},p)p.hasOwnProperty(i)&&(typeof(r=p[i])===h?e[r[0]]=l:e[r]=l);for(t=n=0;t<c.length&&!o;)if(o=c[t++].exec(this.getUA()))for(i=0;i<p.length;i++)s=o[++n],typeof(r=p[i])===h&&0<r.length?2==r.length?typeof r[1]==d?e[r[0]]=r[1].call(this,s):e[r[0]]=r[1]:3==r.length?typeof r[1]!==d||r[1].exec&&r[1].test?e[r[0]]=s?s.replace(r[1],r[2]):l:e[r[0]]=s?r[1].call(this,s,r[2]):l:4==r.length&&(e[r[0]]=s?r[3].call(this,s.replace(r[1],r[2])):l):e[r]=s||l;a+=2}return e},str:function(e,t){for(var n in t)if(typeof t[n]===h&&0<t[n].length){for(var i=0;i<t[n].length;i++)if(v.has(t[n][i],e))return"?"===n?l:n}else if(v.has(t[n],e))return"?"===n?l:n;return e}},m={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},name:{"Opera Mobile":"Opera Mobi","IE Mobile":"IEMobile"}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},name:{"Windows Phone":"Windows Phone OS"}}}},_={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[t,o],[/(OPiOS)[\/\s]+([\w\.]+)/i],[[t,"Opera Mini"],o],[/\s(opr)\/([\w\.]+)/i],[[t,"Opera"],o],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i],[t,o],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[t,"IE"],o],[/(edge)\/((\d+)?[\w\.]+)/i],[t,o],[/(yabrowser)\/([\w\.]+)/i],[[t,"Yandex"],o],[/(comodo_dragon)\/([\w\.]+)/i],[[t,/_/g," "],o],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[t,"Chrome Mobile"],o],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(qqbrowser)[\/\s]?([\w\.]+)/i],[t,o],[/(uc\s?browser)[\/\s]?([\w\.]+)/i,/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,/JUC.+(ucweb)[\/\s]?([\w\.]+)/i],[[t,"UCBrowser"],o],[/(dolfin)\/([\w\.]+)/i],[[t,"Dolphin"],o],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[o,[t,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[o,[t,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[o,[t,"Facebook"]],[/fxios\/([\w\.-]+)/i],[o,[t,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[o,[t,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[o,t],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[t,[o,y.str,m.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[t,o],[/(blackberry)\\s?\/([\w\.]+)/i],[[t,"BlackBerry"],o],[/(navigator|netscape)\/([\w\.-]+)/i],[[t,"Netscape"],o],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[t,o]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[s,"amd64"]],[/(ia32(?=;))/i],[[s,v.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[s,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[s,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[s,/ower/,"",v.lowerize]],[/(sun4\w)[;\)]/i],[[s,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[s,v.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[e,i,[n,c]],[/applecoremedia\/[\w\.]+ \((ipad)/],[e,[i,"Apple"],[n,c]],[/(apple\s{0,1}tv)/i],[[e,"Apple TV"],[i,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[i,e,[n,c]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[e,[i,"Amazon"],[n,c]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[e,y.str,m.device.amazon.model],[i,"Amazon"],[n,u]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[e,i,[n,u]],[/\((ip[honed|\s\w*]+);/i],[e,[i,"Apple"],[n,u]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[i,e,[n,u]],[/\(bb10;\s(\w+)/i],[e,[i,"BlackBerry"],[n,u]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],[e,[i,"Asus"],[n,c]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[i,"Sony"],[e,"Xperia Tablet"],[n,c]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[[i,"Sony"],[e,"Xperia Phone"],[n,u]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[i,e,[n,a]],[/android.+;\s(shield)\sbuild/i],[e,[i,"Nvidia"],[n,a]],[/(playstation\s[34portablevi]+)/i],[e,[i,"Sony"],[n,a]],[/(sprint\s(\w+))/i],[[i,y.str,m.device.sprint.vendor],[e,y.str,m.device.sprint.model],[n,u]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[i,e,[n,c]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[i,[e,/_/g," "],[n,u]],[/(nexus\s9)/i],[e,[i,"HTC"],[n,c]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[e,[i,"Microsoft"],[n,a]],[/(kin\.[onetw]{3})/i],[[e,/\./g," "],[i,"Microsoft"],[n,u]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i,/(nexus\s[6])/i],[e,[i,"Motorola"],[n,u]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[e,[i,"Motorola"],[n,c]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[i,"Samsung"],e,[n,c]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[i,"Samsung"],e,[n,u]],[/(samsung);smarttv/i],[i,e,[n,p]],[/\(dtv[\);].+(aquos)/i],[e,[i,"Sharp"],[n,p]],[/sie-(\w+)*/i],[e,[i,"Siemens"],[n,u]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[i,"Nokia"],e,[n,u]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[e,[i,"Acer"],[n,c]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[i,"LG"],e,[n,c]],[/(lg) netcast\.tv/i],[i,e,[n,p]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[e,[i,"LG"],[n,u]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[e,[i,"Lenovo"],[n,c]],[/linux;.+((jolla));/i],[i,e,[n,u]],[/((pebble))app\/[\d\.]+\s/i],[i,e,[n,g]],[/android.+;\s(glass)\s\d/i],[e,[i,"Google"],[n,g]],[/android.+(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i],[[e,/_/g," "],[i,"Xiaomi"],[n,u]],[/\s(tablet)[;\/\s]/i,/\s(mobile)[;\/\s]/i],[[n,v.lowerize],i,e]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[o,[t,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[t,o],[/rv\:([\w\.]+).*(gecko)/i],[o,t]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[t,o],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[t,y.str,m.os.windows.name],[o,y.str,m.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[t,"Windows"],[o,y.str,m.os.windows.version]],[/\((bb)(10);/i],[[t,"BlackBerry"],o],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[t,o],[/(symbian\s?o?s?|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[t,"Symbian"],o],[/\((series40);/i],[t],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[t,"Firefox OS"],o],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[[t,"Linux"],o],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[t,"Chromium OS"],o],[/(sunos)\s?([\w\.]+\d)*/i],[[t,"Solaris"],o],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[[t,"Linux"],o],[/(iphone)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[t,"iPhone"],[o,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[t,"iPad"],[o,/_/g,"."]],[/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i],[[t,"iOS"],[o,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[t,"Mac"],[o,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[t,o]]},w=function(e,t){if(!(this instanceof w))return new w(e,t).getResult();var n=e||(r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),i=t?v.extend(_,t):_;return this.getBrowser=function(){var e=y.rgx.apply(this,i.browser);return e.major=v.major(e.version),e},this.getCPU=function(){return y.rgx.apply(this,i.cpu)},this.getDevice=function(){return y.rgx.apply(this,i.device)},this.getEngine=function(){return y.rgx.apply(this,i.engine)},this.getOS=function(){return y.rgx.apply(this,i.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};w.VERSION="0.7.10",w.BROWSER={NAME:t,MAJOR:"major",VERSION:o},w.CPU={ARCHITECTURE:s},w.DEVICE={MODEL:e,VENDOR:i,TYPE:n,CONSOLE:a,MOBILE:u,SMARTTV:p,TABLET:c,WEARABLE:g,EMBEDDED:"embedded"},w.ENGINE={NAME:t,VERSION:o},w.OS={NAME:t,VERSION:o},S.exports&&(O=S.exports=w),O.UAParser=w;var b=r.jQuery||r.Zepto;if(typeof b!==f){var I=new w;b.ua=I.getResult(),b.ua.get=function(){return I.getUA()},b.ua.set=function(e){I.setUA(e);var t=I.getResult();for(var n in t)b.ua[n]=t[n]}}}("object"==typeof window?window:u)}),xe=(Ne.UAParser,function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}),ke="4.6.0",Ae={apiEndpoint:"api.amplitude.com",batchEvents:!1,cookieExpiration:3650,cookieName:"amplitude_id",deviceIdFromUrlParam:!1,domain:"",eventUploadPeriodMillis:3e4,eventUploadThreshold:30,forceHttps:!0,includeGclid:!1,includeReferrer:!1,includeUtm:!1,language:{language:navigator&&(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage)||void 0}.language,logLevel:"WARN",optOut:!1,platform:"Web",savedMaxCount:1e3,saveEvents:!0,saveParamsReferrerOncePerSession:!0,secureCookie:!1,sessionTimeout:18e5,trackingOptions:{city:!0,country:!0,device_model:!0,dma:!0,ip_address:!0,language:!0,os_name:!0,os_version:!0,platform:!0,region:!0,version_name:!0},unsetParamsReferrerOnNewSession:!1,unsentKey:"amplitude_unsent",unsentIdentifyKey:"amplitude_unsent_identify",uploadBatchSize:100},Te=function(e){this._instanceName=$(e)?d:e.toLowerCase(),this._legacyStorageSuffix=this._instanceName===d?"":"_"+this._instanceName,this._unsentEvents=[],this._unsentIdentifys=[],this._ua=new Ne(navigator.userAgent).getResult(),this.options=P({},Ae,{trackingOptions:P({},Ae.trackingOptions)}),this.cookieStorage=(new de).getStorage(),this._q=[],this._sending=!1,this._updateScheduled=!1,this._eventId=0,this._identifyId=0,this._lastEventTime=null,this._newSession=!1,this._sequenceNumber=0,this._sessionId=null,this._userAgent=navigator&&navigator.userAgent||null};Te.prototype.Identify=he,Te.prototype.Revenue=Ee,Te.prototype.init=function(e,t,n,i){if("string"!==q(e)||$(e))V.error("Invalid apiKey. Please re-initialize with a valid apiKey");else try{this.options.apiKey=e,this._storageSuffix="_"+e+this._legacyStorageSuffix,je(this.options,n),"string"===q(this.options.logLevel)&&W(this.options.logLevel);var r=Be(this);if(this._apiPropertiesTrackingOptions=0<Object.keys(r).length?{tracking_options:r}:{},this.cookieStorage.options({expirationDays:this.options.cookieExpiration,domain:this.options.domain,secure:this.options.secureCookie}),this.options.domain=this.cookieStorage.options().domain,this._instanceName===d&&Ce(this),Pe(this),this.options.deviceId="object"===q(n)&&"string"===q(n.deviceId)&&!$(n.deviceId)&&n.deviceId||this.options.deviceIdFromUrlParam&&this._getDeviceIdFromUrlParam(this._getUrlParams())||this.options.deviceId||xe()+"R",this.options.userId="string"===q(t)&&!$(t)&&t||"number"===q(t)&&t.toString()||this.options.userId||null,this.options.saveEvents){this._unsentEvents=this._loadSavedUnsentEvents(this.options.unsentKey),this._unsentIdentifys=this._loadSavedUnsentEvents(this.options.unsentIdentifyKey);for(var o=0;o<this._unsentEvents.length;o++){var s=this._unsentEvents[o].event_properties,a=this._unsentEvents[o].groups;this._unsentEvents[o].event_properties=Y(s),this._unsentEvents[o].groups=Q(a)}for(var u=0;u<this._unsentIdentifys.length;u++){var c=this._unsentIdentifys[u].user_properties,p=this._unsentIdentifys[u].groups;this._unsentIdentifys[u].user_properties=Y(c),this._unsentIdentifys[u].groups=Q(p)}}var l=(new Date).getTime();(!this._sessionId||!this._lastEventTime||l-this._lastEventTime>this.options.sessionTimeout)&&(this.options.unsetParamsReferrerOnNewSession&&this._unsetUTMParams(),this._newSession=!0,this._sessionId=l,this.options.saveParamsReferrerOncePerSession&&this._trackParamsAndReferrer()),this.options.saveParamsReferrerOncePerSession||this._trackParamsAndReferrer(),this._lastEventTime=l,qe(this),this._sendEventsIfReady()}catch(e){V.error(e)}finally{"function"===q(i)&&i(this)}},Te.prototype._trackParamsAndReferrer=function(){this.options.includeUtm&&this._initUtmData(),this.options.includeReferrer&&this._saveReferrer(this._getReferrer()),this.options.includeGclid&&this._saveGclid(this._getUrlParams())};var je=function i(r,o){if("object"===q(o)){var e=function(e){if(r.hasOwnProperty(e)){var t=o[e],n=q(r[e]);Z(t,e+" option",n)&&("boolean"===n?r[e]=!!t:"string"===n&&!$(t)||"number"===n&&0<t?r[e]=t:"object"===n&&i(r[e],t))}};for(var t in o)o.hasOwnProperty(t)&&e(t)}};Te.prototype.runQueuedFunctions=function(){for(var e=0;e<this._q.length;e++){var t=this[this._q[e][0]];"function"===q(t)&&t.apply(this,this._q[e].slice(1))}this._q=[]},Te.prototype._apiKeySet=function(e){return!$(this.options.apiKey)||(V.error("Invalid apiKey. Please set a valid apiKey with init() before calling "+e),!1)},Te.prototype._loadSavedUnsentEvents=function(e){var t=this._getFromStorage(le,e),n=this._parseSavedUnsentEventsString(t,e),i=this._getFromStorageLegacy(le,e),r=this._parseSavedUnsentEventsString(i,e).concat(n);return this._removeFromLegacyStorage(le,e),this._setInStorage(le,e,JSON.stringify(r)),r},Te.prototype._removeFromLegacyStorage=function(e,t){e.removeItem(t+this._legacyStorageSuffix)},Te.prototype._parseSavedUnsentEventsString=function(e,t){if($(e))return[];if("string"===q(e))try{var n=JSON.parse(e);if("array"===q(n))return n}catch(e){}return V.error("Unable to load "+t+" events. Restart with a new empty queue."),[]},Te.prototype.isNewSession=function(){return this._newSession},Te.prototype.getSessionId=function(){return this._sessionId},Te.prototype.nextEventId=function(){return this._eventId++,this._eventId},Te.prototype.nextIdentifyId=function(){return this._identifyId++,this._identifyId},Te.prototype.nextSequenceNumber=function(){return this._sequenceNumber++,this._sequenceNumber},Te.prototype._unsentCount=function(){return this._unsentEvents.length+this._unsentIdentifys.length},Te.prototype._sendEventsIfReady=function(e){return 0!==this._unsentCount()&&(this.options.batchEvents?this._unsentCount()>=this.options.eventUploadThreshold?(this.sendEvents(e),!0):(this._updateScheduled||(this._updateScheduled=!0,setTimeout(function(){this._updateScheduled=!1,this.sendEvents()}.bind(this),this.options.eventUploadPeriodMillis)),!1):(this.sendEvents(e),!0))},Te.prototype._getFromStorage=function(e,t){return e.getItem(t+this._storageSuffix)},Te.prototype._getFromStorageLegacy=function(e,t){return e.getItem(t+this._legacyStorageSuffix)},Te.prototype._setInStorage=function(e,t,n){e.setItem(t+this._storageSuffix,n)};var Ce=function(e){var t=e.cookieStorage.get(e.options.cookieName+e._storageSuffix);if("object"!==q(t)&&!("object"===q(t=e.cookieStorage.get(e.options.cookieName+e._legacyStorageSuffix))&&t.deviceId&&t.sessionId&&t.lastEventTime)){var n=function(e){var t=le.getItem(e);return le.removeItem(e),t},i="string"===q(e.options.apiKey)&&"_"+e.options.apiKey.slice(0,6)||"",r=n(w+i),o=n(I+i),s=n(b+i);null!=s&&(s="true"===String(s));var a=parseInt(n(_)),u=parseInt(n(v)),c=parseInt(n(g)),p=parseInt(n(y)),l=parseInt(n(m)),d=function(e){return"object"===q(t)&&t[e]};e.options.deviceId=d("deviceId")||r,e.options.userId=d("userId")||o,e._sessionId=d("sessionId")||a||e._sessionId,e._lastEventTime=d("lastEventTime")||u||e._lastEventTime,e._eventId=d("eventId")||c||e._eventId,e._identifyId=d("identifyId")||p||e._identifyId,e._sequenceNumber=d("sequenceNumber")||l||e._sequenceNumber,e.options.optOut=s||!1,t&&void 0!==t.optOut&&null!==t.optOut&&(e.options.optOut="true"===String(t.optOut)),qe(e)}},Pe=function(e){var t=e.cookieStorage.get(e.options.cookieName+e._storageSuffix);if("object"===q(t))Re(e,t);else{var n=e.cookieStorage.get(e.options.cookieName+e._legacyStorageSuffix);"object"===q(n)&&(e.cookieStorage.remove(e.options.cookieName+e._legacyStorageSuffix),Re(e,n))}},Re=function(e,t){t.deviceId&&(e.options.deviceId=t.deviceId),t.userId&&(e.options.userId=t.userId),null!==t.optOut&&void 0!==t.optOut&&(e.options.optOut=t.optOut),t.sessionId&&(e._sessionId=parseInt(t.sessionId)),t.lastEventTime&&(e._lastEventTime=parseInt(t.lastEventTime)),t.eventId&&(e._eventId=parseInt(t.eventId)),t.identifyId&&(e._identifyId=parseInt(t.identifyId)),t.sequenceNumber&&(e._sequenceNumber=parseInt(t.sequenceNumber))},qe=function(e){e.cookieStorage.set(e.options.cookieName+e._storageSuffix,{deviceId:e.options.deviceId,userId:e.options.userId,optOut:e.options.optOut,sessionId:e._sessionId,lastEventTime:e._lastEventTime,eventId:e._eventId,identifyId:e._identifyId,sequenceNumber:e._sequenceNumber})};Te.prototype._initUtmData=function(e,t){e=e||this._getUrlParams(),t=t||this.cookieStorage.get("__utmz");var n,i,r,o,s,a,u,c,p,l,d,f=(i=e,r=(n=t)?"?"+n.split(".").slice(-1)[0].replace(/\|/g,"&"):"",s=(o=function(e,t,n,i){return X(e,t)||X(n,i)})(O,i,"utmcsr",r),a=o(E,i,"utmcmd",r),u=o(N,i,"utmccn",r),c=o(x,i,"utmctr",r),p=o(k,i,"utmcct",r),l={},(d=function(e,t){$(t)||(l[e]=t)})(O,s),d(E,a),d(N,u),d(x,c),d(k,p),l);Ue(this,f)},Te.prototype._unsetUTMParams=function(){var e=new he;e.unset(S),e.unset(O),e.unset(E),e.unset(N),e.unset(x),e.unset(k),this.identify(e)};var Ue=function(e,t){if("object"===q(t)&&0!==Object.keys(t).length){var n=new he;for(var i in t)t.hasOwnProperty(i)&&(n.setOnce("initial_"+i,t[i]),n.set(i,t[i]));e.identify(n)}};Te.prototype._getReferrer=function(){return document.referrer},Te.prototype._getUrlParams=function(){return location.search},Te.prototype._saveGclid=function(e){var t=X("gclid",e);$(t)||Ue(this,{gclid:t})},Te.prototype._getDeviceIdFromUrlParam=function(e){return X(l,e)},Te.prototype._getReferringDomain=function(e){if($(e))return null;var t=e.split("/");return 3<=t.length?t[2]:null},Te.prototype._saveReferrer=function(e){if(!$(e)){var t={referrer:e,referring_domain:this._getReferringDomain(e)};Ue(this,t)}},Te.prototype.saveEvents=function(){try{this._setInStorage(le,this.options.unsentKey,JSON.stringify(this._unsentEvents))}catch(e){}try{this._setInStorage(le,this.options.unsentIdentifyKey,JSON.stringify(this._unsentIdentifys))}catch(e){}},Te.prototype.setDomain=function(e){if(Z(e,"domain","string"))try{this.cookieStorage.options({domain:e}),this.options.domain=this.cookieStorage.options().domain,Pe(this),qe(this)}catch(e){V.error(e)}},Te.prototype.setUserId=function(e){try{this.options.userId=null!=e&&""+e||null,qe(this)}catch(e){V.error(e)}},Te.prototype.setGroup=function(e,t){if(this._apiKeySet("setGroup()")&&Z(e,"groupType","string")&&!$(e)){var n={};n[e]=t;var i=(new he).set(e,t);this._logEvent(f,null,null,i.userPropertiesOperations,n,null,null,null)}},Te.prototype.setOptOut=function(e){if(Z(e,"enable","boolean"))try{this.options.optOut=e,qe(this)}catch(e){V.error(e)}},Te.prototype.setSessionId=function(e){if(Z(e,"sessionId","number"))try{this._sessionId=e,qe(this)}catch(e){V.error(e)}},Te.prototype.resetSessionId=function(){this.setSessionId((new Date).getTime())},Te.prototype.regenerateDeviceId=function(){this.setDeviceId(xe()+"R")},Te.prototype.setDeviceId=function(e){if(Z(e,"deviceId","string"))try{$(e)||(this.options.deviceId=""+e,qe(this))}catch(e){V.error(e)}},Te.prototype.setUserProperties=function(e){if(this._apiKeySet("setUserProperties()")&&Z(e,"userProperties","object")){var t=H(Y(e));if(0!==Object.keys(t).length){var n=new he;for(var i in t)t.hasOwnProperty(i)&&n.set(i,t[i]);this.identify(n)}}},Te.prototype.clearUserProperties=function(){if(this._apiKeySet("clearUserProperties()")){var e=new he;e.clearAll(),this.identify(e)}};var De=function(e,t){for(var n=0;n<t._q.length;n++){var i=e[t._q[n][0]];"function"===q(i)&&i.apply(e,t._q[n].slice(1))}return e};Te.prototype.identify=function(e,t){if(this._apiKeySet("identify()"))if("object"===q(e)&&e.hasOwnProperty("_q")&&(e=De(new he,e)),e instanceof he){if(0<Object.keys(e.userPropertiesOperations).length)return this._logEvent(f,null,null,e.userPropertiesOperations,null,null,null,t);"function"===q(t)&&t(0,"No request sent",{reason:"No user property operations"})}else V.error("Invalid identify input type. Expected Identify object but saw "+q(e)),"function"===q(t)&&t(0,"No request sent",{reason:"Invalid identify input type"});else"function"===q(t)&&t(0,"No request sent",{reason:"API key is not set"})},Te.prototype.groupIdentify=function(e,t,n,i){var r,o,s;if(this._apiKeySet("groupIdentify()"))if(Z(e,"group_type","string")&&!$(e))if(null!=t)if("object"===q(n)&&n.hasOwnProperty("_q")&&(n=De(new he,n)),n instanceof he){if(0<Object.keys(n.userPropertiesOperations).length)return this._logEvent(h,null,null,null,(s=t,(o=e)in(r={})?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s,r),n.userPropertiesOperations,null,i);"function"===q(i)&&i(0,"No request sent",{reason:"No group property operations"})}else V.error("Invalid identify input type. Expected Identify object but saw "+q(n)),"function"===q(i)&&i(0,"No request sent",{reason:"Invalid identify input type"});else"function"===q(i)&&i(0,"No request sent",{reason:"Invalid group name"});else"function"===q(i)&&i(0,"No request sent",{reason:"Invalid group type"});else"function"===q(i)&&i(0,"No request sent",{reason:"API key is not set"})},Te.prototype.setVersionName=function(e){Z(e,"versionName","string")&&(this.options.versionName=e)},Te.prototype._logEvent=function(e,t,n,i,r,o,s,a){if(Pe(this),e)if(this.options.optOut)"function"===q(a)&&a(0,"No request sent",{reason:"optOut is set to true"});else try{var u;u=e===f||e===h?this.nextIdentifyId():this.nextEventId();var c=this.nextSequenceNumber(),p="number"===q(s)?s:(new Date).getTime();(!this._sessionId||!this._lastEventTime||p-this._lastEventTime>this.options.sessionTimeout)&&(this._sessionId=p),this._lastEventTime=p,qe(this),i=i||{};var l=P({},this._apiPropertiesTrackingOptions);n=P({},n||{},l),t=t||{},r=r||{},o=o||{};var d={device_id:this.options.deviceId,user_id:this.options.userId,timestamp:p,event_id:u,session_id:this._sessionId||-1,event_type:e,version_name:Me(this,"version_name")&&this.options.versionName||null,platform:Me(this,"platform")?this.options.platform:null,os_name:Me(this,"os_name")&&this._ua.browser.name||null,os_version:Me(this,"os_version")&&this._ua.browser.major||null,device_model:Me(this,"device_model")&&this._ua.os.name||null,language:Me(this,"language")?this.options.language:null,api_properties:n,event_properties:H(Y(t)),user_properties:H(Y(i)),uuid:xe(),library:{name:"amplitude-js",version:ke},sequence_number:c,groups:H(Q(r)),group_properties:H(Y(o)),user_agent:this._userAgent};return e===f||e===h?(this._unsentIdentifys.push(d),this._limitEventsQueued(this._unsentIdentifys)):(this._unsentEvents.push(d),this._limitEventsQueued(this._unsentEvents)),this.options.saveEvents&&this.saveEvents(),this._sendEventsIfReady(a)||"function"!==q(a)||a(0,"No request sent",{reason:"No events to send or upload queued"}),u}catch(e){V.error(e)}else"function"===q(a)&&a(0,"No request sent",{reason:"Missing eventType"})};var Me=function(e,t){return!!e.options.trackingOptions[t]},Be=function(e){for(var t=["city","country","dma","ip_address","region"],n={},i=0;i<t.length;i++){var r=t[i];Me(e,r)||(n[r]=!1)}return n};Te.prototype._limitEventsQueued=function(e){e.length>this.options.savedMaxCount&&e.splice(0,e.length-this.options.savedMaxCount)},Te.prototype.logEvent=function(e,t,n){return this.logEventWithTimestamp(e,t,null,n)},Te.prototype.logEventWithTimestamp=function(e,t,n,i){return this._apiKeySet("logEvent()")?Z(e,"eventType","string")?$(e)?("function"===q(i)&&i(0,"No request sent",{reason:"Missing eventType"}),-1):this._logEvent(e,t,null,null,null,null,n,i):("function"===q(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===q(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)},Te.prototype.logEventWithGroups=function(e,t,n,i){return this._apiKeySet("logEventWithGroups()")?Z(e,"eventType","string")?this._logEvent(e,t,null,null,n,null,null,i):("function"===q(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===q(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)};var Le=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};Te.prototype.logRevenueV2=function(e){if(this._apiKeySet("logRevenueV2()"))if("object"===q(e)&&e.hasOwnProperty("_q")&&(e=De(new Ee,e)),e instanceof Ee){if(e&&e._isValidRevenue())return this.logEvent(i,e._toJSONObject())}else V.error("Invalid revenue input type. Expected Revenue object but saw "+q(e))},Te.prototype.logRevenue=function(e,t,n){return this._apiKeySet("logRevenue()")&&Le(e)&&(void 0===t||Le(t))?this._logEvent(i,{},{productId:n,special:"revenue_amount",quantity:t||1,price:e},null,null,null,null,null):-1},Te.prototype.removeEvents=function(e,t){Fe(this,"_unsentEvents",e),Fe(this,"_unsentIdentifys",t)};var Fe=function(e,t,n){if(!(n<0)){for(var i=[],r=0;r<e[t].length;r++)e[t][r].event_id>n&&i.push(e[t][r]);e[t]=i}};Te.prototype.sendEvents=function(n){if(this._apiKeySet("sendEvents()"))if(this.options.optOut)"function"===q(n)&&n(0,"No request sent",{reason:"optOut is set to true"});else if(0!==this._unsentCount())if(this._sending)"function"===q(n)&&n(0,"No request sent",{reason:"Request already in progress"});else{this._sending=!0;var e=(this.options.forceHttps?"https":"https:"===window.location.protocol?"https":"http")+"://"+this.options.apiEndpoint+"/",i=Math.min(this._unsentCount(),this.options.uploadBatchSize),t=this._mergeEventsAndIdentifys(i),r=t.maxEventId,o=t.maxIdentifyId,s=JSON.stringify(t.eventsToSend),a=(new Date).getTime(),u={client:this.options.apiKey,e:s,v:p,upload_time:a,checksum:ge(p+this.options.apiKey+s+a)},c=this;new Oe(e,u).send(function(e,t){c._sending=!1;try{200===e&&"success"===t?(c.removeEvents(r,o),c.options.saveEvents&&c.saveEvents(),c._sendEventsIfReady(n)||"function"!==q(n)||n(e,t)):413===e?(1===c.options.uploadBatchSize&&c.removeEvents(r,o),c.options.uploadBatchSize=Math.ceil(i/2),c.sendEvents(n)):"function"===q(n)&&n(e,t)}catch(e){}})}else"function"===q(n)&&n(0,"No request sent",{reason:"No events to send"});else"function"===q(n)&&n(0,"No request sent",{reason:"API key not set"})},Te.prototype._mergeEventsAndIdentifys=function(e){for(var t=[],n=0,i=-1,r=0,o=-1;t.length<e;){var s,a=r>=this._unsentIdentifys.length,u=n>=this._unsentEvents.length;if(u&&a){V.error("Merging Events and Identifys, less events and identifys than expected");break}a?i=(s=this._unsentEvents[n++]).event_id:u?o=(s=this._unsentIdentifys[r++]).event_id:!("sequence_number"in this._unsentEvents[n])||this._unsentEvents[n].sequence_number<this._unsentIdentifys[r].sequence_number?i=(s=this._unsentEvents[n++]).event_id:o=(s=this._unsentIdentifys[r++]).event_id,t.push(s)}return{eventsToSend:t,maxEventId:i,maxIdentifyId:o}},Te.prototype.setGlobalUserProperties=function(e){this.setUserProperties(e)},Te.prototype.__VERSION__=ke;var Ke=function(){this.options=P({},Ae),this._q=[],this._instances={}};Ke.prototype.Identify=he,Ke.prototype.Revenue=Ee,Ke.prototype.getInstance=function(e){e=$(e)?d:e.toLowerCase();var t=this._instances[e];return void 0===t&&(t=new Te(e),this._instances[e]=t),t},Ke.prototype.runQueuedFunctions=function(){for(var e=0;e<this._q.length;e++){var t=this[this._q[e][0]];"function"===q(t)&&t.apply(this,this._q[e].slice(1))}for(var n in this._q=[],this._instances)this._instances.hasOwnProperty(n)&&this._instances[n].runQueuedFunctions()},Ke.prototype.init=function(e,t,n,i){this.getInstance().init(e,t,n,function(e){this.options=e.options,"function"===q(i)&&i(e)}.bind(this))},Ke.prototype.isNewSession=function(){return this.getInstance().isNewSession()},Ke.prototype.getSessionId=function(){return this.getInstance().getSessionId()},Ke.prototype.nextEventId=function(){return this.getInstance().nextEventId()},Ke.prototype.nextIdentifyId=function(){return this.getInstance().nextIdentifyId()},Ke.prototype.nextSequenceNumber=function(){return this.getInstance().nextSequenceNumber()},Ke.prototype.saveEvents=function(){this.getInstance().saveEvents()},Ke.prototype.setDomain=function(e){this.getInstance().setDomain(e)},Ke.prototype.setUserId=function(e){this.getInstance().setUserId(e)},Ke.prototype.setGroup=function(e,t){this.getInstance().setGroup(e,t)},Ke.prototype.setOptOut=function(e){this.getInstance().setOptOut(e)},Ke.prototype.regenerateDeviceId=function(){this.getInstance().regenerateDeviceId()},Ke.prototype.setDeviceId=function(e){this.getInstance().setDeviceId(e)},Ke.prototype.setUserProperties=function(e){this.getInstance().setUserProperties(e)},Ke.prototype.clearUserProperties=function(){this.getInstance().clearUserProperties()},Ke.prototype.identify=function(e,t){this.getInstance().identify(e,t)},Ke.prototype.setVersionName=function(e){this.getInstance().setVersionName(e)},Ke.prototype.logEvent=function(e,t,n){return this.getInstance().logEvent(e,t,n)},Ke.prototype.logEventWithGroups=function(e,t,n,i){return this.getInstance().logEventWithGroups(e,t,n,i)},Ke.prototype.logRevenueV2=function(e){return this.getInstance().logRevenueV2(e)},Ke.prototype.logRevenue=function(e,t,n){return this.getInstance().logRevenue(e,t,n)},Ke.prototype.removeEvents=function(e,t){this.getInstance().removeEvents(e,t)},Ke.prototype.sendEvents=function(e){this.getInstance().sendEvents(e)},Ke.prototype.setGlobalUserProperties=function(e){this.getInstance().setUserProperties(e)},Ke.prototype.__VERSION__=ke;var ze=window.amplitude||{},Ge=new Ke;for(var Je in Ge._q=ze._q||[],ze._iq)ze._iq.hasOwnProperty(Je)&&(Ge.getInstance(Je)._q=ze._iq[Je]._q||[]);return Ge});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.amplitude=t()}(this,function(){"use strict";var u="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(e,t){return e(t={exports:{}},t.exports),t.exports}e(function(s,a){(function(){var M={function:!0,object:!0},e=M.object&&a&&!a.nodeType&&a,B=M[typeof window]&&window||this,t=e&&M.object&&s&&!s.nodeType&&"object"==typeof u&&u;function L(e,u){e||(e=B.Object()),u||(u=B.Object());var c=e.Number||B.Number,p=e.String||B.String,t=e.Object||B.Object,l=e.Date||B.Date,n=e.SyntaxError||B.SyntaxError,S=e.TypeError||B.TypeError,i=e.Math||B.Math,r=e.JSON||B.JSON;"object"==typeof r&&r&&(u.stringify=r.stringify,u.parse=r.parse);var O,E,N,o=t.prototype,x=o.toString,d=new l(-0xc782b5b800cec);try{d=-109252==d.getUTCFullYear()&&0===d.getUTCMonth()&&1===d.getUTCDate()&&10==d.getUTCHours()&&37==d.getUTCMinutes()&&6==d.getUTCSeconds()&&708==d.getUTCMilliseconds()}catch(e){}function f(e){if(f[e]!==N)return f[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=f("json-stringify")&&f("json-parse");else{var n,i='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=u.stringify,o="function"==typeof r&&d;if(o){(n=function(){return 1}).toJSON=n;try{o="0"===r(0)&&"0"===r(new c)&&'""'==r(new p)&&r(x)===N&&r(N)===N&&r()===N&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([N])&&"null"==r(null)&&"[null,null,null]"==r([N,x,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==i&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==r(new l(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==r(new l(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new l(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==r(new l(-1))}catch(e){o=!1}}t=o}if("json-parse"==e){var s=u.parse;if("function"==typeof s)try{if(0===s("0")&&!s(!1)){var a=5==(n=s(i)).a.length&&1===n.a[0];if(a){try{a=!s('"\t"')}catch(e){}if(a)try{a=1!==s("01")}catch(e){}if(a)try{a=1!==s("1.")}catch(e){}}}}catch(e){a=!1}t=a}}return f[e]=!!t}if(!f("json")){var h="[object Function]",k="[object Number]",A="[object String]",T="[object Array]",a=f("bug-string-char-index");if(!d)var j=i.floor,s=[0,31,59,90,120,151,181,212,243,273,304,334],C=function(e,t){return s[t]+365*(e-1970)+j((e-1969+(t=+(1<t)))/4)-j((e-1901+t)/100)+j((e-1601+t)/400)};if((O=o.hasOwnProperty)||(O=function(e){var n,t={};return O=(t.__proto__=null,t.__proto__={toString:1},t).toString!=x?function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(n=t.constructor,function(e){var t=(this.constructor||n).prototype;return e in this&&!(e in t&&this[e]===t[e])}),t=null,O.call(this,e)}),E=function(e,t){var n,s,i,r=0;for(i in(n=function(){this.valueOf=0}).prototype.valueOf=0,s=new n)O.call(s,i)&&r++;return n=s=null,(E=r?2==r?function(e,t){var n,i={},r=x.call(e)==h;for(n in e)r&&"prototype"==n||O.call(i,n)||!(i[n]=1)||!O.call(e,n)||t(n)}:function(e,t){var n,i,r=x.call(e)==h;for(n in e)r&&"prototype"==n||!O.call(e,n)||(i="constructor"===n)||t(n);(i||O.call(e,n="constructor"))&&t(n)}:(s=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],function(e,t){var n,i,r=x.call(e)==h,o=!r&&"function"!=typeof e.constructor&&M[typeof e.hasOwnProperty]&&e.hasOwnProperty||O;for(n in e)r&&"prototype"==n||!o.call(e,n)||t(n);for(i=s.length;n=s[--i];o.call(e,n)&&t(n));}))(e,t)},!f("json-stringify")){var g={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},P=function(e,t){return("000000"+(t||0)).slice(-e)},R=function(e){for(var t='"',n=0,i=e.length,r=!a||10<i,o=r&&(a?e.split(""):e);n<i;n++){var s=e.charCodeAt(n);switch(s){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=g[s];break;default:if(s<32){t+="\\u00"+P(2,s.toString(16));break}t+=r?o[n]:e.charAt(n)}}return t+'"'},q=function(e,t,n,i,r,o,s){var a,u,c,p,l,d,f,h,g,v,y,m,_,w,b,I;try{a=t[e]}catch(e){}if("object"==typeof a&&a)if("[object Date]"!=(u=x.call(a))||O.call(a,"toJSON"))"function"==typeof a.toJSON&&(u!=k&&u!=A&&u!=T||O.call(a,"toJSON"))&&(a=a.toJSON(e));else if(-1/0<a&&a<1/0){if(C){for(l=j(a/864e5),c=j(l/365.2425)+1970-1;C(c+1,0)<=l;c++);for(p=j((l-C(c,0))/30.42);C(c,p+1)<=l;p++);l=1+l-C(c,p),f=j((d=(a%864e5+864e5)%864e5)/36e5)%24,h=j(d/6e4)%60,g=j(d/1e3)%60,v=d%1e3}else c=a.getUTCFullYear(),p=a.getUTCMonth(),l=a.getUTCDate(),f=a.getUTCHours(),h=a.getUTCMinutes(),g=a.getUTCSeconds(),v=a.getUTCMilliseconds();a=(c<=0||1e4<=c?(c<0?"-":"+")+P(6,c<0?-c:c):P(4,c))+"-"+P(2,p+1)+"-"+P(2,l)+"T"+P(2,f)+":"+P(2,h)+":"+P(2,g)+"."+P(3,v)+"Z"}else a=null;if(n&&(a=n.call(t,e,a)),null===a)return"null";if("[object Boolean]"==(u=x.call(a)))return""+a;if(u==k)return-1/0<a&&a<1/0?""+a:"null";if(u==A)return R(""+a);if("object"==typeof a){for(w=s.length;w--;)if(s[w]===a)throw S();if(s.push(a),y=[],b=o,o+=r,u==T){for(_=0,w=a.length;_<w;_++)m=q(_,a,n,i,r,o,s),y.push(m===N?"null":m);I=y.length?r?"[\n"+o+y.join(",\n"+o)+"\n"+b+"]":"["+y.join(",")+"]":"[]"}else E(i||a,function(e){var t=q(e,a,n,i,r,o,s);t!==N&&y.push(R(e)+":"+(r?" ":"")+t)}),I=y.length?r?"{\n"+o+y.join(",\n"+o)+"\n"+b+"}":"{"+y.join(",")+"}":"{}";return s.pop(),I}};u.stringify=function(e,t,n){var i,r,o,s;if(M[typeof t]&&t)if((s=x.call(t))==h)r=t;else if(s==T){o={};for(var a,u=0,c=t.length;u<c;a=t[u++],((s=x.call(a))==A||s==k)&&(o[a]=1));}if(n)if((s=x.call(n))==k){if(0<(n-=n%1))for(i="",10<n&&(n=10);i.length<n;i+=" ");}else s==A&&(i=n.length<=10?n:n.slice(0,10));return q("",((a={})[""]=e,a),r,o,i,"",[])}}if(!f("json-parse")){var v,y,m=p.fromCharCode,_={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},w=function(){throw v=y=null,n()},b=function(){for(var e,t,n,i,r,o=y,s=o.length;v<s;)switch(r=o.charCodeAt(v)){case 9:case 10:case 13:case 32:v++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=a?o.charAt(v):o[v],v++,e;case 34:for(e="@",v++;v<s;)if((r=o.charCodeAt(v))<32)w();else if(92==r)switch(r=o.charCodeAt(++v)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=_[r],v++;break;case 117:for(t=++v,n=v+4;v<n;v++)48<=(r=o.charCodeAt(v))&&r<=57||97<=r&&r<=102||65<=r&&r<=70||w();e+=m("0x"+o.slice(t,v));break;default:w()}else{if(34==r)break;for(r=o.charCodeAt(v),t=v;32<=r&&92!=r&&34!=r;)r=o.charCodeAt(++v);e+=o.slice(t,v)}if(34==o.charCodeAt(v))return v++,e;w();default:if(t=v,45==r&&(i=!0,r=o.charCodeAt(++v)),48<=r&&r<=57){for(48==r&&(48<=(r=o.charCodeAt(v+1))&&r<=57)&&w(),i=!1;v<s&&(48<=(r=o.charCodeAt(v))&&r<=57);v++);if(46==o.charCodeAt(v)){for(n=++v;n<s&&(48<=(r=o.charCodeAt(n))&&r<=57);n++);n==v&&w(),v=n}if(101==(r=o.charCodeAt(v))||69==r){for(43!=(r=o.charCodeAt(++v))&&45!=r||v++,n=v;n<s&&(48<=(r=o.charCodeAt(n))&&r<=57);n++);n==v&&w(),v=n}return+o.slice(t,v)}if(i&&w(),"true"==o.slice(v,v+4))return v+=4,!0;if("false"==o.slice(v,v+5))return v+=5,!1;if("null"==o.slice(v,v+4))return v+=4,null;w()}return"$"},I=function(e){var t,n;if("$"==e&&w(),"string"==typeof e){if("@"==(a?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=b());n||(n=!0))n&&(","==e?"]"==(e=b())&&w():w()),","==e&&w(),t.push(I(e));return t}if("{"==e){for(t={};"}"!=(e=b());n||(n=!0))n&&(","==e?"}"==(e=b())&&w():w()),","!=e&&"string"==typeof e&&"@"==(a?e.charAt(0):e[0])&&":"==b()||w(),t[e.slice(1)]=I(b());return t}w()}return e},U=function(e,t,n){var i=D(e,t,n);i===N?delete e[t]:e[t]=i},D=function(e,t,n){var i,r=e[t];if("object"==typeof r&&r)if(x.call(r)==T)for(i=r.length;i--;)U(r,i,n);else E(r,function(e){U(r,e,n)});return n.call(e,t,r)};u.parse=function(e,t){var n,i;return v=0,y=""+e,n=I(b()),"$"!=b()&&w(),v=y=null,t&&x.call(t)==h?D(((i={})[""]=n,i),"",t):n}}}return u.runInContext=L,u}if(!t||t.global!==t&&t.window!==t&&t.self!==t||(B=t),e)L(B,e);else{var n=B.JSON,i=B.JSON3,r=!1,o=L(B,B.JSON3={noConflict:function(){return r||(r=!0,B.JSON=n,B.JSON3=i,n=i=null),o}});B.JSON={parse:o.parse,stringify:o.stringify}}}).call(u)});var r="$default_instance",p=2,t=4096,a=1e3,f="$identify",h="$groupidentify",g="amplitude_lastEventId",v="amplitude_lastEventTime",y="amplitude_lastIdentifyId",m="amplitude_lastSequenceNumber",_="amplitude_sessionId",w="amplitude_deviceId",b="amplitude_optOut",I="amplitude_userId",n="amplitude_cookie_test",i="revenue_amount",o="$productId",s="$quantity",c="$price",l="$revenueType",d="amp_device_id",S="referrer",O="utm_source",E="utm_medium",N="utm_campaign",x="utm_term",k="utm_content",A=function(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):(127<i&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(63&i|128))}return t},T=function(e){for(var t="",n=0,i=0,r=0,o=0;n<e.length;)(i=e.charCodeAt(n))<128?(t+=String.fromCharCode(i),n++):191<i&&i<224?(r=e.charCodeAt(n+1),t+=String.fromCharCode((31&i)<<6|63&r),n+=2):(r=e.charCodeAt(n+1),o=e.charCodeAt(n+2),t+=String.fromCharCode((15&i)<<12|(63&r)<<6|63&o),n+=3);return t},j={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){try{if(window.btoa&&window.atob)return window.btoa(unescape(encodeURIComponent(e)))}catch(e){}return j._encode(e)},_encode:function(e){var t,n,i,r,o,s,a,u="",c=0;for(e=A(e);c<e.length;)r=(t=e.charCodeAt(c++))>>2,o=(3&t)<<4|(n=e.charCodeAt(c++))>>4,s=(15&n)<<2|(i=e.charCodeAt(c++))>>6,a=63&i,isNaN(n)?s=a=64:isNaN(i)&&(a=64),u=u+j._keyStr.charAt(r)+j._keyStr.charAt(o)+j._keyStr.charAt(s)+j._keyStr.charAt(a);return u},decode:function(e){try{if(window.btoa&&window.atob)return decodeURIComponent(escape(window.atob(e)))}catch(e){}return j._decode(e)},_decode:function(e){var t,n,i,r,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)t=j._keyStr.indexOf(e.charAt(u++))<<2|(r=j._keyStr.indexOf(e.charAt(u++)))>>4,n=(15&r)<<4|(o=j._keyStr.indexOf(e.charAt(u++)))>>2,i=(3&o)<<6|(s=j._keyStr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(i));return a=T(a)}},C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},R=Object.prototype.toString;function q(e){switch(R.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)?"buffer":void 0===(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e))?"undefined":C(e)}var U,D={DISABLE:0,ERROR:1,WARN:2,INFO:3},M=D.WARN,B={error:function(e){M>=D.ERROR&&L(e)},warn:function(e){M>=D.WARN&&L(e)},info:function(e){M>=D.INFO&&L(e)}},L=function(e){try{console.log("[Amplitude] "+e)}catch(e){}},J=function(e){return"string"===q(e)&&e.length>t?e.substring(0,t):e},F=function(e){var t=q(e);if("object"!==t)return B.error("Error: invalid properties format. Expecting Javascript object, received "+t+", ignoring"),{};if(Object.keys(e).length>a)return B.error("Error: too many properties (more than 1000), ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=i,o=q(r);"string"!==o&&(r=String(r),B.warn("WARNING: Non-string property key, received type "+o+', coercing to string "'+r+'"'));var s=z(r,e[i]);null!==s&&(n[r]=s)}return n},K=["null","nan","undefined","function","arguments","regexp","element"],z=function e(t,n){var i=q(n);if(-1!==K.indexOf(i))B.warn('WARNING: Property key "'+t+'" with invalid value type '+i+", ignoring"),n=null;else if("error"===i)n=String(n),B.warn('WARNING: Property key "'+t+'" with value type error, coercing to '+n);else if("array"===i){for(var r=[],o=0;o<n.length;o++){var s=n[o],a=q(s);"array"!==a&&"object"!==a?r.push(e(t,s)):B.warn("WARNING: Cannot have "+a+" nested in an array property value, skipping")}n=r}else"object"===i&&(n=F(n));return n},G=function(e,t){var n=q(t);if("string"===n)return t;if("date"===n||"number"===n||"boolean"===n)return t=String(t),B.warn("WARNING: Non-string groupName, received type "+n+', coercing to string "'+t+'"'),t;if("array"===n){for(var i=[],r=0;r<t.length;r++){var o=t[r],s=q(o);"array"!==s&&"object"!==s?"string"===s?i.push(o):"date"!==s&&"number"!==s&&"boolean"!==s||(o=String(o),B.warn("WARNING: Non-string groupName, received type "+s+', coercing to string "'+o+'"'),i.push(o)):B.warn("WARNING: Skipping nested "+s+" in array groupName")}return i}B.warn("WARNING: Non-string groupName, received type "+n+". Please use strings or array of strings for groupName")},W=function(e){D.hasOwnProperty(e)&&(M=D[e])},V=B,$=function(e){return!e||0===e.length},X=function(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?void 0:decodeURIComponent(n[1].replace(/\+/g," "))},H=function e(t){if("array"===q(t))for(var n=0;n<t.length;n++)t[n]=e(t[n]);else if("object"===q(t))for(var i in t)t.hasOwnProperty(i)&&(t[i]=e(t[i]));else t=J(t);return t},Q=function(e){var t=q(e);if("object"!==t)return B.error("Error: invalid groups format. Expecting Javascript object, received "+t+", ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=i,o=q(r);"string"!==o&&(r=String(r),B.warn("WARNING: Non-string groupType, received type "+o+', coercing to string "'+r+'"'));var s=G(r,e[i]);null!==s&&(n[r]=s)}return n},Z=function(e,t,n){return q(e)===n||(B.error("Invalid "+t+" input type. Expected "+n+" but received "+q(e)),!1)},Y=F,ee=function(e,t,n){var i=null!==t?n.expirationDays:-1;if(i){var r=new Date;r.setTime(r.getTime()+24*i*60*60*1e3),i=r}var o=e+"="+t;i&&(o+="; expires="+i.toUTCString()),o+="; path=/",n.domain&&(o+="; domain="+n.domain),n.secure&&(o+="; Secure"),document.cookie=o},te=function(e){try{for(var t=document.cookie.split(";"),n=null,i=0;i<t.length;i++){for(var r=t[i];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e)){n=r.substring(e.length,r.length);break}}return n}catch(e){return null}},ne={expirationDays:void 0,domain:void 0},ie=function(e){var t,n,i=(t=e,(n=document.createElement("a")).href=t,n.hostname||location.hostname).split("."),r=i[i.length-1],o=[];if(4===i.length&&r===parseInt(r,10))return o;if(i.length<=1)return o;for(var s=i.length-2;0<=s;--s)o.push(i.slice(s).join("."));for(var a=0;a<o.length;++a){var u="__tld_test__",c=o[a],p={domain:"."+c};if(ee(u,1,p),te(u))return ee(u,null,p),c}return""},re=function(e){var t="";return ne.domain&&(t="."===ne.domain.charAt(0)?ne.domain.substring(1):ne.domain),e+t},oe=function(e){var t=re(e)+"=",n=te(t);try{if(n)return JSON.parse(j.decode(n))}catch(e){return null}return null},se=function(e,t){try{return ee(re(e),j.encode(JSON.stringify(t)),ne),!0}catch(e){return!1}},ae=function(e){try{return ee(re(e),null,ne),!0}catch(e){return!1}},ue={reset:function(){ne={expirationDays:void 0,domain:void 0}},options:function(e){if(0===arguments.length)return ne;e=e||{},ne.expirationDays=e.expirationDays,ne.secure=e.secure;var t=$(e.domain)?"."+ie(window.location.href):e.domain,n=Math.random();ne.domain=t,se("amplitude_test",n);var i=oe("amplitude_test");return i&&i===n||(t=null),ae("amplitude_test"),ne.domain=t,ne},get:oe,set:se,remove:ae};if(function(){var e,t=new Date;try{return window.localStorage.setItem(t,t),e=window.localStorage.getItem(t)===String(t),window.localStorage.removeItem(t),e}catch(e){}return!1}())U=window.localStorage;else if(window.globalStorage)try{U=window.globalStorage[window.location.hostname]}catch(e){}else if("undefined"!=typeof document){var ce=document.createElement("div"),pe="localStorage";ce.style.display="none",document.getElementsByTagName("head")[0].appendChild(ce),ce.addBehavior&&(ce.addBehavior("#default#userdata"),U={length:0,setItem:function(e,t){ce.load(pe),ce.getAttribute(e)||this.length++,ce.setAttribute(e,t),ce.save(pe)},getItem:function(e){return ce.load(pe),ce.getAttribute(e)},removeItem:function(e){ce.load(pe),ce.getAttribute(e)&&this.length--,ce.removeAttribute(e),ce.save(pe)},clear:function(){ce.load(pe);for(var e,t=0;e=ce.XMLDocument.documentElement.attributes[t++];)ce.removeAttribute(e.name);ce.save(pe),this.length=0},key:function(e){return ce.load(pe),ce.XMLDocument.documentElement.attributes[e]}},ce.load(pe),U.length=ce.XMLDocument.documentElement.attributes.length)}U||(U={length:0,setItem:function(e,t){},getItem:function(e){},removeItem:function(e){},clear:function(){},key:function(e){}});var le=U,de=function(){this.storage=null};de.prototype._cookiesEnabled=function(){var e,t=String(new Date);try{return ue.set(n,t),e=ue.get(n)===t,ue.remove(n),e}catch(e){}return!1},de.prototype.getStorage=function(){if(null!==this.storage)return this.storage;if(this._cookiesEnabled())this.storage=ue;else{var n="amp_cookiestore_";this.storage={_options:{expirationDays:void 0,domain:void 0,secure:!1},reset:function(){this._options={expirationDays:void 0,domain:void 0,secure:!1}},options:function(e){return 0===arguments.length||(e=e||{},this._options.expirationDays=e.expirationDays||this._options.expirationDays,this._options.domain=e.domain||this._options.domain||window.location&&window.location.hostname,this._options.secure=e.secure||!1),this._options},get:function(e){try{return JSON.parse(le.getItem(n+e))}catch(e){}return null},set:function(e,t){try{return le.setItem(n+e,JSON.stringify(t)),!0}catch(e){}return!1},remove:function(e){try{le.removeItem(n+e)}catch(e){return!1}}}}return this.storage};var fe="$clearAll",he=function(){this.userPropertiesOperations={},this.properties=[]};he.prototype.add=function(e,t){return"number"===q(t)||"string"===q(t)?this._addOperation("$add",e,t):V.error("Unsupported type for value: "+q(t)+", expecting number or string"),this},he.prototype.append=function(e,t){return this._addOperation("$append",e,t),this},he.prototype.clearAll=function(){return 0<Object.keys(this.userPropertiesOperations).length?this.userPropertiesOperations.hasOwnProperty(fe)||V.error("Need to send $clearAll on its own Identify object without any other operations, skipping $clearAll"):this.userPropertiesOperations[fe]="-",this},he.prototype.prepend=function(e,t){return this._addOperation("$prepend",e,t),this},he.prototype.set=function(e,t){return this._addOperation("$set",e,t),this},he.prototype.setOnce=function(e,t){return this._addOperation("$setOnce",e,t),this},he.prototype.unset=function(e){return this._addOperation("$unset",e,"-"),this},he.prototype._addOperation=function(e,t,n){this.userPropertiesOperations.hasOwnProperty(fe)?V.error("This identify already contains a $clearAll operation, skipping operation "+e):-1===this.properties.indexOf(t)?(this.userPropertiesOperations.hasOwnProperty(e)||(this.userPropertiesOperations[e]={}),this.userPropertiesOperations[e][t]=n,this.properties.push(t)):V.error('User property "'+t+'" already used in this identify, skipping operation '+e)};var ge=e(function(s){!function(e){function l(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t,n,i,r,o){return l((s=l(l(t,e),l(i,o)))<<(a=r)|s>>>32-a,n);var s,a}function d(e,t,n,i,r,o,s){return a(t&n|~t&i,e,t,r,o,s)}function f(e,t,n,i,r,o,s){return a(t&i|n&~i,e,t,r,o,s)}function h(e,t,n,i,r,o,s){return a(t^n^i,e,t,r,o,s)}function g(e,t,n,i,r,o,s){return a(n^(t|~i),e,t,r,o,s)}function u(e,t){var n,i,r,o,s;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var a=1732584193,u=-271733879,c=-1732584194,p=271733878;for(n=0;n<e.length;n+=16)u=g(u=g(u=g(u=g(u=h(u=h(u=h(u=h(u=f(u=f(u=f(u=f(u=d(u=d(u=d(u=d(r=u,c=d(o=c,p=d(s=p,a=d(i=a,u,c,p,e[n],7,-680876936),u,c,e[n+1],12,-389564586),a,u,e[n+2],17,606105819),p,a,e[n+3],22,-1044525330),c=d(c,p=d(p,a=d(a,u,c,p,e[n+4],7,-176418897),u,c,e[n+5],12,1200080426),a,u,e[n+6],17,-1473231341),p,a,e[n+7],22,-45705983),c=d(c,p=d(p,a=d(a,u,c,p,e[n+8],7,1770035416),u,c,e[n+9],12,-1958414417),a,u,e[n+10],17,-42063),p,a,e[n+11],22,-1990404162),c=d(c,p=d(p,a=d(a,u,c,p,e[n+12],7,1804603682),u,c,e[n+13],12,-40341101),a,u,e[n+14],17,-1502002290),p,a,e[n+15],22,1236535329),c=f(c,p=f(p,a=f(a,u,c,p,e[n+1],5,-165796510),u,c,e[n+6],9,-1069501632),a,u,e[n+11],14,643717713),p,a,e[n],20,-373897302),c=f(c,p=f(p,a=f(a,u,c,p,e[n+5],5,-701558691),u,c,e[n+10],9,38016083),a,u,e[n+15],14,-660478335),p,a,e[n+4],20,-405537848),c=f(c,p=f(p,a=f(a,u,c,p,e[n+9],5,568446438),u,c,e[n+14],9,-1019803690),a,u,e[n+3],14,-187363961),p,a,e[n+8],20,1163531501),c=f(c,p=f(p,a=f(a,u,c,p,e[n+13],5,-1444681467),u,c,e[n+2],9,-51403784),a,u,e[n+7],14,1735328473),p,a,e[n+12],20,-1926607734),c=h(c,p=h(p,a=h(a,u,c,p,e[n+5],4,-378558),u,c,e[n+8],11,-2022574463),a,u,e[n+11],16,1839030562),p,a,e[n+14],23,-35309556),c=h(c,p=h(p,a=h(a,u,c,p,e[n+1],4,-1530992060),u,c,e[n+4],11,1272893353),a,u,e[n+7],16,-155497632),p,a,e[n+10],23,-1094730640),c=h(c,p=h(p,a=h(a,u,c,p,e[n+13],4,681279174),u,c,e[n],11,-358537222),a,u,e[n+3],16,-722521979),p,a,e[n+6],23,76029189),c=h(c,p=h(p,a=h(a,u,c,p,e[n+9],4,-640364487),u,c,e[n+12],11,-421815835),a,u,e[n+15],16,530742520),p,a,e[n+2],23,-995338651),c=g(c,p=g(p,a=g(a,u,c,p,e[n],6,-198630844),u,c,e[n+7],10,1126891415),a,u,e[n+14],15,-1416354905),p,a,e[n+5],21,-57434055),c=g(c,p=g(p,a=g(a,u,c,p,e[n+12],6,1700485571),u,c,e[n+3],10,-1894986606),a,u,e[n+10],15,-1051523),p,a,e[n+1],21,-2054922799),c=g(c,p=g(p,a=g(a,u,c,p,e[n+8],6,1873313359),u,c,e[n+15],10,-30611744),a,u,e[n+6],15,-1560198380),p,a,e[n+13],21,1309151649),c=g(c,p=g(p,a=g(a,u,c,p,e[n+4],6,-145523070),u,c,e[n+11],10,-1120210379),a,u,e[n+2],15,718787259),p,a,e[n+9],21,-343485551),a=l(a,i),u=l(u,r),c=l(c,o),p=l(p,s);return[a,u,c,p]}function c(e){var t,n="",i=32*e.length;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function p(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var i=8*e.length;for(t=0;t<i;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function i(e){var t,n,i="0123456789abcdef",r="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),r+=i.charAt(t>>>4&15)+i.charAt(15&t);return r}function n(e){return unescape(encodeURIComponent(e))}function r(e){return c(u(p(t=n(e)),8*t.length));var t}function o(e,t){return function(e,t){var n,i,r=p(e),o=[],s=[];for(o[15]=s[15]=void 0,16<r.length&&(r=u(r,8*e.length)),n=0;n<16;n+=1)o[n]=909522486^r[n],s[n]=1549556828^r[n];return i=u(o.concat(p(t)),512+8*t.length),c(u(s.concat(i),640))}(n(e),n(t))}function t(e,t,n){return t?n?o(t,e):i(o(t,e)):n?r(e):i(r(e))}s.exports?s.exports=t:e.md5=t}(u)}),ve=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})},ye=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var we=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,r=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var s in n=Object(arguments[o]))me.call(n,s)&&(r[s]=n[s]);if(ye){i=ye(n);for(var a=0;a<i.length;a++)_e.call(n,i[a])&&(r[i[a]]=n[i[a]])}}return r},be="%[a-f0-9]{2}";new RegExp(be,"gi"),new RegExp("("+be+")+","gi");function Ie(e,t){return t.encode?t.strict?ve(e):encodeURIComponent(e):e}var Se=function(i,r){!1===(r=we({encode:!0,strict:!0,arrayFormat:"none"},r)).sort&&(r.sort=function(){});var o=function(i){switch(i.arrayFormat){case"index":return function(e,t,n){return null===t?[Ie(e,i),"[",n,"]"].join(""):[Ie(e,i),"[",Ie(n,i),"]=",Ie(t,i)].join("")};case"bracket":return function(e,t){return null===t?Ie(e,i):[Ie(e,i),"[]=",Ie(t,i)].join("")};default:return function(e,t){return null===t?Ie(e,i):[Ie(e,i),"=",Ie(t,i)].join("")}}}(r);return i?Object.keys(i).sort(r.sort).map(function(t){var e=i[t];if(void 0===e)return"";if(null===e)return Ie(t,r);if(Array.isArray(e)){var n=[];return e.slice().forEach(function(e){void 0!==e&&n.push(o(t,e,n.length))}),n.join("&")}return Ie(t,r)+"="+Ie(e,r)}).filter(function(e){return 0<e.length}).join("&"):""},Oe=function(e,t){this.url=e,this.data=t||{}};Oe.prototype.send=function(e){if(!!window.XDomainRequest){var t=new window.XDomainRequest;t.open("POST",this.url,!0),t.onload=function(){e(200,t.responseText)},t.onerror=function(){"Request Entity Too Large"===t.responseText?e(413,t.responseText):e(500,t.responseText)},t.ontimeout=function(){},t.onprogress=function(){},t.send(Se(this.data))}else{var n=new XMLHttpRequest;n.open("POST",this.url,!0),n.onreadystatechange=function(){4===n.readyState&&e(n.status,n.responseText)},n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),n.send(Se(this.data))}};var Ee=function(){this._price=null,this._productId=null,this._quantity=1,this._revenueType=null,this._properties=null};Ee.prototype.setProductId=function(e){return"string"!==q(e)?V.error("Unsupported type for productId: "+q(e)+", expecting string"):$(e)?V.error("Invalid empty productId"):this._productId=e,this},Ee.prototype.setQuantity=function(e){return"number"!==q(e)?V.error("Unsupported type for quantity: "+q(e)+", expecting number"):this._quantity=parseInt(e),this},Ee.prototype.setPrice=function(e){return"number"!==q(e)?V.error("Unsupported type for price: "+q(e)+", expecting number"):this._price=e,this},Ee.prototype.setRevenueType=function(e){return"string"!==q(e)?V.error("Unsupported type for revenueType: "+q(e)+", expecting string"):this._revenueType=e,this},Ee.prototype.setEventProperties=function(e){return"object"!==q(e)?V.error("Unsupported type for eventProperties: "+q(e)+", expecting object"):this._properties=Y(e),this},Ee.prototype._isValidRevenue=function(){return"number"===q(this._price)||(V.error("Invalid revenue, need to set price field"),!1)},Ee.prototype._toJSONObject=function(){var e="object"===q(this._properties)?this._properties:{};return null!==this._productId&&(e[o]=this._productId),null!==this._quantity&&(e[s]=this._quantity),null!==this._price&&(e[c]=this._price),null!==this._revenueType&&(e[l]=this._revenueType),e};var Ne=e(function(S,O){!function(r,l){var d="function",f="undefined",h="object",e="model",t="name",n="type",i="vendor",o="version",s="architecture",a="console",u="mobile",c="tablet",p="smarttv",g="wearable",v={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.split(".")[0]:l}},y={rgx:function(){for(var e,t,n,i,r,o,s,a=0,u=arguments;a<u.length&&!o;){var c=u[a],p=u[a+1];if(typeof e===f)for(i in e={},p)p.hasOwnProperty(i)&&(typeof(r=p[i])===h?e[r[0]]=l:e[r]=l);for(t=n=0;t<c.length&&!o;)if(o=c[t++].exec(this.getUA()))for(i=0;i<p.length;i++)s=o[++n],typeof(r=p[i])===h&&0<r.length?2==r.length?typeof r[1]==d?e[r[0]]=r[1].call(this,s):e[r[0]]=r[1]:3==r.length?typeof r[1]!==d||r[1].exec&&r[1].test?e[r[0]]=s?s.replace(r[1],r[2]):l:e[r[0]]=s?r[1].call(this,s,r[2]):l:4==r.length&&(e[r[0]]=s?r[3].call(this,s.replace(r[1],r[2])):l):e[r]=s||l;a+=2}return e},str:function(e,t){for(var n in t)if(typeof t[n]===h&&0<t[n].length){for(var i=0;i<t[n].length;i++)if(v.has(t[n][i],e))return"?"===n?l:n}else if(v.has(t[n],e))return"?"===n?l:n;return e}},m={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},name:{"Opera Mobile":"Opera Mobi","IE Mobile":"IEMobile"}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},name:{"Windows Phone":"Windows Phone OS"}}}},_={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[t,o],[/(OPiOS)[\/\s]+([\w\.]+)/i],[[t,"Opera Mini"],o],[/\s(opr)\/([\w\.]+)/i],[[t,"Opera"],o],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i],[t,o],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[t,"IE"],o],[/(edge)\/((\d+)?[\w\.]+)/i],[t,o],[/(yabrowser)\/([\w\.]+)/i],[[t,"Yandex"],o],[/(comodo_dragon)\/([\w\.]+)/i],[[t,/_/g," "],o],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[t,"Chrome Mobile"],o],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(qqbrowser)[\/\s]?([\w\.]+)/i],[t,o],[/(uc\s?browser)[\/\s]?([\w\.]+)/i,/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,/JUC.+(ucweb)[\/\s]?([\w\.]+)/i],[[t,"UCBrowser"],o],[/(dolfin)\/([\w\.]+)/i],[[t,"Dolphin"],o],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[o,[t,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[o,[t,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[o,[t,"Facebook"]],[/fxios\/([\w\.-]+)/i],[o,[t,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[o,[t,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[o,t],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[t,[o,y.str,m.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[t,o],[/(blackberry)\\s?\/([\w\.]+)/i],[[t,"BlackBerry"],o],[/(navigator|netscape)\/([\w\.-]+)/i],[[t,"Netscape"],o],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[t,o]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[s,"amd64"]],[/(ia32(?=;))/i],[[s,v.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[s,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[s,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[s,/ower/,"",v.lowerize]],[/(sun4\w)[;\)]/i],[[s,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[s,v.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[e,i,[n,c]],[/applecoremedia\/[\w\.]+ \((ipad)/],[e,[i,"Apple"],[n,c]],[/(apple\s{0,1}tv)/i],[[e,"Apple TV"],[i,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[i,e,[n,c]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[e,[i,"Amazon"],[n,c]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[e,y.str,m.device.amazon.model],[i,"Amazon"],[n,u]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[e,i,[n,u]],[/\((ip[honed|\s\w*]+);/i],[e,[i,"Apple"],[n,u]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[i,e,[n,u]],[/\(bb10;\s(\w+)/i],[e,[i,"BlackBerry"],[n,u]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],[e,[i,"Asus"],[n,c]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[i,"Sony"],[e,"Xperia Tablet"],[n,c]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[[i,"Sony"],[e,"Xperia Phone"],[n,u]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[i,e,[n,a]],[/android.+;\s(shield)\sbuild/i],[e,[i,"Nvidia"],[n,a]],[/(playstation\s[34portablevi]+)/i],[e,[i,"Sony"],[n,a]],[/(sprint\s(\w+))/i],[[i,y.str,m.device.sprint.vendor],[e,y.str,m.device.sprint.model],[n,u]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[i,e,[n,c]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[i,[e,/_/g," "],[n,u]],[/(nexus\s9)/i],[e,[i,"HTC"],[n,c]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[e,[i,"Microsoft"],[n,a]],[/(kin\.[onetw]{3})/i],[[e,/\./g," "],[i,"Microsoft"],[n,u]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i,/(nexus\s[6])/i],[e,[i,"Motorola"],[n,u]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[e,[i,"Motorola"],[n,c]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[i,"Samsung"],e,[n,c]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[i,"Samsung"],e,[n,u]],[/(samsung);smarttv/i],[i,e,[n,p]],[/\(dtv[\);].+(aquos)/i],[e,[i,"Sharp"],[n,p]],[/sie-(\w+)*/i],[e,[i,"Siemens"],[n,u]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[i,"Nokia"],e,[n,u]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[e,[i,"Acer"],[n,c]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[i,"LG"],e,[n,c]],[/(lg) netcast\.tv/i],[i,e,[n,p]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[e,[i,"LG"],[n,u]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[e,[i,"Lenovo"],[n,c]],[/linux;.+((jolla));/i],[i,e,[n,u]],[/((pebble))app\/[\d\.]+\s/i],[i,e,[n,g]],[/android.+;\s(glass)\s\d/i],[e,[i,"Google"],[n,g]],[/android.+(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i],[[e,/_/g," "],[i,"Xiaomi"],[n,u]],[/\s(tablet)[;\/\s]/i,/\s(mobile)[;\/\s]/i],[[n,v.lowerize],i,e]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[o,[t,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[t,o],[/rv\:([\w\.]+).*(gecko)/i],[o,t]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[t,o],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[t,y.str,m.os.windows.name],[o,y.str,m.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[t,"Windows"],[o,y.str,m.os.windows.version]],[/\((bb)(10);/i],[[t,"BlackBerry"],o],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[t,o],[/(symbian\s?o?s?|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[t,"Symbian"],o],[/\((series40);/i],[t],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[t,"Firefox OS"],o],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[[t,"Linux"],o],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[t,"Chromium OS"],o],[/(sunos)\s?([\w\.]+\d)*/i],[[t,"Solaris"],o],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[[t,"Linux"],o],[/(iphone)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[t,"iPhone"],[o,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[t,"iPad"],[o,/_/g,"."]],[/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i],[[t,"iOS"],[o,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[t,"Mac"],[o,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[t,o]]},w=function(e,t){if(!(this instanceof w))return new w(e,t).getResult();var n=e||(r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),i=t?v.extend(_,t):_;return this.getBrowser=function(){var e=y.rgx.apply(this,i.browser);return e.major=v.major(e.version),e},this.getCPU=function(){return y.rgx.apply(this,i.cpu)},this.getDevice=function(){return y.rgx.apply(this,i.device)},this.getEngine=function(){return y.rgx.apply(this,i.engine)},this.getOS=function(){return y.rgx.apply(this,i.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};w.VERSION="0.7.10",w.BROWSER={NAME:t,MAJOR:"major",VERSION:o},w.CPU={ARCHITECTURE:s},w.DEVICE={MODEL:e,VENDOR:i,TYPE:n,CONSOLE:a,MOBILE:u,SMARTTV:p,TABLET:c,WEARABLE:g,EMBEDDED:"embedded"},w.ENGINE={NAME:t,VERSION:o},w.OS={NAME:t,VERSION:o},S.exports&&(O=S.exports=w),O.UAParser=w;var b=r.jQuery||r.Zepto;if(typeof b!==f){var I=new w;b.ua=I.getResult(),b.ua.get=function(){return I.getUA()},b.ua.set=function(e){I.setUA(e);var t=I.getResult();for(var n in t)b.ua[n]=t[n]}}}("object"==typeof window?window:u)}),xe=(Ne.UAParser,function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}),ke="4.7.0-react-native",Ae={apiEndpoint:"api.amplitude.com",batchEvents:!1,cookieExpiration:3650,cookieName:"amplitude_id",deviceIdFromUrlParam:!1,domain:"",eventUploadPeriodMillis:3e4,eventUploadThreshold:30,forceHttps:!0,includeGclid:!1,includeReferrer:!1,includeUtm:!1,language:{language:navigator&&(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage)||void 0}.language,logLevel:"WARN",optOut:!1,platform:"Web",savedMaxCount:1e3,saveEvents:!0,saveParamsReferrerOncePerSession:!0,secureCookie:!1,sessionTimeout:18e5,trackingOptions:{city:!0,country:!0,device_model:!0,dma:!0,ip_address:!0,language:!0,os_name:!0,os_version:!0,platform:!0,region:!0,version_name:!0},unsetParamsReferrerOnNewSession:!1,unsentKey:"amplitude_unsent",unsentIdentifyKey:"amplitude_unsent_identify",uploadBatchSize:100},Te=void 0;if(window.navigator&&"ReactNative"===window.navigator.product){var je=require("react-native");Te=je.AsyncStorage}var Ce=function(e){this._instanceName=$(e)?r:e.toLowerCase(),this._legacyStorageSuffix=this._instanceName===r?"":"_"+this._instanceName,this._unsentEvents=[],this._unsentIdentifys=[],this._ua=new Ne(navigator.userAgent).getResult(),this.options=P({},Ae,{trackingOptions:P({},Ae.trackingOptions)}),this.cookieStorage=(new de).getStorage(),this._q=[],this._sending=!1,this._updateScheduled=!1,this._eventId=0,this._identifyId=0,this._lastEventTime=null,this._newSession=!1,this._sequenceNumber=0,this._sessionId=null,this._userAgent=navigator&&navigator.userAgent||null};Ce.prototype.Identify=he,Ce.prototype.Revenue=Ee,Ce.prototype.init=function(e,a,u,t){var c=this;if("string"!==q(e)||$(e))V.error("Invalid apiKey. Please re-initialize with a valid apiKey");else try{this.options.apiKey=e,this._storageSuffix="_"+e+this._legacyStorageSuffix,Pe(this.options,u),"string"===q(this.options.logLevel)&&W(this.options.logLevel);var n=Je(this);this._apiPropertiesTrackingOptions=0<Object.keys(n).length?{tracking_options:n}:{},this.cookieStorage.options({expirationDays:this.options.cookieExpiration,domain:this.options.domain,secure:this.options.secureCookie}),this.options.domain=this.cookieStorage.options().domain,this._instanceName===r&&Re(this),qe(this),this._pendingReadStorage=!0;var i=function(){if(c.options.deviceId="object"===q(u)&&"string"===q(u.deviceId)&&!$(u.deviceId)&&u.deviceId||c.options.deviceIdFromUrlParam&&c._getDeviceIdFromUrlParam(c._getUrlParams())||c.options.deviceId||xe()+"R",c.options.userId="string"===q(a)&&!$(a)&&a||"number"===q(a)&&a.toString()||c.options.userId||null,c.options.saveEvents){c._unsentEvents=c._loadSavedUnsentEvents(c.options.unsentKey),c._unsentIdentifys=c._loadSavedUnsentEvents(c.options.unsentIdentifyKey);for(var e=0;e<c._unsentEvents.length;e++){var t=c._unsentEvents[e].event_properties,n=c._unsentEvents[e].groups;c._unsentEvents[e].event_properties=Y(t),c._unsentEvents[e].groups=Q(n)}for(var i=0;i<c._unsentIdentifys.length;i++){var r=c._unsentIdentifys[i].user_properties,o=c._unsentIdentifys[i].groups;c._unsentIdentifys[i].user_properties=Y(r),c._unsentIdentifys[i].groups=Q(o)}}var s=(new Date).getTime();c._lastEventTime=s,De(c),(!c._sessionId||!c._lastEventTime||s-c._lastEventTime>c.options.sessionTimeout)&&(c.options.unsetParamsReferrerOnNewSession&&c._unsetUTMParams(),c._newSession=!0,c._sessionId=s,c.options.saveParamsReferrerOncePerSession&&c._trackParamsAndReferrer()),c.options.saveParamsReferrerOncePerSession||c._trackParamsAndReferrer(),c._pendingReadStorage=!1};Te?Te.getItem(this._storageSuffix).then(function(e){var t=JSON.parse(e);Ue(c,t),i()}):i(),this._sendEventsIfReady()}catch(e){V.error(e)}finally{"function"===q(t)&&t(this)}},Ce.prototype._trackParamsAndReferrer=function(){this.options.includeUtm&&this._initUtmData(),this.options.includeReferrer&&this._saveReferrer(this._getReferrer()),this.options.includeGclid&&this._saveGclid(this._getUrlParams())};var Pe=function i(r,o){if("object"===q(o)){var e=function(e){if(r.hasOwnProperty(e)){var t=o[e],n=q(r[e]);Z(t,e+" option",n)&&("boolean"===n?r[e]=!!t:"string"===n&&!$(t)||"number"===n&&0<t?r[e]=t:"object"===n&&i(r[e],t))}};for(var t in o)o.hasOwnProperty(t)&&e(t)}};Ce.prototype.runQueuedFunctions=function(){for(var e=0;e<this._q.length;e++){var t=this[this._q[e][0]];"function"===q(t)&&t.apply(this,this._q[e].slice(1))}this._q=[]},Ce.prototype._apiKeySet=function(e){return!$(this.options.apiKey)||(V.error("Invalid apiKey. Please set a valid apiKey with init() before calling "+e),!1)},Ce.prototype._loadSavedUnsentEvents=function(e){var t=this._getFromStorage(le,e),n=this._parseSavedUnsentEventsString(t,e),i=this._getFromStorageLegacy(le,e),r=this._parseSavedUnsentEventsString(i,e).concat(n);return this._removeFromLegacyStorage(le,e),this._setInStorage(le,e,JSON.stringify(r)),r},Ce.prototype._removeFromLegacyStorage=function(e,t){e.removeItem(t+this._legacyStorageSuffix)},Ce.prototype._parseSavedUnsentEventsString=function(e,t){if($(e))return[];if("string"===q(e))try{var n=JSON.parse(e);if("array"===q(n))return n}catch(e){}return V.error("Unable to load "+t+" events. Restart with a new empty queue."),[]},Ce.prototype.isNewSession=function(){return this._newSession},Ce.prototype.getSessionId=function(){return this._sessionId},Ce.prototype.nextEventId=function(){return this._eventId++,this._eventId},Ce.prototype.nextIdentifyId=function(){return this._identifyId++,this._identifyId},Ce.prototype.nextSequenceNumber=function(){return this._sequenceNumber++,this._sequenceNumber},Ce.prototype._unsentCount=function(){return this._unsentEvents.length+this._unsentIdentifys.length},Ce.prototype._sendEventsIfReady=function(e){return 0!==this._unsentCount()&&(this.options.batchEvents?this._unsentCount()>=this.options.eventUploadThreshold?(this.sendEvents(e),!0):(this._updateScheduled||(this._updateScheduled=!0,setTimeout(function(){this._updateScheduled=!1,this.sendEvents()}.bind(this),this.options.eventUploadPeriodMillis)),!1):(this.sendEvents(e),!0))},Ce.prototype._getFromStorage=function(e,t){return e.getItem(t+this._storageSuffix)},Ce.prototype._getFromStorageLegacy=function(e,t){return e.getItem(t+this._legacyStorageSuffix)},Ce.prototype._setInStorage=function(e,t,n){e.setItem(t+this._storageSuffix,n)};var Re=function(e){var t=e.cookieStorage.get(e.options.cookieName+e._storageSuffix);if("object"!==q(t)&&!("object"===q(t=e.cookieStorage.get(e.options.cookieName+e._legacyStorageSuffix))&&t.deviceId&&t.sessionId&&t.lastEventTime)){var n=function(e){var t=le.getItem(e);return le.removeItem(e),t},i="string"===q(e.options.apiKey)&&"_"+e.options.apiKey.slice(0,6)||"",r=n(w+i),o=n(I+i),s=n(b+i);null!=s&&(s="true"===String(s));var a=parseInt(n(_)),u=parseInt(n(v)),c=parseInt(n(g)),p=parseInt(n(y)),l=parseInt(n(m)),d=function(e){return"object"===q(t)&&t[e]};e.options.deviceId=d("deviceId")||r,e.options.userId=d("userId")||o,e._sessionId=d("sessionId")||a||e._sessionId,e._lastEventTime=d("lastEventTime")||u||e._lastEventTime,e._eventId=d("eventId")||c||e._eventId,e._identifyId=d("identifyId")||p||e._identifyId,e._sequenceNumber=d("sequenceNumber")||l||e._sequenceNumber,e.options.optOut=s||!1,t&&void 0!==t.optOut&&null!==t.optOut&&(e.options.optOut="true"===String(t.optOut)),De(e)}},qe=function(e){var t=e.cookieStorage.get(e.options.cookieName+e._storageSuffix);if("object"===q(t))Ue(e,t);else{var n=e.cookieStorage.get(e.options.cookieName+e._legacyStorageSuffix);"object"===q(n)&&(e.cookieStorage.remove(e.options.cookieName+e._legacyStorageSuffix),Ue(e,n))}},Ue=function(e,t){t.deviceId&&(e.options.deviceId=t.deviceId),t.userId&&(e.options.userId=t.userId),null!==t.optOut&&void 0!==t.optOut&&(e.options.optOut=t.optOut),t.sessionId&&(e._sessionId=parseInt(t.sessionId)),t.lastEventTime&&(e._lastEventTime=parseInt(t.lastEventTime)),t.eventId&&(e._eventId=parseInt(t.eventId)),t.identifyId&&(e._identifyId=parseInt(t.identifyId)),t.sequenceNumber&&(e._sequenceNumber=parseInt(t.sequenceNumber))},De=function(e){var t={deviceId:e.options.deviceId,userId:e.options.userId,optOut:e.options.optOut,sessionId:e._sessionId,lastEventTime:e._lastEventTime,eventId:e._eventId,identifyId:e._identifyId,sequenceNumber:e._sequenceNumber};Te&&Te.setItem(e._storageSuffix,JSON.stringify(t)),e.cookieStorage.set(e.options.cookieName+e._storageSuffix,t)};Ce.prototype._initUtmData=function(e,t){e=e||this._getUrlParams(),t=t||this.cookieStorage.get("__utmz");var n,i,r,o,s,a,u,c,p,l,d,f=(i=e,r=(n=t)?"?"+n.split(".").slice(-1)[0].replace(/\|/g,"&"):"",s=(o=function(e,t,n,i){return X(e,t)||X(n,i)})(O,i,"utmcsr",r),a=o(E,i,"utmcmd",r),u=o(N,i,"utmccn",r),c=o(x,i,"utmctr",r),p=o(k,i,"utmcct",r),l={},(d=function(e,t){$(t)||(l[e]=t)})(O,s),d(E,a),d(N,u),d(x,c),d(k,p),l);Me(this,f)},Ce.prototype._unsetUTMParams=function(){var e=new he;e.unset(S),e.unset(O),e.unset(E),e.unset(N),e.unset(x),e.unset(k),this.identify(e)};var Me=function(e,t){if("object"===q(t)&&0!==Object.keys(t).length){var n=new he;for(var i in t)t.hasOwnProperty(i)&&(n.setOnce("initial_"+i,t[i]),n.set(i,t[i]));e.identify(n)}};Ce.prototype._getReferrer=function(){return document.referrer},Ce.prototype._getUrlParams=function(){return location.search},Ce.prototype._saveGclid=function(e){var t=X("gclid",e);$(t)||Me(this,{gclid:t})},Ce.prototype._getDeviceIdFromUrlParam=function(e){return X(d,e)},Ce.prototype._getReferringDomain=function(e){if($(e))return null;var t=e.split("/");return 3<=t.length?t[2]:null},Ce.prototype._saveReferrer=function(e){if(!$(e)){var t={referrer:e,referring_domain:this._getReferringDomain(e)};Me(this,t)}},Ce.prototype.saveEvents=function(){try{this._setInStorage(le,this.options.unsentKey,JSON.stringify(this._unsentEvents))}catch(e){}try{this._setInStorage(le,this.options.unsentIdentifyKey,JSON.stringify(this._unsentIdentifys))}catch(e){}},Ce.prototype.setDomain=function(e){if(Z(e,"domain","string"))try{this.cookieStorage.options({domain:e}),this.options.domain=this.cookieStorage.options().domain,qe(this),De(this)}catch(e){V.error(e)}},Ce.prototype.setUserId=function(e){try{this.options.userId=null!=e&&""+e||null,De(this)}catch(e){V.error(e)}},Ce.prototype.setGroup=function(e,t){if(this._apiKeySet("setGroup()")&&Z(e,"groupType","string")&&!$(e)){var n={};n[e]=t;var i=(new he).set(e,t);this._logEvent(f,null,null,i.userPropertiesOperations,n,null,null,null)}},Ce.prototype.setOptOut=function(e){if(Z(e,"enable","boolean"))try{this.options.optOut=e,De(this)}catch(e){V.error(e)}},Ce.prototype.setSessionId=function(e){if(Z(e,"sessionId","number"))try{this._sessionId=e,De(this)}catch(e){V.error(e)}},Ce.prototype.resetSessionId=function(){this.setSessionId((new Date).getTime())},Ce.prototype.regenerateDeviceId=function(){this.setDeviceId(xe()+"R")},Ce.prototype.setDeviceId=function(e){if(Z(e,"deviceId","string"))try{$(e)||(this.options.deviceId=""+e,De(this))}catch(e){V.error(e)}},Ce.prototype.setUserProperties=function(e){if(this._apiKeySet("setUserProperties()")&&Z(e,"userProperties","object")){var t=H(Y(e));if(0!==Object.keys(t).length){var n=new he;for(var i in t)t.hasOwnProperty(i)&&n.set(i,t[i]);this.identify(n)}}},Ce.prototype.clearUserProperties=function(){if(this._apiKeySet("clearUserProperties()")){var e=new he;e.clearAll(),this.identify(e)}};var Be=function(e,t){for(var n=0;n<t._q.length;n++){var i=e[t._q[n][0]];"function"===q(i)&&i.apply(e,t._q[n].slice(1))}return e};Ce.prototype.identify=function(e,t){if(this._apiKeySet("identify()"))if("object"===q(e)&&e.hasOwnProperty("_q")&&(e=Be(new he,e)),e instanceof he){if(0<Object.keys(e.userPropertiesOperations).length)return this._logEvent(f,null,null,e.userPropertiesOperations,null,null,null,t);"function"===q(t)&&t(0,"No request sent",{reason:"No user property operations"})}else V.error("Invalid identify input type. Expected Identify object but saw "+q(e)),"function"===q(t)&&t(0,"No request sent",{reason:"Invalid identify input type"});else"function"===q(t)&&t(0,"No request sent",{reason:"API key is not set"})},Ce.prototype.groupIdentify=function(e,t,n,i){var r,o,s;if(this._apiKeySet("groupIdentify()"))if(Z(e,"group_type","string")&&!$(e))if(null!=t)if("object"===q(n)&&n.hasOwnProperty("_q")&&(n=Be(new he,n)),n instanceof he){if(0<Object.keys(n.userPropertiesOperations).length)return this._logEvent(h,null,null,null,(s=t,(o=e)in(r={})?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s,r),n.userPropertiesOperations,null,i);"function"===q(i)&&i(0,"No request sent",{reason:"No group property operations"})}else V.error("Invalid identify input type. Expected Identify object but saw "+q(n)),"function"===q(i)&&i(0,"No request sent",{reason:"Invalid identify input type"});else"function"===q(i)&&i(0,"No request sent",{reason:"Invalid group name"});else"function"===q(i)&&i(0,"No request sent",{reason:"Invalid group type"});else"function"===q(i)&&i(0,"No request sent",{reason:"API key is not set"})},Ce.prototype.setVersionName=function(e){Z(e,"versionName","string")&&(this.options.versionName=e)},Ce.prototype._logEvent=function(e,t,n,i,r,o,s,a){if(qe(this),e)if(this.options.optOut)"function"===q(a)&&a(0,"No request sent",{reason:"optOut is set to true"});else try{var u;u=e===f||e===h?this.nextIdentifyId():this.nextEventId();var c=this.nextSequenceNumber(),p="number"===q(s)?s:(new Date).getTime();(!this._sessionId||!this._lastEventTime||p-this._lastEventTime>this.options.sessionTimeout)&&(this._sessionId=p),this._lastEventTime=p,De(this),i=i||{};var l=P({},this._apiPropertiesTrackingOptions);n=P({},n||{},l),t=t||{},r=r||{},o=o||{};var d={device_id:this.options.deviceId,user_id:this.options.userId,timestamp:p,event_id:u,session_id:this._sessionId||-1,event_type:e,version_name:Le(this,"version_name")&&this.options.versionName||null,platform:Le(this,"platform")?this.options.platform:null,os_name:Le(this,"os_name")&&this._ua.browser.name||null,os_version:Le(this,"os_version")&&this._ua.browser.major||null,device_model:Le(this,"device_model")&&this._ua.os.name||null,language:Le(this,"language")?this.options.language:null,api_properties:n,event_properties:H(Y(t)),user_properties:H(Y(i)),uuid:xe(),library:{name:"amplitude-js",version:ke},sequence_number:c,groups:H(Q(r)),group_properties:H(Y(o)),user_agent:this._userAgent};return e===f||e===h?(this._unsentIdentifys.push(d),this._limitEventsQueued(this._unsentIdentifys)):(this._unsentEvents.push(d),this._limitEventsQueued(this._unsentEvents)),this.options.saveEvents&&this.saveEvents(),this._sendEventsIfReady(a)||"function"!==q(a)||a(0,"No request sent",{reason:"No events to send or upload queued"}),u}catch(e){V.error(e)}else"function"===q(a)&&a(0,"No request sent",{reason:"Missing eventType"})};var Le=function(e,t){return!!e.options.trackingOptions[t]},Je=function(e){for(var t=["city","country","dma","ip_address","region"],n={},i=0;i<t.length;i++){var r=t[i];Le(e,r)||(n[r]=!1)}return n};Ce.prototype._limitEventsQueued=function(e){e.length>this.options.savedMaxCount&&e.splice(0,e.length-this.options.savedMaxCount)},Ce.prototype.logEvent=function(e,t,n){return this.logEventWithTimestamp(e,t,null,n)},Ce.prototype.logEventWithTimestamp=function(e,t,n,i){return this._apiKeySet("logEvent()")?Z(e,"eventType","string")?$(e)?("function"===q(i)&&i(0,"No request sent",{reason:"Missing eventType"}),-1):this._logEvent(e,t,null,null,null,null,n,i):("function"===q(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===q(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)},Ce.prototype.logEventWithGroups=function(e,t,n,i){return this._apiKeySet("logEventWithGroups()")?Z(e,"eventType","string")?this._logEvent(e,t,null,null,n,null,null,i):("function"===q(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===q(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)};var Fe=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};Ce.prototype.logRevenueV2=function(e){if(this._apiKeySet("logRevenueV2()"))if("object"===q(e)&&e.hasOwnProperty("_q")&&(e=Be(new Ee,e)),e instanceof Ee){if(e&&e._isValidRevenue())return this.logEvent(i,e._toJSONObject())}else V.error("Invalid revenue input type. Expected Revenue object but saw "+q(e))},Ce.prototype.logRevenue=function(e,t,n){return this._apiKeySet("logRevenue()")&&Fe(e)&&(void 0===t||Fe(t))?this._logEvent(i,{},{productId:n,special:"revenue_amount",quantity:t||1,price:e},null,null,null,null,null):-1},Ce.prototype.removeEvents=function(e,t){Ke(this,"_unsentEvents",e),Ke(this,"_unsentIdentifys",t)};var Ke=function(e,t,n){if(!(n<0)){for(var i=[],r=0;r<e[t].length;r++)e[t][r].event_id>n&&i.push(e[t][r]);e[t]=i}};Ce.prototype.sendEvents=function(n){if(this._apiKeySet("sendEvents()"))if(this.options.optOut)"function"===q(n)&&n(0,"No request sent",{reason:"optOut is set to true"});else if(0!==this._unsentCount())if(this._sending)"function"===q(n)&&n(0,"No request sent",{reason:"Request already in progress. Events will be sent once this request is complete"});else if(this._pendingReadStorage)"function"===q(n)&&n(0,"No request sent",{reason:"Still resolving data from storage. Events will be sent once this is complete."});else{this._sending=!0;var e=(this.options.forceHttps?"https":"https:"===window.location.protocol?"https":"http")+"://"+this.options.apiEndpoint+"/",i=Math.min(this._unsentCount(),this.options.uploadBatchSize),t=this._mergeEventsAndIdentifys(i),r=t.maxEventId,o=t.maxIdentifyId,s=JSON.stringify(t.eventsToSend),a=(new Date).getTime(),u={client:this.options.apiKey,e:s,v:p,upload_time:a,checksum:ge(p+this.options.apiKey+s+a)},c=this;new Oe(e,u).send(function(e,t){c._sending=!1;try{200===e&&"success"===t?(c.removeEvents(r,o),c.options.saveEvents&&c.saveEvents(),c._sendEventsIfReady(n)||"function"!==q(n)||n(e,t)):413===e?(1===c.options.uploadBatchSize&&c.removeEvents(r,o),c.options.uploadBatchSize=Math.ceil(i/2),c.sendEvents(n)):"function"===q(n)&&n(e,t)}catch(e){}})}else"function"===q(n)&&n(0,"No request sent",{reason:"No events to send"});else"function"===q(n)&&n(0,"No request sent",{reason:"API key not set"})},Ce.prototype._mergeEventsAndIdentifys=function(e){for(var t=[],n=0,i=-1,r=0,o=-1;t.length<e;){var s,a=r>=this._unsentIdentifys.length,u=n>=this._unsentEvents.length;if(u&&a){V.error("Merging Events and Identifys, less events and identifys than expected");break}a?i=(s=this._unsentEvents[n++]).event_id:u?o=(s=this._unsentIdentifys[r++]).event_id:!("sequence_number"in this._unsentEvents[n])||this._unsentEvents[n].sequence_number<this._unsentIdentifys[r].sequence_number?i=(s=this._unsentEvents[n++]).event_id:o=(s=this._unsentIdentifys[r++]).event_id,s.deviceId||(s.device_id=this.options.deviceId),s.userId||(s.user_id=this.options.userId),t.push(s)}return{eventsToSend:t,maxEventId:i,maxIdentifyId:o}},Ce.prototype.setGlobalUserProperties=function(e){this.setUserProperties(e)},Ce.prototype.__VERSION__=ke;var ze=function(){this.options=P({},Ae),this._q=[],this._instances={}};ze.prototype.Identify=he,ze.prototype.Revenue=Ee,ze.prototype.getInstance=function(e){e=$(e)?r:e.toLowerCase();var t=this._instances[e];return void 0===t&&(t=new Ce(e),this._instances[e]=t),t},ze.prototype.runQueuedFunctions=function(){for(var e=0;e<this._q.length;e++){var t=this[this._q[e][0]];"function"===q(t)&&t.apply(this,this._q[e].slice(1))}for(var n in this._q=[],this._instances)this._instances.hasOwnProperty(n)&&this._instances[n].runQueuedFunctions()},ze.prototype.init=function(e,t,n,i){this.getInstance().init(e,t,n,function(e){this.options=e.options,"function"===q(i)&&i(e)}.bind(this))},ze.prototype.isNewSession=function(){return this.getInstance().isNewSession()},ze.prototype.getSessionId=function(){return this.getInstance().getSessionId()},ze.prototype.nextEventId=function(){return this.getInstance().nextEventId()},ze.prototype.nextIdentifyId=function(){return this.getInstance().nextIdentifyId()},ze.prototype.nextSequenceNumber=function(){return this.getInstance().nextSequenceNumber()},ze.prototype.saveEvents=function(){this.getInstance().saveEvents()},ze.prototype.setDomain=function(e){this.getInstance().setDomain(e)},ze.prototype.setUserId=function(e){this.getInstance().setUserId(e)},ze.prototype.setGroup=function(e,t){this.getInstance().setGroup(e,t)},ze.prototype.setOptOut=function(e){this.getInstance().setOptOut(e)},ze.prototype.regenerateDeviceId=function(){this.getInstance().regenerateDeviceId()},ze.prototype.setDeviceId=function(e){this.getInstance().setDeviceId(e)},ze.prototype.setUserProperties=function(e){this.getInstance().setUserProperties(e)},ze.prototype.clearUserProperties=function(){this.getInstance().clearUserProperties()},ze.prototype.identify=function(e,t){this.getInstance().identify(e,t)},ze.prototype.setVersionName=function(e){this.getInstance().setVersionName(e)},ze.prototype.logEvent=function(e,t,n){return this.getInstance().logEvent(e,t,n)},ze.prototype.logEventWithGroups=function(e,t,n,i){return this.getInstance().logEventWithGroups(e,t,n,i)},ze.prototype.logRevenueV2=function(e){return this.getInstance().logRevenueV2(e)},ze.prototype.logRevenue=function(e,t,n){return this.getInstance().logRevenue(e,t,n)},ze.prototype.removeEvents=function(e,t){this.getInstance().removeEvents(e,t)},ze.prototype.sendEvents=function(e){this.getInstance().sendEvents(e)},ze.prototype.setGlobalUserProperties=function(e){this.getInstance().setUserProperties(e)},ze.prototype.__VERSION__=ke;var Ge=window.amplitude||{},We=new ze;for(var Ve in We._q=Ge._q||[],Ge._iq)Ge._iq.hasOwnProperty(Ve)&&(We.getInstance(Ve)._q=Ge._iq[Ve]._q||[]);return We});

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.amplitude=t()}(this,function(){"use strict";var l="$default_instance",c=2,t=4096,a=1e3,f="$identify",h="$groupidentify",v="amplitude_lastEventId",g="amplitude_lastEventTime",y="amplitude_lastIdentifyId",m="amplitude_lastSequenceNumber",_="amplitude_sessionId",w="amplitude_deviceId",b="amplitude_optOut",I="amplitude_userId",n="amplitude_cookie_test",i="revenue_amount",r="$productId",o="$quantity",s="$price",u="$revenueType",p="amp_device_id",d="referrer",S="utm_source",O="utm_medium",E="utm_campaign",N="utm_term",x="utm_content",k=function(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):(127<i&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(63&i|128))}return t},A=function(e){for(var t="",n=0,i=0,r=0,o=0;n<e.length;)(i=e.charCodeAt(n))<128?(t+=String.fromCharCode(i),n++):191<i&&i<224?(r=e.charCodeAt(n+1),t+=String.fromCharCode((31&i)<<6|63&r),n+=2):(r=e.charCodeAt(n+1),o=e.charCodeAt(n+2),t+=String.fromCharCode((15&i)<<12|(63&r)<<6|63&o),n+=3);return t},P={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){try{if(window.btoa&&window.atob)return window.btoa(unescape(encodeURIComponent(e)))}catch(e){}return P._encode(e)},_encode:function(e){var t,n,i,r,o,s,a,u="",p=0;for(e=k(e);p<e.length;)r=(t=e.charCodeAt(p++))>>2,o=(3&t)<<4|(n=e.charCodeAt(p++))>>4,s=(15&n)<<2|(i=e.charCodeAt(p++))>>6,a=63&i,isNaN(n)?s=a=64:isNaN(i)&&(a=64),u=u+P._keyStr.charAt(r)+P._keyStr.charAt(o)+P._keyStr.charAt(s)+P._keyStr.charAt(a);return u},decode:function(e){try{if(window.btoa&&window.atob)return decodeURIComponent(escape(window.atob(e)))}catch(e){}return P._decode(e)},_decode:function(e){var t,n,i,r,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)t=P._keyStr.indexOf(e.charAt(u++))<<2|(r=P._keyStr.indexOf(e.charAt(u++)))>>4,n=(15&r)<<4|(o=P._keyStr.indexOf(e.charAt(u++)))>>2,i=(3&o)<<6|(s=P._keyStr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(i));return a=A(a)}},T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},j=Object.prototype.toString;function q(e){switch(j.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)?"buffer":void 0===(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e))?"undefined":T(e)}var C={DISABLE:0,ERROR:1,WARN:2,INFO:3},U=C.WARN,M={error:function(e){U>=C.ERROR&&D(e)},warn:function(e){U>=C.WARN&&D(e)},info:function(e){U>=C.INFO&&D(e)}},D=function(e){try{console.log("[Amplitude] "+e)}catch(e){}},z=function(e){return"string"===q(e)&&e.length>t?e.substring(0,t):e},B=function(e){var t=q(e);if("object"!==t)return M.error("Error: invalid properties format. Expecting Javascript object, received "+t+", ignoring"),{};if(Object.keys(e).length>a)return M.error("Error: too many properties (more than 1000), ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=i,o=q(r);"string"!==o&&(r=String(r),M.warn("WARNING: Non-string property key, received type "+o+', coercing to string "'+r+'"'));var s=L(r,e[i]);null!==s&&(n[r]=s)}return n},K=["null","nan","undefined","function","arguments","regexp","element"],L=function e(t,n){var i=q(n);if(-1!==K.indexOf(i))M.warn('WARNING: Property key "'+t+'" with invalid value type '+i+", ignoring"),n=null;else if("error"===i)n=String(n),M.warn('WARNING: Property key "'+t+'" with value type error, coercing to '+n);else if("array"===i){for(var r=[],o=0;o<n.length;o++){var s=n[o],a=q(s);"array"!==a&&"object"!==a?r.push(e(t,s)):M.warn("WARNING: Cannot have "+a+" nested in an array property value, skipping")}n=r}else"object"===i&&(n=B(n));return n},W=function(e,t){var n=q(t);if("string"===n)return t;if("date"===n||"number"===n||"boolean"===n)return t=String(t),M.warn("WARNING: Non-string groupName, received type "+n+', coercing to string "'+t+'"'),t;if("array"===n){for(var i=[],r=0;r<t.length;r++){var o=t[r],s=q(o);"array"!==s&&"object"!==s?"string"===s?i.push(o):"date"!==s&&"number"!==s&&"boolean"!==s||(o=String(o),M.warn("WARNING: Non-string groupName, received type "+s+', coercing to string "'+o+'"'),i.push(o)):M.warn("WARNING: Skipping nested "+s+" in array groupName")}return i}M.warn("WARNING: Non-string groupName, received type "+n+". Please use strings or array of strings for groupName")},F=function(e){C.hasOwnProperty(e)&&(U=C[e])},G=M,V=function(e){return!e||0===e.length},$=function(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?void 0:decodeURIComponent(n[1].replace(/\+/g," "))},J=function e(t){if("array"===q(t))for(var n=0;n<t.length;n++)t[n]=e(t[n]);else if("object"===q(t))for(var i in t)t.hasOwnProperty(i)&&(t[i]=e(t[i]));else t=z(t);return t},X=function(e){var t=q(e);if("object"!==t)return M.error("Error: invalid groups format. Expecting Javascript object, received "+t+", ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=i,o=q(r);"string"!==o&&(r=String(r),M.warn("WARNING: Non-string groupType, received type "+o+', coercing to string "'+r+'"'));var s=W(r,e[i]);null!==s&&(n[r]=s)}return n},H=function(e,t,n){return q(e)===n||(M.error("Invalid "+t+" input type. Expected "+n+" but received "+q(e)),!1)},Q=B,Y=function(e,t,n){var i=null!==t?n.expirationDays:-1;if(i){var r=new Date;r.setTime(r.getTime()+24*i*60*60*1e3),i=r}var o=e+"="+t;i&&(o+="; expires="+i.toUTCString()),o+="; path=/",n.domain&&(o+="; domain="+n.domain),n.secure&&(o+="; Secure"),document.cookie=o},Z=function(e){try{for(var t=document.cookie.split(";"),n=null,i=0;i<t.length;i++){for(var r=t[i];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e)){n=r.substring(e.length,r.length);break}}return n}catch(e){return null}},ee={expirationDays:void 0,domain:void 0},te=function(e){var t,n,i=(t=e,(n=document.createElement("a")).href=t,n.hostname||location.hostname).split("."),r=i[i.length-1],o=[];if(4===i.length&&r===parseInt(r,10))return o;if(i.length<=1)return o;for(var s=i.length-2;0<=s;--s)o.push(i.slice(s).join("."));for(var a=0;a<o.length;++a){var u="__tld_test__",p=o[a],c={domain:"."+p};if(Y(u,1,c),Z(u))return Y(u,null,c),p}return""},ne=function(e){var t="";return ee.domain&&(t="."===ee.domain.charAt(0)?ee.domain.substring(1):ee.domain),e+t},ie=function(e){var t=ne(e)+"=",n=Z(t);try{if(n)return JSON.parse(P.decode(n))}catch(e){return null}return null},re=function(e,t){try{return Y(ne(e),P.encode(JSON.stringify(t)),ee),!0}catch(e){return!1}},oe=function(e){try{return Y(ne(e),null,ee),!0}catch(e){return!1}},se={reset:function(){ee={expirationDays:void 0,domain:void 0}},options:function(e){if(0===arguments.length)return ee;e=e||{},ee.expirationDays=e.expirationDays,ee.secure=e.secure;var t=V(e.domain)?"."+te(window.location.href):e.domain,n=Math.random();ee.domain=t,re("amplitude_test",n);var i=ie("amplitude_test");return i&&i===n||(t=null),oe("amplitude_test"),ee.domain=t,ee},get:ie,set:re,remove:oe},ae=window.localStorage,ue=function(){this.storage=null};ue.prototype._cookiesEnabled=function(){var e,t=String(new Date);try{return se.set(n,t),e=se.get(n)===t,se.remove(n),e}catch(e){}return!1},ue.prototype.getStorage=function(){if(null!==this.storage)return this.storage;if(this._cookiesEnabled())this.storage=se;else{var n="amp_cookiestore_";this.storage={_options:{expirationDays:void 0,domain:void 0,secure:!1},reset:function(){this._options={expirationDays:void 0,domain:void 0,secure:!1}},options:function(e){return 0===arguments.length?this._options:(e=e||{},this._options.expirationDays=e.expirationDays||this._options.expirationDays,this._options.domain=e.domain||this._options.domain||window.location.hostname,this._options.secure=e.secure||!1)},get:function(e){try{return JSON.parse(ae.getItem(n+e))}catch(e){}return null},set:function(e,t){try{return ae.setItem(n+e,JSON.stringify(t)),!0}catch(e){}return!1},remove:function(e){try{ae.removeItem(n+e)}catch(e){return!1}}}}return this.storage};var pe="$clearAll",ce=function(){this.userPropertiesOperations={},this.properties=[]};ce.prototype.add=function(e,t){return"number"===q(t)||"string"===q(t)?this._addOperation("$add",e,t):G.error("Unsupported type for value: "+q(t)+", expecting number or string"),this},ce.prototype.append=function(e,t){return this._addOperation("$append",e,t),this},ce.prototype.clearAll=function(){return 0<Object.keys(this.userPropertiesOperations).length?this.userPropertiesOperations.hasOwnProperty(pe)||G.error("Need to send $clearAll on its own Identify object without any other operations, skipping $clearAll"):this.userPropertiesOperations[pe]="-",this},ce.prototype.prepend=function(e,t){return this._addOperation("$prepend",e,t),this},ce.prototype.set=function(e,t){return this._addOperation("$set",e,t),this},ce.prototype.setOnce=function(e,t){return this._addOperation("$setOnce",e,t),this},ce.prototype.unset=function(e){return this._addOperation("$unset",e,"-"),this},ce.prototype._addOperation=function(e,t,n){this.userPropertiesOperations.hasOwnProperty(pe)?G.error("This identify already contains a $clearAll operation, skipping operation "+e):-1===this.properties.indexOf(t)?(this.userPropertiesOperations.hasOwnProperty(e)||(this.userPropertiesOperations[e]={}),this.userPropertiesOperations[e][t]=n,this.properties.push(t)):G.error('User property "'+t+'" already used in this identify, skipping operation '+e)};var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function de(e,t){return e(t={exports:{}},t.exports),t.exports}var le=de(function(s){!function(e){function d(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t,n,i,r,o){return d((s=d(d(t,e),d(i,o)))<<(a=r)|s>>>32-a,n);var s,a}function l(e,t,n,i,r,o,s){return a(t&n|~t&i,e,t,r,o,s)}function f(e,t,n,i,r,o,s){return a(t&i|n&~i,e,t,r,o,s)}function h(e,t,n,i,r,o,s){return a(t^n^i,e,t,r,o,s)}function v(e,t,n,i,r,o,s){return a(n^(t|~i),e,t,r,o,s)}function u(e,t){var n,i,r,o,s;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var a=1732584193,u=-271733879,p=-1732584194,c=271733878;for(n=0;n<e.length;n+=16)u=v(u=v(u=v(u=v(u=h(u=h(u=h(u=h(u=f(u=f(u=f(u=f(u=l(u=l(u=l(u=l(r=u,p=l(o=p,c=l(s=c,a=l(i=a,u,p,c,e[n],7,-680876936),u,p,e[n+1],12,-389564586),a,u,e[n+2],17,606105819),c,a,e[n+3],22,-1044525330),p=l(p,c=l(c,a=l(a,u,p,c,e[n+4],7,-176418897),u,p,e[n+5],12,1200080426),a,u,e[n+6],17,-1473231341),c,a,e[n+7],22,-45705983),p=l(p,c=l(c,a=l(a,u,p,c,e[n+8],7,1770035416),u,p,e[n+9],12,-1958414417),a,u,e[n+10],17,-42063),c,a,e[n+11],22,-1990404162),p=l(p,c=l(c,a=l(a,u,p,c,e[n+12],7,1804603682),u,p,e[n+13],12,-40341101),a,u,e[n+14],17,-1502002290),c,a,e[n+15],22,1236535329),p=f(p,c=f(c,a=f(a,u,p,c,e[n+1],5,-165796510),u,p,e[n+6],9,-1069501632),a,u,e[n+11],14,643717713),c,a,e[n],20,-373897302),p=f(p,c=f(c,a=f(a,u,p,c,e[n+5],5,-701558691),u,p,e[n+10],9,38016083),a,u,e[n+15],14,-660478335),c,a,e[n+4],20,-405537848),p=f(p,c=f(c,a=f(a,u,p,c,e[n+9],5,568446438),u,p,e[n+14],9,-1019803690),a,u,e[n+3],14,-187363961),c,a,e[n+8],20,1163531501),p=f(p,c=f(c,a=f(a,u,p,c,e[n+13],5,-1444681467),u,p,e[n+2],9,-51403784),a,u,e[n+7],14,1735328473),c,a,e[n+12],20,-1926607734),p=h(p,c=h(c,a=h(a,u,p,c,e[n+5],4,-378558),u,p,e[n+8],11,-2022574463),a,u,e[n+11],16,1839030562),c,a,e[n+14],23,-35309556),p=h(p,c=h(c,a=h(a,u,p,c,e[n+1],4,-1530992060),u,p,e[n+4],11,1272893353),a,u,e[n+7],16,-155497632),c,a,e[n+10],23,-1094730640),p=h(p,c=h(c,a=h(a,u,p,c,e[n+13],4,681279174),u,p,e[n],11,-358537222),a,u,e[n+3],16,-722521979),c,a,e[n+6],23,76029189),p=h(p,c=h(c,a=h(a,u,p,c,e[n+9],4,-640364487),u,p,e[n+12],11,-421815835),a,u,e[n+15],16,530742520),c,a,e[n+2],23,-995338651),p=v(p,c=v(c,a=v(a,u,p,c,e[n],6,-198630844),u,p,e[n+7],10,1126891415),a,u,e[n+14],15,-1416354905),c,a,e[n+5],21,-57434055),p=v(p,c=v(c,a=v(a,u,p,c,e[n+12],6,1700485571),u,p,e[n+3],10,-1894986606),a,u,e[n+10],15,-1051523),c,a,e[n+1],21,-2054922799),p=v(p,c=v(c,a=v(a,u,p,c,e[n+8],6,1873313359),u,p,e[n+15],10,-30611744),a,u,e[n+6],15,-1560198380),c,a,e[n+13],21,1309151649),p=v(p,c=v(c,a=v(a,u,p,c,e[n+4],6,-145523070),u,p,e[n+11],10,-1120210379),a,u,e[n+2],15,718787259),c,a,e[n+9],21,-343485551),a=d(a,i),u=d(u,r),p=d(p,o),c=d(c,s);return[a,u,p,c]}function p(e){var t,n="",i=32*e.length;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function c(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var i=8*e.length;for(t=0;t<i;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function i(e){var t,n,i="0123456789abcdef",r="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),r+=i.charAt(t>>>4&15)+i.charAt(15&t);return r}function n(e){return unescape(encodeURIComponent(e))}function r(e){return p(u(c(t=n(e)),8*t.length));var t}function o(e,t){return function(e,t){var n,i,r=c(e),o=[],s=[];for(o[15]=s[15]=void 0,16<r.length&&(r=u(r,8*e.length)),n=0;n<16;n+=1)o[n]=909522486^r[n],s[n]=1549556828^r[n];return i=u(o.concat(c(t)),512+8*t.length),p(u(s.concat(i),640))}(n(e),n(t))}function t(e,t,n){return t?n?o(t,e):i(o(t,e)):n?r(e):i(r(e))}s.exports?s.exports=t:e.md5=t}(e)}),fe=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})},he=Object.getOwnPropertySymbols,ve=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var ye=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,r=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var s in n=Object(arguments[o]))ve.call(n,s)&&(r[s]=n[s]);if(he){i=he(n);for(var a=0;a<i.length;a++)ge.call(n,i[a])&&(r[i[a]]=n[i[a]])}}return r},me="%[a-f0-9]{2}";new RegExp(me,"gi"),new RegExp("("+me+")+","gi");function _e(e,t){return t.encode?t.strict?fe(e):encodeURIComponent(e):e}var we=function(i,r){!1===(r=ye({encode:!0,strict:!0,arrayFormat:"none"},r)).sort&&(r.sort=function(){});var o=function(i){switch(i.arrayFormat){case"index":return function(e,t,n){return null===t?[_e(e,i),"[",n,"]"].join(""):[_e(e,i),"[",_e(n,i),"]=",_e(t,i)].join("")};case"bracket":return function(e,t){return null===t?_e(e,i):[_e(e,i),"[]=",_e(t,i)].join("")};default:return function(e,t){return null===t?_e(e,i):[_e(e,i),"=",_e(t,i)].join("")}}}(r);return i?Object.keys(i).sort(r.sort).map(function(t){var e=i[t];if(void 0===e)return"";if(null===e)return _e(t,r);if(Array.isArray(e)){var n=[];return e.slice().forEach(function(e){void 0!==e&&n.push(o(t,e,n.length))}),n.join("&")}return _e(t,r)+"="+_e(e,r)}).filter(function(e){return 0<e.length}).join("&"):""},be=function(e,t){this.url=e,this.data=t||{}};be.prototype.send=function(e){if(!!window.XDomainRequest){var t=new window.XDomainRequest;t.open("POST",this.url,!0),t.onload=function(){e(200,t.responseText)},t.onerror=function(){"Request Entity Too Large"===t.responseText?e(413,t.responseText):e(500,t.responseText)},t.ontimeout=function(){},t.onprogress=function(){},t.send(we(this.data))}else{var n=new XMLHttpRequest;n.open("POST",this.url,!0),n.onreadystatechange=function(){4===n.readyState&&e(n.status,n.responseText)},n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),n.send(we(this.data))}};var Ie=function(){this._price=null,this._productId=null,this._quantity=1,this._revenueType=null,this._properties=null};Ie.prototype.setProductId=function(e){return"string"!==q(e)?G.error("Unsupported type for productId: "+q(e)+", expecting string"):V(e)?G.error("Invalid empty productId"):this._productId=e,this},Ie.prototype.setQuantity=function(e){return"number"!==q(e)?G.error("Unsupported type for quantity: "+q(e)+", expecting number"):this._quantity=parseInt(e),this},Ie.prototype.setPrice=function(e){return"number"!==q(e)?G.error("Unsupported type for price: "+q(e)+", expecting number"):this._price=e,this},Ie.prototype.setRevenueType=function(e){return"string"!==q(e)?G.error("Unsupported type for revenueType: "+q(e)+", expecting string"):this._revenueType=e,this},Ie.prototype.setEventProperties=function(e){return"object"!==q(e)?G.error("Unsupported type for eventProperties: "+q(e)+", expecting object"):this._properties=Q(e),this},Ie.prototype._isValidRevenue=function(){return"number"===q(this._price)||(G.error("Invalid revenue, need to set price field"),!1)},Ie.prototype._toJSONObject=function(){var e="object"===q(this._properties)?this._properties:{};return null!==this._productId&&(e[r]=this._productId),null!==this._quantity&&(e[o]=this._quantity),null!==this._price&&(e[s]=this._price),null!==this._revenueType&&(e[u]=this._revenueType),e};var Se=de(function(S,O){!function(r,d){var l="function",f="undefined",h="object",e="model",t="name",n="type",i="vendor",o="version",s="architecture",a="console",u="mobile",p="tablet",c="smarttv",v="wearable",g={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.split(".")[0]:d}},y={rgx:function(){for(var e,t,n,i,r,o,s,a=0,u=arguments;a<u.length&&!o;){var p=u[a],c=u[a+1];if(typeof e===f)for(i in e={},c)c.hasOwnProperty(i)&&(typeof(r=c[i])===h?e[r[0]]=d:e[r]=d);for(t=n=0;t<p.length&&!o;)if(o=p[t++].exec(this.getUA()))for(i=0;i<c.length;i++)s=o[++n],typeof(r=c[i])===h&&0<r.length?2==r.length?typeof r[1]==l?e[r[0]]=r[1].call(this,s):e[r[0]]=r[1]:3==r.length?typeof r[1]!==l||r[1].exec&&r[1].test?e[r[0]]=s?s.replace(r[1],r[2]):d:e[r[0]]=s?r[1].call(this,s,r[2]):d:4==r.length&&(e[r[0]]=s?r[3].call(this,s.replace(r[1],r[2])):d):e[r]=s||d;a+=2}return e},str:function(e,t){for(var n in t)if(typeof t[n]===h&&0<t[n].length){for(var i=0;i<t[n].length;i++)if(g.has(t[n][i],e))return"?"===n?d:n}else if(g.has(t[n],e))return"?"===n?d:n;return e}},m={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},name:{"Opera Mobile":"Opera Mobi","IE Mobile":"IEMobile"}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},name:{"Windows Phone":"Windows Phone OS"}}}},_={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[t,o],[/(OPiOS)[\/\s]+([\w\.]+)/i],[[t,"Opera Mini"],o],[/\s(opr)\/([\w\.]+)/i],[[t,"Opera"],o],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i],[t,o],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[t,"IE"],o],[/(edge)\/((\d+)?[\w\.]+)/i],[t,o],[/(yabrowser)\/([\w\.]+)/i],[[t,"Yandex"],o],[/(comodo_dragon)\/([\w\.]+)/i],[[t,/_/g," "],o],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[t,"Chrome Mobile"],o],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(qqbrowser)[\/\s]?([\w\.]+)/i],[t,o],[/(uc\s?browser)[\/\s]?([\w\.]+)/i,/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,/JUC.+(ucweb)[\/\s]?([\w\.]+)/i],[[t,"UCBrowser"],o],[/(dolfin)\/([\w\.]+)/i],[[t,"Dolphin"],o],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[o,[t,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[o,[t,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[o,[t,"Facebook"]],[/fxios\/([\w\.-]+)/i],[o,[t,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[o,[t,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[o,t],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[t,[o,y.str,m.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[t,o],[/(blackberry)\\s?\/([\w\.]+)/i],[[t,"BlackBerry"],o],[/(navigator|netscape)\/([\w\.-]+)/i],[[t,"Netscape"],o],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[t,o]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[s,"amd64"]],[/(ia32(?=;))/i],[[s,g.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[s,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[s,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[s,/ower/,"",g.lowerize]],[/(sun4\w)[;\)]/i],[[s,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[s,g.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[e,i,[n,p]],[/applecoremedia\/[\w\.]+ \((ipad)/],[e,[i,"Apple"],[n,p]],[/(apple\s{0,1}tv)/i],[[e,"Apple TV"],[i,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[i,e,[n,p]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[e,[i,"Amazon"],[n,p]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[e,y.str,m.device.amazon.model],[i,"Amazon"],[n,u]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[e,i,[n,u]],[/\((ip[honed|\s\w*]+);/i],[e,[i,"Apple"],[n,u]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[i,e,[n,u]],[/\(bb10;\s(\w+)/i],[e,[i,"BlackBerry"],[n,u]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],[e,[i,"Asus"],[n,p]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[i,"Sony"],[e,"Xperia Tablet"],[n,p]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[[i,"Sony"],[e,"Xperia Phone"],[n,u]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[i,e,[n,a]],[/android.+;\s(shield)\sbuild/i],[e,[i,"Nvidia"],[n,a]],[/(playstation\s[34portablevi]+)/i],[e,[i,"Sony"],[n,a]],[/(sprint\s(\w+))/i],[[i,y.str,m.device.sprint.vendor],[e,y.str,m.device.sprint.model],[n,u]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[i,e,[n,p]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[i,[e,/_/g," "],[n,u]],[/(nexus\s9)/i],[e,[i,"HTC"],[n,p]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[e,[i,"Microsoft"],[n,a]],[/(kin\.[onetw]{3})/i],[[e,/\./g," "],[i,"Microsoft"],[n,u]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i,/(nexus\s[6])/i],[e,[i,"Motorola"],[n,u]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[e,[i,"Motorola"],[n,p]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[i,"Samsung"],e,[n,p]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[i,"Samsung"],e,[n,u]],[/(samsung);smarttv/i],[i,e,[n,c]],[/\(dtv[\);].+(aquos)/i],[e,[i,"Sharp"],[n,c]],[/sie-(\w+)*/i],[e,[i,"Siemens"],[n,u]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[i,"Nokia"],e,[n,u]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[e,[i,"Acer"],[n,p]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[i,"LG"],e,[n,p]],[/(lg) netcast\.tv/i],[i,e,[n,c]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[e,[i,"LG"],[n,u]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[e,[i,"Lenovo"],[n,p]],[/linux;.+((jolla));/i],[i,e,[n,u]],[/((pebble))app\/[\d\.]+\s/i],[i,e,[n,v]],[/android.+;\s(glass)\s\d/i],[e,[i,"Google"],[n,v]],[/android.+(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i],[[e,/_/g," "],[i,"Xiaomi"],[n,u]],[/\s(tablet)[;\/\s]/i,/\s(mobile)[;\/\s]/i],[[n,g.lowerize],i,e]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[o,[t,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[t,o],[/rv\:([\w\.]+).*(gecko)/i],[o,t]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[t,o],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[t,y.str,m.os.windows.name],[o,y.str,m.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[t,"Windows"],[o,y.str,m.os.windows.version]],[/\((bb)(10);/i],[[t,"BlackBerry"],o],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[t,o],[/(symbian\s?o?s?|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[t,"Symbian"],o],[/\((series40);/i],[t],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[t,"Firefox OS"],o],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[[t,"Linux"],o],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[t,"Chromium OS"],o],[/(sunos)\s?([\w\.]+\d)*/i],[[t,"Solaris"],o],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[[t,"Linux"],o],[/(iphone)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[t,"iPhone"],[o,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[t,"iPad"],[o,/_/g,"."]],[/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i],[[t,"iOS"],[o,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[t,"Mac"],[o,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[t,o]]},w=function(e,t){if(!(this instanceof w))return new w(e,t).getResult();var n=e||(r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),i=t?g.extend(_,t):_;return this.getBrowser=function(){var e=y.rgx.apply(this,i.browser);return e.major=g.major(e.version),e},this.getCPU=function(){return y.rgx.apply(this,i.cpu)},this.getDevice=function(){return y.rgx.apply(this,i.device)},this.getEngine=function(){return y.rgx.apply(this,i.engine)},this.getOS=function(){return y.rgx.apply(this,i.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};w.VERSION="0.7.10",w.BROWSER={NAME:t,MAJOR:"major",VERSION:o},w.CPU={ARCHITECTURE:s},w.DEVICE={MODEL:e,VENDOR:i,TYPE:n,CONSOLE:a,MOBILE:u,SMARTTV:c,TABLET:p,WEARABLE:v,EMBEDDED:"embedded"},w.ENGINE={NAME:t,VERSION:o},w.OS={NAME:t,VERSION:o},S.exports&&(O=S.exports=w),O.UAParser=w;var b=r.jQuery||r.Zepto;if(typeof b!==f){var I=new w;b.ua=I.getResult(),b.ua.get=function(){return I.getUA()},b.ua.set=function(e){I.setUA(e);var t=I.getResult();for(var n in t)b.ua[n]=t[n]}}}("object"==typeof window?window:e)}),Oe=(Se.UAParser,function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}),Ee="4.6.0",Ne={apiEndpoint:"api.amplitude.com",batchEvents:!1,cookieExpiration:3650,cookieName:"amplitude_id",deviceIdFromUrlParam:!1,domain:"",eventUploadPeriodMillis:3e4,eventUploadThreshold:30,forceHttps:!0,includeGclid:!1,includeReferrer:!1,includeUtm:!1,language:{language:navigator&&(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage)||void 0}.language,logLevel:"WARN",optOut:!1,platform:"Web",savedMaxCount:1e3,saveEvents:!0,saveParamsReferrerOncePerSession:!0,secureCookie:!1,sessionTimeout:18e5,trackingOptions:{city:!0,country:!0,device_model:!0,dma:!0,ip_address:!0,language:!0,os_name:!0,os_version:!0,platform:!0,region:!0,version_name:!0},unsetParamsReferrerOnNewSession:!1,unsentKey:"amplitude_unsent",unsentIdentifyKey:"amplitude_unsent_identify",uploadBatchSize:100},xe=function(e){this._instanceName=V(e)?l:e.toLowerCase(),this._legacyStorageSuffix=this._instanceName===l?"":"_"+this._instanceName,this._unsentEvents=[],this._unsentIdentifys=[],this._ua=new Se(navigator.userAgent).getResult(),this.options=R({},Ne,{trackingOptions:R({},Ne.trackingOptions)}),this.cookieStorage=(new ue).getStorage(),this._q=[],this._sending=!1,this._updateScheduled=!1,this._eventId=0,this._identifyId=0,this._lastEventTime=null,this._newSession=!1,this._sequenceNumber=0,this._sessionId=null,this._userAgent=navigator&&navigator.userAgent||null};xe.prototype.Identify=ce,xe.prototype.Revenue=Ie,xe.prototype.init=function(e,t,n,i){if("string"!==q(e)||V(e))G.error("Invalid apiKey. Please re-initialize with a valid apiKey");else try{this.options.apiKey=e,this._storageSuffix="_"+e+this._legacyStorageSuffix,ke(this.options,n),"string"===q(this.options.logLevel)&&F(this.options.logLevel);var r=Ue(this);if(this._apiPropertiesTrackingOptions=0<Object.keys(r).length?{tracking_options:r}:{},this.cookieStorage.options({expirationDays:this.options.cookieExpiration,domain:this.options.domain,secure:this.options.secureCookie}),this.options.domain=this.cookieStorage.options().domain,this._instanceName===l&&Ae(this),Pe(this),this.options.deviceId="object"===q(n)&&"string"===q(n.deviceId)&&!V(n.deviceId)&&n.deviceId||this.options.deviceIdFromUrlParam&&this._getDeviceIdFromUrlParam(this._getUrlParams())||this.options.deviceId||Oe()+"R",this.options.userId="string"===q(t)&&!V(t)&&t||"number"===q(t)&&t.toString()||this.options.userId||null,this.options.saveEvents){this._unsentEvents=this._loadSavedUnsentEvents(this.options.unsentKey),this._unsentIdentifys=this._loadSavedUnsentEvents(this.options.unsentIdentifyKey);for(var o=0;o<this._unsentEvents.length;o++){var s=this._unsentEvents[o].event_properties,a=this._unsentEvents[o].groups;this._unsentEvents[o].event_properties=Q(s),this._unsentEvents[o].groups=X(a)}for(var u=0;u<this._unsentIdentifys.length;u++){var p=this._unsentIdentifys[u].user_properties,c=this._unsentIdentifys[u].groups;this._unsentIdentifys[u].user_properties=Q(p),this._unsentIdentifys[u].groups=X(c)}}var d=(new Date).getTime();(!this._sessionId||!this._lastEventTime||d-this._lastEventTime>this.options.sessionTimeout)&&(this.options.unsetParamsReferrerOnNewSession&&this._unsetUTMParams(),this._newSession=!0,this._sessionId=d,this.options.saveParamsReferrerOncePerSession&&this._trackParamsAndReferrer()),this.options.saveParamsReferrerOncePerSession||this._trackParamsAndReferrer(),this._lastEventTime=d,Re(this),this._sendEventsIfReady()}catch(e){G.error(e)}finally{"function"===q(i)&&i(this)}},xe.prototype._trackParamsAndReferrer=function(){this.options.includeUtm&&this._initUtmData(),this.options.includeReferrer&&this._saveReferrer(this._getReferrer()),this.options.includeGclid&&this._saveGclid(this._getUrlParams())};var ke=function i(r,o){if("object"===q(o)){var e=function(e){if(r.hasOwnProperty(e)){var t=o[e],n=q(r[e]);H(t,e+" option",n)&&("boolean"===n?r[e]=!!t:"string"===n&&!V(t)||"number"===n&&0<t?r[e]=t:"object"===n&&i(r[e],t))}};for(var t in o)o.hasOwnProperty(t)&&e(t)}};xe.prototype.runQueuedFunctions=function(){for(var e=0;e<this._q.length;e++){var t=this[this._q[e][0]];"function"===q(t)&&t.apply(this,this._q[e].slice(1))}this._q=[]},xe.prototype._apiKeySet=function(e){return!V(this.options.apiKey)||(G.error("Invalid apiKey. Please set a valid apiKey with init() before calling "+e),!1)},xe.prototype._loadSavedUnsentEvents=function(e){var t=this._getFromStorage(ae,e),n=this._parseSavedUnsentEventsString(t,e),i=this._getFromStorageLegacy(ae,e),r=this._parseSavedUnsentEventsString(i,e).concat(n);return this._removeFromLegacyStorage(ae,e),this._setInStorage(ae,e,JSON.stringify(r)),r},xe.prototype._removeFromLegacyStorage=function(e,t){e.removeItem(t+this._legacyStorageSuffix)},xe.prototype._parseSavedUnsentEventsString=function(e,t){if(V(e))return[];if("string"===q(e))try{var n=JSON.parse(e);if("array"===q(n))return n}catch(e){}return G.error("Unable to load "+t+" events. Restart with a new empty queue."),[]},xe.prototype.isNewSession=function(){return this._newSession},xe.prototype.getSessionId=function(){return this._sessionId},xe.prototype.nextEventId=function(){return this._eventId++,this._eventId},xe.prototype.nextIdentifyId=function(){return this._identifyId++,this._identifyId},xe.prototype.nextSequenceNumber=function(){return this._sequenceNumber++,this._sequenceNumber},xe.prototype._unsentCount=function(){return this._unsentEvents.length+this._unsentIdentifys.length},xe.prototype._sendEventsIfReady=function(e){return 0!==this._unsentCount()&&(this.options.batchEvents?this._unsentCount()>=this.options.eventUploadThreshold?(this.sendEvents(e),!0):(this._updateScheduled||(this._updateScheduled=!0,setTimeout(function(){this._updateScheduled=!1,this.sendEvents()}.bind(this),this.options.eventUploadPeriodMillis)),!1):(this.sendEvents(e),!0))},xe.prototype._getFromStorage=function(e,t){return e.getItem(t+this._storageSuffix)},xe.prototype._getFromStorageLegacy=function(e,t){return e.getItem(t+this._legacyStorageSuffix)},xe.prototype._setInStorage=function(e,t,n){e.setItem(t+this._storageSuffix,n)};var Ae=function(e){var t=e.cookieStorage.get(e.options.cookieName+e._storageSuffix);if("object"!==q(t)&&!("object"===q(t=e.cookieStorage.get(e.options.cookieName+e._legacyStorageSuffix))&&t.deviceId&&t.sessionId&&t.lastEventTime)){var n=function(e){var t=ae.getItem(e);return ae.removeItem(e),t},i="string"===q(e.options.apiKey)&&"_"+e.options.apiKey.slice(0,6)||"",r=n(w+i),o=n(I+i),s=n(b+i);null!=s&&(s="true"===String(s));var a=parseInt(n(_)),u=parseInt(n(g)),p=parseInt(n(v)),c=parseInt(n(y)),d=parseInt(n(m)),l=function(e){return"object"===q(t)&&t[e]};e.options.deviceId=l("deviceId")||r,e.options.userId=l("userId")||o,e._sessionId=l("sessionId")||a||e._sessionId,e._lastEventTime=l("lastEventTime")||u||e._lastEventTime,e._eventId=l("eventId")||p||e._eventId,e._identifyId=l("identifyId")||c||e._identifyId,e._sequenceNumber=l("sequenceNumber")||d||e._sequenceNumber,e.options.optOut=s||!1,t&&void 0!==t.optOut&&null!==t.optOut&&(e.options.optOut="true"===String(t.optOut)),Re(e)}},Pe=function(e){var t=e.cookieStorage.get(e.options.cookieName+e._storageSuffix);if("object"===q(t))Te(e,t);else{var n=e.cookieStorage.get(e.options.cookieName+e._legacyStorageSuffix);"object"===q(n)&&(e.cookieStorage.remove(e.options.cookieName+e._legacyStorageSuffix),Te(e,n))}},Te=function(e,t){t.deviceId&&(e.options.deviceId=t.deviceId),t.userId&&(e.options.userId=t.userId),null!==t.optOut&&void 0!==t.optOut&&(e.options.optOut=t.optOut),t.sessionId&&(e._sessionId=parseInt(t.sessionId)),t.lastEventTime&&(e._lastEventTime=parseInt(t.lastEventTime)),t.eventId&&(e._eventId=parseInt(t.eventId)),t.identifyId&&(e._identifyId=parseInt(t.identifyId)),t.sequenceNumber&&(e._sequenceNumber=parseInt(t.sequenceNumber))},Re=function(e){e.cookieStorage.set(e.options.cookieName+e._storageSuffix,{deviceId:e.options.deviceId,userId:e.options.userId,optOut:e.options.optOut,sessionId:e._sessionId,lastEventTime:e._lastEventTime,eventId:e._eventId,identifyId:e._identifyId,sequenceNumber:e._sequenceNumber})};xe.prototype._initUtmData=function(e,t){e=e||this._getUrlParams(),t=t||this.cookieStorage.get("__utmz");var n,i,r,o,s,a,u,p,c,d,l,f=(i=e,r=(n=t)?"?"+n.split(".").slice(-1)[0].replace(/\|/g,"&"):"",s=(o=function(e,t,n,i){return $(e,t)||$(n,i)})(S,i,"utmcsr",r),a=o(O,i,"utmcmd",r),u=o(E,i,"utmccn",r),p=o(N,i,"utmctr",r),c=o(x,i,"utmcct",r),d={},(l=function(e,t){V(t)||(d[e]=t)})(S,s),l(O,a),l(E,u),l(N,p),l(x,c),d);je(this,f)},xe.prototype._unsetUTMParams=function(){var e=new ce;e.unset(d),e.unset(S),e.unset(O),e.unset(E),e.unset(N),e.unset(x),this.identify(e)};var je=function(e,t){if("object"===q(t)&&0!==Object.keys(t).length){var n=new ce;for(var i in t)t.hasOwnProperty(i)&&(n.setOnce("initial_"+i,t[i]),n.set(i,t[i]));e.identify(n)}};xe.prototype._getReferrer=function(){return document.referrer},xe.prototype._getUrlParams=function(){return location.search},xe.prototype._saveGclid=function(e){var t=$("gclid",e);V(t)||je(this,{gclid:t})},xe.prototype._getDeviceIdFromUrlParam=function(e){return $(p,e)},xe.prototype._getReferringDomain=function(e){if(V(e))return null;var t=e.split("/");return 3<=t.length?t[2]:null},xe.prototype._saveReferrer=function(e){if(!V(e)){var t={referrer:e,referring_domain:this._getReferringDomain(e)};je(this,t)}},xe.prototype.saveEvents=function(){try{this._setInStorage(ae,this.options.unsentKey,JSON.stringify(this._unsentEvents))}catch(e){}try{this._setInStorage(ae,this.options.unsentIdentifyKey,JSON.stringify(this._unsentIdentifys))}catch(e){}},xe.prototype.setDomain=function(e){if(H(e,"domain","string"))try{this.cookieStorage.options({domain:e}),this.options.domain=this.cookieStorage.options().domain,Pe(this),Re(this)}catch(e){G.error(e)}},xe.prototype.setUserId=function(e){try{this.options.userId=null!=e&&""+e||null,Re(this)}catch(e){G.error(e)}},xe.prototype.setGroup=function(e,t){if(this._apiKeySet("setGroup()")&&H(e,"groupType","string")&&!V(e)){var n={};n[e]=t;var i=(new ce).set(e,t);this._logEvent(f,null,null,i.userPropertiesOperations,n,null,null,null)}},xe.prototype.setOptOut=function(e){if(H(e,"enable","boolean"))try{this.options.optOut=e,Re(this)}catch(e){G.error(e)}},xe.prototype.setSessionId=function(e){if(H(e,"sessionId","number"))try{this._sessionId=e,Re(this)}catch(e){G.error(e)}},xe.prototype.resetSessionId=function(){this.setSessionId((new Date).getTime())},xe.prototype.regenerateDeviceId=function(){this.setDeviceId(Oe()+"R")},xe.prototype.setDeviceId=function(e){if(H(e,"deviceId","string"))try{V(e)||(this.options.deviceId=""+e,Re(this))}catch(e){G.error(e)}},xe.prototype.setUserProperties=function(e){if(this._apiKeySet("setUserProperties()")&&H(e,"userProperties","object")){var t=J(Q(e));if(0!==Object.keys(t).length){var n=new ce;for(var i in t)t.hasOwnProperty(i)&&n.set(i,t[i]);this.identify(n)}}},xe.prototype.clearUserProperties=function(){if(this._apiKeySet("clearUserProperties()")){var e=new ce;e.clearAll(),this.identify(e)}};var qe=function(e,t){for(var n=0;n<t._q.length;n++){var i=e[t._q[n][0]];"function"===q(i)&&i.apply(e,t._q[n].slice(1))}return e};xe.prototype.identify=function(e,t){if(this._apiKeySet("identify()"))if("object"===q(e)&&e.hasOwnProperty("_q")&&(e=qe(new ce,e)),e instanceof ce){if(0<Object.keys(e.userPropertiesOperations).length)return this._logEvent(f,null,null,e.userPropertiesOperations,null,null,null,t);"function"===q(t)&&t(0,"No request sent",{reason:"No user property operations"})}else G.error("Invalid identify input type. Expected Identify object but saw "+q(e)),"function"===q(t)&&t(0,"No request sent",{reason:"Invalid identify input type"});else"function"===q(t)&&t(0,"No request sent",{reason:"API key is not set"})},xe.prototype.groupIdentify=function(e,t,n,i){var r,o,s;if(this._apiKeySet("groupIdentify()"))if(H(e,"group_type","string")&&!V(e))if(null!=t)if("object"===q(n)&&n.hasOwnProperty("_q")&&(n=qe(new ce,n)),n instanceof ce){if(0<Object.keys(n.userPropertiesOperations).length)return this._logEvent(h,null,null,null,(s=t,(o=e)in(r={})?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s,r),n.userPropertiesOperations,null,i);"function"===q(i)&&i(0,"No request sent",{reason:"No group property operations"})}else G.error("Invalid identify input type. Expected Identify object but saw "+q(n)),"function"===q(i)&&i(0,"No request sent",{reason:"Invalid identify input type"});else"function"===q(i)&&i(0,"No request sent",{reason:"Invalid group name"});else"function"===q(i)&&i(0,"No request sent",{reason:"Invalid group type"});else"function"===q(i)&&i(0,"No request sent",{reason:"API key is not set"})},xe.prototype.setVersionName=function(e){H(e,"versionName","string")&&(this.options.versionName=e)},xe.prototype._logEvent=function(e,t,n,i,r,o,s,a){if(Pe(this),e)if(this.options.optOut)"function"===q(a)&&a(0,"No request sent",{reason:"optOut is set to true"});else try{var u;u=e===f||e===h?this.nextIdentifyId():this.nextEventId();var p=this.nextSequenceNumber(),c="number"===q(s)?s:(new Date).getTime();(!this._sessionId||!this._lastEventTime||c-this._lastEventTime>this.options.sessionTimeout)&&(this._sessionId=c),this._lastEventTime=c,Re(this),i=i||{};var d=R({},this._apiPropertiesTrackingOptions);n=R({},n||{},d),t=t||{},r=r||{},o=o||{};var l={device_id:this.options.deviceId,user_id:this.options.userId,timestamp:c,event_id:u,session_id:this._sessionId||-1,event_type:e,version_name:Ce(this,"version_name")&&this.options.versionName||null,platform:Ce(this,"platform")?this.options.platform:null,os_name:Ce(this,"os_name")&&this._ua.browser.name||null,os_version:Ce(this,"os_version")&&this._ua.browser.major||null,device_model:Ce(this,"device_model")&&this._ua.os.name||null,language:Ce(this,"language")?this.options.language:null,api_properties:n,event_properties:J(Q(t)),user_properties:J(Q(i)),uuid:Oe(),library:{name:"amplitude-js",version:Ee},sequence_number:p,groups:J(X(r)),group_properties:J(Q(o)),user_agent:this._userAgent};return e===f||e===h?(this._unsentIdentifys.push(l),this._limitEventsQueued(this._unsentIdentifys)):(this._unsentEvents.push(l),this._limitEventsQueued(this._unsentEvents)),this.options.saveEvents&&this.saveEvents(),this._sendEventsIfReady(a)||"function"!==q(a)||a(0,"No request sent",{reason:"No events to send or upload queued"}),u}catch(e){G.error(e)}else"function"===q(a)&&a(0,"No request sent",{reason:"Missing eventType"})};var Ce=function(e,t){return!!e.options.trackingOptions[t]},Ue=function(e){for(var t=["city","country","dma","ip_address","region"],n={},i=0;i<t.length;i++){var r=t[i];Ce(e,r)||(n[r]=!1)}return n};xe.prototype._limitEventsQueued=function(e){e.length>this.options.savedMaxCount&&e.splice(0,e.length-this.options.savedMaxCount)},xe.prototype.logEvent=function(e,t,n){return this.logEventWithTimestamp(e,t,null,n)},xe.prototype.logEventWithTimestamp=function(e,t,n,i){return this._apiKeySet("logEvent()")?H(e,"eventType","string")?V(e)?("function"===q(i)&&i(0,"No request sent",{reason:"Missing eventType"}),-1):this._logEvent(e,t,null,null,null,null,n,i):("function"===q(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===q(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)},xe.prototype.logEventWithGroups=function(e,t,n,i){return this._apiKeySet("logEventWithGroups()")?H(e,"eventType","string")?this._logEvent(e,t,null,null,n,null,null,i):("function"===q(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===q(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)},xe.prototype.logRevenueV2=function(e){if(this._apiKeySet("logRevenueV2()"))if("object"===q(e)&&e.hasOwnProperty("_q")&&(e=qe(new Ie,e)),e instanceof Ie){if(e&&e._isValidRevenue())return this.logEvent(i,e._toJSONObject())}else G.error("Invalid revenue input type. Expected Revenue object but saw "+q(e))},xe.prototype.removeEvents=function(e,t){Me(this,"_unsentEvents",e),Me(this,"_unsentIdentifys",t)};var Me=function(e,t,n){if(!(n<0)){for(var i=[],r=0;r<e[t].length;r++)e[t][r].event_id>n&&i.push(e[t][r]);e[t]=i}};xe.prototype.sendEvents=function(n){if(this._apiKeySet("sendEvents()"))if(this.options.optOut)"function"===q(n)&&n(0,"No request sent",{reason:"optOut is set to true"});else if(0!==this._unsentCount())if(this._sending)"function"===q(n)&&n(0,"No request sent",{reason:"Request already in progress"});else{this._sending=!0;var e=(this.options.forceHttps?"https":"https:"===window.location.protocol?"https":"http")+"://"+this.options.apiEndpoint+"/",i=Math.min(this._unsentCount(),this.options.uploadBatchSize),t=this._mergeEventsAndIdentifys(i),r=t.maxEventId,o=t.maxIdentifyId,s=JSON.stringify(t.eventsToSend),a=(new Date).getTime(),u={client:this.options.apiKey,e:s,v:c,upload_time:a,checksum:le(c+this.options.apiKey+s+a)},p=this;new be(e,u).send(function(e,t){p._sending=!1;try{200===e&&"success"===t?(p.removeEvents(r,o),p.options.saveEvents&&p.saveEvents(),p._sendEventsIfReady(n)||"function"!==q(n)||n(e,t)):413===e?(1===p.options.uploadBatchSize&&p.removeEvents(r,o),p.options.uploadBatchSize=Math.ceil(i/2),p.sendEvents(n)):"function"===q(n)&&n(e,t)}catch(e){}})}else"function"===q(n)&&n(0,"No request sent",{reason:"No events to send"});else"function"===q(n)&&n(0,"No request sent",{reason:"API key not set"})},xe.prototype._mergeEventsAndIdentifys=function(e){for(var t=[],n=0,i=-1,r=0,o=-1;t.length<e;){var s,a=r>=this._unsentIdentifys.length,u=n>=this._unsentEvents.length;if(u&&a){G.error("Merging Events and Identifys, less events and identifys than expected");break}a?i=(s=this._unsentEvents[n++]).event_id:u?o=(s=this._unsentIdentifys[r++]).event_id:!("sequence_number"in this._unsentEvents[n])||this._unsentEvents[n].sequence_number<this._unsentIdentifys[r].sequence_number?i=(s=this._unsentEvents[n++]).event_id:o=(s=this._unsentIdentifys[r++]).event_id,t.push(s)}return{eventsToSend:t,maxEventId:i,maxIdentifyId:o}},xe.prototype.__VERSION__=Ee;var De=function(){this.options=R({},Ne),this._q=[],this._instances={}};De.prototype.Identify=ce,De.prototype.Revenue=Ie,De.prototype.getInstance=function(e){e=V(e)?l:e.toLowerCase();var t=this._instances[e];return void 0===t&&(t=new xe(e),this._instances[e]=t),t},De.prototype.__VERSION__=Ee;var ze=window.amplitude||{},Be=new De;for(var Ke in Be._q=ze._q||[],ze._iq)ze._iq.hasOwnProperty(Ke)&&(Be.getInstance(Ke)._q=ze._iq[Ke]._q||[]);return Be});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.amplitude=t()}(this,function(){"use strict";var r="$default_instance",c=2,t=4096,a=1e3,f="$identify",h="$groupidentify",v="amplitude_lastEventId",g="amplitude_lastEventTime",m="amplitude_lastIdentifyId",y="amplitude_lastSequenceNumber",_="amplitude_sessionId",w="amplitude_deviceId",b="amplitude_optOut",I="amplitude_userId",n="amplitude_cookie_test",i="revenue_amount",o="$productId",s="$quantity",u="$price",p="$revenueType",d="amp_device_id",l="referrer",S="utm_source",O="utm_medium",E="utm_campaign",N="utm_term",x="utm_content",k=function(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):(127<i&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(63&i|128))}return t},A=function(e){for(var t="",n=0,i=0,r=0,o=0;n<e.length;)(i=e.charCodeAt(n))<128?(t+=String.fromCharCode(i),n++):191<i&&i<224?(r=e.charCodeAt(n+1),t+=String.fromCharCode((31&i)<<6|63&r),n+=2):(r=e.charCodeAt(n+1),o=e.charCodeAt(n+2),t+=String.fromCharCode((15&i)<<12|(63&r)<<6|63&o),n+=3);return t},P={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){try{if(window.btoa&&window.atob)return window.btoa(unescape(encodeURIComponent(e)))}catch(e){}return P._encode(e)},_encode:function(e){var t,n,i,r,o,s,a,u="",p=0;for(e=k(e);p<e.length;)r=(t=e.charCodeAt(p++))>>2,o=(3&t)<<4|(n=e.charCodeAt(p++))>>4,s=(15&n)<<2|(i=e.charCodeAt(p++))>>6,a=63&i,isNaN(n)?s=a=64:isNaN(i)&&(a=64),u=u+P._keyStr.charAt(r)+P._keyStr.charAt(o)+P._keyStr.charAt(s)+P._keyStr.charAt(a);return u},decode:function(e){try{if(window.btoa&&window.atob)return decodeURIComponent(escape(window.atob(e)))}catch(e){}return P._decode(e)},_decode:function(e){var t,n,i,r,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)t=P._keyStr.indexOf(e.charAt(u++))<<2|(r=P._keyStr.indexOf(e.charAt(u++)))>>4,n=(15&r)<<4|(o=P._keyStr.indexOf(e.charAt(u++)))>>2,i=(3&o)<<6|(s=P._keyStr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(i));return a=A(a)}},T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},j=Object.prototype.toString;function q(e){switch(j.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)?"buffer":void 0===(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e))?"undefined":T(e)}var C={DISABLE:0,ERROR:1,WARN:2,INFO:3},U=C.WARN,M={error:function(e){U>=C.ERROR&&D(e)},warn:function(e){U>=C.WARN&&D(e)},info:function(e){U>=C.INFO&&D(e)}},D=function(e){try{console.log("[Amplitude] "+e)}catch(e){}},z=function(e){return"string"===q(e)&&e.length>t?e.substring(0,t):e},B=function(e){var t=q(e);if("object"!==t)return M.error("Error: invalid properties format. Expecting Javascript object, received "+t+", ignoring"),{};if(Object.keys(e).length>a)return M.error("Error: too many properties (more than 1000), ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=i,o=q(r);"string"!==o&&(r=String(r),M.warn("WARNING: Non-string property key, received type "+o+', coercing to string "'+r+'"'));var s=L(r,e[i]);null!==s&&(n[r]=s)}return n},K=["null","nan","undefined","function","arguments","regexp","element"],L=function e(t,n){var i=q(n);if(-1!==K.indexOf(i))M.warn('WARNING: Property key "'+t+'" with invalid value type '+i+", ignoring"),n=null;else if("error"===i)n=String(n),M.warn('WARNING: Property key "'+t+'" with value type error, coercing to '+n);else if("array"===i){for(var r=[],o=0;o<n.length;o++){var s=n[o],a=q(s);"array"!==a&&"object"!==a?r.push(e(t,s)):M.warn("WARNING: Cannot have "+a+" nested in an array property value, skipping")}n=r}else"object"===i&&(n=B(n));return n},W=function(e,t){var n=q(t);if("string"===n)return t;if("date"===n||"number"===n||"boolean"===n)return t=String(t),M.warn("WARNING: Non-string groupName, received type "+n+', coercing to string "'+t+'"'),t;if("array"===n){for(var i=[],r=0;r<t.length;r++){var o=t[r],s=q(o);"array"!==s&&"object"!==s?"string"===s?i.push(o):"date"!==s&&"number"!==s&&"boolean"!==s||(o=String(o),M.warn("WARNING: Non-string groupName, received type "+s+', coercing to string "'+o+'"'),i.push(o)):M.warn("WARNING: Skipping nested "+s+" in array groupName")}return i}M.warn("WARNING: Non-string groupName, received type "+n+". Please use strings or array of strings for groupName")},F=function(e){C.hasOwnProperty(e)&&(U=C[e])},G=M,J=function(e){return!e||0===e.length},V=function(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?void 0:decodeURIComponent(n[1].replace(/\+/g," "))},$=function e(t){if("array"===q(t))for(var n=0;n<t.length;n++)t[n]=e(t[n]);else if("object"===q(t))for(var i in t)t.hasOwnProperty(i)&&(t[i]=e(t[i]));else t=z(t);return t},X=function(e){var t=q(e);if("object"!==t)return M.error("Error: invalid groups format. Expecting Javascript object, received "+t+", ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=i,o=q(r);"string"!==o&&(r=String(r),M.warn("WARNING: Non-string groupType, received type "+o+', coercing to string "'+r+'"'));var s=W(r,e[i]);null!==s&&(n[r]=s)}return n},H=function(e,t,n){return q(e)===n||(M.error("Invalid "+t+" input type. Expected "+n+" but received "+q(e)),!1)},Q=B,Y=function(e,t,n){var i=null!==t?n.expirationDays:-1;if(i){var r=new Date;r.setTime(r.getTime()+24*i*60*60*1e3),i=r}var o=e+"="+t;i&&(o+="; expires="+i.toUTCString()),o+="; path=/",n.domain&&(o+="; domain="+n.domain),n.secure&&(o+="; Secure"),document.cookie=o},Z=function(e){try{for(var t=document.cookie.split(";"),n=null,i=0;i<t.length;i++){for(var r=t[i];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e)){n=r.substring(e.length,r.length);break}}return n}catch(e){return null}},ee={expirationDays:void 0,domain:void 0},te=function(e){var t,n,i=(t=e,(n=document.createElement("a")).href=t,n.hostname||location.hostname).split("."),r=i[i.length-1],o=[];if(4===i.length&&r===parseInt(r,10))return o;if(i.length<=1)return o;for(var s=i.length-2;0<=s;--s)o.push(i.slice(s).join("."));for(var a=0;a<o.length;++a){var u="__tld_test__",p=o[a],c={domain:"."+p};if(Y(u,1,c),Z(u))return Y(u,null,c),p}return""},ne=function(e){var t="";return ee.domain&&(t="."===ee.domain.charAt(0)?ee.domain.substring(1):ee.domain),e+t},ie=function(e){var t=ne(e)+"=",n=Z(t);try{if(n)return JSON.parse(P.decode(n))}catch(e){return null}return null},re=function(e,t){try{return Y(ne(e),P.encode(JSON.stringify(t)),ee),!0}catch(e){return!1}},oe=function(e){try{return Y(ne(e),null,ee),!0}catch(e){return!1}},se={reset:function(){ee={expirationDays:void 0,domain:void 0}},options:function(e){if(0===arguments.length)return ee;e=e||{},ee.expirationDays=e.expirationDays,ee.secure=e.secure;var t=J(e.domain)?"."+te(window.location.href):e.domain,n=Math.random();ee.domain=t,re("amplitude_test",n);var i=ie("amplitude_test");return i&&i===n||(t=null),oe("amplitude_test"),ee.domain=t,ee},get:ie,set:re,remove:oe},ae=window.localStorage,ue=function(){this.storage=null};ue.prototype._cookiesEnabled=function(){var e,t=String(new Date);try{return se.set(n,t),e=se.get(n)===t,se.remove(n),e}catch(e){}return!1},ue.prototype.getStorage=function(){if(null!==this.storage)return this.storage;if(this._cookiesEnabled())this.storage=se;else{var n="amp_cookiestore_";this.storage={_options:{expirationDays:void 0,domain:void 0,secure:!1},reset:function(){this._options={expirationDays:void 0,domain:void 0,secure:!1}},options:function(e){return 0===arguments.length||(e=e||{},this._options.expirationDays=e.expirationDays||this._options.expirationDays,this._options.domain=e.domain||this._options.domain||window.location&&window.location.hostname,this._options.secure=e.secure||!1),this._options},get:function(e){try{return JSON.parse(ae.getItem(n+e))}catch(e){}return null},set:function(e,t){try{return ae.setItem(n+e,JSON.stringify(t)),!0}catch(e){}return!1},remove:function(e){try{ae.removeItem(n+e)}catch(e){return!1}}}}return this.storage};var pe="$clearAll",ce=function(){this.userPropertiesOperations={},this.properties=[]};ce.prototype.add=function(e,t){return"number"===q(t)||"string"===q(t)?this._addOperation("$add",e,t):G.error("Unsupported type for value: "+q(t)+", expecting number or string"),this},ce.prototype.append=function(e,t){return this._addOperation("$append",e,t),this},ce.prototype.clearAll=function(){return 0<Object.keys(this.userPropertiesOperations).length?this.userPropertiesOperations.hasOwnProperty(pe)||G.error("Need to send $clearAll on its own Identify object without any other operations, skipping $clearAll"):this.userPropertiesOperations[pe]="-",this},ce.prototype.prepend=function(e,t){return this._addOperation("$prepend",e,t),this},ce.prototype.set=function(e,t){return this._addOperation("$set",e,t),this},ce.prototype.setOnce=function(e,t){return this._addOperation("$setOnce",e,t),this},ce.prototype.unset=function(e){return this._addOperation("$unset",e,"-"),this},ce.prototype._addOperation=function(e,t,n){this.userPropertiesOperations.hasOwnProperty(pe)?G.error("This identify already contains a $clearAll operation, skipping operation "+e):-1===this.properties.indexOf(t)?(this.userPropertiesOperations.hasOwnProperty(e)||(this.userPropertiesOperations[e]={}),this.userPropertiesOperations[e][t]=n,this.properties.push(t)):G.error('User property "'+t+'" already used in this identify, skipping operation '+e)};var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function de(e,t){return e(t={exports:{}},t.exports),t.exports}var le=de(function(s){!function(e){function d(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t,n,i,r,o){return d((s=d(d(t,e),d(i,o)))<<(a=r)|s>>>32-a,n);var s,a}function l(e,t,n,i,r,o,s){return a(t&n|~t&i,e,t,r,o,s)}function f(e,t,n,i,r,o,s){return a(t&i|n&~i,e,t,r,o,s)}function h(e,t,n,i,r,o,s){return a(t^n^i,e,t,r,o,s)}function v(e,t,n,i,r,o,s){return a(n^(t|~i),e,t,r,o,s)}function u(e,t){var n,i,r,o,s;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var a=1732584193,u=-271733879,p=-1732584194,c=271733878;for(n=0;n<e.length;n+=16)u=v(u=v(u=v(u=v(u=h(u=h(u=h(u=h(u=f(u=f(u=f(u=f(u=l(u=l(u=l(u=l(r=u,p=l(o=p,c=l(s=c,a=l(i=a,u,p,c,e[n],7,-680876936),u,p,e[n+1],12,-389564586),a,u,e[n+2],17,606105819),c,a,e[n+3],22,-1044525330),p=l(p,c=l(c,a=l(a,u,p,c,e[n+4],7,-176418897),u,p,e[n+5],12,1200080426),a,u,e[n+6],17,-1473231341),c,a,e[n+7],22,-45705983),p=l(p,c=l(c,a=l(a,u,p,c,e[n+8],7,1770035416),u,p,e[n+9],12,-1958414417),a,u,e[n+10],17,-42063),c,a,e[n+11],22,-1990404162),p=l(p,c=l(c,a=l(a,u,p,c,e[n+12],7,1804603682),u,p,e[n+13],12,-40341101),a,u,e[n+14],17,-1502002290),c,a,e[n+15],22,1236535329),p=f(p,c=f(c,a=f(a,u,p,c,e[n+1],5,-165796510),u,p,e[n+6],9,-1069501632),a,u,e[n+11],14,643717713),c,a,e[n],20,-373897302),p=f(p,c=f(c,a=f(a,u,p,c,e[n+5],5,-701558691),u,p,e[n+10],9,38016083),a,u,e[n+15],14,-660478335),c,a,e[n+4],20,-405537848),p=f(p,c=f(c,a=f(a,u,p,c,e[n+9],5,568446438),u,p,e[n+14],9,-1019803690),a,u,e[n+3],14,-187363961),c,a,e[n+8],20,1163531501),p=f(p,c=f(c,a=f(a,u,p,c,e[n+13],5,-1444681467),u,p,e[n+2],9,-51403784),a,u,e[n+7],14,1735328473),c,a,e[n+12],20,-1926607734),p=h(p,c=h(c,a=h(a,u,p,c,e[n+5],4,-378558),u,p,e[n+8],11,-2022574463),a,u,e[n+11],16,1839030562),c,a,e[n+14],23,-35309556),p=h(p,c=h(c,a=h(a,u,p,c,e[n+1],4,-1530992060),u,p,e[n+4],11,1272893353),a,u,e[n+7],16,-155497632),c,a,e[n+10],23,-1094730640),p=h(p,c=h(c,a=h(a,u,p,c,e[n+13],4,681279174),u,p,e[n],11,-358537222),a,u,e[n+3],16,-722521979),c,a,e[n+6],23,76029189),p=h(p,c=h(c,a=h(a,u,p,c,e[n+9],4,-640364487),u,p,e[n+12],11,-421815835),a,u,e[n+15],16,530742520),c,a,e[n+2],23,-995338651),p=v(p,c=v(c,a=v(a,u,p,c,e[n],6,-198630844),u,p,e[n+7],10,1126891415),a,u,e[n+14],15,-1416354905),c,a,e[n+5],21,-57434055),p=v(p,c=v(c,a=v(a,u,p,c,e[n+12],6,1700485571),u,p,e[n+3],10,-1894986606),a,u,e[n+10],15,-1051523),c,a,e[n+1],21,-2054922799),p=v(p,c=v(c,a=v(a,u,p,c,e[n+8],6,1873313359),u,p,e[n+15],10,-30611744),a,u,e[n+6],15,-1560198380),c,a,e[n+13],21,1309151649),p=v(p,c=v(c,a=v(a,u,p,c,e[n+4],6,-145523070),u,p,e[n+11],10,-1120210379),a,u,e[n+2],15,718787259),c,a,e[n+9],21,-343485551),a=d(a,i),u=d(u,r),p=d(p,o),c=d(c,s);return[a,u,p,c]}function p(e){var t,n="",i=32*e.length;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function c(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var i=8*e.length;for(t=0;t<i;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function i(e){var t,n,i="0123456789abcdef",r="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),r+=i.charAt(t>>>4&15)+i.charAt(15&t);return r}function n(e){return unescape(encodeURIComponent(e))}function r(e){return p(u(c(t=n(e)),8*t.length));var t}function o(e,t){return function(e,t){var n,i,r=c(e),o=[],s=[];for(o[15]=s[15]=void 0,16<r.length&&(r=u(r,8*e.length)),n=0;n<16;n+=1)o[n]=909522486^r[n],s[n]=1549556828^r[n];return i=u(o.concat(c(t)),512+8*t.length),p(u(s.concat(i),640))}(n(e),n(t))}function t(e,t,n){return t?n?o(t,e):i(o(t,e)):n?r(e):i(r(e))}s.exports?s.exports=t:e.md5=t}(e)}),fe=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})},he=Object.getOwnPropertySymbols,ve=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var me=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,r=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var s in n=Object(arguments[o]))ve.call(n,s)&&(r[s]=n[s]);if(he){i=he(n);for(var a=0;a<i.length;a++)ge.call(n,i[a])&&(r[i[a]]=n[i[a]])}}return r},ye="%[a-f0-9]{2}";new RegExp(ye,"gi"),new RegExp("("+ye+")+","gi");function _e(e,t){return t.encode?t.strict?fe(e):encodeURIComponent(e):e}var we=function(i,r){!1===(r=me({encode:!0,strict:!0,arrayFormat:"none"},r)).sort&&(r.sort=function(){});var o=function(i){switch(i.arrayFormat){case"index":return function(e,t,n){return null===t?[_e(e,i),"[",n,"]"].join(""):[_e(e,i),"[",_e(n,i),"]=",_e(t,i)].join("")};case"bracket":return function(e,t){return null===t?_e(e,i):[_e(e,i),"[]=",_e(t,i)].join("")};default:return function(e,t){return null===t?_e(e,i):[_e(e,i),"=",_e(t,i)].join("")}}}(r);return i?Object.keys(i).sort(r.sort).map(function(t){var e=i[t];if(void 0===e)return"";if(null===e)return _e(t,r);if(Array.isArray(e)){var n=[];return e.slice().forEach(function(e){void 0!==e&&n.push(o(t,e,n.length))}),n.join("&")}return _e(t,r)+"="+_e(e,r)}).filter(function(e){return 0<e.length}).join("&"):""},be=function(e,t){this.url=e,this.data=t||{}};be.prototype.send=function(e){if(!!window.XDomainRequest){var t=new window.XDomainRequest;t.open("POST",this.url,!0),t.onload=function(){e(200,t.responseText)},t.onerror=function(){"Request Entity Too Large"===t.responseText?e(413,t.responseText):e(500,t.responseText)},t.ontimeout=function(){},t.onprogress=function(){},t.send(we(this.data))}else{var n=new XMLHttpRequest;n.open("POST",this.url,!0),n.onreadystatechange=function(){4===n.readyState&&e(n.status,n.responseText)},n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),n.send(we(this.data))}};var Ie=function(){this._price=null,this._productId=null,this._quantity=1,this._revenueType=null,this._properties=null};Ie.prototype.setProductId=function(e){return"string"!==q(e)?G.error("Unsupported type for productId: "+q(e)+", expecting string"):J(e)?G.error("Invalid empty productId"):this._productId=e,this},Ie.prototype.setQuantity=function(e){return"number"!==q(e)?G.error("Unsupported type for quantity: "+q(e)+", expecting number"):this._quantity=parseInt(e),this},Ie.prototype.setPrice=function(e){return"number"!==q(e)?G.error("Unsupported type for price: "+q(e)+", expecting number"):this._price=e,this},Ie.prototype.setRevenueType=function(e){return"string"!==q(e)?G.error("Unsupported type for revenueType: "+q(e)+", expecting string"):this._revenueType=e,this},Ie.prototype.setEventProperties=function(e){return"object"!==q(e)?G.error("Unsupported type for eventProperties: "+q(e)+", expecting object"):this._properties=Q(e),this},Ie.prototype._isValidRevenue=function(){return"number"===q(this._price)||(G.error("Invalid revenue, need to set price field"),!1)},Ie.prototype._toJSONObject=function(){var e="object"===q(this._properties)?this._properties:{};return null!==this._productId&&(e[o]=this._productId),null!==this._quantity&&(e[s]=this._quantity),null!==this._price&&(e[u]=this._price),null!==this._revenueType&&(e[p]=this._revenueType),e};var Se=de(function(S,O){!function(r,d){var l="function",f="undefined",h="object",e="model",t="name",n="type",i="vendor",o="version",s="architecture",a="console",u="mobile",p="tablet",c="smarttv",v="wearable",g={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.split(".")[0]:d}},m={rgx:function(){for(var e,t,n,i,r,o,s,a=0,u=arguments;a<u.length&&!o;){var p=u[a],c=u[a+1];if(typeof e===f)for(i in e={},c)c.hasOwnProperty(i)&&(typeof(r=c[i])===h?e[r[0]]=d:e[r]=d);for(t=n=0;t<p.length&&!o;)if(o=p[t++].exec(this.getUA()))for(i=0;i<c.length;i++)s=o[++n],typeof(r=c[i])===h&&0<r.length?2==r.length?typeof r[1]==l?e[r[0]]=r[1].call(this,s):e[r[0]]=r[1]:3==r.length?typeof r[1]!==l||r[1].exec&&r[1].test?e[r[0]]=s?s.replace(r[1],r[2]):d:e[r[0]]=s?r[1].call(this,s,r[2]):d:4==r.length&&(e[r[0]]=s?r[3].call(this,s.replace(r[1],r[2])):d):e[r]=s||d;a+=2}return e},str:function(e,t){for(var n in t)if(typeof t[n]===h&&0<t[n].length){for(var i=0;i<t[n].length;i++)if(g.has(t[n][i],e))return"?"===n?d:n}else if(g.has(t[n],e))return"?"===n?d:n;return e}},y={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},name:{"Opera Mobile":"Opera Mobi","IE Mobile":"IEMobile"}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},name:{"Windows Phone":"Windows Phone OS"}}}},_={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[t,o],[/(OPiOS)[\/\s]+([\w\.]+)/i],[[t,"Opera Mini"],o],[/\s(opr)\/([\w\.]+)/i],[[t,"Opera"],o],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i],[t,o],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[t,"IE"],o],[/(edge)\/((\d+)?[\w\.]+)/i],[t,o],[/(yabrowser)\/([\w\.]+)/i],[[t,"Yandex"],o],[/(comodo_dragon)\/([\w\.]+)/i],[[t,/_/g," "],o],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[t,"Chrome Mobile"],o],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(qqbrowser)[\/\s]?([\w\.]+)/i],[t,o],[/(uc\s?browser)[\/\s]?([\w\.]+)/i,/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,/JUC.+(ucweb)[\/\s]?([\w\.]+)/i],[[t,"UCBrowser"],o],[/(dolfin)\/([\w\.]+)/i],[[t,"Dolphin"],o],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[o,[t,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[o,[t,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[o,[t,"Facebook"]],[/fxios\/([\w\.-]+)/i],[o,[t,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[o,[t,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[o,t],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[t,[o,m.str,y.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[t,o],[/(blackberry)\\s?\/([\w\.]+)/i],[[t,"BlackBerry"],o],[/(navigator|netscape)\/([\w\.-]+)/i],[[t,"Netscape"],o],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[t,o]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[s,"amd64"]],[/(ia32(?=;))/i],[[s,g.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[s,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[s,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[s,/ower/,"",g.lowerize]],[/(sun4\w)[;\)]/i],[[s,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[s,g.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[e,i,[n,p]],[/applecoremedia\/[\w\.]+ \((ipad)/],[e,[i,"Apple"],[n,p]],[/(apple\s{0,1}tv)/i],[[e,"Apple TV"],[i,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[i,e,[n,p]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[e,[i,"Amazon"],[n,p]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[e,m.str,y.device.amazon.model],[i,"Amazon"],[n,u]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[e,i,[n,u]],[/\((ip[honed|\s\w*]+);/i],[e,[i,"Apple"],[n,u]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[i,e,[n,u]],[/\(bb10;\s(\w+)/i],[e,[i,"BlackBerry"],[n,u]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],[e,[i,"Asus"],[n,p]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[i,"Sony"],[e,"Xperia Tablet"],[n,p]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[[i,"Sony"],[e,"Xperia Phone"],[n,u]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[i,e,[n,a]],[/android.+;\s(shield)\sbuild/i],[e,[i,"Nvidia"],[n,a]],[/(playstation\s[34portablevi]+)/i],[e,[i,"Sony"],[n,a]],[/(sprint\s(\w+))/i],[[i,m.str,y.device.sprint.vendor],[e,m.str,y.device.sprint.model],[n,u]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[i,e,[n,p]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[i,[e,/_/g," "],[n,u]],[/(nexus\s9)/i],[e,[i,"HTC"],[n,p]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[e,[i,"Microsoft"],[n,a]],[/(kin\.[onetw]{3})/i],[[e,/\./g," "],[i,"Microsoft"],[n,u]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i,/(nexus\s[6])/i],[e,[i,"Motorola"],[n,u]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[e,[i,"Motorola"],[n,p]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[i,"Samsung"],e,[n,p]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[i,"Samsung"],e,[n,u]],[/(samsung);smarttv/i],[i,e,[n,c]],[/\(dtv[\);].+(aquos)/i],[e,[i,"Sharp"],[n,c]],[/sie-(\w+)*/i],[e,[i,"Siemens"],[n,u]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[i,"Nokia"],e,[n,u]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[e,[i,"Acer"],[n,p]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[i,"LG"],e,[n,p]],[/(lg) netcast\.tv/i],[i,e,[n,c]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[e,[i,"LG"],[n,u]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[e,[i,"Lenovo"],[n,p]],[/linux;.+((jolla));/i],[i,e,[n,u]],[/((pebble))app\/[\d\.]+\s/i],[i,e,[n,v]],[/android.+;\s(glass)\s\d/i],[e,[i,"Google"],[n,v]],[/android.+(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i],[[e,/_/g," "],[i,"Xiaomi"],[n,u]],[/\s(tablet)[;\/\s]/i,/\s(mobile)[;\/\s]/i],[[n,g.lowerize],i,e]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[o,[t,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[t,o],[/rv\:([\w\.]+).*(gecko)/i],[o,t]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[t,o],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[t,m.str,y.os.windows.name],[o,m.str,y.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[t,"Windows"],[o,m.str,y.os.windows.version]],[/\((bb)(10);/i],[[t,"BlackBerry"],o],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[t,o],[/(symbian\s?o?s?|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[t,"Symbian"],o],[/\((series40);/i],[t],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[t,"Firefox OS"],o],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[[t,"Linux"],o],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[t,"Chromium OS"],o],[/(sunos)\s?([\w\.]+\d)*/i],[[t,"Solaris"],o],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[[t,"Linux"],o],[/(iphone)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[t,"iPhone"],[o,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[t,"iPad"],[o,/_/g,"."]],[/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i],[[t,"iOS"],[o,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[t,"Mac"],[o,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[t,o]]},w=function(e,t){if(!(this instanceof w))return new w(e,t).getResult();var n=e||(r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),i=t?g.extend(_,t):_;return this.getBrowser=function(){var e=m.rgx.apply(this,i.browser);return e.major=g.major(e.version),e},this.getCPU=function(){return m.rgx.apply(this,i.cpu)},this.getDevice=function(){return m.rgx.apply(this,i.device)},this.getEngine=function(){return m.rgx.apply(this,i.engine)},this.getOS=function(){return m.rgx.apply(this,i.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};w.VERSION="0.7.10",w.BROWSER={NAME:t,MAJOR:"major",VERSION:o},w.CPU={ARCHITECTURE:s},w.DEVICE={MODEL:e,VENDOR:i,TYPE:n,CONSOLE:a,MOBILE:u,SMARTTV:c,TABLET:p,WEARABLE:v,EMBEDDED:"embedded"},w.ENGINE={NAME:t,VERSION:o},w.OS={NAME:t,VERSION:o},S.exports&&(O=S.exports=w),O.UAParser=w;var b=r.jQuery||r.Zepto;if(typeof b!==f){var I=new w;b.ua=I.getResult(),b.ua.get=function(){return I.getUA()},b.ua.set=function(e){I.setUA(e);var t=I.getResult();for(var n in t)b.ua[n]=t[n]}}}("object"==typeof window?window:e)}),Oe=(Se.UAParser,function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}),Ee="4.7.0-react-native",Ne={apiEndpoint:"api.amplitude.com",batchEvents:!1,cookieExpiration:3650,cookieName:"amplitude_id",deviceIdFromUrlParam:!1,domain:"",eventUploadPeriodMillis:3e4,eventUploadThreshold:30,forceHttps:!0,includeGclid:!1,includeReferrer:!1,includeUtm:!1,language:{language:navigator&&(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage)||void 0}.language,logLevel:"WARN",optOut:!1,platform:"Web",savedMaxCount:1e3,saveEvents:!0,saveParamsReferrerOncePerSession:!0,secureCookie:!1,sessionTimeout:18e5,trackingOptions:{city:!0,country:!0,device_model:!0,dma:!0,ip_address:!0,language:!0,os_name:!0,os_version:!0,platform:!0,region:!0,version_name:!0},unsetParamsReferrerOnNewSession:!1,unsentKey:"amplitude_unsent",unsentIdentifyKey:"amplitude_unsent_identify",uploadBatchSize:100},xe=void 0;if(window.navigator&&"ReactNative"===window.navigator.product){var ke=require("react-native");xe=ke.AsyncStorage}var Ae=function(e){this._instanceName=J(e)?r:e.toLowerCase(),this._legacyStorageSuffix=this._instanceName===r?"":"_"+this._instanceName,this._unsentEvents=[],this._unsentIdentifys=[],this._ua=new Se(navigator.userAgent).getResult(),this.options=R({},Ne,{trackingOptions:R({},Ne.trackingOptions)}),this.cookieStorage=(new ue).getStorage(),this._q=[],this._sending=!1,this._updateScheduled=!1,this._eventId=0,this._identifyId=0,this._lastEventTime=null,this._newSession=!1,this._sequenceNumber=0,this._sessionId=null,this._userAgent=navigator&&navigator.userAgent||null};Ae.prototype.Identify=ce,Ae.prototype.Revenue=Ie,Ae.prototype.init=function(e,a,u,t){var p=this;if("string"!==q(e)||J(e))G.error("Invalid apiKey. Please re-initialize with a valid apiKey");else try{this.options.apiKey=e,this._storageSuffix="_"+e+this._legacyStorageSuffix,Pe(this.options,u),"string"===q(this.options.logLevel)&&F(this.options.logLevel);var n=De(this);this._apiPropertiesTrackingOptions=0<Object.keys(n).length?{tracking_options:n}:{},this.cookieStorage.options({expirationDays:this.options.cookieExpiration,domain:this.options.domain,secure:this.options.secureCookie}),this.options.domain=this.cookieStorage.options().domain,this._instanceName===r&&Te(this),Re(this),this._pendingReadStorage=!0;var i=function(){if(p.options.deviceId="object"===q(u)&&"string"===q(u.deviceId)&&!J(u.deviceId)&&u.deviceId||p.options.deviceIdFromUrlParam&&p._getDeviceIdFromUrlParam(p._getUrlParams())||p.options.deviceId||Oe()+"R",p.options.userId="string"===q(a)&&!J(a)&&a||"number"===q(a)&&a.toString()||p.options.userId||null,p.options.saveEvents){p._unsentEvents=p._loadSavedUnsentEvents(p.options.unsentKey),p._unsentIdentifys=p._loadSavedUnsentEvents(p.options.unsentIdentifyKey);for(var e=0;e<p._unsentEvents.length;e++){var t=p._unsentEvents[e].event_properties,n=p._unsentEvents[e].groups;p._unsentEvents[e].event_properties=Q(t),p._unsentEvents[e].groups=X(n)}for(var i=0;i<p._unsentIdentifys.length;i++){var r=p._unsentIdentifys[i].user_properties,o=p._unsentIdentifys[i].groups;p._unsentIdentifys[i].user_properties=Q(r),p._unsentIdentifys[i].groups=X(o)}}var s=(new Date).getTime();p._lastEventTime=s,qe(p),(!p._sessionId||!p._lastEventTime||s-p._lastEventTime>p.options.sessionTimeout)&&(p.options.unsetParamsReferrerOnNewSession&&p._unsetUTMParams(),p._newSession=!0,p._sessionId=s,p.options.saveParamsReferrerOncePerSession&&p._trackParamsAndReferrer()),p.options.saveParamsReferrerOncePerSession||p._trackParamsAndReferrer(),p._pendingReadStorage=!1};xe?xe.getItem(this._storageSuffix).then(function(e){var t=JSON.parse(e);je(p,t),i()}):i(),this._sendEventsIfReady()}catch(e){G.error(e)}finally{"function"===q(t)&&t(this)}},Ae.prototype._trackParamsAndReferrer=function(){this.options.includeUtm&&this._initUtmData(),this.options.includeReferrer&&this._saveReferrer(this._getReferrer()),this.options.includeGclid&&this._saveGclid(this._getUrlParams())};var Pe=function i(r,o){if("object"===q(o)){var e=function(e){if(r.hasOwnProperty(e)){var t=o[e],n=q(r[e]);H(t,e+" option",n)&&("boolean"===n?r[e]=!!t:"string"===n&&!J(t)||"number"===n&&0<t?r[e]=t:"object"===n&&i(r[e],t))}};for(var t in o)o.hasOwnProperty(t)&&e(t)}};Ae.prototype.runQueuedFunctions=function(){for(var e=0;e<this._q.length;e++){var t=this[this._q[e][0]];"function"===q(t)&&t.apply(this,this._q[e].slice(1))}this._q=[]},Ae.prototype._apiKeySet=function(e){return!J(this.options.apiKey)||(G.error("Invalid apiKey. Please set a valid apiKey with init() before calling "+e),!1)},Ae.prototype._loadSavedUnsentEvents=function(e){var t=this._getFromStorage(ae,e),n=this._parseSavedUnsentEventsString(t,e),i=this._getFromStorageLegacy(ae,e),r=this._parseSavedUnsentEventsString(i,e).concat(n);return this._removeFromLegacyStorage(ae,e),this._setInStorage(ae,e,JSON.stringify(r)),r},Ae.prototype._removeFromLegacyStorage=function(e,t){e.removeItem(t+this._legacyStorageSuffix)},Ae.prototype._parseSavedUnsentEventsString=function(e,t){if(J(e))return[];if("string"===q(e))try{var n=JSON.parse(e);if("array"===q(n))return n}catch(e){}return G.error("Unable to load "+t+" events. Restart with a new empty queue."),[]},Ae.prototype.isNewSession=function(){return this._newSession},Ae.prototype.getSessionId=function(){return this._sessionId},Ae.prototype.nextEventId=function(){return this._eventId++,this._eventId},Ae.prototype.nextIdentifyId=function(){return this._identifyId++,this._identifyId},Ae.prototype.nextSequenceNumber=function(){return this._sequenceNumber++,this._sequenceNumber},Ae.prototype._unsentCount=function(){return this._unsentEvents.length+this._unsentIdentifys.length},Ae.prototype._sendEventsIfReady=function(e){return 0!==this._unsentCount()&&(this.options.batchEvents?this._unsentCount()>=this.options.eventUploadThreshold?(this.sendEvents(e),!0):(this._updateScheduled||(this._updateScheduled=!0,setTimeout(function(){this._updateScheduled=!1,this.sendEvents()}.bind(this),this.options.eventUploadPeriodMillis)),!1):(this.sendEvents(e),!0))},Ae.prototype._getFromStorage=function(e,t){return e.getItem(t+this._storageSuffix)},Ae.prototype._getFromStorageLegacy=function(e,t){return e.getItem(t+this._legacyStorageSuffix)},Ae.prototype._setInStorage=function(e,t,n){e.setItem(t+this._storageSuffix,n)};var Te=function(e){var t=e.cookieStorage.get(e.options.cookieName+e._storageSuffix);if("object"!==q(t)&&!("object"===q(t=e.cookieStorage.get(e.options.cookieName+e._legacyStorageSuffix))&&t.deviceId&&t.sessionId&&t.lastEventTime)){var n=function(e){var t=ae.getItem(e);return ae.removeItem(e),t},i="string"===q(e.options.apiKey)&&"_"+e.options.apiKey.slice(0,6)||"",r=n(w+i),o=n(I+i),s=n(b+i);null!=s&&(s="true"===String(s));var a=parseInt(n(_)),u=parseInt(n(g)),p=parseInt(n(v)),c=parseInt(n(m)),d=parseInt(n(y)),l=function(e){return"object"===q(t)&&t[e]};e.options.deviceId=l("deviceId")||r,e.options.userId=l("userId")||o,e._sessionId=l("sessionId")||a||e._sessionId,e._lastEventTime=l("lastEventTime")||u||e._lastEventTime,e._eventId=l("eventId")||p||e._eventId,e._identifyId=l("identifyId")||c||e._identifyId,e._sequenceNumber=l("sequenceNumber")||d||e._sequenceNumber,e.options.optOut=s||!1,t&&void 0!==t.optOut&&null!==t.optOut&&(e.options.optOut="true"===String(t.optOut)),qe(e)}},Re=function(e){var t=e.cookieStorage.get(e.options.cookieName+e._storageSuffix);if("object"===q(t))je(e,t);else{var n=e.cookieStorage.get(e.options.cookieName+e._legacyStorageSuffix);"object"===q(n)&&(e.cookieStorage.remove(e.options.cookieName+e._legacyStorageSuffix),je(e,n))}},je=function(e,t){t.deviceId&&(e.options.deviceId=t.deviceId),t.userId&&(e.options.userId=t.userId),null!==t.optOut&&void 0!==t.optOut&&(e.options.optOut=t.optOut),t.sessionId&&(e._sessionId=parseInt(t.sessionId)),t.lastEventTime&&(e._lastEventTime=parseInt(t.lastEventTime)),t.eventId&&(e._eventId=parseInt(t.eventId)),t.identifyId&&(e._identifyId=parseInt(t.identifyId)),t.sequenceNumber&&(e._sequenceNumber=parseInt(t.sequenceNumber))},qe=function(e){var t={deviceId:e.options.deviceId,userId:e.options.userId,optOut:e.options.optOut,sessionId:e._sessionId,lastEventTime:e._lastEventTime,eventId:e._eventId,identifyId:e._identifyId,sequenceNumber:e._sequenceNumber};xe&&xe.setItem(e._storageSuffix,JSON.stringify(t)),e.cookieStorage.set(e.options.cookieName+e._storageSuffix,t)};Ae.prototype._initUtmData=function(e,t){e=e||this._getUrlParams(),t=t||this.cookieStorage.get("__utmz");var n,i,r,o,s,a,u,p,c,d,l,f=(i=e,r=(n=t)?"?"+n.split(".").slice(-1)[0].replace(/\|/g,"&"):"",s=(o=function(e,t,n,i){return V(e,t)||V(n,i)})(S,i,"utmcsr",r),a=o(O,i,"utmcmd",r),u=o(E,i,"utmccn",r),p=o(N,i,"utmctr",r),c=o(x,i,"utmcct",r),d={},(l=function(e,t){J(t)||(d[e]=t)})(S,s),l(O,a),l(E,u),l(N,p),l(x,c),d);Ce(this,f)},Ae.prototype._unsetUTMParams=function(){var e=new ce;e.unset(l),e.unset(S),e.unset(O),e.unset(E),e.unset(N),e.unset(x),this.identify(e)};var Ce=function(e,t){if("object"===q(t)&&0!==Object.keys(t).length){var n=new ce;for(var i in t)t.hasOwnProperty(i)&&(n.setOnce("initial_"+i,t[i]),n.set(i,t[i]));e.identify(n)}};Ae.prototype._getReferrer=function(){return document.referrer},Ae.prototype._getUrlParams=function(){return location.search},Ae.prototype._saveGclid=function(e){var t=V("gclid",e);J(t)||Ce(this,{gclid:t})},Ae.prototype._getDeviceIdFromUrlParam=function(e){return V(d,e)},Ae.prototype._getReferringDomain=function(e){if(J(e))return null;var t=e.split("/");return 3<=t.length?t[2]:null},Ae.prototype._saveReferrer=function(e){if(!J(e)){var t={referrer:e,referring_domain:this._getReferringDomain(e)};Ce(this,t)}},Ae.prototype.saveEvents=function(){try{this._setInStorage(ae,this.options.unsentKey,JSON.stringify(this._unsentEvents))}catch(e){}try{this._setInStorage(ae,this.options.unsentIdentifyKey,JSON.stringify(this._unsentIdentifys))}catch(e){}},Ae.prototype.setDomain=function(e){if(H(e,"domain","string"))try{this.cookieStorage.options({domain:e}),this.options.domain=this.cookieStorage.options().domain,Re(this),qe(this)}catch(e){G.error(e)}},Ae.prototype.setUserId=function(e){try{this.options.userId=null!=e&&""+e||null,qe(this)}catch(e){G.error(e)}},Ae.prototype.setGroup=function(e,t){if(this._apiKeySet("setGroup()")&&H(e,"groupType","string")&&!J(e)){var n={};n[e]=t;var i=(new ce).set(e,t);this._logEvent(f,null,null,i.userPropertiesOperations,n,null,null,null)}},Ae.prototype.setOptOut=function(e){if(H(e,"enable","boolean"))try{this.options.optOut=e,qe(this)}catch(e){G.error(e)}},Ae.prototype.setSessionId=function(e){if(H(e,"sessionId","number"))try{this._sessionId=e,qe(this)}catch(e){G.error(e)}},Ae.prototype.resetSessionId=function(){this.setSessionId((new Date).getTime())},Ae.prototype.regenerateDeviceId=function(){this.setDeviceId(Oe()+"R")},Ae.prototype.setDeviceId=function(e){if(H(e,"deviceId","string"))try{J(e)||(this.options.deviceId=""+e,qe(this))}catch(e){G.error(e)}},Ae.prototype.setUserProperties=function(e){if(this._apiKeySet("setUserProperties()")&&H(e,"userProperties","object")){var t=$(Q(e));if(0!==Object.keys(t).length){var n=new ce;for(var i in t)t.hasOwnProperty(i)&&n.set(i,t[i]);this.identify(n)}}},Ae.prototype.clearUserProperties=function(){if(this._apiKeySet("clearUserProperties()")){var e=new ce;e.clearAll(),this.identify(e)}};var Ue=function(e,t){for(var n=0;n<t._q.length;n++){var i=e[t._q[n][0]];"function"===q(i)&&i.apply(e,t._q[n].slice(1))}return e};Ae.prototype.identify=function(e,t){if(this._apiKeySet("identify()"))if("object"===q(e)&&e.hasOwnProperty("_q")&&(e=Ue(new ce,e)),e instanceof ce){if(0<Object.keys(e.userPropertiesOperations).length)return this._logEvent(f,null,null,e.userPropertiesOperations,null,null,null,t);"function"===q(t)&&t(0,"No request sent",{reason:"No user property operations"})}else G.error("Invalid identify input type. Expected Identify object but saw "+q(e)),"function"===q(t)&&t(0,"No request sent",{reason:"Invalid identify input type"});else"function"===q(t)&&t(0,"No request sent",{reason:"API key is not set"})},Ae.prototype.groupIdentify=function(e,t,n,i){var r,o,s;if(this._apiKeySet("groupIdentify()"))if(H(e,"group_type","string")&&!J(e))if(null!=t)if("object"===q(n)&&n.hasOwnProperty("_q")&&(n=Ue(new ce,n)),n instanceof ce){if(0<Object.keys(n.userPropertiesOperations).length)return this._logEvent(h,null,null,null,(s=t,(o=e)in(r={})?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s,r),n.userPropertiesOperations,null,i);"function"===q(i)&&i(0,"No request sent",{reason:"No group property operations"})}else G.error("Invalid identify input type. Expected Identify object but saw "+q(n)),"function"===q(i)&&i(0,"No request sent",{reason:"Invalid identify input type"});else"function"===q(i)&&i(0,"No request sent",{reason:"Invalid group name"});else"function"===q(i)&&i(0,"No request sent",{reason:"Invalid group type"});else"function"===q(i)&&i(0,"No request sent",{reason:"API key is not set"})},Ae.prototype.setVersionName=function(e){H(e,"versionName","string")&&(this.options.versionName=e)},Ae.prototype._logEvent=function(e,t,n,i,r,o,s,a){if(Re(this),e)if(this.options.optOut)"function"===q(a)&&a(0,"No request sent",{reason:"optOut is set to true"});else try{var u;u=e===f||e===h?this.nextIdentifyId():this.nextEventId();var p=this.nextSequenceNumber(),c="number"===q(s)?s:(new Date).getTime();(!this._sessionId||!this._lastEventTime||c-this._lastEventTime>this.options.sessionTimeout)&&(this._sessionId=c),this._lastEventTime=c,qe(this),i=i||{};var d=R({},this._apiPropertiesTrackingOptions);n=R({},n||{},d),t=t||{},r=r||{},o=o||{};var l={device_id:this.options.deviceId,user_id:this.options.userId,timestamp:c,event_id:u,session_id:this._sessionId||-1,event_type:e,version_name:Me(this,"version_name")&&this.options.versionName||null,platform:Me(this,"platform")?this.options.platform:null,os_name:Me(this,"os_name")&&this._ua.browser.name||null,os_version:Me(this,"os_version")&&this._ua.browser.major||null,device_model:Me(this,"device_model")&&this._ua.os.name||null,language:Me(this,"language")?this.options.language:null,api_properties:n,event_properties:$(Q(t)),user_properties:$(Q(i)),uuid:Oe(),library:{name:"amplitude-js",version:Ee},sequence_number:p,groups:$(X(r)),group_properties:$(Q(o)),user_agent:this._userAgent};return e===f||e===h?(this._unsentIdentifys.push(l),this._limitEventsQueued(this._unsentIdentifys)):(this._unsentEvents.push(l),this._limitEventsQueued(this._unsentEvents)),this.options.saveEvents&&this.saveEvents(),this._sendEventsIfReady(a)||"function"!==q(a)||a(0,"No request sent",{reason:"No events to send or upload queued"}),u}catch(e){G.error(e)}else"function"===q(a)&&a(0,"No request sent",{reason:"Missing eventType"})};var Me=function(e,t){return!!e.options.trackingOptions[t]},De=function(e){for(var t=["city","country","dma","ip_address","region"],n={},i=0;i<t.length;i++){var r=t[i];Me(e,r)||(n[r]=!1)}return n};Ae.prototype._limitEventsQueued=function(e){e.length>this.options.savedMaxCount&&e.splice(0,e.length-this.options.savedMaxCount)},Ae.prototype.logEvent=function(e,t,n){return this.logEventWithTimestamp(e,t,null,n)},Ae.prototype.logEventWithTimestamp=function(e,t,n,i){return this._apiKeySet("logEvent()")?H(e,"eventType","string")?J(e)?("function"===q(i)&&i(0,"No request sent",{reason:"Missing eventType"}),-1):this._logEvent(e,t,null,null,null,null,n,i):("function"===q(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===q(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)},Ae.prototype.logEventWithGroups=function(e,t,n,i){return this._apiKeySet("logEventWithGroups()")?H(e,"eventType","string")?this._logEvent(e,t,null,null,n,null,null,i):("function"===q(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===q(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)},Ae.prototype.logRevenueV2=function(e){if(this._apiKeySet("logRevenueV2()"))if("object"===q(e)&&e.hasOwnProperty("_q")&&(e=Ue(new Ie,e)),e instanceof Ie){if(e&&e._isValidRevenue())return this.logEvent(i,e._toJSONObject())}else G.error("Invalid revenue input type. Expected Revenue object but saw "+q(e))},Ae.prototype.removeEvents=function(e,t){ze(this,"_unsentEvents",e),ze(this,"_unsentIdentifys",t)};var ze=function(e,t,n){if(!(n<0)){for(var i=[],r=0;r<e[t].length;r++)e[t][r].event_id>n&&i.push(e[t][r]);e[t]=i}};Ae.prototype.sendEvents=function(n){if(this._apiKeySet("sendEvents()"))if(this.options.optOut)"function"===q(n)&&n(0,"No request sent",{reason:"optOut is set to true"});else if(0!==this._unsentCount())if(this._sending)"function"===q(n)&&n(0,"No request sent",{reason:"Request already in progress. Events will be sent once this request is complete"});else if(this._pendingReadStorage)"function"===q(n)&&n(0,"No request sent",{reason:"Still resolving data from storage. Events will be sent once this is complete."});else{this._sending=!0;var e=(this.options.forceHttps?"https":"https:"===window.location.protocol?"https":"http")+"://"+this.options.apiEndpoint+"/",i=Math.min(this._unsentCount(),this.options.uploadBatchSize),t=this._mergeEventsAndIdentifys(i),r=t.maxEventId,o=t.maxIdentifyId,s=JSON.stringify(t.eventsToSend),a=(new Date).getTime(),u={client:this.options.apiKey,e:s,v:c,upload_time:a,checksum:le(c+this.options.apiKey+s+a)},p=this;new be(e,u).send(function(e,t){p._sending=!1;try{200===e&&"success"===t?(p.removeEvents(r,o),p.options.saveEvents&&p.saveEvents(),p._sendEventsIfReady(n)||"function"!==q(n)||n(e,t)):413===e?(1===p.options.uploadBatchSize&&p.removeEvents(r,o),p.options.uploadBatchSize=Math.ceil(i/2),p.sendEvents(n)):"function"===q(n)&&n(e,t)}catch(e){}})}else"function"===q(n)&&n(0,"No request sent",{reason:"No events to send"});else"function"===q(n)&&n(0,"No request sent",{reason:"API key not set"})},Ae.prototype._mergeEventsAndIdentifys=function(e){for(var t=[],n=0,i=-1,r=0,o=-1;t.length<e;){var s,a=r>=this._unsentIdentifys.length,u=n>=this._unsentEvents.length;if(u&&a){G.error("Merging Events and Identifys, less events and identifys than expected");break}a?i=(s=this._unsentEvents[n++]).event_id:u?o=(s=this._unsentIdentifys[r++]).event_id:!("sequence_number"in this._unsentEvents[n])||this._unsentEvents[n].sequence_number<this._unsentIdentifys[r].sequence_number?i=(s=this._unsentEvents[n++]).event_id:o=(s=this._unsentIdentifys[r++]).event_id,s.deviceId||(s.device_id=this.options.deviceId),s.userId||(s.user_id=this.options.userId),t.push(s)}return{eventsToSend:t,maxEventId:i,maxIdentifyId:o}},Ae.prototype.__VERSION__=Ee;var Be=function(){this.options=R({},Ne),this._q=[],this._instances={}};Be.prototype.Identify=ce,Be.prototype.Revenue=Ie,Be.prototype.getInstance=function(e){e=J(e)?r:e.toLowerCase();var t=this._instances[e];return void 0===t&&(t=new Ae(e),this._instances[e]=t),t},Be.prototype.__VERSION__=Ee;var Ke=window.amplitude||{},Le=new Be;for(var We in Le._q=Ke._q||[],Ke._iq)Ke._iq.hasOwnProperty(We)&&(Le.getInstance(We)._q=Ke._iq[We]._q||[]);return Le});
{
"name": "amplitude-js",
"author": "Amplitude <support@amplitude.com>",
"version": "4.6.0",
"version": "4.7.0-react-native",
"license": "MIT",

@@ -42,3 +42,3 @@ "description": "Javascript library for Amplitude Analytics",

"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-commonjs": "8",
"rollup-plugin-commonjs": "8.4.1",
"rollup-plugin-legacy": "^1.0.0",

@@ -45,0 +45,0 @@ "rollup-plugin-node-resolve": "^3.0.0",

@@ -14,3 +14,3 @@ Amplitude-JavaScript

[4.6.0 - Released on February 25, 2019](https://github.com/amplitude/Amplitude-JavaScript/releases/latest)
[4.7.0-react-native - Released on February 25, 2019](https://github.com/amplitude/Amplitude-JavaScript/releases/latest)

@@ -17,0 +17,0 @@

@@ -16,2 +16,9 @@ import Constants from './constants';

let asyncStorage;
if (window.navigator && window.navigator.product === 'ReactNative') {
const reactNative = require('react-native');
asyncStorage = reactNative.AsyncStorage;
}
/**

@@ -91,56 +98,71 @@ * AmplitudeClient SDK API - instance constructor.

_loadCookieData(this);
this._pendingReadStorage = true;
// load deviceId and userId from input, or try to fetch existing value from cookie
this.options.deviceId = (type(opt_config) === 'object' && type(opt_config.deviceId) === 'string' &&
!utils.isEmptyString(opt_config.deviceId) && opt_config.deviceId) ||
(this.options.deviceIdFromUrlParam && this._getDeviceIdFromUrlParam(this._getUrlParams())) ||
this.options.deviceId || UUID() + 'R';
this.options.userId =
(type(opt_userId) === 'string' && !utils.isEmptyString(opt_userId) && opt_userId) ||
(type(opt_userId) === 'number' && opt_userId.toString()) ||
this.options.userId || null;
const initFromStorage = () => {
// load deviceId and userId from input, or try to fetch existing value from cookie
this.options.deviceId = (type(opt_config) === 'object' && type(opt_config.deviceId) === 'string' &&
!utils.isEmptyString(opt_config.deviceId) && opt_config.deviceId) ||
(this.options.deviceIdFromUrlParam && this._getDeviceIdFromUrlParam(this._getUrlParams())) ||
this.options.deviceId || UUID() + 'R';
this.options.userId =
(type(opt_userId) === 'string' && !utils.isEmptyString(opt_userId) && opt_userId) ||
(type(opt_userId) === 'number' && opt_userId.toString()) ||
this.options.userId || null;
// load unsent events and identifies before any attempt to log new ones
if (this.options.saveEvents) {
this._unsentEvents = this._loadSavedUnsentEvents(this.options.unsentKey);
this._unsentIdentifys = this._loadSavedUnsentEvents(this.options.unsentIdentifyKey);
// load unsent events and identifies before any attempt to log new ones
if (this.options.saveEvents) {
this._unsentEvents = this._loadSavedUnsentEvents(this.options.unsentKey);
this._unsentIdentifys = this._loadSavedUnsentEvents(this.options.unsentIdentifyKey);
// validate event properties for unsent events
for (var i = 0; i < this._unsentEvents.length; i++) {
var eventProperties = this._unsentEvents[i].event_properties;
var groups = this._unsentEvents[i].groups;
this._unsentEvents[i].event_properties = utils.validateProperties(eventProperties);
this._unsentEvents[i].groups = utils.validateGroups(groups);
}
// validate event properties for unsent events
for (var i = 0; i < this._unsentEvents.length; i++) {
var eventProperties = this._unsentEvents[i].event_properties;
var groups = this._unsentEvents[i].groups;
this._unsentEvents[i].event_properties = utils.validateProperties(eventProperties);
this._unsentEvents[i].groups = utils.validateGroups(groups);
}
// validate user properties for unsent identifys
for (var j = 0; j < this._unsentIdentifys.length; j++) {
var userProperties = this._unsentIdentifys[j].user_properties;
var identifyGroups = this._unsentIdentifys[j].groups;
this._unsentIdentifys[j].user_properties = utils.validateProperties(userProperties);
this._unsentIdentifys[j].groups = utils.validateGroups(identifyGroups);
// validate user properties for unsent identifys
for (var j = 0; j < this._unsentIdentifys.length; j++) {
var userProperties = this._unsentIdentifys[j].user_properties;
var identifyGroups = this._unsentIdentifys[j].groups;
this._unsentIdentifys[j].user_properties = utils.validateProperties(userProperties);
this._unsentIdentifys[j].groups = utils.validateGroups(identifyGroups);
}
}
}
var now = new Date().getTime();
if (!this._sessionId || !this._lastEventTime || now - this._lastEventTime > this.options.sessionTimeout) {
if (this.options.unsetParamsReferrerOnNewSession) {
this._unsetUTMParams();
var now = new Date().getTime();
this._lastEventTime = now;
_saveCookieData(this);
if (!this._sessionId || !this._lastEventTime || now - this._lastEventTime > this.options.sessionTimeout) {
if (this.options.unsetParamsReferrerOnNewSession) {
this._unsetUTMParams();
}
this._newSession = true;
this._sessionId = now;
// only capture UTM params and referrer if new session
if (this.options.saveParamsReferrerOncePerSession) {
this._trackParamsAndReferrer();
}
}
this._newSession = true;
this._sessionId = now;
// only capture UTM params and referrer if new session
if (this.options.saveParamsReferrerOncePerSession) {
if (!this.options.saveParamsReferrerOncePerSession) {
this._trackParamsAndReferrer();
}
}
if (!this.options.saveParamsReferrerOncePerSession) {
this._trackParamsAndReferrer();
this._pendingReadStorage = false;
};
if (asyncStorage) {
asyncStorage.getItem(this._storageSuffix).then((json) => {
const cookieData = JSON.parse(json);
_loadCookieDataProps(this, cookieData);
initFromStorage();
});
} else {
initFromStorage();
}
this._lastEventTime = now;
_saveCookieData(this);
this._sendEventsIfReady(); // try sending unsent events

@@ -505,3 +527,3 @@ } catch (e) {

var _saveCookieData = function _saveCookieData(scope) {
scope.cookieStorage.set(scope.options.cookieName + scope._storageSuffix, {
const cookieData = {
deviceId: scope.options.deviceId,

@@ -515,3 +537,7 @@ userId: scope.options.userId,

sequenceNumber: scope._sequenceNumber
});
};
if (asyncStorage) {
asyncStorage.setItem(scope._storageSuffix, JSON.stringify(cookieData));
}
scope.cookieStorage.set(scope.options.cookieName + scope._storageSuffix, cookieData);
};

@@ -1262,6 +1288,12 @@

if (type(callback) === 'function') {
callback(0, 'No request sent', {reason: 'Request already in progress'});
callback(0, 'No request sent', {reason: 'Request already in progress. Events will be sent once this request is complete'});
}
return;
}
if (this._pendingReadStorage) {
if (type(callback) === 'function') {
callback(0, 'No request sent', {reason: 'Still resolving data from storage. Events will be sent once this is complete.'});
}
return;
}

@@ -1374,2 +1406,9 @@ this._sending = true;

if (!event.deviceId) {
event.device_id = this.options.deviceId;
}
if (!event.userId) {
event.user_id = this.options.userId;
}
eventsToSend.push(event);

@@ -1376,0 +1415,0 @@ }

@@ -6,3 +6,3 @@ (function(window, document) {

as.async = true;
as.src = 'https://cdn.amplitude.com/libs/amplitude-4.6.0-min.gz.js';
as.src = 'https://cdn.amplitude.com/libs/amplitude-4.7.0-react-native-min.gz.js';
as.onload = function() {if(window.amplitude.runQueuedFunctions) {window.amplitude.runQueuedFunctions();} else {console.log('[Amplitude] Error: could not load SDK');}};

@@ -9,0 +9,0 @@ var s = document.getElementsByTagName('script')[0];

@@ -62,4 +62,5 @@ /* jshint -W020, unused: false, noempty: false, boss: true */

// localStorage is specific to subdomains
this._options.domain = opts.domain || this._options.domain || window.location.hostname;
return this._options.secure = opts.secure || false;
this._options.domain = opts.domain || this._options.domain || (window.location && window.location.hostname);
this._options.secure = opts.secure || false;
return this._options;
},

@@ -66,0 +67,0 @@ get: function(name) {

@@ -39,3 +39,3 @@ /* jshint -W020, unused: false, noempty: false, boss: true */

}
} else {
} else if (typeof document !== 'undefined') {
// IE 5-7 use userData

@@ -42,0 +42,0 @@ // See http://msdn.microsoft.com/en-us/library/ms531424(v=vs.85).aspx

@@ -1,1 +0,1 @@

export default '4.6.0';
export default '4.7.0-react-native';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc