@bentolabs/sdk 2.0.2 → 2.0.3
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.browser.js +676 -372
- package/dist/index.browser.js.map +4 -4
- package/dist/index.browser.min.js +23 -23
- package/dist/index.browser.min.js.map +4 -4
- package/dist/index.d.ts +15 -0
- package/dist/index.js +683 -399
- package/dist/index.js.map +4 -4
- package/package.json +4 -1
package/dist/index.browser.js
CHANGED
|
@@ -9,18 +9,18 @@ var BentoLabsSDKModule = (() => {
|
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
10
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
11
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (
|
|
13
|
-
for (var prop in
|
|
14
|
-
if (__hasOwnProp.call(
|
|
15
|
-
__defNormalProp(
|
|
12
|
+
var __spreadValues = (a2, b2) => {
|
|
13
|
+
for (var prop in b2 || (b2 = {}))
|
|
14
|
+
if (__hasOwnProp.call(b2, prop))
|
|
15
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
16
16
|
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(
|
|
18
|
-
if (__propIsEnum.call(
|
|
19
|
-
__defNormalProp(
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b2)) {
|
|
18
|
+
if (__propIsEnum.call(b2, prop))
|
|
19
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
20
20
|
}
|
|
21
|
-
return
|
|
21
|
+
return a2;
|
|
22
22
|
};
|
|
23
|
-
var __spreadProps = (
|
|
23
|
+
var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
|
|
24
24
|
var __objRest = (source, exclude) => {
|
|
25
25
|
var target = {};
|
|
26
26
|
for (var prop in source)
|
|
@@ -136,7 +136,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
136
136
|
document.body.removeChild(iframeEl);
|
|
137
137
|
if (!untaintedObject) return defaultPrototype;
|
|
138
138
|
return untaintedBasePrototype$1[key] = untaintedObject;
|
|
139
|
-
} catch (
|
|
139
|
+
} catch (e3) {
|
|
140
140
|
return defaultPrototype;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -232,7 +232,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
232
232
|
return () => {
|
|
233
233
|
source[name] = original;
|
|
234
234
|
};
|
|
235
|
-
} catch (
|
|
235
|
+
} catch (e3) {
|
|
236
236
|
return () => {
|
|
237
237
|
};
|
|
238
238
|
}
|
|
@@ -435,18 +435,18 @@ var BentoLabsSDKModule = (() => {
|
|
|
435
435
|
const ctx = canvas.getContext("2d");
|
|
436
436
|
if (!ctx) return true;
|
|
437
437
|
const chunkSize = 50;
|
|
438
|
-
for (let
|
|
439
|
-
for (let
|
|
438
|
+
for (let x22 = 0; x22 < canvas.width; x22 += chunkSize) {
|
|
439
|
+
for (let y2 = 0; y2 < canvas.height; y2 += chunkSize) {
|
|
440
440
|
const getImageData = ctx.getImageData;
|
|
441
441
|
const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData ? getImageData[ORIGINAL_ATTRIBUTE_NAME] : getImageData;
|
|
442
442
|
const pixelBuffer = new Uint32Array(
|
|
443
443
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
|
444
444
|
originalGetImageData.call(
|
|
445
445
|
ctx,
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
Math.min(chunkSize, canvas.width -
|
|
449
|
-
Math.min(chunkSize, canvas.height -
|
|
446
|
+
x22,
|
|
447
|
+
y2,
|
|
448
|
+
Math.min(chunkSize, canvas.width - x22),
|
|
449
|
+
Math.min(chunkSize, canvas.height - y2)
|
|
450
450
|
).data.buffer
|
|
451
451
|
);
|
|
452
452
|
if (pixelBuffer.some((pixel) => pixel !== 0)) return false;
|
|
@@ -542,19 +542,19 @@ var BentoLabsSDKModule = (() => {
|
|
|
542
542
|
_testNoPxNorm
|
|
543
543
|
);
|
|
544
544
|
const jLimit = 100;
|
|
545
|
-
let
|
|
546
|
-
for (;
|
|
545
|
+
let j2 = 3;
|
|
546
|
+
for (; j2 < textContentNorm.length; j2++) {
|
|
547
547
|
if (
|
|
548
548
|
// keep consuming css identifiers (to get a decent chunk more quickly)
|
|
549
|
-
textContentNorm[
|
|
550
|
-
textContentNorm.indexOf(textContentNorm.substring(0,
|
|
549
|
+
textContentNorm[j2].match(/[a-zA-Z0-9]/) || // substring needs to be unique to this section
|
|
550
|
+
textContentNorm.indexOf(textContentNorm.substring(0, j2), 1) !== -1
|
|
551
551
|
) {
|
|
552
552
|
continue;
|
|
553
553
|
}
|
|
554
554
|
break;
|
|
555
555
|
}
|
|
556
|
-
for (;
|
|
557
|
-
let startSubstring = textContentNorm.substring(0,
|
|
556
|
+
for (; j2 < textContentNorm.length; j2++) {
|
|
557
|
+
let startSubstring = textContentNorm.substring(0, j2);
|
|
558
558
|
let cssNormSplits = cssTextNorm.split(startSubstring);
|
|
559
559
|
let splitNorm = -1;
|
|
560
560
|
if (cssNormSplits.length === 2) {
|
|
@@ -571,11 +571,11 @@ var BentoLabsSDKModule = (() => {
|
|
|
571
571
|
splits.push(cssText);
|
|
572
572
|
return splits;
|
|
573
573
|
}
|
|
574
|
-
|
|
575
|
-
} else if (
|
|
574
|
+
j2 = jLimit + 1;
|
|
575
|
+
} else if (j2 === textContentNorm.length - 1) {
|
|
576
576
|
splitNorm = cssTextNorm.indexOf(startSubstring);
|
|
577
577
|
}
|
|
578
|
-
if (cssNormSplits.length >= 2 &&
|
|
578
|
+
if (cssNormSplits.length >= 2 && j2 > jLimit) {
|
|
579
579
|
const prevTextContent = childNodes2[i2 - 1].textContent;
|
|
580
580
|
if (prevTextContent && typeof prevTextContent === "string") {
|
|
581
581
|
const prevMinLength = normalizeCssString(prevTextContent).length;
|
|
@@ -586,29 +586,29 @@ var BentoLabsSDKModule = (() => {
|
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
588
|
if (splitNorm !== -1) {
|
|
589
|
-
let
|
|
590
|
-
for (;
|
|
589
|
+
let k2 = Math.floor(splitNorm / normFactor);
|
|
590
|
+
for (; k2 > 0 && k2 < cssText.length; ) {
|
|
591
591
|
iterCount += 1;
|
|
592
592
|
if (iterCount > 50 * childNodes2.length) {
|
|
593
593
|
splits.push(cssText);
|
|
594
594
|
return splits;
|
|
595
595
|
}
|
|
596
596
|
const normPart = normalizeCssString(
|
|
597
|
-
cssText.substring(0,
|
|
597
|
+
cssText.substring(0, k2),
|
|
598
598
|
_testNoPxNorm
|
|
599
599
|
);
|
|
600
600
|
if (normPart.length === splitNorm) {
|
|
601
|
-
splits.push(cssText.substring(0,
|
|
602
|
-
cssText = cssText.substring(
|
|
601
|
+
splits.push(cssText.substring(0, k2));
|
|
602
|
+
cssText = cssText.substring(k2);
|
|
603
603
|
cssTextNorm = cssTextNorm.substring(splitNorm);
|
|
604
604
|
break;
|
|
605
605
|
} else if (normPart.length < splitNorm) {
|
|
606
|
-
|
|
606
|
+
k2 += Math.max(
|
|
607
607
|
1,
|
|
608
608
|
Math.floor((splitNorm - normPart.length) / normFactor)
|
|
609
609
|
);
|
|
610
610
|
} else {
|
|
611
|
-
|
|
611
|
+
k2 -= Math.max(
|
|
612
612
|
1,
|
|
613
613
|
Math.floor((normPart.length - splitNorm) * normFactor)
|
|
614
614
|
);
|
|
@@ -763,7 +763,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
763
763
|
if (blockSelector) {
|
|
764
764
|
return element.matches(blockSelector);
|
|
765
765
|
}
|
|
766
|
-
} catch (
|
|
766
|
+
} catch (e22) {
|
|
767
767
|
}
|
|
768
768
|
return false;
|
|
769
769
|
}
|
|
@@ -811,7 +811,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
811
811
|
if (el.matches(maskTextSelector)) return true;
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
} catch (
|
|
814
|
+
} catch (e22) {
|
|
815
815
|
}
|
|
816
816
|
return false;
|
|
817
817
|
}
|
|
@@ -1157,7 +1157,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
1157
1157
|
let isCustomElement;
|
|
1158
1158
|
try {
|
|
1159
1159
|
if (customElements.get(tagName)) isCustomElement = true;
|
|
1160
|
-
} catch (
|
|
1160
|
+
} catch (e22) {
|
|
1161
1161
|
}
|
|
1162
1162
|
return {
|
|
1163
1163
|
type: NodeType$3.Element,
|
|
@@ -1527,8 +1527,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
1527
1527
|
}
|
|
1528
1528
|
var MEDIA_SELECTOR = /(max|min)-device-(width|height)/;
|
|
1529
1529
|
var MEDIA_SELECTOR_GLOBAL = new RegExp(MEDIA_SELECTOR.source, "g");
|
|
1530
|
-
function getDefaultExportFromCjs$1(
|
|
1531
|
-
return
|
|
1530
|
+
function getDefaultExportFromCjs$1(x22) {
|
|
1531
|
+
return x22 && x22.__esModule && Object.prototype.hasOwnProperty.call(x22, "default") ? x22["default"] : x22;
|
|
1532
1532
|
}
|
|
1533
1533
|
function getAugmentedNamespace$1(n2) {
|
|
1534
1534
|
if (n2.__esModule) return n2;
|
|
@@ -1543,12 +1543,12 @@ var BentoLabsSDKModule = (() => {
|
|
|
1543
1543
|
a2.prototype = f2.prototype;
|
|
1544
1544
|
} else a2 = {};
|
|
1545
1545
|
Object.defineProperty(a2, "__esModule", { value: true });
|
|
1546
|
-
Object.keys(n2).forEach(function(
|
|
1547
|
-
var
|
|
1548
|
-
Object.defineProperty(a2,
|
|
1546
|
+
Object.keys(n2).forEach(function(k2) {
|
|
1547
|
+
var d2 = Object.getOwnPropertyDescriptor(n2, k2);
|
|
1548
|
+
Object.defineProperty(a2, k2, d2.get ? d2 : {
|
|
1549
1549
|
enumerable: true,
|
|
1550
1550
|
get: function() {
|
|
1551
|
-
return n2[
|
|
1551
|
+
return n2[k2];
|
|
1552
1552
|
}
|
|
1553
1553
|
});
|
|
1554
1554
|
});
|
|
@@ -1896,8 +1896,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
1896
1896
|
if (root2.raws.indent) return root2.raws.indent;
|
|
1897
1897
|
let value;
|
|
1898
1898
|
root2.walk((i2) => {
|
|
1899
|
-
let
|
|
1900
|
-
if (
|
|
1899
|
+
let p2 = i2.parent;
|
|
1900
|
+
if (p2 && p2 !== root2 && p2.parent && p2.parent === root2) {
|
|
1901
1901
|
if (typeof i2.raws.before !== "undefined") {
|
|
1902
1902
|
let parts = i2.raws.before.split("\n");
|
|
1903
1903
|
value = parts[parts.length - 1];
|
|
@@ -1972,7 +1972,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
1972
1972
|
} else if (i2 === "source") {
|
|
1973
1973
|
cloned[i2] = value;
|
|
1974
1974
|
} else if (Array.isArray(value)) {
|
|
1975
|
-
cloned[i2] = value.map((
|
|
1975
|
+
cloned[i2] = value.map((j2) => cloneNode$1(j2, cloned));
|
|
1976
1976
|
} else {
|
|
1977
1977
|
if (type === "object" && value !== null) value = cloneNode$1(value);
|
|
1978
1978
|
cloned[i2] = value;
|
|
@@ -2207,7 +2207,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
2207
2207
|
}
|
|
2208
2208
|
return result2;
|
|
2209
2209
|
}
|
|
2210
|
-
toJSON(
|
|
2210
|
+
toJSON(_2, inputs) {
|
|
2211
2211
|
let fixed = {};
|
|
2212
2212
|
let emitInputs = inputs == null;
|
|
2213
2213
|
inputs = inputs || /* @__PURE__ */ new Map();
|
|
@@ -2768,9 +2768,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
2768
2768
|
column += str.length;
|
|
2769
2769
|
}
|
|
2770
2770
|
if (node2 && type !== "start") {
|
|
2771
|
-
let
|
|
2771
|
+
let p2 = node2.parent || { raws: {} };
|
|
2772
2772
|
let childless = node2.type === "decl" || node2.type === "atrule" && !node2.nodes;
|
|
2773
|
-
if (!childless || node2 !==
|
|
2773
|
+
if (!childless || node2 !== p2.last || p2.raws.semicolon) {
|
|
2774
2774
|
if (node2.source && node2.source.end) {
|
|
2775
2775
|
mapping.source = this.sourcePath(node2);
|
|
2776
2776
|
mapping.original.line = node2.source.end.line;
|
|
@@ -3189,8 +3189,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
3189
3189
|
let result2;
|
|
3190
3190
|
try {
|
|
3191
3191
|
result2 = callback(child, i2);
|
|
3192
|
-
} catch (
|
|
3193
|
-
throw child.addToError(
|
|
3192
|
+
} catch (e22) {
|
|
3193
|
+
throw child.addToError(e22);
|
|
3194
3194
|
}
|
|
3195
3195
|
if (result2 !== false && child.walk) {
|
|
3196
3196
|
result2 = child.walk(callback);
|
|
@@ -3849,8 +3849,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
3849
3849
|
if (colon === false) return;
|
|
3850
3850
|
let founded = 0;
|
|
3851
3851
|
let token;
|
|
3852
|
-
for (let
|
|
3853
|
-
token = tokens[
|
|
3852
|
+
for (let j2 = colon - 1; j2 >= 0; j2--) {
|
|
3853
|
+
token = tokens[j2];
|
|
3854
3854
|
if (token[0] !== "space") {
|
|
3855
3855
|
founded += 1;
|
|
3856
3856
|
if (founded === 2) break;
|
|
@@ -3968,8 +3968,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
3968
3968
|
} else if (token[1].toLowerCase() === "important") {
|
|
3969
3969
|
let cache = tokens.slice(0);
|
|
3970
3970
|
let str = "";
|
|
3971
|
-
for (let
|
|
3972
|
-
let type = cache[
|
|
3971
|
+
for (let j2 = i2; j2 > 0; j2--) {
|
|
3972
|
+
let type = cache[j2][0];
|
|
3973
3973
|
if (str.trim().indexOf("!") === 0 && type !== "space") {
|
|
3974
3974
|
break;
|
|
3975
3975
|
}
|
|
@@ -4272,19 +4272,19 @@ var BentoLabsSDKModule = (() => {
|
|
|
4272
4272
|
let parser2 = new Parser2$1(input2);
|
|
4273
4273
|
try {
|
|
4274
4274
|
parser2.parse();
|
|
4275
|
-
} catch (
|
|
4275
|
+
} catch (e22) {
|
|
4276
4276
|
if (false) {
|
|
4277
|
-
if (
|
|
4277
|
+
if (e22.name === "CssSyntaxError" && opts && opts.from) {
|
|
4278
4278
|
if (/\.scss$/i.test(opts.from)) {
|
|
4279
|
-
|
|
4279
|
+
e22.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser";
|
|
4280
4280
|
} else if (/\.sass/i.test(opts.from)) {
|
|
4281
|
-
|
|
4281
|
+
e22.message += "\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser";
|
|
4282
4282
|
} else if (/\.less$/i.test(opts.from)) {
|
|
4283
|
-
|
|
4283
|
+
e22.message += "\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser";
|
|
4284
4284
|
}
|
|
4285
4285
|
}
|
|
4286
4286
|
}
|
|
4287
|
-
throw
|
|
4287
|
+
throw e22;
|
|
4288
4288
|
}
|
|
4289
4289
|
return parser2.root;
|
|
4290
4290
|
}
|
|
@@ -4452,8 +4452,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
4452
4452
|
let pluginVer = plugin22.postcssVersion;
|
|
4453
4453
|
let runtimeVer = this.result.processor.version;
|
|
4454
4454
|
let a2 = pluginVer.split(".");
|
|
4455
|
-
let
|
|
4456
|
-
if (a2[0] !==
|
|
4455
|
+
let b2 = runtimeVer.split(".");
|
|
4456
|
+
if (a2[0] !== b2[0] || parseInt(a2[1]) > parseInt(b2[1])) {
|
|
4457
4457
|
console.error(
|
|
4458
4458
|
"Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below."
|
|
4459
4459
|
);
|
|
@@ -4525,9 +4525,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
4525
4525
|
if (isPromise$1(promise)) {
|
|
4526
4526
|
try {
|
|
4527
4527
|
await promise;
|
|
4528
|
-
} catch (
|
|
4528
|
+
} catch (e22) {
|
|
4529
4529
|
let node2 = stack[stack.length - 1].node;
|
|
4530
|
-
throw this.handleError(
|
|
4530
|
+
throw this.handleError(e22, node2);
|
|
4531
4531
|
}
|
|
4532
4532
|
}
|
|
4533
4533
|
}
|
|
@@ -4544,8 +4544,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
4544
4544
|
} else {
|
|
4545
4545
|
await visitor(root2, this.helpers);
|
|
4546
4546
|
}
|
|
4547
|
-
} catch (
|
|
4548
|
-
throw this.handleError(
|
|
4547
|
+
} catch (e22) {
|
|
4548
|
+
throw this.handleError(e22);
|
|
4549
4549
|
}
|
|
4550
4550
|
}
|
|
4551
4551
|
}
|
|
@@ -4641,8 +4641,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
4641
4641
|
let promise;
|
|
4642
4642
|
try {
|
|
4643
4643
|
promise = visitor(node2, this.helpers);
|
|
4644
|
-
} catch (
|
|
4645
|
-
throw this.handleError(
|
|
4644
|
+
} catch (e22) {
|
|
4645
|
+
throw this.handleError(e22, node2.proxyOf);
|
|
4646
4646
|
}
|
|
4647
4647
|
if (node2.type !== "root" && node2.type !== "document" && !node2.parent) {
|
|
4648
4648
|
return true;
|
|
@@ -4669,8 +4669,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
4669
4669
|
this.result.lastPlugin = plugin22;
|
|
4670
4670
|
try {
|
|
4671
4671
|
return visitor(node2.toProxy(), this.helpers);
|
|
4672
|
-
} catch (
|
|
4673
|
-
throw this.handleError(
|
|
4672
|
+
} catch (e22) {
|
|
4673
|
+
throw this.handleError(e22, node2);
|
|
4674
4674
|
}
|
|
4675
4675
|
}
|
|
4676
4676
|
if (visit2.iterator !== 0) {
|
|
@@ -4773,10 +4773,10 @@ var BentoLabsSDKModule = (() => {
|
|
|
4773
4773
|
let str = stringify$1$1;
|
|
4774
4774
|
this.result = new Result$1$1(this._processor, root2, this._opts);
|
|
4775
4775
|
this.result.css = css;
|
|
4776
|
-
let
|
|
4776
|
+
let self2 = this;
|
|
4777
4777
|
Object.defineProperty(this.result, "root", {
|
|
4778
4778
|
get() {
|
|
4779
|
-
return
|
|
4779
|
+
return self2.root;
|
|
4780
4780
|
}
|
|
4781
4781
|
});
|
|
4782
4782
|
let map = new MapGenerator2$1(str, root2, this._opts, css);
|
|
@@ -5073,8 +5073,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
5073
5073
|
var __defProp22 = Object.defineProperty;
|
|
5074
5074
|
var __defNormalProp22 = (obj, key, value) => key in obj ? __defProp22(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5075
5075
|
var __publicField2 = (obj, key, value) => __defNormalProp22(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5076
|
-
function getDefaultExportFromCjs(
|
|
5077
|
-
return
|
|
5076
|
+
function getDefaultExportFromCjs(x22) {
|
|
5077
|
+
return x22 && x22.__esModule && Object.prototype.hasOwnProperty.call(x22, "default") ? x22["default"] : x22;
|
|
5078
5078
|
}
|
|
5079
5079
|
function getAugmentedNamespace(n2) {
|
|
5080
5080
|
if (n2.__esModule) return n2;
|
|
@@ -5089,12 +5089,12 @@ var BentoLabsSDKModule = (() => {
|
|
|
5089
5089
|
a2.prototype = f2.prototype;
|
|
5090
5090
|
} else a2 = {};
|
|
5091
5091
|
Object.defineProperty(a2, "__esModule", { value: true });
|
|
5092
|
-
Object.keys(n2).forEach(function(
|
|
5093
|
-
var
|
|
5094
|
-
Object.defineProperty(a2,
|
|
5092
|
+
Object.keys(n2).forEach(function(k2) {
|
|
5093
|
+
var d2 = Object.getOwnPropertyDescriptor(n2, k2);
|
|
5094
|
+
Object.defineProperty(a2, k2, d2.get ? d2 : {
|
|
5095
5095
|
enumerable: true,
|
|
5096
5096
|
get: function() {
|
|
5097
|
-
return n2[
|
|
5097
|
+
return n2[k2];
|
|
5098
5098
|
}
|
|
5099
5099
|
});
|
|
5100
5100
|
});
|
|
@@ -5442,8 +5442,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
5442
5442
|
if (root2.raws.indent) return root2.raws.indent;
|
|
5443
5443
|
let value;
|
|
5444
5444
|
root2.walk((i2) => {
|
|
5445
|
-
let
|
|
5446
|
-
if (
|
|
5445
|
+
let p2 = i2.parent;
|
|
5446
|
+
if (p2 && p2 !== root2 && p2.parent && p2.parent === root2) {
|
|
5447
5447
|
if (typeof i2.raws.before !== "undefined") {
|
|
5448
5448
|
let parts = i2.raws.before.split("\n");
|
|
5449
5449
|
value = parts[parts.length - 1];
|
|
@@ -5518,7 +5518,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
5518
5518
|
} else if (i2 === "source") {
|
|
5519
5519
|
cloned[i2] = value;
|
|
5520
5520
|
} else if (Array.isArray(value)) {
|
|
5521
|
-
cloned[i2] = value.map((
|
|
5521
|
+
cloned[i2] = value.map((j2) => cloneNode(j2, cloned));
|
|
5522
5522
|
} else {
|
|
5523
5523
|
if (type === "object" && value !== null) value = cloneNode(value);
|
|
5524
5524
|
cloned[i2] = value;
|
|
@@ -5753,7 +5753,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
5753
5753
|
}
|
|
5754
5754
|
return result2;
|
|
5755
5755
|
}
|
|
5756
|
-
toJSON(
|
|
5756
|
+
toJSON(_2, inputs) {
|
|
5757
5757
|
let fixed = {};
|
|
5758
5758
|
let emitInputs = inputs == null;
|
|
5759
5759
|
inputs = inputs || /* @__PURE__ */ new Map();
|
|
@@ -6314,9 +6314,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
6314
6314
|
column += str.length;
|
|
6315
6315
|
}
|
|
6316
6316
|
if (node2 && type !== "start") {
|
|
6317
|
-
let
|
|
6317
|
+
let p2 = node2.parent || { raws: {} };
|
|
6318
6318
|
let childless = node2.type === "decl" || node2.type === "atrule" && !node2.nodes;
|
|
6319
|
-
if (!childless || node2 !==
|
|
6319
|
+
if (!childless || node2 !== p2.last || p2.raws.semicolon) {
|
|
6320
6320
|
if (node2.source && node2.source.end) {
|
|
6321
6321
|
mapping.source = this.sourcePath(node2);
|
|
6322
6322
|
mapping.original.line = node2.source.end.line;
|
|
@@ -6735,8 +6735,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
6735
6735
|
let result2;
|
|
6736
6736
|
try {
|
|
6737
6737
|
result2 = callback(child, i2);
|
|
6738
|
-
} catch (
|
|
6739
|
-
throw child.addToError(
|
|
6738
|
+
} catch (e22) {
|
|
6739
|
+
throw child.addToError(e22);
|
|
6740
6740
|
}
|
|
6741
6741
|
if (result2 !== false && child.walk) {
|
|
6742
6742
|
result2 = child.walk(callback);
|
|
@@ -7395,8 +7395,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
7395
7395
|
if (colon === false) return;
|
|
7396
7396
|
let founded = 0;
|
|
7397
7397
|
let token;
|
|
7398
|
-
for (let
|
|
7399
|
-
token = tokens[
|
|
7398
|
+
for (let j2 = colon - 1; j2 >= 0; j2--) {
|
|
7399
|
+
token = tokens[j2];
|
|
7400
7400
|
if (token[0] !== "space") {
|
|
7401
7401
|
founded += 1;
|
|
7402
7402
|
if (founded === 2) break;
|
|
@@ -7514,8 +7514,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
7514
7514
|
} else if (token[1].toLowerCase() === "important") {
|
|
7515
7515
|
let cache = tokens.slice(0);
|
|
7516
7516
|
let str = "";
|
|
7517
|
-
for (let
|
|
7518
|
-
let type = cache[
|
|
7517
|
+
for (let j2 = i2; j2 > 0; j2--) {
|
|
7518
|
+
let type = cache[j2][0];
|
|
7519
7519
|
if (str.trim().indexOf("!") === 0 && type !== "space") {
|
|
7520
7520
|
break;
|
|
7521
7521
|
}
|
|
@@ -7818,19 +7818,19 @@ var BentoLabsSDKModule = (() => {
|
|
|
7818
7818
|
let parser2 = new Parser22(input2);
|
|
7819
7819
|
try {
|
|
7820
7820
|
parser2.parse();
|
|
7821
|
-
} catch (
|
|
7821
|
+
} catch (e22) {
|
|
7822
7822
|
if (false) {
|
|
7823
|
-
if (
|
|
7823
|
+
if (e22.name === "CssSyntaxError" && opts && opts.from) {
|
|
7824
7824
|
if (/\.scss$/i.test(opts.from)) {
|
|
7825
|
-
|
|
7825
|
+
e22.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser";
|
|
7826
7826
|
} else if (/\.sass/i.test(opts.from)) {
|
|
7827
|
-
|
|
7827
|
+
e22.message += "\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser";
|
|
7828
7828
|
} else if (/\.less$/i.test(opts.from)) {
|
|
7829
|
-
|
|
7829
|
+
e22.message += "\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser";
|
|
7830
7830
|
}
|
|
7831
7831
|
}
|
|
7832
7832
|
}
|
|
7833
|
-
throw
|
|
7833
|
+
throw e22;
|
|
7834
7834
|
}
|
|
7835
7835
|
return parser2.root;
|
|
7836
7836
|
}
|
|
@@ -7998,8 +7998,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
7998
7998
|
let pluginVer = plugin22.postcssVersion;
|
|
7999
7999
|
let runtimeVer = this.result.processor.version;
|
|
8000
8000
|
let a2 = pluginVer.split(".");
|
|
8001
|
-
let
|
|
8002
|
-
if (a2[0] !==
|
|
8001
|
+
let b2 = runtimeVer.split(".");
|
|
8002
|
+
if (a2[0] !== b2[0] || parseInt(a2[1]) > parseInt(b2[1])) {
|
|
8003
8003
|
console.error(
|
|
8004
8004
|
"Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below."
|
|
8005
8005
|
);
|
|
@@ -8071,9 +8071,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
8071
8071
|
if (isPromise(promise)) {
|
|
8072
8072
|
try {
|
|
8073
8073
|
await promise;
|
|
8074
|
-
} catch (
|
|
8074
|
+
} catch (e22) {
|
|
8075
8075
|
let node2 = stack[stack.length - 1].node;
|
|
8076
|
-
throw this.handleError(
|
|
8076
|
+
throw this.handleError(e22, node2);
|
|
8077
8077
|
}
|
|
8078
8078
|
}
|
|
8079
8079
|
}
|
|
@@ -8090,8 +8090,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
8090
8090
|
} else {
|
|
8091
8091
|
await visitor(root2, this.helpers);
|
|
8092
8092
|
}
|
|
8093
|
-
} catch (
|
|
8094
|
-
throw this.handleError(
|
|
8093
|
+
} catch (e22) {
|
|
8094
|
+
throw this.handleError(e22);
|
|
8095
8095
|
}
|
|
8096
8096
|
}
|
|
8097
8097
|
}
|
|
@@ -8187,8 +8187,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
8187
8187
|
let promise;
|
|
8188
8188
|
try {
|
|
8189
8189
|
promise = visitor(node2, this.helpers);
|
|
8190
|
-
} catch (
|
|
8191
|
-
throw this.handleError(
|
|
8190
|
+
} catch (e22) {
|
|
8191
|
+
throw this.handleError(e22, node2.proxyOf);
|
|
8192
8192
|
}
|
|
8193
8193
|
if (node2.type !== "root" && node2.type !== "document" && !node2.parent) {
|
|
8194
8194
|
return true;
|
|
@@ -8215,8 +8215,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
8215
8215
|
this.result.lastPlugin = plugin22;
|
|
8216
8216
|
try {
|
|
8217
8217
|
return visitor(node2.toProxy(), this.helpers);
|
|
8218
|
-
} catch (
|
|
8219
|
-
throw this.handleError(
|
|
8218
|
+
} catch (e22) {
|
|
8219
|
+
throw this.handleError(e22, node2);
|
|
8220
8220
|
}
|
|
8221
8221
|
}
|
|
8222
8222
|
if (visit2.iterator !== 0) {
|
|
@@ -8319,10 +8319,10 @@ var BentoLabsSDKModule = (() => {
|
|
|
8319
8319
|
let str = stringify$1;
|
|
8320
8320
|
this.result = new Result$1(this._processor, root2, this._opts);
|
|
8321
8321
|
this.result.css = css;
|
|
8322
|
-
let
|
|
8322
|
+
let self2 = this;
|
|
8323
8323
|
Object.defineProperty(this.result, "root", {
|
|
8324
8324
|
get() {
|
|
8325
|
-
return
|
|
8325
|
+
return self2.root;
|
|
8326
8326
|
}
|
|
8327
8327
|
});
|
|
8328
8328
|
let map = new MapGenerator22(str, root2, this._opts, css);
|
|
@@ -8735,7 +8735,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
8735
8735
|
document.body.removeChild(iframeEl);
|
|
8736
8736
|
if (!untaintedObject) return defaultPrototype;
|
|
8737
8737
|
return untaintedBasePrototype[key] = untaintedObject;
|
|
8738
|
-
} catch (
|
|
8738
|
+
} catch (e3) {
|
|
8739
8739
|
return defaultPrototype;
|
|
8740
8740
|
}
|
|
8741
8741
|
}
|
|
@@ -8831,7 +8831,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
8831
8831
|
return () => {
|
|
8832
8832
|
source[name] = original;
|
|
8833
8833
|
};
|
|
8834
|
-
} catch (
|
|
8834
|
+
} catch (e3) {
|
|
8835
8835
|
return () => {
|
|
8836
8836
|
};
|
|
8837
8837
|
}
|
|
@@ -8915,15 +8915,15 @@ var BentoLabsSDKModule = (() => {
|
|
|
8915
8915
|
}
|
|
8916
8916
|
};
|
|
8917
8917
|
}
|
|
8918
|
-
function hookSetter(target, key,
|
|
8918
|
+
function hookSetter(target, key, d2, isRevoked, win = window) {
|
|
8919
8919
|
const original = win.Object.getOwnPropertyDescriptor(target, key);
|
|
8920
8920
|
win.Object.defineProperty(
|
|
8921
8921
|
target,
|
|
8922
8922
|
key,
|
|
8923
|
-
isRevoked ?
|
|
8923
|
+
isRevoked ? d2 : {
|
|
8924
8924
|
set(value) {
|
|
8925
8925
|
setTimeout(() => {
|
|
8926
|
-
|
|
8926
|
+
d2.set.call(this, value);
|
|
8927
8927
|
}, 0);
|
|
8928
8928
|
if (original && original.set) {
|
|
8929
8929
|
original.set.call(this, value);
|
|
@@ -8973,7 +8973,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
8973
8973
|
} else {
|
|
8974
8974
|
if (classMatchesRegex(el, blockClass, checkAncestors)) return true;
|
|
8975
8975
|
}
|
|
8976
|
-
} catch (
|
|
8976
|
+
} catch (e22) {
|
|
8977
8977
|
}
|
|
8978
8978
|
if (blockSelector) {
|
|
8979
8979
|
if (el.matches(blockSelector)) return true;
|
|
@@ -9115,7 +9115,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
9115
9115
|
try {
|
|
9116
9116
|
const url = new URL(href, "http://x");
|
|
9117
9117
|
return url.pathname;
|
|
9118
|
-
} catch (
|
|
9118
|
+
} catch (e3) {
|
|
9119
9119
|
return href.split("?")[0].split("#")[0];
|
|
9120
9120
|
}
|
|
9121
9121
|
}
|
|
@@ -9492,7 +9492,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
9492
9492
|
try {
|
|
9493
9493
|
const path = (_a2 = options.pathname) != null ? _a2 : typeof window !== "undefined" ? window.location.pathname : void 0;
|
|
9494
9494
|
context.bentoSelector = buildBentoSelector(element, path);
|
|
9495
|
-
} catch (
|
|
9495
|
+
} catch (e3) {
|
|
9496
9496
|
}
|
|
9497
9497
|
}
|
|
9498
9498
|
if (opts.includeInputValues && isInputElement(element)) {
|
|
@@ -9925,31 +9925,31 @@ var BentoLabsSDKModule = (() => {
|
|
|
9925
9925
|
maskInputFn: this.maskInputFn
|
|
9926
9926
|
});
|
|
9927
9927
|
});
|
|
9928
|
-
__publicField(this, "processMutation", (
|
|
9929
|
-
if (isIgnored(
|
|
9928
|
+
__publicField(this, "processMutation", (m2) => {
|
|
9929
|
+
if (isIgnored(m2.target, this.mirror, this.slimDOMOptions)) {
|
|
9930
9930
|
return;
|
|
9931
9931
|
}
|
|
9932
|
-
switch (
|
|
9932
|
+
switch (m2.type) {
|
|
9933
9933
|
case "characterData": {
|
|
9934
|
-
const value = index.textContent(
|
|
9935
|
-
if (!isBlocked(
|
|
9934
|
+
const value = index.textContent(m2.target);
|
|
9935
|
+
if (!isBlocked(m2.target, this.blockClass, this.blockSelector, false) && value !== m2.oldValue) {
|
|
9936
9936
|
this.texts.push({
|
|
9937
9937
|
value: needMaskingText(
|
|
9938
|
-
|
|
9938
|
+
m2.target,
|
|
9939
9939
|
this.maskTextClass,
|
|
9940
9940
|
this.maskTextSelector,
|
|
9941
9941
|
true
|
|
9942
9942
|
// checkAncestors
|
|
9943
|
-
) && value ? this.maskTextFn ? this.maskTextFn(value, closestElementOfNode(
|
|
9944
|
-
node:
|
|
9943
|
+
) && value ? this.maskTextFn ? this.maskTextFn(value, closestElementOfNode(m2.target)) : value.replace(/[\S]/g, "*") : value,
|
|
9944
|
+
node: m2.target
|
|
9945
9945
|
});
|
|
9946
9946
|
}
|
|
9947
9947
|
break;
|
|
9948
9948
|
}
|
|
9949
9949
|
case "attributes": {
|
|
9950
|
-
const target =
|
|
9951
|
-
let attributeName =
|
|
9952
|
-
let value =
|
|
9950
|
+
const target = m2.target;
|
|
9951
|
+
let attributeName = m2.attributeName;
|
|
9952
|
+
let value = m2.target.getAttribute(attributeName);
|
|
9953
9953
|
if (attributeName === "value") {
|
|
9954
9954
|
const type = getInputType(target);
|
|
9955
9955
|
value = maskInputValue({
|
|
@@ -9961,10 +9961,10 @@ var BentoLabsSDKModule = (() => {
|
|
|
9961
9961
|
maskInputFn: this.maskInputFn
|
|
9962
9962
|
});
|
|
9963
9963
|
}
|
|
9964
|
-
if (isBlocked(
|
|
9964
|
+
if (isBlocked(m2.target, this.blockClass, this.blockSelector, false) || value === m2.oldValue) {
|
|
9965
9965
|
return;
|
|
9966
9966
|
}
|
|
9967
|
-
let item = this.attributeMap.get(
|
|
9967
|
+
let item = this.attributeMap.get(m2.target);
|
|
9968
9968
|
if (target.tagName === "IFRAME" && attributeName === "src" && !this.keepIframeSrcFn(value)) {
|
|
9969
9969
|
if (!target.contentDocument) {
|
|
9970
9970
|
attributeName = "rr_src";
|
|
@@ -9974,15 +9974,15 @@ var BentoLabsSDKModule = (() => {
|
|
|
9974
9974
|
}
|
|
9975
9975
|
if (!item) {
|
|
9976
9976
|
item = {
|
|
9977
|
-
node:
|
|
9977
|
+
node: m2.target,
|
|
9978
9978
|
attributes: {},
|
|
9979
9979
|
styleDiff: {},
|
|
9980
9980
|
_unchangedStyles: {}
|
|
9981
9981
|
};
|
|
9982
9982
|
this.attributes.push(item);
|
|
9983
|
-
this.attributeMap.set(
|
|
9983
|
+
this.attributeMap.set(m2.target, item);
|
|
9984
9984
|
}
|
|
9985
|
-
if (attributeName === "type" && target.tagName === "INPUT" && (
|
|
9985
|
+
if (attributeName === "type" && target.tagName === "INPUT" && (m2.oldValue || "").toLowerCase() === "password") {
|
|
9986
9986
|
target.setAttribute("data-rr-is-password", "true");
|
|
9987
9987
|
}
|
|
9988
9988
|
if (!ignoreAttribute(target.tagName, attributeName)) {
|
|
@@ -9996,13 +9996,13 @@ var BentoLabsSDKModule = (() => {
|
|
|
9996
9996
|
if (!this.unattachedDoc) {
|
|
9997
9997
|
try {
|
|
9998
9998
|
this.unattachedDoc = document.implementation.createHTMLDocument();
|
|
9999
|
-
} catch (
|
|
9999
|
+
} catch (e22) {
|
|
10000
10000
|
this.unattachedDoc = this.doc;
|
|
10001
10001
|
}
|
|
10002
10002
|
}
|
|
10003
10003
|
const old = this.unattachedDoc.createElement("span");
|
|
10004
|
-
if (
|
|
10005
|
-
old.setAttribute("style",
|
|
10004
|
+
if (m2.oldValue) {
|
|
10005
|
+
old.setAttribute("style", m2.oldValue);
|
|
10006
10006
|
}
|
|
10007
10007
|
for (const pname of Array.from(target.style)) {
|
|
10008
10008
|
const newValue = target.style.getPropertyValue(pname);
|
|
@@ -10033,31 +10033,31 @@ var BentoLabsSDKModule = (() => {
|
|
|
10033
10033
|
break;
|
|
10034
10034
|
}
|
|
10035
10035
|
case "childList": {
|
|
10036
|
-
if (isBlocked(
|
|
10036
|
+
if (isBlocked(m2.target, this.blockClass, this.blockSelector, true))
|
|
10037
10037
|
return;
|
|
10038
|
-
if (
|
|
10039
|
-
this.genTextAreaValueMutation(
|
|
10038
|
+
if (m2.target.tagName === "TEXTAREA") {
|
|
10039
|
+
this.genTextAreaValueMutation(m2.target);
|
|
10040
10040
|
return;
|
|
10041
10041
|
}
|
|
10042
|
-
|
|
10043
|
-
|
|
10042
|
+
m2.addedNodes.forEach((n2) => this.genAdds(n2, m2.target));
|
|
10043
|
+
m2.removedNodes.forEach((n2) => {
|
|
10044
10044
|
const nodeId = this.mirror.getId(n2);
|
|
10045
|
-
const parentId = isShadowRoot(
|
|
10046
|
-
if (isBlocked(
|
|
10045
|
+
const parentId = isShadowRoot(m2.target) ? this.mirror.getId(index.host(m2.target)) : this.mirror.getId(m2.target);
|
|
10046
|
+
if (isBlocked(m2.target, this.blockClass, this.blockSelector, false) || isIgnored(n2, this.mirror, this.slimDOMOptions) || !isSerialized(n2, this.mirror)) {
|
|
10047
10047
|
return;
|
|
10048
10048
|
}
|
|
10049
10049
|
if (this.addedSet.has(n2)) {
|
|
10050
10050
|
deepDelete(this.addedSet, n2);
|
|
10051
10051
|
this.droppedSet.add(n2);
|
|
10052
|
-
} else if (this.addedSet.has(
|
|
10053
|
-
else if (isAncestorRemoved(
|
|
10052
|
+
} else if (this.addedSet.has(m2.target) && nodeId === -1) ;
|
|
10053
|
+
else if (isAncestorRemoved(m2.target, this.mirror)) ;
|
|
10054
10054
|
else if (this.movedSet.has(n2) && this.movedMap[moveKey(nodeId, parentId)]) {
|
|
10055
10055
|
deepDelete(this.movedSet, n2);
|
|
10056
10056
|
} else {
|
|
10057
10057
|
this.removes.push({
|
|
10058
10058
|
parentId,
|
|
10059
10059
|
id: nodeId,
|
|
10060
|
-
isShadow: isShadowRoot(
|
|
10060
|
+
isShadow: isShadowRoot(m2.target) && isNativeShadowDom(m2.target) ? true : void 0
|
|
10061
10061
|
});
|
|
10062
10062
|
processRemoves(n2, this.removesSubTreeCache);
|
|
10063
10063
|
}
|
|
@@ -10221,7 +10221,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
10221
10221
|
} else if ("path" in event && event.path.length) {
|
|
10222
10222
|
return event.path[0];
|
|
10223
10223
|
}
|
|
10224
|
-
} catch (
|
|
10224
|
+
} catch (e3) {
|
|
10225
10225
|
}
|
|
10226
10226
|
return event && event.target;
|
|
10227
10227
|
}
|
|
@@ -10261,9 +10261,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
10261
10261
|
(source) => {
|
|
10262
10262
|
const totalOffset = Date.now() - timeBaseline;
|
|
10263
10263
|
mousemoveCb(
|
|
10264
|
-
positions.map((
|
|
10265
|
-
|
|
10266
|
-
return
|
|
10264
|
+
positions.map((p2) => {
|
|
10265
|
+
p2.timeOffset -= totalOffset;
|
|
10266
|
+
return p2;
|
|
10267
10267
|
}),
|
|
10268
10268
|
source
|
|
10269
10269
|
);
|
|
@@ -10303,7 +10303,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
10303
10303
|
on("drag", updatePosition, doc)
|
|
10304
10304
|
];
|
|
10305
10305
|
return callbackWrapper(() => {
|
|
10306
|
-
handlers.forEach((
|
|
10306
|
+
handlers.forEach((h2) => h2());
|
|
10307
10307
|
});
|
|
10308
10308
|
}
|
|
10309
10309
|
function initMouseInteractionObserver({
|
|
@@ -10365,12 +10365,12 @@ var BentoLabsSDKModule = (() => {
|
|
|
10365
10365
|
pointerType = currentPointerType;
|
|
10366
10366
|
currentPointerType = null;
|
|
10367
10367
|
}
|
|
10368
|
-
const
|
|
10369
|
-
if (!
|
|
10368
|
+
const e22 = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;
|
|
10369
|
+
if (!e22) {
|
|
10370
10370
|
return;
|
|
10371
10371
|
}
|
|
10372
10372
|
const id = mirror2.getId(target);
|
|
10373
|
-
const { clientX, clientY } =
|
|
10373
|
+
const { clientX, clientY } = e22;
|
|
10374
10374
|
let elContext;
|
|
10375
10375
|
if (captureElementContext && target instanceof Element) {
|
|
10376
10376
|
const isClickEvent = MouseInteractions[thisEventKey] === MouseInteractions.Click;
|
|
@@ -10413,7 +10413,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
10413
10413
|
handlers.push(on(eventName, handler, doc));
|
|
10414
10414
|
});
|
|
10415
10415
|
return callbackWrapper(() => {
|
|
10416
|
-
handlers.forEach((
|
|
10416
|
+
handlers.forEach((h2) => h2());
|
|
10417
10417
|
});
|
|
10418
10418
|
}
|
|
10419
10419
|
function initScrollObserver({
|
|
@@ -10562,7 +10562,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
10562
10562
|
const currentWindow = doc.defaultView;
|
|
10563
10563
|
if (!currentWindow) {
|
|
10564
10564
|
return () => {
|
|
10565
|
-
handlers.forEach((
|
|
10565
|
+
handlers.forEach((h2) => h2());
|
|
10566
10566
|
};
|
|
10567
10567
|
}
|
|
10568
10568
|
const propertyDescriptor = currentWindow.Object.getOwnPropertyDescriptor(
|
|
@@ -10581,9 +10581,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
10581
10581
|
if (propertyDescriptor && propertyDescriptor.set) {
|
|
10582
10582
|
handlers.push(
|
|
10583
10583
|
...hookProperties.map(
|
|
10584
|
-
(
|
|
10585
|
-
|
|
10586
|
-
|
|
10584
|
+
(p2) => hookSetter(
|
|
10585
|
+
p2[0],
|
|
10586
|
+
p2[1],
|
|
10587
10587
|
{
|
|
10588
10588
|
set() {
|
|
10589
10589
|
callbackWrapper(eventHandler)({
|
|
@@ -10600,7 +10600,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
10600
10600
|
);
|
|
10601
10601
|
}
|
|
10602
10602
|
return callbackWrapper(() => {
|
|
10603
|
-
handlers.forEach((
|
|
10603
|
+
handlers.forEach((h2) => h2());
|
|
10604
10604
|
});
|
|
10605
10605
|
}
|
|
10606
10606
|
function getNestedCSSRulePositions(rule2) {
|
|
@@ -10853,7 +10853,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
10853
10853
|
if (hostId !== null && hostId !== -1) {
|
|
10854
10854
|
try {
|
|
10855
10855
|
stylesheetManager.adoptStyleSheets(sheets, hostId);
|
|
10856
|
-
} catch (
|
|
10856
|
+
} catch (e22) {
|
|
10857
10857
|
}
|
|
10858
10858
|
}
|
|
10859
10859
|
return result2;
|
|
@@ -10978,7 +10978,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
10978
10978
|
on("ratechange", handler(MediaInteractions.RateChange), doc)
|
|
10979
10979
|
];
|
|
10980
10980
|
return callbackWrapper(() => {
|
|
10981
|
-
handlers.forEach((
|
|
10981
|
+
handlers.forEach((h2) => h2());
|
|
10982
10982
|
});
|
|
10983
10983
|
}
|
|
10984
10984
|
function initFontObserver({ fontCb, doc }) {
|
|
@@ -11007,9 +11007,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
11007
11007
|
return function(fontFace) {
|
|
11008
11008
|
setTimeout(
|
|
11009
11009
|
callbackWrapper(() => {
|
|
11010
|
-
const
|
|
11011
|
-
if (
|
|
11012
|
-
fontCb(
|
|
11010
|
+
const p2 = fontMap.get(fontFace);
|
|
11011
|
+
if (p2) {
|
|
11012
|
+
fontCb(p2);
|
|
11013
11013
|
fontMap.delete(fontFace);
|
|
11014
11014
|
}
|
|
11015
11015
|
}),
|
|
@@ -11024,7 +11024,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11024
11024
|
});
|
|
11025
11025
|
handlers.push(restoreHandler);
|
|
11026
11026
|
return callbackWrapper(() => {
|
|
11027
|
-
handlers.forEach((
|
|
11027
|
+
handlers.forEach((h2) => h2());
|
|
11028
11028
|
});
|
|
11029
11029
|
}
|
|
11030
11030
|
function initSelectionObserver(param) {
|
|
@@ -11071,7 +11071,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11071
11071
|
name
|
|
11072
11072
|
}
|
|
11073
11073
|
});
|
|
11074
|
-
} catch (
|
|
11074
|
+
} catch (e22) {
|
|
11075
11075
|
console.warn(`Custom element callback failed for ${name}`);
|
|
11076
11076
|
}
|
|
11077
11077
|
return original.apply(this, [name, constructor, options]);
|
|
@@ -11096,77 +11096,77 @@ var BentoLabsSDKModule = (() => {
|
|
|
11096
11096
|
selectionCb,
|
|
11097
11097
|
customElementCb
|
|
11098
11098
|
} = o2;
|
|
11099
|
-
o2.mutationCb = (...
|
|
11099
|
+
o2.mutationCb = (...p2) => {
|
|
11100
11100
|
if (hooks.mutation) {
|
|
11101
|
-
hooks.mutation(...
|
|
11101
|
+
hooks.mutation(...p2);
|
|
11102
11102
|
}
|
|
11103
|
-
mutationCb(...
|
|
11103
|
+
mutationCb(...p2);
|
|
11104
11104
|
};
|
|
11105
|
-
o2.mousemoveCb = (...
|
|
11105
|
+
o2.mousemoveCb = (...p2) => {
|
|
11106
11106
|
if (hooks.mousemove) {
|
|
11107
|
-
hooks.mousemove(...
|
|
11107
|
+
hooks.mousemove(...p2);
|
|
11108
11108
|
}
|
|
11109
|
-
mousemoveCb(...
|
|
11109
|
+
mousemoveCb(...p2);
|
|
11110
11110
|
};
|
|
11111
|
-
o2.mouseInteractionCb = (...
|
|
11111
|
+
o2.mouseInteractionCb = (...p2) => {
|
|
11112
11112
|
if (hooks.mouseInteraction) {
|
|
11113
|
-
hooks.mouseInteraction(...
|
|
11113
|
+
hooks.mouseInteraction(...p2);
|
|
11114
11114
|
}
|
|
11115
|
-
mouseInteractionCb(...
|
|
11115
|
+
mouseInteractionCb(...p2);
|
|
11116
11116
|
};
|
|
11117
|
-
o2.scrollCb = (...
|
|
11117
|
+
o2.scrollCb = (...p2) => {
|
|
11118
11118
|
if (hooks.scroll) {
|
|
11119
|
-
hooks.scroll(...
|
|
11119
|
+
hooks.scroll(...p2);
|
|
11120
11120
|
}
|
|
11121
|
-
scrollCb(...
|
|
11121
|
+
scrollCb(...p2);
|
|
11122
11122
|
};
|
|
11123
|
-
o2.viewportResizeCb = (...
|
|
11123
|
+
o2.viewportResizeCb = (...p2) => {
|
|
11124
11124
|
if (hooks.viewportResize) {
|
|
11125
|
-
hooks.viewportResize(...
|
|
11125
|
+
hooks.viewportResize(...p2);
|
|
11126
11126
|
}
|
|
11127
|
-
viewportResizeCb(...
|
|
11127
|
+
viewportResizeCb(...p2);
|
|
11128
11128
|
};
|
|
11129
|
-
o2.inputCb = (...
|
|
11129
|
+
o2.inputCb = (...p2) => {
|
|
11130
11130
|
if (hooks.input) {
|
|
11131
|
-
hooks.input(...
|
|
11131
|
+
hooks.input(...p2);
|
|
11132
11132
|
}
|
|
11133
|
-
inputCb(...
|
|
11133
|
+
inputCb(...p2);
|
|
11134
11134
|
};
|
|
11135
|
-
o2.mediaInteractionCb = (...
|
|
11135
|
+
o2.mediaInteractionCb = (...p2) => {
|
|
11136
11136
|
if (hooks.mediaInteaction) {
|
|
11137
|
-
hooks.mediaInteaction(...
|
|
11137
|
+
hooks.mediaInteaction(...p2);
|
|
11138
11138
|
}
|
|
11139
|
-
mediaInteractionCb(...
|
|
11139
|
+
mediaInteractionCb(...p2);
|
|
11140
11140
|
};
|
|
11141
|
-
o2.styleSheetRuleCb = (...
|
|
11141
|
+
o2.styleSheetRuleCb = (...p2) => {
|
|
11142
11142
|
if (hooks.styleSheetRule) {
|
|
11143
|
-
hooks.styleSheetRule(...
|
|
11143
|
+
hooks.styleSheetRule(...p2);
|
|
11144
11144
|
}
|
|
11145
|
-
styleSheetRuleCb(...
|
|
11145
|
+
styleSheetRuleCb(...p2);
|
|
11146
11146
|
};
|
|
11147
|
-
o2.styleDeclarationCb = (...
|
|
11147
|
+
o2.styleDeclarationCb = (...p2) => {
|
|
11148
11148
|
if (hooks.styleDeclaration) {
|
|
11149
|
-
hooks.styleDeclaration(...
|
|
11149
|
+
hooks.styleDeclaration(...p2);
|
|
11150
11150
|
}
|
|
11151
|
-
styleDeclarationCb(...
|
|
11151
|
+
styleDeclarationCb(...p2);
|
|
11152
11152
|
};
|
|
11153
|
-
o2.canvasMutationCb = (...
|
|
11153
|
+
o2.canvasMutationCb = (...p2) => {
|
|
11154
11154
|
if (hooks.canvasMutation) {
|
|
11155
|
-
hooks.canvasMutation(...
|
|
11155
|
+
hooks.canvasMutation(...p2);
|
|
11156
11156
|
}
|
|
11157
|
-
canvasMutationCb(...
|
|
11157
|
+
canvasMutationCb(...p2);
|
|
11158
11158
|
};
|
|
11159
|
-
o2.fontCb = (...
|
|
11159
|
+
o2.fontCb = (...p2) => {
|
|
11160
11160
|
if (hooks.font) {
|
|
11161
|
-
hooks.font(...
|
|
11161
|
+
hooks.font(...p2);
|
|
11162
11162
|
}
|
|
11163
|
-
fontCb(...
|
|
11163
|
+
fontCb(...p2);
|
|
11164
11164
|
};
|
|
11165
|
-
o2.selectionCb = (...
|
|
11165
|
+
o2.selectionCb = (...p2) => {
|
|
11166
11166
|
if (hooks.selection) {
|
|
11167
|
-
hooks.selection(...
|
|
11167
|
+
hooks.selection(...p2);
|
|
11168
11168
|
}
|
|
11169
|
-
selectionCb(...
|
|
11169
|
+
selectionCb(...p2);
|
|
11170
11170
|
};
|
|
11171
11171
|
o2.customElementCb = (...c2) => {
|
|
11172
11172
|
if (hooks.customElement) {
|
|
@@ -11221,7 +11221,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11221
11221
|
);
|
|
11222
11222
|
}
|
|
11223
11223
|
return callbackWrapper(() => {
|
|
11224
|
-
mutationBuffers.forEach((
|
|
11224
|
+
mutationBuffers.forEach((b2) => b2.reset());
|
|
11225
11225
|
mutationObserver == null ? void 0 : mutationObserver.disconnect();
|
|
11226
11226
|
mousemoveHandler();
|
|
11227
11227
|
mouseInteractionHandler();
|
|
@@ -11235,7 +11235,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11235
11235
|
fontObserver();
|
|
11236
11236
|
selectionObserver();
|
|
11237
11237
|
customElementObserver();
|
|
11238
|
-
pluginHandlers.forEach((
|
|
11238
|
+
pluginHandlers.forEach((h2) => h2());
|
|
11239
11239
|
});
|
|
11240
11240
|
}
|
|
11241
11241
|
function hasNestedCSSRule(prop) {
|
|
@@ -11390,18 +11390,18 @@ var BentoLabsSDKModule = (() => {
|
|
|
11390
11390
|
crossOriginMessageEvent.data.isCheckout
|
|
11391
11391
|
);
|
|
11392
11392
|
}
|
|
11393
|
-
transformCrossOriginEvent(iframeEl,
|
|
11393
|
+
transformCrossOriginEvent(iframeEl, e22) {
|
|
11394
11394
|
var _a2;
|
|
11395
|
-
switch (
|
|
11395
|
+
switch (e22.type) {
|
|
11396
11396
|
case EventType.FullSnapshot: {
|
|
11397
11397
|
this.crossOriginIframeMirror.reset(iframeEl);
|
|
11398
11398
|
this.crossOriginIframeStyleMirror.reset(iframeEl);
|
|
11399
|
-
this.replaceIdOnNode(
|
|
11400
|
-
const rootId =
|
|
11399
|
+
this.replaceIdOnNode(e22.data.node, iframeEl);
|
|
11400
|
+
const rootId = e22.data.node.id;
|
|
11401
11401
|
this.crossOriginIframeRootIdMap.set(iframeEl, rootId);
|
|
11402
|
-
this.patchRootIdOnNode(
|
|
11402
|
+
this.patchRootIdOnNode(e22.data.node, rootId);
|
|
11403
11403
|
return {
|
|
11404
|
-
timestamp:
|
|
11404
|
+
timestamp: e22.timestamp,
|
|
11405
11405
|
type: EventType.IncrementalSnapshot,
|
|
11406
11406
|
data: {
|
|
11407
11407
|
source: IncrementalSource.Mutation,
|
|
@@ -11409,7 +11409,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11409
11409
|
{
|
|
11410
11410
|
parentId: this.mirror.getId(iframeEl),
|
|
11411
11411
|
nextId: null,
|
|
11412
|
-
node:
|
|
11412
|
+
node: e22.data.node
|
|
11413
11413
|
}
|
|
11414
11414
|
],
|
|
11415
11415
|
removes: [],
|
|
@@ -11425,20 +11425,20 @@ var BentoLabsSDKModule = (() => {
|
|
|
11425
11425
|
return false;
|
|
11426
11426
|
}
|
|
11427
11427
|
case EventType.Plugin: {
|
|
11428
|
-
return
|
|
11428
|
+
return e22;
|
|
11429
11429
|
}
|
|
11430
11430
|
case EventType.Custom: {
|
|
11431
11431
|
this.replaceIds(
|
|
11432
|
-
|
|
11432
|
+
e22.data.payload,
|
|
11433
11433
|
iframeEl,
|
|
11434
11434
|
["id", "parentId", "previousId", "nextId"]
|
|
11435
11435
|
);
|
|
11436
|
-
return
|
|
11436
|
+
return e22;
|
|
11437
11437
|
}
|
|
11438
11438
|
case EventType.IncrementalSnapshot: {
|
|
11439
|
-
switch (
|
|
11439
|
+
switch (e22.data.source) {
|
|
11440
11440
|
case IncrementalSource.Mutation: {
|
|
11441
|
-
|
|
11441
|
+
e22.data.adds.forEach((n2) => {
|
|
11442
11442
|
this.replaceIds(n2, iframeEl, [
|
|
11443
11443
|
"parentId",
|
|
11444
11444
|
"nextId",
|
|
@@ -11448,24 +11448,24 @@ var BentoLabsSDKModule = (() => {
|
|
|
11448
11448
|
const rootId = this.crossOriginIframeRootIdMap.get(iframeEl);
|
|
11449
11449
|
rootId && this.patchRootIdOnNode(n2.node, rootId);
|
|
11450
11450
|
});
|
|
11451
|
-
|
|
11451
|
+
e22.data.removes.forEach((n2) => {
|
|
11452
11452
|
this.replaceIds(n2, iframeEl, ["parentId", "id"]);
|
|
11453
11453
|
});
|
|
11454
|
-
|
|
11454
|
+
e22.data.attributes.forEach((n2) => {
|
|
11455
11455
|
this.replaceIds(n2, iframeEl, ["id"]);
|
|
11456
11456
|
});
|
|
11457
|
-
|
|
11457
|
+
e22.data.texts.forEach((n2) => {
|
|
11458
11458
|
this.replaceIds(n2, iframeEl, ["id"]);
|
|
11459
11459
|
});
|
|
11460
|
-
return
|
|
11460
|
+
return e22;
|
|
11461
11461
|
}
|
|
11462
11462
|
case IncrementalSource.Drag:
|
|
11463
11463
|
case IncrementalSource.TouchMove:
|
|
11464
11464
|
case IncrementalSource.MouseMove: {
|
|
11465
|
-
|
|
11466
|
-
this.replaceIds(
|
|
11465
|
+
e22.data.positions.forEach((p2) => {
|
|
11466
|
+
this.replaceIds(p2, iframeEl, ["id"]);
|
|
11467
11467
|
});
|
|
11468
|
-
return
|
|
11468
|
+
return e22;
|
|
11469
11469
|
}
|
|
11470
11470
|
case IncrementalSource.ViewportResize: {
|
|
11471
11471
|
return false;
|
|
@@ -11475,31 +11475,31 @@ var BentoLabsSDKModule = (() => {
|
|
|
11475
11475
|
case IncrementalSource.Scroll:
|
|
11476
11476
|
case IncrementalSource.CanvasMutation:
|
|
11477
11477
|
case IncrementalSource.Input: {
|
|
11478
|
-
this.replaceIds(
|
|
11479
|
-
return
|
|
11478
|
+
this.replaceIds(e22.data, iframeEl, ["id"]);
|
|
11479
|
+
return e22;
|
|
11480
11480
|
}
|
|
11481
11481
|
case IncrementalSource.StyleSheetRule:
|
|
11482
11482
|
case IncrementalSource.StyleDeclaration: {
|
|
11483
|
-
this.replaceIds(
|
|
11484
|
-
this.replaceStyleIds(
|
|
11485
|
-
return
|
|
11483
|
+
this.replaceIds(e22.data, iframeEl, ["id"]);
|
|
11484
|
+
this.replaceStyleIds(e22.data, iframeEl, ["styleId"]);
|
|
11485
|
+
return e22;
|
|
11486
11486
|
}
|
|
11487
11487
|
case IncrementalSource.Font: {
|
|
11488
|
-
return
|
|
11488
|
+
return e22;
|
|
11489
11489
|
}
|
|
11490
11490
|
case IncrementalSource.Selection: {
|
|
11491
|
-
|
|
11491
|
+
e22.data.ranges.forEach((range) => {
|
|
11492
11492
|
this.replaceIds(range, iframeEl, ["start", "end"]);
|
|
11493
11493
|
});
|
|
11494
|
-
return
|
|
11494
|
+
return e22;
|
|
11495
11495
|
}
|
|
11496
11496
|
case IncrementalSource.AdoptedStyleSheet: {
|
|
11497
|
-
this.replaceIds(
|
|
11498
|
-
this.replaceStyleIds(
|
|
11499
|
-
(_a2 =
|
|
11497
|
+
this.replaceIds(e22.data, iframeEl, ["id"]);
|
|
11498
|
+
this.replaceStyleIds(e22.data, iframeEl, ["styleIds"]);
|
|
11499
|
+
(_a2 = e22.data.styles) == null ? void 0 : _a2.forEach((style) => {
|
|
11500
11500
|
this.replaceStyleIds(style, iframeEl, ["styleId"]);
|
|
11501
11501
|
});
|
|
11502
|
-
return
|
|
11502
|
+
return e22;
|
|
11503
11503
|
}
|
|
11504
11504
|
}
|
|
11505
11505
|
}
|
|
@@ -11636,7 +11636,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11636
11636
|
this.restoreHandlers.forEach((handler) => {
|
|
11637
11637
|
try {
|
|
11638
11638
|
handler();
|
|
11639
|
-
} catch (
|
|
11639
|
+
} catch (e22) {
|
|
11640
11640
|
}
|
|
11641
11641
|
});
|
|
11642
11642
|
this.restoreHandlers = [];
|
|
@@ -11808,7 +11808,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11808
11808
|
}
|
|
11809
11809
|
);
|
|
11810
11810
|
handlers.push(restoreHandler);
|
|
11811
|
-
} catch (
|
|
11811
|
+
} catch (e3) {
|
|
11812
11812
|
const hookHandler = hookSetter(
|
|
11813
11813
|
win.CanvasRenderingContext2D.prototype,
|
|
11814
11814
|
prop,
|
|
@@ -11827,7 +11827,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11827
11827
|
}
|
|
11828
11828
|
}
|
|
11829
11829
|
return () => {
|
|
11830
|
-
handlers.forEach((
|
|
11830
|
+
handlers.forEach((h2) => h2());
|
|
11831
11831
|
};
|
|
11832
11832
|
}
|
|
11833
11833
|
function getNormalizedContextName(contextType) {
|
|
@@ -11862,11 +11862,11 @@ var BentoLabsSDKModule = (() => {
|
|
|
11862
11862
|
}
|
|
11863
11863
|
);
|
|
11864
11864
|
handlers.push(restoreHandler);
|
|
11865
|
-
} catch (
|
|
11865
|
+
} catch (e3) {
|
|
11866
11866
|
console.error("failed to patch HTMLCanvasElement.prototype.getContext");
|
|
11867
11867
|
}
|
|
11868
11868
|
return () => {
|
|
11869
|
-
handlers.forEach((
|
|
11869
|
+
handlers.forEach((h2) => h2());
|
|
11870
11870
|
};
|
|
11871
11871
|
}
|
|
11872
11872
|
function patchGLPrototype(prototype, type, cb, blockClass, blockSelector, win) {
|
|
@@ -11909,7 +11909,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11909
11909
|
}
|
|
11910
11910
|
);
|
|
11911
11911
|
handlers.push(restoreHandler);
|
|
11912
|
-
} catch (
|
|
11912
|
+
} catch (e3) {
|
|
11913
11913
|
const hookHandler = hookSetter(prototype, prop, {
|
|
11914
11914
|
set(v2) {
|
|
11915
11915
|
cb(this.canvas, {
|
|
@@ -11950,7 +11950,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11950
11950
|
);
|
|
11951
11951
|
}
|
|
11952
11952
|
return () => {
|
|
11953
|
-
handlers.forEach((
|
|
11953
|
+
handlers.forEach((h2) => h2());
|
|
11954
11954
|
};
|
|
11955
11955
|
}
|
|
11956
11956
|
var encodedJs = "KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=";
|
|
@@ -11968,7 +11968,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
11968
11968
|
(window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
11969
11969
|
});
|
|
11970
11970
|
return worker;
|
|
11971
|
-
} catch (
|
|
11971
|
+
} catch (e22) {
|
|
11972
11972
|
return new Worker(
|
|
11973
11973
|
"data:text/javascript;base64," + encodedJs,
|
|
11974
11974
|
{
|
|
@@ -12039,11 +12039,11 @@ var BentoLabsSDKModule = (() => {
|
|
|
12039
12039
|
);
|
|
12040
12040
|
const snapshotInProgressMap = /* @__PURE__ */ new Map();
|
|
12041
12041
|
const worker = new WorkerWrapper();
|
|
12042
|
-
worker.onmessage = (
|
|
12043
|
-
const { id } =
|
|
12042
|
+
worker.onmessage = (e22) => {
|
|
12043
|
+
const { id } = e22.data;
|
|
12044
12044
|
snapshotInProgressMap.set(id, false);
|
|
12045
|
-
if (!("base64" in
|
|
12046
|
-
const { base64, type, width, height } =
|
|
12045
|
+
if (!("base64" in e22.data)) return;
|
|
12046
|
+
const { base64, type, width, height } = e22.data;
|
|
12047
12047
|
this.mutationCb({
|
|
12048
12048
|
id,
|
|
12049
12049
|
type: CanvasContext["2D"],
|
|
@@ -12273,7 +12273,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
12273
12273
|
var canvasManager;
|
|
12274
12274
|
var recording = false;
|
|
12275
12275
|
try {
|
|
12276
|
-
if (Array.from([1], (
|
|
12276
|
+
if (Array.from([1], (x22) => x22 * 2)[0] !== 2) {
|
|
12277
12277
|
const cleanFrame = document.createElement("iframe");
|
|
12278
12278
|
document.body.appendChild(cleanFrame);
|
|
12279
12279
|
Array.from = ((_a = cleanFrame.contentWindow) == null ? void 0 : _a.Array.from) || Array.from;
|
|
@@ -12327,7 +12327,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
12327
12327
|
if (window.parent.document) {
|
|
12328
12328
|
passEmitsToParent = false;
|
|
12329
12329
|
}
|
|
12330
|
-
} catch (
|
|
12330
|
+
} catch (e22) {
|
|
12331
12331
|
passEmitsToParent = true;
|
|
12332
12332
|
}
|
|
12333
12333
|
}
|
|
@@ -12370,70 +12370,70 @@ var BentoLabsSDKModule = (() => {
|
|
|
12370
12370
|
polyfill$1();
|
|
12371
12371
|
let lastFullSnapshotEvent;
|
|
12372
12372
|
let incrementalSnapshotCount = 0;
|
|
12373
|
-
const eventProcessor = (
|
|
12373
|
+
const eventProcessor = (e22) => {
|
|
12374
12374
|
for (const plugin3 of plugins || []) {
|
|
12375
12375
|
if (plugin3.eventProcessor) {
|
|
12376
|
-
|
|
12376
|
+
e22 = plugin3.eventProcessor(e22);
|
|
12377
12377
|
}
|
|
12378
12378
|
}
|
|
12379
12379
|
if (packFn && // Disable packing events which will be emitted to parent frames.
|
|
12380
12380
|
!passEmitsToParent) {
|
|
12381
|
-
|
|
12381
|
+
e22 = packFn(e22);
|
|
12382
12382
|
}
|
|
12383
|
-
return
|
|
12383
|
+
return e22;
|
|
12384
12384
|
};
|
|
12385
12385
|
wrappedEmit = (r2, isCheckout) => {
|
|
12386
12386
|
var _a2;
|
|
12387
|
-
const
|
|
12388
|
-
|
|
12389
|
-
if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) &&
|
|
12387
|
+
const e22 = r2;
|
|
12388
|
+
e22.timestamp = nowTimestamp();
|
|
12389
|
+
if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e22.type !== EventType.FullSnapshot && !(e22.type === EventType.IncrementalSnapshot && e22.data.source === IncrementalSource.Mutation)) {
|
|
12390
12390
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
12391
12391
|
}
|
|
12392
12392
|
if (inEmittingFrame) {
|
|
12393
|
-
emit == null ? void 0 : emit(eventProcessor(
|
|
12393
|
+
emit == null ? void 0 : emit(eventProcessor(e22), isCheckout);
|
|
12394
12394
|
} else if (passEmitsToParent) {
|
|
12395
12395
|
const message = {
|
|
12396
12396
|
type: "rrweb",
|
|
12397
|
-
event: eventProcessor(
|
|
12397
|
+
event: eventProcessor(e22),
|
|
12398
12398
|
origin: window.location.origin,
|
|
12399
12399
|
isCheckout
|
|
12400
12400
|
};
|
|
12401
12401
|
window.parent.postMessage(message, "*");
|
|
12402
12402
|
}
|
|
12403
|
-
if (
|
|
12404
|
-
lastFullSnapshotEvent =
|
|
12403
|
+
if (e22.type === EventType.FullSnapshot) {
|
|
12404
|
+
lastFullSnapshotEvent = e22;
|
|
12405
12405
|
incrementalSnapshotCount = 0;
|
|
12406
|
-
} else if (
|
|
12407
|
-
if (
|
|
12406
|
+
} else if (e22.type === EventType.IncrementalSnapshot) {
|
|
12407
|
+
if (e22.data.source === IncrementalSource.Mutation && e22.data.isAttachIframe) {
|
|
12408
12408
|
return;
|
|
12409
12409
|
}
|
|
12410
12410
|
incrementalSnapshotCount++;
|
|
12411
12411
|
const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
|
|
12412
|
-
const exceedTime = checkoutEveryNms &&
|
|
12412
|
+
const exceedTime = checkoutEveryNms && e22.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
|
|
12413
12413
|
if (exceedCount || exceedTime) {
|
|
12414
12414
|
takeFullSnapshot$1(true);
|
|
12415
12415
|
}
|
|
12416
12416
|
}
|
|
12417
12417
|
};
|
|
12418
|
-
const wrappedMutationEmit = (
|
|
12418
|
+
const wrappedMutationEmit = (m2) => {
|
|
12419
12419
|
wrappedEmit({
|
|
12420
12420
|
type: EventType.IncrementalSnapshot,
|
|
12421
12421
|
data: __spreadValues({
|
|
12422
12422
|
source: IncrementalSource.Mutation
|
|
12423
|
-
},
|
|
12423
|
+
}, m2)
|
|
12424
12424
|
});
|
|
12425
12425
|
};
|
|
12426
|
-
const wrappedScrollEmit = (
|
|
12426
|
+
const wrappedScrollEmit = (p2) => wrappedEmit({
|
|
12427
12427
|
type: EventType.IncrementalSnapshot,
|
|
12428
12428
|
data: __spreadValues({
|
|
12429
12429
|
source: IncrementalSource.Scroll
|
|
12430
|
-
},
|
|
12430
|
+
}, p2)
|
|
12431
12431
|
});
|
|
12432
|
-
const wrappedCanvasMutationEmit = (
|
|
12432
|
+
const wrappedCanvasMutationEmit = (p2) => wrappedEmit({
|
|
12433
12433
|
type: EventType.IncrementalSnapshot,
|
|
12434
12434
|
data: __spreadValues({
|
|
12435
12435
|
source: IncrementalSource.CanvasMutation
|
|
12436
|
-
},
|
|
12436
|
+
}, p2)
|
|
12437
12437
|
});
|
|
12438
12438
|
const wrappedAdoptedStyleSheetEmit = (a2) => wrappedEmit({
|
|
12439
12439
|
type: EventType.IncrementalSnapshot,
|
|
@@ -12582,18 +12582,18 @@ var BentoLabsSDKModule = (() => {
|
|
|
12582
12582
|
positions
|
|
12583
12583
|
}
|
|
12584
12584
|
}),
|
|
12585
|
-
mouseInteractionCb: (
|
|
12585
|
+
mouseInteractionCb: (d2) => wrappedEmit({
|
|
12586
12586
|
type: EventType.IncrementalSnapshot,
|
|
12587
12587
|
data: __spreadValues({
|
|
12588
12588
|
source: IncrementalSource.MouseInteraction
|
|
12589
|
-
},
|
|
12589
|
+
}, d2)
|
|
12590
12590
|
}),
|
|
12591
12591
|
scrollCb: wrappedScrollEmit,
|
|
12592
|
-
viewportResizeCb: (
|
|
12592
|
+
viewportResizeCb: (d2) => wrappedEmit({
|
|
12593
12593
|
type: EventType.IncrementalSnapshot,
|
|
12594
12594
|
data: __spreadValues({
|
|
12595
12595
|
source: IncrementalSource.ViewportResize
|
|
12596
|
-
},
|
|
12596
|
+
}, d2)
|
|
12597
12597
|
}),
|
|
12598
12598
|
inputCb: (v2) => wrappedEmit({
|
|
12599
12599
|
type: EventType.IncrementalSnapshot,
|
|
@@ -12601,11 +12601,11 @@ var BentoLabsSDKModule = (() => {
|
|
|
12601
12601
|
source: IncrementalSource.Input
|
|
12602
12602
|
}, v2)
|
|
12603
12603
|
}),
|
|
12604
|
-
mediaInteractionCb: (
|
|
12604
|
+
mediaInteractionCb: (p2) => wrappedEmit({
|
|
12605
12605
|
type: EventType.IncrementalSnapshot,
|
|
12606
12606
|
data: __spreadValues({
|
|
12607
12607
|
source: IncrementalSource.MediaInteraction
|
|
12608
|
-
},
|
|
12608
|
+
}, p2)
|
|
12609
12609
|
}),
|
|
12610
12610
|
styleSheetRuleCb: (r2) => wrappedEmit({
|
|
12611
12611
|
type: EventType.IncrementalSnapshot,
|
|
@@ -12620,18 +12620,18 @@ var BentoLabsSDKModule = (() => {
|
|
|
12620
12620
|
}, r2)
|
|
12621
12621
|
}),
|
|
12622
12622
|
canvasMutationCb: wrappedCanvasMutationEmit,
|
|
12623
|
-
fontCb: (
|
|
12623
|
+
fontCb: (p2) => wrappedEmit({
|
|
12624
12624
|
type: EventType.IncrementalSnapshot,
|
|
12625
12625
|
data: __spreadValues({
|
|
12626
12626
|
source: IncrementalSource.Font
|
|
12627
|
-
},
|
|
12627
|
+
}, p2)
|
|
12628
12628
|
}),
|
|
12629
|
-
selectionCb: (
|
|
12629
|
+
selectionCb: (p2) => {
|
|
12630
12630
|
wrappedEmit({
|
|
12631
12631
|
type: EventType.IncrementalSnapshot,
|
|
12632
12632
|
data: __spreadValues({
|
|
12633
12633
|
source: IncrementalSource.Selection
|
|
12634
|
-
},
|
|
12634
|
+
}, p2)
|
|
12635
12635
|
});
|
|
12636
12636
|
},
|
|
12637
12637
|
customElementCb: (c2) => {
|
|
@@ -12671,13 +12671,13 @@ var BentoLabsSDKModule = (() => {
|
|
|
12671
12671
|
ignoreCSSAttributes,
|
|
12672
12672
|
captureElementContext,
|
|
12673
12673
|
elementContextOptions,
|
|
12674
|
-
plugins: ((_a2 = plugins == null ? void 0 : plugins.filter((
|
|
12675
|
-
observer:
|
|
12676
|
-
options:
|
|
12674
|
+
plugins: ((_a2 = plugins == null ? void 0 : plugins.filter((p2) => p2.observer)) == null ? void 0 : _a2.map((p2) => ({
|
|
12675
|
+
observer: p2.observer,
|
|
12676
|
+
options: p2.options,
|
|
12677
12677
|
callback: (payload) => wrappedEmit({
|
|
12678
12678
|
type: EventType.Plugin,
|
|
12679
12679
|
data: {
|
|
12680
|
-
plugin:
|
|
12680
|
+
plugin: p2.name,
|
|
12681
12681
|
payload
|
|
12682
12682
|
}
|
|
12683
12683
|
})
|
|
@@ -12774,6 +12774,237 @@ var BentoLabsSDKModule = (() => {
|
|
|
12774
12774
|
var { freezePage } = record;
|
|
12775
12775
|
var { takeFullSnapshot } = record;
|
|
12776
12776
|
|
|
12777
|
+
// node_modules/web-vitals/dist/web-vitals.js
|
|
12778
|
+
var e;
|
|
12779
|
+
var o = -1;
|
|
12780
|
+
var a = function(e3) {
|
|
12781
|
+
addEventListener("pageshow", (function(n2) {
|
|
12782
|
+
n2.persisted && (o = n2.timeStamp, e3(n2));
|
|
12783
|
+
}), true);
|
|
12784
|
+
};
|
|
12785
|
+
var c = function() {
|
|
12786
|
+
var e3 = self.performance && performance.getEntriesByType && performance.getEntriesByType("navigation")[0];
|
|
12787
|
+
if (e3 && e3.responseStart > 0 && e3.responseStart < performance.now()) return e3;
|
|
12788
|
+
};
|
|
12789
|
+
var u = function() {
|
|
12790
|
+
var e3 = c();
|
|
12791
|
+
return e3 && e3.activationStart || 0;
|
|
12792
|
+
};
|
|
12793
|
+
var f = function(e3, n2) {
|
|
12794
|
+
var t = c(), r = "navigate";
|
|
12795
|
+
o >= 0 ? r = "back-forward-cache" : t && (document.prerendering || u() > 0 ? r = "prerender" : document.wasDiscarded ? r = "restore" : t.type && (r = t.type.replace(/_/g, "-")));
|
|
12796
|
+
return { name: e3, value: void 0 === n2 ? -1 : n2, rating: "good", delta: 0, entries: [], id: "v4-".concat(Date.now(), "-").concat(Math.floor(8999999999999 * Math.random()) + 1e12), navigationType: r };
|
|
12797
|
+
};
|
|
12798
|
+
var s = function(e3, n2, t) {
|
|
12799
|
+
try {
|
|
12800
|
+
if (PerformanceObserver.supportedEntryTypes.includes(e3)) {
|
|
12801
|
+
var r = new PerformanceObserver((function(e4) {
|
|
12802
|
+
Promise.resolve().then((function() {
|
|
12803
|
+
n2(e4.getEntries());
|
|
12804
|
+
}));
|
|
12805
|
+
}));
|
|
12806
|
+
return r.observe(Object.assign({ type: e3, buffered: true }, t || {})), r;
|
|
12807
|
+
}
|
|
12808
|
+
} catch (e4) {
|
|
12809
|
+
}
|
|
12810
|
+
};
|
|
12811
|
+
var d = function(e3, n2, t, r) {
|
|
12812
|
+
var i, o2;
|
|
12813
|
+
return function(a2) {
|
|
12814
|
+
n2.value >= 0 && (a2 || r) && ((o2 = n2.value - (i || 0)) || void 0 === i) && (i = n2.value, n2.delta = o2, n2.rating = (function(e4, n3) {
|
|
12815
|
+
return e4 > n3[1] ? "poor" : e4 > n3[0] ? "needs-improvement" : "good";
|
|
12816
|
+
})(n2.value, t), e3(n2));
|
|
12817
|
+
};
|
|
12818
|
+
};
|
|
12819
|
+
var l = function(e3) {
|
|
12820
|
+
requestAnimationFrame((function() {
|
|
12821
|
+
return requestAnimationFrame((function() {
|
|
12822
|
+
return e3();
|
|
12823
|
+
}));
|
|
12824
|
+
}));
|
|
12825
|
+
};
|
|
12826
|
+
var p = function(e3) {
|
|
12827
|
+
document.addEventListener("visibilitychange", (function() {
|
|
12828
|
+
"hidden" === document.visibilityState && e3();
|
|
12829
|
+
}));
|
|
12830
|
+
};
|
|
12831
|
+
var v = function(e3) {
|
|
12832
|
+
var n2 = false;
|
|
12833
|
+
return function() {
|
|
12834
|
+
n2 || (e3(), n2 = true);
|
|
12835
|
+
};
|
|
12836
|
+
};
|
|
12837
|
+
var m = -1;
|
|
12838
|
+
var h = function() {
|
|
12839
|
+
return "hidden" !== document.visibilityState || document.prerendering ? 1 / 0 : 0;
|
|
12840
|
+
};
|
|
12841
|
+
var g = function(e3) {
|
|
12842
|
+
"hidden" === document.visibilityState && m > -1 && (m = "visibilitychange" === e3.type ? e3.timeStamp : 0, T());
|
|
12843
|
+
};
|
|
12844
|
+
var y = function() {
|
|
12845
|
+
addEventListener("visibilitychange", g, true), addEventListener("prerenderingchange", g, true);
|
|
12846
|
+
};
|
|
12847
|
+
var T = function() {
|
|
12848
|
+
removeEventListener("visibilitychange", g, true), removeEventListener("prerenderingchange", g, true);
|
|
12849
|
+
};
|
|
12850
|
+
var E = function() {
|
|
12851
|
+
return m < 0 && (m = h(), y(), a((function() {
|
|
12852
|
+
setTimeout((function() {
|
|
12853
|
+
m = h(), y();
|
|
12854
|
+
}), 0);
|
|
12855
|
+
}))), { get firstHiddenTime() {
|
|
12856
|
+
return m;
|
|
12857
|
+
} };
|
|
12858
|
+
};
|
|
12859
|
+
var C = function(e3) {
|
|
12860
|
+
document.prerendering ? addEventListener("prerenderingchange", (function() {
|
|
12861
|
+
return e3();
|
|
12862
|
+
}), true) : e3();
|
|
12863
|
+
};
|
|
12864
|
+
var b = [1800, 3e3];
|
|
12865
|
+
var S = function(e3, n2) {
|
|
12866
|
+
n2 = n2 || {}, C((function() {
|
|
12867
|
+
var t, r = E(), i = f("FCP"), o2 = s("paint", (function(e4) {
|
|
12868
|
+
e4.forEach((function(e5) {
|
|
12869
|
+
"first-contentful-paint" === e5.name && (o2.disconnect(), e5.startTime < r.firstHiddenTime && (i.value = Math.max(e5.startTime - u(), 0), i.entries.push(e5), t(true)));
|
|
12870
|
+
}));
|
|
12871
|
+
}));
|
|
12872
|
+
o2 && (t = d(e3, i, b, n2.reportAllChanges), a((function(r2) {
|
|
12873
|
+
i = f("FCP"), t = d(e3, i, b, n2.reportAllChanges), l((function() {
|
|
12874
|
+
i.value = performance.now() - r2.timeStamp, t(true);
|
|
12875
|
+
}));
|
|
12876
|
+
})));
|
|
12877
|
+
}));
|
|
12878
|
+
};
|
|
12879
|
+
var L = [0.1, 0.25];
|
|
12880
|
+
var w = function(e3, n2) {
|
|
12881
|
+
n2 = n2 || {}, S(v((function() {
|
|
12882
|
+
var t, r = f("CLS", 0), i = 0, o2 = [], c2 = function(e4) {
|
|
12883
|
+
e4.forEach((function(e5) {
|
|
12884
|
+
if (!e5.hadRecentInput) {
|
|
12885
|
+
var n3 = o2[0], t2 = o2[o2.length - 1];
|
|
12886
|
+
i && e5.startTime - t2.startTime < 1e3 && e5.startTime - n3.startTime < 5e3 ? (i += e5.value, o2.push(e5)) : (i = e5.value, o2 = [e5]);
|
|
12887
|
+
}
|
|
12888
|
+
})), i > r.value && (r.value = i, r.entries = o2, t());
|
|
12889
|
+
}, u2 = s("layout-shift", c2);
|
|
12890
|
+
u2 && (t = d(e3, r, L, n2.reportAllChanges), p((function() {
|
|
12891
|
+
c2(u2.takeRecords()), t(true);
|
|
12892
|
+
})), a((function() {
|
|
12893
|
+
i = 0, r = f("CLS", 0), t = d(e3, r, L, n2.reportAllChanges), l((function() {
|
|
12894
|
+
return t();
|
|
12895
|
+
}));
|
|
12896
|
+
})), setTimeout(t, 0));
|
|
12897
|
+
})));
|
|
12898
|
+
};
|
|
12899
|
+
var A = 0;
|
|
12900
|
+
var I = 1 / 0;
|
|
12901
|
+
var P = 0;
|
|
12902
|
+
var M = function(e3) {
|
|
12903
|
+
e3.forEach((function(e4) {
|
|
12904
|
+
e4.interactionId && (I = Math.min(I, e4.interactionId), P = Math.max(P, e4.interactionId), A = P ? (P - I) / 7 + 1 : 0);
|
|
12905
|
+
}));
|
|
12906
|
+
};
|
|
12907
|
+
var k = function() {
|
|
12908
|
+
return e ? A : performance.interactionCount || 0;
|
|
12909
|
+
};
|
|
12910
|
+
var F = function() {
|
|
12911
|
+
"interactionCount" in performance || e || (e = s("event", M, { type: "event", buffered: true, durationThreshold: 0 }));
|
|
12912
|
+
};
|
|
12913
|
+
var D = [];
|
|
12914
|
+
var x2 = /* @__PURE__ */ new Map();
|
|
12915
|
+
var R = 0;
|
|
12916
|
+
var B = function() {
|
|
12917
|
+
var e3 = Math.min(D.length - 1, Math.floor((k() - R) / 50));
|
|
12918
|
+
return D[e3];
|
|
12919
|
+
};
|
|
12920
|
+
var H = [];
|
|
12921
|
+
var q = function(e3) {
|
|
12922
|
+
if (H.forEach((function(n3) {
|
|
12923
|
+
return n3(e3);
|
|
12924
|
+
})), e3.interactionId || "first-input" === e3.entryType) {
|
|
12925
|
+
var n2 = D[D.length - 1], t = x2.get(e3.interactionId);
|
|
12926
|
+
if (t || D.length < 10 || e3.duration > n2.latency) {
|
|
12927
|
+
if (t) e3.duration > t.latency ? (t.entries = [e3], t.latency = e3.duration) : e3.duration === t.latency && e3.startTime === t.entries[0].startTime && t.entries.push(e3);
|
|
12928
|
+
else {
|
|
12929
|
+
var r = { id: e3.interactionId, latency: e3.duration, entries: [e3] };
|
|
12930
|
+
x2.set(r.id, r), D.push(r);
|
|
12931
|
+
}
|
|
12932
|
+
D.sort((function(e4, n3) {
|
|
12933
|
+
return n3.latency - e4.latency;
|
|
12934
|
+
})), D.length > 10 && D.splice(10).forEach((function(e4) {
|
|
12935
|
+
return x2.delete(e4.id);
|
|
12936
|
+
}));
|
|
12937
|
+
}
|
|
12938
|
+
}
|
|
12939
|
+
};
|
|
12940
|
+
var O = function(e3) {
|
|
12941
|
+
var n2 = self.requestIdleCallback || self.setTimeout, t = -1;
|
|
12942
|
+
return e3 = v(e3), "hidden" === document.visibilityState ? e3() : (t = n2(e3), p(e3)), t;
|
|
12943
|
+
};
|
|
12944
|
+
var N = [200, 500];
|
|
12945
|
+
var j = function(e3, n2) {
|
|
12946
|
+
"PerformanceEventTiming" in self && "interactionId" in PerformanceEventTiming.prototype && (n2 = n2 || {}, C((function() {
|
|
12947
|
+
var t;
|
|
12948
|
+
F();
|
|
12949
|
+
var r, i = f("INP"), o2 = function(e4) {
|
|
12950
|
+
O((function() {
|
|
12951
|
+
e4.forEach(q);
|
|
12952
|
+
var n3 = B();
|
|
12953
|
+
n3 && n3.latency !== i.value && (i.value = n3.latency, i.entries = n3.entries, r());
|
|
12954
|
+
}));
|
|
12955
|
+
}, c2 = s("event", o2, { durationThreshold: null !== (t = n2.durationThreshold) && void 0 !== t ? t : 40 });
|
|
12956
|
+
r = d(e3, i, N, n2.reportAllChanges), c2 && (c2.observe({ type: "first-input", buffered: true }), p((function() {
|
|
12957
|
+
o2(c2.takeRecords()), r(true);
|
|
12958
|
+
})), a((function() {
|
|
12959
|
+
R = k(), D.length = 0, x2.clear(), i = f("INP"), r = d(e3, i, N, n2.reportAllChanges);
|
|
12960
|
+
})));
|
|
12961
|
+
})));
|
|
12962
|
+
};
|
|
12963
|
+
var _ = [2500, 4e3];
|
|
12964
|
+
var z = {};
|
|
12965
|
+
var G = function(e3, n2) {
|
|
12966
|
+
n2 = n2 || {}, C((function() {
|
|
12967
|
+
var t, r = E(), i = f("LCP"), o2 = function(e4) {
|
|
12968
|
+
n2.reportAllChanges || (e4 = e4.slice(-1)), e4.forEach((function(e5) {
|
|
12969
|
+
e5.startTime < r.firstHiddenTime && (i.value = Math.max(e5.startTime - u(), 0), i.entries = [e5], t());
|
|
12970
|
+
}));
|
|
12971
|
+
}, c2 = s("largest-contentful-paint", o2);
|
|
12972
|
+
if (c2) {
|
|
12973
|
+
t = d(e3, i, _, n2.reportAllChanges);
|
|
12974
|
+
var m2 = v((function() {
|
|
12975
|
+
z[i.id] || (o2(c2.takeRecords()), c2.disconnect(), z[i.id] = true, t(true));
|
|
12976
|
+
}));
|
|
12977
|
+
["keydown", "click"].forEach((function(e4) {
|
|
12978
|
+
addEventListener(e4, (function() {
|
|
12979
|
+
return O(m2);
|
|
12980
|
+
}), { once: true, capture: true });
|
|
12981
|
+
})), p(m2), a((function(r2) {
|
|
12982
|
+
i = f("LCP"), t = d(e3, i, _, n2.reportAllChanges), l((function() {
|
|
12983
|
+
i.value = performance.now() - r2.timeStamp, z[i.id] = true, t(true);
|
|
12984
|
+
}));
|
|
12985
|
+
}));
|
|
12986
|
+
}
|
|
12987
|
+
}));
|
|
12988
|
+
};
|
|
12989
|
+
var J = [800, 1800];
|
|
12990
|
+
var K = function e2(n2) {
|
|
12991
|
+
document.prerendering ? C((function() {
|
|
12992
|
+
return e2(n2);
|
|
12993
|
+
})) : "complete" !== document.readyState ? addEventListener("load", (function() {
|
|
12994
|
+
return e2(n2);
|
|
12995
|
+
}), true) : setTimeout(n2, 0);
|
|
12996
|
+
};
|
|
12997
|
+
var Q = function(e3, n2) {
|
|
12998
|
+
n2 = n2 || {};
|
|
12999
|
+
var t = f("TTFB"), r = d(e3, t, J, n2.reportAllChanges);
|
|
13000
|
+
K((function() {
|
|
13001
|
+
var i = c();
|
|
13002
|
+
i && (t.value = Math.max(i.responseStart - u(), 0), t.entries = [i], r(true), a((function() {
|
|
13003
|
+
t = f("TTFB", 0), (r = d(e3, t, J, n2.reportAllChanges))(true);
|
|
13004
|
+
})));
|
|
13005
|
+
}));
|
|
13006
|
+
};
|
|
13007
|
+
|
|
12777
13008
|
// src/index.ts
|
|
12778
13009
|
var PERSISTENCE_KEYS = {
|
|
12779
13010
|
DISTINCT_ID: "bentolabs_distinct_id",
|
|
@@ -12796,7 +13027,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
12796
13027
|
try {
|
|
12797
13028
|
const value = localStorage.getItem(key);
|
|
12798
13029
|
if (value !== null) return value;
|
|
12799
|
-
} catch (
|
|
13030
|
+
} catch (e3) {
|
|
12800
13031
|
}
|
|
12801
13032
|
}
|
|
12802
13033
|
if (this.mode === "cookie" || this.mode === "localStorage+cookie") {
|
|
@@ -12808,7 +13039,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
12808
13039
|
return decodeURIComponent(cookieValue);
|
|
12809
13040
|
}
|
|
12810
13041
|
}
|
|
12811
|
-
} catch (
|
|
13042
|
+
} catch (e3) {
|
|
12812
13043
|
}
|
|
12813
13044
|
}
|
|
12814
13045
|
return null;
|
|
@@ -12822,7 +13053,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
12822
13053
|
if (this.mode === "localStorage" || this.mode === "localStorage+cookie") {
|
|
12823
13054
|
try {
|
|
12824
13055
|
localStorage.setItem(key, value);
|
|
12825
|
-
} catch (
|
|
13056
|
+
} catch (e3) {
|
|
12826
13057
|
}
|
|
12827
13058
|
}
|
|
12828
13059
|
if (this.mode === "cookie" || this.mode === "localStorage+cookie") {
|
|
@@ -12830,7 +13061,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
12830
13061
|
const expires = /* @__PURE__ */ new Date();
|
|
12831
13062
|
expires.setFullYear(expires.getFullYear() + 1);
|
|
12832
13063
|
document.cookie = `${key}=${encodeURIComponent(value)};expires=${expires.toUTCString()};path=/;SameSite=Lax`;
|
|
12833
|
-
} catch (
|
|
13064
|
+
} catch (e3) {
|
|
12834
13065
|
}
|
|
12835
13066
|
}
|
|
12836
13067
|
}
|
|
@@ -12843,13 +13074,13 @@ var BentoLabsSDKModule = (() => {
|
|
|
12843
13074
|
if (this.mode === "localStorage" || this.mode === "localStorage+cookie") {
|
|
12844
13075
|
try {
|
|
12845
13076
|
localStorage.removeItem(key);
|
|
12846
|
-
} catch (
|
|
13077
|
+
} catch (e3) {
|
|
12847
13078
|
}
|
|
12848
13079
|
}
|
|
12849
13080
|
if (this.mode === "cookie" || this.mode === "localStorage+cookie") {
|
|
12850
13081
|
try {
|
|
12851
13082
|
document.cookie = `${key}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;
|
|
12852
|
-
} catch (
|
|
13083
|
+
} catch (e3) {
|
|
12853
13084
|
}
|
|
12854
13085
|
}
|
|
12855
13086
|
}
|
|
@@ -12912,26 +13143,26 @@ var BentoLabsSDKModule = (() => {
|
|
|
12912
13143
|
}
|
|
12913
13144
|
});
|
|
12914
13145
|
return urlObj.toString();
|
|
12915
|
-
} catch (
|
|
13146
|
+
} catch (e3) {
|
|
12916
13147
|
return url;
|
|
12917
13148
|
}
|
|
12918
13149
|
}
|
|
12919
13150
|
interceptFetch() {
|
|
12920
13151
|
if (typeof fetch === "undefined") return;
|
|
12921
13152
|
this.originalFetch = fetch.bind(window);
|
|
12922
|
-
const
|
|
13153
|
+
const self2 = this;
|
|
12923
13154
|
window.fetch = async function(input2, init) {
|
|
12924
13155
|
const url = typeof input2 === "string" ? input2 : input2 instanceof URL ? input2.toString() : input2.url;
|
|
12925
|
-
if (
|
|
12926
|
-
return
|
|
13156
|
+
if (self2.shouldSkip(url) || !self2.shouldSample()) {
|
|
13157
|
+
return self2.originalFetch(input2, init);
|
|
12927
13158
|
}
|
|
12928
13159
|
const startTime = Date.now();
|
|
12929
13160
|
const method = (init == null ? void 0 : init.method) || "GET";
|
|
12930
13161
|
try {
|
|
12931
|
-
const response = await
|
|
13162
|
+
const response = await self2.originalFetch(input2, init);
|
|
12932
13163
|
const duration = Date.now() - startTime;
|
|
12933
13164
|
const log = {
|
|
12934
|
-
url:
|
|
13165
|
+
url: self2.sanitizeUrl(url),
|
|
12935
13166
|
method: method.toUpperCase(),
|
|
12936
13167
|
status: response.status,
|
|
12937
13168
|
duration,
|
|
@@ -12939,14 +13170,14 @@ var BentoLabsSDKModule = (() => {
|
|
|
12939
13170
|
initiator: "fetch",
|
|
12940
13171
|
timestamp: Date.now()
|
|
12941
13172
|
};
|
|
12942
|
-
|
|
12943
|
-
if (
|
|
12944
|
-
|
|
13173
|
+
self2.logs.push(log);
|
|
13174
|
+
if (self2.logs.length > 500) self2.logs.shift();
|
|
13175
|
+
self2.onCapture(log);
|
|
12945
13176
|
return response;
|
|
12946
13177
|
} catch (error) {
|
|
12947
13178
|
const duration = Date.now() - startTime;
|
|
12948
13179
|
const log = {
|
|
12949
|
-
url:
|
|
13180
|
+
url: self2.sanitizeUrl(url),
|
|
12950
13181
|
method: method.toUpperCase(),
|
|
12951
13182
|
status: 0,
|
|
12952
13183
|
duration,
|
|
@@ -12955,9 +13186,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
12955
13186
|
error: error instanceof Error ? error.message : "Unknown error",
|
|
12956
13187
|
timestamp: Date.now()
|
|
12957
13188
|
};
|
|
12958
|
-
|
|
12959
|
-
if (
|
|
12960
|
-
|
|
13189
|
+
self2.logs.push(log);
|
|
13190
|
+
if (self2.logs.length > 500) self2.logs.shift();
|
|
13191
|
+
self2.onCapture(log);
|
|
12961
13192
|
throw error;
|
|
12962
13193
|
}
|
|
12963
13194
|
};
|
|
@@ -12972,24 +13203,24 @@ var BentoLabsSDKModule = (() => {
|
|
|
12972
13203
|
if (typeof XMLHttpRequest === "undefined") return;
|
|
12973
13204
|
this.originalXHROpen = XMLHttpRequest.prototype.open;
|
|
12974
13205
|
this.originalXHRSend = XMLHttpRequest.prototype.send;
|
|
12975
|
-
const
|
|
13206
|
+
const self2 = this;
|
|
12976
13207
|
XMLHttpRequest.prototype.open = function(method, url, async, username, password) {
|
|
12977
13208
|
this._bentoUrl = url.toString();
|
|
12978
13209
|
this._bentoMethod = method;
|
|
12979
13210
|
this._bentoStartTime = 0;
|
|
12980
|
-
return
|
|
13211
|
+
return self2.originalXHROpen.call(this, method, url, async != null ? async : true, username, password);
|
|
12981
13212
|
};
|
|
12982
13213
|
XMLHttpRequest.prototype.send = function(body) {
|
|
12983
13214
|
const xhr = this;
|
|
12984
13215
|
const url = xhr._bentoUrl;
|
|
12985
|
-
if (
|
|
12986
|
-
return
|
|
13216
|
+
if (self2.shouldSkip(url) || !self2.shouldSample()) {
|
|
13217
|
+
return self2.originalXHRSend.call(this, body);
|
|
12987
13218
|
}
|
|
12988
13219
|
xhr._bentoStartTime = Date.now();
|
|
12989
13220
|
const handleLoadEnd = () => {
|
|
12990
13221
|
const duration = Date.now() - xhr._bentoStartTime;
|
|
12991
13222
|
const log = {
|
|
12992
|
-
url:
|
|
13223
|
+
url: self2.sanitizeUrl(url),
|
|
12993
13224
|
method: xhr._bentoMethod.toUpperCase(),
|
|
12994
13225
|
status: xhr.status,
|
|
12995
13226
|
duration,
|
|
@@ -13000,12 +13231,12 @@ var BentoLabsSDKModule = (() => {
|
|
|
13000
13231
|
if (xhr.status === 0) {
|
|
13001
13232
|
log.error = "Request failed or was aborted";
|
|
13002
13233
|
}
|
|
13003
|
-
|
|
13004
|
-
if (
|
|
13005
|
-
|
|
13234
|
+
self2.logs.push(log);
|
|
13235
|
+
if (self2.logs.length > 500) self2.logs.shift();
|
|
13236
|
+
self2.onCapture(log);
|
|
13006
13237
|
};
|
|
13007
13238
|
xhr.addEventListener("loadend", handleLoadEnd);
|
|
13008
|
-
return
|
|
13239
|
+
return self2.originalXHRSend.call(this, body);
|
|
13009
13240
|
};
|
|
13010
13241
|
}
|
|
13011
13242
|
restoreXHR() {
|
|
@@ -13067,7 +13298,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
13067
13298
|
}
|
|
13068
13299
|
interceptLocalStorage() {
|
|
13069
13300
|
if (typeof localStorage === "undefined") return;
|
|
13070
|
-
const
|
|
13301
|
+
const self2 = this;
|
|
13071
13302
|
this.originalLocalStorage = {
|
|
13072
13303
|
setItem: localStorage.setItem.bind(localStorage),
|
|
13073
13304
|
getItem: localStorage.getItem.bind(localStorage),
|
|
@@ -13075,41 +13306,41 @@ var BentoLabsSDKModule = (() => {
|
|
|
13075
13306
|
clear: localStorage.clear.bind(localStorage)
|
|
13076
13307
|
};
|
|
13077
13308
|
localStorage.setItem = function(key, value) {
|
|
13078
|
-
|
|
13309
|
+
self2.addLog({
|
|
13079
13310
|
storageType: "localStorage",
|
|
13080
13311
|
operation: "set",
|
|
13081
13312
|
key,
|
|
13082
13313
|
valueType: typeof value,
|
|
13083
13314
|
timestamp: Date.now()
|
|
13084
13315
|
});
|
|
13085
|
-
return
|
|
13316
|
+
return self2.originalLocalStorage.setItem(key, value);
|
|
13086
13317
|
};
|
|
13087
13318
|
localStorage.getItem = function(key) {
|
|
13088
|
-
|
|
13319
|
+
self2.addLog({
|
|
13089
13320
|
storageType: "localStorage",
|
|
13090
13321
|
operation: "get",
|
|
13091
13322
|
key,
|
|
13092
13323
|
timestamp: Date.now()
|
|
13093
13324
|
});
|
|
13094
|
-
return
|
|
13325
|
+
return self2.originalLocalStorage.getItem(key);
|
|
13095
13326
|
};
|
|
13096
13327
|
localStorage.removeItem = function(key) {
|
|
13097
|
-
|
|
13328
|
+
self2.addLog({
|
|
13098
13329
|
storageType: "localStorage",
|
|
13099
13330
|
operation: "remove",
|
|
13100
13331
|
key,
|
|
13101
13332
|
timestamp: Date.now()
|
|
13102
13333
|
});
|
|
13103
|
-
return
|
|
13334
|
+
return self2.originalLocalStorage.removeItem(key);
|
|
13104
13335
|
};
|
|
13105
13336
|
localStorage.clear = function() {
|
|
13106
|
-
|
|
13337
|
+
self2.addLog({
|
|
13107
13338
|
storageType: "localStorage",
|
|
13108
13339
|
operation: "clear",
|
|
13109
13340
|
key: "*",
|
|
13110
13341
|
timestamp: Date.now()
|
|
13111
13342
|
});
|
|
13112
|
-
return
|
|
13343
|
+
return self2.originalLocalStorage.clear();
|
|
13113
13344
|
};
|
|
13114
13345
|
}
|
|
13115
13346
|
restoreLocalStorage() {
|
|
@@ -13123,7 +13354,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
13123
13354
|
}
|
|
13124
13355
|
interceptSessionStorage() {
|
|
13125
13356
|
if (typeof sessionStorage === "undefined") return;
|
|
13126
|
-
const
|
|
13357
|
+
const self2 = this;
|
|
13127
13358
|
this.originalSessionStorage = {
|
|
13128
13359
|
setItem: sessionStorage.setItem.bind(sessionStorage),
|
|
13129
13360
|
getItem: sessionStorage.getItem.bind(sessionStorage),
|
|
@@ -13131,41 +13362,41 @@ var BentoLabsSDKModule = (() => {
|
|
|
13131
13362
|
clear: sessionStorage.clear.bind(sessionStorage)
|
|
13132
13363
|
};
|
|
13133
13364
|
sessionStorage.setItem = function(key, value) {
|
|
13134
|
-
|
|
13365
|
+
self2.addLog({
|
|
13135
13366
|
storageType: "sessionStorage",
|
|
13136
13367
|
operation: "set",
|
|
13137
13368
|
key,
|
|
13138
13369
|
valueType: typeof value,
|
|
13139
13370
|
timestamp: Date.now()
|
|
13140
13371
|
});
|
|
13141
|
-
return
|
|
13372
|
+
return self2.originalSessionStorage.setItem(key, value);
|
|
13142
13373
|
};
|
|
13143
13374
|
sessionStorage.getItem = function(key) {
|
|
13144
|
-
|
|
13375
|
+
self2.addLog({
|
|
13145
13376
|
storageType: "sessionStorage",
|
|
13146
13377
|
operation: "get",
|
|
13147
13378
|
key,
|
|
13148
13379
|
timestamp: Date.now()
|
|
13149
13380
|
});
|
|
13150
|
-
return
|
|
13381
|
+
return self2.originalSessionStorage.getItem(key);
|
|
13151
13382
|
};
|
|
13152
13383
|
sessionStorage.removeItem = function(key) {
|
|
13153
|
-
|
|
13384
|
+
self2.addLog({
|
|
13154
13385
|
storageType: "sessionStorage",
|
|
13155
13386
|
operation: "remove",
|
|
13156
13387
|
key,
|
|
13157
13388
|
timestamp: Date.now()
|
|
13158
13389
|
});
|
|
13159
|
-
return
|
|
13390
|
+
return self2.originalSessionStorage.removeItem(key);
|
|
13160
13391
|
};
|
|
13161
13392
|
sessionStorage.clear = function() {
|
|
13162
|
-
|
|
13393
|
+
self2.addLog({
|
|
13163
13394
|
storageType: "sessionStorage",
|
|
13164
13395
|
operation: "clear",
|
|
13165
13396
|
key: "*",
|
|
13166
13397
|
timestamp: Date.now()
|
|
13167
13398
|
});
|
|
13168
|
-
return
|
|
13399
|
+
return self2.originalSessionStorage.clear();
|
|
13169
13400
|
};
|
|
13170
13401
|
}
|
|
13171
13402
|
restoreSessionStorage() {
|
|
@@ -13179,23 +13410,23 @@ var BentoLabsSDKModule = (() => {
|
|
|
13179
13410
|
}
|
|
13180
13411
|
interceptCookies() {
|
|
13181
13412
|
if (typeof document === "undefined") return;
|
|
13182
|
-
const
|
|
13413
|
+
const self2 = this;
|
|
13183
13414
|
const descriptor = Object.getOwnPropertyDescriptor(Document.prototype, "cookie");
|
|
13184
13415
|
if (!descriptor) return;
|
|
13185
13416
|
this.originalCookieDescriptor = descriptor;
|
|
13186
13417
|
Object.defineProperty(document, "cookie", {
|
|
13187
13418
|
get: function() {
|
|
13188
|
-
return
|
|
13419
|
+
return self2.originalCookieDescriptor.get.call(this);
|
|
13189
13420
|
},
|
|
13190
13421
|
set: function(value) {
|
|
13191
13422
|
const name = value.split("=")[0].trim();
|
|
13192
|
-
|
|
13423
|
+
self2.addLog({
|
|
13193
13424
|
storageType: "cookie",
|
|
13194
13425
|
operation: "set",
|
|
13195
13426
|
key: name,
|
|
13196
13427
|
timestamp: Date.now()
|
|
13197
13428
|
});
|
|
13198
|
-
return
|
|
13429
|
+
return self2.originalCookieDescriptor.set.call(this, value);
|
|
13199
13430
|
},
|
|
13200
13431
|
configurable: true
|
|
13201
13432
|
});
|
|
@@ -13267,7 +13498,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
13267
13498
|
return value;
|
|
13268
13499
|
});
|
|
13269
13500
|
return str.length > this.options.maxPayloadSize ? str.slice(0, this.options.maxPayloadSize) + "..." : str;
|
|
13270
|
-
} catch (
|
|
13501
|
+
} catch (e3) {
|
|
13271
13502
|
return "[Object]";
|
|
13272
13503
|
}
|
|
13273
13504
|
}
|
|
@@ -13279,7 +13510,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
13279
13510
|
const stack = new Error().stack || "";
|
|
13280
13511
|
const lines = stack.split("\n").slice(3);
|
|
13281
13512
|
return lines.slice(0, 5).map((line) => line.trim());
|
|
13282
|
-
} catch (
|
|
13513
|
+
} catch (e3) {
|
|
13283
13514
|
return [];
|
|
13284
13515
|
}
|
|
13285
13516
|
}
|
|
@@ -13302,7 +13533,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
13302
13533
|
}
|
|
13303
13534
|
}
|
|
13304
13535
|
interceptConsole() {
|
|
13305
|
-
const
|
|
13536
|
+
const self2 = this;
|
|
13306
13537
|
this.originalConsole = {
|
|
13307
13538
|
log: console.log.bind(console),
|
|
13308
13539
|
warn: console.warn.bind(console),
|
|
@@ -13313,32 +13544,32 @@ var BentoLabsSDKModule = (() => {
|
|
|
13313
13544
|
const levels = this.options.levels;
|
|
13314
13545
|
if (levels.includes("log")) {
|
|
13315
13546
|
console.log = function(...args) {
|
|
13316
|
-
|
|
13317
|
-
return
|
|
13547
|
+
self2.addLog("log", args);
|
|
13548
|
+
return self2.originalConsole.log(...args);
|
|
13318
13549
|
};
|
|
13319
13550
|
}
|
|
13320
13551
|
if (levels.includes("warn")) {
|
|
13321
13552
|
console.warn = function(...args) {
|
|
13322
|
-
|
|
13323
|
-
return
|
|
13553
|
+
self2.addLog("warn", args);
|
|
13554
|
+
return self2.originalConsole.warn(...args);
|
|
13324
13555
|
};
|
|
13325
13556
|
}
|
|
13326
13557
|
if (levels.includes("error")) {
|
|
13327
13558
|
console.error = function(...args) {
|
|
13328
|
-
|
|
13329
|
-
return
|
|
13559
|
+
self2.addLog("error", args);
|
|
13560
|
+
return self2.originalConsole.error(...args);
|
|
13330
13561
|
};
|
|
13331
13562
|
}
|
|
13332
13563
|
if (levels.includes("info")) {
|
|
13333
13564
|
console.info = function(...args) {
|
|
13334
|
-
|
|
13335
|
-
return
|
|
13565
|
+
self2.addLog("info", args);
|
|
13566
|
+
return self2.originalConsole.info(...args);
|
|
13336
13567
|
};
|
|
13337
13568
|
}
|
|
13338
13569
|
if (levels.includes("debug")) {
|
|
13339
13570
|
console.debug = function(...args) {
|
|
13340
|
-
|
|
13341
|
-
return
|
|
13571
|
+
self2.addLog("debug", args);
|
|
13572
|
+
return self2.originalConsole.debug(...args);
|
|
13342
13573
|
};
|
|
13343
13574
|
}
|
|
13344
13575
|
}
|
|
@@ -13354,24 +13585,24 @@ var BentoLabsSDKModule = (() => {
|
|
|
13354
13585
|
}
|
|
13355
13586
|
interceptGlobalErrors() {
|
|
13356
13587
|
if (typeof window === "undefined") return;
|
|
13357
|
-
const
|
|
13588
|
+
const self2 = this;
|
|
13358
13589
|
this.originalOnError = window.onerror;
|
|
13359
13590
|
window.onerror = function(message, source, lineno, colno, error) {
|
|
13360
|
-
|
|
13591
|
+
self2.addLog("error", [
|
|
13361
13592
|
`Uncaught error: ${message}`,
|
|
13362
13593
|
`at ${source}:${lineno}:${colno}`,
|
|
13363
13594
|
(error == null ? void 0 : error.stack) || ""
|
|
13364
13595
|
]);
|
|
13365
|
-
if (
|
|
13366
|
-
return
|
|
13596
|
+
if (self2.originalOnError && typeof self2.originalOnError === "function") {
|
|
13597
|
+
return self2.originalOnError(message, source, lineno, colno, error);
|
|
13367
13598
|
}
|
|
13368
13599
|
return false;
|
|
13369
13600
|
};
|
|
13370
13601
|
this.originalOnUnhandledRejection = window.onunhandledrejection;
|
|
13371
13602
|
window.onunhandledrejection = function(event) {
|
|
13372
|
-
|
|
13373
|
-
if (
|
|
13374
|
-
|
|
13603
|
+
self2.addLog("error", [`Unhandled promise rejection: ${self2.stringifyArg(event.reason)}`]);
|
|
13604
|
+
if (self2.originalOnUnhandledRejection) {
|
|
13605
|
+
self2.originalOnUnhandledRejection(event);
|
|
13375
13606
|
}
|
|
13376
13607
|
};
|
|
13377
13608
|
}
|
|
@@ -13450,6 +13681,12 @@ var BentoLabsSDKModule = (() => {
|
|
|
13450
13681
|
maxLogs: 500,
|
|
13451
13682
|
maxPayloadSize: 5e3,
|
|
13452
13683
|
captureStackTrace: true
|
|
13684
|
+
},
|
|
13685
|
+
// Web Vitals defaults
|
|
13686
|
+
capture_web_vitals: true,
|
|
13687
|
+
webVitalsOptions: {
|
|
13688
|
+
allowedMetrics: ["LCP", "FCP", "INP", "CLS"],
|
|
13689
|
+
captureAttribution: true
|
|
13453
13690
|
}
|
|
13454
13691
|
};
|
|
13455
13692
|
this.sessionId = "";
|
|
@@ -13521,12 +13758,19 @@ var BentoLabsSDKModule = (() => {
|
|
|
13521
13758
|
maxLogs: 500,
|
|
13522
13759
|
maxPayloadSize: 5e3,
|
|
13523
13760
|
captureStackTrace: true
|
|
13761
|
+
},
|
|
13762
|
+
// Web Vitals defaults
|
|
13763
|
+
capture_web_vitals: true,
|
|
13764
|
+
webVitalsOptions: {
|
|
13765
|
+
allowedMetrics: ["LCP", "FCP", "INP", "CLS"],
|
|
13766
|
+
captureAttribution: true
|
|
13524
13767
|
}
|
|
13525
13768
|
};
|
|
13526
13769
|
const mergedOptions = __spreadProps(__spreadValues(__spreadValues({}, defaultOptions), options), {
|
|
13527
13770
|
networkOptions: __spreadValues(__spreadValues({}, defaultOptions.networkOptions), options == null ? void 0 : options.networkOptions),
|
|
13528
13771
|
storageOptions: __spreadValues(__spreadValues({}, defaultOptions.storageOptions), options == null ? void 0 : options.storageOptions),
|
|
13529
|
-
consoleOptions: __spreadValues(__spreadValues({}, defaultOptions.consoleOptions), options == null ? void 0 : options.consoleOptions)
|
|
13772
|
+
consoleOptions: __spreadValues(__spreadValues({}, defaultOptions.consoleOptions), options == null ? void 0 : options.consoleOptions),
|
|
13773
|
+
webVitalsOptions: __spreadValues(__spreadValues({}, defaultOptions.webVitalsOptions), options == null ? void 0 : options.webVitalsOptions)
|
|
13530
13774
|
});
|
|
13531
13775
|
this.config = {
|
|
13532
13776
|
apiKey,
|
|
@@ -13549,6 +13793,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
13549
13793
|
storageOptions: mergedOptions.storageOptions,
|
|
13550
13794
|
capture_console: mergedOptions.capture_console,
|
|
13551
13795
|
consoleOptions: mergedOptions.consoleOptions,
|
|
13796
|
+
capture_web_vitals: mergedOptions.capture_web_vitals,
|
|
13797
|
+
webVitalsOptions: mergedOptions.webVitalsOptions,
|
|
13552
13798
|
bootstrap: mergedOptions.bootstrap
|
|
13553
13799
|
};
|
|
13554
13800
|
if (this.config.respect_dnt && this.isDNTEnabled()) {
|
|
@@ -13607,6 +13853,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
13607
13853
|
if (this.config.capture_console) {
|
|
13608
13854
|
this.startConsoleCapture();
|
|
13609
13855
|
}
|
|
13856
|
+
if (this.config.capture_web_vitals) {
|
|
13857
|
+
this.startWebVitalsCapture();
|
|
13858
|
+
}
|
|
13610
13859
|
}
|
|
13611
13860
|
// ============================================================================
|
|
13612
13861
|
// Identity Methods
|
|
@@ -13910,6 +14159,57 @@ var BentoLabsSDKModule = (() => {
|
|
|
13910
14159
|
var _a2;
|
|
13911
14160
|
return ((_a2 = this.consoleMonitor) == null ? void 0 : _a2.getLogs()) || [];
|
|
13912
14161
|
}
|
|
14162
|
+
/**
|
|
14163
|
+
* Start Web Vitals monitoring
|
|
14164
|
+
* Captures LCP, FCP, INP, CLS, and optionally TTFB
|
|
14165
|
+
*/
|
|
14166
|
+
startWebVitalsCapture() {
|
|
14167
|
+
var _a2;
|
|
14168
|
+
if (typeof window === "undefined") return;
|
|
14169
|
+
const allowedMetrics = this.config.webVitalsOptions.allowedMetrics || ["LCP", "FCP", "INP", "CLS"];
|
|
14170
|
+
const captureAttribution = (_a2 = this.config.webVitalsOptions.captureAttribution) != null ? _a2 : true;
|
|
14171
|
+
const captureMetric = (metric, metricName) => {
|
|
14172
|
+
if (this.optedOut) return;
|
|
14173
|
+
const properties = {
|
|
14174
|
+
[`$web_vitals_${metricName}_value`]: metric.value,
|
|
14175
|
+
$pathname: window.location.pathname,
|
|
14176
|
+
$current_url: window.location.href
|
|
14177
|
+
};
|
|
14178
|
+
if (captureAttribution) {
|
|
14179
|
+
properties[`$web_vitals_${metricName}_event`] = {
|
|
14180
|
+
name: metric.name,
|
|
14181
|
+
value: metric.value,
|
|
14182
|
+
rating: metric.rating,
|
|
14183
|
+
delta: metric.delta,
|
|
14184
|
+
id: metric.id,
|
|
14185
|
+
navigationType: metric.navigationType,
|
|
14186
|
+
attribution: "attribution" in metric ? metric.attribution : void 0
|
|
14187
|
+
};
|
|
14188
|
+
}
|
|
14189
|
+
this.capture("$web_vitals", properties);
|
|
14190
|
+
if (this.config.debug) {
|
|
14191
|
+
console.log(`[BentoLabsSDK] Web Vital captured: ${metricName} = ${metric.value} (${metric.rating})`);
|
|
14192
|
+
}
|
|
14193
|
+
};
|
|
14194
|
+
if (allowedMetrics.includes("LCP")) {
|
|
14195
|
+
G((metric) => captureMetric(metric, "LCP"));
|
|
14196
|
+
}
|
|
14197
|
+
if (allowedMetrics.includes("FCP")) {
|
|
14198
|
+
S((metric) => captureMetric(metric, "FCP"));
|
|
14199
|
+
}
|
|
14200
|
+
if (allowedMetrics.includes("INP")) {
|
|
14201
|
+
j((metric) => captureMetric(metric, "INP"));
|
|
14202
|
+
}
|
|
14203
|
+
if (allowedMetrics.includes("CLS")) {
|
|
14204
|
+
w((metric) => captureMetric(metric, "CLS"));
|
|
14205
|
+
}
|
|
14206
|
+
if (allowedMetrics.includes("TTFB")) {
|
|
14207
|
+
Q((metric) => captureMetric(metric, "TTFB"));
|
|
14208
|
+
}
|
|
14209
|
+
if (this.config.debug) {
|
|
14210
|
+
console.log("[BentoLabsSDK] Web Vitals capture started for:", allowedMetrics);
|
|
14211
|
+
}
|
|
14212
|
+
}
|
|
13913
14213
|
// ============================================================================
|
|
13914
14214
|
// Existing Public Methods (Preserved)
|
|
13915
14215
|
// ============================================================================
|
|
@@ -13967,7 +14267,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
13967
14267
|
capture_storage: this.config.capture_storage,
|
|
13968
14268
|
storageOptions: this.config.storageOptions,
|
|
13969
14269
|
capture_console: this.config.capture_console,
|
|
13970
|
-
consoleOptions: this.config.consoleOptions
|
|
14270
|
+
consoleOptions: this.config.consoleOptions,
|
|
14271
|
+
capture_web_vitals: this.config.capture_web_vitals,
|
|
14272
|
+
webVitalsOptions: this.config.webVitalsOptions
|
|
13971
14273
|
};
|
|
13972
14274
|
}
|
|
13973
14275
|
/**
|
|
@@ -13994,10 +14296,10 @@ var BentoLabsSDKModule = (() => {
|
|
|
13994
14296
|
return `anon_${uuid}`;
|
|
13995
14297
|
}
|
|
13996
14298
|
generateUUID() {
|
|
13997
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
|
14299
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c2) {
|
|
13998
14300
|
const r = Math.random() * 16 | 0;
|
|
13999
|
-
const
|
|
14000
|
-
return
|
|
14301
|
+
const v2 = c2 === "x" ? r : r & 3 | 8;
|
|
14302
|
+
return v2.toString(16);
|
|
14001
14303
|
});
|
|
14002
14304
|
}
|
|
14003
14305
|
isDNTEnabled() {
|
|
@@ -14019,7 +14321,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
14019
14321
|
if (storedSuperProps) {
|
|
14020
14322
|
try {
|
|
14021
14323
|
this.superProperties = JSON.parse(storedSuperProps);
|
|
14022
|
-
} catch (
|
|
14324
|
+
} catch (e3) {
|
|
14023
14325
|
this.superProperties = {};
|
|
14024
14326
|
}
|
|
14025
14327
|
}
|
|
@@ -14027,7 +14329,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
14027
14329
|
if (storedUserProps) {
|
|
14028
14330
|
try {
|
|
14029
14331
|
this.identity.properties = JSON.parse(storedUserProps);
|
|
14030
|
-
} catch (
|
|
14332
|
+
} catch (e3) {
|
|
14031
14333
|
this.identity.properties = {};
|
|
14032
14334
|
}
|
|
14033
14335
|
}
|
|
@@ -14239,7 +14541,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
14239
14541
|
if (eventsToRetry.length > 0) {
|
|
14240
14542
|
this.events.unshift(...eventsToRetry);
|
|
14241
14543
|
if (this.config.debug) {
|
|
14242
|
-
const nextRetryIn = Math.min(...eventsToRetry.map((
|
|
14544
|
+
const nextRetryIn = Math.min(...eventsToRetry.map((e3) => e3.nextRetryTime)) - now;
|
|
14243
14545
|
console.log(`[BentoLabsSDK] ${eventsToRetry.length} events re-queued for retry in ${nextRetryIn}ms`);
|
|
14244
14546
|
}
|
|
14245
14547
|
}
|
|
@@ -14257,7 +14559,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
14257
14559
|
if (retryableEvents.length === 0) {
|
|
14258
14560
|
return;
|
|
14259
14561
|
}
|
|
14260
|
-
const nextRetryTime = Math.min(...retryableEvents.map((
|
|
14562
|
+
const nextRetryTime = Math.min(...retryableEvents.map((e3) => e3.nextRetryTime));
|
|
14261
14563
|
const delay = Math.max(0, nextRetryTime - now);
|
|
14262
14564
|
if (this.config.debug) {
|
|
14263
14565
|
console.log(`[BentoLabsSDK] Scheduling retry in ${delay}ms`);
|
|
@@ -14287,9 +14589,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
14287
14589
|
}
|
|
14288
14590
|
setupAutocapture() {
|
|
14289
14591
|
if (typeof document === "undefined") return;
|
|
14290
|
-
const handleClick = (
|
|
14592
|
+
const handleClick = (e3) => {
|
|
14291
14593
|
var _a2;
|
|
14292
|
-
const target =
|
|
14594
|
+
const target = e3.target;
|
|
14293
14595
|
if (!target) return;
|
|
14294
14596
|
const tagName = target.tagName.toLowerCase();
|
|
14295
14597
|
const allowedTags = ["a", "button", "input", "select", "textarea"];
|
|
@@ -14298,7 +14600,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
14298
14600
|
let selector = "";
|
|
14299
14601
|
try {
|
|
14300
14602
|
selector = generateSelectorFromElement(target);
|
|
14301
|
-
} catch (
|
|
14603
|
+
} catch (e4) {
|
|
14302
14604
|
selector = "";
|
|
14303
14605
|
}
|
|
14304
14606
|
this.capture("$autocapture", {
|
|
@@ -14310,8 +14612,8 @@ var BentoLabsSDKModule = (() => {
|
|
|
14310
14612
|
$bento_selector: selector
|
|
14311
14613
|
});
|
|
14312
14614
|
};
|
|
14313
|
-
const handleChange = (
|
|
14314
|
-
const target =
|
|
14615
|
+
const handleChange = (e3) => {
|
|
14616
|
+
const target = e3.target;
|
|
14315
14617
|
if (!target) return;
|
|
14316
14618
|
const tagName = target.tagName.toLowerCase();
|
|
14317
14619
|
if (!["input", "select", "textarea"].includes(tagName)) return;
|
|
@@ -14319,7 +14621,7 @@ var BentoLabsSDKModule = (() => {
|
|
|
14319
14621
|
let selector = "";
|
|
14320
14622
|
try {
|
|
14321
14623
|
selector = generateSelectorFromElement(target);
|
|
14322
|
-
} catch (
|
|
14624
|
+
} catch (e4) {
|
|
14323
14625
|
selector = "";
|
|
14324
14626
|
}
|
|
14325
14627
|
this.capture("$autocapture", {
|
|
@@ -14332,13 +14634,13 @@ var BentoLabsSDKModule = (() => {
|
|
|
14332
14634
|
// Don't capture actual value for privacy
|
|
14333
14635
|
});
|
|
14334
14636
|
};
|
|
14335
|
-
const handleSubmit = (
|
|
14336
|
-
const target =
|
|
14637
|
+
const handleSubmit = (e3) => {
|
|
14638
|
+
const target = e3.target;
|
|
14337
14639
|
if (!target || target.tagName.toLowerCase() !== "form") return;
|
|
14338
14640
|
let selector = "";
|
|
14339
14641
|
try {
|
|
14340
14642
|
selector = generateSelectorFromElement(target);
|
|
14341
|
-
} catch (
|
|
14643
|
+
} catch (e4) {
|
|
14342
14644
|
selector = "";
|
|
14343
14645
|
}
|
|
14344
14646
|
this.capture("$autocapture", {
|
|
@@ -14422,7 +14724,9 @@ var BentoLabsSDKModule = (() => {
|
|
|
14422
14724
|
stopConsoleCapture: sdk.stopConsoleCapture.bind(sdk),
|
|
14423
14725
|
getNetworkLogs: sdk.getNetworkLogs.bind(sdk),
|
|
14424
14726
|
getStorageLogs: sdk.getStorageLogs.bind(sdk),
|
|
14425
|
-
getConsoleLogs: sdk.getConsoleLogs.bind(sdk)
|
|
14727
|
+
getConsoleLogs: sdk.getConsoleLogs.bind(sdk),
|
|
14728
|
+
// Web Vitals
|
|
14729
|
+
startWebVitalsCapture: sdk.startWebVitalsCapture.bind(sdk)
|
|
14426
14730
|
};
|
|
14427
14731
|
}
|
|
14428
14732
|
var index_default = sdk;
|