@rudderstack/analytics-js 3.11.15 → 3.11.17
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 +20 -0
- package/LICENSE.md +6 -6
- package/dist/npm/index.d.cts +1 -1
- package/dist/npm/index.d.mts +1 -1
- package/dist/npm/legacy/bundled/cjs/index.cjs +102 -94
- package/dist/npm/legacy/bundled/esm/index.mjs +102 -94
- package/dist/npm/legacy/bundled/umd/index.js +102 -94
- package/dist/npm/legacy/cjs/index.cjs +102 -94
- package/dist/npm/legacy/content-script/cjs/index.cjs +99 -92
- package/dist/npm/legacy/content-script/esm/index.mjs +99 -92
- package/dist/npm/legacy/content-script/umd/index.js +99 -92
- package/dist/npm/legacy/esm/index.mjs +102 -94
- package/dist/npm/legacy/umd/index.js +102 -94
- package/dist/npm/modern/bundled/cjs/index.cjs +95 -93
- package/dist/npm/modern/bundled/esm/index.mjs +95 -93
- package/dist/npm/modern/bundled/umd/index.js +95 -93
- package/dist/npm/modern/cjs/index.cjs +6 -6
- package/dist/npm/modern/content-script/cjs/index.cjs +93 -92
- package/dist/npm/modern/content-script/esm/index.mjs +93 -92
- package/dist/npm/modern/content-script/umd/index.js +93 -92
- package/dist/npm/modern/esm/index.mjs +6 -6
- package/dist/npm/modern/umd/index.js +6 -6
- package/package.json +1 -1
@@ -421,7 +421,7 @@
|
|
421
421
|
* @returns ISO formatted timestamp string
|
422
422
|
*/const getCurrentTimeFormatted=()=>getFormattedTimestamp(new Date());
|
423
423
|
|
424
|
-
const LOG_CONTEXT_SEPARATOR=':: ';const SCRIPT_ALREADY_EXISTS_ERROR=id=>`A script with the id "${id}" is already loaded. Skipping the loading of this script to prevent conflicts.`;const SCRIPT_LOAD_ERROR=(id,url)=>`Failed to load the script with the id "${id}" from URL "${url}".`;const SCRIPT_LOAD_TIMEOUT_ERROR=(id,url,timeout)=>`A timeout of ${timeout} ms occurred while trying to load the script with id "${id}" from URL "${url}".`;const CIRCULAR_REFERENCE_WARNING=(context,key)=>`${context}${LOG_CONTEXT_SEPARATOR}A circular reference has been detected in the object and the property "${key}" has been dropped from the output.`;const JSON_STRINGIFY_WARNING=`Failed to convert the value to a JSON string.`;
|
424
|
+
const LOG_CONTEXT_SEPARATOR=':: ';const SCRIPT_ALREADY_EXISTS_ERROR=id=>`A script with the id "${id}" is already loaded. Skipping the loading of this script to prevent conflicts.`;const SCRIPT_LOAD_ERROR=(id,url)=>`Failed to load the script with the id "${id}" from URL "${url}".`;const SCRIPT_LOAD_TIMEOUT_ERROR=(id,url,timeout)=>`A timeout of ${timeout} ms occurred while trying to load the script with id "${id}" from URL "${url}".`;const CIRCULAR_REFERENCE_WARNING=(context,key)=>`${context}${LOG_CONTEXT_SEPARATOR}A circular reference has been detected in the object and the property "${key}" has been dropped from the output.`;const JSON_STRINGIFY_WARNING=`Failed to convert the value to a JSON string.`;const COOKIE_DATA_ENCODING_ERROR=`Failed to encode the cookie data.`;
|
425
425
|
|
426
426
|
const JSON_STRINGIFY='JSONStringify';const BIG_INT_PLACEHOLDER='[BigInt]';const CIRCULAR_REFERENCE_PLACEHOLDER='[Circular Reference]';const getCircularReplacer=(excludeNull,excludeKeys,logger)=>{const ancestors=[];// Here we do not want to use arrow function to use "this" in function context
|
427
427
|
// eslint-disable-next-line func-names
|
@@ -465,7 +465,7 @@
|
|
465
465
|
* @returns Instance of Error with message prepended with issue
|
466
466
|
*/const getMutatedError=(err,issue)=>{let finalError=err;if(!isTypeOfError(err)){finalError=new Error(`${issue}: ${stringifyWithoutCircular(err)}`);}else {finalError.message=`${issue}: ${err.message}`;}return finalError;};const dispatchErrorEvent=error=>{if(isTypeOfError(error)){error.stack=`${error.stack??''}\n${MANUAL_ERROR_IDENTIFIER}`;}globalThis.dispatchEvent(new ErrorEvent('error',{error}));};
|
467
467
|
|
468
|
-
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.11.
|
468
|
+
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.11.17';const APP_NAMESPACE='com.rudderlabs.javascript';const MODULE_TYPE='npm';const ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';const ADBLOCK_PAGE_NAME='ad-block page request';const ADBLOCK_PAGE_PATH='/ad-blocked';const GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';const CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
469
469
|
|
470
470
|
const QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';const QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';const QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';const QUERY_PARAM_USER_ID_KEY='ajs_uid';const QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
471
471
|
|
@@ -716,10 +716,6 @@
|
|
716
716
|
const isErrRetryable=details=>{let isRetryableNWFailure=false;if(details?.error&&details?.xhr){const xhrStatus=details.xhr.status;// same as in v1.1
|
717
717
|
isRetryableNWFailure=xhrStatus===429||xhrStatus>=500&&xhrStatus<600;}return isRetryableNWFailure;};
|
718
718
|
|
719
|
-
const userIdKey='rl_user_id';const userTraitsKey='rl_trait';const anonymousUserIdKey='rl_anonymous_id';const groupIdKey='rl_group_id';const groupTraitsKey='rl_group_trait';const pageInitialReferrerKey='rl_page_init_referrer';const pageInitialReferringDomainKey='rl_page_init_referring_domain';const sessionInfoKey='rl_session';const authTokenKey='rl_auth_token';const COOKIE_KEYS={userId:userIdKey,userTraits:userTraitsKey,anonymousId:anonymousUserIdKey,groupId:groupIdKey,groupTraits:groupTraitsKey,initialReferrer:pageInitialReferrerKey,initialReferringDomain:pageInitialReferringDomainKey,sessionInfo:sessionInfoKey,authToken:authTokenKey};const ENCRYPTION_PREFIX_V3='RS_ENC_v3_';
|
720
|
-
|
721
|
-
const COOKIE_DATA_ENCODING_ERROR=`Failed to encode the cookie data.`;
|
722
|
-
|
723
719
|
/**
|
724
720
|
* Encode.
|
725
721
|
*/const encode=(value,logger)=>{try{return encodeURIComponent(value);}catch(err){logger?.error(COOKIE_DATA_ENCODING_ERROR,err);return undefined;}};/**
|
@@ -739,6 +735,8 @@
|
|
739
735
|
*/// eslint-disable-next-line func-names
|
740
736
|
const cookie=function(name,value,options,logger){switch(arguments.length){case 4:case 3:case 2:return set(name,value,options,logger);case 1:if(name){return get(name);}return all();default:return all();}};
|
741
737
|
|
738
|
+
const userIdKey='rl_user_id';const userTraitsKey='rl_trait';const anonymousUserIdKey='rl_anonymous_id';const groupIdKey='rl_group_id';const groupTraitsKey='rl_group_trait';const pageInitialReferrerKey='rl_page_init_referrer';const pageInitialReferringDomainKey='rl_page_init_referring_domain';const sessionInfoKey='rl_session';const authTokenKey='rl_auth_token';const COOKIE_KEYS={userId:userIdKey,userTraits:userTraitsKey,anonymousId:anonymousUserIdKey,groupId:groupIdKey,groupTraits:groupTraitsKey,initialReferrer:pageInitialReferrerKey,initialReferringDomain:pageInitialReferringDomainKey,sessionInfo:sessionInfoKey,authToken:authTokenKey};const ENCRYPTION_PREFIX_V3='RS_ENC_v3_';
|
739
|
+
|
742
740
|
const encryptBrowser=value=>`${ENCRYPTION_PREFIX_V3}${toBase64(value)}`;const decryptBrowser=value=>{if(value?.startsWith(ENCRYPTION_PREFIX_V3)){return fromBase64(value.substring(ENCRYPTION_PREFIX_V3.length));}return value;};
|
743
741
|
|
744
742
|
const EVENT_PAYLOAD_SIZE_BYTES_LIMIT=32*1024;// 32 KB
|
@@ -942,170 +940,170 @@
|
|
942
940
|
* @returns Destinations array filtered based on the integration options
|
943
941
|
*/const filterDestinations=(intgOpts,destinations)=>{const allOptVal=intgOpts.All??true;return destinations.filter(dest=>{const destDisplayName=dest.displayName;let isDestEnabled;if(allOptVal){isDestEnabled=true;if(isDestIntgConfigFalsy(intgOpts[destDisplayName])){isDestEnabled=false;}}else {isDestEnabled=false;if(isDestIntgConfigTruthy(intgOpts[destDisplayName])){isDestEnabled=true;}}return isDestEnabled;});};
|
944
942
|
|
945
|
-
const
|
943
|
+
const ACTIVE_CAMPAIGN_DISPLAY_NAME='ActiveCampaign';const ADOBE_ANALYTICS_DISPLAY_NAME='Adobe Analytics';const ADROLL_DISPLAY_NAME='Adroll';const AM_DISPLAY_NAME='Amplitude';const APPCUES_DISPLAY_NAME='Appcues';const AXEPTIO_DISPLAY_NAME='Axeptio';const BINGADS_DISPLAY_NAME='Bing Ads';const BRAZE_DISPLAY_NAME='Braze';const BUGSNAG_DISPLAY_NAME='Bugsnag';const CHARTBEAT_DISPLAY_NAME='Chartbeat';const CLEVERTAP_DISPLAY_NAME='CleverTap';const COMMANDBAR_DISPLAY_NAME='CommandBar';const CONVERTFLOW_DISPLAY_NAME='Convertflow';const CRITEO_DISPLAY_NAME='Criteo';const CUSTOMERIO_DISPLAY_NAME='Customer IO';const DCM_FLOODLIGHT_DISPLAY_NAME='DCM Floodlight';const DRIP_DISPLAY_NAME='Drip';const ENGAGE_DISPLAY_NAME='Engage';const FACEBOOK_PIXEL_DISPLAY_NAME='Facebook Pixel';const FULLSTORY_DISPLAY_NAME='Fullstory';const GA_DISPLAY_NAME='Google Analytics';const GA360_DISPLAY_NAME='Google Analytics 360';const GA4_DISPLAY_NAME='Google Analytics 4 (GA4)';const GA4_V2_DISPLAY_NAME='Google Analytics 4 (GA4) V2';const GAINSIGHT_PX_DISPLAY_NAME='Gainsight PX';const GOOGLE_OPTIMIZE_DISPLAY_NAME='Google Optimize';const GOOGLEADS_DISPLAY_NAME='Google Ads';const GTM_DISPLAY_NAME='Google Tag Manager';const HEAP_DISPLAY_NAME='Heap.io';const HOTJAR_DISPLAY_NAME='Hotjar';const HS_DISPLAY_NAME='HubSpot';const INTERCOM_DISPLAY_NAME='Intercom';const ITERABLE_DISPLAY_NAME='Iterable';const JUNE_DISPLAY_NAME='JUNE';const KEEN_DISPLAY_NAME='Keen';const KISSMETRICS_DISPLAY_NAME='Kiss Metrics';const KLAVIYO_DISPLAY_NAME='Klaviyo';const LAUNCHDARKLY_DISPLAY_NAME='LaunchDarkly';const LEMNISK_DISPLAY_NAME='Lemnisk Marketing Automation';const LINKEDIN_INSIGHT_TAG_DISPLAY_NAME='Linkedin Insight Tag';const LIVECHAT_DISPLAY_NAME='livechat';const LOTAME_DISPLAY_NAME='Lotame';const LYTICS_DISPLAY_NAME='Lytics';const MATOMO_DISPLAY_NAME='Matomo';const MICROSOFT_CLARITY_DISPLAY_NAME='Microsoft Clarity';const MOENGAGE_DISPLAY_NAME='MoEngage';const MOUSEFLOW_DISPLAY_NAME='Mouseflow';const MP_DISPLAY_NAME='Mixpanel';const NINETAILED_DISPLAY_NAME='Ninetailed';const OLARK_DISPLAY_NAME='Olark';const OPTIMIZELY_DISPLAY_NAME='Optimizely Web';const PENDO_DISPLAY_NAME='Pendo';const PINTEREST_TAG_DISPLAY_NAME='Pinterest Tag';const PODSIGHTS_DISPLAY_NAME='Podsights';const POST_AFFILIATE_PRO_DISPLAY_NAME='Post Affiliate Pro';const POSTHOG_DISPLAY_NAME='PostHog';const PROFITWELL_DISPLAY_NAME='ProfitWell';const QUALAROO_DISPLAY_NAME='Qualaroo';const QUALTRICS_DISPLAY_NAME='Qualtrics';const QUANTUMMETRIC_DISPLAY_NAME='Quantum Metric';const QUORA_PIXEL_DISPLAY_NAME='Quora Pixel';const REDDIT_PIXEL_DISPLAY_NAME='Reddit Pixel';const REFINER_DISPLAY_NAME='Refiner';const ROCKERBOX_DISPLAY_NAME='Rockerbox';const ROLLBAR_DISPLAY_NAME='rollbar';const SATISMETER_DISPLAY_NAME='SatisMeter';const SENDINBLUE_DISPLAY_NAME='Sendinblue';const SENTRY_DISPLAY_NAME='Sentry';const SHYNET_DISPLAY_NAME='Shynet';const SNAP_PIXEL_DISPLAY_NAME='Snap Pixel';const SNAPENGAGE_DISPLAY_NAME='SnapEngage';const SPOTIFYPIXEL_DISPLAY_NAME='Spotify Pixel';const SPRIG_DISPLAY_NAME='Sprig';const TIKTOK_ADS_DISPLAY_NAME='TikTok Ads';const TVSQUARED_DISPLAY_NAME='TVSquared';const VERO_DISPLAY_NAME='Vero';const VWO_DISPLAY_NAME='VWO';const WOOPRA_DISPLAY_NAME='WOOPRA';const XPIXEL_DISPLAY_NAME='XPixel';const YANDEX_METRICA_DISPLAY_NAME='Yandex.Metrica';
|
946
944
|
|
947
|
-
const DIR_NAME$1f='
|
945
|
+
const DIR_NAME$1f='AdobeAnalytics';
|
948
946
|
|
949
|
-
const DIR_NAME$1e='
|
947
|
+
const DIR_NAME$1e='Amplitude';
|
950
948
|
|
951
|
-
const DIR_NAME$1d='
|
949
|
+
const DIR_NAME$1d='Appcues';
|
952
950
|
|
953
|
-
const DIR_NAME$1c='
|
951
|
+
const DIR_NAME$1c='BingAds';
|
954
952
|
|
955
|
-
const DIR_NAME$1b='
|
953
|
+
const DIR_NAME$1b='Braze';
|
956
954
|
|
957
|
-
const DIR_NAME$1a='
|
955
|
+
const DIR_NAME$1a='Bugsnag';
|
958
956
|
|
959
|
-
const DIR_NAME$19='
|
957
|
+
const DIR_NAME$19='Chartbeat';
|
960
958
|
|
961
|
-
const DIR_NAME$18='
|
959
|
+
const DIR_NAME$18='Clevertap';
|
962
960
|
|
963
|
-
const DIR_NAME$17='Criteo';
|
961
|
+
const DIR_NAME$17='Criteo';
|
964
962
|
|
965
|
-
const DIR_NAME$16='CustomerIO';
|
963
|
+
const DIR_NAME$16='CustomerIO';
|
966
964
|
|
967
|
-
const DIR_NAME$15='Drip';
|
965
|
+
const DIR_NAME$15='Drip';
|
968
966
|
|
969
|
-
const DIR_NAME$14='FacebookPixel';
|
967
|
+
const DIR_NAME$14='FacebookPixel';
|
970
968
|
|
971
|
-
const DIR_NAME$13='Fullstory';
|
969
|
+
const DIR_NAME$13='Fullstory';
|
972
970
|
|
973
|
-
const DIR_NAME$12='GA';
|
971
|
+
const DIR_NAME$12='GA';
|
974
972
|
|
975
|
-
const DIR_NAME$11='GA4';
|
973
|
+
const DIR_NAME$11='GA4';
|
976
974
|
|
977
|
-
const DIR_NAME$10='GA4_V2';
|
975
|
+
const DIR_NAME$10='GA4_V2';
|
978
976
|
|
979
|
-
const DIR_NAME$$='GoogleAds';
|
977
|
+
const DIR_NAME$$='GoogleAds';
|
980
978
|
|
981
|
-
const DIR_NAME$_='GoogleOptimize';
|
979
|
+
const DIR_NAME$_='GoogleOptimize';
|
982
980
|
|
983
|
-
const DIR_NAME$Z='GoogleTagManager';
|
981
|
+
const DIR_NAME$Z='GoogleTagManager';
|
984
982
|
|
985
|
-
const DIR_NAME$Y='Heap';
|
983
|
+
const DIR_NAME$Y='Heap';
|
986
984
|
|
987
|
-
const DIR_NAME$X='Hotjar';
|
985
|
+
const DIR_NAME$X='Hotjar';
|
988
986
|
|
989
|
-
const DIR_NAME$W='HubSpot';
|
987
|
+
const DIR_NAME$W='HubSpot';
|
990
988
|
|
991
|
-
const DIR_NAME$V='INTERCOM';
|
989
|
+
const DIR_NAME$V='INTERCOM';
|
992
990
|
|
993
|
-
const DIR_NAME$U='Keen';
|
991
|
+
const DIR_NAME$U='Keen';
|
994
992
|
|
995
|
-
const DIR_NAME$T='Kissmetrics';
|
993
|
+
const DIR_NAME$T='Kissmetrics';
|
996
994
|
|
997
|
-
const DIR_NAME$S='Klaviyo';
|
995
|
+
const DIR_NAME$S='Klaviyo';
|
998
996
|
|
999
|
-
const DIR_NAME$R='LaunchDarkly';
|
997
|
+
const DIR_NAME$R='LaunchDarkly';
|
1000
998
|
|
1001
|
-
const DIR_NAME$Q='LinkedInInsightTag';
|
999
|
+
const DIR_NAME$Q='LinkedInInsightTag';
|
1002
1000
|
|
1003
|
-
const DIR_NAME$P='Lotame';
|
1001
|
+
const DIR_NAME$P='Lotame';
|
1004
1002
|
|
1005
|
-
const DIR_NAME$O='Lytics';
|
1003
|
+
const DIR_NAME$O='Lytics';
|
1006
1004
|
|
1007
|
-
const DIR_NAME$N='Mixpanel';
|
1005
|
+
const DIR_NAME$N='Mixpanel';
|
1008
1006
|
|
1009
|
-
const DIR_NAME$M='MoEngage';
|
1007
|
+
const DIR_NAME$M='MoEngage';
|
1010
1008
|
|
1011
|
-
const DIR_NAME$L='Optimizely';
|
1009
|
+
const DIR_NAME$L='Optimizely';
|
1012
1010
|
|
1013
|
-
const DIR_NAME$K='Pendo';
|
1011
|
+
const DIR_NAME$K='Pendo';
|
1014
1012
|
|
1015
|
-
const DIR_NAME$J='PinterestTag';
|
1013
|
+
const DIR_NAME$J='PinterestTag';
|
1016
1014
|
|
1017
|
-
const DIR_NAME$I='PostAffiliatePro';
|
1015
|
+
const DIR_NAME$I='PostAffiliatePro';
|
1018
1016
|
|
1019
|
-
const DIR_NAME$H='Posthog';
|
1017
|
+
const DIR_NAME$H='Posthog';
|
1020
1018
|
|
1021
|
-
const DIR_NAME$G='ProfitWell';
|
1019
|
+
const DIR_NAME$G='ProfitWell';
|
1022
1020
|
|
1023
|
-
const DIR_NAME$F='Qualtrics';
|
1021
|
+
const DIR_NAME$F='Qualtrics';
|
1024
1022
|
|
1025
|
-
const DIR_NAME$E='QuantumMetric';
|
1023
|
+
const DIR_NAME$E='QuantumMetric';
|
1026
1024
|
|
1027
|
-
const DIR_NAME$D='RedditPixel';
|
1025
|
+
const DIR_NAME$D='RedditPixel';
|
1028
1026
|
|
1029
|
-
const DIR_NAME$C='Sentry';
|
1027
|
+
const DIR_NAME$C='Sentry';
|
1030
1028
|
|
1031
|
-
const DIR_NAME$B='SnapPixel';
|
1029
|
+
const DIR_NAME$B='SnapPixel';
|
1032
1030
|
|
1033
|
-
const DIR_NAME$A='TVSquared';
|
1031
|
+
const DIR_NAME$A='TVSquared';
|
1034
1032
|
|
1035
|
-
const DIR_NAME$z='VWO';
|
1033
|
+
const DIR_NAME$z='VWO';
|
1036
1034
|
|
1037
|
-
const DIR_NAME$y='GA360';
|
1035
|
+
const DIR_NAME$y='GA360';
|
1038
1036
|
|
1039
|
-
const DIR_NAME$x='Adroll';
|
1037
|
+
const DIR_NAME$x='Adroll';
|
1040
1038
|
|
1041
|
-
const DIR_NAME$w='DCMFloodlight';
|
1039
|
+
const DIR_NAME$w='DCMFloodlight';
|
1042
1040
|
|
1043
|
-
const DIR_NAME$v='Matomo';
|
1041
|
+
const DIR_NAME$v='Matomo';
|
1044
1042
|
|
1045
|
-
const DIR_NAME$u='Vero';
|
1043
|
+
const DIR_NAME$u='Vero';
|
1046
1044
|
|
1047
|
-
const DIR_NAME$t='Mouseflow';
|
1045
|
+
const DIR_NAME$t='Mouseflow';
|
1048
1046
|
|
1049
|
-
const DIR_NAME$s='Rockerbox';
|
1047
|
+
const DIR_NAME$s='Rockerbox';
|
1050
1048
|
|
1051
|
-
const DIR_NAME$r='ConvertFlow';
|
1049
|
+
const DIR_NAME$r='ConvertFlow';
|
1052
1050
|
|
1053
|
-
const DIR_NAME$q='SnapEngage';
|
1051
|
+
const DIR_NAME$q='SnapEngage';
|
1054
1052
|
|
1055
|
-
const DIR_NAME$p='LiveChat';
|
1053
|
+
const DIR_NAME$p='LiveChat';
|
1056
1054
|
|
1057
|
-
const DIR_NAME$o='Shynet';
|
1055
|
+
const DIR_NAME$o='Shynet';
|
1058
1056
|
|
1059
|
-
const DIR_NAME$n='Woopra';
|
1057
|
+
const DIR_NAME$n='Woopra';
|
1060
1058
|
|
1061
|
-
const DIR_NAME$m='RollBar';
|
1059
|
+
const DIR_NAME$m='RollBar';
|
1062
1060
|
|
1063
|
-
const DIR_NAME$l='QuoraPixel';
|
1061
|
+
const DIR_NAME$l='QuoraPixel';
|
1064
1062
|
|
1065
|
-
const DIR_NAME$k='June';
|
1063
|
+
const DIR_NAME$k='June';
|
1066
1064
|
|
1067
|
-
const DIR_NAME$j='Engage';
|
1065
|
+
const DIR_NAME$j='Engage';
|
1068
1066
|
|
1069
|
-
const DIR_NAME$i='Iterable';
|
1067
|
+
const DIR_NAME$i='Iterable';
|
1070
1068
|
|
1071
|
-
const DIR_NAME$h='YandexMetrica';
|
1069
|
+
const DIR_NAME$h='YandexMetrica';
|
1072
1070
|
|
1073
|
-
const DIR_NAME$g='Refiner';
|
1071
|
+
const DIR_NAME$g='Refiner';
|
1074
1072
|
|
1075
|
-
const DIR_NAME$f='Qualaroo';
|
1073
|
+
const DIR_NAME$f='Qualaroo';
|
1076
1074
|
|
1077
|
-
const DIR_NAME$e='Podsights';
|
1075
|
+
const DIR_NAME$e='Podsights';
|
1078
1076
|
|
1079
|
-
const DIR_NAME$d='Axeptio';
|
1077
|
+
const DIR_NAME$d='Axeptio';
|
1080
1078
|
|
1081
|
-
const DIR_NAME$c='Satismeter';
|
1079
|
+
const DIR_NAME$c='Satismeter';
|
1082
1080
|
|
1083
|
-
const DIR_NAME$b='MicrosoftClarity';
|
1081
|
+
const DIR_NAME$b='MicrosoftClarity';
|
1084
1082
|
|
1085
|
-
const DIR_NAME$a='Sendinblue';
|
1083
|
+
const DIR_NAME$a='Sendinblue';
|
1086
1084
|
|
1087
|
-
const DIR_NAME$9='Olark';
|
1085
|
+
const DIR_NAME$9='Olark';
|
1088
1086
|
|
1089
|
-
const DIR_NAME$8='Lemnisk';
|
1087
|
+
const DIR_NAME$8='Lemnisk';
|
1090
1088
|
|
1091
|
-
const DIR_NAME$7='TiktokAds';
|
1089
|
+
const DIR_NAME$7='TiktokAds';
|
1092
1090
|
|
1093
|
-
const DIR_NAME$6='ActiveCampaign';
|
1091
|
+
const DIR_NAME$6='ActiveCampaign';
|
1094
1092
|
|
1095
|
-
const DIR_NAME$5='Sprig';
|
1093
|
+
const DIR_NAME$5='Sprig';
|
1096
1094
|
|
1097
|
-
const DIR_NAME$4='SpotifyPixel';
|
1095
|
+
const DIR_NAME$4='SpotifyPixel';
|
1098
1096
|
|
1099
|
-
const DIR_NAME$3='CommandBar';
|
1097
|
+
const DIR_NAME$3='CommandBar';
|
1100
1098
|
|
1101
|
-
const DIR_NAME$2='Ninetailed';
|
1099
|
+
const DIR_NAME$2='Ninetailed';
|
1102
1100
|
|
1103
|
-
const DIR_NAME$1='Gainsight_PX';
|
1101
|
+
const DIR_NAME$1='Gainsight_PX';
|
1104
1102
|
|
1105
|
-
const DIR_NAME='XPixel';
|
1103
|
+
const DIR_NAME='XPixel';
|
1106
1104
|
|
1107
1105
|
// map of the destination display names to the destination directory names
|
1108
|
-
const destDisplayNamesToFileNamesMap={[
|
1106
|
+
const destDisplayNamesToFileNamesMap={[HS_DISPLAY_NAME]:DIR_NAME$W,[GA_DISPLAY_NAME]:DIR_NAME$12,[HOTJAR_DISPLAY_NAME]:DIR_NAME$X,[GOOGLEADS_DISPLAY_NAME]:DIR_NAME$$,[VWO_DISPLAY_NAME]:DIR_NAME$z,[GTM_DISPLAY_NAME]:DIR_NAME$Z,[BRAZE_DISPLAY_NAME]:DIR_NAME$1b,[INTERCOM_DISPLAY_NAME]:DIR_NAME$V,[KEEN_DISPLAY_NAME]:DIR_NAME$U,[KISSMETRICS_DISPLAY_NAME]:DIR_NAME$T,[CUSTOMERIO_DISPLAY_NAME]:DIR_NAME$16,[CHARTBEAT_DISPLAY_NAME]:DIR_NAME$19,[FACEBOOK_PIXEL_DISPLAY_NAME]:DIR_NAME$14,[LOTAME_DISPLAY_NAME]:DIR_NAME$P,[OPTIMIZELY_DISPLAY_NAME]:DIR_NAME$L,[BUGSNAG_DISPLAY_NAME]:DIR_NAME$1a,[FULLSTORY_DISPLAY_NAME]:DIR_NAME$13,[TVSQUARED_DISPLAY_NAME]:DIR_NAME$A,[GA4_DISPLAY_NAME]:DIR_NAME$11,[GA4_V2_DISPLAY_NAME]:DIR_NAME$10,[MOENGAGE_DISPLAY_NAME]:DIR_NAME$M,[AM_DISPLAY_NAME]:DIR_NAME$1e,[PENDO_DISPLAY_NAME]:DIR_NAME$K,[LYTICS_DISPLAY_NAME]:DIR_NAME$O,[APPCUES_DISPLAY_NAME]:DIR_NAME$1d,[POSTHOG_DISPLAY_NAME]:DIR_NAME$H,[KLAVIYO_DISPLAY_NAME]:DIR_NAME$S,[CLEVERTAP_DISPLAY_NAME]:DIR_NAME$18,[BINGADS_DISPLAY_NAME]:DIR_NAME$1c,[PINTEREST_TAG_DISPLAY_NAME]:DIR_NAME$J,[ADOBE_ANALYTICS_DISPLAY_NAME]:DIR_NAME$1f,[LINKEDIN_INSIGHT_TAG_DISPLAY_NAME]:DIR_NAME$Q,[REDDIT_PIXEL_DISPLAY_NAME]:DIR_NAME$D,[DRIP_DISPLAY_NAME]:DIR_NAME$15,[HEAP_DISPLAY_NAME]:DIR_NAME$Y,[CRITEO_DISPLAY_NAME]:DIR_NAME$17,[MP_DISPLAY_NAME]:DIR_NAME$N,[QUALTRICS_DISPLAY_NAME]:DIR_NAME$F,[PROFITWELL_DISPLAY_NAME]:DIR_NAME$G,[SENTRY_DISPLAY_NAME]:DIR_NAME$C,[QUANTUMMETRIC_DISPLAY_NAME]:DIR_NAME$E,[SNAP_PIXEL_DISPLAY_NAME]:DIR_NAME$B,[POST_AFFILIATE_PRO_DISPLAY_NAME]:DIR_NAME$I,[GOOGLE_OPTIMIZE_DISPLAY_NAME]:DIR_NAME$_,[LAUNCHDARKLY_DISPLAY_NAME]:DIR_NAME$R,[GA360_DISPLAY_NAME]:DIR_NAME$y,[ADROLL_DISPLAY_NAME]:DIR_NAME$x,[DCM_FLOODLIGHT_DISPLAY_NAME]:DIR_NAME$w,[MATOMO_DISPLAY_NAME]:DIR_NAME$v,[VERO_DISPLAY_NAME]:DIR_NAME$u,[MOUSEFLOW_DISPLAY_NAME]:DIR_NAME$t,[ROCKERBOX_DISPLAY_NAME]:DIR_NAME$s,[CONVERTFLOW_DISPLAY_NAME]:DIR_NAME$r,[SNAPENGAGE_DISPLAY_NAME]:DIR_NAME$q,[LIVECHAT_DISPLAY_NAME]:DIR_NAME$p,[SHYNET_DISPLAY_NAME]:DIR_NAME$o,[WOOPRA_DISPLAY_NAME]:DIR_NAME$n,[ROLLBAR_DISPLAY_NAME]:DIR_NAME$m,[QUORA_PIXEL_DISPLAY_NAME]:DIR_NAME$l,[JUNE_DISPLAY_NAME]:DIR_NAME$k,[ENGAGE_DISPLAY_NAME]:DIR_NAME$j,[ITERABLE_DISPLAY_NAME]:DIR_NAME$i,[YANDEX_METRICA_DISPLAY_NAME]:DIR_NAME$h,[REFINER_DISPLAY_NAME]:DIR_NAME$g,[QUALAROO_DISPLAY_NAME]:DIR_NAME$f,[PODSIGHTS_DISPLAY_NAME]:DIR_NAME$e,[AXEPTIO_DISPLAY_NAME]:DIR_NAME$d,[SATISMETER_DISPLAY_NAME]:DIR_NAME$c,[MICROSOFT_CLARITY_DISPLAY_NAME]:DIR_NAME$b,[SENDINBLUE_DISPLAY_NAME]:DIR_NAME$a,[OLARK_DISPLAY_NAME]:DIR_NAME$9,[LEMNISK_DISPLAY_NAME]:DIR_NAME$8,[TIKTOK_ADS_DISPLAY_NAME]:DIR_NAME$7,[ACTIVE_CAMPAIGN_DISPLAY_NAME]:DIR_NAME$6,[SPRIG_DISPLAY_NAME]:DIR_NAME$5,[SPOTIFYPIXEL_DISPLAY_NAME]:DIR_NAME$4,[COMMANDBAR_DISPLAY_NAME]:DIR_NAME$3,[NINETAILED_DISPLAY_NAME]:DIR_NAME$2,[GAINSIGHT_PX_DISPLAY_NAME]:DIR_NAME$1,[XPIXEL_DISPLAY_NAME]:DIR_NAME};
|
1109
1107
|
|
1110
1108
|
/**
|
1111
1109
|
* Determines if the destination SDK code is evaluated
|
@@ -1113,7 +1111,7 @@
|
|
1113
1111
|
* @param sdkTypeName The name of the destination SDK type
|
1114
1112
|
* @param logger Logger instance
|
1115
1113
|
* @returns true if the destination SDK code is evaluated, false otherwise
|
1116
|
-
*/const isDestinationSDKMounted=(destSDKIdentifier,sdkTypeName,logger)=>Boolean(globalThis[destSDKIdentifier]
|
1114
|
+
*/const isDestinationSDKMounted=(destSDKIdentifier,sdkTypeName,logger)=>Boolean(globalThis[destSDKIdentifier]?.[sdkTypeName]?.prototype&&typeof globalThis[destSDKIdentifier][sdkTypeName].prototype.constructor!=='undefined');const wait=time=>new Promise(resolve=>{globalThis.setTimeout(resolve,time);});const createDestinationInstance=(destSDKIdentifier,sdkTypeName,dest,state)=>{const rAnalytics=globalThis.rudderanalytics;const analytics=rAnalytics.getAnalyticsInstance(state.lifecycle.writeKey.value);const analyticsInstance={loadIntegration:state.nativeDestinations.loadIntegration.value,logLevel:state.lifecycle.logLevel.value,loadOnlyIntegrations:state.consents.postConsent.value?.integrations??state.nativeDestinations.loadOnlyIntegrations.value,page:(category,name,properties,options,callback)=>analytics.page(pageArgumentsToCallOptions(getSanitizedValue(category),getSanitizedValue(name),getSanitizedValue(properties),getSanitizedValue(options),getSanitizedValue(callback))),track:(event,properties,options,callback)=>analytics.track(trackArgumentsToCallOptions(getSanitizedValue(event),getSanitizedValue(properties),getSanitizedValue(options),getSanitizedValue(callback))),identify:(userId,traits,options,callback)=>analytics.identify(identifyArgumentsToCallOptions(getSanitizedValue(userId),getSanitizedValue(traits),getSanitizedValue(options),getSanitizedValue(callback))),alias:(to,from,options,callback)=>analytics.alias(aliasArgumentsToCallOptions(getSanitizedValue(to),getSanitizedValue(from),getSanitizedValue(options),getSanitizedValue(callback))),group:(groupId,traits,options,callback)=>analytics.group(groupArgumentsToCallOptions(getSanitizedValue(groupId),getSanitizedValue(traits),getSanitizedValue(options),getSanitizedValue(callback))),getAnonymousId:options=>analytics.getAnonymousId(getSanitizedValue(options)),getUserId:()=>analytics.getUserId(),getUserTraits:()=>analytics.getUserTraits(),getGroupId:()=>analytics.getGroupId(),getGroupTraits:()=>analytics.getGroupTraits(),getSessionId:()=>analytics.getSessionId()};const deviceModeDestination=new globalThis[destSDKIdentifier][sdkTypeName](clone(dest.config),analyticsInstance,{shouldApplyDeviceModeTransformation:dest.shouldApplyDeviceModeTransformation,propagateEventsUntransformedOnError:dest.propagateEventsUntransformedOnError,destinationId:dest.id});return deviceModeDestination;};const isDestinationReady=(dest,time=0)=>new Promise((resolve,reject)=>{const instance=dest.instance;if(instance.isLoaded()&&(!instance.isReady||instance.isReady())){resolve(true);}else if(time>=READY_CHECK_TIMEOUT_MS){reject(new Error(DESTINATION_READY_TIMEOUT_ERROR(READY_CHECK_TIMEOUT_MS,dest.userFriendlyId)));}else {const curTime=Date.now();wait(READY_CHECK_INTERVAL_MS).then(()=>{const elapsedTime=Date.now()-curTime;isDestinationReady(dest,time+elapsedTime).then(resolve).catch(err=>reject(err));}).catch(err=>reject(err));}});/**
|
1117
1115
|
* Extracts the integration config, if any, from the given destination
|
1118
1116
|
* and merges it with the current integrations config
|
1119
1117
|
* @param dest Destination object
|
@@ -1157,7 +1155,8 @@
|
|
1157
1155
|
|
1158
1156
|
const getConfigForPayloadCreation=(err,errorType)=>{switch(errorType){case ErrorType.UNHANDLEDEXCEPTION:{const{error}=err;return {component:'unhandledException handler',normalizedError:error||err};}case ErrorType.UNHANDLEDREJECTION:{const error=err;return {component:'unhandledrejection handler',normalizedError:error.reason};}case ErrorType.HANDLEDEXCEPTION:default:return {component:'notify()',normalizedError:err};}};const createNewBreadcrumb=(message,metaData)=>({type:'manual',name:message,timestamp:new Date(),metaData:metaData??{}});const getReleaseStage=()=>{const host=globalThis.location.hostname;return host&&DEV_HOSTS.includes(host)?'development':'production';};const getAppStateForMetadata=state=>{const stateStr=stringifyWithoutCircular(state,false,APP_STATE_EXCLUDE_KEYS);return stateStr!==null?JSON.parse(stateStr):{};};const getURLWithoutQueryString=()=>{const url=globalThis.location.href.split('?');return url[0];};const getErrorContext=event=>{const{message}=event;let context=message;// Hack for easily grouping the script load errors
|
1159
1157
|
// on the dashboard
|
1160
|
-
if(message.includes('Error in loading a third-party script')){context='Script load failures';}return context;};const getBugsnagErrorEvent=(payload,errorState,state)=>({notifier:{name:NOTIFIER_NAME,version:state.context.app.value.version,url:SDK_GITHUB_URL},events:[{payloadVersion:'5',exceptions:clone(payload.errors),severity:errorState.severity,unhandled:errorState.unhandled,severityReason:errorState.severityReason,app:{version:state.context.app.value.version,releaseStage:getReleaseStage()},device:{locale:state.context.locale.value??undefined,userAgent:state.context.userAgent.value??undefined,time:new Date()},request:{url:getURLWithoutQueryString(),clientIp:'[NOT COLLECTED]'},breadcrumbs:clone(state.reporting.breadcrumbs.value),context:getErrorContext(payload.errors[0]),metaData:{sdk:{name:'JS',installType:state.context.app.value.installType},state:getAppStateForMetadata(state)??{},source:{snippetVersion:globalThis.RudderSnippetVersion}},user:{
|
1158
|
+
if(message.includes('Error in loading a third-party script')){context='Script load failures';}return context;};const getBugsnagErrorEvent=(payload,errorState,state)=>({notifier:{name:NOTIFIER_NAME,version:state.context.app.value.version,url:SDK_GITHUB_URL},events:[{payloadVersion:'5',exceptions:clone(payload.errors),severity:errorState.severity,unhandled:errorState.unhandled,severityReason:errorState.severityReason,app:{version:state.context.app.value.version,releaseStage:getReleaseStage()},device:{locale:state.context.locale.value??undefined,userAgent:state.context.userAgent.value??undefined,time:new Date()},request:{url:getURLWithoutQueryString(),clientIp:'[NOT COLLECTED]'},breadcrumbs:clone(state.reporting.breadcrumbs.value),context:getErrorContext(payload.errors[0]),metaData:{sdk:{name:'JS',installType:state.context.app.value.installType},state:getAppStateForMetadata(state)??{},source:{snippetVersion:globalThis.RudderSnippetVersion}},user:{// Combination of source, session and visit ids
|
1159
|
+
id:`${state.source.value?.id??state.lifecycle.writeKey.value}..${state.session.sessionInfo.value?.id??'NA'}..${state.autoTrack?.pageLifecycle?.visitId?.value??'NA'}`}}]});/**
|
1161
1160
|
* A function to determine whether the error should be promoted to notify or not
|
1162
1161
|
* @param {Error} error
|
1163
1162
|
* @returns
|
@@ -2780,7 +2779,7 @@
|
|
2780
2779
|
/**
|
2781
2780
|
* Determines if the SDK is running inside a chrome extension
|
2782
2781
|
* @returns boolean
|
2783
|
-
*/const isSDKRunningInChromeExtension=()=>!!
|
2782
|
+
*/const isSDKRunningInChromeExtension=()=>!!window.chrome?.runtime?.id;
|
2784
2783
|
|
2785
2784
|
const DEFAULT_PRE_CONSENT_STORAGE_STRATEGY='none';const DEFAULT_PRE_CONSENT_EVENTS_DELIVERY_TYPE='immediate';
|
2786
2785
|
|
@@ -2891,7 +2890,9 @@
|
|
2891
2890
|
* To get the timezone of the user
|
2892
2891
|
*
|
2893
2892
|
* @returns string
|
2894
|
-
*/const getTimezone=()=>{
|
2893
|
+
*/const getTimezone=()=>{// Not susceptible to super-linear backtracking
|
2894
|
+
// eslint-disable-next-line sonarjs/slow-regex
|
2895
|
+
const timezone=/([A-Z]+[+-]\d+)/.exec(new Date().toString());return timezone?.[1]?timezone[1]:'NA';};
|
2895
2896
|
|
2896
2897
|
/**
|
2897
2898
|
* Get the referrer URL
|
@@ -406,7 +406,7 @@ const getFormattedTimestamp=date=>date.toISOString();/**
|
|
406
406
|
* @returns ISO formatted timestamp string
|
407
407
|
*/const getCurrentTimeFormatted=()=>getFormattedTimestamp(new Date());
|
408
408
|
|
409
|
-
const LOG_CONTEXT_SEPARATOR=':: ';const SCRIPT_ALREADY_EXISTS_ERROR=id=>`A script with the id "${id}" is already loaded. Skipping the loading of this script to prevent conflicts.`;const SCRIPT_LOAD_ERROR=(id,url)=>`Failed to load the script with the id "${id}" from URL "${url}".`;const SCRIPT_LOAD_TIMEOUT_ERROR=(id,url,timeout)=>`A timeout of ${timeout} ms occurred while trying to load the script with id "${id}" from URL "${url}".`;const CIRCULAR_REFERENCE_WARNING=(context,key)=>`${context}${LOG_CONTEXT_SEPARATOR}A circular reference has been detected in the object and the property "${key}" has been dropped from the output.`;const JSON_STRINGIFY_WARNING=`Failed to convert the value to a JSON string.`;
|
409
|
+
const LOG_CONTEXT_SEPARATOR=':: ';const SCRIPT_ALREADY_EXISTS_ERROR=id=>`A script with the id "${id}" is already loaded. Skipping the loading of this script to prevent conflicts.`;const SCRIPT_LOAD_ERROR=(id,url)=>`Failed to load the script with the id "${id}" from URL "${url}".`;const SCRIPT_LOAD_TIMEOUT_ERROR=(id,url,timeout)=>`A timeout of ${timeout} ms occurred while trying to load the script with id "${id}" from URL "${url}".`;const CIRCULAR_REFERENCE_WARNING=(context,key)=>`${context}${LOG_CONTEXT_SEPARATOR}A circular reference has been detected in the object and the property "${key}" has been dropped from the output.`;const JSON_STRINGIFY_WARNING=`Failed to convert the value to a JSON string.`;const COOKIE_DATA_ENCODING_ERROR=`Failed to encode the cookie data.`;
|
410
410
|
|
411
411
|
const JSON_STRINGIFY='JSONStringify';const BIG_INT_PLACEHOLDER='[BigInt]';const CIRCULAR_REFERENCE_PLACEHOLDER='[Circular Reference]';const getCircularReplacer=(excludeNull,excludeKeys,logger)=>{const ancestors=[];// Here we do not want to use arrow function to use "this" in function context
|
412
412
|
// eslint-disable-next-line func-names
|
@@ -450,7 +450,7 @@ const MANUAL_ERROR_IDENTIFIER='[MANUAL ERROR]';/**
|
|
450
450
|
* @returns Instance of Error with message prepended with issue
|
451
451
|
*/const getMutatedError=(err,issue)=>{let finalError=err;if(!isTypeOfError(err)){finalError=new Error(`${issue}: ${stringifyWithoutCircular(err)}`);}else {finalError.message=`${issue}: ${err.message}`;}return finalError;};const dispatchErrorEvent=error=>{if(isTypeOfError(error)){error.stack=`${error.stack??''}\n${MANUAL_ERROR_IDENTIFIER}`;}globalThis.dispatchEvent(new ErrorEvent('error',{error}));};
|
452
452
|
|
453
|
-
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.11.
|
453
|
+
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.11.17';const APP_NAMESPACE='com.rudderlabs.javascript';const MODULE_TYPE='npm';const ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';const ADBLOCK_PAGE_NAME='ad-block page request';const ADBLOCK_PAGE_PATH='/ad-blocked';const GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';const CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
454
454
|
|
455
455
|
const QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';const QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';const QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';const QUERY_PARAM_USER_ID_KEY='ajs_uid';const QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
456
456
|
|
@@ -867,8 +867,6 @@ const STORAGE_TEST_COOKIE='test_rudder_cookie';const STORAGE_TEST_LOCAL_STORAGE=
|
|
867
867
|
|
868
868
|
const storageClientDataStoreNameMap={[COOKIE_STORAGE]:CLIENT_DATA_STORE_COOKIE,[LOCAL_STORAGE]:CLIENT_DATA_STORE_LS,[MEMORY_STORAGE]:CLIENT_DATA_STORE_MEMORY,[SESSION_STORAGE]:CLIENT_DATA_STORE_SESSION};
|
869
869
|
|
870
|
-
const COOKIE_DATA_ENCODING_ERROR=`Failed to encode the cookie data.`;
|
871
|
-
|
872
870
|
/**
|
873
871
|
* Encode.
|
874
872
|
*/const encode=(value,logger)=>{try{return encodeURIComponent(value);}catch(err){logger?.error(COOKIE_DATA_ENCODING_ERROR,err);return undefined;}};/**
|
@@ -1111,7 +1109,7 @@ new URL(url);}return URL_PATTERN.test(url);}catch(e){return false;}};
|
|
1111
1109
|
/**
|
1112
1110
|
* Determines if the SDK is running inside a chrome extension
|
1113
1111
|
* @returns boolean
|
1114
|
-
*/const isSDKRunningInChromeExtension=()=>!!
|
1112
|
+
*/const isSDKRunningInChromeExtension=()=>!!window.chrome?.runtime?.id;
|
1115
1113
|
|
1116
1114
|
const DEFAULT_PRE_CONSENT_STORAGE_STRATEGY='none';const DEFAULT_PRE_CONSENT_EVENTS_DELIVERY_TYPE='immediate';
|
1117
1115
|
|
@@ -1222,7 +1220,9 @@ this.httpClient.getAsyncData({url:state.lifecycle.sourceConfigUrl.value,options:
|
|
1222
1220
|
* To get the timezone of the user
|
1223
1221
|
*
|
1224
1222
|
* @returns string
|
1225
|
-
*/const getTimezone=()=>{
|
1223
|
+
*/const getTimezone=()=>{// Not susceptible to super-linear backtracking
|
1224
|
+
// eslint-disable-next-line sonarjs/slow-regex
|
1225
|
+
const timezone=/([A-Z]+[+-]\d+)/.exec(new Date().toString());return timezone?.[1]?timezone[1]:'NA';};
|
1226
1226
|
|
1227
1227
|
/**
|
1228
1228
|
* Get the referrer URL
|
@@ -412,7 +412,7 @@
|
|
412
412
|
* @returns ISO formatted timestamp string
|
413
413
|
*/const getCurrentTimeFormatted=()=>getFormattedTimestamp(new Date());
|
414
414
|
|
415
|
-
const LOG_CONTEXT_SEPARATOR=':: ';const SCRIPT_ALREADY_EXISTS_ERROR=id=>`A script with the id "${id}" is already loaded. Skipping the loading of this script to prevent conflicts.`;const SCRIPT_LOAD_ERROR=(id,url)=>`Failed to load the script with the id "${id}" from URL "${url}".`;const SCRIPT_LOAD_TIMEOUT_ERROR=(id,url,timeout)=>`A timeout of ${timeout} ms occurred while trying to load the script with id "${id}" from URL "${url}".`;const CIRCULAR_REFERENCE_WARNING=(context,key)=>`${context}${LOG_CONTEXT_SEPARATOR}A circular reference has been detected in the object and the property "${key}" has been dropped from the output.`;const JSON_STRINGIFY_WARNING=`Failed to convert the value to a JSON string.`;
|
415
|
+
const LOG_CONTEXT_SEPARATOR=':: ';const SCRIPT_ALREADY_EXISTS_ERROR=id=>`A script with the id "${id}" is already loaded. Skipping the loading of this script to prevent conflicts.`;const SCRIPT_LOAD_ERROR=(id,url)=>`Failed to load the script with the id "${id}" from URL "${url}".`;const SCRIPT_LOAD_TIMEOUT_ERROR=(id,url,timeout)=>`A timeout of ${timeout} ms occurred while trying to load the script with id "${id}" from URL "${url}".`;const CIRCULAR_REFERENCE_WARNING=(context,key)=>`${context}${LOG_CONTEXT_SEPARATOR}A circular reference has been detected in the object and the property "${key}" has been dropped from the output.`;const JSON_STRINGIFY_WARNING=`Failed to convert the value to a JSON string.`;const COOKIE_DATA_ENCODING_ERROR=`Failed to encode the cookie data.`;
|
416
416
|
|
417
417
|
const JSON_STRINGIFY='JSONStringify';const BIG_INT_PLACEHOLDER='[BigInt]';const CIRCULAR_REFERENCE_PLACEHOLDER='[Circular Reference]';const getCircularReplacer=(excludeNull,excludeKeys,logger)=>{const ancestors=[];// Here we do not want to use arrow function to use "this" in function context
|
418
418
|
// eslint-disable-next-line func-names
|
@@ -456,7 +456,7 @@
|
|
456
456
|
* @returns Instance of Error with message prepended with issue
|
457
457
|
*/const getMutatedError=(err,issue)=>{let finalError=err;if(!isTypeOfError(err)){finalError=new Error(`${issue}: ${stringifyWithoutCircular(err)}`);}else {finalError.message=`${issue}: ${err.message}`;}return finalError;};const dispatchErrorEvent=error=>{if(isTypeOfError(error)){error.stack=`${error.stack??''}\n${MANUAL_ERROR_IDENTIFIER}`;}globalThis.dispatchEvent(new ErrorEvent('error',{error}));};
|
458
458
|
|
459
|
-
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.11.
|
459
|
+
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.11.17';const APP_NAMESPACE='com.rudderlabs.javascript';const MODULE_TYPE='npm';const ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';const ADBLOCK_PAGE_NAME='ad-block page request';const ADBLOCK_PAGE_PATH='/ad-blocked';const GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';const CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
460
460
|
|
461
461
|
const QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';const QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';const QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';const QUERY_PARAM_USER_ID_KEY='ajs_uid';const QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
462
462
|
|
@@ -873,8 +873,6 @@
|
|
873
873
|
|
874
874
|
const storageClientDataStoreNameMap={[COOKIE_STORAGE]:CLIENT_DATA_STORE_COOKIE,[LOCAL_STORAGE]:CLIENT_DATA_STORE_LS,[MEMORY_STORAGE]:CLIENT_DATA_STORE_MEMORY,[SESSION_STORAGE]:CLIENT_DATA_STORE_SESSION};
|
875
875
|
|
876
|
-
const COOKIE_DATA_ENCODING_ERROR=`Failed to encode the cookie data.`;
|
877
|
-
|
878
876
|
/**
|
879
877
|
* Encode.
|
880
878
|
*/const encode=(value,logger)=>{try{return encodeURIComponent(value);}catch(err){logger?.error(COOKIE_DATA_ENCODING_ERROR,err);return undefined;}};/**
|
@@ -1117,7 +1115,7 @@
|
|
1117
1115
|
/**
|
1118
1116
|
* Determines if the SDK is running inside a chrome extension
|
1119
1117
|
* @returns boolean
|
1120
|
-
*/const isSDKRunningInChromeExtension=()=>!!
|
1118
|
+
*/const isSDKRunningInChromeExtension=()=>!!window.chrome?.runtime?.id;
|
1121
1119
|
|
1122
1120
|
const DEFAULT_PRE_CONSENT_STORAGE_STRATEGY='none';const DEFAULT_PRE_CONSENT_EVENTS_DELIVERY_TYPE='immediate';
|
1123
1121
|
|
@@ -1228,7 +1226,9 @@
|
|
1228
1226
|
* To get the timezone of the user
|
1229
1227
|
*
|
1230
1228
|
* @returns string
|
1231
|
-
*/const getTimezone=()=>{
|
1229
|
+
*/const getTimezone=()=>{// Not susceptible to super-linear backtracking
|
1230
|
+
// eslint-disable-next-line sonarjs/slow-regex
|
1231
|
+
const timezone=/([A-Z]+[+-]\d+)/.exec(new Date().toString());return timezone?.[1]?timezone[1]:'NA';};
|
1232
1232
|
|
1233
1233
|
/**
|
1234
1234
|
* Get the referrer URL
|