var Mixdown=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function r(t){for(var r=1;r=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0;)i();return window.localStorage.removeItem(e),Promise.all(o)},p.prototype.track=function(t,e){this._handleEvent(t,e)},p.prototype.trackLinks=function(t,e,n){this._handleEvent(e,n,t)},p.prototype._handleEvent=function(t,e,n){var r;((e=e||{}).time=Date.now(),window&&document)&&(e.$current_url=window.location.href||"",e.$referrer=(null===(r=window.lp_mix)||void 0===r?void 0:r.referrer)||document.referrer||"");this.mixpanel&&"post-identify"===this.currentUserTrackingStatus?this._forwardEvent(t,e,n):this._prepareForEventCaching(t,e,n)},p.prototype._prepareForEventCaching=function(t,e,n){e.token=this.token;var o=this._getSuperProps(this.token),i=n?{event:t,properties:r(r({},e),o),query:n}:{event:t,properties:r(r({},e),o)};this._getAndSetCache("eventCache",i)},p.prototype._forwardEvent=function(t,e,n){n?c.trackLinks(n,t,e):c.track(t,e)},p.prototype.peopleSet=function(t){this._handleProfileUpdate(t)},p.prototype.peopleSetOnce=function(t){this._handleProfileUpdate(t,"once")},p.prototype._handleProfileUpdate=function(t,e){this.mixpanel&&"post-identify"===this.currentUserTrackingStatus?("once"===e?this.mixpanel.people.set_once(t):this.mixpanel.people.set(t),this.mixpanel.identify()):this._prepareForProfileUpdateCaching(t,e)},p.prototype._prepareForProfileUpdateCaching=function(t,e){var n={};n.$token=this.token,n.$distinct_id=this.mixpanel.get_distinct_id(),n.$time=Date.now();var o=r(r({},n),{},"once"===e?{$set_once:r({},t)}:{$set:r({},t)});this._getAndSetCache("profileCache",o)},p.prototype.identify=function(){this.mixpanel&&(this._registerTrackingStatus("post-identify"),this._processCache("track","eventCache",10),this._processCache("engage","profileCache",1),this.mixpanel.identify())},p}();