@symbo.ls/sdk 2.33.41 → 2.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,7 +80,7 @@ var init_set = __esm({
80
80
  });
81
81
 
82
82
  // ../../../node_modules/lib0/array.js
83
- var last, appendTo, from, isArray;
83
+ var last, appendTo, from, every, some, unfold, isArray;
84
84
  var init_array = __esm({
85
85
  "../../../node_modules/lib0/array.js"() {
86
86
  last = (arr) => arr[arr.length - 1];
@@ -90,6 +90,29 @@ var init_array = __esm({
90
90
  }
91
91
  };
92
92
  from = Array.from;
93
+ every = (arr, f3) => {
94
+ for (let i3 = 0; i3 < arr.length; i3++) {
95
+ if (!f3(arr[i3], i3, arr)) {
96
+ return false;
97
+ }
98
+ }
99
+ return true;
100
+ };
101
+ some = (arr, f3) => {
102
+ for (let i3 = 0; i3 < arr.length; i3++) {
103
+ if (f3(arr[i3], i3, arr)) {
104
+ return true;
105
+ }
106
+ }
107
+ return false;
108
+ };
109
+ unfold = (len, f3) => {
110
+ const array = new Array(len);
111
+ for (let i3 = 0; i3 < len; i3++) {
112
+ array[i3] = f3(i3, array);
113
+ }
114
+ return array;
115
+ };
93
116
  isArray = Array.isArray;
94
117
  }
95
118
  });
@@ -285,23 +308,24 @@ var init_binary = __esm({
285
308
  });
286
309
 
287
310
  // ../../../node_modules/lib0/number.js
288
- var MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, LOWEST_INT32, isInteger, isNaN3, parseInt2;
311
+ var MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, LOWEST_INT32, isInteger2, isNaN3, parseInt2;
289
312
  var init_number = __esm({
290
313
  "../../../node_modules/lib0/number.js"() {
291
314
  init_math();
292
315
  MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
293
316
  MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER;
294
317
  LOWEST_INT32 = 1 << 31;
295
- isInteger = Number.isInteger || ((num) => typeof num === "number" && isFinite(num) && floor(num) === num);
318
+ isInteger2 = Number.isInteger || ((num) => typeof num === "number" && isFinite(num) && floor(num) === num);
296
319
  isNaN3 = Number.isNaN;
297
320
  parseInt2 = Number.parseInt;
298
321
  }
299
322
  });
300
323
 
301
324
  // ../../../node_modules/lib0/string.js
