@shopify/create-app 3.85.1 → 3.85.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.
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  fanoutHooks,
3
3
  reportAnalyticsEvent
4
- } from "./chunk-UW5PDMY2.js";
4
+ } from "./chunk-A6BP5R5D.js";
5
5
  import {
6
6
  CLI_KIT_VERSION,
7
7
  getEnvironmentData,
8
8
  isLocalEnvironment
9
- } from "./chunk-K6GH3OTA.js";
9
+ } from "./chunk-6NLDEVLI.js";
10
10
  import {
11
11
  runWithRateLimit
12
- } from "./chunk-LSGUB77H.js";
12
+ } from "./chunk-5HCVMQPA.js";
13
13
  import {
14
14
  AbortSilentError,
15
15
  CancelExecution,
@@ -24,10 +24,10 @@ import {
24
24
  reportingRateLimit,
25
25
  require_stacktracey,
26
26
  shouldReportErrorAsUnexpected
27
- } from "./chunk-BPVVHBDS.js";
27
+ } from "./chunk-GDQKSWAB.js";
28
28
  import {
29
29
  require_lib
30
- } from "./chunk-G5HUFNZJ.js";
30
+ } from "./chunk-2VQSCETZ.js";
31
31
  import {
32
32
  cwd,
33
33
  isAbsolutePath,
@@ -463,9 +463,9 @@ var require_byline = __commonJS({
463
463
  }
464
464
  });
465
465
 
