@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.js
CHANGED
@@ -55202,18 +55202,18 @@ var BrowserClient = /*#__PURE__*/ function(BaseClient) {
|
|
55202
55202
|
function BrowserClient(options) {
|
55203
55203
|
_class_call_check(this, BrowserClient);
|
55204
55204
|
var _this;
|
55205
|
-
var
|
55205
|
+
var opts = _object_spread({
|
55206
55206
|
// We default this to true, as it is the safer scenario
|
55207
55207
|
parentSpanIsAlwaysRootSpan: true
|
55208
55208
|
}, options);
|
55209
55209
|
var sdkSource = WINDOW4.SENTRY_SDK_SOURCE || getSDKSource();
|
55210
|
-
applySdkMetadata(
|
55210
|
+
applySdkMetadata(opts, "browser", [
|
55211
55211
|
"browser"
|
55212
55212
|
], sdkSource);
|
55213
55213
|
_this = _call_super(this, BrowserClient, [
|
55214
|
-
|
55214
|
+
opts
|
55215
55215
|
]);
|
55216
|
-
if (
|
55216
|
+
if (opts.sendClientReports && WINDOW4.document) {
|
55217
55217
|
WINDOW4.document.addEventListener("visibilitychange", function() {
|
55218
55218
|
if (WINDOW4.document.visibilityState === "hidden") {
|
55219
55219
|
_this._flushOutcomes();
|
@@ -55347,7 +55347,7 @@ var initMetric = function(name, value2) {
|
|
55347
55347
|
};
|
55348
55348
|
};
|
55349
55349
|
// node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js
|
55350
|
-
var observe = function(type, callback,
|
55350
|
+
var observe = function(type, callback, opts) {
|
55351
55351
|
try {
|
55352
55352
|
if (PerformanceObserver.supportedEntryTypes.includes(type)) {
|
55353
55353
|
var po2 = new PerformanceObserver(function(list) {
|
@@ -55358,7 +55358,7 @@ var observe = function(type, callback, opts2) {
|
|
55358
55358
|
po2.observe(Object.assign({
|
55359
55359
|
type: type,
|
55360
55360
|
buffered: true
|
55361
|
-
},
|
55361
|
+
}, opts || {}));
|
55362
55362
|
return po2;
|
55363
55363
|
}
|
55364
55364
|
} catch (e2) {}
|
@@ -55432,7 +55432,7 @@ var FCPThresholds = [
|
|
55432
55432
|
3e3
|
55433
55433
|
];
|
55434
55434
|
var onFCP = function(onReport) {
|
55435
|
-
var
|
55435
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55436
55436
|
whenActivated(function() {
|
55437
55437
|
var visibilityWatcher = getVisibilityWatcher();
|
55438
55438
|
var metric = initMetric("FCP");
|
@@ -55451,7 +55451,7 @@ var onFCP = function(onReport) {
|
|
55451
55451
|
};
|
55452
55452
|
var po2 = observe("paint", handleEntries);
|
55453
55453
|
if (po2) {
|
55454
|
-
report = bindReporter(onReport, metric, FCPThresholds,
|
55454
|
+
report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges);
|
55455
55455
|
}
|
55456
55456
|
});
|
55457
55457
|
};
|
@@ -55461,7 +55461,7 @@ var CLSThresholds = [
|
|
55461
55461
|
0.25
|
55462
55462
|
];
|
55463
55463
|
var onCLS = function(onReport) {
|
55464
|
-
var
|
55464
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55465
55465
|
onFCP(runOnce(function() {
|
55466
55466
|
var metric = initMetric("CLS", 0);
|
55467
55467
|
var report;
|
@@ -55491,7 +55491,7 @@ var onCLS = function(onReport) {
|
|
55491
55491
|
};
|
55492
55492
|
var po2 = observe("layout-shift", handleEntries);
|
55493
55493
|
if (po2) {
|
55494
|
-
report = bindReporter(onReport, metric, CLSThresholds,
|
55494
|
+
report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges);
|
55495
55495
|
onHidden(function() {
|
55496
55496
|
handleEntries(po2.takeRecords());
|
55497
55497
|
report(true);
|
@@ -55506,7 +55506,7 @@ var FIDThresholds = [
|
|
55506
55506
|
300
|
55507
55507
|
];
|
55508
55508
|
var onFID = function(onReport) {
|
55509
|
-
var
|
55509
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55510
55510
|
whenActivated(function() {
|
55511
55511
|
var visibilityWatcher = getVisibilityWatcher();
|
55512
55512
|
var metric = initMetric("FID");
|
@@ -55522,7 +55522,7 @@ var onFID = function(onReport) {
|
|
55522
55522
|
entries.forEach(handleEntry);
|
55523
55523
|
};
|
55524
55524
|
var po2 = observe("first-input", handleEntries);
|
55525
|
-
report = bindReporter(onReport, metric, FIDThresholds,
|
55525
|
+
report = bindReporter(onReport, metric, FIDThresholds, opts.reportAllChanges);
|
55526
55526
|
if (po2) {
|
55527
55527
|
onHidden(runOnce(function() {
|
55528
55528
|
handleEntries(po2.takeRecords());
|
@@ -55627,7 +55627,7 @@ var INPThresholds = [
|
|
55627
55627
|
500
|
55628
55628
|
];
|
55629
55629
|
var onINP = function(onReport) {
|
55630
|
-
var
|
55630
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55631
55631
|
if (!("PerformanceEventTiming" in WINDOW5 && "interactionId" in PerformanceEventTiming.prototype)) {
|
55632
55632
|
return;
|
55633
55633
|
}
|
@@ -55653,9 +55653,9 @@ var onINP = function(onReport) {
|
|
55653
55653
|
// and performance. Running this callback for any interaction that spans
|
55654
55654
|
// just one or two frames is likely not worth the insight that could be
|
55655
55655
|
// gained.
|
55656
|
-
durationThreshold:
|
55656
|
+
durationThreshold: opts.durationThreshold != null ? opts.durationThreshold : DEFAULT_DURATION_THRESHOLD
|
55657
55657
|
});
|
55658
|
-
report = bindReporter(onReport, metric, INPThresholds,
|
55658
|
+
report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges);
|
55659
55659
|
if (po2) {
|
55660
55660
|
po2.observe({
|
55661
55661
|
type: "first-input",
|
@@ -55675,13 +55675,13 @@ var LCPThresholds = [
|
|
55675
55675
|
];
|
55676
55676
|
var reportedMetricIDs = {};
|
55677
55677
|
var onLCP = function(onReport) {
|
55678
|
-
var
|
55678
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55679
55679
|
whenActivated(function() {
|
55680
55680
|
var visibilityWatcher = getVisibilityWatcher();
|
55681
55681
|
var metric = initMetric("LCP");
|
55682
55682
|
var report;
|
55683
55683
|
var handleEntries = function(entries) {
|
55684
|
-
if (!
|
55684
|
+
if (!opts.reportAllChanges) {
|
55685
55685
|
entries = entries.slice(-1);
|
55686
55686
|
}
|
55687
55687
|
entries.forEach(function(entry) {
|
@@ -55696,7 +55696,7 @@ var onLCP = function(onReport) {
|
|
55696
55696
|
};
|
55697
55697
|
var po2 = observe("largest-contentful-paint", handleEntries);
|
55698
55698
|
if (po2) {
|
55699
|
-
report = bindReporter(onReport, metric, LCPThresholds,
|
55699
|
+
report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges);
|
55700
55700
|
var stopListening = runOnce(function() {
|
55701
55701
|
if (!reportedMetricIDs[metric.id]) {
|
55702
55702
|
handleEntries(po2.takeRecords());
|
@@ -55741,9 +55741,9 @@ var whenReady = function(callback) {
|
|
55741
55741
|
}
|
55742
55742
|
};
|
55743
55743
|
var onTTFB = function(onReport) {
|
55744
|
-
var
|
55744
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55745
55745
|
var metric = initMetric("TTFB");
|
55746
|
-
var report = bindReporter(onReport, metric, TTFBThresholds,
|
55746
|
+
var report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges);
|
55747
55747
|
whenReady(function() {
|
55748
55748
|
var navigationEntry = getNavigationEntry();
|
55749
55749
|
if (navigationEntry) {
|
@@ -62842,9 +62842,9 @@ function makeReplayLogger() {
|
|
62842
62842
|
infoTick: function() {
|
62843
62843
|
return void 0;
|
62844
62844
|
},
|
62845
|
-
setConfig: function(
|
62846
|
-
_capture =
|
62847
|
-
_trace =
|
62845
|
+
setConfig: function(opts) {
|
62846
|
+
_capture = opts.captureExceptions;
|
62847
|
+
_trace = opts.traceInternals;
|
62848
62848
|
}
|
62849
62849
|
};
|
62850
62850
|
if (DEBUG_BUILD5) {
|
@@ -69360,9 +69360,9 @@ var RegionMaskPlugin = /*#__PURE__*/ function() {
|
|
69360
69360
|
}();
|
69361
69361
|
// src/Ads/Regions/Plugins/Border/RegionBorderPlugin.ts
|
69362
69362
|
var RegionBorderPlugin = /*#__PURE__*/ function() {
|
69363
|
-
function RegionBorderPlugin(
|
69363
|
+
function RegionBorderPlugin(opts) {
|
69364
69364
|
_class_call_check(this, RegionBorderPlugin);
|
69365
|
-
this.options =
|
69365
|
+
this.options = opts;
|
69366
69366
|
}
|
69367
69367
|
_create_class(RegionBorderPlugin, [
|
69368
69368
|
{
|
@@ -69843,10 +69843,6 @@ var RULES = {
|
|
69843
69843
|
[
|
69844
69844
|
728,
|
69845
69845
|
90
|
69846
|
-
],
|
69847
|
-
[
|
69848
|
-
468,
|
69849
|
-
60
|
69850
69846
|
]
|
69851
69847
|
],
|
69852
69848
|
"desktop": [
|
@@ -72520,7 +72516,7 @@ var GPT = /*#__PURE__*/ function() {
|
|
72520
72516
|
},
|
72521
72517
|
{
|
72522
72518
|
key: "defineSlot",
|
72523
|
-
value: function defineSlot(slotId, size, containerId,
|
72519
|
+
value: function defineSlot(slotId, size, containerId, opts) {
|
72524
72520
|
window.googletag.cmd.push(function() {
|
72525
72521
|
if (window.googletag.pubads().getSlots().some(function(slot) {
|
72526
72522
|
return slot.getSlotElementId() === containerId;
|
@@ -72529,9 +72525,9 @@ var GPT = /*#__PURE__*/ function() {
|
|
72529
72525
|
}
|
72530
72526
|
var mrec1 = window.googletag.defineSlot(slotId, size, "".concat(containerId)).addService(window.googletag.pubads());
|
72531
72527
|
var mrecmapping;
|
72532
|
-
if (
|
72528
|
+
if (opts === null || opts === void 0 ? void 0 : opts.mapping) {
|
72533
72529
|
mrecmapping = window.googletag.sizeMapping();
|
72534
|
-
var sortedBreakpoints = Object.keys(
|
72530
|
+
var sortedBreakpoints = Object.keys(opts.mapping).sort(function(a, b) {
|
72535
72531
|
return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
|
72536
72532
|
});
|
72537
72533
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
@@ -72541,7 +72537,7 @@ var GPT = /*#__PURE__*/ function() {
|
|
72541
72537
|
mrecmapping = mrecmapping.addSize([
|
72542
72538
|
RegionDefinitions.BREAKPOINTS[bp],
|
72543
72539
|
0
|
72544
|
-
],
|
72540
|
+
], opts.mapping[bp]);
|
72545
72541
|
}
|
72546
72542
|
} catch (err) {
|
72547
72543
|
_didIteratorError = true;
|
@@ -72574,9 +72570,9 @@ var GPT = /*#__PURE__*/ function() {
|
|
72574
72570
|
], []).build();
|
72575
72571
|
}
|
72576
72572
|
mrec1 === null || mrec1 === void 0 ? void 0 : mrec1.defineSizeMapping(mrecmapping);
|
72577
|
-
if (
|
72573
|
+
if (opts === null || opts === void 0 ? void 0 : opts.targeting) {
|
72578
72574
|
mrec1.setConfig({
|
72579
|
-
targeting:
|
72575
|
+
targeting: opts === null || opts === void 0 ? void 0 : opts.targeting
|
72580
72576
|
});
|
72581
72577
|
}
|
72582
72578
|
});
|
@@ -72751,7 +72747,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
|
|
72751
72747
|
RegionDefinitions.BREAKPOINTS[bp],
|
72752
72748
|
0
|
72753
72749
|
],
|
72754
|
-
sizes:
|
72750
|
+
sizes: mapping[bp]
|
72755
72751
|
});
|
72756
72752
|
}
|
72757
72753
|
} catch (err) {
|
@@ -80598,7 +80594,7 @@ var CooldownPresentation = /*#__PURE__*/ function(AbstractPresentation) {
|
|
80598
80594
|
},
|
80599
80595
|
{
|
80600
80596
|
key: "startedPresentation",
|
80601
|
-
value: function startedPresentation(
|
80597
|
+
value: function startedPresentation(opts) {
|
80602
80598
|
this.stopRetry();
|
80603
80599
|
this.emit("pace");
|
80604
80600
|
this.presentationTimer.resume();
|
@@ -80832,11 +80828,11 @@ var DynamicDurationPresentation = /*#__PURE__*/ function(AbstractPresentation) {
|
|
80832
80828
|
},
|
80833
80829
|
{
|
80834
80830
|
key: "startedPresentation",
|
80835
|
-
value: function startedPresentation(
|
80831
|
+
value: function startedPresentation(opts) {
|
80836
80832
|
this.stopRetry();
|
80837
80833
|
this.startPacing();
|
80838
|
-
if (
|
80839
|
-
this.presentationTimer.setDuration(
|
80834
|
+
if (opts.expectedDuration && !this.presentationTimer.isPaused) {
|
80835
|
+
this.presentationTimer.setDuration(opts.expectedDuration * 1e3);
|
80840
80836
|
}
|
80841
80837
|
this.presentationTimer.resume();
|
80842
80838
|
}
|
@@ -86626,8 +86622,8 @@ function pick(obj) {
|
|
86626
86622
|
}
|
86627
86623
|
var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout;
|
86628
86624
|
var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
|
86629
|
-
function installTimerFunctions(obj,
|
86630
|
-
if (
|
86625
|
+
function installTimerFunctions(obj, opts) {
|
86626
|
+
if (opts.useNativeTimers) {
|
86631
86627
|
obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
|
86632
86628
|
obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
|
86633
86629
|
} else {
|
@@ -86700,16 +86696,16 @@ var TransportError = /*#__PURE__*/ function(Error1) {
|
|
86700
86696
|
}(_wrap_native_super(Error));
|
86701
86697
|
var Transport = /*#__PURE__*/ function(Emitter) {
|
86702
86698
|
_inherits(Transport, Emitter);
|
86703
|
-
function Transport(
|
86699
|
+
function Transport(opts) {
|
86704
86700
|
_class_call_check(this, Transport);
|
86705
86701
|
var _this;
|
86706
86702
|
_this = _call_super(this, Transport);
|
86707
86703
|
_this.writable = false;
|
86708
|
-
installTimerFunctions(_this,
|
86709
|
-
_this.opts =
|
86710
|
-
_this.query =
|
86711
|
-
_this.socket =
|
86712
|
-
_this.supportsBinary = !
|
86704
|
+
installTimerFunctions(_this, opts);
|
86705
|
+
_this.opts = opts;
|
86706
|
+
_this.query = opts.query;
|
86707
|
+
_this.socket = opts.socket;
|
86708
|
+
_this.supportsBinary = !opts.forceBase64;
|
86713
86709
|
return _this;
|
86714
86710
|
}
|
86715
86711
|
_create_class(Transport, [
|
@@ -87023,11 +87019,11 @@ var hasCORS = value;
|
|
87023
87019
|
function empty() {}
|
87024
87020
|
var BaseXHR = /*#__PURE__*/ function(Polling) {
|
87025
87021
|
_inherits(BaseXHR, Polling);
|
87026
|
-
function BaseXHR(
|
87022
|
+
function BaseXHR(opts) {
|
87027
87023
|
_class_call_check(this, BaseXHR);
|
87028
87024
|
var _this;
|
87029
87025
|
_this = _call_super(this, BaseXHR, [
|
87030
|
-
|
87026
|
+
opts
|
87031
87027
|
]);
|
87032
87028
|
if (typeof location !== "undefined") {
|
87033
87029
|
var isSSL = "https:" === location.protocol;
|
@@ -87035,7 +87031,7 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
|
|
87035
87031
|
if (!port) {
|
87036
87032
|
port = isSSL ? "443" : "80";
|
87037
87033
|
}
|
87038
|
-
_this.xd = typeof location !== "undefined" &&
|
87034
|
+
_this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port;
|
87039
87035
|
}
|
87040
87036
|
return _this;
|
87041
87037
|
}
|
@@ -87081,16 +87077,16 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
|
|
87081
87077
|
}(Polling);
|
87082
87078
|
var Request2 = /*#__PURE__*/ function(Emitter) {
|
87083
87079
|
_inherits(_Request, Emitter);
|
87084
|
-
function _Request(createRequest, uri,
|
87080
|
+
function _Request(createRequest, uri, opts) {
|
87085
87081
|
_class_call_check(this, _Request);
|
87086
87082
|
var _this;
|
87087
87083
|
_this = _call_super(this, _Request);
|
87088
87084
|
_this.createRequest = createRequest;
|
87089
|
-
installTimerFunctions(_this,
|
87090
|
-
_this._opts =
|
87091
|
-
_this._method =
|
87085
|
+
installTimerFunctions(_this, opts);
|
87086
|
+
_this._opts = opts;
|
87087
|
+
_this._method = opts.method || "GET";
|
87092
87088
|
_this._uri = uri;
|
87093
|
-
_this._data = void 0 !==
|
87089
|
+
_this._data = void 0 !== opts.data ? opts.data : null;
|
87094
87090
|
_this._create();
|
87095
87091
|
return _this;
|
87096
87092
|
}
|
@@ -87104,9 +87100,9 @@ var Request2 = /*#__PURE__*/ function(Emitter) {
|
|
87104
87100
|
value: function _create() {
|
87105
87101
|
var _this = this;
|
87106
87102
|
var _a;
|
87107
|
-
var
|
87108
|
-
|
87109
|
-
var xhr = this._xhr = this.createRequest(
|
87103
|
+
var opts = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
|
87104
|
+
opts.xdomain = !!this._opts.xd;
|
87105
|
+
var xhr = this._xhr = this.createRequest(opts);
|
87110
87106
|
try {
|
87111
87107
|
xhr.open(this._method, this._uri, true);
|
87112
87108
|
try {
|
@@ -87248,13 +87244,13 @@ var hasXHR2 = function() {
|
|
87248
87244
|
}();
|
87249
87245
|
var XHR = /*#__PURE__*/ function(BaseXHR) {
|
87250
87246
|
_inherits(XHR, BaseXHR);
|
87251
|
-
function XHR(
|
87247
|
+
function XHR(opts) {
|
87252
87248
|
_class_call_check(this, XHR);
|
87253
87249
|
var _this;
|
87254
87250
|
_this = _call_super(this, XHR, [
|
87255
|
-
|
87251
|
+
opts
|
87256
87252
|
]);
|
87257
|
-
var forceBase64 =
|
87253
|
+
var forceBase64 = opts && opts.forceBase64;
|
87258
87254
|
_this.supportsBinary = hasXHR2 && !forceBase64;
|
87259
87255
|
return _this;
|
87260
87256
|
}
|
@@ -87262,18 +87258,18 @@ var XHR = /*#__PURE__*/ function(BaseXHR) {
|
|
87262
87258
|
{
|
87263
87259
|
key: "request",
|
87264
87260
|
value: function request() {
|
87265
|
-
var
|
87266
|
-
Object.assign(
|
87261
|
+
var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
87262
|
+
Object.assign(opts, {
|
87267
87263
|
xd: this.xd
|
87268
87264
|
}, this.opts);
|
87269
|
-
return new Request2(newRequest, this.uri(),
|
87265
|
+
return new Request2(newRequest, this.uri(), opts);
|
87270
87266
|
}
|
87271
87267
|
}
|
87272
87268
|
]);
|
87273
87269
|
return XHR;
|
87274
87270
|
}(BaseXHR);
|
87275
|
-
function newRequest(
|
87276
|
-
var xdomain =
|
87271
|
+
function newRequest(opts) {
|
87272
|
+
var xdomain = opts.xdomain;
|
87277
87273
|
try {
|
87278
87274
|
if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
|
87279
87275
|
return new XMLHttpRequest();
|
@@ -87307,12 +87303,12 @@ var BaseWS = /*#__PURE__*/ function(Transport) {
|
|
87307
87303
|
value: function doOpen() {
|
87308
87304
|
var uri = this.uri();
|
87309
87305
|
var protocols = this.opts.protocols;
|
87310
|
-
var
|
87306
|
+
var opts = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
|
87311
87307
|
if (this.opts.extraHeaders) {
|
87312
|
-
|
87308
|
+
opts.headers = this.opts.extraHeaders;
|
87313
87309
|
}
|
87314
87310
|
try {
|
87315
|
-
this.ws = this.createSocket(uri, protocols,
|
87311
|
+
this.ws = this.createSocket(uri, protocols, opts);
|
87316
87312
|
} catch (err) {
|
87317
87313
|
return this.emitReserved("error", err);
|
87318
87314
|
}
|
@@ -87412,8 +87408,8 @@ var WS = /*#__PURE__*/ function(BaseWS) {
|
|
87412
87408
|
_create_class(WS, [
|
87413
87409
|
{
|
87414
87410
|
key: "createSocket",
|
87415
|
-
value: function createSocket(uri, protocols,
|
87416
|
-
return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols,
|
87411
|
+
value: function createSocket(uri, protocols, opts) {
|
87412
|
+
return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols, opts);
|
87417
87413
|
}
|
87418
87414
|
},
|
87419
87415
|
{
|
@@ -87591,7 +87587,7 @@ if (withEventListeners) {
|
|
87591
87587
|
}
|
87592
87588
|
var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
87593
87589
|
_inherits(_SocketWithoutUpgrade, Emitter);
|
87594
|
-
function _SocketWithoutUpgrade(uri,
|
87590
|
+
function _SocketWithoutUpgrade(uri, opts) {
|
87595
87591
|
_class_call_check(this, _SocketWithoutUpgrade);
|
87596
87592
|
var _this;
|
87597
87593
|
_this = _call_super(this, _SocketWithoutUpgrade);
|
@@ -87603,28 +87599,28 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87603
87599
|
_this._maxPayload = -1;
|
87604
87600
|
_this._pingTimeoutTime = Infinity;
|
87605
87601
|
if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
|
87606
|
-
|
87602
|
+
opts = uri;
|
87607
87603
|
uri = null;
|
87608
87604
|
}
|
87609
87605
|
if (uri) {
|
87610
87606
|
var parsedUri = parse2(uri);
|
87611
|
-
|
87612
|
-
|
87613
|
-
|
87614
|
-
if (parsedUri.query)
|
87615
|
-
} else if (
|
87616
|
-
|
87617
|
-
}
|
87618
|
-
installTimerFunctions(_this,
|
87619
|
-
_this.secure = null !=
|
87620
|
-
if (
|
87621
|
-
|
87622
|
-
}
|
87623
|
-
_this.hostname =
|
87624
|
-
_this.port =
|
87607
|
+
opts.hostname = parsedUri.host;
|
87608
|
+
opts.secure = parsedUri.protocol === "https" || parsedUri.protocol === "wss";
|
87609
|
+
opts.port = parsedUri.port;
|
87610
|
+
if (parsedUri.query) opts.query = parsedUri.query;
|
87611
|
+
} else if (opts.host) {
|
87612
|
+
opts.hostname = parse2(opts.host).host;
|
87613
|
+
}
|
87614
|
+
installTimerFunctions(_this, opts);
|
87615
|
+
_this.secure = null != opts.secure ? opts.secure : typeof location !== "undefined" && "https:" === location.protocol;
|
87616
|
+
if (opts.hostname && !opts.port) {
|
87617
|
+
opts.port = _this.secure ? "443" : "80";
|
87618
|
+
}
|
87619
|
+
_this.hostname = opts.hostname || (typeof location !== "undefined" ? location.hostname : "localhost");
|
87620
|
+
_this.port = opts.port || (typeof location !== "undefined" && location.port ? location.port : _this.secure ? "443" : "80");
|
87625
87621
|
_this.transports = [];
|
87626
87622
|
_this._transportsByName = {};
|
87627
|
-
|
87623
|
+
opts.transports.forEach(function(t2) {
|
87628
87624
|
var transportName = t2.prototype.name;
|
87629
87625
|
_this.transports.push(transportName);
|
87630
87626
|
_this._transportsByName[transportName] = t2;
|
@@ -87643,7 +87639,7 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87643
87639
|
},
|
87644
87640
|
transportOptions: {},
|
87645
87641
|
closeOnBeforeunload: false
|
87646
|
-
},
|
87642
|
+
}, opts);
|
87647
87643
|
_this.opts.path = _this.opts.path.replace(/\/$/, "") + (_this.opts.addTrailingSlash ? "/" : "");
|
87648
87644
|
if (typeof _this.opts.query === "string") {
|
87649
87645
|
_this.opts.query = decode2(_this.opts.query);
|
@@ -87687,14 +87683,14 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87687
87683
|
query.EIO = protocol;
|
87688
87684
|
query.transport = name;
|
87689
87685
|
if (this.id) query.sid = this.id;
|
87690
|
-
var
|
87686
|
+
var opts = Object.assign({}, this.opts, {
|
87691
87687
|
query: query,
|
87692
87688
|
socket: this,
|
87693
87689
|
hostname: this.hostname,
|
87694
87690
|
secure: this.secure,
|
87695
87691
|
port: this.port
|
87696
87692
|
}, this.opts.transportOptions[name]);
|
87697
|
-
return new this._transportsByName[name](
|
87693
|
+
return new this._transportsByName[name](opts);
|
87698
87694
|
}
|
87699
87695
|
},
|
87700
87696
|
{
|
@@ -88196,9 +88192,9 @@ var SocketWithUpgrade = /*#__PURE__*/ function(SocketWithoutUpgrade1) {
|
|
88196
88192
|
var Socket = /*#__PURE__*/ function(SocketWithUpgrade) {
|
88197
88193
|
_inherits(Socket, SocketWithUpgrade);
|
88198
88194
|
function Socket(uri) {
|
88199
|
-
var
|
88195
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
88200
88196
|
_class_call_check(this, Socket);
|
88201
|
-
var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri :
|
88197
|
+
var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri : opts;
|
88202
88198
|
if (!o2.transports || o2.transports && typeof o2.transports[0] === "string") {
|
88203
88199
|
o2.transports = (o2.transports || [
|
88204
88200
|
"polling",
|
@@ -88672,7 +88668,7 @@ var RESERVED_EVENTS2 = Object.freeze({
|
|
88672
88668
|
});
|
88673
88669
|
var Socket2 = /*#__PURE__*/ function(Emitter) {
|
88674
88670
|
_inherits(Socket2, Emitter);
|
88675
|
-
function Socket2(io, nsp,
|
88671
|
+
function Socket2(io, nsp, opts) {
|
88676
88672
|
_class_call_check(this, Socket2);
|
88677
88673
|
var _this;
|
88678
88674
|
_this = _call_super(this, Socket2);
|
@@ -88687,10 +88683,10 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
|
|
88687
88683
|
_this.flags = {};
|
88688
88684
|
_this.io = io;
|
88689
88685
|
_this.nsp = nsp;
|
88690
|
-
if (
|
88691
|
-
_this.auth =
|
88686
|
+
if (opts && opts.auth) {
|
88687
|
+
_this.auth = opts.auth;
|
88692
88688
|
}
|
88693
|
-
_this._opts = Object.assign({},
|
88689
|
+
_this._opts = Object.assign({}, opts);
|
88694
88690
|
if (_this.io._autoConnect) _this.open();
|
88695
88691
|
return _this;
|
88696
88692
|
}
|
@@ -89588,12 +89584,12 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
|
|
89588
89584
|
return Socket2;
|
89589
89585
|
}(Emitter);
|
89590
89586
|
// node_modules/socket.io-client/build/esm/contrib/backo2.js
|
89591
|
-
function Backoff(
|
89592
|
-
|
89593
|
-
this.ms =
|
89594
|
-
this.max =
|
89595
|
-
this.factor =
|
89596
|
-
this.jitter =
|
89587
|
+
function Backoff(opts) {
|
89588
|
+
opts = opts || {};
|
89589
|
+
this.ms = opts.min || 100;
|
89590
|
+
this.max = opts.max || 1e4;
|
89591
|
+
this.factor = opts.factor || 2;
|
89592
|
+
this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
|
89597
89593
|
this.attempts = 0;
|
89598
89594
|
}
|
89599
89595
|
Backoff.prototype.duration = function() {
|
@@ -89620,7 +89616,7 @@ Backoff.prototype.setJitter = function(jitter) {
|
|
89620
89616
|
// node_modules/socket.io-client/build/esm/manager.js
|
89621
89617
|
var Manager = /*#__PURE__*/ function(Emitter) {
|
89622
89618
|
_inherits(Manager, Emitter);
|
89623
|
-
function Manager(uri,
|
89619
|
+
function Manager(uri, opts) {
|
89624
89620
|
_class_call_check(this, Manager);
|
89625
89621
|
var _this;
|
89626
89622
|
var _a;
|
@@ -89628,30 +89624,30 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
89628
89624
|
_this.nsps = {};
|
89629
89625
|
_this.subs = [];
|
89630
89626
|
if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
|
89631
|
-
|
89627
|
+
opts = uri;
|
89632
89628
|
uri = void 0;
|
89633
89629
|
}
|
89634
|
-
|
89635
|
-
|
89636
|
-
_this.opts =
|
89637
|
-
installTimerFunctions(_this,
|
89638
|
-
_this.reconnection(
|
89639
|
-
_this.reconnectionAttempts(
|
89640
|
-
_this.reconnectionDelay(
|
89641
|
-
_this.reconnectionDelayMax(
|
89642
|
-
_this.randomizationFactor((_a =
|
89630
|
+
opts = opts || {};
|
89631
|
+
opts.path = opts.path || "/socket.io";
|
89632
|
+
_this.opts = opts;
|
89633
|
+
installTimerFunctions(_this, opts);
|
89634
|
+
_this.reconnection(opts.reconnection !== false);
|
89635
|
+
_this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
|
89636
|
+
_this.reconnectionDelay(opts.reconnectionDelay || 1e3);
|
89637
|
+
_this.reconnectionDelayMax(opts.reconnectionDelayMax || 5e3);
|
89638
|
+
_this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);
|
89643
89639
|
_this.backoff = new Backoff({
|
89644
89640
|
min: _this.reconnectionDelay(),
|
89645
89641
|
max: _this.reconnectionDelayMax(),
|
89646
89642
|
jitter: _this.randomizationFactor()
|
89647
89643
|
});
|
89648
|
-
_this.timeout(null ==
|
89644
|
+
_this.timeout(null == opts.timeout ? 2e4 : opts.timeout);
|
89649
89645
|
_this._readyState = "closed";
|
89650
89646
|
_this.uri = uri;
|
89651
|
-
var _parser =
|
89647
|
+
var _parser = opts.parser || esm_exports2;
|
89652
89648
|
_this.encoder = new _parser.Encoder();
|
89653
89649
|
_this.decoder = new _parser.Decoder();
|
89654
|
-
_this._autoConnect =
|
89650
|
+
_this._autoConnect = opts.autoConnect !== false;
|
89655
89651
|
if (_this._autoConnect) _this.open();
|
89656
89652
|
return _this;
|
89657
89653
|
}
|
@@ -89856,10 +89852,10 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
89856
89852
|
* @return {Socket}
|
89857
89853
|
* @public
|
89858
89854
|
*/ key: "socket",
|
89859
|
-
value: function socket(nsp,
|
89855
|
+
value: function socket(nsp, opts) {
|
89860
89856
|
var socket = this.nsps[nsp];
|
89861
89857
|
if (!socket) {
|
89862
|
-
socket = new Socket2(this, nsp,
|
89858
|
+
socket = new Socket2(this, nsp, opts);
|
89863
89859
|
this.nsps[nsp] = socket;
|
89864
89860
|
} else if (this._autoConnect && !socket.active) {
|
89865
89861
|
socket.connect();
|
@@ -90032,31 +90028,31 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
90032
90028
|
}(Emitter);
|
90033
90029
|
// node_modules/socket.io-client/build/esm/index.js
|
90034
90030
|
var cache = {};
|
90035
|
-
function lookup2(uri,
|
90031
|
+
function lookup2(uri, opts) {
|
90036
90032
|
if ((typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object") {
|
90037
|
-
|
90033
|
+
opts = uri;
|
90038
90034
|
uri = void 0;
|
90039
90035
|
}
|
90040
|
-
|
90041
|
-
var parsed = url(uri,
|
90036
|
+
opts = opts || {};
|
90037
|
+
var parsed = url(uri, opts.path || "/socket.io");
|
90042
90038
|
var source = parsed.source;
|
90043
90039
|
var id = parsed.id;
|
90044
90040
|
var path = parsed.path;
|
90045
90041
|
var sameNamespace = cache[id] && path in cache[id]["nsps"];
|
90046
|
-
var newConnection =
|
90042
|
+
var newConnection = opts.forceNew || opts["force new connection"] || false === opts.multiplex || sameNamespace;
|
90047
90043
|
var io;
|
90048
90044
|
if (newConnection) {
|
90049
|
-
io = new Manager(source,
|
90045
|
+
io = new Manager(source, opts);
|
90050
90046
|
} else {
|
90051
90047
|
if (!cache[id]) {
|
90052
|
-
cache[id] = new Manager(source,
|
90048
|
+
cache[id] = new Manager(source, opts);
|
90053
90049
|
}
|
90054
90050
|
io = cache[id];
|
90055
90051
|
}
|
90056
|
-
if (parsed.query && !
|
90057
|
-
|
90052
|
+
if (parsed.query && !opts.query) {
|
90053
|
+
opts.query = parsed.queryKey;
|
90058
90054
|
}
|
90059
|
-
return io.socket(parsed.path,
|
90055
|
+
return io.socket(parsed.path, opts);
|
90060
90056
|
}
|
90061
90057
|
Object.assign(lookup2, {
|
90062
90058
|
Manager: Manager,
|