lwc 2.11.0 → 2.11.4

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 +339 -263
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +339 -263
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +294 -126
  5. package/dist/engine-dom/iife/es5/engine-dom.js +1137 -1047
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +425 -182
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +339 -263
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +294 -126
  11. package/dist/engine-dom/umd/es5/engine-dom.js +1137 -1047
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +425 -182
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +44 -11
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +44 -11
  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 +8 -9
@@ -49,6 +49,8 @@ var LWC = (function (exports) {
49
49
 
50
50
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
51
51
 
52
+ 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; } } }; }
53
+
52
54
  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); }
53
55
 
54
56
  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; }
@@ -345,7 +347,7 @@ var LWC = (function (exports) {
345
347
  var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
346
348
  var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
347
349
  var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
348
- /** version: 2.11.0 */
350
+ /** version: 2.11.4 */
349
351
 
350
352
  /*
351
353
  * Copyright (c) 2018, salesforce.com, inc.
@@ -515,7 +517,7 @@ var LWC = (function (exports) {
515
517
 
516
518
  function setFeatureFlagForTest(name, value) {
517
519
  }
518
- /** version: 2.11.0 */
520
+ /** version: 2.11.4 */
519
521
 
520
522
  /* proxy-compat-disable */
521
523
 
@@ -558,6 +560,42 @@ var LWC = (function (exports) {
558
560
 
559
561
  return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
560
562
  } // Borrowed from Vue template compiler.
563
+ // https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
564
+
565
+
566
+ var DECLARATION_DELIMITER = /;(?![^(]*\))/g;
567
+ var PROPERTY_DELIMITER = /:(.+)/;
568
+
569
+ function parseStyleText(cssText) {
570
+ var styleMap = {};
571
+ var declarations = cssText.split(DECLARATION_DELIMITER);
572
+
573
+ var _iterator = _createForOfIteratorHelper(declarations),
574
+ _step;
575
+
576
+ try {
577
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
578
+ var declaration = _step.value;
579
+
580
+ if (declaration) {
581
+ var _declaration$split = declaration.split(PROPERTY_DELIMITER),
582
+ _declaration$split2 = _slicedToArray(_declaration$split, 2),
583
+ prop = _declaration$split2[0],
584
+ value = _declaration$split2[1];
585
+
586
+ if (prop !== undefined && value !== undefined) {
587
+ styleMap[prop.trim()] = value.trim();
588
+ }
589
+ }
590
+ }
591
+ } catch (err) {
592
+ _iterator.e(err);
593
+ } finally {
594
+ _iterator.f();
595
+ }
596
+
597
+ return styleMap;
598
+ } // Make a shallow copy of an object but omit the given key
561
599
 
562
600
 
563
601
  function cloneAndOmitKey(object, keyToOmit) {
@@ -1030,8 +1068,8 @@ var LWC = (function (exports) {
1030
1068
  }
1031
1069
  }
1032
1070
 
1033
- function logWarn(message, vm) {
1034
- log('warn', message, vm);
1071
+ function logError(message, vm) {
1072
+ log('error', message, vm);
1035
1073
  }
1036
1074
  /*
1037
1075
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2591,6 +2629,13 @@ var LWC = (function (exports) {
2591
2629
  var meta = signedDecoratorToMetaMap.get(Ctor);
2592
2630
  return isUndefined$1(meta) ? defaultMeta : meta;
2593
2631
  }
2632
+ /*
2633
+ * Copyright (c) 2018, salesforce.com, inc.
2634
+ * All rights reserved.
2635
+ * SPDX-License-Identifier: MIT
2636
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2637
+ */
2638
+
2594
2639
 
2595
2640
  var signedTemplateSet = new Set();
2596
2641
 
@@ -2611,7 +2656,33 @@ var LWC = (function (exports) {
2611
2656
 
2612
2657
  function registerTemplate(tpl) {
2613
2658
 
2614
- signedTemplateSet.add(tpl); // chaining this method as a way to wrap existing
2659
+ signedTemplateSet.add(tpl); // FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
2660
+ // the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
2661
+ // on top of stylesheetToken for anyone who is accessing the old internal API.
2662
+ // Details: https://salesforce.quip.com/v1rmAFu2cKAr
2663
+
2664
+ defineProperty(tpl, 'stylesheetTokens', {
2665
+ get: function get() {
2666
+ var stylesheetToken = this.stylesheetToken;
2667
+
2668
+ if (isUndefined$1(stylesheetToken)) {
2669
+ return stylesheetToken;
2670
+ } // Shim for the old `stylesheetTokens` property
2671
+ // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
2672
+
2673
+
2674
+ return {
2675
+ hostAttribute: "".concat(stylesheetToken, "-host"),
2676
+ shadowAttribute: stylesheetToken
2677
+ };
2678
+ },
2679
+ set: function set(value) {
2680
+ // If the value is null or some other exotic object, you would be broken anyway in the past
2681
+ // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
2682
+ // However it may be undefined in newer versions of LWC, so we need to guard against that case.
2683
+ this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
2684
+ }
2685
+ }); // chaining this method as a way to wrap existing
2615
2686
  // assignment of templates easily, without too much transformation
2616
2687
 
2617
2688
  return tpl;
@@ -4949,12 +5020,17 @@ var LWC = (function (exports) {
4949
5020
  * will prevent this function from being imported by userland code.
4950
5021
  */
4951
5022
 
4952
- function registerComponent(Ctor, _ref2) {
5023
+ function registerComponent( // We typically expect a LightningElementConstructor, but technically you can call this with anything
5024
+ Ctor, _ref2) {
4953
5025
  var tmpl = _ref2.tmpl;
4954
5026
 
4955
- signedTemplateMap.set(Ctor, tmpl); // chaining this method as a way to wrap existing assignment of component constructor easily,
5027
+ if (isFunction$1(Ctor)) {
5028
+
5029
+ signedTemplateMap.set(Ctor, tmpl);
5030
+ } // chaining this method as a way to wrap existing assignment of component constructor easily,
4956
5031
  // without too much transformation
4957
5032
 
5033
+
4958
5034
  return Ctor;
4959
5035
  }
4960
5036
 
@@ -5049,140 +5125,6 @@ var LWC = (function (exports) {
5049
5125
  cbs[_i22].call(undefined, component, {}, def, context);
5050
5126
  }
5051
5127
  }
5052
- /*
5053
- * Copyright (c) 2022, salesforce.com, inc.
5054
- * All rights reserved.
5055
- * SPDX-License-Identifier: MIT
5056
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5057
- */
5058
-
5059
-
5060
- function hydrate(vnode, node) {
5061
- switch (vnode.type) {
5062
- case 0
5063
- /* Text */
5064
- :
5065
- hydrateText(vnode, node);
5066
- break;
5067
-
5068
- case 1
5069
- /* Comment */
5070
- :
5071
- hydrateComment(vnode, node);
5072
- break;
5073
-
5074
- case 2
5075
- /* Element */
5076
- :
5077
- hydrateElement(vnode, node);
5078
- break;
5079
-
5080
- case 3
5081
- /* CustomElement */
5082
- :
5083
- hydrateCustomElement(vnode, node);
5084
- break;
5085
- }
5086
- }
5087
-
5088
- function hydrateText(vnode, node) {
5089
- var _a;
5090
-
5091
-
5092
- setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
5093
- vnode.elm = node;
5094
- }
5095
-
5096
- function hydrateComment(vnode, node) {
5097
- var _a;
5098
-
5099
-
5100
- setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
5101
- vnode.elm = node;
5102
- }
5103
-
5104
- function hydrateElement(vnode, node) {
5105
-
5106
- var elm = node;
5107
- vnode.elm = elm;
5108
- var context = vnode.data.context;
5109
- var isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
5110
- /* Manual */
5111
- );
5112
-
5113
- if (isDomManual) {
5114
- // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
5115
- // remove the innerHTML from props so it reuses the existing dom elements.
5116
- var props = vnode.data.props;
5117
-
5118
- if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
5119
- if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
5120
- // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
5121
- vnode.data = Object.assign(Object.assign({}, vnode.data), {
5122
- props: cloneAndOmitKey(props, 'innerHTML')
5123
- });
5124
- } else {
5125
- logWarn("Mismatch hydrating element <".concat(getProperty$1(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), vnode.owner);
5126
- }
5127
- }
5128
- }
5129
-
5130
- patchElementPropsAndAttrs(vnode);
5131
-
5132
- if (!isDomManual) {
5133
- hydrateChildren(getChildNodes$1(vnode.elm), vnode.children, vnode.owner);
5134
- }
5135
- }
5136
-
5137
- function hydrateCustomElement(vnode, node) {
5138
-
5139
- var elm = node;
5140
- var sel = vnode.sel,
5141
- mode = vnode.mode,
5142
- ctor = vnode.ctor,
5143
- owner = vnode.owner;
5144
- var vm = createVM(elm, ctor, {
5145
- mode: mode,
5146
- owner: owner,
5147
- tagName: sel
5148
- });
5149
- vnode.elm = elm;
5150
- vnode.vm = vm;
5151
- allocateChildren(vnode, vm);
5152
- patchElementPropsAndAttrs(vnode); // Insert hook section:
5153
-
5154
- runConnectedCallback(vm);
5155
-
5156
- if (vm.renderMode !== 0
5157
- /* Light */
5158
- ) {
5159
- // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
5160
- // Note: for Light DOM, this is handled while hydrating the VM
5161
- hydrateChildren(getChildNodes$1(vnode.elm), vnode.children);
5162
- }
5163
-
5164
- hydrateVM(vm);
5165
- }
5166
-
5167
- function hydrateChildren(elmChildren, children, vm) {
5168
-
5169
- var childNodeIndex = 0;
5170
-
5171
- for (var _i23 = 0; _i23 < children.length; _i23++) {
5172
- var childVnode = children[_i23];
5173
-
5174
- if (!isNull(childVnode)) {
5175
- var childNode = elmChildren[childNodeIndex];
5176
- hydrate(childVnode, childNode);
5177
- childNodeIndex++;
5178
- }
5179
- }
5180
- }
5181
-
5182
- function patchElementPropsAndAttrs(vnode) {
5183
- applyEventListeners(vnode);
5184
- patchProps(null, vnode);
5185
- }
5186
5128
  /*
5187
5129
  * Copyright (c) 2018, salesforce.com, inc.
5188
5130
  * All rights reserved.
@@ -5233,12 +5175,6 @@ var LWC = (function (exports) {
5233
5175
  , vm);
5234
5176
  }
5235
5177
 
5236
- function hydrateRootElement(elm) {
5237
- var vm = getAssociatedVM(elm);
5238
- runConnectedCallback(vm);
5239
- hydrateVM(vm);
5240
- }
5241
-
5242
5178
  function disconnectRootElement(elm) {
5243
5179
  var vm = getAssociatedVM(elm);
5244
5180
  resetComponentStateWhenRemoved(vm);
@@ -5246,22 +5182,6 @@ var LWC = (function (exports) {
5246
5182
 
5247
5183
  function appendVM(vm) {
5248
5184
  rehydrate(vm);
5249
- }
5250
-
5251
- function hydrateVM(vm) {
5252
- if (isTrue(vm.isDirty)) {
5253
- // manually diffing/patching here.
5254
- // This routine is:
5255
- // patchShadowRoot(vm, children);
5256
- // -> addVnodes.
5257
- var children = renderComponent(vm);
5258
- vm.children = children;
5259
- var vmChildren = vm.renderMode === 0
5260
- /* Light */
5261
- ? getChildNodes$1(vm.elm) : getChildNodes$1(vm.elm.shadowRoot);
5262
- hydrateChildren(vmChildren, children);
5263
- runRenderedCallback(vm);
5264
- }
5265
5185
  } // just in case the component comes back, with this we guarantee re-rendering it
5266
5186
  // while preventing any attempt to rehydration until after reinsertion.
5267
5187
 
@@ -5527,19 +5447,19 @@ var LWC = (function (exports) {
5527
5447
  });
5528
5448
  rehydrateQueue = []; // reset to a new queue
5529
5449
 
5530
- for (var _i26 = 0, _len8 = vms.length; _i26 < _len8; _i26 += 1) {
5531
- var vm = vms[_i26];
5450
+ for (var _i23 = 0, _len8 = vms.length; _i23 < _len8; _i23 += 1) {
5451
+ var vm = vms[_i23];
5532
5452
 
5533
5453
  try {
5534
5454
  rehydrate(vm);
5535
5455
  } catch (error) {
5536
- if (_i26 + 1 < _len8) {
5456
+ if (_i23 + 1 < _len8) {
5537
5457
  // pieces of the queue are still pending to be rehydrated, those should have priority
5538
5458
  if (rehydrateQueue.length === 0) {
5539
5459
  addCallbackToNextTick(flushRehydrationQueue);
5540
5460
  }
5541
5461
 
5542
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i26 + 1));
5462
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i23 + 1));
5543
5463
  } // we need to end the measure before throwing.
5544
5464
 
5545
5465
 
@@ -5638,8 +5558,8 @@ var LWC = (function (exports) {
5638
5558
  var vCustomElementCollection = vm.velements; // Reporting disconnection for every child in inverse order since they are
5639
5559
  // inserted in reserved order.
5640
5560
 
5641
- for (var _i27 = vCustomElementCollection.length - 1; _i27 >= 0; _i27 -= 1) {
5642
- var elm = vCustomElementCollection[_i27].elm; // There are two cases where the element could be undefined:
5561
+ for (var _i24 = vCustomElementCollection.length - 1; _i24 >= 0; _i24 -= 1) {
5562
+ var elm = vCustomElementCollection[_i24].elm; // There are two cases where the element could be undefined:
5643
5563
  // * when there is an error during the construction phase, and an error
5644
5564
  // boundary picks it, there is a possibility that the VCustomElement
5645
5565
  // is not properly initialized, and therefore is should be ignored.
@@ -5673,8 +5593,8 @@ var LWC = (function (exports) {
5673
5593
 
5674
5594
 
5675
5595
  function recursivelyDisconnectChildren(vnodes) {
5676
- for (var _i28 = 0, _len9 = vnodes.length; _i28 < _len9; _i28 += 1) {
5677
- var vnode = vnodes[_i28];
5596
+ for (var _i25 = 0, _len9 = vnodes.length; _i25 < _len9; _i25 += 1) {
5597
+ var vnode = vnodes[_i25];
5678
5598
 
5679
5599
  if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
5680
5600
  switch (vnode.type) {
@@ -5705,8 +5625,8 @@ var LWC = (function (exports) {
5705
5625
  var children = vm.children,
5706
5626
  renderRoot = vm.renderRoot;
5707
5627
 
5708
- for (var _i29 = 0, _len10 = children.length; _i29 < _len10; _i29++) {
5709
- var child = children[_i29];
5628
+ for (var _i26 = 0, _len10 = children.length; _i26 < _len10; _i26++) {
5629
+ var child = children[_i26];
5710
5630
 
5711
5631
  if (!isNull(child) && !isUndefined$1(child.elm)) {
5712
5632
  remove$1(child.elm, renderRoot);
@@ -6056,8 +5976,8 @@ var LWC = (function (exports) {
6056
5976
  function connectWireAdapters(vm) {
6057
5977
  var wiredConnecting = vm.context.wiredConnecting;
6058
5978
 
6059
- for (var _i30 = 0, _len11 = wiredConnecting.length; _i30 < _len11; _i30 += 1) {
6060
- wiredConnecting[_i30]();
5979
+ for (var _i27 = 0, _len11 = wiredConnecting.length; _i27 < _len11; _i27 += 1) {
5980
+ wiredConnecting[_i27]();
6061
5981
  }
6062
5982
  }
6063
5983
 
@@ -6065,8 +5985,8 @@ var LWC = (function (exports) {
6065
5985
  var wiredDisconnecting = vm.context.wiredDisconnecting;
6066
5986
  runWithBoundaryProtection(vm, vm, noop, function () {
6067
5987
  // job
6068
- for (var _i31 = 0, _len12 = wiredDisconnecting.length; _i31 < _len12; _i31 += 1) {
6069
- wiredDisconnecting[_i31]();
5988
+ for (var _i28 = 0, _len12 = wiredDisconnecting.length; _i28 < _len12; _i28 += 1) {
5989
+ wiredDisconnecting[_i28]();
6070
5990
  }
6071
5991
  }, noop);
6072
5992
  }
@@ -6136,6 +6056,327 @@ var LWC = (function (exports) {
6136
6056
 
6137
6057
  return reactiveMembrane.getReadOnlyProxy(obj);
6138
6058
  }
6059
+ /*
6060
+ * Copyright (c) 2022, salesforce.com, inc.
6061
+ * All rights reserved.
6062
+ * SPDX-License-Identifier: MIT
6063
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6064
+ */
6065
+ // flag indicating if the hydration recovered from the DOM mismatch
6066
+
6067
+
6068
+ var hasMismatch = false;
6069
+
6070
+ function hydrateRoot(vm) {
6071
+ hasMismatch = false;
6072
+ runConnectedCallback(vm);
6073
+ hydrateVM(vm);
6074
+
6075
+ if (hasMismatch) {
6076
+ logError('Hydration completed with errors.', vm);
6077
+ }
6078
+ }
6079
+
6080
+ function hydrateVM(vm) {
6081
+ var children = renderComponent(vm);
6082
+ vm.children = children;
6083
+ var parentNode = vm.renderRoot;
6084
+ hydrateChildren(getFirstChild$1(parentNode), children, parentNode);
6085
+ runRenderedCallback(vm);
6086
+ }
6087
+
6088
+ function hydrateNode(node, vnode) {
6089
+ var hydratedNode;
6090
+
6091
+ switch (vnode.type) {
6092
+ case 0
6093
+ /* Text */
6094
+ :
6095
+ hydratedNode = hydrateText(node, vnode);
6096
+ break;
6097
+
6098
+ case 1
6099
+ /* Comment */
6100
+ :
6101
+ hydratedNode = hydrateComment(node, vnode);
6102
+ break;
6103
+
6104
+ case 2
6105
+ /* Element */
6106
+ :
6107
+ hydratedNode = hydrateElement(node, vnode);
6108
+ break;
6109
+
6110
+ case 3
6111
+ /* CustomElement */
6112
+ :
6113
+ hydratedNode = hydrateCustomElement(node, vnode);
6114
+ break;
6115
+ }
6116
+
6117
+ return nextSibling$1(hydratedNode);
6118
+ }
6119
+
6120
+ function hydrateText(node, vnode) {
6121
+ var _a;
6122
+
6123
+ if (!hasCorrectNodeType(vnode, node, 3
6124
+ /* TEXT */
6125
+ )) {
6126
+ return handleMismatch(node, vnode);
6127
+ }
6128
+
6129
+ setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6130
+ vnode.elm = node;
6131
+ return node;
6132
+ }
6133
+
6134
+ function hydrateComment(node, vnode) {
6135
+ var _a;
6136
+
6137
+ if (!hasCorrectNodeType(vnode, node, 8
6138
+ /* COMMENT */
6139
+ )) {
6140
+ return handleMismatch(node, vnode);
6141
+ }
6142
+
6143
+ setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6144
+ vnode.elm = node;
6145
+ return node;
6146
+ }
6147
+
6148
+ function hydrateElement(elm, vnode) {
6149
+ if (!hasCorrectNodeType(vnode, elm, 1
6150
+ /* ELEMENT */
6151
+ ) || !isMatchingElement(vnode, elm)) {
6152
+ return handleMismatch(elm, vnode);
6153
+ }
6154
+
6155
+ vnode.elm = elm;
6156
+ var context = vnode.data.context;
6157
+ var isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
6158
+ /* Manual */
6159
+ );
6160
+
6161
+ if (isDomManual) {
6162
+ // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
6163
+ // remove the innerHTML from props so it reuses the existing dom elements.
6164
+ var props = vnode.data.props;
6165
+
6166
+ if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
6167
+ if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
6168
+ // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
6169
+ vnode.data = Object.assign(Object.assign({}, vnode.data), {
6170
+ props: cloneAndOmitKey(props, 'innerHTML')
6171
+ });
6172
+ }
6173
+ }
6174
+ }
6175
+
6176
+ patchElementPropsAndAttrs(vnode);
6177
+
6178
+ if (!isDomManual) {
6179
+ hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vnode.owner);
6180
+ }
6181
+
6182
+ return elm;
6183
+ }
6184
+
6185
+ function hydrateCustomElement(elm, vnode) {
6186
+ if (!hasCorrectNodeType(vnode, elm, 1
6187
+ /* ELEMENT */
6188
+ ) || !isMatchingElement(vnode, elm)) {
6189
+ return handleMismatch(elm, vnode);
6190
+ }
6191
+
6192
+ var sel = vnode.sel,
6193
+ mode = vnode.mode,
6194
+ ctor = vnode.ctor,
6195
+ owner = vnode.owner;
6196
+ var vm = createVM(elm, ctor, {
6197
+ mode: mode,
6198
+ owner: owner,
6199
+ tagName: sel
6200
+ });
6201
+ vnode.elm = elm;
6202
+ vnode.vm = vm;
6203
+ allocateChildren(vnode, vm);
6204
+ patchElementPropsAndAttrs(vnode); // Insert hook section:
6205
+
6206
+ runConnectedCallback(vm);
6207
+
6208
+ if (vm.renderMode !== 0
6209
+ /* Light */
6210
+ ) {
6211
+ // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
6212
+ // Note: for Light DOM, this is handled while hydrating the VM
6213
+ hydrateChildren(getFirstChild$1(elm), vnode.children, elm);
6214
+ }
6215
+
6216
+ hydrateVM(vm);
6217
+ return elm;
6218
+ }
6219
+
6220
+ function hydrateChildren(node, children, parentNode, owner) {
6221
+ var nextNode = node;
6222
+ var anchor = null;
6223
+
6224
+ for (var _i29 = 0; _i29 < children.length; _i29++) {
6225
+ var childVnode = children[_i29];
6226
+
6227
+ if (!isNull(childVnode)) {
6228
+ if (nextNode) {
6229
+ nextNode = hydrateNode(nextNode, childVnode);
6230
+ anchor = childVnode.elm;
6231
+ } else {
6232
+ hasMismatch = true;
6233
+
6234
+ mount(childVnode, parentNode, anchor);
6235
+ anchor = childVnode.elm;
6236
+ }
6237
+ }
6238
+ }
6239
+
6240
+ if (nextNode) {
6241
+ hasMismatch = true;
6242
+
6243
+ do {
6244
+ var current = nextNode;
6245
+ nextNode = nextSibling$1(nextNode);
6246
+ removeNode(current, parentNode);
6247
+ } while (nextNode);
6248
+ }
6249
+ }
6250
+
6251
+ function handleMismatch(node, vnode, msg) {
6252
+ hasMismatch = true;
6253
+
6254
+ var parentNode = getProperty$1(node, 'parentNode');
6255
+ mount(vnode, parentNode, node);
6256
+ removeNode(node, parentNode);
6257
+ return vnode.elm;
6258
+ }
6259
+
6260
+ function patchElementPropsAndAttrs(vnode) {
6261
+ applyEventListeners(vnode);
6262
+ patchProps(null, vnode);
6263
+ }
6264
+
6265
+ function hasCorrectNodeType(vnode, node, nodeType) {
6266
+ if (getProperty$1(node, 'nodeType') !== nodeType) {
6267
+
6268
+ return false;
6269
+ }
6270
+
6271
+ return true;
6272
+ }
6273
+
6274
+ function isMatchingElement(vnode, elm) {
6275
+ if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
6276
+
6277
+ return false;
6278
+ }
6279
+
6280
+ var hasIncompatibleAttrs = validateAttrs(vnode, elm);
6281
+ var hasIncompatibleClass = validateClassAttr(vnode, elm);
6282
+ var hasIncompatibleStyle = validateStyleAttr(vnode, elm);
6283
+ return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
6284
+ }
6285
+
6286
+ function validateAttrs(vnode, elm) {
6287
+ var _vnode$data$attrs = vnode.data.attrs,
6288
+ attrs = _vnode$data$attrs === void 0 ? {} : _vnode$data$attrs;
6289
+ var nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
6290
+ // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
6291
+
6292
+ for (var _i30 = 0, _Object$entries = Object.entries(attrs); _i30 < _Object$entries.length; _i30++) {
6293
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i30], 2),
6294
+ attrName = _Object$entries$_i[0],
6295
+ attrValue = _Object$entries$_i[1];
6296
+
6297
+ var elmAttrValue = getAttribute$1(elm, attrName);
6298
+
6299
+ if (String(attrValue) !== elmAttrValue) {
6300
+
6301
+ nodesAreCompatible = false;
6302
+ }
6303
+ }
6304
+
6305
+ return nodesAreCompatible;
6306
+ }
6307
+
6308
+ function validateClassAttr(vnode, elm) {
6309
+ var _vnode$data = vnode.data,
6310
+ className = _vnode$data.className,
6311
+ classMap = _vnode$data.classMap;
6312
+ var nodesAreCompatible = true;
6313
+
6314
+ if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
6315
+ // className is used when class is bound to an expr.
6316
+ nodesAreCompatible = false;
6317
+ } else if (!isUndefined$1(classMap)) {
6318
+ // classMap is used when class is set to static value.
6319
+ var classList = getClassList$1(elm);
6320
+ var computedClassName = ''; // all classes from the vnode should be in the element.classList
6321
+
6322
+ for (var name in classMap) {
6323
+ computedClassName += ' ' + name;
6324
+
6325
+ if (!classList.contains(name)) {
6326
+ nodesAreCompatible = false;
6327
+ }
6328
+ }
6329
+
6330
+ computedClassName.trim();
6331
+
6332
+ if (classList.length > keys(classMap).length) {
6333
+ nodesAreCompatible = false;
6334
+ }
6335
+ }
6336
+
6337
+ return nodesAreCompatible;
6338
+ }
6339
+
6340
+ function validateStyleAttr(vnode, elm) {
6341
+ var _vnode$data2 = vnode.data,
6342
+ style = _vnode$data2.style,
6343
+ styleDecls = _vnode$data2.styleDecls;
6344
+ var elmStyle = getAttribute$1(elm, 'style') || '';
6345
+ var nodesAreCompatible = true;
6346
+
6347
+ if (!isUndefined$1(style) && style !== elmStyle) {
6348
+ nodesAreCompatible = false;
6349
+ } else if (!isUndefined$1(styleDecls)) {
6350
+ var parsedVnodeStyle = parseStyleText(elmStyle);
6351
+ var expectedStyle = []; // styleMap is used when style is set to static value.
6352
+
6353
+ for (var _i31 = 0, n = styleDecls.length; _i31 < n; _i31++) {
6354
+ var _styleDecls$_i2 = _slicedToArray(styleDecls[_i31], 3),
6355
+ prop = _styleDecls$_i2[0],
6356
+ value = _styleDecls$_i2[1],
6357
+ important = _styleDecls$_i2[2];
6358
+
6359
+ expectedStyle.push("".concat(prop, ": ").concat(value + (important ? ' important!' : '')));
6360
+ var parsedPropValue = parsedVnodeStyle[prop];
6361
+
6362
+ if (isUndefined$1(parsedPropValue)) {
6363
+ nodesAreCompatible = false;
6364
+ } else if (!parsedPropValue.startsWith(value)) {
6365
+ nodesAreCompatible = false;
6366
+ } else if (important && !parsedPropValue.endsWith('!important')) {
6367
+ nodesAreCompatible = false;
6368
+ }
6369
+ }
6370
+
6371
+ if (keys(parsedVnodeStyle).length > styleDecls.length) {
6372
+ nodesAreCompatible = false;
6373
+ }
6374
+
6375
+ ArrayJoin.call(expectedStyle, ';');
6376
+ }
6377
+
6378
+ return nodesAreCompatible;
6379
+ }
6139
6380
  /*
6140
6381
  * Copyright (c) 2018, salesforce.com, inc.
6141
6382
  * All rights reserved.
@@ -6151,7 +6392,7 @@ var LWC = (function (exports) {
6151
6392
  hooksAreSet = true;
6152
6393
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
6153
6394
  }
6154
- /* version: 2.11.0 */
6395
+ /* version: 2.11.4 */
6155
6396
 
6156
6397
  /*
6157
6398
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6538,7 +6779,7 @@ var LWC = (function (exports) {
6538
6779
  }
6539
6780
 
6540
6781
  function createVMWithProps(element, Ctor, props) {
6541
- createVM(element, Ctor, {
6782
+ var vm = createVM(element, Ctor, {
6542
6783
  mode: 'open',
6543
6784
  owner: null,
6544
6785
  tagName: element.tagName.toLowerCase()
@@ -6551,6 +6792,8 @@ var LWC = (function (exports) {
6551
6792
 
6552
6793
  element[key] = value;
6553
6794
  }
6795
+
6796
+ return vm;
6554
6797
  }
6555
6798
 
6556
6799
  function hydrateComponent(element, Ctor) {
@@ -6578,8 +6821,8 @@ var LWC = (function (exports) {
6578
6821
  // Let the renderer know we are hydrating, so it does not replace the existing shadowRoot
6579
6822
  // and uses the same algo to create the stylesheets as in SSR.
6580
6823
  setIsHydrating(true);
6581
- createVMWithProps(element, Ctor, props);
6582
- hydrateRootElement(element); // set it back since now we finished hydration.
6824
+ var vm = createVMWithProps(element, Ctor, props);
6825
+ hydrateRoot(vm); // set it back since now we finished hydration.
6583
6826
 
6584
6827
  setIsHydrating(false);
6585
6828
  } catch (e) {
@@ -6894,7 +7137,7 @@ var LWC = (function (exports) {
6894
7137
  });
6895
7138
  freeze(LightningElement);
6896
7139
  seal(LightningElement.prototype);
6897
- /* version: 2.11.0 */
7140
+ /* version: 2.11.4 */
6898
7141
 
6899
7142
  exports.LightningElement = LightningElement;
6900
7143
  exports.__unstable__ProfilerControl = profilerControl;