rudder-sdk-js 1.3.4 → 1.4.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/index.js +88 -309
- package/package.json +1 -1
package/index.js
CHANGED
@@ -5148,200 +5148,6 @@
|
|
5148
5148
|
return isobject(val) || Array.isArray(val) || typeof val === 'function';
|
5149
5149
|
}
|
5150
5150
|
|
5151
|
-
/*!
|
5152
|
-
* is-primitive <https://github.com/jonschlinkert/is-primitive>
|
5153
|
-
*
|
5154
|
-
* Copyright (c) 2014-present, Jon Schlinkert.
|
5155
|
-
* Released under the MIT License.
|
5156
|
-
*/
|
5157
|
-
|
5158
|
-
var isPrimitive = function isPrimitive(val) {
|
5159
|
-
if (_typeof(val) === 'object') {
|
5160
|
-
return val === null;
|
5161
|
-
}
|
5162
|
-
|
5163
|
-
return typeof val !== 'function';
|
5164
|
-
};
|
5165
|
-
|
5166
|
-
function isObjectObject(o) {
|
5167
|
-
return isobject(o) === true && Object.prototype.toString.call(o) === '[object Object]';
|
5168
|
-
}
|
5169
|
-
|
5170
|
-
var isPlainObject = function isPlainObject(o) {
|
5171
|
-
var ctor, prot;
|
5172
|
-
if (isObjectObject(o) === false) return false; // If has modified constructor
|
5173
|
-
|
5174
|
-
ctor = o.constructor;
|
5175
|
-
if (typeof ctor !== 'function') return false; // If has modified prototype
|
5176
|
-
|
5177
|
-
prot = ctor.prototype;
|
5178
|
-
if (isObjectObject(prot) === false) return false; // If constructor does not have an Object-specific method
|
5179
|
-
|
5180
|
-
if (prot.hasOwnProperty('isPrototypeOf') === false) {
|
5181
|
-
return false;
|
5182
|
-
} // Most likely a plain Object
|
5183
|
-
|
5184
|
-
|
5185
|
-
return true;
|
5186
|
-
};
|
5187
|
-
|
5188
|
-
var deleteProperty = Reflect.deleteProperty;
|
5189
|
-
|
5190
|
-
var isObject = function isObject(value) {
|
5191
|
-
return _typeof(value) === 'object' && value !== null || typeof value === 'function';
|
5192
|
-
};
|
5193
|
-
|
5194
|
-
var isUnsafeKey = function isUnsafeKey(key) {
|
5195
|
-
return key === '__proto__' || key === 'constructor' || key === 'prototype';
|
5196
|
-
};
|
5197
|
-
|
5198
|
-
var validateKey = function validateKey(key) {
|
5199
|
-
if (!isPrimitive(key)) {
|
5200
|
-
throw new TypeError('Object keys must be strings or symbols');
|
5201
|
-
}
|
5202
|
-
|
5203
|
-
if (isUnsafeKey(key)) {
|
5204
|
-
throw new Error("Cannot set unsafe key: \"".concat(key, "\""));
|
5205
|
-
}
|
5206
|
-
};
|
5207
|
-
|
5208
|
-
var toStringKey = function toStringKey(input) {
|
5209
|
-
return Array.isArray(input) ? input.flat().map(String).join(',') : input;
|
5210
|
-
};
|
5211
|
-
|
5212
|
-
var createMemoKey = function createMemoKey(input, options) {
|
5213
|
-
if (typeof input !== 'string' || !options) return input;
|
5214
|
-
var key = input + ';';
|
5215
|
-
if (options.arrays !== undefined) key += "arrays=".concat(options.arrays, ";");
|
5216
|
-
if (options.separator !== undefined) key += "separator=".concat(options.separator, ";");
|
5217
|
-
if (options.split !== undefined) key += "split=".concat(options.split, ";");
|
5218
|
-
if (options.merge !== undefined) key += "merge=".concat(options.merge, ";");
|
5219
|
-
if (options.preservePaths !== undefined) key += "preservePaths=".concat(options.preservePaths, ";");
|
5220
|
-
return key;
|
5221
|
-
};
|
5222
|
-
|
5223
|
-
var memoize = function memoize(input, options, fn) {
|
5224
|
-
var key = toStringKey(options ? createMemoKey(input, options) : input);
|
5225
|
-
validateKey(key);
|
5226
|
-
var value = setValue.cache.get(key) || fn();
|
5227
|
-
setValue.cache.set(key, value);
|
5228
|
-
return value;
|
5229
|
-
};
|
5230
|
-
|
5231
|
-
var splitString = function splitString(input) {
|
5232
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
5233
|
-
var sep = options.separator || '.';
|
5234
|
-
var preserve = sep === '/' ? false : options.preservePaths;
|
5235
|
-
|
5236
|
-
if (typeof input === 'string' && preserve !== false && /\//.test(input)) {
|
5237
|
-
return [input];
|
5238
|
-
}
|
5239
|
-
|
5240
|
-
var parts = [];
|
5241
|
-
var part = '';
|
5242
|
-
|
5243
|
-
var push = function push(part) {
|
5244
|
-
var number;
|
5245
|
-
|
5246
|
-
if (part.trim() !== '' && Number.isInteger(number = Number(part))) {
|
5247
|
-
parts.push(number);
|
5248
|
-
} else {
|
5249
|
-
parts.push(part);
|
5250
|
-
}
|
5251
|
-
};
|
5252
|
-
|
5253
|
-
for (var i = 0; i < input.length; i++) {
|
5254
|
-
var value = input[i];
|
5255
|
-
|
5256
|
-
if (value === '\\') {
|
5257
|
-
part += input[++i];
|
5258
|
-
continue;
|
5259
|
-
}
|
5260
|
-
|
5261
|
-
if (value === sep) {
|
5262
|
-
push(part);
|
5263
|
-
part = '';
|
5264
|
-
continue;
|
5265
|
-
}
|
5266
|
-
|
5267
|
-
part += value;
|
5268
|
-
}
|
5269
|
-
|
5270
|
-
if (part) {
|
5271
|
-
push(part);
|
5272
|
-
}
|
5273
|
-
|
5274
|
-
return parts;
|
5275
|
-
};
|
5276
|
-
|
5277
|
-
var split$1 = function split(input, options) {
|
5278
|
-
if (options && typeof options.split === 'function') return options.split(input);
|
5279
|
-
if (_typeof(input) === 'symbol') return [input];
|
5280
|
-
if (Array.isArray(input)) return input;
|
5281
|
-
return memoize(input, options, function () {
|
5282
|
-
return splitString(input, options);
|
5283
|
-
});
|
5284
|
-
};
|
5285
|
-
|
5286
|
-
var assignProp = function assignProp(obj, prop, value, options) {
|
5287
|
-
validateKey(prop); // Delete property when "value" is undefined
|
5288
|
-
|
5289
|
-
if (value === undefined) {
|
5290
|
-
deleteProperty(obj, prop);
|
5291
|
-
} else if (options && options.merge) {
|
5292
|
-
var merge = options.merge === 'function' ? options.merge : Object.assign; // Only merge plain objects
|
5293
|
-
|
5294
|
-
if (merge && isPlainObject(obj[prop]) && isPlainObject(value)) {
|
5295
|
-
obj[prop] = merge(obj[prop], value);
|
5296
|
-
} else {
|
5297
|
-
obj[prop] = value;
|
5298
|
-
}
|
5299
|
-
} else {
|
5300
|
-
obj[prop] = value;
|
5301
|
-
}
|
5302
|
-
|
5303
|
-
return obj;
|
5304
|
-
};
|
5305
|
-
|
5306
|
-
var setValue = function setValue(target, path, value, options) {
|
5307
|
-
if (!path || !isObject(target)) return target;
|
5308
|
-
var keys = split$1(path, options);
|
5309
|
-
var obj = target;
|
5310
|
-
|
5311
|
-
for (var i = 0; i < keys.length; i++) {
|
5312
|
-
var key = keys[i];
|
5313
|
-
var next = keys[i + 1];
|
5314
|
-
validateKey(key);
|
5315
|
-
|
5316
|
-
if (next === undefined) {
|
5317
|
-
assignProp(obj, key, value, options);
|
5318
|
-
break;
|
5319
|
-
}
|
5320
|
-
|
5321
|
-
if (typeof next === 'number' && !Array.isArray(obj[key])) {
|
5322
|
-
obj = obj[key] = [];
|
5323
|
-
continue;
|
5324
|
-
}
|
5325
|
-
|
5326
|
-
if (!isObject(obj[key])) {
|
5327
|
-
obj[key] = {};
|
5328
|
-
}
|
5329
|
-
|
5330
|
-
obj = obj[key];
|
5331
|
-
}
|
5332
|
-
|
5333
|
-
return target;
|
5334
|
-
};
|
5335
|
-
|
5336
|
-
setValue.split = split$1;
|
5337
|
-
setValue.cache = new Map();
|
5338
|
-
|
5339
|
-
setValue.clear = function () {
|
5340
|
-
setValue.cache = new Map();
|
5341
|
-
};
|
5342
|
-
|
5343
|
-
var setValue_1 = setValue;
|
5344
|
-
|
5345
5151
|
var LOG_LEVEL_INFO = 1;
|
5346
5152
|
var LOG_LEVEL_DEBUG = 2;
|
5347
5153
|
var LOG_LEVEL_WARN = 3;
|
@@ -5713,9 +5519,10 @@
|
|
5713
5519
|
PRODUCT_REVIEWED: "Product Reviewed"
|
5714
5520
|
}; // Enumeration for integrations supported
|
5715
5521
|
|
5716
|
-
var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=1.
|
5522
|
+
var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=1.4.0";
|
5717
5523
|
var MAX_WAIT_FOR_INTEGRATION_LOAD = 10000;
|
5718
5524
|
var INTEGRATION_LOAD_CHECK_INTERVAL = 1000;
|
5525
|
+
var POLYFILL_URL = "https://polyfill.io/v3/polyfill.min.js?features=Array.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries";
|
5719
5526
|
/* module.exports = {
|
5720
5527
|
MessageType: MessageType,
|
5721
5528
|
ECommerceParamNames: ECommerceParamNames,
|
@@ -9066,7 +8873,7 @@
|
|
9066
8873
|
*/
|
9067
8874
|
// TODO: Move to a library
|
9068
8875
|
|
9069
|
-
var isObject
|
8876
|
+
var isObject = function isObject(value) {
|
9070
8877
|
return Boolean(value) && _typeof(value) === 'object';
|
9071
8878
|
};
|
9072
8879
|
/**
|
@@ -9080,7 +8887,7 @@
|
|
9080
8887
|
// TODO: Move to a library
|
9081
8888
|
|
9082
8889
|
|
9083
|
-
var isPlainObject
|
8890
|
+
var isPlainObject = function isPlainObject(value) {
|
9084
8891
|
return Boolean(value) && objToString$1.call(value) === '[object Object]';
|
9085
8892
|
};
|
9086
8893
|
/**
|
@@ -9119,7 +8926,7 @@
|
|
9119
8926
|
|
9120
8927
|
var deepCombiner = function deepCombiner(target, source, value, key) {
|
9121
8928
|
if (has$2.call(source, key)) {
|
9122
|
-
if (isPlainObject
|
8929
|
+
if (isPlainObject(target[key]) && isPlainObject(value)) {
|
9123
8930
|
target[key] = defaultsDeep(target[key], value);
|
9124
8931
|
} else if (target[key] === undefined) {
|
9125
8932
|
target[key] = value;
|
@@ -9143,7 +8950,7 @@
|
|
9143
8950
|
var defaultsWith = function defaultsWith(combiner, target
|
9144
8951
|
/*, ...sources */
|
9145
8952
|
) {
|
9146
|
-
if (!isObject
|
8953
|
+
if (!isObject(target)) {
|
9147
8954
|
return target;
|
9148
8955
|
}
|
9149
8956
|
|
@@ -12477,7 +12284,13 @@
|
|
12477
12284
|
});
|
12478
12285
|
objKeys.map(function (k) {
|
12479
12286
|
if (!(typeof messageContext[k] === "undefined")) {
|
12480
|
-
|
12287
|
+
if (destination) {
|
12288
|
+
destination[k] = getValue(messageContext, k);
|
12289
|
+
} else {
|
12290
|
+
destination = {
|
12291
|
+
k: getValue(messageContext, k)
|
12292
|
+
};
|
12293
|
+
}
|
12481
12294
|
}
|
12482
12295
|
});
|
12483
12296
|
}
|
@@ -12505,7 +12318,7 @@
|
|
12505
12318
|
};
|
12506
12319
|
|
12507
12320
|
if (!getValue(traitsValue, "name") && getValue(traitsValue, "firstName") && getValue(traitsValue, "lastName")) {
|
12508
|
-
|
12321
|
+
traitsValue.name = "".concat(getValue(traitsValue, "firstName"), " ").concat(getValue(traitsValue, "lastName"));
|
12509
12322
|
}
|
12510
12323
|
|
12511
12324
|
return traitsValue;
|
@@ -12515,7 +12328,7 @@
|
|
12515
12328
|
*/
|
12516
12329
|
|
12517
12330
|
|
12518
|
-
var isObject$
|
12331
|
+
var isObject$1 = function isObject(obj) {
|
12519
12332
|
return type(obj) === "object";
|
12520
12333
|
};
|
12521
12334
|
/**
|
@@ -24886,7 +24699,7 @@
|
|
24886
24699
|
}
|
24887
24700
|
|
24888
24701
|
Object.keys(payload).map(function (key) {
|
24889
|
-
if (isObject$
|
24702
|
+
if (isObject$1(payload[key])) {
|
24890
24703
|
logger.debug("cannot process, unsupported traits");
|
24891
24704
|
return;
|
24892
24705
|
}
|
@@ -24920,7 +24733,7 @@
|
|
24920
24733
|
window.clevertap.event.push("Charged", ecomProperties);
|
24921
24734
|
} else {
|
24922
24735
|
Object.keys(properties).map(function (key) {
|
24923
|
-
if (isObject$
|
24736
|
+
if (isObject$1(properties[key]) || isArray$1(properties[key])) {
|
24924
24737
|
logger.debug("cannot process, unsupported event");
|
24925
24738
|
return;
|
24926
24739
|
}
|
@@ -24952,7 +24765,7 @@
|
|
24952
24765
|
|
24953
24766
|
if (properties) {
|
24954
24767
|
Object.keys(properties).map(function (key) {
|
24955
|
-
if (isObject$
|
24768
|
+
if (isObject$1(properties[key]) || isArray$1(properties[key])) {
|
24956
24769
|
logger.debug("cannot process, unsupported event");
|
24957
24770
|
return;
|
24958
24771
|
}
|
@@ -27602,114 +27415,50 @@
|
|
27602
27415
|
return FacebookPixel;
|
27603
27416
|
}();
|
27604
27417
|
|
27605
|
-
|
27606
|
-
|
27607
|
-
|
27608
|
-
|
27609
|
-
|
27610
|
-
var LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source);
|
27611
|
-
var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu');
|
27612
|
-
var NUMBERS_AND_IDENTIFIER = new RegExp('\\d+' + IDENTIFIER.source, 'gu');
|
27613
|
-
|
27614
|
-
var preserveCamelCase = function preserveCamelCase(string, locale) {
|
27615
|
-
var isLastCharLower = false;
|
27616
|
-
var isLastCharUpper = false;
|
27617
|
-
var isLastLastCharUpper = false;
|
27618
|
-
|
27619
|
-
for (var i = 0; i < string.length; i++) {
|
27620
|
-
var character = string[i];
|
27621
|
-
|
27622
|
-
if (isLastCharLower && UPPERCASE.test(character)) {
|
27623
|
-
string = string.slice(0, i) + '-' + string.slice(i);
|
27624
|
-
isLastCharLower = false;
|
27625
|
-
isLastLastCharUpper = isLastCharUpper;
|
27626
|
-
isLastCharUpper = true;
|
27627
|
-
i++;
|
27628
|
-
} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
|
27629
|
-
string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
|
27630
|
-
isLastLastCharUpper = isLastCharUpper;
|
27631
|
-
isLastCharUpper = false;
|
27632
|
-
isLastCharLower = true;
|
27633
|
-
} else {
|
27634
|
-
isLastCharLower = character.toLocaleLowerCase(locale) === character && character.toLocaleUpperCase(locale) !== character;
|
27635
|
-
isLastLastCharUpper = isLastCharUpper;
|
27636
|
-
isLastCharUpper = character.toLocaleUpperCase(locale) === character && character.toLocaleLowerCase(locale) !== character;
|
27418
|
+
// util function to convert the input to string type
|
27419
|
+
function convertToString(input) {
|
27420
|
+
if (input) {
|
27421
|
+
if (typeof input === "string") {
|
27422
|
+
return input;
|
27637
27423
|
}
|
27638
|
-
}
|
27639
|
-
|
27640
|
-
return string;
|
27641
|
-
};
|
27642
27424
|
|
27643
|
-
|
27644
|
-
LEADING_CAPITAL.lastIndex = 0;
|
27645
|
-
return input.replace(LEADING_CAPITAL, function (m1) {
|
27646
|
-
return m1.toLowerCase();
|
27647
|
-
});
|
27648
|
-
};
|
27649
|
-
|
27650
|
-
var postProcess = function postProcess(input, options) {
|
27651
|
-
SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
27652
|
-
NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
27653
|
-
return input.replace(SEPARATORS_AND_IDENTIFIER, function (_, identifier) {
|
27654
|
-
return identifier.toLocaleUpperCase(options.locale);
|
27655
|
-
}).replace(NUMBERS_AND_IDENTIFIER, function (m) {
|
27656
|
-
return m.toLocaleUpperCase(options.locale);
|
27657
|
-
});
|
27658
|
-
};
|
27659
|
-
|
27660
|
-
var camelCase = function camelCase(input, options) {
|
27661
|
-
if (!(typeof input === 'string' || Array.isArray(input))) {
|
27662
|
-
throw new TypeError('Expected the input to be `string | string[]`');
|
27425
|
+
return String(input);
|
27663
27426
|
}
|
27664
27427
|
|
27665
|
-
|
27666
|
-
|
27667
|
-
preserveConsecutiveUppercase: false
|
27668
|
-
}, options);
|
27669
|
-
|
27670
|
-
if (Array.isArray(input)) {
|
27671
|
-
input = input.map(function (x) {
|
27672
|
-
return x.trim();
|
27673
|
-
}).filter(function (x) {
|
27674
|
-
return x.length;
|
27675
|
-
}).join('-');
|
27676
|
-
} else {
|
27677
|
-
input = input.trim();
|
27678
|
-
}
|
27428
|
+
return "";
|
27429
|
+
} // convert string to words
|
27679
27430
|
|
27680
|
-
if (input.length === 0) {
|
27681
|
-
return '';
|
27682
|
-
}
|
27683
27431
|
|
27684
|
-
|
27685
|
-
|
27686
|
-
|
27432
|
+
function toWords(input) {
|
27433
|
+
input = convertToString(input);
|
27434
|
+
var regex = /[A-Z\xC0-\xD6\xD8-\xDE]?[a-z\xDF-\xF6\xF8-\xFF]+|[A-Z\xC0-\xD6\xD8-\xDE]+(?![a-z\xDF-\xF6\xF8-\xFF])|\d+/g;
|
27435
|
+
return input.match(regex);
|
27436
|
+
} // convert the input array to camel case
|
27687
27437
|
|
27688
|
-
var hasUpperCase = input !== input.toLocaleLowerCase(options.locale);
|
27689
27438
|
|
27690
|
-
|
27691
|
-
|
27692
|
-
}
|
27439
|
+
function toCamelCase(inputArray) {
|
27440
|
+
var result = "";
|
27693
27441
|
|
27694
|
-
|
27442
|
+
for (var i = 0, len = inputArray.length; i < len; i++) {
|
27443
|
+
var currentStr = inputArray[i];
|
27444
|
+
var tempStr = currentStr.toLowerCase();
|
27695
27445
|
|
27696
|
-
|
27697
|
-
|
27698
|
-
|
27699
|
-
|
27700
|
-
}
|
27446
|
+
if (i !== 0) {
|
27447
|
+
// convert first letter to upper case (the word is in lowercase)
|
27448
|
+
tempStr = tempStr.substr(0, 1).toUpperCase() + tempStr.substr(1);
|
27449
|
+
}
|
27701
27450
|
|
27702
|
-
|
27703
|
-
input = input.charAt(0).toLocaleUpperCase(options.locale) + input.slice(1);
|
27451
|
+
result += tempStr;
|
27704
27452
|
}
|
27705
27453
|
|
27706
|
-
return
|
27707
|
-
}
|
27454
|
+
return result;
|
27455
|
+
} // this function call all other functions
|
27708
27456
|
|
27709
|
-
var camelcase = camelCase; // TODO: Remove this for the next major release
|
27710
27457
|
|
27711
|
-
|
27712
|
-
|
27458
|
+
function camelcase(input) {
|
27459
|
+
var words = toWords(input);
|
27460
|
+
return toCamelCase(words);
|
27461
|
+
}
|
27713
27462
|
|
27714
27463
|
var Fullstory = /*#__PURE__*/function () {
|
27715
27464
|
function Fullstory(config, analytics) {
|
@@ -33419,7 +33168,7 @@
|
|
33419
33168
|
key: "isLoaded",
|
33420
33169
|
value: function isLoaded() {
|
33421
33170
|
logger.debug("===in Sentry isLoaded===");
|
33422
|
-
return !!(window.Sentry && isObject$
|
33171
|
+
return !!(window.Sentry && isObject$1(window.Sentry) && window.Sentry.setUser && window.Sentry.Integrations.RewriteFrames);
|
33423
33172
|
} // eslint-disable-next-line class-methods-use-this
|
33424
33173
|
|
33425
33174
|
}, {
|
@@ -33427,7 +33176,7 @@
|
|
33427
33176
|
value: function isReady() {
|
33428
33177
|
logger.debug("===in Sentry isReady===");
|
33429
33178
|
|
33430
|
-
if (window.Sentry && isObject$
|
33179
|
+
if (window.Sentry && isObject$1(window.Sentry) && window.Sentry.setUser && window.Sentry.Integrations.RewriteFrames) {
|
33431
33180
|
var sentryConfig = sentryInit(this.allowUrls, this.denyUrls, this.ignoreErrors, this.includePathsArray, this.customVersionProperty, this.release, this.dsn, this.debugMode, this.environment, this.serverName);
|
33432
33181
|
window.Sentry.init(sentryConfig);
|
33433
33182
|
|
@@ -34472,7 +34221,7 @@
|
|
34472
34221
|
this.build = "1.0.0";
|
34473
34222
|
this.name = "RudderLabs JavaScript SDK";
|
34474
34223
|
this.namespace = "com.rudderlabs.javascript";
|
34475
|
-
this.version = "1.
|
34224
|
+
this.version = "1.4.0";
|
34476
34225
|
});
|
34477
34226
|
|
34478
34227
|
// Library information class
|
@@ -34480,7 +34229,7 @@
|
|
34480
34229
|
_classCallCheck(this, RudderLibraryInfo);
|
34481
34230
|
|
34482
34231
|
this.name = "RudderLabs JavaScript SDK";
|
34483
|
-
this.version = "1.
|
34232
|
+
this.version = "1.4.0";
|
34484
34233
|
}); // Operating System information class
|
34485
34234
|
|
34486
34235
|
|
@@ -38106,20 +37855,19 @@
|
|
38106
37855
|
return true;
|
38107
37856
|
}
|
38108
37857
|
/**
|
38109
|
-
*
|
38110
|
-
*
|
37858
|
+
* Load after polyfills are loaded
|
38111
37859
|
* @param {*} writeKey
|
38112
|
-
* @
|
37860
|
+
* @param {*} serverUrl
|
37861
|
+
* @param {*} options
|
37862
|
+
* @returns
|
38113
37863
|
*/
|
38114
37864
|
|
38115
37865
|
}, {
|
38116
|
-
key: "
|
38117
|
-
value: function
|
37866
|
+
key: "loadAfterPolyfill",
|
37867
|
+
value: function loadAfterPolyfill(writeKey, serverUrl, options) {
|
38118
37868
|
var _this4 = this;
|
38119
37869
|
|
38120
|
-
logger.debug("inside load ");
|
38121
37870
|
if (options && options.cookieConsentManager) this.cookieConsentOptions = lodash_clonedeep(options.cookieConsentManager);
|
38122
|
-
if (this.loaded) return;
|
38123
37871
|
var configUrl = CONFIG_URL;
|
38124
37872
|
|
38125
37873
|
if (!this.isValidWriteKey(writeKey) || !this.isValidServerUrl(serverUrl)) {
|
@@ -38244,6 +37992,37 @@
|
|
38244
37992
|
|
38245
37993
|
processDataInAnalyticsArray(this);
|
38246
37994
|
}
|
37995
|
+
/**
|
37996
|
+
* Call control pane to get client configs
|
37997
|
+
*
|
37998
|
+
* @param {*} writeKey
|
37999
|
+
* @memberof Analytics
|
38000
|
+
*/
|
38001
|
+
|
38002
|
+
}, {
|
38003
|
+
key: "load",
|
38004
|
+
value: function load(writeKey, serverUrl, options) {
|
38005
|
+
// logger.debug("inside load ");
|
38006
|
+
if (this.loaded) return; // check if the below features are available in the browser or not
|
38007
|
+
// If not present dynamically load from the polyfill cdn
|
38008
|
+
|
38009
|
+
if (!String.prototype.endsWith || !String.prototype.startsWith || !String.prototype.includes || !Array.prototype.find || !Array.prototype.includes || !Promise || !Object.entries) {
|
38010
|
+
ScriptLoader("polyfill", POLYFILL_URL);
|
38011
|
+
var self = this;
|
38012
|
+
var interval = setInterval(function () {
|
38013
|
+
// check if the polyfill is loaded
|
38014
|
+
if (window.hasOwnProperty("polyfill")) {
|
38015
|
+
clearInterval(interval);
|
38016
|
+
self.loadAfterPolyfill(writeKey, serverUrl, options);
|
38017
|
+
}
|
38018
|
+
}, 100);
|
38019
|
+
setTimeout(function () {
|
38020
|
+
clearInterval(interval);
|
38021
|
+
}, MAX_WAIT_FOR_INTEGRATION_LOAD);
|
38022
|
+
} else {
|
38023
|
+
this.loadAfterPolyfill(writeKey, serverUrl, options);
|
38024
|
+
}
|
38025
|
+
}
|
38247
38026
|
}, {
|
38248
38027
|
key: "ready",
|
38249
38028
|
value: function ready(callback) {
|