302
- var fromCharCode, fromCodePoint, MAX_UTF16_CHARACTER, toLowerCase, trimLeftRegex, trimLeft, fromCamelCaseRegex, fromCamelCase, _encodeUtf8Polyfill, utf8TextEncoder, _encodeUtf8Native, encodeUtf8, utf8TextDecoder;
325
+ var fromCharCode, fromCodePoint, MAX_UTF16_CHARACTER, toLowerCase, trimLeftRegex, trimLeft, fromCamelCaseRegex, fromCamelCase, _encodeUtf8Polyfill, utf8TextEncoder, _encodeUtf8Native, encodeUtf8, utf8TextDecoder, repeat;
303
326
  var init_string = __esm({
304
327
  "../../../node_modules/lib0/string.js"() {
328
+ init_array();
305
329
  fromCharCode = String.fromCharCode;
306
330
  fromCodePoint = String.fromCodePoint;
307
331
  MAX_UTF16_CHARACTER = fromCharCode(65535);
@@ -309,7 +333,7 @@ var init_string = __esm({
309
333
  trimLeftRegex = /^\s*/g;
310
334
  trimLeft = (s3) => s3.replace(trimLeftRegex, "");
311
335
  fromCamelCaseRegex = /([A-Z])/g;
312
- fromCamelCase = (s3, separator) => trimLeft(s3.replace(fromCamelCaseRegex, (match) => `${separator}${toLowerCase(match)}`));
336
+ fromCamelCase = (s3, separator) => trimLeft(s3.replace(fromCamelCaseRegex, (match2) => `${separator}${toLowerCase(match2)}`));
313
337
  _encodeUtf8Polyfill = (str) => {
314
338
  const encodedString = unescape(encodeURIComponent(str));
315
339
  const len = encodedString.length;
@@ -328,6 +352,7 @@ var init_string = __esm({
328
352
  if (utf8TextDecoder && utf8TextDecoder.decode(new Uint8Array()).length === 1) {
329
353
  utf8TextDecoder = null;
330
354
  }
355
+ repeat = (source, n3) => unfold(n3, () => source).join("");
331
356
  }
332
357
  });
333
358
 
@@ -472,7 +497,7 @@ var init_encoding = __esm({
472
497
  writeVarString(encoder, data2);
473
498
  break;
474
499
  case "number":
475
- if (isInteger(data2) && abs(data2) <= BITS31) {
500
+ if (isInteger2(data2) && abs(data2) <= BITS31) {
476
501
  write(encoder, 125);
477
502
  writeVarInt(encoder, data2);
478
503
  } else if (isFloat32(data2)) {
@@ -675,7 +700,7 @@ var init_decoding = __esm({
675
700
  errorIntegerOutOfRange = create3("Integer out of Range");
676
701
  Decoder2 = class {
677
702
  /**
678
- * @param {Uint8Array} uint8Array Binary data to decode
703
+ * @param {Uint8Array<Buf>} uint8Array Binary data to decode
679
704
  */
680
705
  constructor(uint8Array) {
681
706
  this.arr = uint8Array;
@@ -1002,10 +1027,24 @@ var init_storage = __esm({
1002
1027
  }
1003
1028
  });
1004
1029
 
1030
+ // ../../../node_modules/lib0/trait/equality.js
1031
+ var EqualityTraitSymbol, equals;
1032
+ var init_equality = __esm({
1033
+ "../../../node_modules/lib0/trait/equality.js"() {
1034
+ EqualityTraitSymbol = Symbol("Equality");
1035
+ equals = (a3, b3) => {
1036
+ var _a2;
1037
+ return a3 === b3 || !!((_a2 = a3 == null ? void 0 : a3[EqualityTraitSymbol]) == null ? void 0 : _a2.call(a3, b3)) || false;
1038
+ };
1039
+ }
1040
+ });
1041
+
1005
1042
  // ../../../node_modules/lib0/object.js
1006
- var assign, keys, forEach, size, isEmpty, every, hasProperty, equalFlat, freeze, deepFreeze;
1043
+ var isObject2, assign, keys, forEach, size, isEmpty, every2, hasProperty, equalFlat, freeze, deepFreeze;
1007
1044
  var init_object = __esm({
1008
1045
  "../../../node_modules/lib0/object.js"() {
1046
+ init_equality();
1047
+ isObject2 = (o3) => typeof o3 === "object";
1009
1048
  assign = Object.assign;
1010
1049
  keys = Object.keys;
1011
1050
  forEach = (obj, f3) => {
@@ -1020,7 +1059,7 @@ var init_object = __esm({
1020
1059
  }
1021
1060
  return true;
1022
1061
  };
1023
- every = (obj, f3) => {
1062
+ every2 = (obj, f3) => {
1024
1063
  for (const key in obj) {
1025
1064
  if (!f3(obj[key], key)) {
1026
1065
  return false;
@@ -1029,7 +1068,7 @@ var init_object = __esm({
1029
1068
  return true;
1030
1069
  };
1031
1070
  hasProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
1032
- equalFlat = (a3, b3) => a3 === b3 || size(a3) === size(b3) && every(a3, (val, key) => (val !== void 0 || hasProperty(b3, key)) && b3[key] === val);
1071
+ equalFlat = (a3, b3) => a3 === b3 || size(a3) === size(b3) && every2(a3, (val, key) => (val !== void 0 || hasProperty(b3, key)) && equals(b3[key], val));
1033
1072
  freeze = Object.freeze;
1034
1073
  deepFreeze = (o3) => {
1035
1074
  for (const key in o3) {
@@ -1044,9 +1083,11 @@ var init_object = __esm({
1044
1083
  });
1045
1084
 
1046
1085
  // ../../../node_modules/lib0/function.js
1047
- var callAll, id, isOneOf;
1086
+ var callAll, id, equalityDeep, isOneOf;
1048
1087
  var init_function = __esm({
1049
1088
  "../../../node_modules/lib0/function.js"() {
1089
+ init_object();
1090
+ init_equality();
1050
1091
  callAll = (fs, args2, i3 = 0) => {
1051
1092
  try {
1052
1093
  for (; i3 < fs.length; i3++) {
@@ -1059,6 +1100,80 @@ var init_function = __esm({
1059
1100
  }
1060
1101
  };
1061
1102
  id = (a3) => a3;
1103
+ equalityDeep = (a3, b3) => {
1104
+ if (a3 === b3) {
1105
+ return true;
1106
+ }
1107
+ if (a3 == null || b3 == null || a3.constructor !== b3.constructor && (a3.constructor || Object) !== (b3.constructor || Object)) {
1108
+ return false;
1109
+ }
1110
+ if (a3[EqualityTraitSymbol] != null) {
1111
+ return a3[EqualityTraitSymbol](b3);
1112
+ }
1113
+ switch (a3.constructor) {
1114
+ case ArrayBuffer:
1115
+ a3 = new Uint8Array(a3);
1116
+ b3 = new Uint8Array(b3);
1117
+ // eslint-disable-next-line no-fallthrough
1118
+ case Uint8Array: {
1119
+ if (a3.byteLength !== b3.byteLength) {
1120
+ return false;
1121
+ }
1122
+ for (let i3 = 0; i3 < a3.length; i3++) {
1123
+ if (a3[i3] !== b3[i3]) {
1124
+ return false;
1125
+ }
1126
+ }
1127
+ break;
1128
+ }
1129
+ case Set: {
1130
+ if (a3.size !== b3.size) {
1131
+ return false;
1132
+ }
1133
+ for (const value2 of a3) {
1134
+ if (!b3.has(value2)) {
1135
+ return false;
1136
+ }
1137
+ }
1138
+ break;
1139
+ }
1140
+ case Map: {
1141
+ if (a3.size !== b3.size) {
1142
+ return false;
1143
+ }
1144
+ for (const key of a3.keys()) {
1145
+ if (!b3.has(key) || !equalityDeep(a3.get(key), b3.get(key))) {
1146
+ return false;
1147
+ }
1148
+ }
1149
+ break;
1150
+ }
1151
+ case void 0:
1152
+ case Object:
1153
+ if (size(a3) !== size(b3)) {
1154
+ return false;
1155
+ }
1156
+ for (const key in a3) {
1157
+ if (!hasProperty(a3, key) || !equalityDeep(a3[key], b3[key])) {
1158
+ return false;
1159
+ }
1160
+ }
1161
+ break;
1162
+ case Array:
1163
+ if (a3.length !== b3.length) {
1164
+ return false;
1165
+ }
1166
+ for (let i3 = 0; i3 < a3.length; i3++) {
1167
+ if (!equalityDeep(a3[i3], b3[i3])) {
1168
+ return false;
1169
+ }
1170
+ }
1171
+ break;
1172
+ default:
1173
+ return false;
1174
+ }
1175
+ return true;
1176
+ };
1062
1177
  isOneOf = (value2, options) => options.includes(value2);
1063
1178
  }
1064
1179
  });
@@ -1156,15 +1271,769 @@ var init_pair = __esm({
1156
1271
  }
1157
1272
  });
1158
1273
 
1274
+ // ../../../node_modules/lib0/prng.js
1275
+ var bool, int53, int32, int31, letter, word, oneOf;
1276
+ var init_prng = __esm({
1277
+ "../../../node_modules/lib0/prng.js"() {
1278
+ init_string();
1279
+ init_math();
1280
+ bool = (gen) => gen.next() >= 0.5;
1281
+ int53 = (gen, min2, max2) => floor(gen.next() * (max2 + 1 - min2) + min2);
1282
+ int32 = (gen, min2, max2) => floor(gen.next() * (max2 + 1 - min2) + min2);
1283
+ int31 = (gen, min2, max2) => int32(gen, min2, max2);
1284
+ letter = (gen) => fromCharCode(int31(gen, 97, 122));
1285
+ word = (gen, minLen = 0, maxLen = 20) => {
1286
+ const len = int31(gen, minLen, maxLen);
1287
+ let str = "";
1288
+ for (let i3 = 0; i3 < len; i3++) {
1289
+ str += letter(gen);
1290
+ }
1291
+ return str;
1292
+ };
1293
+ oneOf = (gen, array) => array[int31(gen, 0, array.length - 1)];
1294
+ }
1295
+ });
1296
+
1297
+ // ../../../node_modules/lib0/schema.js
1298
+ var schemaSymbol, ValidationError, shapeExtends, Schema, $ConstructedBy, $constructedBy, $$constructedBy, $Custom, $custom, $$custom, $Literal, $literal, $$literal, _regexEscape, _schemaStringTemplateToRegex, $StringTemplate, $$stringTemplate, isOptionalSymbol, $Optional, $$optional, $Never, $never, $$never, _$Object, $Object, $object, $$object, $objectAny, $Record, $record, $$record, $Tuple, $tuple, $$tuple, $Array, $array, $$array, $arrayAny, $InstanceOf, $instanceOf, $$instanceOf, $$schema, $Lambda, $$lambda, $function, $Intersection, $$intersect, $Union, $union, $$union, _t, $any, $$any, $bigint, $$bigint, $symbol, $$symbol, $number, $$number, $string, $$string, $boolean, $$boolean, $undefined, $$undefined, $void, $null, $$null, $uint8Array, $$uint8Array, $primitive, $json, $, assert, PatternMatcher, match, _random, random;
1299
+ var init_schema = __esm({
1300
+ "../../../node_modules/lib0/schema.js"() {
1301
+ init_object();
1302
+ init_array();
1303
+ init_error();
1304
+ init_environment();
1305
+ init_equality();
1306
+ init_function();
1307
+ init_string();
1308
+ init_prng();
1309
+ init_number();
1310
+ schemaSymbol = Symbol("0schema");
1311
+ ValidationError = class {
1312
+ constructor() {
1313
+ this._rerrs = [];
1314
+ }
1315
+ /**
1316
+ * @param {string?} path
1317
+ * @param {string} expected
1318
+ * @param {string} has
1319
+ * @param {string?} message
1320
+ */
1321
+ extend(path, expected, has, message = null) {
1322
+ this._rerrs.push({ path, expected, has, message });
1323
+ }
1324
+ toString() {
1325
+ const s3 = [];
1326
+ for (let i3 = this._rerrs.length - 1; i3 > 0; i3--) {
1327
+ const r3 = this._rerrs[i3];
1328
+ s3.push(repeat(" ", (this._rerrs.length - i3) * 2) + `${r3.path != null ? `[${r3.path}] ` : ""}${r3.has} doesn't match ${r3.expected}. ${r3.message}`);
1329
+ }
1330
+ return s3.join("\n");
1331
+ }
1332
+ };
1333
+ shapeExtends = (a3, b3) => {
1334
+ if (a3 === b3) return true;
1335
+ if (a3 == null || b3 == null || a3.constructor !== b3.constructor) return false;
1336
+ if (a3[EqualityTraitSymbol]) return equals(a3, b3);
1337
+ if (isArray(a3)) {
1338
+ return every(
1339
+ a3,
1340
+ (aitem) => some(b3, (bitem) => shapeExtends(aitem, bitem))
1341
+ );
1342
+ } else if (isObject2(a3)) {
1343
+ return every2(
1344
+ a3,
1345
+ (aitem, akey) => shapeExtends(aitem, b3[akey])
1346
+ );
1347
+ }
1348
+ return false;
1349
+ };
1350
+ Schema = class {
1351
+ /**
1352
+ * @param {Schema<any>} other
1353
+ */
1354
+ extends(other) {
1355
+ let [a3, b3] = [
1356
+ /** @type {any} */
1357
+ this.shape,
1358
+ /** @type {any} */
1359
+ other.shape
1360
+ ];
1361
+ if (
1362
+ /** @type {typeof Schema<any>} */
1363
+ this.constructor._dilutes
1364
+ ) [b3, a3] = [a3, b3];
1365
+ return shapeExtends(a3, b3);
1366
+ }
1367
+ /**
1368
+ * Overwrite this when necessary. By default, we only check the `shape` property which every shape
1369
+ * should have.
1370
+ * @param {Schema<any>} other
1371
+ */
1372
+ equals(other) {
1373
+ return this.constructor === other.constructor && equalityDeep(this.shape, other.shape);
1374
+ }
1375
+ [schemaSymbol]() {
1376
+ return true;
1377
+ }
1378
+ /**
1379
+ * @param {object} other
1380
+ */
1381
+ [EqualityTraitSymbol](other) {
1382
+ return this.equals(
1383
+ /** @type {any} */
1384
+ other
1385
+ );
1386
+ }
1387
+ /**
1388
+ * Use `schema.validate(obj)` with a typed parameter that is already of typed to be an instance of
1389
+ * Schema. Validate will check the structure of the parameter and return true iff the instance
1390
+ * really is an instance of Schema.
1391
+ *
1392
+ * @param {T} o
1393
+ * @return {boolean}
1394
+ */
1395
+ validate(o3) {
1396
+ return this.check(o3);
1397
+ }
1398
+ /* c8 ignore start */
1399
+ /**
1400
+ * Similar to validate, but this method accepts untyped parameters.
1401
+ *
1402
+ * @param {any} _o
1403
+ * @param {ValidationError} [_err]
1404
+ * @return {_o is T}
1405
+ */
1406
+ check(_o, _err) {
1407
+ methodUnimplemented();
1408
+ }
1409
+ /* c8 ignore stop */
1410
+ /**
1411
+ * @type {Schema<T?>}
1412
+ */
1413
+ get nullable() {
1414
+ return $union(this, $null);
1415
+ }
1416
+ /**
1417
+ * @type {$Optional<Schema<T>>}
1418
+ */
1419
+ get optional() {
1420
+ return new $Optional(
1421
+ /** @type {Schema<T>} */
1422
+ this
1423
+ );
1424
+ }
1425
+ /**
1426
+ * Cast a variable to a specific type. Returns the casted value, or throws an exception otherwise.
1427
+ * Use this if you know that the type is of a specific type and you just want to convince the type
1428
+ * system.
1429
+ *
1430
+ * **Do not rely on these error messages!**
1431
+ * Performs an assertion check only if not in a production environment.
1432
+ *
1433
+ * @template OO
1434
+ * @param {OO} o
1435
+ * @return {Extract<OO, T> extends never ? T : (OO extends Array<never> ? T : Extract<OO,T>)}
1436
+ */
1437
+ cast(o3) {
1438
+ assert(o3, this);
1439
+ return (
1440
+ /** @type {any} */
1441
+ o3
1442
+ );
1443
+ }
1444
+ /**
1445
+ * EXPECTO PATRONUM!! 🪄
1446
+ * This function protects against type errors. Though it may not work in the real world.
1447
+ *
1448
+ * "After all this time?"
1449
+ * "Always." - Snape, talking about type safety
1450
+ *
1451
+ * Ensures that a variable is a a specific type. Returns the value, or throws an exception if the assertion check failed.
1452
+ * Use this if you know that the type is of a specific type and you just want to convince the type
1453
+ * system.
1454
+ *
1455
+ * Can be useful when defining lambdas: `s.lambda(s.$number, s.$void).expect((n) => n + 1)`
1456
+ *
1457
+ * **Do not rely on these error messages!**
1458
+ * Performs an assertion check if not in a production environment.
1459
+ *
1460
+ * @param {T} o
1461
+ * @return {o extends T ? T : never}
1462
+ */
1463
+ expect(o3) {
1464
+ assert(o3, this);
1465
+ return o3;
1466
+ }
1467
+ };
1468
+ // this.shape must not be defined on Schema. Otherwise typecheck on metatypes (e.g. $$object) won't work as expected anymore
1469
+ /**
1470
+ * If true, the more things are added to the shape the more objects this schema will accept (e.g.
1471
+ * union). By default, the more objects are added, the the fewer objects this schema will accept.
1472
+ * @protected
1473
+ */
1474
+ __publicField(Schema, "_dilutes", false);
1475
+ $ConstructedBy = class extends Schema {
1476
+ /**
1477
+ * @param {C} c
1478
+ * @param {((o:Instance<C>)=>boolean)|null} check
1479
+ */
1480
+ constructor(c3, check) {
1481
+ super();
1482
+ this.shape = c3;
1483
+ this._c = check;
1484
+ }
1485
+ /**
1486
+ * @param {any} o
1487
+ * @param {ValidationError} [err]
1488
+ * @return {o is C extends ((...args:any[]) => infer T) ? T : (C extends (new (...args:any[]) => any) ? InstanceType<C> : never)} o
1489
+ */
1490
+ check(o3, err = void 0) {
1491
+ const c3 = (o3 == null ? void 0 : o3.constructor) === this.shape && (this._c == null || this._c(o3));
1492
+ !c3 && (err == null ? void 0 : err.extend(null, this.shape.name, o3 == null ? void 0 : o3.constructor.name, (o3 == null ? void 0 : o3.constructor) !== this.shape ? "Constructor match failed" : "Check failed"));
1493
+ return c3;
1494
+ }
1495
+ };
1496
+ $constructedBy = (c3, check = null) => new $ConstructedBy(c3, check);
1497
+ $$constructedBy = $constructedBy($ConstructedBy);
1498
+ $Custom = class extends Schema {
1499
+ /**
1500
+ * @param {(o:any) => boolean} check
1501
+ */
1502
+ constructor(check) {
1503
+ super();
1504
+ this.shape = check;
1505
+ }
1506
+ /**
1507
+ * @param {any} o
1508
+ * @param {ValidationError} err
1509
+ * @return {o is any}
1510
+ */
1511
+ check(o3, err) {
1512
+ const c3 = this.shape(o3);
1513
+ !c3 && (err == null ? void 0 : err.extend(null, "custom prop", o3 == null ? void 0 : o3.constructor.name, "failed to check custom prop"));
1514
+ return c3;
1515
+ }
1516
+ };
1517
+ $custom = (check) => new $Custom(check);
1518
+ $$custom = $constructedBy($Custom);
1519
+ $Literal = class extends Schema {
1520
+ /**
1521
+ * @param {Array<T>} literals
1522
+ */
1523
+ constructor(literals) {
1524
+ super();
1525
+ this.shape = literals;
1526
+ }
1527
+ /**
1528
+ *
1529
+ * @param {any} o
1530
+ * @param {ValidationError} [err]
1531
+ * @return {o is T}
1532
+ */
1533
+ check(o3, err) {
1534
+ const c3 = this.shape.some((a3) => a3 === o3);
1535
+ !c3 && (err == null ? void 0 : err.extend(null, this.shape.join(" | "), o3.toString()));
1536
+ return c3;
1537
+ }
1538
+ };
1539
+ $literal = (...literals) => new $Literal(literals);
1540
+ $$literal = $constructedBy($Literal);
1541
+ _regexEscape = /** @type {any} */
1542
+ RegExp.escape || /** @type {(str:string) => string} */
1543
+ ((str) => str.replace(/[().|&,$^[\]]/g, (s3) => "\\" + s3));
1544
+ _schemaStringTemplateToRegex = (s3) => {
1545
+ if ($string.check(s3)) {
1546
+ return [_regexEscape(s3)];
1547
+ }
1548
+ if ($$literal.check(s3)) {
1549
+ return (
1550
+ /** @type {Array<string|number>} */
1551
+ s3.shape.map((v3) => v3 + "")
1552
+ );
1553
+ }
1554
+ if ($$number.check(s3)) {
1555
+ return ["[+-]?\\d+.?\\d*"];
1556
+ }
1557
+ if ($$string.check(s3)) {
1558
+ return [".*"];
1559
+ }
1560
+ if ($$union.check(s3)) {
1561
+ return s3.shape.map(_schemaStringTemplateToRegex).flat(1);
1562
+ }
1563
+ unexpectedCase();
1564
+ };
1565
+ $StringTemplate = class extends Schema {
1566
+ /**
1567
+ * @param {T} shape
1568
+ */
1569
+ constructor(shape) {
1570
+ super();
1571
+ this.shape = shape;
1572
+ this._r = new RegExp("^" + shape.map(_schemaStringTemplateToRegex).map((opts) => `(${opts.join("|")})`).join("") + "$");
1573
+ }
1574
+ /**
1575
+ * @param {any} o
1576
+ * @param {ValidationError} [err]
1577
+ * @return {o is CastStringTemplateArgsToTemplate<T>}
1578
+ */
1579
+ check(o3, err) {
1580
+ const c3 = this._r.exec(o3) != null;
1581
+ !c3 && (err == null ? void 0 : err.extend(null, this._r.toString(), o3.toString(), "String doesn't match string template."));
1582
+ return c3;
1583
+ }
1584
+ };
1585
+ $$stringTemplate = $constructedBy($StringTemplate);
1586
+ isOptionalSymbol = Symbol("optional");
1587
+ $Optional = class extends Schema {
1588
+ /**
1589
+ * @param {S} shape
1590
+ */
1591
+ constructor(shape) {
1592
+ super();
1593
+ this.shape = shape;
1594
+ }
1595
+ /**
1596
+ * @param {any} o
1597
+ * @param {ValidationError} [err]
1598
+ * @return {o is (Unwrap<S>|undefined)}
1599
+ */
1600
+ check(o3, err) {
1601
+ const c3 = o3 === void 0 || this.shape.check(o3);
1602
+ !c3 && (err == null ? void 0 : err.extend(null, "undefined (optional)", "()"));
1603
+ return c3;
1604
+ }
1605
+ get [isOptionalSymbol]() {
1606
+ return true;
1607
+ }
1608
+ };
1609
+ $$optional = $constructedBy($Optional);
1610
+ $Never = class extends Schema {
1611
+ /**
1612
+ * @param {any} _o
1613
+ * @param {ValidationError} [err]
1614
+ * @return {_o is never}
1615
+ */
1616
+ check(_o, err) {
1617
+ err == null ? void 0 : err.extend(null, "never", typeof _o);
1618
+ return false;
1619
+ }
1620
+ };
1621
+ $never = new $Never();
1622
+ $$never = $constructedBy($Never);
1623
+ _$Object = class _$Object extends Schema {
1624
+ /**
1625
+ * @param {S} shape
1626
+ * @param {boolean} partial
1627
+ */
1628
+ constructor(shape, partial = false) {
1629
+ super();
1630
+ this.shape = shape;
1631
+ this._isPartial = partial;
1632
+ }
1633
+ /**
1634
+ * @type {Schema<Partial<$ObjectToType<S>>>}
1635
+ */
1636
+ get partial() {
1637
+ return new _$Object(this.shape, true);
1638
+ }
1639
+ /**
1640
+ * @param {any} o
1641
+ * @param {ValidationError} err
1642
+ * @return {o is $ObjectToType<S>}
1643
+ */
1644
+ check(o3, err) {
1645
+ if (o3 == null) {
1646
+ err == null ? void 0 : err.extend(null, "object", "null");
1647
+ return false;
1648
+ }
1649
+ return every2(this.shape, (vv, vk) => {
1650
+ const c3 = this._isPartial && !hasProperty(o3, vk) || vv.check(o3[vk], err);
1651
+ !c3 && (err == null ? void 0 : err.extend(vk.toString(), vv.toString(), typeof o3[vk], "Object property does not match"));
1652
+ return c3;
1653
+ });
1654
+ }
1655
+ };
1656
+ __publicField(_$Object, "_dilutes", true);
1657
+ $Object = _$Object;
1658
+ $object = (def) => (
1659
+ /** @type {any} */
1660
+ new $Object(def)
1661
+ );
1662
+ $$object = $constructedBy($Object);
1663
+ $objectAny = $custom((o3) => o3 != null && (o3.constructor === Object || o3.constructor == null));
1664
+ $Record = class extends Schema {
1665
+ /**
1666
+ * @param {Keys} keys
1667
+ * @param {Values} values
1668
+ */
1669
+ constructor(keys2, values) {
1670
+ super();
1671
+ this.shape = {
1672
+ keys: keys2,
1673
+ values
1674
+ };
1675
+ }
1676
+ /**
1677
+ * @param {any} o
1678
+ * @param {ValidationError} err
1679
+ * @return {o is { [key in Unwrap<Keys>]: Unwrap<Values> }}
1680
+ */
1681
+ check(o3, err) {
1682
+ return o3 != null && every2(o3, (vv, vk) => {
1683
+ const ck = this.shape.keys.check(vk, err);
1684
+ !ck && (err == null ? void 0 : err.extend(vk + "", "Record", typeof o3, ck ? "Key doesn't match schema" : "Value doesn't match value"));
1685
+ return ck && this.shape.values.check(vv, err);
1686
+ });
1687
+ }
1688
+ };
1689
+ $record = (keys2, values) => new $Record(keys2, values);
1690
+ $$record = $constructedBy($Record);
1691
+ $Tuple = class extends Schema {
1692
+ /**
1693
+ * @param {S} shape
1694
+ */
1695
+ constructor(shape) {
1696
+ super();
1697
+ this.shape = shape;
1698
+ }
1699
+ /**
1700
+ * @param {any} o
1701
+ * @param {ValidationError} err
1702
+ * @return {o is { [K in keyof S]: S[K] extends Schema<infer Type> ? Type : never }}
1703
+ */
1704
+ check(o3, err) {
1705
+ return o3 != null && every2(this.shape, (vv, vk) => {
1706
+ const c3 = (
1707
+ /** @type {Schema<any>} */
1708
+ vv.check(o3[vk], err)
1709
+ );
1710
+ !c3 && (err == null ? void 0 : err.extend(vk.toString(), "Tuple", typeof vv));
1711
+ return c3;
1712
+ });
1713
+ }
1714
+ };
1715
+ $tuple = (...def) => new $Tuple(def);
1716
+ $$tuple = $constructedBy($Tuple);
1717
+ $Array = class extends Schema {
1718
+ /**
1719
+ * @param {Array<S>} v
1720
+ */
1721
+ constructor(v3) {
1722
+ super();
1723
+ this.shape = v3.length === 1 ? v3[0] : new $Union(v3);
1724
+ }
1725
+ /**
1726
+ * @param {any} o
1727
+ * @param {ValidationError} [err]
1728
+ * @return {o is Array<S extends Schema<infer T> ? T : never>} o
1729
+ */
1730
+ check(o3, err) {
1731
+ const c3 = isArray(o3) && every(o3, (oi) => this.shape.check(oi));
1732
+ !c3 && (err == null ? void 0 : err.extend(null, "Array", ""));
1733
+ return c3;
1734
+ }
1735
+ };
1736
+ $array = (...def) => new $Array(def);
1737
+ $$array = $constructedBy($Array);
1738
+ $arrayAny = $custom((o3) => isArray(o3));
1739
+ $InstanceOf = class extends Schema {
1740
+ /**
1741
+ * @param {new (...args:any) => T} constructor
1742
+ * @param {((o:T) => boolean)|null} check
1743
+ */
1744
+ constructor(constructor, check) {
1745
+ super();
1746
+ this.shape = constructor;
1747
+ this._c = check;
1748
+ }
1749
+ /**
1750
+ * @param {any} o
1751
+ * @param {ValidationError} err
1752
+ * @return {o is T}
1753
+ */
1754
+ check(o3, err) {
1755
+ const c3 = o3 instanceof this.shape && (this._c == null || this._c(o3));
1756
+ !c3 && (err == null ? void 0 : err.extend(null, this.shape.name, o3 == null ? void 0 : o3.constructor.name));
1757
+ return c3;
1758
+ }
1759
+ };
1760
+ $instanceOf = (c3, check = null) => new $InstanceOf(c3, check);
1761
+ $$instanceOf = $constructedBy($InstanceOf);
1762
+ $$schema = $instanceOf(Schema);
1763
+ $Lambda = class extends Schema {
1764
+ /**
1765
+ * @param {Args} args
1766
+ */
1767
+ constructor(args2) {
1768
+ super();
1769
+ this.len = args2.length - 1;
1770
+ this.args = $tuple(...args2.slice(-1));
1771
+ this.res = args2[this.len];
1772
+ }
1773
+ /**
1774
+ * @param {any} f
1775
+ * @param {ValidationError} err
1776
+ * @return {f is _LArgsToLambdaDef<Args>}
1777
+ */
1778
+ check(f3, err) {
1779
+ const c3 = f3.constructor === Function && f3.length <= this.len;
1780
+ !c3 && (err == null ? void 0 : err.extend(null, "function", typeof f3));
1781
+ return c3;
1782
+ }
1783
+ };
1784
+ $$lambda = $constructedBy($Lambda);
1785
+ $function = $custom((o3) => typeof o3 === "function");
1786
+ $Intersection = class extends Schema {
1787
+ /**
1788
+ * @param {T} v
1789
+ */
1790
+ constructor(v3) {
1791
+ super();
1792
+ this.shape = v3;
1793
+ }
1794
+ /**
1795
+ * @param {any} o
1796
+ * @param {ValidationError} [err]
1797
+ * @return {o is Intersect<UnwrapArray<T>>}
1798
+ */
1799
+ check(o3, err) {
1800
+ const c3 = every(this.shape, (check) => check.check(o3, err));
1801
+ !c3 && (err == null ? void 0 : err.extend(null, "Intersectinon", typeof o3));
1802
+ return c3;
1803
+ }
1804
+ };
1805
+ $$intersect = $constructedBy($Intersection, (o3) => o3.shape.length > 0);
1806
+ $Union = class extends Schema {
1807
+ /**
1808
+ * @param {Array<Schema<S>>} v
1809
+ */
1810
+ constructor(v3) {
1811
+ super();
1812
+ this.shape = v3;
1813
+ }
1814
+ /**
1815
+ * @param {any} o
1816
+ * @param {ValidationError} [err]
1817
+ * @return {o is S}
1818
+ */
1819
+ check(o3, err) {
1820
+ const c3 = some(this.shape, (vv) => vv.check(o3, err));
1821
+ err == null ? void 0 : err.extend(null, "Union", typeof o3);
1822
+ return c3;
1823
+ }
1824
+ };
1825
+ __publicField($Union, "_dilutes", true);
1826
+ $union = (...schemas) => schemas.findIndex(($s) => $$union.check($s)) >= 0 ? $union(...schemas.map(($s) => $($s)).map(($s) => $$union.check($s) ? $s.shape : [$s]).flat(1)) : schemas.length === 1 ? schemas[0] : new $Union(schemas);
1827
+ $$union = /** @type {Schema<$Union<any>>} */
1828
+ $constructedBy($Union);
1829
+ _t = () => true;
1830
+ $any = $custom(_t);
1831
+ $$any = /** @type {Schema<Schema<any>>} */
1832
+ $constructedBy($Custom, (o3) => o3.shape === _t);
1833
+ $bigint = $custom((o3) => typeof o3 === "bigint");
1834
+ $$bigint = /** @type {Schema<Schema<BigInt>>} */
1835
+ $custom((o3) => o3 === $bigint);
1836
+ $symbol = $custom((o3) => typeof o3 === "symbol");
1837
+ $$symbol = /** @type {Schema<Schema<Symbol>>} */
1838
+ $custom((o3) => o3 === $symbol);
1839
+ $number = $custom((o3) => typeof o3 === "number");
1840
+ $$number = /** @type {Schema<Schema<number>>} */
1841
+ $custom((o3) => o3 === $number);
1842
+ $string = $custom((o3) => typeof o3 === "string");
1843
+ $$string = /** @type {Schema<Schema<string>>} */
1844
+ $custom((o3) => o3 === $string);
1845
+ $boolean = $custom((o3) => typeof o3 === "boolean");
1846
+ $$boolean = /** @type {Schema<Schema<Boolean>>} */
1847
+ $custom((o3) => o3 === $boolean);
1848
+ $undefined = $literal(void 0);
1849
+ $$undefined = /** @type {Schema<Schema<undefined>>} */
1850
+ $constructedBy($Literal, (o3) => o3.shape.length === 1 && o3.shape[0] === void 0);
1851
+ $void = $literal(void 0);
1852
+ $null = $literal(null);
1853
+ $$null = /** @type {Schema<Schema<null>>} */
1854
+ $constructedBy($Literal, (o3) => o3.shape.length === 1 && o3.shape[0] === null);
1855
+ $uint8Array = $constructedBy(Uint8Array);
1856
+ $$uint8Array = /** @type {Schema<Schema<Uint8Array>>} */
1857
+ $constructedBy($ConstructedBy, (o3) => o3.shape === Uint8Array);
1858
+ $primitive = $union($number, $string, $null, $undefined, $bigint, $boolean, $symbol);
1859
+ $json = (() => {
1860
+ const $jsonArr = (
1861
+ /** @type {$Array<$any>} */
1862
+ $array($any)
1863
+ );
1864
+ const $jsonRecord = (
1865
+ /** @type {$Record<$string,$any>} */
1866
+ $record($string, $any)
1867
+ );
1868
+ const $json2 = $union($number, $string, $null, $boolean, $jsonArr, $jsonRecord);
1869
+ $jsonArr.shape = $json2;
1870
+ $jsonRecord.shape.values = $json2;
1871
+ return $json2;
1872
+ })();
1873
+ $ = (o3) => {
1874
+ if ($$schema.check(o3)) {
1875
+ return (
1876
+ /** @type {any} */
1877
+ o3
1878
+ );
1879
+ } else if ($objectAny.check(o3)) {
1880
+ const o22 = {};
1881
+ for (const k3 in o3) {
1882
+ o22[k3] = $(o3[k3]);
1883
+ }
1884
+ return (
1885
+ /** @type {any} */
1886
+ $object(o22)
1887
+ );
1888
+ } else if ($arrayAny.check(o3)) {
1889
+ return (
1890
+ /** @type {any} */
1891
+ $union(...o3.map($))
1892
+ );
1893
+ } else if ($primitive.check(o3)) {
1894
+ return (
1895
+ /** @type {any} */
1896
+ $literal(o3)
1897
+ );
1898
+ } else if ($function.check(o3)) {
1899
+ return (
1900
+ /** @type {any} */
1901
+ $constructedBy(
1902
+ /** @type {any} */
1903
+ o3
1904
+ )
1905
+ );
1906
+ }
1907
+ unexpectedCase();
1908
+ };
1909
+ assert = production ? () => {
1910
+ } : (o3, schema) => {
1911
+ const err = new ValidationError();
1912
+ if (!schema.check(o3, err)) {
1913
+ throw create3(`Expected value to be of type ${schema.constructor.name}.
1914
+ ${err.toString()}`);
1915
+ }
1916
+ };
1917
+ PatternMatcher = class {
1918
+ /**
1919
+ * @param {Schema<State>} [$state]
1920
+ */
1921
+ constructor($state) {
1922
+ this.patterns = [];
1923
+ this.$state = $state;
1924
+ }
1925
+ /**
1926
+ * @template P
1927
+ * @template R
1928
+ * @param {P} pattern
1929
+ * @param {(o:NoInfer<Unwrap<ReadSchema<P>>>,s:State)=>R} handler
1930
+ * @return {PatternMatcher<State,Patterns|Pattern<Unwrap<ReadSchema<P>>,R>>}
1931
+ */
1932
+ if(pattern, handler) {
1933
+ this.patterns.push({ if: $(pattern), h: handler });
1934
+ return this;
1935
+ }
1936
+ /**
1937
+ * @template R
1938
+ * @param {(o:any,s:State)=>R} h
1939
+ */
1940
+ else(h3) {
1941
+ return this.if($any, h3);
1942
+ }
1943
+ /**
1944
+ * @return {State extends undefined
1945
+ * ? <In extends Unwrap<Patterns['if']>>(o:In,state?:undefined)=>PatternMatchResult<Patterns,In>
1946
+ * : <In extends Unwrap<Patterns['if']>>(o:In,state:State)=>PatternMatchResult<Patterns,In>}
1947
+ */
1948
+ done() {
1949
+ return (
1950
+ /** @type {any} */
1951
+ (o3, s3) => {
1952
+ for (let i3 = 0; i3 < this.patterns.length; i3++) {
1953
+ const p3 = this.patterns[i3];
1954
+ if (p3.if.check(o3)) {
1955
+ return p3.h(o3, s3);
1956
+ }
1957
+ }
1958
+ throw create3("Unhandled pattern");
1959
+ }
1960
+ );
1961
+ }
1962
+ };
1963
+ match = (state) => new PatternMatcher(
1964
+ /** @type {any} */
1965
+ state
1966
+ );
1967
+ _random = /** @type {any} */
1968
+ match(
1969
+ /** @type {Schema<prng.PRNG>} */
1970
+ $any
1971
+ ).if($$number, (_o, gen) => int53(gen, MIN_SAFE_INTEGER, MAX_SAFE_INTEGER)).if($$string, (_o, gen) => word(gen)).if($$boolean, (_o, gen) => bool(gen)).if($$bigint, (_o, gen) => BigInt(int53(gen, MIN_SAFE_INTEGER, MAX_SAFE_INTEGER))).if($$union, (o3, gen) => random(gen, oneOf(gen, o3.shape))).if($$object, (o3, gen) => {
1972
+ const res = {};
1973
+ for (const k3 in o3.shape) {
1974
+ let prop = o3.shape[k3];
1975
+ if ($$optional.check(prop)) {
1976
+ if (bool(gen)) {
1977
+ continue;
1978
+ }
1979
+ prop = prop.shape;
1980
+ }
1981
+ res[k3] = _random(prop, gen);
1982
+ }
1983
+ return res;
1984
+ }).if($$array, (o3, gen) => {
1985
+ const arr = [];
1986
+ const n3 = int32(gen, 0, 42);
1987
+ for (let i3 = 0; i3 < n3; i3++) {
1988
+ arr.push(random(gen, o3.shape));
1989
+ }
1990
+ return arr;
1991
+ }).if($$literal, (o3, gen) => {
1992
+ return oneOf(gen, o3.shape);
1993
+ }).if($$null, (o3, gen) => {
1994
+ return null;
1995
+ }).if($$lambda, (o3, gen) => {
1996
+ const res = random(gen, o3.res);
1997
+ return () => res;
1998
+ }).if($$any, (o3, gen) => random(gen, oneOf(gen, [
1999
+ $number,
2000
+ $string,
2001
+ $null,
2002
+ $undefined,
2003
+ $bigint,
2004
+ $boolean,
2005
+ $array($number),
2006
+ $record($union("a", "b", "c"), $number)
2007
+ ]))).if($$record, (o3, gen) => {
2008
+ const res = {};
2009
+ const keysN = int53(gen, 0, 3);
2010
+ for (let i3 = 0; i3 < keysN; i3++) {
2011
+ const key = random(gen, o3.shape.keys);
2012
+ const val = random(gen, o3.shape.values);
2013
+ res[key] = val;
2014
+ }
2015
+ return res;
2016
+ }).done();
2017
+ random = (gen, schema) => (
2018
+ /** @type {any} */
2019
+ _random($(schema), gen)
2020
+ );
2021
+ }
2022
+ });
2023
+
1159
2024
  // ../../../node_modules/lib0/dom.js
1160
- var doc, domParser, mapToStyleString, ELEMENT_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, DOCUMENT_FRAGMENT_NODE;
2025
+ var doc, $fragment, domParser, $element, $text, mapToStyleString, ELEMENT_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, DOCUMENT_FRAGMENT_NODE, $node;
1161
2026
  var init_dom = __esm({
1162
2027
  "../../../node_modules/lib0/dom.js"() {
1163
2028
  init_map();
2029
+ init_schema();
1164
2030
  doc = /** @type {Document} */
1165
2031
  typeof document !== "undefined" ? document : {};
2032
+ $fragment = $custom((el) => el.nodeType === DOCUMENT_FRAGMENT_NODE);
1166
2033
  domParser = /** @type {DOMParser} */
1167
2034
  typeof DOMParser !== "undefined" ? new DOMParser() : null;
2035
+ $element = $custom((el) => el.nodeType === ELEMENT_NODE);
2036
+ $text = $custom((el) => el.nodeType === TEXT_NODE);
1168
2037
  mapToStyleString = (m3) => map(m3, (value2, key) => `${key}:${value2};`).join("");
1169
2038
  ELEMENT_NODE = doc.ELEMENT_NODE;
1170
2039
  TEXT_NODE = doc.TEXT_NODE;
@@ -1173,6 +2042,7 @@ var init_dom = __esm({
1173
2042
  DOCUMENT_NODE = doc.DOCUMENT_NODE;
1174
2043
  DOCUMENT_TYPE_NODE = doc.DOCUMENT_TYPE_NODE;
1175
2044
  DOCUMENT_FRAGMENT_NODE = doc.DOCUMENT_FRAGMENT_NODE;
2045
+ $node = $custom((el) => el.nodeType === DOCUMENT_NODE);
1176
2046
  }
1177
2047
  });
1178
2048
 
@@ -2963,15 +3833,19 @@ var init_yjs = __esm({
2963
3833
  event._path = null;
2964
3834
  });
2965
3835
  events.sort((event1, event2) => event1.path.length - event2.path.length);
2966
- callEventHandlerListeners(type._dEH, events, transaction);
3836
+ fs.push(() => {
3837
+ callEventHandlerListeners(type._dEH, events, transaction);
3838
+ });
3839
+ }
3840
+ });
3841
+ fs.push(() => doc2.emit("afterTransaction", [transaction, doc2]));
3842
+ fs.push(() => {
3843
+ if (transaction._needFormattingCleanup) {
3844
+ cleanupYTextAfterTransaction(transaction);
2967
3845
  }
2968
3846
  });
2969
3847
  });
2970
- fs.push(() => doc2.emit("afterTransaction", [transaction, doc2]));
2971
3848
  callAll(fs, []);
2972
- if (transaction._needFormattingCleanup) {
2973
- cleanupYTextAfterTransaction(transaction);
2974
- }
2975
3849
  } finally {
2976
3850
  if (doc2.gc) {
2977
3851
  tryGcDeleteSet(ds, store, doc2.gcFilter);
@@ -3355,7 +4229,7 @@ var init_yjs = __esm({
3355
4229
  return isDeleted(this.transaction.deleteSet, struct.id);
3356
4230
  }
3357
4231
  /**
3358
- * @type {Map<string, { action: 'add' | 'update' | 'delete', oldValue: any, newValue: any }>}
4232
+ * @type {Map<string, { action: 'add' | 'update' | 'delete', oldValue: any }>}
3359
4233
  */
3360
4234
  get keys() {
3361
4235
  if (this._keys === null) {
@@ -6061,11 +6935,13 @@ var init_yjs = __esm({
6061
6935
  const el = new _YXmlElement(this.nodeName);
6062
6936
  const attrs = this.getAttributes();
6063
6937
  forEach(attrs, (value2, key) => {
6064
- if (typeof value2 === "string") {
6065
- el.setAttribute(key, value2);
6066
- }
6938
+ el.setAttribute(
6939
+ key,
6940
+ /** @type {any} */
6941
+ value2
6942
+ );
6067
6943
  });
6068
- el.insert(0, this.toArray().map((item) => item instanceof AbstractType ? item.clone() : item));
6944
+ el.insert(0, this.toArray().map((v3) => v3 instanceof AbstractType ? v3.clone() : v3));
6069
6945
  return el;
6070
6946
  }
6071
6947
  /**
@@ -8118,7 +8994,7 @@ var require_dexie = __commonJS({
8118
8994
  function override(origFunc, overridedFactory) {
8119
8995
  return overridedFactory(origFunc);
8120
8996
  }
8121
- function assert(b3) {
8997
+ function assert2(b3) {
8122
8998
  if (!b3)
8123
8999
  throw new Error("Assertion Failed");
8124
9000
  }
@@ -8162,7 +9038,7 @@ var require_dexie = __commonJS({
8162
9038
  if ("isFrozen" in Object && Object.isFrozen(obj))
8163
9039
  return;
8164
9040
  if (typeof keyPath !== "string" && "length" in keyPath) {
8165
- assert(typeof value2 !== "string" && "length" in value2);
9041
+ assert2(typeof value2 !== "string" && "length" in value2);
8166
9042
  for (var i3 = 0, l3 = keyPath.length; i3 < l3; ++i3) {
8167
9043
  setByKeyPath(obj, keyPath[i3], value2[i3]);
8168
9044
  }
@@ -9432,7 +10308,7 @@ var require_dexie = __commonJS({
9432
10308
  if (!compoundIndex && debug)
9433
10309
  console.warn("The query ".concat(JSON.stringify(indexOrCrit), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(keyPaths.join("+"), "]"));
9434
10310
  var idxByName = this.schema.idxByName;
9435
- function equals(a3, b3) {
10311
+ function equals2(a3, b3) {
9436
10312
  return cmp2(a3, b3) === 0;
9437
10313
  }
9438
10314
  var _a3 = keyPaths.reduce(function(_a4, keyPath) {
@@ -9444,10 +10320,10 @@ var require_dexie = __commonJS({
9444
10320
  prevIndex || !index ? combine(prevFilterFn, index && index.multi ? function(x3) {
9445
10321
  var prop = getByKeyPath(x3, keyPath);
9446
10322
  return isArray5(prop) && prop.some(function(item) {
9447
- return equals(value2, item);
10323
+ return equals2(value2, item);
9448
10324
  });
9449
10325
  } : function(x3) {
9450
- return equals(value2, getByKeyPath(x3, keyPath));
10326
+ return equals2(value2, getByKeyPath(x3, keyPath));
9451
10327
  }) : prevFilterFn
9452
10328
  ];
9453
10329
  }, [null, null]), idx = _a3[0], filterFunction = _a3[1];
@@ -10435,7 +11311,7 @@ var require_dexie = __commonJS({
10435
11311
  return key.substr(0, upperNeedle.length);
10436
11312
  return llp < 0 ? null : key.substr(0, llp) + lowerNeedle[llp] + upperNeedle.substr(llp + 1);
10437
11313
  }
10438
- function addIgnoreCaseAlgorithm(whereClause, match, needles, suffix) {
11314
+ function addIgnoreCaseAlgorithm(whereClause, match2, needles, suffix) {
10439
11315
  var upper, lower, compare, upperNeedles, lowerNeedles, direction, nextKeySuffix, needlesLen = needles.length;
10440
11316
  if (!needles.every(function(s3) {
10441
11317
  return typeof s3 === "string";
@@ -10473,7 +11349,7 @@ var require_dexie = __commonJS({
10473
11349
  if (typeof key !== "string")
10474
11350
  return false;
10475
11351
  var lowerKey = lower(key);
10476
- if (match(lowerKey, lowerNeedles, firstPossibleNeedle)) {
11352
+ if (match2(lowerKey, lowerNeedles, firstPossibleNeedle)) {
10477
11353
  return true;
10478
11354
  } else {
10479
11355
  var lowestPossibleCasing = null;
@@ -10811,14 +11687,14 @@ var require_dexie = __commonJS({
10811
11687
  function Transaction3() {
10812
11688
  }
10813
11689
  Transaction3.prototype._lock = function() {
10814
- assert(!PSD.global);
11690
+ assert2(!PSD.global);
10815
11691
  ++this._reculock;
10816
11692
  if (this._reculock === 1 && !PSD.global)
10817
11693
  PSD.lockOwnerFor = this;
10818
11694
  return this;
10819
11695
  };
10820
11696
  Transaction3.prototype._unlock = function() {
10821
- assert(!PSD.global);
11697
+ assert2(!PSD.global);
10822
11698
  if (--this._reculock === 0) {
10823
11699
  if (!PSD.global)
10824
11700
  PSD.lockOwnerFor = null;
@@ -10841,7 +11717,7 @@ var require_dexie = __commonJS({
10841
11717
  return this;
10842
11718
  var idbdb = this.db.idbdb;
10843
11719
  var dbOpenError = this.db._state.dbOpenError;
10844
- assert(!this.idbtrans);
11720
+ assert2(!this.idbtrans);
10845
11721
  if (!idbtrans && !idbdb) {
10846
11722
  switch (dbOpenError && dbOpenError.name) {
10847
11723
  case "DatabaseClosedError":
@@ -10854,7 +11730,7 @@ var require_dexie = __commonJS({
10854
11730
  }
10855
11731
  if (!this.active)
10856
11732
  throw new exceptions.TransactionInactive();
10857
- assert(this._completion._state === null);
11733
+ assert2(this._completion._state === null);
10858
11734
  idbtrans = this.idbtrans = idbtrans || (this.db.core ? this.db.core.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }) : idbdb.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }));
10859
11735
  idbtrans.onerror = wrap2(function(ev) {
10860
11736
  preventDefault(ev);
@@ -15751,20 +16627,29 @@ function getKeyPairs(baggage) {
15751
16627
  });
15752
16628
  }
15753
16629
  function parsePairKeyValue(entry) {
15754
- const valueProps = entry.split(BAGGAGE_PROPERTIES_SEPARATOR);
15755
- if (valueProps.length <= 0)
15756
- return;
15757
- const keyPairPart = valueProps.shift();
15758
- if (!keyPairPart)
16630
+ if (!entry)
15759
16631
  return;
16632
+ const metadataSeparatorIndex = entry.indexOf(BAGGAGE_PROPERTIES_SEPARATOR);
16633
+ const keyPairPart = metadataSeparatorIndex === -1 ? entry : entry.substring(0, metadataSeparatorIndex);
15760
16634
  const separatorIndex = keyPairPart.indexOf(BAGGAGE_KEY_PAIR_SEPARATOR);
15761
16635
  if (separatorIndex <= 0)
15762
16636
  return;
15763
- const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim());
15764
- const value2 = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim());
16637
+ const rawKey = keyPairPart.substring(0, separatorIndex).trim();
16638
+ const rawValue = keyPairPart.substring(separatorIndex + 1).trim();
16639
+ if (!rawKey || !rawValue)
16640
+ return;
16641
+ let key;
16642
+ let value2;
16643
+ try {
16644
+ key = decodeURIComponent(rawKey);
16645
+ value2 = decodeURIComponent(rawValue);
16646
+ } catch {
16647
+ return;
16648
+ }
15765
16649
  let metadata;
15766
- if (valueProps.length > 0) {
15767
- metadata = baggageEntryMetadataFromString(valueProps.join(BAGGAGE_PROPERTIES_SEPARATOR));
16650
+ if (metadataSeparatorIndex !== -1 && metadataSeparatorIndex < entry.length - 1) {
16651
+ const metadataString = entry.substring(metadataSeparatorIndex + 1);
16652
+ metadata = baggageEntryMetadataFromString(metadataString);
15768
16653
  }
15769
16654
  return { key, value: value2, metadata };
15770
16655
  }
@@ -15964,19 +16849,11 @@ var init_environment2 = __esm({
15964
16849
  }
15965
16850
  });
15966
16851
 
15967
- // ../../../node_modules/@opentelemetry/core/build/esm/platform/browser/performance.js
15968
- var otperformance;
15969
- var init_performance = __esm({
15970
- "../../../node_modules/@opentelemetry/core/build/esm/platform/browser/performance.js"() {
15971
- otperformance = performance;
15972
- }
15973
- });
15974
-
15975
16852
  // ../../../node_modules/@opentelemetry/core/build/esm/version.js
15976
16853
  var VERSION2;
15977
16854
  var init_version2 = __esm({
15978
16855
  "../../../node_modules/@opentelemetry/core/build/esm/version.js"() {
15979
- VERSION2 = "2.2.0";
16856
+ VERSION2 = "2.5.0";
15980
16857
  }
15981
16858
  });
15982
16859
 
@@ -18089,11 +18966,12 @@ var init_sdk_info = __esm({
18089
18966
  });
18090
18967
 
18091
18968
  // ../../../node_modules/@opentelemetry/core/build/esm/platform/browser/index.js
18969
+ var otperformance;
18092
18970
  var init_browser2 = __esm({
18093
18971
  "../../../node_modules/@opentelemetry/core/build/esm/platform/browser/index.js"() {
18094
18972
  init_environment2();
18095
- init_performance();
18096
18973
  init_sdk_info();
18974
+ otperformance = performance;
18097
18975
  }
18098
18976
  });
18099
18977
 
@@ -18104,16 +18982,8 @@ function millisToHrTime(epochMillis) {
18104
18982
  const nanos = Math.round(epochMillis % 1e3 * MILLISECONDS_TO_NANOSECONDS);
18105
18983
  return [seconds, nanos];
18106
18984
  }
18107
- function getTimeOrigin() {
18108
- let timeOrigin = otperformance.timeOrigin;
18109
- if (typeof timeOrigin !== "number") {
18110
- const perf = otperformance;
18111
- timeOrigin = perf.timing && perf.timing.fetchStart;
18112
- }
18113
- return timeOrigin;
18114
- }
18115
18985
  function hrTime(performanceNow) {
18116
- const timeOrigin = millisToHrTime(getTimeOrigin());
18986
+ const timeOrigin = millisToHrTime(otperformance.timeOrigin);
18117
18987
  const now = millisToHrTime(typeof performanceNow === "number" ? performanceNow : otperformance.now());
18118
18988
  return addHrTimes(timeOrigin, now);
18119
18989
  }
@@ -18314,15 +19184,15 @@ var init_TraceState = __esm({
18314
19184
 
18315
19185
  // ../../../node_modules/@opentelemetry/core/build/esm/trace/W3CTraceContextPropagator.js
18316
19186
  function parseTraceParent(traceParent) {
18317
- const match = TRACE_PARENT_REGEX.exec(traceParent);
18318
- if (!match)
19187
+ const match2 = TRACE_PARENT_REGEX.exec(traceParent);
19188
+ if (!match2)
18319
19189
  return null;
18320
- if (match[1] === "00" && match[5])
19190
+ if (match2[1] === "00" && match2[5])
18321
19191
  return null;
18322
19192
  return {
18323
- traceId: match[2],
18324
- spanId: match[3],
18325
- traceFlags: parseInt(match[4], 16)
19193
+ traceId: match2[2],
19194
+ spanId: match2[3],
19195
+ traceFlags: parseInt(match2[4], 16)
18326
19196
  };
18327
19197
  }
18328
19198
  var TRACE_PARENT_HEADER, TRACE_STATE_HEADER, VERSION3, VERSION_PART, TRACE_ID_PART, PARENT_ID_PART, FLAGS_PART, TRACE_PARENT_REGEX, W3CTraceContextPropagator;
@@ -18463,15 +19333,15 @@ function mergeTwoObjects(one, two, level = 0, objects) {
18463
19333
  for (let i3 = 0, j3 = two.length; i3 < j3; i3++) {
18464
19334
  result.push(takeValue(two[i3]));
18465
19335
  }
18466
- } else if (isObject2(two)) {
19336
+ } else if (isObject3(two)) {
18467
19337
  const keys2 = Object.keys(two);
18468
19338
  for (let i3 = 0, j3 = keys2.length; i3 < j3; i3++) {
18469
19339
  const key = keys2[i3];
18470
19340
  result[key] = takeValue(two[key]);
18471
19341
  }
18472
19342
  }
18473
- } else if (isObject2(one)) {
18474
- if (isObject2(two)) {
19343
+ } else if (isObject3(one)) {
19344
+ if (isObject3(two)) {
18475
19345
  if (!shouldMerge(one, two)) {
18476
19346
  return two;
18477
19347
  }
@@ -18492,7 +19362,7 @@ function mergeTwoObjects(one, two, level = 0, objects) {
18492
19362
  if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) {
18493
19363
  delete result[key];
18494
19364
  } else {
18495
- if (isObject2(obj1) && isObject2(obj2)) {
19365
+ if (isObject3(obj1) && isObject3(obj2)) {
18496
19366
  const arr1 = objects.get(obj1) || [];
18497
19367
  const arr2 = objects.get(obj2) || [];
18498
19368
  arr1.push({ obj: one, key });
@@ -18526,7 +19396,7 @@ function isArray3(value2) {
18526
19396
  function isFunction2(value2) {
18527
19397
  return typeof value2 === "function";
18528
19398
  }
18529
- function isObject2(value2) {
19399
+ function isObject3(value2) {
18530
19400
  return !isPrimitive(value2) && !isArray3(value2) && !isFunction2(value2) && typeof value2 === "object";
18531
19401
  }
18532
19402
  function isPrimitive(value2) {
@@ -18579,13 +19449,13 @@ var init_callback = __esm({
18579
19449
  "../../../node_modules/@opentelemetry/core/build/esm/utils/callback.js"() {
18580
19450
  init_promise2();
18581
19451
  BindOnceFuture = class {
18582
- constructor(_callback, _that) {
18583
- __publicField(this, "_callback");
18584
- __publicField(this, "_that");
19452
+ constructor(callback, that) {
18585
19453
  __publicField(this, "_isCalled", false);
18586
19454
  __publicField(this, "_deferred", new Deferred());
18587
- this._callback = _callback;
18588
- this._that = _that;
19455
+ __publicField(this, "_callback");
19456
+ __publicField(this, "_that");
19457
+ this._callback = callback;
19458
+ this._that = that;
18589
19459
  }
18590
19460
  get isCalled() {
18591
19461
  return this._isCalled;
@@ -19432,15 +20302,15 @@ var require_W3CTraceContextPropagator = __commonJS({
19432
20302
  var FLAGS_PART2 = "[\\da-f]{2}";
19433
20303
  var TRACE_PARENT_REGEX2 = new RegExp(`^\\s?(${VERSION_PART2})-(${TRACE_ID_PART2})-(${PARENT_ID_PART2})-(${FLAGS_PART2})(-.*)?\\s?$`);
19434
20304
  function parseTraceParent2(traceParent) {
19435
- const match = TRACE_PARENT_REGEX2.exec(traceParent);
19436
- if (!match)
20305
+ const match2 = TRACE_PARENT_REGEX2.exec(traceParent);
20306
+ if (!match2)
19437
20307
  return null;
19438
- if (match[1] === "00" && match[5])
20308
+ if (match2[1] === "00" && match2[5])
19439
20309
  return null;
19440
20310
  return {
19441
- traceId: match[2],
19442
- spanId: match[3],
19443
- traceFlags: parseInt(match[4], 16)
20311
+ traceId: match2[2],
20312
+ spanId: match2[3],
20313
+ traceFlags: parseInt(match2[4], 16)
19444
20314
  };
19445
20315
  }
19446
20316
  exports.parseTraceParent = parseTraceParent2;
@@ -19607,15 +20477,15 @@ var require_merge = __commonJS({
19607
20477
  for (let i3 = 0, j3 = two.length; i3 < j3; i3++) {
19608
20478
  result.push(takeValue2(two[i3]));
19609
20479
  }
19610
- } else if (isObject4(two)) {
20480
+ } else if (isObject5(two)) {
19611
20481
  const keys2 = Object.keys(two);
19612
20482
  for (let i3 = 0, j3 = keys2.length; i3 < j3; i3++) {
19613
20483
  const key = keys2[i3];
19614
20484
  result[key] = takeValue2(two[key]);
19615
20485
  }
19616
20486
  }
19617
- } else if (isObject4(one)) {
19618
- if (isObject4(two)) {
20487
+ } else if (isObject5(one)) {
20488
+ if (isObject5(two)) {
19619
20489
  if (!shouldMerge2(one, two)) {
19620
20490
  return two;
19621
20491
  }
@@ -19636,7 +20506,7 @@ var require_merge = __commonJS({
19636
20506
  if (wasObjectReferenced2(one, key, objects) || wasObjectReferenced2(two, key, objects)) {
19637
20507
  delete result[key];
19638
20508
  } else {
19639
- if (isObject4(obj1) && isObject4(obj2)) {
20509
+ if (isObject5(obj1) && isObject5(obj2)) {
19640
20510
  const arr1 = objects.get(obj1) || [];
19641
20511
  const arr2 = objects.get(obj2) || [];
19642
20512
  arr1.push({ obj: one, key });
@@ -19670,7 +20540,7 @@ var require_merge = __commonJS({
19670
20540
  function isFunction4(value2) {
19671
20541
  return typeof value2 === "function";
19672
20542
  }
19673
- function isObject4(value2) {
20543
+ function isObject5(value2) {
19674
20544
  return !isPrimitive3(value2) && !isArray5(value2) && !isFunction4(value2) && typeof value2 === "object";
19675
20545
  }
19676
20546
  function isPrimitive3(value2) {
@@ -20296,12 +21166,12 @@ function isEmpty2(value2) {
20296
21166
  if (isArray4(value2) || isString(value2)) {
20297
21167
  return value2.length === 0;
20298
21168
  }
20299
- if (isObject3(value2)) {
21169
+ if (isObject4(value2)) {
20300
21170
  return Object.keys(value2).length === 0;
20301
21171
  }
20302
21172
  return false;
20303
21173
  }
20304
- var isUndefined, isNull, isString, isNumber, isInt, isBoolean, isSymbol, isObject3, isFunction3, isArray4, isRegExp, isThenable, isPrimitive2, isEventDefined, isEvent, isErrorDefined, isError, isErrorEvent, isDomError, isDomException, isElementDefined, isElement, isMapDefined, isMap, isSyntheticEvent;
21174
+ var isUndefined, isNull, isString, isNumber, isInt, isBoolean, isSymbol, isObject4, isFunction3, isArray4, isRegExp, isThenable, isPrimitive2, isEventDefined, isEvent, isErrorDefined, isError, isErrorEvent, isDomError, isDomException, isElementDefined, isElement, isMapDefined, isMap, isSyntheticEvent;
20305
21175
  var init_is = __esm({
20306
21176
  "../../../node_modules/@grafana/faro-core/dist/esm/utils/is.js"() {
20307
21177
  isUndefined = ((value2) => isTypeof(value2, "undefined"));
@@ -20311,12 +21181,12 @@ var init_is = __esm({
20311
21181
  isInt = ((value2) => isNumber(value2) && Number.isInteger(value2));
20312
21182
  isBoolean = ((value2) => isTypeof(value2, "boolean"));
20313
21183
  isSymbol = ((value2) => isTypeof(value2, "symbol"));
20314
- isObject3 = ((value2) => !isNull(value2) && isTypeof(value2, "object"));
21184
+ isObject4 = ((value2) => !isNull(value2) && isTypeof(value2, "object"));
20315
21185
  isFunction3 = ((value2) => isTypeof(value2, "function"));
20316
21186
  isArray4 = ((value2) => isToString(value2, "Array"));
20317
21187
  isRegExp = ((value2) => isToString(value2, "RegExp"));
20318
21188
  isThenable = ((value2) => isFunction3(value2 === null || value2 === void 0 ? void 0 : value2.then));
20319
- isPrimitive2 = ((value2) => !isObject3(value2) && !isFunction3(value2));
21189
+ isPrimitive2 = ((value2) => !isObject4(value2) && !isFunction3(value2));
20320
21190
  isEventDefined = typeof Event !== "undefined";
20321
21191
  isEvent = ((value2) => isEventDefined && isInstanceOf(value2, Event));
20322
21192
  isErrorDefined = typeof Error !== "undefined";
@@ -20328,7 +21198,7 @@ var init_is = __esm({
20328
21198
  isElement = ((value2) => isElementDefined && isInstanceOf(value2, Element));
20329
21199
  isMapDefined = typeof Map !== "undefined";
20330
21200
  isMap = ((value2) => isMapDefined && isInstanceOf(value2, Map));
20331
- isSyntheticEvent = ((value2) => isObject3(value2) && "nativeEvent" in value2 && "preventDefault" in value2 && "stopPropagation" in value2);
21201
+ isSyntheticEvent = ((value2) => isObject4(value2) && "nativeEvent" in value2 && "preventDefault" in value2 && "stopPropagation" in value2);
20332
21202
  }
20333
21203
  });
20334
21204
 
@@ -20357,8 +21227,8 @@ function deepEqual2(a3, b3) {
20357
21227
  }
20358
21228
  return true;
20359
21229
  }
20360
- const aIsObject = isObject3(a3);
20361
- const bIsObject = isObject3(b3);
21230
+ const aIsObject = isObject4(a3);
21231
+ const bIsObject = isObject4(b3);
20362
21232
  if (aIsObject !== bIsObject) {
20363
21233
  return false;
20364
21234
  }
@@ -20519,7 +21389,7 @@ var init_sourceMaps = __esm({
20519
21389
  function getCircularDependencyReplacer() {
20520
21390
  const valueSeen = /* @__PURE__ */ new WeakSet();
20521
21391
  return function(_key, value2) {
20522
- if (isObject3(value2) && value2 !== null) {
21392
+ if (isObject4(value2) && value2 !== null) {
20523
21393
  if (valueSeen.has(value2)) {
20524
21394
  return null;
20525
21395
  }
@@ -20534,7 +21404,7 @@ function stringifyExternalJson(json = {}) {
20534
21404
  function stringifyObjectValues(obj = {}) {
20535
21405
  const o3 = {};
20536
21406
  for (const [key, value2] of Object.entries(obj)) {
20537
- o3[key] = isObject3(value2) && value2 !== null ? stringifyExternalJson(value2) : String(value2);
21407
+ o3[key] = isObject4(value2) && value2 !== null ? stringifyExternalJson(value2) : String(value2);
20538
21408
  }
20539
21409
  return o3;
20540
21410
  }
@@ -21201,7 +22071,7 @@ var init_const5 = __esm({
21201
22071
  defaultExceptionType = "Error";
21202
22072
  defaultErrorArgsSerializer = (args2) => {
21203
22073
  return args2.map((arg) => {
21204
- if (isObject3(arg)) {
22074
+ if (isObject4(arg)) {
21205
22075
  return stringifyExternalJson(arg);
21206
22076
  }
21207
22077
  return String(arg);
@@ -21287,7 +22157,7 @@ function parseCause(error) {
21287
22157
  let cause = error.cause;
21288
22158
  if (isError(cause)) {
21289
22159
  cause = error.cause.toString();
21290
- } else if (cause !== null && (isObject3(error.cause) || isArray4(error.cause))) {
22160
+ } else if (cause !== null && (isObject4(error.cause) || isArray4(error.cause))) {
21291
22161
  cause = stringifyExternalJson(error.cause);
21292
22162
  } else if (cause != null) {
21293
22163
  cause = error.cause.toString();
@@ -22128,7 +22998,7 @@ var require_ua_parser = __commonJS({
22128
22998
  }
22129
22999
  };
22130
23000
  var rgxMapper = function(ua, arrays) {
22131
- var i3 = 0, j3, k3, p3, q3, matches, match;
23001
+ var i3 = 0, j3, k3, p3, q3, matches, match2;
22132
23002
  while (i3 < arrays.length && !matches) {
22133
23003
  var regex = arrays[i3], props = arrays[i3 + 1];
22134
23004
  j3 = k3 = 0;
@@ -22139,26 +23009,26 @@ var require_ua_parser = __commonJS({
22139
23009
  matches = regex[j3++].exec(ua);
22140
23010
  if (!!matches) {
22141
23011
  for (p3 = 0; p3 < props.length; p3++) {
22142
- match = matches[++k3];
23012
+ match2 = matches[++k3];
22143
23013
  q3 = props[p3];
22144
23014
  if (typeof q3 === OBJ_TYPE && q3.length > 0) {
22145
23015
  if (q3.length === 2) {
22146
23016
  if (typeof q3[1] == FUNC_TYPE) {
22147
- this[q3[0]] = q3[1].call(this, match);
23017
+ this[q3[0]] = q3[1].call(this, match2);
22148
23018
  } else {
22149
23019
  this[q3[0]] = q3[1];
22150
23020
  }
22151
23021
  } else if (q3.length === 3) {
22152
23022
  if (typeof q3[1] === FUNC_TYPE && !(q3[1].exec && q3[1].test)) {
22153
- this[q3[0]] = match ? q3[1].call(this, match, q3[2]) : undefined2;
23023
+ this[q3[0]] = match2 ? q3[1].call(this, match2, q3[2]) : undefined2;
22154
23024
  } else {
22155
- this[q3[0]] = match ? match.replace(q3[1], q3[2]) : undefined2;
23025
+ this[q3[0]] = match2 ? match2.replace(q3[1], q3[2]) : undefined2;
22156
23026
  }
22157
23027
  } else if (q3.length === 4) {
22158
- this[q3[0]] = match ? q3[3].call(this, match.replace(q3[1], q3[2])) : undefined2;
23028
+ this[q3[0]] = match2 ? q3[3].call(this, match2.replace(q3[1], q3[2])) : undefined2;
22159
23029
  }
22160
23030
  } else {
22161
- this[q3] = match ? match : undefined2;
23031
+ this[q3] = match2 ? match2 : undefined2;
22162
23032
  }
22163
23033
  }
22164
23034
  }
@@ -23518,18 +24388,18 @@ var require_ua_parser = __commonJS({
23518
24388
  window2.UAParser = UAParser2;
23519
24389
  }
23520
24390
  }
23521
- var $3 = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto);
23522
- if ($3 && !$3.ua) {
24391
+ var $4 = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto);
24392
+ if ($4 && !$4.ua) {
23523
24393
  var parser = new UAParser2();
23524
- $3.ua = parser.getResult();
23525
- $3.ua.get = function() {
24394
+ $4.ua = parser.getResult();
24395
+ $4.ua.get = function() {
23526
24396
  return parser.getUA();
23527
24397
  };
23528
- $3.ua.set = function(ua) {
24398
+ $4.ua.set = function(ua) {
23529
24399
  parser.setUA(ua);
23530
24400
  var result = parser.getResult();
23531
24401
  for (var prop in result) {
23532
- $3.ua[prop] = result[prop];
24402
+ $4.ua[prop] = result[prop];
23533
24403
  }
23534
24404
  };
23535
24405
  }
@@ -23879,11 +24749,11 @@ function sendOverrideEvent(hasSessionOverridesChanged, sessionOverrides = {}, st
23879
24749
  if (!hasSessionOverridesChanged) {
23880
24750
  return;
23881
24751
  }
23882
- const serviceName = sessionOverrides.serviceName;
24752
+ const serviceName2 = sessionOverrides.serviceName;
23883
24753
  const previousServiceName = (_c = (_a2 = storedSessionOverrides.serviceName) !== null && _a2 !== void 0 ? _a2 : (_b = faro.metas.value.app) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : "";
23884
- if (serviceName && serviceName !== previousServiceName) {
24754
+ if (serviceName2 && serviceName2 !== previousServiceName) {
23885
24755
  faro.api.pushEvent(EVENT_OVERRIDES_SERVICE_NAME, {
23886
- serviceName,
24756
+ serviceName: serviceName2,
23887
24757
  previousServiceName
23888
24758
  });
23889
24759
  }
@@ -24325,7 +25195,7 @@ function getErrorDetails(evt) {
24325
25195
  } else if (isError(evt)) {
24326
25196
  value2 = evt.message;
24327
25197
  stackFrames = getStackFramesFromError(evt);
24328
- } else if (isObject3(evt) || (isEventRes = isEvent(evt))) {
25198
+ } else if (isObject4(evt) || (isEventRes = isEvent(evt))) {
24329
25199
  type = isEventRes ? evt.constructor.name : void 0;
24330
25200
  value2 = `${objectEventValue} ${Object.keys(evt)}`;
24331
25201
  }
@@ -24556,7 +25426,7 @@ var init_view = __esm({
24556
25426
  });
24557
25427
 
24558
25428
  // ../../../node_modules/web-vitals/dist/web-vitals.js
24559
- var e, n, t, r, i, o, a, c, u, f, s, d, l, p, v, m, h, g, y, T, E, C, b, S, L, w, A, I, P, M, k, F, D, x, R, B, H, q, O, N, j, _, z, G, J, K, Q, U, V, W, X, Y, Z, $, ee;
25429
+ var e, n, t, r, i, o, a, c, u, f, s, d, l, p, v, m, h, g, y, T, E, C, b, S, L, w, A, I, P, M, k, F, D, x, R, B, H, q, O, N, j, _, z, G, J, K, Q, U, V, W, X, Y, Z, $2, ee;
24560
25430
  var init_web_vitals = __esm({
24561
25431
  "../../../node_modules/web-vitals/dist/web-vitals.js"() {
24562
25432
  o = -1;
@@ -24820,7 +25690,7 @@ var init_web_vitals = __esm({
24820
25690
  return e4(n3, Y, U);
24821
25691
  }));
24822
25692
  };
24823
- $ = [100, 300];
25693
+ $2 = [100, 300];
24824
25694
  ee = function(e4, r3) {
24825
25695
  r3 = r3 || {}, C((function() {
24826
25696
  var o3, c3 = E(), u3 = f("FID"), l3 = function(e5) {
@@ -24828,11 +25698,11 @@ var init_web_vitals = __esm({
24828
25698
  }, m3 = function(e5) {
24829
25699
  e5.forEach(l3);
24830
25700
  }, h3 = s("first-input", m3);
24831
- o3 = d(e4, u3, $, r3.reportAllChanges), h3 && (p(v((function() {
25701
+ o3 = d(e4, u3, $2, r3.reportAllChanges), h3 && (p(v((function() {
24832
25702
  m3(h3.takeRecords()), h3.disconnect();
24833
25703
  }))), a((function() {
24834
25704
  var a3;
24835
- u3 = f("FID"), o3 = d(e4, u3, $, r3.reportAllChanges), i = [], t = -1, n = null, Z(addEventListener), a3 = l3, i.push(a3), X();
25705
+ u3 = f("FID"), o3 = d(e4, u3, $2, r3.reportAllChanges), i = [], t = -1, n = null, Z(addEventListener), a3 = l3, i.push(a3), X();
24836
25706
  })));
24837
25707
  }));
24838
25708
  };
@@ -24875,7 +25745,7 @@ var init_webVitalsBasic = __esm({
24875
25745
  });
24876
25746
 
24877
25747
  // ../../../node_modules/web-vitals/dist/web-vitals.attribution.js
24878
- var t2, e3, n2, r2, i2, a2, o2, c2, u2, s2, f2, d2, l2, m2, p2, v2, g2, h2, T2, y2, E2, S2, b2, L2, C2, M2, D2, w2, x2, I2, k2, A2, F2, P2, B2, O2, R2, j2, q2, H2, N2, W2, z2, U2, V2, _2, G2, J2, K2, Q2, X2, Y2, Z2, $2, tt, et, nt, rt, it, at2, ot, ct, ut, st, ft, dt, lt, mt, pt, vt, gt, ht, Tt, yt;
25748
+ var t2, e3, n2, r2, i2, a2, o2, c2, u2, s2, f2, d2, l2, m2, p2, v2, g2, h2, T2, y2, E2, S2, b2, L2, C2, M2, D2, w2, x2, I2, k2, A2, F2, P2, B2, O2, R2, j2, q2, H2, N2, W2, z2, U2, V2, _2, G2, J2, K2, Q2, X2, Y2, Z2, $3, tt, et, nt, rt, it, at2, ot, ct, ut, st, ft, dt, lt, mt, pt, vt, gt, ht, Tt, yt;
24879
25749
  var init_web_vitals_attribution = __esm({
24880
25750
  "../../../node_modules/web-vitals/dist/web-vitals.attribution.js"() {
24881
25751
  n2 = function() {
@@ -25273,11 +26143,11 @@ var init_web_vitals_attribution = __esm({
25273
26143
  dt = { passive: true, capture: true };
25274
26144
  lt = /* @__PURE__ */ new Date();
25275
26145
  mt = function(t4, e4) {
25276
- Z2 || (Z2 = e4, $2 = t4, tt = /* @__PURE__ */ new Date(), gt(removeEventListener), pt());
26146
+ Z2 || (Z2 = e4, $3 = t4, tt = /* @__PURE__ */ new Date(), gt(removeEventListener), pt());
25277
26147
  };
25278
26148
  pt = function() {
25279
- if ($2 >= 0 && $2 < tt - lt) {
25280
- var t4 = { entryType: "first-input", name: Z2.type, target: Z2.target, cancelable: Z2.cancelable, startTime: Z2.timeStamp, processingStart: Z2.timeStamp + $2 };
26149
+ if ($3 >= 0 && $3 < tt - lt) {
26150
+ var t4 = { entryType: "first-input", name: Z2.type, target: Z2.target, cancelable: Z2.cancelable, startTime: Z2.timeStamp, processingStart: Z2.timeStamp + $3 };
25281
26151
  et.forEach((function(e4) {
25282
26152
  e4(t4);
25283
26153
  })), et = [];
@@ -25315,7 +26185,7 @@ var init_web_vitals_attribution = __esm({
25315
26185
  o3(c3.takeRecords()), c3.disconnect();
25316
26186
  }))), u2((function() {
25317
26187
  var r4;
25318
- i3 = f2("FID"), n3 = l2(t4, i3, ht, e4.reportAllChanges), et = [], $2 = -1, Z2 = null, gt(addEventListener), r4 = a3, et.push(r4), pt();
26188
+ i3 = f2("FID"), n3 = l2(t4, i3, ht, e4.reportAllChanges), et = [], $3 = -1, Z2 = null, gt(addEventListener), r4 = a3, et.push(r4), pt();
25319
26189
  })));
25320
26190
  }));
25321
26191
  };
@@ -25813,7 +26683,7 @@ var init_instrumentation6 = __esm({
25813
26683
  });
25814
26684
 
25815
26685
  // ../../../node_modules/@grafana/faro-web-sdk/dist/esm/instrumentations/performance/index.js
25816
- var init_performance2 = __esm({
26686
+ var init_performance = __esm({
25817
26687
  "../../../node_modules/@grafana/faro-web-sdk/dist/esm/instrumentations/performance/index.js"() {
25818
26688
  init_instrumentation6();
25819
26689
  }
@@ -26221,7 +27091,7 @@ var init_instrumentations2 = __esm({
26221
27091
  init_errors();
26222
27092
  init_view();
26223
27093
  init_webVitals();
26224
- init_performance2();
27094
+ init_performance();
26225
27095
  init_userActions();
26226
27096
  init_csp();
26227
27097
  }
@@ -26578,7 +27448,7 @@ function createDefaultMetas(browserConfig) {
26578
27448
  createPageMeta({ generatePageId, initialPageMeta: page }),
26579
27449
  ...(_b = browserConfig.metas) !== null && _b !== void 0 ? _b : []
26580
27450
  ];
26581
- const isK6BrowserSession = isObject3(window.k6);
27451
+ const isK6BrowserSession = isObject4(window.k6);
26582
27452
  if (isK6BrowserSession) {
26583
27453
  return [...initialMetas, k6Meta];
26584
27454
  }
@@ -26733,7 +27603,7 @@ __export(esm_exports4, {
26733
27603
  isMapDefined: () => isMapDefined,
26734
27604
  isNull: () => isNull,
26735
27605
  isNumber: () => isNumber,
26736
- isObject: () => isObject3,
27606
+ isObject: () => isObject4,
26737
27607
  isPrimitive: () => isPrimitive2,
26738
27608
  isRegExp: () => isRegExp,
26739
27609
  isString: () => isString,
@@ -27466,7 +28336,7 @@ var init_globalThis3 = __esm({
27466
28336
 
27467
28337
  // ../../../node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/core/build/esm/platform/browser/performance.js
27468
28338
  var otperformance2;
27469
- var init_performance3 = __esm({
28339
+ var init_performance2 = __esm({
27470
28340
  "../../../node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/core/build/esm/platform/browser/performance.js"() {
27471
28341
  otperformance2 = performance;
27472
28342
  }
@@ -27477,7 +28347,7 @@ var init_browser6 = __esm({
27477
28347
  "../../../node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/core/build/esm/platform/browser/index.js"() {
27478
28348
  init_environment3();
27479
28349
  init_globalThis3();
27480
- init_performance3();
28350
+ init_performance2();
27481
28351
  }
27482
28352
  });
27483
28353
 
@@ -28357,7 +29227,7 @@ var init_environment4 = __esm({
28357
29227
 
28358
29228
  // ../../../node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/core/build/esm/platform/browser/performance.js
28359
29229
  var otperformance3;
28360
- var init_performance4 = __esm({
29230
+ var init_performance3 = __esm({
28361
29231
  "../../../node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/core/build/esm/platform/browser/performance.js"() {
28362
29232
  otperformance3 = performance;
28363
29233
  }
@@ -28367,7 +29237,7 @@ var init_performance4 = __esm({
28367
29237
  var init_browser7 = __esm({
28368
29238
  "../../../node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/core/build/esm/platform/browser/index.js"() {
28369
29239
  init_environment4();
28370
- init_performance4();
29240
+ init_performance3();
28371
29241
  }
28372
29242
  });
28373
29243
 
@@ -29344,19 +30214,21 @@ var init_getDefaultOTELInstrumentations = __esm({
29344
30214
  }
29345
30215
  });
29346
30216
 
29347
- // ../../../node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.js
30217
+ // ../../../node_modules/@opentelemetry/resources/build/esm/default-service-name.js
29348
30218
  function defaultServiceName() {
29349
- return "unknown_service";
30219
+ if (serviceName === void 0) {
30220
+ try {
30221
+ const argv0 = globalThis.process.argv0;
30222
+ serviceName = argv0 ? `unknown_service:${argv0}` : "unknown_service";
30223
+ } catch {
30224
+ serviceName = "unknown_service";
30225
+ }
30226
+ }
30227
+ return serviceName;
29350
30228
  }
30229
+ var serviceName;
29351
30230
  var init_default_service_name = __esm({
29352
- "../../../node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.js"() {
29353
- }
29354
- });
29355
-
29356
- // ../../../node_modules/@opentelemetry/resources/build/esm/platform/browser/index.js
29357
- var init_browser8 = __esm({
29358
- "../../../node_modules/@opentelemetry/resources/build/esm/platform/browser/index.js"() {
29359
- init_default_service_name();
30231
+ "../../../node_modules/@opentelemetry/resources/build/esm/default-service-name.js"() {
29360
30232
  }
29361
30233
  });
29362
30234
 
@@ -29426,7 +30298,7 @@ var init_ResourceImpl = __esm({
29426
30298
  init_esm();
29427
30299
  init_esm3();
29428
30300
  init_esm2();
29429
- init_browser8();
30301
+ init_default_service_name();
29430
30302
  init_utils14();
29431
30303
  ResourceImpl = class _ResourceImpl {
29432
30304
  constructor(resource, options) {
@@ -29563,7 +30435,7 @@ var init_Span = __esm({
29563
30435
  const now = Date.now();
29564
30436
  this._spanContext = opts.spanContext;
29565
30437
  this._performanceStartTime = otperformance.now();
29566
- this._performanceOffset = now - (this._performanceStartTime + getTimeOrigin());
30438
+ this._performanceOffset = now - (this._performanceStartTime + otperformance.timeOrigin);
29567
30439
  this._startTimeProvided = opts.startTime != null;
29568
30440
  this._spanLimits = opts.spanLimits;
29569
30441
  this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit || 0;
@@ -29675,7 +30547,6 @@ var init_Span = __esm({
29675
30547
  diag2.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);
29676
30548
  return;
29677
30549
  }
29678
- this._ended = true;
29679
30550
  this.endTime = this._getTime(endTime);
29680
30551
  this._duration = hrTimeDuration(this.startTime, this.endTime);
29681
30552
  if (this._duration[0] < 0) {
@@ -29686,6 +30557,10 @@ var init_Span = __esm({
29686
30557
  if (this._droppedEventsCount > 0) {
29687
30558
  diag2.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);
29688
30559
  }
30560
+ if (this._spanProcessor.onEnding) {
30561
+ this._spanProcessor.onEnding(this);
30562
+ }
30563
+ this._ended = true;
29689
30564
  this._spanProcessor.onEnd(this);
29690
30565
  }
29691
30566
  _getTime(inp) {
@@ -29898,11 +30773,10 @@ var init_TraceIdRatioBasedSampler = __esm({
29898
30773
  init_esm();
29899
30774
  init_Sampler();
29900
30775
  TraceIdRatioBasedSampler = class {
29901
- constructor(_ratio = 0) {
30776
+ constructor(ratio = 0) {
29902
30777
  __publicField(this, "_ratio");
29903
30778
  __publicField(this, "_upperBound");
29904
- this._ratio = _ratio;
29905
- this._ratio = this._normalize(_ratio);
30779
+ this._ratio = this._normalize(ratio);
29906
30780
  this._upperBound = Math.floor(this._ratio * 4294967295);
29907
30781
  }
29908
30782
  shouldSample(context2, traceId) {
@@ -30048,19 +30922,19 @@ var init_BatchSpanProcessorBase = __esm({
30048
30922
  init_esm();
30049
30923
  init_esm3();
30050
30924
  BatchSpanProcessorBase = class {
30051
- constructor(_exporter, config) {
30052
- __publicField(this, "_exporter");
30925
+ constructor(exporter, config) {
30053
30926
  __publicField(this, "_maxExportBatchSize");
30054
30927
  __publicField(this, "_maxQueueSize");
30055
30928
  __publicField(this, "_scheduledDelayMillis");
30056
30929
  __publicField(this, "_exportTimeoutMillis");
30930
+ __publicField(this, "_exporter");
30057
30931
  __publicField(this, "_isExporting", false);
30058
30932
  __publicField(this, "_finishedSpans", []);
30059
30933
  __publicField(this, "_timer");
30060
30934
  __publicField(this, "_shutdownOnce");
30061
30935
  __publicField(this, "_droppedSpansCount", 0);
30062
30936
  var _a2, _b, _c, _d;
30063
- this._exporter = _exporter;
30937
+ this._exporter = exporter;
30064
30938
  this._maxExportBatchSize = typeof (config == null ? void 0 : config.maxExportBatchSize) === "number" ? config.maxExportBatchSize : (_a2 = getNumberFromEnv("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")) != null ? _a2 : 512;
30065
30939
  this._maxQueueSize = typeof (config == null ? void 0 : config.maxQueueSize) === "number" ? config.maxQueueSize : (_b = getNumberFromEnv("OTEL_BSP_MAX_QUEUE_SIZE")) != null ? _b : 2048;
30066
30940
  this._scheduledDelayMillis = typeof (config == null ? void 0 : config.scheduledDelayMillis) === "number" ? config.scheduledDelayMillis : (_c = getNumberFromEnv("OTEL_BSP_SCHEDULE_DELAY")) != null ? _c : 5e3;
@@ -30296,7 +31170,7 @@ var init_RandomIdGenerator = __esm({
30296
31170
  });
30297
31171
 
30298
31172
  // ../../../node_modules/@opentelemetry/sdk-trace-web/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/browser/index.js
30299
- var init_browser9 = __esm({
31173
+ var init_browser8 = __esm({
30300
31174
  "../../../node_modules/@opentelemetry/sdk-trace-web/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/browser/index.js"() {
30301
31175
  init_BatchSpanProcessor();
30302
31176
  init_RandomIdGenerator();
@@ -30311,7 +31185,7 @@ var init_Tracer = __esm({
30311
31185
  init_esm3();
30312
31186
  init_Span();
30313
31187
  init_utility();
30314
- init_browser9();
31188
+ init_browser8();
30315
31189
  Tracer = class {
30316
31190
  /**
30317
31191
  * Constructs a new Tracer instance.
@@ -30433,9 +31307,9 @@ var init_MultiSpanProcessor = __esm({
30433
31307
  "../../../node_modules/@opentelemetry/sdk-trace-web/node_modules/@opentelemetry/sdk-trace-base/build/esm/MultiSpanProcessor.js"() {
30434
31308
  init_esm3();
30435
31309
  MultiSpanProcessor = class {
30436
- constructor(_spanProcessors) {
31310
+ constructor(spanProcessors) {
30437
31311
  __publicField(this, "_spanProcessors");
30438
- this._spanProcessors = _spanProcessors;
31312
+ this._spanProcessors = spanProcessors;
30439
31313
  }
30440
31314
  forceFlush() {
30441
31315
  const promises = [];
@@ -30456,6 +31330,13 @@ var init_MultiSpanProcessor = __esm({
30456
31330
  spanProcessor.onStart(span, context2);
30457
31331
  }
30458
31332
  }
31333
+ onEnding(span) {
31334
+ for (const spanProcessor of this._spanProcessors) {
31335
+ if (spanProcessor.onEnding) {
31336
+ spanProcessor.onEnding(span);
31337
+ }
31338
+ }
31339
+ }
30459
31340
  onEnd(span) {
30460
31341
  for (const spanProcessor of this._spanProcessors) {
30461
31342
  spanProcessor.onEnd(span);
@@ -30561,7 +31442,7 @@ var init_BasicTracerProvider = __esm({
30561
31442
  var init_esm15 = __esm({
30562
31443
  "../../../node_modules/@opentelemetry/sdk-trace-web/node_modules/@opentelemetry/sdk-trace-base/build/esm/index.js"() {
30563
31444
  init_BasicTracerProvider();
30564
- init_browser9();
31445
+ init_browser8();
30565
31446
  init_Sampler();
30566
31447
  }
30567
31448
  });
@@ -33379,7 +34260,7 @@ var Transport = class extends Emitter {
33379
34260
  return hostname.indexOf(":") === -1 ? hostname : "[" + hostname + "]";
33380
34261
  }
33381
34262
  _port() {
33382
- if (this.opts.port && (this.opts.secure && Number(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80)) {
34263
+ if (this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80)) {
33383
34264
  return ":" + this.opts.port;
33384
34265
  } else {
33385
34266
  return "";
@@ -34610,6 +35491,7 @@ __export(esm_exports, {
34610
35491
  Decoder: () => Decoder,
34611
35492
  Encoder: () => Encoder,
34612
35493
  PacketType: () => PacketType,
35494
+ isPacketValid: () => isPacketValid,
34613
35495
  protocol: () => protocol3
34614
35496
  });
34615
35497
 
@@ -34715,10 +35597,15 @@ function _reconstructPacket(data2, buffers) {
34715
35597
  // ../../../node_modules/socket.io-parser/build/esm/index.js
34716
35598
  var RESERVED_EVENTS = [
34717
35599
  "connect",
35600
+ // used on the client side
34718
35601
  "connect_error",
35602
+ // used on the client side
34719
35603
  "disconnect",
35604
+ // used on both sides
34720
35605
  "disconnecting",
35606
+ // used on the server side
34721
35607
  "newListener",
35608
+ // used by the Node.js EventEmitter
34722
35609
  "removeListener"
34723
35610
  // used by the Node.js EventEmitter
34724
35611
  ];
@@ -34793,9 +35680,6 @@ var Encoder = class {
34793
35680
  return buffers;
34794
35681
  }
34795
35682
  };
34796
- function isObject(value2) {
34797
- return Object.prototype.toString.call(value2) === "[object Object]";
34798
- }
34799
35683
  var Decoder = class _Decoder extends Emitter {
34800
35684
  /**
34801
35685
  * Decoder constructor
@@ -34967,6 +35851,37 @@ var BinaryReconstructor = class {
34967
35851
  this.buffers = [];
34968
35852
  }
34969
35853
  };
35854
+ function isNamespaceValid(nsp) {
35855
+ return typeof nsp === "string";
35856
+ }
35857
+ var isInteger = Number.isInteger || function(value2) {
35858
+ return typeof value2 === "number" && isFinite(value2) && Math.floor(value2) === value2;
35859
+ };
35860
+ function isAckIdValid(id2) {
35861
+ return id2 === void 0 || isInteger(id2);
35862
+ }
35863
+ function isObject(value2) {
35864
+ return Object.prototype.toString.call(value2) === "[object Object]";
35865
+ }
35866
+ function isDataValid(type, payload) {
35867
+ switch (type) {
35868
+ case PacketType.CONNECT:
35869
+ return payload === void 0 || isObject(payload);
35870
+ case PacketType.DISCONNECT:
35871
+ return payload === void 0;
35872
+ case PacketType.EVENT:
35873
+ return Array.isArray(payload) && (typeof payload[0] === "number" || typeof payload[0] === "string" && RESERVED_EVENTS.indexOf(payload[0]) === -1);
35874
+ case PacketType.ACK:
35875
+ return Array.isArray(payload);
35876
+ case PacketType.CONNECT_ERROR:
35877
+ return typeof payload === "string" || isObject(payload);
35878
+ default:
35879
+ return false;
35880
+ }
35881
+ }
35882
+ function isPacketValid(packet) {
35883
+ return isNamespaceValid(packet.nsp) && isAckIdValid(packet.id) && isDataValid(packet.type, packet.data);
35884
+ }
34970
35885
 
34971
35886
  // ../../../node_modules/socket.io-client/build/esm/on.js
34972
35887
  function on(obj, ev, fn) {
@@ -35232,7 +36147,6 @@ var Socket2 = class extends Emitter {
35232
36147
  };
35233
36148
  args2.push((err, ...responseArgs) => {
35234
36149
  if (packet !== this._queue[0]) {
35235
- return;
35236
36150
  }
35237
36151
  const hasError = err !== null;
35238
36152
  if (hasError) {
@@ -35464,8 +36378,8 @@ var Socket2 = class extends Emitter {
35464
36378
  this._pid = pid;
35465
36379
  this.connected = true;
35466
36380
  this.emitBuffered();
35467
- this.emitReserved("connect");
35468
36381
  this._drainQueue(true);
36382
+ this.emitReserved("connect");
35469
36383
  }
35470
36384
  /**
35471
36385
  * Emit buffered events (received and emitted).
@@ -37133,17 +38047,17 @@ pp$9.strictDirective = function(start) {
37133
38047
  for (; ; ) {
37134
38048
  skipWhiteSpace.lastIndex = start;
37135
38049
  start += skipWhiteSpace.exec(this.input)[0].length;
37136
- var match = literal.exec(this.input.slice(start));
37137
- if (!match) {
38050
+ var match2 = literal.exec(this.input.slice(start));
38051
+ if (!match2) {
37138
38052
  return false;
37139
38053
  }
37140
- if ((match[1] || match[2]) === "use strict") {
37141
- skipWhiteSpace.lastIndex = start + match[0].length;
38054
+ if ((match2[1] || match2[2]) === "use strict") {
38055
+ skipWhiteSpace.lastIndex = start + match2[0].length;
37142
38056
  var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
37143
38057
  var next = this.input.charAt(end);
37144
38058
  return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=");
37145
38059
  }
37146
- start += match[0].length;
38060
+ start += match2[0].length;
37147
38061
  skipWhiteSpace.lastIndex = start;
37148
38062
  start += skipWhiteSpace.exec(this.input)[0].length;
37149
38063
  if (this.input[start] === ";") {
@@ -42123,7 +43037,7 @@ pp.readHexChar = function(len) {
42123
43037
  };
42124
43038
  pp.readWord1 = function() {
42125
43039
  this.containsEsc = false;
42126
- var word = "", first = true, chunkStart = this.pos;
43040
+ var word2 = "", first = true, chunkStart = this.pos;
42127
43041
  var astral = this.options.ecmaVersion >= 6;
42128
43042
  while (this.pos < this.input.length) {
42129
43043
  var ch = this.fullCharCodeAtPos();
@@ -42131,7 +43045,7 @@ pp.readWord1 = function() {
42131
43045
  this.pos += ch <= 65535 ? 1 : 2;
42132
43046
  } else if (ch === 92) {
42133
43047
  this.containsEsc = true;
42134
- word += this.input.slice(chunkStart, this.pos);
43048
+ word2 += this.input.slice(chunkStart, this.pos);
42135
43049
  var escStart = this.pos;
42136
43050
  if (this.input.charCodeAt(++this.pos) !== 117) {
42137
43051
  this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX");
@@ -42141,22 +43055,22 @@ pp.readWord1 = function() {
42141
43055
  if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) {
42142
43056
  this.invalidStringToken(escStart, "Invalid Unicode escape");
42143
43057
  }
42144
- word += codePointToString(esc);
43058
+ word2 += codePointToString(esc);
42145
43059
  chunkStart = this.pos;
42146
43060
  } else {
42147
43061
  break;
42148
43062
  }
42149
43063
  first = false;
42150
43064
  }
42151
- return word + this.input.slice(chunkStart, this.pos);
43065
+ return word2 + this.input.slice(chunkStart, this.pos);
42152
43066
  };
42153
43067
  pp.readWord = function() {
42154
- var word = this.readWord1();
43068
+ var word2 = this.readWord1();
42155
43069
  var type = types$1.name;
42156
- if (this.keywords.test(word)) {
42157
- type = keywords[word];
43070
+ if (this.keywords.test(word2)) {
43071
+ type = keywords[word2];
42158
43072
  }
42159
- return this.finishToken(type, word);
43073
+ return this.finishToken(type, word2);
42160
43074
  };
42161
43075
  var version = "8.15.0";
42162
43076
  Parser.acorn = {
@@ -45289,6 +46203,9 @@ var PlanService = class extends BaseService {
45289
46203
  }
45290
46204
  });
45291
46205
  }
46206
+ if (Object.hasOwn(planData, "key") && planData.key == null) {
46207
+ throw new Error("Plan key must be a valid string");
46208
+ }
45292
46209
  if (planData.key && !/^[a-z0-9-]+$/u.test(planData.key)) {
45293
46210
  throw new Error(
45294
46211
  "Plan key must contain only lowercase letters, numbers, and hyphens"
@@ -45343,7 +46260,7 @@ var PlanService = class extends BaseService {
45343
46260
  `Pricing option '${key}' must have a non-negative numeric 'amount'`
45344
46261
  );
45345
46262
  }
45346
- if (interval != null && !allowedIntervals.has(interval)) {
46263
+ if (interval !== null && !allowedIntervals.has(interval)) {
45347
46264
  throw new Error(
45348
46265
  `Pricing option '${key}' has invalid interval '${interval}'. Allowed: month, year, week, day or null`
45349
46266
  );
@@ -45355,6 +46272,9 @@ var PlanService = class extends BaseService {
45355
46272
  }
45356
46273
  });
45357
46274
  }
46275
+ if (Object.hasOwn(planData, "key") && planData.key == null) {
46276
+ throw new Error("Plan key must be a valid string");
46277
+ }
45358
46278
  if (planData.key && !/^[a-z0-9-]+$/u.test(planData.key)) {
45359
46279
  throw new Error(
45360
46280
  "Plan key must contain only lowercase letters, numbers, and hyphens"