lwc 2.34.0 → 2.35.1

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 +939 -763
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +939 -762
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +846 -684
  5. package/dist/engine-dom/iife/es5/engine-dom.js +1115 -922
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +801 -619
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +939 -762
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +846 -684
  11. package/dist/engine-dom/umd/es5/engine-dom.js +1115 -922
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +801 -619
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +1025 -1082
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +1025 -1082
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +21 -41
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +21 -41
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +20 -39
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +24 -38
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +23 -36
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +21 -41
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +20 -39
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +24 -38
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +23 -36
  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
@@ -15,11 +15,6 @@
15
15
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
16
16
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
17
17
  function _getPrototypeOf2(o) { _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf2(o); }
18
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
- 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); } }
20
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
22
- 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); }
23
18
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
24
19
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
25
20
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
@@ -28,6 +23,11 @@
28
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."); }
29
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; } }
30
25
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
+ 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
+ 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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
30
+ 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
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
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
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; }
@@ -103,6 +103,7 @@
103
103
  var _String$prototype = String.prototype,
104
104
  StringCharCodeAt = _String$prototype.charCodeAt,
105
105
  StringReplace = _String$prototype.replace,
106
+ StringSplit = _String$prototype.split,
106
107
  StringSlice = _String$prototype.slice,
107
108
  StringToLowerCase = _String$prototype.toLowerCase;
108
109
  function isUndefined$1(obj) {
@@ -195,6 +196,9 @@
195
196
  }(),
196
197
  AriaAttrNameToPropNameMap = _ref.AriaAttrNameToPropNameMap,
197
198
  AriaPropNameToAttrNameMap = _ref.AriaPropNameToAttrNameMap;
199
+ // These attributes take either an ID or a list of IDs as values.
200
+ // This includes aria-* attributes as well as the special non-ARIA "for" attribute
201
+ var ID_REFERENCING_ATTRIBUTES_SET = new Set(['aria-activedescendant', 'aria-controls', 'aria-describedby', 'aria-details', 'aria-errormessage', 'aria-flowto', 'aria-labelledby', 'aria-owns', 'for']);
198
202
 
199
203
  /*
200
204
  * Copyright (c) 2018, salesforce.com, inc.
@@ -202,39 +206,11 @@
202
206
  * SPDX-License-Identifier: MIT
203
207
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
204
208
  */
