lwc 2.35.2 → 2.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +245 -89
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +245 -89
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +273 -45
  5. package/dist/engine-dom/iife/es5/engine-dom.js +402 -232
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +449 -161
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +245 -89
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +273 -45
  11. package/dist/engine-dom/umd/es5/engine-dom.js +402 -232
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +449 -161
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +124 -77
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +124 -77
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
  20. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  22. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
  24. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  25. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  26. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  27. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  28. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  29. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  30. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  31. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  34. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  35. package/package.json +7 -7
@@ -86,13 +86,18 @@ var LWC = (function (exports) {
86
86
  setPrototypeOf = Object.setPrototypeOf;
87
87
  var isArray$1 = Array.isArray;
88
88
  var _Array$prototype = Array.prototype,
89
+ ArrayCopyWithin = _Array$prototype.copyWithin,
90
+ ArrayFill = _Array$prototype.fill,
89
91
  ArrayFilter = _Array$prototype.filter,
90
92
  ArrayIndexOf = _Array$prototype.indexOf,
91
93
  ArrayJoin = _Array$prototype.join,
92
94
  ArrayMap = _Array$prototype.map,
93
95
  ArrayPop = _Array$prototype.pop,
94
96
  ArrayPush$1 = _Array$prototype.push,
97
+ ArrayReverse = _Array$prototype.reverse,
98
+ ArrayShift = _Array$prototype.shift,
95
99
  ArraySlice = _Array$prototype.slice,
100
+ ArraySort = _Array$prototype.sort,
96
101
  ArraySplice = _Array$prototype.splice,
97
102
  ArrayUnshift = _Array$prototype.unshift,
98
103
  forEach = _Array$prototype.forEach;
@@ -310,7 +315,7 @@ var LWC = (function (exports) {
310
315
  CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
311
316
  return propertyName;
312
317
  }
313
- /** version: 2.35.2 */
318
+ /** version: 2.36.0 */
314
319
 
315
320
  /**
316
321
  * Copyright (C) 2018 salesforce.com, inc.
@@ -382,7 +387,7 @@ var LWC = (function (exports) {
382
387
  */
383
388
  function setFeatureFlagForTest(name, value) {
384
389
  }
385
- /** version: 2.35.2 */
390
+ /** version: 2.36.0 */
386
391
 
387
392
  /**
388
393
  * Copyright (C) 2018 salesforce.com, inc.
@@ -446,7 +451,7 @@ var LWC = (function (exports) {
446
451
  }
447
452
  }
448
453
  }
449
- /** version: 2.35.2 */
454
+ /** version: 2.36.0 */
450
455
 
451
456
  /*
452
457
  * Copyright (c) 2018, salesforce.com, inc.
@@ -466,7 +471,6 @@ var LWC = (function (exports) {
466
471
  * SPDX-License-Identifier: MIT
467
472
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
468
473
  */
469
- /** Callbacks to invoke when reporting is enabled **/
470
474
  var onReportingEnabledCallbacks = [];
471
475
  /** The currently assigned reporting dispatcher. */
472
476
  var currentDispatcher$1 = noop;
@@ -523,11 +527,11 @@ var LWC = (function (exports) {
523
527
  /**
524
528
  * Report to the current dispatcher, if there is one.
525
529
  * @param reportingEventId
526
- * @param vm
530
+ * @param payload - data to report
527
531
  */
528
- function report(reportingEventId, vm) {
532
+ function report(reportingEventId, payload) {
529
533
  if (enabled$1) {
530
- currentDispatcher$1(reportingEventId, vm.tagName, vm.idx);
534
+ currentDispatcher$1(reportingEventId, payload);
531
535
  }
532
536
  }
533
537
 
@@ -791,31 +795,39 @@ var LWC = (function (exports) {
791
795
  // Make a shallow copy of an object but omit the given key
792
796
  function cloneAndOmitKey(object, keyToOmit) {
793
797
  var result = {};
794
- for (var _i7 = 0, _Object$keys = Object.keys(object); _i7 < _Object$keys.length; _i7++) {
795
- var key = _Object$keys[_i7];
796
- if (key !== keyToOmit) {
797
- result[key] = object[key];
798
+ var _iterator2 = _createForOfIteratorHelper(keys(object)),
799
+ _step2;
800
+ try {
801
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
802
+ var key = _step2.value;
803
+ if (key !== keyToOmit) {
804
+ result[key] = object[key];
805
+ }
798
806
  }
807
+ } catch (err) {
808
+ _iterator2.e(err);
809
+ } finally {
810
+ _iterator2.f();
799
811
  }
800
812
  return result;
801
813
  }
802
814
  function flattenStylesheets(stylesheets) {
803
815
  var list = [];
804
- var _iterator2 = _createForOfIteratorHelper(stylesheets),
805
- _step2;
816
+ var _iterator3 = _createForOfIteratorHelper(stylesheets),
817
+ _step3;
806
818
  try {
807
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
808
- var stylesheet = _step2.value;
809
- if (!Array.isArray(stylesheet)) {
819
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
820
+ var stylesheet = _step3.value;
821
+ if (!isArray$1(stylesheet)) {
810
822
  list.push(stylesheet);
811
823
  } else {
812
824
  list.push.apply(list, _toConsumableArray(flattenStylesheets(stylesheet)));
813
825
  }
814
826
  }
815
827
  } catch (err) {
816
- _iterator2.e(err);
828
+ _iterator3.e(err);
817
829
  } finally {
818
- _iterator2.f();
830
+ _iterator3.f();
819
831
  }
820
832
  return list;
821
833
  }
@@ -1717,17 +1729,17 @@ var LWC = (function (exports) {
1717
1729
  var refs = refsCache.get(refVNodes);
1718
1730
  if (isUndefined$1(refs)) {
1719
1731
  refs = create(null);
1720
- var _iterator3 = _createForOfIteratorHelper(keys(refVNodes)),
1721
- _step3;
1732
+ var _iterator4 = _createForOfIteratorHelper(keys(refVNodes)),
1733
+ _step4;
1722
1734
  try {
1723
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1724
- var key = _step3.value;
1735
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1736
+ var key = _step4.value;
1725
1737
  refs[key] = refVNodes[key].elm;
1726
1738
  }
1727
1739
  } catch (err) {
1728
- _iterator3.e(err);
1740
+ _iterator4.e(err);
1729
1741
  } finally {
1730
- _iterator3.f();
1742
+ _iterator4.f();
1731
1743
  }
1732
1744
  freeze(refs);
1733
1745
  refsCache.set(refVNodes, refs);
@@ -1791,7 +1803,7 @@ var LWC = (function (exports) {
1791
1803
  var queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
1792
1804
  // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
1793
1805
  var _loop = function _loop() {
1794
- var queryMethod = _queryMethods[_i8];
1806
+ var queryMethod = _queryMethods[_i7];
1795
1807
  queryAndChildGetterDescriptors[queryMethod] = {
1796
1808
  value: function value(arg) {
1797
1809
  var vm = getAssociatedVM(this);
@@ -1804,7 +1816,7 @@ var LWC = (function (exports) {
1804
1816
  writable: true
1805
1817
  };
1806
1818
  };
1807
- for (var _i8 = 0, _queryMethods = queryMethods; _i8 < _queryMethods.length; _i8++) {
1819
+ for (var _i7 = 0, _queryMethods = queryMethods; _i7 < _queryMethods.length; _i7++) {
1808
1820
  _loop();
1809
1821
  }
1810
1822
  defineProperties(LightningElement.prototype, queryAndChildGetterDescriptors);
@@ -2090,16 +2102,16 @@ var LWC = (function (exports) {
2090
2102
  }
2091
2103
  function connectWireAdapters(vm) {
2092
2104
  var wiredConnecting = vm.context.wiredConnecting;
2093
- for (var _i9 = 0, len = wiredConnecting.length; _i9 < len; _i9 += 1) {
2094
- wiredConnecting[_i9]();
2105
+ for (var _i8 = 0, len = wiredConnecting.length; _i8 < len; _i8 += 1) {
2106
+ wiredConnecting[_i8]();
2095
2107
  }
2096
2108
  }
2097
2109
  function disconnectWireAdapters(vm) {
2098
2110
  var wiredDisconnecting = vm.context.wiredDisconnecting;
2099
2111
  runWithBoundaryProtection(vm, vm, noop, function () {
2100
2112
  // job
2101
- for (var _i10 = 0, len = wiredDisconnecting.length; _i10 < len; _i10 += 1) {
2102
- wiredDisconnecting[_i10]();
2113
+ for (var _i9 = 0, len = wiredDisconnecting.length; _i9 < len; _i9 += 1) {
2114
+ wiredDisconnecting[_i9]();
2103
2115
  }
2104
2116
  }, noop);
2105
2117
  }
@@ -2301,8 +2313,8 @@ var LWC = (function (exports) {
2301
2313
  }
2302
2314
  }
2303
2315
  if (!isUndefined$1(fields)) {
2304
- for (var _i11 = 0, n = fields.length; _i11 < n; _i11++) {
2305
- var _fieldName2 = fields[_i11];
2316
+ for (var _i10 = 0, n = fields.length; _i10 < n; _i10++) {
2317
+ var _fieldName2 = fields[_i10];
2306
2318
  descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
2307
2319
  // [W-9927596] Only mark a field as observed whenever it isn't a duplicated public nor
2308
2320
  // tracked property. This is only here for backward compatibility purposes.
@@ -2483,8 +2495,8 @@ var LWC = (function (exports) {
2483
2495
  superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
2484
2496
  var descriptors = create(null);
2485
2497
  // expose getters and setters for each public props on the new Element Bridge
2486
- for (var _i12 = 0, len = props.length; _i12 < len; _i12 += 1) {
2487
- var _propName = props[_i12];
2498
+ for (var _i11 = 0, len = props.length; _i11 < len; _i11 += 1) {
2499
+ var _propName = props[_i11];
2488
2500
  attributeToPropMap[htmlPropertyToAttribute(_propName)] = _propName;
2489
2501
  descriptors[_propName] = {
2490
2502
  get: createGetter(_propName),
@@ -2494,8 +2506,8 @@ var LWC = (function (exports) {
2494
2506
  };
2495
2507
  }
2496
2508
  // expose public methods as props on the new Element Bridge
2497
- for (var _i13 = 0, _len = methods.length; _i13 < _len; _i13 += 1) {
2498
- var methodName = methods[_i13];
2509
+ for (var _i12 = 0, _len = methods.length; _i12 < _len; _i12 += 1) {
2510
+ var methodName = methods[_i12];
2499
2511
  descriptors[methodName] = {
2500
2512
  value: createMethodCaller(methodName),
2501
2513
  writable: true,
@@ -2863,8 +2875,8 @@ var LWC = (function (exports) {
2863
2875
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
2864
2876
  var content = [];
2865
2877
  var root;
2866
- for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
2867
- var stylesheet = stylesheets[_i14];
2878
+ for (var _i13 = 0; _i13 < stylesheets.length; _i13++) {
2879
+ var stylesheet = stylesheets[_i13];
2868
2880
  if (isArray$1(stylesheet)) {
2869
2881
  ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
2870
2882
  } else {
@@ -2964,8 +2976,8 @@ var LWC = (function (exports) {
2964
2976
  shadowMode = vm.shadowMode,
2965
2977
  insertStylesheet = vm.renderer.insertStylesheet;
2966
2978
  if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
2967
- for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
2968
- insertStylesheet(stylesheets[_i15]);
2979
+ for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
2980
+ insertStylesheet(stylesheets[_i14]);
2969
2981
  }
2970
2982
  } else if (vm.hydrated) {
2971
2983
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
@@ -2978,8 +2990,8 @@ var LWC = (function (exports) {
2978
2990
  var root = getNearestNativeShadowComponent(vm);
2979
2991
  // null root means a global style
2980
2992
  var target = isNull(root) ? undefined : root.shadowRoot;
2981
- for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
2982
- insertStylesheet(stylesheets[_i16], target);
2993
+ for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
2994
+ insertStylesheet(stylesheets[_i15], target);
2983
2995
  }
2984
2996
  }
2985
2997
  return null;
@@ -3281,8 +3293,8 @@ var LWC = (function (exports) {
3281
3293
  return;
3282
3294
  }
3283
3295
  var setCSSStyleProperty = renderer.setCSSStyleProperty;
3284
- for (var _i17 = 0; _i17 < styleDecls.length; _i17++) {
3285
- var _styleDecls$_i = _slicedToArray(styleDecls[_i17], 3),
3296
+ for (var _i16 = 0; _i16 < styleDecls.length; _i16++) {
3297
+ var _styleDecls$_i = _slicedToArray(styleDecls[_i16], 3),
3286
3298
  prop = _styleDecls$_i[0],
3287
3299
  value = _styleDecls$_i[1],
3288
3300
  important = _styleDecls$_i[2];
@@ -3705,8 +3717,8 @@ var LWC = (function (exports) {
3705
3717
  // If no VFragment is found in children, we don't need to traverse anything or mark the children dynamic and can return early.
3706
3718
  var nodeStack = [];
3707
3719
  var fragmentFound = false;
3708
- for (var _i18 = children.length - 1; _i18 > -1; _i18 -= 1) {
3709
- var child = children[_i18];
3720
+ for (var _i17 = children.length - 1; _i17 > -1; _i17 -= 1) {
3721
+ var child = children[_i17];
3710
3722
  ArrayPush$1.call(nodeStack, child);
3711
3723
  fragmentFound = fragmentFound || !!(child && isVFragment(child));
3712
3724
  }
@@ -3718,8 +3730,8 @@ var LWC = (function (exports) {
3718
3730
  if (!isNull(currentNode) && isVFragment(currentNode)) {
3719
3731
  var fChildren = currentNode.children;
3720
3732
  // Ignore the start and end text node delimiters
3721
- for (var _i19 = fChildren.length - 2; _i19 > 0; _i19 -= 1) {
3722
- ArrayPush$1.call(nodeStack, fChildren[_i19]);
3733
+ for (var _i18 = fChildren.length - 2; _i18 > 0; _i18 -= 1) {
3734
+ ArrayPush$1.call(nodeStack, fChildren[_i18]);
3723
3735
  }
3724
3736
  } else {
3725
3737
  ArrayPush$1.call(flattenedChildren, currentNode);
@@ -3755,8 +3767,8 @@ var LWC = (function (exports) {
3755
3767
  var oldSlotsMapping = vm.cmpSlots.slotAssignments;
3756
3768
  var cmpSlotsMapping = create(null);
3757
3769
  // Collect all slots into cmpSlotsMapping
3758
- for (var _i20 = 0, len = children.length; _i20 < len; _i20 += 1) {
3759
- var vnode = children[_i20];
3770
+ for (var _i19 = 0, len = children.length; _i19 < len; _i19 += 1) {
3771
+ var vnode = children[_i19];
3760
3772
  if (isNull(vnode)) {
3761
3773
  continue;
3762
3774
  }
@@ -3766,7 +3778,12 @@ var LWC = (function (exports) {
3766
3778
  } else if (isVScopedSlotFragment(vnode)) {
3767
3779
  slotName = vnode.slotName;
3768
3780
  }
3769
- var vnodes = cmpSlotsMapping[slotName] = cmpSlotsMapping[slotName] || [];
3781
+ // Can't use toString here because Symbol(1).toString() is 'Symbol(1)'
3782
+ // but elm.setAttribute('slot', Symbol(1)) is an error.
3783
+ // the following line also throws same error for symbols
3784
+ // Similar for Object.create(null)
3785
+ var normalizedSlotName = '' + slotName;
3786
+ var vnodes = cmpSlotsMapping[normalizedSlotName] = cmpSlotsMapping[normalizedSlotName] || [];
3770
3787
  ArrayPush$1.call(vnodes, vnode);
3771
3788
  }
3772
3789
  vm.cmpSlots = {
@@ -3781,8 +3798,8 @@ var LWC = (function (exports) {
3781
3798
  markComponentAsDirty(vm);
3782
3799
  return;
3783
3800
  }
3784
- for (var _i21 = 0, _len2 = oldKeys.length; _i21 < _len2; _i21 += 1) {
3785
- var key = oldKeys[_i21];
3801
+ for (var _i20 = 0, _len2 = oldKeys.length; _i20 < _len2; _i20 += 1) {
3802
+ var key = oldKeys[_i20];
3786
3803
  if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
3787
3804
  markComponentAsDirty(vm);
3788
3805
  return;
@@ -3905,11 +3922,11 @@ var LWC = (function (exports) {
3905
3922
  if (oldStartIdx > oldEndIdx) {
3906
3923
  // There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
3907
3924
  // already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
3908
- var _i22 = newEndIdx;
3925
+ var _i21 = newEndIdx;
3909
3926
  var n;
3910
3927
  do {
3911
- n = newCh[++_i22];
3912
- } while (!isVNode(n) && _i22 < newChEnd);
3928
+ n = newCh[++_i21];
3929
+ } while (!isVNode(n) && _i21 < newChEnd);
3913
3930
  before = isVNode(n) ? n.elm : null;
3914
3931
  mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
3915
3932
  } else {
@@ -3934,9 +3951,9 @@ var LWC = (function (exports) {
3934
3951
  // if the old list is not empty, the new list MUST have the same
3935
3952
  // amount of nodes, that's why we call this static children
3936
3953
  var anchor = null;
3937
- for (var _i23 = c2Length - 1; _i23 >= 0; _i23 -= 1) {
3938
- var n1 = c1[_i23];
3939
- var n2 = c2[_i23];
3954
+ for (var _i22 = c2Length - 1; _i22 >= 0; _i22 -= 1) {
3955
+ var n1 = c1[_i22];
3956
+ var n2 = c2[_i22];
3940
3957
  if (n2 !== n1) {
3941
3958
  if (isVNode(n1)) {
3942
3959
  if (isVNode(n2)) {
@@ -4033,8 +4050,8 @@ var LWC = (function (exports) {
4033
4050
  if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
4034
4051
  var newChildren = [];
4035
4052
  var slotAssignments = slotset.slotAssignments[slotName];
4036
- for (var _i24 = 0; _i24 < slotAssignments.length; _i24++) {
4037
- var vnode = slotAssignments[_i24];
4053
+ for (var _i23 = 0; _i23 < slotAssignments.length; _i23++) {
4054
+ var vnode = slotAssignments[_i23];
4038
4055
  if (!isNull(vnode)) {
4039
4056
  var assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
4040
4057
  // The only sniff test for a scoped <slot> element is the presence of `slotData`
@@ -4422,23 +4439,23 @@ var LWC = (function (exports) {
4422
4439
  var classAttrToken = hasScopedStyles && hasStyleToken ? " class=\"".concat(stylesheetToken, "\"") : '';
4423
4440
  var attrToken = hasStyleToken && isSyntheticShadow ? ' ' + stylesheetToken : '';
4424
4441
  var htmlFragment = '';
4425
- for (var _i25 = 0, n = keys.length; _i25 < n; _i25++) {
4426
- switch (keys[_i25]) {
4442
+ for (var _i24 = 0, n = keys.length; _i24 < n; _i24++) {
4443
+ switch (keys[_i24]) {
4427
4444
  case 0:
4428
4445
  // styleToken in existing class attr
4429
- htmlFragment += strings[_i25] + classToken;
4446
+ htmlFragment += strings[_i24] + classToken;
4430
4447
  break;
4431
4448
  case 1:
4432
4449
  // styleToken for added class attr
4433
- htmlFragment += strings[_i25] + classAttrToken;
4450
+ htmlFragment += strings[_i24] + classAttrToken;
4434
4451
  break;
4435
4452
  case 2:
4436
4453
  // styleToken as attr
4437
- htmlFragment += strings[_i25] + attrToken;
4454
+ htmlFragment += strings[_i24] + attrToken;
4438
4455
  break;
4439
4456
  case 3:
4440
4457
  // ${1}${2}
4441
- htmlFragment += strings[_i25] + classAttrToken + attrToken;
4458
+ htmlFragment += strings[_i24] + classAttrToken + attrToken;
4442
4459
  break;
4443
4460
  }
4444
4461
  }
@@ -4526,8 +4543,8 @@ var LWC = (function (exports) {
4526
4543
  }
4527
4544
  function computeHasScopedStylesInStylesheets(stylesheets) {
4528
4545
  if (hasStyles(stylesheets)) {
4529
- for (var _i26 = 0; _i26 < stylesheets.length; _i26++) {
4530
- if (isTrue(stylesheets[_i26][KEY__SCOPED_CSS])) {
4546
+ for (var _i25 = 0; _i25 < stylesheets.length; _i25++) {
4547
+ if (isTrue(stylesheets[_i25][KEY__SCOPED_CSS])) {
4531
4548
  return true;
4532
4549
  }
4533
4550
  }
@@ -4693,8 +4710,8 @@ var LWC = (function (exports) {
4693
4710
  * subject to change or being removed.
4694
4711
  */
4695
4712
  function register(service) {
4696
- for (var _i27 = 0; _i27 < hooks.length; ++_i27) {
4697
- var hookName = hooks[_i27];
4713
+ for (var _i26 = 0; _i26 < hooks.length; ++_i26) {
4714
+ var hookName = hooks[_i26];
4698
4715
  if (hookName in service) {
4699
4716
  var l = Services[hookName];
4700
4717
  if (isUndefined$1(l)) {
@@ -4708,8 +4725,8 @@ var LWC = (function (exports) {
4708
4725
  var component = vm.component,
4709
4726
  def = vm.def,
4710
4727
  context = vm.context;
4711
- for (var _i28 = 0, len = cbs.length; _i28 < len; ++_i28) {
4712
- cbs[_i28].call(undefined, component, {}, def, context);
4728
+ for (var _i27 = 0, len = cbs.length; _i27 < len; ++_i27) {
4729
+ cbs[_i27].call(undefined, component, {}, def, context);
4713
4730
  }
4714
4731
  }
4715
4732
 
@@ -4846,8 +4863,8 @@ var LWC = (function (exports) {
4846
4863
  var valid = true;
4847
4864
  var validate = function validate(arrayOrStylesheet) {
4848
4865
  if (isArray$1(arrayOrStylesheet)) {
4849
- for (var _i29 = 0; _i29 < arrayOrStylesheet.length; _i29++) {
4850
- validate(arrayOrStylesheet[_i29]);
4866
+ for (var _i28 = 0; _i28 < arrayOrStylesheet.length; _i28++) {
4867
+ validate(arrayOrStylesheet[_i28]);
4851
4868
  }
4852
4869
  } else if (!isFunction$1(arrayOrStylesheet)) {
4853
4870
  // function assumed to be a stylesheet factory
@@ -4982,17 +4999,17 @@ var LWC = (function (exports) {
4982
4999
  return a.idx - b.idx;
4983
5000
  });
4984
5001
  rehydrateQueue = []; // reset to a new queue
4985
- for (var _i30 = 0, len = vms.length; _i30 < len; _i30 += 1) {
4986
- var vm = vms[_i30];
5002
+ for (var _i29 = 0, len = vms.length; _i29 < len; _i29 += 1) {
5003
+ var vm = vms[_i29];
4987
5004
  try {
4988
5005
  rehydrate(vm);
4989
5006
  } catch (error) {
4990
- if (_i30 + 1 < len) {
5007
+ if (_i29 + 1 < len) {
4991
5008
  // pieces of the queue are still pending to be rehydrated, those should have priority
4992
5009
  if (rehydrateQueue.length === 0) {
4993
5010
  addCallbackToNextTick(flushRehydrationQueue);
4994
5011
  }
4995
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i30 + 1));
5012
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i29 + 1));
4996
5013
  }
4997
5014
  // we need to end the measure before throwing.
4998
5015
  logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
@@ -5058,8 +5075,8 @@ var LWC = (function (exports) {
5058
5075
  var vCustomElementCollection = vm.velements;
5059
5076
  // Reporting disconnection for every child in inverse order since they are
5060
5077
  // inserted in reserved order.
5061
- for (var _i31 = vCustomElementCollection.length - 1; _i31 >= 0; _i31 -= 1) {
5062
- var elm = vCustomElementCollection[_i31].elm;
5078
+ for (var _i30 = vCustomElementCollection.length - 1; _i30 >= 0; _i30 -= 1) {
5079
+ var elm = vCustomElementCollection[_i30].elm;
5063
5080
  // There are two cases where the element could be undefined:
5064
5081
  // * when there is an error during the construction phase, and an error
5065
5082
  // boundary picks it, there is a possibility that the VCustomElement
@@ -5090,8 +5107,8 @@ var LWC = (function (exports) {
5090
5107
  * defined on its shadow.
5091
5108
  */
5092
5109
  function recursivelyDisconnectChildren(vnodes) {
5093
- for (var _i32 = 0, len = vnodes.length; _i32 < len; _i32 += 1) {
5094
- var vnode = vnodes[_i32];
5110
+ for (var _i31 = 0, len = vnodes.length; _i31 < len; _i31 += 1) {
5111
+ var vnode = vnodes[_i31];
5095
5112
  if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
5096
5113
  switch (vnode.type) {
5097
5114
  case 2 /* VNodeType.Element */:
@@ -5115,8 +5132,8 @@ var LWC = (function (exports) {
5115
5132
  var children = vm.children,
5116
5133
  renderRoot = vm.renderRoot,
5117
5134
  remove = vm.renderer.remove;
5118
- for (var _i33 = 0, len = children.length; _i33 < len; _i33++) {
5119
- var child = children[_i33];
5135
+ for (var _i32 = 0, len = children.length; _i32 < len; _i32++) {
5136
+ var child = children[_i32];
5120
5137
  if (!isNull(child) && !isUndefined$1(child.elm)) {
5121
5138
  remove(child.elm, renderRoot);
5122
5139
  }
@@ -5188,7 +5205,7 @@ var LWC = (function (exports) {
5188
5205
  function isSyntheticShadowRootInstance(rootNode) {
5189
5206
  return rootNode !== document && isTrue(rootNode.synthetic);
5190
5207
  }
5191
- function reportViolation(source, target, attrName) {
5208
+ function reportViolation$1(source, target, attrName) {
5192
5209
  // The vm is either for the source, the target, or both. Either one or both must be using synthetic
5193
5210
  // shadow for a violation to be detected.
5194
5211
  var vm = getAssociatedVMIfPresent(source.getRootNode().host);
@@ -5199,7 +5216,10 @@ var LWC = (function (exports) {
5199
5216
  // vm should never be undefined here, but just to be safe, bail out and don't report
5200
5217
  return;
5201
5218
  }
5202
- report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */, vm);
5219
+ report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */, {
5220
+ tagName: vm.tagName,
5221
+ attributeName: attrName
5222
+ });
5203
5223
  }
5204
5224
  function parseIdRefAttributeValue(attrValue) {
5205
5225
  // split on whitespace and skip empty strings after splitting
@@ -5216,57 +5236,57 @@ var LWC = (function (exports) {
5216
5236
  // if our id is null or empty, nobody can reference us
5217
5237
  return;
5218
5238
  }
5219
- var _iterator4 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
5220
- _step4;
5239
+ var _iterator5 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
5240
+ _step5;
5221
5241
  try {
5222
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
5223
- var idRefAttrName = _step4.value;
5242
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
5243
+ var idRefAttrName = _step5.value;
5224
5244
  // Query all global elements with this attribute. The attribute selector syntax `~=` is for values
5225
5245
  // that reference multiple IDs, separated by whitespace.
5226
5246
  var query = "[".concat(idRefAttrName, "~=\"").concat(CSS.escape(attrValue), "\"]");
5227
5247
  var sourceElements = querySelectorAll.call(document, query);
5228
- for (var _i34 = 0; _i34 < sourceElements.length; _i34++) {
5229
- var sourceElement = sourceElements[_i34];
5248
+ for (var _i33 = 0; _i33 < sourceElements.length; _i33++) {
5249
+ var sourceElement = sourceElements[_i33];
5230
5250
  var sourceRoot = sourceElement.getRootNode();
5231
5251
  if (sourceRoot !== root) {
5232
- reportViolation(sourceElement, elm, idRefAttrName);
5252
+ reportViolation$1(sourceElement, elm, idRefAttrName);
5233
5253
  break;
5234
5254
  }
5235
5255
  }
5236
5256
  }
5237
5257
  } catch (err) {
5238
- _iterator4.e(err);
5258
+ _iterator5.e(err);
5239
5259
  } finally {
5240
- _iterator4.f();
5260
+ _iterator5.f();
5241
5261
  }
5242
5262
  } else {
5243
5263
  // elm is the source, find the target
5244
5264
  var ids = parseIdRefAttributeValue(attrValue);
5245
- var _iterator5 = _createForOfIteratorHelper(ids),
5246
- _step5;
5265
+ var _iterator6 = _createForOfIteratorHelper(ids),
5266
+ _step6;
5247
5267
  try {
5248
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
5249
- var id = _step5.value;
5268
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
5269
+ var id = _step6.value;
5250
5270
  var target = getElementById.call(document, id);
5251
5271
  if (!isNull(target)) {
5252
5272
  var targetRoot = target.getRootNode();
5253
5273
  if (targetRoot !== root) {
5254
5274
  // target element's shadow root is not the same as ours
5255
- reportViolation(elm, target, attrName);
5275
+ reportViolation$1(elm, target, attrName);
5256
5276
  }
5257
5277
  }
5258
5278
  }
5259
5279
  } catch (err) {
5260
- _iterator5.e(err);
5280
+ _iterator6.e(err);
5261
5281
  } finally {
5262
- _iterator5.f();
5282
+ _iterator6.f();
5263
5283
  }
5264
5284
  }
5265
5285
  }
5266
5286
  var enabled = false;
5267
5287
  // We want to avoid patching globals whenever possible, so this should be tree-shaken out in prod-mode and if
5268
5288
  // reporting is not enabled. It should also only run once
5269
- function enableDetection() {
5289
+ function enableDetection$1() {
5270
5290
  if (enabled) {
5271
5291
  return; // don't double-apply the patches
5272
5292
  }
@@ -5321,7 +5341,102 @@ var LWC = (function (exports) {
5321
5341
  // Always run detection in dev mode, so we can at least print to the console
5322
5342
  {
5323
5343
  // In prod mode, only enable detection if reporting is enabled
5324
- onReportingEnabled(enableDetection);
5344
+ onReportingEnabled(enableDetection$1);
5345
+ }
5346
+ }
5347
+
5348
+ /*
5349
+ * Copyright (c) 2018, salesforce.com, inc.
5350
+ * All rights reserved.
5351
+ * SPDX-License-Identifier: MIT
5352
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5353
+ */
5354
+ //
5355
+ // The goal of this code is to detect usages of non-standard reflected ARIA properties. These are caused by
5356
+ // legacy non-standard Element.prototype extensions added by the @lwc/aria-reflection package.
5357
+ //
5358
+ // See the README for @lwc/aria-reflection
5359
+ var NON_STANDARD_ARIA_PROPS = ['ariaActiveDescendant', 'ariaControls', 'ariaDescribedBy', 'ariaDetails', 'ariaErrorMessage', 'ariaFlowTo', 'ariaLabelledBy', 'ariaOwns'];
5360
+ function isLightningElement(elm) {
5361
+ // The former case is for `this.prop` (inside component) and the latter is for `element.prop` (outside component).
5362
+ // In both cases, we apply the non-standard prop even when the global polyfill is disabled, so this is kosher.
5363
+ return elm instanceof LightningElement || elm instanceof BaseBridgeElement;
5364
+ }
5365
+ function findVM(elm) {
5366
+ // If it's a shadow DOM component, then it has a host
5367
+ var _elm$getRootNode = elm.getRootNode(),
5368
+ host = _elm$getRootNode.host;
5369
+ var vm = isUndefined$1(host) ? undefined : getAssociatedVMIfPresent(host);
5370
+ if (!isUndefined$1(vm)) {
5371
+ return vm;
5372
+ }
5373
+ // Else it might be a light DOM component. Walk up the tree trying to find the owner
5374
+ var parentElement = elm;
5375
+ while (!isNull(parentElement = parentElement.parentElement)) {
5376
+ if (isLightningElement(parentElement)) {
5377
+ var _vm = getAssociatedVMIfPresent(parentElement);
5378
+ if (!isUndefined$1(_vm)) {
5379
+ return _vm;
5380
+ }
5381
+ }
5382
+ }
5383
+ // If we return undefined, it's because the element was rendered wholly outside a LightningElement
5384
+ }
5385
+
5386
+ function checkAndReportViolation(elm, prop) {
5387
+ if (!isLightningElement(elm)) {
5388
+ var vm = findVM(elm);
5389
+ report(2 /* ReportingEventId.NonStandardAriaReflection */, {
5390
+ tagName: vm === null || vm === void 0 ? void 0 : vm.tagName,
5391
+ propertyName: prop
5392
+ });
5393
+ }
5394
+ }
5395
+ function enableDetection() {
5396
+ var _Element = Element,
5397
+ prototype = _Element.prototype;
5398
+ var _iterator7 = _createForOfIteratorHelper(NON_STANDARD_ARIA_PROPS),
5399
+ _step7;
5400
+ try {
5401
+ var _loop3 = function _loop3() {
5402
+ var prop = _step7.value;
5403
+ var descriptor = getOwnPropertyDescriptor$1(prototype, prop);
5404
+ // The descriptor should exist because the @lwc/aria-reflection polyfill has run by now.
5405
+ // This happens automatically because of the ordering of imports.
5406
+ if ("production" !== 'production') ;
5407
+ // @ts-ignore
5408
+ var _get4 = descriptor.get,
5409
+ _set4 = descriptor.set;
5410
+ defineProperty(prototype, prop, {
5411
+ get: function get() {
5412
+ checkAndReportViolation(this, prop);
5413
+ return _get4.call(this);
5414
+ },
5415
+ set: function set(val) {
5416
+ checkAndReportViolation(this, prop);
5417
+ return _set4.call(this, val);
5418
+ },
5419
+ configurable: true,
5420
+ enumerable: true
5421
+ });
5422
+ };
5423
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
5424
+ _loop3();
5425
+ }
5426
+ } catch (err) {
5427
+ _iterator7.e(err);
5428
+ } finally {
5429
+ _iterator7.f();
5430
+ }
5431
+ }
5432
+ // No point in running this code if we're not in a browser, or if the global polyfill is not loaded
5433
+ {
5434
+ if (!lwcRuntimeFlags.DISABLE_ARIA_REFLECTION_POLYFILL) {
5435
+ // Always run detection in dev mode, so we can at least print to the console
5436
+ {
5437
+ // In prod mode, only enable detection if reporting is enabled
5438
+ onReportingEnabled(enableDetection);
5439
+ }
5325
5440
  }
5326
5441
  }
5327
5442
 
@@ -5530,8 +5645,8 @@ var LWC = (function (exports) {
5530
5645
  var nextNode = node;
5531
5646
  var anchor = null;
5532
5647
  var renderer = owner.renderer;
5533
- for (var _i35 = 0; _i35 < children.length; _i35++) {
5534
- var childVnode = children[_i35];
5648
+ for (var _i34 = 0; _i34 < children.length; _i34++) {
5649
+ var childVnode = children[_i34];
5535
5650
  if (!isNull(childVnode)) {
5536
5651
  if (nextNode) {
5537
5652
  nextNode = hydrateNode(nextNode, childVnode, renderer);
@@ -5592,8 +5707,8 @@ var LWC = (function (exports) {
5592
5707
  var nodesAreCompatible = true;
5593
5708
  // Validate attributes, though we could always recovery from those by running the update mods.
5594
5709
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
5595
- for (var _i36 = 0, _Object$entries = Object.entries(attrs); _i36 < _Object$entries.length; _i36++) {
5596
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i36], 2),
5710
+ for (var _i35 = 0, _Object$entries = Object.entries(attrs); _i35 < _Object$entries.length; _i35++) {
5711
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i35], 2),
5597
5712
  attrName = _Object$entries$_i[0],
5598
5713
  attrValue = _Object$entries$_i[1];
5599
5714
  vnode.owner;
@@ -5680,8 +5795,8 @@ var LWC = (function (exports) {
5680
5795
  var parsedVnodeStyle = parseStyleText(elmStyle);
5681
5796
  var expectedStyle = [];
5682
5797
  // styleMap is used when style is set to static value.
5683
- for (var _i37 = 0, n = styleDecls.length; _i37 < n; _i37++) {
5684
- var _styleDecls$_i2 = _slicedToArray(styleDecls[_i37], 3),
5798
+ for (var _i36 = 0, n = styleDecls.length; _i36 < n; _i36++) {
5799
+ var _styleDecls$_i2 = _slicedToArray(styleDecls[_i36], 3),
5685
5800
  prop = _styleDecls$_i2[0],
5686
5801
  value = _styleDecls$_i2[1],
5687
5802
  important = _styleDecls$_i2[2];
@@ -5746,6 +5861,121 @@ var LWC = (function (exports) {
5746
5861
  hooksAreSet = true;
5747
5862
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
5748
5863
  }
5864
+
5865
+ /*
5866
+ * Copyright (c) 2018, salesforce.com, inc.
5867
+ * All rights reserved.
5868
+ * SPDX-License-Identifier: MIT
5869
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5870
+ */
5871
+ // See @lwc/engine-core/src/framework/template.ts
5872
+ var TEMPLATE_PROPS = ['slots', 'stylesheetToken', 'stylesheets', 'renderMode'];
5873
+ // Expandos that may be placed on a stylesheet factory function, and which are meaningful to LWC at runtime
5874
+ var STYLESHEET_PROPS = [
5875
+ // SEE `KEY__SCOPED_CSS` in @lwc/style-compiler
5876
+ '$scoped$'];
5877
+ // Via https://www.npmjs.com/package/object-observer
5878
+ var ARRAY_MUTATION_METHODS = ['pop', 'push', 'shift', 'unshift', 'reverse', 'sort', 'fill', 'splice', 'copyWithin'];
5879
+ var mutationTrackingDisabled = false;
5880
+ function getOriginalArrayMethod(prop) {
5881
+ switch (prop) {
5882
+ case 'pop':
5883
+ return ArrayPop;
5884
+ case 'push':
5885
+ return ArrayPush$1;
5886
+ case 'shift':
5887
+ return ArrayShift;
5888
+ case 'unshift':
5889
+ return ArrayUnshift;
5890
+ case 'reverse':
5891
+ return ArrayReverse;
5892
+ case 'sort':
5893
+ return ArraySort;
5894
+ case 'fill':
5895
+ return ArrayFill;
5896
+ case 'splice':
5897
+ return ArraySplice;
5898
+ case 'copyWithin':
5899
+ return ArrayCopyWithin;
5900
+ }
5901
+ }
5902
+ function reportViolation(type, eventId, prop) {
5903
+ report(eventId, {
5904
+ propertyName: prop
5905
+ });
5906
+ }
5907
+ function reportTemplateViolation(prop) {
5908
+ reportViolation('template', 3 /* ReportingEventId.TemplateMutation */, prop);
5909
+ }
5910
+ function reportStylesheetViolation(prop) {
5911
+ reportViolation('stylesheet', 4 /* ReportingEventId.StylesheetMutation */, prop);
5912
+ }
5913
+ // Warn if the user tries to mutate a stylesheets array, e.g.:
5914
+ // `tmpl.stylesheets.push(someStylesheetFunction)`
5915
+ function warnOnArrayMutation(stylesheets) {
5916
+ // We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
5917
+ // we can at least warn when they use the most common mutation methods.
5918
+ var _iterator8 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
5919
+ _step8;
5920
+ try {
5921
+ var _loop4 = function _loop4() {
5922
+ var prop = _step8.value;
5923
+ var originalArrayMethod = getOriginalArrayMethod(prop);
5924
+ stylesheets[prop] = function arrayMutationWarningWrapper() {
5925
+ reportTemplateViolation('stylesheets');
5926
+ // @ts-ignore
5927
+ return originalArrayMethod.apply(this, arguments);
5928
+ };
5929
+ };
5930
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
5931
+ _loop4();
5932
+ }
5933
+ } catch (err) {
5934
+ _iterator8.e(err);
5935
+ } finally {
5936
+ _iterator8.f();
5937
+ }
5938
+ }
5939
+ // Warn if the user tries to mutate a stylesheet factory function, e.g.:
5940
+ // `stylesheet.$scoped$ = true`
5941
+ function warnOnStylesheetFunctionMutation(stylesheet) {
5942
+ var _iterator9 = _createForOfIteratorHelper(STYLESHEET_PROPS),
5943
+ _step9;
5944
+ try {
5945
+ var _loop5 = function _loop5() {
5946
+ var prop = _step9.value;
5947
+ var value = stylesheet[prop];
5948
+ defineProperty(stylesheet, prop, {
5949
+ enumerable: true,
5950
+ configurable: true,
5951
+ get: function get() {
5952
+ return value;
5953
+ },
5954
+ set: function set(newValue) {
5955
+ reportStylesheetViolation(prop);
5956
+ value = newValue;
5957
+ }
5958
+ });
5959
+ };
5960
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
5961
+ _loop5();
5962
+ }
5963
+ } catch (err) {
5964
+ _iterator9.e(err);
5965
+ } finally {
5966
+ _iterator9.f();
5967
+ }
5968
+ }
5969
+ // Warn on either array or stylesheet (function) mutation, in a deeply-nested array
5970
+ function trackStylesheetsMutation(stylesheets) {
5971
+ traverseStylesheets(stylesheets, function (subStylesheets) {
5972
+ if (isArray$1(subStylesheets)) {
5973
+ warnOnArrayMutation(subStylesheets);
5974
+ } else {
5975
+ warnOnStylesheetFunctionMutation(subStylesheets);
5976
+ }
5977
+ });
5978
+ }
5749
5979
  // Deeply freeze the entire array (of arrays) of stylesheet factory functions
5750
5980
  function deepFreeze(stylesheets) {
5751
5981
  traverseStylesheets(stylesheets, function (subStylesheets) {
@@ -5755,8 +5985,8 @@ var LWC = (function (exports) {
5755
5985
  // Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
5756
5986
  function traverseStylesheets(stylesheets, callback) {
5757
5987
  callback(stylesheets);
5758
- for (var _i38 = 0; _i38 < stylesheets.length; _i38++) {
5759
- var stylesheet = stylesheets[_i38];
5988
+ for (var _i37 = 0; _i37 < stylesheets.length; _i37++) {
5989
+ var stylesheet = stylesheets[_i37];
5760
5990
  if (isArray$1(stylesheet)) {
5761
5991
  traverseStylesheets(stylesheet, callback);
5762
5992
  } else {
@@ -5764,7 +5994,80 @@ var LWC = (function (exports) {
5764
5994
  }
5765
5995
  }
5766
5996
  }
5997
+ function trackMutations(tmpl) {
5998
+ if (!isUndefined$1(tmpl.stylesheets)) {
5999
+ trackStylesheetsMutation(tmpl.stylesheets);
6000
+ }
6001
+ var _iterator10 = _createForOfIteratorHelper(TEMPLATE_PROPS),
6002
+ _step10;
6003
+ try {
6004
+ var _loop6 = function _loop6() {
6005
+ var prop = _step10.value;
6006
+ var value = tmpl[prop];
6007
+ defineProperty(tmpl, prop, {
6008
+ enumerable: true,
6009
+ configurable: true,
6010
+ get: function get() {
6011
+ return value;
6012
+ },
6013
+ set: function set(newValue) {
6014
+ if (!mutationTrackingDisabled) {
6015
+ reportTemplateViolation(prop);
6016
+ }
6017
+ value = newValue;
6018
+ }
6019
+ });
6020
+ };
6021
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
6022
+ _loop6();
6023
+ }
6024
+ } catch (err) {
6025
+ _iterator10.e(err);
6026
+ } finally {
6027
+ _iterator10.f();
6028
+ }
6029
+ var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
6030
+ defineProperty(tmpl, 'stylesheetTokens', {
6031
+ enumerable: true,
6032
+ configurable: true,
6033
+ get: originalDescriptor.get,
6034
+ set: function set(value) {
6035
+ reportTemplateViolation('stylesheetTokens');
6036
+ // Avoid logging/reporting twice (for both stylesheetToken and stylesheetTokens)
6037
+ mutationTrackingDisabled = true;
6038
+ originalDescriptor.set.call(this, value);
6039
+ mutationTrackingDisabled = false;
6040
+ }
6041
+ });
6042
+ }
6043
+ function addLegacyStylesheetTokensShim(tmpl) {
6044
+ // When ENABLE_FROZEN_TEMPLATE is false, then we shim stylesheetTokens on top of stylesheetToken for anyone who
6045
+ // is accessing the old internal API (backwards compat). Details: https://salesforce.quip.com/v1rmAFu2cKAr
6046
+ defineProperty(tmpl, 'stylesheetTokens', {
6047
+ enumerable: true,
6048
+ configurable: true,
6049
+ get: function get() {
6050
+ var stylesheetToken = this.stylesheetToken;
6051
+ if (isUndefined$1(stylesheetToken)) {
6052
+ return stylesheetToken;
6053
+ }
6054
+ // Shim for the old `stylesheetTokens` property
6055
+ // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
6056
+ return {
6057
+ hostAttribute: "".concat(stylesheetToken, "-host"),
6058
+ shadowAttribute: stylesheetToken
6059
+ };
6060
+ },
6061
+ set: function set(value) {
6062
+ // If the value is null or some other exotic object, you would be broken anyway in the past
6063
+ // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
6064
+ // However it may be undefined in newer versions of LWC, so we need to guard against that case.
6065
+ this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
6066
+ }
6067
+ });
6068
+ }
5767
6069
  function freezeTemplate(tmpl) {
6070
+ // TODO [#2782]: remove this flag and delete the legacy behavior
5768
6071
  if (lwcRuntimeFlags.ENABLE_FROZEN_TEMPLATE) {
5769
6072
  // Deep freeze the template
5770
6073
  freeze(tmpl);
@@ -5772,31 +6075,16 @@ var LWC = (function (exports) {
5772
6075
  deepFreeze(tmpl.stylesheets);
5773
6076
  }
5774
6077
  } else {
5775
- // TODO [#2782]: remove this flag and delete the legacy behavior
5776
- // When ENABLE_FROZEN_TEMPLATE is false, then we shim stylesheetTokens on top of stylesheetToken for anyone who
5777
- // is accessing the old internal API (backwards compat). Details: https://salesforce.quip.com/v1rmAFu2cKAr
5778
- defineProperty(tmpl, 'stylesheetTokens', {
5779
- enumerable: true,
5780
- configurable: true,
5781
- get: function get() {
5782
- var stylesheetToken = this.stylesheetToken;
5783
- if (isUndefined$1(stylesheetToken)) {
5784
- return stylesheetToken;
5785
- }
5786
- // Shim for the old `stylesheetTokens` property
5787
- // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
5788
- return {
5789
- hostAttribute: "".concat(stylesheetToken, "-host"),
5790
- shadowAttribute: stylesheetToken
5791
- };
5792
- },
5793
- set: function set(value) {
5794
- // If the value is null or some other exotic object, you would be broken anyway in the past
5795
- // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
5796
- // However it may be undefined in newer versions of LWC, so we need to guard against that case.
5797
- this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
5798
- }
5799
- });
6078
+ // template is not frozen - shim, report, and warn
6079
+ // this shim should be applied in both dev and prod
6080
+ addLegacyStylesheetTokensShim(tmpl);
6081
+ // When ENABLE_FROZEN_TEMPLATE is false, we want to warn in dev mode whenever someone is mutating the template
6082
+ {
6083
+ // In prod mode, we only track mutations if reporting is enabled
6084
+ onReportingEnabled(function () {
6085
+ trackMutations(tmpl);
6086
+ });
6087
+ }
5800
6088
  }
5801
6089
  }
5802
6090
 
@@ -6417,17 +6705,17 @@ var LWC = (function (exports) {
6417
6705
  function flushPendingWhenDefinedCallbacks(tagName, ctor) {
6418
6706
  var resolvers = pendingWhenDefinedCallbacks.get(tagName);
6419
6707
  if (!isUndefined$1(resolvers)) {
6420
- var _iterator9 = _createForOfIteratorHelper(resolvers),
6421
- _step9;
6708
+ var _iterator11 = _createForOfIteratorHelper(resolvers),
6709
+ _step11;
6422
6710
  try {
6423
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
6424
- var resolver = _step9.value;
6711
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
6712
+ var resolver = _step11.value;
6425
6713
  resolver(ctor);
6426
6714
  }
6427
6715
  } catch (err) {
6428
- _iterator9.e(err);
6716
+ _iterator11.e(err);
6429
6717
  } finally {
6430
- _iterator9.f();
6718
+ _iterator11.f();
6431
6719
  }
6432
6720
  }
6433
6721
  pendingWhenDefinedCallbacks.delete(tagName);
@@ -6477,11 +6765,11 @@ var LWC = (function (exports) {
6477
6765
  var awaiting = awaitingUpgrade.get(tagName);
6478
6766
  if (!isUndefined$1(awaiting)) {
6479
6767
  awaitingUpgrade.delete(tagName);
6480
- var _iterator10 = _createForOfIteratorHelper(awaiting),
6481
- _step10;
6768
+ var _iterator12 = _createForOfIteratorHelper(awaiting),
6769
+ _step12;
6482
6770
  try {
6483
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
6484
- var element = _step10.value;
6771
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
6772
+ var element = _step12.value;
6485
6773
  var registeredDefinition = pendingRegistryForElement.get(element);
6486
6774
  // At this point, registeredDefinition should never be undefined because awaitingUpgrade
6487
6775
  // is only populated when we haven't run internalUpgrade yet, and we only populate
@@ -6493,9 +6781,9 @@ var LWC = (function (exports) {
6493
6781
  }
6494
6782
  }
6495
6783
  } catch (err) {
6496
- _iterator10.e(err);
6784
+ _iterator12.e(err);
6497
6785
  } finally {
6498
- _iterator10.f();
6786
+ _iterator12.f();
6499
6787
  }
6500
6788
  }
6501
6789
  // If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
@@ -6772,7 +7060,7 @@ var LWC = (function (exports) {
6772
7060
  function isNull(obj) {
6773
7061
  return obj === null;
6774
7062
  }
6775
- /** version: 2.35.2 */
7063
+ /** version: 2.36.0 */
6776
7064
 
6777
7065
  /*
6778
7066
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6831,17 +7119,17 @@ var LWC = (function (exports) {
6831
7119
  exports.createFragment = function (html) {
6832
7120
  var wrapperTags = topLevelWrappingMap[getTagName(html)];
6833
7121
  if (!isUndefined(wrapperTags)) {
6834
- var _iterator11 = _createForOfIteratorHelper(wrapperTags),
6835
- _step11;
7122
+ var _iterator13 = _createForOfIteratorHelper(wrapperTags),
7123
+ _step13;
6836
7124
  try {
6837
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
6838
- var wrapperTag = _step11.value;
7125
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
7126
+ var wrapperTag = _step13.value;
6839
7127
  html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
6840
7128
  }
6841
7129
  } catch (err) {
6842
- _iterator11.e(err);
7130
+ _iterator13.e(err);
6843
7131
  } finally {
6844
- _iterator11.f();
7132
+ _iterator13.f();
6845
7133
  }
6846
7134
  }
6847
7135
  // For IE11, the document title must not be undefined, but it can be an empty string
@@ -6850,7 +7138,7 @@ var LWC = (function (exports) {
6850
7138
  doc.body.innerHTML = html;
6851
7139
  var content = doc.body;
6852
7140
  if (!isUndefined(wrapperTags)) {
6853
- for (var _i39 = 0; _i39 < wrapperTags.length; _i39++) {
7141
+ for (var _i38 = 0; _i38 < wrapperTags.length; _i38++) {
6854
7142
  content = content.firstChild;
6855
7143
  }
6856
7144
  }
@@ -7043,8 +7331,8 @@ var LWC = (function (exports) {
7043
7331
  tagName: element.tagName.toLowerCase(),
7044
7332
  hydrated: true
7045
7333
  });
7046
- for (var _i40 = 0, _Object$entries2 = Object.entries(props); _i40 < _Object$entries2.length; _i40++) {
7047
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i40], 2),
7334
+ for (var _i39 = 0, _Object$entries2 = Object.entries(props); _i39 < _Object$entries2.length; _i39++) {
7335
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i39], 2),
7048
7336
  key = _Object$entries2$_i[0],
7049
7337
  value = _Object$entries2$_i[1];
7050
7338
  element[key] = value;
@@ -7331,7 +7619,7 @@ var LWC = (function (exports) {
7331
7619
  });
7332
7620
  freeze(LightningElement);
7333
7621
  seal(LightningElement.prototype);
7334
- /* version: 2.35.2 */
7622
+ /* version: 2.36.0 */
7335
7623
 
7336
7624
  exports.LightningElement = LightningElement;
7337
7625
  exports.__unstable__ProfilerControl = profilerControl;