PageSourceSearch

https://fluentu.com/public/js/bundles/analyticsHandler.8b82908fd8fa7aa41d50.js

js fluentu.com collected 2026-09-24 08:32:16 UTC 192,640 bytes, 2 lines download raw bytes

vendor: 4,527 bytes, lines 1-2
1/*! For license information please see analyticsHandler.8b82908fd8fa7aa41d50.js.LICENSE.txt */
2var analyticsHandler;(()=>{var e={8165(e,t,r){"use strict";var n=r(9138),o=r(6095),i=r(4531),s=r(7196);e.exports=s||n.call(i,o)},6095(e){"use strict";e.exports=Function.prototype.apply},4531(e){"use strict";e.exports=Function.prototype.call},9903(e,t,r){"use strict";var n=r(9138),o=r(3468),i=r(4531),s=r(8165);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return s(n,i,e)}},7196(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},4607(e,t,r){"use strict";var n=r(528),o=r(9903),i=o([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o([r]):r}},6423(e,t,r){"use strict";var n,o=r(9903),i=r(9336);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!n&&i&&i(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?o([s.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},4940(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},9110(e){"use strict";e.exports=EvalError},9838(e){"use strict";e.exports=Error},1155(e){"use strict";e.exports=RangeError},4943(e){"use strict";e.exports=ReferenceError},5731(e){"use strict";e.exports=SyntaxError},3468(e){"use strict";e.exports=TypeError},2140(e){"use strict";e.exports=URIError},9629(e){"use strict";e.exports=Object},8794(e){"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,s=function(e,t){for(var r=[],n=t||0,o=0;n<e.length;n+=1,o+=1)r[o]=e[n];return r}(arguments,1),a=r(0,o.length-s.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,n(s,arguments));return Object(t)===t?t:this}return o.apply(e,n(s,arguments))}),o.prototype){var u=function(){};u.prototype=o.prototype,i.prototype=new u,u.prototype=null}return i}},9138(e,t,r){"use strict";var n=r(8794);e.exports=Function.prototype.bind||n},528(e,t,r){"use strict";var n,o=r(9629),i=r(9838),s=r(9110),a=r(1155),l=r(4943),c=r(5731),u=r(3468),d=r(2140),p=r(8479),f=r(8449),h=r(8129),g=r(2387),y=r(5865),v=r(1319),m=r(6882),b=Function,S=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},E=r(9336),w=r(4940),A=function(){throw new u},I=E?function(){try{return A}catch(e){try{return E(arguments,"callee").get}catch(e){return A}}}():A,k=r(3558)(),T=r(6369),O=r(7345),P=r(7859),C=r(6095),_=r(4531),D={},x="undefined"!=typeof Uint8Array&&T?T(Uint8Array):n,R={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":k&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":D,"%AsyncGenerator%":D,"%AsyncGeneratorFunction%":D,"%AsyncIteratorPrototype%":D,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":D,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
2IteratorPrototype%":k&&T?T(T([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&T?T((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&T?T((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&T?T(""[Symbol.iterator]()):n,"%Symbol%":k?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":I,"%TypedArray%":x,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":_,"%Function.prototype.apply%":C,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":O,"%Math.abs%":p,"%Math.floor%":f,"%Math.max%":h,"%Math.min%":g,"%Math.pow%":y,"%Math.round%":v,"%Math.sign%":m,"%Reflect.getPrototypeOf%":P};if(T)try{null.error}catch(e){var j=T(T(e));R["%Error.prototype%"]=j}var $=function e(t){var r;if("%AsyncFunction%"===t)r=S("async function () {}");else if("%GeneratorFunction%"===t)r=S("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=S("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&T&&(r=T(o.prototype))}return R[t]=r,r},L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},N=r(9138),M=r(8554),U=N.call(_,Array.prototype.concat),B=N.call(C,Array.prototype.splice),F=N.call(_,String.prototype.replace),G=N.call(_,String.prototype.slice),H=N.call(_,RegExp.prototype.exec),K=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,V=function(e,t){var r,n=e;if(M(L,n)&&(n="%"+(r=L[n])[0]+"%"),M(R,n)){var o=R[n];if(o===D&&(o=$(n)),void 0===o&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=G(e,0,1),r=G(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return F(e,K,function(e,t,r,o){n[n.length]=r?F(o,W,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",o=V("%"+n+"%",t),i=o.name,s=o.value,a=!1,l=o.alias;l&&(n=l[0],B(r,U([0,1],l)));for(var d=1,p=!0;d<r.length;d+=1){var f=r[d],h=G(f,0,1),g=G(f,-1);if(('"'===h||"'"===h||"`"===h||'"'===g||"'"===g||"`"===g)&&h!==g)throw new c("property names with quotes must have matching quotes");if("constructor"!==f&&p||(a=!0),M(R,i="%"+(n+="."+f)+"%"))s=R[i];else if(null!=s){if(!(f in s)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(E&&d+1>=r.length){var y=E(s,f);s=(p=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:s[f]}else p=M(s,f),s=s[f];p&&!a&&(R[i]=s)}}return s}},7345(e,t,r){"use strict";var n=r(9629);e.exports=n.getPrototypeOf||null},7859(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},6369(e,t,r){"use strict";var n=r(7859),o=r(7345),i=r(6423);e.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},1292(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},9336(e,t,r){"use strict";var n=r(1292);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},3558(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(2908);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},2908(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},8554(e,t,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(9138);e.exports=i.call(n,o)},8479(e){"use strict";e.exports=Math.abs},8449(e){"use strict";e.exports=Math.floor},2422(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},8129(e){"use strict";e.exports=Math.max},2387(e){"use strict";e.exports=Math.min},5865(e){"use strict";e.exports=Math.pow},1319(e){"use strict";e.exports=Math.round},6882(e,t,r){"use strict";var n=r(2422);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},8660(e,t,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&l&&"function"==typeof l.get?l.get:null,u=a&&Set.prototype.forEach,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,v=String.prototype.match,m=String.prototype.slice,b=String.prototype.replace,S=String.prototype.toUpperCase,E=String.prototype.toLowerCase,w=RegExp.prototype.test,A=Array.prototype.concat,I=Array.prototype.join,k=Array.prototype.slice,T=Math.floor,O="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,_="function"==typeof Symbol&&"object"==typeof Symbol.iterator,D="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===_||"symbol")?Symbol.toStringTag:null,x=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function j(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||w.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-T(-e):T(e);if(n!==e){var o=String(n),i=m.call(t,o.length+1);return b.call(o,r,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,r,"$&_")}var $=r(6973),L=$.custom,N=W(L)?L:null,M={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function B(e,t,r){var n=r.quoteStyle||t,o=M[n];return o+e+o}function F(e){return b.call(String(e),/"/g,"&quot;")}function G(e){return!D||!("object"==typeof e&&(D in e||void 0!==e[D]))}function H(e){return"[object Array]"===z(e)&&G(e)}function K(e){return"[object RegExp]"===z(e)&&G(e)}function W(e){if(_)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;
vendor: 6,573 bytes, line 2
2if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,a){var l=n||{};if(q(l,"quoteStyle")&&!q(M,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var g=!q(l,"customInspect")||l.customInspect;if("boolean"!=typeof g&&"symbol"!==g)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var S=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return J(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return S?j(t,w):w}if("bigint"==typeof t){var T=String(t)+"n";return S?j(t,T):T}var P=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof t)return H(t)?"[Array]":"[Object]";var L=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=I.call(Array(e.indent+1)," ")}return{base:r,prev:I.call(Array(t+1),r)}}(l,o);if(void 0===a)a=[];else if(Q(a,t)>=0)return"[Circular]";function U(t,r,n){if(r&&(a=k.call(a)).push(r),n){var i={depth:l.depth};return q(l,"quoteStyle")&&(i.quoteStyle=l.quoteStyle),e(t,i,o+1,a)}return e(t,l,o+1,a)}if("function"==typeof t&&!K(t)){var V=function(e){if(e.name)return e.name;var t=v.call(y.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),X=re(t,U);return"[Function"+(V?": "+V:" (anonymous)")+"]"+(X.length>0?" { "+I.call(X,", ")+" }":"")}if(W(t)){var ne=_?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(t);return"object"!=typeof t||_?ne:Y(ne)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var oe="<"+E.call(String(t.nodeName)),ie=t.attributes||[],se=0;se<ie.length;se++)oe+=" "+ie[se].name+"="+B(F(ie[se].value),"double",l);return oe+=">",t.childNodes&&t.childNodes.length&&(oe+="..."),oe+="</"+E.call(String(t.nodeName))+">"}if(H(t)){if(0===t.length)return"[]";var ae=re(t,U);return L&&!function(e){for(var t=0;t<e.length;t++)if(Q(e[t],"\n")>=0)return!1;return!0}(ae)?"["+te(ae,L)+"]":"[ "+I.call(ae,", ")+" ]"}if(function(e){return"[object Error]"===z(e)&&G(e)}(t)){var le=re(t,U);return"cause"in Error.prototype||!("cause"in t)||x.call(t,"cause")?0===le.length?"["+String(t)+"]":"{ ["+String(t)+"] "+I.call(le,", ")+" }":"{ ["+String(t)+"] "+I.call(A.call("[cause]: "+U(t.cause),le),", ")+" }"}if("object"==typeof t&&g){if(N&&"function"==typeof t[N]&&$)return $(t,{depth:P-o});if("symbol"!==g&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ce=[];return s&&s.call(t,function(e,r){ce.push(U(r,t,!0)+" => "+U(e,t))}),ee("Map",i.call(t),ce,L)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ue=[];return u&&u.call(t,function(e){ue.push(U(e,t))}),ee("Set",c.call(t),ue,L)}if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Z("WeakMap");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Z("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return Z("WeakRef");if(function(e){return"[object Number]"===z(e)&&G(e)}(t))return Y(U(Number(t)));if(function(e){if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}(t))return Y(U(O.call(t)));if(function(e){return"[object Boolean]"===z(e)&&G(e)}(t))return Y(h.call(t));if(function(e){return"[object String]"===z(e)&&G(e)}(t))return Y(U(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===z(e)&&G(e)}(t)&&!K(t)){var de=re(t,U),pe=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,fe=t instanceof Object?"":"null prototype",he=!pe&&D&&Object(t)===t&&D in t?m.call(z(t),8,-1):fe?"Object":"",ge=(pe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||fe?"["+I.call(A.call([],he||[],fe||[]),": ")+"] ":"");return 0===de.length?ge+"{}":L?ge+"{"+te(de,L)+"}":ge+"{ "+I.call(de,", ")+" }"}return String(t)};var V=Object.prototype.hasOwnProperty||function(e){return e in this};function q(e,t){return V.call(e,t)}function z(e){return g.call(e)}function Q(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function J(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return J(m.call(e,0,t.maxStringLength),t)+n}var o=U[t.quoteStyle||"single"];return o.lastIndex=0,B(b.call(b.call(e,o,"\\$1"),/[\x00-\x1f]/g,X),"single",t)}function X(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+S.call(t.toString(16))}function Y(e){return"Object("+e+")"}function Z(e){return e+" { ? }"}function ee(e,t,r,n){return e+" ("+t+") {"+(n?te(r,n):I.call(r,", "))+"}"}function te(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+I.call(e,","+r)+"\n"+t.prev}function re(e,t){var r=H(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=q(e,o)?t(e[o],e):""}var i,s="function"==typeof P?P(e):[];if(_){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var l in e)q(e,l)&&(r&&String(Number(l))===l&&l<e.length||_&&i["$"+l]instanceof Symbol||(w.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof P)for(var c=0;c<s.length;
2c++)x.call(e,s[c])&&n.push("["+t(s[c])+"]: "+t(e[s[c]],e));return n}},4826(e,t,r){"use strict";r.r(t),r.d(t,{ucs2decode:()=>f});const n=2147483647,o=36,i=/^xn--/,s=/[^\0-\x7F]/,a=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=Math.floor,u=String.fromCharCode;function d(e){throw new RangeError(l[e])}function p(e,t){const r=e.split("@");let n="";r.length>1&&(n=r[0]+"@",e=r[1]);const o=function(e,t){const r=[];let n=e.length;for(;n--;)r[n]=t(e[n]);return r}((e=e.replace(a,".")).split("."),t).join(".");return n+o}function f(e){const t=[];let r=0;const n=e.length;for(;r<n;){const o=e.charCodeAt(r++);if(o>=55296&&o<=56319&&r<n){const n=e.charCodeAt(r++);56320==(64512&n)?t.push(((1023&o)<<10)+(1023&n)+65536):(t.push(o),r--)}else t.push(o)}return t}const h=e=>String.fromCodePoint(...e),g=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:o},y=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},v=function(e,t,r){let n=0;for(e=r?c(e/700):e>>1,e+=c(e/t);e>455;n+=o)e=c(e/35);return c(n+36*e/(e+38))},m=function(e){const t=[],r=e.length;let i=0,s=128,a=72,l=e.lastIndexOf("-");l<0&&(l=0);for(let r=0;r<l;++r)e.charCodeAt(r)>=128&&d("not-basic"),t.push(e.charCodeAt(r));for(let u=l>0?l+1:0;u<r;){const l=i;for(let t=1,s=o;;s+=o){u>=r&&d("invalid-input");const l=g(e.charCodeAt(u++));l>=o&&d("invalid-input"),l>c((n-i)/t)&&d("overflow"),i+=l*t;const p=s<=a?1:s>=a+26?26:s-a;if(l<p)break;const f=o-p;t>c(n/f)&&d("overflow"),t*=f}const p=t.length+1;a=v(i-l,p,0==l),c(i/p)>n-s&&d("overflow"),s+=c(i/p),i%=p,t.splice(i++,0,s)}return String.fromCodePoint(...t)},b=function(e){const t=[],r=(e=f(e)).length;let i=128,s=0,a=72;for(const r of e)r<128&&t.push(u(r));const l=t.length;let p=l;for(l&&t.push("-");p<r;){let r=n;for(const t of e)t>=i&&t<r&&(r=t);const f=p+1;r-i>c((n-s)/f)&&d("overflow"),s+=(r-i)*f,i=r;for(const r of e)if(r<i&&++s>n&&d("overflow"),r===i){let e=s;for(let r=o;;r+=o){const n=r<=a?1:r>=a+26?26:r-a;if(e<n)break;const i=e-n,s=o-n;t.push(u(y(n+i%s,0))),e=c(i/s)}t.push(u(y(e,0))),a=v(s,f,p===l),s=0,++p}++s,++i}return t.join("")},S=function(e){return p(e,function(e){return i.test(e)?m(e.slice(4).toLowerCase()):e})},E=function(e){return p(e,function(e){return s.test(e)?"xn--"+b(e):e})},w={version:"2.3.1",ucs2:{decode:f,encode:h},decode:m,encode:b,toASCII:E,toUnicode:S};r.d(t,["decode",0,m,"default",0,w,"encode",0,b,"toASCII",0,E,"toUnicode",0,S,"ucs2encode",0,h])},1830(e){"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC1738",o="RFC3986";e.exports={default:o,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:n,RFC3986:o}},5810(e,t,r){"use strict";var n=r(6623),o=r(6193),i=r(1830);e.exports={formats:i,parse:o,stringify:n}},6193(e,t,r){"use strict";var n=r(1539),o=Object.prototype.hasOwnProperty,i=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},l=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},c=function(e,t,r,i){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(s),u=c?s.slice(0,c.index):s,d=[];if(u){if(!r.plainObjects&&o.call(Object.prototype,u)&&!r.allowPrototypes)return;d.push(u)}for(var p=0;r.depth>0&&null!==(c=a.exec(s))&&p<r.depth;){if(p+=1,!r.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;d.push(c[1])}
2if(c){if(!0===r.strictDepth)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");d.push("["+s.slice(c.index)+"]")}return function(e,t,r,o){var i=0;if(e.length>0&&"[]"===e[e.length-1]){var s=e.slice(0,-1).join("");i=Array.isArray(t)&&t[s]?t[s].length:0}for(var a=o?t:l(t,r,i),c=e.length-1;c>=0;--c){var u,d=e[c];if("[]"===d&&r.parseArrays)u=r.allowEmptyArrays&&(""===a||r.strictNullHandling&&null===a)?[]:n.combine([],a);else{u=r.plainObjects?{__proto__:null}:{};var p="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,f=r.decodeDotInKeys?p.replace(/%2E/g,"."):p,h=parseInt(f,10);r.parseArrays||""!==f?!isNaN(h)&&d!==f&&String(h)===f&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(u=[])[h]=a:"__proto__"!==f&&(u[f]=a):u={0:a}}a=u}return a}(d,t,r,i)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?s.charset:e.charset,r=void 0===e.duplicates?s.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||s.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:s.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:s.strictDepth,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var u="string"==typeof e?function(e,t){var r={__proto__:null},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;c=c.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=t.parameterLimit===1/0?void 0:t.parameterLimit,d=c.split(t.delimiter,t.throwOnLimitExceeded?u+1:u);if(t.throwOnLimitExceeded&&d.length>u)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var p,f=-1,h=t.charset;if(t.charsetSentinel)for(p=0;p<d.length;++p)0===d[p].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[p]?h="utf-8":"utf8=%26%2310003%3B"===d[p]&&(h="iso-8859-1"),f=p,p=d.length);for(p=0;p<d.length;++p)if(p!==f){var g,y,v=d[p],m=v.indexOf("]="),b=-1===m?v.indexOf("="):m+1;-1===b?(g=t.decoder(v,s.decoder,h,"key"),y=t.strictNullHandling?null:""):(g=t.decoder(v.slice(0,b),s.decoder,h,"key"),y=n.maybeMap(l(v.slice(b+1),t,i(r[g])?r[g].length:0),function(e){return t.decoder(e,s.decoder,h,"value")}
vendor: 5,008 bytes, line 2
2)),y&&t.interpretNumericEntities&&"iso-8859-1"===h&&(y=a(String(y))),v.indexOf("[]=")>-1&&(y=i(y)?[y]:y);var S=o.call(r,g);S&&"combine"===t.duplicates?r[g]=n.combine(r[g],y):S&&"last"!==t.duplicates||(r[g]=y)}return r}(e,r):e,d=r.plainObjects?{__proto__:null}:{},p=Object.keys(u),f=0;f<p.length;++f){var h=p[f],g=c(h,u[h],r,"string"==typeof e);d=n.merge(d,g,r)}return!0===r.allowSparse?d:n.compact(d)}},6623(e,t,r){"use strict";var n=r(9956),o=r(1539),i=r(1830),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},d=Date.prototype.toISOString,p=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:p,formatter:i.formatters[p],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},h={},g=function e(t,r,i,s,a,c,d,p,g,y,v,m,b,S,E,w,A,I){for(var k,T=t,O=I,P=0,C=!1;void 0!==(O=O.get(h))&&!C;){var _=O.get(t);if(P+=1,void 0!==_){if(_===P)throw new RangeError("Cyclic object value");C=!0}void 0===O.get(h)&&(P=0)}if("function"==typeof y?T=y(r,T):T instanceof Date?T=b(T):"comma"===i&&l(T)&&(T=o.maybeMap(T,function(e){return e instanceof Date?b(e):e})),null===T){if(c)return g&&!w?g(r,f.encoder,A,"key",S):r;T=""}if("string"==typeof(k=T)||"number"==typeof k||"boolean"==typeof k||"symbol"==typeof k||"bigint"==typeof k||o.isBuffer(T))return g?[E(w?r:g(r,f.encoder,A,"key",S))+"="+E(g(T,f.encoder,A,"value",S))]:[E(r)+"="+E(String(T))];var D,x=[];if(void 0===T)return x;if("comma"===i&&l(T))w&&g&&(T=o.maybeMap(T,g)),D=[{value:T.length>0?T.join(",")||null:void 0}];else if(l(y))D=y;else{var R=Object.keys(T);D=v?R.sort(v):R}var j=p?String(r).replace(/\./g,"%2E"):String(r),$=s&&l(T)&&1===T.length?j+"[]":j;if(a&&l(T)&&0===T.length)return $+"[]";for(var L=0;L<D.length;++L){var N=D[L],M="object"==typeof N&&N&&void 0!==N.value?N.value:T[N];if(!d||null!==M){var U=m&&p?String(N).replace(/\./g,"%2E"):String(N),B=l(T)?"function"==typeof i?i($,U):$:$+(m?"."+U:"["+U+"]");I.set(t,P);var F=n();F.set(h,I),u(x,e(M,B,i,s,a,c,d,p,"comma"===i&&w&&l(T)?null:g,y,v,m,b,S,E,w,A,F))}}return x};e.exports=function(e,t){var r,o=e,c=function(e){if(!e)return f;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||f.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n,o=i.formatters[r],c=f.filter;if(("function"==typeof e.filter||l(e.filter))&&(c=e.filter),n=e.arrayFormat in a?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":f.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||f.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:f.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:n,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?f.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:f.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:f.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:f.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:f.encodeValuesOnly,filter:c,format:r,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:f.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:f.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:f.strictNullHandling}}(t);"function"==typeof c.filter?o=(0,c.filter)("",o):l(c.filter)&&(r=c.filter);var d=[];if("object"!=typeof o||null===o)return"";var p=a[c.arrayFormat],h="comma"===p&&c.commaRoundTrip;r||(r=Object.keys(o)),c.sort&&r.sort(c.sort);for(var y=n(),v=0;v<r.length;++v){var m=r[v],b=o[m];c.skipNulls&&null===b||u(d,g(b,m,p,h,c.allowEmptyArrays,c.strictNullHandling,c.skipNulls,c.encodeDotInKeys,c.encode?
2c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,y))}var S=d.join(c.delimiter),E=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),S.length>0?E+S:""}},1539(e,t,r){"use strict";var n=r(1830),o=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},l=1024;e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:s,prop:c}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var c="",u=0;u<a.length;u+=l){for(var d=a.length>=l?a.slice(u,u+l):a,p=[],f=0;f<d.length;++f){var h=d.charCodeAt(f);45===h||46===h||95===h||126===h||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||i===n.RFC1738&&(40===h||41===h)?p[p.length]=d.charAt(f):h<128?p[p.length]=s[h]:h<2048?p[p.length]=s[192|h>>6]+s[128|63&h]:h<55296||h>=57344?p[p.length]=s[224|h>>12]+s[128|h>>6&63]+s[128|63&h]:(f+=1,h=65536+((1023&h)<<10|1023&d.charCodeAt(f)),p[p.length]=s[240|h>>18]+s[128|h>>12&63]+s[128|h>>6&63]+s[128|63&h])}c+=p.join("")}return c},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r&&"function"!=typeof r){if(i(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return i(t)&&!i(r)&&(s=a(t,n)),i(t)&&i(r)?(r.forEach(function(r,i){if(o.call(t,i)){var s=t[i];s&&"object"==typeof s&&r&&"object"==typeof r?t[i]=e(s,r,n):t.push(r)}else t[i]=r}),t):Object.keys(r).reduce(function(t,i){var s=r[i];return o.call(t,i)?t[i]=e(t[i],s,n):t[i]=s,t},s)}}},3346(e,t,r){"use strict";var n=r(8660),o=r(3468),i=function(e,t,r){for(var n,o=e;null!=(n=o.next);o=n)if(n.key===t)return o.next=n.next,r||(n.next=e.next,e.next=n),n};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+n(e))},delete:function(t){var r=e&&e.next,n=function(e,t){if(e)return i(e,t,!0)}(e,t);return n&&r&&r===n&&(e=void 0),!!n},get:function(t){return function(e,t){if(e){var r=i(e,t);return r&&r.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!i(e,t)}(e,t)},set:function(t,r){e||(e={next:void 0}),function(e,t,r){var n=i(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(e,t,r)}};return t}},7004(e,t,r){"use strict";var n=r(528),o=r(4607),i=r(8660),s=r(3468),a=n("%Map%",!0),l=o("Map.prototype.get",!0),c=o("Map.prototype.set",!0),u=o("Map.prototype.has",!0),d=o("Map.prototype.delete",!0),p=o("Map.prototype.size",!0);e.exports=!!a&&function(){var e,t={assert:function(e){if(!t.has(e))throw new s("Side channel does not contain "+i(e))},delete:function(t){if(e){var r=d(e,t);return 0===p(e)&&(e=void 0),r}return!1},get:function(t){if(e)return l(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,r){e||(e=new a),c(e,t,r)}};return t}},6348(e,t,r){"use strict";
2var n=r(528),o=r(4607),i=r(8660),s=r(7004),a=r(3468),l=n("%WeakMap%",!0),c=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),d=o("WeakMap.prototype.has",!0),p=o("WeakMap.prototype.delete",!0);e.exports=l?function(){var e,t,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+i(e))},delete:function(r){if(l&&r&&("object"==typeof r||"function"==typeof r)){if(e)return p(e,r)}else if(s&&t)return t.delete(r);return!1},get:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?c(e,r):t&&t.get(r)},has:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?d(e,r):!!t&&t.has(r)},set:function(r,n){l&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new l),u(e,r,n)):s&&(t||(t=s()),t.set(r,n))}};return r}:s},9956(e,t,r){"use strict";var n=r(3468),o=r(8660),i=r(3346),s=r(7004),a=r(6348)||s||i;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n("Side channel does not contain "+o(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,r){e||(e=a()),e.set(t,r)}};return t}},8811(e,t,r){const n=r(5442),o=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],i=e=>Object.keys(e).filter(e=>o.includes(e)).reduce((t,r)=>(t[r]=e[r],t),{});t.utm=(e,t)=>{const r=n.parse(unescape(e)).query||"";t=t||"&";const o=new RegExp("((utm_[^=]+)=([^\\"+t+"]+))","gi");return(r.match(o)||[]).reduce((e,t)=>{const r=t.split("=");return e[r[0]]=r[1],e},{})||{}},t.strict=(e,r)=>{const n=t.utm(e,r);return i(n)},t.build=(e,t,r)=>{const o=n.parse(unescape(e));return o.search=void 0,o.query=r?i(t):t,n.format(o)}},5442(e,t,r){"use strict";var n=r(4826);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var i=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),u=["%","/","?",";","#"].concat(c),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(5810);function m(e,t,r){if(e&&"object"==typeof e&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var m=e=l.join(s);if(m=m.trim(),!r&&1===e.split("#").length){var b=a.exec(m);if(b)return this.path=m,this.href=m,this.pathname=b[1],b[2]?(this.search=b[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var S=i.exec(m);if(S){var E=(S=S[0]).toLowerCase();this.protocol=E,m=m.substr(S.length)}if(r||S||m.match(/^\/\/[^@/]+@[^@/]+/)){var w="//"===m.substr(0,2);!w||S&&g[S]||(m=m.substr(2),this.slashes=!0)}if(!g[S]&&(w||S&&!y[S])){for(var A,I,k=-1,T=0;T<d.length;T++){-1!==(O=m.indexOf(d[T]))&&(-1===k||O<k)&&(k=O)}-1!==(I=-1===k?m.lastIndexOf("@"):m.lastIndexOf("@",k))&&(A=m.slice(0,I),m=m.slice(I+1),this.auth=decodeURIComponent(A)),k=-1;for(T=0;T<u.length;T++){var O;-1!==(O=m.indexOf(u[T]))&&(-1===k||O<k)&&(k=O)}-1===k&&(k=m.length),this.host=m.slice(0,k),m=m.slice(k),this.parseHost(),this.hostname=this.hostname||"";var P="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!P)for(var C=this.hostname.split(/\./),_=(T=0,C.length);T<_;T++){var D=C[T];if(D&&!D.match(p)){for(var x="",R=0,j=D.length;R<j;R++)D.charCodeAt(R)>127?x+="x":x+=D[R];if(!x.match(p)){var $=C.slice(0,T),L=C.slice(T+1),N=D.match(f);N&&($.push(N[1]),L.unshift(N[2])),L.length&&(m="/"+L.join(".")+m),this.hostname=$.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=n.toASCII(this.hostname));var M=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+M,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==m[0]&&(m="/"+m))}if(!h[E])for(T=0,_=c.length;T<_;T++){var B=c[T];if(-1!==m.indexOf(B)){var F=encodeURIComponent(B);F===B&&(F=escape(B)),m=m.split(B).join(F)}}var G=m.indexOf("#");-1!==G&&(this.hash=m.substr(G),m=m.slice(0,G));var H=m.indexOf("?");if(-1!==H?(this.search=m.substr(H),this.query=m.substr(H+1),t&&(this.query=v.parse(this.query)),m=m.slice(0,H)):t&&(this.search="",this.query={}),m&&(this.pathname=m),y[E]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){M=this.pathname||"";var K=this.search||"";this.path=M+K}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(i=v.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(m(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if("string"==typeof e){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),i=0;i<n.length;i++){var s=n[i];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var c=a[l];"protocol"!==c&&(r[c]=e[c])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!y[e.protocol]){for(var u=Object.keys(e),d=0;d<u.length;d++){var p=u[d];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||g[e.protocol])r.pathname=e.pathname;else{for(var f=(e.pathname||"").split("/");f.length&&!(e.host=f.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),r.pathname=f.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var h=r.pathname||"",v=r.search||"";r.path=h+v}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var m=r.pathname&&"/"===r.pathname.charAt(0),b=e.host||e.pathname&&"/"===e.pathname.charAt(0),S=b||m||r.host&&e.pathname,E=S,w=r.pathname&&r.pathname.split("/")||[],A=(f=e.pathname&&e.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(A&&(r.hostname="",r.port=null,r.host&&(""===w[0]?w[0]=r.host:w.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===f[0]?f[0]=e.host:f.unshift(e.host)),e.host=null),S=S&&(""===f[0]||""===w[0])),b)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,w=f;else if(f.length)w||(w=[]),w.pop(),w=w.concat(f),r.search=e.search,r.query=e.query;else if(null!=e.search){if(A)r.host=w.shift(),r.hostname=r.host,(P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=P.shift(),r.hostname=P.shift(),r.host=r.hostname);return r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var I=w.slice(-1)[0],k=(r.host||e.host||w.length>1)&&("."===I||".."===I)||""===I,T=0,O=w.length;O>=0;O--)"."===(I=w[O])?w.splice(O,1):".."===I?(w.splice(O,1),T++):T&&(w.splice(O,1),T--);if(!S&&!E)for(;T--;T)w.unshift("..");!S||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),k&&"/"!==w.join("/").substr(-1)&&w.push("");var P,C=""===w[0]||w[0]&&"/"===w[0].charAt(0);A&&(r.hostname=C?"":w.length?w.shift():"",r.host=r.hostname,(P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=P.shift(),r.hostname=P.shift(),r.host=r.hostname));return(S=S||r.host&&w.length)&&!C&&w.unshift(""),w.length>0?r.pathname=w.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=m,t.format=function(e){return"string"==typeof e&&(e=m(e)),e instanceof o?e.format():o.prototype.format.call(e)}},6973(){}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var o=t[n++],i=t[n++],s=0===i?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:i};r.o(e,o)||Object.defineProperty(e,o,s)}else for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}
2}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};(()=>{"use strict";var e=function(e){return e.SIGNUP_STARTED="Signup Started",e.LANGUAGE_SELECTED="Language Selected",e.LANGUAGE_SELECTED_SUCCESS="Language Selected Success",e.LEVEL_SELECTED="Level Selected",e.LEVEL_SELECTED_SUCCESS="Level Selected Success",e.AGE_SELECTED="Age Selected",e.AGE_SELECTED_SUCCESS="Age Selected Success",e.SOURCE_SELECTED="How did you hear about us",e.SOURCE_SELECTED_SUCCESS="How did you hear about us Success",e.DAILY_GOAL_SELECTED="Daily Goal",e.DAILY_GOAL_SELECTED_SUCCESS="Daily Goal Success",e.PLAN_SELECTED="Plan Selected",e.PLAN_SELECTED_SUCCESS="Plan Selected Success",e.VIEWED_CHECKOUT_PAGE="Viewed Checkout Page",e.EMAIL_FORM_PAGE="Email-form Page",e.PASSWORD_FORM_PAGE="Password-form Page",e.DOWNLOAD_APP_PAGE="Download App Page",e.PICK_FAVORITE_GENRES="Pick your favorite genres",e.PICK_VIDEO_TO_GET_STARTED="Pick a video to get started",e.VISITED_MARKETING_HOMEPAGE="Visited Marketing Homepage",e.QUICK_WORD_LOOK_UP_IN_FIRST_5_DAYS_OF_TRIAL="Quick Word Lookup in First 5 Days of Trial",e.DETAILED_WORD_LOOK_UP_IN_FIRST_5_DAYS_OF_TRIAL="Detailed Word Lookup in First 5 Days of Trial",e.SIGNUP_EDUCATION_PAGE_SUCCESS="Signup Education Page Success",e}({});function t(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function n(e){return function r(n){return 0===arguments.length||t(n)?r:e.apply(this,arguments)}}function o(e){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return t(o)?r:n(function(t){return e(o,t)});default:return t(o)&&t(i)?r:t(o)?n(function(t){return e(t,i)}):t(i)?n(function(t){return e(o,t)}):e(o,i)}}}function i(e){return function r(i,s,a){switch(arguments.length){case 0:return r;case 1:return t(i)?r:o(function(t,r){return e(i,t,r)});case 2:return t(i)&&t(s)?r:t(i)?o(function(t,r){return e(t,s,r)}):t(s)?o(function(t,r){return e(i,t,r)}):n(function(t){return e(i,s,t)});default:return t(i)&&t(s)&&t(a)?r:t(i)&&t(s)?o(function(t,r){return e(t,r,a)}):t(i)&&t(a)?o(function(t,r){return e(t,s,r)}):t(s)&&t(a)?o(function(t,r){return e(i,t,r)}):t(i)?n(function(t){return e(t,s,a)}):t(s)?n(function(t){return e(i,t,a)}):t(a)?n(function(t){return e(i,s,t)}):e(i,s,a)}}}function s(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var a=n(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function l(e){return"[object Object]"===Object.prototype.toString.call(e)}const c=Number.isInteger||function(e){return(e|0)===e};function u(e,t){return t[e<0?t.length+e:e]}function d(e,t,r){if(r||(r=new p),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var n,o=function(t){var n=r.get(e);if(n)return n;for(var o in r.set(e,t),e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=d(e[o],!0,r));return t};switch(a(e)){case"Object":return o(Object.create(Object.getPrototypeOf(e)));case"Array":return o(Array(e.length));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 p=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){if((i=r[n])[0]===e)return i[1]}else{var o=this.hash(e);if(r=this.map[o])for(n=0;n<r.length;n+=1){var i;if((i=r[n])[0]===e)return i[1]}}},e}(),f=n(function(e){return null!=e&&"function"==typeof e.clone?e.clone():d(e)});function h(e,t){for(var r=t,n=0;n<e.length;n+=1){if(null==r)return;var o=e[n];r=c(o)?u(o,r):r[o]}return r}var g=i(function(e,t,r){var n,o={};for(n in r=r||{},t=t||{})s(n,t)&&(o[n]=s(n,r)?e(n,t[n],r[n]):t[n]);for(n in r)s(n,r)&&!s(n,o)&&(o[n]=r[n]);return o}
2),y=i(function e(t,r,n){return g(function(r,n,o){return l(n)&&l(o)?e(t,n,o):t(r,n,o)},r,n)}),v=i(function(e,t,r){return y(function(t,r,n){return e(r,n)},t,r)}),m=o(h),b=o(function(e,t){var r={};for(var n in t)e(t[n],n,t)&&(r[n]=t[n]);return r});const S=e=>"function"==typeof e&&Boolean(e.constructor&&e.call&&e.apply),E=e=>"string"==typeof e,w=e=>null===e,A=e=>void 0===e,I=e=>w(e)||A(e),k=e=>!A(e),T=e=>!I(e),O=e=>{switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}},P=(e,t)=>{const r=t.split(".");return m(r,e)},C=e=>!w(e)&&"[object Object]"===Object.prototype.toString.call(e),_=(e,t)=>{if(!Array.isArray(e)||!Array.isArray(t))return f(t);const r=f(e);return t.forEach((e,t)=>{r[t]=Array.isArray(e)||(e=>!w(e)&&(e=>"object"==typeof e)(e)&&!Array.isArray(e))(e)?D(r[t],e):e}),r},D=(e,t)=>v(_,e,t),x=e=>C(e)&&Object.keys(e).length>0,R=e=>{const t=b(k,e);return Object.keys(t).forEach(e=>{const r=t[e];C(r)&&(t[e]=R(r))}),t},j=e=>{const t=b(T,e);return Object.keys(t).forEach(e=>{const r=t[e];C(r)&&(t[e]=j(r))}),t},L=e=>{if(x(e))return j(e)},N=(e,t)=>"boolean"==typeof e?e:t,M=e=>(Object.getOwnPropertyNames(e).forEach(function(t){e[t]&&"object"==typeof e[t]&&M(e[t])}),Object.freeze(e)),U=e=>e.replace(/^\.+/,""),B=e=>{let t=e;if(!E(e)&&!I(e))try{t=JSON.stringify(e)}catch(e){t=null}return t},F=e=>(e=>{const t=Array.from(e,e=>String.fromCodePoint(e)).join("");return globalThis.btoa(t)})((new TextEncoder).encode(e)),G=(e,t,r,n,o)=>{const i={category:e,name:t,properties:r,options:n,callback:void 0};S(o)&&(i.callback=o),S(n)&&(i.category=e,i.name=t,i.properties=r,i.options=void 0,i.callback=n),S(r)&&(i.category=e,i.name=t,i.properties=void 0,i.options=void 0,i.callback=r),S(t)&&(i.category=e,i.name=void 0,i.properties=void 0,i.options=void 0,i.callback=t),S(e)&&(i.category=void 0,i.name=void 0,i.properties=void 0,i.options=void 0,i.callback=e),C(e)?(i.name=void 0,i.category=void 0,i.properties=e,S(t)?i.options=void 0:i.options=t):C(t)&&(i.name=void 0,i.properties=t,S(r)?i.options=void 0:i.options=r),E(e)&&!E(t)&&(i.category=void 0,i.name=e),k(i.category)||(i.category=void 0),k(i.name)||(i.name=void 0),i.properties=i.properties?f(i.properties):{},k(i.options)?i.options=f(i.options):i.options=void 0;const s=E(i.name)?i.name:i.properties.name,a=E(i.category)?i.category:i.properties.category;return i.properties=D(C(i.properties)?i.properties:{},{...s&&{name:s},...a&&{category:a}}),i},H=(e,t,r,n)=>{const o={name:e,properties:t,options:r,callback:void 0};return S(n)&&(o.callback=n),S(r)&&(o.properties=t,o.options=void 0,o.callback=r),S(t)&&(o.properties=void 0,o.options=void 0,o.callback=t),o.properties=T(o.properties)?f(o.properties):{},k(o.options)?o.options=f(o.options):o.options=void 0,o},K=(e,t,r,n)=>{const o={userId:e,traits:t,options:r,callback:void 0};return S(n)&&(o.callback=n),S(r)&&(o.userId=e,o.traits=t,o.options=void 0,o.callback=r),S(t)&&(o.userId=e,o.traits=void 0,o.options=void 0,o.callback=t),(C(e)||w(e))&&(o.userId=null,o.traits=e,S(t)?o.options=void 0:o.options=t),o.userId=B(o.userId),C(o.traits)?o.traits=f(o.traits):o.traits=void 0,k(o.options)?o.options=f(o.options):o.options=void 0,o},W=(e,t,r,n)=>{const o={to:e,from:t,options:r,callback:void 0};return S(n)&&(o.callback=n),S(r)&&(o.to=e,o.from=t,o.options=void 0,o.callback=r),S(t)?(o.to=e,o.from=void 0,o.options=void 0,o.callback=t):(C(t)||w(t))&&(o.to=e,o.from=void 0,o.options=t),k(o.to)&&(o.to=B(o.to)),k(o.from)?o.from=B(o.from):o.from=void 0,k(o.options)?o.options=f(o.options):o.options=void 0,o},V=(e,t,r,n)=>{const o={groupId:e,traits:t,options:r,callback:void 0};return S(n)&&(o.callback=n),S(r)&&(o.groupId=e,o.traits=t,o.options=void 0,o.callback=r),S(t)&&(o.groupId=e,o.traits=void 0,o.options=void 0,o.callback=t),(C(e)||w(e))&&(o.groupId=null,o.traits=e,S(t)?o.options=void 0:o.options=t),o.groupId=B(o.groupId),C(o.traits)?o.traits=f(o.traits):o.traits=void 0,k(o.options)?o.options=f(o.options):o.options=void 0,o};let q=function(e){return e.UNLOADED="Page Unloaded",e}({});const z="API",Q="CapabilitiesManager",J="ConfigManager",X="EventManager",Y="PluginsManager",Z="UserSessionManager",ee="ErrorHandler",te="PluginEngine",re=`Ready${z}`,ne=`Load${z}`,oe="AnalyticsCore";for(var ie,se=[],ae=0;ae<256;ae++)se[ae]=(ae+256).toString(16).substring(1);function le(){var e;(!ie||ae+16>4096)&&(e=4096,ie=crypto.getRandomValues(new Uint8Array(e)),ae=0);for(var t,r=0,n="";r<16;r++)t=ie[ae+r],n+=6==r?se[15&t|64]:8==r?se[63&t|128]:se[t],1&r&&r>1&&r<11&&(n+="-");return ae+=16,n}for(var ce,ue=256,de=[];ue--;)de[ue]=(ue+256).toString(16).substring(1);const pe=()=>!I(globalThis.crypto)&&S(globalThis.crypto.getRandomValues)?le():function(){var e,t=0,r="";if(!ce||ue+16>256){for(ce=Array(t=256);t--;)ce[t]=256*Math.random()|0;t=ue=0}for(;t<16;t++)e=ce[ue+t],r+=6==t?de[15&e|64]:8==t?de[63&e|128]:de[e],1&t&&t>1&&t<11&&(r+="-");return ue++,r}(),fe=(e,t=!1)=>{let r=!1,n=!1;function o(){r||(r=!0,e(n),setTimeout(()=>{r=!1},0))}(t||E(globalThis.navigator.userAgent)&&/Trident.*rv:11\./.test(globalThis.navigator.userAgent))&&globalThis.addEventListener("beforeunload",()=>{n=!1,o()}),globalThis.addEventListener("blur",()=>{n=!0,o()}),globalThis.addEventListener("focus",()=>{r=!1}),document.addEventListener("pagehide",()=>{n="hidden"===document.visibilityState,o()}),document.addEventListener("visibilitychange",()=>{n=!0,"hidden"===document.visibilityState?o():r=!1})},he=e=>e.toISOString(),ge=":: ",ye=(e,t,r)=>`Unable to load (${E(r)?r:r.type}) the script with the id "${e}" from URL "${t}"`,ve=(e,t)=>
2`${e}${ge}A bad data (like circular reference, BigInt) has been detected in the object and the property "${t}" has been dropped from the output.`,me="JSON",be="[Circular Reference]",Se=(e,t,r)=>{const n=[];return function(o,i){if(!(t?.includes(o)||e&&I(i))){if("object"!=typeof i||w(i))return i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(i)?(r?.warn(((e,t)=>`${e}${ge}A circular reference has been detected in the object and the property "${t}" has been dropped from the output.`)("JSONStringify",o)),be):(n.push(i),i)}}},Ee=(e,t,r,n)=>{try{return JSON.stringify(e,Se(t,r,n))}catch(e){return n?.warn("Failed to convert the value to a JSON string.",e),null}},we=e=>{const t=[];return function(r,n){if((e=>"bigint"==typeof e)(n))return e?.warn(ve(me,r)),"[BigInt]";for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?(e?.warn(ve(me,r)),be):(t.push(n),n)}},Ae=(e,t)=>{const r=Array.isArray(e)?[]:{};for(const n in e)if(Object.hasOwnProperty.call(e,n)){const o=e[n],i=t.call(e,n,o);C(i)||Array.isArray(i)?r[n]=Ae(i,t):r[n]=i}return r},Ie=(e,t)=>{const r=we(t),n=r.call(e,"",e);return C(e)||Array.isArray(e)?Ae(e,r):n},ke="[SDK DISPATCHED ERROR]",Te=e=>{const{stack:t}=e;if("string"==typeof t&&t)return t},Oe=(e,t)=>{if(!O(e))return new Error(`${t}: ${Ee(e)}`);try{const r=new(0,e.constructor)(`${t}: ${e.message}`),n=Te(e);return n&&(r.stack=n),Object.getOwnPropertyNames(e).forEach(t=>{if("message"!==t&&"stack"!==t&&"name"!==t)try{r[t]=e[t]}catch{}}),r}catch{return new Error(`${t}: ${Ee(e)}`)}},Pe=e=>{if(O(e)){const t=Te(e);t&&(e.stack=`${t}\n${ke}`)}globalThis.dispatchEvent(new ErrorEvent("error",{error:e,bubbles:!0,cancelable:!0,composed:!0}))},Ce="RudderLabs JavaScript SDK",_e="3.32.0",De="RudderJS-Initiated",xe="preloadedEventsBuffer",Re="ajs_aid",je="ajs_event",$e=432e5,Le=18e5,Ne=(e="app")=>{globalThis.RudderStackGlobals||(globalThis.RudderStackGlobals={}),globalThis.RudderStackGlobals[e]||(globalThis.RudderStackGlobals[e]={})},Me=(e,t,r="app")=>{Ne(r),globalThis.RudderStackGlobals[r][e]=t},Ue=(e,t="app")=>(Ne(t),globalThis.RudderStackGlobals[t][e]);const Be=(e,t)=>{const r={};return e.forEach((n,o)=>{if(o.startsWith(t)){const n=o.substring(t.length);r[n]=e.get(o)}}),r},Fe=e=>{const t=Ue(xe)||[];((e=[])=>{const t="ajs_trait_",r="ajs_prop_",n=new URLSearchParams(globalThis.location.search);n.get(je)&&e.unshift(["track",n.get(je),Be(n,r)]);const o=n.get("ajs_uid"),i=Be(n,t);if(o||x(i)){const t=[...o?[o]:[],i];e.unshift(["identify",...t])}n.get(Re)&&e.unshift(["setAnonymousId",n.get(Re)])})(t),t.length>0&&(e.enqueuePreloadBufferEvents(t),Me(xe,[]))},Ge=(e,t)=>{const r=e.shift();let n;if(S(t[r])){switch(r){case"page":n=G(...e);break;case"track":n=H(...e);break;case"identify":n=K(...e);break;case"alias":n=W(...e);break;case"group":n=V(...e);break;default:t[r](...e)}n&&t[r](n)}},He=(e,t,r,n=!0,o)=>new Promise((i,s)=>{document.getElementById(t)&&s(new Error((e=>`A script with the id "${e}" is already loaded. Skipping the loading of this script to prevent conflicts`)(t)));try{let a;(e=>{const t=document.getElementsByTagName("head");if(t.length>0)return void t[0]?.insertBefore(e,t[0]?.firstChild);const r=document.getElementsByTagName("script");if(r.length>0&&r[0]?.parentNode)return void r[0]?.parentNode.insertBefore(e,r[0]);const n=document.createElement("head");n.appendChild(e);const o=document.getElementsByTagName("html")[0];o?.insertBefore(n,o.firstChild)})(((e,t,r=!0,n=null,o=null,i={})=>{const s=document.createElement("script");return s.type="text/javascript",s.onload=n,s.onerror=o,s.src=e,s.id=t,s.async=r,Object.keys(i).forEac
2h(e=>{s.setAttribute(e,i[e])}),s.setAttribute("data-loader","RS_JS_SDK"),s})(e,t,n,()=>{globalThis.clearTimeout(a),i(t)},r=>{globalThis.clearTimeout(a),s(new Error(ye(t,e,r)))},o)),a=globalThis.setTimeout(()=>{s(new Error(((e,t,r)=>`A timeout of ${r} ms occurred while trying to load the script with id "${e}" from URL "${t}"`)(t,e,r)))},r)}catch(r){s(Oe(r,ye(t,e,"unknown")))}});class Ke{constructor(e,t=1e4){this.logger=e,this.timeout=t}loadJSFile(e){const{url:t,id:r,timeout:n,async:o,callback:i,extraAttributes:s}=e,a=!S(i);He(t,r,n||this.timeout,o,s).then(e=>{a||i(e)}).catch(e=>{a||i(r,e)})}}var We=Symbol.for("preact-signals");function Ve(){if(Ye>1)Ye--;else{var e,t=!1;for(!function(){var e=rt;for(rt=void 0;void 0!==e;){var t=e.S;if(t.v===e.v)for(var r=t.t;void 0!==r;r=r.x)r.i===e.i&&(r.i=t.i);e=e.o}}();void 0!==Xe;){var r=Xe;for(Xe=void 0,Ze++;void 0!==r;){var n=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&at(r))try{r.c()}catch(r){t||(e=r,t=!0)}r=n}}if(Ze=0,Ye--,t)throw e}}function qe(e){if(Ye>0)return e();tt=++et,Ye++;try{return e()}finally{Ve()}}var ze,Qe=void 0;function Je(e){var t=Qe,r=ze;Qe=void 0,ze=void 0;try{return e()}finally{Qe=t,ze=r}}var Xe=void 0,Ye=0,Ze=0,et=0,tt=0,rt=void 0,nt=0;function ot(e){if(void 0!==Qe){var t=e.n;if(void 0===t||t.t!==Qe)return t={i:0,S:e,p:Qe.s,n:void 0,t:Qe,e:void 0,x:void 0,r:t},void 0!==Qe.s&&(Qe.s.n=t),Qe.s=t,e.n=t,32&Qe.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=Qe.s,t.n=void 0,Qe.s.n=t,Qe.s=t),t}}function it(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function st(e,t){return new it(e,t)}function at(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function lt(e){for(var t=e.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r&&(t.r=r),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function ct(e){for(var t=e.s,r=void 0;void 0!==t;){var n=t.p;-1===t.i?(t.S.U(t),void 0!==n&&(n.n=t.n),void 0!==t.n&&(t.n.p=n)):r=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=n}e.s=r}function ut(e,t){it.call(this,void 0,t),this.x=e,this.s=void 0,this.g=nt-1,this.f=4}function dt(e){var t=e.m;if(e.m=void 0,"function"==typeof t){Ye++;var r=Qe;Qe=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,pt(e),t}finally{Qe=r,Ve()}}}function pt(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,dt(e)}function ft(e){if(Qe!==this)throw new Error("Out-of-order effect");ct(this),Qe=e,this.f&=-2,8&this.f&&pt(this),Ve()}function ht(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name,ze&&ze.push(this)}function gt(e,t){var r=new ht(e,t);try{r.c()}catch(e){throw r.d(),e}var n=r.d.bind(r);return n[Symbol.dispose]=n,n}it.prototype.brand=We,it.prototype.h=function(){return!0},it.prototype.S=function(e){var t=this,r=this.t;r!==e&&void 0===e.e&&(e.x=r,this.t=e,void 0!==r?r.e=e:Je(function(){var e;null==(e=t.W)||e.call(t)}))},it.prototype.U=function(e){var t=this;if(void 0!==this.t){var r=e.e,n=e.x;void 0!==r&&(r.x=n,e.e=void 0),void 0!==n&&(n.e=r,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&Je(function(){var e;null==(e=t.Z)||e.call(t)}))}},it.prototype.subscribe=function(e){var t=this;return gt(function(){var r=t.value;Je(function(){return e(r)})},{name:"sub"})},it.prototype.valueOf=function(){return this.value},it.prototype.toString=function(){return this.value+""},it.prototype.toJSON=function(){return this.value},it.prototype.peek=function(){var e=this;return Je(function(){return e.value})},Object.defineProperty(it.prototype,"value",{get:function(){var e=ot(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Ze>100)throw new Error("Cycle detected");!function(e){0!==Ye&&0===Ze&&e.l!==tt&&(e.l=tt,rt={S:e,v:e.v,i:e.i,o:rt})}(this),this.v=e,this.i++,nt++,Ye++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{Ve()}}}}),ut.prototype=new it,ut.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===nt)return!0;if(this.g=nt,this.f|=1,this.i>0&&!at(this))return this.f&=-2,!0;var e=Qe;try{lt(this),Qe=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Qe=e,ct(this),this.f&=-2,!0},ut.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}it.prototype.S.call(this,e)},ut.prototype.U=function(e){if(void 0!==this.t&&(it.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},ut.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(ut.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=ot(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),ht.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.m=t)}finally{e()}},ht.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,dt(this),lt(this),Ye++;var e=Qe;return Qe=this,ft.bind(this,e)},ht.prototype.N=function(){2&this.f||(this.f|=2,this.u=Xe,Xe=this)},ht.prototype.d=function(){this.f|=8,1&this.f||pt(this)},ht.prototype.dispose=function(){this.d()};class yt{constructor(){this.items=[]}enqueue(e){this.items.push(e)}dequeue(){return 0===this.items.length?null:this.items.shift()}isEmpty(){return 0===this.items.length}size(){return this.items.length}clear(){this.items=[]}}const vt={LOG:0,INFO:1,DEBUG:2,WARN:3,ERROR:4,NONE:5},mt="ERROR";const bt=new class{constructor(e="LOG",t="",r=console){this.minLogLevel=vt[e],this.scope=t,this.logProvider=r}log(...e){this.outputLog("LOG",e)}info(...e){this.outputLog("INFO",e)}debug(...e){this.outputLog("DEBUG",e)}warn(...e){this.outputLog("WARN",e)}error(...e){this.outputLog("ERROR",e)}outputLog(e,t){this.minLogLevel<=vt[e]&&this.logProvider[e.toLowerCase()]?.(...this.formatLogData(t))}setScope(e){this.scope=e||this.scope}setMinLogLevel(e){this.minLogLevel=vt[e],A(this.minLogLevel)&&(this.minLogLevel=vt.LOG)}formatLogData(e){if(Array.isArray(e)&&e.length>0){let t="%c RS SDK";this.scope&&(t=`${t} - ${this.scope}`);t=`${t} %c ${E(e[0])?e[0].trim():""}`;const r=[t,"font-weight: bold; background: black; color: white;","font-weight: normal;"];return E(e[0])||r.push(e[0]),r.push(...e.slice(1)),r}return e}};let St=function(e){return e.HANDLEDEXCEPTION="handledException",e.UNHANDLEDEXCEPTION="unhandledException",e.UNHANDLEDREJECTION="unhandledPromiseRejection",e}({});const Et=["localStorage","memoryStorage","cookieStorage","sessionStorage","none"],wt="cookieStorage",At="Unable to process/parse source configuration response",It="Failed to log breadcrumb",kt="Failed to fetch the source config",Tt=e=>`${e}${ge}The provided callback parameter is not a function.`,Ot=(e,t,r)=>`${e} due to timeout or no connection (${t?t.type:""}) at the client side for URL: ${r}`,Pt="Failed to set/remove cookies via server. As a fallback, the cookies will be managed client side.",Ct=e=>`${e}${ge}Invalid custom context. Use a plain object without prototype pollution keys.`,_t={All:!0},Dt="js-integrations",xt="plugins",Rt=new RegExp("^(https?:\\/\\/)(((([a-zA-Z\\d]([a-zA-Z\\d-]*[a-zA-Z\\d])*)\\.)+[a-zA-Z]{2,}|localhost|((25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9]?)))(\\:\\d+)?(\\/[-a-zA-Z\\d%_.~+]*)*(\\?[;&a-zA-Z\\d%_.~+=-]*)?(\\#[-a-zA-Z\\d_]*)?$"),jt="modern",$t="https://cdn.rudderlabs.com",Lt="v3",Nt=`${$t}/${Lt}/${jt}/${Dt}`,Mt=`${$t}/${Lt}/${jt}/${xt}`,Ut="https://api.rudderstack.com",Bt="v3",Ft="xhr",Gt={iubenda:"IubendaConsentManager",oneTrust:"OneTrustConsentManager",ketch:"KetchConsentManager",custom:"CustomConsentManager"},Ht={[Bt]:"StorageEncryption",legacy:"StorageEncryptionLegacy"},Kt={[Ft]:"XhrQueue",beacon:"BeaconQueue"},Wt=st(f({configUrl:Ut,loadIntegration:!0,sessions:{autoTrack:!0,timeout:Le,cutOff:{enabled:!1}}
2,sameSiteCookie:"Lax",polyfillIfRequired:!0,integrations:_t,useBeacon:!1,beaconQueueOptions:{},destinationsQueueOptions:{},queueOptions:{},lockIntegrationsVersion:!0,lockPluginsVersion:!0,uaChTrackLevel:"none",plugins:[],useGlobalIntegrationsConfigInEvents:!1,bufferDataPlaneEventsUntilReady:!1,dataPlaneEventsBufferTimeout:1e4,storage:{encryption:{version:Bt},migrate:!0,cookie:{}},sendAdblockPage:!1,sameDomainCookiesOnly:!1,secureCookie:!1,sendAdblockPageOptions:{},useServerSideCookies:!1})),Vt=M({userId:"",userTraits:{},anonymousId:"",groupId:"",groupTraits:{},initialReferrer:"",initialReferringDomain:"",sessionInfo:{},authToken:null}),qt=M({entries:{userId:!0,userTraits:!0,groupId:!0,groupTraits:!0,sessionInfo:!0,authToken:!0,anonymousId:!1,initialReferrer:!1,initialReferringDomain:!1}}),zt={userId:st(Vt.userId),userTraits:st(Vt.userTraits),anonymousId:st(Vt.anonymousId),groupId:st(Vt.groupId),groupTraits:st(Vt.groupTraits),initialReferrer:st(Vt.initialReferrer),initialReferringDomain:st(Vt.initialReferringDomain),sessionInfo:st(Vt.sessionInfo),authToken:st(Vt.authToken)},Qt={isOnline:st(!0),storage:{isLocalStorageAvailable:st(!1),isCookieStorageAvailable:st(!1),isSessionStorageAvailable:st(!1)},isBeaconAvailable:st(!1),isLegacyDOM:st(!1),isUaCHAvailable:st(!1),isCryptoAvailable:st(!1),isAdBlockerDetectionInProgress:st(!1),isAdBlocked:st(void 0),cspBlockedURLs:st([])},Jt={isErrorReportingEnabled:st(!1),isMetricsReportingEnabled:st(!1),breadcrumbs:st([])},Xt=st(void 0),Yt={activeDataplaneUrl:st(void 0),integrationsCDNPath:st(Nt),pluginsCDNPath:st(Mt),sourceConfigUrl:st(void 0),status:st(void 0),initialized:st(!1),logLevel:st(mt),loaded:st(!1),readyCallbacks:st([]),writeKey:st(void 0),dataPlaneUrl:st(void 0),safeAnalyticsInstance:st(void 0)},Zt={enabled:st(!1),initialized:st(!1),data:st({}),activeConsentManagerPluginName:st(void 0),preConsent:st({enabled:!1}),postConsent:st({}),resolutionStrategy:st("and"),provider:st(void 0),metadata:st(void 0)},er={retries:st(0),dropped:st(0),sent:st(0),queued:st(0),triggered:st(0),metricsServiceUrl:st(void 0)},tr={app:st({name:Ce,namespace:"com.rudderlabs.javascript",version:_e,installType:"npm"}),traits:st(null),library:st({name:Ce,version:_e,snippetVersion:globalThis.RudderSnippetVersion,variant:"modern"}),userAgent:st(null),device:st(null),network:st(null),os:st({name:"",version:""}),locale:st(null),screen:st({density:0,width:0,height:0,innerWidth:0,innerHeight:0}),"ua-ch":st(void 0),timezone:st(void 0)},rr=st({}),nr={configuredDestinations:st([]),activeDestinations:st([]),loadOnlyIntegrations:st({}),failedDestinations:st([]),loadIntegration:st(!0),initializedDestinations:st([]),clientDestinationsReady:st(!1),integrationsConfig:st({})},or={toBeProcessedArray:st([]),readyCallbacksArray:st([])},ir={ready:st(!1),loadedPlugins:st([]),failedPlugins:st([]),pluginsToLoadFromConfig:st([]),activePlugins:st([]),totalPluginsToLoad:st(0)},sr={encryptionPluginName:st(void 0),migrate:st(!1),type:st(void 0),cookie:st(void 0),entries:st({}),trulyAnonymousTracking:st(!1)},ar={isEnabledServerSideCookies:st(!1),dataServiceUrl:st(void 0)},lr={eventsQueuePluginName:st(void 0),deliveryEnabled:st(!0)},cr={enabled:st(!1),pageLifecycle:{enabled:st(!1),pageViewId:st(void 0),pageLoadedTimestamp:st(void 0)}},ur={...f({capabilities:Qt,consents:Zt,context:tr,customContext:rr,eventBuffer:or,lifecycle:Yt,loadOptions:Wt,metrics:er,nativeDestinations:nr,plugins:ir,reporting:Jt,session:zt,source:Xt,storage:sr,serverCookies:ar,dataPlaneEvents:lr,autoTrack:cr})},dr=/^\s*at /,pr=/^(eval@)?(\[native code])?$/,fr=/(.+?)(?::(\d+))?(?::(\d+))?$/;function hr(e){if(!e?.includes(":"))return[e||void 0,void 0,void 0];const t=e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e,r=fr.exec(t);return r?[r[1]||void 0,void 0===r[2]?void 0:Number(r[2]),void 0===r[3]?void 0:Number(r[3])]:[void 0,void 0,void 0]}function gr(e){if(!dr.test(e))return null;e.includes("(eval ")&&(e=e.replaceAll("eval code","eval").replaceAll(/(\(eval at [^()]*)|(,.*$)/g,""));const t=e.replace(/^\s+/,"").replaceAll("(eval code","(").replace(/^.*?\s+/,""),r=/ (\(.+\)$)/.exec(t),n=r?t.replace(r[0],""):t,[o,i,s]=hr(r?r[1]:t);return{functionName:r&&n||void 0,fileName:"eval"===o||"<anonymous>"===o?void 0:o,lineNumber:i,columnNumber:s}}function yr(e){if(pr.test(e))return null;if(e.includes(" > eval")&&(e=e.replaceAll(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!e.includes("@")&&!e.includes(":"))return{functionName:e,fileName:void 0,lineNumber:void 0,columnNumber:void 0};const t=e.lastIndexOf("@"),r=t>0?e.slice(0,t):void 0,[n,o,i]=hr(e.slice(t+1));return{functionName:r,fileName:n,lineNumber:o,columnNumber:i}}const vr="global code",mr=e=>E(e)?e:"";function br(e,t,r,n){return{errorClass:mr(e),message:`${r}${mr(t)}`,type:"browserjs",stacktrace:n.reduce((e,t)=>
2{const r=(e=>{const t={file:e.fileName,method:(r=e.functionName,k(r)&&/^global code$/i.test(r)?vr:r),lineNumber:e.lineNumber,columnNumber:e.columnNumber};var r;return t.lineNumber&&t.lineNumber>-1&&!t.file&&!t.method&&(t.file=vr),t})(t);try{return"{}"===JSON.stringify(r)?e:e.concat(r)}catch{return e}},[])}}const Sr=(e,t)=>{let r;var n,o;return O(e)&&E(Te(e))?r=e:(t.warn((n=ee,o=Ee(e),`${n}${ge}Ignoring a non-error: ${o}.`)),r=void 0),r},Er=(e,t)=>{try{const r=function(e){if(!e.stack)throw new Error("Cannot parse given Error object");const t=e.stack.split("\n");return t.some(e=>dr.test(e))?t.map(gr).filter(e=>null!==e):t.map(yr).filter(e=>null!==e)}(e);return br(e.name,e.message,t,r)}catch{return br(e.name,e.message,t,[])}},wr=(e,t)=>{try{return JSON.parse(e||"")}catch(e){t(Oe(e,"Failed to parse response data"))}},Ar="The request failed",Ir=[new RegExp(`${Ar}.*`),/A script with the id .* is already loaded\./],kr=[/Failed to fetch dynamically imported module: .*/,/Unable to load \(.*\) the script with the id .*/,/A timeout of \d+ ms occurred while trying to load the script with id .*/],Tr={headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},method:"GET"},Or=(e,t,r)=>{const n=D(Tr,t||{});return r&&(n.headers=D(n.headers,{Authorization:r})),n.url=e,n},Pr=(e,t=1e4,r)=>new Promise((n,o)=>{let i;if(!0===e.sendRawData)i=e.data;else if(i=Ee(e.data,!1,[],r),w(i))return void o({error:new Error("Failed to prepare data for the request."),undefined:void 0,options:e});const s=new XMLHttpRequest,a=t=>{o({error:new Error(Ot(Ar,t,e.url)),xhr:s,options:e,..."timeout"===t?.type?{timedOut:!0}:{}})};s.ontimeout=a,s.onerror=a,s.onload=()=>{var t,r,i,a,l;s.status>=200&&s.status<400?n({response:s.responseText,xhr:s,options:e}):o({error:new Error((t=Ar,r=s.status,i=s.statusText,a=e.url,l=s.responseText,`${t} with status ${r} (${i}) for URL: ${a}. Response: ${l.trim()}`)),xhr:s,options:e})},s.open(e.method,e.url,!0),!0===e.withCredentials&&(s.withCredentials=!0),s.timeout=t,Object.keys(e.headers).forEach(t=>{e.headers[t]&&s.setRequestHeader(t,e.headers[t])});try{s.send(i)}catch(t){o({error:Oe(t,(l=Ar,c=e.url,`${l} for URL: ${c}`)),xhr:s,options:e})}var l,c});const Cr=new class{constructor(e){this.logger=e,this.onError=this.onError.bind(this)}init(e){this.errorHandler=e}async getData(e){const{url:t,options:r,timeout:n,isRawResponse:o}=e;try{const e=await Pr(Or(t,r,this.basicAuthHeader),n,this.logger);return{data:o?e.response:wr(e.response,this.onError),details:e}}catch(e){return{data:void 0,details:e}}}getAsyncData(e){const{callback:t,url:r,options:n,timeout:o,isRawResponse:i}=e,s=!S(t);Pr(Or(r,n,this.basicAuthHeader),o,this.logger).then(e=>{s||t(i?e.response:wr(e.response,this.onError),e)}).catch(e=>{s||t(void 0,e)})}onError(e,t){this.errorHandler?.onError({error:e,context:"HttpClient",groupingHash:t})}setAuthHeader(e,t=!1){const r=t?e:F(`${e}:`);this.basicAuthHeader=`Basic ${r}`}resetAuthHeader(){this.basicAuthHeader=void 0}}(bt),_r=["www.test-host.com","localhost","127.0.0.1","[::1]"],Dr=["userId","userTraits","groupId","groupTraits","anonymousId","config","integration","eventBuffer","customContext","traits","authToken"],xr=e=>{ur.capabilities.isAdBlockerDetectionInProgress.value=!0;try{const t=new URL(ur.lifecycle.sourceConfigUrl.value),r=`${t.origin}${t.pathname}?view=ad`;e.getAsyncData({url:r,options:{method:"HEAD",headers:{"Content-Type":void 0}},isRawResponse:!0,callback:(e,t)=>{ur.capabilities.isAdBlockerDetectionInProgress.value=!1,ur.capabilities.isAdBlocked.value=void 0!==t?.error||t?.xhr?.responseURL!==r}})}catch(e){throw ur.capabilities.isAdBlockerDetectionInProgress.value=!1,e}},Rr=(e=()=>window.location.hostname)=>{const t=e();return!t||t&&_r.includes(t)?"development":"production"},jr=e=>{const t=Ee(e,!1,Dr);return null!==t?JSON.parse(t):{}},$r=(e,t,r,n)=>({id:`${e.value?.id??r.writeKey.value}..${t.sessionInfo.value.id??"NA"}..${n.pageLifecycle.pageViewId.value??"NA"}`,name:e.value?.name??"NA"}),Lr=(e,t)=>({locale:e.value??"NA",userAgent:t.value??"NA",time:new Date}),Nr=(e,t,r)=>{const n=e.message;return new Promise(e=>{if(kr.some(e=>e.test(n))){const o=/https?:\/\/[^\s"'(),;<>[\]{}]+/.exec(n)?.[0];E(o)?o.startsWith($t)?t.capabilities.cspBlockedURLs.value.includes(o)?e(!1):((e,t,r)=>{if(A(e.capabilities.isAdBlocked.value)){!1===e.capabilities.isAdBlockerDetectionInProgress.value&&xr(t);const n=gt(()=>{k(e.capabilities.isAdBlocked.value)&&(r(!1===e.capabilities.isAdBlocked.value),n())})}else r(!1===e.capabilities.isAdBlocked.value)})(t,r,e):e(!1):e(!0)}else e(!Ir.some(e=>e.test(n)))})},Mr=e=>{if(!e)return;return e.split("/").at(-2)},Ur=e=>{const t=e.stacktrace[0]?.file;if(t&&"string"==typeof t)return t},Br=(e,t,r)=>{const n={version:"1",message_id:pe(),source:{name:"js",sdk_version:t.context.app.value.version,write_key:t.lifecycle.writeKey.value,install_type:t.context.app.value.installType,category:r},errors:e};return Ee(n)};const Fr=new class{initialized=!1;constructor(e,t){this.httpClient=e,this.logger=t}init(){this.initialized||(this.attachErrorListeners(),this.initialized=!0)}attachErrorListeners(){globalThis.addEventListener("error",e=>{this.onError({error:e,context:ee,errorType:St.UNHANDLEDEXCEPTION})}),globalThis.addEventListener("unhandledrejection",e=>{this.onError({error:e,context:ee,errorType:St.UNHANDLEDREJECTION})}),document.addEventListener("securitypolicyviolation",e=>{const t=E(e.blockedURI)?e.blockedURI:"";"enforce"===e.disposition&&t.startsWith($t)&&!ur.capabilities.cspBlockedURLs.value.includes(t)&&(ur.capabilities.cspBlockedURLs.value=[...ur.capabilities.cspBlockedURLs.value,t])})}async onError(e){try{const{error:t,context:r,customMessage:n,groupingHash:o,category:i}=e,s=e.errorType??St.HANDLEDEXCEPTION,a=((e,t)=>{switch(t){case St.UNHANDLEDEXCEPTION:{const{error:t}=e;return t||e}case St.UNHANDLEDREJECTION:return e.reason;case St.HANDLEDEXCEPTION:default:return e}})(t,s),l=Sr(a,this.logger);if(A(l))return;const c=n?`${n} - `:"",u=Er(l,`${r}${ge}
2${c}`),d=Te(l).includes(ke);if(!d&&!(e=>{const t=Ur(e);if(!t)return!1;const r=t.substring(t.lastIndexOf("/")+1);return Mr(t)===Dt||["rsa"].some(e=>r.startsWith(e)&&r.endsWith(".js"))})(u)&&s!==St.HANDLEDEXCEPTION)return;if(ur.reporting.isErrorReportingEnabled.value){if(await Nr(u,ur,this.httpClient)){const e={severity:"error",unhandled:s!==St.HANDLEDEXCEPTION,severityReason:{type:s}},t=((e,t,r)=>{let n;if(k(e))if(E(e))n=e;else{const o=Sr(e,r);n=k(o)?o.message:t}else n=t;return n})(o,u.message,this.logger),r=((e,t,r,n)=>{const{context:o,lifecycle:i,session:s,source:a,reporting:l,autoTrack:c}=r,{app:u,locale:d,userAgent:p,timezone:h,screen:g,library:y}=o;return{payloadVersion:"5",notifier:{name:"RudderStack JavaScript SDK",version:u.value.version,url:"git+https://github.com/rudderlabs/rudder-sdk-js.git"},events:[{exceptions:[f(e)],severity:t.severity,unhandled:t.unhandled,severityReason:t.severityReason,app:{version:u.value.version,releaseStage:Rr(),type:u.value.installType},device:Lr(d,p),request:{url:globalThis.location.href.split("?")[0],clientIp:"[NOT COLLECTED]"},breadcrumbs:f(l.breadcrumbs.value),context:e.message,groupingHash:n,metaData:{app:{snippetVersion:y.value.snippetVersion},device:{...g.value,timezone:h.value},...jr(r)},user:$r(a,s,i,c)}]}})(u,e,ur,t),n=((e,t)=>{if(t)return t;const r=Ur(e);return Mr(r)===Dt?"integrations":"sdk"})(u,i);this.httpClient.getAsyncData({url:ur.metrics.metricsServiceUrl.value,options:{method:"POST",data:Br(r,ur,n),sendRawData:!0},isRawResponse:!0})}}(s===St.HANDLEDEXCEPTION||d)&&this.logger.error(u.message)}catch(e){this.logger.error(`${ee}${ge}Failed to handle the error.`,e)}}leaveBreadcrumb(e){try{ur.reporting.breadcrumbs.value=[...ur.reporting.breadcrumbs.value,(t=e,{type:"manual",name:t,timestamp:new Date,metaData:{}})]}catch(e){this.onError({error:e,context:ee,customMessage:It,groupingHash:It})}var t}}(Cr,bt);const Gr=new class{plugins=[];byName={};cache={};config={throws:!0};constructor(e,t={}){this.config={throws:!0,...t},this.logger=e}register(e,t){if(!e.name){const t=`${te}${ge}Plugin name is missing.`;if(this.config.throws)throw new Error(t);return void this.logger.error(t,e)}if(this.byName[e.name]){const t=((e,t)=>`${e}${ge}Plugin "${t}" already exists.`)(te,e.name);if(this.config.throws)throw new Error(t);return void this.logger.error(t)}this.cache={},this.plugins=this.plugins.slice();let r=this.plugins.length;this.plugins.forEach((t,n)=>{t.deps?.includes(e.name)&&(r=Math.min(r,n))}),this.plugins.splice(r,0,e),this.byName[e.name]=e,S(e.initialize)&&e.initialize(t)}unregister(e){const t=this.byName[e];if(!t){const t=`${te}${ge}Plugin "${e}" not found.`;if(this.config.throws)throw new Error(t);return void this.logger.error(t)}const r=this.plugins.indexOf(t);if(-1===r){const t=((e,t)=>`${e}${ge}Plugin "${t}" not found in plugins but found in byName. This indicates a bug in the plugin engine. Please report this issue to the development team.`)(te,e);if(this.config.throws)throw new Error(t);return void this.logger.error(t)}this.cache={},delete this.byName[e],this.plugins=this.plugins.slice(),this.plugins.splice(r,1)}getPlugin(e){return this.byName[e]}getPlugins(e){const t=e??".";return this.cache[t]||(this.cache[t]=this.plugins.filter(e=>{if(e.deps?.some(e=>!this.byName[e])){const t=e.deps.filter(e=>!this.byName[e]);return this.logger.error(((e,t,r)=>`${e}${ge}Plugin "${t}" could not be loaded because some of its dependencies "${r}" do not exist.`)(te,e.name,t)),!1}return"."===t||((e,t)=>Boolean(P(e,t)))(e,t)})),this.cache[t]}processRawPlugins(e){e(this.plugins),this.cache={}}invoke(e,t=!0,...r){let n=e;if(!n)throw new Error("Failed to invoke plugin because the extension point name is missing.");const o=n.startsWith("!"),i=this.config.throws??n.endsWith("!");if(n=n.replace(/(^!|!$)/g,""),!n)throw new Error("Failed to invoke plugin because the extension point name is invalid.");const s=n.split(".");s.pop();const a=s.join(".");return(t?this.getPlugins(n):[this.getPlugins(n)[0]]).map(e=>{const t=P(e,n);if(!S(t)||o)return t;try{return t.apply(P(e,a),r)}catch(t){if(i)throw t;this.logger.error(((e,t,r)=>`${e}${ge}Failed to invoke the "${t}" extension point of plugin "${r}".`)(te,n,e.name),t)}return null})}invokeSingle(e,...t){return this.invoke(e,!1,...t)[0]}invokeMultiple(e,...t){return this.invoke(e,!0,...t)}}(bt,{throws:!0}),Hr=e=>Boolean("cloud"!==e.config.connectionMode||!0===e.config.useNativeSDKToSend||!0===e.config.useNativeSDK),Kr=e=>e.filter(Hr),Wr=["BeaconQueue","CustomConsentManager","DeviceModeDestinations","DeviceModeTransformation","ExternalAnonymousId","GoogleLinker","IubendaConsentManager","KetchConsentManager","NativeDestinationQueue","OneTrustConsentManager","StorageEncryption","StorageEncryptionLegacy","StorageMigrator","XhrQueue"],Vr=["Bugsnag","ErrorReporting"],qr={rudderAnalyticsRemotePlugins:{url:()=>Promise.resolve(window.RudderStackGlobals&&window.RudderStackGlobals.app&&window.RudderStackGlobals.app.pluginsCDNPath?`${window.RudderStackGlobals.app.pluginsCDNPath}/rsa-plugins.js`:"https://cdn.rudderlabs.com/v3/modern/plugins//rsa-plugins.js"),format:"esm",from:"vite"}};function zr(e,t){const r=Object.assign(e,t);for(const e of Object.keys(r))"object"==typeof r[e]&&"object"==typeof t[e]&&(r[e]=zr(r[e],t[e]));return r}const Qr=e=>zr({},(globalThis.__federation_shared__||{}).default||{});function Jr(e,t){if(!e?.default&&t){let t=Object.create(null);return t.default=e,t.__esModule=!0,t}return e}function Xr(e,t){return async function(e){const t=qr[e];return t.inited?t.lib:["esm","systemjs"].includes(t.format)?new Promise((e,r)=>{("function"==typeof t.url?t.url:()=>Promise.resolve(t.url))().then(n=>{import(n).then(r=>{if(!t.inited){const e=Qr();r.init(e),t.lib=r,t.lib.init(e),t.inited=!0}e(t.lib)}).catch(r)})}):void 0}(e).then(e=>e.get(t).then(e=>e()))}const Yr=e=>{const t={};
2return e.forEach(e=>{if(Wr.includes(e)){const r=(e=>{switch(e){case"BeaconQueue":return()=>Xr("rudderAnalyticsRemotePlugins","./BeaconQueue").then(e=>Jr(e,!0));case"CustomConsentManager":return()=>Xr("rudderAnalyticsRemotePlugins","./CustomConsentManager").then(e=>Jr(e,!0));case"DeviceModeDestinations":return()=>Xr("rudderAnalyticsRemotePlugins","./DeviceModeDestinations").then(e=>Jr(e,!0));case"DeviceModeTransformation":return()=>Xr("rudderAnalyticsRemotePlugins","./DeviceModeTransformation").then(e=>Jr(e,!0));case"ExternalAnonymousId":return()=>Xr("rudderAnalyticsRemotePlugins","./ExternalAnonymousId").then(e=>Jr(e,!0));case"GoogleLinker":return()=>Xr("rudderAnalyticsRemotePlugins","./GoogleLinker").then(e=>Jr(e,!0));case"KetchConsentManager":return()=>Xr("rudderAnalyticsRemotePlugins","./KetchConsentManager").then(e=>Jr(e,!0));case"IubendaConsentManager":return()=>Xr("rudderAnalyticsRemotePlugins","./IubendaConsentManager").then(e=>Jr(e,!0));case"NativeDestinationQueue":return()=>Xr("rudderAnalyticsRemotePlugins","./NativeDestinationQueue").then(e=>Jr(e,!0));case"OneTrustConsentManager":return()=>Xr("rudderAnalyticsRemotePlugins","./OneTrustConsentManager").then(e=>Jr(e,!0));case"StorageEncryption":return()=>Xr("rudderAnalyticsRemotePlugins","./StorageEncryption").then(e=>Jr(e,!0));case"StorageEncryptionLegacy":return()=>Xr("rudderAnalyticsRemotePlugins","./StorageEncryptionLegacy").then(e=>Jr(e,!0));case"StorageMigrator":return()=>Xr("rudderAnalyticsRemotePlugins","./StorageMigrator").then(e=>Jr(e,!0));case"XhrQueue":return()=>Xr("rudderAnalyticsRemotePlugins","./XhrQueue").then(e=>Jr(e,!0));default:return}})(e);r&&(t[e]=r)}}),t},Zr=e=>Yr?.(e)||{},en={};class tn{constructor(e,t,r){this.engine=e,this.errorHandler=t,this.logger=r,this.onError=this.onError.bind(this)}init(){ur.lifecycle.status.value="pluginsLoading",Me("pluginsCDNPath",ur.lifecycle.pluginsCDNPath.value),this.setActivePlugins(),this.registerLocalPlugins(),this.registerRemotePlugins(),this.attachEffects()}attachEffects(){gt(()=>{(0===ur.plugins.activePlugins.value.length||ur.plugins.loadedPlugins.value.length+ur.plugins.failedPlugins.value.length===ur.plugins.totalPluginsToLoad.value)&&qe(()=>{ur.plugins.ready.value=!0,ur.lifecycle.status.value="pluginsReady"})})}getPluginsToLoadBasedOnConfig(){let e=ur.plugins.pluginsToLoadFromConfig.value;if(!e)return[];e=e.filter(e=>!Vr.includes(e)||(this.logger.warn(((e,t)=>`${e}${ge}${t} plugin is deprecated. Please exclude it from the load API options.`)(Y,e)),!1));const t=[{configurationStatus:()=>k(ur.dataPlaneEvents.eventsQueuePluginName.value),configurationStatusStr:"Data plane events delivery is enabled",activePluginName:ur.dataPlaneEvents.eventsQueuePluginName.value,supportedPlugins:Object.values(Kt),shouldAddMissingPlugins:!0},{configurationStatus:()=>Kr(ur.nativeDestinations.configuredDestinations.value).length>0,configurationStatusStr:"Device mode destinations are connected to the source",supportedPlugins:["DeviceModeDestinations","NativeDestinationQueue"]},{configurationStatus:()=>Kr(ur.nativeDestinations.configuredDestinations.value).some(e=>e.shouldApplyDeviceModeTransformation),configurationStatusStr:"Device mode transformations are enabled for at least one destination",supportedPlugins:["DeviceModeTransformation"]},{configurationStatus:()=>k(ur.consents.activeConsentManagerPluginName.value),configurationStatusStr:"Consent management is enabled",activePluginName:ur.consents.activeConsentManagerPluginName.value,supportedPlugins:Object.values(Gt)},{configurationStatus:()=>k(ur.storage.encryptionPluginName.value),configurationStatusStr:"Storage encryption is enabled",activePluginName:ur.storage.encryptionPluginName.value,supportedPlugins:Object.values(Ht)},{configurationStatus:()=>ur.storage.migrate.value,configurationStatusStr:"Storage migration is enabled",supportedPlugins:["StorageMigrator"]}];return t.forEach(t=>{t.configurationStatus()?(e=e.filter(t.activePluginName?e=>!(e!==t.activePluginName&&t.supportedPlugins.includes(e)):e=>k(e)),this.addMissingPlugins(t,false,e)):e=e.filter(void 0!==t.basePlugins?e=>!(t.basePlugins.includes(e)||t.supportedPlugins.includes(e)):e=>!t.supportedPlugins.includes(e))}),[...Object.keys({}),...e]}addMissingPlugins(e,t,r){const n=e.shouldAddMissingPlugins||t;let o;o=e.activePluginName?[...e.basePlugins||[],e.activePluginName]:[...e.supp
2ortedPlugins];const i=o.filter(e=>!r.includes(e));i.length>0&&(n&&r.push(...i),this.logger.warn(((e,t,r,n)=>{const o=1===r.length,i=o?` '${r[0]}' plugin was`:` ['${r.join("', '")}'] plugins were`,s=`${e}${ge}${t}, but${i} not configured to load.`;return n?`${s} So, ${o?"the plugin":"those plugins"} will be loaded automatically.`:`${s} Ignore if this was intentional. Otherwise, consider adding ${o?"it":"them"} to the 'plugins' load API option.`})(Y,e.configurationStatusStr,i,n)))}setActivePlugins(){const e=this.getPluginsToLoadBasedOnConfig(),t=[...Object.keys(en),...Wr],r=[],n=[];e.forEach(e=>{t.includes(e)?r.push(e):n.push(e)}),n.length>0&&this.logger.warn(`${Y}${ge}Ignoring unknown plugins: ${n.join(", ")}.`),qe(()=>{ur.plugins.totalPluginsToLoad.value=e.length,ur.plugins.activePlugins.value=r,ur.plugins.failedPlugins.value=n})}registerLocalPlugins(){const e=[];Object.entries(en).forEach(([t,r])=>{ur.plugins.activePlugins.value.includes(t)&&(S(r)?this.register([r()]):e.push(t))}),e.length>0&&(ur.plugins.failedPlugins.value=[...ur.plugins.failedPlugins.value,...e],this.logger.error(((e,t)=>`${e}${ge}Failed to load the following unavailable local plugins: ${t.join(", ")}. Some features of the SDK may not work as expected. Make sure you are using the correct SDK bundle variant.`)(Y,e)))}registerRemotePlugins(){const e=(t=ur.plugins.activePlugins.value,{...Zr(t)});var t;Promise.all(Object.keys(e).map(async t=>{await e[t]().then(e=>this.register([e.default()])).catch(e=>{ur.plugins.failedPlugins.value=[...ur.plugins.failedPlugins.value,t],this.onError(e,`Failed to load plugin "${t}"`,e)})})).catch(e=>{this.onError(e)})}invokeMultiple(e,...t){try{return this.engine.invokeMultiple(e,...t)}catch(t){return this.onError(t,e),[]}}invokeSingle(e,...t){try{return this.engine.invokeSingle(e,...t)}catch(t){return this.onError(t,e),null}}register(e){e.forEach(e=>{try{this.engine.register(e,ur)}catch(t){ur.plugins.failedPlugins.value=[...ur.plugins.failedPlugins.value,e.name],this.onError(t,`Failed to register plugin "${e.name}"`)}})}unregisterLocalPlugins(){Object.keys(en).forEach(e=>{try{this.engine.unregister(e)}catch(t){this.onError(t,`Failed to unregister plugin "${e}"`)}})}onError(e,t,r){this.errorHandler.onError({error:e,context:Y,customMessage:t,groupingHash:r})}}const rn="cookieStorage",nn="localStorage",on="sessionStorage",sn="memoryStorage",an="none",ln={userId:"rl_user_id",userTraits:"rl_trait",anonymousId:"rl_anonymous_id",groupId:"rl_group_id",groupTraits:"rl_group_trait",initialReferrer:"rl_page_init_referrer",initialReferringDomain:"rl_page_init_referring_domain",sessionInfo:"rl_session",authToken:"rl_auth_token"},cn="clientDataInCookie",un="clientDataInLocalStorage",dn="clientDataInSessionStorage",pn=["userId","userTraits","anonymousId","groupId","groupTraits","initialReferrer","initialReferringDomain","sessionInfo","authToken"],fn={[rn]:cn,[nn]:un,[sn]:"clientDataInMemory",[on]:dn},hn=(e,t)=>{try{return encodeURIComponent(e)}catch(e){return void t?.error("Failed to encode the cookie data.",e)}},gn=e=>{try{return decodeURIComponent(e)}catch(e){return}},yn=()=>(e=>{const t={},r=e.split(/\s*;\s*/);let n;return r[0]?(r.forEach(e=>{n=e.split("=");const r=n[0]?gn(n[0]):void 0;r&&(t[r]=n[1]?gn(n[1]):void 0)}),t):t})(globalThis.document.cookie),vn=function(e,t,r,n){switch(arguments.length){case 4:case 3:case 2:return((e,t,r,n)=>{const o={...r||{}};let i=`${hn(e,n)}=${hn(t,n)}`;w(t)&&(o.maxage=-1),o.maxage&&(o.expires=new Date(+new Date+o.maxage)),o.path&&(i+=`; path=${o.path}`),o.domain&&(i+=`; domain=${o.domain}`),o.expires&&(i+=`; expires=${o.expires.toUTCString()}`),o.samesite&&(i+=`; samesite=${o.samesite}`),o.secure&&(i+="; secure"),globalThis.document.cookie=i})(e,t,r,n);case 1:return e?(e=>yn()[e])(e):yn();default:return yn()}},mn=e=>{const t="function"!=typeof globalThis.URL?(e=>{const t=document.createElement("a");return t.href=e,t.hostname})(e):new URL(e).hostname,r=t?.split(".")??[],n=r[r.length-1],o=[];if(4===r.length&&n&&n===parseInt(n,10).toString())return o;if(r.length<=1)return r[0]&&-1!==r[0].indexOf("localhost")?["localhost"]:o;for(let e=r.length-2;e>=0;e-=1)o.push(r.slice(e).join("."));return o},bn=()=>{const e=`.${(e=>{const t=mn(e);for(let e=0;e<t.length;e+=1){const r=t[e],n="__tld__",o={domain:`${-1!==r.indexOf("localhost")?""
2:"."}${r}`};try{if(vn(n,1,o),vn(n))return vn(n,null,o),r}catch{try{vn(n,null,o)}catch{}}}return""})(globalThis.location.href)}`;return{maxage:31536e6,path:"/",domain:e&&"."!==e?e:void 0,samesite:"Lax",enabled:!0}};const Sn=new class{isEnabled=!0;length=0;data={};constructor(e){this.options={enabled:!0},this.logger=e}configure(e){return this.options=D(this.options,e??{}),this.isEnabled=Boolean(this.options.enabled),this.options}setItem(e,t){return this.data[e]=t,this.length=Object.keys(this.data).length,t}getItem(e){return e in this.data?this.data[e]:null}removeItem(e){return e in this.data&&delete this.data[e],this.length=Object.keys(this.data).length,null}clear(){this.data={},this.length=0}key(e){return this.keys()[e]??null}keys(){return Object.keys(this.data)}}(bt);function En(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wn,An={exports:{}};var In=(wn||(wn=1,An.exports=function(){function e(e){return e=JSON.stringify(e),!!/^\{[\s\S]*\}$/.test(e)}function t(e){return void 0===e||"function"==typeof e?e+"":JSON.stringify(e)}function r(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}}function n(e){return"[object Function]"==={}.toString.call(e)}function o(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){var t="_Is_Incognit",r="yes";try{e||(e=window.localStorage),e.setItem(t,r),e.removeItem(t)}catch(t){var n={_data:{},setItem:function(e,t){return n._data[e]=String(t)},getItem:function(e){return n._data.hasOwnProperty(e)?n._data[e]:void 0},removeItem:function(e){return delete n._data[e]},clear:function(){return n._data={}}};e=n}finally{e.getItem(t)===r&&e.removeItem(t)}return e}var s=i();function a(){if(!(this instanceof a))return new a}a.prototype={set:function(r,n){if(r&&!e(r))s.setItem(r,t(n));else if(e(r))for(var o in r)this.set(o,r[o]);return this},get:function(e){if(void 0===e){var t={};return this.forEach(function(e,r){return t[e]=r}),t}if("?"===e.charAt(0))return this.has(e.substr(1));var n=arguments;if(n.length>1){for(var o={},i=0,a=n.length;i<a;i++){var l=r(s.getItem(n[i]));this.has(n[i])&&(o[n[i]]=l)}return o}return r(s.getItem(e))},clear:function(){return s.clear(),this},remove:function(e){var t=this.get(e);return s.removeItem(e),t},has:function(e){return{}.hasOwnProperty.call(this.get(),e)},keys:function(){var e=[];return this.forEach(function(t){e.push(t)}),e},forEach:function(e){for(var t=0,r=s.length;t<r;t++){var n=s.key(t);e(n,this.get(n))}return this},search:function(e){for(var t=this.keys(),r={},n=0,o=t.length;n<o;n++)t[n].indexOf(e)>-1&&(r[t[n]]=this.get(t[n]));return r},len:function(){return s.length}};var l=null;function c(t,r){var i=arguments,s=null;if(l||(l=a()),0===i.length)return l.get();if(1===i.length){if("string"==typeof t)return l.get(t);if(e(t))return l.set(t)}if(2===i.length&&"string"==typeof t){if(!r)return l.remove(t);if(r&&"string"==typeof r)return l.set(t,r);r&&n(r)&&(s=null,s=r(t,l.get(t)),c.set(t,s))}if(2===i.length&&o(t)&&n(r))for(var u=0,d=t.length;u<d;u++)s=r(t[u],l.get(t[u])),c.set(t[u],s);return c}for(var u in a.prototype)c[u]=a.prototype[u];return c}()),An.exports);const kn=En(In),Tn=e=>{const t=[22,1014];return e instanceof DOMException&&(["QuotaExceededError","NS_ERROR_DOM_QUOTA_REACHED"].includes(e.name)||t.includes(e.code))},On=(e=nn,t,r)=>{let n,o;const i=`${Q}${ge}The "${e}" storage type is `;let s,a="unavailable",l=!0;try{switch(e){case sn:return!0;case rn:n=t,o="test_rudder_cookie";break;case nn:n=t??globalThis.localStorage,o="test_rudder_ls";break;case on:n=t??globalThis.sessionStorage,o="test_rudder_ss";break;default:return!1}if(n&&(n.setItem(o,"true"),n.getItem(o)))return n.removeItem(o),!0;l=!1}catch(e){l=!1,s=e,Tn(e)&&(a="full")}return l||r?.warn(`${i}${a}.`,s),!1};const Pn=new class{isSupportAvailable=!0;isEnabled=!0;length=0;constructor(e){this.options={enabled:!0},this.logger=e}configure(e){return this.options=D(this.options,e??{}),this.isSupportAvailable=On(nn),this.isEnabled=Boolean(this.options.enabled&&this.isSupportAvailable),this.options}setItem(e,t){kn.set(e,t),this.length=kn.len()}getItem(e){const t=kn.get(e);return A(t)?null:t}removeItem(e){kn.remove(e),this.length=kn.len()}clear(){kn.clear(),this.length=0}key(e){return this.keys()[e]??null}keys(){return kn.keys()}}(bt);const Cn=new class{isSupportAvailable=!0;isEnabled=!0;length=0;constructor(e){this.options={enabled:!0},this.logger=e}configure(e){return this.options=D(this.options,e??{}),this.isSupportAvailable=On(on),this.isSupportAvailable&&(this.store=globalThis.sessionStorage),this.isEnabled=Boolean(this.options.enabled&&this.isSupportAvailable),this.options}setItem(e,t){this.store&&(this.store.setItem(e,t),this.length=this.store.length)}getItem(e){if(!this.store)return null;const t=this.store.getItem(e);return A(t)?null:t}removeItem(e){this.store&&(this.store.removeItem(e),this.length=this.store.length)}clear(){this.store?.clear(),this.length=0}key(e){return this.store?.key(e)??null}keys(){const e=[];
2if(!this.store)return e;for(let t=0;t<this.store.length;t+=1){const r=this.store.key(t);null!==r&&e.push(r)}return e}}(bt);const _n=new class{isSupportAvailable=!0;isEnabled=!0;length=0;constructor(e){this.logger=e}configure(e){return this.options||(this.options=bn()),this.options=D(this.options,e??{}),this.options.sameDomainCookiesOnly&&delete this.options.domain,this.isSupportAvailable=On(rn,this),this.isEnabled=Boolean(this.options.enabled&&this.isSupportAvailable),this.options}setItem(e,t){return vn(e,t,this.options,this.logger),this.length=Object.keys(vn()).length,!0}getItem(e){const t=vn(e);return A(t)?null:t}removeItem(e){const t=this.setItem(e,null);return this.length=Object.keys(vn()).length,t}clear(){}key(e){return this.keys()[e]??null}keys(){return Object.keys(vn())}}(bt),Dn=e=>{switch(e){case nn:return Pn;case on:return Cn;case sn:return Sn;case rn:return _n;default:return Sn}},xn=(e={},t={},r={},n={})=>{var o;(e=>{const t=_n.configure(e);ur.storage.cookie.value={maxage:t.maxage,path:t.path,domain:t.domain,samesite:t.samesite,expires:t.expires,secure:t.secure}})(e),o=t,Pn.configure(o),(e=>{Sn.configure(e)})(r),(e=>{Cn.configure(e)})(n)};class Rn{constructor(e,t,r){this.id=e.id,this.name=e.name,this.isEncrypted=e.isEncrypted??!1,this.validKeys=e.validKeys??{},this.engine=t,this.noKeyValidation=0===Object.keys(this.validKeys).length,this.noCompoundKey=e.noCompoundKey,this.originalEngine=this.engine,this.errorHandler=e.errorHandler,this.logger=e.logger,this.pluginsManager=r}createValidKey(e){const{name:t,id:r,validKeys:n,noKeyValidation:o,noCompoundKey:i}=this;if(o)return i?e:[t,r,e].join(".");let s;return Object.values(n).forEach(n=>{n===e&&(s=i?e:[t,r,e].join("."))}),s}swapQueueStoreToInMemoryEngine(){const{name:e,id:t,validKeys:r,noCompoundKey:n}=this,o=Dn(sn);Object.keys(r).forEach(i=>{const s=this.get(r[i]),a=n?i:[e,t,i].join(".");o.setItem(a,s),this.remove(i)}),this.engine=o}set(e,t){const r=this.createValidKey(e);if(r)try{this.engine.setItem(r,this.encrypt(Ee(t,!1,[],this.logger)))}catch(r){if(Tn(r))this.logger.warn(`${`Store ${this.id}`}${ge}The storage is either full or unavailable, so the data will not be persisted. Switching to in-memory storage.`),this.swapQueueStoreToInMemoryEngine(),this.set(e,t);else{const t=(e=>`Failed to save the value for "${e}" to storage`)(e);this.onError(r,t,t)}}}get(e){const t=this.createValidKey(e);let r;try{return t?(r=this.decrypt(this.engine.getItem(t)),I(r)||""===r?null:JSON.parse(r)):null}catch(t){const r=ur.storage.encryptionPluginName.value;if(!r||!ur.plugins.failedPlugins.value.includes(r)){const r=(e=>`Failed to retrieve or parse data for "${e}" from storage`)(e);this.onError(t,r,r)}return null}}remove(e){const t=this.createValidKey(e);t&&this.engine.removeItem(t)}getOriginalEngine(){return this.originalEngine}decrypt(e){return I(e)?null:this.crypto(e,"decrypt")}encrypt(e){return this.crypto(e,"encrypt")}crypto(e,t){const r=!this.isEncrypted||!e||"string"!=typeof e||""===(e=>e.replace(/^\s+|\s+$/gm,""))(e);if(r)return e;const n=`storage.${t}`,o=this.pluginsManager?this.pluginsManager.invokeSingle(n,e):e;return void 0===o?e:o??""}onError(e,t,r){this.errorHandler.onError({error:e,context:`Store ${this.id}`,customMessage:t,groupingHash:r})}}class jn{stores={};isInitialized=!1;constructor(e,t,r){this.errorHandler=t,this.logger=r,this.pluginsManager=e}init(){if(this.isInitialized)return;const e=ur.loadOptions.value,t={cookieStorageOptions:{samesite:e.sameSiteCookie,secure:e.secureCookie,domain:e.setCookieDomain,sameDomainCookiesOnly:e.sameDomainCookiesOnly},localStorageOptions:{},inMemoryStorageOptions:{},sessionStorageOptions:{}};xn(R(D(t.cookieStorageOptions??{},ur.storage.cookie?.value??{})),R(t.localStorageOptions),R(t.inMemoryStorageOptions),R(t.sessionStorageOptions)),this.initClientDataStores(),this.isInitialized=!0}initClientDataStores(){this.initializeStorageState();[sn,nn,rn,on].forEach(e=>{Dn(e)?.isEnabled&&this.setStore({id:fn[e],name:fn[e],isEncrypted:!0,noCompoundKey:!0,type:e,errorHandler:this.errorHandler,logger:this.logger})})}initializeStorageState(){let e=ur.storage.type.value,t=ur.loadOptions.value.storage?.entries;const r=ur.consents.postConsent.value.storage;
2(k(r?.type)||k(r?.entries))&&(e=r?.type,t=r?.entries);let n=!0,o={};pn.forEach(r=>{const i=r,s=r,a=t?.[i]?.type,l=((e,t)=>{let r;if(e.consents.preConsent.value.enabled)switch(e.consents.preConsent.value.storage?.strategy){case"none":r=an;break;case"session":"sessionInfo"!==t&&(r=an);break;case"anonymousId":"anonymousId"!==t&&(r=an)}return r})(ur,r),c=l??a??e??wt,u=this.getResolvedStorageTypeForEntry(c,r);u!==an&&(n=!1),o={...o,[r]:{type:u,key:ln[s]}}}),qe(()=>{ur.storage.type.value=e,ur.storage.entries.value=o,ur.storage.trulyAnonymousTracking.value=n})}getResolvedStorageTypeForEntry(e,t){let r=e;switch(e){case nn:Dn(nn)?.isEnabled||(r=sn);break;case on:Dn(on)?.isEnabled||(r=sn);break;case sn:case an:break;default:r=Dn(rn)?.isEnabled?rn:Dn(nn)?.isEnabled?nn:Dn(on)?.isEnabled?on:sn}return r!==e&&this.logger.warn(((e,t,r,n)=>`${e}${ge}The storage type "${r}" is not available for entry "${t}". The SDK will initialize the entry with "${n}" storage type instead.`)("StoreManager",t,e,r)),r}setStore(e){const t=Dn(e.type);return this.stores[e.id]=new Rn(e,t,this.pluginsManager),this.stores[e.id]}getStore(e){return this.stores[e]}}const $n=e=>{const t=new URL(e),{host:r,protocol:n}=t,o=r.split(".");let i;return i=o.length>2?`${o[o.length-2]}.${o[o.length-1]}`:r,{topDomain:i,protocol:n}},Ln=(e,t)=>`${t?window.location.origin:(e=>{const{topDomain:t,protocol:r}=$n(e);return`${r}//${t}`})(window.location.href)}/${e.startsWith("/")?e.substring(1):e}`,Nn=e=>e?.endsWith("/")?Nn(e.substring(0,e.length-1)):e,Mn=e=>{try{return new URL(e).host}catch(e){return null}},Un=e=>Mn(e)??"",Bn=e=>{const t={};try{const r=new URL(e),n="utm_";r.searchParams.forEach((e,r)=>{if(r.startsWith(n)){let o=r.substring(n.length);"campaign"===o&&(o="name"),t[o]=e}})}catch(e){}return t},Fn=e=>{if(!E(e))return!1;try{return S(globalThis.URL)&&new URL(e),Rt.test(e)}catch(e){return!1}},Gn="none",Hn="immediate",Kn=e=>x(e)||Array.isArray(e),Wn=(e,t)=>{let{provider:r}=e;const n=r?Gt[r]:void 0;var o;return r&&!n&&(t.error((o=Gt,`${J}${ge}The consent manager "${r}" is not supported. Please choose one of the following supported consent managers: "${Object.keys(o)}".`)),r=void 0),{provider:r,consentManagerPluginName:n}},Vn=(e,t)=>{let r,n,o=[],i=[],s=!1,a=!0===e?.enabled;x(e)&&a&&(({provider:n,consentManagerPluginName:r}=Wn(e,t)),Kn(e.allowedConsentIds)&&(o=e.allowedConsentIds,s=!0),Kn(e.deniedConsentIds)&&(i=e.deniedConsentIds,s=!0));const l={allowedConsentIds:o,deniedConsentIds:i};return a=a&&Boolean(r),{provider:n,consentManagerPluginName:r,initialized:s,enabled:a,consentsData:l}},qn=e=>{var t;ur.reporting.isErrorReportingEnabled.value=(t=e.source.config,!0===t?.statsCollection?.errors?.enabled&&!window.chrome?.runtime?.id),ur.reporting.isMetricsReportingEnabled.value=(e=>!0===e?.statsCollection?.metrics?.enabled)(e.source.config)},zn=e=>{const{useServerSideCookies:t,dataServiceEndpoint:r,storage:n,setCookieDomain:o,sameDomainCookiesOnly:i}=ur.loadOptions.value;let s,a=n?.cookie,l=!1;if(t){l=t;const n=a.domain??o,c=k(n)&&!(e=>{const{topDomain:t}=$n(window.location.href);return t===e})(U(n))||i,u=Ln(r??"rsaRequest",c);if(Fn(u)){s=Nn(u);const t=Mn(window.location.href),r=Mn(u);t!==r&&(a={...a,samesite:"None",secure:!0}),!i&&c&&r!==U(n)&&(l=!1,e.warn(((e,t,r)=>`${e}${ge}The provided cookie domain (${t}) does not match the current webpage's domain (${r}). Hence, the cookies will be set client-side.`)(J,n,r)))}else l=!1}return{sscEnabled:l,cookieOptions:a,finalDataServiceUrl:s}},Qn=e=>{const{storage:t}=ur.loadOptions.value;let r=t?.type;k(r)&&!(e=>"string"==typeof e&&Et.includes(e))(r)&&(e.warn(((e,t,r)=>`${e}${ge}The storage type "${t}" is not supported. Please choose one of the following supported types: "${Et}". The default type "${r}" will be used instead.`)(J,r,wt)),r=wt);let n=t?.encryption?.version;const o=n&&Ht[n];var i,s;!A(n)&&A(o)?(e.warn((i=Ht,s=Bt,`${J}${ge}The storage encryption version "${n}" is not supported. Please choose one of the following supported versions: "${Object.keys(i)}". The default version "${s}" will be used instead.`)),n=Bt):A(n)&&(n=Bt);const a=t?.migrate,l=a&&n===Bt;!0===a&&l!==a&&e.warn(((e,t,r)=>`${e}${ge}The storage data migration has been disabled because the configured storage encryption version (${t}) is not the latest (${r}). To enable storage data migration, please update the storage encryption version to the latest version.`)(J,n,Bt));const{sscEnabled:c,finalDataServiceUrl:u,cookieOptions:d}=zn(e);qe(()=>{ur.storage.type.value=r,ur.storage.cookie.value=d,ur.serverCookies.isEnabledServerSideCookies.value=c,ur.serverCookies.dataServiceUrl.value=u,ur.storage.encryptionPluginName.value=Ht[n],ur.storage.migrate.value=l})},Jn=e=>{const{provider:t,consentManagerPluginName:r,initialized:n,enabled:o,consentsData:i}=Vn(ur.loadOptions.value.consentManagement,e),s=ur.loadOptions.value.preConsent;let a=s?.storage?.strategy??Gn;var l,c;k(a)&&!["none","session","anonymousId"].includes(a)&&(a=Gn,e.warn((l=J,c=s?.storage?.strategy,`${l}${ge}The pre-consent storage strategy "${c}" is not supported. Please choose one of the following supported strategies: "none, session, anonymousId". The default strategy "${Gn}" will be used instead.`)));let u=s?.events?.delivery??Hn;k(u)&&!["immediate","buffer"].includes(u)&&(u=Hn,e.warn(((e,t,r)=>`${e}${ge}The pre-consent events delivery type "${t}" is not supported. Please choose one of the following supported types: "immediate, buffer". The default type "${r}" will be used instead.`)(J,s?.events?.delivery,Hn))),qe(()=>{ur.consents.activeConsentManagerPluginName.value=r,ur.consents.initialized.value=n,ur.consents.enabled.value=o,ur.consents.data.value=i,ur.consents.provider.value=t,ur.consents.preConsent.value={enabled:!0===ur.loadOptions.value.preConsent?.enabled&&!1===n&&!0===o,storage:{strategy:a},events:{delivery:u}}})},Xn=e=>{if(ur.dataPlaneEvents.deliveryEnabled.value){const t="XhrQueue";let r=t;ur.loadOptions.value.useBeacon&&(ur.capabilities.isBeaconAvailable.value?r="BeaconQueue":(r=t,e.warn(`${J}${ge}The Beacon API is not supported by your browser. The events will be sent using XHR instead.`))),qe(()=>{ur.dataPlaneEvents.eventsQueuePluginName.value=r})}},Yn=(e,t,r,n,o)=>{const i=new URLSearchParams({p:"npm",v:_e,build:jt,writeKey:t,lockIntegrationsVersion:r.toString(),lockPluginsVersion:n.toString()});let s=Ut,a=i,l="/sourceConfig/",c="";if(Fn(e)){const t=new URL(e);Nn(t.pathname).endsWith("/sourceConfig")||(t.pathname=`${Nn(t.pathname)}
2/sourceConfig/`),t.pathname=t.pathname.replace(/\/{2,}/g,"/"),i.forEach((e,r)=>{null===t.searchParams.get(r)&&t.searchParams.set(r,e)}),s=t.origin,l=t.pathname,a=t.searchParams,c=t.hash}else o.warn(((e,t)=>`${e}${ge}The provided source config URL "${t}" is invalid. Using the default source config URL instead.`)(J,e));return`${s}${l}?${a}${c}`},Zn=(e,t,r,n,o,i,s)=>{let a;if(i){if(!Fn(i))return s.error(`${J}${ge}The base URL "${i}" for ${e} is not valid.`),null;a=Nn(i)}else if(a=r,"cdn"===ur.context.app.value.installType){const e=(()=>{const e=document.querySelector("script[data-rsa-write-key]");if(e&&e.dataset.rsaWriteKey===ur.lifecycle.writeKey.value)return e.src;const t=document.getElementsByTagName("script"),r=/(?:^|\/)rsa(\.min)?\.js$/;for(const e of t){const t=e.getAttribute("src");if(t&&r.test(t))return t}})();e&&(a=e.split("/").slice(0,-1).concat(t).join("/"))}return o&&(a=a.replace(new RegExp(`/${Lt}/${jt}/${t}$`),`/${n}/${jt}/${t}`)),a};class eo{constructor(e,t,r){this.errorHandler=t,this.logger=r,this.httpClient=e,this.onError=this.onError.bind(this),this.processConfig=this.processConfig.bind(this)}attachEffects(){gt(()=>{this.logger.setMinLogLevel(ur.lifecycle.logLevel.value)})}init(){const{logLevel:e,configUrl:t,lockIntegrationsVersion:r,lockPluginsVersion:n,destSDKBaseURL:o,pluginsSDKBaseURL:i,integrations:s}=ur.loadOptions.value,a=((e,t,r,n)=>Zn("integrations",Dt,Nt,e,t,r,n))(_e,r,o,this.logger);if(w(a))return;let l;l=((e,t,r,n)=>Zn("plugins",xt,Mt,e,t,r,n))(_e,n,i,this.logger),null!==l&&(this.attachEffects(),ur.lifecycle.activeDataplaneUrl.value=Nn(ur.lifecycle.dataPlaneUrl.value),Qn(this.logger),Jn(this.logger),Xn(this.logger),qe(()=>{ur.lifecycle.integrationsCDNPath.value=a,ur.lifecycle.pluginsCDNPath.value=l,e&&(ur.lifecycle.logLevel.value=e),ur.lifecycle.sourceConfigUrl.value=Yn(t,ur.lifecycle.writeKey.value,r,n,this.logger),ur.metrics.metricsServiceUrl.value=`${ur.lifecycle.activeDataplaneUrl.value}/rsaMetrics`,ur.nativeDestinations.loadOnlyIntegrations.value=s}),this.getConfig())}onError(e,t,r){this.errorHandler.onError({error:e,context:J,customMessage:t,groupingHash:r})}processConfig(e,t){if(!k(e))return void(k(t)?this.onError(t.error,kt):this.onError(new Error(kt)));let r;try{r=E(e)?JSON.parse(e):e}catch(e){return void this.onError(e,At)}if(!(e=>C(e)&&C(e.source)&&!I(e.source.id)&&C(e.source.config)&&Array.isArray(e.source.destinations))(r))return void this.onError(new Error(At));if(!1===r.source.enabled)return void this.logger.error("The source is disabled. Please enable the source in the dashboard to send events.");qn(r);const n=r.source.destinations.length>0?r.source.destinations.map(e=>{return{id:e.id,displayName:e.destinationDefinition.displayName,enabled:e.enabled,config:e.config,shouldApplyDeviceModeTransformation:e.shouldApplyDeviceModeTransformation??!1,propagateEventsUntransformedOnError:e.propagateEventsUntransformedOnError??!1,userFriendlyId:(t=e.destinationDefinition.displayName,r=e.id,`${t.replaceAll(" ","-")}___${r}`),isCustomIntegration:"Custom Device Mode"===e.destinationDefinition.displayName};var t,r}):[];qe(()=>{ur.source.value={config:r.source.config,name:r.source.name,id:r.source.id,workspaceId:r.source.workspaceId},ur.nativeDestinations.configuredDestinations.value=n,ur.plugins.pluginsToLoadFromConfig.value=ur.loadOptions.value.plugins??[],(e=>{let t,r=ur.consents.resolutionStrategy.value;C(e.consentManagementMetadata)&&(ur.consents.provider.value&&(r=e.consentManagementMetadata.providers.find(e=>e.provider===ur.consents.provider.value)?.resolutionStrategy??ur.consents.resolutionStrategy.value),t=e.consentManagementMetadata),"custom"===ur.consents.provider.value&&(r=void 0),qe(()=>{ur.consents.metadata.value=f(t),ur.consents.resolutionStrategy.value=r})})(r),ur.lifecycle.status.value="configured"})}getConfig(){const e=ur.loadOptions.value.getSourceConfig;if(e){if(!S(e))return void this.logger.error((t=J,`${t}${ge}The "getSourceConfig" load API option must be a function that returns valid source configuration data.`));const r=e();r instanceof Promise?r.then(e=>this.processConfig(e)).catch(e=>{this.onError(e,"SourceConfig")}):this.processConfig(r)}else this.httpClient.getAsyncData({url:ur.lifecycle.sourceConfigUrl.value,options:{headers:{"Content-Type":void 0}},callback:this.processConfig});var t}}const to=(e=()=>document)=>e()?.referrer||"$direct",ro=(e=()=>globalThis.location,t=()=>document)=>{const r=e(),n=((e=()=>document)=>{const t=e().getElementsByTagName("link");let r="";for(let e=0;t[e];e+=1){const n=t[e];if("canonical"===n.getAttribute("rel")&&!r){r=n.getAttribute("href")??"";break}}return r})(t);let o=r.pathname;const{href:i}=r;let s=i;const{search:a}=r;if(n)try{const e=new URL(n);s=""===e.search?n+a:n,o=e.pathname}catch(e){}const l=(e=>{let t=e;
2try{const r=new URL(e);t=r.origin+r.pathname+r.search}catch(e){}return t})(s),{title:c}=t(),u=to(t);return{path:o,referrer:u,referring_domain:Un(u),search:a,title:c,url:l,tab_url:i}},no={URL:()=>!S(globalThis.URL)||!S(globalThis.URLSearchParams),Promise:()=>!S(globalThis.Promise),"Number.isNaN":()=>!S(globalThis.Number.isNaN),"Number.isInteger":()=>!S(globalThis.Number.isInteger),"Array.from":()=>!S(globalThis.Array.from),"Array.prototype.find":()=>!S(globalThis.Array.prototype.find),"Array.prototype.includes":()=>!S(globalThis.Array.prototype.includes),"String.prototype.endsWith":()=>!S(globalThis.String.prototype.endsWith),"String.prototype.startsWith":()=>!S(globalThis.String.prototype.startsWith),"String.prototype.includes":()=>!S(globalThis.String.prototype.includes),"String.prototype.replaceAll":()=>!S(globalThis.String.prototype.replaceAll),"String.fromCodePoint":()=>!S(globalThis.String.fromCodePoint),"Object.entries":()=>!S(globalThis.Object.entries),"Object.values":()=>!S(globalThis.Object.values),"Object.assign":()=>!S(globalThis.Object.assign),"Object.fromEntries":()=>!S(globalThis.Object.fromEntries),"Element.prototype.dataset":()=>!(()=>{const e=globalThis.document.createElement("div");return e.setAttribute("data-a-b","c"),!!e.dataset&&"c"===e.dataset.aB})(),TextEncoder:()=>!S(globalThis.TextEncoder)||!S(globalThis.TextDecoder),requestAnimationFrame:()=>!S(globalThis.requestAnimationFrame)||!S(globalThis.cancelAnimationFrame),CustomEvent:()=>!S(globalThis.CustomEvent),"navigator.sendBeacon":()=>!S(globalThis.navigator.sendBeacon),ArrayBuffer:()=>!S(globalThis.Uint8Array),Set:()=>!S(globalThis.Set),atob:()=>!S(globalThis.atob)},oo=`https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=${Object.keys(no).join("%2C")}`,io="rudderstackPolyfill",so=()=>!I(globalThis.navigator.userAgentData),ao=()=>{let e={density:0,width:0,height:0,innerWidth:0,innerHeight:0};return e={width:globalThis.screen.width,height:globalThis.screen.height,density:globalThis.devicePixelRatio,innerWidth:globalThis.innerWidth,innerHeight:globalThis.innerHeight},e};class lo{constructor(e,t,r){this.httpClient=e,this.errorHandler=t,this.logger=r,this.externalSrcLoader=new Ke(this.logger),this.onError=this.onError.bind(this),this.onReady=this.onReady.bind(this)}init(){this.prepareBrowserCapabilities(),this.attachWindowListeners()}detectBrowserCapabilities(){qe(()=>{ur.capabilities.storage.isCookieStorageAvailable.value=On(rn,Dn(rn),this.logger),ur.capabilities.storage.isLocalStorageAvailable.value=On(nn,void 0,this.logger),ur.capabilities.storage.isSessionStorageAvailable.value=On(on,void 0,this.logger),ur.capabilities.isBeaconAvailable.value=!I(globalThis.navigator.sendBeacon)&&S(globalThis.navigator.sendBeacon),ur.capabilities.isUaCHAvailable.value=so(),ur.capabilities.isCryptoAvailable.value=!I(globalThis.crypto)&&S(globalThis.crypto.getRandomValues),ur.capabilities.isOnline.value=globalThis.navigator.onLine,ur.context.userAgent.value=((e=()=>globalThis.navigator)=>{const t=e();if(A(t))return null;let{userAgent:r}=t;const{brave:n}=t;if(n&&Object.getPrototypeOf(n).isBrave){const e=r.match(/(chrome)\/([\w.]+)/i);e&&(r=`${r} Brave/${e[2]}`)}return r})(),ur.context.locale.value=((e=()=>globalThis.navigator)=>{const t=e();return A(t)?null:t.language??t.browserLanguage})(),ur.context.screen.value=ao(),ur.context.timezone.value=(()=>{const e=/([A-Z]+[+-]\d+)/.exec((new Date).toString());return e?.[1]?e[1]:"NA"})(),so()&&((e,t="none")=>{"none"===t&&e(void 0),"default"===t&&e(navigator.userAgentData),"full"===t&&navigator.userAgentData?.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion","fullVersionList","wow64"]).then(t=>{e(t)}).catch(()=>{e()})})(e=>{ur.context["ua-ch"].value=e},ur.loadOptions.value.uaChTrackLevel)}),gt(()=>{!0===ur.loadOptions.value.sendAdblockPage&&void 0!==ur.lifecycle.sourceConfigUrl.value&&xr(this.httpClient)})}prepareBrowserCapabilities(){ur.capabilities.isLegacyDOM.value=(()=>{const e=Object.keys(no);let t=!1;for(let r=0;r<e.length;r++){const n=no[e[r]];if(S(n)&&n()){t=!0;break}}return t})();const e=ur.loadOptions.value.polyfillURL;
2let t=oo;T(e)&&(Fn(e)?t=e:this.logger.warn(((e,t)=>`${e}${ge}The provided polyfill URL "${t}" is invalid. The default polyfill URL will be used instead.`)(Q,e)));if(ur.loadOptions.value.polyfillIfRequired&&ur.capabilities.isLegacyDOM.value&&Fn(t)){const e=t!==ur.loadOptions.value.polyfillURL;if(e){const e=`RS_polyfillCallback_${ur.lifecycle.writeKey.value}`,r=()=>{this.onReady(),delete globalThis[e]};globalThis[e]=r,t=`${t}&callback=${e}`}this.externalSrcLoader.loadJSFile({url:t,id:io,async:!0,timeout:1e4,callback:r=>{r?e||this.onReady():this.onError(new Error(((e,t)=>`Failed to load the polyfill script with ID "${e}" from URL ${t}.`)(io,t)))}})}else this.onReady()}attachWindowListeners(){globalThis.addEventListener("offline",()=>{ur.capabilities.isOnline.value=!1}),globalThis.addEventListener("online",()=>{ur.capabilities.isOnline.value=!0}),globalThis.addEventListener("resize",function(e,t,r=250){let n;return(...o)=>{globalThis.clearTimeout(n),n=globalThis.setTimeout(()=>{e.apply(t,o)},r)}}(()=>{ur.context.screen.value=ao()},this))}onReady(){this.detectBrowserCapabilities(),ur.lifecycle.status.value="browserCapabilitiesReady"}onError(e,t){this.errorHandler.onError({error:e,context:Q,groupingHash:t})}}const co=["integrations","anonymousId","originalTimestamp"],uo=["library","consentManagement","userAgent","ua-ch","screen"],po=["id","anonymous_id","user_id","sent_at","timestamp","received_at","original_timestamp","event","event_text","channel","context_ip","context_request_ip","context_passed_ip","group_id","previous_id"],fo="CustomContext",ho=new Set(["__proto__","constructor","prototype"]),go=Function.prototype.toString.call(Object),yo=(e,t=new Set)=>{if(!C(e)&&!Array.isArray(e))return!1;const r=e;return!t.has(r)&&(t.add(r),Object.keys(r).some(e=>ho.has(e)||yo(r[e],t)))},vo=(e,t)=>{const r={};return Object.keys(e).forEach(n=>{uo.includes(n)?t.warn(`${fo}${ge}The top-level custom context property "${n}" is reserved and was ignored.`):Object.defineProperty(r,n,{configurable:!0,enumerable:!0,value:e[n]===e?r:e[n],writable:!0})}),r},mo=(e,t)=>{try{if(!(e=>{if(!C(e))return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;const r=Object.prototype.hasOwnProperty.call(t,"constructor")?t.constructor:void 0;return"function"==typeof r&&r.prototype===t&&Function.prototype.toString.call(r)===go})(e))return void t.warn(Ct(fo));const r=vo(e,t);if(yo(r))return void t.warn(Ct(fo));const n=Ie(r,t);return f(n)}catch{return void t.warn(Ct(fo))}};class bo{constructor(e,t){this.state=e,this.logger=t}set(e){const t=mo(e,this.logger);if(!t)return;const r=D(f(this.state.value),t);this.state.value=j(r)}get(){return f(this.state.value)}clear(){this.state.value={}}}const So=e=>"number"==typeof e&&!Number.isNaN(e),Eo=e=>So(e)&&e>=0&&Number.isInteger(e),wo=e=>{const{cutOff:t}=e,r=Date.now();return Boolean(t?.enabled&&t.expiresAt&&r>t.expiresAt)},Ao=e=>Boolean(!e.expiresAt||Date.now()>e.expiresAt)||wo(e),Io=(e,t)=>{return!!(e&&Eo(e)&&(r=10,n=e,n.toString().length>=r))||(t.warn(((e,t,r)=>`${e}${ge}The provided session ID (${t}) is either invalid, not a positive integer, or not at least "${r}" digits long. A new session ID will be auto-generated instead.`)(Z,e,10)),!1);var r,n},ko=(e,t)=>({id:Io(e,t)?e:Date.now(),sessionStart:void 0,manualTrack:!0}),To=e=>Boolean(e===rn||e===nn||e===on||e===sn),Oo=()=>pe(),Po=e=>{const t=ro(),r={};return Object.keys(t).forEach(n=>{r[n]=e?.[n]||t[n]}),r.initial_referrer=e?.initial_referrer||ur.session.initialReferrer.value,r.initial_referring_domain=e?.initial_referring_domain||ur.session.initialReferringDomain.value,r},Co=(e,t,r)=>{C(e)&&Object.keys(e).forEach(e=>{(po.includes(e)||po.includes(e.toLowerCase()))&&r.warn(((e,t,r,n)=>`${e}${ge}The "${t}" property defined under "${r}" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (${n}).`)(X,e,t,po))})},_o=(e,t,r)=>{let n=e;const o=e=>{const t=vo(e,r);yo(t)?r.warn(Ct(X)):n=D(n,t)};return Object.keys(t).forEach(e=>{co.includes(e)||("context"!==e?o({[e]:t[e]}):!A(t[e])&&C(t[e])?o(t[e]):r.warn(`${X}${ge}Please make sure that the "context" property in the event API's "options" argument is a valid object literal with key-value pairs.`))}),n},Do=(e,t,r)=>{C(t)&&(((e,t)=>{t.anonymousId&&E(t.anonymousId)&&(e.anonymousId=t.anonymousId),x(t.integrations)&&(e.integrations=t.integrations),t.originalTimestamp&&E(t.originalTimestamp)&&(e.originalTimestamp=t.originalTimestamp)})(e,t),e.context=_o(e.context,t,r))},xo=(e,t,r,n,o={})=>{const i={channel:"web",context:{traits:f(ur.session.userTraits.value),sessionId:ur.session.sessionInfo.value.id||void 0,sessionStart:ur.session.sessionInfo.value.sessionStart||void 0,...ur.consents.enabled.value&&{consentManagement:{deniedConsentIds:f(ur.consents.data.value.de
2niedConsentIds),allowedConsentIds:f(ur.consents.data.value.allowedConsentIds),provider:ur.consents.provider.value,resolutionStrategy:ur.consents.resolutionStrategy.value}},"ua-ch":ur.context["ua-ch"].value,app:ur.context.app.value,library:ur.context.library.value,userAgent:ur.context.userAgent.value,os:ur.context.os.value,locale:ur.context.locale.value,screen:ur.context.screen.value,campaign:Bn(globalThis.location.href),page:Po(r),timezone:ur.context.timezone.value,...ur.autoTrack.enabled.value&&{autoTrack:{...ur.autoTrack.pageLifecycle.enabled.value&&{page:{pageViewId:ur.autoTrack.pageLifecycle.pageViewId.value}}}}},originalTimestamp:he(new Date),messageId:pe(),userId:e.userId||ur.session.userId.value};To(ur.storage.entries.value.anonymousId?.type)?i.anonymousId=ur.session.anonymousId.value:i.anonymousId=Oo(),ur.storage.trulyAnonymousTracking.value&&(i.context.trulyAnonymousTracking=!0),"identify"===e.type&&(i.context.traits=ur.storage.entries.value.userTraits?.type!==an?f(ur.session.userTraits.value):e.context.traits),"group"===e.type&&((e.groupId||ur.session.groupId.value)&&(i.groupId=e.groupId||ur.session.groupId.value),(e.traits||ur.session.groupTraits.value)&&(i.traits=ur.storage.entries.value.groupTraits?.type!==an?f(ur.session.groupTraits.value):e.traits));const s=D(e,i),a=D(s,{context:o});return void 0===a.event&&(a.event=null),void 0===a.properties&&(a.properties=null),Do(a,t,n),((e,t)=>{const{properties:r,traits:n,context:o}=e,{traits:i}=o;Co(r,"properties",t),Co(n,"traits",t),Co(i,"context.traits",t)})(a,n),a.integrations=(e=>{let t;return t=ur.loadOptions.value.useGlobalIntegrationsConfigInEvents?ur.consents.postConsent.value.integrations??ur.nativeDestinations.loadOnlyIntegrations.value:e||_t,f(t)})(a.integrations),a};class Ro{constructor(e){this.logger=e}generatePageEvent(e,t,r,n,o={}){let i=r??{};i=((e,t)=>{const r=t?.page||{},n=e,o=ro();return Object.keys(o).forEach(e=>{A(n[e])&&(n[e]=r[e]||o[e])}),A(n.initial_referrer)&&(n.initial_referrer=r.initial_referrer||ur.session.initialReferrer.value),A(n.initial_referring_domain)&&(n.initial_referring_domain=r.initial_referring_domain||ur.session.initialReferringDomain.value),n})(i,n);return xo({properties:i,name:t,category:e,type:"page"},n,i,this.logger,o)}generateTrackEvent(e,t,r,n={}){return xo({properties:t,event:e,type:"track"},r,void 0,this.logger,n)}generateIdentifyEvent(e,t,r,n={}){return xo({userId:e,type:"identify",context:{traits:t}},r,void 0,this.logger,n)}generateAliasEvent(e,t,r,n={}){const o=xo({previousId:t,type:"alias"},r,void 0,this.logger,n);return o.userId=e??o.userId,o}generateGroupEvent(e,t,r,n={}){const o={type:"group"};return e&&(o.groupId=e),t&&(o.traits=t),xo(o,r,void 0,this.logger,n)}create(e,t={}){let r;const{type:n,name:o,properties:i,options:s,category:a,userId:l,traits:c,to:u,from:d,groupId:p}=e;switch(n){case"page":r=this.generatePageEvent(a,o,i,s,t);break;case"track":r=this.generateTrackEvent(o,i,s,t);break;case"identify":r=this.generateIdentifyEvent(l,c,s,t);break;case"alias":r=this.generateAliasEvent(u,d,s,t);break;default:r=this.generateGroupEvent(p,c,s,t)}return r}}class jo{constructor(e,t,r,n){this.eventRepository=e,this.userSessionManager=t,this.errorHandler=r,this.logger=n,this.eventFactory=new Ro(this.logger)}init(){this.eventRepository.init()}resume(){this.eventRepository.resume()}addEvent(e,t){this.userSessionManager.refreshSession();const r=this.eventFactory.create(e,t);this.eventRepository.enqueue(r,e.callback)}}class $o{constructor(e,t,r,n,o){this.storeManager=t,this.pluginsManager=e,this.logger=o,this.errorHandler=n,this.httpClient=r,this.onError=this.onError.bind(this),this.serverSideCookieDebounceFuncs={},this.serverSideCookiesRequestInProgress={}}init(){this.syncStorageDataToState(),this.registerEffects()}syncStorageDataToState(){this.migrateStorageIfNeeded(),this.migrateDataFromPreviousStorage(),this.setUserId(this.getUserId()),this.setUserTraits(this.getUserTraits()),this.setGroupId(this.getGroupId()),this.setGroupTraits(this.getGroupTraits());const{externalAnonymousIdCookieName:e,anonymousIdOptions:t}=ur.loadOptions.value;let r;T(e)&&"string"==typeof e&&(r=this.getExternalAnonymousIdByCookieName(e)),this.setAnonymousId(r??this.getAnonymousId(t)),this.setAuthToken(this.getAuthToken()),this.setInitialReferrerInfo(),this.configureSessionTracking()}configureSessionTracking(){let e;if(this.isPersistenceEnabledForStorageEntry("sessionInfo")){const t=this.getConfiguredSessionTrackingInfo(),r=this.getSessionInfo()??Vt.sessionInfo;e={autoTrack:t.autoTrack&&!0!==r.manualTrack,timeout:t.timeout,manualTrack:r.manualTrack,expiresAt:r.expiresAt,id:r.id,sessionStart:r.sessionStart},e.autoTrack||!0===e.manualTrack?!0===t.cutOff?.enabled&&(e.cutOff={enabled:!0,duration:t.cutOff.duration,expiresAt:r.cutOff?.expiresAt}):e=Vt.sessionInfo}else e=Vt.sessionInfo;ur.session.sessionInfo.value=e,ur.session.sessionInfo.value.autoTrack&&this.startOrRenewAutoTracking(ur.session.sessionInfo.value)}setInitialReferrerInfo(){const e=this.getInitialReferrer(),t=this.getInitialReferringDomain();if(e&&t)this.setInitialReferrer(e),this.setInitialReferringDomain(t);else{const t=e||to();this.setInitialReferrer(t),this.setInitialReferringDomain(Un(t))}}isPersistenceEnabledForStorageEntry(e){return To(ur.storage.entries.value[e]?.type)}migrateDataFromPreviousStorage(){const e=ur.storage.entries.value,t=[rn,nn,on];Object.keys(e).forEach(r=>{const n=r,o=e[n]?.type,i=this.storeManager?.getStore(fn[o]);
2i&&t.forEach(e=>{const t=this.storeManager?.getStore(fn[e]);if(t&&e!==o){const e=t.get(ln[n]);(e=>T(e)&&""!==e)(e)&&i.set(ln[n],e),t.remove(ln[n])}})})}migrateStorageIfNeeded(e,t){if(!ur.storage.migrate.value)return;let r=e??[];if(0===r.length){[cn,un,dn].forEach(e=>{const t=this.storeManager?.getStore(e);t&&r.push(t)})}(t??Object.keys(ln)).forEach(e=>{const t=ln[e];r.forEach(e=>{const r=this.pluginsManager?.invokeSingle("storage.migrate",t,e.engine,this.errorHandler,this.logger);I(r)||e.set(t,r)})})}getConfiguredSessionTrackingInfo(){let e,t=!1!==ur.loadOptions.value.sessions.autoTrack;if(!t)return{autoTrack:t};const r=ur.loadOptions.value.sessions?.timeout;Eo(r)?e=r:(this.logger.warn(((e,t,r)=>`${e}${ge}The session timeout value "${t}" is not a number. The default timeout of ${r} ms will be used instead.`)(Z,r,Le)),e=Le),0===e&&(this.logger.warn(`${Z}${ge}The session timeout value is 0, which disables the automatic session tracking feature. If you want to enable session tracking, please provide a positive integer value for the timeout.`),t=!1),e>0&&e<1e4&&this.logger.warn(((e,t,r)=>`${e}${ge}The session timeout value ${t} ms is less than the recommended minimum of ${r} ms. Please consider increasing the timeout value to ensure optimal performance and reliability.`)(Z,e,1e4));return{timeout:e,autoTrack:t,cutOff:this.getCutOffInfo(e)}}getCutOffInfo(e){const t=ur.loadOptions.value.sessions.cutOff;let r,n=!1;return!0===t.enabled&&(r=t.duration,n=!0,Eo(r)?r<e&&(this.logger.warn(((e,t,r)=>`${e}${ge}The session cut off duration value "${t}" ms is less than the session timeout value "${r}" ms. The cut off functionality will be disabled.`)(Z,r,e)),n=!1):(this.logger.warn(((e,t,r)=>`${e}${ge}The session cut off duration value "${t}" is not a number. The default cut off duration of ${r} ms will be used instead.`)(Z,r,$e)),r=$e)),{enabled:n,duration:r}}onError(e,t,r){this.errorHandler.onError({error:e,context:Z,customMessage:t,groupingHash:r})}getEncryptedCookieData(e,t){const r=[];return e.forEach(e=>{const n=t?.encrypt(Ee(e.value,!1,[],this.logger));T(n)&&r.push({name:e.name,value:n})}),r}makeRequestToSetCookie(e,t){this.httpClient?.getAsyncData({url:ur.serverCookies.dataServiceUrl.value,options:{method:"POST",data:Ee({reqType:"setCookies",workspaceId:ur.source.value?.workspaceId,data:{options:{maxAge:ur.storage.cookie.value?.maxage,path:ur.storage.cookie.value?.path,domain:ur.storage.cookie.value?.domain,sameSite:ur.storage.cookie.value?.samesite,secure:ur.storage.cookie.value?.secure,expires:ur.storage.cookie.value?.expires},cookies:e}}),sendRawData:!0,withCredentials:!0},isRawResponse:!0,callback:t})}setServerSideCookies(e,t,r){const n=Object.keys(e),o=()=>n.map(t=>({name:e[t].name,value:ur.session[t].value})),i={};n.forEach(t=>{i[e[t].name]=r?.get(e[t].name)});const s=()=>{n.forEach(e=>{this.serverSideCookiesRequestInProgress[e]=!1})},a=()=>{o().forEach(e=>{t&&t(e.name,e.value)})};try{const l={};n.forEach(t=>{l[e[t].name]=ur.session[t].value});const c=this.getEncryptedCookieData(o(),r);c.length>0?this.makeRequestToSetCookie(c,(e,n)=>{var c;s(),200===n?.xhr?.status?o().forEach(e=>{const n=i[e.name],o=r?.get(e.name);Ee(l[e.name],!1,[])!==Ee(o,!1,[])&&(w(n)&&w(o)&&this.logger.error(`The server failed to set the ${e.name} cookie. As a fallback, the cookies will be set client side.`),t&&t(e.name,e.value))}):(this.logger.error((c=n?.xhr?.status,`The server responded with status ${c} while setting the cookies. As a fallback, the cookies will be set client side.`)),a())}):(a(),s())}catch(e){this.onError(e,Pt,Pt),a(),s()}}syncValueToStorage(e){const t=ur.storage.entries.value,r=t[e]?.type;if(To(r)){const n=this.storeManager.getStore(fn[r]),o=t[e]?.key,i=ur.session[e].value;i&&(E(i)||x(i))?ur.serverCookies.isEnabledServerSideCookies.value&&r===rn?(this.serverSideCookiesRequestInProgress[e]=!0,this.serverSideCookieDebounceFuncs[e]&&globalThis.clearTimeout(this.serverSideCookieDebounceFuncs[e]),this.serverSideCookieDebounceFuncs[e]=globalThis.setTimeout(()=>{const t={[e]:{name:o}};this.setServerSideCookies(t,(e,t)=>{n?.set(e,t)},n)},10)):n?.set(o,i):n?.remove(o)}}
2registerEffects(){pn.forEach(e=>{gt(()=>{this.syncValueToStorage(e)})})}setAnonymousId(e,t){let r=e;if(E(e)&&r||(r=void 0),this.isPersistenceEnabledForStorageEntry("anonymousId")){if(!r&&t){const e=this.pluginsManager?.invokeSingle("userSession.anonymousIdGoogleLinker",t);r=e}r=r||Oo()}else r=Vt.anonymousId;ur.session.anonymousId.value=r}getAnonymousId(e){const t=ur.storage.entries.value.anonymousId?.type;if(To(t)){let t=ur.session.anonymousId.value;if(t&&t!==Vt.anonymousId||(t=this.getEntryValue("anonymousId")),!t&&e){const r=this.pluginsManager?.invokeSingle("storage.getAnonymousId",Dn,e);t=r}ur.session.anonymousId.value=t||Oo()}return ur.session.anonymousId.value}getEntryValue(e){const t=ur.storage.entries.value,r=t[e]?.type;if(To(r)){const n=this.storeManager?.getStore(fn[r]);this.migrateStorageIfNeeded([n],[e]);const o=t[e]?.key;return n?.get(o)??null}return null}getExternalAnonymousIdByCookieName(e){const t=Dn(rn);return t?.isEnabled?t.getItem(e)??null:null}getUserSessionValue(e){return this.serverSideCookiesRequestInProgress[e]?ur.session[e].value:this.getEntryValue(e)}getUserId(){return this.getUserSessionValue("userId")}getUserTraits(){return this.getUserSessionValue("userTraits")}getGroupId(){return this.getUserSessionValue("groupId")}getGroupTraits(){return this.getUserSessionValue("groupTraits")}getInitialReferrer(){return this.getUserSessionValue("initialReferrer")}getInitialReferringDomain(){return this.getUserSessionValue("initialReferringDomain")}getSessionInfo(){return this.getUserSessionValue("sessionInfo")}getAuthToken(){return this.getUserSessionValue("authToken")}getSessionId(){const e=this.getSessionInfo()??Vt.sessionInfo;return e.autoTrack&&!Ao(e)||e.manualTrack?e.id??null:null}refreshSession(){let e=this.getSessionInfo()??Vt.sessionInfo;(e.autoTrack||e.manualTrack)&&(e.autoTrack&&(this.startOrRenewAutoTracking(e),e=ur.session.sessionInfo.value),void 0===e.sessionStart?e={...e,sessionStart:!0}:e.sessionStart&&(e={...e,sessionStart:!1})),ur.session.sessionInfo.value=e,"readyExecuted"!==ur.lifecycle.status.value&&this.syncValueToStorage("sessionInfo")}resetAndStartNewSession(){const e=ur.session,{manualTrack:t,autoTrack:r,timeout:n,cutOff:o}=e.sessionInfo.value;if(r){const t={...Vt.sessionInfo,timeout:n};o&&(t.cutOff={enabled:o.enabled,duration:o.duration}),e.sessionInfo.value=t,this.startOrRenewAutoTracking(e.sessionInfo.value)}else t&&this.startManualTrackingInternal()}reset(e){const{session:t}=ur,r=(e=>{if("boolean"==typeof e){const{entries:t,...r}=qt;return{...r,entries:{...t,anonymousId:e}}}return C(e)&&C(e.entries)?D(qt,e):{...qt}})(e);qe(()=>{Object.keys(Vt).forEach(e=>{const n=e;if(!0===r.entries[n])switch(e){case"anonymousId":this.setAnonymousId();break;case"sessionInfo":this.resetAndStartNewSession();break;default:t[n].value=Vt[n]}})})}setUserId(e){ur.session.userId.value=this.isPersistenceEnabledForStorageEntry("userId")&&e?e:Vt.userId}setUserTraits(e){ur.session.userTraits.value=this.isPersistenceEnabledForStorageEntry("userTraits")&&C(e)?D(ur.session.userTraits.value??Vt.userTraits,e):Vt.userTraits}setGroupId(e){ur.session.groupId.value=this.isPersistenceEnabledForStorageEntry("groupId")&&e?e:Vt.groupId}setGroupTraits(e){ur.session.groupTraits.value=this.isPersistenceEnabledForStorageEntry("groupTraits")&&C(e)?D(ur.session.groupTraits.value??Vt.groupTraits,e):Vt.groupTraits}setInitialReferrer(e){ur.session.initialReferrer.value=this.isPersistenceEnabledForStorageEntry("initialReferrer")&&e?e:Vt.initialReferrer}setInitialReferringDomain(e){ur.session.initialReferringDomain.value=this.isPersistenceEnabledForStorageEntry("initialReferringDomain")&&e?e:Vt.initialReferringDomain}startOrRenewAutoTracking(e){let t=e;if(Ao(e))t=(e=>{const{timeout:t,cutOff:r}=e,n=Date.now();return{id:n,expiresAt:n+t,timeout:t,autoTrack:!0,...r&&{cutOff:r}}})(e);else{const r=Date.now(),n=e.timeout;t.expiresAt=r+n}
2if(wo(t)&&(t.cutOff.expiresAt=void 0),t.cutOff){const e=(e=>{if(e?.enabled)return e.expiresAt??(Eo(e.duration)?Date.now()+e.duration:void 0)})(t.cutOff);t.cutOff.expiresAt=e}ur.session.sessionInfo.value=t}start(e){ur.session.sessionInfo.value=ko(e,this.logger)}startManualTrackingInternal(){this.start(Date.now())}end(){ur.session.sessionInfo.value=Vt.sessionInfo}setAuthToken(e){ur.session.authToken.value=this.isPersistenceEnabledForStorageEntry("authToken")&&e?e:Vt.authToken}}const Lo=["BeaconQueue","CustomConsentManager","DeviceModeDestinations","DeviceModeTransformation","ExternalAnonymousId","GoogleLinker","IubendaConsentManager","KetchConsentManager","NativeDestinationQueue","OneTrustConsentManager","StorageEncryption","StorageEncryptionLegacy","StorageMigrator","XhrQueue"],No="dataplaneEventsQueue",Mo="destinationsEventsQueue",Uo=(e,t)=>{const r=f(e),n=t.nativeDestinations.integrationsConfig.value,o=((e,t)=>Object.keys(e).filter(r=>!0!==e[r]||!t[r]).reduce((t,r)=>{const n=f(t);return n[r]=e[r],n},{}))(e.integrations,n);return r.integrations=D(n,o),r},Bo=(e,t,r,n)=>{if(k(e))if(S(e))try{e(...t)}catch(e){n.error(`${r}${ge}The callback threw an exception`,e)}else n.error(Tt(r))};class Fo{constructor(e,t,r,n,o){this.pluginsManager=e,this.errorHandler=n,this.httpClient=r,this.logger=o,this.storeManager=t}init(){this.dataplaneEventsQueue=this.pluginsManager.invokeSingle(`${No}.init`,ur,this.httpClient,this.storeManager,this.errorHandler,this.logger),this.dmtEventsQueue=this.pluginsManager.invokeSingle("transformEvent.init",ur,this.pluginsManager,this.httpClient,this.storeManager,this.errorHandler,this.logger),this.destinationsEventsQueue=this.pluginsManager.invokeSingle(`${Mo}.init`,ur,this.pluginsManager,this.storeManager,this.dmtEventsQueue,this.errorHandler,this.logger),gt(()=>{!0===ur.nativeDestinations.clientDestinationsReady.value&&(this.destinationsEventsQueue?.start(),this.dmtEventsQueue?.start())});const e=(e=>e.consents.preConsent.value.enabled&&"buffer"===e.consents.preConsent.value.events?.delivery)(ur);let t;gt(()=>{const r=!0===ur.loadOptions.value.bufferDataPlaneEventsUntilReady&&!1===ur.nativeDestinations.clientDestinationsReady.value;!1!==ur.nativeDestinations.activeDestinations.value.some(e=>{return t=e,Boolean("hybrid"===t.config.connectionMode||!0===t.config.useNativeSDKToSend);var t})&&!1!==r||e||!0===this.dataplaneEventsQueue?.scheduleTimeoutActive||(globalThis.clearTimeout(t),this.dataplaneEventsQueue?.start())}),!0===ur.loadOptions.value.bufferDataPlaneEventsUntilReady&&(t=globalThis.setTimeout(()=>{!0!==this.dataplaneEventsQueue?.scheduleTimeoutActive&&this.dataplaneEventsQueue?.start()},ur.loadOptions.value.dataPlaneEventsBufferTimeout))}resume(){!0!==this.dataplaneEventsQueue?.scheduleTimeoutActive&&(ur.consents.postConsent.value.discardPreConsentEvents&&(this.dataplaneEventsQueue?.clear(),this.destinationsEventsQueue?.clear()),this.dataplaneEventsQueue?.start())}enqueue(e,t){const r=Uo(e,ur);this.pluginsManager.invokeSingle(`${No}.enqueue`,ur,this.dataplaneEventsQueue,r,this.errorHandler,this.logger);const n=f(e);this.pluginsManager.invokeSingle(`${Mo}.enqueue`,ur,this.destinationsEventsQueue,n,this.errorHandler,this.logger);const o=`${e.type.charAt(0).toUpperCase()}${e.type.slice(1)}${z}`;Bo(t,[r],o,this.logger)}}const Go=e=>{const t=new CustomEvent(e,{detail:{analyticsInstance:globalThis.rudderanalytics},bubbles:!0,cancelable:!0,composed:!0});globalThis.document.dispatchEvent(t)};class Ho{constructor(){this.preloadBuffer=new yt,this.initialized=!1,this.errorHandler=Fr,this.logger=bt,this.customContextStore=new bo(ur.customContext,this.logger),this.externalSrcLoader=new Ke(this.logger),this.httpClient=Cr,this.httpClient.init(this.errorHandler),this.capabilitiesManager=new lo(this.httpClient,this.errorHandler,this.logger)}load(e,t,r={}){if(ur.lifecycle.status.value)return;if(!(e=>E(e)&&e.trim().length>0)(e))return void this.logger.error(((e,t)=>`${e}${ge}The write key "${t}" is invalid. It must be a non-empty string. Please check that the write key is correct and try again.`)(oe,e));if(!(e=>Fn(e))(t))return void this.logger.error(((e,t)=>`${e}${ge}The data plane URL "${t}
2" is invalid. It must be a valid URL string. Please check that the data plane URL is correct and try again.`)(oe,t));const{context:n,...o}=r,i=Ie(o);void 0!==n&&this.customContextStore.set(n),qe(()=>{ur.lifecycle.writeKey.value=f(e),ur.lifecycle.dataPlaneUrl.value=f(t),ur.loadOptions.value=((e,t)=>{const r=f(t);return E(r.setCookieDomain)||(r.setCookieDomain=void 0),["Strict","Lax","None"].includes(r.sameSiteCookie)||(r.sameSiteCookie=void 0),r.secureCookie=N(r.secureCookie,e.secureCookie),r.sameDomainCookiesOnly=N(r.sameDomainCookiesOnly,e.sameDomainCookiesOnly),["none","default","full"].includes(r.uaChTrackLevel)||(r.uaChTrackLevel=void 0),r.integrations=L(r.integrations),Array.isArray(r.plugins)||(r.plugins=Lo),r.useGlobalIntegrationsConfigInEvents=N(r.useGlobalIntegrationsConfigInEvents,e.useGlobalIntegrationsConfigInEvents),r.bufferDataPlaneEventsUntilReady=N(r.bufferDataPlaneEventsUntilReady,e.bufferDataPlaneEventsUntilReady),r.sendAdblockPage=N(r.sendAdblockPage,e.sendAdblockPage),r.useServerSideCookies=N(r.useServerSideCookies,e.useServerSideCookies),E(r.dataServiceEndpoint)||(r.dataServiceEndpoint=void 0),r.sendAdblockPageOptions=L(r.sendAdblockPageOptions),r.loadIntegration=N(r.loadIntegration,e.loadIntegration),x(r.storage)?(r.storage.migrate=N(r.storage.migrate,e.storage?.migrate),r.storage.cookie=L(r.storage.cookie),r.storage.encryption=L(r.storage.encryption),r.storage=j(r.storage)):r.storage=void 0,r.destinationsQueueOptions=L(r.destinationsQueueOptions),r.queueOptions=L(r.queueOptions),r.lockIntegrationsVersion=N(r.lockIntegrationsVersion,e.lockIntegrationsVersion),r.lockPluginsVersion=N(r.lockPluginsVersion,e.lockPluginsVersion),So(r.dataPlaneEventsBufferTimeout)||(r.dataPlaneEventsBufferTimeout=void 0),r.beaconQueueOptions=L(r.beaconQueueOptions),r.preConsent=L(r.preConsent),r.sourceConfigurationOverride=L(r.sourceConfigurationOverride),D(e,j(r))})(ur.loadOptions.value,i),ur.lifecycle.status.value="mounted"}),this.logger.setMinLogLevel(ur.loadOptions.value.logLevel??mt),Me("state",ur,e),this.startLifecycle()}setCustomContext(e){ur.lifecycle.loaded.value?this.customContextStore.set(e):ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,["setCustomContext",e]]}getCustomContext(){return this.customContextStore.get()}clearCustomContext(){ur.lifecycle.loaded.value?this.customContextStore.clear():ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,["clearCustomContext"]]}startLifecycle(){gt(()=>{try{switch(ur.lifecycle.status.value){case"mounted":this.onMounted();break;case"browserCapabilitiesReady":this.onBrowserCapabilitiesReady();break;case"configured":this.onConfigured();break;case"pluginsLoading":case"destinationsLoading":case"readyExecuted":default:break;case"pluginsReady":this.onPluginsReady();break;case"initialized":this.onInitialized();break;case"loaded":this.onLoaded();break;case"destinationsReady":this.onDestinationsReady();break;case"ready":this.onReady()}}catch(e){const t="Failed to load the SDK";this.errorHandler.onError({error:e,context:oe,customMessage:t,groupingHash:t})}})}onBrowserCapabilitiesReady(){Fe(this),this.prepareInternalServices(),this.loadConfig()}onLoaded(){this.processBufferedEvents(),!0===ur.consents.preConsent.value.enabled?ur.lifecycle.status.value="ready":this.loadDestinations()}onMounted(){this.capabilitiesManager.init()}enqueuePreloadBufferEvents(e){Array.isArray(e)&&e.forEach(e=>this.preloadBuffer.enqueue(f(e)))}processDataInPreloadBuffer(){for(;this.preloadBuffer.size()>0;){const e=this.preloadBuffer.dequeue();e&&Ge([...e],this)}}prepareInternalServices(){this.pluginsManager=new tn(Gr,this.errorHandler,this.logger),this.storeManager=new jn(this.pluginsManager,this.errorHandler,this.logger),this.configManager=new eo(this.httpClient,this.errorHandler,this.logger),this.userSessionManager=new $o(this.pluginsManager,this.storeManager,this.httpClient,this.errorHandler,this.logger),this.eventRepository=new Fo(this.pluginsManager,this.storeManager,this.httpClient,this.errorHandler,this.logger),this.eventManager=new jo(this.eventRepository,this.userSessionManager,this.errorHandler,this.logger)}loadConfig(){ur.lifecycle.writeKey.value&&this.httpClient.setAuthHeader(ur.lifecycle.writeKey.value),this.configManager?.init()}onPluginsReady(){this.storeManager?.init(),this.userSessionManager?.init(),ur.consents.enabled.value&&!ur.consents.initialized.value&&(this.pluginsManager?.invokeSingle("consentManager.init",ur,this.logger),!1===ur.consents.preConsent.value.enabled&&this.pluginsManager?.invokeSingle("consentManager.updateConsentsInfo",ur,this.storeManager,this.logger)),this.eventManager?.init(),ur.lifecycle.status.value="initialized"}onConfigured(){this.pluginsManager?.init()}onInitialized(){this.processDataInPreloadBuffer(),qe(()=>{ur.lifecycle.loaded.value=!0,ur.lifecycle.status.value="loaded"}),this.initialized=!0;const e=ur.loadOptions.value.onLoaded;Bo(e,[globalThis.rudderanalytics],ne,this.logger),Go("RSA_Initialised")}onReady(){ur.lifecycle.status.value="readyExecuted",ur.eventBuffer.readyCallbacksArray.value.forEach(e
2=>{Bo(e,[],re,this.logger)}),Go("RSA_Ready")}processBufferedEvents(){let e=ur.eventBuffer.toBeProcessedArray.value;for(;e.length>0;){const t=e.shift();ur.eventBuffer.toBeProcessedArray.value=e,t&&this.processBufferedEvent(t),e=ur.eventBuffer.toBeProcessedArray.value}}processBufferedEvent(e){switch(e[0]){case"setCustomContext":this.setCustomContext(e[1]);break;case"clearCustomContext":this.clearCustomContext();break;case"ready":this.ready(e[1],!0);break;case"page":this.page(e[1],!0,e[2]);break;case"track":this.track(e[1],!0,e[2]);break;case"identify":this.identify(e[1],!0,e[2]);break;case"alias":this.alias(e[1],!0,e[2]);break;case"group":this.group(e[1],!0,e[2]);break;case"reset":this.reset(e[1],!0);break;case"setAnonymousId":this.setAnonymousId(e[1],e[2],!0);break;case"startSession":this.startSession(e[1],!0);break;case"endSession":this.endSession(!0);break;case"consent":this.consent(e[1],!0);break;case"addCustomIntegration":this.addCustomIntegration(e[1],e[2],!0);break;default:return e}}getInvocationContext(e){if(void 0===e)return this.customContextStore.get();return mo(e,this.logger)??{}}loadDestinations(){if("destinationsLoading"===ur.lifecycle.status.value||!0===ur.nativeDestinations.clientDestinationsReady.value)return;this.pluginsManager?.invokeSingle("nativeDestinations.setActiveDestinations",ur,this.pluginsManager,this.errorHandler,this.logger);const e=ur.nativeDestinations.activeDestinations.value.length;0!==e?(ur.lifecycle.status.value="destinationsLoading",this.pluginsManager?.invokeSingle("nativeDestinations.load",ur,this.externalSrcLoader,this.errorHandler,this.logger),gt(()=>{ur.nativeDestinations.initializedDestinations.value.length+ur.nativeDestinations.failedDestinations.value.length===e&&qe(()=>{ur.lifecycle.status.value="destinationsReady",ur.nativeDestinations.clientDestinationsReady.value=!0})})):qe(()=>{ur.nativeDestinations.clientDestinationsReady.value=!0,ur.lifecycle.status.value="destinationsReady"})}onDestinationsReady(){"ready"!==ur.lifecycle.status.value&&qe(()=>{ur.lifecycle.status.value="ready"})}ready(e,t=!1){const r="ready";ur.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb(`New ${r} invocation`),S(e)?"readyExecuted"===ur.lifecycle.status.value?Bo(e,[],re,this.logger):ur.eventBuffer.readyCallbacksArray.value=[...ur.eventBuffer.readyCallbacksArray.value,e]:this.logger.error(Tt(re))):ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[r,e]]}page(e,t=!1,r){const n="page";if(!ur.lifecycle.loaded.value)return void(ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[n,e]]);const o=this.getInvocationContext(r);this.errorHandler.leaveBreadcrumb(`New ${n} event`),ur.metrics.triggered.value+=1,this.eventManager?.addEvent({type:"page",category:e.category,name:e.name,properties:e.properties,options:e.options,callback:e.callback},o),!0===ur.capabilities.isAdBlocked.value&&e.category!==De&&this.page(G(De,"ad-block page request",{path:"/ad-blocked"},ur.loadOptions.value.sendAdblockPageOptions),t,o)}track(e,t=!1,r){const n="track";if(!ur.lifecycle.loaded.value)return void(ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[n,e]]);const o=this.getInvocationContext(r);this.errorHandler.leaveBreadcrumb(`New ${n} event - ${e.name}`),ur.metrics.triggered.value+=1,this.eventManager?.addEvent({type:n,name:e.name||void 0,properties:e.properties,options:e.options,callback:e.callback},o)}identify(e,t=!1,r){const n="identify";if(!ur.lifecycle.loaded.value)return void(ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[n,e]]);const o=this.getInvocationContext(r);this.errorHandler.leaveBreadcrumb(`New ${n} event`),ur.metrics.triggered.value+=1;Boolean(e.userId&&ur.session.userId.value&&e.userId!==ur.session.userId.value)&&this.reset(),w(e.userId)||this.userSessionManager?.setUserId(e.userId),this.userSessionManager?.setUserTraits(e.traits),this.eventManager?.addEvent({type:n,userId:e.userId,traits:e.traits,options:e.options,callback:e.callback},o)}alias(e,t=!1,r){const n="alias";if(!ur.lifecycle.loaded.value)return void(ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[n,e]]);const o=this.getInvocationContext(r);this.errorHandler.leaveBreadcrumb(`New ${n} event`),ur.metrics.triggered.value+=1;const i=e.from??(this.getUserId()||this.userSessionManager?.getAnonymousId());this.eventManager?.addEvent({type:n,to:e.to,from:i,options:e.options,callback:e.callback},o)}group(e,t=!1,r){const n="group";if(!ur.lifecycle.loaded.value)return void(ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[n,e]]);const o=this.getInvocationContext(r);this.errorHandler.leaveBreadcrumb(`New ${n} event`),ur.metrics.triggered.value+=1,w(e.groupId)||this.userSessionManager?.setGroupId(e.groupId),this.userSessionManager?.setGroupTraits(e.traits),this.eventManager?.addEvent({type:n,groupId:e.groupId,traits:e.traits,options:e.options,callback:e.callback},o)}reset(e,t=!1){const r="reset";ur.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb(`New ${r} invocation`),this.userSessionManager?.reset(e)):ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[r,e]]}getAnonymousId(e){return this.userSessionManager?.getAnonymousId(e)}setAnonymousId(e,t,r=!1){const n="setAnonymousId";ur.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb(`New ${n} invocation`),this.userSessionManager?.setAnonymousId(e,t)):ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[n,e,t]]}getUserId(){return ur.session.userId.value}getUserTraits(){return ur.session.userTraits.value}getGroupId(){return ur.session.groupId.value}getGroupTraits(){return ur.session.groupTraits.value}startSession(e,t=!1){const r="startSession";ur.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb(`New ${r} invocation`),this.userSessionManager?.start(e)):ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[r,e]]}endSession(e=!1){const t="endSession";ur.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb(`New ${t} invocation`),this.userSessionManager?.end()):ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[t]]}getSessionId(){const e=this.userSessionManager?.getSessionId();return e??null}consent(e,t=!1){ur.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb("New consent invocation"),qe(()=>{ur.consents.preConsent.value={...ur.consents.preConsent.value,enabled:!1},ur.consents.postConsent.value=(e=>{const t={sendPageEvent:!1,trackConsent:!1,discardPreConsentEvents:!1};if(C(e)){const r=f(e);t.storage=r.storage,x(r.integrations)&&(t.integrations=r.integrations),t.discardPreConsentEvents=!0===r.discardPreConsentEvents,t.sendPageEvent=!0===r.sendPageEvent,t.trackConsent=!0===r.trackConsent,x(r.consentManagement)&&(t.consentManagement=D(r.consentManagement,{enabled:ur.consents.enabled.value}))}return t})(e);const{initialized:t,consentsData:r}=Vn(ur.consents.postConsent.value.consentManagement,this.logger);ur.consents.initialized.value=t,ur.consents.data.value=r}),ur.consents.enabled.value&&!ur.consents.initialized.value&&this.pluginsManager?.invokeSingle("consentManager.updateConsentsInfo",ur,this.storeManager,this.logger),this.storeManager?.initializeStorageState(),this.userSessionManager?.syncStorageDataToState(),this.eventManager?.resume(),this.loadDestinations(),this.sendTrackingEvents(t)):ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,["consent",e]]}sendTrackingEvents(e){if(ur.consents.postConsent.value.trackConsent){const t=H("Consent Management Interaction");e?ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,["track",t,this.customContextStore.get()]]:this.track(t)}if(ur.consents.postConsent.value.sendPageEvent){const t=G();e?ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,["page",t,this.customContextStore.get()]]:this.page(t)}}setAuthToken(e){this.userSessionManager?.setAuthToken(e)}addCustomIntegration(e,t,r=!1){const n="addCustomIntegration";if(r)this.errorHandler.leaveBreadcrumb(`New ${n} invocation`),this.pluginsManager?.invokeSingle("nativeDestinations.addCustomIntegration",e,t,ur,this.logger);else{if(ur.lifecycle.loaded.value)return void this.logger.error(((e,t)=>`${e}${ge}Cannot add custom integration for destination ID "${t}" after the SDK is loaded.`)(oe,e));ur.eventBuffer.toBeProcessedArray.value=[...ur.eventBuffer.toBeProcessedArray.value,[n,e,t]]}}}class Ko{static globalSingleton=null;analyticsInstances={};defaultAnalyticsKey="";logger=bt;constructor(){try{if(Ko.globalSingleton)return Ko.globalSingleton;Ko.initializeGlobalResources(),this.setDefaultInstanceKey=this.setDefaultInstanceKey.bind(this),this.getAnalyticsInstance=this.getAnalyticsInstance.bind(this),this.load=this.load.bind(this),this.ready=this.ready.bind(this),this.triggerBufferedLoadEvent=this.triggerBufferedLoadEvent.bind(this),this.page=this.page.bind(this),this.track=this.track.bind(this),this.identify=this.identify.bind(this),this.alias=this.alias.bind(this),this.group=this.group.bind(this),this.reset=this.reset.bind(this),this.getAnonymousId=this.getAnonymousId.bind(this),this.setAnonymousId=this.setAnonymousId.bind(this),this.getUserId=this.getUserId.bind(this),this.getUserTraits=this.getUserTraits.bind(this),this.getGroupId=this.getGroupId.bind(this),this.getGroupTraits=this.getGroupTraits.bind(this),this.setCustomContext=this.setCustomContext.bind(this),this.getCustomContext=this.getCustomContext.bind(this),this.clearCustomContext=this.clearCustomContext.bind(this),this.startSession=this.startSession.bind(this),this.endSession=this.endSession.bind(this),this.get
2SessionId=this.getSessionId.bind(this),this.setAuthToken=this.setAuthToken.bind(this),this.consent=this.consent.bind(this),this.addCustomIntegration=this.addCustomIntegration.bind(this),this.createSafeAnalyticsInstance(),Ko.globalSingleton=this,ur.autoTrack.pageLifecycle.pageViewId.value=pe(),ur.autoTrack.pageLifecycle.pageLoadedTimestamp.value=Date.now(),this.triggerBufferedLoadEvent(),globalThis.rudderanalytics=this}catch(e){Pe(e)}}createSafeAnalyticsInstance(){ur.lifecycle.safeAnalyticsInstance.value={page:this.page.bind(this),track:this.track.bind(this),identify:this.identify.bind(this),alias:this.alias.bind(this),group:this.group.bind(this),getAnonymousId:this.getAnonymousId.bind(this),getUserId:this.getUserId.bind(this),getUserTraits:this.getUserTraits.bind(this),getGroupId:this.getGroupId.bind(this),getGroupTraits:this.getGroupTraits.bind(this),getSessionId:this.getSessionId.bind(this)}}static initializeGlobalResources(){Fr.init(),_n.configure(),Pn.configure(),Cn.configure(),Sn.configure()}setDefaultInstanceKey(e){E(e)&&e&&(this.defaultAnalyticsKey=e)}getAnalyticsInstance(e){try{let t=e;E(t)&&t||(t=this.defaultAnalyticsKey);return Boolean(this.analyticsInstances[t])||(this.analyticsInstances[t]=new Ho),this.analyticsInstances[t]}catch(e){return void Pe(e)}}load(e,t,r){try{if(this.analyticsInstances[e])return;this.setDefaultInstanceKey(e),this.trackPageLifecycleEvents(r);const n=Ue(xe);(e=>{const t="consent",r=e.filter(e=>e[0]===t),n=e.filter(e=>e[0]!==t);e.splice(0,e.length,...r,...n)})(n),Me(xe,f(n)),this.getAnalyticsInstance(e)?.load(e,t,r)}catch(e){Pe(e)}}trackPageLifecycleEvents(e){const{autoTrack:t,useBeacon:r}=e??{},{enabled:n=!1,options:o={},pageLifecycle:i}=t??{},{events:s=[q.UNLOADED],enabled:a=n,options:l=o}=i??{};ur.autoTrack.pageLifecycle.enabled.value=a,ur.autoTrack.enabled.value=n||a,a&&this.setupPageUnloadTracking(s,r,l)}setupPageUnloadTracking(e,t,r){(0===e.length||e.includes(q.UNLOADED))&&(!0===t?fe(e=>{if(!1===e&&ur.lifecycle.loaded.value){const e=Date.now(),t=e-ur.autoTrack.pageLifecycle.pageLoadedTimestamp.value;this.track(q.UNLOADED,{timeOnPage:t},{...r,originalTimestamp:he(new Date(e))})}},!0):this.logger.warn(`${"RudderStackAnalytics"}${ge}Page Unloaded event can only be tracked when the Beacon transport is active. Please enable "useBeacon" load API option.`))}triggerBufferedLoadEvent(){const e=Array.isArray(globalThis.rudderanalytics)?globalThis.rudderanalytics:[],t=(e=>{let t=[],r=0;for(;r<e.length;){if(e[r]&&"load"===e[r][0]){t=f(e[r]),e.splice(r,1);break}r+=1}return t})(e);Me(xe,f([...e])),t.length>0&&(t.shift(),this.load.apply(null,t))}ready(e){try{this.getAnalyticsInstance()?.ready(Ie(e))}catch(e){Pe(e)}}page(e,t,r,n,o){try{this.getAnalyticsInstance()?.page(G(Ie(e),Ie(t),Ie(r),Ie(n),Ie(o)))}catch(e){Pe(e)}}track(e,t,r,n){try{this.getAnalyticsInstance()?.track(H(Ie(e),Ie(t),Ie(r),Ie(n)))}catch(e){Pe(e)}}identify(e,t,r,n){try{this.getAnalyticsInstance()?.identify(K(Ie(e),Ie(t),Ie(r),Ie(n)))}catch(e){Pe(e)}}alias(e,t,r,n){try{this.getAnalyticsInstance()?.alias(W(Ie(e),Ie(t),Ie(r),Ie(n)))}catch(e){Pe(e)}}group(e,t,r,n){try{this.getAnalyticsInstance()?.group(V(Ie(e),Ie(t),Ie(r),Ie(n)))}catch(e){Pe(e)}}reset(e){try{this.getAnalyticsInstance()?.reset(Ie(e))}catch(e){Pe(e)}}getAnonymousId(e){try{return this.getAnalyticsInstance()?.getAnonymousId(Ie(e))}catch(e){return void Pe(e)}}setAnonymousId(e,t){try{this.getAnalyticsInstance()?.setAnonymousId(Ie(e),Ie(t))}catch(e){Pe(e)}}getUserId(){try{return this.getAnalyticsInstance()?.getUserId()}catch(e){return void Pe(e)}}getUserTraits(){try{return this.getAnalyticsInstance()?.getUserTraits()}catch(e){return void Pe(e)}}getGroupId(){try{return this.getAnalyticsInstance()?.getGroupId()}catch(e){return void Pe(e)}}getGroupTraits(){try{return this.getAnalyticsInstance()?.getGroupTraits()}catch(e){return void Pe(e)}}setCustomContext(e){try{this.getAnalyticsInstance()?.setCustomContext(e)}catch(e){Pe(e)}}getCustomContext(){try{return this.getAnalyticsInstance()?.getCustomContext()??{}}catch(e){return Pe(e),{}}}clearCustomContext(){try{this.getAnalyticsInstance()?.clearCustomContext()}catch(e){Pe(e)}}startSession(e){try{this.getAnalyticsInstance()?.startSession(Ie(e))}catch(e){Pe(e)}}endSession(){try{this.getAnalyticsInstance()?.endSession()}catch(e){Pe(e)}}getSessionId(){try{return this.getAnalyticsInstance()?.getSessionId()}catch(e){return void Pe(e)}}setAuthToken(e){try{this.getAnalyticsInstance()?.setAuthToken(Ie(e))}catch(e){Pe(e)}}consent(e){try{this.getAnalyticsInstance()?.consent(Ie(e))}catch(e){Pe(e)}}addCustomIntegration(e,t){try{this.getAnalyticsInstance()?.addCustomIntegration(Ie(e),Ie(t))}catch(e){Pe(e)}}}var Wo=null,Vo=function(){return null===Wo&&(Wo=new Promise(function(e){var t=new Ko;t.load(window.rudderstackClientSecret,window.rudderstackDataPlaneUrl),t.ready(function(){e(t)})})),Wo};function qo(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof a?n:a,c=Object.create(l.prototype);return zo(c,"_invoke",function(r,n,o){var i,a,l,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,a=0,l=e,p.n=r,s}};function f(r,n){for(a=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];r>3?(o=h===n)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(a=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,a=0))}if(o||r>1)return s;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),a=u,l=h;(t=a<2?e:l)||!d;){i||(a?a<3?(a>1&&(p.n=-1),f(a,l)):p.n=l:p.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");
vendor: 5,462 bytes, line 2
2if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,i),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(zo(t={},n,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,zo(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,zo(d,"constructor",c),zo(c,"constructor",l),l.displayName="GeneratorFunction",zo(c,o,"GeneratorFunction"),zo(d),zo(d,o,"Generator"),zo(d,n,function(){return this}),zo(d,"toString",function(){return"[object Generator]"}),(qo=function(){return{w:i,m:p}})()}function zo(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}zo=function(e,t,r,n){function i(t,r){zo(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},zo(e,t,r,n)}function Qo(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,o)}function Jo(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){Qo(i,n,o,s,a,"next",e)}function a(e){Qo(i,n,o,s,a,"throw",e)}s(void 0)})}}function Xo(e){return Xo="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},Xo(e)}function Yo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Zo(n.key),n)}}function Zo(e){var t=function(e,t){if("object"!=Xo(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Xo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Xo(t)?t:t+""}var ei=new Set([e.SIGNUP_STARTED,e.SOURCE_SELECTED,e.VISITED_MARKETING_HOMEPAGE,e.LANGUAGE_SELECTED,e.LANGUAGE_SELECTED_SUCCESS,e.LEVEL_SELECTED,e.LEVEL_SELECTED_SUCCESS,e.AGE_SELECTED,e.AGE_SELECTED_SUCCESS,e.SOURCE_SELECTED,e.SOURCE_SELECTED_SUCCESS,e.DAILY_GOAL_SELECTED,e.DAILY_GOAL_SELECTED_SUCCESS,e.EMAIL_FORM_PAGE,e.PASSWORD_FORM_PAGE,e.PLAN_SELECTED,e.DOWNLOAD_APP_PAGE,e.PICK_FAVORITE_GENRES,e.PICK_VIDEO_TO_GET_STARTED,e.QUICK_WORD_LOOK_UP_IN_FIRST_5_DAYS_OF_TRIAL,e.DETAILED_WORD_LOOK_UP_IN_FIRST_5_DAYS_OF_TRIAL,e.VIEWED_CHECKOUT_PAGE]);var ti,ri=function(e,t,r){return t&&Yo(e.prototype,t),r&&Yo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.clientProvider=t},[{key:"identify",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;this.clientProvider.identify(e,t,r,n)}},{key:"track",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;t=e,ei.has(t)||this.clientProvider.track(e,r,n,o)}},{key:"page",value:function(e,t){}},{key:"group",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;this.clientProvider.group(e,t,r,n)}},{key:"alias",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;this.clientProvider.alias(e,t,r,n)}},{key:"reset",value:function(){this.clientProvider.reset()}},{key:"getUserId",value:function(){return this.clientProvider.getUserId()}},{key:"getAnonymousId",value:function(){return this.clientProvider.getAnonymousId()}},{key:"getUserTraits",value:function(){return this.clientProvider.getUserTraits()}}]),ni=null,oi=(ti=Jo(qo().m(function e(){return qo().w(function(e){for(;;)if(0===e.n)return null===ni&&(ni=Jo(qo().m(function e(){var t;return qo().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vo();case 1:return t=e.v,e.a(2,new ri(t))}},e)}))()),e.a(2,ni)},e)})),function(){return ti.apply(this,arguments)});function ii(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof a?n:a,c=Object.create(l.prototype);return si(c,"_invoke",function(r,n,o){var i,a,l,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,a=0,l=e,p.n=r,s}};function f(r,n){for(a=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];r>3?(o=h===n)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(a=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,a=0))}if(o||r>1)return s;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),a=u,l=h;(t=a<2?e:l)||!d;){i||(a?a<3?(a>1&&(p.n=-1),f(a,l)):p.n=l:p.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");
2if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,i),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(si(t={},n,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,si(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,si(d,"constructor",c),si(c,"constructor",l),l.displayName="GeneratorFunction",si(c,o,"GeneratorFunction"),si(d),si(d,o,"Generator"),si(d,n,function(){return this}),si(d,"toString",function(){return"[object Generator]"}),(ii=function(){return{w:i,m:p}})()}function si(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}si=function(e,t,r,n){function i(t,r){si(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},si(e,t,r,n)}function ai(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,o)}function li(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){ai(i,n,o,s,a,"next",e)}function a(e){ai(i,n,o,s,a,"throw",e)}s(void 0)})}}(function(){var e=li(ii().m(function e(t){var r,n;return ii().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:r=e.v,n={platform:"Web"},r.track(t,n);case 2:return e.a(2)}},e)}))})(),ci=li(ii().m(function e(t,r,n){return ii().w(function(e){for(;;)switch(e.n){case 0:if(n){e.n=1;break}return e.a(2);case 1:return e.n=2,oi();case 2:e.v.track(t,{page:r,platform:"Web"});case 3:return e.a(2)}},e)})),ui=li(ii().m(function t(){var r,n;return ii().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,oi();case 1:r=t.v,n={platform:"Web",mobile_version_of_website:window.mobileMode},r.track(e.SIGNUP_STARTED,n);case 2:return t.a(2)}},t)})),di=li(ii().m(function e(t,r){var n,o;return ii().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:n=e.v,o={language_selected:r,platform:"Web"},n.track(t,o);case 2:return e.a(2)}},e)})),pi=li(ii().m(function e(t,r){var n,o;return ii().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:n=e.v,o={level_selected:r,platform:"Web"},n.track(t,o);case 2:return e.a(2)}},e)})),fi=li(ii().m(function e(t,r){var n,o;return ii().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:n=e.v,o={age:r,platform:"Web"},n.track(t,o);case 2:return e.a(2)}},e)})),hi=li(ii().m(function e(t,r){var n,o;return ii().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:n=e.v,o={source:r,platform:"Web"},n.track(t,o);case 2:return e.a(2)}},e)})),gi=li(ii().m(function e(t,r){var n,o;return ii().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:n=e.v,o={daily_goal:r,platform:"Web"},n.track(t,o);case 2:return e.a(2)}},e)})),yi=li(ii().m(function e(t,r){var n,o;return ii().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:n=e.v,o={plan_name:r,platform:"Web"},n.track(t,o);case 2:return e.a(2)}},e)}));var ci,ui,di,pi,fi,hi,gi,yi,vi,mi,bi,Si,Ei,wi=(vi=li(ii().m(function t(){var r,n,o,i;return ii().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,oi();case 1:r=t.v,n=window.ACTIVE_LOCALE_NAME[0].toUpperCase()+window.ACTIVE_LOCALE_NAME.substring(1),o=window.ACTIVE_LANGUAGE_NAME[0].toUpperCase()+window.ACTIVE_LANGUAGE_NAME.substring(1),i={platform:"Web",language:n,locale:o},r.track(e.VISITED_MARKETING_HOMEPAGE,i);case 2:return t.a(2)}},t)})),function(){return vi.apply(this,arguments)});mi=li(ii().m(function t(){var r,n;return ii().w(function(t){for(;;)switch(t.n){case 0:if(!window.currentUserId){t.n=2;break}return t.n=1,oi();case 1:r=t.v,n={platform:"Web"},r.track(e.VIEWED_CHECKOUT_PAGE,n);case 2:return t.a(2)}},t)})),bi=li(ii().m(function t(r,n){var o,i;return ii().w(function(t){for(;;)switch(t.n){case 0:if(!window.currentUserId){t.n=2;break}return t.n=1,oi();case 1:o=t.v,i={genre:r,displayed_genres_name:n,platform:"Web"},o.track(e.PICK_FAVORITE_GENRES,i);case 2:return t.a(2)}},t)})),Si=li(ii().m(function t(r,n,o,i,s,a,l){var c,u;return ii().w(function(t){for(;;)switch(t.n){case 0:if(!window.currentUserId){t.n=2;break}return t.n=1,oi();case 1:c=t.v,u={content_id:r,content_type:n,content_publish_date:o,difficulty:i,displayed_content_name:s,english_content_name:a,language:l.anal
2yticsName,platform:"Web"},c.track(e.PICK_VIDEO_TO_GET_STARTED,u);case 2:return t.a(2)}},t)})),Ei=li(ii().m(function t(){var r,n,o,i,s,a,l=arguments;return ii().w(function(t){for(;;)switch(t.n){case 0:return r=l.length>0&&void 0!==l[0]&&l[0],n=l.length>1&&void 0!==l[1]&&l[1],o=l.length>2&&void 0!==l[2]&&l[2],i=l.length>3&&void 0!==l[3]&&l[3],t.n=1,oi();case 1:s=t.v,a={logo_click:r,continue_to_website_click:n,download_on_App_Store_click:i,get_in_on_Google_Play_click:o,platform:"Web"},s.track(e.DOWNLOAD_APP_PAGE,a);case 2:return t.a(2)}},t)}));function Ai(e,t){$(tknSelectors.eventsAnchor).on(e,function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t(r)})}function Ii(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof a?n:a,c=Object.create(l.prototype);return ki(c,"_invoke",function(r,n,o){var i,a,l,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,a=0,l=e,p.n=r,s}};function f(r,n){for(a=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];r>3?(o=h===n)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(a=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,a=0))}if(o||r>1)return s;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),a=u,l=h;(t=a<2?e:l)||!d;){i||(a?a<3?(a>1&&(p.n=-1),f(a,l)):p.n=l:p.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,i),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(ki(t={},n,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ki(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,ki(d,"constructor",c),ki(c,"constructor",l),l.displayName="GeneratorFunction",ki(c,o,"GeneratorFunction"),ki(d),ki(d,o,"Generator"),ki(d,n,function(){return this}),ki(d,"toString",function(){return"[object Generator]"}),(Ii=function(){return{w:i,m:p}})()}function ki(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ki=function(e,t,r,n){function i(t,r){ki(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},ki(e,t,r,n)}function Ti(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,o)}function Oi(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){Ti(i,n,o,s,a,"next",e)}function a(e){Ti(i,n,o,s,a,"throw",e)}s(void 0)})}}function Pi(){return(Pi=Oi(Ii().m(function e(){var t,r;return Ii().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:t=e.v,r=t.getUserId(),window.IS_GUEST?r&&t.reset():r||t.identify(String(window.currentUserId)),window.IDENTIFY_ANALYTIC_TRAITS&&!document.cookie.includes("analytics_started")&&Ci();case 2:return e.a(2)}},e)}))).apply(this,arguments)}function Ci(){return _i.apply(this,arguments)}function _i(){return(_i=Oi(Ii().m(function e(){return Ii().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:e.v.identify(window.currentUserId,window.IDENTIFY_ANALYTIC_TRAITS,{},function(){var e,t;e=new Date,t=e.setHours(23,59,59,999),document.cookie="analytics_started=true;expires="+new Date(t).toUTCString()+";path=/"});case 2:return e.a(2)}},e)}))).apply(this,arguments)}function Di(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}
2finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xi(e,t);var r={}.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)?xi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Ri(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof a?n:a,c=Object.create(l.prototype);return ji(c,"_invoke",function(r,n,o){var i,a,l,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,a=0,l=e,p.n=r,s}};function f(r,n){for(a=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];r>3?(o=h===n)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(a=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,a=0))}if(o||r>1)return s;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),a=u,l=h;(t=a<2?e:l)||!d;){i||(a?a<3?(a>1&&(p.n=-1),f(a,l)):p.n=l:p.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,i),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(ji(t={},n,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ji(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,ji(d,"constructor",c),ji(c,"constructor",l),l.displayName="GeneratorFunction",ji(c,o,"GeneratorFunction"),ji(d),ji(d,o,"Generator"),ji(d,n,function(){return this}),ji(d,"toString",function(){return"[object Generator]"}),(Ri=function(){return{w:i,m:p}})()}function ji(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ji=function(e,t,r,n){function i(t,r){ji(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},ji(e,t,r,n)}function $i(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,o)}function Li(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){$i(i,n,o,s,a,"next",e)}function a(e){$i(i,n,o,s,a,"throw",e)}s(void 0)})}}var Ni=function(){var e=Li(Ri().m(function e(){return Ri().w(function(e){for(;;)switch(e.n){case 0:if(!window.analyticsData){e.n=2;break}return e.n=1,oi();case 1:e.v.page("",window.analyticsData.page,window.analyticsData.props);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();const Mi=Ni;function Ui(){return Ui=Li(Ri().m(function e(t){var r,n;return Ri().w(function(e){for(;;)switch(e.n){case 0:if(r=Di(t,2),r[0],n=r[1],!window.analyticsData||window.analyticsData.page!==n.page){e.n=1;break}return e.a(2);case 1:return e.n=2,oi();case 2:e.v.page(void 0,n.page,n.props);case 3:return e.a(2)}},e)})),Ui.apply(this,arguments)}function Bi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)"__proto__"!==n&&(e[n]=r[n])}return e}var Fi=function e(t,r){function n(e,n,o){if("undefined"!=typeof document){"number"==typeof(o=Bi({},r,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decode
vendor: 4,871 bytes, line 2
2URIComponent).replace(/[()]/g,escape);var i="";for(var s in o)o[s]&&(i+="; "+s,!0!==o[s]&&(i+="="+o[s].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+i}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},o=0;o<r.length;o++){var i=r[o].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(a in n||(n[a]=t.read(s,a)),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){n(e,"",Bi({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Bi({},this.attributes,t))},withConverter:function(t){return e(Bi({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function Gi(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof a?n:a,c=Object.create(l.prototype);return Hi(c,"_invoke",function(r,n,o){var i,a,l,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,a=0,l=e,p.n=r,s}};function f(r,n){for(a=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];r>3?(o=h===n)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(a=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,a=0))}if(o||r>1)return s;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),a=u,l=h;(t=a<2?e:l)||!d;){i||(a?a<3?(a>1&&(p.n=-1),f(a,l)):p.n=l:p.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,i),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(Hi(t={},n,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Hi(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Hi(d,"constructor",c),Hi(c,"constructor",l),l.displayName="GeneratorFunction",Hi(c,o,"GeneratorFunction"),Hi(d),Hi(d,o,"Generator"),Hi(d,n,function(){return this}),Hi(d,"toString",function(){return"[object Generator]"}),(Gi=function(){return{w:i,m:p}})()}function Hi(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Hi=function(e,t,r,n){function i(t,r){Hi(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Hi(e,t,r,n)}function Ki(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,o)}function Wi(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){Ki(i,n,o,s,a,"next",e)}function a(e){Ki(i,n,o,s,a,"throw",e)}s(void 0)})}}function Vi(e){return qi.apply(this,arguments)}function qi(){return qi=Wi(Gi().m(function e(t){var r,n,o=arguments;return Gi().w(function(e){for(;;)switch(e.n){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:null,e.n=1,fetch(t,{method:"post",body:r?JSON.stringify(r):null,headers:{"X-CSRF-TOKEN":window.CSRF_TOKEN,"Content-type":"application/json; charset=UTF-8"}});case 1:return n=e.v,e.n=2,n.json();case 2:return e.a(2,e.v)}},e)})),qi.apply(this,arguments)}var zi="/analytics-event",Qi="".concat(zi,"/gen-anonymous-id/");"".concat(zi,"/visited-marketing-homepage/");function Ji(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof a?n:a,c=Object.create(l.prototype);return Xi(c,"_invoke",function(r,n,o){var i,a,l,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,a=0,l=e,p.n=r,s}};function f(r,n){for(a=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];r>3?(o=h===n)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(a=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,a=0))}if(o||r>1)return s;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),a=u,l=h;(t=a<2?e:l)||!d;){i||(a?a<3?(a>1&&(p.n=-1),f(a,l)):p.n=l:p.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");
2if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,i),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(Xi(t={},n,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Xi(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Xi(d,"constructor",c),Xi(c,"constructor",l),l.displayName="GeneratorFunction",Xi(c,o,"GeneratorFunction"),Xi(d),Xi(d,o,"Generator"),Xi(d,n,function(){return this}),Xi(d,"toString",function(){return"[object Generator]"}),(Ji=function(){return{w:i,m:p}})()}function Xi(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Xi=function(e,t,r,n){function i(t,r){Xi(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Xi(e,t,r,n)}function Yi(e){return Yi="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},Yi(e)}function Zi(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,o)}var es=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){Zi(i,n,o,s,a,"next",e)}function a(e){Zi(i,n,o,s,a,"throw",e)}s(void 0)})}}(Ji().m(function e(){var t,r;return Ji().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:if(t=e.v,void 0!==(r=String(t.getAnonymousId()))&&null!==Yi(r)){e.n=3;break}return e.n=2,Vi("".concat(window.SERVER_BASE_URL).concat(Qi));case 2:e.n=4;break;case 3:Fi.set("analyticAnonymousId",r);case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();const ts=es;var rs=r(8811);function ns(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof a?n:a,c=Object.create(l.prototype);return os(c,"_invoke",function(r,n,o){var i,a,l,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,a=0,l=e,p.n=r,s}};function f(r,n){for(a=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];r>3?(o=h===n)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(a=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,a=0))}if(o||r>1)return s;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),a=u,l=h;(t=a<2?e:l)||!d;){i||(a?a<3?(a>1&&(p.n=-1),f(a,l)):p.n=l:p.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,i),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(os(t={},n,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,os(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,os(d,"constructor",c),os(c,"constructor",l),l.displayName="GeneratorFunction",os(c,o,"GeneratorFunction"),os(d),os(d,o,"Generator"),os(d,n,function(){return this}),os(d,"toString",function(){return"[object Generator]"}),(ns=function(){return{w:i,m:p}})()}function os(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}os=function(e,t,r,n){function i(t,r){os(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},os(e,t,r,n)}function is(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,o)}function ss(){return ss=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){is(i,n,o,s,a,"next",e)}function a(e){is(i,n,o,s,a,"throw",e)}s(void 0)})}}(ns().m(function e(){var t,r;return ns().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,oi();case 1:t=e.v,r=(0,rs.utm)(window.location.href),0!==Object.keys(r).length&&t.identify(r);case 2:return e.a(2)}},e)})),ss.apply(this,arguments)}!function(){Pi.apply(this,arguments)}(),function(){ss.apply(this,arguments)}(),Ai("VisitedMarketingHomepage",wi),Ai("DailyGoalPresetShown",function(e){return Ui.apply(this,arguments)}),Mi(),ts()})(),analyticsHandler={}})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.