@rudderstack/analytics-js 3.29.0 → 3.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/npm/index.d.cts +1 -5
- package/dist/npm/index.d.mts +1 -5
- package/dist/npm/legacy/bundled/cjs/index.cjs +44 -72
- package/dist/npm/legacy/bundled/esm/index.mjs +44 -72
- package/dist/npm/legacy/bundled/umd/index.js +44 -72
- package/dist/npm/legacy/cjs/index.cjs +44 -72
- package/dist/npm/legacy/content-script/cjs/index.cjs +44 -72
- package/dist/npm/legacy/content-script/esm/index.mjs +44 -72
- package/dist/npm/legacy/content-script/umd/index.js +44 -72
- package/dist/npm/legacy/esm/index.mjs +44 -72
- package/dist/npm/legacy/lite/cjs/index.cjs +207 -194
- package/dist/npm/legacy/lite/esm/index.mjs +207 -194
- package/dist/npm/legacy/lite/umd/index.js +207 -194
- package/dist/npm/legacy/umd/index.js +44 -72
- package/dist/npm/modern/bundled/cjs/index.cjs +44 -72
- package/dist/npm/modern/bundled/esm/index.mjs +44 -72
- package/dist/npm/modern/bundled/umd/index.js +44 -72
- package/dist/npm/modern/cjs/index.cjs +44 -72
- package/dist/npm/modern/content-script/cjs/index.cjs +44 -72
- package/dist/npm/modern/content-script/esm/index.mjs +44 -72
- package/dist/npm/modern/content-script/umd/index.js +44 -72
- package/dist/npm/modern/esm/index.mjs +44 -72
- package/dist/npm/modern/lite/cjs/index.cjs +207 -194
- package/dist/npm/modern/lite/esm/index.mjs +207 -194
- package/dist/npm/modern/lite/umd/index.js +207 -194
- package/dist/npm/modern/umd/index.js +44 -72
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [3.31.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.30.0...@rudderstack/analytics-js@3.31.0) (2026-03-23)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `@rudderstack/analytics-js-common` updated to version `3.28.1`
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **analytics-js:** replace error-stack-parser with lean inline parser [SDK-4625] ([#2833](https://github.com/rudderlabs/rudder-sdk-js/issues/2833)) ([9a99057](https://github.com/rudderlabs/rudder-sdk-js/commit/9a990577e928b007c88f665ecec27c1fd6fa8afe))
|
|
14
|
+
|
|
15
|
+
## [3.30.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.29.0...@rudderstack/analytics-js@3.30.0) (2026-03-02)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* add BeaconQueue plugin into the lite variant ([#2806](https://github.com/rudderlabs/rudder-sdk-js/issues/2806)) ([b042281](https://github.com/rudderlabs/rudder-sdk-js/commit/b0422810257f6d298ccc18d3eef29c3a66ce8360))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **analytics-js:** prevent redundant destination loading [SDK-4540] ([#2781](https://github.com/rudderlabs/rudder-sdk-js/issues/2781)) ([ecd5a4c](https://github.com/rudderlabs/rudder-sdk-js/commit/ecd5a4cb0f4c5acac433e4542cc9e836324a7fd6))
|
|
26
|
+
|
|
5
27
|
## [3.29.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.28.1...@rudderstack/analytics-js@3.29.0) (2026-02-16)
|
|
6
28
|
|
|
7
29
|
### Dependency Updates
|
package/dist/npm/index.d.cts
CHANGED
|
@@ -36,7 +36,7 @@ declare class Logger implements ILogger {
|
|
|
36
36
|
* Formats the console message using `scope` and styles
|
|
37
37
|
*/
|
|
38
38
|
formatLogData(data: any[]): any[];
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
|
|
41
41
|
type Nullable<T> = T | null;
|
|
42
42
|
|
|
@@ -965,7 +965,6 @@ declare class BufferQueue<T = any> {
|
|
|
965
965
|
size(): number;
|
|
966
966
|
clear(): void;
|
|
967
967
|
}
|
|
968
|
-
//# sourceMappingURL=BufferQueue.d.ts.map
|
|
969
968
|
|
|
970
969
|
/**
|
|
971
970
|
* Store Implementation with dedicated storage
|
|
@@ -1024,7 +1023,6 @@ declare class Store implements IStore {
|
|
|
1024
1023
|
*/
|
|
1025
1024
|
onError(error: unknown, customMessage?: string, groupingHash?: string): void;
|
|
1026
1025
|
}
|
|
1027
|
-
//# sourceMappingURL=Store.d.ts.map
|
|
1028
1026
|
|
|
1029
1027
|
interface IUserSessionManager {
|
|
1030
1028
|
storeManager?: IStoreManager;
|
|
@@ -1448,14 +1446,12 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
|
|
|
1448
1446
|
consent(options?: ConsentOptions): void;
|
|
1449
1447
|
addCustomIntegration(destinationId: string, integration: RSACustomIntegration): void;
|
|
1450
1448
|
}
|
|
1451
|
-
//# sourceMappingURL=RudderAnalytics.d.ts.map
|
|
1452
1449
|
|
|
1453
1450
|
declare global {
|
|
1454
1451
|
interface Window {
|
|
1455
1452
|
rudderanalytics: RudderAnalytics | RudderAnalyticsPreloader | undefined;
|
|
1456
1453
|
}
|
|
1457
1454
|
}
|
|
1458
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1459
1455
|
|
|
1460
1456
|
export { RudderAnalytics };
|
|
1461
1457
|
export type { AnonymousIdOptions, ApiCallback, ApiObject, ApiOptions, BeaconQueueOpts, ConsentOptions, CookieSameSite, CustomDestinationConfig, DestinationsQueueOpts, IdentifyTraits, IntegrationOpts, LoadOptions, LogLevel, PluginName, PreloadedEventCall, QueueOpts, RSACustomIntegration, RSAEvent, RSALogger, RSAnalytics, RudderAnalyticsPreloader, SessionOpts, UaChTrackLevel };
|
package/dist/npm/index.d.mts
CHANGED
|
@@ -36,7 +36,7 @@ declare class Logger implements ILogger {
|
|
|
36
36
|
* Formats the console message using `scope` and styles
|
|
37
37
|
*/
|
|
38
38
|
formatLogData(data: any[]): any[];
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
|
|
41
41
|
type Nullable<T> = T | null;
|
|
42
42
|
|
|
@@ -965,7 +965,6 @@ declare class BufferQueue<T = any> {
|
|
|
965
965
|
size(): number;
|
|
966
966
|
clear(): void;
|
|
967
967
|
}
|
|
968
|
-
//# sourceMappingURL=BufferQueue.d.ts.map
|
|
969
968
|
|
|
970
969
|
/**
|
|
971
970
|
* Store Implementation with dedicated storage
|
|
@@ -1024,7 +1023,6 @@ declare class Store implements IStore {
|
|
|
1024
1023
|
*/
|
|
1025
1024
|
onError(error: unknown, customMessage?: string, groupingHash?: string): void;
|
|
1026
1025
|
}
|
|
1027
|
-
//# sourceMappingURL=Store.d.ts.map
|
|
1028
1026
|
|
|
1029
1027
|
interface IUserSessionManager {
|
|
1030
1028
|
storeManager?: IStoreManager;
|
|
@@ -1448,14 +1446,12 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
|
|
|
1448
1446
|
consent(options?: ConsentOptions): void;
|
|
1449
1447
|
addCustomIntegration(destinationId: string, integration: RSACustomIntegration): void;
|
|
1450
1448
|
}
|
|
1451
|
-
//# sourceMappingURL=RudderAnalytics.d.ts.map
|
|
1452
1449
|
|
|
1453
1450
|
declare global {
|
|
1454
1451
|
interface Window {
|
|
1455
1452
|
rudderanalytics: RudderAnalytics | RudderAnalyticsPreloader | undefined;
|
|
1456
1453
|
}
|
|
1457
1454
|
}
|
|
1458
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1459
1455
|
|
|
1460
1456
|
export { RudderAnalytics };
|
|
1461
1457
|
export type { AnonymousIdOptions, ApiCallback, ApiObject, ApiOptions, BeaconQueueOpts, ConsentOptions, CookieSameSite, CustomDestinationConfig, DestinationsQueueOpts, IdentifyTraits, IntegrationOpts, LoadOptions, LogLevel, PluginName, PreloadedEventCall, QueueOpts, RSACustomIntegration, RSAEvent, RSALogger, RSAnalytics, RudderAnalyticsPreloader, SessionOpts, UaChTrackLevel };
|
|
@@ -899,7 +899,7 @@ if(isObjectLiteralAndNotNull(sanitizedValue)||Array.isArray(sanitizedValue)){res
|
|
|
899
899
|
*/var getSanitizedValue=function getSanitizedValue(value,logger){var replacer=getReplacer();// This is needed for registering the first ancestor
|
|
900
900
|
var newValue=replacer.call(value,'',value);if(isObjectLiteralAndNotNull(value)||Array.isArray(value)){return _traverseWithThis(value,replacer);}return newValue;};
|
|
901
901
|
|
|
902
|
-
var MANUAL_ERROR_IDENTIFIER='[SDK DISPATCHED ERROR]';var getStacktrace=function getStacktrace(err){var
|
|
902
|
+
var MANUAL_ERROR_IDENTIFIER='[SDK DISPATCHED ERROR]';var getStacktrace=function getStacktrace(err){var stack=err.stack;if(typeof stack==='string'&&stack){return stack;}return undefined;};/**
|
|
903
903
|
* Get mutated error with issue prepended to error message
|
|
904
904
|
* @param err Original error
|
|
905
905
|
* @param issue Issue to prepend to error message
|
|
@@ -908,12 +908,10 @@ var MANUAL_ERROR_IDENTIFIER='[SDK DISPATCHED ERROR]';var getStacktrace=function
|
|
|
908
908
|
var ErrorConstructor=err.constructor;var newError=new ErrorConstructor("".concat(issue,": ").concat(err.message));// Preserve stack trace
|
|
909
909
|
var stack=getStacktrace(err);if(stack){newError.stack=stack;}// Preserve any other enumerable properties
|
|
910
910
|
Object.getOwnPropertyNames(err).forEach(function(key){if(key!=='message'&&key!=='stack'&&key!=='name'){try{newError[key]=err[key];}catch(_unused){// Ignore if property is not writable
|
|
911
|
-
}}});return newError;}catch(_unused2){return new Error("".concat(issue,": ").concat(stringifyWithoutCircular(err)));}};var dispatchErrorEvent=function dispatchErrorEvent(error){if(isTypeOfError(error)){var errStack=getStacktrace(error);if(errStack){
|
|
912
|
-
error.stack="".concat(
|
|
913
|
-
error.stacktrace="".concat(stacktrace,"\n").concat(MANUAL_ERROR_IDENTIFIER);break;case operaSourceloc:default:// eslint-disable-next-line no-param-reassign
|
|
914
|
-
error['opera#sourceloc']="".concat(operaSourceloc,"\n").concat(MANUAL_ERROR_IDENTIFIER);break;}}}globalThis.dispatchEvent(new ErrorEvent('error',{error:error,bubbles:true,cancelable:true,composed:true}));};
|
|
911
|
+
}}});return newError;}catch(_unused2){return new Error("".concat(issue,": ").concat(stringifyWithoutCircular(err)));}};var dispatchErrorEvent=function dispatchErrorEvent(error){if(isTypeOfError(error)){var errStack=getStacktrace(error);if(errStack){// eslint-disable-next-line no-param-reassign
|
|
912
|
+
error.stack="".concat(errStack,"\n").concat(MANUAL_ERROR_IDENTIFIER);}}globalThis.dispatchEvent(new ErrorEvent('error',{error:error,bubbles:true,cancelable:true,composed:true}));};
|
|
915
913
|
|
|
916
|
-
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.
|
|
914
|
+
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.31.0';var APP_NAMESPACE='com.rudderlabs.javascript';var MODULE_TYPE='npm';var BUILD_VARIANT='legacy-bundled';var ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';var ADBLOCK_PAGE_NAME='ad-block page request';var ADBLOCK_PAGE_PATH='/ad-blocked';var GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';var CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
|
917
915
|
|
|
918
916
|
var QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';var QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';var QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';var QUERY_PARAM_USER_ID_KEY='ajs_uid';var QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
|
919
917
|
|
|
@@ -1004,7 +1002,7 @@ timeoutID=globalThis.setTimeout(function(){reject(new Error(SCRIPT_LOAD_TIMEOUT_
|
|
|
1004
1002
|
* Load external resource of type javascript
|
|
1005
1003
|
*/return _createClass(ExternalSrcLoader,[{key:"loadJSFile",value:function loadJSFile(config){var url=config.url,id=config.id,timeout=config.timeout,async=config.async,callback=config.callback,extraAttributes=config.extraAttributes;var isFireAndForget=!isFunction(callback);jsFileLoader(url,id,timeout||this.timeout,async,extraAttributes).then(function(id){if(!isFireAndForget){callback(id);}}).catch(function(err){if(!isFireAndForget){callback(id,err);}});}}]);}();
|
|
1006
1004
|
|
|
1007
|
-
var i$2=Symbol.for("preact-signals");function t$1(){if(!(s>1)){var i,t=false;while(void 0!==h){var n=h;h=void 0;v++;while(void 0!==n){var r=n.
|
|
1005
|
+
var i$2=Symbol.for("preact-signals");function t$1(){if(!(s>1)){var i,t=false;!function(){var i=d$1;d$1=void 0;while(void 0!==i){if(i.S.v===i.v)i.S.i=i.i;i=i.o;}}();while(void 0!==h){var n=h;h=void 0;v++;while(void 0!==n){var r=n.u;n.u=void 0;n.f&=-3;if(!(8&n.f)&&w(n))try{n.c();}catch(n){if(!t){i=n;t=true;}}n=r;}}v=0;s--;if(t)throw i;}else s--;}function n(i){if(s>0)return i();e=++u;s++;try{return i();}finally{t$1();}}var r=void 0;function o(i){var t=r;r=void 0;try{return i();}finally{r=t;}}var h=void 0,s=0,v=0,u=0,e=0,d$1=void 0,c=0;function a(i){if(void 0!==r){var t=i.n;if(void 0===t||t.t!==r){t={i:0,S:i,p:r.s,n:void 0,t:r,e:void 0,x:void 0,r:t};if(void 0!==r.s)r.s.n=t;r.s=t;i.n=t;if(32&r.f)i.S(t);return t;}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=r.s;t.n=void 0;r.s.n=t;r.s=t;}return t;}}}function l(i,t){this.v=i;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;}l.prototype.brand=i$2;l.prototype.h=function(){return true;};l.prototype.S=function(i){var t=this,n=this.t;if(n!==i&&void 0===i.e){i.x=n;this.t=i;if(void 0!==n)n.e=i;else o(function(){var i;null==(i=t.W)||i.call(t);});}};l.prototype.U=function(i){var t=this;if(void 0!==this.t){var n=i.e,r=i.x;if(void 0!==n){n.x=r;i.e=void 0;}if(void 0!==r){r.e=n;i.x=void 0;}if(i===this.t){this.t=r;if(void 0===r)o(function(){var i;null==(i=t.Z)||i.call(t);});}}};l.prototype.subscribe=function(i){var t=this;return C(function(){var n=t.value,o=r;r=void 0;try{i(n);}finally{r=o;}},{name:"sub"});};l.prototype.valueOf=function(){return this.value;};l.prototype.toString=function(){return this.value+"";};l.prototype.toJSON=function(){return this.value;};l.prototype.peek=function(){var i=r;r=void 0;try{return this.value;}finally{r=i;}};Object.defineProperty(l.prototype,"value",{get:function get(){var i=a(this);if(void 0!==i)i.i=this.i;return this.v;},set:function set(i){if(i!==this.v){if(v>100)throw new Error("Cycle detected");!function(i){if(0!==s&&0===v)if(i.l!==e){i.l=e;d$1={S:i,v:i.v,i:i.i,o:d$1};}}(this);this.v=i;this.i++;c++;s++;try{for(var n=this.t;void 0!==n;n=n.x)n.t.N();}finally{t$1();}}}});function y(i,t){return new l(i,t);}function w(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return true;return false;}function _(i){for(var t=i.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n)t.r=n;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break;}}}function b(i){var t=i.s,n=void 0;while(void 0!==t){var r=t.p;if(-1===t.i){t.S.U(t);if(void 0!==r)r.n=t.n;if(void 0!==t.n)t.n.p=r;}else n=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=r;}i.s=n;}function p(i,t){l.call(this,void 0);this.x=i;this.s=void 0;this.g=c-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name;}p.prototype=new l();p.prototype.h=function(){this.f&=-3;if(1&this.f)return false;if(32==(36&this.f))return true;this.f&=-5;if(this.g===c)return true;this.g=c;this.f|=1;if(this.i>0&&!w(this)){this.f&=-2;return true;}var i=r;try{_(this);r=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++;}}catch(i){this.v=i;this.f|=16;this.i++;}r=i;b(this);this.f&=-2;return true;};p.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t);}l.prototype.S.call(this,i);};p.prototype.U=function(i){if(void 0!==this.t){l.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t);}}};p.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N();}};Object.defineProperty(p.prototype,"value",{get:function get(){if(1&this.f)throw new Error("Cycle detected");var i=a(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v;}});function S(i){var n=i.m;i.m=void 0;if("function"==typeof n){s++;var o=r;r=void 0;try{n();}catch(t){i.f&=-2;i.f|=8;m(i);throw t;}finally{r=o;t$1();}}}function m(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;S(i);}function x$1(i){if(r!==this)throw new Error("Out-of-order effect");b(this);r=i;this.f&=-2;if(8&this.f)m(this);t$1();}function E(i,t){this.x=i;this.m=void 0;this.s=void 0;this.u=void 0;this.f=32;this.name=null==t?void 0:t.name;}E.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.m=t;}finally{i();}};E.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;S(this);_(this);s++;var i=r;r=this;return x$1.bind(this,i);};E.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.u=h;h=this;}};E.prototype.d=function(){this.f|=8;if(!(1&this.f))m(this);};E.prototype.dispose=function(){this.d();};function C(i,t){var n=new E(i,t);try{n.c();}catch(i){n.d();throw i;}var r=n.d.bind(n);r[Symbol.dispose]=r;return r;}
|
|
1008
1006
|
|
|
1009
1007
|
/**
|
|
1010
1008
|
* A buffer queue to serve as a store for any type of data
|
|
@@ -1052,86 +1050,56 @@ var BUILD_TYPE='legacy';var SDK_CDN_BASE_URL='https://cdn.rudderlabs.com';var CD
|
|
|
1052
1050
|
|
|
1053
1051
|
var DEFAULT_STORAGE_ENCRYPTION_VERSION='v3';var DEFAULT_DATA_PLANE_EVENTS_TRANSPORT='xhr';var ConsentManagersToPluginNameMap={iubenda:'IubendaConsentManager',oneTrust:'OneTrustConsentManager',ketch:'KetchConsentManager',custom:'CustomConsentManager'};var StorageEncryptionVersionsToPluginNameMap=_defineProperty(_defineProperty({},DEFAULT_STORAGE_ENCRYPTION_VERSION,'StorageEncryption'),"legacy",'StorageEncryptionLegacy');var DataPlaneEventsTransportToPluginNameMap=_defineProperty(_defineProperty({},DEFAULT_DATA_PLANE_EVENTS_TRANSPORT,'XhrQueue'),"beacon",'BeaconQueue');var DEFAULT_DATA_SERVICE_ENDPOINT='rsaRequest';var METRICS_SERVICE_ENDPOINT='rsaMetrics';var CUSTOM_DEVICE_MODE_DESTINATION_DISPLAY_NAME='Custom Device Mode';
|
|
1054
1052
|
|
|
1055
|
-
var defaultLoadOptions={configUrl:DEFAULT_CONFIG_BE_URL,loadIntegration:true,sessions:{autoTrack:true,timeout:DEFAULT_SESSION_TIMEOUT_MS,cutOff:{enabled:false}},sameSiteCookie:'Lax',polyfillIfRequired:true,integrations:DEFAULT_INTEGRATIONS_CONFIG,useBeacon:false,beaconQueueOptions:{},destinationsQueueOptions:{},queueOptions:{},lockIntegrationsVersion:true,lockPluginsVersion:true,uaChTrackLevel:'none',plugins:[],useGlobalIntegrationsConfigInEvents:false,bufferDataPlaneEventsUntilReady:false,dataPlaneEventsBufferTimeout:DEFAULT_DATA_PLANE_EVENTS_BUFFER_TIMEOUT_MS,storage:{encryption:{version:DEFAULT_STORAGE_ENCRYPTION_VERSION},migrate:true,cookie:{}},sendAdblockPage:false,sameDomainCookiesOnly:false,secureCookie:false,sendAdblockPageOptions:{},useServerSideCookies:false};var loadOptionsState=
|
|
1053
|
+
var defaultLoadOptions={configUrl:DEFAULT_CONFIG_BE_URL,loadIntegration:true,sessions:{autoTrack:true,timeout:DEFAULT_SESSION_TIMEOUT_MS,cutOff:{enabled:false}},sameSiteCookie:'Lax',polyfillIfRequired:true,integrations:DEFAULT_INTEGRATIONS_CONFIG,useBeacon:false,beaconQueueOptions:{},destinationsQueueOptions:{},queueOptions:{},lockIntegrationsVersion:true,lockPluginsVersion:true,uaChTrackLevel:'none',plugins:[],useGlobalIntegrationsConfigInEvents:false,bufferDataPlaneEventsUntilReady:false,dataPlaneEventsBufferTimeout:DEFAULT_DATA_PLANE_EVENTS_BUFFER_TIMEOUT_MS,storage:{encryption:{version:DEFAULT_STORAGE_ENCRYPTION_VERSION},migrate:true,cookie:{}},sendAdblockPage:false,sameDomainCookiesOnly:false,secureCookie:false,sendAdblockPageOptions:{},useServerSideCookies:false};var loadOptionsState=y(clone(defaultLoadOptions));
|
|
1056
1054
|
|
|
1057
1055
|
var DEFAULT_USER_SESSION_VALUES=_deepFreeze({userId:'',userTraits:{},anonymousId:'',groupId:'',groupTraits:{},initialReferrer:'',initialReferringDomain:'',sessionInfo:{},authToken:null});var DEFAULT_RESET_OPTIONS=_deepFreeze({entries:{userId:true,userTraits:true,groupId:true,groupTraits:true,sessionInfo:true,authToken:true,// These are not reset by default
|
|
1058
1056
|
anonymousId:false,initialReferrer:false,initialReferringDomain:false}});var SERVER_SIDE_COOKIES_DEBOUNCE_TIME=10;// milliseconds
|
|
1059
1057
|
|
|
1060
|
-
var sessionState={userId:
|
|
1058
|
+
var sessionState={userId:y(DEFAULT_USER_SESSION_VALUES.userId),userTraits:y(DEFAULT_USER_SESSION_VALUES.userTraits),anonymousId:y(DEFAULT_USER_SESSION_VALUES.anonymousId),groupId:y(DEFAULT_USER_SESSION_VALUES.groupId),groupTraits:y(DEFAULT_USER_SESSION_VALUES.groupTraits),initialReferrer:y(DEFAULT_USER_SESSION_VALUES.initialReferrer),initialReferringDomain:y(DEFAULT_USER_SESSION_VALUES.initialReferringDomain),sessionInfo:y(DEFAULT_USER_SESSION_VALUES.sessionInfo),authToken:y(DEFAULT_USER_SESSION_VALUES.authToken)};
|
|
1061
1059
|
|
|
1062
|
-
var capabilitiesState={isOnline:
|
|
1060
|
+
var capabilitiesState={isOnline:y(true),storage:{isLocalStorageAvailable:y(false),isCookieStorageAvailable:y(false),isSessionStorageAvailable:y(false)},isBeaconAvailable:y(false),isLegacyDOM:y(false),isUaCHAvailable:y(false),isCryptoAvailable:y(false),isAdBlockerDetectionInProgress:y(false),isAdBlocked:y(undefined),cspBlockedURLs:y([])};
|
|
1063
1061
|
|
|
1064
|
-
var reportingState={isErrorReportingEnabled:
|
|
1062
|
+
var reportingState={isErrorReportingEnabled:y(false),isMetricsReportingEnabled:y(false),breadcrumbs:y([])};
|
|
1065
1063
|
|
|
1066
|
-
var sourceConfigState=
|
|
1064
|
+
var sourceConfigState=y(undefined);
|
|
1067
1065
|
|
|
1068
|
-
var lifecycleState={activeDataplaneUrl:
|
|
1066
|
+
var lifecycleState={activeDataplaneUrl:y(undefined),integrationsCDNPath:y(DEFAULT_INTEGRATION_SDKS_URL),pluginsCDNPath:y(DEFAULT_PLUGINS_URL),sourceConfigUrl:y(undefined),status:y(undefined),initialized:y(false),logLevel:y(POST_LOAD_LOG_LEVEL),loaded:y(false),readyCallbacks:y([]),writeKey:y(undefined),dataPlaneUrl:y(undefined),safeAnalyticsInstance:y(undefined)};
|
|
1069
1067
|
|
|
1070
|
-
var consentsState={enabled:
|
|
1068
|
+
var consentsState={enabled:y(false),initialized:y(false),data:y({}),activeConsentManagerPluginName:y(undefined),preConsent:y({enabled:false}),postConsent:y({}),resolutionStrategy:y('and'),provider:y(undefined),metadata:y(undefined)};
|
|
1071
1069
|
|
|
1072
|
-
var metricsState={retries:
|
|
1070
|
+
var metricsState={retries:y(0),dropped:y(0),sent:y(0),queued:y(0),triggered:y(0),metricsServiceUrl:y(undefined)};
|
|
1073
1071
|
|
|
1074
1072
|
var getVariantValue=function getVariantValue(){// For CDN builds, use runtime window.rudderAnalyticsBuildType
|
|
1075
|
-
return BUILD_VARIANT;};var contextState={app:
|
|
1073
|
+
return BUILD_VARIANT;};var contextState={app:y({name:APP_NAME,namespace:APP_NAMESPACE,version:APP_VERSION,installType:MODULE_TYPE}),traits:y(null),library:y({name:APP_NAME,version:APP_VERSION,snippetVersion:globalThis.RudderSnippetVersion,variant:getVariantValue()}),userAgent:y(null),device:y(null),network:y(null),os:y({name:'',version:''}),locale:y(null),screen:y({density:0,width:0,height:0,innerWidth:0,innerHeight:0}),'ua-ch':y(undefined),timezone:y(undefined)};
|
|
1076
1074
|
|
|
1077
|
-
var nativeDestinationsState={configuredDestinations:
|
|
1075
|
+
var nativeDestinationsState={configuredDestinations:y([]),activeDestinations:y([]),loadOnlyIntegrations:y({}),failedDestinations:y([]),loadIntegration:y(true),initializedDestinations:y([]),clientDestinationsReady:y(false),integrationsConfig:y({})};
|
|
1078
1076
|
|
|
1079
|
-
var eventBufferState={toBeProcessedArray:
|
|
1077
|
+
var eventBufferState={toBeProcessedArray:y([]),readyCallbacksArray:y([])};
|
|
1080
1078
|
|
|
1081
|
-
var pluginsState={ready:
|
|
1079
|
+
var pluginsState={ready:y(false),loadedPlugins:y([]),failedPlugins:y([]),pluginsToLoadFromConfig:y([]),activePlugins:y([]),totalPluginsToLoad:y(0)};
|
|
1082
1080
|
|
|
1083
|
-
var storageState={encryptionPluginName:
|
|
1081
|
+
var storageState={encryptionPluginName:y(undefined),migrate:y(false),type:y(undefined),cookie:y(undefined),entries:y({}),trulyAnonymousTracking:y(false)};
|
|
1084
1082
|
|
|
1085
|
-
var serverSideCookiesState={isEnabledServerSideCookies:
|
|
1083
|
+
var serverSideCookiesState={isEnabledServerSideCookies:y(false),dataServiceUrl:y(undefined)};
|
|
1086
1084
|
|
|
1087
|
-
var dataPlaneEventsState={eventsQueuePluginName:
|
|
1085
|
+
var dataPlaneEventsState={eventsQueuePluginName:y(undefined),deliveryEnabled:y(true)// Delivery should always happen
|
|
1088
1086
|
};
|
|
1089
1087
|
|
|
1090
|
-
var autoTrackState={enabled:
|
|
1088
|
+
var autoTrackState={enabled:y(false),pageLifecycle:{enabled:y(false),pageViewId:y(undefined),pageLoadedTimestamp:y(undefined)}};
|
|
1091
1089
|
|
|
1092
1090
|
var defaultStateValues={capabilities:capabilitiesState,consents:consentsState,context:contextState,eventBuffer:eventBufferState,lifecycle:lifecycleState,loadOptions:loadOptionsState,metrics:metricsState,nativeDestinations:nativeDestinationsState,plugins:pluginsState,reporting:reportingState,session:sessionState,source:sourceConfigState,storage:storageState,serverCookies:serverSideCookiesState,dataPlaneEvents:dataPlaneEventsState,autoTrack:autoTrackState};var state=_objectSpread2({},clone(defaultStateValues));
|
|
1093
1091
|
|
|
1094
|
-
function
|
|
1095
|
-
|
|
1096
|
-
|
|
1092
|
+
var CHROME_STACK_LINE_RE=/^\s*at /;var SAFARI_NATIVE_RE=/^(eval@)?(\[native code])?$/;var LOCATION_RE=/(.+?)(?::(\d+))?(?::(\d+))?$/;function extractLocation(urlLike){if(!(urlLike!==null&&urlLike!==void 0&&urlLike.includes(':'))){return [urlLike||undefined,undefined,undefined];}var normalizedUrlLike=urlLike.startsWith('(')&&urlLike.endsWith(')')?urlLike.slice(1,-1):urlLike;var parts=LOCATION_RE.exec(normalizedUrlLike);if(!parts){return [undefined,undefined,undefined];}return [parts[1]||undefined,parts[2]===undefined?undefined:Number(parts[2]),parts[3]===undefined?undefined:Number(parts[3])];}function parseV8Line(line){if(!CHROME_STACK_LINE_RE.test(line)){return null;}if(line.includes('(eval ')){line=line.replaceAll('eval code','eval').replaceAll(/(\(eval at [^()]*)|(,.*$)/g,'');}var sanitized=line.replace(/^\s+/,'').replaceAll('(eval code','(').replace(/^.*?\s+/,'');var parenLoc=/ (\(.+\)$)/.exec(sanitized);var withoutLoc=parenLoc?sanitized.replace(parenLoc[0],''):sanitized;var _extractLocation=extractLocation(parenLoc?parenLoc[1]:sanitized),_extractLocation2=_slicedToArray(_extractLocation,3),rawFile=_extractLocation2[0],lineNumber=_extractLocation2[1],columnNumber=_extractLocation2[2];var functionName=parenLoc&&withoutLoc||undefined;var fileName=rawFile==='eval'||rawFile==='<anonymous>'?undefined:rawFile;return {functionName:functionName,fileName:fileName,lineNumber:lineNumber,columnNumber:columnNumber};}function parseFFSafariLine(line){if(SAFARI_NATIVE_RE.test(line)){return null;}if(line.includes(' > eval')){line=line.replaceAll(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,':$1');}if(!line.includes('@')&&!line.includes(':')){return {functionName:line,fileName:undefined,lineNumber:undefined,columnNumber:undefined};}var atIndex=line.lastIndexOf('@');var functionName=atIndex>0?line.slice(0,atIndex):undefined;var _extractLocation3=extractLocation(line.slice(atIndex+1)),_extractLocation4=_slicedToArray(_extractLocation3,3),fileName=_extractLocation4[0],lineNumber=_extractLocation4[1],columnNumber=_extractLocation4[2];return {functionName:functionName,fileName:fileName,lineNumber:lineNumber,columnNumber:columnNumber};}/**
|
|
1093
|
+
* Parses an Error object's stack trace into structured frames.
|
|
1094
|
+
* Supports V8/Chromium (Chrome, Edge, Node) and SpiderMonkey/WebKit (Firefox, Safari) formats.
|
|
1095
|
+
* Throws if the error has no stack property.
|
|
1096
|
+
*/function parseStackTrace(error){if(!error.stack){throw new Error('Cannot parse given Error object');}var lines=error.stack.split('\n');if(lines.some(function(l){return CHROME_STACK_LINE_RE.test(l);})){return lines.map(parseV8Line).filter(function(f){return f!==null;});}return lines.map(parseFFSafariLine).filter(function(f){return f!==null;});}
|
|
1097
1097
|
|
|
1098
|
-
var
|
|
1099
|
-
|
|
1100
|
-
var stackframe$1 = {exports: {}};
|
|
1101
|
-
|
|
1102
|
-
var stackframe=stackframe$1.exports;var hasRequiredStackframe;function requireStackframe(){if(hasRequiredStackframe)return stackframe$1.exports;hasRequiredStackframe=1;(function(module,exports$1){(function(root,factory){/* istanbul ignore next */{module.exports=factory();}})(stackframe,function(){function _isNumber(n){return !isNaN(parseFloat(n))&&isFinite(n);}function _capitalize(str){return str.charAt(0).toUpperCase()+str.substring(1);}function _getter(p){return function(){return this[p];};}var booleanProps=['isConstructor','isEval','isNative','isToplevel'];var numericProps=['columnNumber','lineNumber'];var stringProps=['fileName','functionName','source'];var arrayProps=['args'];var objectProps=['evalOrigin'];var props=booleanProps.concat(numericProps,stringProps,arrayProps,objectProps);function StackFrame(obj){if(!obj)return;for(var i=0;i<props.length;i++){if(obj[props[i]]!==undefined){this['set'+_capitalize(props[i])](obj[props[i]]);}}}StackFrame.prototype={getArgs:function getArgs(){return this.args;},setArgs:function setArgs(v){if(Object.prototype.toString.call(v)!=='[object Array]'){throw new TypeError('Args must be an Array');}this.args=v;},getEvalOrigin:function getEvalOrigin(){return this.evalOrigin;},setEvalOrigin:function setEvalOrigin(v){if(v instanceof StackFrame){this.evalOrigin=v;}else if(v instanceof Object){this.evalOrigin=new StackFrame(v);}else {throw new TypeError('Eval Origin must be an Object or StackFrame');}},toString:function toString(){var fileName=this.getFileName()||'';var lineNumber=this.getLineNumber()||'';var columnNumber=this.getColumnNumber()||'';var functionName=this.getFunctionName()||'';if(this.getIsEval()){if(fileName){return '[eval] ('+fileName+':'+lineNumber+':'+columnNumber+')';}return '[eval]:'+lineNumber+':'+columnNumber;}if(functionName){return functionName+' ('+fileName+':'+lineNumber+':'+columnNumber+')';}return fileName+':'+lineNumber+':'+columnNumber;}};StackFrame.fromString=function StackFrame$$fromString(str){var argsStartIndex=str.indexOf('(');var argsEndIndex=str.lastIndexOf(')');var functionName=str.substring(0,argsStartIndex);var args=str.substring(argsStartIndex+1,argsEndIndex).split(',');var locationString=str.substring(argsEndIndex+1);if(locationString.indexOf('@')===0){var parts=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(locationString,'');var fileName=parts[1];var lineNumber=parts[2];var columnNumber=parts[3];}return new StackFrame({functionName:functionName,args:args||undefined,fileName:fileName,lineNumber:lineNumber||undefined,columnNumber:columnNumber||undefined});};for(var i=0;i<booleanProps.length;i++){StackFrame.prototype['get'+_capitalize(booleanProps[i])]=_getter(booleanProps[i]);StackFrame.prototype['set'+_capitalize(booleanProps[i])]=function(p){return function(v){this[p]=Boolean(v);};}(booleanProps[i]);}for(var j=0;j<numericProps.length;j++){StackFrame.prototype['get'+_capitalize(numericProps[j])]=_getter(numericProps[j]);StackFrame.prototype['set'+_capitalize(numericProps[j])]=function(p){return function(v){if(!_isNumber(v)){throw new TypeError(p+' must be a Number');}this[p]=Number(v);};}(numericProps[j]);}for(var k=0;k<stringProps.length;k++){StackFrame.prototype['get'+_capitalize(stringProps[k])]=_getter(stringProps[k]);StackFrame.prototype['set'+_capitalize(stringProps[k])]=function(p){return function(v){this[p]=String(v);};}(stringProps[k]);}return StackFrame;});})(stackframe$1);return stackframe$1.exports;}
|
|
1103
|
-
|
|
1104
|
-
var errorStackParser=errorStackParser$1.exports;var hasRequiredErrorStackParser;function requireErrorStackParser(){if(hasRequiredErrorStackParser)return errorStackParser$1.exports;hasRequiredErrorStackParser=1;(function(module,exports$1){(function(root,factory){/* istanbul ignore next */{module.exports=factory(requireStackframe());}})(errorStackParser,function ErrorStackParser(StackFrame){var FIREFOX_SAFARI_STACK_REGEXP=/(^|@)\S+:\d+/;var CHROME_IE_STACK_REGEXP=/^\s*at .*(\S+:\d+|\(native\))/m;var SAFARI_NATIVE_CODE_REGEXP=/^(eval@)?(\[native code])?$/;return {/**
|
|
1105
|
-
* Given an Error object, extract the most information from it.
|
|
1106
|
-
*
|
|
1107
|
-
* @param {Error} error object
|
|
1108
|
-
* @return {Array} of StackFrames
|
|
1109
|
-
*/parse:function ErrorStackParser$$parse(error){if(typeof error.stacktrace!=='undefined'||typeof error['opera#sourceloc']!=='undefined'){return this.parseOpera(error);}else if(error.stack&&error.stack.match(CHROME_IE_STACK_REGEXP)){return this.parseV8OrIE(error);}else if(error.stack){return this.parseFFOrSafari(error);}else {throw new Error('Cannot parse given Error object');}},// Separate line and column numbers from a string of the form: (URI:Line:Column)
|
|
1110
|
-
extractLocation:function ErrorStackParser$$extractLocation(urlLike){// Fail-fast but return locations like "(native)"
|
|
1111
|
-
if(urlLike.indexOf(':')===-1){return [urlLike];}var regExp=/(.+?)(?::(\d+))?(?::(\d+))?$/;var parts=regExp.exec(urlLike.replace(/[()]/g,''));return [parts[1],parts[2]||undefined,parts[3]||undefined];},parseV8OrIE:function ErrorStackParser$$parseV8OrIE(error){var filtered=error.stack.split('\n').filter(function(line){return !!line.match(CHROME_IE_STACK_REGEXP);},this);return filtered.map(function(line){if(line.indexOf('(eval ')>-1){// Throw away eval information until we implement stacktrace.js/stackframe#8
|
|
1112
|
-
line=line.replace(/eval code/g,'eval').replace(/(\(eval at [^()]*)|(,.*$)/g,'');}var sanitizedLine=line.replace(/^\s+/,'').replace(/\(eval code/g,'(').replace(/^.*?\s+/,'');// capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in
|
|
1113
|
-
// case it has spaces in it, as the string is split on \s+ later on
|
|
1114
|
-
var location=sanitizedLine.match(/ (\(.+\)$)/);// remove the parenthesized location from the line, if it was matched
|
|
1115
|
-
sanitizedLine=location?sanitizedLine.replace(location[0],''):sanitizedLine;// if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine
|
|
1116
|
-
// because this line doesn't have function name
|
|
1117
|
-
var locationParts=this.extractLocation(location?location[1]:sanitizedLine);var functionName=location&&sanitizedLine||undefined;var fileName=['eval','<anonymous>'].indexOf(locationParts[0])>-1?undefined:locationParts[0];return new StackFrame({functionName:functionName,fileName:fileName,lineNumber:locationParts[1],columnNumber:locationParts[2],source:line});},this);},parseFFOrSafari:function ErrorStackParser$$parseFFOrSafari(error){var filtered=error.stack.split('\n').filter(function(line){return !line.match(SAFARI_NATIVE_CODE_REGEXP);},this);return filtered.map(function(line){// Throw away eval information until we implement stacktrace.js/stackframe#8
|
|
1118
|
-
if(line.indexOf(' > eval')>-1){line=line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,':$1');}if(line.indexOf('@')===-1&&line.indexOf(':')===-1){// Safari eval frames only have function names and nothing else
|
|
1119
|
-
return new StackFrame({functionName:line});}else {var functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;var matches=line.match(functionNameRegex);var functionName=matches&&matches[1]?matches[1]:undefined;var locationParts=this.extractLocation(line.replace(functionNameRegex,''));return new StackFrame({functionName:functionName,fileName:locationParts[0],lineNumber:locationParts[1],columnNumber:locationParts[2],source:line});}},this);},parseOpera:function ErrorStackParser$$parseOpera(e){if(!e.stacktrace||e.message.indexOf('\n')>-1&&e.message.split('\n').length>e.stacktrace.split('\n').length){return this.parseOpera9(e);}else if(!e.stack){return this.parseOpera10(e);}else {return this.parseOpera11(e);}},parseOpera9:function ErrorStackParser$$parseOpera9(e){var lineRE=/Line (\d+).*script (?:in )?(\S+)/i;var lines=e.message.split('\n');var result=[];for(var i=2,len=lines.length;i<len;i+=2){var match=lineRE.exec(lines[i]);if(match){result.push(new StackFrame({fileName:match[2],lineNumber:match[1],source:lines[i]}));}}return result;},parseOpera10:function ErrorStackParser$$parseOpera10(e){var lineRE=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i;var lines=e.stacktrace.split('\n');var result=[];for(var i=0,len=lines.length;i<len;i+=2){var match=lineRE.exec(lines[i]);if(match){result.push(new StackFrame({functionName:match[3]||undefined,fileName:match[2],lineNumber:match[1],source:lines[i]}));}}return result;},// Opera 10.65+ Error.stack very similar to FF/Safari
|
|
1120
|
-
parseOpera11:function ErrorStackParser$$parseOpera11(error){var filtered=error.stack.split('\n').filter(function(line){return !!line.match(FIREFOX_SAFARI_STACK_REGEXP)&&!line.match(/^Error created at/);},this);return filtered.map(function(line){var tokens=line.split('@');var locationParts=this.extractLocation(tokens.pop());var functionCall=tokens.shift()||'';var functionName=functionCall.replace(/<anonymous function(: (\w+))?>/,'$2').replace(/\([^)]*\)/g,'')||undefined;var argsRaw;if(functionCall.match(/\(([^)]*)\)/)){argsRaw=functionCall.replace(/^[^(]+\(([^)]*)\)$/,'$1');}var args=argsRaw===undefined||argsRaw==='[arguments not available]'?undefined:argsRaw.split(',');return new StackFrame({functionName:functionName,args:args,fileName:locationParts[0],lineNumber:locationParts[1],columnNumber:locationParts[2],source:line});},this);}};});})(errorStackParser$1);return errorStackParser$1.exports;}
|
|
1121
|
-
|
|
1122
|
-
var errorStackParserExports = requireErrorStackParser();
|
|
1123
|
-
var ErrorStackParser = /*@__PURE__*/getDefaultExportFromCjs(errorStackParserExports);
|
|
1124
|
-
|
|
1125
|
-
var GLOBAL_CODE='global code';var normalizeFunctionName=function normalizeFunctionName(name){if(isDefined(name)){return /^global code$/i.test(name)?GLOBAL_CODE:name;}return name;};/**
|
|
1126
|
-
* Takes a stacktrace.js style stackframe (https://github.com/stacktracejs/stackframe)
|
|
1127
|
-
* and returns a Bugsnag compatible stackframe (https://docs.bugsnag.com/api/error-reporting/#json-payload)
|
|
1128
|
-
* @param frame
|
|
1129
|
-
* @returns
|
|
1130
|
-
*/var formatStackframe=function formatStackframe(frame){var f={file:frame.fileName,method:normalizeFunctionName(frame.functionName),lineNumber:frame.lineNumber,columnNumber:frame.columnNumber};// Some instances result in no file:
|
|
1098
|
+
var GLOBAL_CODE='global code';var normalizeFunctionName=function normalizeFunctionName(name){if(isDefined(name)){return /^global code$/i.test(name)?GLOBAL_CODE:name;}return name;};var formatStackframe=function formatStackframe(frame){var f={file:frame.fileName,method:normalizeFunctionName(frame.functionName),lineNumber:frame.lineNumber,columnNumber:frame.columnNumber};// Some instances result in no file:
|
|
1131
1099
|
// - non-error exception thrown from global code in FF
|
|
1132
1100
|
// This adds one.
|
|
1133
1101
|
if(f.lineNumber&&f.lineNumber>-1&&!f.file&&!f.method){f.file=GLOBAL_CODE;}return f;};var ensureString=function ensureString(str){return isString(str)?str:'';};function createException(errorClass,errorMessage,msgPrefix,stacktrace){return {errorClass:ensureString(errorClass),message:"".concat(msgPrefix).concat(ensureString(errorMessage)),type:'browserjs',stacktrace:stacktrace.reduce(function(accum,frame){var f=formatStackframe(frame);// don't include a stackframe if none of its properties are defined
|
|
1134
|
-
try{if(JSON.stringify(f)==='{}')return accum;return accum.concat(f);}catch(_unused){return accum;}},[])};}var normalizeError=function normalizeError(maybeError,logger){var error;if(isTypeOfError(maybeError)&&isString(getStacktrace(maybeError))){error=maybeError;}else {logger.warn(NON_ERROR_WARNING(ERROR_HANDLER,stringifyWithoutCircular(maybeError)));error=undefined;}return error;};var createBugsnagException=function createBugsnagException(error,msgPrefix){try{var stacktrace=
|
|
1102
|
+
try{if(JSON.stringify(f)==='{}')return accum;return accum.concat(f);}catch(_unused){return accum;}},[])};}var normalizeError=function normalizeError(maybeError,logger){var error;if(isTypeOfError(maybeError)&&isString(getStacktrace(maybeError))){error=maybeError;}else {logger.warn(NON_ERROR_WARNING(ERROR_HANDLER,stringifyWithoutCircular(maybeError)));error=undefined;}return error;};var createBugsnagException=function createBugsnagException(error,msgPrefix){try{var stacktrace=parseStackTrace(error);return createException(error.name,error.message,msgPrefix,stacktrace);}catch(_unused2){return createException(error.name,error.message,msgPrefix,[]);}};
|
|
1135
1103
|
|
|
1136
1104
|
/**
|
|
1137
1105
|
* Utility to parse XHR JSON response
|
|
@@ -1199,7 +1167,7 @@ var getErrInstance=function getErrInstance(err,errorType){switch(errorType){case
|
|
|
1199
1167
|
* @param {Function} resolve The promise's resolve function
|
|
1200
1168
|
*/var checkIfAdBlockersAreActive=function checkIfAdBlockersAreActive(state,httpClient,resolve){// Initiate ad blocker detection if not done previously and not already in progress.
|
|
1201
1169
|
if(isUndefined(state.capabilities.isAdBlocked.value)){if(state.capabilities.isAdBlockerDetectionInProgress.value===false){detectAdBlockers(httpClient);}// Wait for the detection to complete.
|
|
1202
|
-
var detectionDisposer=
|
|
1170
|
+
var detectionDisposer=C(function(){if(isDefined(state.capabilities.isAdBlocked.value)){// If ad blocker is not detected, notify.
|
|
1203
1171
|
resolve(state.capabilities.isAdBlocked.value===false);// Cleanup the effect.
|
|
1204
1172
|
detectionDisposer();}});}else {// If ad blocker is not detected, notify.
|
|
1205
1173
|
resolve(state.capabilities.isAdBlocked.value===false);}};/**
|
|
@@ -3174,7 +3142,7 @@ var PluginsManager=/*#__PURE__*/function(){function PluginsManager(engine,errorH
|
|
|
3174
3142
|
this.setActivePlugins();this.registerLocalPlugins();this.registerRemotePlugins();this.attachEffects();}/**
|
|
3175
3143
|
* Update state based on plugin loaded status
|
|
3176
3144
|
*/// eslint-disable-next-line class-methods-use-this
|
|
3177
|
-
},{key:"attachEffects",value:function attachEffects(){
|
|
3145
|
+
},{key:"attachEffects",value:function attachEffects(){C(function(){var isAllPluginsReady=state.plugins.activePlugins.value.length===0||state.plugins.loadedPlugins.value.length+state.plugins.failedPlugins.value.length===state.plugins.totalPluginsToLoad.value;if(isAllPluginsReady){n(function(){state.plugins.ready.value=true;// TODO: decide what to do if a plugin fails to load for any reason.
|
|
3178
3146
|
// Should we stop here or should we progress?
|
|
3179
3147
|
state.lifecycle.status.value='pluginsReady';});}});}/**
|
|
3180
3148
|
* Determine the list of plugins that should be loaded based on sourceConfig & load options
|
|
@@ -3237,6 +3205,10 @@ var getDefaultCookieOptions=function getDefaultCookieOptions(){var topDomain="."
|
|
|
3237
3205
|
* A storage utility to retain values in memory via Storage interface
|
|
3238
3206
|
*/var InMemoryStorage=/*#__PURE__*/function(){function InMemoryStorage(logger){_classCallCheck(this,InMemoryStorage);_defineProperty(this,"isEnabled",true);_defineProperty(this,"length",0);_defineProperty(this,"data",{});this.options=getDefaultInMemoryStorageOptions();this.logger=logger;}return _createClass(InMemoryStorage,[{key:"configure",value:function configure(options){this.options=mergeDeepRight(this.options,options!==null&&options!==void 0?options:{});this.isEnabled=Boolean(this.options.enabled);return this.options;}},{key:"setItem",value:function setItem(key,value){this.data[key]=value;this.length=Object.keys(this.data).length;return value;}},{key:"getItem",value:function getItem(key){if(key in this.data){return this.data[key];}return null;}},{key:"removeItem",value:function removeItem(key){if(key in this.data){delete this.data[key];}this.length=Object.keys(this.data).length;return null;}},{key:"clear",value:function clear(){this.data={};this.length=0;}},{key:"key",value:function key(index){var _curKeys$index;var curKeys=this.keys();return (_curKeys$index=curKeys[index])!==null&&_curKeys$index!==void 0?_curKeys$index:null;}},{key:"keys",value:function keys(){return Object.keys(this.data);}}]);}();var defaultInMemoryStorage=new InMemoryStorage(defaultLogger);
|
|
3239
3207
|
|
|
3208
|
+
function getDefaultExportFromCjs (x) {
|
|
3209
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3240
3212
|
var store$2 = {exports: {}};
|
|
3241
3213
|
|
|
3242
3214
|
var store$1=store$2.exports;var hasRequiredStore;function requireStore(){if(hasRequiredStore)return store$2.exports;hasRequiredStore=1;(function(module,exports$1){(function(global,factory){module.exports=factory();})(store$1,function(){function isJSON(obj){obj=JSON.stringify(obj);if(!/^\{[\s\S]*\}$/.test(obj)){return false;}return true;}function stringify(val){return val===undefined||typeof val==="function"?val+'':JSON.stringify(val);}function deserialize(value){if(typeof value!=='string'){return undefined;}try{return JSON.parse(value);}catch(e){return value;}}function isFunction(value){return {}.toString.call(value)==="[object Function]";}function isArray(value){return Object.prototype.toString.call(value)==="[object Array]";}// https://github.com/jaywcjlove/store.js/pull/8
|
|
@@ -3470,7 +3442,7 @@ if(lockVersion){sdkComponentBaseURL=sdkComponentBaseURL.replace(new RegExp("/".c
|
|
|
3470
3442
|
* @returns
|
|
3471
3443
|
*/var getIntegrationsCDNPath=function getIntegrationsCDNPath(currentSdkVersion,lockIntegrationsVersion,integrationsUrlFromLoadOptions,logger){return getSDKComponentBaseURL('integrations',CDN_INT_DIR,DEFAULT_INTEGRATION_SDKS_URL,currentSdkVersion,lockIntegrationsVersion,integrationsUrlFromLoadOptions,logger);};
|
|
3472
3444
|
|
|
3473
|
-
var ConfigManager=/*#__PURE__*/function(){function ConfigManager(httpClient,errorHandler,logger){_classCallCheck(this,ConfigManager);this.errorHandler=errorHandler;this.logger=logger;this.httpClient=httpClient;this.onError=this.onError.bind(this);this.processConfig=this.processConfig.bind(this);}return _createClass(ConfigManager,[{key:"attachEffects",value:function attachEffects(){var _this=this;
|
|
3445
|
+
var ConfigManager=/*#__PURE__*/function(){function ConfigManager(httpClient,errorHandler,logger){_classCallCheck(this,ConfigManager);this.errorHandler=errorHandler;this.logger=logger;this.httpClient=httpClient;this.onError=this.onError.bind(this);this.processConfig=this.processConfig.bind(this);}return _createClass(ConfigManager,[{key:"attachEffects",value:function attachEffects(){var _this=this;C(function(){_this.logger.setMinLogLevel(state.lifecycle.logLevel.value);});}/**
|
|
3474
3446
|
* A function to validate, construct and store loadOption, lifecycle, source and destination
|
|
3475
3447
|
* config related information in global state
|
|
3476
3448
|
*/},{key:"init",value:function init(){var _this2=this;var _state$loadOptions$va=state.loadOptions.value,logLevel=_state$loadOptions$va.logLevel,configUrl=_state$loadOptions$va.configUrl,lockIntegrationsVersion=_state$loadOptions$va.lockIntegrationsVersion,lockPluginsVersion=_state$loadOptions$va.lockPluginsVersion,destSDKBaseURL=_state$loadOptions$va.destSDKBaseURL;_state$loadOptions$va.pluginsSDKBaseURL;var integrations=_state$loadOptions$va.integrations;// determine the path to fetch integration SDK from
|
|
@@ -3546,9 +3518,9 @@ var CapabilitiesManager=/*#__PURE__*/function(){function CapabilitiesManager(htt
|
|
|
3546
3518
|
*/// eslint-disable-next-line class-methods-use-this
|
|
3547
3519
|
},{key:"detectBrowserCapabilities",value:function detectBrowserCapabilities(){var _this=this;n(function(){// Storage related details
|
|
3548
3520
|
state.capabilities.storage.isCookieStorageAvailable.value=isStorageAvailable(COOKIE_STORAGE,getStorageEngine(COOKIE_STORAGE),_this.logger);state.capabilities.storage.isLocalStorageAvailable.value=isStorageAvailable(LOCAL_STORAGE,undefined,_this.logger);state.capabilities.storage.isSessionStorageAvailable.value=isStorageAvailable(SESSION_STORAGE,undefined,_this.logger);// Browser feature detection details
|
|
3549
|
-
state.capabilities.isBeaconAvailable.value=hasBeacon();state.capabilities.isUaCHAvailable.value=hasUAClientHints();state.capabilities.isCryptoAvailable.value=hasCrypto();state.capabilities.
|
|
3521
|
+
state.capabilities.isBeaconAvailable.value=hasBeacon();state.capabilities.isUaCHAvailable.value=hasUAClientHints();state.capabilities.isCryptoAvailable.value=hasCrypto();state.capabilities.isOnline.value=globalThis.navigator.onLine;// Get page context details
|
|
3550
3522
|
state.context.userAgent.value=getUserAgent();state.context.locale.value=getLanguage();state.context.screen.value=getScreenDetails();state.context.timezone.value=getTimezone();if(hasUAClientHints()){getUserAgentClientHint(function(uach){state.context['ua-ch'].value=uach;},state.loadOptions.value.uaChTrackLevel);}});// Ad blocker detection
|
|
3551
|
-
|
|
3523
|
+
C(function(){if(state.loadOptions.value.sendAdblockPage===true&&state.lifecycle.sourceConfigUrl.value!==undefined){detectAdBlockers(_this.httpClient);}});}/**
|
|
3552
3524
|
* Detect if polyfills are required and then load script from polyfill URL
|
|
3553
3525
|
*/},{key:"prepareBrowserCapabilities",value:function prepareBrowserCapabilities(){var _this2=this;state.capabilities.isLegacyDOM.value=isLegacyJSEngine();var customPolyfillUrl=state.loadOptions.value.polyfillURL;var polyfillUrl=POLYFILL_URL;if(isDefinedAndNotNull(customPolyfillUrl)){if(isValidURL(customPolyfillUrl)){polyfillUrl=customPolyfillUrl;}else {this.logger.warn(INVALID_POLYFILL_URL_WARNING(CAPABILITIES_MANAGER,customPolyfillUrl));}}var shouldLoadPolyfill=state.loadOptions.value.polyfillIfRequired&&state.capabilities.isLegacyDOM.value&&isValidURL(polyfillUrl);if(shouldLoadPolyfill){var isDefaultPolyfillService=polyfillUrl!==state.loadOptions.value.polyfillURL;if(isDefaultPolyfillService){// write key specific callback
|
|
3554
3526
|
// NOTE: we're not putting this into RudderStackGlobals as providing the property path to the callback function in the polyfill URL is not possible
|
|
@@ -3777,7 +3749,7 @@ this.serverSideCookiesRequestInProgress[sessionKey]=true;if(this.serverSideCooki
|
|
|
3777
3749
|
var sessionToCookiesMap=_defineProperty({},sessionKey,{name:cookieName});_this5.setServerSideCookies(sessionToCookiesMap,function(cookieName,cookieValue){curStore===null||curStore===void 0||curStore.set(cookieName,cookieValue);},curStore);},SERVER_SIDE_COOKIES_DEBOUNCE_TIME);}else {curStore===null||curStore===void 0||curStore.set(cookieName,cookieValue);}}else {curStore===null||curStore===void 0||curStore.remove(cookieName);}}}/**
|
|
3778
3750
|
* Function to update storage whenever state value changes
|
|
3779
3751
|
*/},{key:"registerEffects",value:function registerEffects(){var _this6=this;// This will work as long as the user session entry key names are same as the state keys
|
|
3780
|
-
USER_SESSION_KEYS.forEach(function(sessionKey){
|
|
3752
|
+
USER_SESSION_KEYS.forEach(function(sessionKey){C(function(){_this6.syncValueToStorage(sessionKey);});});}/**
|
|
3781
3753
|
* Sets anonymous id in the following precedence:
|
|
3782
3754
|
*
|
|
3783
3755
|
* 1. anonymousId: Id directly provided to the function.
|
|
@@ -3918,11 +3890,11 @@ var safelyInvokeCallback=function safelyInvokeCallback(callback,args,apiName,log
|
|
|
3918
3890
|
*/function EventRepository(pluginsManager,storeManager,httpClient,errorHandler,logger){_classCallCheck(this,EventRepository);this.pluginsManager=pluginsManager;this.errorHandler=errorHandler;this.httpClient=httpClient;this.logger=logger;this.storeManager=storeManager;}/**
|
|
3919
3891
|
* Initializes the event repository
|
|
3920
3892
|
*/return _createClass(EventRepository,[{key:"init",value:function init(){var _this=this;this.dataplaneEventsQueue=this.pluginsManager.invokeSingle("".concat(DATA_PLANE_QUEUE_EXT_POINT_PREFIX,".init"),state,this.httpClient,this.storeManager,this.errorHandler,this.logger);this.dmtEventsQueue=this.pluginsManager.invokeSingle("".concat(DMT_EXT_POINT_PREFIX,".init"),state,this.pluginsManager,this.httpClient,this.storeManager,this.errorHandler,this.logger);this.destinationsEventsQueue=this.pluginsManager.invokeSingle("".concat(DESTINATIONS_QUEUE_EXT_POINT_PREFIX,".init"),state,this.pluginsManager,this.storeManager,this.dmtEventsQueue,this.errorHandler,this.logger);// Start the queue once the client destinations are ready
|
|
3921
|
-
|
|
3893
|
+
C(function(){if(state.nativeDestinations.clientDestinationsReady.value===true){var _this$destinationsEve,_this$dmtEventsQueue;(_this$destinationsEve=_this.destinationsEventsQueue)===null||_this$destinationsEve===void 0||_this$destinationsEve.start();(_this$dmtEventsQueue=_this.dmtEventsQueue)===null||_this$dmtEventsQueue===void 0||_this$dmtEventsQueue.start();}});var bufferEventsBeforeConsent=shouldBufferEventsForPreConsent(state);// Start the queue processing only when the destinations are ready or hybrid mode destinations exist
|
|
3922
3894
|
// However, events will be enqueued for now.
|
|
3923
3895
|
// At the time of processing the events, the integrations config data from destinations
|
|
3924
3896
|
// is merged into the event object
|
|
3925
|
-
var timeoutId;
|
|
3897
|
+
var timeoutId;C(function(){var _this$dataplaneEvents;var shouldBufferDpEvents=state.loadOptions.value.bufferDataPlaneEventsUntilReady===true&&state.nativeDestinations.clientDestinationsReady.value===false;var hybridDestExist=state.nativeDestinations.activeDestinations.value.some(function(dest){return isHybridModeDestination(dest);});if((hybridDestExist===false||shouldBufferDpEvents===false)&&!bufferEventsBeforeConsent&&((_this$dataplaneEvents=_this.dataplaneEventsQueue)===null||_this$dataplaneEvents===void 0?void 0:_this$dataplaneEvents.scheduleTimeoutActive)!==true){var _this$dataplaneEvents2;globalThis.clearTimeout(timeoutId);(_this$dataplaneEvents2=_this.dataplaneEventsQueue)===null||_this$dataplaneEvents2===void 0||_this$dataplaneEvents2.start();}});// Force start the data plane events queue processing after a timeout
|
|
3926
3898
|
if(state.loadOptions.value.bufferDataPlaneEventsUntilReady===true){timeoutId=globalThis.setTimeout(function(){var _this$dataplaneEvents3;if(((_this$dataplaneEvents3=_this.dataplaneEventsQueue)===null||_this$dataplaneEvents3===void 0?void 0:_this$dataplaneEvents3.scheduleTimeoutActive)!==true){var _this$dataplaneEvents4;(_this$dataplaneEvents4=_this.dataplaneEventsQueue)===null||_this$dataplaneEvents4===void 0||_this$dataplaneEvents4.start();}},state.loadOptions.value.dataPlaneEventsBufferTimeout);}}},{key:"resume",value:function resume(){var _this$dataplaneEvents5;if(((_this$dataplaneEvents5=this.dataplaneEventsQueue)===null||_this$dataplaneEvents5===void 0?void 0:_this$dataplaneEvents5.scheduleTimeoutActive)!==true){var _this$dataplaneEvents7;if(state.consents.postConsent.value.discardPreConsentEvents){var _this$dataplaneEvents6,_this$destinationsEve2;(_this$dataplaneEvents6=this.dataplaneEventsQueue)===null||_this$dataplaneEvents6===void 0||_this$dataplaneEvents6.clear();(_this$destinationsEve2=this.destinationsEventsQueue)===null||_this$destinationsEve2===void 0||_this$destinationsEve2.clear();}(_this$dataplaneEvents7=this.dataplaneEventsQueue)===null||_this$dataplaneEvents7===void 0||_this$dataplaneEvents7.start();}}/**
|
|
3927
3899
|
* Enqueues the event for processing
|
|
3928
3900
|
* @param event RudderEvent object
|
|
@@ -3946,7 +3918,7 @@ setExposedGlobal('state',state,writeKey);// Configure initial config of any serv
|
|
|
3946
3918
|
this.startLifecycle();}// Start lifecycle methods
|
|
3947
3919
|
/**
|
|
3948
3920
|
* Orchestrate the lifecycle of the application phases/status
|
|
3949
|
-
*/},{key:"startLifecycle",value:function startLifecycle(){var _this=this;
|
|
3921
|
+
*/},{key:"startLifecycle",value:function startLifecycle(){var _this=this;C(function(){try{switch(state.lifecycle.status.value){case 'mounted':_this.onMounted();break;case 'browserCapabilitiesReady':_this.onBrowserCapabilitiesReady();break;case 'configured':_this.onConfigured();break;case 'pluginsLoading':break;case 'pluginsReady':_this.onPluginsReady();break;case 'initialized':_this.onInitialized();break;case 'loaded':_this.onLoaded();break;case 'destinationsLoading':break;case 'destinationsReady':_this.onDestinationsReady();break;case 'ready':_this.onReady();break;case 'readyExecuted':default:break;}}catch(err){var issue='Failed to load the SDK';_this.errorHandler.onError({error:err,context:ANALYTICS_CORE,customMessage:issue,groupingHash:issue});}});}},{key:"onBrowserCapabilitiesReady",value:function onBrowserCapabilitiesReady(){// initialize the preloaded events enqueuing
|
|
3950
3922
|
retrievePreloadBufferEvents(this);this.prepareInternalServices();this.loadConfig();}},{key:"onLoaded",value:function onLoaded(){this.processBufferedEvents();// Short-circuit the life cycle and move to the ready state if pre-consent behavior is enabled
|
|
3951
3923
|
if(state.consents.preConsent.value.enabled===true){state.lifecycle.status.value='ready';}else {this.loadDestinations();}}/**
|
|
3952
3924
|
* Load browser polyfill if required
|
|
@@ -3987,10 +3959,10 @@ var bufferedEvents=state.eventBuffer.toBeProcessedArray.value;while(bufferedEven
|
|
|
3987
3959
|
(_ref=this)[methodName].apply(_ref,_toConsumableArray(bufferedEvent.slice(1)).concat([true]));}}bufferedEvents=state.eventBuffer.toBeProcessedArray.value;}}/**
|
|
3988
3960
|
* Load device mode destinations
|
|
3989
3961
|
*/},{key:"loadDestinations",value:function loadDestinations(){var _this$pluginsManager4,_this$pluginsManager5;// If the integrations load is already triggered or completed, skip the rest of the logic
|
|
3990
|
-
if(state.lifecycle.status.value==='destinationsLoading'||state.
|
|
3991
|
-
(_this$pluginsManager4=this.pluginsManager)===null||_this$pluginsManager4===void 0||_this$pluginsManager4.invokeSingle('nativeDestinations.setActiveDestinations',state,this.pluginsManager,this.errorHandler,this.logger);var totalDestinationsToLoad=state.nativeDestinations.activeDestinations.value.length;if(totalDestinationsToLoad===0){state.lifecycle.status.value='destinationsReady';return;}// Start loading native integration scripts and create instances
|
|
3962
|
+
if(state.lifecycle.status.value==='destinationsLoading'||state.nativeDestinations.clientDestinationsReady.value===true){return;}// Set in state the desired activeDestinations to inject in DOM
|
|
3963
|
+
(_this$pluginsManager4=this.pluginsManager)===null||_this$pluginsManager4===void 0||_this$pluginsManager4.invokeSingle('nativeDestinations.setActiveDestinations',state,this.pluginsManager,this.errorHandler,this.logger);var totalDestinationsToLoad=state.nativeDestinations.activeDestinations.value.length;if(totalDestinationsToLoad===0){n(function(){state.nativeDestinations.clientDestinationsReady.value=true;state.lifecycle.status.value='destinationsReady';});return;}// Start loading native integration scripts and create instances
|
|
3992
3964
|
state.lifecycle.status.value='destinationsLoading';(_this$pluginsManager5=this.pluginsManager)===null||_this$pluginsManager5===void 0||_this$pluginsManager5.invokeSingle('nativeDestinations.load',state,this.externalSrcLoader,this.errorHandler,this.logger);// Progress to next lifecycle phase if all native destinations are initialized or failed
|
|
3993
|
-
|
|
3965
|
+
C(function(){var areAllDestinationsReady=state.nativeDestinations.initializedDestinations.value.length+state.nativeDestinations.failedDestinations.value.length===totalDestinationsToLoad;if(areAllDestinationsReady){n(function(){state.lifecycle.status.value='destinationsReady';state.nativeDestinations.clientDestinationsReady.value=true;});}});}/**
|
|
3994
3966
|
* Move to the ready state
|
|
3995
3967
|
*/// eslint-disable-next-line class-methods-use-this
|
|
3996
3968
|
},{key:"onDestinationsReady",value:function onDestinationsReady(){// May be do any destination specific actions here
|