(function() { var l=void 0,m=!0,r=null,D=!1; (function(){function Ba(){function a(){if(!a.Gc)la=a.Gc=m,ma=D,c.a(F,function(a){a.tc()})}function b(){try{v.documentElement.doScroll("left")}catch(d){setTimeout(b,1);return}a()}if(v.addEventListener)"complete"===v.readyState?a():v.addEventListener("DOMContentLoaded",a,D);else if(v.attachEvent){v.attachEvent("onreadystatechange",a);var d=D;try{d=n.frameElement===r}catch(f){}v.documentElement.doScroll&&d&&b()}c.Vb(n,"load",a,m)}function Ca(){x.init=function(a,b,d){if(d)return x[d]||(x[d]=F[d]=S(a, b,d),x[d].la()),x[d];d=x;if(F.mixpanel)d=F.mixpanel;else if(a)d=S(a,b,"mixpanel"),d.la(),F.mixpanel=d;x=d;1===ca&&(n.mixpanel=x);Da()}}function Da(){c.a(F,function(a,b){"mixpanel"!==b&&(x[b]=a)});x._=c}function da(a){a=c.g(a)?a:c.e(a)?{}:{days:a};return c.extend({},Ea,a)}function S(a,b,d){var f,h="mixpanel"===d?x:x[d];if(h&&0===ca)f=h;else{if(h&&!c.isArray(h)){o.error("You have already initialized "+d);return}f=new e}f.lb={};f.Y(a,b,d);f.people=new j;f.people.Y(f);if(!f.c("skip_first_touch_marketing")){var a= c.info.Z(r),g={},t=D;c.a(a,function(a,b){(g["initial_"+b]=a)&&(t=m)});t&&f.people.O(g)}J=J||f.c("debug");!c.e(h)&&c.isArray(h)&&(f.Ba.call(f.people,h.people),f.Ba(h));return f}function e(){}function P(){}function Fa(a){return a}function na(a){throw Error(a+" not available in this build.");}function q(a){this.props={};this.Dd=D;this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;if("cookie"!==b&&"localStorage"!==b)o.B("Unknown persistence type "+b+"; falling back to cookie"), b=a.persistence="cookie";this.j="localStorage"===b&&c.localStorage.ua()?c.localStorage:c.cookie;this.load();this.nc(a);this.zd();this.save()}function j(){}function u(){}function C(a,b){this.K=b.K;this.ca=new G(a,{K:c.bind(this.h,this),j:b.j,z:b.z});this.C=b.C;this.bd=b.cd;this.ma=b.ma;this.md=b.nd;this.G=this.C.batch_size;this.qa=this.C.batch_flush_interval_ms;this.fa=!this.C.batch_autostart;this.Ka=0;this.I={};this.Db=b.Db||D}function oa(a,b){var d=[];c.a(a,function(a){var c=a.id;if(c in b){if(c= b[c],c!==r)a.payload=c,d.push(a)}else d.push(a)});return d}function pa(a,b){var d=[];c.a(a,function(a){a.id&&!b[a.id]&&d.push(a)});return d}function G(a,b){b=b||{};this.P=a;this.j=b.j||window.localStorage;this.h=b.K||c.bind(qa.error,qa);this.Ya=new ra(a,{j:this.j});this.z=b.z;this.wa=b.wa||r;this.D=[]}function ra(a,b){b=b||{};this.P=a;this.j=b.j||window.localStorage;this.Tb=b.Tb||100;this.hc=b.hc||2E3}function T(){this.Qb="submit"}function M(){this.Qb="click"}function E(){}function Ga(){var a=n.navigator.onLine; return c.e(a)||a}function sa(a){var b=Ha,d=a.split("."),d=d[d.length-1];if(4a?"0"+a:a}return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+ "T"+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())};c.ga=function(a){var b={};c.a(a,function(a,f){c.Xa(a)&&0=i;)h()}function d(){var a,b,d="",c;if('"'===i)for(;h();){if('"'===i)return h(),d;if("\\"===i)if(h(),"u"===i){for(b=c=0;4>b;b+=1){a=parseInt(h(),16);if(!isFinite(a))break;c=16*c+a}d+=String.fromCharCode(c)}else if("string"===typeof k[i])d+=k[i];else break;else d+=i}g("Bad string")}function c(){var a;a="";"-"===i&&(a="-",h("-"));for(;"0"<=i&&"9">=i;)a+=i,h();if("."===i)for(a+= ".";h()&&"0"<=i&&"9">=i;)a+=i;if("e"===i||"E"===i){a+=i;h();if("-"===i||"+"===i)a+=i,h();for(;"0"<=i&&"9">=i;)a+=i,h()}a=+a;if(isFinite(a))return a;g("Bad number")}function h(a){a&&a!==i&&g("Expected '"+a+"' instead of '"+i+"'");i=p.charAt(e);e+=1;return i}function g(a){a=new SyntaxError(a);a.Cd=e;a.text=p;throw a;}var e,i,k={'"':'"',"\\":"\\","/":"/",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"},p,s;s=function(){b();switch(i){case "{":var e;a:{var t,k={};if("{"===i){h("{");b();if("}"===i){h("}");e= k;break a}for(;i;){t=d();b();h(":");Object.hasOwnProperty.call(k,t)&&g('Duplicate key "'+t+'"');k[t]=s();b();if("}"===i){h("}");e=k;break a}h(",");b()}}g("Bad object")}return e;case "[":a:{e=[];if("["===i){h("[");b();if("]"===i){h("]");t=e;break a}for(;i;){e.push(s());b();if("]"===i){h("]");t=e;break a}h(",");b()}}g("Bad array")}return t;case '"':return d();case "-":return c();default:return"0"<=i&&"9">=i?c():a()}};return function(a){p=a;e=0;i=" ";a=s();b();i&&g("Syntax error");return a}}();c.Bc= function(a){var b,d,f,h,g=0,e=0,i="",i=[];if(!a)return a;a=c.Ad(a);do b=a.charCodeAt(g++),d=a.charCodeAt(g++),f=a.charCodeAt(g++),h=b<<16|d<<8|f,b=h>>18&63,d=h>>12&63,f=h>>6&63,h&=63,i[e++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h); while(ge?c++:i=127e?String.fromCharCode(e>>6|192,e&63|128):String.fromCharCode(e>>12|224,e>>6&63|128,e&63|128);i!==r&&(c>d&&(b+=a.substring(d,c)),b+=i,d=c=g+1)}c>d&&(b+=a.substring(d,a.length));return b};c.jb=function(){function a(){function a(b, c){var d,f=0;for(d=0;dB?(Sa.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+k+"]"),j.removeItem(o),j.removeItem(q),h()):setTimeout(function(){try{a()}catch(c){b&&b(c)}},w*(Math.random()+0.1))}!c&&"function"!==typeof b&&(c=b,b=r);var k=c|| (new Date).getTime()+"|"+Math.random(),p=(new Date).getTime(),s=this.P,w=this.Tb,B=this.hc,j=this.j,n=s+":X",q=s+":Y",o=s+":Z";try{if(U(j,m))h();else throw Error("localStorage support check failed");}catch(v){b&&b(v)}};var qa=ga("batch");G.prototype.Oa=function(a,b,d){var f={id:ea(),flushAfter:(new Date).getTime()+2*b,payload:a};this.z?this.Ya.ib(c.bind(function(){var b;try{var c=this.ea();c.push(f);(b=this.ab(c))&&this.D.push(f)}catch(e){this.h("Error enqueueing item",a),b=D}d&&d(b)},this),c.bind(function(a){this.h("Error acquiring storage lock", a);d&&d(D)},this),this.wa):(this.D.push(f),d&&d(m))};G.prototype.Hc=function(a){var b=this.D.slice(0,a);if(this.z&&b.lengthg.flushAfter&&!f[g.id]&&(g.Uc=m,b.push(g),b.length>=a))break}}}return b};G.prototype.Wc=function(a,b){var d={};c.a(a,function(a){d[a]=m});this.D=pa(this.D,d);if(this.z){var f=c.bind(function(){var b;try{var c=this.ea(),c=pa(c,d);if(b=this.ab(c))for(var c= this.ea(),f=0;ft.length)this.N();else{this.Xb=m;var k=c.bind(function(k){this.Xb=D;try{var t=D;if(a.lc)this.ca.yd(i);else if(c.g(k)&&"timeout"===k.error&&(new Date).getTime()-d>=b)this.h("Network timeout; retrying"),this.flush();else if(c.g(k)&&(500<=k.sa||429===k.sa||0>=k.sa&&!Ga()||"timeout"===k.error)){var j=2*this.qa;k.Zb&&(j=1E3*parseInt(k.Zb,10)||j);j=Math.min(6E5,j);this.h("Error; retry in "+ j+" ms");this.$b(j)}else if(c.g(k)&&413===k.sa)if(1=o.timeout?"timeout":"Bad HTTP status: "+o.status+" "+o.statusText,p.l(a),f&&(k?f({status:0,sa:o.status,error:a,Zb:(o.responseHeaders|| {})["Retry-After"]}):f(0))};o.send(j)}catch(y){p.l(y),e=D}else j=v.createElement("script"),j.type="text/javascript",j.async=m,j.defer=m,j.src=a,u=v.getElementsByTagName("script")[0],u.parentNode.insertBefore(j,u);return e};e.prototype.Ba=function(a){function b(a,b){c.a(a,function(a){if(c.isArray(a[0])){var d=b;c.a(a,function(a){d=d[a[0]].apply(d,a.slice(1))})}else this[a[0]].apply(this,a.slice(1))},b)}var d,e=[],h=[],g=[];c.a(a,function(a){a&&(d=a[0],c.isArray(d)?g.push(a):"function"===typeof a?a.call(this): c.isArray(a)&&"alias"===d?e.push(a):c.isArray(a)&&-1!==d.indexOf("track")&&"function"===typeof this[d]?g.push(a):h.push(a))},this);b(e,this);b(h,this);b(g,this)};e.prototype.sb=function(){return!!this.u.L};e.prototype.Eb=function(){var a="__mpq_"+this.c("token"),b=this.c("api_routes");return this.kb=this.kb||{L:{type:"events",H:"/"+b.track,da:a+"_ev"},$a:{type:"people",H:"/"+b.engage,da:a+"_pp"},Sa:{type:"groups",H:"/"+b.groups,da:a+"_gr"}}};e.prototype.Nc=function(){if(!this.sb()){var a=c.bind(function(a){return new C(a.da, {C:this.config,K:this.c("error_reporter"),cd:c.bind(function(b,c,e){this.k(this.c("api_host")+a.H,this.mb(b),c,this.ob(e,b))},this),ma:c.bind(function(b){return this.qb("before_send_"+a.type,b)},this),nd:c.bind(this.cb,this),z:m})},this),b=this.Eb();this.u={L:a(b.L),$a:a(b.$a),Sa:a(b.Sa)}}this.c("batch_autostart")&&this.bb()};e.prototype.bb=function(){this.rc=m;if(this.sb())this.U=m,c.a(this.u,function(a){a.start()})};e.prototype.cb=function(){this.U=D;c.a(this.u,function(a){a.stop();a.clear()})}; e.prototype.push=function(a){this.Ba([a])};e.prototype.disable=function(a){"undefined"===typeof a?this.V.Ec=m:this.ya=this.ya.concat(a)};e.prototype.mb=function(a){a=c.ia(a);"base64"===this.c("api_payload_format")&&(a=c.Bc(a));return{data:a}};e.prototype.Ga=function(a,b){var d=c.truncate(a.data,255),e=a.H,h=a.Ia,g=a.ld,j=a.dd||{},b=b||P,i=m,k=c.bind(function(){j.fc||(d=this.qb("before_send_"+a.type,d));return d?(o.log("MIXPANEL REQUEST:"),o.log(d),this.k(e,this.mb(d),j,this.ob(b,d))):r},this);this.U&& !g?h.Oa(d,function(a){a?b(1,d):k()}):i=k();return i&&d};e.prototype.o=K(function(a,b,d,e){!e&&"function"===typeof d&&(e=d,d=r);var d=d||{},h=d.transport;if(h)d.gb=h;h=d.send_immediately;"function"!==typeof e&&(e=P);if(c.e(a))this.l("No event name provided to mixpanel.track");else if(this.nb(a))e(0);else{b=c.extend({},b);b.token=this.c("token");var g=this.persistence.Xc(a);c.e(g)||(b.$duration=parseFloat((((new Date).getTime()-g)/1E3).toFixed(3)));this.rb();g=this.c("track_marketing")?c.info.Rc(): {};b=c.extend({},c.info.ba({mp_loader:this.c("mp_loader")}),g,this.persistence.ba(),this.R,this.Fb(),b);g=this.c("property_blacklist");c.isArray(g)?c.a(g,function(a){delete b[a]}):this.l("Invalid value for property_blacklist config: "+g);return this.Ga({type:"events",data:{event:a,properties:b},H:this.c("api_host")+"/"+this.c("api_routes").track,Ia:this.u.L,ld:h,dd:d},e)}});e.prototype.jd=K(function(a,b,d){c.isArray(b)||(b=[b]);var e={};e[a]=b;this.m(e);return this.people.set(a,b,d)});e.prototype.yc= K(function(a,b,c){var e=this.s(a),h={};e===l?(h[a]=[b],this.m(h)):-1===e.indexOf(b)&&(e.push(b),h[a]=e,this.m(h));return this.people.ha(a,b,c)});e.prototype.Yc=K(function(a,b,c){var e=this.s(a);if(e!==l){var h=e.indexOf(b);-1(x.__SV||0)?o.B("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(c.a(x._i,function(a){a&&c.isArray(a)&&(F[a[a.length-1]]=S.apply(this,a))}),Ca(),x.init(),c.a(F,function(a){a.la()}),Ba())})(function(a,b){var c=document.createElement("script");c.type="text/javascript";c.async=m;c.onload=b;c.src=a;document.head.appendChild(c)})})(); })();