From 3dbe7ea799d1a519ada012db3a9c8b9fb1018aab Mon Sep 17 00:00:00 2001 From: Sayan Mitra Date: Thu, 14 May 2020 18:25:17 +0530 Subject: [PATCH] adding server identifiable names --- analytics.js | 6 ++++- dist/browser.js | 43 ++++++++++++++++++++++++++++-- dist/rudder-analytics.min.js | 2 +- integrations/client_server_name.js | 21 +++++++++++++++ integrations/integration_cname.js | 1 + tests/html/browser.js | 43 ++++++++++++++++++++++++++++-- utils/utils.js | 19 +++++++++++++ 7 files changed, 129 insertions(+), 6 deletions(-) create mode 100644 integrations/client_server_name.js diff --git a/analytics.js b/analytics.js index 17bce747f1..6482ac4b8e 100644 --- a/analytics.js +++ b/analytics.js @@ -4,7 +4,8 @@ import { handleError, getDefaultPageProperties, findAllEnabledDestinations, - tranformToRudderNames + tranformToRudderNames, + transformToServerNames } from "./utils/utils"; import { CONFIG_URL, @@ -620,6 +621,9 @@ class Analytics { this.toBeProcessedByIntegrationArray.push([type, rudderElement]); } + // convert integrations object to server identified names, kind of hack now! + transformToServerNames(rudderElement.message.integrations) + // self analytics process, send to rudder enqueue.call(this, rudderElement, type); diff --git a/dist/browser.js b/dist/browser.js index dd0aa66f61..ab4309f08e 100644 --- a/dist/browser.js +++ b/dist/browser.js @@ -157,6 +157,7 @@ var rudderanalytics = (function (exports) { } }; + // for sdk side native integration identification var commonNames = { "All": "All", "Google Analytics": "GA", @@ -196,6 +197,25 @@ var rudderanalytics = (function (exports) { "VWO": "VWO" }; + var clientToServerNames = { + "All": "All", + "GA": "Google Analytics", + "GOOGLEADS": "Google Ads", + "BRAZE": "Braze", + "Chartbeat": "Chartbeat", + "COMSCORE": "Comscore", + "CUSTOMERIO": "Customer IO", + "FB_PIXEL": "Facebook Pixel", + "GOOGLETAGMANAGER": "Google Tag Manager", + "HOTJAR": "Hotjar", + "HS": "HubSpot", + "INTERCOM": "Intercom", + "KEEN": "Keen", + "KISSMETRICS": "Kiss Metrics", + "LOTAME": "Lotame", + "VWO": "VWO" + }; + /** * * Utility method for excluding null and empty values in JSON @@ -384,7 +404,7 @@ var rudderanalytics = (function (exports) { } if (key != "All") { - // delete user supplied keys except All and if except those where oldkeys are same as transformed keys + // delete user supplied keys except All and if except those where oldkeys are not present or oldkeys are same as transformed keys if (commonNames[key] != undefined && commonNames[key] != key) { delete integrationObject[key]; } @@ -392,6 +412,23 @@ var rudderanalytics = (function (exports) { } }); } + + function transformToServerNames(integrationObject) { + Object.keys(integrationObject).forEach(function (key) { + if (integrationObject.hasOwnProperty(key)) { + if (clientToServerNames[key]) { + integrationObject[clientToServerNames[key]] = integrationObject[key]; + } + + if (key != "All") { + // delete user supplied keys except All and if except those where oldkeys are not present or oldkeys are same as transformed keys + if (clientToServerNames[key] != undefined && clientToServerNames[key] != key) { + delete integrationObject[key]; + } + } + } + }); + } /** * * @param {*} sdkSuppliedIntegrations @@ -10973,8 +11010,10 @@ var rudderanalytics = (function (exports) { logger.debug("pushing in replay queue"); //new event processing after analytics initialized but integrations not fetched from BE this.toBeProcessedByIntegrationArray.push([type, rudderElement]); - } // self analytics process, send to rudder + } // convert integrations object to server identified names, kind of hack now! + + transformToServerNames(rudderElement.message.integrations); // self analytics process, send to rudder enqueue.call(this, rudderElement, type); logger.debug(type + " is called "); diff --git a/dist/rudder-analytics.min.js b/dist/rudder-analytics.min.js index b45b50c0ac..8a823b56e3 100644 --- a/dist/rudder-analytics.min.js +++ b/dist/rudder-analytics.min.js @@ -1 +1 @@ -var rudderanalytics=function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n-1?t:t+e:window.location.href,r=n.indexOf("#");return r>-1?n.slice(0,r):n}(r)}}function m(){for(var e,t=document.getElementsByTagName("link"),n=0;e=t[n];n++)if("canonical"===e.getAttribute("rel"))return e.getAttribute("href")}function v(e,t){var n=e.revenue;return!n&&t&&t.match(/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i)&&(n=e.total),function(e){if(e){if("number"==typeof e)return e;if("string"==typeof e)return e=e.replace(/\$/g,""),e=parseFloat(e),isNaN(e)?void 0:e}}(n)}function b(e){Object.keys(e).forEach((function(t){e.hasOwnProperty(t)&&(d[t]&&(e[d[t]]=e[t]),"All"!=t&&null!=d[t]&&d[t]!=t&&delete e[t])}))}function w(e,n){var r=[];if(!n||0==n.length)return r;var i=!0;return"string"==typeof n[0]?(null!=e.All&&(i=e.All),n.forEach((function(t){if(i){var n=!0;null!=e[t]&&0==e[t]&&(n=!1),n&&r.push(t)}else e[t]&&e[t]&&r.push(t)})),r):"object"==t(n[0])?(null!=e.All&&(i=e.All),n.forEach((function(t){if(i){var n=!0;null!=e[t.name]&&0==e[t.name]&&(n=!1),n&&r.push(t)}else e[t.name]&&e[t.name]&&r.push(t)})),r):void 0}var k={TRACK:"track",PAGE:"page",IDENTIFY:"identify"},_={PRODUCTS_SEARCHED:"Products Searched",PRODUCT_LIST_VIEWED:"Product List Viewed",PRODUCT_LIST_FILTERED:"Product List Filtered",PROMOTION_VIEWED:"Promotion Viewed",PROMOTION_CLICKED:"Promotion Clicked",PRODUCT_CLICKED:"Product Clicked",PRODUCT_VIEWED:"Product Viewed",PRODUCT_ADDED:"Product Added",PRODUCT_REMOVED:"Product Removed",CART_VIEWED:"Cart Viewed",CHECKOUT_STARTED:"Checkout Started",CHECKOUT_STEP_VIEWED:"Checkout Step Viewed",CHECKOUT_STEP_COMPLETED:"Checkout Step Completed",PAYMENT_INFO_ENTERED:"Payment Info Entered",ORDER_UPDATED:"Order Updated",ORDER_COMPLETED:"Order Completed",ORDER_REFUNDED:"Order Refunded",ORDER_CANCELLED:"Order Cancelled",COUPON_ENTERED:"Coupon Entered",COUPON_APPLIED:"Coupon Applied",COUPON_DENIED:"Coupon Denied",COUPON_REMOVED:"Coupon Removed",PRODUCT_ADDED_TO_WISHLIST:"Product Added to Wishlist",PRODUCT_REMOVED_FROM_WISHLIST:"Product Removed from Wishlist",WISH_LIST_PRODUCT_ADDED_TO_CART:"Wishlist Product Added to Cart",PRODUCT_SHARED:"Product Shared",CART_SHARED:"Cart Shared",PRODUCT_REVIEWED:"Product Reviewed"},I="https://hosted-dataplane.rudderstack.com";function E(e,t){l.debug("in script loader=== "+e);var n=document.createElement("script");n.src=t,n.type="text/javascript",n.id=e;var r=document.getElementsByTagName("script")[0];l.debug("==script==",r),r.parentNode.insertBefore(n,r)}var A=function(){function e(t){n(this,e),this.hubId=t.hubID,this.name="HS"}return i(e,[{key:"init",value:function(){E("hubspot-integration","http://js.hs-scripts.com/"+this.hubId+".js"),l.debug("===in init HS===")}},{key:"identify",value:function(e){l.debug("in HubspotAnalyticsManager identify");var n=e.message.context.traits,r={};for(var i in n)if(Object.getOwnPropertyDescriptor(n,i)&&n[i]){var o=i;"[object Date]"==toString.call(n[i])?r[o]=n[i].getTime():r[o]=n[i]}var s=e.message.context.user_properties;for(var a in s){if(Object.getOwnPropertyDescriptor(s,a)&&s[a])r[a]=s[a]}(l.debug(r),void 0!==("undefined"==typeof window?"undefined":t(window)))&&(window._hsq=window._hsq||[]).push(["identify",r])}},{key:"track",value:function(e){l.debug("in HubspotAnalyticsManager track");var t=window._hsq=window._hsq||[],n={};n.id=e.message.event,e.message.properties&&(e.message.properties.revenue||e.message.properties.value)&&(n.value=e.message.properties.revenue||e.message.properties.value),t.push(["trackEvent",n])}},{key:"page",value:function(e){l.debug("in HubspotAnalyticsManager page");var t=window._hsq=window._hsq||[];e.message.properties&&e.message.properties.path&&t.push(["setPath",e.message.properties.path]),t.push(["trackPageView"])}},{key:"isLoaded",value:function(){return l.debug("in hubspot isLoaded"),!(!window._hsq||window._hsq.push===Array.prototype.push)}},{key:"isReady",value:function(){return!(!window._hsq||window._hsq.push===Array.prototype.push)}}]),e}(),T=Object.prototype.toString;var C=function e(t){var n=function(e){switch(T.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":null!=(t=e)&&(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))?"buffer":typeof(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e));var t}(t);if("object"===n){var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=e(t[i]));return r}if("array"===n){r=new Array(t.length);for(var o=0,s=t.length;o1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*D;case"days":case"day":case"d":return n*j;case"hours":case"hour":case"hrs":case"hr":case"h":return n*R;case"minutes":case"minute":case"mins":case"min":case"m":return n*x;case"seconds":case"second":case"secs":case"sec":case"s":return n*P;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}(e):t.long?function(e){return M(e,j,"day")||M(e,R,"hour")||M(e,x,"minute")||M(e,P,"second")||e+" ms"}(e):function(e){return e>=j?Math.round(e/j)+"d":e>=R?Math.round(e/R)+"h":e>=x?Math.round(e/x)+"m":e>=P?Math.round(e/P)+"s":e+"ms"}(e)};function M(e,t,n){if(!(e=31},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){return JSON.stringify(e)},t.enable(n())}))),B=(N.log,N.formatArgs,N.save,N.load,N.useColors,N.storage,N.colors,N("cookie")),q=function(e,t,n){switch(arguments.length){case 3:case 2:return F(e,t,n);case 1:return G(e);default:return K()}};function F(e,t,n){n=n||{};var r=H(e)+"="+H(t);null==t&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(r+="; path="+n.path),n.domain&&(r+="; domain="+n.domain),n.expires&&(r+="; expires="+n.expires.toUTCString()),n.samesite&&(r+="; samesite="+n.samesite),n.secure&&(r+="; secure"),document.cookie=r}function K(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},r=e.split(/ *; */);if(""==r[0])return n;for(var i=0;i1)))/4)-l((e-1901+t)/100)+l((e-1601+t)/400)};t=function(e){for(i=l(e/864e5),n=l(i/365.2425)+1970-1;f(n+1,0)<=i;n++);for(r=l((i-f(n,0))/30.42);f(n,r+1)<=i;r++);i=1+i-f(n,r),s=l((o=(e%864e5+864e5)%864e5)/36e5)%24,a=l(o/6e4)%60,u=l(o/1e3)%60,c=o%1e3}}return(E=function(e){return e>-1/0&&e<1/0?(t(e),e=(n<=0||n>=1e4?(n<0?"-":"+")+I(6,n<0?-n:n):I(4,n))+"-"+I(2,r+1)+"-"+I(2,i)+"T"+I(2,s)+":"+I(2,a)+":"+I(2,u)+"."+I(3,c)+"Z",n=r=i=s=a=u=c=null):e=null,e})(e)};if(b("json-stringify")&&!b("date-serialization")){function A(e){return E(this)}var T=t.stringify;t.stringify=function(e,t,n){var r=u.prototype.toJSON;u.prototype.toJSON=A;var i=T(e,t,n);return u.prototype.toJSON=r,i}}else{var C=function(e){var t=e.charCodeAt(0),n=_[t];return n||"\\u00"+I(2,t.toString(16))},O=/[\x00-\x1f\x22\x5c]/g,S=function(e){return O.lastIndex=0,'"'+(O.test(e)?e.replace(O,C):e)+'"'},P=function(e,t,n,r,i,o,s){var a,c,d,p,h,y,v,b,w;if(m((function(){a=t[e]})),"object"==typeof a&&a&&(a.getUTCFullYear&&"[object Date]"==g.call(a)&&a.toJSON===u.prototype.toJSON?a=E(a):"function"==typeof a.toJSON&&(a=a.toJSON(e))),n&&(a=n.call(t,e,a)),a==f)return a===f?a:"null";switch("object"==(c=typeof a)&&(d=g.call(a)),d||c){case"boolean":case"[object Boolean]":return""+a;case"number":case"[object Number]":return a>-1/0&&a<1/0?""+a:"null";case"string":case"[object String]":return S(""+a)}if("object"==typeof a){for(v=s.length;v--;)if(s[v]===a)throw l();if(s.push(a),p=[],b=o,o+=i,"[object Array]"==d){for(y=0,v=a.length;y0)for(r>10&&(r=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||L();e+=j("0x"+o.slice(t,x));break;default:L()}else{if(34==i)break;for(i=o.charCodeAt(x),t=x;i>=32&&92!=i&&34!=i;)i=o.charCodeAt(++x);e+=o.slice(t,x)}if(34==o.charCodeAt(x))return x++,e;L();default:if(t=x,45==i&&(r=!0,i=o.charCodeAt(++x)),i>=48&&i<=57){for(48==i&&((i=o.charCodeAt(x+1))>=48&&i<=57)&&L(),r=!1;x=48&&i<=57);x++);if(46==o.charCodeAt(x)){for(n=++x;n57);n++);n==x&&L(),x=n}if(101==(i=o.charCodeAt(x))||69==i){for(43!=(i=o.charCodeAt(++x))&&45!=i||x++,n=x;n57);n++);n==x&&L(),x=n}return+o.slice(t,x)}r&&L();var a=o.slice(x,x+4);if("true"==a)return x+=4,!0;if("fals"==a&&101==o.charCodeAt(x+4))return x+=5,!1;if("null"==a)return x+=4,null;L()}return"$"},U=function(e){var t,n;if("$"==e&&L(),"string"==typeof e){if("@"==(w?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=M());)n?","==e?"]"==(e=M())&&L():L():n=!0,","==e&&L(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=M());)n?","==e?"}"==(e=M())&&L():L():n=!0,","!=e&&"string"==typeof e&&"@"==(w?e.charAt(0):e[0])&&":"==M()||L(),t[e.slice(1)]=U(M());return t}L()}return e},N=function(e,t,n){var r=B(e,t,n);r===f?delete e[t]:e[t]=r},B=function(e,t,n){var r,i=e[t];if("object"==typeof i&&i)if("[object Array]"==g.call(i))for(r=i.length;r--;)N(g,k,i);else k(i,(function(e){N(i,e,n)}));return n.call(e,t,i)};t.parse=function(e,t){var n,r;return x=0,R=""+e,n=U(M()),"$"!=M()&&L(),x=R=null,t&&"[object Function]"==g.call(t)?B(((r={})[""]=n,r),"",t):n}}}return t.runInContext=s,t}if(!o||o.global!==o&&o.window!==o&&o.self!==o||(i=o),r)s(i,r);else{var a=i.JSON,u=i.JSON3,c=!1,l=s(i,i.JSON3={noConflict:function(){return c||(c=!0,i.JSON=a,i.JSON3=u,a=u=null),l}});i.JSON={parse:l.parse,stringify:l.stringify}}}).call(O)})),ae=S((function(e,t){function n(e){switch(e){case"http:":return 80;case"https:":return 443;default:return location.port}}t.parse=function(e){var t=document.createElement("a");return t.href=e,{href:t.href,host:t.host||location.host,port:"0"===t.port||""===t.port?n(t.protocol):t.port,hash:t.hash,hostname:t.hostname||location.hostname,pathname:"/"!=t.pathname.charAt(0)?"/"+t.pathname:t.pathname,protocol:t.protocol&&":"!=t.protocol?t.protocol:location.protocol,search:t.search,query:t.search.slice(1)}},t.isAbsolute=function(e){return 0==e.indexOf("//")||!!~e.indexOf("://")},t.isRelative=function(e){return!t.isAbsolute(e)},t.isCrossDomain=function(e){e=t.parse(e);var n=t.parse(window.location.href);return e.hostname!==n.hostname||e.port!==n.port||e.protocol!==n.protocol}})),ue=(ae.parse,ae.isAbsolute,ae.isRelative,ae.isCrossDomain,1e3),ce=60*ue,le=60*ce,de=24*le,pe=365.25*de,fe=function(e,t){return t=t||{},"string"==typeof e?function(e){if((e=""+e).length>1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*pe;case"days":case"day":case"d":return n*de;case"hours":case"hour":case"hrs":case"hr":case"h":return n*le;case"minutes":case"minute":case"mins":case"min":case"m":return n*ce;case"seconds":case"second":case"secs":case"sec":case"s":return n*ue;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}(e):t.long?function(e){return he(e,de,"day")||he(e,le,"hour")||he(e,ce,"minute")||he(e,ue,"second")||e+" ms"}(e):function(e){return e>=de?Math.round(e/de)+"d":e>=le?Math.round(e/le)+"h":e>=ce?Math.round(e/ce)+"m":e>=ue?Math.round(e/ue)+"s":e+"ms"}(e)};function he(e,t,n){if(!(e=31},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){return JSON.stringify(e)},t.enable(n())}))),me=(ye.log,ye.formatArgs,ye.save,ye.load,ye.useColors,ye.storage,ye.colors,ye("cookie")),ve=function(e,t,n){switch(arguments.length){case 3:case 2:return be(e,t,n);case 1:return ke(e);default:return we()}};function be(e,t,n){n=n||{};var r=_e(e)+"="+_e(t);null==t&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(r+="; path="+n.path),n.domain&&(r+="; domain="+n.domain),n.expires&&(r+="; expires="+n.expires.toUTCString()),n.secure&&(r+="; secure"),n.samesite&&(r+="; samesite="+n.samesite),document.cookie=r}function we(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},r=e.split(/ *; */);if(""==r[0])return n;for(var i=0;i=0;--o)i.push(t.slice(o).join("."));return i},r.cookie=ve,t=e.exports=r})),Ae=new(function(){function e(t){n(this,e),this._options={},this.options(t)}return i(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this._options;var t="."+Ee(window.location.href);"."===t&&(t=null),this._options=ie(e,{maxage:31536e6,path:"/",domain:t,samesite:"Lax"}),this.set("test_rudder",!0),this.get("test_rudder")||(this._options.domain=null),this.remove("test_rudder")}},{key:"set",value:function(e,t){try{return t=se.stringify(t),q(e,t,C(this._options)),!0}catch(e){return!1}}},{key:"get",value:function(e){try{var t=q(e);return t=t?se.parse(t):null}catch(e){return null}}},{key:"remove",value:function(e){try{return q(e,null,C(this._options)),!0}catch(e){return!1}}}]),e}())({}),Te=function(){var e,t={},n="undefined"!=typeof window?window:O,r=n.document,i="localStorage";if(t.disabled=!1,t.version="1.3.20",t.set=function(e,t){},t.get=function(e,t){},t.has=function(e){return void 0!==t.get(e)},t.remove=function(e){},t.clear=function(){},t.transact=function(e,n,r){null==r&&(r=n,n=null),null==n&&(n={});var i=t.get(e,n);r(i),t.set(e,i)},t.getAll=function(){var e={};return t.forEach((function(t,n){e[t]=n})),e},t.forEach=function(){},t.serialize=function(e){return se.stringify(e)},t.deserialize=function(e){if("string"==typeof e)try{return se.parse(e)}catch(t){return e||void 0}},function(){try{return i in n&&n[i]}catch(e){return!1}}())e=n[i],t.set=function(n,r){return void 0===r?t.remove(n):(e.setItem(n,t.serialize(r)),r)},t.get=function(n,r){var i=t.deserialize(e.getItem(n));return void 0===i?r:i},t.remove=function(t){e.removeItem(t)},t.clear=function(){e.clear()},t.forEach=function(n){for(var r=0;rdocument.w=window<\/script>'),s.close(),o=s.w.frames[0].document,e=o.createElement("div")}catch(t){e=r.createElement("div"),o=r.body}var a=function(n){return function(){var r=Array.prototype.slice.call(arguments,0);r.unshift(e),o.appendChild(e),e.addBehavior("#default#userData"),e.load(i);var s=n.apply(t,r);return o.removeChild(e),s}},u=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),c=function(e){return e.replace(/^d/,"___$&").replace(u,"___")};t.set=a((function(e,n,r){return n=c(n),void 0===r?t.remove(n):(e.setAttribute(n,t.serialize(r)),e.save(i),r)})),t.get=a((function(e,n,r){n=c(n);var i=t.deserialize(e.getAttribute(n));return void 0===i?r:i})),t.remove=a((function(e,t){t=c(t),e.removeAttribute(t),e.save(i)})),t.clear=a((function(e){var t=e.XMLDocument.documentElement.attributes;e.load(i);for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save(i)})),t.forEach=a((function(e,n){for(var r,i=e.XMLDocument.documentElement.attributes,o=0;r=i[o];++o)n(r.name,t.deserialize(e.getAttribute(r.name)))}))}try{var l="__storejs__";t.set(l,l),t.get(l)!=l&&(t.disabled=!0),t.remove(l)}catch(e){t.disabled=!0}return t.enabled=!t.disabled,t}(),Ce=new(function(){function e(t){n(this,e),this._options={},this.enabled=!1,this.options(t)}return i(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this._options;ie(e,{enabled:!0}),this.enabled=e.enabled&&Te.enabled,this._options=e}},{key:"set",value:function(e,t){return!!this.enabled&&Te.set(e,t)}},{key:"get",value:function(e){return this.enabled?Te.get(e):null}},{key:"remove",value:function(e){return!!this.enabled&&Te.remove(e)}}]),e}())({}),Oe="rl_user_id",Se="rl_trait",Pe="rl_anonymous_id",xe="rl_group_id",Re="rl_group_trait",je=new(function(){function e(){if(n(this,e),Ae.set("rudder_cookies",!0),Ae.get("rudder_cookies"))return Ae.remove("rudder_cookies"),void(this.storage=Ae);Ce.enabled&&(this.storage=Ce)}return i(e,[{key:"setItem",value:function(e,t){this.storage.set(e,t)}},{key:"setUserId",value:function(e){"string"==typeof e?this.storage.set(Oe,e):l.error("[Storage] setUserId:: userId should be string")}},{key:"setUserTraits",value:function(e){this.storage.set(Se,e)}},{key:"setGroupId",value:function(e){"string"==typeof e?this.storage.set(xe,e):l.error("[Storage] setGroupId:: groupId should be string")}},{key:"setGroupTraits",value:function(e){this.storage.set(Re,e)}},{key:"setAnonymousId",value:function(e){"string"==typeof e?this.storage.set(Pe,e):l.error("[Storage] setAnonymousId:: anonymousId should be string")}},{key:"getItem",value:function(e){return this.storage.get(e)}},{key:"getUserId",value:function(){return this.storage.get(Oe)}},{key:"getUserTraits",value:function(){return this.storage.get(Se)}},{key:"getGroupId",value:function(){return this.storage.get(xe)}},{key:"getGroupTraits",value:function(){return this.storage.get(Re)}},{key:"getAnonymousId",value:function(){return this.storage.get(Pe)}},{key:"removeItem",value:function(e){return this.storage.remove(e)}},{key:"clear",value:function(){this.storage.remove(Oe),this.storage.remove(Se),this.storage.remove(Pe)}}]),e}()),De=function(){function e(t){n(this,e),this.trackingID=t.trackingID,this.allowLinker=t.allowLinker||!1,this.name="GA"}return i(e,[{key:"init",value:function(){!function(e,t,n,r,i,o,s){e.GoogleAnalyticsObject=i,e.ga=e.ga||function(){(e.ga.q=e.ga.q||[]).push(arguments)},e.ga.l=1*new Date,o=t.createElement(n),s=t.getElementsByTagName(n)[0],o.async=1,o.src="https://www.google-analytics.com/analytics.js",s.parentNode.insertBefore(o,s)}(window,document,"script",0,"ga"),ga("create",this.trackingID,"auto","rudder_ga",{allowLinker:this.allowLinker});var e=je.getUserId();e&&""!==e&&ga("rudder_ga.set","userId",e),l.debug("===in init GA===")}},{key:"identify",value:function(e){var t=""!==e.message.userId?e.message.userId:e.message.anonymousId;ga("rudder_ga.set","userId",t),l.debug("in GoogleAnalyticsManager identify")}},{key:"track",value:function(e){var t=e.message.event,n=e.message.event,r=e.message.event,i="";e.message.properties&&(i=e.message.properties.value?e.message.properties.value:e.message.properties.revenue,t=e.message.properties.category?e.message.properties.category:t,r=e.message.properties.label?e.message.properties.label:r),ga("rudder_ga.send","event",{hitType:"event",eventCategory:t,eventAction:n,eventLabel:r,eventValue:i}),l.debug("in GoogleAnalyticsManager track")}},{key:"page",value:function(e){l.debug("in GoogleAnalyticsManager page");var t=e.message.properties&&e.message.properties.path?e.message.properties.path:void 0,n=e.message.properties&&e.message.properties.title?e.message.properties.title:void 0,r=e.message.properties&&e.message.properties.url?e.message.properties.url:void 0;t&&ga("rudder_ga.set","page",t),n&&ga("rudder_ga.set","title",n),r&&ga("rudder_ga.set","location",r),ga("rudder_ga.send","pageview")}},{key:"isLoaded",value:function(){return l.debug("in GA isLoaded"),!!window.gaplugins}},{key:"isReady",value:function(){return!!window.gaplugins}}]),e}(),Le=function(){function e(t){n(this,e),this.siteId=t.siteID,this.name="HOTJAR",this._ready=!1}return i(e,[{key:"init",value:function(){window.hotjarSiteId=this.siteId,function(e,t,n,r,i,o){e.hj=e.hj||function(){(e.hj.q=e.hj.q||[]).push(arguments)},e._hjSettings={hjid:e.hotjarSiteId,hjsv:6},i=t.getElementsByTagName("head")[0],(o=t.createElement("script")).async=1,o.src="https://static.hotjar.com/c/hotjar-"+e._hjSettings.hjid+".js?sv="+e._hjSettings.hjsv,i.appendChild(o)}(window,document),this._ready=!0,l.debug("===in init Hotjar===")}},{key:"identify",value:function(e){if(e.message.userId||e.message.anonymousId){var t=e.message.context.traits;window.hj("identify",e.message.userId,t)}else l.debug("[Hotjar] identify:: user id is required")}},{key:"track",value:function(e){l.debug("[Hotjar] track:: method not supported")}},{key:"page",value:function(e){l.debug("[Hotjar] page:: method not supported")}},{key:"isLoaded",value:function(){return this._ready}},{key:"isReady",value:function(){return this._ready}}]),e}(),Me=function(){function e(t){n(this,e),this.conversionId=t.conversionID,this.pageLoadConversions=t.pageLoadConversions,this.clickEventConversions=t.clickEventConversions,this.name="GOOGLEADS"}return i(e,[{key:"init",value:function(){!function(e,t,n){l.debug("in script loader=== "+e);var r=n.createElement("script");r.src=t,r.async=1,r.type="text/javascript",r.id=e;var i=n.getElementsByTagName("head")[0];l.debug("==script==",i),i.appendChild(r)}("googleAds-integration","https://www.googletagmanager.com/gtag/js?id="+this.conversionId,document),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",this.conversionId),l.debug("===in init Google Ads===")}},{key:"identify",value:function(e){l.debug("[GoogleAds] identify:: method not supported")}},{key:"track",value:function(e){l.debug("in GoogleAdsAnalyticsManager track");var t=this.getConversionData(this.clickEventConversions,e.message.event);if(t.conversionLabel){var n=t.conversionLabel,r=t.eventName,i=this.conversionId+"/"+n,o={};e.properties&&(o.value=e.properties.revenue,o.currency=e.properties.currency,o.transaction_id=e.properties.order_id),o.send_to=i,window.gtag("event",r,o)}}},{key:"page",value:function(e){l.debug("in GoogleAdsAnalyticsManager page");var t=this.getConversionData(this.pageLoadConversions,e.message.name);if(t.conversionLabel){var n=t.conversionLabel,r=t.eventName;window.gtag("event",r,{send_to:this.conversionId+"/"+n})}}},{key:"getConversionData",value:function(e,t){var n={};return e&&e.forEach((function(e){if(e.name.toLowerCase()===t.toLowerCase())return n.conversionLabel=e.conversionLabel,void(n.eventName=e.name)})),n}},{key:"isLoaded",value:function(){return window.dataLayer.push!==Array.prototype.push}},{key:"isReady",value:function(){return window.dataLayer.push!==Array.prototype.push}}]),e}(),Ue=function(){function e(t){n(this,e),this.accountId=t.accountId,this.settingsTolerance=t.settingsTolerance,this.isSPA=t.isSPA,this.libraryTolerance=t.libraryTolerance,this.useExistingJquery=t.useExistingJquery,this.sendExperimentTrack=t.sendExperimentTrack,this.sendExperimentIdentify=t.sendExperimentIdentify,this.name="VWO",l.debug("Config ",t)}return i(e,[{key:"init",value:function(){l.debug("===in init VWO===");var e=this.accountId,t=this.settingsTolerance,n=this.libraryTolerance,r=this.useExistingJquery,i=this.isSPA;window._vwo_code=function(){var o=!1,s=document;return{use_existing_jquery:function(){return r},library_tolerance:function(){return n},finish:function(){if(!o){o=!0;var e=s.getElementById("_vis_opt_path_hides");e&&e.parentNode.removeChild(e)}},finished:function(){return o},load:function(e){var t=s.createElement("script");t.src=e,t.type="text/javascript",t.innerText,t.onerror=function(){_vwo_code.finish()},s.getElementsByTagName("head")[0].appendChild(t)},init:function(){var n=setTimeout("_vwo_code.finish()",t),r=s.createElement("style"),o="body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}",a=s.getElementsByTagName("head")[0];return r.setAttribute("id","_vis_opt_path_hides"),r.setAttribute("type","text/css"),r.styleSheet?r.styleSheet.cssText=o:r.appendChild(s.createTextNode(o)),a.appendChild(r),this.load("//dev.visualwebsiteoptimizer.com/j.php?a="+e+"&u="+encodeURIComponent(s.URL)+"&r="+Math.random()+"&f="+ +i),n}}}(),window._vwo_settings_timer=window._vwo_code.init(),(this.sendExperimentTrack||this.experimentViewedIdentify)&&this.experimentViewed()}},{key:"experimentViewed",value:function(){window.VWO=window.VWO||[];var e=this;window.VWO.push(["onVariationApplied",function(t){if(t){l.debug("Variation Applied");var n=t[1],r=t[2];if(l.debug("experiment id:",n,"Variation Name:",_vwo_exp[n].comb_n[r]),void 0!==_vwo_exp[n].comb_n[r]&&["VISUAL_AB","VISUAL","SPLIT_URL","SURVEY"].indexOf(_vwo_exp[n].type)>-1){try{e.sendExperimentTrack&&(l.debug("Tracking..."),window.rudderanalytics.track("Experiment Viewed",{experimentId:n,variationName:_vwo_exp[n].comb_n[r]}))}catch(e){l.error("[VWO] experimentViewed:: ",e)}try{e.sendExperimentIdentify&&(l.debug("Identifying..."),window.rudderanalytics.identify(o({},"Experiment: ".concat(n),_vwo_exp[n].comb_n[r])))}catch(e){l.error("[VWO] experimentViewed:: ",e)}}}}])}},{key:"identify",value:function(e){l.debug("method not supported")}},{key:"track",value:function(e){if("Order Completed"===e.message.event){var t=e.message.properties?e.message.properties.total||e.message.properties.revenue:0;l.debug("Revenue",t),window.VWO=window.VWO||[],window.VWO.push(["track.revenueConversion",t])}}},{key:"page",value:function(e){l.debug("method not supported")}},{key:"isLoaded",value:function(){return!!window._vwo_code}},{key:"isReady",value:function(){return!!window._vwo_code}}]),e}(),Ne=function(){function e(t){n(this,e),this.containerID=t.containerID,this.name="GOOGLETAGMANAGER"}return i(e,[{key:"init",value:function(){l.debug("===in init GoogleTagManager==="),function(e,t,n,r,i){e[r]=e[r]||[],e[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var o=t.getElementsByTagName(n)[0],s=t.createElement(n);s.async=!0,s.src="https://www.googletagmanager.com/gtm.js?id="+i,o.parentNode.insertBefore(s,o)}(window,document,"script","dataLayer",this.containerID)}},{key:"identify",value:function(e){l.debug("[GTM] identify:: method not supported")}},{key:"track",value:function(e){l.debug("===in track GoogleTagManager===");var t=e.message,n=a({event:t.event,userId:t.userId,anonymousId:t.anonymousId},t.properties);this.sendToGTMDatalayer(n)}},{key:"page",value:function(e){l.debug("===in page GoogleTagManager===");var t,n=e.message,r=n.name,i=n.properties?n.properties.category:void 0;r&&(t="Viewed "+r+" page"),i&&r&&(t="Viewed "+i+" "+r+" page"),t||(t="Viewed a Page");var o=a({event:t,userId:n.userId,anonymousId:n.anonymousId},n.properties);this.sendToGTMDatalayer(o)}},{key:"isLoaded",value:function(){return!(!window.dataLayer||Array.prototype.push===window.dataLayer.push)}},{key:"sendToGTMDatalayer",value:function(e){window.dataLayer.push(e)}},{key:"isReady",value:function(){return!(!window.dataLayer||Array.prototype.push===window.dataLayer.push)}}]),e}(),Be=function(){function e(t,r){if(n(this,e),this.analytics=r,this.appKey=t.appKey,t.appKey||(this.appKey=""),this.endPoint="",t.dataCenter){var i=t.dataCenter.trim().split("-");"eu"===i[0].toLowerCase()?this.endPoint="sdk.fra-01.braze.eu":this.endPoint="sdk.iad-"+i[1]+".braze.com"}this.name="BRAZE",l.debug("Config ",t)}return i(e,[{key:"formatGender",value:function(e){if(e&&"string"==typeof e){return["woman","female","w","f"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.FEMALE:["man","male","m"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.MALE:["other","o"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.OTHER:void 0}}},{key:"init",value:function(){l.debug("===in init Braze==="),function(e,t,n,r,i){e.appboy={},e.appboyQueue=[];for(var o="initialize destroy getDeviceId toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates requestContentCardsRefresh subscribeToContentCardsUpdates logCardImpressions logCardClick logCardDismissal logFeedDisplayed logContentCardsDisplayed logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick logInAppMessageHtmlClick subscribeToNewInAppMessages subscribeToInAppMessage removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked isPushGranted isPushPermissionGranted registerAppboyPushMessages unregisterAppboyPushMessages trackLocation stopWebTracking resumeWebTracking wipeData ab ab.DeviceProperties ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setLanguage ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPushNotificationSubscriptionType ab.User.prototype.setPhoneNumber ab.User.prototype.setAvatarImageUrl ab.User.prototype.setLastKnownLocation ab.User.prototype.setUserAttribute ab.User.prototype.setCustomUserAttribute ab.User.prototype.addToCustomAttributeArray ab.User.prototype.removeFromCustomAttributeArray ab.User.prototype.incrementCustomUserAttribute ab.User.prototype.addAlias ab.User.prototype.setCustomLocationAttribute ab.InAppMessage ab.InAppMessage.SlideFrom ab.InAppMessage.ClickAction ab.InAppMessage.DismissType ab.InAppMessage.OpenTarget ab.InAppMessage.ImageStyle ab.InAppMessage.TextAlignment ab.InAppMessage.Orientation ab.InAppMessage.CropType ab.InAppMessage.prototype.subscribeToClickedEvent ab.InAppMessage.prototype.subscribeToDismissedEvent ab.InAppMessage.prototype.removeSubscription ab.InAppMessage.prototype.removeAllSubscriptions ab.InAppMessage.prototype.closeMessage ab.InAppMessage.Button ab.InAppMessage.Button.prototype.subscribeToClickedEvent ab.InAppMessage.Button.prototype.removeSubscription ab.InAppMessage.Button.prototype.removeAllSubscriptions ab.SlideUpMessage ab.ModalMessage ab.FullScreenMessage ab.HtmlMessage ab.ControlMessage ab.Feed ab.Feed.prototype.getUnreadCardCount ab.ContentCards ab.ContentCards.prototype.getUnviewedCardCount ab.Card ab.Card.prototype.dismissCard ab.ClassicCard ab.CaptionedImage ab.Banner ab.ControlCard ab.WindowUtils display display.automaticallyShowNewInAppMessages display.showInAppMessage display.showFeed display.destroyFeed display.toggleFeed display.showContentCards display.hideContentCards display.toggleContentCards sharedLib".split(" "),s=0;s>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r>>6-2*i);return n}};e.exports=n}()})),Fe={utf8:{stringToBytes:function(e){return Fe.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Fe.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n>>24)|4278255360&(a[f]<<24|a[f]>>>8);a[u>>>5]|=128<>>9<<4)]=u;var h=o._ff,g=o._gg,y=o._hh,m=o._ii;for(f=0;f>>0,l=l+b>>>0,d=d+w>>>0,p=p+k>>>0}return t.endian([c,l,d,p])};o._ff=function(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+(i>>>0)+s;return(a<>>32-o)+t},o._gg=function(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+(i>>>0)+s;return(a<>>32-o)+t},o._hh=function(e,t,n,r,i,o,s){var a=e+(t^n^r)+(i>>>0)+s;return(a<>>32-o)+t},o._ii=function(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+(i>>>0)+s;return(a<>>32-o)+t},o._blocksize=16,o._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(o(e,n));return n&&n.asBytes?r:n&&n.asString?i.bytesToString(r):t.bytesToHex(r)}}()})),We=function(){function e(t){n(this,e),this.NAME="INTERCOM",this.API_KEY=t.apiKey,this.APP_ID=t.appId,this.MOBILE_APP_ID=t.mobileAppId,l.debug("Config ",t)}return i(e,[{key:"init",value:function(){window.intercomSettings={app_id:this.APP_ID},function(){var e=window,t=e.Intercom;if("function"==typeof t)t("reattach_activator"),t("update",e.intercomSettings);else{var n=document,r=function e(){e.c(arguments)};r.q=[],r.c=function(e){r.q.push(e)},e.Intercom=r;var i=function(){var e=n.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://widget.intercom.io/widget/"+window.intercomSettings.app_id;var t=n.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)};"complete"===document.readyState?(i(),window.intercom_code=!0):e.attachEvent?(e.attachEvent("onload",i),window.intercom_code=!0):(e.addEventListener("load",i,!1),window.intercom_code=!0)}}()}},{key:"page",value:function(){window.Intercom("update")}},{key:"identify",value:function(e){var n={},r=e.message.context;if(null!=(r.Intercom?r.Intercom:null)){var i=r.Intercom.user_hash?r.Intercom.user_hash:null;null!=i&&(n.user_hash=i);var o=r.Intercom.hideDefaultLauncher?r.Intercom.hideDefaultLauncher:null;null!=o&&(n.hide_default_launcher=o)}Object.keys(r.traits).forEach((function(e){if(r.traits.hasOwnProperty(e)){var i=r.traits[e];if("company"===e){var o=[],s={};"string"==typeof r.traits[e]&&(s.company_id=Je(r.traits[e]));var a="object"==t(r.traits[e])&&Object.keys(r.traits[e])||[];a.forEach((function(t){a.hasOwnProperty(t)&&("id"!=t?s[t]=r.traits[e][t]:s.company_id=r.traits[e][t])})),"object"!=t(r.traits[e])||a.includes("id")||(s.company_id=Je(s.name)),o.push(s),n.companies=o}else n[e]=r.traits[e];switch(e){case"createdAt":n.created_at=i;break;case"anonymousId":n.user_id=i}}})),n.user_id=e.message.userId,window.Intercom("update",n)}},{key:"track",value:function(e){var t={},n=e.message;(n.properties?Object.keys(n.properties):null).forEach((function(e){var r=n.properties[e];t[e]=r})),n.event&&(t.event_name=n.event),t.user_id=n.userId?n.userId:n.anonymousId,t.created_at=Math.floor(new Date(n.originalTimestamp).getTime()/1e3),window.Intercom("trackEvent",t.event_name,t)}},{key:"isLoaded",value:function(){return!!window.intercom_code}},{key:"isReady",value:function(){return!!window.intercom_code}}]),e}(),$e=function(){function e(t){n(this,e),this.projectID=t.projectID,this.writeKey=t.writeKey,this.ipAddon=t.ipAddon,this.uaAddon=t.uaAddon,this.urlAddon=t.urlAddon,this.referrerAddon=t.referrerAddon,this.client=null,this.name="KEEN"}return i(e,[{key:"init",value:function(){l.debug("===in init Keen==="),E("keen-integration","https://cdn.jsdelivr.net/npm/keen-tracking@4");var e=setInterval(function(){void 0!==window.KeenTracking&&void 0!==window.KeenTracking&&(this.client=function(e){return e.client=new window.KeenTracking({projectId:e.projectID,writeKey:e.writeKey}),e.client}(this),clearInterval(e))}.bind(this),1e3)}},{key:"identify",value:function(e){l.debug("in Keen identify");var t=e.message.context.traits,n=e.message.userId?e.message.userId:e.message.anonymousId,r=e.message.properties?Object.assign(r,e.message.properties):{};r.user={userId:n,traits:t},r=this.getAddOn(r),this.client.extendEvents(r)}},{key:"track",value:function(e){l.debug("in Keen track");var t=e.message.event,n=e.message.properties;n=this.getAddOn(n),this.client.recordEvent(t,n)}},{key:"page",value:function(e){l.debug("in Keen page");var t=e.message.name,n=e.message.properties?e.message.properties.category:void 0,r="Loaded a Page";t&&(r="Viewed "+t+" page"),n&&t&&(r="Viewed "+n+" "+t+" page");var i=e.message.properties;i=this.getAddOn(i),this.client.recordEvent(r,i)}},{key:"isLoaded",value:function(){return l.debug("in Keen isLoaded"),!(null==this.client)}},{key:"isReady",value:function(){return!(null==this.client)}},{key:"getAddOn",value:function(e){var t=[];return this.ipAddon&&(e.ip_address="${keen.ip}",t.push({name:"keen:ip_to_geo",input:{ip:"ip_address"},output:"ip_geo_info"})),this.uaAddon&&(e.user_agent="${keen.user_agent}",t.push({name:"keen:ua_parser",input:{ua_string:"user_agent"},output:"parsed_user_agent"})),this.urlAddon&&(e.page_url=document.location.href,t.push({name:"keen:url_parser",input:{url:"page_url"},output:"parsed_page_url"})),this.referrerAddon&&(e.page_url=document.location.href,e.referrer_url=document.referrer,t.push({name:"keen:referrer_parser",input:{referrer_url:"referrer_url",page_url:"page_url"},output:"referrer_info"})),e.keen={addons:t},e}}]),e}(),Ye=Object.prototype,Qe=Ye.hasOwnProperty,Ze=Ye.toString;"function"==typeof Symbol&&(Ve=Symbol.prototype.valueOf),"function"==typeof BigInt&&(ze=BigInt.prototype.valueOf);var Xe=function(e){return e!=e},et={boolean:1,number:1,string:1,undefined:1},tt=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/,nt=/^[A-Fa-f0-9]+$/,rt={};rt.a=rt.type=function(e,t){return typeof e===t},rt.defined=function(e){return void 0!==e},rt.empty=function(e){var t,n=Ze.call(e);if("[object Array]"===n||"[object Arguments]"===n||"[object String]"===n)return 0===e.length;if("[object Object]"===n){for(t in e)if(Qe.call(e,t))return!1;return!0}return!e},rt.equal=function(e,t){if(e===t)return!0;var n,r=Ze.call(e);if(r!==Ze.call(t))return!1;if("[object Object]"===r){for(n in e)if(!(rt.equal(e[n],t[n])&&n in t))return!1;for(n in t)if(!(rt.equal(e[n],t[n])&&n in e))return!1;return!0}if("[object Array]"===r){if((n=e.length)!==t.length)return!1;for(;n--;)if(!rt.equal(e[n],t[n]))return!1;return!0}return"[object Function]"===r?e.prototype===t.prototype:"[object Date]"===r&&e.getTime()===t.getTime()},rt.hosted=function(e,t){var n=typeof t[e];return"object"===n?!!t[e]:!et[n]},rt.instance=rt.instanceof=function(e,t){return e instanceof t},rt.nil=rt.null=function(e){return null===e},rt.undef=rt.undefined=function(e){return void 0===e},rt.args=rt.arguments=function(e){var t="[object Arguments]"===Ze.call(e),n=!rt.array(e)&&rt.arraylike(e)&&rt.object(e)&&rt.fn(e.callee);return t||n},rt.array=Array.isArray||function(e){return"[object Array]"===Ze.call(e)},rt.args.empty=function(e){return rt.args(e)&&0===e.length},rt.array.empty=function(e){return rt.array(e)&&0===e.length},rt.arraylike=function(e){return!!e&&!rt.bool(e)&&Qe.call(e,"length")&&isFinite(e.length)&&rt.number(e.length)&&e.length>=0},rt.bool=rt.boolean=function(e){return"[object Boolean]"===Ze.call(e)},rt.false=function(e){return rt.bool(e)&&!1===Boolean(Number(e))},rt.true=function(e){return rt.bool(e)&&!0===Boolean(Number(e))},rt.date=function(e){return"[object Date]"===Ze.call(e)},rt.date.valid=function(e){return rt.date(e)&&!isNaN(Number(e))},rt.element=function(e){return void 0!==e&&"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&1===e.nodeType},rt.error=function(e){return"[object Error]"===Ze.call(e)},rt.fn=rt.function=function(e){if("undefined"!=typeof window&&e===window.alert)return!0;var t=Ze.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t||"[object AsyncFunction]"===t},rt.number=function(e){return"[object Number]"===Ze.call(e)},rt.infinite=function(e){return e===1/0||e===-1/0},rt.decimal=function(e){return rt.number(e)&&!Xe(e)&&!rt.infinite(e)&&e%1!=0},rt.divisibleBy=function(e,t){var n=rt.infinite(e),r=rt.infinite(t),i=rt.number(e)&&!Xe(e)&&rt.number(t)&&!Xe(t)&&0!==t;return n||r||i&&e%t==0},rt.integer=rt.int=function(e){return rt.number(e)&&!Xe(e)&&e%1==0},rt.maximum=function(e,t){if(Xe(e))throw new TypeError("NaN is not a valid value");if(!rt.arraylike(t))throw new TypeError("second argument must be array-like");for(var n=t.length;--n>=0;)if(e=0;)if(e>t[n])return!1;return!0},rt.nan=function(e){return!rt.number(e)||e!=e},rt.even=function(e){return rt.infinite(e)||rt.number(e)&&e==e&&e%2==0},rt.odd=function(e){return rt.infinite(e)||rt.number(e)&&e==e&&e%2!=0},rt.ge=function(e,t){if(Xe(e)||Xe(t))throw new TypeError("NaN is not a valid value");return!rt.infinite(e)&&!rt.infinite(t)&&e>=t},rt.gt=function(e,t){if(Xe(e)||Xe(t))throw new TypeError("NaN is not a valid value");return!rt.infinite(e)&&!rt.infinite(t)&&e>t},rt.le=function(e,t){if(Xe(e)||Xe(t))throw new TypeError("NaN is not a valid value");return!rt.infinite(e)&&!rt.infinite(t)&&e<=t},rt.lt=function(e,t){if(Xe(e)||Xe(t))throw new TypeError("NaN is not a valid value");return!rt.infinite(e)&&!rt.infinite(t)&&e=t&&e<=n},rt.object=function(e){return"[object Object]"===Ze.call(e)},rt.primitive=function(e){return!e||!("object"==typeof e||rt.object(e)||rt.fn(e)||rt.array(e))},rt.hash=function(e){return rt.object(e)&&e.constructor===Object&&!e.nodeType&&!e.setInterval},rt.regexp=function(e){return"[object RegExp]"===Ze.call(e)},rt.string=function(e){return"[object String]"===Ze.call(e)},rt.base64=function(e){return rt.string(e)&&(!e.length||tt.test(e))},rt.hex=function(e){return rt.string(e)&&(!e.length||nt.test(e))},rt.symbol=function(e){return"function"==typeof Symbol&&"[object Symbol]"===Ze.call(e)&&"symbol"==typeof Ve.call(e)},rt.bigint=function(e){return"function"==typeof BigInt&&"[object BigInt]"===Ze.call(e)&&"bigint"==typeof ze.call(e)};var it,ot=rt,st=Object.prototype.hasOwnProperty,at=function(e){for(var t=Array.prototype.slice.call(arguments,1),n=0;n-1&&s.push([a,n[a]])}},{key:"initAfterPage",value:function(){var e,t=this;e=function(){var e,n,r=t.isVideo?"chartbeat_video.js":"chartbeat.js";e=document.createElement("script"),n=document.getElementsByTagName("script")[0],e.type="text/javascript",e.async=!0,e.src="//static.chartbeat.com/js/"+r,n.parentNode.insertBefore(e,n)},St?Rt(e):Pt.push(e),this._isReady(this).then((function(e){l.debug("===replaying on chartbeat==="),e.replayEvents.forEach((function(t){e[t[0]](t[1])}))}))}},{key:"pause",value:function(e){return new Promise((function(t){setTimeout(t,e)}))}},{key:"_isReady",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){return t.isLoaded()?(t.failed=!1,l.debug("===chartbeat loaded successfully==="),e.analytics.emit("ready"),r(e)):n>=1e4?(t.failed=!0,l.debug("===chartbeat failed==="),r(e)):void t.pause(1e3).then((function(){return t._isReady(e,n+1e3).then(r)}))}))}}]),e}(),Dt=function(){function e(t,r){n(this,e),this.c2ID=t.c2ID,this.analytics=r,this.comScoreBeaconParam=t.comScoreBeaconParam?t.comScoreBeaconParam:{},this.isFirstPageCallMade=!1,this.failed=!1,this.comScoreParams={},this.replayEvents=[],this.name="COMSCORE"}return i(e,[{key:"init",value:function(){l.debug("===in init Comscore init===")}},{key:"identify",value:function(e){l.debug("in Comscore identify")}},{key:"track",value:function(e){l.debug("in Comscore track")}},{key:"page",value:function(e){if(l.debug("in Comscore page"),this.loadConfig(e),this.isFirstPageCallMade){if(this.failed)return void(this.replayEvents=[]);if(!this.isLoaded()&&!this.failed)return void this.replayEvents.push(["page",e]);e.message.properties;window.COMSCORE.beacon(this.comScoreParams)}else this.isFirstPageCallMade=!0,this.initAfterPage()}},{key:"loadConfig",value:function(e){l.debug("=====in loadConfig====="),this.comScoreParams=this.mapComscoreParams(e.message.properties),window._comscore=window._comscore||[],window._comscore.push(this.comScoreParams)}},{key:"initAfterPage",value:function(){l.debug("=====in initAfterPage====="),function(){var e=document.createElement("script"),t=document.getElementsByTagName("script")[0];e.async=!0,e.src=("https:"==document.location.protocol?"https://sb":"http://b")+".scorecardresearch.com/beacon.js",t.parentNode.insertBefore(e,t)}(),this._isReady(this).then((function(e){e.replayEvents.forEach((function(t){e[t[0]](t[1])}))}))}},{key:"pause",value:function(e){return new Promise((function(t){setTimeout(t,e)}))}},{key:"_isReady",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){return t.isLoaded()?(t.failed=!1,e.analytics.emit("ready"),r(e)):n>=1e4?(t.failed=!0,r(e)):void t.pause(1e3).then((function(){return t._isReady(e,n+1e3).then(r)}))}))}},{key:"mapComscoreParams",value:function(e){l.debug("=====in mapComscoreParams=====");var t=this.comScoreBeaconParam,n={};return Object.keys(t).forEach((function(r){if(r in e){var i=t[r],o=e[r];n[i]=o}})),n.c1="2",n.c2=this.c2ID,l.debug("=====in mapComscoreParams=====",n),n}},{key:"isLoaded",value:function(){return l.debug("in Comscore isLoaded"),!this.isFirstPageCallMade||!!window.COMSCORE}},{key:"isReady",value:function(){return!!window.COMSCORE}}]),e}(),Lt=Object.prototype.hasOwnProperty,Mt=String.prototype.charAt,Ut=Object.prototype.toString,Nt=function(e,t){return Mt.call(e,t)},Bt=function(e,t){return Lt.call(e,t)},qt=function(e,t){t=t||Bt;for(var n=[],r=0,i=e.length;r=0&&ot.date(f))l[p]=f.toISOTring().split("T")[0];else if(a.hasOwnProperty(p))a[p]&&"string"==typeof f&&(l[p]=sha256(f));else{var h=r.indexOf(p)>=0,g=i.indexOf(p)>=0;h&&!g||(l[p]=f)}}return l}}]),e}(),$t="lt_synch_timestamp",Yt=new(function(){function e(){n(this,e),this.storage=je}return i(e,[{key:"setLotameSynchTime",value:function(e){this.storage.setItem($t,e)}},{key:"getLotameSynchTime",value:function(){return this.storage.getItem($t)}}]),e}()),Qt={HS:A,GA:De,HOTJAR:Le,GOOGLEADS:Me,VWO:Ue,GTM:Ne,BRAZE:Be,INTERCOM:We,KEEN:$e,KISSMETRICS:kt,CUSTOMERIO:_t,CHARTBEAT:jt,COMSCORE:Dt,FACEBOOK_PIXEL:Wt,LOTAME:function(){function e(t,r){var i=this;n(this,e),this.name="LOTAME",this.analytics=r,this.storage=Yt,this.bcpUrlSettings=t.bcpUrlSettings,this.dspUrlSettings=t.dspUrlSettings,this.mappings={},t.mappings.forEach((function(e){var t=e.key,n=e.value;i.mappings[t]=n}))}return i(e,[{key:"init",value:function(){l.debug("===in init Lotame==="),window.LOTAME_SYNCH_CALLBACK=function(){}}},{key:"addPixel",value:function(e,t,n){var r=document.createElement("img");r.src=e,r.setAttribute("width",t),r.setAttribute("height",n),document.getElementsByTagName("body")[0].appendChild(r)}},{key:"syncPixel",value:function(e){var t=this;l.debug("===== in syncPixel ======"),this.dspUrlSettings&&this.dspUrlSettings.length>0&&this.dspUrlSettings.forEach((function(n){var r=t.compileUrl(a({},t.mappings,{userId:e}),n.dspUrlTemplate);t.addPixel(r,"1","1")})),this.storage.setLotameSynchTime(Date.now()),this.analytics.methodToCallbackMapping.syncPixel&&this.analytics.emit("syncPixel",{destination:this.name})}},{key:"compileUrl",value:function(e,t){return Object.keys(e).forEach((function(n){if(e.hasOwnProperty(n)){var r=new RegExp("{{"+n+"}}","gi");t=t.replace(r,e[n])}})),t}},{key:"identify",value:function(e){l.debug("in Lotame identify");var t=e.message.userId;this.syncPixel(t)}},{key:"track",value:function(e){l.debug("track not supported for lotame")}},{key:"page",value:function(e){var t=this;l.debug("in Lotame page"),this.bcpUrlSettings&&this.bcpUrlSettings.length>0&&this.bcpUrlSettings.forEach((function(e){var n=t.compileUrl(a({},t.mappings),e.bcpUrlTemplate);t.addPixel(n,"1","1")})),e.message.userId&&this.isPixelToBeSynched()&&this.syncPixel(e.message.userId)}},{key:"isPixelToBeSynched",value:function(){var e=this.storage.getLotameSynchTime(),t=Date.now();return!e||Math.floor((t-e)/864e5)>=7}},{key:"isLoaded",value:function(){return l.debug("in Lotame isLoaded"),!0}},{key:"isReady",value:function(){return!0}}]),e}()},Zt=function e(){n(this,e),this.build="1.0.0",this.name="RudderLabs JavaScript SDK",this.namespace="com.rudderlabs.javascript",this.version="1.1.1"},Xt=function e(){n(this,e),this.name="RudderLabs JavaScript SDK",this.version="1.1.1"},en=function e(){n(this,e),this.name="",this.version=""},tn=function e(){n(this,e),this.density=0,this.width=0,this.height=0},nn=function e(){n(this,e),this.app=new Zt,this.traits=null,this.library=new Xt;var t=new en;t.version="";var r=new tn;r.width=window.width,r.height=window.height,r.density=window.devicePixelRatio,this.userAgent=navigator.userAgent,this.locale=navigator.language||navigator.browserLanguage,this.os=t,this.screen=r,this.device=null,this.network=null},rn=function(){function e(){n(this,e),this.channel="web",this.context=new nn,this.type=null,this.action=null,this.messageId=f().toString(),this.originalTimestamp=(new Date).toISOString(),this.anonymousId=null,this.userId=null,this.event=null,this.properties={},this.integrations={},this.integrations.All=!0}return i(e,[{key:"getProperty",value:function(e){return this.properties[e]}},{key:"addProperty",value:function(e,t){this.properties[e]=t}},{key:"validateFor",value:function(e){if(!this.properties)throw new Error("Key properties is required");switch(e){case k.TRACK:if(!this.event)throw new Error("Key event is required for track event");if(this.event in Object.values(_))switch(this.event){case _.CHECKOUT_STEP_VIEWED:case _.CHECKOUT_STEP_COMPLETED:case _.PAYMENT_INFO_ENTERED:this.checkForKey("checkout_id"),this.checkForKey("step");break;case _.PROMOTION_VIEWED:case _.PROMOTION_CLICKED:this.checkForKey("promotion_id");break;case _.ORDER_REFUNDED:this.checkForKey("order_id")}else this.properties.category||(this.properties.category=this.event);break;case k.PAGE:break;case k.SCREEN:if(!this.properties.name)throw new Error("Key 'name' is required in properties")}}},{key:"checkForKey",value:function(e){if(!this.properties[e])throw new Error("Key '"+e+"' is required in properties")}}]),e}(),on=function(){function e(){n(this,e),this.message=new rn}return i(e,[{key:"setType",value:function(e){this.message.type=e}},{key:"setProperty",value:function(e){this.message.properties=e}},{key:"setUserProperty",value:function(e){this.message.user_properties=e}},{key:"setUserId",value:function(e){this.message.userId=e}},{key:"setEventName",value:function(e){this.message.event=e}},{key:"updateTraits",value:function(e){this.message.context.traits=e}},{key:"getElementContent",value:function(){return this.message}}]),e}(),sn=function(){function e(){n(this,e),this.rudderProperty=null,this.rudderUserProperty=null,this.event=null,this.userId=null,this.channel=null,this.type=null}return i(e,[{key:"setProperty",value:function(e){return this.rudderProperty=e,this}},{key:"setPropertyBuilder",value:function(e){return this.rudderProperty=e.build(),this}},{key:"setUserProperty",value:function(e){return this.rudderUserProperty=e,this}},{key:"setUserPropertyBuilder",value:function(e){return this.rudderUserProperty=e.build(),this}},{key:"setEvent",value:function(e){return this.event=e,this}},{key:"setUserId",value:function(e){return this.userId=e,this}},{key:"setChannel",value:function(e){return this.channel=e,this}},{key:"setType",value:function(e){return this.type=e,this}},{key:"build",value:function(){var e=new on;return e.setUserId(this.userId),e.setType(this.type),e.setEventName(this.event),e.setProperty(this.rudderProperty),e.setUserProperty(this.rudderUserProperty),e}}]),e}(),an=function e(){n(this,e),this.batch=null,this.writeKey=null},un=S((function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}})),cn=[],ln=0;ln<256;++ln)cn[ln]=(ln+256).toString(16).substr(1);var dn,pn,fn=function(e,t){var n=t||0,r=cn;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")},hn=0,gn=0;var yn=function(e,t,n){var r=t&&n||0,i=t||[],o=(e=e||{}).node||dn,s=void 0!==e.clockseq?e.clockseq:pn;if(null==o||null==s){var a=un();null==o&&(o=dn=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=pn=16383&(a[6]<<8|a[7]))}var u=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:gn+1,l=u-hn+(c-gn)/1e4;if(l<0&&void 0===e.clockseq&&(s=s+1&16383),(l<0||u>hn)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");hn=u,gn=c,pn=s;var d=(1e4*(268435455&(u+=122192928e5))+c)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=255&d;var p=u/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=255&p,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=s>>>8|128,i[r++]=255&s;for(var f=0;f<6;++f)i[r+f]=o[f];return t||fn(i)};var mn=function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||un)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||fn(i)},vn=mn;vn.v1=yn,vn.v4=mn;var bn=vn,wn=bn.v4,kn={_data:{},length:0,setItem:function(e,t){return this._data[e]=t,this.length=Ft(this._data).length,t},getItem:function(e){return e in this._data?this._data[e]:null},removeItem:function(e){return e in this._data&&delete this._data[e],this.length=Ft(this._data).length,null},clear:function(){this._data={},this.length=0},key:function(e){return Ft(this._data)[e]}};var _n={defaultEngine:function(){try{if(!window.localStorage)return!1;var e=wn();window.localStorage.setItem(e,"test_value");var t=window.localStorage.getItem(e);return window.localStorage.removeItem(e),"test_value"===t}catch(e){return!1}}()?window.localStorage:kn,inMemoryEngine:kn},In=_n.defaultEngine,En=_n.inMemoryEngine;function An(e,t,n,r){this.id=t,this.name=e,this.keys=n||{},this.engine=r||In}An.prototype.set=function(e,t){var n=this._createValidKey(e);if(n)try{this.engine.setItem(n,se.stringify(t))}catch(n){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(n)&&(this._swapEngine(),this.set(e,t))}},An.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:se.parse(t)}catch(e){return null}},An.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},An.prototype._createValidKey=function(e){var t,n=this.name,r=this.id;return Ft(this.keys).length?(Jt((function(i){i===e&&(t=[n,r,e].join("."))}),this.keys),t):[n,r,e].join(".")},An.prototype._swapEngine=function(){var e=this;Jt((function(t){var n=e.get(t);En.setItem([e.name,e.id,t].join("."),n),e.remove(t)}),this.keys),this.engine=En};var Tn=An;var Cn={setTimeout:function(e,t){return window.setTimeout(e,t)},clearTimeout:function(e){return window.clearTimeout(e)},Date:window.Date},On=Cn;function Sn(){this.tasks={},this.nextId=1}Sn.prototype.now=function(){return+new On.Date},Sn.prototype.run=function(e,t){var n=this.nextId++;return this.tasks[n]=On.setTimeout(this._handle(n,e),t),n},Sn.prototype.cancel=function(e){this.tasks[e]&&(On.clearTimeout(this.tasks[e]),delete this.tasks[e])},Sn.prototype.cancelAll=function(){Jt(On.clearTimeout,this.tasks),this.tasks={}},Sn.prototype._handle=function(e,t){var n=this;return function(){return delete n.tasks[e],t()}},Sn.setClock=function(e){On=e},Sn.resetClock=function(){On=Cn};var Pn=Sn,xn=Rn;function Rn(e){return Rn.enabled(e)?function(t){t=jn(t);var n=new Date,r=n-(Rn[e]||n);Rn[e]=n,t=e+" "+t+" +"+Rn.humanize(r),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function jn(e){return e instanceof Error?e.stack||e.message:e}Rn.names=[],Rn.skips=[],Rn.enable=function(e){try{localStorage.debug=e}catch(e){}for(var t=(e||"").split(/[\s,]+/),n=t.length,r=0;r=36e5?(e/36e5).toFixed(1)+"h":e>=6e4?(e/6e4).toFixed(1)+"m":e>=1e3?(e/1e3|0)+"s":e+"ms"},Rn.enabled=function(e){for(var t=0,n=Rn.skips.length;tthis.maxAttempts)},Nn.prototype.getDelay=function(e){var t=this.backoff.MIN_RETRY_DELAY*Math.pow(this.backoff.FACTOR,e);if(this.backoff.JITTER){var n=Math.random(),r=Math.floor(n*this.backoff.JITTER*t);Math.floor(10*n)<5?t-=r:t+=r}return Number(Math.min(t,this.backoff.MAX_RETRY_DELAY).toPrecision(1))},Nn.prototype.addItem=function(e){this._enqueue({item:e,attemptNumber:0,time:this._schedule.now()})},Nn.prototype.requeue=function(e,t,n){this.shouldRetry(e,t,n)?this._enqueue({item:e,attemptNumber:t,time:this._schedule.now()+this.getDelay(t)}):this.emit("discard",e,t)},Nn.prototype._enqueue=function(e){var t=this._store.get(this.keys.QUEUE)||[];(t=t.slice(-(this.maxItems-1))).push(e),t=t.sort((function(e,t){return e.time-t.time})),this._store.set(this.keys.QUEUE,t),this._running&&this._processHead()},Nn.prototype._processHead=function(){var e=this,t=this._store;this._schedule.cancel(this._processId);var n=t.get(this.keys.QUEUE)||[],r=t.get(this.keys.IN_PROGRESS)||{},i=this._schedule.now(),o=[];function s(n,r){o.push({item:n.item,done:function(i,o){var s=t.get(e.keys.IN_PROGRESS)||{};delete s[r],t.set(e.keys.IN_PROGRESS,s),e.emit("processed",i,o,n.item),i&&e.requeue(n.item,n.attemptNumber+1,i)}})}for(var a=Object.keys(r).length;n.length&&n[0].time<=i&&a++0&&(this._processId=this._schedule.run(this._processHead,n[0].time-i))},Nn.prototype._ack=function(){this._store.set(this.keys.ACK,this._schedule.now()),this._store.set(this.keys.RECLAIM_START,null),this._store.set(this.keys.RECLAIM_END,null),this._schedule.run(this._ack,this.timeouts.ACK_TIMER)},Nn.prototype._checkReclaim=function(){var e=this;Jt((function(t){t.id!==e.id&&(e._schedule.now()-t.get(e.keys.ACK)=500&&o.status<600?(g(new Error("request failed with status: "+o.status+o.statusText+" for url: "+e)),i(new Error("request failed with status: "+o.status+o.statusText+" for url: "+e))):(l.debug("====== request processed successfully: "+o.status),i(null,o.status)))},o.send(JSON.stringify(n,p))}catch(e){i(e)}}},{key:"enqueue",value:function(e,t){var n={"Content-Type":"application/json",Authorization:"Basic "+btoa(this.writeKey+":")},r=e.getElementContent();r.originalTimestamp=h(),r.sentAt=h(),JSON.stringify(r).length>32e3&&l.error("[EventRepository] enqueue:: message length greater 32 Kb ",r);var i="/"==this.url.slice(-1)?this.url.slice(0,-1):this.url;this.payloadQueue.addItem({url:i+"/v1/"+t,headers:n,message:r})}}]),e}());function Kn(e){var t=function(t){var n=(t=t||window.event).target||t.srcElement;Jn(n)&&(n=n.parentNode),Hn(n,t)?l.debug("to be tracked ",t.type):l.debug("not to be tracked ",t.type),function(e,t){var n=e.target||e.srcElement,r=void 0;Jn(n)&&(n=n.parentNode);if(Hn(n,e)){if("form"==n.tagName.toLowerCase()){r={};for(var i=0;i-1)return!0}return!1}function Yn(e){return!(Wn(e).split(" ").indexOf("rudder-no-track")>=0)}function Qn(e){if(e.previousElementSibling)return e.previousElementSibling;do{e=e.previousSibling}while(e&&!zn(e));return e}var Zn=function(e,t,n){var r=!1;return n=n||Xn,i.count=e,0===e?t():i;function i(e,o){if(i.count<=0)throw new Error("after called too many times");--i.count,e?(r=!0,t(e),t=n):0!==i.count||r||t(null,o)}};function Xn(){}function er(e,t){this.eventRepository||(this.eventRepository=Fn),this.eventRepository.enqueue(e,t)}var tr=function(){function e(){n(this,e),this.autoTrackHandlersRegistered=!1,this.autoTrackFeatureEnabled=!1,this.initialized=!1,this.trackValues=[],this.eventsBuffer=[],this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=je,this.userId=null!=this.storage.getUserId()?this.storage.getUserId():"",this.userTraits=null!=this.storage.getUserTraits()?this.storage.getUserTraits():{},this.groupId=null!=this.storage.getGroupId()?this.storage.getGroupId():"",this.groupTraits=null!=this.storage.getGroupTraits()?this.storage.getGroupTraits():{},this.anonymousId=this.getAnonymousId(),this.storage.setUserId(this.userId),this.eventRepository=Fn,this.readyCallback=function(){},this.executeReadyCallback=void 0,this.methodToCallbackMapping={syncPixel:"syncPixelCallback"}}return i(e,[{key:"processResponse",value:function(e,t){try{l.debug("===in process response=== "+e),(t=JSON.parse(t)).source.useAutoTracking&&!this.autoTrackHandlersRegistered&&(this.autoTrackFeatureEnabled=!0,Kn(this),this.autoTrackHandlersRegistered=!0),t.source.destinations.forEach((function(e,t){l.debug("Destination "+t+" Enabled? "+e.enabled+" Type: "+e.destinationDefinition.name+" Use Native SDK? "+e.config.useNativeSDK),e.enabled&&this.clientIntegrations.push({name:e.destinationDefinition.name,config:e.config})}),this),this.clientIntegrations=w(this.loadOnlyIntegrations,this.clientIntegrations),this.init(this.clientIntegrations)}catch(e){g(e),l.debug("===handling config BE response processing error==="),l.debug("autoTrackHandlersRegistered",this.autoTrackHandlersRegistered),this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&(Kn(this),this.autoTrackHandlersRegistered=!0)}}},{key:"init",value:function(e){var t=this,n=this;if(l.debug("supported intgs ",Qt),!e||0==e.length)return this.readyCallback&&this.readyCallback(),void(this.toBeProcessedByIntegrationArray=[]);e.forEach((function(e){var r=new(0,Qt[e.name])(e.config,n);r.init(),l.debug("initializing destination: ",e),t.isInitialized(r).then(t.replayEvents)}))}},{key:"replayEvents",value:function(e){e.successfullyLoadedIntegration.length+e.failedToBeLoadedIntegration.length==e.clientIntegrations.length&&e.toBeProcessedByIntegrationArray.length>0&&(l.debug("===replay events called====",e.successfullyLoadedIntegration.length,e.failedToBeLoadedIntegration.length),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration,l.debug("==registering after callback===",e.clientIntegrationObjects.length),e.executeReadyCallback=Zn(e.clientIntegrationObjects.length,e.readyCallback),l.debug("==registering ready callback==="),e.on("ready",e.executeReadyCallback),e.clientIntegrationObjects.forEach((function(t){l.debug("===looping over each successful integration===="),t.isReady&&!t.isReady()||(l.debug("===letting know I am ready=====",t.name),e.emit("ready"))})),e.toBeProcessedByIntegrationArray.forEach((function(t){var n=t[0];t.shift();for(var r=w(t[0].message.integrations,e.clientIntegrationObjects),i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){return e.isLoaded()?(l.debug("===integration loaded successfully====",e.name),t.successfullyLoadedIntegration.push(e),r(t)):n>=1e4?(l.debug("====max wait over===="),t.failedToBeLoadedIntegration.push(e),r(t)):void t.pause(1e3).then((function(){return l.debug("====after pause, again checking===="),t.isInitialized(e,n+1e3).then(r)}))}))}},{key:"page",value:function(e,n,r,i,o){"function"==typeof i&&(o=i,i=null),"function"==typeof r&&(o=r,i=r=null),"function"==typeof n&&(o=n,i=r=n=null),"object"===t(e)&&(i=n,r=e,n=e=null),"object"===t(n)&&(i=r,r=n,n=null),"string"==typeof e&&"string"!=typeof n&&(n=e,e=null),this.processPage(e,n,r,i,o)}},{key:"track",value:function(e,t,n,r){"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),this.processTrack(e,t,n,r)}},{key:"identify",value:function(e,n,r,i){"function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=null,n=null),"object"==t(e)&&(r=n,n=e,e=this.userId),this.processIdentify(e,n,r,i)}},{key:"alias",value:function(e,n,r,i){"function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=null,n=null),"object"==t(n)&&(r=n,n=null);var o=(new sn).setType("alias").build();o.message.previousId=n||this.userId?this.userId:this.getAnonymousId(),o.message.userId=e,this.processAndSendDataToDestinations("alias",o,r,i)}},{key:"group",value:function(e,n,r,i){if(arguments.length){"function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=null,n=null),"object"==t(e)&&(r=n,n=e,e=this.groupId),this.groupId=e,this.storage.setGroupId(this.groupId);var o=(new sn).setType("group").build();if(n)for(var s in n)this.groupTraits[s]=n[s];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",o,r,i)}}},{key:"processPage",value:function(e,t,n,r,i){var o=(new sn).setType("page").build();t&&(o.message.name=t),n||(n={}),e&&(n.category=e),n&&(o.message.properties=this.getPageProperties(n)),this.trackPage(o,r,i)}},{key:"processTrack",value:function(e,t,n,r){var i=(new sn).setType("track").build();e&&i.setEventName(e),t?i.setProperty(t):i.setProperty({}),this.trackEvent(i,n,r)}},{key:"processIdentify",value:function(e,t,n,r){e&&this.userId&&e!==this.userId&&this.reset(),this.userId=e,this.storage.setUserId(this.userId);var i=(new sn).setType("identify").build();if(t){for(var o in t)this.userTraits[o]=t[o];this.storage.setUserTraits(this.userTraits)}this.identifyUser(i,n,r)}},{key:"identifyUser",value:function(e,t,n){e.message.userId&&(this.userId=e.message.userId,this.storage.setUserId(this.userId)),e&&e.message&&e.message.context&&e.message.context.traits&&(this.userTraits=Object.assign({},e.message.context.traits),this.storage.setUserTraits(this.userTraits)),this.processAndSendDataToDestinations("identify",e,t,n)}},{key:"trackPage",value:function(e,t,n){this.processAndSendDataToDestinations("page",e,t,n)}},{key:"trackEvent",value:function(e,t,n){this.processAndSendDataToDestinations("track",e,t,n)}},{key:"processAndSendDataToDestinations",value:function(e,t,n,r){try{this.anonymousId||this.setAnonymousId(),t.message.context.page=y(),t.message.context.traits=Object.assign({},this.userTraits),l.debug("anonymousId: ",this.anonymousId),t.message.anonymousId=this.anonymousId,t.message.userId=t.message.userId?t.message.userId:this.userId,"group"==e&&(this.groupId&&(t.message.groupId=this.groupId),this.groupTraits&&(t.message.traits=Object.assign({},this.groupTraits))),n&&this.processOptionsParam(t,n),l.debug(JSON.stringify(t)),Object.keys(t.message.integrations).length>0&&b(t.message.integrations),w(t.message.integrations,this.clientIntegrationObjects).forEach((function(n){n.isFailed&&n.isFailed()||n[e](t)})),this.clientIntegrationObjects||(l.debug("pushing in replay queue"),this.toBeProcessedByIntegrationArray.push([e,t])),er.call(this,t,e),l.debug(e+" is called "),r&&r()}catch(e){g(e)}}},{key:"processOptionsParam",value:function(e,t){var n=["integrations","anonymousId","originalTimestamp"];for(var r in t)if(n.includes(r))e.message[r]=t[r];else if("context"!==r)e.message.context[r]=t[r];else for(var i in t[r])e.message.context[i]=t[r][i]}},{key:"getPageProperties",value:function(e){var t=y();for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e}},{key:"reset",value:function(){this.userId="",this.userTraits={},this.anonymousId=this.setAnonymousId(),this.storage.clear()}},{key:"getAnonymousId",value:function(){return this.anonymousId=this.storage.getAnonymousId(),this.anonymousId||this.setAnonymousId(),this.anonymousId}},{key:"setAnonymousId",value:function(e){this.anonymousId=e||f(),this.storage.setAnonymousId(this.anonymousId)}},{key:"load",value:function(e,t,n){var r="https://api.rudderlabs.com/sourceConfig";if(!e||!t||0==t.length)throw g({message:"[Analytics] load:: Unable to load due to wrong writeKey or serverUrl"}),Error("failed to initialize");n&&n.logLevel&&l.setLogLevel(n.logLevel),n&&n.integrations&&(Object.assign(this.loadOnlyIntegrations,n.integrations),b(this.loadOnlyIntegrations)),n&&n.configUrl&&(r=n.configUrl),l.debug("inside load "),this.eventRepository.writeKey=e,t&&(this.eventRepository.url=t),n&&n.valTrackingList&&n.valTrackingList.push==Array.prototype.push&&(this.trackValues=n.valTrackingList),n&&n.useAutoTracking&&(this.autoTrackFeatureEnabled=!0,this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&(Kn(this),this.autoTrackHandlersRegistered=!0,l.debug("autoTrackHandlersRegistered",this.autoTrackHandlersRegistered)));try{!function(e,t,n,r){var i,o=r.bind(e);(i=new XMLHttpRequest).open("GET",t,!0),i.setRequestHeader("Authorization","Basic "+btoa(n+":")),i.onload=function(){var e=i.status;200==e?(l.debug("status 200 calling callback"),o(200,i.responseText)):(g(new Error("request failed with status: "+i.status+" for url: "+t)),o(e))},i.send()}(this,r,e,this.processResponse)}catch(e){g(e),this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&Kn(nr)}}},{key:"ready",value:function(e){"function"!=typeof e?l.error("ready callback is not a function"):this.readyCallback=e}},{key:"registerCallbacks",value:function(){var e=this;Object.keys(this.methodToCallbackMapping).forEach((function(t){if(e.methodToCallbackMapping.hasOwnProperty(t)){var n=window.rudderanalytics&&"function"==typeof window.rudderanalytics[e.methodToCallbackMapping[t]]?window.rudderanalytics[e.methodToCallbackMapping[t]]:function(){};l.debug("registerCallbacks",t,n),e.on(t,n)}}))}}]),e}();window.addEventListener("error",(function(e){g(e)}),!0);var nr=new tr;Dn(nr),nr.registerCallbacks();var rr=!!window.rudderanalytics&&window.rudderanalytics.push==Array.prototype.push,ir=window.rudderanalytics?window.rudderanalytics[0]:[];if(ir.length>0&&"load"==ir[0]){var or=ir[0];ir.shift(),l.debug("=====from init, calling method:: ",or),nr[or].apply(nr,u(ir))}if(rr){for(var sr=1;sr-1?t:t+e:window.location.href,r=n.indexOf("#");return r>-1?n.slice(0,r):n}(r)}}function v(){for(var e,t=document.getElementsByTagName("link"),n=0;e=t[n];n++)if("canonical"===e.getAttribute("rel"))return e.getAttribute("href")}function b(e,t){var n=e.revenue;return!n&&t&&t.match(/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i)&&(n=e.total),function(e){if(e){if("number"==typeof e)return e;if("string"==typeof e)return e=e.replace(/\$/g,""),e=parseFloat(e),isNaN(e)?void 0:e}}(n)}function w(e){Object.keys(e).forEach((function(t){e.hasOwnProperty(t)&&(d[t]&&(e[d[t]]=e[t]),"All"!=t&&null!=d[t]&&d[t]!=t&&delete e[t])}))}function k(e,n){var r=[];if(!n||0==n.length)return r;var i=!0;return"string"==typeof n[0]?(null!=e.All&&(i=e.All),n.forEach((function(t){if(i){var n=!0;null!=e[t]&&0==e[t]&&(n=!1),n&&r.push(t)}else e[t]&&e[t]&&r.push(t)})),r):"object"==t(n[0])?(null!=e.All&&(i=e.All),n.forEach((function(t){if(i){var n=!0;null!=e[t.name]&&0==e[t.name]&&(n=!1),n&&r.push(t)}else e[t.name]&&e[t.name]&&r.push(t)})),r):void 0}var _={TRACK:"track",PAGE:"page",IDENTIFY:"identify"},I={PRODUCTS_SEARCHED:"Products Searched",PRODUCT_LIST_VIEWED:"Product List Viewed",PRODUCT_LIST_FILTERED:"Product List Filtered",PROMOTION_VIEWED:"Promotion Viewed",PROMOTION_CLICKED:"Promotion Clicked",PRODUCT_CLICKED:"Product Clicked",PRODUCT_VIEWED:"Product Viewed",PRODUCT_ADDED:"Product Added",PRODUCT_REMOVED:"Product Removed",CART_VIEWED:"Cart Viewed",CHECKOUT_STARTED:"Checkout Started",CHECKOUT_STEP_VIEWED:"Checkout Step Viewed",CHECKOUT_STEP_COMPLETED:"Checkout Step Completed",PAYMENT_INFO_ENTERED:"Payment Info Entered",ORDER_UPDATED:"Order Updated",ORDER_COMPLETED:"Order Completed",ORDER_REFUNDED:"Order Refunded",ORDER_CANCELLED:"Order Cancelled",COUPON_ENTERED:"Coupon Entered",COUPON_APPLIED:"Coupon Applied",COUPON_DENIED:"Coupon Denied",COUPON_REMOVED:"Coupon Removed",PRODUCT_ADDED_TO_WISHLIST:"Product Added to Wishlist",PRODUCT_REMOVED_FROM_WISHLIST:"Product Removed from Wishlist",WISH_LIST_PRODUCT_ADDED_TO_CART:"Wishlist Product Added to Cart",PRODUCT_SHARED:"Product Shared",CART_SHARED:"Cart Shared",PRODUCT_REVIEWED:"Product Reviewed"},E="https://hosted-dataplane.rudderstack.com";function A(e,t){l.debug("in script loader=== "+e);var n=document.createElement("script");n.src=t,n.type="text/javascript",n.id=e;var r=document.getElementsByTagName("script")[0];l.debug("==script==",r),r.parentNode.insertBefore(n,r)}var C=function(){function e(t){n(this,e),this.hubId=t.hubID,this.name="HS"}return i(e,[{key:"init",value:function(){A("hubspot-integration","http://js.hs-scripts.com/"+this.hubId+".js"),l.debug("===in init HS===")}},{key:"identify",value:function(e){l.debug("in HubspotAnalyticsManager identify");var n=e.message.context.traits,r={};for(var i in n)if(Object.getOwnPropertyDescriptor(n,i)&&n[i]){var o=i;"[object Date]"==toString.call(n[i])?r[o]=n[i].getTime():r[o]=n[i]}var s=e.message.context.user_properties;for(var a in s){if(Object.getOwnPropertyDescriptor(s,a)&&s[a])r[a]=s[a]}(l.debug(r),void 0!==("undefined"==typeof window?"undefined":t(window)))&&(window._hsq=window._hsq||[]).push(["identify",r])}},{key:"track",value:function(e){l.debug("in HubspotAnalyticsManager track");var t=window._hsq=window._hsq||[],n={};n.id=e.message.event,e.message.properties&&(e.message.properties.revenue||e.message.properties.value)&&(n.value=e.message.properties.revenue||e.message.properties.value),t.push(["trackEvent",n])}},{key:"page",value:function(e){l.debug("in HubspotAnalyticsManager page");var t=window._hsq=window._hsq||[];e.message.properties&&e.message.properties.path&&t.push(["setPath",e.message.properties.path]),t.push(["trackPageView"])}},{key:"isLoaded",value:function(){return l.debug("in hubspot isLoaded"),!(!window._hsq||window._hsq.push===Array.prototype.push)}},{key:"isReady",value:function(){return!(!window._hsq||window._hsq.push===Array.prototype.push)}}]),e}(),T=Object.prototype.toString;var O=function e(t){var n=function(e){switch(T.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":null!=(t=e)&&(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))?"buffer":typeof(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e));var t}(t);if("object"===n){var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=e(t[i]));return r}if("array"===n){r=new Array(t.length);for(var o=0,s=t.length;o1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*L;case"days":case"day":case"d":return n*D;case"hours":case"hour":case"hrs":case"hr":case"h":return n*j;case"minutes":case"minute":case"mins":case"min":case"m":return n*R;case"seconds":case"second":case"secs":case"sec":case"s":return n*x;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}(e):t.long?function(e){return U(e,D,"day")||U(e,j,"hour")||U(e,R,"minute")||U(e,x,"second")||e+" ms"}(e):function(e){return e>=D?Math.round(e/D)+"d":e>=j?Math.round(e/j)+"h":e>=R?Math.round(e/R)+"m":e>=x?Math.round(e/x)+"s":e+"ms"}(e)};function U(e,t,n){if(!(e=31},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){return JSON.stringify(e)},t.enable(n())}))),q=(B.log,B.formatArgs,B.save,B.load,B.useColors,B.storage,B.colors,B("cookie")),F=function(e,t,n){switch(arguments.length){case 3:case 2:return G(e,t,n);case 1:return H(e);default:return K()}};function G(e,t,n){n=n||{};var r=V(e)+"="+V(t);null==t&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(r+="; path="+n.path),n.domain&&(r+="; domain="+n.domain),n.expires&&(r+="; expires="+n.expires.toUTCString()),n.samesite&&(r+="; samesite="+n.samesite),n.secure&&(r+="; secure"),document.cookie=r}function K(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},r=e.split(/ *; */);if(""==r[0])return n;for(var i=0;i1)))/4)-l((e-1901+t)/100)+l((e-1601+t)/400)};t=function(e){for(i=l(e/864e5),n=l(i/365.2425)+1970-1;f(n+1,0)<=i;n++);for(r=l((i-f(n,0))/30.42);f(n,r+1)<=i;r++);i=1+i-f(n,r),s=l((o=(e%864e5+864e5)%864e5)/36e5)%24,a=l(o/6e4)%60,u=l(o/1e3)%60,c=o%1e3}}return(E=function(e){return e>-1/0&&e<1/0?(t(e),e=(n<=0||n>=1e4?(n<0?"-":"+")+I(6,n<0?-n:n):I(4,n))+"-"+I(2,r+1)+"-"+I(2,i)+"T"+I(2,s)+":"+I(2,a)+":"+I(2,u)+"."+I(3,c)+"Z",n=r=i=s=a=u=c=null):e=null,e})(e)};if(b("json-stringify")&&!b("date-serialization")){function A(e){return E(this)}var C=t.stringify;t.stringify=function(e,t,n){var r=u.prototype.toJSON;u.prototype.toJSON=A;var i=C(e,t,n);return u.prototype.toJSON=r,i}}else{var T=function(e){var t=e.charCodeAt(0),n=_[t];return n||"\\u00"+I(2,t.toString(16))},O=/[\x00-\x1f\x22\x5c]/g,S=function(e){return O.lastIndex=0,'"'+(O.test(e)?e.replace(O,T):e)+'"'},P=function(e,t,n,r,i,o,s){var a,c,d,p,h,y,v,b,w;if(m((function(){a=t[e]})),"object"==typeof a&&a&&(a.getUTCFullYear&&"[object Date]"==g.call(a)&&a.toJSON===u.prototype.toJSON?a=E(a):"function"==typeof a.toJSON&&(a=a.toJSON(e))),n&&(a=n.call(t,e,a)),a==f)return a===f?a:"null";switch("object"==(c=typeof a)&&(d=g.call(a)),d||c){case"boolean":case"[object Boolean]":return""+a;case"number":case"[object Number]":return a>-1/0&&a<1/0?""+a:"null";case"string":case"[object String]":return S(""+a)}if("object"==typeof a){for(v=s.length;v--;)if(s[v]===a)throw l();if(s.push(a),p=[],b=o,o+=i,"[object Array]"==d){for(y=0,v=a.length;y0)for(r>10&&(r=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||L();e+=j("0x"+o.slice(t,x));break;default:L()}else{if(34==i)break;for(i=o.charCodeAt(x),t=x;i>=32&&92!=i&&34!=i;)i=o.charCodeAt(++x);e+=o.slice(t,x)}if(34==o.charCodeAt(x))return x++,e;L();default:if(t=x,45==i&&(r=!0,i=o.charCodeAt(++x)),i>=48&&i<=57){for(48==i&&((i=o.charCodeAt(x+1))>=48&&i<=57)&&L(),r=!1;x=48&&i<=57);x++);if(46==o.charCodeAt(x)){for(n=++x;n57);n++);n==x&&L(),x=n}if(101==(i=o.charCodeAt(x))||69==i){for(43!=(i=o.charCodeAt(++x))&&45!=i||x++,n=x;n57);n++);n==x&&L(),x=n}return+o.slice(t,x)}r&&L();var a=o.slice(x,x+4);if("true"==a)return x+=4,!0;if("fals"==a&&101==o.charCodeAt(x+4))return x+=5,!1;if("null"==a)return x+=4,null;L()}return"$"},U=function(e){var t,n;if("$"==e&&L(),"string"==typeof e){if("@"==(w?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=M());)n?","==e?"]"==(e=M())&&L():L():n=!0,","==e&&L(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=M());)n?","==e?"}"==(e=M())&&L():L():n=!0,","!=e&&"string"==typeof e&&"@"==(w?e.charAt(0):e[0])&&":"==M()||L(),t[e.slice(1)]=U(M());return t}L()}return e},N=function(e,t,n){var r=B(e,t,n);r===f?delete e[t]:e[t]=r},B=function(e,t,n){var r,i=e[t];if("object"==typeof i&&i)if("[object Array]"==g.call(i))for(r=i.length;r--;)N(g,k,i);else k(i,(function(e){N(i,e,n)}));return n.call(e,t,i)};t.parse=function(e,t){var n,r;return x=0,R=""+e,n=U(M()),"$"!=M()&&L(),x=R=null,t&&"[object Function]"==g.call(t)?B(((r={})[""]=n,r),"",t):n}}}return t.runInContext=s,t}if(!o||o.global!==o&&o.window!==o&&o.self!==o||(i=o),r)s(i,r);else{var a=i.JSON,u=i.JSON3,c=!1,l=s(i,i.JSON3={noConflict:function(){return c||(c=!0,i.JSON=a,i.JSON3=u,a=u=null),l}});i.JSON={parse:l.parse,stringify:l.stringify}}}).call(S)})),ue=P((function(e,t){function n(e){switch(e){case"http:":return 80;case"https:":return 443;default:return location.port}}t.parse=function(e){var t=document.createElement("a");return t.href=e,{href:t.href,host:t.host||location.host,port:"0"===t.port||""===t.port?n(t.protocol):t.port,hash:t.hash,hostname:t.hostname||location.hostname,pathname:"/"!=t.pathname.charAt(0)?"/"+t.pathname:t.pathname,protocol:t.protocol&&":"!=t.protocol?t.protocol:location.protocol,search:t.search,query:t.search.slice(1)}},t.isAbsolute=function(e){return 0==e.indexOf("//")||!!~e.indexOf("://")},t.isRelative=function(e){return!t.isAbsolute(e)},t.isCrossDomain=function(e){e=t.parse(e);var n=t.parse(window.location.href);return e.hostname!==n.hostname||e.port!==n.port||e.protocol!==n.protocol}})),ce=(ue.parse,ue.isAbsolute,ue.isRelative,ue.isCrossDomain,1e3),le=60*ce,de=60*le,pe=24*de,fe=365.25*pe,he=function(e,t){return t=t||{},"string"==typeof e?function(e){if((e=""+e).length>1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*fe;case"days":case"day":case"d":return n*pe;case"hours":case"hour":case"hrs":case"hr":case"h":return n*de;case"minutes":case"minute":case"mins":case"min":case"m":return n*le;case"seconds":case"second":case"secs":case"sec":case"s":return n*ce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}(e):t.long?function(e){return ge(e,pe,"day")||ge(e,de,"hour")||ge(e,le,"minute")||ge(e,ce,"second")||e+" ms"}(e):function(e){return e>=pe?Math.round(e/pe)+"d":e>=de?Math.round(e/de)+"h":e>=le?Math.round(e/le)+"m":e>=ce?Math.round(e/ce)+"s":e+"ms"}(e)};function ge(e,t,n){if(!(e=31},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){return JSON.stringify(e)},t.enable(n())}))),ve=(me.log,me.formatArgs,me.save,me.load,me.useColors,me.storage,me.colors,me("cookie")),be=function(e,t,n){switch(arguments.length){case 3:case 2:return we(e,t,n);case 1:return _e(e);default:return ke()}};function we(e,t,n){n=n||{};var r=Ie(e)+"="+Ie(t);null==t&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(r+="; path="+n.path),n.domain&&(r+="; domain="+n.domain),n.expires&&(r+="; expires="+n.expires.toUTCString()),n.secure&&(r+="; secure"),n.samesite&&(r+="; samesite="+n.samesite),document.cookie=r}function ke(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},r=e.split(/ *; */);if(""==r[0])return n;for(var i=0;i=0;--o)i.push(t.slice(o).join("."));return i},r.cookie=be,t=e.exports=r})),Ce=new(function(){function e(t){n(this,e),this._options={},this.options(t)}return i(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this._options;var t="."+Ae(window.location.href);"."===t&&(t=null),this._options=oe(e,{maxage:31536e6,path:"/",domain:t,samesite:"Lax"}),this.set("test_rudder",!0),this.get("test_rudder")||(this._options.domain=null),this.remove("test_rudder")}},{key:"set",value:function(e,t){try{return t=ae.stringify(t),F(e,t,O(this._options)),!0}catch(e){return!1}}},{key:"get",value:function(e){try{var t=F(e);return t=t?ae.parse(t):null}catch(e){return null}}},{key:"remove",value:function(e){try{return F(e,null,O(this._options)),!0}catch(e){return!1}}}]),e}())({}),Te=function(){var e,t={},n="undefined"!=typeof window?window:S,r=n.document,i="localStorage";if(t.disabled=!1,t.version="1.3.20",t.set=function(e,t){},t.get=function(e,t){},t.has=function(e){return void 0!==t.get(e)},t.remove=function(e){},t.clear=function(){},t.transact=function(e,n,r){null==r&&(r=n,n=null),null==n&&(n={});var i=t.get(e,n);r(i),t.set(e,i)},t.getAll=function(){var e={};return t.forEach((function(t,n){e[t]=n})),e},t.forEach=function(){},t.serialize=function(e){return ae.stringify(e)},t.deserialize=function(e){if("string"==typeof e)try{return ae.parse(e)}catch(t){return e||void 0}},function(){try{return i in n&&n[i]}catch(e){return!1}}())e=n[i],t.set=function(n,r){return void 0===r?t.remove(n):(e.setItem(n,t.serialize(r)),r)},t.get=function(n,r){var i=t.deserialize(e.getItem(n));return void 0===i?r:i},t.remove=function(t){e.removeItem(t)},t.clear=function(){e.clear()},t.forEach=function(n){for(var r=0;rdocument.w=window<\/script>'),s.close(),o=s.w.frames[0].document,e=o.createElement("div")}catch(t){e=r.createElement("div"),o=r.body}var a=function(n){return function(){var r=Array.prototype.slice.call(arguments,0);r.unshift(e),o.appendChild(e),e.addBehavior("#default#userData"),e.load(i);var s=n.apply(t,r);return o.removeChild(e),s}},u=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),c=function(e){return e.replace(/^d/,"___$&").replace(u,"___")};t.set=a((function(e,n,r){return n=c(n),void 0===r?t.remove(n):(e.setAttribute(n,t.serialize(r)),e.save(i),r)})),t.get=a((function(e,n,r){n=c(n);var i=t.deserialize(e.getAttribute(n));return void 0===i?r:i})),t.remove=a((function(e,t){t=c(t),e.removeAttribute(t),e.save(i)})),t.clear=a((function(e){var t=e.XMLDocument.documentElement.attributes;e.load(i);for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save(i)})),t.forEach=a((function(e,n){for(var r,i=e.XMLDocument.documentElement.attributes,o=0;r=i[o];++o)n(r.name,t.deserialize(e.getAttribute(r.name)))}))}try{var l="__storejs__";t.set(l,l),t.get(l)!=l&&(t.disabled=!0),t.remove(l)}catch(e){t.disabled=!0}return t.enabled=!t.disabled,t}(),Oe=new(function(){function e(t){n(this,e),this._options={},this.enabled=!1,this.options(t)}return i(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this._options;oe(e,{enabled:!0}),this.enabled=e.enabled&&Te.enabled,this._options=e}},{key:"set",value:function(e,t){return!!this.enabled&&Te.set(e,t)}},{key:"get",value:function(e){return this.enabled?Te.get(e):null}},{key:"remove",value:function(e){return!!this.enabled&&Te.remove(e)}}]),e}())({}),Se="rl_user_id",Pe="rl_trait",xe="rl_anonymous_id",Re="rl_group_id",je="rl_group_trait",De=new(function(){function e(){if(n(this,e),Ce.set("rudder_cookies",!0),Ce.get("rudder_cookies"))return Ce.remove("rudder_cookies"),void(this.storage=Ce);Oe.enabled&&(this.storage=Oe)}return i(e,[{key:"setItem",value:function(e,t){this.storage.set(e,t)}},{key:"setUserId",value:function(e){"string"==typeof e?this.storage.set(Se,e):l.error("[Storage] setUserId:: userId should be string")}},{key:"setUserTraits",value:function(e){this.storage.set(Pe,e)}},{key:"setGroupId",value:function(e){"string"==typeof e?this.storage.set(Re,e):l.error("[Storage] setGroupId:: groupId should be string")}},{key:"setGroupTraits",value:function(e){this.storage.set(je,e)}},{key:"setAnonymousId",value:function(e){"string"==typeof e?this.storage.set(xe,e):l.error("[Storage] setAnonymousId:: anonymousId should be string")}},{key:"getItem",value:function(e){return this.storage.get(e)}},{key:"getUserId",value:function(){return this.storage.get(Se)}},{key:"getUserTraits",value:function(){return this.storage.get(Pe)}},{key:"getGroupId",value:function(){return this.storage.get(Re)}},{key:"getGroupTraits",value:function(){return this.storage.get(je)}},{key:"getAnonymousId",value:function(){return this.storage.get(xe)}},{key:"removeItem",value:function(e){return this.storage.remove(e)}},{key:"clear",value:function(){this.storage.remove(Se),this.storage.remove(Pe),this.storage.remove(xe)}}]),e}()),Le=function(){function e(t){n(this,e),this.trackingID=t.trackingID,this.allowLinker=t.allowLinker||!1,this.name="GA"}return i(e,[{key:"init",value:function(){!function(e,t,n,r,i,o,s){e.GoogleAnalyticsObject=i,e.ga=e.ga||function(){(e.ga.q=e.ga.q||[]).push(arguments)},e.ga.l=1*new Date,o=t.createElement(n),s=t.getElementsByTagName(n)[0],o.async=1,o.src="https://www.google-analytics.com/analytics.js",s.parentNode.insertBefore(o,s)}(window,document,"script",0,"ga"),ga("create",this.trackingID,"auto","rudder_ga",{allowLinker:this.allowLinker});var e=De.getUserId();e&&""!==e&&ga("rudder_ga.set","userId",e),l.debug("===in init GA===")}},{key:"identify",value:function(e){var t=""!==e.message.userId?e.message.userId:e.message.anonymousId;ga("rudder_ga.set","userId",t),l.debug("in GoogleAnalyticsManager identify")}},{key:"track",value:function(e){var t=e.message.event,n=e.message.event,r=e.message.event,i="";e.message.properties&&(i=e.message.properties.value?e.message.properties.value:e.message.properties.revenue,t=e.message.properties.category?e.message.properties.category:t,r=e.message.properties.label?e.message.properties.label:r),ga("rudder_ga.send","event",{hitType:"event",eventCategory:t,eventAction:n,eventLabel:r,eventValue:i}),l.debug("in GoogleAnalyticsManager track")}},{key:"page",value:function(e){l.debug("in GoogleAnalyticsManager page");var t=e.message.properties&&e.message.properties.path?e.message.properties.path:void 0,n=e.message.properties&&e.message.properties.title?e.message.properties.title:void 0,r=e.message.properties&&e.message.properties.url?e.message.properties.url:void 0;t&&ga("rudder_ga.set","page",t),n&&ga("rudder_ga.set","title",n),r&&ga("rudder_ga.set","location",r),ga("rudder_ga.send","pageview")}},{key:"isLoaded",value:function(){return l.debug("in GA isLoaded"),!!window.gaplugins}},{key:"isReady",value:function(){return!!window.gaplugins}}]),e}(),Me=function(){function e(t){n(this,e),this.siteId=t.siteID,this.name="HOTJAR",this._ready=!1}return i(e,[{key:"init",value:function(){window.hotjarSiteId=this.siteId,function(e,t,n,r,i,o){e.hj=e.hj||function(){(e.hj.q=e.hj.q||[]).push(arguments)},e._hjSettings={hjid:e.hotjarSiteId,hjsv:6},i=t.getElementsByTagName("head")[0],(o=t.createElement("script")).async=1,o.src="https://static.hotjar.com/c/hotjar-"+e._hjSettings.hjid+".js?sv="+e._hjSettings.hjsv,i.appendChild(o)}(window,document),this._ready=!0,l.debug("===in init Hotjar===")}},{key:"identify",value:function(e){if(e.message.userId||e.message.anonymousId){var t=e.message.context.traits;window.hj("identify",e.message.userId,t)}else l.debug("[Hotjar] identify:: user id is required")}},{key:"track",value:function(e){l.debug("[Hotjar] track:: method not supported")}},{key:"page",value:function(e){l.debug("[Hotjar] page:: method not supported")}},{key:"isLoaded",value:function(){return this._ready}},{key:"isReady",value:function(){return this._ready}}]),e}(),Ue=function(){function e(t){n(this,e),this.conversionId=t.conversionID,this.pageLoadConversions=t.pageLoadConversions,this.clickEventConversions=t.clickEventConversions,this.name="GOOGLEADS"}return i(e,[{key:"init",value:function(){!function(e,t,n){l.debug("in script loader=== "+e);var r=n.createElement("script");r.src=t,r.async=1,r.type="text/javascript",r.id=e;var i=n.getElementsByTagName("head")[0];l.debug("==script==",i),i.appendChild(r)}("googleAds-integration","https://www.googletagmanager.com/gtag/js?id="+this.conversionId,document),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",this.conversionId),l.debug("===in init Google Ads===")}},{key:"identify",value:function(e){l.debug("[GoogleAds] identify:: method not supported")}},{key:"track",value:function(e){l.debug("in GoogleAdsAnalyticsManager track");var t=this.getConversionData(this.clickEventConversions,e.message.event);if(t.conversionLabel){var n=t.conversionLabel,r=t.eventName,i=this.conversionId+"/"+n,o={};e.properties&&(o.value=e.properties.revenue,o.currency=e.properties.currency,o.transaction_id=e.properties.order_id),o.send_to=i,window.gtag("event",r,o)}}},{key:"page",value:function(e){l.debug("in GoogleAdsAnalyticsManager page");var t=this.getConversionData(this.pageLoadConversions,e.message.name);if(t.conversionLabel){var n=t.conversionLabel,r=t.eventName;window.gtag("event",r,{send_to:this.conversionId+"/"+n})}}},{key:"getConversionData",value:function(e,t){var n={};return e&&e.forEach((function(e){if(e.name.toLowerCase()===t.toLowerCase())return n.conversionLabel=e.conversionLabel,void(n.eventName=e.name)})),n}},{key:"isLoaded",value:function(){return window.dataLayer.push!==Array.prototype.push}},{key:"isReady",value:function(){return window.dataLayer.push!==Array.prototype.push}}]),e}(),Ne=function(){function e(t){n(this,e),this.accountId=t.accountId,this.settingsTolerance=t.settingsTolerance,this.isSPA=t.isSPA,this.libraryTolerance=t.libraryTolerance,this.useExistingJquery=t.useExistingJquery,this.sendExperimentTrack=t.sendExperimentTrack,this.sendExperimentIdentify=t.sendExperimentIdentify,this.name="VWO",l.debug("Config ",t)}return i(e,[{key:"init",value:function(){l.debug("===in init VWO===");var e=this.accountId,t=this.settingsTolerance,n=this.libraryTolerance,r=this.useExistingJquery,i=this.isSPA;window._vwo_code=function(){var o=!1,s=document;return{use_existing_jquery:function(){return r},library_tolerance:function(){return n},finish:function(){if(!o){o=!0;var e=s.getElementById("_vis_opt_path_hides");e&&e.parentNode.removeChild(e)}},finished:function(){return o},load:function(e){var t=s.createElement("script");t.src=e,t.type="text/javascript",t.innerText,t.onerror=function(){_vwo_code.finish()},s.getElementsByTagName("head")[0].appendChild(t)},init:function(){var n=setTimeout("_vwo_code.finish()",t),r=s.createElement("style"),o="body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}",a=s.getElementsByTagName("head")[0];return r.setAttribute("id","_vis_opt_path_hides"),r.setAttribute("type","text/css"),r.styleSheet?r.styleSheet.cssText=o:r.appendChild(s.createTextNode(o)),a.appendChild(r),this.load("//dev.visualwebsiteoptimizer.com/j.php?a="+e+"&u="+encodeURIComponent(s.URL)+"&r="+Math.random()+"&f="+ +i),n}}}(),window._vwo_settings_timer=window._vwo_code.init(),(this.sendExperimentTrack||this.experimentViewedIdentify)&&this.experimentViewed()}},{key:"experimentViewed",value:function(){window.VWO=window.VWO||[];var e=this;window.VWO.push(["onVariationApplied",function(t){if(t){l.debug("Variation Applied");var n=t[1],r=t[2];if(l.debug("experiment id:",n,"Variation Name:",_vwo_exp[n].comb_n[r]),void 0!==_vwo_exp[n].comb_n[r]&&["VISUAL_AB","VISUAL","SPLIT_URL","SURVEY"].indexOf(_vwo_exp[n].type)>-1){try{e.sendExperimentTrack&&(l.debug("Tracking..."),window.rudderanalytics.track("Experiment Viewed",{experimentId:n,variationName:_vwo_exp[n].comb_n[r]}))}catch(e){l.error("[VWO] experimentViewed:: ",e)}try{e.sendExperimentIdentify&&(l.debug("Identifying..."),window.rudderanalytics.identify(o({},"Experiment: ".concat(n),_vwo_exp[n].comb_n[r])))}catch(e){l.error("[VWO] experimentViewed:: ",e)}}}}])}},{key:"identify",value:function(e){l.debug("method not supported")}},{key:"track",value:function(e){if("Order Completed"===e.message.event){var t=e.message.properties?e.message.properties.total||e.message.properties.revenue:0;l.debug("Revenue",t),window.VWO=window.VWO||[],window.VWO.push(["track.revenueConversion",t])}}},{key:"page",value:function(e){l.debug("method not supported")}},{key:"isLoaded",value:function(){return!!window._vwo_code}},{key:"isReady",value:function(){return!!window._vwo_code}}]),e}(),Be=function(){function e(t){n(this,e),this.containerID=t.containerID,this.name="GOOGLETAGMANAGER"}return i(e,[{key:"init",value:function(){l.debug("===in init GoogleTagManager==="),function(e,t,n,r,i){e[r]=e[r]||[],e[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var o=t.getElementsByTagName(n)[0],s=t.createElement(n);s.async=!0,s.src="https://www.googletagmanager.com/gtm.js?id="+i,o.parentNode.insertBefore(s,o)}(window,document,"script","dataLayer",this.containerID)}},{key:"identify",value:function(e){l.debug("[GTM] identify:: method not supported")}},{key:"track",value:function(e){l.debug("===in track GoogleTagManager===");var t=e.message,n=a({event:t.event,userId:t.userId,anonymousId:t.anonymousId},t.properties);this.sendToGTMDatalayer(n)}},{key:"page",value:function(e){l.debug("===in page GoogleTagManager===");var t,n=e.message,r=n.name,i=n.properties?n.properties.category:void 0;r&&(t="Viewed "+r+" page"),i&&r&&(t="Viewed "+i+" "+r+" page"),t||(t="Viewed a Page");var o=a({event:t,userId:n.userId,anonymousId:n.anonymousId},n.properties);this.sendToGTMDatalayer(o)}},{key:"isLoaded",value:function(){return!(!window.dataLayer||Array.prototype.push===window.dataLayer.push)}},{key:"sendToGTMDatalayer",value:function(e){window.dataLayer.push(e)}},{key:"isReady",value:function(){return!(!window.dataLayer||Array.prototype.push===window.dataLayer.push)}}]),e}(),qe=function(){function e(t,r){if(n(this,e),this.analytics=r,this.appKey=t.appKey,t.appKey||(this.appKey=""),this.endPoint="",t.dataCenter){var i=t.dataCenter.trim().split("-");"eu"===i[0].toLowerCase()?this.endPoint="sdk.fra-01.braze.eu":this.endPoint="sdk.iad-"+i[1]+".braze.com"}this.name="BRAZE",l.debug("Config ",t)}return i(e,[{key:"formatGender",value:function(e){if(e&&"string"==typeof e){return["woman","female","w","f"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.FEMALE:["man","male","m"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.MALE:["other","o"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.OTHER:void 0}}},{key:"init",value:function(){l.debug("===in init Braze==="),function(e,t,n,r,i){e.appboy={},e.appboyQueue=[];for(var o="initialize destroy getDeviceId toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates requestContentCardsRefresh subscribeToContentCardsUpdates logCardImpressions logCardClick logCardDismissal logFeedDisplayed logContentCardsDisplayed logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick logInAppMessageHtmlClick subscribeToNewInAppMessages subscribeToInAppMessage removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked isPushGranted isPushPermissionGranted registerAppboyPushMessages unregisterAppboyPushMessages trackLocation stopWebTracking resumeWebTracking wipeData ab ab.DeviceProperties ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setLanguage ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPushNotificationSubscriptionType ab.User.prototype.setPhoneNumber ab.User.prototype.setAvatarImageUrl ab.User.prototype.setLastKnownLocation ab.User.prototype.setUserAttribute ab.User.prototype.setCustomUserAttribute ab.User.prototype.addToCustomAttributeArray ab.User.prototype.removeFromCustomAttributeArray ab.User.prototype.incrementCustomUserAttribute ab.User.prototype.addAlias ab.User.prototype.setCustomLocationAttribute ab.InAppMessage ab.InAppMessage.SlideFrom ab.InAppMessage.ClickAction ab.InAppMessage.DismissType ab.InAppMessage.OpenTarget ab.InAppMessage.ImageStyle ab.InAppMessage.TextAlignment ab.InAppMessage.Orientation ab.InAppMessage.CropType ab.InAppMessage.prototype.subscribeToClickedEvent ab.InAppMessage.prototype.subscribeToDismissedEvent ab.InAppMessage.prototype.removeSubscription ab.InAppMessage.prototype.removeAllSubscriptions ab.InAppMessage.prototype.closeMessage ab.InAppMessage.Button ab.InAppMessage.Button.prototype.subscribeToClickedEvent ab.InAppMessage.Button.prototype.removeSubscription ab.InAppMessage.Button.prototype.removeAllSubscriptions ab.SlideUpMessage ab.ModalMessage ab.FullScreenMessage ab.HtmlMessage ab.ControlMessage ab.Feed ab.Feed.prototype.getUnreadCardCount ab.ContentCards ab.ContentCards.prototype.getUnviewedCardCount ab.Card ab.Card.prototype.dismissCard ab.ClassicCard ab.CaptionedImage ab.Banner ab.ControlCard ab.WindowUtils display display.automaticallyShowNewInAppMessages display.showInAppMessage display.showFeed display.destroyFeed display.toggleFeed display.showContentCards display.hideContentCards display.toggleContentCards sharedLib".split(" "),s=0;s>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r>>6-2*i);return n}};e.exports=n}()})),Ge={utf8:{stringToBytes:function(e){return Ge.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Ge.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n>>24)|4278255360&(a[f]<<24|a[f]>>>8);a[u>>>5]|=128<>>9<<4)]=u;var h=o._ff,g=o._gg,y=o._hh,m=o._ii;for(f=0;f>>0,l=l+b>>>0,d=d+w>>>0,p=p+k>>>0}return t.endian([c,l,d,p])};o._ff=function(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+(i>>>0)+s;return(a<>>32-o)+t},o._gg=function(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+(i>>>0)+s;return(a<>>32-o)+t},o._hh=function(e,t,n,r,i,o,s){var a=e+(t^n^r)+(i>>>0)+s;return(a<>>32-o)+t},o._ii=function(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+(i>>>0)+s;return(a<>>32-o)+t},o._blocksize=16,o._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(o(e,n));return n&&n.asBytes?r:n&&n.asString?i.bytesToString(r):t.bytesToHex(r)}}()})),$e=function(){function e(t){n(this,e),this.NAME="INTERCOM",this.API_KEY=t.apiKey,this.APP_ID=t.appId,this.MOBILE_APP_ID=t.mobileAppId,l.debug("Config ",t)}return i(e,[{key:"init",value:function(){window.intercomSettings={app_id:this.APP_ID},function(){var e=window,t=e.Intercom;if("function"==typeof t)t("reattach_activator"),t("update",e.intercomSettings);else{var n=document,r=function e(){e.c(arguments)};r.q=[],r.c=function(e){r.q.push(e)},e.Intercom=r;var i=function(){var e=n.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://widget.intercom.io/widget/"+window.intercomSettings.app_id;var t=n.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)};"complete"===document.readyState?(i(),window.intercom_code=!0):e.attachEvent?(e.attachEvent("onload",i),window.intercom_code=!0):(e.addEventListener("load",i,!1),window.intercom_code=!0)}}()}},{key:"page",value:function(){window.Intercom("update")}},{key:"identify",value:function(e){var n={},r=e.message.context;if(null!=(r.Intercom?r.Intercom:null)){var i=r.Intercom.user_hash?r.Intercom.user_hash:null;null!=i&&(n.user_hash=i);var o=r.Intercom.hideDefaultLauncher?r.Intercom.hideDefaultLauncher:null;null!=o&&(n.hide_default_launcher=o)}Object.keys(r.traits).forEach((function(e){if(r.traits.hasOwnProperty(e)){var i=r.traits[e];if("company"===e){var o=[],s={};"string"==typeof r.traits[e]&&(s.company_id=We(r.traits[e]));var a="object"==t(r.traits[e])&&Object.keys(r.traits[e])||[];a.forEach((function(t){a.hasOwnProperty(t)&&("id"!=t?s[t]=r.traits[e][t]:s.company_id=r.traits[e][t])})),"object"!=t(r.traits[e])||a.includes("id")||(s.company_id=We(s.name)),o.push(s),n.companies=o}else n[e]=r.traits[e];switch(e){case"createdAt":n.created_at=i;break;case"anonymousId":n.user_id=i}}})),n.user_id=e.message.userId,window.Intercom("update",n)}},{key:"track",value:function(e){var t={},n=e.message;(n.properties?Object.keys(n.properties):null).forEach((function(e){var r=n.properties[e];t[e]=r})),n.event&&(t.event_name=n.event),t.user_id=n.userId?n.userId:n.anonymousId,t.created_at=Math.floor(new Date(n.originalTimestamp).getTime()/1e3),window.Intercom("trackEvent",t.event_name,t)}},{key:"isLoaded",value:function(){return!!window.intercom_code}},{key:"isReady",value:function(){return!!window.intercom_code}}]),e}(),Ye=function(){function e(t){n(this,e),this.projectID=t.projectID,this.writeKey=t.writeKey,this.ipAddon=t.ipAddon,this.uaAddon=t.uaAddon,this.urlAddon=t.urlAddon,this.referrerAddon=t.referrerAddon,this.client=null,this.name="KEEN"}return i(e,[{key:"init",value:function(){l.debug("===in init Keen==="),A("keen-integration","https://cdn.jsdelivr.net/npm/keen-tracking@4");var e=setInterval(function(){void 0!==window.KeenTracking&&void 0!==window.KeenTracking&&(this.client=function(e){return e.client=new window.KeenTracking({projectId:e.projectID,writeKey:e.writeKey}),e.client}(this),clearInterval(e))}.bind(this),1e3)}},{key:"identify",value:function(e){l.debug("in Keen identify");var t=e.message.context.traits,n=e.message.userId?e.message.userId:e.message.anonymousId,r=e.message.properties?Object.assign(r,e.message.properties):{};r.user={userId:n,traits:t},r=this.getAddOn(r),this.client.extendEvents(r)}},{key:"track",value:function(e){l.debug("in Keen track");var t=e.message.event,n=e.message.properties;n=this.getAddOn(n),this.client.recordEvent(t,n)}},{key:"page",value:function(e){l.debug("in Keen page");var t=e.message.name,n=e.message.properties?e.message.properties.category:void 0,r="Loaded a Page";t&&(r="Viewed "+t+" page"),n&&t&&(r="Viewed "+n+" "+t+" page");var i=e.message.properties;i=this.getAddOn(i),this.client.recordEvent(r,i)}},{key:"isLoaded",value:function(){return l.debug("in Keen isLoaded"),!(null==this.client)}},{key:"isReady",value:function(){return!(null==this.client)}},{key:"getAddOn",value:function(e){var t=[];return this.ipAddon&&(e.ip_address="${keen.ip}",t.push({name:"keen:ip_to_geo",input:{ip:"ip_address"},output:"ip_geo_info"})),this.uaAddon&&(e.user_agent="${keen.user_agent}",t.push({name:"keen:ua_parser",input:{ua_string:"user_agent"},output:"parsed_user_agent"})),this.urlAddon&&(e.page_url=document.location.href,t.push({name:"keen:url_parser",input:{url:"page_url"},output:"parsed_page_url"})),this.referrerAddon&&(e.page_url=document.location.href,e.referrer_url=document.referrer,t.push({name:"keen:referrer_parser",input:{referrer_url:"referrer_url",page_url:"page_url"},output:"referrer_info"})),e.keen={addons:t},e}}]),e}(),Qe=Object.prototype,Ze=Qe.hasOwnProperty,Xe=Qe.toString;"function"==typeof Symbol&&(ze=Symbol.prototype.valueOf),"function"==typeof BigInt&&(Je=BigInt.prototype.valueOf);var et=function(e){return e!=e},tt={boolean:1,number:1,string:1,undefined:1},nt=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/,rt=/^[A-Fa-f0-9]+$/,it={};it.a=it.type=function(e,t){return typeof e===t},it.defined=function(e){return void 0!==e},it.empty=function(e){var t,n=Xe.call(e);if("[object Array]"===n||"[object Arguments]"===n||"[object String]"===n)return 0===e.length;if("[object Object]"===n){for(t in e)if(Ze.call(e,t))return!1;return!0}return!e},it.equal=function(e,t){if(e===t)return!0;var n,r=Xe.call(e);if(r!==Xe.call(t))return!1;if("[object Object]"===r){for(n in e)if(!(it.equal(e[n],t[n])&&n in t))return!1;for(n in t)if(!(it.equal(e[n],t[n])&&n in e))return!1;return!0}if("[object Array]"===r){if((n=e.length)!==t.length)return!1;for(;n--;)if(!it.equal(e[n],t[n]))return!1;return!0}return"[object Function]"===r?e.prototype===t.prototype:"[object Date]"===r&&e.getTime()===t.getTime()},it.hosted=function(e,t){var n=typeof t[e];return"object"===n?!!t[e]:!tt[n]},it.instance=it.instanceof=function(e,t){return e instanceof t},it.nil=it.null=function(e){return null===e},it.undef=it.undefined=function(e){return void 0===e},it.args=it.arguments=function(e){var t="[object Arguments]"===Xe.call(e),n=!it.array(e)&&it.arraylike(e)&&it.object(e)&&it.fn(e.callee);return t||n},it.array=Array.isArray||function(e){return"[object Array]"===Xe.call(e)},it.args.empty=function(e){return it.args(e)&&0===e.length},it.array.empty=function(e){return it.array(e)&&0===e.length},it.arraylike=function(e){return!!e&&!it.bool(e)&&Ze.call(e,"length")&&isFinite(e.length)&&it.number(e.length)&&e.length>=0},it.bool=it.boolean=function(e){return"[object Boolean]"===Xe.call(e)},it.false=function(e){return it.bool(e)&&!1===Boolean(Number(e))},it.true=function(e){return it.bool(e)&&!0===Boolean(Number(e))},it.date=function(e){return"[object Date]"===Xe.call(e)},it.date.valid=function(e){return it.date(e)&&!isNaN(Number(e))},it.element=function(e){return void 0!==e&&"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&1===e.nodeType},it.error=function(e){return"[object Error]"===Xe.call(e)},it.fn=it.function=function(e){if("undefined"!=typeof window&&e===window.alert)return!0;var t=Xe.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t||"[object AsyncFunction]"===t},it.number=function(e){return"[object Number]"===Xe.call(e)},it.infinite=function(e){return e===1/0||e===-1/0},it.decimal=function(e){return it.number(e)&&!et(e)&&!it.infinite(e)&&e%1!=0},it.divisibleBy=function(e,t){var n=it.infinite(e),r=it.infinite(t),i=it.number(e)&&!et(e)&&it.number(t)&&!et(t)&&0!==t;return n||r||i&&e%t==0},it.integer=it.int=function(e){return it.number(e)&&!et(e)&&e%1==0},it.maximum=function(e,t){if(et(e))throw new TypeError("NaN is not a valid value");if(!it.arraylike(t))throw new TypeError("second argument must be array-like");for(var n=t.length;--n>=0;)if(e=0;)if(e>t[n])return!1;return!0},it.nan=function(e){return!it.number(e)||e!=e},it.even=function(e){return it.infinite(e)||it.number(e)&&e==e&&e%2==0},it.odd=function(e){return it.infinite(e)||it.number(e)&&e==e&&e%2!=0},it.ge=function(e,t){if(et(e)||et(t))throw new TypeError("NaN is not a valid value");return!it.infinite(e)&&!it.infinite(t)&&e>=t},it.gt=function(e,t){if(et(e)||et(t))throw new TypeError("NaN is not a valid value");return!it.infinite(e)&&!it.infinite(t)&&e>t},it.le=function(e,t){if(et(e)||et(t))throw new TypeError("NaN is not a valid value");return!it.infinite(e)&&!it.infinite(t)&&e<=t},it.lt=function(e,t){if(et(e)||et(t))throw new TypeError("NaN is not a valid value");return!it.infinite(e)&&!it.infinite(t)&&e=t&&e<=n},it.object=function(e){return"[object Object]"===Xe.call(e)},it.primitive=function(e){return!e||!("object"==typeof e||it.object(e)||it.fn(e)||it.array(e))},it.hash=function(e){return it.object(e)&&e.constructor===Object&&!e.nodeType&&!e.setInterval},it.regexp=function(e){return"[object RegExp]"===Xe.call(e)},it.string=function(e){return"[object String]"===Xe.call(e)},it.base64=function(e){return it.string(e)&&(!e.length||nt.test(e))},it.hex=function(e){return it.string(e)&&(!e.length||rt.test(e))},it.symbol=function(e){return"function"==typeof Symbol&&"[object Symbol]"===Xe.call(e)&&"symbol"==typeof ze.call(e)},it.bigint=function(e){return"function"==typeof BigInt&&"[object BigInt]"===Xe.call(e)&&"bigint"==typeof Je.call(e)};var ot,st=it,at=Object.prototype.hasOwnProperty,ut=function(e){for(var t=Array.prototype.slice.call(arguments,1),n=0;n-1&&s.push([a,n[a]])}},{key:"initAfterPage",value:function(){var e,t=this;e=function(){var e,n,r=t.isVideo?"chartbeat_video.js":"chartbeat.js";e=document.createElement("script"),n=document.getElementsByTagName("script")[0],e.type="text/javascript",e.async=!0,e.src="//static.chartbeat.com/js/"+r,n.parentNode.insertBefore(e,n)},Pt?jt(e):xt.push(e),this._isReady(this).then((function(e){l.debug("===replaying on chartbeat==="),e.replayEvents.forEach((function(t){e[t[0]](t[1])}))}))}},{key:"pause",value:function(e){return new Promise((function(t){setTimeout(t,e)}))}},{key:"_isReady",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){return t.isLoaded()?(t.failed=!1,l.debug("===chartbeat loaded successfully==="),e.analytics.emit("ready"),r(e)):n>=1e4?(t.failed=!0,l.debug("===chartbeat failed==="),r(e)):void t.pause(1e3).then((function(){return t._isReady(e,n+1e3).then(r)}))}))}}]),e}(),Lt=function(){function e(t,r){n(this,e),this.c2ID=t.c2ID,this.analytics=r,this.comScoreBeaconParam=t.comScoreBeaconParam?t.comScoreBeaconParam:{},this.isFirstPageCallMade=!1,this.failed=!1,this.comScoreParams={},this.replayEvents=[],this.name="COMSCORE"}return i(e,[{key:"init",value:function(){l.debug("===in init Comscore init===")}},{key:"identify",value:function(e){l.debug("in Comscore identify")}},{key:"track",value:function(e){l.debug("in Comscore track")}},{key:"page",value:function(e){if(l.debug("in Comscore page"),this.loadConfig(e),this.isFirstPageCallMade){if(this.failed)return void(this.replayEvents=[]);if(!this.isLoaded()&&!this.failed)return void this.replayEvents.push(["page",e]);e.message.properties;window.COMSCORE.beacon(this.comScoreParams)}else this.isFirstPageCallMade=!0,this.initAfterPage()}},{key:"loadConfig",value:function(e){l.debug("=====in loadConfig====="),this.comScoreParams=this.mapComscoreParams(e.message.properties),window._comscore=window._comscore||[],window._comscore.push(this.comScoreParams)}},{key:"initAfterPage",value:function(){l.debug("=====in initAfterPage====="),function(){var e=document.createElement("script"),t=document.getElementsByTagName("script")[0];e.async=!0,e.src=("https:"==document.location.protocol?"https://sb":"http://b")+".scorecardresearch.com/beacon.js",t.parentNode.insertBefore(e,t)}(),this._isReady(this).then((function(e){e.replayEvents.forEach((function(t){e[t[0]](t[1])}))}))}},{key:"pause",value:function(e){return new Promise((function(t){setTimeout(t,e)}))}},{key:"_isReady",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){return t.isLoaded()?(t.failed=!1,e.analytics.emit("ready"),r(e)):n>=1e4?(t.failed=!0,r(e)):void t.pause(1e3).then((function(){return t._isReady(e,n+1e3).then(r)}))}))}},{key:"mapComscoreParams",value:function(e){l.debug("=====in mapComscoreParams=====");var t=this.comScoreBeaconParam,n={};return Object.keys(t).forEach((function(r){if(r in e){var i=t[r],o=e[r];n[i]=o}})),n.c1="2",n.c2=this.c2ID,l.debug("=====in mapComscoreParams=====",n),n}},{key:"isLoaded",value:function(){return l.debug("in Comscore isLoaded"),!this.isFirstPageCallMade||!!window.COMSCORE}},{key:"isReady",value:function(){return!!window.COMSCORE}}]),e}(),Mt=Object.prototype.hasOwnProperty,Ut=String.prototype.charAt,Nt=Object.prototype.toString,Bt=function(e,t){return Ut.call(e,t)},qt=function(e,t){return Mt.call(e,t)},Ft=function(e,t){t=t||qt;for(var n=[],r=0,i=e.length;r=0&&st.date(f))l[p]=f.toISOTring().split("T")[0];else if(a.hasOwnProperty(p))a[p]&&"string"==typeof f&&(l[p]=sha256(f));else{var h=r.indexOf(p)>=0,g=i.indexOf(p)>=0;h&&!g||(l[p]=f)}}return l}}]),e}(),Yt="lt_synch_timestamp",Qt=new(function(){function e(){n(this,e),this.storage=De}return i(e,[{key:"setLotameSynchTime",value:function(e){this.storage.setItem(Yt,e)}},{key:"getLotameSynchTime",value:function(){return this.storage.getItem(Yt)}}]),e}()),Zt={HS:C,GA:Le,HOTJAR:Me,GOOGLEADS:Ue,VWO:Ne,GTM:Be,BRAZE:qe,INTERCOM:$e,KEEN:Ye,KISSMETRICS:_t,CUSTOMERIO:It,CHARTBEAT:Dt,COMSCORE:Lt,FACEBOOK_PIXEL:$t,LOTAME:function(){function e(t,r){var i=this;n(this,e),this.name="LOTAME",this.analytics=r,this.storage=Qt,this.bcpUrlSettings=t.bcpUrlSettings,this.dspUrlSettings=t.dspUrlSettings,this.mappings={},t.mappings.forEach((function(e){var t=e.key,n=e.value;i.mappings[t]=n}))}return i(e,[{key:"init",value:function(){l.debug("===in init Lotame==="),window.LOTAME_SYNCH_CALLBACK=function(){}}},{key:"addPixel",value:function(e,t,n){var r=document.createElement("img");r.src=e,r.setAttribute("width",t),r.setAttribute("height",n),document.getElementsByTagName("body")[0].appendChild(r)}},{key:"syncPixel",value:function(e){var t=this;l.debug("===== in syncPixel ======"),this.dspUrlSettings&&this.dspUrlSettings.length>0&&this.dspUrlSettings.forEach((function(n){var r=t.compileUrl(a({},t.mappings,{userId:e}),n.dspUrlTemplate);t.addPixel(r,"1","1")})),this.storage.setLotameSynchTime(Date.now()),this.analytics.methodToCallbackMapping.syncPixel&&this.analytics.emit("syncPixel",{destination:this.name})}},{key:"compileUrl",value:function(e,t){return Object.keys(e).forEach((function(n){if(e.hasOwnProperty(n)){var r=new RegExp("{{"+n+"}}","gi");t=t.replace(r,e[n])}})),t}},{key:"identify",value:function(e){l.debug("in Lotame identify");var t=e.message.userId;this.syncPixel(t)}},{key:"track",value:function(e){l.debug("track not supported for lotame")}},{key:"page",value:function(e){var t=this;l.debug("in Lotame page"),this.bcpUrlSettings&&this.bcpUrlSettings.length>0&&this.bcpUrlSettings.forEach((function(e){var n=t.compileUrl(a({},t.mappings),e.bcpUrlTemplate);t.addPixel(n,"1","1")})),e.message.userId&&this.isPixelToBeSynched()&&this.syncPixel(e.message.userId)}},{key:"isPixelToBeSynched",value:function(){var e=this.storage.getLotameSynchTime(),t=Date.now();return!e||Math.floor((t-e)/864e5)>=7}},{key:"isLoaded",value:function(){return l.debug("in Lotame isLoaded"),!0}},{key:"isReady",value:function(){return!0}}]),e}()},Xt=function e(){n(this,e),this.build="1.0.0",this.name="RudderLabs JavaScript SDK",this.namespace="com.rudderlabs.javascript",this.version="1.1.1"},en=function e(){n(this,e),this.name="RudderLabs JavaScript SDK",this.version="1.1.1"},tn=function e(){n(this,e),this.name="",this.version=""},nn=function e(){n(this,e),this.density=0,this.width=0,this.height=0},rn=function e(){n(this,e),this.app=new Xt,this.traits=null,this.library=new en;var t=new tn;t.version="";var r=new nn;r.width=window.width,r.height=window.height,r.density=window.devicePixelRatio,this.userAgent=navigator.userAgent,this.locale=navigator.language||navigator.browserLanguage,this.os=t,this.screen=r,this.device=null,this.network=null},on=function(){function e(){n(this,e),this.channel="web",this.context=new rn,this.type=null,this.action=null,this.messageId=h().toString(),this.originalTimestamp=(new Date).toISOString(),this.anonymousId=null,this.userId=null,this.event=null,this.properties={},this.integrations={},this.integrations.All=!0}return i(e,[{key:"getProperty",value:function(e){return this.properties[e]}},{key:"addProperty",value:function(e,t){this.properties[e]=t}},{key:"validateFor",value:function(e){if(!this.properties)throw new Error("Key properties is required");switch(e){case _.TRACK:if(!this.event)throw new Error("Key event is required for track event");if(this.event in Object.values(I))switch(this.event){case I.CHECKOUT_STEP_VIEWED:case I.CHECKOUT_STEP_COMPLETED:case I.PAYMENT_INFO_ENTERED:this.checkForKey("checkout_id"),this.checkForKey("step");break;case I.PROMOTION_VIEWED:case I.PROMOTION_CLICKED:this.checkForKey("promotion_id");break;case I.ORDER_REFUNDED:this.checkForKey("order_id")}else this.properties.category||(this.properties.category=this.event);break;case _.PAGE:break;case _.SCREEN:if(!this.properties.name)throw new Error("Key 'name' is required in properties")}}},{key:"checkForKey",value:function(e){if(!this.properties[e])throw new Error("Key '"+e+"' is required in properties")}}]),e}(),sn=function(){function e(){n(this,e),this.message=new on}return i(e,[{key:"setType",value:function(e){this.message.type=e}},{key:"setProperty",value:function(e){this.message.properties=e}},{key:"setUserProperty",value:function(e){this.message.user_properties=e}},{key:"setUserId",value:function(e){this.message.userId=e}},{key:"setEventName",value:function(e){this.message.event=e}},{key:"updateTraits",value:function(e){this.message.context.traits=e}},{key:"getElementContent",value:function(){return this.message}}]),e}(),an=function(){function e(){n(this,e),this.rudderProperty=null,this.rudderUserProperty=null,this.event=null,this.userId=null,this.channel=null,this.type=null}return i(e,[{key:"setProperty",value:function(e){return this.rudderProperty=e,this}},{key:"setPropertyBuilder",value:function(e){return this.rudderProperty=e.build(),this}},{key:"setUserProperty",value:function(e){return this.rudderUserProperty=e,this}},{key:"setUserPropertyBuilder",value:function(e){return this.rudderUserProperty=e.build(),this}},{key:"setEvent",value:function(e){return this.event=e,this}},{key:"setUserId",value:function(e){return this.userId=e,this}},{key:"setChannel",value:function(e){return this.channel=e,this}},{key:"setType",value:function(e){return this.type=e,this}},{key:"build",value:function(){var e=new sn;return e.setUserId(this.userId),e.setType(this.type),e.setEventName(this.event),e.setProperty(this.rudderProperty),e.setUserProperty(this.rudderUserProperty),e}}]),e}(),un=function e(){n(this,e),this.batch=null,this.writeKey=null},cn=P((function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}})),ln=[],dn=0;dn<256;++dn)ln[dn]=(dn+256).toString(16).substr(1);var pn,fn,hn=function(e,t){var n=t||0,r=ln;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")},gn=0,yn=0;var mn=function(e,t,n){var r=t&&n||0,i=t||[],o=(e=e||{}).node||pn,s=void 0!==e.clockseq?e.clockseq:fn;if(null==o||null==s){var a=cn();null==o&&(o=pn=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=fn=16383&(a[6]<<8|a[7]))}var u=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:yn+1,l=u-gn+(c-yn)/1e4;if(l<0&&void 0===e.clockseq&&(s=s+1&16383),(l<0||u>gn)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");gn=u,yn=c,fn=s;var d=(1e4*(268435455&(u+=122192928e5))+c)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=255&d;var p=u/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=255&p,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=s>>>8|128,i[r++]=255&s;for(var f=0;f<6;++f)i[r+f]=o[f];return t||hn(i)};var vn=function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||cn)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||hn(i)},bn=vn;bn.v1=mn,bn.v4=vn;var wn=bn,kn=wn.v4,_n={_data:{},length:0,setItem:function(e,t){return this._data[e]=t,this.length=Gt(this._data).length,t},getItem:function(e){return e in this._data?this._data[e]:null},removeItem:function(e){return e in this._data&&delete this._data[e],this.length=Gt(this._data).length,null},clear:function(){this._data={},this.length=0},key:function(e){return Gt(this._data)[e]}};var In={defaultEngine:function(){try{if(!window.localStorage)return!1;var e=kn();window.localStorage.setItem(e,"test_value");var t=window.localStorage.getItem(e);return window.localStorage.removeItem(e),"test_value"===t}catch(e){return!1}}()?window.localStorage:_n,inMemoryEngine:_n},En=In.defaultEngine,An=In.inMemoryEngine;function Cn(e,t,n,r){this.id=t,this.name=e,this.keys=n||{},this.engine=r||En}Cn.prototype.set=function(e,t){var n=this._createValidKey(e);if(n)try{this.engine.setItem(n,ae.stringify(t))}catch(n){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(n)&&(this._swapEngine(),this.set(e,t))}},Cn.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:ae.parse(t)}catch(e){return null}},Cn.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},Cn.prototype._createValidKey=function(e){var t,n=this.name,r=this.id;return Gt(this.keys).length?(Wt((function(i){i===e&&(t=[n,r,e].join("."))}),this.keys),t):[n,r,e].join(".")},Cn.prototype._swapEngine=function(){var e=this;Wt((function(t){var n=e.get(t);An.setItem([e.name,e.id,t].join("."),n),e.remove(t)}),this.keys),this.engine=An};var Tn=Cn;var On={setTimeout:function(e,t){return window.setTimeout(e,t)},clearTimeout:function(e){return window.clearTimeout(e)},Date:window.Date},Sn=On;function Pn(){this.tasks={},this.nextId=1}Pn.prototype.now=function(){return+new Sn.Date},Pn.prototype.run=function(e,t){var n=this.nextId++;return this.tasks[n]=Sn.setTimeout(this._handle(n,e),t),n},Pn.prototype.cancel=function(e){this.tasks[e]&&(Sn.clearTimeout(this.tasks[e]),delete this.tasks[e])},Pn.prototype.cancelAll=function(){Wt(Sn.clearTimeout,this.tasks),this.tasks={}},Pn.prototype._handle=function(e,t){var n=this;return function(){return delete n.tasks[e],t()}},Pn.setClock=function(e){Sn=e},Pn.resetClock=function(){Sn=On};var xn=Pn,Rn=jn;function jn(e){return jn.enabled(e)?function(t){t=Dn(t);var n=new Date,r=n-(jn[e]||n);jn[e]=n,t=e+" "+t+" +"+jn.humanize(r),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function Dn(e){return e instanceof Error?e.stack||e.message:e}jn.names=[],jn.skips=[],jn.enable=function(e){try{localStorage.debug=e}catch(e){}for(var t=(e||"").split(/[\s,]+/),n=t.length,r=0;r=36e5?(e/36e5).toFixed(1)+"h":e>=6e4?(e/6e4).toFixed(1)+"m":e>=1e3?(e/1e3|0)+"s":e+"ms"},jn.enabled=function(e){for(var t=0,n=jn.skips.length;tthis.maxAttempts)},Bn.prototype.getDelay=function(e){var t=this.backoff.MIN_RETRY_DELAY*Math.pow(this.backoff.FACTOR,e);if(this.backoff.JITTER){var n=Math.random(),r=Math.floor(n*this.backoff.JITTER*t);Math.floor(10*n)<5?t-=r:t+=r}return Number(Math.min(t,this.backoff.MAX_RETRY_DELAY).toPrecision(1))},Bn.prototype.addItem=function(e){this._enqueue({item:e,attemptNumber:0,time:this._schedule.now()})},Bn.prototype.requeue=function(e,t,n){this.shouldRetry(e,t,n)?this._enqueue({item:e,attemptNumber:t,time:this._schedule.now()+this.getDelay(t)}):this.emit("discard",e,t)},Bn.prototype._enqueue=function(e){var t=this._store.get(this.keys.QUEUE)||[];(t=t.slice(-(this.maxItems-1))).push(e),t=t.sort((function(e,t){return e.time-t.time})),this._store.set(this.keys.QUEUE,t),this._running&&this._processHead()},Bn.prototype._processHead=function(){var e=this,t=this._store;this._schedule.cancel(this._processId);var n=t.get(this.keys.QUEUE)||[],r=t.get(this.keys.IN_PROGRESS)||{},i=this._schedule.now(),o=[];function s(n,r){o.push({item:n.item,done:function(i,o){var s=t.get(e.keys.IN_PROGRESS)||{};delete s[r],t.set(e.keys.IN_PROGRESS,s),e.emit("processed",i,o,n.item),i&&e.requeue(n.item,n.attemptNumber+1,i)}})}for(var a=Object.keys(r).length;n.length&&n[0].time<=i&&a++0&&(this._processId=this._schedule.run(this._processHead,n[0].time-i))},Bn.prototype._ack=function(){this._store.set(this.keys.ACK,this._schedule.now()),this._store.set(this.keys.RECLAIM_START,null),this._store.set(this.keys.RECLAIM_END,null),this._schedule.run(this._ack,this.timeouts.ACK_TIMER)},Bn.prototype._checkReclaim=function(){var e=this;Wt((function(t){t.id!==e.id&&(e._schedule.now()-t.get(e.keys.ACK)=500&&o.status<600?(y(new Error("request failed with status: "+o.status+o.statusText+" for url: "+e)),i(new Error("request failed with status: "+o.status+o.statusText+" for url: "+e))):(l.debug("====== request processed successfully: "+o.status),i(null,o.status)))},o.send(JSON.stringify(n,f))}catch(e){i(e)}}},{key:"enqueue",value:function(e,t){var n={"Content-Type":"application/json",Authorization:"Basic "+btoa(this.writeKey+":")},r=e.getElementContent();r.originalTimestamp=g(),r.sentAt=g(),JSON.stringify(r).length>32e3&&l.error("[EventRepository] enqueue:: message length greater 32 Kb ",r);var i="/"==this.url.slice(-1)?this.url.slice(0,-1):this.url;this.payloadQueue.addItem({url:i+"/v1/"+t,headers:n,message:r})}}]),e}());function Kn(e){var t=function(t){var n=(t=t||window.event).target||t.srcElement;Wn(n)&&(n=n.parentNode),Vn(n,t)?l.debug("to be tracked ",t.type):l.debug("not to be tracked ",t.type),function(e,t){var n=e.target||e.srcElement,r=void 0;Wn(n)&&(n=n.parentNode);if(Vn(n,e)){if("form"==n.tagName.toLowerCase()){r={};for(var i=0;i-1)return!0}return!1}function Qn(e){return!($n(e).split(" ").indexOf("rudder-no-track")>=0)}function Zn(e){if(e.previousElementSibling)return e.previousElementSibling;do{e=e.previousSibling}while(e&&!Jn(e));return e}var Xn=function(e,t,n){var r=!1;return n=n||er,i.count=e,0===e?t():i;function i(e,o){if(i.count<=0)throw new Error("after called too many times");--i.count,e?(r=!0,t(e),t=n):0!==i.count||r||t(null,o)}};function er(){}function tr(e,t){this.eventRepository||(this.eventRepository=Gn),this.eventRepository.enqueue(e,t)}var nr=function(){function e(){n(this,e),this.autoTrackHandlersRegistered=!1,this.autoTrackFeatureEnabled=!1,this.initialized=!1,this.trackValues=[],this.eventsBuffer=[],this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=De,this.userId=null!=this.storage.getUserId()?this.storage.getUserId():"",this.userTraits=null!=this.storage.getUserTraits()?this.storage.getUserTraits():{},this.groupId=null!=this.storage.getGroupId()?this.storage.getGroupId():"",this.groupTraits=null!=this.storage.getGroupTraits()?this.storage.getGroupTraits():{},this.anonymousId=this.getAnonymousId(),this.storage.setUserId(this.userId),this.eventRepository=Gn,this.readyCallback=function(){},this.executeReadyCallback=void 0,this.methodToCallbackMapping={syncPixel:"syncPixelCallback"}}return i(e,[{key:"processResponse",value:function(e,t){try{l.debug("===in process response=== "+e),(t=JSON.parse(t)).source.useAutoTracking&&!this.autoTrackHandlersRegistered&&(this.autoTrackFeatureEnabled=!0,Kn(this),this.autoTrackHandlersRegistered=!0),t.source.destinations.forEach((function(e,t){l.debug("Destination "+t+" Enabled? "+e.enabled+" Type: "+e.destinationDefinition.name+" Use Native SDK? "+e.config.useNativeSDK),e.enabled&&this.clientIntegrations.push({name:e.destinationDefinition.name,config:e.config})}),this),this.clientIntegrations=k(this.loadOnlyIntegrations,this.clientIntegrations),this.init(this.clientIntegrations)}catch(e){y(e),l.debug("===handling config BE response processing error==="),l.debug("autoTrackHandlersRegistered",this.autoTrackHandlersRegistered),this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&(Kn(this),this.autoTrackHandlersRegistered=!0)}}},{key:"init",value:function(e){var t=this,n=this;if(l.debug("supported intgs ",Zt),!e||0==e.length)return this.readyCallback&&this.readyCallback(),void(this.toBeProcessedByIntegrationArray=[]);e.forEach((function(e){var r=new(0,Zt[e.name])(e.config,n);r.init(),l.debug("initializing destination: ",e),t.isInitialized(r).then(t.replayEvents)}))}},{key:"replayEvents",value:function(e){e.successfullyLoadedIntegration.length+e.failedToBeLoadedIntegration.length==e.clientIntegrations.length&&e.toBeProcessedByIntegrationArray.length>0&&(l.debug("===replay events called====",e.successfullyLoadedIntegration.length,e.failedToBeLoadedIntegration.length),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration,l.debug("==registering after callback===",e.clientIntegrationObjects.length),e.executeReadyCallback=Xn(e.clientIntegrationObjects.length,e.readyCallback),l.debug("==registering ready callback==="),e.on("ready",e.executeReadyCallback),e.clientIntegrationObjects.forEach((function(t){l.debug("===looping over each successful integration===="),t.isReady&&!t.isReady()||(l.debug("===letting know I am ready=====",t.name),e.emit("ready"))})),e.toBeProcessedByIntegrationArray.forEach((function(t){var n=t[0];t.shift();for(var r=k(t[0].message.integrations,e.clientIntegrationObjects),i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){return e.isLoaded()?(l.debug("===integration loaded successfully====",e.name),t.successfullyLoadedIntegration.push(e),r(t)):n>=1e4?(l.debug("====max wait over===="),t.failedToBeLoadedIntegration.push(e),r(t)):void t.pause(1e3).then((function(){return l.debug("====after pause, again checking===="),t.isInitialized(e,n+1e3).then(r)}))}))}},{key:"page",value:function(e,n,r,i,o){"function"==typeof i&&(o=i,i=null),"function"==typeof r&&(o=r,i=r=null),"function"==typeof n&&(o=n,i=r=n=null),"object"===t(e)&&(i=n,r=e,n=e=null),"object"===t(n)&&(i=r,r=n,n=null),"string"==typeof e&&"string"!=typeof n&&(n=e,e=null),this.processPage(e,n,r,i,o)}},{key:"track",value:function(e,t,n,r){"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),this.processTrack(e,t,n,r)}},{key:"identify",value:function(e,n,r,i){"function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=null,n=null),"object"==t(e)&&(r=n,n=e,e=this.userId),this.processIdentify(e,n,r,i)}},{key:"alias",value:function(e,n,r,i){"function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=null,n=null),"object"==t(n)&&(r=n,n=null);var o=(new an).setType("alias").build();o.message.previousId=n||this.userId?this.userId:this.getAnonymousId(),o.message.userId=e,this.processAndSendDataToDestinations("alias",o,r,i)}},{key:"group",value:function(e,n,r,i){if(arguments.length){"function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=null,n=null),"object"==t(e)&&(r=n,n=e,e=this.groupId),this.groupId=e,this.storage.setGroupId(this.groupId);var o=(new an).setType("group").build();if(n)for(var s in n)this.groupTraits[s]=n[s];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",o,r,i)}}},{key:"processPage",value:function(e,t,n,r,i){var o=(new an).setType("page").build();t&&(o.message.name=t),n||(n={}),e&&(n.category=e),n&&(o.message.properties=this.getPageProperties(n)),this.trackPage(o,r,i)}},{key:"processTrack",value:function(e,t,n,r){var i=(new an).setType("track").build();e&&i.setEventName(e),t?i.setProperty(t):i.setProperty({}),this.trackEvent(i,n,r)}},{key:"processIdentify",value:function(e,t,n,r){e&&this.userId&&e!==this.userId&&this.reset(),this.userId=e,this.storage.setUserId(this.userId);var i=(new an).setType("identify").build();if(t){for(var o in t)this.userTraits[o]=t[o];this.storage.setUserTraits(this.userTraits)}this.identifyUser(i,n,r)}},{key:"identifyUser",value:function(e,t,n){e.message.userId&&(this.userId=e.message.userId,this.storage.setUserId(this.userId)),e&&e.message&&e.message.context&&e.message.context.traits&&(this.userTraits=Object.assign({},e.message.context.traits),this.storage.setUserTraits(this.userTraits)),this.processAndSendDataToDestinations("identify",e,t,n)}},{key:"trackPage",value:function(e,t,n){this.processAndSendDataToDestinations("page",e,t,n)}},{key:"trackEvent",value:function(e,t,n){this.processAndSendDataToDestinations("track",e,t,n)}},{key:"processAndSendDataToDestinations",value:function(e,t,n,r){try{this.anonymousId||this.setAnonymousId(),t.message.context.page=m(),t.message.context.traits=Object.assign({},this.userTraits),l.debug("anonymousId: ",this.anonymousId),t.message.anonymousId=this.anonymousId,t.message.userId=t.message.userId?t.message.userId:this.userId,"group"==e&&(this.groupId&&(t.message.groupId=this.groupId),this.groupTraits&&(t.message.traits=Object.assign({},this.groupTraits))),n&&this.processOptionsParam(t,n),l.debug(JSON.stringify(t)),Object.keys(t.message.integrations).length>0&&w(t.message.integrations),k(t.message.integrations,this.clientIntegrationObjects).forEach((function(n){n.isFailed&&n.isFailed()||n[e](t)})),this.clientIntegrationObjects||(l.debug("pushing in replay queue"),this.toBeProcessedByIntegrationArray.push([e,t])),i=t.message.integrations,Object.keys(i).forEach((function(e){i.hasOwnProperty(e)&&(p[e]&&(i[p[e]]=i[e]),"All"!=e&&null!=p[e]&&p[e]!=e&&delete i[e])})),tr.call(this,t,e),l.debug(e+" is called "),r&&r()}catch(e){y(e)}var i}},{key:"processOptionsParam",value:function(e,t){var n=["integrations","anonymousId","originalTimestamp"];for(var r in t)if(n.includes(r))e.message[r]=t[r];else if("context"!==r)e.message.context[r]=t[r];else for(var i in t[r])e.message.context[i]=t[r][i]}},{key:"getPageProperties",value:function(e){var t=m();for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e}},{key:"reset",value:function(){this.userId="",this.userTraits={},this.anonymousId=this.setAnonymousId(),this.storage.clear()}},{key:"getAnonymousId",value:function(){return this.anonymousId=this.storage.getAnonymousId(),this.anonymousId||this.setAnonymousId(),this.anonymousId}},{key:"setAnonymousId",value:function(e){this.anonymousId=e||h(),this.storage.setAnonymousId(this.anonymousId)}},{key:"load",value:function(e,t,n){var r="https://api.rudderlabs.com/sourceConfig";if(!e||!t||0==t.length)throw y({message:"[Analytics] load:: Unable to load due to wrong writeKey or serverUrl"}),Error("failed to initialize");n&&n.logLevel&&l.setLogLevel(n.logLevel),n&&n.integrations&&(Object.assign(this.loadOnlyIntegrations,n.integrations),w(this.loadOnlyIntegrations)),n&&n.configUrl&&(r=n.configUrl),l.debug("inside load "),this.eventRepository.writeKey=e,t&&(this.eventRepository.url=t),n&&n.valTrackingList&&n.valTrackingList.push==Array.prototype.push&&(this.trackValues=n.valTrackingList),n&&n.useAutoTracking&&(this.autoTrackFeatureEnabled=!0,this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&(Kn(this),this.autoTrackHandlersRegistered=!0,l.debug("autoTrackHandlersRegistered",this.autoTrackHandlersRegistered)));try{!function(e,t,n,r){var i,o=r.bind(e);(i=new XMLHttpRequest).open("GET",t,!0),i.setRequestHeader("Authorization","Basic "+btoa(n+":")),i.onload=function(){var e=i.status;200==e?(l.debug("status 200 calling callback"),o(200,i.responseText)):(y(new Error("request failed with status: "+i.status+" for url: "+t)),o(e))},i.send()}(this,r,e,this.processResponse)}catch(e){y(e),this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&Kn(rr)}}},{key:"ready",value:function(e){"function"!=typeof e?l.error("ready callback is not a function"):this.readyCallback=e}},{key:"registerCallbacks",value:function(){var e=this;Object.keys(this.methodToCallbackMapping).forEach((function(t){if(e.methodToCallbackMapping.hasOwnProperty(t)){var n=window.rudderanalytics&&"function"==typeof window.rudderanalytics[e.methodToCallbackMapping[t]]?window.rudderanalytics[e.methodToCallbackMapping[t]]:function(){};l.debug("registerCallbacks",t,n),e.on(t,n)}}))}}]),e}();window.addEventListener("error",(function(e){y(e)}),!0);var rr=new nr;Ln(rr),rr.registerCallbacks();var ir=!!window.rudderanalytics&&window.rudderanalytics.push==Array.prototype.push,or=window.rudderanalytics?window.rudderanalytics[0]:[];if(or.length>0&&"load"==or[0]){var sr=or[0];or.shift(),l.debug("=====from init, calling method:: ",sr),rr[sr].apply(rr,u(or))}if(ir){for(var ar=1;ar { + if(integrationObject.hasOwnProperty(key)) { + if(clientToServerNames[key]) { + integrationObject[clientToServerNames[key]] = integrationObject[key] + } + if(key != "All") { + // delete user supplied keys except All and if except those where oldkeys are not present or oldkeys are same as transformed keys + if(clientToServerNames[key] != undefined && clientToServerNames[key] != key) { + delete integrationObject[key] + } + } + + } + }) +} + /** * * @param {*} sdkSuppliedIntegrations @@ -310,5 +328,6 @@ export { getDefaultPageProperties, findAllEnabledDestinations, tranformToRudderNames, + transformToServerNames, handleError };