!function(){var e=this&&this.__assign||function(){return e=Object.assign||function(e){for(var t,r=1,o=arguments.length;r>8-o%1*8)){if(t.charAt(0|o)||(s="="),(n=t.charCodeAt(o+=.75))>255)return;i=i<<8|n}return r},isValidGuid:function(e){var t=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;return e&&t.test(e.trim())},warnIfInvalidToken:function(e){var t=h.isValidGuid(e);return t||console.error("Token is not a valid GUID"),t},isValidUserId:function(e){if(!e)return!1;var t=function(e){return e.toString().toLowerCase().trim()},r=["undefined","null","n/a","","none",{},0,1,NaN,!0,!1,"0","1","missing-id"].map(t),o=t(e);return!(r.indexOf(o)>-1)}},p=function(){function o(e,t){this.sessionCookieTime=307584e6,this.userCookieTime=307584e6,this.sessionCookieName="tatari-session-cookie",this.sessionUrlParamName="tatari_session_id",this.sessionId="",this.userCookieName="tatari-user-cookie",this.userId="",this.version=r,this.util=h,this.debugCookieName="tatari-debug-cookie",this.debugCookieTime=864e5,this.debug=!1,this.ipCookieName="t-ip",this.ipCookieTime=3e5,this._i=e,this.url=i,this.cookieSupport=this.getCookieSupport(),this.config=t,this.checkDebugCookie(),this.checkSessionCookie(),this.checkUserCookie(),this.recordIpsIfNecessary(),h.warnIfInvalidToken(e),this.debug&&(console.info("Debug: Tatari Tracker Lib Loaded",this),console.info("Debug: Tatari Tracker TLD",this.getDomain()))}return o.prototype.enableDebug=function(){this.createCookie(this.debugCookieName,"1",this.debugCookieTime),this.debug=!0,console.info("Debug: Tatari Tracker Debug Enabled")},o.prototype.init=function(e,t){this._i=e,this.config=t,h.warnIfInvalidToken(e)},o.prototype.flushCommandQueue=function(e){if(void 0===e&&(e=[]),e.length>0){var t=this;e.forEach(function(e){t[e[0]].apply(t,e.slice(1,e.length))})}},o.prototype.scrubParams=function(e){var t,r=this;if((null===(t=this.config)||void 0===t?void 0:t.queryParamScrubs)&&e){var o=document.createElement("a");o.setAttribute("href",e);var i=o.search;if(i){var n=[];i.replace(/^\?/,"").split("&").forEach(function(e){var t=decodeURIComponent(e.split("=")[0]);r.config.queryParamScrubs.some(function(e){return e===t})||n.push(e)});var s="?"+n.join("&");return e.replace(i,s)}}return e},o.prototype.scrubUrl=function(e){var t;if((null===(t=this.config)||void 0===t?void 0:t.urlScrubs)&&e){var r=e;return this.config.urlScrubs.forEach(function(t){var o=t.test(e)&&RegExp.$1;o&&(r=e.replace(o,"TATARI-SCRUBBED"))}),r}return e},o.prototype.scrub=function(e){return this.config?this.scrubUrl(this.scrubParams(e)):e},o.prototype.getProperties=function(){return{$os:h.os(),$referrer:this.scrub(document.referrer),$currentUrl:this.scrub(window.location.href)}},o.prototype.removePII=function(e,t){var r="";if(a.includes(e.toString().toLowerCase().trim()))return[e,""];if(d.test(t.toString()))return[e,""];for(r in c)if(t.toString().includes(c[r]))return[e,""];return[e,t]},o.prototype.removePIIFromArray=function(e){var t=this;return e.map(function(e){if("object"!=typeof e||null===e||Array.isArray(e)){if(Array.isArray(e))return t.removePIIFromArray(e);if("string"==typeof e){var r=t.removePII("arrayElement",e);return r[1]}return e}for(var o={},i=0,n=Object.entries(e);i65535&&(console.warn("Tatari Tracker arg should be smaller than 65535 characters, was "+i.length+"."),"object"==typeof o&&console.warn("Tatari Tracker arg size was the result of large JSON serialization."));var p=e({version:this.version,token:this._i,sessionId:this.sessionId,cookieSupport:this.cookieSupport,userId:this.userId,arg:i,event:r},this.getProperties());this.removeEmptyKeys(p);var m=this.buildReqUrl(p);this.debug&&console.info("Debug: Tatari Tracker Event Fired",p),this.sendRequest(m)}catch(e){console.warn("Tatari's tracking library encountered an error when attempting to track.",e)}},o.prototype.sendRequest=function(e){if(this._i){var t=new XMLHttpRequest;t.open("GET",e,!0),t.send(null)}else this.debug&&console.info("Debug: Tatari Tracker suppressing request with invalid token")},o.prototype.removeEmptyKeys=function(e){Object.keys(e).forEach(function(t){return(void 0===e[t]||null===e[t]||""===e[t])&&delete e[t]})},o.prototype.buildReqUrl=function(e,t){void 0===t&&(t=this.url);var r=this.buildDataBlob(e);return t+"?data="+encodeURIComponent(r)+"&date="+ +new Date},o.prototype.buildDataBlob=function(e){var t=Object.keys(e).map(function(t){var r=encodeURIComponent;return"object"==typeof e[t]&&(r=function(e){return encodeURIComponent(JSON.stringify(e))}),encodeURIComponent(t)+"="+r(e[t])}).join("&");return""+this.util.btoa(t)},o.prototype.pageview=function(){this._track(t.Pageview),window.ttm&&window.ttm.onPageview&&window.ttm.onPageview()},o.prototype.track=function(e,t){return e?"string"==typeof e&&s[e.toLowerCase()]?void console.warn("Supressing event "+e):(this._track("e_"+e.toString(),t),void(window.ttm&&window.ttm.onTrack&&window.ttm.onTrack(e.toString(),t))):void console.error("Undefined event passed to track.")},o.prototype.identify=function(e){var r=this.userId;if(!h.isValidUserId(e))return void console.error("Invalid id passed to identify.");r&&e.toString()===r||(this.userId=e.toString(),this.createCookie(this.userCookieName,this.userId,this.userCookieTime),this._track(t.Tie)),this._track(t.Identify),window.ttm&&window.ttm.onIdentify&&window.ttm.onIdentify(e.toString())},o.prototype.addToCart=function(e){return e?"string"!=typeof e.productId?void console.error("AddToCart: productId must be a string."):"number"!=typeof e.quantity||e.quantity<=0?void console.error("AddToCart: quantity must be a number greater than 0."):"number"!=typeof e.price||e.price<0?void console.error("AddToCart: price must be a number >= 0."):e.name&&"string"!=typeof e.name?void console.error("AddToCart: name must be a string."):e.category&&"string"!=typeof e.category?void console.error("AddToCart: category must be a string."):void this._track(t.AddToCart,e):void console.error("AddToCart: params object is required.")},o.prototype.searchSubmitted=function(e){return e?e.searchTerm&&"string"==typeof e.searchTerm&&""!==e.searchTerm.trim()?void this._track(t.SearchSubmitted,e):void console.error("SearchSubmitted: searchTerm is required and must be a non-empty string."):void console.error("SearchSubmitted: params object is required.")},o.prototype.signUp=function(){this._track(t.SignUp)},o.prototype.leadSubmitted=function(){this._track(t.Lead)},o.prototype.productViewed=function(e){return e?e.name&&"string"==typeof e.name?"number"!=typeof e.price||e.price<0?void console.error("ProductViewed: price must be a number >= 0."):"number"!=typeof e.quantity||e.quantity<=0?void console.error("ProductViewed: quantity must be a number greater than 0."):e.category&&"string"!=typeof e.category?void console.error("ProductViewed: category must be a string."):e.productId&&"string"!=typeof e.productId?void console.error("ProductViewed: productId must be a string."):void this._track(t.ProductViewed,e):void console.error("ProductViewed: name is required and must be a string."):void console.error("ProductViewed: product object is required.")},o.prototype.checkoutStarted=function(r){if(!r)return void console.error("CheckoutStarted: params object is required.");if("number"!=typeof r.total||r.total<=0)return void console.error("CheckoutStarted: total must be a positive number.");if(!r.items||!Array.isArray(r.items))return void console.error("CheckoutStarted: items array is required.");if(0===r.items.length)return void console.error("CheckoutStarted: items array cannot be empty.");for(var o=0;o