lwc 2.35.0 → 2.35.2

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.
Files changed (39) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +61 -134
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +61 -134
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +100 -74
  5. package/dist/engine-dom/iife/es5/engine-dom.js +249 -327
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +266 -244
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +61 -134
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +100 -74
  11. package/dist/engine-dom/umd/es5/engine-dom.js +249 -327
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +266 -244
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +47 -136
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +47 -136
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +11 -42
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +11 -42
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +8 -38
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +15 -44
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +12 -40
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +11 -42
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +8 -38
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +15 -44
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +12 -40
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  35. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  36. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  37. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  39. package/package.json +7 -7
@@ -21,16 +21,16 @@
21
21
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
22
22
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
23
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
24
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
25
25
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
27
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
28
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
26
29
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
30
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
28
31
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
32
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
30
33
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
31
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
32
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
33
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
34
34
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
35
35
  /* proxy-compat-disable */
36
36
  /**
@@ -62,10 +62,10 @@
62
62
  }
63
63
  var assert = /*#__PURE__*/Object.freeze({
64
64
  __proto__: null,
65
+ fail: fail,
65
66
  invariant: invariant,
66
- isTrue: isTrue$1,
67
67
  isFalse: isFalse$1,
68
- fail: fail
68
+ isTrue: isTrue$1
69
69
  });
70
70
 
71
71
  /*
@@ -215,39 +215,11 @@
215
215
  * SPDX-License-Identifier: MIT
216
216
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
217
217
  */
