@copart/ops-tool-kit 1.13.0-beta.27 → 1.13.0-beta.29

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.
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
47
47
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
48
48
 
49
49
  const name$1 = "@copart/ops-tool-kit";
50
- const version$3 = "1.13.0-beta.27";
50
+ const version$3 = "1.13.0-beta.29";
51
51
  const main$1 = "dist/ops-tool-kit.js";
52
52
  const style = "dist/ops-tool-kit.css";
53
53
  const files = [
@@ -290,6 +290,54 @@ function _createClass$2(e, r, t) {
290
290
  writable: !1
291
291
  }), e;
292
292
  }
293
+ function _createForOfIteratorHelper(r, e) {
294
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
295
+ if (!t) {
296
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
297
+ t && (r = t);
298
+ var n = 0,
299
+ F = function () {};
300
+ return {
301
+ s: F,
302
+ n: function () {
303
+ return n >= r.length ? {
304
+ done: !0
305
+ } : {
306
+ done: !1,
307
+ value: r[n++]
308
+ };
309
+ },
310
+ e: function (r) {
311
+ throw r;
312
+ },
313
+ f: F
314
+ };
315
+ }
316
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
317
+ }
318
+ var o,
319
+ a = !0,
320
+ u = !1;
321
+ return {
322
+ s: function () {
323
+ t = t.call(r);
324
+ },
325
+ n: function () {
326
+ var r = t.next();
327
+ return a = r.done, r;
328
+ },
329
+ e: function (r) {
330
+ u = !0, o = r;
331
+ },
332
+ f: function () {
333
+ try {
334
+ a || null == t.return || t.return();
335
+ } finally {
336
+ if (u) throw o;
337
+ }
338
+ }
339
+ };
340
+ }
293
341
  function _defineProperty$2(e, r, t) {
294
342
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
295
343
  value: t,
@@ -2927,6 +2975,42 @@ var getCrumbProps = function getCrumbProps(props) {
2927
2975
  var crumbProps = _objectWithoutProperties(props, _excluded$6);
2928
2976
  return crumbProps;
2929
2977
  };
2978
+
2979
+ // Flatten children to a comparable text label. Children may be a React element
2980
+ // (e.g. <span onClick>Label</span>) whose internal fiber refs (`_owner`) are
2981
+ // circular, so it must never be passed to JSON.stringify.
2982
+ var _crumbLabel = function crumbLabel(children) {
2983
+ if (children == null) return '';
2984
+ if (typeof children === 'string' || typeof children === 'number') return String(children);
2985
+ if (Array.isArray(children)) return children.map(_crumbLabel).join('');
2986
+ if (React__namespace.isValidElement(children) && children.props && children.props.children != null) {
2987
+ return _crumbLabel(children.props.children);
2988
+ }
2989
+ return '';
2990
+ };
2991
+
2992
+ // Safe replacement for the old JSON.stringify diff, which threw
2993
+ // "Converting circular structure to JSON" whenever children was a React element.
2994
+ var crumbPropsChanged = function crumbPropsChanged(oldProps, newProps) {
2995
+ var keys = new Set([].concat(_toConsumableArray(Object.keys(oldProps)), _toConsumableArray(Object.keys(newProps))));
2996
+ var _iterator = _createForOfIteratorHelper(keys),
2997
+ _step;
2998
+ try {
2999
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
3000
+ var key = _step.value;
3001
+ if (key === 'children') {
3002
+ if (_crumbLabel(oldProps.children) !== _crumbLabel(newProps.children)) return true;
3003
+ } else if (oldProps[key] !== newProps[key]) {
3004
+ return true;
3005
+ }
3006
+ }
3007
+ } catch (err) {
3008
+ _iterator.e(err);
3009
+ } finally {
3010
+ _iterator.f();
3011
+ }
3012
+ return false;
3013
+ };
2930
3014
  var Crumb$1 = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
2931
3015
  function Crumb() {
2932
3016
  var _this;
@@ -2950,9 +3034,7 @@ var Crumb$1 = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component)
2950
3034
  value: function shouldComponentUpdate(nextProps) {
2951
3035
  var oldProps = getCrumbProps(this.props);
2952
3036
  var newProps = getCrumbProps(nextProps);
2953
-
2954
- // TODO: Fix this hack, it is so hacky that the hackers cry themselves to sleep.
2955
- return JSON.stringify(newProps) !== JSON.stringify(oldProps);
3037
+ return crumbPropsChanged(oldProps, newProps);
2956
3038
  }
2957
3039
  }, {
2958
3040
  key: "componentDidUpdate",
@@ -68952,7 +69034,27 @@ var _excluded$1 = ["signal"];
68952
69034
  var pending = new Map();
68953
69035
  var STORAGE_REQUEST_TIMEOUT_MS = 5000;
68954
69036
  function requestId() {
68955
- return crypto.randomUUID();
69037
+ // crypto.randomUUID exists only in a secure context (HTTPS / localhost).
69038
+ // QA/other envs served over plain HTTP would throw "crypto.randomUUID is not
69039
+ // a function" and crash bootstrap, so fall back to getRandomValues, then Math.random.
69040
+ // These ids are only used to correlate postMessage RPCs — not for security.
69041
+ if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {
69042
+ return crypto.randomUUID();
69043
+ }
69044
+ if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {
69045
+ var bytes = crypto.getRandomValues(new Uint8Array(16));
69046
+ bytes[6] = bytes[6] & 0x0f | 0x40;
69047
+ bytes[8] = bytes[8] & 0x3f | 0x80;
69048
+ var hex = Array.from(bytes, function (b) {
69049
+ return b.toString(16).padStart(2, '0');
69050
+ });
69051
+ return "".concat(hex.slice(0, 4).join(''), "-").concat(hex.slice(4, 6).join(''), "-").concat(hex.slice(6, 8).join(''), "-").concat(hex.slice(8, 10).join(''), "-").concat(hex.slice(10, 16).join(''));
69052
+ }
69053
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
69054
+ var r = Math.random() * 16 | 0;
69055
+ var v = c === 'x' ? r : r & 0x3 | 0x8;
69056
+ return v.toString(16);
69057
+ });
68956
69058
  }
68957
69059
 
68958
69060
  // The exact origin of the shell that framed us. Learned from the first inbound