466
- // ../../node_modules/.pnpm/@bugsnag+node@7.25.0/node_modules/@bugsnag/node/dist/bugsnag.js
466
+ // ../../node_modules/.pnpm/@bugsnag+node@8.6.0/node_modules/@bugsnag/node/dist/bugsnag.js
467
467
  var require_bugsnag = __commonJS({
468
- "../../node_modules/.pnpm/@bugsnag+node@7.25.0/node_modules/@bugsnag/node/dist/bugsnag.js"(exports, module) {
468
+ "../../node_modules/.pnpm/@bugsnag+node@8.6.0/node_modules/@bugsnag/node/dist/bugsnag.js"(exports, module) {
469
469
  init_cjs_shims();
470
470
  (function(f) {
471
471
  if (typeof exports == "object" && typeof module < "u")
@@ -490,22 +490,22 @@ var require_bugsnag = __commonJS({
490
490
  metaData: this.metadata
491
491
  };
492
492
  }, Breadcrumb2;
493
- }(), _$Breadcrumb_1 = Breadcrumb, _$breadcrumbTypes_6 = ["navigation", "request", "process", "log", "user", "state", "error", "manual"], _$reduce_16 = function(arr, fn, accum) {
493
+ }(), _$Breadcrumb_7 = Breadcrumb, _$breadcrumbTypes_12 = ["navigation", "request", "process", "log", "user", "state", "error", "manual"], _$reduce_22 = function(arr, fn, accum) {
494
494
  for (var val = accum, i = 0, len = arr.length; i < len; i++) val = fn(val, arr[i], i, arr);
495
495
  return val;
496
- }, _$filter_11 = function(arr, fn) {
497
- return _$reduce_16(arr, function(accum, item, i, arr2) {
496
+ }, _$filter_17 = function(arr, fn) {
497
+ return _$reduce_22(arr, function(accum, item, i, arr2) {
498
498
  return fn(item, i, arr2) ? accum.concat(item) : accum;
499
499
  }, []);
500
- }, _$includes_12 = function(arr, x) {
501
- return _$reduce_16(arr, function(accum, item, i, arr2) {
500
+ }, _$includes_18 = function(arr, x) {
501
+ return _$reduce_22(arr, function(accum, item, i, arr2) {
502
502
  return accum === !0 || item === x;
503
503
  }, !1);
504
- }, _$isArray_13 = function(obj) {
504
+ }, _$isArray_19 = function(obj) {
505
505
  return Object.prototype.toString.call(obj) === "[object Array]";
506
506
  }, _hasDontEnumBug = !{
507
507
  toString: null
508
- }.propertyIsEnumerable("toString"), _dontEnums = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], _$keys_14 = function(obj) {
508
+ }.propertyIsEnumerable("toString"), _dontEnums = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], _$keys_20 = function(obj) {
509
509
  var result = [], prop;
510
510
  for (prop in obj)
511
511
  Object.prototype.hasOwnProperty.call(obj, prop) && result.push(prop);
@@ -513,36 +513,36 @@ var require_bugsnag = __commonJS({
513
513
  for (var i = 0, len = _dontEnums.length; i < len; i++)
514
514
  Object.prototype.hasOwnProperty.call(obj, _dontEnums[i]) && result.push(_dontEnums[i]);
515
515
  return result;
516
- }, _$intRange_25 = function(min, max) {
516
+ }, _$intRange_31 = function(min, max) {
517
517
  return min === void 0 && (min = 1), max === void 0 && (max = 1 / 0), function(value) {
518
518
  return typeof value == "number" && parseInt("" + value, 10) === value && value >= min && value <= max;
519
519
  };
520
- }, _$listOfFunctions_26 = function(value) {
521
- return typeof value == "function" || _$isArray_13(value) && _$filter_11(value, function(f) {
520
+ }, _$listOfFunctions_32 = function(value) {
521
+ return typeof value == "function" || _$isArray_19(value) && _$filter_17(value, function(f) {
522
522
  return typeof f == "function";
523
523
  }).length === value.length;
524
- }, _$stringWithLength_27 = function(value) {
524
+ }, _$stringWithLength_33 = function(value) {
525
525
  return typeof value == "string" && !!value.length;
526
- }, _$config_3 = {}, defaultErrorTypes = function() {
526
+ }, _$config_9 = {}, defaultErrorTypes = function() {
527
527
  return {
528
528
  unhandledExceptions: !0,
529
529
  unhandledRejections: !0
530
530
  };
531
531
  };
532
- _$config_3.schema = {
532
+ _$config_9.schema = {
533
533
  apiKey: {
534
534
  defaultValue: function() {
535
535
  return null;
536
536
  },
537
537
  message: "is required",
538
- validate: _$stringWithLength_27
538
+ validate: _$stringWithLength_33
539
539
  },
540
540
  appVersion: {
541
541
  defaultValue: function() {
542
542
  },
543
543
  message: "should be a string",
544
544
  validate: function(value) {
545
- return value === void 0 || _$stringWithLength_27(value);
545
+ return value === void 0 || _$stringWithLength_33(value);
546
546
  }
547
547
  },
548
548
  appType: {
@@ -550,7 +550,7 @@ var require_bugsnag = __commonJS({
550
550
  },
551
551
  message: "should be a string",
552
552
  validate: function(value) {
553
- return value === void 0 || _$stringWithLength_27(value);
553
+ return value === void 0 || _$stringWithLength_33(value);
554
554
  }
555
555
  },
556
556
  autoDetectErrors: {
@@ -570,10 +570,10 @@ var require_bugsnag = __commonJS({
570
570
  allowPartialObject: !0,
571
571
  validate: function(value) {
572
572
  if (typeof value != "object" || !value) return !1;
573
- var providedKeys = _$keys_14(value), defaultKeys = _$keys_14(defaultErrorTypes());
574
- return !(_$filter_11(providedKeys, function(k) {
575
- return _$includes_12(defaultKeys, k);
576
- }).length < providedKeys.length || _$filter_11(_$keys_14(value), function(k) {
573
+ var providedKeys = _$keys_20(value), defaultKeys = _$keys_20(defaultErrorTypes());
574
+ return !(_$filter_17(providedKeys, function(k) {
575
+ return _$includes_18(defaultKeys, k);
576
+ }).length < providedKeys.length || _$filter_17(_$keys_20(value), function(k) {
577
577
  return typeof value[k] != "boolean";
578
578
  }).length > 0);
579
579
  }
@@ -583,27 +583,30 @@ var require_bugsnag = __commonJS({
583
583
  return [];
584
584
  },
585
585
  message: "should be a function or array of functions",
586
- validate: _$listOfFunctions_26
586
+ validate: _$listOfFunctions_32
587
587
  },
588
588
  onSession: {
589
589
  defaultValue: function() {
590
590
  return [];
591
591
  },
592
592
  message: "should be a function or array of functions",
593
- validate: _$listOfFunctions_26
593
+ validate: _$listOfFunctions_32
594
594
  },
595
595
  onBreadcrumb: {
596
596
  defaultValue: function() {
597
597
  return [];
598
598
  },
599
599
  message: "should be a function or array of functions",
600
- validate: _$listOfFunctions_26
600
+ validate: _$listOfFunctions_32
601
601
  },
602
602
  endpoints: {
603
- defaultValue: function() {
604
- return {
603
+ defaultValue: function(endpoints) {
604
+ return typeof endpoints > "u" ? {
605
605
  notify: "https://notify.bugsnag.com",
606
606
  sessions: "https://sessions.bugsnag.com"
607
+ } : {
608
+ notify: null,
609
+ sessions: null
607
610
  };
608
611
  },
609
612
  message: "should be an object containing endpoint URLs { notify, sessions }",
@@ -611,9 +614,9 @@ var require_bugsnag = __commonJS({
611
614
  return (
612
615
  // first, ensure it's an object
613
616
  val && typeof val == "object" && // notify and sessions must always be set
614
- _$stringWithLength_27(val.notify) && _$stringWithLength_27(val.sessions) && // ensure no keys other than notify/session are set on endpoints object
615
- _$filter_11(_$keys_14(val), function(k) {
616
- return !_$includes_12(["notify", "sessions"], k);
617
+ _$stringWithLength_33(val.notify) && _$stringWithLength_33(val.sessions) && // ensure no keys other than notify/session are set on endpoints object
618
+ _$filter_17(_$keys_20(val), function(k) {
619
+ return !_$includes_18(["notify", "sessions"], k);
617
620
  }).length === 0
618
621
  );
619
622
  }
@@ -633,7 +636,7 @@ var require_bugsnag = __commonJS({
633
636
  },
634
637
  message: "should be an array of strings",
635
638
  validate: function(value) {
636
- return value === null || _$isArray_13(value) && _$filter_11(value, function(f) {
639
+ return value === null || _$isArray_19(value) && _$filter_17(value, function(f) {
637
640
  return typeof f == "string";
638
641
  }).length === value.length;
639
642
  }
@@ -653,17 +656,17 @@ var require_bugsnag = __commonJS({
653
656
  },
654
657
  message: "should be a number \u2264100",
655
658
  validate: function(value) {
656
- return _$intRange_25(0, 100)(value);
659
+ return _$intRange_31(0, 100)(value);
657
660
  }
658
661
  },
659
662
  enabledBreadcrumbTypes: {
660
663
  defaultValue: function() {
661
- return _$breadcrumbTypes_6;
664
+ return _$breadcrumbTypes_12;
662
665
  },
663
- message: "should be null or a list of available breadcrumb types (" + _$breadcrumbTypes_6.join(",") + ")",
666
+ message: "should be null or a list of available breadcrumb types (" + _$breadcrumbTypes_12.join(",") + ")",
664
667
  validate: function(value) {
665
- return value === null || _$isArray_13(value) && _$reduce_16(value, function(accum, maybeType) {
666
- return accum === !1 ? accum : _$includes_12(_$breadcrumbTypes_6, maybeType);
668
+ return value === null || _$isArray_19(value) && _$reduce_22(value, function(accum, maybeType) {
669
+ return accum === !1 ? accum : _$includes_18(_$breadcrumbTypes_12, maybeType);
667
670
  }, !0);
668
671
  }
669
672
  },
@@ -681,8 +684,8 @@ var require_bugsnag = __commonJS({
681
684
  },
682
685
  message: "should be an object with { id, email, name } properties",
683
686
  validate: function(value) {
684
- return value === null || value && _$reduce_16(_$keys_14(value), function(accum, key) {
685
- return accum && _$includes_12(["id", "email", "name"], key);
687
+ return value === null || value && _$reduce_22(_$keys_20(value), function(accum, key) {
688
+ return accum && _$includes_18(["id", "email", "name"], key);
686
689
  }, !0);
687
690
  }
688
691
  },
@@ -700,7 +703,7 @@ var require_bugsnag = __commonJS({
700
703
  },
701
704
  message: "should be null or an object with methods { debug, info, warn, error }",
702
705
  validate: function(value) {
703
- return !value || value && _$reduce_16(["debug", "info", "warn", "error"], function(accum, method) {
706
+ return !value || value && _$reduce_22(["debug", "info", "warn", "error"], function(accum, method) {
704
707
  return accum && typeof value[method] == "function";
705
708
  }, !0);
706
709
  }
@@ -711,7 +714,7 @@ var require_bugsnag = __commonJS({
711
714
  },
712
715
  message: "should be an array of strings|regexes",
713
716
  validate: function(value) {
714
- return _$isArray_13(value) && value.length === _$filter_11(value, function(s) {
717
+ return _$isArray_19(value) && value.length === _$filter_17(value, function(s) {
715
718
  return typeof s == "string" || s && typeof s.test == "function";
716
719
  }).length;
717
720
  }
@@ -722,7 +725,7 @@ var require_bugsnag = __commonJS({
722
725
  },
723
726
  message: "should be an array of plugin objects",
724
727
  validate: function(value) {
725
- return _$isArray_13(value) && value.length === _$filter_11(value, function(p) {
728
+ return _$isArray_19(value) && value.length === _$filter_17(value, function(p) {
726
729
  return p && typeof p == "object" && typeof p.load == "function";
727
730
  }).length;
728
731
  }
@@ -733,24 +736,42 @@ var require_bugsnag = __commonJS({
733
736
  },
734
737
  message: 'should be an array of objects that have a "name" property',
735
738
  validate: function(value) {
736
- return _$isArray_13(value) && value.length === _$filter_11(value, function(feature) {
739
+ return _$isArray_19(value) && value.length === _$filter_17(value, function(feature) {
737
740
  return feature && typeof feature == "object" && typeof feature.name == "string";
738
741
  }).length;
739
742
  }
743
+ },
744
+ reportUnhandledPromiseRejectionsAsHandled: {
745
+ defaultValue: function() {
746
+ return !1;
747
+ },
748
+ message: "should be true|false",
749
+ validate: function(value) {
750
+ return value === !0 || value === !1;
751
+ }
752
+ },
753
+ sendPayloadChecksums: {
754
+ defaultValue: function() {
755
+ return !1;
756
+ },
757
+ message: "should be true|false",
758
+ validate: function(value) {
759
+ return value === !0 || value === !1;
760
+ }
740
761
  }
741
762
  };
742
- var _$errorStackParser_9 = require_error_stack_parser(), _$assign_10 = function(target) {
763
+ var _$errorStackParser_15 = require_error_stack_parser(), _$assign_16 = function(target) {
743
764
  for (var i = 1; i < arguments.length; i++) {
744
765
  var source = arguments[i];
745
766
  for (var key in source)
746
767
  Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
747
768
  }
748
769
  return target;
749
- }, _$map_15 = function(arr, fn) {
750
- return _$reduce_16(arr, function(accum, item, i, arr2) {
770
+ }, _$map_21 = function(arr, fn) {
771
+ return _$reduce_22(arr, function(accum, item, i, arr2) {
751
772
  return accum.concat(fn(item, i, arr2));
752
773
  }, []);
753
- }, _$safeJsonStringify_31 = function(data, replacer, space, opts) {
774
+ }, _$safeJsonStringify_5 = function(data, replacer, space, opts) {
754
775
  var redactedKeys = opts && opts.redactedKeys ? opts.redactedKeys : [], redactedPaths = opts && opts.redactedPaths ? opts.redactedPaths : [];
755
776
  return JSON.stringify(prepareObjForSerialization(data, redactedKeys, redactedPaths), replacer, space);
756
777
  }, MAX_DEPTH = 20, MAX_EDGES = 25e3, MIN_PRESERVED_DEPTH = 8, REPLACEMENT_NODE = "...";
@@ -775,7 +796,7 @@ var require_bugsnag = __commonJS({
775
796
  if (typeof patterns[i] == "string" && patterns[i].toLowerCase() === key.toLowerCase() || patterns[i] && typeof patterns[i].test == "function" && patterns[i].test(key)) return !0;
776
797
  return !1;
777
798
  }
778
- function __isArray_31(obj) {
799
+ function __isArray_5(obj) {
779
800
  return Object.prototype.toString.call(obj) === "[object Array]";
780
801
  }
781
802
  function safelyGetProp(obj, prop) {
@@ -811,7 +832,7 @@ var require_bugsnag = __commonJS({
811
832
  }, path2);
812
833
  return seen.pop(), eResult;
813
834
  }
814
- if (__isArray_31(obj2)) {
835
+ if (__isArray_5(obj2)) {
815
836
  for (var aResult = [], i = 0, len = obj2.length; i < len; i++) {
816
837
  if (edgesExceeded()) {
817
838
  aResult.push(REPLACEMENT_NODE);
@@ -843,7 +864,7 @@ var require_bugsnag = __commonJS({
843
864
  }
844
865
  function add(existingFeatures, existingFeatureKeys, name2, variant) {
845
866
  if (typeof name2 == "string") {
846
- variant === void 0 ? variant = null : variant !== null && typeof variant != "string" && (variant = _$safeJsonStringify_31(variant));
867
+ variant === void 0 ? variant = null : variant !== null && typeof variant != "string" && (variant = _$safeJsonStringify_5(variant));
847
868
  var existingIndex = existingFeatureKeys[name2];
848
869
  if (typeof existingIndex == "number") {
849
870
  existingFeatures[existingIndex] = {
@@ -859,7 +880,7 @@ var require_bugsnag = __commonJS({
859
880
  }
860
881
  }
861
882
  function merge(existingFeatures, newFeatures, existingFeatureKeys) {
862
- if (_$isArray_13(newFeatures)) {
883
+ if (_$isArray_19(newFeatures)) {
863
884
  for (var i = 0; i < newFeatures.length; ++i) {
864
885
  var feature = newFeatures[i];
865
886
  feature === null || typeof feature != "object" || add(existingFeatures, existingFeatureKeys, feature.name, feature.variant);
@@ -868,7 +889,7 @@ var require_bugsnag = __commonJS({
868
889
  }
869
890
  }
870
891
  function toEventApi(featureFlags) {
871
- return _$map_15(_$filter_11(featureFlags, Boolean), function(_ref) {
892
+ return _$map_21(_$filter_17(featureFlags, Boolean), function(_ref) {
872
893
  var name2 = _ref.name, variant = _ref.variant, flag = {
873
894
  featureFlag: name2
874
895
  };
@@ -879,19 +900,19 @@ var require_bugsnag = __commonJS({
879
900
  var existingIndex = featuresIndex[name2];
880
901
  typeof existingIndex == "number" && (features[existingIndex] = null, delete featuresIndex[name2]);
881
902
  }
882
- var _$featureFlagDelegate_17 = {
903
+ var _$featureFlagDelegate_23 = {
883
904
  add,
884
905
  clear,
885
906
  merge,
886
907
  toEventApi
887
- }, _$hasStack_18 = function(err) {
908
+ }, _$hasStack_24 = function(err) {
888
909
  return !!err && (!!err.stack || !!err.stacktrace || !!err["opera#sourceloc"]) && typeof (err.stack || err.stacktrace || err["opera#sourceloc"]) == "string" && err.stack !== err.name + ": " + err.message;
889
- }, _$iserror_19 = require_iserror(), __add_21 = function(state, section, keyOrObj, maybeVal) {
910
+ }, _$iserror_25 = require_iserror(), __add_27 = function(state, section, keyOrObj, maybeVal) {
890
911
  var _updates;
891
912
  if (section) {
892
913
  var updates;
893
- if (keyOrObj === null) return __clear_21(state, section);
894
- typeof keyOrObj == "object" && (updates = keyOrObj), typeof keyOrObj == "string" && (updates = (_updates = {}, _updates[keyOrObj] = maybeVal, _updates)), updates && (section === "__proto__" || section === "constructor" || section === "prototype" || (state[section] || (state[section] = {}), state[section] = _$assign_10({}, state[section], updates)));
914
+ if (keyOrObj === null) return __clear_27(state, section);
915
+ typeof keyOrObj == "object" && (updates = keyOrObj), typeof keyOrObj == "string" && (updates = (_updates = {}, _updates[keyOrObj] = maybeVal, _updates)), updates && (section === "__proto__" || section === "constructor" || section === "prototype" || (state[section] || (state[section] = {}), state[section] = _$assign_16({}, state[section], updates)));
895
916
  }
896
917
  }, get = function(state, section, key) {
897
918
  if (typeof section == "string") {
@@ -900,7 +921,7 @@ var require_bugsnag = __commonJS({
900
921
  if (state[section])
901
922
  return state[section][key];
902
923
  }
903
- }, __clear_21 = function(state, section, key) {
924
+ }, __clear_27 = function(state, section, key) {
904
925
  if (typeof section == "string") {
905
926
  if (!key) {
906
927
  delete state[section];
@@ -908,46 +929,50 @@ var require_bugsnag = __commonJS({
908
929
  }
909
930
  section === "__proto__" || section === "constructor" || section === "prototype" || state[section] && delete state[section][key];
910
931
  }
911
- }, _$metadataDelegate_21 = {
912
- add: __add_21,
932
+ }, _$metadataDelegate_27 = {
933
+ add: __add_27,
913
934
  get,
914
- clear: __clear_21
935
+ clear: __clear_27
915
936
  };
916
937
  function _extends() {
917
- return _extends = Object.assign ? Object.assign.bind() : function(target) {
918
- for (var i = 1; i < arguments.length; i++) {
919
- var source = arguments[i];
920
- for (var key in source)
921
- Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
938
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
939
+ for (var e = 1; e < arguments.length; e++) {
940
+ var t = arguments[e];
941
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
922
942
  }
923
- return target;
924
- }, _extends.apply(this, arguments);
943
+ return n;
944
+ }, _extends.apply(null, arguments);
925
945
  }
926
946
  var StackGenerator = require_stack_generator(), Event = /* @__PURE__ */ function() {
927
947
  function Event2(errorClass, errorMessage, stacktrace, handledState, originalError) {
928
- stacktrace === void 0 && (stacktrace = []), handledState === void 0 && (handledState = defaultHandledState()), this.apiKey = void 0, this.context = void 0, this.groupingHash = void 0, this.originalError = originalError, this._handledState = handledState, this.severity = this._handledState.severity, this.unhandled = this._handledState.unhandled, this.app = {}, this.device = {}, this.request = {}, this.breadcrumbs = [], this.threads = [], this._metadata = {}, this._features = [], this._featuresIndex = {}, this._user = {}, this._session = void 0, this._correlation = void 0, this.errors = [createBugsnagError(errorClass, errorMessage, Event2.__type, stacktrace)];
948
+ stacktrace === void 0 && (stacktrace = []), handledState === void 0 && (handledState = defaultHandledState()), this.apiKey = void 0, this.context = void 0, this.groupingHash = void 0, this.originalError = originalError, this._handledState = handledState, this.severity = this._handledState.severity, this.unhandled = this._handledState.unhandled, this.app = {}, this.device = {}, this.request = {}, this.breadcrumbs = [], this.threads = [], this._metadata = {}, this._features = [], this._featuresIndex = {}, this._user = {}, this._session = void 0, this._correlation = void 0, this._groupingDiscriminator = void 0, this.errors = [createBugsnagError(errorClass, errorMessage, Event2.__type, stacktrace)];
929
949
  }
930
950
  var _proto = Event2.prototype;
931
951
  return _proto.addMetadata = function(section, keyOrObj, maybeVal) {
932
- return _$metadataDelegate_21.add(this._metadata, section, keyOrObj, maybeVal);
952
+ return _$metadataDelegate_27.add(this._metadata, section, keyOrObj, maybeVal);
933
953
  }, _proto.setTraceCorrelation = function(traceId, spanId) {
934
954
  typeof traceId == "string" && (this._correlation = _extends({
935
955
  traceId
936
956
  }, typeof spanId == "string" ? {
937
957
  spanId
938
958
  } : {}));
959
+ }, _proto.getGroupingDiscriminator = function() {
960
+ return this._groupingDiscriminator;
961
+ }, _proto.setGroupingDiscriminator = function(value) {
962
+ var previousValue = this._groupingDiscriminator;
963
+ return (typeof value == "string" || value === null || value === void 0) && (this._groupingDiscriminator = value), previousValue;
939
964
  }, _proto.getMetadata = function(section, key) {
940
- return _$metadataDelegate_21.get(this._metadata, section, key);
965
+ return _$metadataDelegate_27.get(this._metadata, section, key);
941
966
  }, _proto.clearMetadata = function(section, key) {
942
- return _$metadataDelegate_21.clear(this._metadata, section, key);
967
+ return _$metadataDelegate_27.clear(this._metadata, section, key);
943
968
  }, _proto.addFeatureFlag = function(name2, variant) {
944
- variant === void 0 && (variant = null), _$featureFlagDelegate_17.add(this._features, this._featuresIndex, name2, variant);
969
+ variant === void 0 && (variant = null), _$featureFlagDelegate_23.add(this._features, this._featuresIndex, name2, variant);
945
970
  }, _proto.addFeatureFlags = function(featureFlags) {
946
- _$featureFlagDelegate_17.merge(this._features, featureFlags, this._featuresIndex);
971
+ _$featureFlagDelegate_23.merge(this._features, featureFlags, this._featuresIndex);
947
972
  }, _proto.getFeatureFlags = function() {
948
- return _$featureFlagDelegate_17.toEventApi(this._features);
973
+ return _$featureFlagDelegate_23.toEventApi(this._features);
949
974
  }, _proto.clearFeatureFlag = function(name2) {
950
- _$featureFlagDelegate_17.clear(this._features, this._featuresIndex, name2);
975
+ _$featureFlagDelegate_23.clear(this._features, this._featuresIndex, name2);
951
976
  }, _proto.clearFeatureFlags = function() {
952
977
  this._features = [], this._featuresIndex = {};
953
978
  }, _proto.getUser = function() {
@@ -961,8 +986,8 @@ var require_bugsnag = __commonJS({
961
986
  }, _proto.toJSON = function() {
962
987
  return {
963
988
  payloadVersion: "4",
964
- exceptions: _$map_15(this.errors, function(er) {
965
- return _$assign_10({}, er, {
989
+ exceptions: _$map_21(this.errors, function(er) {
990
+ return _$assign_16({}, er, {
966
991
  message: er.errorMessage
967
992
  });
968
993
  }),
@@ -975,6 +1000,7 @@ var require_bugsnag = __commonJS({
975
1000
  breadcrumbs: this.breadcrumbs,
976
1001
  context: this.context,
977
1002
  groupingHash: this.groupingHash,
1003
+ groupingDiscriminator: this._groupingDiscriminator,
978
1004
  metaData: this._metadata,
979
1005
  user: this._user,
980
1006
  session: this._session,
@@ -1010,7 +1036,7 @@ var require_bugsnag = __commonJS({
1010
1036
  errorClass: ensureString(errorClass),
1011
1037
  errorMessage: ensureString(errorMessage),
1012
1038
  type,
1013
- stacktrace: _$reduce_16(stacktrace, function(accum, frame) {
1039
+ stacktrace: _$reduce_22(stacktrace, function(accum, frame) {
1014
1040
  var f = formatStackframe(frame);
1015
1041
  try {
1016
1042
  return JSON.stringify(f) === "{}" ? accum : accum.concat(f);
@@ -1024,9 +1050,9 @@ var require_bugsnag = __commonJS({
1024
1050
  return error.cause ? [error].concat(getCauseStack(error.cause)) : [error];
1025
1051
  }
1026
1052
  Event.getStacktrace = function(error, errorFramesToSkip, backtraceFramesToSkip) {
1027
- if (_$hasStack_18(error)) return _$errorStackParser_9.parse(error).slice(errorFramesToSkip);
1053
+ if (_$hasStack_24(error)) return _$errorStackParser_15.parse(error).slice(errorFramesToSkip);
1028
1054
  try {
1029
- return _$filter_11(StackGenerator.backtrace(), function(frame) {
1055
+ return _$filter_17(StackGenerator.backtrace(), function(frame) {
1030
1056
  return (frame.functionName || "").indexOf("StackGenerator$$") === -1;
1031
1057
  }).slice(1 + backtraceFramesToSkip);
1032
1058
  } catch {
@@ -1052,8 +1078,8 @@ var require_bugsnag = __commonJS({
1052
1078
  event = new Event(error.name, error.message, [], handledState, maybeError);
1053
1079
  }
1054
1080
  if (error.name === "InvalidError" && event.addMetadata("" + component, "non-error parameter", makeSerialisable(maybeError)), error.cause) {
1055
- var _event$errors, causes = getCauseStack(error).slice(1), normalisedCauses = _$map_15(causes, function(cause) {
1056
- var stacktrace2 = _$iserror_19(cause) && _$hasStack_18(cause) ? _$errorStackParser_9.parse(cause) : [], _normaliseError2 = normaliseError(cause, !0, "error cause"), error2 = _normaliseError2[0];
1081
+ var _event$errors, causes = getCauseStack(error).slice(1), normalisedCauses = _$map_21(causes, function(cause) {
1082
+ var stacktrace2 = _$iserror_25(cause) && _$hasStack_24(cause) ? _$errorStackParser_15.parse(cause) : [], _normaliseError2 = normaliseError(cause, !0, "error cause"), error2 = _normaliseError2[0];
1057
1083
  return error2.name === "InvalidError" && event.addMetadata("error cause", makeSerialisable(cause)), createBugsnagError(error2.name, error2.message, Event.__type, stacktrace2);
1058
1084
  });
1059
1085
  (_event$errors = event.errors).push.apply(_event$errors, normalisedCauses);
@@ -1070,7 +1096,7 @@ var require_bugsnag = __commonJS({
1070
1096
  return err.name = "InvalidError", err;
1071
1097
  };
1072
1098
  if (!tolerateNonErrors)
1073
- _$iserror_19(maybeError) ? error = maybeError : (error = createAndLogInputError(typeof maybeError), internalFrames += 2);
1099
+ _$iserror_25(maybeError) ? error = maybeError : (error = createAndLogInputError(typeof maybeError), internalFrames += 2);
1074
1100
  else
1075
1101
  switch (typeof maybeError) {
1076
1102
  case "string":
@@ -1082,23 +1108,23 @@ var require_bugsnag = __commonJS({
1082
1108
  error = createAndLogInputError("function"), internalFrames += 2;
1083
1109
  break;
1084
1110
  case "object":
1085
- maybeError !== null && _$iserror_19(maybeError) ? error = maybeError : maybeError !== null && hasNecessaryFields(maybeError) ? (error = new Error(maybeError.message || maybeError.errorMessage), error.name = maybeError.name || maybeError.errorClass, internalFrames += 1) : (error = createAndLogInputError(maybeError === null ? "null" : "unsupported object"), internalFrames += 2);
1111
+ maybeError !== null && _$iserror_25(maybeError) ? error = maybeError : maybeError !== null && hasNecessaryFields(maybeError) ? (error = new Error(maybeError.message || maybeError.errorMessage), error.name = maybeError.name || maybeError.errorClass, internalFrames += 1) : (error = createAndLogInputError(maybeError === null ? "null" : "unsupported object"), internalFrames += 2);
1086
1112
  break;
1087
1113
  default:
1088
1114
  error = createAndLogInputError("nothing"), internalFrames += 2;
1089
1115
  }
1090
- if (!_$hasStack_18(error))
1116
+ if (!_$hasStack_24(error))
1091
1117
  try {
1092
1118
  throw error;
1093
1119
  } catch (e) {
1094
- _$hasStack_18(e) && (error = e, internalFrames = 1);
1120
+ _$hasStack_24(e) && (error = e, internalFrames = 1);
1095
1121
  }
1096
1122
  return [error, internalFrames];
1097
1123
  };
1098
1124
  Event.__type = "browserjs";
1099
1125
  var hasNecessaryFields = function(error) {
1100
1126
  return (typeof error.name == "string" || typeof error.errorClass == "string") && (typeof error.message == "string" || typeof error.errorMessage == "string");
1101
- }, _$Event_4 = Event, _$asyncEvery_5 = function(arr, fn, cb) {
1127
+ }, _$Event_10 = Event, _$asyncEvery_11 = function(arr, fn, cb) {
1102
1128
  var index = 0, next = function() {
1103
1129
  if (index >= arr.length) return cb(null, !0);
1104
1130
  fn(arr[index], function(err, result) {
@@ -1108,7 +1134,7 @@ var require_bugsnag = __commonJS({
1108
1134
  });
1109
1135
  };
1110
1136
  next();
1111
- }, _$callbackRunner_7 = function(callbacks, event, onCallbackError, cb) {
1137
+ }, _$callbackRunner_13 = function(callbacks, event, onCallbackError, cb) {
1112
1138
  var runMaybeAsyncCallback = function(fn, cb2) {
1113
1139
  if (typeof fn != "function") return cb2(null);
1114
1140
  try {
@@ -1138,8 +1164,8 @@ var require_bugsnag = __commonJS({
1138
1164
  onCallbackError(e), cb2(null);
1139
1165
  }
1140
1166
  };
1141
- _$asyncEvery_5(callbacks, runMaybeAsyncCallback, cb);
1142
- }, _$syncCallbackRunner_24 = function(callbacks, callbackArg, callbackType, logger) {
1167
+ _$asyncEvery_11(callbacks, runMaybeAsyncCallback, cb);
1168
+ }, _$syncCallbackRunner_30 = function(callbacks, callbackArg, callbackType, logger) {
1143
1169
  for (var ignore = !1, cbs = callbacks.slice(); !ignore && cbs.length; )
1144
1170
  try {
1145
1171
  ignore = cbs.pop()(callbackArg) === !1;
@@ -1147,28 +1173,38 @@ var require_bugsnag = __commonJS({
1147
1173
  logger.error("Error occurred in " + callbackType + " callback, continuing anyway\u2026"), logger.error(e);
1148
1174
  }
1149
1175
  return ignore;
1150
- }, _$pad_30 = function(num, size) {
1176
+ }, _$pad_4 = function(num, size) {
1151
1177
  var s = "000000000" + num;
1152
1178
  return s.substr(s.length - size);
1153
- }, os = __require("os"), padding = 2, pid = _$pad_30(process.pid.toString(36), padding), hostname = os.hostname(), length = hostname.length, hostId = _$pad_30(hostname.split("").reduce(function(prev, char) {
1179
+ }, os = __require("os");
1180
+ function getHostname() {
1181
+ try {
1182
+ return os.hostname();
1183
+ } catch {
1184
+ return process.env._CLUSTER_NETWORK_NAME_ || process.env.COMPUTERNAME || "hostname";
1185
+ }
1186
+ }
1187
+ var padding = 2, pid = _$pad_4(process.pid.toString(36), padding), hostname = getHostname(), length = hostname.length, hostId = _$pad_4(hostname.split("").reduce(function(prev, char) {
1154
1188
  return +prev + char.charCodeAt(0);
1155
- }, +length + 36).toString(36), padding), _$fingerprint_29 = function() {
1189
+ }, +length + 36).toString(36), padding), _$fingerprint_2 = function() {
1156
1190
  return pid + hostId;
1191
+ }, _$isCuid_3 = function(value) {
1192
+ return typeof value == "string" && /^c[a-z0-9]{20,32}$/.test(value);
1157
1193
  }, c = 0, blockSize = 4, base = 36, discreteValues = Math.pow(base, blockSize);
1158
1194
  function randomBlock() {
1159
- return _$pad_30((Math.random() * discreteValues << 0).toString(base), blockSize);
1195
+ return _$pad_4((Math.random() * discreteValues << 0).toString(base), blockSize);
1160
1196
  }
1161
1197
  function safeCounter() {
1162
1198
  return c = c < discreteValues ? c : 0, c++, c - 1;
1163
1199
  }
1164
1200
  function cuid() {
1165
- var letter = "c", timestamp = (/* @__PURE__ */ new Date()).getTime().toString(base), counter = _$pad_30(safeCounter().toString(base), blockSize), print = _$fingerprint_29(), random = randomBlock() + randomBlock();
1201
+ var letter = "c", timestamp = (/* @__PURE__ */ new Date()).getTime().toString(base), counter = _$pad_4(safeCounter().toString(base), blockSize), print = _$fingerprint_2(), random = randomBlock() + randomBlock();
1166
1202
  return letter + timestamp + counter + print + random;
1167
1203
  }
1168
- cuid.fingerprint = _$fingerprint_29;
1169
- var _$cuid_28 = cuid, Session = /* @__PURE__ */ function() {
1204
+ cuid.fingerprint = _$fingerprint_2, cuid.isCuid = _$isCuid_3;
1205
+ var _$cuid_1 = cuid, Session = /* @__PURE__ */ function() {
1170
1206
  function Session2() {
1171
- this.id = _$cuid_28(), this.startedAt = /* @__PURE__ */ new Date(), this._handled = 0, this._unhandled = 0, this._user = {}, this.app = {}, this.device = {};
1207
+ this.id = _$cuid_1(), this.startedAt = /* @__PURE__ */ new Date(), this._handled = 0, this._unhandled = 0, this._user = {}, this.app = {}, this.device = {};
1172
1208
  }
1173
1209
  var _proto = Session2.prototype;
1174
1210
  return _proto.getUser = function() {
@@ -1191,11 +1227,11 @@ var require_bugsnag = __commonJS({
1191
1227
  }, _proto._track = function(event) {
1192
1228
  this[event._handledState.unhandled ? "_unhandled" : "_handled"] += 1;
1193
1229
  }, Session2;
1194
- }(), _$Session_32 = Session, __add_2 = _$featureFlagDelegate_17.add, __clear_2 = _$featureFlagDelegate_17.clear, __merge_2 = _$featureFlagDelegate_17.merge, noop = function() {
1230
+ }(), _$Session_34 = Session, __add_8 = _$featureFlagDelegate_23.add, __clear_8 = _$featureFlagDelegate_23.clear, __merge_8 = _$featureFlagDelegate_23.merge, HUB_PREFIX = "00000", HUB_NOTIFY = "https://notify.insighthub.smartbear.com", HUB_SESSION = "https://sessions.insighthub.smartbear.com", noop = function() {
1195
1231
  }, Client = /* @__PURE__ */ function() {
1196
1232
  function Client2(configuration, schema2, internalPlugins2, notifier) {
1197
1233
  var _this = this;
1198
- schema2 === void 0 && (schema2 = _$config_3.schema), internalPlugins2 === void 0 && (internalPlugins2 = []), this._notifier = notifier, this._config = {}, this._schema = schema2, this._delivery = {
1234
+ schema2 === void 0 && (schema2 = _$config_9.schema), internalPlugins2 === void 0 && (internalPlugins2 = []), this._notifier = notifier, this._config = {}, this._schema = schema2, this._delivery = {
1199
1235
  sendSession: noop,
1200
1236
  sendEvent: noop
1201
1237
  }, this._logger = {
@@ -1203,12 +1239,12 @@ var require_bugsnag = __commonJS({
1203
1239
  info: noop,
1204
1240
  warn: noop,
1205
1241
  error: noop
1206
- }, this._plugins = {}, this._breadcrumbs = [], this._session = null, this._metadata = {}, this._featuresIndex = {}, this._features = [], this._context = void 0, this._user = {}, this._cbs = {
1242
+ }, this._plugins = {}, this._breadcrumbs = [], this._session = null, this._metadata = {}, this._featuresIndex = {}, this._features = [], this._context = void 0, this._user = {}, this._groupingDiscriminator = void 0, this._cbs = {
1207
1243
  e: [],
1208
1244
  s: [],
1209
1245
  sp: [],
1210
1246
  b: []
1211
- }, this.Client = Client2, this.Event = _$Event_4, this.Breadcrumb = _$Breadcrumb_1, this.Session = _$Session_32, this._config = this._configure(configuration, internalPlugins2), _$map_15(internalPlugins2.concat(this._config.plugins), function(pl) {
1247
+ }, this.Client = Client2, this.Event = _$Event_10, this.Breadcrumb = _$Breadcrumb_7, this.Session = _$Session_34, this._config = this._configure(configuration, internalPlugins2), _$map_21(internalPlugins2.concat(this._config.plugins), function(pl) {
1212
1248
  pl && _this._loadPlugin(pl);
1213
1249
  }), this._depth = 1;
1214
1250
  var self2 = this, notify = this.notify;
@@ -1218,31 +1254,38 @@ var require_bugsnag = __commonJS({
1218
1254
  }
1219
1255
  var _proto = Client2.prototype;
1220
1256
  return _proto.addMetadata = function(section, keyOrObj, maybeVal) {
1221
- return _$metadataDelegate_21.add(this._metadata, section, keyOrObj, maybeVal);
1257
+ return _$metadataDelegate_27.add(this._metadata, section, keyOrObj, maybeVal);
1222
1258
  }, _proto.getMetadata = function(section, key) {
1223
- return _$metadataDelegate_21.get(this._metadata, section, key);
1259
+ return _$metadataDelegate_27.get(this._metadata, section, key);
1224
1260
  }, _proto.clearMetadata = function(section, key) {
1225
- return _$metadataDelegate_21.clear(this._metadata, section, key);
1261
+ return _$metadataDelegate_27.clear(this._metadata, section, key);
1226
1262
  }, _proto.addFeatureFlag = function(name2, variant) {
1227
- variant === void 0 && (variant = null), __add_2(this._features, this._featuresIndex, name2, variant);
1263
+ variant === void 0 && (variant = null), __add_8(this._features, this._featuresIndex, name2, variant);
1228
1264
  }, _proto.addFeatureFlags = function(featureFlags) {
1229
- __merge_2(this._features, featureFlags, this._featuresIndex);
1265
+ __merge_8(this._features, featureFlags, this._featuresIndex);
1230
1266
  }, _proto.clearFeatureFlag = function(name2) {
1231
- __clear_2(this._features, this._featuresIndex, name2);
1267
+ __clear_8(this._features, this._featuresIndex, name2);
1232
1268
  }, _proto.clearFeatureFlags = function() {
1233
1269
  this._features = [], this._featuresIndex = {};
1234
1270
  }, _proto.getContext = function() {
1235
1271
  return this._context;
1236
1272
  }, _proto.setContext = function(c2) {
1237
1273
  this._context = c2;
1274
+ }, _proto.getGroupingDiscriminator = function() {
1275
+ return this._groupingDiscriminator;
1276
+ }, _proto.setGroupingDiscriminator = function(value) {
1277
+ var previousValue = this._groupingDiscriminator;
1278
+ return (typeof value == "string" || value === null || value === void 0) && (this._groupingDiscriminator = value), previousValue;
1238
1279
  }, _proto._configure = function(opts, internalPlugins2) {
1239
- var schema2 = _$reduce_16(internalPlugins2, function(schema3, plugin) {
1240
- return plugin && plugin.configSchema ? _$assign_10({}, schema3, plugin.configSchema) : schema3;
1241
- }, this._schema), _reduce = _$reduce_16(_$keys_14(schema2), function(accum, key) {
1280
+ var schema2 = _$reduce_22(internalPlugins2, function(schema3, plugin) {
1281
+ return plugin && plugin.configSchema ? _$assign_16({}, schema3, plugin.configSchema) : schema3;
1282
+ }, this._schema);
1283
+ opts.endpoints || (opts.sendPayloadChecksums = "sendPayloadChecksums" in opts ? opts.sendPayloadChecksums : !0);
1284
+ var _reduce = _$reduce_22(_$keys_20(schema2), function(accum, key) {
1242
1285
  var defaultValue = schema2[key].defaultValue(opts[key]);
1243
1286
  if (opts[key] !== void 0) {
1244
1287
  var valid = schema2[key].validate(opts[key]);
1245
- valid ? schema2[key].allowPartialObject ? accum.config[key] = _$assign_10(defaultValue, opts[key]) : accum.config[key] = opts[key] : (accum.errors[key] = schema2[key].message, accum.config[key] = defaultValue);
1288
+ valid ? schema2[key].allowPartialObject ? accum.config[key] = _$assign_16(defaultValue, opts[key]) : accum.config[key] = opts[key] : (accum.errors[key] = schema2[key].message, accum.config[key] = defaultValue);
1246
1289
  } else
1247
1290
  accum.config[key] = defaultValue;
1248
1291
  return accum;
@@ -1252,9 +1295,12 @@ var require_bugsnag = __commonJS({
1252
1295
  }), errors = _reduce.errors, config = _reduce.config;
1253
1296
  if (schema2.apiKey) {
1254
1297
  if (!config.apiKey) throw new Error("No Bugsnag API Key set");
1255
- /^[0-9a-f]{32}$/i.test(config.apiKey) || (errors.apiKey = "should be a string of 32 hexadecimal characters");
1298
+ /^[0-9a-f]{32}$/i.test(config.apiKey) || (errors.apiKey = "should be a string of 32 hexadecimal characters"), opts.endpoints === void 0 && config.apiKey.startsWith(HUB_PREFIX) && (config.endpoints = {
1299
+ notify: HUB_NOTIFY,
1300
+ sessions: HUB_SESSION
1301
+ });
1256
1302
  }
1257
- return this._metadata = _$assign_10({}, config.metadata), __merge_2(this._features, config.featureFlags, this._featuresIndex), this._user = _$assign_10({}, config.user), this._context = config.context, config.logger && (this._logger = config.logger), config.onError && (this._cbs.e = this._cbs.e.concat(config.onError)), config.onBreadcrumb && (this._cbs.b = this._cbs.b.concat(config.onBreadcrumb)), config.onSession && (this._cbs.s = this._cbs.s.concat(config.onSession)), _$keys_14(errors).length && this._logger.warn(generateConfigErrorMessage(errors, opts)), config;
1303
+ return this._metadata = _$assign_16({}, config.metadata), __merge_8(this._features, config.featureFlags, this._featuresIndex), this._user = _$assign_16({}, config.user), this._context = config.context, config.logger && (this._logger = config.logger), config.onError && (this._cbs.e = this._cbs.e.concat(config.onError)), config.onBreadcrumb && (this._cbs.b = this._cbs.b.concat(config.onBreadcrumb)), config.onSession && (this._cbs.s = this._cbs.s.concat(config.onSession)), _$keys_20(errors).length && this._logger.warn(generateConfigErrorMessage(errors, opts)), config;
1258
1304
  }, _proto.getUser = function() {
1259
1305
  return this._user;
1260
1306
  }, _proto.setUser = function(id, email, name2) {
@@ -1265,20 +1311,20 @@ var require_bugsnag = __commonJS({
1265
1311
  };
1266
1312
  }, _proto._loadPlugin = function(plugin) {
1267
1313
  var result = plugin.load(this);
1268
- return plugin.name && (this._plugins["~" + plugin.name + "~"] = result), this;
1314
+ plugin.name && (this._plugins["~" + plugin.name + "~"] = result);
1269
1315
  }, _proto.getPlugin = function(name2) {
1270
1316
  return this._plugins["~" + name2 + "~"];
1271
1317
  }, _proto._setDelivery = function(d) {
1272
1318
  this._delivery = d(this);
1273
1319
  }, _proto.startSession = function() {
1274
- var session = new _$Session_32();
1275
- session.app.releaseStage = this._config.releaseStage, session.app.version = this._config.appVersion, session.app.type = this._config.appType, session._user = _$assign_10({}, this._user);
1276
- var ignore = _$syncCallbackRunner_24(this._cbs.s, session, "onSession", this._logger);
1320
+ var session = new _$Session_34();
1321
+ session.app.releaseStage = this._config.releaseStage, session.app.version = this._config.appVersion, session.app.type = this._config.appType, session._user = _$assign_16({}, this._user);
1322
+ var ignore = _$syncCallbackRunner_30(this._cbs.s, session, "onSession", this._logger);
1277
1323
  return ignore ? (this._logger.debug("Session not started due to onSession callback"), this) : this._sessionDelegate.startSession(this, session);
1278
1324
  }, _proto.addOnError = function(fn, front) {
1279
1325
  front === void 0 && (front = !1), this._cbs.e[front ? "unshift" : "push"](fn);
1280
1326
  }, _proto.removeOnError = function(fn) {
1281
- this._cbs.e = _$filter_11(this._cbs.e, function(f) {
1327
+ this._cbs.e = _$filter_17(this._cbs.e, function(f) {
1282
1328
  return f !== fn;
1283
1329
  });
1284
1330
  }, _proto._addOnSessionPayload = function(fn) {
@@ -1286,13 +1332,13 @@ var require_bugsnag = __commonJS({
1286
1332
  }, _proto.addOnSession = function(fn) {
1287
1333
  this._cbs.s.push(fn);
1288
1334
  }, _proto.removeOnSession = function(fn) {
1289
- this._cbs.s = _$filter_11(this._cbs.s, function(f) {
1335
+ this._cbs.s = _$filter_17(this._cbs.s, function(f) {
1290
1336
  return f !== fn;
1291
1337
  });
1292
1338
  }, _proto.addOnBreadcrumb = function(fn, front) {
1293
1339
  front === void 0 && (front = !1), this._cbs.b[front ? "unshift" : "push"](fn);
1294
1340
  }, _proto.removeOnBreadcrumb = function(fn) {
1295
- this._cbs.b = _$filter_11(this._cbs.b, function(f) {
1341
+ this._cbs.b = _$filter_17(this._cbs.b, function(f) {
1296
1342
  return f !== fn;
1297
1343
  });
1298
1344
  }, _proto.pauseSession = function() {
@@ -1300,8 +1346,8 @@ var require_bugsnag = __commonJS({
1300
1346
  }, _proto.resumeSession = function() {
1301
1347
  return this._sessionDelegate.resumeSession(this);
1302
1348
  }, _proto.leaveBreadcrumb = function(message, metadata, type) {
1303
- if (message = typeof message == "string" ? message : "", type = typeof type == "string" && _$includes_12(_$breadcrumbTypes_6, type) ? type : "manual", metadata = typeof metadata == "object" && metadata !== null ? metadata : {}, !!message) {
1304
- var crumb = new _$Breadcrumb_1(message, metadata, type), ignore = _$syncCallbackRunner_24(this._cbs.b, crumb, "onBreadcrumb", this._logger);
1349
+ if (message = typeof message == "string" ? message : "", type = typeof type == "string" && _$includes_18(_$breadcrumbTypes_12, type) ? type : "manual", metadata = typeof metadata == "object" && metadata !== null ? metadata : {}, !!message) {
1350
+ var crumb = new _$Breadcrumb_7(message, metadata, type), ignore = _$syncCallbackRunner_30(this._cbs.b, crumb, "onBreadcrumb", this._logger);
1305
1351
  if (ignore) {
1306
1352
  this._logger.debug("Breadcrumb not attached due to onBreadcrumb callback");
1307
1353
  return;
@@ -1310,23 +1356,23 @@ var require_bugsnag = __commonJS({
1310
1356
  }
1311
1357
  }, _proto._isBreadcrumbTypeEnabled = function(type) {
1312
1358
  var types = this._config.enabledBreadcrumbTypes;
1313
- return types === null || _$includes_12(types, type);
1359
+ return types === null || _$includes_18(types, type);
1314
1360
  }, _proto.notify = function(maybeError, onError, postReportCallback) {
1315
1361
  postReportCallback === void 0 && (postReportCallback = noop);
1316
- var event = _$Event_4.create(maybeError, !0, void 0, "notify()", this._depth + 1, this._logger);
1362
+ var event = _$Event_10.create(maybeError, !0, void 0, "notify()", this._depth + 1, this._logger);
1317
1363
  this._notify(event, onError, postReportCallback);
1318
1364
  }, _proto._notify = function(event, onError, postReportCallback) {
1319
1365
  var _this2 = this;
1320
- if (postReportCallback === void 0 && (postReportCallback = noop), event.app = _$assign_10({}, event.app, {
1366
+ if (postReportCallback === void 0 && (postReportCallback = noop), event.app = _$assign_16({}, event.app, {
1321
1367
  releaseStage: this._config.releaseStage,
1322
1368
  version: this._config.appVersion,
1323
1369
  type: this._config.appType
1324
- }), event.context = event.context || this._context, event._metadata = _$assign_10({}, event._metadata, this._metadata), event._user = _$assign_10({}, event._user, this._user), event.breadcrumbs = this._breadcrumbs.slice(), __merge_2(event._features, this._features, event._featuresIndex), this._config.enabledReleaseStages !== null && !_$includes_12(this._config.enabledReleaseStages, this._config.releaseStage))
1370
+ }), event.context = event.context || this._context, event._metadata = _$assign_16({}, event._metadata, this._metadata), event._user = _$assign_16({}, event._user, this._user), event.breadcrumbs = this._breadcrumbs.slice(), event.setGroupingDiscriminator(this._groupingDiscriminator), __merge_8(event._features, this._features, event._featuresIndex), this._config.enabledReleaseStages !== null && !_$includes_18(this._config.enabledReleaseStages, this._config.releaseStage))
1325
1371
  return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"), postReportCallback(null, event);
1326
1372
  var originalSeverity = event.severity, onCallbackError = function(err) {
1327
1373
  _this2._logger.error("Error occurred in onError callback, continuing anyway\u2026"), _this2._logger.error(err);
1328
1374
  }, callbacks = [].concat(this._cbs.e).concat(onError);
1329
- _$callbackRunner_7(callbacks, event, onCallbackError, function(err, shouldSend) {
1375
+ _$callbackRunner_13(callbacks, event, onCallbackError, function(err, shouldSend) {
1330
1376
  if (err && onCallbackError(err), !shouldSend)
1331
1377
  return _this2._logger.debug("Event not sent due to onError callback"), postReportCallback(null, event);
1332
1378
  _this2._isBreadcrumbTypeEnabled("error") && Client2.prototype.leaveBreadcrumb.call(_this2, event.errors[0].errorClass, {
@@ -1346,7 +1392,7 @@ var require_bugsnag = __commonJS({
1346
1392
  }, Client2;
1347
1393
  }(), generateConfigErrorMessage = function(errors, rawInput) {
1348
1394
  var er = new Error(`Invalid configuration
1349
- ` + _$map_15(_$keys_14(errors), function(key) {
1395
+ ` + _$map_21(_$keys_20(errors), function(key) {
1350
1396
  return " - " + key + " " + errors[key] + ", got " + stringify(rawInput[key]);
1351
1397
  }).join(`
1352
1398
 
@@ -1361,9 +1407,9 @@ var require_bugsnag = __commonJS({
1361
1407
  default:
1362
1408
  return String(val);
1363
1409
  }
1364
- }, _$Client_2 = Client, _$jsonPayload_20 = {}, EVENT_REDACTION_PATHS = ["events.[].metaData", "events.[].breadcrumbs.[].metaData", "events.[].request"];
1365
- _$jsonPayload_20.event = function(event, redactedKeys) {
1366
- var payload = _$safeJsonStringify_31(event, null, null, {
1410
+ }, _$Client_8 = Client, _$jsonPayload_26 = {}, EVENT_REDACTION_PATHS = ["events.[].metaData", "events.[].breadcrumbs.[].metaData", "events.[].request"];
1411
+ _$jsonPayload_26.event = function(event, redactedKeys) {
1412
+ var payload = _$safeJsonStringify_5(event, null, null, {
1367
1413
  redactedPaths: EVENT_REDACTION_PATHS,
1368
1414
  redactedKeys
1369
1415
  });
@@ -1371,15 +1417,15 @@ var require_bugsnag = __commonJS({
1371
1417
  notifier: `WARNING!
1372
1418
  Serialized payload was ` + payload.length / 1e6 + `MB (limit = 1MB)
1373
1419
  metadata was removed`
1374
- }, payload = _$safeJsonStringify_31(event, null, null, {
1420
+ }, payload = _$safeJsonStringify_5(event, null, null, {
1375
1421
  redactedPaths: EVENT_REDACTION_PATHS,
1376
1422
  redactedKeys
1377
1423
  })), payload;
1378
- }, _$jsonPayload_20.session = function(session, redactedKeys) {
1379
- var payload = _$safeJsonStringify_31(session, null, null);
1424
+ }, _$jsonPayload_26.session = function(session, redactedKeys) {
1425
+ var payload = _$safeJsonStringify_5(session, null, null);
1380
1426
  return payload;
1381
1427
  };
1382
- var http = __require("http"), https = __require("https"), ___require_34 = __require("url"), parse = ___require_34.parse, _$request_34 = function(_ref, cb) {
1428
+ var http = __require("http"), https = __require("https"), ___require_36 = __require("url"), parse = ___require_36.parse, _$request_36 = function(_ref, cb) {
1383
1429
  var url2 = _ref.url, headers = _ref.headers, body = _ref.body, agent = _ref.agent, didError = !1, onError = function(err) {
1384
1430
  didError || (didError = !0, cb(err));
1385
1431
  }, parsedUrl = parse(url2), secure = parsedUrl.protocol === "https:", transport = secure ? https : http, req = transport.request({
@@ -1406,17 +1452,21 @@ metadata was removed`
1406
1452
  }), stream.on("end", function() {
1407
1453
  return cb(null, data);
1408
1454
  });
1409
- }, _$delivery_33 = function(client) {
1455
+ }, _$delivery_35 = function(client) {
1410
1456
  return {
1411
1457
  sendEvent: function(event, cb) {
1412
1458
  cb === void 0 && (cb = function() {
1413
1459
  });
1414
- var body = _$jsonPayload_20.event(event, client._config.redactedKeys), _cb = function(err) {
1415
- err && client._logger.error(`Event failed to send\u2026
1416
- ` + (err && err.stack ? err.stack : err), err), body.length > 1e6 && client._logger.warn("Event oversized (" + (body.length / 1e6).toFixed(2) + " MB)"), cb(err);
1460
+ var body = _$jsonPayload_26.event(event, client._config.redactedKeys), _cb = function(err2) {
1461
+ err2 && client._logger.error(`Event failed to send\u2026
1462
+ ` + (err2 && err2.stack ? err2.stack : err2), err2), body.length > 1e6 && client._logger.warn("Event oversized (" + (body.length / 1e6).toFixed(2) + " MB)"), cb(err2);
1417
1463
  };
1464
+ if (client._config.endpoints.notify === null) {
1465
+ var err = new Error("Event not sent due to incomplete endpoint configuration");
1466
+ return _cb(err);
1467
+ }
1418
1468
  try {
1419
- _$request_34({
1469
+ _$request_36({
1420
1470
  url: client._config.endpoints.notify,
1421
1471
  headers: {
1422
1472
  "Content-Type": "application/json",
@@ -1426,8 +1476,8 @@ metadata was removed`
1426
1476
  },
1427
1477
  body,
1428
1478
  agent: client._config.agent
1429
- }, function(err, body2) {
1430
- return _cb(err);
1479
+ }, function(err2, body2) {
1480
+ return _cb(err2);
1431
1481
  });
1432
1482
  } catch (e) {
1433
1483
  _cb(e);
@@ -1436,12 +1486,16 @@ metadata was removed`
1436
1486
  sendSession: function(session, cb) {
1437
1487
  cb === void 0 && (cb = function() {
1438
1488
  });
1439
- var _cb = function(err) {
1440
- err && client._logger.error(`Session failed to send\u2026
1441
- ` + (err && err.stack ? err.stack : err), err), cb(err);
1489
+ var _cb = function(err2) {
1490
+ err2 && client._logger.error(`Session failed to send\u2026
1491
+ ` + (err2 && err2.stack ? err2.stack : err2), err2), cb(err2);
1442
1492
  };
1493
+ if (client._config.endpoints.session === null) {
1494
+ var err = new Error("Session not sent due to incomplete endpoint configuration");
1495
+ return _cb(err);
1496
+ }
1443
1497
  try {
1444
- _$request_34({
1498
+ _$request_36({
1445
1499
  url: client._config.endpoints.sessions,
1446
1500
  headers: {
1447
1501
  "Content-Type": "application/json",
@@ -1449,10 +1503,10 @@ metadata was removed`
1449
1503
  "Bugsnag-Payload-Version": "1",
1450
1504
  "Bugsnag-Sent-At": (/* @__PURE__ */ new Date()).toISOString()
1451
1505
  },
1452
- body: _$jsonPayload_20.session(session, client._config.redactedKeys),
1506
+ body: _$jsonPayload_26.session(session, client._config.redactedKeys),
1453
1507
  agent: client._config.agent
1454
- }, function(err) {
1455
- return _cb(err);
1508
+ }, function(err2) {
1509
+ return _cb(err2);
1456
1510
  });
1457
1511
  } catch (e) {
1458
1512
  _cb(e);
@@ -1460,18 +1514,17 @@ metadata was removed`
1460
1514
  }
1461
1515
  };
1462
1516
  };
1463
- function ___extends_35() {
1464
- return ___extends_35 = Object.assign ? Object.assign.bind() : function(target) {
1465
- for (var i = 1; i < arguments.length; i++) {
1466
- var source = arguments[i];
1467
- for (var key in source)
1468
- Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
1517
+ function ___extends_37() {
1518
+ return ___extends_37 = Object.assign ? Object.assign.bind() : function(n) {
1519
+ for (var e = 1; e < arguments.length; e++) {
1520
+ var t = arguments[e];
1521
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
1469
1522
  }
1470
- return target;
1471
- }, ___extends_35.apply(this, arguments);
1523
+ return n;
1524
+ }, ___extends_37.apply(null, arguments);
1472
1525
  }
1473
- var schema = _$config_3.schema, __os_35 = __require("os"), _require2 = __require("util"), inspect = _require2.inspect, _$config_35 = {
1474
- appType: ___extends_35({}, schema.appType, {
1526
+ var schema = _$config_9.schema, __os_37 = __require("os"), _require2 = __require("util"), inspect = _require2.inspect, _$config_37 = {
1527
+ appType: ___extends_37({}, schema.appType, {
1475
1528
  defaultValue: function() {
1476
1529
  return "node";
1477
1530
  }
@@ -1481,25 +1534,25 @@ metadata was removed`
1481
1534
  return process.cwd();
1482
1535
  },
1483
1536
  validate: function(value) {
1484
- return value === null || _$stringWithLength_27(value);
1537
+ return value === null || _$stringWithLength_33(value);
1485
1538
  },
1486
1539
  message: "should be string"
1487
1540
  },
1488
1541
  hostname: {
1489
1542
  defaultValue: function() {
1490
- return __os_35.hostname();
1543
+ return __os_37.hostname();
1491
1544
  },
1492
1545
  message: "should be a string",
1493
1546
  validate: function(value) {
1494
- return value === null || _$stringWithLength_27(value);
1547
+ return value === null || _$stringWithLength_33(value);
1495
1548
  }
1496
1549
  },
1497
- logger: ___extends_35({}, schema.logger, {
1550
+ logger: ___extends_37({}, schema.logger, {
1498
1551
  defaultValue: function() {
1499
1552
  return getPrefixedConsole();
1500
1553
  }
1501
1554
  }),
1502
- releaseStage: ___extends_35({}, schema.releaseStage, {
1555
+ releaseStage: ___extends_37({}, schema.releaseStage, {
1503
1556
  defaultValue: function() {
1504
1557
  return process.env.NODE_ENV || "production";
1505
1558
  }
@@ -1549,7 +1602,7 @@ metadata was removed`
1549
1602
  return typeof value == "object" && value !== null || typeof value == "boolean";
1550
1603
  }, appStart = /* @__PURE__ */ new Date(), reset = function() {
1551
1604
  appStart = /* @__PURE__ */ new Date();
1552
- }, _$app_37 = {
1605
+ }, _$app_39 = {
1553
1606
  name: "appDuration",
1554
1607
  load: function(client) {
1555
1608
  return client.addOnError(function(event) {
@@ -1559,54 +1612,88 @@ metadata was removed`
1559
1612
  reset
1560
1613
  };
1561
1614
  }
1562
- }, _$nodeFallbackStack_22 = {};
1563
- _$nodeFallbackStack_22.getStack = function() {
1615
+ }, _$consoleBreadcrumbs_40 = {};
1616
+ _$consoleBreadcrumbs_40.load = function(client) {
1617
+ var isDev = /^(local-)?dev(elopment)?$/.test(client._config.releaseStage);
1618
+ isDev || !client._isBreadcrumbTypeEnabled("log") || _$map_21(CONSOLE_LOG_METHODS, function(method) {
1619
+ var original = console[method];
1620
+ console[method] = function() {
1621
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
1622
+ args[_key] = arguments[_key];
1623
+ client.leaveBreadcrumb("Console output", _$reduce_22(args, function(accum, arg, i) {
1624
+ var stringified = "[Unknown value]";
1625
+ try {
1626
+ stringified = String(arg);
1627
+ } catch {
1628
+ }
1629
+ if (stringified === "[object Object]")
1630
+ try {
1631
+ stringified = JSON.stringify(arg);
1632
+ } catch {
1633
+ }
1634
+ return accum["[" + i + "]"] = stringified, accum;
1635
+ }, {
1636
+ severity: method.indexOf("group") === 0 ? "log" : method
1637
+ }), "log"), original.apply(console, args);
1638
+ }, console[method]._restore = function() {
1639
+ console[method] = original;
1640
+ };
1641
+ });
1642
+ }, process.env.NODE_ENV !== "production" && (_$consoleBreadcrumbs_40.destroy = function() {
1643
+ return CONSOLE_LOG_METHODS.forEach(function(method) {
1644
+ typeof console[method]._restore == "function" && console[method]._restore();
1645
+ });
1646
+ });
1647
+ var CONSOLE_LOG_METHODS = _$filter_17(["log", "debug", "info", "warn", "error"], function(method) {
1648
+ return typeof console < "u" && typeof console[method] == "function";
1649
+ }), _$cloneClient_14 = {}, onCloneCallbacks = [];
1650
+ _$cloneClient_14 = function(client) {
1651
+ var clone = new client.Client({}, {}, [], client._notifier);
1652
+ return clone._config = client._config, clone._breadcrumbs = client._breadcrumbs.slice(), clone._metadata = _$assign_16({}, client._metadata), clone._features = [].concat(client._features), clone._featuresIndex = _$assign_16({}, client._featuresIndex), clone._user = _$assign_16({}, client._user), clone._context = client._context, clone._cbs = {
1653
+ e: client._cbs.e.slice(),
1654
+ s: client._cbs.s.slice(),
1655
+ sp: client._cbs.sp.slice(),
1656
+ b: client._cbs.b.slice()
1657
+ }, clone._logger = client._logger, clone._delivery = client._delivery, clone._sessionDelegate = client._sessionDelegate, onCloneCallbacks.forEach(function(callback) {
1658
+ callback(clone);
1659
+ }), clone;
1660
+ }, _$cloneClient_14.registerCallback = function(callback) {
1661
+ onCloneCallbacks.push(callback);
1662
+ };
1663
+ var _$nodeFallbackStack_28 = {};
1664
+ _$nodeFallbackStack_28.getStack = function() {
1564
1665
  return new Error().stack.split(`
1565
1666
  `).slice(3).join(`
1566
1667
  `);
1567
- }, _$nodeFallbackStack_22.maybeUseFallbackStack = function(err, fallbackStack) {
1668
+ }, _$nodeFallbackStack_28.maybeUseFallbackStack = function(err, fallbackStack) {
1568
1669
  var lines = err.stack.split(`
1569
1670
  `);
1570
1671
  return (lines.length === 1 || lines.length === 2 && /at Error \(native\)/.test(lines[1])) && (err.stack = lines[0] + `
1571
1672
  ` + fallbackStack), err;
1572
1673
  };
1573
- var _$contextualize_38 = {}, domain = __require("domain"), getStack = _$nodeFallbackStack_22.getStack, maybeUseFallbackStack = _$nodeFallbackStack_22.maybeUseFallbackStack;
1574
- _$contextualize_38 = {
1674
+ var _$contextualize_41 = {}, getStack = _$nodeFallbackStack_28.getStack;
1675
+ _$contextualize_41 = {
1575
1676
  name: "contextualize",
1576
1677
  load: function(client) {
1577
1678
  var contextualize = function(fn, onError) {
1578
- var fallbackStack = getStack(), dom = domain.create();
1579
- dom.on("error", function(err) {
1580
- err.stack && maybeUseFallbackStack(err, fallbackStack);
1581
- var event = client.Event.create(err, !0, {
1582
- severity: "error",
1583
- unhandled: !0,
1584
- severityReason: {
1585
- type: "unhandledException"
1586
- }
1587
- }, "contextualize()", 1);
1588
- client._notify(event, onError, function(e, event2) {
1589
- e && client._logger.error("Failed to send event to Bugsnag"), client._config.onUncaughtException(err, event2, client._logger);
1590
- });
1591
- }), process.nextTick(function() {
1592
- return dom.run(fn);
1593
- });
1679
+ var fallbackStack = getStack(), clonedClient = _$cloneClient_14(client);
1680
+ clonedClient.fallbackStack = fallbackStack, clonedClient.addOnError(onError), client._clientContext.run(clonedClient, fn);
1594
1681
  };
1595
1682
  return contextualize;
1596
1683
  }
1597
- }, _$contextualize_38.default = _$contextualize_38;
1598
- var _$intercept_39 = {}, __getStack_39 = _$nodeFallbackStack_22.getStack, __maybeUseFallbackStack_39 = _$nodeFallbackStack_22.maybeUseFallbackStack;
1599
- _$intercept_39 = {
1684
+ }, _$contextualize_41.default = _$contextualize_41;
1685
+ var _$intercept_42 = {}, __getStack_42 = _$nodeFallbackStack_28.getStack, maybeUseFallbackStack = _$nodeFallbackStack_28.maybeUseFallbackStack;
1686
+ _$intercept_42 = {
1600
1687
  name: "intercept",
1601
1688
  load: function(client) {
1602
1689
  var intercept = function(onError, cb) {
1603
1690
  onError === void 0 && (onError = function() {
1604
1691
  }), typeof cb != "function" && (cb = onError, onError = function() {
1605
1692
  });
1606
- var fallbackStack = __getStack_39();
1693
+ var fallbackStack = __getStack_42();
1607
1694
  return function(err) {
1608
1695
  if (err) {
1609
- err.stack && __maybeUseFallbackStack_39(err, fallbackStack);
1696
+ err.stack && maybeUseFallbackStack(err, fallbackStack);
1610
1697
  var event = client.Event.create(err, !0, {
1611
1698
  severity: "warning",
1612
1699
  unhandled: !1,
@@ -1624,44 +1711,43 @@ metadata was removed`
1624
1711
  };
1625
1712
  return intercept;
1626
1713
  }
1627
- }, _$intercept_39.default = _$intercept_39;
1628
- function ___extends_40() {
1629
- return ___extends_40 = Object.assign ? Object.assign.bind() : function(target) {
1630
- for (var i = 1; i < arguments.length; i++) {
1631
- var source = arguments[i];
1632
- for (var key in source)
1633
- Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
1714
+ }, _$intercept_42.default = _$intercept_42;
1715
+ function ___extends_43() {
1716
+ return ___extends_43 = Object.assign ? Object.assign.bind() : function(n) {
1717
+ for (var e = 1; e < arguments.length; e++) {
1718
+ var t = arguments[e];
1719
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
1634
1720
  }
1635
- return target;
1636
- }, ___extends_40.apply(this, arguments);
1721
+ return n;
1722
+ }, ___extends_43.apply(null, arguments);
1637
1723
  }
1638
- var __os_40 = __require("os"), _$device_40 = {
1724
+ var __os_43 = __require("os"), _$device_43 = {
1639
1725
  load: function(client) {
1640
1726
  var device = {
1641
- osName: __os_40.platform() + " (" + __os_40.arch() + ")",
1642
- osVersion: __os_40.release(),
1643
- totalMemory: __os_40.totalmem(),
1727
+ osName: __os_43.platform() + " (" + __os_43.arch() + ")",
1728
+ osVersion: __os_43.release(),
1729
+ totalMemory: __os_43.totalmem(),
1644
1730
  hostname: client._config.hostname,
1645
1731
  runtimeVersions: {
1646
1732
  node: process.versions.node
1647
1733
  }
1648
1734
  };
1649
1735
  client._addOnSessionPayload(function(sp) {
1650
- sp.device = ___extends_40({}, sp.device, device);
1736
+ sp.device = ___extends_43({}, sp.device, device);
1651
1737
  }), client.addOnError(function(event) {
1652
- event.device = ___extends_40({}, event.device, device, {
1653
- freeMemory: __os_40.freemem(),
1738
+ event.device = ___extends_43({}, event.device, device, {
1739
+ freeMemory: __os_43.freemem(),
1654
1740
  time: /* @__PURE__ */ new Date()
1655
1741
  });
1656
1742
  }, !0);
1657
1743
  }
1658
- }, ___require_23 = __require("path"), join = ___require_23.join, resolve = ___require_23.resolve, _$pathNormalizer_23 = function(p) {
1744
+ }, ___require_29 = __require("path"), join = ___require_29.join, resolve = ___require_29.resolve, _$pathNormalizer_29 = function(p) {
1659
1745
  return join(resolve(p), "/");
1660
- }, _$inProject_41 = {
1746
+ }, _$inProject_44 = {
1661
1747
  load: function(client) {
1662
1748
  return client.addOnError(function(event) {
1663
1749
  if (client._config.projectRoot) {
1664
- var projectRoot = _$pathNormalizer_23(client._config.projectRoot), allFrames = event.errors.reduce(function(accum, er) {
1750
+ var projectRoot = _$pathNormalizer_29(client._config.projectRoot), allFrames = event.errors.reduce(function(accum, er) {
1665
1751
  return accum.concat(er.stacktrace);
1666
1752
  }, []);
1667
1753
  allFrames.map(function(stackframe) {
@@ -1671,25 +1757,24 @@ metadata was removed`
1671
1757
  });
1672
1758
  }
1673
1759
  };
1674
- function ___extends_42() {
1675
- return ___extends_42 = Object.assign ? Object.assign.bind() : function(target) {
1676
- for (var i = 1; i < arguments.length; i++) {
1677
- var source = arguments[i];
1678
- for (var key in source)
1679
- Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
1760
+ function ___extends_45() {
1761
+ return ___extends_45 = Object.assign ? Object.assign.bind() : function(n) {
1762
+ for (var e = 1; e < arguments.length; e++) {
1763
+ var t = arguments[e];
1764
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
1680
1765
  }
1681
- return target;
1682
- }, ___extends_42.apply(this, arguments);
1766
+ return n;
1767
+ }, ___extends_45.apply(null, arguments);
1683
1768
  }
1684
- function _inheritsLoose(subClass, superClass) {
1685
- subClass.prototype = Object.create(superClass.prototype), subClass.prototype.constructor = subClass, _setPrototypeOf(subClass, superClass);
1769
+ function _inheritsLoose(t, o) {
1770
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
1686
1771
  }
1687
- function _setPrototypeOf(o, p) {
1688
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o2, p2) {
1689
- return o2.__proto__ = p2, o2;
1690
- }, _setPrototypeOf(o, p);
1772
+ function _setPrototypeOf(t, e) {
1773
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
1774
+ return t2.__proto__ = e2, t2;
1775
+ }, _setPrototypeOf(t, e);
1691
1776
  }
1692
- var SURROUNDING_LINES = 3, MAX_LINE_LENGTH = 200, ___require_42 = __require("fs"), createReadStream = ___require_42.createReadStream, ___require2_42 = __require("stream"), Writable = ___require2_42.Writable, pump = require_pump(), byline = require_byline(), path = __require("path"), _$surroundingCode_42 = {
1777
+ var SURROUNDING_LINES = 3, MAX_LINE_LENGTH = 200, ___require_45 = __require("fs"), createReadStream = ___require_45.createReadStream, ___require2_45 = __require("stream"), Writable = ___require2_45.Writable, pump = require_pump(), byline = require_byline(), path = __require("path"), _$surroundingCode_45 = {
1693
1778
  load: function(client) {
1694
1779
  if (client._config.sendCode) {
1695
1780
  var loadSurroundingCode = function(stackframe, cache) {
@@ -1748,13 +1833,13 @@ metadata was removed`
1748
1833
  cb(null, slicer.getCode());
1749
1834
  });
1750
1835
  }, CodeRange = /* @__PURE__ */ function(_Writable) {
1751
- _inheritsLoose(CodeRange2, _Writable);
1752
1836
  function CodeRange2(opts) {
1753
1837
  var _this;
1754
- return _this = _Writable.call(this, ___extends_42({}, opts, {
1838
+ return _this = _Writable.call(this, ___extends_45({}, opts, {
1755
1839
  decodeStrings: !1
1756
1840
  })) || this, _this._start = opts.start, _this._end = opts.end, _this._n = 0, _this._code = {}, _this;
1757
1841
  }
1842
+ _inheritsLoose(CodeRange2, _Writable);
1758
1843
  var _proto = CodeRange2.prototype;
1759
1844
  return _proto._write = function(chunk, enc, cb) {
1760
1845
  return this._n++, this._n < this._start ? cb(null) : this._n <= this._end ? (this._code[String(this._n)] = chunk.length <= MAX_LINE_LENGTH ? chunk : chunk.substr(0, MAX_LINE_LENGTH), cb(null)) : (this.emit("done"), cb(null));
@@ -1774,61 +1859,51 @@ metadata was removed`
1774
1859
  resolve2(res.slice(1));
1775
1860
  });
1776
1861
  });
1777
- }, _handler, _$uncaughtException_43 = {
1862
+ }, __maybeUseFallbackStack_46 = _$nodeFallbackStack_28.maybeUseFallbackStack, _handler, _$uncaughtException_46 = {
1778
1863
  load: function(client) {
1779
1864
  client._config.autoDetectErrors && client._config.enabledErrorTypes.unhandledExceptions && (_handler = function(err) {
1780
- var event = client.Event.create(err, !1, {
1865
+ var ctx = client._clientContext && client._clientContext.getStore(), c2 = ctx || client;
1866
+ err.stack && c2.fallbackStack && __maybeUseFallbackStack_46(err, c2.fallbackStack);
1867
+ var event = c2.Event.create(err, !1, {
1781
1868
  severity: "error",
1782
1869
  unhandled: !0,
1783
1870
  severityReason: {
1784
1871
  type: "unhandledException"
1785
1872
  }
1786
1873
  }, "uncaughtException handler", 1);
1787
- client._notify(event, function() {
1788
- }, function(e, event2) {
1789
- e && client._logger.error("Failed to send event to Bugsnag"), client._config.onUncaughtException(err, event2, client._logger);
1874
+ return new Promise(function(resolve2) {
1875
+ c2._notify(event, function() {
1876
+ }, function(e, event2) {
1877
+ e && c2._logger.error("Failed to send event to Bugsnag"), c2._config.onUncaughtException(err, event2, c2._logger), resolve2();
1878
+ });
1790
1879
  });
1791
- }, process.on("uncaughtException", _handler));
1880
+ }, process.prependListener("uncaughtException", _handler));
1792
1881
  },
1793
1882
  destroy: function() {
1794
1883
  process.removeListener("uncaughtException", _handler);
1795
1884
  }
1796
- }, ___handler_44, _$unhandledRejection_44 = {
1885
+ }, ___handler_47, _$unhandledRejection_47 = {
1797
1886
  load: function(client) {
1798
- !client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections || (___handler_44 = function(err) {
1799
- var event = client.Event.create(err, !1, {
1887
+ !client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections || (___handler_47 = function(err) {
1888
+ var ctx = client._clientContext && client._clientContext.getStore(), c2 = ctx || client, unhandled = !client._config.reportUnhandledPromiseRejectionsAsHandled, event = c2.Event.create(err, !1, {
1800
1889
  severity: "error",
1801
- unhandled: !0,
1890
+ unhandled,
1802
1891
  severityReason: {
1803
1892
  type: "unhandledPromiseRejection"
1804
1893
  }
1805
1894
  }, "unhandledRejection handler", 1);
1806
1895
  return new Promise(function(resolve2) {
1807
- client._notify(event, function() {
1896
+ c2._notify(event, function() {
1808
1897
  }, function(e, event2) {
1809
- e && client._logger.error("Failed to send event to Bugsnag"), client._config.onUnhandledRejection(err, event2, client._logger), resolve2();
1898
+ e && c2._logger.error("Failed to send event to Bugsnag"), c2._config.onUnhandledRejection(err, event2, c2._logger), resolve2();
1810
1899
  });
1811
1900
  });
1812
- }, process.prependListener ? process.prependListener("unhandledRejection", ___handler_44) : process.on("unhandledRejection", ___handler_44));
1901
+ }, process.prependListener ? process.prependListener("unhandledRejection", ___handler_47) : process.on("unhandledRejection", ___handler_47));
1813
1902
  },
1814
1903
  destroy: function() {
1815
- process.removeListener("unhandledRejection", ___handler_44);
1904
+ process.removeListener("unhandledRejection", ___handler_47);
1816
1905
  }
1817
- }, _$cloneClient_8 = {}, onCloneCallbacks = [];
1818
- _$cloneClient_8 = function(client) {
1819
- var clone = new client.Client({}, {}, [], client._notifier);
1820
- return clone._config = client._config, clone._breadcrumbs = client._breadcrumbs.slice(), clone._metadata = _$assign_10({}, client._metadata), clone._features = [].concat(client._features), clone._featuresIndex = _$assign_10({}, client._featuresIndex), clone._user = _$assign_10({}, client._user), clone._context = client._context, clone._cbs = {
1821
- e: client._cbs.e.slice(),
1822
- s: client._cbs.s.slice(),
1823
- sp: client._cbs.sp.slice(),
1824
- b: client._cbs.b.slice()
1825
- }, clone._logger = client._logger, clone._delivery = client._delivery, clone._sessionDelegate = client._sessionDelegate, onCloneCallbacks.forEach(function(callback) {
1826
- callback(clone);
1827
- }), clone;
1828
- }, _$cloneClient_8.registerCallback = function(callback) {
1829
- onCloneCallbacks.push(callback);
1830
- };
1831
- var _$Backoff_45 = Backoff;
1906
+ }, _$Backoff_6 = Backoff;
1832
1907
  function Backoff(opts) {
1833
1908
  opts = opts || {}, this.ms = opts.min || 100, this.max = opts.max || 1e4, this.factor = opts.factor || 2, this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0, this.attempts = 0;
1834
1909
  }
@@ -1842,25 +1917,20 @@ metadata was removed`
1842
1917
  }, Backoff.prototype.reset = function() {
1843
1918
  this.attempts = 0;
1844
1919
  };
1845
- function _assertThisInitialized(self2) {
1846
- if (self2 === void 0)
1847
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1848
- return self2;
1849
- }
1850
- function ___inheritsLoose_47(subClass, superClass) {
1851
- subClass.prototype = Object.create(superClass.prototype), subClass.prototype.constructor = subClass, ___setPrototypeOf_47(subClass, superClass);
1920
+ function ___inheritsLoose_49(t, o) {
1921
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, ___setPrototypeOf_49(t, o);
1852
1922
  }
1853
- function ___setPrototypeOf_47(o, p) {
1854
- return ___setPrototypeOf_47 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o2, p2) {
1855
- return o2.__proto__ = p2, o2;
1856
- }, ___setPrototypeOf_47(o, p);
1923
+ function ___setPrototypeOf_49(t, e) {
1924
+ return ___setPrototypeOf_49 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
1925
+ return t2.__proto__ = e2, t2;
1926
+ }, ___setPrototypeOf_49(t, e);
1857
1927
  }
1858
- var DEFAULT_SUMMARY_INTERVAL = 10 * 1e3, Emitter = __require("events").EventEmitter, _$tracker_47 = /* @__PURE__ */ function(_Emitter) {
1859
- ___inheritsLoose_47(SessionTracker, _Emitter);
1928
+ var DEFAULT_SUMMARY_INTERVAL = 10 * 1e3, Emitter = __require("events").EventEmitter, _$tracker_49 = /* @__PURE__ */ function(_Emitter) {
1860
1929
  function SessionTracker(intervalLength) {
1861
1930
  var _this;
1862
- return _this = _Emitter.call(this) || this, _this._sessions = /* @__PURE__ */ new Map(), _this._interval = null, _this._intervalLength = intervalLength || DEFAULT_SUMMARY_INTERVAL, _this._summarize = _this._summarize.bind(_assertThisInitialized(_this)), _this;
1931
+ return _this = _Emitter.call(this) || this, _this._sessions = /* @__PURE__ */ new Map(), _this._interval = null, _this._intervalLength = intervalLength || DEFAULT_SUMMARY_INTERVAL, _this._summarize = _this._summarize.bind(_this), _this;
1863
1932
  }
1933
+ ___inheritsLoose_49(SessionTracker, _Emitter);
1864
1934
  var _proto = SessionTracker.prototype;
1865
1935
  return _proto.start = function() {
1866
1936
  this._interval || (this._interval = setInterval(this._summarize, this._intervalLength).unref());
@@ -1881,13 +1951,12 @@ metadata was removed`
1881
1951
  }(Emitter), dateToMsKey = function(d) {
1882
1952
  var dk = new Date(d);
1883
1953
  return dk.setSeconds(0), dk.setMilliseconds(0), dk.toISOString();
1884
- }, _$session_46 = {
1954
+ }, _$session_48 = {
1885
1955
  load: function(client) {
1886
- var sessionTracker = new _$tracker_47(client._config.sessionSummaryInterval);
1956
+ var sessionTracker = new _$tracker_49(client._config.sessionSummaryInterval);
1887
1957
  sessionTracker.on("summary", sendSessionSummary(client)), sessionTracker.start(), client._sessionDelegate = {
1888
1958
  startSession: function(client2, session) {
1889
- var sessionClient = _$cloneClient_8(client2);
1890
- return sessionClient._session = session, sessionClient._pausedSession = null, sessionTracker.track(sessionClient._session), sessionClient;
1959
+ return client2._session = session, client2._pausedSession = null, sessionTracker.track(client2._session), client2;
1891
1960
  },
1892
1961
  pauseSession: function(client2) {
1893
1962
  client2._pausedSession = client2._session, client2._session = null;
@@ -1902,7 +1971,7 @@ metadata was removed`
1902
1971
  defaultValue: function() {
1903
1972
  },
1904
1973
  validate: function(value) {
1905
- return value === void 0 || _$intRange_25()(value);
1974
+ return value === void 0 || _$intRange_31()(value);
1906
1975
  },
1907
1976
  message: "should be a positive integer"
1908
1977
  }
@@ -1914,7 +1983,7 @@ metadata was removed`
1914
1983
  return;
1915
1984
  }
1916
1985
  if (!sessionCounts.length) return;
1917
- var backoff = new _$Backoff_45({
1986
+ var backoff = new _$Backoff_6({
1918
1987
  min: 1e3,
1919
1988
  max: 1e4
1920
1989
  }), maxAttempts = 10;
@@ -1944,13 +2013,13 @@ metadata was removed`
1944
2013
  type: client._config.appType
1945
2014
  },
1946
2015
  sessionCounts
1947
- }, ignore = _$syncCallbackRunner_24(client._cbs.sp, payload, "onSessionPayload", client._logger);
2016
+ }, ignore = _$syncCallbackRunner_30(client._cbs.sp, payload, "onSessionPayload", client._logger);
1948
2017
  if (ignore)
1949
2018
  return client._logger.debug("Session not sent due to onSessionPayload callback"), cb(null);
1950
2019
  client._delivery.sendSession(payload, cb);
1951
2020
  }
1952
2021
  };
1953
- }, _$pathNormaliser_48 = {
2022
+ }, _$pathNormaliser_50 = {
1954
2023
  load: function(client) {
1955
2024
  client.addOnError(function(event) {
1956
2025
  var allFrames = event.errors.reduce(function(accum, er) {
@@ -1961,11 +2030,11 @@ metadata was removed`
1961
2030
  });
1962
2031
  });
1963
2032
  }
1964
- }, _$stripProjectRoot_49 = {
2033
+ }, _$stripProjectRoot_51 = {
1965
2034
  load: function(client) {
1966
2035
  return client.addOnError(function(event) {
1967
2036
  if (client._config.projectRoot) {
1968
- var projectRoot = _$pathNormalizer_23(client._config.projectRoot), allFrames = event.errors.reduce(function(accum, er) {
2037
+ var projectRoot = _$pathNormalizer_29(client._config.projectRoot), allFrames = event.errors.reduce(function(accum, er) {
1969
2038
  return accum.concat(er.stacktrace);
1970
2039
  }, []);
1971
2040
  allFrames.map(function(stackframe) {
@@ -1974,35 +2043,38 @@ metadata was removed`
1974
2043
  }
1975
2044
  });
1976
2045
  }
1977
- }, _$notifier_36 = {};
1978
- function ___extends_36() {
1979
- return ___extends_36 = Object.assign ? Object.assign.bind() : function(target) {
1980
- for (var i = 1; i < arguments.length; i++) {
1981
- var source = arguments[i];
1982
- for (var key in source)
1983
- Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
2046
+ }, _$notifier_38 = {};
2047
+ function ___extends_38() {
2048
+ return ___extends_38 = Object.assign ? Object.assign.bind() : function(n) {
2049
+ for (var e = 1; e < arguments.length; e++) {
2050
+ var t = arguments[e];
2051
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
1984
2052
  }
1985
- return target;
1986
- }, ___extends_36.apply(this, arguments);
2053
+ return n;
2054
+ }, ___extends_38.apply(null, arguments);
1987
2055
  }
1988
- var name = "Bugsnag Node", version = "7.25.0", url = "https://github.com/bugsnag/bugsnag-js";
1989
- _$Event_4.__type = "nodejs";
1990
- var __schema_36 = ___extends_36({}, _$config_3.schema, _$config_35);
1991
- delete __schema_36.enabledBreadcrumbTypes;
1992
- var internalPlugins = [_$app_37, _$surroundingCode_42, _$inProject_41, _$stripProjectRoot_49, _$session_46, _$device_40, _$uncaughtException_43, _$unhandledRejection_44, _$intercept_39, _$contextualize_38, _$pathNormaliser_48], Bugsnag2 = {
2056
+ var name = "Bugsnag Node", version = "8.6.0", url = "https://github.com/bugsnag/bugsnag-js", ___require_38 = __require("async_hooks"), AsyncLocalStorage = ___require_38.AsyncLocalStorage;
2057
+ _$Event_10.__type = "nodejs";
2058
+ var __schema_38 = ___extends_38({}, _$config_9.schema, _$config_37), internalPlugins = [_$app_39, _$surroundingCode_45, _$inProject_44, _$stripProjectRoot_51, _$session_48, _$device_43, _$uncaughtException_46, _$unhandledRejection_47, _$intercept_42, _$contextualize_41, _$pathNormaliser_50, _$consoleBreadcrumbs_40], Bugsnag2 = {
1993
2059
  _client: null,
1994
2060
  createClient: function(opts) {
1995
2061
  typeof opts == "string" && (opts = {
1996
2062
  apiKey: opts
1997
2063
  }), opts || (opts = {});
1998
- var bugsnag = new _$Client_2(opts, __schema_36, internalPlugins, {
2064
+ var bugsnag = new _$Client_8(opts, __schema_38, internalPlugins, {
1999
2065
  name,
2000
2066
  version,
2001
2067
  url
2002
2068
  });
2003
- return bugsnag._setDelivery(_$delivery_33), bugsnag._logger.debug("Loaded!"), bugsnag.leaveBreadcrumb = function() {
2004
- bugsnag._logger.warn("Breadcrumbs are not supported in Node.js yet");
2005
- }, bugsnag._config.enabledBreadcrumbTypes = [], bugsnag;
2069
+ return Object.keys(_$Client_8.prototype).forEach(function(m) {
2070
+ var original = bugsnag[m];
2071
+ bugsnag[m] = function() {
2072
+ var contextClient = bugsnag._clientContext && typeof bugsnag._clientContext.getStore == "function" ? bugsnag._clientContext.getStore() : null, client = contextClient || bugsnag, originalMethod = contextClient ? contextClient[m] : original;
2073
+ client._depth += 1;
2074
+ var ret = originalMethod.apply(client, arguments);
2075
+ return client._depth -= 1, ret;
2076
+ };
2077
+ }), bugsnag._clientContext = new AsyncLocalStorage(), bugsnag._setDelivery(_$delivery_35), bugsnag._logger.debug("Loaded!"), bugsnag;
2006
2078
  },
2007
2079
  start: function(opts) {
2008
2080
  return Bugsnag2._client ? (Bugsnag2._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."), Bugsnag2._client) : (Bugsnag2._client = Bugsnag2.createClient(opts), Bugsnag2._client);
@@ -2011,21 +2083,22 @@ metadata was removed`
2011
2083
  return Bugsnag2._client != null;
2012
2084
  }
2013
2085
  };
2014
- return Object.keys(_$Client_2.prototype).forEach(function(m) {
2086
+ return Object.keys(_$Client_8.prototype).forEach(function(m) {
2015
2087
  /^_/.test(m) || (Bugsnag2[m] = function() {
2016
- if (!Bugsnag2._client) return console.error("Bugsnag." + m + "() was called before Bugsnag.start()");
2017
- Bugsnag2._client._depth += 1;
2018
- var ret = Bugsnag2._client[m].apply(Bugsnag2._client, arguments);
2019
- return Bugsnag2._client._depth -= 1, ret;
2088
+ var client = Bugsnag2._client, ctx = client && client._clientContext && client._clientContext.getStore();
2089
+ if (ctx && (client = ctx), !client) return console.error("Bugsnag." + m + "() was called before Bugsnag.start()");
2090
+ client._depth += 1;
2091
+ var ret = client[m].apply(client, arguments);
2092
+ return client._depth -= 1, ret;
2020
2093
  });
2021
- }), _$notifier_36 = Bugsnag2, _$notifier_36.Client = _$Client_2, _$notifier_36.Event = _$Event_4, _$notifier_36.Session = _$Session_32, _$notifier_36.Breadcrumb = _$Breadcrumb_1, _$notifier_36.default = Bugsnag2, _$notifier_36;
2094
+ }), _$notifier_38 = Bugsnag2, _$notifier_38.Client = _$Client_8, _$notifier_38.Event = _$Event_10, _$notifier_38.Session = _$Session_34, _$notifier_38.Breadcrumb = _$Breadcrumb_7, _$notifier_38.default = Bugsnag2, _$notifier_38;
2022
2095
  });
2023
2096
  }
2024
2097
  });
2025
2098
 
2026
- // ../../node_modules/.pnpm/@bugsnag+js@7.25.0/node_modules/@bugsnag/js/node/notifier.js
2099
+ // ../../node_modules/.pnpm/@bugsnag+js@8.6.0/node_modules/@bugsnag/js/node/notifier.js
2027
2100
  var require_notifier = __commonJS({
2028
- "../../node_modules/.pnpm/@bugsnag+js@7.25.0/node_modules/@bugsnag/js/node/notifier.js"(exports, module) {
2101
+ "../../node_modules/.pnpm/@bugsnag+js@8.6.0/node_modules/@bugsnag/js/node/notifier.js"(exports, module) {
2029
2102
  init_cjs_shims();
2030
2103
  module.exports = require_bugsnag();
2031
2104
  }
@@ -2035,6 +2108,7 @@ var require_notifier = __commonJS({
2035
2108
  init_cjs_shims();
2036
2109
  var import_core = __toESM(require_lib(), 1), import_stacktracey = __toESM(require_stacktracey(), 1), import_js = __toESM(require_notifier(), 1);
2037
2110
  import { realpath } from "fs/promises";
2111
+ var ALLOWED_SLICE_NAMES = /* @__PURE__ */ new Set(["app", "theme", "hydrogen", "store"]);
2038
2112
  async function errorHandler(error, config) {
2039
2113
  if (error instanceof CancelExecution)
2040
2114
  error.message && error.message !== "" && outputInfo(`\u2728 ${error.message}`);
@@ -2069,6 +2143,11 @@ ${formattedStacktrace}`;
2069
2143
  outputDebug(`Reporting ${unhandled ? "unhandled" : "handled"} error to Bugsnag: ${reportableError.message}`);
2070
2144
  let eventHandler = (event) => {
2071
2145
  event.severity = "error", event.unhandled = unhandled;
2146
+ let { commandStartOptions } = getAllSensitiveMetadata(), { startCommand } = commandStartOptions ?? {};
2147
+ if (startCommand) {
2148
+ let firstWord = startCommand.trim().split(/\s+/)[0] ?? "cli", sliceName = ALLOWED_SLICE_NAMES.has(firstWord) ? firstWord : "cli";
2149
+ event.addMetadata("custom", { slice_name: sliceName });
2150
+ }
2072
2151
  }, errorHandler2 = (error2) => {
2073
2152
  error2 ? reject(error2) : resolve(reportableError);
2074
2153
  };
@@ -2131,7 +2210,12 @@ function initializeBugsnag() {
2131
2210
  endpoints: {
2132
2211
  notify: "https://error-analytics-production.shopifysvc.com",
2133
2212
  sessions: "https://error-analytics-sessions-production.shopifysvc.com"
2134
- }
2213
+ },
2214
+ // Set the project root to `null` to prevent the default behavior of
2215
+ // Bugsnag which is to set it to the cwd. That is unhelpful for us because
2216
+ // the cwd can be anywhere in the user's filesystem, not necessarily
2217
+ // related to the CLI codebase.
2218
+ projectRoot: null
2135
2219
  });
2136
2220
  }
2137
2221
 
@@ -2143,4 +2227,4 @@ export {
2143
2227
  registerCleanBugsnagErrorsFromWithinPlugins,
2144
2228
  addBugsnagMetadata
2145
2229
  };
2146
- //# sourceMappingURL=chunk-345OYFTI.js.map
2230
+ //# sourceMappingURL=chunk-K2VIRVTL.js.map