218
- // Inspired from: https://mathiasbynens.be/notes/globalthis
219
- var _globalThis = /*@__PURE__*/function () {
220
- // On recent browsers, `globalThis` is already defined. In this case return it directly.
221
- if ((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === 'object') {
222
- return globalThis;
223
- }
224
- var _globalThis;
225
- try {
226
- // eslint-disable-next-line no-extend-native
227
- Object.defineProperty(Object.prototype, '__magic__', {
228
- get: function get() {
229
- return this;
230
- },
231
- configurable: true
232
- });
233
- // __magic__ is undefined in Safari 10 and IE10 and older.
234
- // @ts-ignore
235
- // eslint-disable-next-line no-undef
236
- _globalThis = __magic__;
237
- // @ts-ignore
238
- delete Object.prototype.__magic__;
239
- } catch (ex) {
240
- // In IE8, Object.defineProperty only works on DOM objects.
241
- } finally {
242
- // If the magic above fails for some reason we assume that we are in a legacy browser.
243
- // Assume `window` exists in this case.
244
- if (typeof _globalThis === 'undefined') {
245
- // @ts-ignore
246
- _globalThis = window;
247
- }
248
- }
249
- return _globalThis;
250
- }();
218
+ // See browser support for globalThis:
219
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility
220
+ /* istanbul ignore next */
221
+ // @ts-ignore
222
+ var _globalThis = (typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === 'object' ? globalThis : window;
251
223
 
252
224
  /*
253
225
  * Copyright (c) 2018, salesforce.com, inc.
@@ -358,9 +330,9 @@
358
330
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
359
331
  */
360
332
  // Increment whenever the LWC template compiler changes
361
- var LWC_VERSION = "2.35.0";
333
+ var LWC_VERSION = "2.35.2";
362
334
  var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
363
- /** version: 2.35.0 */
335
+ /** version: 2.35.2 */
364
336
 
365
337
  /**
366
338
  * Copyright (C) 2018 salesforce.com, inc.
@@ -414,7 +386,8 @@
414
386
  console.warn("Failed to set the value \"".concat(value, "\" for the runtime feature flag \"").concat(name, "\" because it is undefined. Available flags: ").concat(availableFlags, "."));
415
387
  return;
416
388
  }
417
- if (process.env.NODE_ENV !== 'production') {
389
+ // This may seem redundant, but `process.env.NODE_ENV === 'test-karma-lwc'` is replaced by Karma tests
390
+ if (process.env.NODE_ENV === 'test-karma-lwc' || process.env.NODE_ENV !== 'production') {
418
391
  // Allow the same flag to be set more than once outside of production to enable testing
419
392
  lwcRuntimeFlags[name] = value;
420
393
  } else {
@@ -435,11 +408,12 @@
435
408
  * purposes. It is a no-op when invoked in production mode.
436
409
  */
437
410
  function setFeatureFlagForTest(name, value) {
438
- if (process.env.NODE_ENV !== 'production') {
411
+ // This may seem redundant, but `process.env.NODE_ENV === 'test-karma-lwc'` is replaced by Karma tests
412
+ if (process.env.NODE_ENV === 'test-karma-lwc' || process.env.NODE_ENV !== 'production') {
439
413
  setFeatureFlag(name, value);
440
414
  }
441
415
  }
442
- /** version: 2.35.0 */
416
+ /** version: 2.35.2 */
443
417
 
444
418
  /**
445
419
  * Copyright (C) 2018 salesforce.com, inc.
@@ -503,7 +477,7 @@
503
477
  }
504
478
  }
505
479
  }
506
- /** version: 2.35.0 */
480
+ /** version: 2.35.2 */
507
481
 
508
482
  /*
509
483
  * Copyright (c) 2018, salesforce.com, inc.
@@ -524,8 +498,7 @@
524
498
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
525
499
  */
526
500
  // Only used in LWC's Karma tests
527
- // @ts-ignore
528
- if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
501
+ if (process.env.NODE_ENV === 'test-karma-lwc') {
529
502
  window.addEventListener('test-dummy-flag', function () {
530
503
  var hasFlag = false;
531
504
  if (lwcRuntimeFlags.DUMMY_TEST_FLAG) {
@@ -549,8 +522,7 @@
549
522
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
550
523
  */
551
524
  // Only used in LWC's Karma tests
552
- // @ts-ignore
553
- if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
525
+ if (process.env.NODE_ENV === 'test-karma-lwc') {
554
526
  window.addEventListener('test-dummy-flag', function () {
555
527
  var hasFlag = false;
556
528
  if (lwcRuntimeFlags.DUMMY_TEST_FLAG) {
@@ -591,23 +563,15 @@
591
563
  attachDispatcher: function attachDispatcher(dispatcher) {
592
564
  enabled$1 = true;
593
565
  currentDispatcher$1 = dispatcher;
594
- var _iterator = _createForOfIteratorHelper(onReportingEnabledCallbacks),
595
- _step;
596
- try {
597
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
598
- var callback = _step.value;
599
- try {
600
- callback();
601
- } catch (err) {
602
- // This should never happen. But if it does, we don't want one callback to cause another to fail
603
- // eslint-disable-next-line no-console
604
- console.error('Could not invoke callback', err);
605
- }
566
+ for (var _i3 = 0, _onReportingEnabledCa = onReportingEnabledCallbacks; _i3 < _onReportingEnabledCa.length; _i3++) {
567
+ var callback = _onReportingEnabledCa[_i3];
568
+ try {
569
+ callback();
570
+ } catch (err) {
571
+ // This should never happen. But if it does, we don't want one callback to cause another to fail
572
+ // eslint-disable-next-line no-console
573
+ console.error('Could not invoke callback', err);
606
574
  }
607
- } catch (err) {
608
- _iterator.e(err);
609
- } finally {
610
- _iterator.f();
611
575
  }
612
576
  onReportingEnabledCallbacks.length = 0; // clear the array
613
577
  },
@@ -698,8 +662,8 @@
698
662
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
699
663
  */
700
664
  var alreadyLoggedMessages = new Set();
701
- // @ts-ignore
702
- if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
665
+ // Only used in LWC's Karma tests
666
+ if (process.env.NODE_ENV === 'test-karma-lwc') {
703
667
  // @ts-ignore
704
668
  window.__lwcResetAlreadyLoggedMessages = function () {
705
669
  alreadyLoggedMessages.clear();
@@ -761,8 +725,8 @@
761
725
  if (!isUndefined$1(reactiveRecord)) {
762
726
  var reactiveObservers = reactiveRecord[key];
763
727
  if (!isUndefined$1(reactiveObservers)) {
764
- for (var _i3 = 0, len = reactiveObservers.length; _i3 < len; _i3 += 1) {
765
- var ro = reactiveObservers[_i3];
728
+ for (var _i4 = 0, len = reactiveObservers.length; _i4 < len; _i4 += 1) {
729
+ var ro = reactiveObservers[_i4];
766
730
  ro.notify();
767
731
  }
768
732
  }
@@ -821,9 +785,9 @@
821
785
  var listeners = this.listeners;
822
786
  var len = listeners.length;
823
787
  if (len > 0) {
824
- for (var _i4 = 0; _i4 < len; _i4 += 1) {
825
- var set = listeners[_i4];
826
- var pos = ArrayIndexOf.call(listeners[_i4], this);
788
+ for (var _i5 = 0; _i5 < len; _i5 += 1) {
789
+ var set = listeners[_i5];
790
+ var pos = ArrayIndexOf.call(listeners[_i5], this);
827
791
  ArraySplice.call(set, pos, 1);
828
792
  }
829
793
  listeners.length = 0;
@@ -880,8 +844,8 @@
880
844
  }
881
845
  var callbacks = nextTickCallbackQueue;
882
846
  nextTickCallbackQueue = []; // reset to a new queue
883
- for (var _i5 = 0, len = callbacks.length; _i5 < len; _i5 += 1) {
884
- callbacks[_i5]();
847
+ for (var _i6 = 0, len = callbacks.length; _i6 < len; _i6 += 1) {
848
+ callbacks[_i6]();
885
849
  }
886
850
  }
887
851
  function addCallbackToNextTick(callback) {
@@ -908,11 +872,11 @@
908
872
  function parseStyleText(cssText) {
909
873
  var styleMap = {};
910
874
  var declarations = cssText.split(DECLARATION_DELIMITER);
911
- var _iterator2 = _createForOfIteratorHelper(declarations),
912
- _step2;
875
+ var _iterator = _createForOfIteratorHelper(declarations),
876
+ _step;
913
877
  try {
914
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
915
- var declaration = _step2.value;
878
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
879
+ var declaration = _step.value;
916
880
  if (declaration) {
917
881
  var _declaration$split = declaration.split(PROPERTY_DELIMITER),
918
882
  _declaration$split2 = _slicedToArray(_declaration$split, 2),
@@ -924,17 +888,17 @@
924
888
  }
925
889
  }
926
890
  } catch (err) {
927
- _iterator2.e(err);
891
+ _iterator.e(err);
928
892
  } finally {
929
- _iterator2.f();
893
+ _iterator.f();
930
894
  }
931
895
  return styleMap;
932
896
  }
933
897
  // Make a shallow copy of an object but omit the given key
934
898
  function cloneAndOmitKey(object, keyToOmit) {
935
899
  var result = {};
936
- for (var _i6 = 0, _Object$keys = Object.keys(object); _i6 < _Object$keys.length; _i6++) {
937
- var key = _Object$keys[_i6];
900
+ for (var _i7 = 0, _Object$keys = Object.keys(object); _i7 < _Object$keys.length; _i7++) {
901
+ var key = _Object$keys[_i7];
938
902
  if (key !== keyToOmit) {
939
903
  result[key] = object[key];
940
904
  }
@@ -943,11 +907,11 @@
943
907
  }
944
908
  function flattenStylesheets(stylesheets) {
945
909
  var list = [];
946
- var _iterator3 = _createForOfIteratorHelper(stylesheets),
947
- _step3;
910
+ var _iterator2 = _createForOfIteratorHelper(stylesheets),
911
+ _step2;
948
912
  try {
949
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
950
- var stylesheet = _step3.value;
913
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
914
+ var stylesheet = _step2.value;
951
915
  if (!Array.isArray(stylesheet)) {
952
916
  list.push(stylesheet);
953
917
  } else {
@@ -955,9 +919,9 @@
955
919
  }
956
920
  }
957
921
  } catch (err) {
958
- _iterator3.e(err);
922
+ _iterator2.e(err);
959
923
  } finally {
960
- _iterator3.f();
924
+ _iterator2.f();
961
925
  }
962
926
  return list;
963
927
  }
@@ -975,6 +939,14 @@
975
939
  refVNodes[ref] = vnode;
976
940
  }
977
941
  }
942
+ // Throw an error if we're running in prod mode. Ensures code is truly removed from prod mode.
943
+ function assertNotProd() {
944
+ /* istanbul ignore if */
945
+ if (process.env.NODE_ENV === 'production') {
946
+ // this method should never leak to prod
947
+ throw new ReferenceError();
948
+ }
949
+ }
978
950
 
979
951
  /*
980
952
  * Copyright (c) 2020, salesforce.com, inc.
@@ -1170,27 +1142,18 @@
1170
1142
  }
1171
1143
  var isDomMutationAllowed = false;
1172
1144
  function unlockDomMutation() {
1173
- if (process.env.NODE_ENV === 'production') {
1174
- // this method should never leak to prod
1175
- throw new ReferenceError();
1176
- }
1145
+ assertNotProd(); // this method should never leak to prod
1177
1146
  isDomMutationAllowed = true;
1178
1147
  }
1179
1148
  function lockDomMutation() {
1180
- if (process.env.NODE_ENV === 'production') {
1181
- // this method should never leak to prod
1182
- throw new ReferenceError();
1183
- }
1149
+ assertNotProd(); // this method should never leak to prod
1184
1150
  isDomMutationAllowed = false;
1185
1151
  }
1186
1152
  function logMissingPortalError(name, type) {
1187
1153
  return logError("The `".concat(name, "` ").concat(type, " is available only on elements that use the `lwc:dom=\"manual\"` directive."));
1188
1154
  }
1189
1155
  function patchElementWithRestrictions(elm, options) {
1190
- if (process.env.NODE_ENV === 'production') {
1191
- // this method should never leak to prod
1192
- throw new ReferenceError();
1193
- }
1156
+ assertNotProd(); // this method should never leak to prod
1194
1157
  var originalOuterHTMLDescriptor = getPropertyDescriptor(elm, 'outerHTML');
1195
1158
  var descriptors = {
1196
1159
  outerHTML: generateAccessorDescriptor({
@@ -1274,10 +1237,7 @@
1274
1237
  defineProperties(elm, descriptors);
1275
1238
  }
1276
1239
  function getShadowRootRestrictionsDescriptors(sr) {
1277
- if (process.env.NODE_ENV === 'production') {
1278
- // this method should never leak to prod
1279
- throw new ReferenceError();
1280
- }
1240
+ assertNotProd(); // this method should never leak to prod
1281
1241
  // Disallowing properties in dev mode only to avoid people doing the wrong
1282
1242
  // thing when using the real shadow root, because if that's the case,
1283
1243
  // the component will not work when running with synthetic shadow.
@@ -1318,10 +1278,7 @@
1318
1278
  // Custom Elements Restrictions:
1319
1279
  // -----------------------------
1320
1280
  function getCustomElementRestrictionsDescriptors(elm) {
1321
- if (process.env.NODE_ENV === 'production') {
1322
- // this method should never leak to prod
1323
- throw new ReferenceError();
1324
- }
1281
+ assertNotProd(); // this method should never leak to prod
1325
1282
  var originalAddEventListener = elm.addEventListener;
1326
1283
  var originalInnerHTMLDescriptor = getPropertyDescriptor(elm, 'innerHTML');
1327
1284
  var originalOuterHTMLDescriptor = getPropertyDescriptor(elm, 'outerHTML');
@@ -1366,10 +1323,7 @@
1366
1323
  };
1367
1324
  }
1368
1325
  function getComponentRestrictionsDescriptors() {
1369
- if (process.env.NODE_ENV === 'production') {
1370
- // this method should never leak to prod
1371
- throw new ReferenceError();
1372
- }
1326
+ assertNotProd(); // this method should never leak to prod
1373
1327
  return {
1374
1328
  tagName: generateAccessorDescriptor({
1375
1329
  get: function get() {
@@ -1382,10 +1336,7 @@
1382
1336
  }
1383
1337
 
1384
1338
  function getLightningElementPrototypeRestrictionsDescriptors(proto) {
1385
- if (process.env.NODE_ENV === 'production') {
1386
- // this method should never leak to prod
1387
- throw new ReferenceError();
1388
- }
1339
+ assertNotProd(); // this method should never leak to prod
1389
1340
  var originalDispatchEvent = proto.dispatchEvent;
1390
1341
  var descriptors = {
1391
1342
  dispatchEvent: generateDataDescriptor({
@@ -2212,7 +2163,6 @@
2212
2163
  }
2213
2164
  };
2214
2165
  }
2215
- var EMPTY_REFS = freeze(create(null));
2216
2166
  var refsCache = new WeakMap();
2217
2167
  /**
2218
2168
  * This class is the base class for any LWC element.
@@ -2428,7 +2378,6 @@
2428
2378
  warnIfInvokedDuringConstruction(vm, 'refs');
2429
2379
  }
2430
2380
  var refVNodes = vm.refVNodes,
2431
- hasRefVNodes = vm.hasRefVNodes,
2432
2381
  cmpTemplate = vm.cmpTemplate;
2433
2382
  // If the `cmpTemplate` is null, that means that the template has not been rendered yet. Most likely this occurs
2434
2383
  // if `this.refs` is called during the `connectedCallback` phase. The DOM elements have not been rendered yet,
@@ -2441,15 +2390,9 @@
2441
2390
  // were introduced, we return undefined if the template has no refs defined
2442
2391
  // anywhere. This fixes components that may want to add an expando called `refs`
2443
2392
  // and are checking if it exists with `if (this.refs)` before adding it.
2444
- // Note it is not sufficient to just check if `refVNodes` is null or empty,
2445
- // because a template may have `lwc:ref` defined within a falsy `if:true` block.
2446
- if (!hasRefVNodes) {
2447
- return;
2448
- }
2449
- // For templates that are using `lwc:ref`, if there are no refs currently available
2450
- // (e.g. refs inside of a falsy `if:true` block), we return an empty object.
2393
+ // Note we use a null refVNodes to indicate that the template has no refs defined.
2451
2394
  if (isNull(refVNodes)) {
2452
- return EMPTY_REFS;
2395
+ return;
2453
2396
  }
2454
2397
  // The refNodes can be cached based on the refVNodes, since the refVNodes
2455
2398
  // are recreated from scratch every time the template is rendered.
@@ -2457,17 +2400,17 @@
2457
2400
  var refs = refsCache.get(refVNodes);
2458
2401
  if (isUndefined$1(refs)) {
2459
2402
  refs = create(null);
2460
- var _iterator4 = _createForOfIteratorHelper(keys(refVNodes)),
2461
- _step4;
2403
+ var _iterator3 = _createForOfIteratorHelper(keys(refVNodes)),
2404
+ _step3;
2462
2405
  try {
2463
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
2464
- var key = _step4.value;
2406
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
2407
+ var key = _step3.value;
2465
2408
  refs[key] = refVNodes[key].elm;
2466
2409
  }
2467
2410
  } catch (err) {
2468
- _iterator4.e(err);
2411
+ _iterator3.e(err);
2469
2412
  } finally {
2470
- _iterator4.f();
2413
+ _iterator3.f();
2471
2414
  }
2472
2415
  freeze(refs);
2473
2416
  refsCache.set(refVNodes, refs);
@@ -2549,7 +2492,7 @@
2549
2492
  var queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
2550
2493
  // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2551
2494
  var _loop = function _loop() {
2552
- var queryMethod = _queryMethods[_i7];
2495
+ var queryMethod = _queryMethods[_i8];
2553
2496
  queryAndChildGetterDescriptors[queryMethod] = {
2554
2497
  value: function value(arg) {
2555
2498
  var vm = getAssociatedVM(this);
@@ -2565,7 +2508,7 @@
2565
2508
  writable: true
2566
2509
  };
2567
2510
  };
2568
- for (var _i7 = 0, _queryMethods = queryMethods; _i7 < _queryMethods.length; _i7++) {
2511
+ for (var _i8 = 0, _queryMethods = queryMethods; _i8 < _queryMethods.length; _i8++) {
2569
2512
  _loop();
2570
2513
  }
2571
2514
  defineProperties(LightningElement.prototype, queryAndChildGetterDescriptors);
@@ -2844,49 +2787,50 @@
2844
2787
  }
2845
2788
  var wiredConnecting = context.wiredConnecting = [];
2846
2789
  var wiredDisconnecting = context.wiredDisconnecting = [];
2847
- for (var fieldNameOrMethod in wire) {
2790
+ var _loop2 = function _loop2() {
2848
2791
  var descriptor = wire[fieldNameOrMethod];
2849
2792
  var wireDef = WireMetaMap.get(descriptor);
2850
2793
  if (process.env.NODE_ENV !== 'production') {
2851
2794
  assert.invariant(wireDef, "Internal Error: invalid wire definition found.");
2852
2795
  }
2853
2796
  if (!isUndefined$1(wireDef)) {
2854
- (function () {
2855
- var _createConnector = createConnector(vm, fieldNameOrMethod, wireDef),
2856
- connector = _createConnector.connector,
2857
- computeConfigAndUpdate = _createConnector.computeConfigAndUpdate,
2858
- resetConfigWatcher = _createConnector.resetConfigWatcher;
2859
- var hasDynamicParams = wireDef.dynamic.length > 0;
2860
- ArrayPush$1.call(wiredConnecting, function () {
2861
- connector.connect();
2862
- if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
2863
- if (hasDynamicParams) {
2864
- Promise.resolve().then(computeConfigAndUpdate);
2865
- return;
2866
- }
2797
+ var _createConnector = createConnector(vm, fieldNameOrMethod, wireDef),
2798
+ connector = _createConnector.connector,
2799
+ computeConfigAndUpdate = _createConnector.computeConfigAndUpdate,
2800
+ resetConfigWatcher = _createConnector.resetConfigWatcher;
2801
+ var hasDynamicParams = wireDef.dynamic.length > 0;
2802
+ ArrayPush$1.call(wiredConnecting, function () {
2803
+ connector.connect();
2804
+ if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
2805
+ if (hasDynamicParams) {
2806
+ Promise.resolve().then(computeConfigAndUpdate);
2807
+ return;
2867
2808
  }
2868
- computeConfigAndUpdate();
2869
- });
2870
- ArrayPush$1.call(wiredDisconnecting, function () {
2871
- connector.disconnect();
2872
- resetConfigWatcher();
2873
- });
2874
- })();
2809
+ }
2810
+ computeConfigAndUpdate();
2811
+ });
2812
+ ArrayPush$1.call(wiredDisconnecting, function () {
2813
+ connector.disconnect();
2814
+ resetConfigWatcher();
2815
+ });
2875
2816
  }
2817
+ };
2818
+ for (var fieldNameOrMethod in wire) {
2819
+ _loop2();
2876
2820
  }
2877
2821
  }
2878
2822
  function connectWireAdapters(vm) {
2879
2823
  var wiredConnecting = vm.context.wiredConnecting;
2880
- for (var _i8 = 0, len = wiredConnecting.length; _i8 < len; _i8 += 1) {
2881
- wiredConnecting[_i8]();
2824
+ for (var _i9 = 0, len = wiredConnecting.length; _i9 < len; _i9 += 1) {
2825
+ wiredConnecting[_i9]();
2882
2826
  }
2883
2827
  }
2884
2828
  function disconnectWireAdapters(vm) {
2885
2829
  var wiredDisconnecting = vm.context.wiredDisconnecting;
2886
2830
  runWithBoundaryProtection(vm, vm, noop, function () {
2887
2831
  // job
2888
- for (var _i9 = 0, len = wiredDisconnecting.length; _i9 < len; _i9 += 1) {
2889
- wiredDisconnecting[_i9]();
2832
+ for (var _i10 = 0, len = wiredDisconnecting.length; _i10 < len; _i10 += 1) {
2833
+ wiredDisconnecting[_i10]();
2890
2834
  }
2891
2835
  }, noop);
2892
2836
  }
@@ -3220,8 +3164,8 @@
3220
3164
  }
3221
3165
  }
3222
3166
  if (!isUndefined$1(fields)) {
3223
- for (var _i10 = 0, n = fields.length; _i10 < n; _i10++) {
3224
- var _fieldName2 = fields[_i10];
3167
+ for (var _i11 = 0, n = fields.length; _i11 < n; _i11++) {
3168
+ var _fieldName2 = fields[_i11];
3225
3169
  descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
3226
3170
  if (process.env.NODE_ENV !== 'production') {
3227
3171
  validateObservedField(Ctor, _fieldName2, descriptor);
@@ -3269,8 +3213,8 @@
3269
3213
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3270
3214
  */
3271
3215
  var warned = false;
3272
- // @ts-ignore
3273
- if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
3216
+ // Only used in LWC's Karma tests
3217
+ if (process.env.NODE_ENV === 'test-karma-lwc') {
3274
3218
  // @ts-ignore
3275
3219
  window.__lwcResetWarnedOnVersionMismatch = function () {
3276
3220
  warned = false;
@@ -3443,8 +3387,8 @@
3443
3387
  superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
3444
3388
  var descriptors = create(null);
3445
3389
  // expose getters and setters for each public props on the new Element Bridge
3446
- for (var _i11 = 0, len = props.length; _i11 < len; _i11 += 1) {
3447
- var _propName = props[_i11];
3390
+ for (var _i12 = 0, len = props.length; _i12 < len; _i12 += 1) {
3391
+ var _propName = props[_i12];
3448
3392
  attributeToPropMap[htmlPropertyToAttribute(_propName)] = _propName;
3449
3393
  descriptors[_propName] = {
3450
3394
  get: createGetter(_propName),
@@ -3454,8 +3398,8 @@
3454
3398
  };
3455
3399
  }
3456
3400
  // expose public methods as props on the new Element Bridge
3457
- for (var _i12 = 0, _len = methods.length; _i12 < _len; _i12 += 1) {
3458
- var methodName = methods[_i12];
3401
+ for (var _i13 = 0, _len = methods.length; _i13 < _len; _i13 += 1) {
3402
+ var methodName = methods[_i13];
3459
3403
  descriptors[methodName] = {
3460
3404
  value: createMethodCaller(methodName),
3461
3405
  writable: true,
@@ -3569,10 +3513,7 @@
3569
3513
  return canRefreshAllInstances;
3570
3514
  }
3571
3515
  function getTemplateOrSwappedTemplate(tpl) {
3572
- if (process.env.NODE_ENV === 'production') {
3573
- // this method should never leak to prod
3574
- throw new ReferenceError();
3575
- }
3516
+ assertNotProd(); // this method should never leak to prod
3576
3517
  var visited = new Set();
3577
3518
  while (swappedTemplateMap.has(tpl) && !visited.has(tpl)) {
3578
3519
  visited.add(tpl);
@@ -3581,10 +3522,7 @@
3581
3522
  return tpl;
3582
3523
  }
3583
3524
  function getComponentOrSwappedComponent(Ctor) {
3584
- if (process.env.NODE_ENV === 'production') {
3585
- // this method should never leak to prod
3586
- throw new ReferenceError();
3587
- }
3525
+ assertNotProd(); // this method should never leak to prod
3588
3526
  var visited = new Set();
3589
3527
  while (swappedComponentMap.has(Ctor) && !visited.has(Ctor)) {
3590
3528
  visited.add(Ctor);
@@ -3593,10 +3531,7 @@
3593
3531
  return Ctor;
3594
3532
  }
3595
3533
  function getStyleOrSwappedStyle(style) {
3596
- if (process.env.NODE_ENV === 'production') {
3597
- // this method should never leak to prod
3598
- throw new ReferenceError();
3599
- }
3534
+ assertNotProd(); // this method should never leak to prod
3600
3535
  var visited = new Set();
3601
3536
  while (swappedStyleMap.has(style) && !visited.has(style)) {
3602
3537
  visited.add(style);
@@ -3605,10 +3540,7 @@
3605
3540
  return style;
3606
3541
  }
3607
3542
  function setActiveVM(vm) {
3608
- if (process.env.NODE_ENV === 'production') {
3609
- // this method should never leak to prod
3610
- throw new ReferenceError();
3611
- }
3543
+ assertNotProd(); // this method should never leak to prod
3612
3544
  // tracking active component
3613
3545
  var Ctor = vm.def.ctor;
3614
3546
  var componentVMs = activeComponents.get(Ctor);
@@ -3651,10 +3583,7 @@
3651
3583
  }
3652
3584
  }
3653
3585
  function removeActiveVM(vm) {
3654
- if (process.env.NODE_ENV === 'production') {
3655
- // this method should never leak to prod
3656
- throw new ReferenceError();
3657
- }
3586
+ assertNotProd(); // this method should never leak to prod
3658
3587
  // tracking inactive component
3659
3588
  var Ctor = vm.def.ctor;
3660
3589
  var list = activeComponents.get(Ctor);
@@ -3999,8 +3928,8 @@
3999
3928
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
4000
3929
  var content = [];
4001
3930
  var root;
4002
- for (var _i13 = 0; _i13 < stylesheets.length; _i13++) {
4003
- var stylesheet = stylesheets[_i13];
3931
+ for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
3932
+ var stylesheet = stylesheets[_i14];
4004
3933
  if (isArray$1(stylesheet)) {
4005
3934
  ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
4006
3935
  } else {
@@ -4108,8 +4037,8 @@
4108
4037
  shadowMode = vm.shadowMode,
4109
4038
  insertStylesheet = vm.renderer.insertStylesheet;
4110
4039
  if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
4111
- for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
4112
- insertStylesheet(stylesheets[_i14]);
4040
+ for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
4041
+ insertStylesheet(stylesheets[_i15]);
4113
4042
  }
4114
4043
  } else if (vm.hydrated) {
4115
4044
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
@@ -4122,8 +4051,8 @@
4122
4051
  var root = getNearestNativeShadowComponent(vm);
4123
4052
  // null root means a global style
4124
4053
  var target = isNull(root) ? undefined : root.shadowRoot;
4125
- for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
4126
- insertStylesheet(stylesheets[_i15], target);
4054
+ for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
4055
+ insertStylesheet(stylesheets[_i16], target);
4127
4056
  }
4128
4057
  }
4129
4058
  return null;
@@ -4437,8 +4366,8 @@
4437
4366
  return;
4438
4367
  }
4439
4368
  var setCSSStyleProperty = renderer.setCSSStyleProperty;
4440
- for (var _i16 = 0; _i16 < styleDecls.length; _i16++) {
4441
- var _styleDecls$_i = _slicedToArray(styleDecls[_i16], 3),
4369
+ for (var _i17 = 0; _i17 < styleDecls.length; _i17++) {
4370
+ var _styleDecls$_i = _slicedToArray(styleDecls[_i17], 3),
4442
4371
  prop = _styleDecls$_i[0],
4443
4372
  value = _styleDecls$_i[1],
4444
4373
  important = _styleDecls$_i[2];
@@ -4920,8 +4849,8 @@
4920
4849
  // If no VFragment is found in children, we don't need to traverse anything or mark the children dynamic and can return early.
4921
4850
  var nodeStack = [];
4922
4851
  var fragmentFound = false;
4923
- for (var _i17 = children.length - 1; _i17 > -1; _i17 -= 1) {
4924
- var child = children[_i17];
4852
+ for (var _i18 = children.length - 1; _i18 > -1; _i18 -= 1) {
4853
+ var child = children[_i18];
4925
4854
  ArrayPush$1.call(nodeStack, child);
4926
4855
  fragmentFound = fragmentFound || !!(child && isVFragment(child));
4927
4856
  }
@@ -4933,8 +4862,8 @@
4933
4862
  if (!isNull(currentNode) && isVFragment(currentNode)) {
4934
4863
  var fChildren = currentNode.children;
4935
4864
  // Ignore the start and end text node delimiters
4936
- for (var _i18 = fChildren.length - 2; _i18 > 0; _i18 -= 1) {
4937
- ArrayPush$1.call(nodeStack, fChildren[_i18]);
4865
+ for (var _i19 = fChildren.length - 2; _i19 > 0; _i19 -= 1) {
4866
+ ArrayPush$1.call(nodeStack, fChildren[_i19]);
4938
4867
  }
4939
4868
  } else {
4940
4869
  ArrayPush$1.call(flattenedChildren, currentNode);
@@ -4973,8 +4902,8 @@
4973
4902
  var oldSlotsMapping = vm.cmpSlots.slotAssignments;
4974
4903
  var cmpSlotsMapping = create(null);
4975
4904
  // Collect all slots into cmpSlotsMapping
4976
- for (var _i19 = 0, len = children.length; _i19 < len; _i19 += 1) {
4977
- var vnode = children[_i19];
4905
+ for (var _i20 = 0, len = children.length; _i20 < len; _i20 += 1) {
4906
+ var vnode = children[_i20];
4978
4907
  if (isNull(vnode)) {
4979
4908
  continue;
4980
4909
  }
@@ -4999,8 +4928,8 @@
4999
4928
  markComponentAsDirty(vm);
5000
4929
  return;
5001
4930
  }
5002
- for (var _i20 = 0, _len2 = oldKeys.length; _i20 < _len2; _i20 += 1) {
5003
- var key = oldKeys[_i20];
4931
+ for (var _i21 = 0, _len2 = oldKeys.length; _i21 < _len2; _i21 += 1) {
4932
+ var key = oldKeys[_i21];
5004
4933
  if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
5005
4934
  markComponentAsDirty(vm);
5006
4935
  return;
@@ -5123,11 +5052,11 @@
5123
5052
  if (oldStartIdx > oldEndIdx) {
5124
5053
  // There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
5125
5054
  // already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
5126
- var _i21 = newEndIdx;
5055
+ var _i22 = newEndIdx;
5127
5056
  var n;
5128
5057
  do {
5129
- n = newCh[++_i21];
5130
- } while (!isVNode(n) && _i21 < newChEnd);
5058
+ n = newCh[++_i22];
5059
+ } while (!isVNode(n) && _i22 < newChEnd);
5131
5060
  before = isVNode(n) ? n.elm : null;
5132
5061
  mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
5133
5062
  } else {
@@ -5152,9 +5081,9 @@
5152
5081
  // if the old list is not empty, the new list MUST have the same
5153
5082
  // amount of nodes, that's why we call this static children
5154
5083
  var anchor = null;
5155
- for (var _i22 = c2Length - 1; _i22 >= 0; _i22 -= 1) {
5156
- var n1 = c1[_i22];
5157
- var n2 = c2[_i22];
5084
+ for (var _i23 = c2Length - 1; _i23 >= 0; _i23 -= 1) {
5085
+ var n1 = c1[_i23];
5086
+ var n2 = c2[_i23];
5158
5087
  if (n2 !== n1) {
5159
5088
  if (isVNode(n1)) {
5160
5089
  if (isVNode(n2)) {
@@ -5279,8 +5208,8 @@
5279
5208
  if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
5280
5209
  var newChildren = [];
5281
5210
  var slotAssignments = slotset.slotAssignments[slotName];
5282
- for (var _i23 = 0; _i23 < slotAssignments.length; _i23++) {
5283
- var vnode = slotAssignments[_i23];
5211
+ for (var _i24 = 0; _i24 < slotAssignments.length; _i24++) {
5212
+ var vnode = slotAssignments[_i24];
5284
5213
  if (!isNull(vnode)) {
5285
5214
  var assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
5286
5215
  // The only sniff test for a scoped <slot> element is the presence of `slotData`
@@ -5749,10 +5678,7 @@
5749
5678
  vmBeingRendered = vm;
5750
5679
  }
5751
5680
  function validateSlots(vm, html) {
5752
- if (process.env.NODE_ENV === 'production') {
5753
- // this method should never leak to prod
5754
- throw new ReferenceError();
5755
- }
5681
+ assertNotProd(); // this method should never leak to prod
5756
5682
  var cmpSlots = vm.cmpSlots;
5757
5683
  var _html$slots = html.slots,
5758
5684
  slots = _html$slots === void 0 ? EmptyArray : _html$slots;
@@ -5805,23 +5731,23 @@
5805
5731
  var classAttrToken = hasScopedStyles && hasStyleToken ? " class=\"".concat(stylesheetToken, "\"") : '';
5806
5732
  var attrToken = hasStyleToken && isSyntheticShadow ? ' ' + stylesheetToken : '';
5807
5733
  var htmlFragment = '';
5808
- for (var _i24 = 0, n = keys.length; _i24 < n; _i24++) {
5809
- switch (keys[_i24]) {
5734
+ for (var _i25 = 0, n = keys.length; _i25 < n; _i25++) {
5735
+ switch (keys[_i25]) {
5810
5736
  case 0:
5811
5737
  // styleToken in existing class attr
5812
- htmlFragment += strings[_i24] + classToken;
5738
+ htmlFragment += strings[_i25] + classToken;
5813
5739
  break;
5814
5740
  case 1:
5815
5741
  // styleToken for added class attr
5816
- htmlFragment += strings[_i24] + classAttrToken;
5742
+ htmlFragment += strings[_i25] + classAttrToken;
5817
5743
  break;
5818
5744
  case 2:
5819
5745
  // styleToken as attr
5820
- htmlFragment += strings[_i24] + attrToken;
5746
+ htmlFragment += strings[_i25] + attrToken;
5821
5747
  break;
5822
5748
  case 3:
5823
5749
  // ${1}${2}
5824
- htmlFragment += strings[_i24] + classAttrToken + attrToken;
5750
+ htmlFragment += strings[_i25] + classAttrToken + attrToken;
5825
5751
  break;
5826
5752
  }
5827
5753
  }
@@ -5901,9 +5827,7 @@
5901
5827
  setActiveVM(vm);
5902
5828
  }
5903
5829
  // reset the refs; they will be set during the tmpl() instantiation
5904
- var hasRefVNodes = Boolean(html.hasRefs);
5905
- vm.hasRefVNodes = hasRefVNodes;
5906
- vm.refVNodes = hasRefVNodes ? create(null) : null;
5830
+ vm.refVNodes = html.hasRefs ? create(null) : null;
5907
5831
  // right before producing the vnodes, we clear up all internal references
5908
5832
  // to custom elements from the template.
5909
5833
  vm.velements = [];
@@ -5928,8 +5852,8 @@
5928
5852
  }
5929
5853
  function computeHasScopedStylesInStylesheets(stylesheets) {
5930
5854
  if (hasStyles(stylesheets)) {
5931
- for (var _i25 = 0; _i25 < stylesheets.length; _i25++) {
5932
- if (isTrue(stylesheets[_i25][KEY__SCOPED_CSS])) {
5855
+ for (var _i26 = 0; _i26 < stylesheets.length; _i26++) {
5856
+ if (isTrue(stylesheets[_i26][KEY__SCOPED_CSS])) {
5933
5857
  return true;
5934
5858
  }
5935
5859
  }
@@ -6095,7 +6019,7 @@
6095
6019
  var cmpEventListenerMap = new WeakMap();
6096
6020
  function getWrappedComponentsListener(vm, listener) {
6097
6021
  if (!isFunction$1(listener)) {
6098
- throw new TypeError(); // avoiding problems with non-valid listeners
6022
+ throw new TypeError('Expected an EventListener but received ' + _typeof(listener)); // avoiding problems with non-valid listeners
6099
6023
  }
6100
6024
 
6101
6025
  var wrappedListener = cmpEventListenerMap.get(listener);
@@ -6125,8 +6049,8 @@
6125
6049
  if (process.env.NODE_ENV !== 'production') {
6126
6050
  assert.isTrue(isObject(service), "Invalid service declaration, ".concat(service, ": service must be an object"));
6127
6051
  }
6128
- for (var _i26 = 0; _i26 < hooks.length; ++_i26) {
6129
- var hookName = hooks[_i26];
6052
+ for (var _i27 = 0; _i27 < hooks.length; ++_i27) {
6053
+ var hookName = hooks[_i27];
6130
6054
  if (hookName in service) {
6131
6055
  var l = Services[hookName];
6132
6056
  if (isUndefined$1(l)) {
@@ -6143,8 +6067,8 @@
6143
6067
  var component = vm.component,
6144
6068
  def = vm.def,
6145
6069
  context = vm.context;
6146
- for (var _i27 = 0, len = cbs.length; _i27 < len; ++_i27) {
6147
- cbs[_i27].call(undefined, component, {}, def, context);
6070
+ for (var _i28 = 0, len = cbs.length; _i28 < len; ++_i28) {
6071
+ cbs[_i28].call(undefined, component, {}, def, context);
6148
6072
  }
6149
6073
  }
6150
6074
 
@@ -6238,7 +6162,6 @@
6238
6162
  mode: mode,
6239
6163
  owner: owner,
6240
6164
  refVNodes: null,
6241
- hasRefVNodes: false,
6242
6165
  children: EmptyArray,
6243
6166
  aChildren: EmptyArray,
6244
6167
  velements: EmptyArray,
@@ -6299,8 +6222,8 @@
6299
6222
  var valid = true;
6300
6223
  var validate = function validate(arrayOrStylesheet) {
6301
6224
  if (isArray$1(arrayOrStylesheet)) {
6302
- for (var _i28 = 0; _i28 < arrayOrStylesheet.length; _i28++) {
6303
- validate(arrayOrStylesheet[_i28]);
6225
+ for (var _i29 = 0; _i29 < arrayOrStylesheet.length; _i29++) {
6226
+ validate(arrayOrStylesheet[_i29]);
6304
6227
  }
6305
6228
  } else if (!isFunction$1(arrayOrStylesheet)) {
6306
6229
  // function assumed to be a stylesheet factory
@@ -6453,17 +6376,17 @@
6453
6376
  return a.idx - b.idx;
6454
6377
  });
6455
6378
  rehydrateQueue = []; // reset to a new queue
6456
- for (var _i29 = 0, len = vms.length; _i29 < len; _i29 += 1) {
6457
- var vm = vms[_i29];
6379
+ for (var _i30 = 0, len = vms.length; _i30 < len; _i30 += 1) {
6380
+ var vm = vms[_i30];
6458
6381
  try {
6459
6382
  rehydrate(vm);
6460
6383
  } catch (error) {
6461
- if (_i29 + 1 < len) {
6384
+ if (_i30 + 1 < len) {
6462
6385
  // pieces of the queue are still pending to be rehydrated, those should have priority
6463
6386
  if (rehydrateQueue.length === 0) {
6464
6387
  addCallbackToNextTick(flushRehydrationQueue);
6465
6388
  }
6466
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i29 + 1));
6389
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i30 + 1));
6467
6390
  }
6468
6391
  // we need to end the measure before throwing.
6469
6392
  logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
@@ -6532,8 +6455,8 @@
6532
6455
  var vCustomElementCollection = vm.velements;
6533
6456
  // Reporting disconnection for every child in inverse order since they are
6534
6457
  // inserted in reserved order.
6535
- for (var _i30 = vCustomElementCollection.length - 1; _i30 >= 0; _i30 -= 1) {
6536
- var elm = vCustomElementCollection[_i30].elm;
6458
+ for (var _i31 = vCustomElementCollection.length - 1; _i31 >= 0; _i31 -= 1) {
6459
+ var elm = vCustomElementCollection[_i31].elm;
6537
6460
  // There are two cases where the element could be undefined:
6538
6461
  // * when there is an error during the construction phase, and an error
6539
6462
  // boundary picks it, there is a possibility that the VCustomElement
@@ -6564,8 +6487,8 @@
6564
6487
  * defined on its shadow.
6565
6488
  */
6566
6489
  function recursivelyDisconnectChildren(vnodes) {
6567
- for (var _i31 = 0, len = vnodes.length; _i31 < len; _i31 += 1) {
6568
- var vnode = vnodes[_i31];
6490
+ for (var _i32 = 0, len = vnodes.length; _i32 < len; _i32 += 1) {
6491
+ var vnode = vnodes[_i32];
6569
6492
  if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
6570
6493
  switch (vnode.type) {
6571
6494
  case 2 /* VNodeType.Element */:
@@ -6589,8 +6512,8 @@
6589
6512
  var children = vm.children,
6590
6513
  renderRoot = vm.renderRoot,
6591
6514
  remove = vm.renderer.remove;
6592
- for (var _i32 = 0, len = children.length; _i32 < len; _i32++) {
6593
- var child = children[_i32];
6515
+ for (var _i33 = 0, len = children.length; _i33 < len; _i33++) {
6516
+ var child = children[_i33];
6594
6517
  if (!isNull(child) && !isUndefined$1(child.elm)) {
6595
6518
  remove(child.elm, renderRoot);
6596
6519
  }
@@ -6712,17 +6635,17 @@
6712
6635
  // if our id is null or empty, nobody can reference us
6713
6636
  return;
6714
6637
  }
6715
- var _iterator5 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
6716
- _step5;
6638
+ var _iterator4 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
6639
+ _step4;
6717
6640
  try {
6718
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
6719
- var idRefAttrName = _step5.value;
6641
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
6642
+ var idRefAttrName = _step4.value;
6720
6643
  // Query all global elements with this attribute. The attribute selector syntax `~=` is for values
6721
6644
  // that reference multiple IDs, separated by whitespace.
6722
6645
  var query = "[".concat(idRefAttrName, "~=\"").concat(CSS.escape(attrValue), "\"]");
6723
6646
  var sourceElements = querySelectorAll.call(document, query);
6724
- for (var _i33 = 0; _i33 < sourceElements.length; _i33++) {
6725
- var sourceElement = sourceElements[_i33];
6647
+ for (var _i34 = 0; _i34 < sourceElements.length; _i34++) {
6648
+ var sourceElement = sourceElements[_i34];
6726
6649
  var sourceRoot = sourceElement.getRootNode();
6727
6650
  if (sourceRoot !== root) {
6728
6651
  reportViolation(sourceElement, elm, idRefAttrName);
@@ -6731,18 +6654,18 @@
6731
6654
  }
6732
6655
  }
6733
6656
  } catch (err) {
6734
- _iterator5.e(err);
6657
+ _iterator4.e(err);
6735
6658
  } finally {
6736
- _iterator5.f();
6659
+ _iterator4.f();
6737
6660
  }
6738
6661
  } else {
6739
6662
  // elm is the source, find the target
6740
6663
  var ids = parseIdRefAttributeValue(attrValue);
6741
- var _iterator6 = _createForOfIteratorHelper(ids),
6742
- _step6;
6664
+ var _iterator5 = _createForOfIteratorHelper(ids),
6665
+ _step5;
6743
6666
  try {
6744
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
6745
- var id = _step6.value;
6667
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
6668
+ var id = _step5.value;
6746
6669
  var target = getElementById.call(document, id);
6747
6670
  if (!isNull(target)) {
6748
6671
  var targetRoot = target.getRootNode();
@@ -6753,9 +6676,9 @@
6753
6676
  }
6754
6677
  }
6755
6678
  } catch (err) {
6756
- _iterator6.e(err);
6679
+ _iterator5.e(err);
6757
6680
  } finally {
6758
- _iterator6.f();
6681
+ _iterator5.f();
6759
6682
  }
6760
6683
  }
6761
6684
  }
@@ -7057,8 +6980,8 @@
7057
6980
  var nextNode = node;
7058
6981
  var anchor = null;
7059
6982
  var renderer = owner.renderer;
7060
- for (var _i34 = 0; _i34 < children.length; _i34++) {
7061
- var childVnode = children[_i34];
6983
+ for (var _i35 = 0; _i35 < children.length; _i35++) {
6984
+ var childVnode = children[_i35];
7062
6985
  if (!isNull(childVnode)) {
7063
6986
  if (nextNode) {
7064
6987
  nextNode = hydrateNode(nextNode, childVnode, renderer);
@@ -7136,8 +7059,8 @@
7136
7059
  var nodesAreCompatible = true;
7137
7060
  // Validate attributes, though we could always recovery from those by running the update mods.
7138
7061
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
7139
- for (var _i35 = 0, _Object$entries = Object.entries(attrs); _i35 < _Object$entries.length; _i35++) {
7140
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i35], 2),
7062
+ for (var _i36 = 0, _Object$entries = Object.entries(attrs); _i36 < _Object$entries.length; _i36++) {
7063
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i36], 2),
7141
7064
  attrName = _Object$entries$_i[0],
7142
7065
  attrValue = _Object$entries$_i[1];
7143
7066
  var owner = vnode.owner;
@@ -7238,8 +7161,8 @@
7238
7161
  var parsedVnodeStyle = parseStyleText(elmStyle);
7239
7162
  var expectedStyle = [];
7240
7163
  // styleMap is used when style is set to static value.
7241
- for (var _i36 = 0, n = styleDecls.length; _i36 < n; _i36++) {
7242
- var _styleDecls$_i2 = _slicedToArray(styleDecls[_i36], 3),
7164
+ for (var _i37 = 0, n = styleDecls.length; _i37 < n; _i37++) {
7165
+ var _styleDecls$_i2 = _slicedToArray(styleDecls[_i37], 3),
7243
7166
  prop = _styleDecls$_i2[0],
7244
7167
  value = _styleDecls$_i2[1],
7245
7168
  important = _styleDecls$_i2[2];
@@ -7356,11 +7279,11 @@
7356
7279
  function warnOnArrayMutation(stylesheets) {
7357
7280
  // We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
7358
7281
  // we can at least warn when they use the most common mutation methods.
7359
- var _iterator7 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
7360
- _step7;
7282
+ var _iterator6 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
7283
+ _step6;
7361
7284
  try {
7362
- var _loop2 = function _loop2() {
7363
- var prop = _step7.value;
7285
+ var _loop3 = function _loop3() {
7286
+ var prop = _step6.value;
7364
7287
  var originalArrayMethod = getOriginalArrayMethod(prop);
7365
7288
  stylesheets[prop] = function arrayMutationWarningWrapper() {
7366
7289
  logError("Mutating the \"stylesheets\" array on a template function " + "is deprecated and may be removed in a future version of LWC.");
@@ -7368,24 +7291,24 @@
7368
7291
  return originalArrayMethod.apply(this, arguments);
7369
7292
  };
7370
7293
  };
7371
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7372
- _loop2();
7294
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7295
+ _loop3();
7373
7296
  }
7374
7297
  } catch (err) {
7375
- _iterator7.e(err);
7298
+ _iterator6.e(err);
7376
7299
  } finally {
7377
- _iterator7.f();
7300
+ _iterator6.f();
7378
7301
  }
7379
7302
  }
7380
7303
  // Warn if the user tries to mutate a stylesheet factory function, e.g.:
7381
7304
  // `stylesheet.$scoped$ = true`
7382
7305
  function warnOnStylesheetFunctionMutation(stylesheet) {
7383
7306
  // We could warn on other properties, but in practice only certain expandos are meaningful to LWC at runtime
7384
- var _iterator8 = _createForOfIteratorHelper(STYLESHEET_FUNCTION_EXPANDOS),
7385
- _step8;
7307
+ var _iterator7 = _createForOfIteratorHelper(STYLESHEET_FUNCTION_EXPANDOS),
7308
+ _step7;
7386
7309
  try {
7387
- var _loop3 = function _loop3() {
7388
- var prop = _step8.value;
7310
+ var _loop4 = function _loop4() {
7311
+ var prop = _step7.value;
7389
7312
  var value = stylesheet[prop];
7390
7313
  defineProperty(stylesheet, prop, {
7391
7314
  enumerable: true,
@@ -7399,13 +7322,13 @@
7399
7322
  }
7400
7323
  });
7401
7324
  };
7402
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
7403
- _loop3();
7325
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7326
+ _loop4();
7404
7327
  }
7405
7328
  } catch (err) {
7406
- _iterator8.e(err);
7329
+ _iterator7.e(err);
7407
7330
  } finally {
7408
- _iterator8.f();
7331
+ _iterator7.f();
7409
7332
  }
7410
7333
  }
7411
7334
  // Warn on either array or stylesheet (function) mutation, in a deeply-nested array
@@ -7427,8 +7350,8 @@
7427
7350
  // Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
7428
7351
  function traverseStylesheets(stylesheets, callback) {
7429
7352
  callback(stylesheets);
7430
- for (var _i37 = 0; _i37 < stylesheets.length; _i37++) {
7431
- var stylesheet = stylesheets[_i37];
7353
+ for (var _i38 = 0; _i38 < stylesheets.length; _i38++) {
7354
+ var stylesheet = stylesheets[_i38];
7432
7355
  if (isArray$1(stylesheet)) {
7433
7356
  traverseStylesheets(stylesheet, callback);
7434
7357
  } else {
@@ -7474,11 +7397,11 @@
7474
7397
  if (!isUndefined$1(tmpl.stylesheets)) {
7475
7398
  warnOnStylesheetsMutation(tmpl.stylesheets);
7476
7399
  }
7477
- var _iterator9 = _createForOfIteratorHelper(TEMPLATE_PROPS),
7478
- _step9;
7400
+ var _iterator8 = _createForOfIteratorHelper(TEMPLATE_PROPS),
7401
+ _step8;
7479
7402
  try {
7480
- var _loop4 = function _loop4() {
7481
- var prop = _step9.value;
7403
+ var _loop5 = function _loop5() {
7404
+ var prop = _step8.value;
7482
7405
  var value = tmpl[prop];
7483
7406
  defineProperty(tmpl, prop, {
7484
7407
  enumerable: true,
@@ -7494,13 +7417,13 @@
7494
7417
  }
7495
7418
  });
7496
7419
  };
7497
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
7498
- _loop4();
7420
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
7421
+ _loop5();
7499
7422
  }
7500
7423
  } catch (err) {
7501
- _iterator9.e(err);
7424
+ _iterator8.e(err);
7502
7425
  } finally {
7503
- _iterator9.f();
7426
+ _iterator8.f();
7504
7427
  }
7505
7428
  var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
7506
7429
  defineProperty(tmpl, 'stylesheetTokens', {
@@ -7541,7 +7464,7 @@
7541
7464
  }
7542
7465
  return ctor;
7543
7466
  }
7544
- /* version: 2.35.0 */
7467
+ /* version: 2.35.2 */
7545
7468
 
7546
7469
  /*
7547
7470
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7645,8 +7568,7 @@
7645
7568
  // Test utilities
7646
7569
  //
7647
7570
  // Only used in LWC's Karma tests
7648
- // @ts-ignore
7649
- if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
7571
+ if (process.env.NODE_ENV === 'test-karma-lwc') {
7650
7572
  // @ts-ignore
7651
7573
  window.__lwcResetGlobalStylesheets = function () {
7652
7574
  stylesheetCache.clear();
@@ -7818,7 +7740,7 @@
7818
7740
  var cachedConstructors = new Map();
7819
7741
  var elementsUpgradedOutsideLWC = new WeakSet();
7820
7742
  var elementBeingUpgradedByLWC = false;
7821
- // Creates a constructor that is intended to be used as a vanilla custom element, except that the upgradeCallback is
7743
+ // Creates a constructor that is intended to be used directly as a custom element, except that the upgradeCallback is
7822
7744
  // passed in to the constructor so LWC can reuse the same custom element constructor for multiple components.
7823
7745
  // Another benefit is that only LWC can create components that actually do anything – if you do
7824
7746
  // `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
@@ -7867,7 +7789,7 @@
7867
7789
  }
7868
7790
  return UpgradableConstructor;
7869
7791
  };
7870
- var createCustomElementVanilla = function createCustomElementVanilla(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
7792
+ var createCustomElementUsingUpgradableConstructor = function createCustomElementUsingUpgradableConstructor(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
7871
7793
  // use global custom elements registry
7872
7794
  var UpgradableConstructor = cachedConstructors.get(tagName);
7873
7795
  if (isUndefined$1(UpgradableConstructor)) {
@@ -7894,7 +7816,7 @@
7894
7816
  */
7895
7817
  /**
7896
7818
  * Create a scoped registry, i.e. a function that can create custom elements whose tag names
7897
- * do not conflict with vanilla custom elements having the same tag name.
7819
+ * do not conflict with third-party custom elements having the same tag name.
7898
7820
  */
7899
7821
  function createScopedRegistry() {
7900
7822
  if (!hasCustomElements) {
@@ -8225,17 +8147,17 @@
8225
8147
  function flushPendingWhenDefinedCallbacks(tagName, ctor) {
8226
8148
  var resolvers = pendingWhenDefinedCallbacks.get(tagName);
8227
8149
  if (!isUndefined$1(resolvers)) {
8228
- var _iterator10 = _createForOfIteratorHelper(resolvers),
8229
- _step10;
8150
+ var _iterator9 = _createForOfIteratorHelper(resolvers),
8151
+ _step9;
8230
8152
  try {
8231
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
8232
- var resolver = _step10.value;
8153
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
8154
+ var resolver = _step9.value;
8233
8155
  resolver(ctor);
8234
8156
  }
8235
8157
  } catch (err) {
8236
- _iterator10.e(err);
8158
+ _iterator9.e(err);
8237
8159
  } finally {
8238
- _iterator10.f();
8160
+ _iterator9.f();
8239
8161
  }
8240
8162
  }
8241
8163
  pendingWhenDefinedCallbacks.delete(tagName);
@@ -8285,11 +8207,11 @@
8285
8207
  var awaiting = awaitingUpgrade.get(tagName);
8286
8208
  if (!isUndefined$1(awaiting)) {
8287
8209
  awaitingUpgrade.delete(tagName);
8288
- var _iterator11 = _createForOfIteratorHelper(awaiting),
8289
- _step11;
8210
+ var _iterator10 = _createForOfIteratorHelper(awaiting),
8211
+ _step10;
8290
8212
  try {
8291
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
8292
- var element = _step11.value;
8213
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
8214
+ var element = _step10.value;
8293
8215
  var registeredDefinition = pendingRegistryForElement.get(element);
8294
8216
  // At this point, registeredDefinition should never be undefined because awaitingUpgrade
8295
8217
  // is only populated when we haven't run internalUpgrade yet, and we only populate
@@ -8301,9 +8223,9 @@
8301
8223
  }
8302
8224
  }
8303
8225
  } catch (err) {
8304
- _iterator11.e(err);
8226
+ _iterator10.e(err);
8305
8227
  } finally {
8306
- _iterator11.f();
8228
+ _iterator10.f();
8307
8229
  }
8308
8230
  }
8309
8231
  // If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
@@ -8500,10 +8422,10 @@
8500
8422
  * We have three modes for creating custom elements:
8501
8423
  *
8502
8424
  * 1. Compat (legacy) browser support (e.g. IE11). Totally custom, doesn't rely on native browser APIs.
8503
- * 2. "Vanilla" custom elements registry. This system actually still allows us to have two LWC components with the
8504
- * same tag name, via a simple trick: every custom element constructor we define in the registry is basically
8505
- * the same. It's essentially a dummy `class extends HTMLElement` that accepts an `upgradeCallback` in its
8506
- * constructor, which allows us to have completely customized functionality for different components.
8425
+ * 2. "Upgradable constructor" custom element. This allows us to have two LWC components with the same tag name,
8426
+ * via a trick: every custom element constructor we define in the registry is basically the same. It's essentially
8427
+ * a dummy `class extends HTMLElement` that accepts an `upgradeCallback` in its constructor ("upgradable
8428
+ * constructor"), which allows us to have completely customized functionality for different components.
8507
8429
  * 3. "Scoped" (or "pivot") custom elements. This relies on a sophisticated system that emulates the "scoped custom
8508
8430
  * elements registry" proposal, with support for avoiding conflicts in tag names both between LWC components and
8509
8431
  * between LWC components and third-party elements. This uses a similar trick to #2, but is much more complex
@@ -8514,8 +8436,8 @@
8514
8436
  if (lwcRuntimeFlags.ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY) {
8515
8437
  createCustomElement = createCustomElementScoped;
8516
8438
  } else {
8517
- // use global custom elements registry (vanilla)
8518
- createCustomElement = createCustomElementVanilla;
8439
+ // use the global registry, with an upgradable constructor for the defined custom element
8440
+ createCustomElement = createCustomElementUsingUpgradableConstructor;
8519
8441
  }
8520
8442
  } else {
8521
8443
  // no registry available here
@@ -8569,10 +8491,10 @@
8569
8491
  }
8570
8492
  var assert = /*#__PURE__*/Object.freeze({
8571
8493
  __proto__: null,
8494
+ fail: fail,
8572
8495
  invariant: invariant,
8573
- isTrue: isTrue$1,
8574
8496
  isFalse: isFalse$1,
8575
- fail: fail
8497
+ isTrue: isTrue$1
8576
8498
  });
8577
8499
  function isUndefined(obj) {
8578
8500
  return obj === undefined;
@@ -8580,7 +8502,7 @@
8580
8502
  function isNull(obj) {
8581
8503
  return obj === null;
8582
8504
  }
8583
- /** version: 2.35.0 */
8505
+ /** version: 2.35.2 */
8584
8506
 
8585
8507
  /*
8586
8508
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8639,17 +8561,17 @@
8639
8561
  exports.createFragment = function (html) {
8640
8562
  var wrapperTags = topLevelWrappingMap[getTagName(html)];
8641
8563
  if (!isUndefined(wrapperTags)) {
8642
- var _iterator12 = _createForOfIteratorHelper(wrapperTags),
8643
- _step12;
8564
+ var _iterator11 = _createForOfIteratorHelper(wrapperTags),
8565
+ _step11;
8644
8566
  try {
8645
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
8646
- var wrapperTag = _step12.value;
8567
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
8568
+ var wrapperTag = _step11.value;
8647
8569
  html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
8648
8570
  }
8649
8571
  } catch (err) {
8650
- _iterator12.e(err);
8572
+ _iterator11.e(err);
8651
8573
  } finally {
8652
- _iterator12.f();
8574
+ _iterator11.f();
8653
8575
  }
8654
8576
  }
8655
8577
  // For IE11, the document title must not be undefined, but it can be an empty string
@@ -8658,7 +8580,7 @@
8658
8580
  doc.body.innerHTML = html;
8659
8581
  var content = doc.body;
8660
8582
  if (!isUndefined(wrapperTags)) {
8661
- for (var _i38 = 0; _i38 < wrapperTags.length; _i38++) {
8583
+ for (var _i39 = 0; _i39 < wrapperTags.length; _i39++) {
8662
8584
  content = content.firstChild;
8663
8585
  }
8664
8586
  }
@@ -8851,8 +8773,8 @@
8851
8773
  tagName: element.tagName.toLowerCase(),
8852
8774
  hydrated: true
8853
8775
  });
8854
- for (var _i39 = 0, _Object$entries2 = Object.entries(props); _i39 < _Object$entries2.length; _i39++) {
8855
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i39], 2),
8776
+ for (var _i40 = 0, _Object$entries2 = Object.entries(props); _i40 < _Object$entries2.length; _i40++) {
8777
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i40], 2),
8856
8778
  key = _Object$entries2$_i[0],
8857
8779
  value = _Object$entries2$_i[1];
8858
8780
  element[key] = value;
@@ -9146,7 +9068,7 @@
9146
9068
  });
9147
9069
  freeze(LightningElement);
9148
9070
  seal(LightningElement.prototype);
9149
- /* version: 2.35.0 */
9071
+ /* version: 2.35.2 */
9150
9072
 
9151
9073
  exports.LightningElement = LightningElement;
9152
9074
  exports.__unstable__ProfilerControl = profilerControl;