!function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var i=Object.assign||function(e){for(var t=1;t127&&i<2048?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128))}return t},decode:function(e){for(var t="",n=0,i=0,r=0,o=0;n191&&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}},S={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){try{if(window.btoa&&window.atob)return window.btoa(unescape(encodeURIComponent(e)))}catch(e){}return S._encode(e)},_encode:function(e){var t,n,i,r,o,s,a,u="",c=0;for(e=I.encode(e);c>2,o=(3&t)<<4|n>>4,s=(15&n)<<2|i>>6,a=63&i,isNaN(n)?s=a=64:isNaN(i)&&(a=64),u=u+S._keyStr.charAt(r)+S._keyStr.charAt(o)+S._keyStr.charAt(s)+S._keyStr.charAt(a);return u},decode:function(e){try{if(window.btoa&&window.atob)return decodeURIComponent(escape(window.atob(e)))}catch(e){}return S._decode(e)},_decode:function(e){var t,n,i,r,o,s,a,u="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,n=(15&o)<<4|s>>2,i=(3&s)<<6|a,u+=String.fromCharCode(t),64!==s&&(u+=String.fromCharCode(n)),64!==a&&(u+=String.fromCharCode(i));return u=I.decode(u)}},A=Object.prototype.toString,T={DISABLE:0,ERROR:1,WARN:2,INFO:3},O=T.WARN,N=function(e){T.hasOwnProperty(e)&&(O=T[e])},k=function(){return O},P={error:function(e){O>=T.ERROR&&R(e)},warn:function(e){O>=T.WARN&&R(e)},info:function(e){O>=T.INFO&&R(e)}},R=function(e){try{console.log("[Amplitude] "+e)}catch(e){}},x=function(e){return!e||0===e.length},U=function(){try{if(window.sessionStorage)return!0}catch(e){}return!1},C=function e(t){if("array"===u(t))for(var n=0;nE.MAX_STRING_LENGTH?e.substring(0,E.MAX_STRING_LENGTH):e},D=function(e,t,n){return u(e)===n||(P.error("Invalid "+t+" input type. Expected "+n+" but received "+u(e)),!1)},j=function(e){var t=u(e);if("object"!==t)return P.error("Error: invalid properties format. Expecting Javascript object, received "+t+", ignoring"),{};if(Object.keys(e).length>E.MAX_PROPERTY_KEYS)return P.error("Error: too many properties (more than 1000), ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=i,o=u(r);"string"!==o&&(r=String(r),P.warn("WARNING: Non-string property key, received type "+o+', coercing to string "'+r+'"'));var s=F(r,e[i]);null!==s&&(n[r]=s)}return n},B=["nan","function","arguments","regexp","element"],F=function e(t,n){var i=u(n);if(B.indexOf(i)!==-1)P.warn('WARNING: Property key "'+t+'" with invalid value type '+i+", ignoring"),n=null;else if("undefined"===i)n=null;else if("error"===i)n=String(n),P.warn('WARNING: Property key "'+t+'" with value type error, coercing to '+n);else if("array"===i){for(var r=[],o=0;o=0;--o)i.push(n.slice(o).join("."));for(var s=0;s0?(this.userPropertiesOperations.hasOwnProperty(ye)||$.log.error("Need to send $clearAll on its own Identify object without any other operations, skipping $clearAll"),this):(this.userPropertiesOperations[ye]="-",this)},Ie.prototype.prepend=function(e,t){return this._addOperation(we,e,t),this},Ie.prototype.set=function(e,t){return this._addOperation(_e,e,t),this},Ie.prototype.setOnce=function(e,t){return this._addOperation(be,e,t),this},Ie.prototype.unset=function(e){return this._addOperation(Ee,e,"-"),this},Ie.prototype._addOperation=function(e,t,n){return this.userPropertiesOperations.hasOwnProperty(ye)?void $.log.error("This identify already contains a $clearAll operation, skipping operation "+e):this.properties.indexOf(t)!==-1?void $.log.error('User property "'+t+'" already used in this identify, skipping operation '+e):(this.userPropertiesOperations.hasOwnProperty(e)||(this.userPropertiesOperations[e]={}),this.userPropertiesOperations[e][t]=n,void this.properties.push(t))};var Se="undefined"!=typeof window?window:"undefined"!=typeof n?n:"undefined"!=typeof self?self:{},Ae=c(function(e){!function(t){function n(e,t){var n=(65535&e)+(65535&t),i=(e>>16)+(t>>16)+(n>>16);return i<<16|65535&n}function i(e,t){return e<>>32-t}function r(e,t,r,o,s,a){return n(i(n(n(t,e),n(o,a)),s),r)}function o(e,t,n,i,o,s,a){return r(t&n|~t&i,e,t,o,s,a)}function s(e,t,n,i,o,s,a){return r(t&i|n&~i,e,t,o,s,a)}function a(e,t,n,i,o,s,a){return r(t^n^i,e,t,o,s,a)}function u(e,t,n,i,o,s,a){return r(n^(t|~i),e,t,o,s,a)}function c(e,t){e[t>>5]|=128<>>9<<4)+14]=t;var i,r,c,l,f,d=1732584193,p=-271733879,h=-1732584194,g=271733878;for(i=0;i>5]>>>t%32&255);return n}function f(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<16&&(r=c(r,8*e.length)),n=0;n<16;n+=1)o[n]=909522486^r[n],s[n]=1549556828^r[n];return i=c(o.concat(f(t)),512+8*t.length),l(c(s.concat(i),640))}function h(e){var t,n,i="0123456789abcdef",r="";for(n=0;n>>4&15)+i.charAt(15&t);return r}function g(e){return unescape(encodeURIComponent(e))}function v(e){return d(g(e))}function m(e){return h(v(e))}function y(e,t){return p(g(e),g(t))}function w(e,t){return h(y(e,t))}function _(e,t,n){return t?n?y(t,e):w(t,e):n?v(e):m(e)}e.exports?e.exports=_:t.md5=_}(Se)}),Te=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})},Oe=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable,Pe=f()?Object.assign:function(e,t){for(var n,i,r=l(e),o=1;o * Licensed under MIT License */ !function(n,i){var r="0.7.21",o="",s="?",a="function",u="object",c="string",l="major",f="model",d="name",p="type",h="vendor",g="version",v="architecture",m="console",y="mobile",w="tablet",_="smarttv",b="wearable",E="embedded",I={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&&t.toLowerCase().indexOf(e.toLowerCase())!==-1},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===c?e.replace(/[^\d\.]/g,"").split(".")[0]:i},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},S={rgx:function(e,t){for(var n,r,o,s,c,l,f=0;f0?2==s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):i:this[s[0]]=l?s[1].call(this,l,s[2]):i:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):i):this[s]=l?l:i;f+=2}},str:function(e,t){for(var n in t)if(typeof t[n]===u&&t[n].length>0){for(var r=0;r>t/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}),Ke="7.1.0",Ge=function(){return navigator&&(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage)||""},We={getLanguage:Ge},He="Web",Je={apiEndpoint:"api.amplitude.com",batchEvents:!1,cookieExpiration:3650,cookieName:"amplitude_id",sameSiteCookie:"Lax",cookieForceUpgrade:!1,deferInitialization:!1,disableCookies:!1,deviceIdFromUrlParam:!1,domain:"",eventUploadPeriodMillis:3e4,eventUploadThreshold:30,forceHttps:!0,includeGclid:!1,includeReferrer:!1,includeUtm:!1,language:We.getLanguage(),logLevel:"WARN",optOut:!1,onError:function(){},platform:He,savedMaxCount:1e3,saveEvents:!0,saveParamsReferrerOncePerSession:!0,secureCookie:!1,sessionTimeout:18e5,trackingOptions:{city:!0,country:!0,carrier:!0,device_manufacturer:!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=$.isEmptyString(e)?E.DEFAULT_INSTANCE:e.toLowerCase(),this._unsentEvents=[],this._unsentIdentifys=[],this._ua=new Ve(navigator.userAgent).getResult(),this.options=a({},Je,{trackingOptions:a({},Je.trackingOptions)}),this.cookieStorage=(new pe).getStorage(),this._q=[],this._sending=!1,this._updateScheduled=!1,this._onInit=[],this._eventId=0,this._identifyId=0,this._lastEventTime=null,this._newSession=!1,this._sequenceNumber=0,this._sessionId=null,this._isInitialized=!1,this._userAgent=navigator&&navigator.userAgent||null};Xe.prototype.Identify=Ie,Xe.prototype.Revenue=Le,Xe.prototype.init=function(e,t,n,i){var r=this;if("string"!==u(e)||$.isEmptyString(e))return void $.log.error("Invalid apiKey. Please re-initialize with a valid apiKey");try{Ze(this.options,n),this.options.cookieName!==Je.cookieName&&$.log.warn("The cookieName option is deprecated. We will be ignoring it for newer cookies"),this.options.apiKey=e,this._storageSuffix="_"+e+(this._instanceName===E.DEFAULT_INSTANCE?"":"_"+this._instanceName),this._storageSuffixV5=e.slice(0,6),this._oldCookiename=this.options.cookieName+this._storageSuffix,this._unsentKey=this.options.unsentKey+this._storageSuffix,this._unsentIdentifyKey=this.options.unsentIdentifyKey+this._storageSuffix,this._cookieName=E.COOKIE_PREFIX+"_"+this._storageSuffixV5,this.cookieStorage.options({expirationDays:this.options.cookieExpiration,domain:this.options.domain,secure:this.options.secureCookie,sameSite:this.options.sameSiteCookie}),this._metadataStorage=new he({storageKey:this._cookieName,disableCookies:this.options.disableCookies,expirationDays:this.options.cookieExpiration,domain:this.options.domain,secure:this.options.secureCookie,sameSite:this.options.sameSiteCookie});var o=!!this.cookieStorage.get(this._oldCookiename),s=!!this._metadataStorage.load();this._useOldCookie=!s&&o&&!this.options.cookieForceUpgrade;var a=s||o;if(this.options.domain=this.cookieStorage.options().domain,this.options.deferInitialization&&!a)return void this._deferInitialization(e,t,n,i);"string"===u(this.options.logLevel)&&$.setLogLevel(this.options.logLevel);var c=at(this);this._apiPropertiesTrackingOptions=Object.keys(c).length>0?{tracking_options:c}:{},this.options.cookieForceUpgrade&&o&&(s||tt(this),this.cookieStorage.remove(this._oldCookiename)),et(this),this._pendingReadStorage=!0;var l=function(e){r.options.deviceId=r._getInitialDeviceId(n&&n.deviceId,e),r.options.userId="string"===u(t)&&!$.isEmptyString(t)&&t||"number"===u(t)&&t.toString()||r.options.userId||null;var i=(new Date).getTime();(!r._sessionId||!r._lastEventTime||i-r._lastEventTime>r.options.sessionTimeout)&&(r.options.unsetParamsReferrerOnNewSession&&r._unsetUTMParams(),r._newSession=!0,r._sessionId=i,r.options.saveParamsReferrerOncePerSession&&r._trackParamsAndReferrer()),r.options.saveParamsReferrerOncePerSession||r._trackParamsAndReferrer(),r.options.saveEvents&&(Qe(r._unsentEvents),Qe(r._unsentIdentifys)),r._lastEventTime=i,it(r),r._pendingReadStorage=!1,r._sendEventsIfReady();for(var o=0;oi.length;--r){var o=n.slice(n.length-r).join(".");J.set(this._cookieName,null,{domain:"."+o})}J.set(this._cookieName,null,{})}},Xe.prototype._getInitialDeviceId=function(e,t){return e?e:this.options.deviceIdFromUrlParam?this._getDeviceIdFromUrlParam(this._getUrlParams()):this.options.deviceId?this.options.deviceId:t?t:K()};var Qe=function(e){for(var t=0;t0&&Promise.all(r).then(function(){}).catch(function(e){t.options.onError(e)})}}).then(e).catch(function(e){t.options.onError(e)})},Xe.prototype._trackParamsAndReferrer=function(){this.options.includeUtm&&this._initUtmData(),this.options.includeReferrer&&this._saveReferrer(this._getReferrer()),this.options.includeGclid&&this._saveGclid(this._getUrlParams())};var Ze=function e(t,n){if("object"===u(n)){var i=function(i){if(t.hasOwnProperty(i)){var r=n[i],o=u(t[i]);$.validateInput(r,i+" option",o)&&("boolean"===o?t[i]=!!r:"string"===o&&!$.isEmptyString(r)||"number"===o&&r>0?t[i]=r:"object"===o&&e(t[i],r))}};for(var r in n)n.hasOwnProperty(r)&&i(r)}};Xe.prototype.runQueuedFunctions=function(){var e=this._q;this._q=[];for(var t=0;t=this.options.eventUploadThreshold?(this.sendEvents(),!0):(this._updateScheduled||(this._updateScheduled=!0,setTimeout(function(){this._updateScheduled=!1,this.sendEvents()}.bind(this),this.options.eventUploadPeriodMillis)),!1):(this.sendEvents(),!0))},Xe.prototype._getFromStorage=function(e,t){return e.getItem(t+this._storageSuffix)},Xe.prototype._setInStorage=function(e,t,n){e.setItem(t+this._storageSuffix,n)};var et=function(e){if(!e._useOldCookie){var t=e._metadataStorage.load();return void("object"===u(t)&&nt(e,t))}var n=e.cookieStorage.get(e._oldCookiename);if("object"===u(n))return void nt(e,n)},tt=function(e){var t=e.cookieStorage.get(e._oldCookiename);"object"===u(t)&&(nt(e,t),it(e))},nt=function(e,t){t.deviceId&&(e.options.deviceId=t.deviceId),t.userId&&(e.options.userId=t.userId),null!==t.optOut&&void 0!==t.optOut&&t.optOut!==!1&&(e.options.optOut=t.optOut),t.sessionId&&(e._sessionId=parseInt(t.sessionId,10)),t.lastEventTime&&(e._lastEventTime=parseInt(t.lastEventTime,10)),t.eventId&&(e._eventId=parseInt(t.eventId,10)),t.identifyId&&(e._identifyId=parseInt(t.identifyId,10)),t.sequenceNumber&&(e._sequenceNumber=parseInt(t.sequenceNumber,10))},it=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};ze&&ze.setItem(e._storageSuffix,JSON.stringify(t)),e._useOldCookie?e.cookieStorage.set(e.options.cookieName+e._storageSuffix,t):e._metadataStorage.save(t)};Xe.prototype._initUtmData=function(e,t){e=e||this._getUrlParams(),t=t||this.cookieStorage.get("__utmz");var n=ge(t,e);rt(this,n)},Xe.prototype._unsetUTMParams=function(){var e=new Ie;e.unset(E.REFERRER),e.unset(E.UTM_SOURCE),e.unset(E.UTM_MEDIUM),e.unset(E.UTM_CAMPAIGN),e.unset(E.UTM_TERM),e.unset(E.UTM_CONTENT),this.identify(e)};var rt=function(e,t){if("object"===u(t)&&0!==Object.keys(t).length){var n=new Ie;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=$.getQueryParam("gclid",e);if(!$.isEmptyString(t)){var n={gclid:t};rt(this,n)}},Xe.prototype._getDeviceIdFromUrlParam=function(e){return $.getQueryParam(E.AMP_DEVICE_ID_PARAM,e)},Xe.prototype._getReferringDomain=function(e){if($.isEmptyString(e))return null;var t=e.split("/");return t.length>=3?t[2]:null},Xe.prototype._saveReferrer=function(e){if(!$.isEmptyString(e)){var t={referrer:e,referring_domain:this._getReferringDomain(e)};rt(this,t)}},Xe.prototype.saveEvents=function(){try{var e=JSON.stringify(this._unsentEvents.map(function(e){var t=e.event;return t}));ze?ze.setItem(this.options.unsentKey+this._storageSuffix,e):this._setInStorage(de,this.options.unsentKey,e)}catch(e){}try{var t=JSON.stringify(this._unsentIdentifys.map(function(e){return e.event}));ze?ze.setItem(this.options.unsentIdentifyKey+this._storageSuffix,t):this._setInStorage(de,this.options.unsentIdentifyKey,t)}catch(e){}},Xe.prototype.setDomain=function(e){if(this._shouldDeferCall())return this._q.push(["setDomain"].concat(Array.prototype.slice.call(arguments,0)));if($.validateInput(e,"domain","string"))try{this.cookieStorage.options({expirationDays:this.options.cookieExpiration,secure:this.options.secureCookie,domain:e,sameSite:this.options.sameSiteCookie}),this.options.domain=this.cookieStorage.options().domain,et(this),it(this)}catch(e){$.log.error(e)}},Xe.prototype.setUserId=function(e){if(this._shouldDeferCall())return this._q.push(["setUserId"].concat(Array.prototype.slice.call(arguments,0)));try{this.options.userId=void 0!==e&&null!==e&&""+e||null,it(this)}catch(e){$.log.error(e)}},Xe.prototype.setGroup=function(e,t){if(this._shouldDeferCall())return this._q.push(["setGroup"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("setGroup()")&&$.validateInput(e,"groupType","string")&&!$.isEmptyString(e)){var n={};n[e]=t;var i=(new Ie).set(e,t);this._logEvent(E.IDENTIFY_EVENT,null,null,i.userPropertiesOperations,n,null,null,null)}},Xe.prototype.setOptOut=function(e){if(this._shouldDeferCall())return this._q.push(["setOptOut"].concat(Array.prototype.slice.call(arguments,0)));if($.validateInput(e,"enable","boolean"))try{this.options.optOut=e,it(this)}catch(e){$.log.error(e)}},Xe.prototype.setSessionId=function(e){if($.validateInput(e,"sessionId","number"))try{this._sessionId=e,it(this)}catch(e){$.log.error(e)}},Xe.prototype.resetSessionId=function(){this.setSessionId((new Date).getTime())},Xe.prototype.regenerateDeviceId=function(){return this._shouldDeferCall()?this._q.push(["regenerateDeviceId"].concat(Array.prototype.slice.call(arguments,0))):void this.setDeviceId(K())},Xe.prototype.setDeviceId=function(e){if(this._shouldDeferCall())return this._q.push(["setDeviceId"].concat(Array.prototype.slice.call(arguments,0)));if($.validateInput(e,"deviceId","string"))try{$.isEmptyString(e)||(this.options.deviceId=""+e,it(this))}catch(e){$.log.error(e)}},Xe.prototype.setUserProperties=function(e){if(this._shouldDeferCall())return this._q.push(["setUserProperties"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("setUserProperties()")&&$.validateInput(e,"userProperties","object")){var t=$.truncate($.validateProperties(e));if(0!==Object.keys(t).length){var n=new Ie;for(var i in t)t.hasOwnProperty(i)&&n.set(i,t[i]);this.identify(n)}}},Xe.prototype.clearUserProperties=function(){if(this._shouldDeferCall())return this._q.push(["clearUserProperties"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("clearUserProperties()")){var e=new Ie;e.clearAll(),this.identify(e)}};var ot=function(e,t){for(var n=0;n0)return this._logEvent(E.IDENTIFY_EVENT,null,null,e.userPropertiesOperations,null,null,null,t);"function"===u(t)&&t(0,"No request sent",{reason:"No user property operations"})}else $.log.error("Invalid identify input type. Expected Identify object but saw "+u(e)),"function"===u(t)&&t(0,"No request sent",{reason:"Invalid identify input type"})},Xe.prototype.groupIdentify=function(e,t,n,i){if(this._shouldDeferCall())return this._q.push(["groupIdentify"].concat(Array.prototype.slice.call(arguments,0)));if(!this._apiKeySet("groupIdentify()"))return void("function"===u(i)&&i(0,"No request sent",{reason:"API key is not set"}));if(!$.validateInput(e,"group_type","string")||$.isEmptyString(e))return void("function"===u(i)&&i(0,"No request sent",{reason:"Invalid group type"}));if(null===t||void 0===t)return void("function"===u(i)&&i(0,"No request sent",{reason:"Invalid group name"}));if("object"===u(n)&&n.hasOwnProperty("_q")&&(n=ot(new Ie,n)),n instanceof Ie){if(Object.keys(n.userPropertiesOperations).length>0)return this._logEvent(E.GROUP_IDENTIFY_EVENT,null,null,null,s({},e,t),n.userPropertiesOperations,null,i);"function"===u(i)&&i(0,"No request sent",{reason:"No group property operations"})}else $.log.error("Invalid identify input type. Expected Identify object but saw "+u(n)),"function"===u(i)&&i(0,"No request sent",{reason:"Invalid identify input type"})},Xe.prototype.setVersionName=function(e){return this._shouldDeferCall()?this._q.push(["setVersionName"].concat(Array.prototype.slice.call(arguments,0))):void($.validateInput(e,"versionName","string")&&(this.options.versionName=e))},Xe.prototype._logEvent=function(e,t,n,i,r,o,s,c){if(et(this),!e)return void("function"===u(c)&&c(0,"No request sent",{ reason:"Missing eventType"}));if(this.options.optOut)return void("function"===u(c)&&c(0,"No request sent",{reason:"optOut is set to true"}));try{var l;l=e===E.IDENTIFY_EVENT||e===E.GROUP_IDENTIFY_EVENT?this.nextIdentifyId():this.nextEventId();var f=this.nextSequenceNumber(),d="number"===u(s)?s:(new Date).getTime();(!this._sessionId||!this._lastEventTime||d-this._lastEventTime>this.options.sessionTimeout)&&(this._sessionId=d),this._lastEventTime=d,it(this);var p,h,g,v=this._ua.browser.name,m=this._ua.browser.major,y=this._ua.os.name;i=i||{};var w=a({},this._apiPropertiesTrackingOptions);n=a({},n||{},w),t=t||{},r=r||{},o=o||{};var _={device_id:this.options.deviceId,user_id:this.options.userId,timestamp:d,event_id:l,session_id:this._sessionId||-1,event_type:e,version_name:st(this,"version_name")?this.options.versionName||h||null:null,platform:st(this,"platform")?this.options.platform:null,os_name:st(this,"os_name")?v||null:null,os_version:st(this,"os_version")?m||null:null,device_model:st(this,"device_model")?y||null:null,device_manufacturer:st(this,"device_manufacturer")?p||null:null,language:st(this,"language")?this.options.language:null,carrier:st(this,"carrier")?g||null:null,api_properties:n,event_properties:$.truncate($.validateProperties(t)),user_properties:$.truncate($.validateProperties(i)),uuid:Ye(),library:{name:"amplitude-js",version:Ke},sequence_number:f,groups:$.truncate($.validateGroups(r)),group_properties:$.truncate($.validateProperties(o)),user_agent:this._userAgent};return e===E.IDENTIFY_EVENT||e===E.GROUP_IDENTIFY_EVENT?(this._unsentIdentifys.push({event:_,callback:c}),this._limitEventsQueued(this._unsentIdentifys)):(this._unsentEvents.push({event:_,callback:c}),this._limitEventsQueued(this._unsentEvents)),this.options.saveEvents&&this.saveEvents(),this._sendEventsIfReady(c),l}catch(e){$.log.error(e)}};var st=function(e,t){return!!e.options.trackingOptions[t]},at=function(e){for(var t=["city","country","dma","ip_address","region"],n={},i=0;ithis.options.savedMaxCount&&e.splice(0,e.length-this.options.savedMaxCount)},Xe.prototype.logEvent=function(e,t,n){return this._shouldDeferCall()?this._q.push(["logEvent"].concat(Array.prototype.slice.call(arguments,0))):this.logEventWithTimestamp(e,t,null,n)},Xe.prototype.logEventWithTimestamp=function(e,t,n,i){return this._shouldDeferCall()?this._q.push(["logEventWithTimestamp"].concat(Array.prototype.slice.call(arguments,0))):this._apiKeySet("logEvent()")?$.validateInput(e,"eventType","string")?$.isEmptyString(e)?("function"===u(i)&&i(0,"No request sent",{reason:"Missing eventType"}),-1):this._logEvent(e,t,null,null,null,null,n,i):("function"===u(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===u(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)},Xe.prototype.logEventWithGroups=function(e,t,n,i){return this._shouldDeferCall()?this._q.push(["logEventWithGroups"].concat(Array.prototype.slice.call(arguments,0))):this._apiKeySet("logEventWithGroups()")?$.validateInput(e,"eventType","string")?this._logEvent(e,t,null,null,n,null,null,i):("function"===u(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===u(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)};var ut=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};Xe.prototype.logRevenueV2=function(e){if(this._shouldDeferCall())return this._q.push(["logRevenueV2"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("logRevenueV2()"))if("object"===u(e)&&e.hasOwnProperty("_q")&&(e=ot(new Le,e)),e instanceof Le){if(e&&e._isValidRevenue())return this.logEvent(E.REVENUE_EVENT,e._toJSONObject())}else $.log.error("Invalid revenue input type. Expected Revenue object but saw "+u(e))},Xe.prototype.logRevenue=function(e,t,n){return this._shouldDeferCall()?this._q.push(["logRevenue"].concat(Array.prototype.slice.call(arguments,0))):this._apiKeySet("logRevenue()")&&ut(e)&&(void 0===t||ut(t))?this._logEvent(E.REVENUE_EVENT,{},{productId:n,special:"revenue_amount",quantity:t||1,price:e},null,null,null,null,null):-1},Xe.prototype.removeEvents=function(e,t,n,i){ct(this,"_unsentEvents",e,n,i),ct(this,"_unsentIdentifys",t,n,i)};var ct=function(e,t,n,i,r){if(!(n<0)){for(var o=[],s=0;sn?o.push(a):a.callback&&a.callback(i,r)}e[t]=o}};Xe.prototype.sendEvents=function(){if(!this._apiKeySet("sendEvents()"))return void this.removeEvents(1/0,1/0,0,"No request sent",{reason:"API key not set"});if(this.options.optOut)return void this.removeEvents(1/0,1/0,0,"No request sent",{reason:"Opt out is set to true"});if(0!==this._unsentCount()&&!this._sending){this._sending=!0;var e=this.options.forceHttps?"https":"https:"===window.location.protocol?"https":"http",t=e+"://"+this.options.apiEndpoint,n=Math.min(this._unsentCount(),this.options.uploadBatchSize),i=this._mergeEventsAndIdentifys(n),r=i.maxEventId,o=i.maxIdentifyId,s=JSON.stringify(i.eventsToSend.map(function(e){var t=e.event;return t})),a=(new Date).getTime(),u={client:this.options.apiKey,e:s,v:E.API_VERSION,upload_time:a,checksum:Ae(E.API_VERSION+this.options.apiKey+s+a)},c=this;new qe(t,u).send(function(e,t){c._sending=!1;try{200===e&&"success"===t?(c.removeEvents(r,o,e,t),c.options.saveEvents&&c.saveEvents(),c._sendEventsIfReady()):413===e&&(1===c.options.uploadBatchSize&&c.removeEvents(r,o,e,t),c.options.uploadBatchSize=Math.ceil(n/2),c.sendEvents())}catch(e){}})}},Xe.prototype._mergeEventsAndIdentifys=function(e){for(var t=[],n=0,i=-1,r=0,o=-1;t.length=this._unsentIdentifys.length,u=n>=this._unsentEvents.length;if(u&&a){$.log.error("Merging Events and Identifys, less events and identifys than expected");break}a?(s=this._unsentEvents[n++],i=s.event.event_id):u?(s=this._unsentIdentifys[r++],o=s.event.event_id):!("sequence_number"in this._unsentEvents[n].event)||this._unsentEvents[n].event.sequence_number2&&void 0!==arguments[2]?arguments[2]:{},s=n.target.dataset,a=i({linkText:n.target.innerText,linkTarget:n.target.getAttribute("href")},e,s,o);r.getInstance().logEvent(t,a)};$(".global-nav__links a").on("click",function(e){var t={linkLocation:"Top Nav"};u("click navigation",e,t)}),$(".global-footer__links-content a").on("click",function(e){var t={linkLocation:"Footer"};u("click footer",e,t)}),$(".global-footer__legal a").on("click",function(e){var t={linkLocation:"Footer"};u("click footer",e,t)}),$(".global-footer__social-links a").on("click",function(e){var t={linkLocation:"Footer"};u("click footer",e,t)}),$("a.button, .location-social__links a, .package-list-static a, .carousel-instructor__list a").on("click",function(e){u("click cta",e)}),$(".offer-bar a").on("click",function(e){u("click offer",e)}),$(".offer-bar-static a").on("click",function(e){u("click offer",e)}),$(".announcement-banner__copy a").on("click",function(e){u("click hello banner",e)}),$("video").each(function(t,n){var o=n,s=$(o).find("source").attr("src"),a=i({videoUrl:s},e);$(o).on("play",function(){r.getInstance().logEvent("video play",a)}),$(o).on("ended",function(){r.getInstance().logEvent("video complete",a)})}),$(document).on("click","form .hs-button",function(e){var t={};if($("nav.super-nav").length>0&&$("nav.super-nav")[0].dataset.navLocation){var n=JSON.parse($("nav.super-nav")[0].dataset.navLocation);t={locationName:n.name,locationId:n.id}}if($(".offer-form__location-picker-container").length>0){var i=JSON.parse($(".offer-form__location-picker-container")[0].dataset.offerLocation);t={locationName:i.name,locationId:i.id,offer:document.title}}u("click form submit",e,t)})})},function(e,t){"use strict";var n=void 0,i=function(){return n||(n=$({})),n},r=function(e,t){i().trigger(e,[t])},o=function(e,t){i().on(e,t)};e.exports={dispatch:r,on:o}},function(e,t,n){"use strict";var i=n(1),r=function(){return"xpo_"+UI_APP.brand_key+"_favorite_locations"},o=function(e){try{var t=localStorage.getItem(r());if(!t)return null;var n=JSON.parse(t);return n[e]||null}catch(e){}return null},s=function(e){try{if(o(e.id))return;var t=localStorage.getItem(r()),n=t?JSON.parse(t):{};n[e.id]={name:e.name,id:e.id,favorite:!0,site_slug:e.site_slug},localStorage.setItem(r(),JSON.stringify(n)),UI_APP.dispatch(i.favoritesSaved,n)}catch(e){}},a=function(e){try{var t=localStorage.getItem(r());if(!t)return;var n=t?JSON.parse(t):{};n[e]&&delete n[e],localStorage.setItem(r(),JSON.stringify(n)),UI_APP.dispatch(i.favoritesSaved,n)}catch(e){}},u=function(){try{var e=localStorage.getItem(r());return e?JSON.parse(e):null}catch(e){}return null},c=function(e){try{o(e.id)?a(e.id):s(e)}catch(e){}return null};e.exports={getFavoriteLocations:u,saveFavoriteByLocation:s,getFavoriteByID:o,deleteFavoriteByID:a,toggleFavorite:c}},function(e,t){"use strict";var n=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!t)try{var i=UI_APP.getFavoriteLocations();if(i){var r=Object.keys(i)[0];if(i[r])return e(i[r])}}catch(e){}var o=UI_APP.remote_id,s=UI_APP.getVarByKey("apiBaseURL")+"/brands/"+UI_APP.apiNameKey+"/locations?geoip="+o+"&open_status=external&limit=1&offer_slug="+n;$.getJSON(s,function(t){return e(t.locations&&t.locations.length>0?t.locations.pop():null)})};e.exports={getNearestLocation:n}},function(e,t){"use strict";function n(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&e.css("transition-duration","0s"),e.attr("data-reveal","revealed")}function i(){var e=$("body,html"),t=e.scrollTop();$('[data-reveal]:not([data-reveal="revealed"])').each(function(e,i){var r=$(i);r.offset().top0){var t=e[0].getAttribute("data-reveal-speed")||100;n($(e[0])),f=e.slice(1),d=setTimeout(r,parseFloat(t))}else d=null}function o(){var e=document.documentElement;e.setAttribute("data-useragent",navigator.userAgent),e.setAttribute("data-platform",navigator.platform),e.className+=Boolean("ontouchstart"in window)||Boolean("onmsgesturechange"in window)?" touch":""}function s(){var e="ontouchstart"in window||navigator.msMaxTouchPoints,t="undefined"!=typeof window.orientation||navigator.userAgent.indexOf("IEMobile")!==-1;document.documentElement.classList.add(t||e?"mobile-device":"desktop-device"),e&&document.documentElement.classList.add(e?"touch-device":"")}function a(){n($(".global-nav")),d=setTimeout(r,100),i(),$("[data-reveal-group]").each(function(e,t){window.revealObserver.observe(t)})}function u(){$("[type=hidden]").closest(".form-columns-1").css({margin:0})}function c(){if(!document.body.classList.contains("no-hero")&&!document.querySelector("html").classList.contains("hs-inline-edit")){var e=document.querySelector('[data-hs-cos-general-type="widget_container"]');e&&[].forEach.call(document.querySelectorAll(".module"),function(t){t.closest(".module-wrapper")||(e.appendChild(t),[].forEach.call(e.querySelectorAll(".hs_cos_wrapper_type_module"),function(e){e.remove&&e.remove()}))})}}function l(){if(window.objectFitPolyfill){var e=document.querySelector(".module__media--video video");e&&objectFitPolyfill(e)}}var f=[],d=void 0;$("window");window.revealObserver=new IntersectionObserver(function(e,t){$.each(e,function(e,n){if(n.isIntersecting){t.unobserve(n.target);var i=$('[data-reveal]:not([data-reveal="revealed"])',n.target).toArray().sort(function(e,t){var n=parseInt($(e).data("reveal"))||Number.MAX_SAFE_INTEGER,i=parseInt($(t).data("reveal"))||Number.MAX_SAFE_INTEGER;return n>i?1:nV[g]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}var f=void 0,p=void 0,g=(""===(f=e.id)&&(e.id=(p=t&&t.id||K.id+M++,null!==document.getElementById(p)&&(p+=M++),f=p),D=(t||{}).log,d(f,"Added missing iframe ID: "+f+" ("+e.src+")")),f);g in V&&"iFrameResizer"in e?h(g,"Ignored iFrame, already setup."):(o(t),function(){switch(d(g,"IFrame scrolling "+(V[g]&&V[g].scrolling?"enabled":"disabled")+" for "+g),e.style.overflow=!1===(V[g]&&V[g].scrolling)?"hidden":"auto",V[g]&&V[g].scrolling){case"omit":break;case!0:e.scrolling="yes";break;case!1:e.scrolling="no";break;default:e.scrolling=V[g]?V[g].scrolling:"no"}}(),l("Height"),l("Width"),c("maxHeight"),c("minHeight"),c("maxWidth"),c("minWidth"),"number"!=typeof(V[g]&&V[g].bodyMargin)&&"0"!==(V[g]&&V[g].bodyMargin)||(V[g].bodyMarginV1=V[g].bodyMargin,V[g].bodyMargin=V[g].bodyMargin+"px"),i(O(g)),V[g]&&(V[g].iframe.iFrameResizer={close:w.bind(null,V[g].iframe),removeListeners:y.bind(null,V[g].iframe),resize:T.bind(null,"Window resize","resize",V[g].iframe),moveToAnchor:function(e){T("Move to anchor","moveToAnchor:"+e,V[g].iframe,g)},sendMessage:function(e){T("Send Message","message:"+(e=JSON.stringify(e)),V[g].iframe,g)}}))}function k(e,t){null===Y&&(Y=setTimeout(function(){Y=null,e()},t))}function P(){"hidden"!==document.visibilityState&&(d("document","Trigger event: Visibility change"),k(function(){R("Tab Visible","resize")},16))}function R(e,t){Object.keys(V).forEach(function(n){var i=void 0;V[i=n]&&"parent"===V[i].resizeFrom&&V[i].autoResize&&!V[i].firstRun&&T(e,t,V[n].iframe,n)})}function x(){u(window,"message",v),u(window,"resize",function(){var e=void 0;d("window","Trigger event: "+(e="resize")),k(function(){R("Window "+e,"resize")},16)}),u(document,"visibilitychange",P),u(document,"-webkit-visibilitychange",P)}function U(){function e(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected