forked from replicate/replicate-javascript
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGA4.min.js.download
2 lines (2 loc) · 50.8 KB
/
GA4.min.js.download
1
2
var GA4_RS=function(e){"use strict";function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function n(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function o(e){return o="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},o(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function s(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=l(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}var d=4,y=function(){var e;d<=2&&(e=console).log.apply(e,arguments)},v=function(){var e;d<=3&&(e=console).warn.apply(e,arguments)},h=function(){var e;d<=4&&(e=console).error.apply(e,arguments)},g="RS_JS_SDK",m=["Request failed with status:"],_=function(e){var t=window.RudderStackGlobals&&window.RudderStackGlobals.errorReporting;t&&e instanceof Error&&t.notify(e)},b=function(e,t){try{return JSON.stringify(e,function(e){var t=[];return function(r,n){if(!e||null!=n){if("object"!==o(n)||null===n)return n;for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?(y("Circular Reference detected for key: ".concat(r)),"[Circular Reference]"):(t.push(n),n)}}}(t))}catch(r){return v("Failed to convert the value to a JSON string."),null}},w=function(e){return e?0===Object.keys(e).length:(v("input is undefined or null"),!0)},C=function(e,t,r){var n,i;try{n="string"==typeof e?e:e instanceof Error||e.message?e.message:b(e)}catch(a){n=""}if("object"===o(i=e)&&null!==i&&"target"in i){if(e.target&&"script"!==e.target.localName)return"";if(e.target.dataset&&(e.target.dataset.loader!==g||"true"!==e.target.dataset.isnonnativesdk))return"";if(n="error in script loading:: src:: ".concat(e.target.src," id:: ").concat(e.target.id),"ad-block"===e.target.id)return r.page("RudderJS-Initiated","ad-block page request",{path:"/ad-blocked",title:n},r.sendAdblockPageOptions),""}return"[handleError]::".concat(t||"",' "').concat(n,'"')},O=function(e,t,r){var n;try{n=C(e,t,r)}catch(o){h("[handleError] Exception:: ",o),h("[handleError] Original error:: ",b(e)),_(o)}n&&(h(n),function(e){return!e.message||!m.some((function(t){return e.message.includes(t)}))}(e)&&_(e))},j="GA4",A="Google Analytics 4 (GA4)";u({},A,"GA4"),u(u(u(u(u(u(u(u(u(u({},j,j),"Google Analytics 4",j),"Google analytics 4",j),"google analytics 4",j),"Google Analytics4",j),"Google analytics4",j),"google analytics4",j),"Google Analytics 4 (GA4)",j),"google analytics 4 (ga4)",j),"GoogleAnalytics4",j);var E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function S(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k,I,K={exports:{}};function F(){if(I)return k;I=1;var e=1e3,t=60*e,r=60*t,n=24*r,i=7*n,a=365.25*n;function s(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}return k=function(u,c){c=c||{};var l=o(u);if("string"===l&&u.length>0)return function(o){if((o=String(o)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(!s)return;var u=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*a;case"weeks":case"week":case"w":return u*i;case"days":case"day":case"d":return u*n;case"hours":case"hour":case"hrs":case"hr":case"h":return u*r;case"minutes":case"minute":case"mins":case"min":case"m":return u*t;case"seconds":case"second":case"secs":case"sec":case"s":return u*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(u);if("number"===l&&isFinite(u))return c.long?function(o){var i=Math.abs(o);if(i>=n)return s(o,i,n,"day");if(i>=r)return s(o,i,r,"hour");if(i>=t)return s(o,i,t,"minute");if(i>=e)return s(o,i,e,"second");return o+" ms"}(u):function(o){var i=Math.abs(o);if(i>=n)return Math.round(o/n)+"d";if(i>=r)return Math.round(o/r)+"h";if(i>=t)return Math.round(o/t)+"m";if(i>=e)return Math.round(o/e)+"s";return o+"ms"}(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))},k}var D=function(e){function t(e){var n,o,i,a=null;function s(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];if(s.enabled){var i=s,a=Number(new Date),u=a-(n||a);i.diff=u,i.prev=n,i.curr=a,n=a,r[0]=t.coerce(r[0]),"string"!=typeof r[0]&&r.unshift("%O");var c=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(function(e,n){if("%%"===e)return"%";c++;var o=t.formatters[n];if("function"==typeof o){var a=r[c];e=o.call(i,a),r.splice(c,1),c--}return e})),t.formatArgs.call(i,r),(i.log||t.log).apply(i,r)}}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==a?a:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i)},set:function(e){a=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,r){var n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){var e=[].concat(c(t.names.map(n)),c(t.skips.map(n).map((function(e){return"-"+e})))).join(",");return t.enable(""),e},t.enable=function(e){var r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=F(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((function(r){t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t};!function(e,t){var r;t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))})),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(r){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(r=!1,function(){r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=D(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(K,K.exports);var x=K.exports,P=x("cookie"),R=function(e,t,r){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var n=U(e)+"="+U(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(n+="; path="+r.path);r.domain&&(n+="; domain="+r.domain);r.expires&&(n+="; expires="+r.expires.toUTCString());r.samesite&&(n+="; samesite="+r.samesite);r.secure&&(n+="; secure");document.cookie=n}(e,t,r);case 1:return function(e){return T()[e]}(e);default:return T()}};function T(){var e;try{e=document.cookie}catch(t){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(t.stack||t),{}}return function(e){var t,r={},n=e.split(/ *; */);if(""==n[0])return r;for(var o=0;o<n.length;++o)r[N((t=n[o].split("="))[0])]=N(t[1]);return r}(e)}function U(e){try{return encodeURIComponent(e)}catch(t){P("error `encode(%o)` - %o",e,t)}}function N(e){try{return decodeURIComponent(e)}catch(t){P("error `decode(%o)` - %o",e,t)}}var L=S(R),M={exports:{}},B=Math.max,G=function(e,t){var r=t?t.length:0;if(!r)return[];for(var n=B(Number(e)||0,0),o=B(r-n,0),i=new Array(o),a=0;a<o;a+=1)i[a]=t[a+n];return i},V=Math.max,q=G,$=function(e){if(null==e||!e.length)return[];for(var t=new Array(V(e.length-2,0)),r=1;r<e.length;r+=1)t[r-1]=e[r];return t},W=Object.prototype.hasOwnProperty,Y=Object.prototype.toString,H=function(e){return Boolean(e)&&"[object Object]"===Y.call(e)},J=function(e,t,r,n){return W.call(t,n)&&void 0===e[n]&&(e[n]=r),t},z=function(e,t,r,n){return W.call(t,n)&&(H(e[n])&&H(r)?e[n]=Q(e[n],r):void 0===e[n]&&(e[n]=r)),t},Z=function(e,t){if(r=t,!Boolean(r)||"object"!==o(r))return t;var r;e=e||J;for(var n=q(2,arguments),i=0;i<n.length;i+=1)for(var a in n[i])e(t,n[i],n[i][a],a);return t},Q=function(e){return Z.apply(null,[z,e].concat($(arguments)))};M.exports=function(e){return Z.apply(null,[null,e].concat($(arguments)))},M.exports.deep=Q;var X=S(M.exports),ee={exports:{}},te=x("cookie"),re=function(e,t,r){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var n=oe(e)+"="+oe(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(n+="; path="+r.path);r.domain&&(n+="; domain="+r.domain);r.expires&&(n+="; expires="+r.expires.toUTCString());r.secure&&(n+="; secure");document.cookie=n}(e,t,r);case 1:return function(e){return ne()[e]}(e);default:return ne()}};function ne(){var e;try{e=document.cookie}catch(t){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(t.stack||t),{}}return function(e){var t,r={},n=e.split(/ *; */);if(""==n[0])return r;for(var o=0;o<n.length;++o)r[ie((t=n[o].split("="))[0])]=ie(t[1]);return r}(e)}function oe(e){try{return encodeURIComponent(e)}catch(t){te("error `encode(%o)` - %o",e,t)}}function ie(e){try{return decodeURIComponent(e)}catch(t){te("error `decode(%o)` - %o",e,t)}}!function(e,t){var r=re;function n(e){for(var r=t.cookie,n=t.levels(e),o=0;o<n.length;++o){var i="__tld__",a=n[o],s={domain:"."+a};if(r(i,1,s),r(i))return r(i,null,s),a}return""}n.levels=function(e){var t,r,n=("function"!=typeof window.URL?(t=e,(r=document.createElement("a")).href=t,r.hostname):new URL(e).hostname).split("."),o=n[n.length-1],i=[];if(4===n.length&&o===parseInt(o,10))return i;if(n.length<=1)return i;for(var a=n.length-2;a>=0;--a)i.push(n.slice(a).join("."));return i},n.cookie=r,t=e.exports=n}(ee,ee.exports);var ae=S(ee.exports);function se(e){return function t(r){return 0===arguments.length||function(e){return null!=e&&"object"===o(e)&&!0===e["@@functional/placeholder"]}(r)?t:e.apply(this,arguments)}}var ue=se((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function ce(e,t,r){if(r||(r=new le),function(e){var t=o(e);return null==e||"object"!=t&&"function"!=t}(e))return e;var n,i=function(n){var o=r.get(e);if(o)return o;for(var i in r.set(e,n),e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=t?ce(e[i],!0,r):e[i]);return n};switch(ue(e)){case"Object":return i(Object.create(Object.getPrototypeOf(e)));case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return n=e,new RegExp(n.source,n.flags?n.flags:(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":"")+(n.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var le=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var r=this.hash(e),n=this.map[r];n||(this.map[r]=n=[]),n.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var r in e)t.push(Object.prototype.toString.call(e[r]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var r=this.map[t],n=0;n<r.length;n+=1){var o=r[n];if(o[0]===e)return o[1]}else{var i=this.hash(e),a=this.map[i];if(a)for(var s=0;s<a.length;s+=1){var u=a[s];if(u[0]===e)return u[1]}}},e}(),fe=se((function(e){return null!=e&&"function"==typeof e.clone?e.clone():ce(e,!0)})),pe=function(){function e(t){i(this,e),this.cOpts={},this.options(t),this.isSupportAvailable=this.checkSupportAvailability()}return s(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this.cOpts;var t=".".concat(ae(window.location.href));return"."===t&&(t=null),this.cOpts=X(e,{maxage:31536e6,path:"/",domain:t,samesite:"Lax"}),e.sameDomainCookiesOnly&&delete this.cOpts.domain,this.cOpts}},{key:"set",value:function(e,t){try{return L(e,t,fe(this.cOpts)),!0}catch(r){return h(r),!1}}},{key:"get",value:function(e){return L(e)}},{key:"remove",value:function(e){try{return L(e,null,fe(this.cOpts)),!0}catch(t){return!1}}},{key:"checkSupportAvailability",value:function(){var e="test_rudder_cookie";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}}]),e}(),de=new pe({}),ye={LOG:{value:0,method:console.log},INFO:{value:1,method:console.info},DEBUG:{value:2,method:console.debug},WARN:{value:3,method:console.warn},ERROR:{value:4,method:console.error}},ve=function(){function e(t,r){i(this,e),this.level=+r||ye.ERROR.value,this.scope=t||""}return s(e,[{key:"setLogLevel",value:function(e){if(e&&"string"==typeof e){var t=e.toUpperCase();this.level=ye[t]?ye[t].value:this.level}}},{key:"setScope",value:function(e){this.scope=e||this.scope}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.logBase(t,ye.LOG.value)}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.logBase(t,ye.INFO.value)}},{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.logBase(t,ye.DEBUG.value)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.logBase(t,ye.WARN.value)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.logBase(t,ye.ERROR.value)}},{key:"logBase",value:function(e,t){if(this.level<=t){var r=Object.values(ye).find((function(e){return e.value===t}));r.method.apply(r,c(this.getLogData(e)))}}},{key:"getLogData",value:function(e){if(Array.isArray(e)&&e.length>0){var t="%c RS SDK";this.scope&&(t="".concat(t," - ").concat(this.scope));var r=e[0].trim();t="".concat(t," %c ").concat(r);var n=[];return n.push(t),n.push("font-weight: bold; background: black; color: white;"),n.push("font-weight: normal;"),n.push.apply(n,c(e.slice(1))),n}return e}}]),e}(),he=["item_id","itemId","product_id","item_name","itemName","name","coupon","item_brand","itemBrand","brand","item_variant","itemVariant","variant","price","quantity","index","position","affiliation","discount","item_category","itemCategory","category","item_category2","item_category3","item_category4","item_category5","item_list_id","item_list_name","location_id"],ge=[{sourceKeys:["product_id","itemId"],destKey:"item_id"},{sourceKeys:["name","itemName"],destKey:"item_name"},{sourceKeys:"coupon",destKey:"coupon"},{sourceKeys:["brand","itemBrand"],destKey:"item_brand"},{sourceKeys:["variant","itemVariant"],destKey:"item_variant"},{sourceKeys:"price",destKey:"price",metadata:{type:"toNumber"}},{sourceKeys:"quantity",destKey:"quantity",metadata:{type:"toNumber"}},{sourceKeys:"position",destKey:"index",metadata:{type:"toNumber"}},{sourceKeys:"affiliation",destKey:"affiliation"},{sourceKeys:"discount",destKey:"discount"},{sourceKeys:["category","itemCategory"],destKey:"item_category"},{sourceKeys:"item_category2",destKey:"item_category2"},{sourceKeys:"item_category3",destKey:"item_category3"},{sourceKeys:"item_category4",destKey:"item_category4"},{sourceKeys:"item_category5",destKey:"item_category5"},{sourceKeys:"item_list_id",destKey:"item_list_id"},{sourceKeys:"item_list_name",destKey:"item_list_name"},{sourceKeys:"location_id",destKey:"location_id"}],me={method:{sourceKeys:"properties.method",destKey:"method"},product_cart_shared_method:{sourceKeys:"properties.share_via",destKey:"method"},currency:{sourceKeys:"properties.currency",destKey:"currency",metadata:{defaultValue:"USD"}},value:{sourceKeys:["properties.total","properties.value","properties.revenue","properties.price"],destKey:"value",metadata:{type:"toNumber"}},product_add_or_remove_value:{sourceKeys:["properties.total","properties.value","properties.revenue",{operation:"multiplication",args:[{sourceKeys:"properties.price"},{sourceKeys:"properties.quantity",defaultVal:1}]}],destKey:"value",metadata:{type:"toNumber"}},search:{sourceKeys:"properties.query",destKey:"search_term"},list_id:{sourceKeys:"properties.list_id",destKey:"item_list_id"},list_name:{sourceKeys:"properties.category",destKey:"item_list_name"},creative_name:{sourceKeys:["properties.creative_name","properties.creative"],destKey:"creative_name"},creative_slot:{sourceKeys:["properties.creative_slot","properties.position"],destKey:"creative_slot"},promotion_id:{sourceKeys:"properties.promotion_id",destKey:"promotion_id"},promotion_name:{sourceKeys:["properties.promotion_name","properties.name"],destKey:"promotion_name"},coupon:{sourceKeys:"properties.coupon",destKey:"coupon"},payment_method:{sourceKeys:"properties.payment_method",destKey:"payment_type"},shipping_method:{sourceKeys:"properties.shipping_method",destKey:"shipping_tier"},order_id:{sourceKeys:"properties.order_id",destKey:"transaction_id"},shipping:{sourceKeys:"properties.shipping",destKey:"shipping",metadata:{type:"toNumber"}},tax:{sourceKeys:"properties.tax",destKey:"tax",metadata:{type:"toNumber"}},content_type:{sourceKeys:"properties.content_type",destKey:"content_type"},item_id:{sourceKeys:["properties.item_id","properties.product_id","properties.sku"],destKey:"item_id"},cart_shared_item_id:{sourceKeys:["properties.item_id","properties.cart_id"],destKey:"item_id"},url:{sourceKeys:["properties.url","context.page.url"],destKey:"page_location"},referrer:{sourceKeys:["properties.referrer","context.page.referrer"],destKey:"page_referrer"},title:{sourceKeys:["properties.title","context.page.title"],destKey:"page_title"}},_e={LOGIN:{event:"login",mapping:[me.method]},SIGN_UP:{event:"sign_up",mapping:[me.method]},GENERATE_LEAD:{event:"generate_lead",mapping:[me.currency,r(r({},me.value),{},{required:!0})]},PRODUCTS_SEARCHED:{event:"search",mapping:[me.search]},PRODUCT_SEARCHED:{event:"search",mapping:[me.search]},PRODUCT_LIST_VIEWED:{event:"view_item_list",itemList:"YES",mapping:[me.list_id,me.list_name]},PROMOTION_VIEWED:{event:"view_promotion",itemList:"YES",mapping:[me.promotion_id,me.creative_slot,me.creative_name,me.promotion_name]},PROMOTION_CLICKED:{event:"select_promotion",itemList:"NO",mapping:[me.promotion_id,me.creative_slot,me.creative_name,me.promotion_name]},PRODUCT_CLICKED:{event:"select_item",item:"YES",mapping:[me.list_id,me.list_name]},PRODUCTS_CLICKED:{event:"select_item",item:"YES",mapping:[me.list_id,me.list_name]},PRODUCT_VIEWED:{event:"view_item",item:"YES",mapping:[me.currency,r(r({},me.value),{},{required:!0})]},PRODUCT_ADDED:{event:"add_to_cart",itemList:"NO",item:"YES",mapping:[me.currency,r(r({},me.product_add_or_remove_value),{},{required:!0})]},PRODUCT_REMOVED:{event:"remove_from_cart",itemList:"NO",item:"YES",mapping:[me.currency,r(r({},me.product_add_or_remove_value),{},{required:!0})]},CART_VIEWED:{event:"view_cart",itemList:"YES",mapping:[me.currency,r(r({},me.value),{},{required:!0})]},CHECKOUT_STARTED:{event:"begin_checkout",itemList:"YES",mapping:[me.currency,me.coupon,r(r({},me.value),{},{required:!0})]},PAYMENT_INFO_ENTERED:{event:"add_payment_info",itemList:"YES",mapping:[me.currency,me.coupon,me.payment_method,r(r({},me.value),{},{required:!0})]},CHECKOUT_STEP_COMPLETED:{event:"add_shipping_info",itemList:"YES",mapping:[me.currency,me.coupon,me.shipping_method,r(r({},me.value),{},{required:!0})]},ORDER_COMPLETED:{event:"purchase",itemList:"YES",mapping:[me.tax,me.coupon,me.shipping,me.currency,r(r({},me.value),{},{required:!0}),r(r({},me.order_id),{},{required:!0})]},ORDER_REFUNDED:{event:"refund",itemList:"NO",mapping:[me.tax,me.coupon,me.shipping,me.currency,r(r({},me.value),{},{required:!0}),r(r({},me.order_id),{},{required:!0})]},PRODUCT_ADDED_TO_WISHLIST:{event:"add_to_wishlist",itemList:"NO",item:"YES",mapping:[me.currency,r(r({},me.value),{},{required:!0})]},PRODUCT_SHARED:{event:"share",mapping:[me.item_id,me.content_type,me.product_cart_shared_method]},CART_SHARED:{event:"share",mapping:[me.content_type,me.cart_shared_item_id,me.product_cart_shared_method]},PAGE:{event:"page_view",mapping:[me.url,me.title,me.referrer]}},be=[_e.PRODUCT_CLICKED.event,_e.PRODUCT_VIEWED.event,_e.PRODUCT_ADDED.event,_e.PRODUCT_REMOVED.event,_e.PRODUCT_ADDED_TO_WISHLIST.event],we=function(e){return null!=e&&"object"===o(e)&&!1===Array.isArray(e)};function Ce(e,t,r){return"function"==typeof r.join?r.join(e):e[0]+t+e[1]}function Oe(e,t,r){return"function"!=typeof r.isValid||r.isValid(e,t)}function je(e){return we(e)||Array.isArray(e)||"function"==typeof e}for(var Ae=S((function(e,t,r){if(we(r)||(r={default:r}),!je(e))return void 0!==r.default?r.default:e;"number"==typeof t&&(t=String(t));var n=Array.isArray(t),o="string"==typeof t,i=r.separator||".",a=r.joinChar||("string"==typeof i?i:".");if(!o&&!n)return e;if(o&&t in e)return Oe(t,e,r)?e[t]:r.default;var s=n?t:function(e,t,r){if("function"==typeof r.split)return r.split(e);return e.split(t)}(t,i,r),u=s.length,c=0;do{var l=s[c];for("number"==typeof l&&(l=String(l));l&&"\\"===l.slice(-1);)l=Ce([l.slice(0,-1),s[++c]||""],a,r);if(l in e){if(!Oe(l,e,r))return r.default;e=e[l]}else{for(var f=!1,p=c+1;p<u;)if(f=(l=Ce([l,s[p++]],a,r))in e){if(!Oe(l,e,r))return r.default;e=e[l],c=p-1;break}if(!f)return r.default}}while(++c<u&&je(e));return c===u?e:r.default})),Ee=256;Ee--;)(Ee+256).toString(16).substring(1);for(var Se=0;Se<256;Se++)(Se+256).toString(16).substring(1);function ke(e,t,r){var n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Set,i=r;return o.has(e)?(i[t]="[Circular Reference]",r):(o.add(e),Object(e)!==e?i[t]=e:Array.isArray(e)?function(){for(var r=e.length,n=0;n<r;n+=1)ke(e[n],t?"".concat(t,".").concat(n):"".concat(n),i,o);0===r&&(i[t]=[])}():(n=!0,Object.keys(e).forEach((function(r){n=!1,ke(e[r],t?"".concat(t,".").concat(r):r,i,o)})),n&&(i[t]={})),o.delete(e),i)}function Ie(e){return ke(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",{})}function Ke(e,t,r,n){var o=[],i=t||{};return Array.isArray(r)?r.forEach((function(t){var r=Ae(e,t);r&&(Object.keys(r).forEach((function(e){n.includes(e)||o.push(e)})),o.forEach((function(e){void 0!==r[e]&&(i[e]=Ae(r,e))})))})):"root"===r?(Object.keys(e).forEach((function(e){n.includes(e)||o.push(e)})),o.forEach((function(t){void 0!==e[t]&&(i[t]=Ae(e,t))}))):y("unable to parse keys"),i}var Fe=function(e){return function(e){return void 0!==e}(e)&&function(e){return null!==e}(e)},De=function(e){var t=e.message,r=e.operationObject,n=r.operation,o=r.args.map((function(e){var r=e.sourceKeys,n=e.defaultVal,o=Ae(t,r);return o||!1===o||0===o?o:n}));if(!o.every((function(e){return Fe(e)})))return null;var i=null;switch(n){case"multiplication":i=1;var a,s=p(o);try{for(s.s();!(a=s.n()).done;){var u=a.value;if("number"!=typeof u)return null;i*=u}}catch(d){s.e(d)}finally{s.f()}return i.toFixed(2);case"addition":i=0;var c,l=p(o);try{for(l.s();!(c=l.n()).done;){var f=c.value;if("number"!=typeof f)return null;i+=f}}catch(d){l.e(d)}finally{l.f()}return i.toFixed(2);default:return null}},xe=function(e,t){var r=e,n={jsonStringify:function(){r=JSON.stringify(e)},jsonStringifyOnObject:function(){"string"!=typeof e&&(r=JSON.stringify(e))},toString:function(){r=String(e)},toNumber:function(){r=Number(e)},toFloat:function(){r=parseFloat(e)},toInt:function(){r=parseInt(e,10)},toLower:function(){r=e.toString().toLowerCase()},trim:function(){"string"==typeof e&&(r=e.trim())},IsBoolean:function(){r=!0,"boolean"!=typeof e&&(y("Boolean value missing, so dropping it"),r=!1)}};t in n&&(0,n[t])();return r},Pe=function(e,t){var r={};return Array.isArray(t)&&t.length>0&&t.forEach((function(t){var n=t.sourceKeys,i=t.destKey,a=t.metadata,s=function(e,t){if(!t)return e;var r=t.type,n=t.defaultValue;if(!Fe(e))return n||e;var o=e;return r&&(Array.isArray(r)?r.forEach((function(e){o=xe(o,e)})):o=xe(o,r)),o}(function(e,t){if(Array.isArray(t)&&t.length>0){var r,n=p(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=void 0;if((a="object"===o(i)?De({message:e,operationObject:i}):Ae(e,i))||!1===a||0===a)return a}}catch(s){n.e(s)}finally{n.f()}return null}return"object"===o(t)?De({message:e,operationObject:t}):Ae(e,t)}(e,n),a);(s||0===s||!1===s)&&i&&(r[i]=s)})),r},Re={exports:{}};!function(e,t){var r=9007199254740991,n="[object Arguments]",i="[object Function]",a="[object GeneratorFunction]",s="[object Map]",u="[object Promise]",c="[object Set]",l="[object WeakMap]",f="[object DataView]",p=/^\[object .+?Constructor\]$/,d="object"==o(E)&&E&&E.Object===Object&&E,y="object"==("undefined"==typeof self?"undefined":o(self))&&self&&self.Object===Object&&self,v=d||y||Function("return this")(),h=t&&!t.nodeType&&t,g=h&&e&&!e.nodeType&&e,m=g&&g.exports===h;var _,b,w,C=Function.prototype,O=Object.prototype,j=v["__core-js_shared__"],A=(_=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+_:"",S=C.toString,k=O.hasOwnProperty,I=O.toString,K=RegExp("^"+S.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=m?v.Buffer:void 0,D=O.propertyIsEnumerable,x=F?F.isBuffer:void 0,P=(b=Object.keys,w=Object,function(e){return b(w(e))}),R=Y(v,"DataView"),T=Y(v,"Map"),U=Y(v,"Promise"),N=Y(v,"Set"),L=Y(v,"WeakMap"),M=!D.call({valueOf:1},"valueOf"),B=J(R),G=J(T),V=J(U),q=J(N),$=J(L);function W(e){if(!te(e)||function(e){return!!A&&A in e}(e))return!1;var t=ee(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}(e)?K:p;return t.test(J(e))}function Y(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return W(r)?r:void 0}var H=function(e){return I.call(e)};function J(e){if(null!=e){try{return S.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function z(e){return function(e){return function(e){return!!e&&"object"==o(e)}(e)&&Q(e)}(e)&&k.call(e,"callee")&&(!D.call(e,"callee")||I.call(e)==n)}(R&&H(new R(new ArrayBuffer(1)))!=f||T&&H(new T)!=s||U&&H(U.resolve())!=u||N&&H(new N)!=c||L&&H(new L)!=l)&&(H=function(e){var t=I.call(e),r="[object Object]"==t?e.constructor:void 0,n=r?J(r):void 0;if(n)switch(n){case B:return f;case G:return s;case V:return u;case q:return c;case $:return l}return t});var Z=Array.isArray;function Q(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!ee(e)}var X=x||function(){return!1};function ee(e){var t=te(e)?I.call(e):"";return t==i||t==a}function te(e){var t=o(e);return!!e&&("object"==t||"function"==t)}e.exports=function(e){if(Q(e)&&(Z(e)||"string"==typeof e||"function"==typeof e.splice||X(e)||z(e)))return!e.length;var t=H(e);if(t==s||t==c)return!e.size;if(M||function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||O)}(e))return!P(e).length;for(var r in e)if(k.call(e,r))return!1;return!0}}(Re,Re.exports);var Te=S(Re.exports),Ue={exports:{}};!function(e,t){var r="__lodash_hash_undefined__",n=1,i=2,a=1/0,s=9007199254740991,u="[object Arguments]",c="[object Array]",l="[object Boolean]",f="[object Date]",p="[object Error]",d="[object Function]",y="[object GeneratorFunction]",v="[object Map]",h="[object Number]",g="[object Object]",m="[object Promise]",_="[object RegExp]",b="[object Set]",w="[object String]",C="[object Symbol]",O="[object WeakMap]",j="[object ArrayBuffer]",A="[object DataView]",S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/,I=/^\./,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,F=/\\(\\)?/g,D=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,P={};P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P[u]=P[c]=P[j]=P[l]=P[A]=P[f]=P[p]=P[d]=P[v]=P[h]=P[g]=P[_]=P[b]=P[w]=P[O]=!1;var R="object"==o(E)&&E&&E.Object===Object&&E,T="object"==("undefined"==typeof self?"undefined":o(self))&&self&&self.Object===Object&&self,U=R||T||Function("return this")(),N=t&&!t.nodeType&&t,L=N&&e&&!e.nodeType&&e,M=L&&L.exports===N&&R.process,B=function(){try{return M&&M.binding("util")}catch(e){}}(),G=B&&B.isTypedArray;function V(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}function q(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}function $(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}function W(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function Y(e,t){return function(r){return e(t(r))}}function H(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var J,z=Array.prototype,Z=Function.prototype,Q=Object.prototype,X=U["__core-js_shared__"],ee=(J=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+J:"",te=Z.toString,re=Q.hasOwnProperty,ne=Q.toString,oe=RegExp("^"+te.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ie=U.Symbol,ae=U.Uint8Array,se=Y(Object.getPrototypeOf,Object),ue=Q.propertyIsEnumerable,ce=z.splice,le=Object.getOwnPropertySymbols,fe=Y(Object.keys,Object),pe=Ve(U,"DataView"),de=Ve(U,"Map"),ye=Ve(U,"Promise"),ve=Ve(U,"Set"),he=Ve(U,"WeakMap"),ge=Ve(Object,"create"),me=et(pe),_e=et(de),be=et(ye),we=et(ve),Ce=et(he),Oe=ie?ie.prototype:void 0,je=Oe?Oe.valueOf:void 0,Ae=Oe?Oe.toString:void 0;function Ee(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Se(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ke(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ie(e){var t=-1,r=e?e.length:0;for(this.__data__=new ke;++t<r;)this.add(e[t])}function Ke(e){this.__data__=new Se(e)}function Fe(e,t){var r=ot(e)||nt(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,o=!!n;for(var i in e)!t&&!re.call(e,i)||o&&("length"==i||Ye(i,n))||r.push(i);return r}function De(e,t){for(var r=e.length;r--;)if(rt(e[r][0],t))return r;return-1}function xe(e,t){for(var r=0,n=(t=He(t,e)?[t]:Le(t)).length;null!=e&&r<n;)e=e[Xe(t[r++])];return r&&r==n?e:void 0}function Pe(e,t){return null!=e&&t in Object(e)}function Re(e,t,r,o,a){return e===t||(null==e||null==t||!ut(e)&&!ct(t)?e!=e&&t!=t:function(e,t,r,o,a,s){var d=ot(e),y=ot(t),m=c,O=c;d||(m=(m=We(e))==u?g:m);y||(O=(O=We(t))==u?g:O);var E=m==g&&!$(e),S=O==g&&!$(t),k=m==O;if(k&&!E)return s||(s=new Ke),d||pt(e)?Me(e,t,r,o,a,s):function(e,t,r,o,a,s,u){switch(r){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j:return!(e.byteLength!=t.byteLength||!o(new ae(e),new ae(t)));case l:case f:case h:return rt(+e,+t);case p:return e.name==t.name&&e.message==t.message;case _:case w:return e==t+"";case v:var c=W;case b:var d=s&i;if(c||(c=H),e.size!=t.size&&!d)return!1;var y=u.get(e);if(y)return y==t;s|=n,u.set(e,t);var g=Me(c(e),c(t),o,a,s,u);return u.delete(e),g;case C:if(je)return je.call(e)==je.call(t)}return!1}(e,t,m,r,o,a,s);if(!(a&i)){var I=E&&re.call(e,"__wrapped__"),K=S&&re.call(t,"__wrapped__");if(I||K){var F=I?e.value():e,D=K?t.value():t;return s||(s=new Ke),r(F,D,o,a,s)}}if(!k)return!1;return s||(s=new Ke),function(e,t,r,n,o,a){var s=o&i,u=dt(e),c=u.length,l=dt(t),f=l.length;if(c!=f&&!s)return!1;var p=c;for(;p--;){var d=u[p];if(!(s?d in t:re.call(t,d)))return!1}var y=a.get(e);if(y&&a.get(t))return y==t;var v=!0;a.set(e,t),a.set(t,e);var h=s;for(;++p<c;){var g=e[d=u[p]],m=t[d];if(n)var _=s?n(m,g,d,t,e,a):n(g,m,d,e,t,a);if(!(void 0===_?g===m||r(g,m,n,o,a):_)){v=!1;break}h||(h="constructor"==d)}if(v&&!h){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(v=!1)}return a.delete(e),a.delete(t),v}(e,t,r,o,a,s)}(e,t,Re,r,o,a))}function Te(e){return!(!ut(e)||(t=e,ee&&ee in t))&&(at(e)||$(e)?oe:D).test(et(e));var t}function Ue(e){return"function"==typeof e?e:null==e?vt:"object"==o(e)?ot(e)?function(e,t){if(He(e)&&ze(t))return Ze(Xe(e),t);return function(r){var o=function(e,t,r){var n=null==e?void 0:xe(e,t);return void 0===n?r:n}(r,e);return void 0===o&&o===t?function(e,t){return null!=e&&function(e,t,r){t=He(t,e)?[t]:Le(t);var n,o=-1,i=t.length;for(;++o<i;){var a=Xe(t[o]);if(!(n=null!=e&&r(e,a)))break;e=e[a]}if(n)return n;i=e?e.length:0;return!!i&&st(i)&&Ye(a,i)&&(ot(e)||nt(e))}(e,t,Pe)}(r,e):Re(t,o,void 0,n|i)}}(e[0],e[1]):function(e){var t=function(e){var t=dt(e),r=t.length;for(;r--;){var n=t[r],o=e[n];t[r]=[n,o,ze(o)]}return t}(e);if(1==t.length&&t[0][2])return Ze(t[0][0],t[0][1]);return function(r){return r===e||function(e,t,r,o){var a=r.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=r[a];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var l=(c=r[a])[0],f=e[l],p=c[1];if(u&&c[2]){if(void 0===f&&!(l in e))return!1}else{var d=new Ke;if(o)var y=o(f,p,l,e,t,d);if(!(void 0===y?Re(p,f,o,n|i,d):y))return!1}}return!0}(r,e,t)}}(e):He(t=e)?(r=Xe(t),function(e){return null==e?void 0:e[r]}):function(e){return function(t){return xe(t,e)}}(t);var t,r}function Ne(e){if(!ut(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Je(e),r=[];for(var n in e)("constructor"!=n||!t&&re.call(e,n))&&r.push(n);return r}function Le(e){return ot(e)?e:Qe(e)}function Me(e,t,r,o,a,s){var u=a&i,c=e.length,l=t.length;if(c!=l&&!(u&&l>c))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var p=-1,d=!0,y=a&n?new Ie:void 0;for(s.set(e,t),s.set(t,e);++p<c;){var v=e[p],h=t[p];if(o)var g=u?o(h,v,p,t,e,s):o(v,h,p,e,t,s);if(void 0!==g){if(g)continue;d=!1;break}if(y){if(!q(t,(function(e,t){if(!y.has(t)&&(v===e||r(v,e,o,a,s)))return y.add(t)}))){d=!1;break}}else if(v!==h&&!r(v,h,o,a,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function Be(e){return function(e,t,r){var n=t(e);return ot(e)?n:V(n,r(e))}(e,yt,$e)}function Ge(e,t){var r=e.__data__;return function(e){var t=o(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function Ve(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return Te(r)?r:void 0}Ee.prototype.clear=function(){this.__data__=ge?ge(null):{}},Ee.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ee.prototype.get=function(e){var t=this.__data__;if(ge){var n=t[e];return n===r?void 0:n}return re.call(t,e)?t[e]:void 0},Ee.prototype.has=function(e){var t=this.__data__;return ge?void 0!==t[e]:re.call(t,e)},Ee.prototype.set=function(e,t){return this.__data__[e]=ge&&void 0===t?r:t,this},Se.prototype.clear=function(){this.__data__=[]},Se.prototype.delete=function(e){var t=this.__data__,r=De(t,e);return!(r<0)&&(r==t.length-1?t.pop():ce.call(t,r,1),!0)},Se.prototype.get=function(e){var t=this.__data__,r=De(t,e);return r<0?void 0:t[r][1]},Se.prototype.has=function(e){return De(this.__data__,e)>-1},Se.prototype.set=function(e,t){var r=this.__data__,n=De(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ke.prototype.clear=function(){this.__data__={hash:new Ee,map:new(de||Se),string:new Ee}},ke.prototype.delete=function(e){return Ge(this,e).delete(e)},ke.prototype.get=function(e){return Ge(this,e).get(e)},ke.prototype.has=function(e){return Ge(this,e).has(e)},ke.prototype.set=function(e,t){return Ge(this,e).set(e,t),this},Ie.prototype.add=Ie.prototype.push=function(e){return this.__data__.set(e,r),this},Ie.prototype.has=function(e){return this.__data__.has(e)},Ke.prototype.clear=function(){this.__data__=new Se},Ke.prototype.delete=function(e){return this.__data__.delete(e)},Ke.prototype.get=function(e){return this.__data__.get(e)},Ke.prototype.has=function(e){return this.__data__.has(e)},Ke.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Se){var n=r.__data__;if(!de||n.length<199)return n.push([e,t]),this;r=this.__data__=new ke(n)}return r.set(e,t),this};var qe=le?Y(le,Object):ht,$e=le?function(e){for(var t=[];e;)V(t,qe(e)),e=se(e);return t}:ht,We=function(e){return ne.call(e)};function Ye(e,t){return!!(t=null==t?s:t)&&("number"==typeof e||x.test(e))&&e>-1&&e%1==0&&e<t}function He(e,t){if(ot(e))return!1;var r=o(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!lt(e))||(k.test(e)||!S.test(e)||null!=t&&e in Object(t))}function Je(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Q)}function ze(e){return e==e&&!ut(e)}function Ze(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}(pe&&We(new pe(new ArrayBuffer(1)))!=A||de&&We(new de)!=v||ye&&We(ye.resolve())!=m||ve&&We(new ve)!=b||he&&We(new he)!=O)&&(We=function(e){var t=ne.call(e),r=t==g?e.constructor:void 0,n=r?et(r):void 0;if(n)switch(n){case me:return A;case _e:return v;case be:return m;case we:return b;case Ce:return O}return t});var Qe=tt((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(lt(e))return Ae?Ae.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var r=[];return I.test(e)&&r.push(""),e.replace(K,(function(e,t,n,o){r.push(n?o.replace(F,"$1"):t||e)})),r}));function Xe(e){if("string"==typeof e||lt(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function et(e){if(null!=e){try{return te.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function tt(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a),a};return r.cache=new(tt.Cache||ke),r}function rt(e,t){return e===t||e!=e&&t!=t}function nt(e){return function(e){return ct(e)&&it(e)}(e)&&re.call(e,"callee")&&(!ue.call(e,"callee")||ne.call(e)==u)}tt.Cache=ke;var ot=Array.isArray;function it(e){return null!=e&&st(e.length)&&!at(e)}function at(e){var t=ut(e)?ne.call(e):"";return t==d||t==y}function st(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function ut(e){var t=o(e);return!!e&&("object"==t||"function"==t)}function ct(e){return!!e&&"object"==o(e)}function lt(e){return"symbol"==o(e)||ct(e)&&ne.call(e)==C}var ft,pt=G?(ft=G,function(e){return ft(e)}):function(e){return ct(e)&&st(e.length)&&!!P[ne.call(e)]};function dt(e){return it(e)?Fe(e):function(e){if(!Je(e))return fe(e);var t=[];for(var r in Object(e))re.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}function yt(e){return it(e)?Fe(e,!0):Ne(e)}function vt(e){return e}function ht(){return[]}e.exports=function(e,t){return null==e?{}:function(e,t,r){for(var n=-1,o=t.length,i={};++n<o;){var a=t[n],s=e[a];r(s,a)&&(i[a]=s)}return i}(e,Be(e),Ue(t))}}(Ue,Ue.exports);var Ne=1/0,Le="[object Symbol]",Me="object"==o(E)&&E&&E.Object===Object&&E,Be="object"==("undefined"==typeof self?"undefined":o(self))&&self&&self.Object===Object&&self,Ge=Me||Be||Function("return this")(),Ve=Object.prototype.toString,qe=Ge.Symbol,$e=qe?qe.prototype:void 0,We=$e?$e.toString:void 0;function Ye(e){if("string"==typeof e)return e;if(function(e){return"symbol"==o(e)||function(e){return!!e&&"object"==o(e)}(e)&&Ve.call(e)==Le}(e))return We?We.call(e):"";var t=e+"";return"0"==t&&1/e==-Ne?"-0":t}var He=S((function(e){return null==e?"":Ye(e)}));function Je(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal",o={};return function e(i,a){var s,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(u.has(i))o[a]="[Circular Reference]";else{if(u.add(i),Object(i)!==i)o[a]=i;else if(Array.isArray(i)){for(s=0,t=i.length;s<t;s+=1)e(i[s],"strict"===n?"".concat(a).concat(r).concat(s):"".concat(a,"[").concat(s,"]"),u);0===t&&(o[a]=[])}else{var c=!0;Object.keys(i).forEach((function(t){c=!1,e(i[t],a?"".concat(a).concat(r).concat(t):t,u)})),c&&a&&(o[a]={})}u.delete(i)}}(e,""),o}var ze=new ve(A),Ze=function(e){return e.split(".").pop()},Qe=function(e){var t={};return"object"!==o(e)||Array.isArray(e)?e:(Object.keys(e).forEach((function(r){var n=e[r];("items"===r||"object"!==o(n)&&!function(e){return Te(He(e).trim())}(n))&&(t[r]=n)})),t)},Xe=function(e,t,r){var n={};return n=Ke(e,n,t,r),w(n)||(n=Je(n,"_","strict")),n},et=function(e){var t=[],n=e.properties,i=null==n?void 0:n.products,a=!1;return"object"!==o(i)||Array.isArray(i)||(a=!0,i=[i]),Array.isArray(i)&&i.forEach((function(n,o){var i=Pe(n,ge),s=Ke(e,{},a?["properties.products"]:["properties.products.".concat(o)],he);w(s)||(i=Qe(r(r({},i),Je(s,"_","strict")))),w(i)||t.push(i)})),t},tt=function(e){var t=e.properties,r=[];if(t&&Object.keys(t).length>0){var n=Pe(t,ge);w(n)||r.push(n)}return r},rt=function(e,t){var n=t.event,o=t.mapping,i=Pe(e,o);if(Array.isArray(o)&&o.length>0&&o.some((function(e){return!(i[e.destKey]||!e.required)&&(ze.error("Missing required value from ".concat(JSON.stringify(e.sourceKeys))),!0)})))return null;var a=function(e,t){var r=t.itemList,n=t.item,o=[],i=!1;return r&&n?(o=et(e))&&o.length>0||(i=!0,o=tt(e)):n?(i=!0,o=tt(e)):r&&(o=et(e)),{items:o,mapRootLevelPropertiesToGA4ItemsArray:i}}(e,t),s=a.items,u=function(e,t,r){var n=t.reduce((function(e,t){var r=t.sourceKeys;return"string"==typeof r?e.push(Ze(r)):Array.isArray(r)&&r.forEach((function(t){"string"==typeof t&&e.push(Ze(t))})),e}),[]);return n.push("products"),e&&be.includes(r)&&(n=n.concat(he)),n}(a.mapRootLevelPropertiesToGA4ItemsArray,o,n),c=Xe(e,["properties"],u);return s.length>0&&(i.items=s),w(c)||(i=r(r({},i),c)),i},nt=function(e,t){var r=_e["".concat(t.toUpperCase())],n=r?rt(e,r):function(e){return Xe(e,["properties"],[])}(e);return n?{params:Qe(n),event:r?r.event:t}:null},ot=new ve(A),it=function(){function e(t,r,n){var o;i(this,e),r.logLevel&&ot.setLogLevel(r.logLevel),this.name=j,this.clientId="",this.sessionId="",this.sessionNumber="",this.cookie=de,this.sendUserId=!0,this.analytics=r,this.measurementId=t.measurementId,this.debugView=t.debugView||!1,this.capturePageView=t.capturePageView||"rs",this.isHybridModeEnabled="hybrid"===t.connectionMode,this.piiPropertiesToIgnore=t.piiPropertiesToIgnore||[],this.extendPageViewParams=t.extendPageViewParams||!1,this.overrideClientAndSessionId=t.overrideClientAndSessionId||!1,this.sdkBaseUrl=((o=t.sdkBaseUrl)&&o.endsWith("/")?o.replace(/\/+$/,""):o)||"https://www.googletagmanager.com";var a=null!=n?n:{};this.shouldApplyDeviceModeTransformation=a.shouldApplyDeviceModeTransformation,this.propagateEventsUntransformedOnError=a.propagateEventsUntransformedOnError,this.destinationId=a.destinationId}return s(e,[{key:"loadScript",value:function(e,t){var r=this;window.dataLayer=window.dataLayer||[],window.gtag=window.gtag||function(){window.dataLayer.push(arguments)},window.gtag("js",new Date);var n,o,i,a={};if("rs"===this.capturePageView&&(a.send_page_view=!1),this.sendUserId=(n=this.analytics.loadOnlyIntegrations,null===(o=null==n||null===(i=n.GA4)||void 0===i?void 0:i.sendUserId)||void 0===o||o),this.sendUserId&&this.analytics.getUserId()&&(a.user_id=this.analytics.getUserId()),this.isHybridModeEnabled&&this.overrideClientAndSessionId)a.cookie_prefix="rs",a.client_id=this.analytics.getAnonymousId(),a.session_id=this.analytics.getSessionId();else{var s=this.cookie.get("rs_ga"),u=this.cookie.get("_ga"),c=this.measurementId.split("-"),l=this.cookie.get("rs_ga_".concat(c[1]));if(!u&&s&&l){var f=s.split("."),p=f.length>3?"".concat(f[2],".").concat(f[3]):f[2],d=l.split(".")[2];p&&(a.client_id=p),d&&(a.session_id=d)}this.cookie.remove("rs_ga"),this.cookie.remove("rs_ga_".concat(c[1]))}this.debugView&&(a.debug_mode=!0),0===Object.keys(a).length?window.gtag("config",e):window.gtag("config",e,a),window.gtag("get",this.measurementId,"session_id",(function(e){r.sessionId=e})),window.gtag("get",this.measurementId,"client_id",(function(e){r.clientId=e})),window.gtag("get",this.measurementId,"session_number",(function(e){r.sessionNumber=e})),function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{if(document.getElementById(e))return;var n=document.createElement("script");n.src=t,n.async=void 0===r.async||r.async,n.type="text/javascript",n.id=e,!0!==r.skipDatasetAttributes&&(n.setAttribute("data-loader",g),void 0!==r.isNonNativeSDK&&n.setAttribute("data-isNonNativeSDK",r.isNonNativeSDK));var o=document.getElementsByTagName("head");if(o.length>0)o[0].insertBefore(n,o[0].firstChild);else{var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i)}}catch(i){O(i)}}("google-analytics 4","".concat(t,"/gtag/js?id=").concat(e))}},{key:"init",value:function(){this.loadScript(this.measurementId,this.sdkBaseUrl)}},{key:"isLoaded",value:function(){return!(!this.sessionId||!this.clientId)}},{key:"isReady",value:function(){return this.isLoaded()}},{key:"identify",value:function(e){var t=e.message,n=t.context.traits,o=function(e,t){var n=[],o={},i=t,a={};return e.length>0&&e.forEach((function(e){"string"==typeof e.piiProperty&&""!==e.piiProperty.trim()&&n.push(e.piiProperty.trim())})),Object.keys(i).forEach((function(e){var t=i[e];n.includes(e)?o[e]=null:a[e]=t})),r(r({},o),a)}(this.piiPropertiesToIgnore,n);if(Object.keys(o).length>0&&window.gtag("set","user_properties",o),this.sendUserId&&t.userId){var i=t.userId;window.gtag("config",this.measurementId,{user_id:i})}}},{key:"track",value:function(e){if(!this.isHybridModeEnabled){var t=e.message,r=function(e){if(!e||"string"!=typeof e)return ze.error("Event name is required and should be a string"),null;var t=e.trim().replace(/\s+/g,"_");return["click","error","scroll","form_start","form_submit","first_open","first_visit","app_remove","video_start","session_start","view_complete","file_download","video_progress","user_engagement","in_app_purchase","app_store_refund","app_store_subscription_cancel","app_store_subscription_renew"].includes(t)?(ze.error("Reserved event name ".concat(t," is not allowed")),null):t}(null==t?void 0:t.event);if(r){var n=nt(t,r);if(n){var o=n.params,i=n.event,a=this.addSendToAndMeasurementIdToPayload(o,e);window.gtag("event",i,a)}}else ot.error("Event name is required")}}},{key:"page",value:function(e){if("rs"===this.capturePageView){var t=e.message,n=t.properties,o=Pe(t,_e.PAGE.mapping);o=this.addSendToAndMeasurementIdToPayload(o,e),this.extendPageViewParams?window.gtag("event","page_view",r(r({},Ie(n)),o)):window.gtag("event","page_view",o)}}},{key:"group",value:function(e){if(!this.isHybridModeEnabled){var t=e.message,n=t.groupId,o=t.traits,i=r({group_id:n},o=this.addSendToAndMeasurementIdToPayload(o,e));window.gtag("event","join_group",i)}}},{key:"addSendToAndMeasurementIdToPayload",value:function(e,t){var r=t.message.userId,n=e;return n.send_to=this.measurementId,this.sendUserId&&r&&(n.user_id=r),n}},{key:"getDataForIntegrationsObject",value:function(){return u({},A,{clientId:this.clientId,sessionId:this.sessionId,sessionNumber:this.sessionNumber})}}]),e}();return e.GA4=it,e}({});
//# sourceMappingURL=GA4.min.js.map