205
- // Inspired from: https://mathiasbynens.be/notes/globalthis
206
- var _globalThis = /*@__PURE__*/function () {
207
- // On recent browsers, `globalThis` is already defined. In this case return it directly.
208
- if ((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === 'object') {
209
- return globalThis;
210
- }
211
- var _globalThis;
212
- try {
213
- // eslint-disable-next-line no-extend-native
214
- Object.defineProperty(Object.prototype, '__magic__', {
215
- get: function get() {
216
- return this;
217
- },
218
- configurable: true
219
- });
220
- // __magic__ is undefined in Safari 10 and IE10 and older.
221
- // @ts-ignore
222
- // eslint-disable-next-line no-undef
223
- _globalThis = __magic__;
224
- // @ts-ignore
225
- delete Object.prototype.__magic__;
226
- } catch (ex) {
227
- // In IE8, Object.defineProperty only works on DOM objects.
228
- } finally {
229
- // If the magic above fails for some reason we assume that we are in a legacy browser.
230
- // Assume `window` exists in this case.
231
- if (typeof _globalThis === 'undefined') {
232
- // @ts-ignore
233
- _globalThis = window;
234
- }
235
- }
236
- return _globalThis;
237
- }();
209
+ // See browser support for globalThis:
210
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility
211
+ /* istanbul ignore next */
212
+ // @ts-ignore
213
+ var _globalThis = (typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === 'object' ? globalThis : window;
238
214
 
239
215
  /*
240
216
  * Copyright (c) 2018, salesforce.com, inc.
@@ -248,6 +224,8 @@
248
224
  var KEY__SHADOW_TOKEN = '$shadowToken$';
249
225
  var KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
250
226
  var KEY__SCOPED_CSS = '$scoped$';
227
+ var KEY__NATIVE_GET_ELEMENT_BY_ID = '$nativeGetElementById$';
228
+ var KEY__NATIVE_QUERY_SELECTOR_ALL = '$nativeQuerySelectorAll$';
251
229
  var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
252
230
  var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
253
231
  var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
@@ -335,7 +313,7 @@
335
313
  CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
336
314
  return propertyName;
337
315
  }
338
- /** version: 2.34.0 */
316
+ /** version: 2.35.1 */
339
317
 
340
318
  /**
341
319
  * Copyright (C) 2018 salesforce.com, inc.
@@ -387,6 +365,7 @@
387
365
  console.warn("Failed to set the value \"".concat(value, "\" for the runtime feature flag \"").concat(name, "\" because it is undefined. Available flags: ").concat(availableFlags, "."));
388
366
  return;
389
367
  }
368
+ // This may seem redundant, but `"production" === 'test-karma-lwc'` is replaced by Karma tests
390
369
  {
391
370
  // Disallow the same flag to be set more than once in production
392
371
  var runtimeValue = lwcRuntimeFlags[name];
@@ -406,7 +385,7 @@
406
385
  */
407
386
  function setFeatureFlagForTest(name, value) {
408
387
  }
409
- /** version: 2.34.0 */
388
+ /** version: 2.35.1 */
410
389
 
411
390
  /**
412
391
  * Copyright (C) 2018 salesforce.com, inc.
@@ -470,7 +449,7 @@
470
449
  }
471
450
  }
472
451
  }
473
- /** version: 2.34.0 */
452
+ /** version: 2.35.1 */
474
453
 
475
454
  /*
476
455
  * Copyright (c) 2018, salesforce.com, inc.
@@ -490,99 +469,153 @@
490
469
  * SPDX-License-Identifier: MIT
491
470
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
492
471
  */
493
- var nextTickCallbackQueue = [];
494
- var SPACE_CHAR = 32;
495
- var EmptyObject = seal(create(null));
496
- var EmptyArray = seal([]);
497
- function flushCallbackQueue() {
498
- var callbacks = nextTickCallbackQueue;
499
- nextTickCallbackQueue = []; // reset to a new queue
500
- for (var _i3 = 0, len = callbacks.length; _i3 < len; _i3 += 1) {
501
- callbacks[_i3]();
472
+ /** Callbacks to invoke when reporting is enabled **/
473
+ var onReportingEnabledCallbacks = [];
474
+ /** The currently assigned reporting dispatcher. */
475
+ var currentDispatcher$1 = noop;
476
+ /**
477
+ * Whether reporting is enabled.
478
+ *
479
+ * Note that this may seem redundant, given you can just check if the currentDispatcher is undefined,
480
+ * but it turns out that Terser only strips out unused code if we use this explicit boolean.
481
+ */
482
+ var enabled$1 = false;
483
+ var reportingControl = {
484
+ /**
485
+ * Attach a new reporting control (aka dispatcher).
486
+ *
487
+ * @param dispatcher - reporting control
488
+ */
489
+ attachDispatcher: function attachDispatcher(dispatcher) {
490
+ enabled$1 = true;
491
+ currentDispatcher$1 = dispatcher;
492
+ var _iterator = _createForOfIteratorHelper(onReportingEnabledCallbacks),
493
+ _step;
494
+ try {
495
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
496
+ var callback = _step.value;
497
+ try {
498
+ callback();
499
+ } catch (err) {
500
+ // This should never happen. But if it does, we don't want one callback to cause another to fail
501
+ // eslint-disable-next-line no-console
502
+ console.error('Could not invoke callback', err);
503
+ }
504
+ }
505
+ } catch (err) {
506
+ _iterator.e(err);
507
+ } finally {
508
+ _iterator.f();
509
+ }
510
+ onReportingEnabledCallbacks.length = 0; // clear the array
511
+ },
512
+ /**
513
+ * Detach the current reporting control (aka dispatcher).
514
+ */
515
+ detachDispatcher: function detachDispatcher() {
516
+ enabled$1 = false;
517
+ currentDispatcher$1 = noop;
518
+ }
519
+ };
520
+ /**
521
+ * Call a callback when reporting is enabled, or immediately if reporting is already enabled.
522
+ * Will only ever be called once.
523
+ * @param callback
524
+ */
525
+ function onReportingEnabled(callback) {
526
+ if (enabled$1) {
527
+ // call immediately
528
+ callback();
529
+ } else {
530
+ // call later
531
+ onReportingEnabledCallbacks.push(callback);
502
532
  }
503
533
  }
504
- function addCallbackToNextTick(callback) {
505
- if (nextTickCallbackQueue.length === 0) {
506
- Promise.resolve().then(flushCallbackQueue);
534
+ /**
535
+ * Report to the current dispatcher, if there is one.
536
+ * @param reportingEventId
537
+ * @param vm
538
+ */
539
+ function report(reportingEventId, vm) {
540
+ if (enabled$1) {
541
+ currentDispatcher$1(reportingEventId, vm.tagName, vm.idx);
507
542
  }
508
- ArrayPush$1.call(nextTickCallbackQueue, callback);
509
543
  }
510
- function guid() {
511
- function s4() {
512
- return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
544
+
545
+ /*
546
+ * Copyright (c) 2018, salesforce.com, inc.
547
+ * All rights reserved.
548
+ * SPDX-License-Identifier: MIT
549
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
550
+ */
551
+ function getComponentTag(vm) {
552
+ return "<".concat(StringToLowerCase.call(vm.tagName), ">");
553
+ }
554
+ // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
555
+ function getComponentStack(vm) {
556
+ var stack = [];
557
+ var prefix = '';
558
+ while (!isNull(vm.owner)) {
559
+ ArrayPush$1.call(stack, prefix + getComponentTag(vm));
560
+ vm = vm.owner;
561
+ prefix += '\t';
513
562
  }
514
- return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
563
+ return ArrayJoin.call(stack, '\n');
515
564
  }
516
- // Borrowed from Vue template compiler.
517
- // https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
518
- var DECLARATION_DELIMITER = /;(?![^(]*\))/g;
519
- var PROPERTY_DELIMITER = /:(.+)/;
520
- function parseStyleText(cssText) {
521
- var styleMap = {};
522
- var declarations = cssText.split(DECLARATION_DELIMITER);
523
- var _iterator = _createForOfIteratorHelper(declarations),
524
- _step;
525
- try {
526
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
527
- var declaration = _step.value;
528
- if (declaration) {
529
- var _declaration$split = declaration.split(PROPERTY_DELIMITER),
530
- _declaration$split2 = _slicedToArray(_declaration$split, 2),
531
- prop = _declaration$split2[0],
532
- value = _declaration$split2[1];
533
- if (prop !== undefined && value !== undefined) {
534
- styleMap[prop.trim()] = value.trim();
535
- }
565
+ function getErrorComponentStack(vm) {
566
+ var wcStack = [];
567
+ var currentVm = vm;
568
+ while (!isNull(currentVm)) {
569
+ ArrayPush$1.call(wcStack, getComponentTag(currentVm));
570
+ currentVm = currentVm.owner;
571
+ }
572
+ return wcStack.reverse().join('\n\t');
573
+ }
574
+
575
+ /*
576
+ * Copyright (c) 2018, salesforce.com, inc.
577
+ * All rights reserved.
578
+ * SPDX-License-Identifier: MIT
579
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
580
+ */
581
+ function addErrorComponentStack(vm, error) {
582
+ if (!isFrozen(error) && isUndefined$1(error.wcStack)) {
583
+ var wcStack = getErrorComponentStack(vm);
584
+ defineProperty(error, 'wcStack', {
585
+ get: function get() {
586
+ return wcStack;
536
587
  }
537
- }
538
- } catch (err) {
539
- _iterator.e(err);
540
- } finally {
541
- _iterator.f();
588
+ });
542
589
  }
543
- return styleMap;
544
590
  }
545
- // Make a shallow copy of an object but omit the given key
546
- function cloneAndOmitKey(object, keyToOmit) {
547
- var result = {};
548
- for (var _i4 = 0, _Object$keys = Object.keys(object); _i4 < _Object$keys.length; _i4++) {
549
- var key = _Object$keys[_i4];
550
- if (key !== keyToOmit) {
551
- result[key] = object[key];
591
+
592
+ /*
593
+ * Copyright (c) 2018, salesforce.com, inc.
594
+ * All rights reserved.
595
+ * SPDX-License-Identifier: MIT
596
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
597
+ */
598
+ var alreadyLoggedMessages = new Set();
599
+ function log(method, message, vm, once) {
600
+ var msg = "[LWC ".concat(method, "]: ").concat(message);
601
+ if (!isUndefined$1(vm)) {
602
+ msg = "".concat(msg, "\n").concat(getComponentStack(vm));
603
+ }
604
+ if (once) {
605
+ if (alreadyLoggedMessages.has(msg)) {
606
+ return;
552
607
  }
608
+ alreadyLoggedMessages.add(msg);
553
609
  }
554
- return result;
555
- }
556
- function flattenStylesheets(stylesheets) {
557
- var list = [];
558
- var _iterator2 = _createForOfIteratorHelper(stylesheets),
559
- _step2;
560
610
  try {
561
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
562
- var stylesheet = _step2.value;
563
- if (!Array.isArray(stylesheet)) {
564
- list.push(stylesheet);
565
- } else {
566
- list.push.apply(list, _toConsumableArray(flattenStylesheets(stylesheet)));
567
- }
568
- }
569
- } catch (err) {
570
- _iterator2.e(err);
571
- } finally {
572
- _iterator2.f();
611
+ throw new Error(msg);
612
+ } catch (e) {
613
+ /* eslint-disable-next-line no-console */
614
+ console[method](e);
573
615
  }
574
- return list;
575
616
  }
576
- // Set a ref (lwc:ref) on a VM, from a template API
577
- function setRefVNode(vm, ref, vnode) {
578
- // If this method is called, then vm.refVNodes is set as the template has refs.
579
- // If not, then something went wrong and we threw an error above.
580
- var refVNodes = vm.refVNodes;
581
- // In cases of conflict (two elements with the same ref), prefer, the last one,
582
- // in depth-first traversal order.
583
- if (!(ref in refVNodes) || refVNodes[ref].key < vnode.key) {
584
- refVNodes[ref] = vnode;
585
- }
617
+ function logError(message, vm) {
618
+ log('error', message, vm, false);
586
619
  }
587
620
 
588
621
  /*
@@ -607,8 +640,8 @@
607
640
  if (!isUndefined$1(reactiveRecord)) {
608
641
  var reactiveObservers = reactiveRecord[key];
609
642
  if (!isUndefined$1(reactiveObservers)) {
610
- for (var _i5 = 0, len = reactiveObservers.length; _i5 < len; _i5 += 1) {
611
- var ro = reactiveObservers[_i5];
643
+ for (var _i3 = 0, len = reactiveObservers.length; _i3 < len; _i3 += 1) {
644
+ var ro = reactiveObservers[_i3];
612
645
  ro.notify();
613
646
  }
614
647
  }
@@ -667,9 +700,9 @@
667
700
  var listeners = this.listeners;
668
701
  var len = listeners.length;
669
702
  if (len > 0) {
670
- for (var _i6 = 0; _i6 < len; _i6 += 1) {
671
- var set = listeners[_i6];
672
- var pos = ArrayIndexOf.call(listeners[_i6], this);
703
+ for (var _i4 = 0; _i4 < len; _i4 += 1) {
704
+ var set = listeners[_i4];
705
+ var pos = ArrayIndexOf.call(listeners[_i4], this);
673
706
  ArraySplice.call(set, pos, 1);
674
707
  }
675
708
  listeners.length = 0;
@@ -714,67 +747,107 @@
714
747
  * SPDX-License-Identifier: MIT
715
748
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
716
749
  */
717
- function getComponentTag(vm) {
718
- return "<".concat(StringToLowerCase.call(vm.tagName), ">");
750
+ var nextTickCallbackQueue = [];
751
+ var SPACE_CHAR = 32;
752
+ var EmptyObject = seal(create(null));
753
+ var EmptyArray = seal([]);
754
+ function flushCallbackQueue() {
755
+ var callbacks = nextTickCallbackQueue;
756
+ nextTickCallbackQueue = []; // reset to a new queue
757
+ for (var _i5 = 0, len = callbacks.length; _i5 < len; _i5 += 1) {
758
+ callbacks[_i5]();
759
+ }
719
760
  }
720
- // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
721
- function getComponentStack(vm) {
722
- var stack = [];
723
- var prefix = '';
724
- while (!isNull(vm.owner)) {
725
- ArrayPush$1.call(stack, prefix + getComponentTag(vm));
726
- vm = vm.owner;
727
- prefix += '\t';
761
+ function addCallbackToNextTick(callback) {
762
+ if (nextTickCallbackQueue.length === 0) {
763
+ Promise.resolve().then(flushCallbackQueue);
728
764
  }
729
- return ArrayJoin.call(stack, '\n');
765
+ ArrayPush$1.call(nextTickCallbackQueue, callback);
730
766
  }
731
- function getErrorComponentStack(vm) {
732
- var wcStack = [];
733
- var currentVm = vm;
734
- while (!isNull(currentVm)) {
735
- ArrayPush$1.call(wcStack, getComponentTag(currentVm));
736
- currentVm = currentVm.owner;
767
+ function guid() {
768
+ function s4() {
769
+ return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
737
770
  }
738
- return wcStack.reverse().join('\n\t');
771
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
739
772
  }
740
-
741
- /*
742
- * Copyright (c) 2018, salesforce.com, inc.
743
- * All rights reserved.
744
- * SPDX-License-Identifier: MIT
745
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
746
- */
747
- function addErrorComponentStack(vm, error) {
748
- if (!isFrozen(error) && isUndefined$1(error.wcStack)) {
749
- var wcStack = getErrorComponentStack(vm);
750
- defineProperty(error, 'wcStack', {
751
- get: function get() {
752
- return wcStack;
773
+ // Borrowed from Vue template compiler.
774
+ // https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
775
+ var DECLARATION_DELIMITER = /;(?![^(]*\))/g;
776
+ var PROPERTY_DELIMITER = /:(.+)/;
777
+ function parseStyleText(cssText) {
778
+ var styleMap = {};
779
+ var declarations = cssText.split(DECLARATION_DELIMITER);
780
+ var _iterator2 = _createForOfIteratorHelper(declarations),
781
+ _step2;
782
+ try {
783
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
784
+ var declaration = _step2.value;
785
+ if (declaration) {
786
+ var _declaration$split = declaration.split(PROPERTY_DELIMITER),
787
+ _declaration$split2 = _slicedToArray(_declaration$split, 2),
788
+ prop = _declaration$split2[0],
789
+ value = _declaration$split2[1];
790
+ if (prop !== undefined && value !== undefined) {
791
+ styleMap[prop.trim()] = value.trim();
792
+ }
753
793
  }
754
- });
794
+ }
795
+ } catch (err) {
796
+ _iterator2.e(err);
797
+ } finally {
798
+ _iterator2.f();
755
799
  }
800
+ return styleMap;
756
801
  }
757
-
758
- /*
759
- * Copyright (c) 2018, salesforce.com, inc.
760
- * All rights reserved.
761
- * SPDX-License-Identifier: MIT
762
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
763
- */
764
- function log(method, message, vm) {
765
- var msg = "[LWC ".concat(method, "]: ").concat(message);
766
- if (!isUndefined$1(vm)) {
767
- msg = "".concat(msg, "\n").concat(getComponentStack(vm));
802
+ // Make a shallow copy of an object but omit the given key
803
+ function cloneAndOmitKey(object, keyToOmit) {
804
+ var result = {};
805
+ for (var _i6 = 0, _Object$keys = Object.keys(object); _i6 < _Object$keys.length; _i6++) {
806
+ var key = _Object$keys[_i6];
807
+ if (key !== keyToOmit) {
808
+ result[key] = object[key];
809
+ }
768
810
  }
811
+ return result;
812
+ }
813
+ function flattenStylesheets(stylesheets) {
814
+ var list = [];
815
+ var _iterator3 = _createForOfIteratorHelper(stylesheets),
816
+ _step3;
769
817
  try {
770
- throw new Error(msg);
771
- } catch (e) {
772
- /* eslint-disable-next-line no-console */
773
- console[method](e);
818
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
819
+ var stylesheet = _step3.value;
820
+ if (!Array.isArray(stylesheet)) {
821
+ list.push(stylesheet);
822
+ } else {
823
+ list.push.apply(list, _toConsumableArray(flattenStylesheets(stylesheet)));
824
+ }
825
+ }
826
+ } catch (err) {
827
+ _iterator3.e(err);
828
+ } finally {
829
+ _iterator3.f();
774
830
  }
831
+ return list;
775
832
  }
776
- function logError(message, vm) {
777
- log('error', message, vm);
833
+ // Set a ref (lwc:ref) on a VM, from a template API
834
+ function setRefVNode(vm, ref, vnode) {
835
+ // If this method is called, then vm.refVNodes is set as the template has refs.
836
+ // If not, then something went wrong and we threw an error above.
837
+ var refVNodes = vm.refVNodes;
838
+ // In cases of conflict (two elements with the same ref), prefer, the last one,
839
+ // in depth-first traversal order.
840
+ if (!(ref in refVNodes) || refVNodes[ref].key < vnode.key) {
841
+ refVNodes[ref] = vnode;
842
+ }
843
+ }
844
+ // Throw an error if we're running in prod mode. Ensures code is truly removed from prod mode.
845
+ function assertNotProd() {
846
+ /* istanbul ignore if */
847
+ {
848
+ // this method should never leak to prod
849
+ throw new ReferenceError();
850
+ }
778
851
  }
779
852
 
780
853
  /*
@@ -810,101 +883,6 @@
810
883
  */
811
884
  // These properties get added to LWCElement.prototype publicProps automatically
812
885
  var defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
813
- function offsetPropertyErrorMessage(name) {
814
- return "Using the `".concat(name, "` property is an anti-pattern because it rounds the value to an integer. Instead, use the `getBoundingClientRect` method to obtain fractional values for the size of an element and its position relative to the viewport.");
815
- }
816
- // Global HTML Attributes & Properties
817
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
818
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
819
- //
820
- // If you update this list, check for test files that recapitulate the same list. Searching the codebase
821
- // for e.g. "dropzone" should suffice.
822
- assign(create(null), {
823
- accessKey: {
824
- attribute: 'accesskey'
825
- },
826
- accessKeyLabel: {
827
- readOnly: true
828
- },
829
- className: {
830
- attribute: 'class',
831
- error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.'
832
- },
833
- contentEditable: {
834
- attribute: 'contenteditable'
835
- },
836
- dataset: {
837
- readOnly: true,
838
- error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead."
839
- },
840
- dir: {
841
- attribute: 'dir'
842
- },
843
- draggable: {
844
- attribute: 'draggable'
845
- },
846
- dropzone: {
847
- attribute: 'dropzone',
848
- readOnly: true
849
- },
850
- hidden: {
851
- attribute: 'hidden'
852
- },
853
- id: {
854
- attribute: 'id'
855
- },
856
- inputMode: {
857
- attribute: 'inputmode'
858
- },
859
- lang: {
860
- attribute: 'lang'
861
- },
862
- slot: {
863
- attribute: 'slot',
864
- error: 'Using the `slot` property is an anti-pattern.'
865
- },
866
- spellcheck: {
867
- attribute: 'spellcheck'
868
- },
869
- style: {
870
- attribute: 'style'
871
- },
872
- tabIndex: {
873
- attribute: 'tabindex'
874
- },
875
- title: {
876
- attribute: 'title'
877
- },
878
- translate: {
879
- attribute: 'translate'
880
- },
881
- // additional "global attributes" that are not present in the link above.
882
- isContentEditable: {
883
- readOnly: true
884
- },
885
- offsetHeight: {
886
- readOnly: true,
887
- error: offsetPropertyErrorMessage('offsetHeight')
888
- },
889
- offsetLeft: {
890
- readOnly: true,
891
- error: offsetPropertyErrorMessage('offsetLeft')
892
- },
893
- offsetParent: {
894
- readOnly: true
895
- },
896
- offsetTop: {
897
- readOnly: true,
898
- error: offsetPropertyErrorMessage('offsetTop')
899
- },
900
- offsetWidth: {
901
- readOnly: true,
902
- error: offsetPropertyErrorMessage('offsetWidth')
903
- },
904
- role: {
905
- attribute: 'role'
906
- }
907
- });
908
886
  var controlledElement = null;
909
887
  var controlledAttributeName;
910
888
  function isAttributeLocked(elm, attrName) {
@@ -1568,7 +1546,6 @@
1568
1546
  }
1569
1547
  };
1570
1548
  }
1571
- var EMPTY_REFS = freeze(create(null));
1572
1549
  var refsCache = new WeakMap();
1573
1550
  /**
1574
1551
  * This class is the base class for any LWC element.
@@ -1735,22 +1712,15 @@
1735
1712
  // based on `this.refs.bar`.
1736
1713
  return;
1737
1714
  }
1738
- var refVNodes = vm.refVNodes,
1739
- hasRefVNodes = vm.hasRefVNodes;
1715
+ var refVNodes = vm.refVNodes;
1740
1716
  vm.cmpTemplate;
1741
1717
  // For backwards compatibility with component written before template refs
1742
1718
  // were introduced, we return undefined if the template has no refs defined
1743
1719
  // anywhere. This fixes components that may want to add an expando called `refs`
1744
1720
  // and are checking if it exists with `if (this.refs)` before adding it.
1745
- // Note it is not sufficient to just check if `refVNodes` is null or empty,
1746
- // because a template may have `lwc:ref` defined within a falsy `if:true` block.
1747
- if (!hasRefVNodes) {
1748
- return;
1749
- }
1750
- // For templates that are using `lwc:ref`, if there are no refs currently available
1751
- // (e.g. refs inside of a falsy `if:true` block), we return an empty object.
1721
+ // Note we use a null refVNodes to indicate that the template has no refs defined.
1752
1722
  if (isNull(refVNodes)) {
1753
- return EMPTY_REFS;
1723
+ return;
1754
1724
  }
1755
1725
  // The refNodes can be cached based on the refVNodes, since the refVNodes
1756
1726
  // are recreated from scratch every time the template is rendered.
@@ -1758,17 +1728,17 @@
1758
1728
  var refs = refsCache.get(refVNodes);
1759
1729
  if (isUndefined$1(refs)) {
1760
1730
  refs = create(null);
1761
- var _iterator3 = _createForOfIteratorHelper(keys(refVNodes)),
1762
- _step3;
1731
+ var _iterator4 = _createForOfIteratorHelper(keys(refVNodes)),
1732
+ _step4;
1763
1733
  try {
1764
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1765
- var key = _step3.value;
1734
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1735
+ var key = _step4.value;
1766
1736
  refs[key] = refVNodes[key].elm;
1767
1737
  }
1768
1738
  } catch (err) {
1769
- _iterator3.e(err);
1739
+ _iterator4.e(err);
1770
1740
  } finally {
1771
- _iterator3.f();
1741
+ _iterator4.f();
1772
1742
  }
1773
1743
  freeze(refs);
1774
1744
  refsCache.set(refVNodes, refs);
@@ -1888,6 +1858,262 @@
1888
1858
  };
1889
1859
  }
1890
1860
 
1861
+ /*
1862
+ * Copyright (c) 2018, salesforce.com, inc.
1863
+ * All rights reserved.
1864
+ * SPDX-License-Identifier: MIT
1865
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1866
+ */
1867
+ var DeprecatedWiredElementHost = '$$DeprecatedWiredElementHostKey$$';
1868
+ var DeprecatedWiredParamsMeta = '$$DeprecatedWiredParamsMetaKey$$';
1869
+ var WireMetaMap = new Map();
1870
+ var WireContextRegistrationEvent = /*#__PURE__*/function (_CustomEvent) {
1871
+ _inherits(WireContextRegistrationEvent, _CustomEvent);
1872
+ var _super3 = _createSuper(WireContextRegistrationEvent);
1873
+ function WireContextRegistrationEvent(adapterToken, _ref3) {
1874
+ var _this2;
1875
+ var setNewContext = _ref3.setNewContext,
1876
+ setDisconnectedCallback = _ref3.setDisconnectedCallback;
1877
+ _classCallCheck(this, WireContextRegistrationEvent);
1878
+ _this2 = _super3.call(this, adapterToken, {
1879
+ bubbles: true,
1880
+ composed: true
1881
+ });
1882
+ defineProperties(_assertThisInitialized(_this2), {
1883
+ setNewContext: {
1884
+ value: setNewContext
1885
+ },
1886
+ setDisconnectedCallback: {
1887
+ value: setDisconnectedCallback
1888
+ }
1889
+ });
1890
+ return _this2;
1891
+ }
1892
+ return _createClass(WireContextRegistrationEvent);
1893
+ }( /*#__PURE__*/_wrapNativeSuper(CustomEvent));
1894
+ function createFieldDataCallback(vm, name) {
1895
+ return function (value) {
1896
+ updateComponentValue(vm, name, value);
1897
+ };
1898
+ }
1899
+ function createMethodDataCallback(vm, method) {
1900
+ return function (value) {
1901
+ // dispatching new value into the wired method
1902
+ runWithBoundaryProtection(vm, vm.owner, noop, function () {
1903
+ // job
1904
+ method.call(vm.component, value);
1905
+ }, noop);
1906
+ };
1907
+ }
1908
+ function createConfigWatcher(component, configCallback, callbackWhenConfigIsReady) {
1909
+ var hasPendingConfig = false;
1910
+ // creating the reactive observer for reactive params when needed
1911
+ var ro = createReactiveObserver(function () {
1912
+ if (hasPendingConfig === false) {
1913
+ hasPendingConfig = true;
1914
+ // collect new config in the micro-task
1915
+ Promise.resolve().then(function () {
1916
+ hasPendingConfig = false;
1917
+ // resetting current reactive params
1918
+ ro.reset();
1919
+ // dispatching a new config due to a change in the configuration
1920
+ computeConfigAndUpdate();
1921
+ });
1922
+ }
1923
+ });
1924
+ var computeConfigAndUpdate = function computeConfigAndUpdate() {
1925
+ var config;
1926
+ ro.observe(function () {
1927
+ return config = configCallback(component);
1928
+ });
1929
+ // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
1930
+ // TODO: dev-mode validation of config based on the adapter.configSchema
1931
+ // @ts-ignore it is assigned in the observe() callback
1932
+ callbackWhenConfigIsReady(config);
1933
+ };
1934
+ return {
1935
+ computeConfigAndUpdate: computeConfigAndUpdate,
1936
+ ro: ro
1937
+ };
1938
+ }
1939
+ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
1940
+ var adapter = wireDef.adapter;
1941
+ var adapterContextToken = getAdapterToken(adapter);
1942
+ if (isUndefined$1(adapterContextToken)) {
1943
+ return; // no provider found, nothing to be done
1944
+ }
1945
+
1946
+ var elm = vm.elm,
1947
+ _vm$context = vm.context,
1948
+ wiredConnecting = _vm$context.wiredConnecting,
1949
+ wiredDisconnecting = _vm$context.wiredDisconnecting,
1950
+ dispatchEvent = vm.renderer.dispatchEvent;
1951
+ // waiting for the component to be connected to formally request the context via the token
1952
+ ArrayPush$1.call(wiredConnecting, function () {
1953
+ // This event is responsible for connecting the host element with another
1954
+ // element in the composed path that is providing contextual data. The provider
1955
+ // must be listening for a special dom event with the name corresponding to the value of
1956
+ // `adapterContextToken`, which will remain secret and internal to this file only to
1957
+ // guarantee that the linkage can be forged.
1958
+ var contextRegistrationEvent = new WireContextRegistrationEvent(adapterContextToken, {
1959
+ setNewContext: function setNewContext(newContext) {
1960
+ // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
1961
+ // TODO: dev-mode validation of config based on the adapter.contextSchema
1962
+ callbackWhenContextIsReady(newContext);
1963
+ },
1964
+ setDisconnectedCallback: function setDisconnectedCallback(disconnectCallback) {
1965
+ // adds this callback into the disconnect bucket so it gets disconnected from parent
1966
+ // the the element hosting the wire is disconnected
1967
+ ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
1968
+ }
1969
+ });
1970
+ dispatchEvent(elm, contextRegistrationEvent);
1971
+ });
1972
+ }
1973
+ function createConnector(vm, name, wireDef) {
1974
+ var method = wireDef.method,
1975
+ adapter = wireDef.adapter,
1976
+ configCallback = wireDef.configCallback,
1977
+ dynamic = wireDef.dynamic;
1978
+ var debugInfo;
1979
+ var fieldOrMethodCallback = isUndefined$1(method) ? createFieldDataCallback(vm, name) : createMethodDataCallback(vm, method);
1980
+ var dataCallback = function dataCallback(value) {
1981
+ fieldOrMethodCallback(value);
1982
+ };
1983
+ var context;
1984
+ var connector;
1985
+ // Workaround to pass the component element associated to this wire adapter instance.
1986
+ defineProperty(dataCallback, DeprecatedWiredElementHost, {
1987
+ value: vm.elm
1988
+ });
1989
+ defineProperty(dataCallback, DeprecatedWiredParamsMeta, {
1990
+ value: dynamic
1991
+ });
1992
+ runWithBoundaryProtection(vm, vm, noop, function () {
1993
+ // job
1994
+ connector = new adapter(dataCallback);
1995
+ }, noop);
1996
+ var updateConnectorConfig = function updateConnectorConfig(config) {
1997
+ // every time the config is recomputed due to tracking,
1998
+ // this callback will be invoked with the new computed config
1999
+ runWithBoundaryProtection(vm, vm, noop, function () {
2000
+ // job
2001
+ if ("production" !== 'production') ;
2002
+ connector.update(config, context);
2003
+ }, noop);
2004
+ };
2005
+ // Computes the current wire config and calls the update method on the wire adapter.
2006
+ // If it has params, we will need to observe changes in the next tick.
2007
+ var _createConfigWatcher = createConfigWatcher(vm.component, configCallback, updateConnectorConfig),
2008
+ computeConfigAndUpdate = _createConfigWatcher.computeConfigAndUpdate,
2009
+ ro = _createConfigWatcher.ro;
2010
+ // if the adapter needs contextualization, we need to watch for new context and push it alongside the config
2011
+ if (!isUndefined$1(adapter.contextSchema)) {
2012
+ createContextWatcher(vm, wireDef, function (newContext) {
2013
+ // every time the context is pushed into this component,
2014
+ // this callback will be invoked with the new computed context
2015
+ if (context !== newContext) {
2016
+ context = newContext;
2017
+ // Note: when new context arrives, the config will be recomputed and pushed along side the new
2018
+ // context, this is to preserve the identity characteristics, config should not have identity
2019
+ // (ever), while context can have identity
2020
+ if (vm.state === 1 /* VMState.connected */) {
2021
+ computeConfigAndUpdate();
2022
+ }
2023
+ }
2024
+ });
2025
+ }
2026
+ return {
2027
+ // @ts-ignore the boundary protection executes sync, connector is always defined
2028
+ connector: connector,
2029
+ computeConfigAndUpdate: computeConfigAndUpdate,
2030
+ resetConfigWatcher: function resetConfigWatcher() {
2031
+ return ro.reset();
2032
+ }
2033
+ };
2034
+ }
2035
+ var AdapterToTokenMap = new Map();
2036
+ function getAdapterToken(adapter) {
2037
+ return AdapterToTokenMap.get(adapter);
2038
+ }
2039
+ function setAdapterToken(adapter, token) {
2040
+ AdapterToTokenMap.set(adapter, token);
2041
+ }
2042
+ function storeWiredMethodMeta(descriptor, adapter, configCallback, dynamic) {
2043
+ // support for callable adapters
2044
+ if (adapter.adapter) {
2045
+ adapter = adapter.adapter;
2046
+ }
2047
+ var method = descriptor.value;
2048
+ var def = {
2049
+ adapter: adapter,
2050
+ method: method,
2051
+ configCallback: configCallback,
2052
+ dynamic: dynamic
2053
+ };
2054
+ WireMetaMap.set(descriptor, def);
2055
+ }
2056
+ function storeWiredFieldMeta(descriptor, adapter, configCallback, dynamic) {
2057
+ // support for callable adapters
2058
+ if (adapter.adapter) {
2059
+ adapter = adapter.adapter;
2060
+ }
2061
+ var def = {
2062
+ adapter: adapter,
2063
+ configCallback: configCallback,
2064
+ dynamic: dynamic
2065
+ };
2066
+ WireMetaMap.set(descriptor, def);
2067
+ }
2068
+ function installWireAdapters(vm) {
2069
+ var context = vm.context,
2070
+ wire = vm.def.wire;
2071
+ var wiredConnecting = context.wiredConnecting = [];
2072
+ var wiredDisconnecting = context.wiredDisconnecting = [];
2073
+ for (var fieldNameOrMethod in wire) {
2074
+ var descriptor = wire[fieldNameOrMethod];
2075
+ var wireDef = WireMetaMap.get(descriptor);
2076
+ if (!isUndefined$1(wireDef)) {
2077
+ (function () {
2078
+ var _createConnector = createConnector(vm, fieldNameOrMethod, wireDef),
2079
+ connector = _createConnector.connector,
2080
+ computeConfigAndUpdate = _createConnector.computeConfigAndUpdate,
2081
+ resetConfigWatcher = _createConnector.resetConfigWatcher;
2082
+ var hasDynamicParams = wireDef.dynamic.length > 0;
2083
+ ArrayPush$1.call(wiredConnecting, function () {
2084
+ connector.connect();
2085
+ if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
2086
+ if (hasDynamicParams) {
2087
+ Promise.resolve().then(computeConfigAndUpdate);
2088
+ return;
2089
+ }
2090
+ }
2091
+ computeConfigAndUpdate();
2092
+ });
2093
+ ArrayPush$1.call(wiredDisconnecting, function () {
2094
+ connector.disconnect();
2095
+ resetConfigWatcher();
2096
+ });
2097
+ })();
2098
+ }
2099
+ }
2100
+ }
2101
+ function connectWireAdapters(vm) {
2102
+ var wiredConnecting = vm.context.wiredConnecting;
2103
+ for (var _i8 = 0, len = wiredConnecting.length; _i8 < len; _i8 += 1) {
2104
+ wiredConnecting[_i8]();
2105
+ }
2106
+ }
2107
+ function disconnectWireAdapters(vm) {
2108
+ var wiredDisconnecting = vm.context.wiredDisconnecting;
2109
+ runWithBoundaryProtection(vm, vm, noop, function () {
2110
+ // job
2111
+ for (var _i9 = 0, len = wiredDisconnecting.length; _i9 < len; _i9 += 1) {
2112
+ wiredDisconnecting[_i9]();
2113
+ }
2114
+ }, noop);
2115
+ }
2116
+
1891
2117
  /*
1892
2118
  * Copyright (c) 2018, salesforce.com, inc.
1893
2119
  * All rights reserved.
@@ -2085,8 +2311,8 @@
2085
2311
  }
2086
2312
  }
2087
2313
  if (!isUndefined$1(fields)) {
2088
- for (var _i8 = 0, n = fields.length; _i8 < n; _i8++) {
2089
- var _fieldName2 = fields[_i8];
2314
+ for (var _i10 = 0, n = fields.length; _i10 < n; _i10++) {
2315
+ var _fieldName2 = fields[_i10];
2090
2316
  descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
2091
2317
  // [W-9927596] Only mark a field as observed whenever it isn't a duplicated public nor
2092
2318
  // tracked property. This is only here for backward compatibility purposes.
@@ -2237,10 +2463,10 @@
2237
2463
  if (isFunction$1(SuperClass)) {
2238
2464
  HTMLBridgeElement = /*#__PURE__*/function (_SuperClass) {
2239
2465
  _inherits(HTMLBridgeElement, _SuperClass);
2240
- var _super3 = _createSuper(HTMLBridgeElement);
2466
+ var _super4 = _createSuper(HTMLBridgeElement);
2241
2467
  function HTMLBridgeElement() {
2242
2468
  _classCallCheck(this, HTMLBridgeElement);
2243
- return _super3.apply(this, arguments);
2469
+ return _super4.apply(this, arguments);
2244
2470
  }
2245
2471
  return _createClass(HTMLBridgeElement);
2246
2472
  }(SuperClass);
@@ -2267,8 +2493,8 @@
2267
2493
  superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
2268
2494
  var descriptors = create(null);
2269
2495
  // expose getters and setters for each public props on the new Element Bridge
2270
- for (var _i9 = 0, len = props.length; _i9 < len; _i9 += 1) {
2271
- var _propName = props[_i9];
2496
+ for (var _i11 = 0, len = props.length; _i11 < len; _i11 += 1) {
2497
+ var _propName = props[_i11];
2272
2498
  attributeToPropMap[htmlPropertyToAttribute(_propName)] = _propName;
2273
2499
  descriptors[_propName] = {
2274
2500
  get: createGetter(_propName),
@@ -2278,8 +2504,8 @@
2278
2504
  };
2279
2505
  }
2280
2506
  // expose public methods as props on the new Element Bridge
2281
- for (var _i10 = 0, _len = methods.length; _i10 < _len; _i10 += 1) {
2282
- var methodName = methods[_i10];
2507
+ for (var _i12 = 0, _len = methods.length; _i12 < _len; _i12 += 1) {
2508
+ var methodName = methods[_i12];
2283
2509
  descriptors[methodName] = {
2284
2510
  value: createMethodCaller(methodName),
2285
2511
  writable: true,
@@ -2320,10 +2546,60 @@
2320
2546
  }
2321
2547
  freeze(BaseBridgeElement);
2322
2548
  seal(BaseBridgeElement.prototype);
2549
+ var swappedStyleMap = new WeakMap();
2550
+ var activeTemplates = new WeakMap();
2551
+ var activeComponents = new WeakMap();
2552
+ var activeStyles = new WeakMap();
2553
+ function getStyleOrSwappedStyle(style) {
2554
+ assertNotProd(); // this method should never leak to prod
2555
+ var visited = new Set();
2556
+ while (swappedStyleMap.has(style) && !visited.has(style)) {
2557
+ visited.add(style);
2558
+ style = swappedStyleMap.get(style);
2559
+ }
2560
+ return style;
2561
+ }
2323
2562
  function setActiveVM(vm) {
2324
- {
2325
- // this method should never leak to prod
2326
- throw new ReferenceError();
2563
+ assertNotProd(); // this method should never leak to prod
2564
+ // tracking active component
2565
+ var Ctor = vm.def.ctor;
2566
+ var componentVMs = activeComponents.get(Ctor);
2567
+ if (isUndefined$1(componentVMs)) {
2568
+ componentVMs = new Set();
2569
+ activeComponents.set(Ctor, componentVMs);
2570
+ }
2571
+ // this will allow us to keep track of the hot components
2572
+ componentVMs.add(vm);
2573
+ // tracking active template
2574
+ var tpl = vm.cmpTemplate;
2575
+ if (tpl) {
2576
+ var templateVMs = activeTemplates.get(tpl);
2577
+ if (isUndefined$1(templateVMs)) {
2578
+ templateVMs = new Set();
2579
+ activeTemplates.set(tpl, templateVMs);
2580
+ }
2581
+ // this will allow us to keep track of the templates that are
2582
+ // being used by a hot component
2583
+ templateVMs.add(vm);
2584
+ // tracking active styles associated to template
2585
+ var stylesheets = tpl.stylesheets;
2586
+ if (!isUndefined$1(stylesheets)) {
2587
+ flattenStylesheets(stylesheets).forEach(function (stylesheet) {
2588
+ // this is necessary because we don't hold the list of styles
2589
+ // in the vm, we only hold the selected (already swapped template)
2590
+ // but the styles attached to the template might not be the actual
2591
+ // active ones, but the swapped versions of those.
2592
+ stylesheet = getStyleOrSwappedStyle(stylesheet);
2593
+ var stylesheetVMs = activeStyles.get(stylesheet);
2594
+ if (isUndefined$1(stylesheetVMs)) {
2595
+ stylesheetVMs = new Set();
2596
+ activeStyles.set(stylesheet, stylesheetVMs);
2597
+ }
2598
+ // this will allow us to keep track of the stylesheet that are
2599
+ // being used by a hot component
2600
+ stylesheetVMs.add(vm);
2601
+ });
2602
+ }
2327
2603
  }
2328
2604
  }
2329
2605
  function swapTemplate(oldTpl, newTpl) {
@@ -2597,8 +2873,8 @@
2597
2873
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
2598
2874
  var content = [];
2599
2875
  var root;
2600
- for (var _i11 = 0; _i11 < stylesheets.length; _i11++) {
2601
- var stylesheet = stylesheets[_i11];
2876
+ for (var _i13 = 0; _i13 < stylesheets.length; _i13++) {
2877
+ var stylesheet = stylesheets[_i13];
2602
2878
  if (isArray$1(stylesheet)) {
2603
2879
  ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
2604
2880
  } else {
@@ -2698,8 +2974,8 @@
2698
2974
  shadowMode = vm.shadowMode,
2699
2975
  insertStylesheet = vm.renderer.insertStylesheet;
2700
2976
  if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
2701
- for (var _i12 = 0; _i12 < stylesheets.length; _i12++) {
2702
- insertStylesheet(stylesheets[_i12]);
2977
+ for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
2978
+ insertStylesheet(stylesheets[_i14]);
2703
2979
  }
2704
2980
  } else if (vm.hydrated) {
2705
2981
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
@@ -2712,8 +2988,8 @@
2712
2988
  var root = getNearestNativeShadowComponent(vm);
2713
2989
  // null root means a global style
2714
2990
  var target = isNull(root) ? undefined : root.shadowRoot;
2715
- for (var _i13 = 0; _i13 < stylesheets.length; _i13++) {
2716
- insertStylesheet(stylesheets[_i13], target);
2991
+ for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
2992
+ insertStylesheet(stylesheets[_i15], target);
2717
2993
  }
2718
2994
  }
2719
2995
  return null;
@@ -3015,8 +3291,8 @@
3015
3291
  return;
3016
3292
  }
3017
3293
  var setCSSStyleProperty = renderer.setCSSStyleProperty;
3018
- for (var _i14 = 0; _i14 < styleDecls.length; _i14++) {
3019
- var _styleDecls$_i = _slicedToArray(styleDecls[_i14], 3),
3294
+ for (var _i16 = 0; _i16 < styleDecls.length; _i16++) {
3295
+ var _styleDecls$_i = _slicedToArray(styleDecls[_i16], 3),
3020
3296
  prop = _styleDecls$_i[0],
3021
3297
  value = _styleDecls$_i[1],
3022
3298
  important = _styleDecls$_i[2];
@@ -3439,8 +3715,8 @@
3439
3715
  // If no VFragment is found in children, we don't need to traverse anything or mark the children dynamic and can return early.
3440
3716
  var nodeStack = [];
3441
3717
  var fragmentFound = false;
3442
- for (var _i15 = children.length - 1; _i15 > -1; _i15 -= 1) {
3443
- var child = children[_i15];
3718
+ for (var _i17 = children.length - 1; _i17 > -1; _i17 -= 1) {
3719
+ var child = children[_i17];
3444
3720
  ArrayPush$1.call(nodeStack, child);
3445
3721
  fragmentFound = fragmentFound || !!(child && isVFragment(child));
3446
3722
  }
@@ -3452,8 +3728,8 @@
3452
3728
  if (!isNull(currentNode) && isVFragment(currentNode)) {
3453
3729
  var fChildren = currentNode.children;
3454
3730
  // Ignore the start and end text node delimiters
3455
- for (var _i16 = fChildren.length - 2; _i16 > 0; _i16 -= 1) {
3456
- ArrayPush$1.call(nodeStack, fChildren[_i16]);
3731
+ for (var _i18 = fChildren.length - 2; _i18 > 0; _i18 -= 1) {
3732
+ ArrayPush$1.call(nodeStack, fChildren[_i18]);
3457
3733
  }
3458
3734
  } else {
3459
3735
  ArrayPush$1.call(flattenedChildren, currentNode);
@@ -3489,8 +3765,8 @@
3489
3765
  var oldSlotsMapping = vm.cmpSlots.slotAssignments;
3490
3766
  var cmpSlotsMapping = create(null);
3491
3767
  // Collect all slots into cmpSlotsMapping
3492
- for (var _i17 = 0, len = children.length; _i17 < len; _i17 += 1) {
3493
- var vnode = children[_i17];
3768
+ for (var _i19 = 0, len = children.length; _i19 < len; _i19 += 1) {
3769
+ var vnode = children[_i19];
3494
3770
  if (isNull(vnode)) {
3495
3771
  continue;
3496
3772
  }
@@ -3515,8 +3791,8 @@
3515
3791
  markComponentAsDirty(vm);
3516
3792
  return;
3517
3793
  }
3518
- for (var _i18 = 0, _len2 = oldKeys.length; _i18 < _len2; _i18 += 1) {
3519
- var key = oldKeys[_i18];
3794
+ for (var _i20 = 0, _len2 = oldKeys.length; _i20 < _len2; _i20 += 1) {
3795
+ var key = oldKeys[_i20];
3520
3796
  if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
3521
3797
  markComponentAsDirty(vm);
3522
3798
  return;
@@ -3639,11 +3915,11 @@
3639
3915
  if (oldStartIdx > oldEndIdx) {
3640
3916
  // There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
3641
3917
  // already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
3642
- var _i19 = newEndIdx;
3918
+ var _i21 = newEndIdx;
3643
3919
  var n;
3644
3920
  do {
3645
- n = newCh[++_i19];
3646
- } while (!isVNode(n) && _i19 < newChEnd);
3921
+ n = newCh[++_i21];
3922
+ } while (!isVNode(n) && _i21 < newChEnd);
3647
3923
  before = isVNode(n) ? n.elm : null;
3648
3924
  mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
3649
3925
  } else {
@@ -3668,9 +3944,9 @@
3668
3944
  // if the old list is not empty, the new list MUST have the same
3669
3945
  // amount of nodes, that's why we call this static children
3670
3946
  var anchor = null;
3671
- for (var _i20 = c2Length - 1; _i20 >= 0; _i20 -= 1) {
3672
- var n1 = c1[_i20];
3673
- var n2 = c2[_i20];
3947
+ for (var _i22 = c2Length - 1; _i22 >= 0; _i22 -= 1) {
3948
+ var n1 = c1[_i22];
3949
+ var n2 = c2[_i22];
3674
3950
  if (n2 !== n1) {
3675
3951
  if (isVNode(n1)) {
3676
3952
  if (isVNode(n2)) {
@@ -3767,8 +4043,8 @@
3767
4043
  if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
3768
4044
  var newChildren = [];
3769
4045
  var slotAssignments = slotset.slotAssignments[slotName];
3770
- for (var _i21 = 0; _i21 < slotAssignments.length; _i21++) {
3771
- var vnode = slotAssignments[_i21];
4046
+ for (var _i23 = 0; _i23 < slotAssignments.length; _i23++) {
4047
+ var vnode = slotAssignments[_i23];
3772
4048
  if (!isNull(vnode)) {
3773
4049
  var assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
3774
4050
  // The only sniff test for a scoped <slot> element is the presence of `slotData`
@@ -4103,9 +4379,18 @@
4103
4379
  vmBeingRendered = vm;
4104
4380
  }
4105
4381
  function validateSlots(vm, html) {
4106
- {
4107
- // this method should never leak to prod
4108
- throw new ReferenceError();
4382
+ assertNotProd(); // this method should never leak to prod
4383
+ var cmpSlots = vm.cmpSlots;
4384
+ var _html$slots = html.slots,
4385
+ slots = _html$slots === void 0 ? EmptyArray : _html$slots;
4386
+ for (var slotName in cmpSlots.slotAssignments) {
4387
+ // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
4388
+ assert.isTrue(isArray$1(cmpSlots.slotAssignments[slotName]), "Slots can only be set to an array, instead received ".concat(toString$1(cmpSlots.slotAssignments[slotName]), " for slot \"").concat(slotName, "\" in ").concat(vm, "."));
4389
+ if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
4390
+ // TODO [#1297]: this should never really happen because the compiler should always validate
4391
+ // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
4392
+ logError("Ignoring unknown provided slot name \"".concat(slotName, "\" in ").concat(vm, ". Check for a typo on the slot attribute."), vm);
4393
+ }
4109
4394
  }
4110
4395
  }
4111
4396
  function validateLightDomTemplate(template, vm) {
@@ -4147,23 +4432,23 @@
4147
4432
  var classAttrToken = hasScopedStyles && hasStyleToken ? " class=\"".concat(stylesheetToken, "\"") : '';
4148
4433
  var attrToken = hasStyleToken && isSyntheticShadow ? ' ' + stylesheetToken : '';
4149
4434
  var htmlFragment = '';
4150
- for (var _i22 = 0, n = keys.length; _i22 < n; _i22++) {
4151
- switch (keys[_i22]) {
4435
+ for (var _i24 = 0, n = keys.length; _i24 < n; _i24++) {
4436
+ switch (keys[_i24]) {
4152
4437
  case 0:
4153
4438
  // styleToken in existing class attr
4154
- htmlFragment += strings[_i22] + classToken;
4439
+ htmlFragment += strings[_i24] + classToken;
4155
4440
  break;
4156
4441
  case 1:
4157
4442
  // styleToken for added class attr
4158
- htmlFragment += strings[_i22] + classAttrToken;
4443
+ htmlFragment += strings[_i24] + classAttrToken;
4159
4444
  break;
4160
4445
  case 2:
4161
4446
  // styleToken as attr
4162
- htmlFragment += strings[_i22] + attrToken;
4447
+ htmlFragment += strings[_i24] + attrToken;
4163
4448
  break;
4164
4449
  case 3:
4165
4450
  // ${1}${2}
4166
- htmlFragment += strings[_i22] + classAttrToken + attrToken;
4451
+ htmlFragment += strings[_i24] + classAttrToken + attrToken;
4167
4452
  break;
4168
4453
  }
4169
4454
  }
@@ -4229,9 +4514,7 @@
4229
4514
  }
4230
4515
  if ("production" !== 'production') ;
4231
4516
  // reset the refs; they will be set during the tmpl() instantiation
4232
- var hasRefVNodes = Boolean(html.hasRefs);
4233
- vm.hasRefVNodes = hasRefVNodes;
4234
- vm.refVNodes = hasRefVNodes ? create(null) : null;
4517
+ vm.refVNodes = html.hasRefs ? create(null) : null;
4235
4518
  // right before producing the vnodes, we clear up all internal references
4236
4519
  // to custom elements from the template.
4237
4520
  vm.velements = [];
@@ -4253,8 +4536,8 @@
4253
4536
  }
4254
4537
  function computeHasScopedStylesInStylesheets(stylesheets) {
4255
4538
  if (hasStyles(stylesheets)) {
4256
- for (var _i23 = 0; _i23 < stylesheets.length; _i23++) {
4257
- if (isTrue(stylesheets[_i23][KEY__SCOPED_CSS])) {
4539
+ for (var _i25 = 0; _i25 < stylesheets.length; _i25++) {
4540
+ if (isTrue(stylesheets[_i25][KEY__SCOPED_CSS])) {
4258
4541
  return true;
4259
4542
  }
4260
4543
  }
@@ -4359,8 +4642,8 @@
4359
4642
  */
4360
4643
  function registerComponent(
4361
4644
  // We typically expect a LightningElementConstructor, but technically you can call this with anything
4362
- Ctor, _ref3) {
4363
- var tmpl = _ref3.tmpl;
4645
+ Ctor, _ref4) {
4646
+ var tmpl = _ref4.tmpl;
4364
4647
  if (isFunction$1(Ctor)) {
4365
4648
  signedTemplateMap.set(Ctor, tmpl);
4366
4649
  }
@@ -4393,7 +4676,7 @@
4393
4676
  var cmpEventListenerMap = new WeakMap();
4394
4677
  function getWrappedComponentsListener(vm, listener) {
4395
4678
  if (!isFunction$1(listener)) {
4396
- throw new TypeError(); // avoiding problems with non-valid listeners
4679
+ throw new TypeError('Expected an EventListener but received ' + _typeof(listener)); // avoiding problems with non-valid listeners
4397
4680
  }
4398
4681
 
4399
4682
  var wrappedListener = cmpEventListenerMap.get(listener);
@@ -4420,8 +4703,8 @@
4420
4703
  * subject to change or being removed.
4421
4704
  */
4422
4705
  function register(service) {
4423
- for (var _i24 = 0; _i24 < hooks.length; ++_i24) {
4424
- var hookName = hooks[_i24];
4706
+ for (var _i26 = 0; _i26 < hooks.length; ++_i26) {
4707
+ var hookName = hooks[_i26];
4425
4708
  if (hookName in service) {
4426
4709
  var l = Services[hookName];
4427
4710
  if (isUndefined$1(l)) {
@@ -4435,8 +4718,8 @@
4435
4718
  var component = vm.component,
4436
4719
  def = vm.def,
4437
4720
  context = vm.context;
4438
- for (var _i25 = 0, len = cbs.length; _i25 < len; ++_i25) {
4439
- cbs[_i25].call(undefined, component, {}, def, context);
4721
+ for (var _i27 = 0, len = cbs.length; _i27 < len; ++_i27) {
4722
+ cbs[_i27].call(undefined, component, {}, def, context);
4440
4723
  }
4441
4724
  }
4442
4725
 
@@ -4524,7 +4807,6 @@
4524
4807
  mode: mode,
4525
4808
  owner: owner,
4526
4809
  refVNodes: null,
4527
- hasRefVNodes: false,
4528
4810
  children: EmptyArray,
4529
4811
  aChildren: EmptyArray,
4530
4812
  velements: EmptyArray,
@@ -4574,8 +4856,8 @@
4574
4856
  var valid = true;
4575
4857
  var validate = function validate(arrayOrStylesheet) {
4576
4858
  if (isArray$1(arrayOrStylesheet)) {
4577
- for (var _i26 = 0; _i26 < arrayOrStylesheet.length; _i26++) {
4578
- validate(arrayOrStylesheet[_i26]);
4859
+ for (var _i28 = 0; _i28 < arrayOrStylesheet.length; _i28++) {
4860
+ validate(arrayOrStylesheet[_i28]);
4579
4861
  }
4580
4862
  } else if (!isFunction$1(arrayOrStylesheet)) {
4581
4863
  // function assumed to be a stylesheet factory
@@ -4710,17 +4992,17 @@
4710
4992
  return a.idx - b.idx;
4711
4993
  });
4712
4994
  rehydrateQueue = []; // reset to a new queue
4713
- for (var _i27 = 0, len = vms.length; _i27 < len; _i27 += 1) {
4714
- var vm = vms[_i27];
4995
+ for (var _i29 = 0, len = vms.length; _i29 < len; _i29 += 1) {
4996
+ var vm = vms[_i29];
4715
4997
  try {
4716
4998
  rehydrate(vm);
4717
4999
  } catch (error) {
4718
- if (_i27 + 1 < len) {
5000
+ if (_i29 + 1 < len) {
4719
5001
  // pieces of the queue are still pending to be rehydrated, those should have priority
4720
5002
  if (rehydrateQueue.length === 0) {
4721
5003
  addCallbackToNextTick(flushRehydrationQueue);
4722
5004
  }
4723
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i27 + 1));
5005
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i29 + 1));
4724
5006
  }
4725
5007
  // we need to end the measure before throwing.
4726
5008
  logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
@@ -4786,8 +5068,8 @@
4786
5068
  var vCustomElementCollection = vm.velements;
4787
5069
  // Reporting disconnection for every child in inverse order since they are
4788
5070
  // inserted in reserved order.
4789
- for (var _i28 = vCustomElementCollection.length - 1; _i28 >= 0; _i28 -= 1) {
4790
- var elm = vCustomElementCollection[_i28].elm;
5071
+ for (var _i30 = vCustomElementCollection.length - 1; _i30 >= 0; _i30 -= 1) {
5072
+ var elm = vCustomElementCollection[_i30].elm;
4791
5073
  // There are two cases where the element could be undefined:
4792
5074
  // * when there is an error during the construction phase, and an error
4793
5075
  // boundary picks it, there is a possibility that the VCustomElement
@@ -4818,8 +5100,8 @@
4818
5100
  * defined on its shadow.
4819
5101
  */
4820
5102
  function recursivelyDisconnectChildren(vnodes) {
4821
- for (var _i29 = 0, len = vnodes.length; _i29 < len; _i29 += 1) {
4822
- var vnode = vnodes[_i29];
5103
+ for (var _i31 = 0, len = vnodes.length; _i31 < len; _i31 += 1) {
5104
+ var vnode = vnodes[_i31];
4823
5105
  if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
4824
5106
  switch (vnode.type) {
4825
5107
  case 2 /* VNodeType.Element */:
@@ -4843,8 +5125,8 @@
4843
5125
  var children = vm.children,
4844
5126
  renderRoot = vm.renderRoot,
4845
5127
  remove = vm.renderer.remove;
4846
- for (var _i30 = 0, len = children.length; _i30 < len; _i30++) {
4847
- var child = children[_i30];
5128
+ for (var _i32 = 0, len = children.length; _i32 < len; _i32++) {
5129
+ var child = children[_i32];
4848
5130
  if (!isNull(child) && !isUndefined$1(child.elm)) {
4849
5131
  remove(child.elm, renderRoot);
4850
5132
  }
@@ -4904,254 +5186,153 @@
4904
5186
  * SPDX-License-Identifier: MIT
4905
5187
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4906
5188
  */
4907
- var DeprecatedWiredElementHost = '$$DeprecatedWiredElementHostKey$$';
4908
- var DeprecatedWiredParamsMeta = '$$DeprecatedWiredParamsMetaKey$$';
4909
- var WireMetaMap = new Map();
4910
- var WireContextRegistrationEvent = /*#__PURE__*/function (_CustomEvent) {
4911
- _inherits(WireContextRegistrationEvent, _CustomEvent);
4912
- var _super4 = _createSuper(WireContextRegistrationEvent);
4913
- function WireContextRegistrationEvent(adapterToken, _ref4) {
4914
- var _this2;
4915
- var setNewContext = _ref4.setNewContext,
4916
- setDisconnectedCallback = _ref4.setDisconnectedCallback;
4917
- _classCallCheck(this, WireContextRegistrationEvent);
4918
- _this2 = _super4.call(this, adapterToken, {
4919
- bubbles: true,
4920
- composed: true
4921
- });
4922
- defineProperties(_assertThisInitialized(_this2), {
4923
- setNewContext: {
4924
- value: setNewContext
4925
- },
4926
- setDisconnectedCallback: {
4927
- value: setDisconnectedCallback
4928
- }
4929
- });
4930
- return _this2;
5189
+ //
5190
+ // The goal of this code is to detect invalid cross-root ARIA references in synthetic shadow DOM.
5191
+ // These invalid references should be fixed before the offending components can be migrated to native shadow DOM.
5192
+ // When invalid usage is detected, we warn in dev mode and call the reporting API if enabled.
5193
+ // See: https://lwc.dev/guide/accessibility#link-ids-and-aria-attributes-from-different-templates
5194
+ //
5195
+ // Use the unpatched native getElementById/querySelectorAll rather than the synthetic one
5196
+ var getElementById = _globalThis[KEY__NATIVE_GET_ELEMENT_BY_ID];
5197
+ var querySelectorAll = _globalThis[KEY__NATIVE_QUERY_SELECTOR_ALL];
5198
+ function isSyntheticShadowRootInstance(rootNode) {
5199
+ return rootNode !== document && isTrue(rootNode.synthetic);
5200
+ }
5201
+ function reportViolation(source, target, attrName) {
5202
+ // The vm is either for the source, the target, or both. Either one or both must be using synthetic
5203
+ // shadow for a violation to be detected.
5204
+ var vm = getAssociatedVMIfPresent(source.getRootNode().host);
5205
+ if (isUndefined$1(vm)) {
5206
+ vm = getAssociatedVMIfPresent(target.getRootNode().host);
5207
+ }
5208
+ if (isUndefined$1(vm)) {
5209
+ // vm should never be undefined here, but just to be safe, bail out and don't report
5210
+ return;
4931
5211
  }
4932
- return _createClass(WireContextRegistrationEvent);
4933
- }( /*#__PURE__*/_wrapNativeSuper(CustomEvent));
4934
- function createFieldDataCallback(vm, name) {
4935
- return function (value) {
4936
- updateComponentValue(vm, name, value);
4937
- };
4938
- }
4939
- function createMethodDataCallback(vm, method) {
4940
- return function (value) {
4941
- // dispatching new value into the wired method
4942
- runWithBoundaryProtection(vm, vm.owner, noop, function () {
4943
- // job
4944
- method.call(vm.component, value);
4945
- }, noop);
4946
- };
5212
+ report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */, vm);
4947
5213
  }
4948
- function createConfigWatcher(component, configCallback, callbackWhenConfigIsReady) {
4949
- var hasPendingConfig = false;
4950
- // creating the reactive observer for reactive params when needed
4951
- var ro = createReactiveObserver(function () {
4952
- if (hasPendingConfig === false) {
4953
- hasPendingConfig = true;
4954
- // collect new config in the micro-task
4955
- Promise.resolve().then(function () {
4956
- hasPendingConfig = false;
4957
- // resetting current reactive params
4958
- ro.reset();
4959
- // dispatching a new config due to a change in the configuration
4960
- computeConfigAndUpdate();
4961
- });
4962
- }
4963
- });
4964
- var computeConfigAndUpdate = function computeConfigAndUpdate() {
4965
- var config;
4966
- ro.observe(function () {
4967
- return config = configCallback(component);
4968
- });
4969
- // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
4970
- // TODO: dev-mode validation of config based on the adapter.configSchema
4971
- // @ts-ignore it is assigned in the observe() callback
4972
- callbackWhenConfigIsReady(config);
4973
- };
4974
- return {
4975
- computeConfigAndUpdate: computeConfigAndUpdate,
4976
- ro: ro
4977
- };
5214
+ function parseIdRefAttributeValue(attrValue) {
5215
+ // split on whitespace and skip empty strings after splitting
5216
+ return isString(attrValue) ? ArrayFilter.call(StringSplit.call(attrValue, /\s+/), Boolean) : [];
4978
5217
  }
4979
- function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
4980
- var adapter = wireDef.adapter;
4981
- var adapterContextToken = getAdapterToken(adapter);
4982
- if (isUndefined$1(adapterContextToken)) {
4983
- return; // no provider found, nothing to be done
5218
+ function detectSyntheticCrossRootAria(elm, attrName, attrValue) {
5219
+ var root = elm.getRootNode();
5220
+ if (!isSyntheticShadowRootInstance(root)) {
5221
+ return;
4984
5222
  }
4985
-
4986
- var elm = vm.elm,
4987
- _vm$context = vm.context,
4988
- wiredConnecting = _vm$context.wiredConnecting,
4989
- wiredDisconnecting = _vm$context.wiredDisconnecting,
4990
- dispatchEvent = vm.renderer.dispatchEvent;
4991
- // waiting for the component to be connected to formally request the context via the token
4992
- ArrayPush$1.call(wiredConnecting, function () {
4993
- // This event is responsible for connecting the host element with another
4994
- // element in the composed path that is providing contextual data. The provider
4995
- // must be listening for a special dom event with the name corresponding to the value of
4996
- // `adapterContextToken`, which will remain secret and internal to this file only to
4997
- // guarantee that the linkage can be forged.
4998
- var contextRegistrationEvent = new WireContextRegistrationEvent(adapterContextToken, {
4999
- setNewContext: function setNewContext(newContext) {
5000
- // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
5001
- // TODO: dev-mode validation of config based on the adapter.contextSchema
5002
- callbackWhenContextIsReady(newContext);
5003
- },
5004
- setDisconnectedCallback: function setDisconnectedCallback(disconnectCallback) {
5005
- // adds this callback into the disconnect bucket so it gets disconnected from parent
5006
- // the the element hosting the wire is disconnected
5007
- ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
5223
+ if (attrName === 'id') {
5224
+ // elm is the target, find the source
5225
+ if (!isString(attrValue) || attrValue.length === 0) {
5226
+ // if our id is null or empty, nobody can reference us
5227
+ return;
5228
+ }
5229
+ var _iterator5 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
5230
+ _step5;
5231
+ try {
5232
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
5233
+ var idRefAttrName = _step5.value;
5234
+ // Query all global elements with this attribute. The attribute selector syntax `~=` is for values
5235
+ // that reference multiple IDs, separated by whitespace.
5236
+ var query = "[".concat(idRefAttrName, "~=\"").concat(CSS.escape(attrValue), "\"]");
5237
+ var sourceElements = querySelectorAll.call(document, query);
5238
+ for (var _i33 = 0; _i33 < sourceElements.length; _i33++) {
5239
+ var sourceElement = sourceElements[_i33];
5240
+ var sourceRoot = sourceElement.getRootNode();
5241
+ if (sourceRoot !== root) {
5242
+ reportViolation(sourceElement, elm, idRefAttrName);
5243
+ break;
5244
+ }
5245
+ }
5008
5246
  }
5009
- });
5010
- dispatchEvent(elm, contextRegistrationEvent);
5011
- });
5012
- }
5013
- function createConnector(vm, name, wireDef) {
5014
- var method = wireDef.method,
5015
- adapter = wireDef.adapter,
5016
- configCallback = wireDef.configCallback,
5017
- dynamic = wireDef.dynamic;
5018
- var debugInfo;
5019
- var fieldOrMethodCallback = isUndefined$1(method) ? createFieldDataCallback(vm, name) : createMethodDataCallback(vm, method);
5020
- var dataCallback = function dataCallback(value) {
5021
- fieldOrMethodCallback(value);
5022
- };
5023
- var context;
5024
- var connector;
5025
- // Workaround to pass the component element associated to this wire adapter instance.
5026
- defineProperty(dataCallback, DeprecatedWiredElementHost, {
5027
- value: vm.elm
5028
- });
5029
- defineProperty(dataCallback, DeprecatedWiredParamsMeta, {
5030
- value: dynamic
5031
- });
5032
- runWithBoundaryProtection(vm, vm, noop, function () {
5033
- // job
5034
- connector = new adapter(dataCallback);
5035
- }, noop);
5036
- var updateConnectorConfig = function updateConnectorConfig(config) {
5037
- // every time the config is recomputed due to tracking,
5038
- // this callback will be invoked with the new computed config
5039
- runWithBoundaryProtection(vm, vm, noop, function () {
5040
- // job
5041
- if ("production" !== 'production') ;
5042
- connector.update(config, context);
5043
- }, noop);
5044
- };
5045
- // Computes the current wire config and calls the update method on the wire adapter.
5046
- // If it has params, we will need to observe changes in the next tick.
5047
- var _createConfigWatcher = createConfigWatcher(vm.component, configCallback, updateConnectorConfig),
5048
- computeConfigAndUpdate = _createConfigWatcher.computeConfigAndUpdate,
5049
- ro = _createConfigWatcher.ro;
5050
- // if the adapter needs contextualization, we need to watch for new context and push it alongside the config
5051
- if (!isUndefined$1(adapter.contextSchema)) {
5052
- createContextWatcher(vm, wireDef, function (newContext) {
5053
- // every time the context is pushed into this component,
5054
- // this callback will be invoked with the new computed context
5055
- if (context !== newContext) {
5056
- context = newContext;
5057
- // Note: when new context arrives, the config will be recomputed and pushed along side the new
5058
- // context, this is to preserve the identity characteristics, config should not have identity
5059
- // (ever), while context can have identity
5060
- if (vm.state === 1 /* VMState.connected */) {
5061
- computeConfigAndUpdate();
5247
+ } catch (err) {
5248
+ _iterator5.e(err);
5249
+ } finally {
5250
+ _iterator5.f();
5251
+ }
5252
+ } else {
5253
+ // elm is the source, find the target
5254
+ var ids = parseIdRefAttributeValue(attrValue);
5255
+ var _iterator6 = _createForOfIteratorHelper(ids),
5256
+ _step6;
5257
+ try {
5258
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
5259
+ var id = _step6.value;
5260
+ var target = getElementById.call(document, id);
5261
+ if (!isNull(target)) {
5262
+ var targetRoot = target.getRootNode();
5263
+ if (targetRoot !== root) {
5264
+ // target element's shadow root is not the same as ours
5265
+ reportViolation(elm, target, attrName);
5266
+ }
5062
5267
  }
5063
5268
  }
5064
- });
5065
- }
5066
- return {
5067
- // @ts-ignore the boundary protection executes sync, connector is always defined
5068
- connector: connector,
5069
- computeConfigAndUpdate: computeConfigAndUpdate,
5070
- resetConfigWatcher: function resetConfigWatcher() {
5071
- return ro.reset();
5269
+ } catch (err) {
5270
+ _iterator6.e(err);
5271
+ } finally {
5272
+ _iterator6.f();
5072
5273
  }
5073
- };
5074
- }
5075
- var AdapterToTokenMap = new Map();
5076
- function getAdapterToken(adapter) {
5077
- return AdapterToTokenMap.get(adapter);
5078
- }
5079
- function setAdapterToken(adapter, token) {
5080
- AdapterToTokenMap.set(adapter, token);
5081
- }
5082
- function storeWiredMethodMeta(descriptor, adapter, configCallback, dynamic) {
5083
- // support for callable adapters
5084
- if (adapter.adapter) {
5085
- adapter = adapter.adapter;
5086
5274
  }
5087
- var method = descriptor.value;
5088
- var def = {
5089
- adapter: adapter,
5090
- method: method,
5091
- configCallback: configCallback,
5092
- dynamic: dynamic
5093
- };
5094
- WireMetaMap.set(descriptor, def);
5095
5275
  }
5096
- function storeWiredFieldMeta(descriptor, adapter, configCallback, dynamic) {
5097
- // support for callable adapters
5098
- if (adapter.adapter) {
5099
- adapter = adapter.adapter;
5276
+ var enabled = false;
5277
+ // We want to avoid patching globals whenever possible, so this should be tree-shaken out in prod-mode and if
5278
+ // reporting is not enabled. It should also only run once
5279
+ function enableDetection() {
5280
+ if (enabled) {
5281
+ return; // don't double-apply the patches
5100
5282
  }
5101
- var def = {
5102
- adapter: adapter,
5103
- configCallback: configCallback,
5104
- dynamic: dynamic
5105
- };
5106
- WireMetaMap.set(descriptor, def);
5107
- }
5108
- function installWireAdapters(vm) {
5109
- var context = vm.context,
5110
- wire = vm.def.wire;
5111
- var wiredConnecting = context.wiredConnecting = [];
5112
- var wiredDisconnecting = context.wiredDisconnecting = [];
5113
- for (var fieldNameOrMethod in wire) {
5114
- var descriptor = wire[fieldNameOrMethod];
5115
- var wireDef = WireMetaMap.get(descriptor);
5116
- if (!isUndefined$1(wireDef)) {
5117
- (function () {
5118
- var _createConnector = createConnector(vm, fieldNameOrMethod, wireDef),
5119
- connector = _createConnector.connector,
5120
- computeConfigAndUpdate = _createConnector.computeConfigAndUpdate,
5121
- resetConfigWatcher = _createConnector.resetConfigWatcher;
5122
- var hasDynamicParams = wireDef.dynamic.length > 0;
5123
- ArrayPush$1.call(wiredConnecting, function () {
5124
- connector.connect();
5125
- if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
5126
- if (hasDynamicParams) {
5127
- Promise.resolve().then(computeConfigAndUpdate);
5128
- return;
5129
- }
5130
- }
5131
- computeConfigAndUpdate();
5132
- });
5133
- ArrayPush$1.call(wiredDisconnecting, function () {
5134
- connector.disconnect();
5135
- resetConfigWatcher();
5136
- });
5137
- })();
5283
+
5284
+ enabled = true;
5285
+ var _setAttribute = Element.prototype.setAttribute;
5286
+ // Detect calling `setAttribute` to set an idref or an id
5287
+ assign(Element.prototype, {
5288
+ setAttribute: function setAttribute(attrName, attrValue) {
5289
+ _setAttribute.call(this, attrName, attrValue);
5290
+ if (attrName === 'id' || ID_REFERENCING_ATTRIBUTES_SET.has(attrName)) {
5291
+ detectSyntheticCrossRootAria(this, attrName, attrValue);
5292
+ }
5293
+ }
5294
+ });
5295
+ // Detect `elm.id = 'foo'`
5296
+ var idDescriptor = getOwnPropertyDescriptor$1(Element.prototype, 'id');
5297
+ if (!isUndefined$1(idDescriptor)) {
5298
+ var _get3 = idDescriptor.get,
5299
+ _set3 = idDescriptor.set;
5300
+ // These should always be a getter and a setter, but if someone is monkeying with the global descriptor, ignore it
5301
+ if (isFunction$1(_get3) && isFunction$1(_set3)) {
5302
+ defineProperty(Element.prototype, 'id', {
5303
+ get: function get() {
5304
+ return _get3.call(this);
5305
+ },
5306
+ set: function set(value) {
5307
+ _set3.call(this, value);
5308
+ detectSyntheticCrossRootAria(this, 'id', value);
5309
+ },
5310
+ // On the default descriptor for 'id', enumerable and configurable are true
5311
+ enumerable: true,
5312
+ configurable: true
5313
+ });
5138
5314
  }
5139
5315
  }
5140
5316
  }
5141
- function connectWireAdapters(vm) {
5142
- var wiredConnecting = vm.context.wiredConnecting;
5143
- for (var _i31 = 0, len = wiredConnecting.length; _i31 < len; _i31 += 1) {
5144
- wiredConnecting[_i31]();
5145
- }
5317
+ // Our detection logic relies on some modern browser features. We can just skip reporting the data
5318
+ // for unsupported browsers
5319
+ function supportsCssEscape() {
5320
+ return typeof CSS !== 'undefined' && isFunction$1(CSS.escape);
5146
5321
  }
5147
- function disconnectWireAdapters(vm) {
5148
- var wiredDisconnecting = vm.context.wiredDisconnecting;
5149
- runWithBoundaryProtection(vm, vm, noop, function () {
5150
- // job
5151
- for (var _i32 = 0, len = wiredDisconnecting.length; _i32 < len; _i32 += 1) {
5152
- wiredDisconnecting[_i32]();
5153
- }
5154
- }, noop);
5322
+ // If this page is not using synthetic shadow, then we don't need to install detection. Note
5323
+ // that we are assuming synthetic shadow is loaded before LWC.
5324
+ function isSyntheticShadowLoaded() {
5325
+ // We should probably be calling `renderer.isSyntheticShadowDefined`, but 1) we don't have access to the renderer,
5326
+ // and 2) this code needs to run in @lwc/engine-core, so it can access `logWarn()` and `report()`.
5327
+ return hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
5328
+ }
5329
+ // Detecting cross-root ARIA in synthetic shadow only makes sense for the browser
5330
+ if (supportsCssEscape() && isSyntheticShadowLoaded()) {
5331
+ // Always run detection in dev mode, so we can at least print to the console
5332
+ {
5333
+ // In prod mode, only enable detection if reporting is enabled
5334
+ onReportingEnabled(enableDetection);
5335
+ }
5155
5336
  }
5156
5337
 
5157
5338
  /*
@@ -5359,8 +5540,8 @@
5359
5540
  var nextNode = node;
5360
5541
  var anchor = null;
5361
5542
  var renderer = owner.renderer;
5362
- for (var _i33 = 0; _i33 < children.length; _i33++) {
5363
- var childVnode = children[_i33];
5543
+ for (var _i34 = 0; _i34 < children.length; _i34++) {
5544
+ var childVnode = children[_i34];
5364
5545
  if (!isNull(childVnode)) {
5365
5546
  if (nextNode) {
5366
5547
  nextNode = hydrateNode(nextNode, childVnode, renderer);
@@ -5421,8 +5602,8 @@
5421
5602
  var nodesAreCompatible = true;
5422
5603
  // Validate attributes, though we could always recovery from those by running the update mods.
5423
5604
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
5424
- for (var _i34 = 0, _Object$entries = Object.entries(attrs); _i34 < _Object$entries.length; _i34++) {
5425
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i34], 2),
5605
+ for (var _i35 = 0, _Object$entries = Object.entries(attrs); _i35 < _Object$entries.length; _i35++) {
5606
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i35], 2),
5426
5607
  attrName = _Object$entries$_i[0],
5427
5608
  attrValue = _Object$entries$_i[1];
5428
5609
  vnode.owner;
@@ -5509,8 +5690,8 @@
5509
5690
  var parsedVnodeStyle = parseStyleText(elmStyle);
5510
5691
  var expectedStyle = [];
5511
5692
  // styleMap is used when style is set to static value.
5512
- for (var _i35 = 0, n = styleDecls.length; _i35 < n; _i35++) {
5513
- var _styleDecls$_i2 = _slicedToArray(styleDecls[_i35], 3),
5693
+ for (var _i36 = 0, n = styleDecls.length; _i36 < n; _i36++) {
5694
+ var _styleDecls$_i2 = _slicedToArray(styleDecls[_i36], 3),
5514
5695
  prop = _styleDecls$_i2[0],
5515
5696
  value = _styleDecls$_i2[1],
5516
5697
  important = _styleDecls$_i2[2];
@@ -5584,8 +5765,8 @@
5584
5765
  // Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
5585
5766
  function traverseStylesheets(stylesheets, callback) {
5586
5767
  callback(stylesheets);
5587
- for (var _i36 = 0; _i36 < stylesheets.length; _i36++) {
5588
- var stylesheet = stylesheets[_i36];
5768
+ for (var _i37 = 0; _i37 < stylesheets.length; _i37++) {
5769
+ var stylesheet = stylesheets[_i37];
5589
5770
  if (isArray$1(stylesheet)) {
5590
5771
  traverseStylesheets(stylesheet, callback);
5591
5772
  } else {
@@ -6246,17 +6427,17 @@
6246
6427
  function flushPendingWhenDefinedCallbacks(tagName, ctor) {
6247
6428
  var resolvers = pendingWhenDefinedCallbacks.get(tagName);
6248
6429
  if (!isUndefined$1(resolvers)) {
6249
- var _iterator7 = _createForOfIteratorHelper(resolvers),
6250
- _step7;
6430
+ var _iterator10 = _createForOfIteratorHelper(resolvers),
6431
+ _step10;
6251
6432
  try {
6252
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
6253
- var resolver = _step7.value;
6433
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
6434
+ var resolver = _step10.value;
6254
6435
  resolver(ctor);
6255
6436
  }
6256
6437
  } catch (err) {
6257
- _iterator7.e(err);
6438
+ _iterator10.e(err);
6258
6439
  } finally {
6259
- _iterator7.f();
6440
+ _iterator10.f();
6260
6441
  }
6261
6442
  }
6262
6443
  pendingWhenDefinedCallbacks.delete(tagName);
@@ -6306,11 +6487,11 @@
6306
6487
  var awaiting = awaitingUpgrade.get(tagName);
6307
6488
  if (!isUndefined$1(awaiting)) {
6308
6489
  awaitingUpgrade.delete(tagName);
6309
- var _iterator8 = _createForOfIteratorHelper(awaiting),
6310
- _step8;
6490
+ var _iterator11 = _createForOfIteratorHelper(awaiting),
6491
+ _step11;
6311
6492
  try {
6312
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
6313
- var element = _step8.value;
6493
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
6494
+ var element = _step11.value;
6314
6495
  var registeredDefinition = pendingRegistryForElement.get(element);
6315
6496
  // At this point, registeredDefinition should never be undefined because awaitingUpgrade
6316
6497
  // is only populated when we haven't run internalUpgrade yet, and we only populate
@@ -6322,9 +6503,9 @@
6322
6503
  }
6323
6504
  }
6324
6505
  } catch (err) {
6325
- _iterator8.e(err);
6506
+ _iterator11.e(err);
6326
6507
  } finally {
6327
- _iterator8.f();
6508
+ _iterator11.f();
6328
6509
  }
6329
6510
  }
6330
6511
  // If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
@@ -6601,7 +6782,7 @@
6601
6782
  function isNull(obj) {
6602
6783
  return obj === null;
6603
6784
  }
6604
- /** version: 2.34.0 */
6785
+ /** version: 2.35.1 */
6605
6786
 
6606
6787
  /*
6607
6788
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6660,17 +6841,17 @@
6660
6841
  exports.createFragment = function (html) {
6661
6842
  var wrapperTags = topLevelWrappingMap[getTagName(html)];
6662
6843
  if (!isUndefined(wrapperTags)) {
6663
- var _iterator9 = _createForOfIteratorHelper(wrapperTags),
6664
- _step9;
6844
+ var _iterator12 = _createForOfIteratorHelper(wrapperTags),
6845
+ _step12;
6665
6846
  try {
6666
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
6667
- var wrapperTag = _step9.value;
6847
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
6848
+ var wrapperTag = _step12.value;
6668
6849
  html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
6669
6850
  }
6670
6851
  } catch (err) {
6671
- _iterator9.e(err);
6852
+ _iterator12.e(err);
6672
6853
  } finally {
6673
- _iterator9.f();
6854
+ _iterator12.f();
6674
6855
  }
6675
6856
  }
6676
6857
  // For IE11, the document title must not be undefined, but it can be an empty string
@@ -6679,7 +6860,7 @@
6679
6860
  doc.body.innerHTML = html;
6680
6861
  var content = doc.body;
6681
6862
  if (!isUndefined(wrapperTags)) {
6682
- for (var _i37 = 0; _i37 < wrapperTags.length; _i37++) {
6863
+ for (var _i38 = 0; _i38 < wrapperTags.length; _i38++) {
6683
6864
  content = content.firstChild;
6684
6865
  }
6685
6866
  }
@@ -6872,8 +7053,8 @@
6872
7053
  tagName: element.tagName.toLowerCase(),
6873
7054
  hydrated: true
6874
7055
  });
6875
- for (var _i38 = 0, _Object$entries2 = Object.entries(props); _i38 < _Object$entries2.length; _i38++) {
6876
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i38], 2),
7056
+ for (var _i39 = 0, _Object$entries2 = Object.entries(props); _i39 < _Object$entries2.length; _i39++) {
7057
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i39], 2),
6877
7058
  key = _Object$entries2$_i[0],
6878
7059
  value = _Object$entries2$_i[1];
6879
7060
  element[key] = value;
@@ -7160,10 +7341,11 @@
7160
7341
  });
7161
7342
  freeze(LightningElement);
7162
7343
  seal(LightningElement.prototype);
7163
- /* version: 2.34.0 */
7344
+ /* version: 2.35.1 */
7164
7345
 
7165
7346
  exports.LightningElement = LightningElement;
7166
7347
  exports.__unstable__ProfilerControl = profilerControl;
7348
+ exports.__unstable__ReportingControl = reportingControl;
7167
7349
  exports.api = api$1;
7168
7350
  exports.buildCustomElementConstructor = deprecatedBuildCustomElementConstructor;
7169
7351
  exports.createContextProvider = createContextProvider;