@brndts/brndts-ads 1.14.18 → 1.14.19
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/dist/index.js +126 -130
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +126 -130
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -55196,18 +55196,18 @@ var BrowserClient = /*#__PURE__*/ function(BaseClient) {
|
|
55196
55196
|
function BrowserClient(options) {
|
55197
55197
|
_class_call_check(this, BrowserClient);
|
55198
55198
|
var _this;
|
55199
|
-
var
|
55199
|
+
var opts = _object_spread({
|
55200
55200
|
// We default this to true, as it is the safer scenario
|
55201
55201
|
parentSpanIsAlwaysRootSpan: true
|
55202
55202
|
}, options);
|
55203
55203
|
var sdkSource = WINDOW4.SENTRY_SDK_SOURCE || getSDKSource();
|
55204
|
-
applySdkMetadata(
|
55204
|
+
applySdkMetadata(opts, "browser", [
|
55205
55205
|
"browser"
|
55206
55206
|
], sdkSource);
|
55207
55207
|
_this = _call_super(this, BrowserClient, [
|
55208
|
-
|
55208
|
+
opts
|
55209
55209
|
]);
|
55210
|
-
if (
|
55210
|
+
if (opts.sendClientReports && WINDOW4.document) {
|
55211
55211
|
WINDOW4.document.addEventListener("visibilitychange", function() {
|
55212
55212
|
if (WINDOW4.document.visibilityState === "hidden") {
|
55213
55213
|
_this._flushOutcomes();
|
@@ -55341,7 +55341,7 @@ var initMetric = function(name, value2) {
|
|
55341
55341
|
};
|
55342
55342
|
};
|
55343
55343
|
// node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js
|
55344
|
-
var observe = function(type, callback,
|
55344
|
+
var observe = function(type, callback, opts) {
|
55345
55345
|
try {
|
55346
55346
|
if (PerformanceObserver.supportedEntryTypes.includes(type)) {
|
55347
55347
|
var po2 = new PerformanceObserver(function(list) {
|
@@ -55352,7 +55352,7 @@ var observe = function(type, callback, opts2) {
|
|
55352
55352
|
po2.observe(Object.assign({
|
55353
55353
|
type: type,
|
55354
55354
|
buffered: true
|
55355
|
-
},
|
55355
|
+
}, opts || {}));
|
55356
55356
|
return po2;
|
55357
55357
|
}
|
55358
55358
|
} catch (e2) {}
|
@@ -55426,7 +55426,7 @@ var FCPThresholds = [
|
|
55426
55426
|
3e3
|
55427
55427
|
];
|
55428
55428
|
var onFCP = function(onReport) {
|
55429
|
-
var
|
55429
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55430
55430
|
whenActivated(function() {
|
55431
55431
|
var visibilityWatcher = getVisibilityWatcher();
|
55432
55432
|
var metric = initMetric("FCP");
|
@@ -55445,7 +55445,7 @@ var onFCP = function(onReport) {
|
|
55445
55445
|
};
|
55446
55446
|
var po2 = observe("paint", handleEntries);
|
55447
55447
|
if (po2) {
|
55448
|
-
report = bindReporter(onReport, metric, FCPThresholds,
|
55448
|
+
report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges);
|
55449
55449
|
}
|
55450
55450
|
});
|
55451
55451
|
};
|
@@ -55455,7 +55455,7 @@ var CLSThresholds = [
|
|
55455
55455
|
0.25
|
55456
55456
|
];
|
55457
55457
|
var onCLS = function(onReport) {
|
55458
|
-
var
|
55458
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55459
55459
|
onFCP(runOnce(function() {
|
55460
55460
|
var metric = initMetric("CLS", 0);
|
55461
55461
|
var report;
|
@@ -55485,7 +55485,7 @@ var onCLS = function(onReport) {
|
|
55485
55485
|
};
|
55486
55486
|
var po2 = observe("layout-shift", handleEntries);
|
55487
55487
|
if (po2) {
|
55488
|
-
report = bindReporter(onReport, metric, CLSThresholds,
|
55488
|
+
report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges);
|
55489
55489
|
onHidden(function() {
|
55490
55490
|
handleEntries(po2.takeRecords());
|
55491
55491
|
report(true);
|
@@ -55500,7 +55500,7 @@ var FIDThresholds = [
|
|
55500
55500
|
300
|
55501
55501
|
];
|
55502
55502
|
var onFID = function(onReport) {
|
55503
|
-
var
|
55503
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55504
55504
|
whenActivated(function() {
|
55505
55505
|
var visibilityWatcher = getVisibilityWatcher();
|
55506
55506
|
var metric = initMetric("FID");
|
@@ -55516,7 +55516,7 @@ var onFID = function(onReport) {
|
|
55516
55516
|
entries.forEach(handleEntry);
|
55517
55517
|
};
|
55518
55518
|
var po2 = observe("first-input", handleEntries);
|
55519
|
-
report = bindReporter(onReport, metric, FIDThresholds,
|
55519
|
+
report = bindReporter(onReport, metric, FIDThresholds, opts.reportAllChanges);
|
55520
55520
|
if (po2) {
|
55521
55521
|
onHidden(runOnce(function() {
|
55522
55522
|
handleEntries(po2.takeRecords());
|
@@ -55621,7 +55621,7 @@ var INPThresholds = [
|
|
55621
55621
|
500
|
55622
55622
|
];
|
55623
55623
|
var onINP = function(onReport) {
|
55624
|
-
var
|
55624
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55625
55625
|
if (!("PerformanceEventTiming" in WINDOW5 && "interactionId" in PerformanceEventTiming.prototype)) {
|
55626
55626
|
return;
|
55627
55627
|
}
|
@@ -55647,9 +55647,9 @@ var onINP = function(onReport) {
|
|
55647
55647
|
// and performance. Running this callback for any interaction that spans
|
55648
55648
|
// just one or two frames is likely not worth the insight that could be
|
55649
55649
|
// gained.
|
55650
|
-
durationThreshold:
|
55650
|
+
durationThreshold: opts.durationThreshold != null ? opts.durationThreshold : DEFAULT_DURATION_THRESHOLD
|
55651
55651
|
});
|
55652
|
-
report = bindReporter(onReport, metric, INPThresholds,
|
55652
|
+
report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges);
|
55653
55653
|
if (po2) {
|
55654
55654
|
po2.observe({
|
55655
55655
|
type: "first-input",
|
@@ -55669,13 +55669,13 @@ var LCPThresholds = [
|
|
55669
55669
|
];
|
55670
55670
|
var reportedMetricIDs = {};
|
55671
55671
|
var onLCP = function(onReport) {
|
55672
|
-
var
|
55672
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55673
55673
|
whenActivated(function() {
|
55674
55674
|
var visibilityWatcher = getVisibilityWatcher();
|
55675
55675
|
var metric = initMetric("LCP");
|
55676
55676
|
var report;
|
55677
55677
|
var handleEntries = function(entries) {
|
55678
|
-
if (!
|
55678
|
+
if (!opts.reportAllChanges) {
|
55679
55679
|
entries = entries.slice(-1);
|
55680
55680
|
}
|
55681
55681
|
entries.forEach(function(entry) {
|
@@ -55690,7 +55690,7 @@ var onLCP = function(onReport) {
|
|
55690
55690
|
};
|
55691
55691
|
var po2 = observe("largest-contentful-paint", handleEntries);
|
55692
55692
|
if (po2) {
|
55693
|
-
report = bindReporter(onReport, metric, LCPThresholds,
|
55693
|
+
report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges);
|
55694
55694
|
var stopListening = runOnce(function() {
|
55695
55695
|
if (!reportedMetricIDs[metric.id]) {
|
55696
55696
|
handleEntries(po2.takeRecords());
|
@@ -55735,9 +55735,9 @@ var whenReady = function(callback) {
|
|
55735
55735
|
}
|
55736
55736
|
};
|
55737
55737
|
var onTTFB = function(onReport) {
|
55738
|
-
var
|
55738
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55739
55739
|
var metric = initMetric("TTFB");
|
55740
|
-
var report = bindReporter(onReport, metric, TTFBThresholds,
|
55740
|
+
var report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges);
|
55741
55741
|
whenReady(function() {
|
55742
55742
|
var navigationEntry = getNavigationEntry();
|
55743
55743
|
if (navigationEntry) {
|
@@ -62849,9 +62849,9 @@ function makeReplayLogger() {
|
|
62849
62849
|
infoTick: function() {
|
62850
62850
|
return void 0;
|
62851
62851
|
},
|
62852
|
-
setConfig: function(
|
62853
|
-
_capture =
|
62854
|
-
_trace =
|
62852
|
+
setConfig: function(opts) {
|
62853
|
+
_capture = opts.captureExceptions;
|
62854
|
+
_trace = opts.traceInternals;
|
62855
62855
|
}
|
62856
62856
|
};
|
62857
62857
|
if (DEBUG_BUILD5) {
|
@@ -69402,9 +69402,9 @@ var RegionMaskPlugin = /*#__PURE__*/ function() {
|
|
69402
69402
|
// src/Ads/Regions/Plugins/Border/RegionBorderPlugin.ts
|
69403
69403
|
var RegionBorderPlugin = /*#__PURE__*/ function() {
|
69404
69404
|
"use strict";
|
69405
|
-
function RegionBorderPlugin(
|
69405
|
+
function RegionBorderPlugin(opts) {
|
69406
69406
|
_class_call_check(this, RegionBorderPlugin);
|
69407
|
-
this.options =
|
69407
|
+
this.options = opts;
|
69408
69408
|
}
|
69409
69409
|
_create_class(RegionBorderPlugin, [
|
69410
69410
|
{
|
@@ -69889,10 +69889,6 @@ var RULES = {
|
|
69889
69889
|
[
|
69890
69890
|
728,
|
69891
69891
|
90
|
69892
|
-
],
|
69893
|
-
[
|
69894
|
-
468,
|
69895
|
-
60
|
69896
69892
|
]
|
69897
69893
|
],
|
69898
69894
|
"desktop": [
|
@@ -72590,7 +72586,7 @@ var GPT = /*#__PURE__*/ function() {
|
|
72590
72586
|
},
|
72591
72587
|
{
|
72592
72588
|
key: "defineSlot",
|
72593
|
-
value: function defineSlot(slotId, size, containerId,
|
72589
|
+
value: function defineSlot(slotId, size, containerId, opts) {
|
72594
72590
|
window.googletag.cmd.push(function() {
|
72595
72591
|
if (window.googletag.pubads().getSlots().some(function(slot) {
|
72596
72592
|
return slot.getSlotElementId() === containerId;
|
@@ -72599,9 +72595,9 @@ var GPT = /*#__PURE__*/ function() {
|
|
72599
72595
|
}
|
72600
72596
|
var mrec1 = window.googletag.defineSlot(slotId, size, "".concat(containerId)).addService(window.googletag.pubads());
|
72601
72597
|
var mrecmapping;
|
72602
|
-
if (
|
72598
|
+
if (opts === null || opts === void 0 ? void 0 : opts.mapping) {
|
72603
72599
|
mrecmapping = window.googletag.sizeMapping();
|
72604
|
-
var sortedBreakpoints = Object.keys(
|
72600
|
+
var sortedBreakpoints = Object.keys(opts.mapping).sort(function(a, b) {
|
72605
72601
|
return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
|
72606
72602
|
});
|
72607
72603
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
@@ -72611,7 +72607,7 @@ var GPT = /*#__PURE__*/ function() {
|
|
72611
72607
|
mrecmapping = mrecmapping.addSize([
|
72612
72608
|
RegionDefinitions.BREAKPOINTS[bp],
|
72613
72609
|
0
|
72614
|
-
],
|
72610
|
+
], opts.mapping[bp]);
|
72615
72611
|
}
|
72616
72612
|
} catch (err) {
|
72617
72613
|
_didIteratorError = true;
|
@@ -72644,9 +72640,9 @@ var GPT = /*#__PURE__*/ function() {
|
|
72644
72640
|
], []).build();
|
72645
72641
|
}
|
72646
72642
|
mrec1 === null || mrec1 === void 0 ? void 0 : mrec1.defineSizeMapping(mrecmapping);
|
72647
|
-
if (
|
72643
|
+
if (opts === null || opts === void 0 ? void 0 : opts.targeting) {
|
72648
72644
|
mrec1.setConfig({
|
72649
|
-
targeting:
|
72645
|
+
targeting: opts === null || opts === void 0 ? void 0 : opts.targeting
|
72650
72646
|
});
|
72651
72647
|
}
|
72652
72648
|
});
|
@@ -72822,7 +72818,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
|
|
72822
72818
|
RegionDefinitions.BREAKPOINTS[bp],
|
72823
72819
|
0
|
72824
72820
|
],
|
72825
|
-
sizes:
|
72821
|
+
sizes: mapping[bp]
|
72826
72822
|
});
|
72827
72823
|
}
|
72828
72824
|
} catch (err) {
|
@@ -80719,7 +80715,7 @@ var CooldownPresentation = /*#__PURE__*/ function(AbstractPresentation) {
|
|
80719
80715
|
},
|
80720
80716
|
{
|
80721
80717
|
key: "startedPresentation",
|
80722
|
-
value: function startedPresentation(
|
80718
|
+
value: function startedPresentation(opts) {
|
80723
80719
|
this.stopRetry();
|
80724
80720
|
this.emit("pace");
|
80725
80721
|
this.presentationTimer.resume();
|
@@ -80955,11 +80951,11 @@ var DynamicDurationPresentation = /*#__PURE__*/ function(AbstractPresentation) {
|
|
80955
80951
|
},
|
80956
80952
|
{
|
80957
80953
|
key: "startedPresentation",
|
80958
|
-
value: function startedPresentation(
|
80954
|
+
value: function startedPresentation(opts) {
|
80959
80955
|
this.stopRetry();
|
80960
80956
|
this.startPacing();
|
80961
|
-
if (
|
80962
|
-
this.presentationTimer.setDuration(
|
80957
|
+
if (opts.expectedDuration && !this.presentationTimer.isPaused) {
|
80958
|
+
this.presentationTimer.setDuration(opts.expectedDuration * 1e3);
|
80963
80959
|
}
|
80964
80960
|
this.presentationTimer.resume();
|
80965
80961
|
}
|
@@ -86776,8 +86772,8 @@ function pick(obj) {
|
|
86776
86772
|
}
|
86777
86773
|
var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout;
|
86778
86774
|
var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
|
86779
|
-
function installTimerFunctions(obj,
|
86780
|
-
if (
|
86775
|
+
function installTimerFunctions(obj, opts) {
|
86776
|
+
if (opts.useNativeTimers) {
|
86781
86777
|
obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
|
86782
86778
|
obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
|
86783
86779
|
} else {
|
@@ -86852,16 +86848,16 @@ var TransportError = /*#__PURE__*/ function(Error1) {
|
|
86852
86848
|
var Transport = /*#__PURE__*/ function(Emitter) {
|
86853
86849
|
"use strict";
|
86854
86850
|
_inherits(Transport, Emitter);
|
86855
|
-
function Transport(
|
86851
|
+
function Transport(opts) {
|
86856
86852
|
_class_call_check(this, Transport);
|
86857
86853
|
var _this;
|
86858
86854
|
_this = _call_super(this, Transport);
|
86859
86855
|
_this.writable = false;
|
86860
|
-
installTimerFunctions(_this,
|
86861
|
-
_this.opts =
|
86862
|
-
_this.query =
|
86863
|
-
_this.socket =
|
86864
|
-
_this.supportsBinary = !
|
86856
|
+
installTimerFunctions(_this, opts);
|
86857
|
+
_this.opts = opts;
|
86858
|
+
_this.query = opts.query;
|
86859
|
+
_this.socket = opts.socket;
|
86860
|
+
_this.supportsBinary = !opts.forceBase64;
|
86865
86861
|
return _this;
|
86866
86862
|
}
|
86867
86863
|
_create_class(Transport, [
|
@@ -87177,11 +87173,11 @@ function empty() {}
|
|
87177
87173
|
var BaseXHR = /*#__PURE__*/ function(Polling) {
|
87178
87174
|
"use strict";
|
87179
87175
|
_inherits(BaseXHR, Polling);
|
87180
|
-
function BaseXHR(
|
87176
|
+
function BaseXHR(opts) {
|
87181
87177
|
_class_call_check(this, BaseXHR);
|
87182
87178
|
var _this;
|
87183
87179
|
_this = _call_super(this, BaseXHR, [
|
87184
|
-
|
87180
|
+
opts
|
87185
87181
|
]);
|
87186
87182
|
if (typeof location !== "undefined") {
|
87187
87183
|
var isSSL = "https:" === location.protocol;
|
@@ -87189,7 +87185,7 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
|
|
87189
87185
|
if (!port) {
|
87190
87186
|
port = isSSL ? "443" : "80";
|
87191
87187
|
}
|
87192
|
-
_this.xd = typeof location !== "undefined" &&
|
87188
|
+
_this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port;
|
87193
87189
|
}
|
87194
87190
|
return _this;
|
87195
87191
|
}
|
@@ -87236,16 +87232,16 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
|
|
87236
87232
|
var Request2 = /*#__PURE__*/ function(Emitter) {
|
87237
87233
|
"use strict";
|
87238
87234
|
_inherits(_Request, Emitter);
|
87239
|
-
function _Request(createRequest, uri,
|
87235
|
+
function _Request(createRequest, uri, opts) {
|
87240
87236
|
_class_call_check(this, _Request);
|
87241
87237
|
var _this;
|
87242
87238
|
_this = _call_super(this, _Request);
|
87243
87239
|
_this.createRequest = createRequest;
|
87244
|
-
installTimerFunctions(_this,
|
87245
|
-
_this._opts =
|
87246
|
-
_this._method =
|
87240
|
+
installTimerFunctions(_this, opts);
|
87241
|
+
_this._opts = opts;
|
87242
|
+
_this._method = opts.method || "GET";
|
87247
87243
|
_this._uri = uri;
|
87248
|
-
_this._data = void 0 !==
|
87244
|
+
_this._data = void 0 !== opts.data ? opts.data : null;
|
87249
87245
|
_this._create();
|
87250
87246
|
return _this;
|
87251
87247
|
}
|
@@ -87259,9 +87255,9 @@ var Request2 = /*#__PURE__*/ function(Emitter) {
|
|
87259
87255
|
value: function _create() {
|
87260
87256
|
var _this = this;
|
87261
87257
|
var _a;
|
87262
|
-
var
|
87263
|
-
|
87264
|
-
var xhr = this._xhr = this.createRequest(
|
87258
|
+
var opts = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
|
87259
|
+
opts.xdomain = !!this._opts.xd;
|
87260
|
+
var xhr = this._xhr = this.createRequest(opts);
|
87265
87261
|
try {
|
87266
87262
|
xhr.open(this._method, this._uri, true);
|
87267
87263
|
try {
|
@@ -87404,13 +87400,13 @@ var hasXHR2 = function() {
|
|
87404
87400
|
var XHR = /*#__PURE__*/ function(BaseXHR) {
|
87405
87401
|
"use strict";
|
87406
87402
|
_inherits(XHR, BaseXHR);
|
87407
|
-
function XHR(
|
87403
|
+
function XHR(opts) {
|
87408
87404
|
_class_call_check(this, XHR);
|
87409
87405
|
var _this;
|
87410
87406
|
_this = _call_super(this, XHR, [
|
87411
|
-
|
87407
|
+
opts
|
87412
87408
|
]);
|
87413
|
-
var forceBase64 =
|
87409
|
+
var forceBase64 = opts && opts.forceBase64;
|
87414
87410
|
_this.supportsBinary = hasXHR2 && !forceBase64;
|
87415
87411
|
return _this;
|
87416
87412
|
}
|
@@ -87418,18 +87414,18 @@ var XHR = /*#__PURE__*/ function(BaseXHR) {
|
|
87418
87414
|
{
|
87419
87415
|
key: "request",
|
87420
87416
|
value: function request() {
|
87421
|
-
var
|
87422
|
-
Object.assign(
|
87417
|
+
var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
87418
|
+
Object.assign(opts, {
|
87423
87419
|
xd: this.xd
|
87424
87420
|
}, this.opts);
|
87425
|
-
return new Request2(newRequest, this.uri(),
|
87421
|
+
return new Request2(newRequest, this.uri(), opts);
|
87426
87422
|
}
|
87427
87423
|
}
|
87428
87424
|
]);
|
87429
87425
|
return XHR;
|
87430
87426
|
}(BaseXHR);
|
87431
|
-
function newRequest(
|
87432
|
-
var xdomain =
|
87427
|
+
function newRequest(opts) {
|
87428
|
+
var xdomain = opts.xdomain;
|
87433
87429
|
try {
|
87434
87430
|
if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
|
87435
87431
|
return new XMLHttpRequest();
|
@@ -87464,12 +87460,12 @@ var BaseWS = /*#__PURE__*/ function(Transport) {
|
|
87464
87460
|
value: function doOpen() {
|
87465
87461
|
var uri = this.uri();
|
87466
87462
|
var protocols = this.opts.protocols;
|
87467
|
-
var
|
87463
|
+
var opts = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
|
87468
87464
|
if (this.opts.extraHeaders) {
|
87469
|
-
|
87465
|
+
opts.headers = this.opts.extraHeaders;
|
87470
87466
|
}
|
87471
87467
|
try {
|
87472
|
-
this.ws = this.createSocket(uri, protocols,
|
87468
|
+
this.ws = this.createSocket(uri, protocols, opts);
|
87473
87469
|
} catch (err) {
|
87474
87470
|
return this.emitReserved("error", err);
|
87475
87471
|
}
|
@@ -87570,8 +87566,8 @@ var WS = /*#__PURE__*/ function(BaseWS) {
|
|
87570
87566
|
_create_class(WS, [
|
87571
87567
|
{
|
87572
87568
|
key: "createSocket",
|
87573
|
-
value: function createSocket(uri, protocols,
|
87574
|
-
return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols,
|
87569
|
+
value: function createSocket(uri, protocols, opts) {
|
87570
|
+
return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols, opts);
|
87575
87571
|
}
|
87576
87572
|
},
|
87577
87573
|
{
|
@@ -87751,7 +87747,7 @@ if (withEventListeners) {
|
|
87751
87747
|
var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
87752
87748
|
"use strict";
|
87753
87749
|
_inherits(_SocketWithoutUpgrade, Emitter);
|
87754
|
-
function _SocketWithoutUpgrade(uri,
|
87750
|
+
function _SocketWithoutUpgrade(uri, opts) {
|
87755
87751
|
_class_call_check(this, _SocketWithoutUpgrade);
|
87756
87752
|
var _this;
|
87757
87753
|
_this = _call_super(this, _SocketWithoutUpgrade);
|
@@ -87763,28 +87759,28 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87763
87759
|
_this._maxPayload = -1;
|
87764
87760
|
_this._pingTimeoutTime = Infinity;
|
87765
87761
|
if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
|
87766
|
-
|
87762
|
+
opts = uri;
|
87767
87763
|
uri = null;
|
87768
87764
|
}
|
87769
87765
|
if (uri) {
|
87770
87766
|
var parsedUri = parse2(uri);
|
87771
|
-
|
87772
|
-
|
87773
|
-
|
87774
|
-
if (parsedUri.query)
|
87775
|
-
} else if (
|
87776
|
-
|
87777
|
-
}
|
87778
|
-
installTimerFunctions(_this,
|
87779
|
-
_this.secure = null !=
|
87780
|
-
if (
|
87781
|
-
|
87782
|
-
}
|
87783
|
-
_this.hostname =
|
87784
|
-
_this.port =
|
87767
|
+
opts.hostname = parsedUri.host;
|
87768
|
+
opts.secure = parsedUri.protocol === "https" || parsedUri.protocol === "wss";
|
87769
|
+
opts.port = parsedUri.port;
|
87770
|
+
if (parsedUri.query) opts.query = parsedUri.query;
|
87771
|
+
} else if (opts.host) {
|
87772
|
+
opts.hostname = parse2(opts.host).host;
|
87773
|
+
}
|
87774
|
+
installTimerFunctions(_this, opts);
|
87775
|
+
_this.secure = null != opts.secure ? opts.secure : typeof location !== "undefined" && "https:" === location.protocol;
|
87776
|
+
if (opts.hostname && !opts.port) {
|
87777
|
+
opts.port = _this.secure ? "443" : "80";
|
87778
|
+
}
|
87779
|
+
_this.hostname = opts.hostname || (typeof location !== "undefined" ? location.hostname : "localhost");
|
87780
|
+
_this.port = opts.port || (typeof location !== "undefined" && location.port ? location.port : _this.secure ? "443" : "80");
|
87785
87781
|
_this.transports = [];
|
87786
87782
|
_this._transportsByName = {};
|
87787
|
-
|
87783
|
+
opts.transports.forEach(function(t2) {
|
87788
87784
|
var transportName = t2.prototype.name;
|
87789
87785
|
_this.transports.push(transportName);
|
87790
87786
|
_this._transportsByName[transportName] = t2;
|
@@ -87803,7 +87799,7 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87803
87799
|
},
|
87804
87800
|
transportOptions: {},
|
87805
87801
|
closeOnBeforeunload: false
|
87806
|
-
},
|
87802
|
+
}, opts);
|
87807
87803
|
_this.opts.path = _this.opts.path.replace(/\/$/, "") + (_this.opts.addTrailingSlash ? "/" : "");
|
87808
87804
|
if (typeof _this.opts.query === "string") {
|
87809
87805
|
_this.opts.query = decode2(_this.opts.query);
|
@@ -87847,14 +87843,14 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87847
87843
|
query.EIO = protocol;
|
87848
87844
|
query.transport = name;
|
87849
87845
|
if (this.id) query.sid = this.id;
|
87850
|
-
var
|
87846
|
+
var opts = Object.assign({}, this.opts, {
|
87851
87847
|
query: query,
|
87852
87848
|
socket: this,
|
87853
87849
|
hostname: this.hostname,
|
87854
87850
|
secure: this.secure,
|
87855
87851
|
port: this.port
|
87856
87852
|
}, this.opts.transportOptions[name]);
|
87857
|
-
return new this._transportsByName[name](
|
87853
|
+
return new this._transportsByName[name](opts);
|
87858
87854
|
}
|
87859
87855
|
},
|
87860
87856
|
{
|
@@ -88358,9 +88354,9 @@ var Socket = /*#__PURE__*/ function(SocketWithUpgrade) {
|
|
88358
88354
|
"use strict";
|
88359
88355
|
_inherits(Socket, SocketWithUpgrade);
|
88360
88356
|
function Socket(uri) {
|
88361
|
-
var
|
88357
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
88362
88358
|
_class_call_check(this, Socket);
|
88363
|
-
var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri :
|
88359
|
+
var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri : opts;
|
88364
88360
|
if (!o2.transports || o2.transports && typeof o2.transports[0] === "string") {
|
88365
88361
|
o2.transports = (o2.transports || [
|
88366
88362
|
"polling",
|
@@ -88838,7 +88834,7 @@ var RESERVED_EVENTS2 = Object.freeze({
|
|
88838
88834
|
var Socket2 = /*#__PURE__*/ function(Emitter) {
|
88839
88835
|
"use strict";
|
88840
88836
|
_inherits(Socket2, Emitter);
|
88841
|
-
function Socket2(io, nsp,
|
88837
|
+
function Socket2(io, nsp, opts) {
|
88842
88838
|
_class_call_check(this, Socket2);
|
88843
88839
|
var _this;
|
88844
88840
|
_this = _call_super(this, Socket2);
|
@@ -88853,10 +88849,10 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
|
|
88853
88849
|
_this.flags = {};
|
88854
88850
|
_this.io = io;
|
88855
88851
|
_this.nsp = nsp;
|
88856
|
-
if (
|
88857
|
-
_this.auth =
|
88852
|
+
if (opts && opts.auth) {
|
88853
|
+
_this.auth = opts.auth;
|
88858
88854
|
}
|
88859
|
-
_this._opts = Object.assign({},
|
88855
|
+
_this._opts = Object.assign({}, opts);
|
88860
88856
|
if (_this.io._autoConnect) _this.open();
|
88861
88857
|
return _this;
|
88862
88858
|
}
|
@@ -89754,12 +89750,12 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
|
|
89754
89750
|
return Socket2;
|
89755
89751
|
}(Emitter);
|
89756
89752
|
// node_modules/socket.io-client/build/esm/contrib/backo2.js
|
89757
|
-
function Backoff(
|
89758
|
-
|
89759
|
-
this.ms =
|
89760
|
-
this.max =
|
89761
|
-
this.factor =
|
89762
|
-
this.jitter =
|
89753
|
+
function Backoff(opts) {
|
89754
|
+
opts = opts || {};
|
89755
|
+
this.ms = opts.min || 100;
|
89756
|
+
this.max = opts.max || 1e4;
|
89757
|
+
this.factor = opts.factor || 2;
|
89758
|
+
this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
|
89763
89759
|
this.attempts = 0;
|
89764
89760
|
}
|
89765
89761
|
Backoff.prototype.duration = function() {
|
@@ -89787,7 +89783,7 @@ Backoff.prototype.setJitter = function(jitter) {
|
|
89787
89783
|
var Manager = /*#__PURE__*/ function(Emitter) {
|
89788
89784
|
"use strict";
|
89789
89785
|
_inherits(Manager, Emitter);
|
89790
|
-
function Manager(uri,
|
89786
|
+
function Manager(uri, opts) {
|
89791
89787
|
_class_call_check(this, Manager);
|
89792
89788
|
var _this;
|
89793
89789
|
var _a;
|
@@ -89795,30 +89791,30 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
89795
89791
|
_this.nsps = {};
|
89796
89792
|
_this.subs = [];
|
89797
89793
|
if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
|
89798
|
-
|
89794
|
+
opts = uri;
|
89799
89795
|
uri = void 0;
|
89800
89796
|
}
|
89801
|
-
|
89802
|
-
|
89803
|
-
_this.opts =
|
89804
|
-
installTimerFunctions(_this,
|
89805
|
-
_this.reconnection(
|
89806
|
-
_this.reconnectionAttempts(
|
89807
|
-
_this.reconnectionDelay(
|
89808
|
-
_this.reconnectionDelayMax(
|
89809
|
-
_this.randomizationFactor((_a =
|
89797
|
+
opts = opts || {};
|
89798
|
+
opts.path = opts.path || "/socket.io";
|
89799
|
+
_this.opts = opts;
|
89800
|
+
installTimerFunctions(_this, opts);
|
89801
|
+
_this.reconnection(opts.reconnection !== false);
|
89802
|
+
_this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
|
89803
|
+
_this.reconnectionDelay(opts.reconnectionDelay || 1e3);
|
89804
|
+
_this.reconnectionDelayMax(opts.reconnectionDelayMax || 5e3);
|
89805
|
+
_this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);
|
89810
89806
|
_this.backoff = new Backoff({
|
89811
89807
|
min: _this.reconnectionDelay(),
|
89812
89808
|
max: _this.reconnectionDelayMax(),
|
89813
89809
|
jitter: _this.randomizationFactor()
|
89814
89810
|
});
|
89815
|
-
_this.timeout(null ==
|
89811
|
+
_this.timeout(null == opts.timeout ? 2e4 : opts.timeout);
|
89816
89812
|
_this._readyState = "closed";
|
89817
89813
|
_this.uri = uri;
|
89818
|
-
var _parser =
|
89814
|
+
var _parser = opts.parser || esm_exports2;
|
89819
89815
|
_this.encoder = new _parser.Encoder();
|
89820
89816
|
_this.decoder = new _parser.Decoder();
|
89821
|
-
_this._autoConnect =
|
89817
|
+
_this._autoConnect = opts.autoConnect !== false;
|
89822
89818
|
if (_this._autoConnect) _this.open();
|
89823
89819
|
return _this;
|
89824
89820
|
}
|
@@ -90023,10 +90019,10 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
90023
90019
|
* @return {Socket}
|
90024
90020
|
* @public
|
90025
90021
|
*/ key: "socket",
|
90026
|
-
value: function socket(nsp,
|
90022
|
+
value: function socket(nsp, opts) {
|
90027
90023
|
var socket = this.nsps[nsp];
|
90028
90024
|
if (!socket) {
|
90029
|
-
socket = new Socket2(this, nsp,
|
90025
|
+
socket = new Socket2(this, nsp, opts);
|
90030
90026
|
this.nsps[nsp] = socket;
|
90031
90027
|
} else if (this._autoConnect && !socket.active) {
|
90032
90028
|
socket.connect();
|
@@ -90199,31 +90195,31 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
90199
90195
|
}(Emitter);
|
90200
90196
|
// node_modules/socket.io-client/build/esm/index.js
|
90201
90197
|
var cache = {};
|
90202
|
-
function lookup2(uri,
|
90198
|
+
function lookup2(uri, opts) {
|
90203
90199
|
if ((typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object") {
|
90204
|
-
|
90200
|
+
opts = uri;
|
90205
90201
|
uri = void 0;
|
90206
90202
|
}
|
90207
|
-
|
90208
|
-
var parsed = url(uri,
|
90203
|
+
opts = opts || {};
|
90204
|
+
var parsed = url(uri, opts.path || "/socket.io");
|
90209
90205
|
var source = parsed.source;
|
90210
90206
|
var id = parsed.id;
|
90211
90207
|
var path = parsed.path;
|
90212
90208
|
var sameNamespace = cache[id] && path in cache[id]["nsps"];
|
90213
|
-
var newConnection =
|
90209
|
+
var newConnection = opts.forceNew || opts["force new connection"] || false === opts.multiplex || sameNamespace;
|
90214
90210
|
var io;
|
90215
90211
|
if (newConnection) {
|
90216
|
-
io = new Manager(source,
|
90212
|
+
io = new Manager(source, opts);
|
90217
90213
|
} else {
|
90218
90214
|
if (!cache[id]) {
|
90219
|
-
cache[id] = new Manager(source,
|
90215
|
+
cache[id] = new Manager(source, opts);
|
90220
90216
|
}
|
90221
90217
|
io = cache[id];
|
90222
90218
|
}
|
90223
|
-
if (parsed.query && !
|
90224
|
-
|
90219
|
+
if (parsed.query && !opts.query) {
|
90220
|
+
opts.query = parsed.queryKey;
|
90225
90221
|
}
|
90226
|
-
return io.socket(parsed.path,
|
90222
|
+
return io.socket(parsed.path, opts);
|
90227
90223
|
}
|
90228
90224
|
Object.assign(lookup2, {
|
90229
90225
|
Manager: Manager,
|