!function(){var e=this&&this.__assign||function(){return e=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},e.apply(this,arguments)};try{!function(){var t,r="1.2.18",o=navigator.userAgent,i="https://tte-prod.telemetry.vaultdcr.com/5a28e627",n={Persist:"PERSIST",None:"NONE"};!function(e){e.Tie="_tie",e.Identify="identify",e.Pageview="pageview",e.SessionTie="_s_tie",e.AddToCart="e_add_to_cart",e.Purchase="e_purchase",e.CheckoutStarted="e_checkout_started",e.SearchSubmitted="e_search_submitted",e.SignUp="e_sign_up",e.Lead="e_lead",e.ProductViewed="e_product_viewed"}(t||(t={}));var s={pageview:!0,"page view":!0,"page-view":!0,page_view:!0},a=["address","ssn","phone","phone number","city","state","dob","first name","last name"],c=["@","%"],u="(999)999-9999|999-999-9999",d=RegExp("^("+u.replace(/([\(\)])/g,"\\$1").replace(/9/g,"\\d")+")$"),h={os:function(){return/Windows/i.test(o)?/Phone/.test(o)||/WPDesktop/.test(o)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(o)?"iOS":/Android/.test(o)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(o)?"BlackBerry":/Mac/i.test(o)?"Mac OS X":/Linux/.test(o)?"Linux":""},btoa:function(e){for(var t=String(e),r="",o=0,i=void 0,n=void 0,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.charAt(0|o)||o%1;r+=s.charAt(63&i>>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);i<n.length;i++){var s=n[i],a=s[0],c=s[1];if(Array.isArray(c))o[a]=t.removePIIFromArray(c);else if("object"==typeof c&&null!==c){for(var u={},d=0,h=Object.entries(c);d<h.length;d++){var p=h[d],m=p[0],f=p[1],r=t.removePII(m,f.toString());u[r[0]]=r[1]}o[a]=u}else if("string"==typeof c){var r=t.removePII(a,c);o[r[0]]=r[1]}else o[a]=c}return o})},o.prototype._track=function(r,o){void 0===o&&(o="");try{r!==t.Tie&&r!==t.SessionTie&&this.checkSessionCookie();var i=o,n=[],s={};if("object"==typeof o)try{for(var a=0,c=Object.entries(o);a<c.length;a++){var u=c[a],d=u[0],h=u[1];Array.isArray(h)?s[d]=this.removePIIFromArray(h):(n=this.removePII(d,h.toString()),s[n[0]]=n[1])}i=JSON.stringify(s)}catch(e){i="",console.warn("Tatari Tracker arg should be a valid JSON object")}i.length>65535&&(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<r.items.length;o++){var i=r.items[o];if(!i.name||"string"!=typeof i.name)return void console.error("CheckoutStarted: item "+o+" must have a valid name.");if("number"!=typeof i.price||i.price<0)return void console.error("CheckoutStarted: item "+o+" must have a valid price.");if("number"!=typeof i.quantity||i.quantity<=0)return void console.error("CheckoutStarted: item "+o+" must have a valid quantity.")}if(r.currency&&"string"!=typeof r.currency)return void console.error("CheckoutStarted: currency must be a string.");var n=e(e({},r),r.currency&&{currency:r.currency.toUpperCase()});this._track(t.CheckoutStarted,n)},o.prototype.purchase=function(r){if(!r)return void console.error("Purchase: params object is required.");if("number"!=typeof r.total||r.total<=0)return void console.error("Purchase: total must be a positive number.");if(!r.currency||"string"!=typeof r.currency)return void console.error("Purchase: currency is required and must be a string.");if(!/^[A-Z]{3}$/.test(r.currency.toUpperCase()))return void console.error("Purchase: currency must be a 3-letter currency code (e.g., USD, EUR).");if(!r.orderId||"string"!=typeof r.orderId||""===r.orderId.trim())return void console.error("Purchase: orderId is required and must be a non-empty string.");if(!r.items||!Array.isArray(r.items))return void console.error("Purchase: items array is required.");if(0===r.items.length)return void console.error("Purchase: items array cannot be empty.");for(var o=0;o<r.items.length;o++){var i=r.items[o];if(!i.name||"string"!=typeof i.name)return void console.error("Purchase: item "+o+" must have a valid name.");if("number"!=typeof i.price||i.price<0)return void console.error("Purchase: item "+o+" must have a valid price.");if("number"!=typeof i.quantity||i.quantity<=0)return void console.error("Purchase: item "+o+" must have a valid quantity.")}var n=e(e({},r),{currency:r.currency.toUpperCase()});this._track(t.Purchase,n)},o.prototype.guid=function(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return""+e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},o.prototype.createCookie=function(e,t,r){var o="",i=new Date,n="domain="+this.getDomain()+";";return i.setTime(i.getTime()+r),o="expires="+i.toUTCString()+";",document.cookie=e+"="+t+"; "+o+" "+n+" path=/",t},o.prototype.getDomain=function(){var e=document.location||{hostname:""},t=e.hostname.split("."),r="";return t.some(function(e,o){var i=t.slice(t.length-o-1).join(".");if(document.cookie="testTLD=test;domain="+i+";",-1!==document.cookie.indexOf("testTLD=test"))return r=i,document.cookie="testTLD=;domain="+r+";expires="+new Date(0).toUTCString()+";",!0}),r},o.prototype.getCookie=function(e){for(var t=e+"=",r=decodeURIComponent(document.cookie),o=r.split(";"),i=0,n=o;i<n.length;i++){for(var s=n[i];" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(t))return s.substring(t.length,s.length)}},o.prototype.removeCookie=function(e){var t=this.getDomain();document.cookie=e+"=; Max-Age=-99999999;",t&&(document.cookie=e+"=; Max-Age=-99999999; domain="+t+";")},o.prototype.checkUserCookie=function(){var e=this.getCookie(this.userCookieName);e&&!h.isValidUserId(e)?this.removeCookie(this.userCookieName):(this.userId=e,this.userId&&(this.removeCookie(this.userCookieName),this.createCookie(this.userCookieName,this.userId,this.userCookieTime)))},o.prototype.checkSessionCookie=function(){var e=this;this.sessionId=this.getCookie(this.sessionCookieName);var r,o=window.location.search?window.location.search.replace(/^\?/,"").split("&").map(function(e){return e.split("=").map(decodeURIComponent)}):[];o.forEach(function(t){t&&2===t.length&&t[0]===e.sessionUrlParamName&&(r=t)});var i=r&&r[1];this.sessionId&&!h.isValidGuid(this.sessionId)&&(console.warn("Invalid stored session ID ("+this.sessionId+"). Ignoring."),this.removeCookie(this.sessionCookieName),this.sessionId=null),i&&!h.isValidGuid(i)&&(console.warn("Invalid parameter session ID ("+i+"). Ignoring."),i=null),i&&this.sessionId!==i&&(this.sessionId&&this._track(t.SessionTie,i),this.createCookie(this.sessionCookieName,i,this.sessionCookieTime),this.sessionId=i),this.sessionId?(this.removeCookie(this.sessionCookieName),this.createCookie(this.sessionCookieName,this.sessionId,this.sessionCookieTime)):this.sessionId=this.createCookie(this.sessionCookieName,this.guid(),this.sessionCookieTime)},o.prototype.checkDebugCookie=function(){var e=this.getCookie(this.debugCookieName);this.debug=!!e},o.prototype.recordIpsIfNecessary=function(){var t=this;if(!this.getCookie(this.ipCookieName)){this.createCookie(this.ipCookieName,"1",this.ipCookieTime);var r={version:this.version,token:this._i,sessionId:this.sessionId};this.removeEmptyKeys(r),[this.buildReqUrl(r,"https://ttip-ipv4-prod.telemetry.vaultdcr.com/5a28e627"),this.buildReqUrl(e({ipv6:!0},r),"https://ttip-ipv6-prod.telemetry.vaultdcr.com/5a28e627")].forEach(function(e){t.sendRequest(e)})}},o.prototype.getCookieSupport=function(){var e="tatari-cookie-test="+Math.floor(1e8*Math.random()),t=new Date;return t.setTime(t.getTime()+this.sessionCookieTime),document.cookie=e+"; expires="+t.toUTCString()+"; path=/",-1!==document.cookie.indexOf(e)?n.Persist:n.None},o}(),m=window.tatari||[],f=new p(m._i,m.config);window.tatari=f,f.flushCommandQueue(m)}()}catch(e){console.log(e)}}();