lwc 2.18.0 → 2.20.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 (37) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +140 -140
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +140 -140
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +119 -119
  5. package/dist/engine-dom/iife/es5/engine-dom.js +152 -153
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +130 -132
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +140 -140
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +119 -119
  11. package/dist/engine-dom/umd/es5/engine-dom.js +152 -153
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +130 -132
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +148 -160
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +148 -160
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +20 -20
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +20 -20
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +20 -20
  20. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +20 -20
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +20 -20
  22. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +20 -20
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +20 -20
  24. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +20 -20
  25. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +20 -20
  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 +4 -4
  30. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  31. package/dist/wire-service/iife/es5/wire-service_debug.js +4 -4
  32. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  33. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  34. package/dist/wire-service/umd/es5/wire-service.js +4 -4
  35. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  36. package/dist/wire-service/umd/es5/wire-service_debug.js +4 -4
  37. package/package.json +7 -7
@@ -229,62 +229,44 @@ const KEY__SHADOW_STATIC = '$shadowStaticNode$';
229
229
  const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
230
230
  const KEY__SCOPED_CSS = '$scoped$';
231
231
 
232
+ /*
233
+ * Copyright (c) 2022, salesforce.com, inc.
234
+ * All rights reserved.
235
+ * SPDX-License-Identifier: MIT
236
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
237
+ */
238
+ const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
239
+ const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
240
+ const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
241
+ const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
242
+
232
243
  /*
233
244
  * Copyright (c) 2020, salesforce.com, inc.
234
245
  * All rights reserved.
235
246
  * SPDX-License-Identifier: MIT
236
247
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
237
248
  */
238
- // The following list contains a mix of both void elements from the HTML and the XML namespace
239
- // without distinction.
240
- const VOID_ELEMENTS = [
249
+ // Void elements are elements that self-close even without an explicit solidus (slash),
250
+ // e.g. `</tagName>` or `<tagName />`. For instance, `<meta>` closes on its own; no need for a slash.
251
+ // These only come from HTML; there are no void elements in the SVG or MathML namespaces.
252
+ // See: https://html.spec.whatwg.org/multipage/syntax.html#syntax-tags
253
+ const VOID_ELEMENTS_SET = new Set([
241
254
  'area',
242
255
  'base',
243
256
  'br',
244
- 'circle',
245
257
  'col',
246
- 'ellipse',
247
- 'feBlend',
248
- 'feColorMatrix',
249
- 'feFuncR',
250
- 'feFuncG',
251
- 'feFuncB',
252
- 'feFuncA',
253
- 'feImage',
254
- 'feComposite',
255
- 'feConvolveMatrix',
256
- 'feDiffuseLighting',
257
- 'feDisplacementMap',
258
- 'feDropShadow',
259
- 'feFlood',
260
- 'feGaussianBlur',
261
- 'feMerge',
262
- 'feMergeNode',
263
- 'feMorphology',
264
- 'feOffset',
265
- 'feSpecularLighting',
266
- 'feTile',
267
- 'feTurbulence',
268
- 'fePointLight',
269
258
  'embed',
270
259
  'hr',
271
260
  'img',
272
261
  'input',
273
- 'keygen',
274
- 'line',
275
262
  'link',
276
- 'menuitem',
277
263
  'meta',
278
- 'param',
279
- 'path',
280
- 'rect',
281
264
  'source',
282
265
  'track',
283
266
  'wbr',
284
- ];
285
- const VOID_ELEMENTS_SET = new Set(VOID_ELEMENTS);
286
- function isVoidElement(name) {
287
- return VOID_ELEMENTS_SET.has(name);
267
+ ]);
268
+ function isVoidElement(name, namespace) {
269
+ return namespace === HTML_NAMESPACE && VOID_ELEMENTS_SET.has(name.toLowerCase());
288
270
  }
289
271
 
290
272
  /*
@@ -425,9 +407,6 @@ function htmlEscape(str, attrMode = false) {
425
407
  const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
426
408
  return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
427
409
  }
428
- const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
429
- const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
430
- const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
431
410
 
432
411
  /*
433
412
  * Copyright (c) 2018, salesforce.com, inc.
@@ -436,9 +415,9 @@ const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
436
415
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
437
416
  */
438
417
  // Increment whenever the LWC template compiler changes
439
- const LWC_VERSION = "2.18.0";
418
+ const LWC_VERSION = "2.20.0";
440
419
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
441
- /** version: 2.18.0 */
420
+ /** version: 2.20.0 */
442
421
 
443
422
  /*
444
423
  * Copyright (c) 2020, salesforce.com, inc.
@@ -547,7 +526,7 @@ function setFeatureFlagForTest(name, value) {
547
526
  setFeatureFlag(name, value);
548
527
  }
549
528
  }
550
- /** version: 2.18.0 */
529
+ /** version: 2.20.0 */
551
530
 
552
531
  /* proxy-compat-disable */
553
532
 
@@ -1952,7 +1931,7 @@ const LightningElement = function () {
1952
1931
  // Linking elm, shadow root and component with the VM.
1953
1932
  associateVM(component, vm);
1954
1933
  associateVM(elm, vm);
1955
- if (vm.renderMode === 1 /* Shadow */) {
1934
+ if (vm.renderMode === 1 /* RenderMode.Shadow */) {
1956
1935
  vm.renderRoot = doAttachShadow(vm);
1957
1936
  }
1958
1937
  else {
@@ -1968,7 +1947,7 @@ const LightningElement = function () {
1968
1947
  function doAttachShadow(vm) {
1969
1948
  const { elm, mode, shadowMode, def: { ctor }, renderer: { attachShadow }, } = vm;
1970
1949
  const shadowRoot = attachShadow(elm, {
1971
- [KEY__SYNTHETIC_MODE]: shadowMode === 1 /* Synthetic */,
1950
+ [KEY__SYNTHETIC_MODE]: shadowMode === 1 /* ShadowMode.Synthetic */,
1972
1951
  delegatesFocus: Boolean(ctor.delegatesFocus),
1973
1952
  mode,
1974
1953
  });
@@ -2091,7 +2070,7 @@ LightningElement.prototype = {
2091
2070
  get template() {
2092
2071
  const vm = getAssociatedVM(this);
2093
2072
  if (process.env.NODE_ENV !== 'production') {
2094
- if (vm.renderMode === 0 /* Light */) {
2073
+ if (vm.renderMode === 0 /* RenderMode.Light */) {
2095
2074
  logError('`this.template` returns null for light DOM components. Since there is no shadow, the rendered content can be accessed via `this` itself. e.g. instead of `this.template.querySelector`, use `this.querySelector`.');
2096
2075
  }
2097
2076
  }
@@ -2463,13 +2442,13 @@ function internalWireFieldDecorator(key) {
2463
2442
  */
2464
2443
  function getClassDescriptorType(descriptor) {
2465
2444
  if (isFunction$1(descriptor.value)) {
2466
- return "method" /* Method */;
2445
+ return "method" /* DescriptorType.Method */;
2467
2446
  }
2468
2447
  else if (isFunction$1(descriptor.set) || isFunction$1(descriptor.get)) {
2469
- return "accessor" /* Accessor */;
2448
+ return "accessor" /* DescriptorType.Accessor */;
2470
2449
  }
2471
2450
  else {
2472
- return "field" /* Field */;
2451
+ return "field" /* DescriptorType.Field */;
2473
2452
  }
2474
2453
  }
2475
2454
  function validateObservedField(Ctor, fieldName, descriptor) {
@@ -2478,7 +2457,7 @@ function validateObservedField(Ctor, fieldName, descriptor) {
2478
2457
  const message = `Invalid observed ${fieldName} field. Found a duplicate ${type} with the same name.`;
2479
2458
  // [W-9927596] Ideally we always throw an error when detecting duplicate observed field.
2480
2459
  // This branch is only here for backward compatibility reasons.
2481
- if (type === "accessor" /* Accessor */) {
2460
+ if (type === "accessor" /* DescriptorType.Accessor */) {
2482
2461
  logError(message);
2483
2462
  }
2484
2463
  else {
@@ -2509,7 +2488,7 @@ function validateFieldDecoratedWithApi(Ctor, fieldName, descriptor) {
2509
2488
  const message = `Invalid @api ${fieldName} field. Found a duplicate ${type} with the same name.`;
2510
2489
  // [W-9927596] Ideally we always throw an error when detecting duplicate public properties.
2511
2490
  // This branch is only here for backward compatibility reasons.
2512
- if (type === "accessor" /* Accessor */) {
2491
+ if (type === "accessor" /* DescriptorType.Accessor */) {
2513
2492
  logError(message);
2514
2493
  }
2515
2494
  else {
@@ -3114,8 +3093,8 @@ function createComponentDef(Ctor) {
3114
3093
  // assert.isTrue(ctorName && isString(ctorName), `${toString(Ctor)} should have a "name" property with string value, but found ${ctorName}.`);
3115
3094
  assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
3116
3095
  if (!isUndefined$1(ctorShadowSupportMode)) {
3117
- assert.invariant(ctorShadowSupportMode === "any" /* Any */ ||
3118
- ctorShadowSupportMode === "reset" /* Default */, `Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
3096
+ assert.invariant(ctorShadowSupportMode === "any" /* ShadowSupportMode.Any */ ||
3097
+ ctorShadowSupportMode === "reset" /* ShadowSupportMode.Default */, `Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
3119
3098
  }
3120
3099
  if (!isUndefined$1(ctorRenderMode)) {
3121
3100
  assert.invariant(ctorRenderMode === 'light' || ctorRenderMode === 'shadow', `Invalid value for static property renderMode: '${ctorRenderMode}'. renderMode must be either 'light' or 'shadow'.`);
@@ -3143,7 +3122,7 @@ function createComponentDef(Ctor) {
3143
3122
  }
3144
3123
  let renderMode = superDef.renderMode;
3145
3124
  if (!isUndefined$1(ctorRenderMode)) {
3146
- renderMode = ctorRenderMode === 'light' ? 0 /* Light */ : 1 /* Shadow */;
3125
+ renderMode = ctorRenderMode === 'light' ? 0 /* RenderMode.Light */ : 1 /* RenderMode.Shadow */;
3147
3126
  }
3148
3127
  const template = getComponentRegisteredTemplate(Ctor) || superDef.template;
3149
3128
  const name = Ctor.name || superDef.name;
@@ -3232,8 +3211,8 @@ const lightingElementDef = {
3232
3211
  props: lightningBasedDescriptors,
3233
3212
  propsConfig: EmptyObject,
3234
3213
  methods: EmptyObject,
3235
- renderMode: 1 /* Shadow */,
3236
- shadowSupportMode: "reset" /* Default */,
3214
+ renderMode: 1 /* RenderMode.Shadow */,
3215
+ shadowSupportMode: "reset" /* ShadowSupportMode.Default */,
3237
3216
  wire: EmptyObject,
3238
3217
  bridge: BaseBridgeElement,
3239
3218
  template: defaultEmptyTemplate,
@@ -3255,7 +3234,7 @@ function getComponentDef(Ctor) {
3255
3234
  // avoid leaking the reference to the public props descriptors
3256
3235
  publicProps[key] = {
3257
3236
  config: propsConfig[key] || 0,
3258
- type: "any" /* any */,
3237
+ type: "any" /* PropDefType.any */,
3259
3238
  attr: htmlPropertyToAttribute(key),
3260
3239
  };
3261
3240
  }
@@ -3312,7 +3291,7 @@ function getUpgradableConstructor(tagName, renderer) {
3312
3291
  */
3313
3292
  function isVBaseElement(vnode) {
3314
3293
  const { type } = vnode;
3315
- return type === 2 /* Element */ || type === 3 /* CustomElement */;
3294
+ return type === 2 /* VNodeType.Element */ || type === 3 /* VNodeType.CustomElement */;
3316
3295
  }
3317
3296
  function isSameVnode(vnode1, vnode2) {
3318
3297
  return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
@@ -3568,21 +3547,21 @@ function patch(n1, n2, renderer) {
3568
3547
  }
3569
3548
  }
3570
3549
  switch (n2.type) {
3571
- case 0 /* Text */:
3550
+ case 0 /* VNodeType.Text */:
3572
3551
  // VText has no special capability, fallback to the owner's renderer
3573
3552
  patchText(n1, n2, renderer);
3574
3553
  break;
3575
- case 1 /* Comment */:
3554
+ case 1 /* VNodeType.Comment */:
3576
3555
  // VComment has no special capability, fallback to the owner's renderer
3577
3556
  patchComment(n1, n2, renderer);
3578
3557
  break;
3579
- case 4 /* Static */:
3558
+ case 4 /* VNodeType.Static */:
3580
3559
  n2.elm = n1.elm;
3581
3560
  break;
3582
- case 2 /* Element */:
3561
+ case 2 /* VNodeType.Element */:
3583
3562
  patchElement(n1, n2, (_a = n2.data.renderer) !== null && _a !== void 0 ? _a : renderer);
3584
3563
  break;
3585
- case 3 /* CustomElement */:
3564
+ case 3 /* VNodeType.CustomElement */:
3586
3565
  patchCustomElement(n1, n2, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
3587
3566
  break;
3588
3567
  }
@@ -3590,23 +3569,23 @@ function patch(n1, n2, renderer) {
3590
3569
  function mount(node, parent, renderer, anchor) {
3591
3570
  var _a, _b;
3592
3571
  switch (node.type) {
3593
- case 0 /* Text */:
3572
+ case 0 /* VNodeType.Text */:
3594
3573
  // VText has no special capability, fallback to the owner's renderer
3595
3574
  mountText(node, parent, anchor, renderer);
3596
3575
  break;
3597
- case 1 /* Comment */:
3576
+ case 1 /* VNodeType.Comment */:
3598
3577
  // VComment has no special capability, fallback to the owner's renderer
3599
3578
  mountComment(node, parent, anchor, renderer);
3600
3579
  break;
3601
- case 4 /* Static */:
3580
+ case 4 /* VNodeType.Static */:
3602
3581
  // VStatic cannot have a custom renderer associated to them, using owner's renderer
3603
3582
  mountStatic(node, parent, anchor, renderer);
3604
3583
  break;
3605
- case 2 /* Element */:
3584
+ case 2 /* VNodeType.Element */:
3606
3585
  // If the vnode data has a renderer override use it, else fallback to owner's renderer
3607
3586
  mountElement(node, parent, anchor, (_a = node.data.renderer) !== null && _a !== void 0 ? _a : renderer);
3608
3587
  break;
3609
- case 3 /* CustomElement */:
3588
+ case 3 /* VNodeType.CustomElement */:
3610
3589
  // If the vnode data has a renderer override use it, else fallback to owner's renderer
3611
3590
  mountCustomElement(node, parent, anchor, (_b = node.data.renderer) !== null && _b !== void 0 ? _b : renderer);
3612
3591
  break;
@@ -3665,12 +3644,12 @@ function mountStatic(vnode, parent, anchor, renderer) {
3665
3644
  // Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
3666
3645
  const { renderMode, shadowMode } = owner;
3667
3646
  if (isSyntheticShadowDefined) {
3668
- if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
3647
+ if (shadowMode === 1 /* ShadowMode.Synthetic */ || renderMode === 0 /* RenderMode.Light */) {
3669
3648
  elm[KEY__SHADOW_STATIC] = true;
3670
3649
  }
3671
3650
  }
3672
3651
  if (process.env.NODE_ENV !== 'production') {
3673
- const isLight = renderMode === 0 /* Light */;
3652
+ const isLight = renderMode === 0 /* RenderMode.Light */;
3674
3653
  patchElementWithRestrictions(elm, { isPortal: false, isLight });
3675
3654
  }
3676
3655
  insertNode(elm, parent, anchor, renderer);
@@ -3702,7 +3681,7 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
3702
3681
  insertNode(elm, parent, anchor, renderer);
3703
3682
  if (vm) {
3704
3683
  if (process.env.NODE_ENV !== 'production') {
3705
- assert.isTrue(vm.state === 0 /* created */, `${vm} cannot be recycled.`);
3684
+ assert.isTrue(vm.state === 0 /* VMState.created */, `${vm} cannot be recycled.`);
3706
3685
  }
3707
3686
  runConnectedCallback(vm);
3708
3687
  }
@@ -3747,14 +3726,14 @@ function unmount(vnode, parent, renderer, doRemove = false) {
3747
3726
  removeNode(elm, parent, renderer);
3748
3727
  }
3749
3728
  switch (type) {
3750
- case 2 /* Element */: {
3729
+ case 2 /* VNodeType.Element */: {
3751
3730
  // Slot content is removed to trigger slotchange event when removing slot.
3752
3731
  // Only required for synthetic shadow.
3753
- const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* Synthetic */;
3732
+ const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* ShadowMode.Synthetic */;
3754
3733
  unmountVNodes(vnode.children, elm, renderer, shouldRemoveChildren);
3755
3734
  break;
3756
3735
  }
3757
- case 3 /* CustomElement */: {
3736
+ case 3 /* VNodeType.CustomElement */: {
3758
3737
  const { vm } = vnode;
3759
3738
  // No need to unmount the children here, `removeVM` will take care of removing the
3760
3739
  // children.
@@ -3797,7 +3776,7 @@ function linkNodeToShadow(elm, owner, renderer) {
3797
3776
  const { isSyntheticShadowDefined } = renderer;
3798
3777
  // TODO [#1164]: this should eventually be done by the polyfill directly
3799
3778
  if (isSyntheticShadowDefined) {
3800
- if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
3779
+ if (shadowMode === 1 /* ShadowMode.Synthetic */ || renderMode === 0 /* RenderMode.Light */) {
3801
3780
  elm[KEY__SHADOW_RESOLVER] = renderRoot[KEY__SHADOW_RESOLVER];
3802
3781
  }
3803
3782
  }
@@ -3847,12 +3826,12 @@ function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
3847
3826
  function fallbackElmHook(elm, vnode, renderer) {
3848
3827
  const { owner } = vnode;
3849
3828
  setScopeTokenClassIfNecessary(elm, owner, renderer);
3850
- if (owner.shadowMode === 1 /* Synthetic */) {
3829
+ if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
3851
3830
  const { data: { context }, } = vnode;
3852
3831
  const { stylesheetToken } = owner.context;
3853
3832
  if (!isUndefined$1(context) &&
3854
3833
  !isUndefined$1(context.lwc) &&
3855
- context.lwc.dom === "manual" /* Manual */) {
3834
+ context.lwc.dom === "manual" /* LwcDomMode.Manual */) {
3856
3835
  // this element will now accept any manual content inserted into it
3857
3836
  observeElementChildNodes(elm);
3858
3837
  }
@@ -3866,8 +3845,8 @@ function fallbackElmHook(elm, vnode, renderer) {
3866
3845
  const { data: { context }, } = vnode;
3867
3846
  const isPortal = !isUndefined$1(context) &&
3868
3847
  !isUndefined$1(context.lwc) &&
3869
- context.lwc.dom === "manual" /* Manual */;
3870
- const isLight = owner.renderMode === 0 /* Light */;
3848
+ context.lwc.dom === "manual" /* LwcDomMode.Manual */;
3849
+ const isLight = owner.renderMode === 0 /* RenderMode.Light */;
3871
3850
  patchElementWithRestrictions(elm, { isPortal, isLight });
3872
3851
  }
3873
3852
  }
@@ -3885,7 +3864,7 @@ function allocateChildren(vnode, vm) {
3885
3864
  const children = vnode.aChildren || vnode.children;
3886
3865
  vm.aChildren = children;
3887
3866
  const { renderMode, shadowMode } = vm;
3888
- if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
3867
+ if (shadowMode === 1 /* ShadowMode.Synthetic */ || renderMode === 0 /* RenderMode.Light */) {
3889
3868
  // slow path
3890
3869
  allocateInSlot(vm, children);
3891
3870
  // save the allocated children in case this vnode is reused.
@@ -3904,7 +3883,7 @@ function createViewModelHook(elm, vnode, renderer) {
3904
3883
  }
3905
3884
  const { sel, mode, ctor, owner } = vnode;
3906
3885
  setScopeTokenClassIfNecessary(elm, owner, renderer);
3907
- if (owner.shadowMode === 1 /* Synthetic */) {
3886
+ if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
3908
3887
  const { stylesheetToken } = owner.context;
3909
3888
  // when running in synthetic shadow mode, we need to set the shadowToken value
3910
3889
  // into each element from the template, so they can be styled accordingly.
@@ -4146,7 +4125,7 @@ function addVNodeToChildLWC(vnode) {
4146
4125
  // [st]atic node
4147
4126
  function st(fragment, key) {
4148
4127
  return {
4149
- type: 4 /* Static */,
4128
+ type: 4 /* VNodeType.Static */,
4150
4129
  sel: undefined,
4151
4130
  key,
4152
4131
  elm: undefined,
@@ -4180,7 +4159,7 @@ function h(sel, data, children = EmptyArray) {
4180
4159
  let elm;
4181
4160
  const { key } = data;
4182
4161
  return {
4183
- type: 2 /* Element */,
4162
+ type: 2 /* VNodeType.Element */,
4184
4163
  sel,
4185
4164
  data,
4186
4165
  children,
@@ -4217,11 +4196,11 @@ function s(slotName, data, children, slotset) {
4217
4196
  }
4218
4197
  const vmBeingRendered = getVMBeingRendered();
4219
4198
  const { renderMode, shadowMode } = vmBeingRendered;
4220
- if (renderMode === 0 /* Light */) {
4199
+ if (renderMode === 0 /* RenderMode.Light */) {
4221
4200
  sc(children);
4222
4201
  return children;
4223
4202
  }
4224
- if (shadowMode === 1 /* Synthetic */) {
4203
+ if (shadowMode === 1 /* ShadowMode.Synthetic */) {
4225
4204
  // TODO [#1276]: compiler should give us some sort of indicator when a vnodes collection is dynamic
4226
4205
  sc(children);
4227
4206
  }
@@ -4255,7 +4234,7 @@ function c(sel, Ctor, data, children = EmptyArray) {
4255
4234
  const { key } = data;
4256
4235
  let elm, aChildren, vm;
4257
4236
  const vnode = {
4258
- type: 3 /* CustomElement */,
4237
+ type: 3 /* VNodeType.CustomElement */,
4259
4238
  sel,
4260
4239
  data,
4261
4240
  children,
@@ -4363,7 +4342,7 @@ function f(items) {
4363
4342
  function t(text) {
4364
4343
  let sel, key, elm;
4365
4344
  return {
4366
- type: 0 /* Text */,
4345
+ type: 0 /* VNodeType.Text */,
4367
4346
  sel,
4368
4347
  text,
4369
4348
  elm,
@@ -4375,7 +4354,7 @@ function t(text) {
4375
4354
  function co(text) {
4376
4355
  let sel, key, elm;
4377
4356
  return {
4378
- type: 1 /* Comment */,
4357
+ type: 1 /* VNodeType.Comment */,
4379
4358
  sel,
4380
4359
  text,
4381
4360
  elm,
@@ -4424,7 +4403,7 @@ function gid(id) {
4424
4403
  return null;
4425
4404
  }
4426
4405
  const { idx, shadowMode } = vmBeingRendered;
4427
- if (shadowMode === 1 /* Synthetic */) {
4406
+ if (shadowMode === 1 /* ShadowMode.Synthetic */) {
4428
4407
  return StringReplace.call(id, /\S+/g, (id) => `${id}-${idx}`);
4429
4408
  }
4430
4409
  return id;
@@ -4446,7 +4425,7 @@ function fid(url) {
4446
4425
  }
4447
4426
  const { idx, shadowMode } = vmBeingRendered;
4448
4427
  // Apply transformation only for fragment-only-urls, and only in shadow DOM
4449
- if (shadowMode === 1 /* Synthetic */ && /^#/.test(url)) {
4428
+ if (shadowMode === 1 /* ShadowMode.Synthetic */ && /^#/.test(url)) {
4450
4429
  return `${url}-${idx}`;
4451
4430
  }
4452
4431
  return url;
@@ -4569,7 +4548,7 @@ function createInlineStyleVNode(content) {
4569
4548
  function updateStylesheetToken(vm, template) {
4570
4549
  const { elm, context, renderMode, shadowMode, renderer: { getClassList, removeAttribute, setAttribute }, } = vm;
4571
4550
  const { stylesheets: newStylesheets, stylesheetToken: newStylesheetToken } = template;
4572
- const isSyntheticShadow = renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */;
4551
+ const isSyntheticShadow = renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */;
4573
4552
  const { hasScopedStyles } = context;
4574
4553
  let newToken;
4575
4554
  let newHasTokenInClass;
@@ -4625,19 +4604,19 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
4625
4604
  const isScopedCss = stylesheet[KEY__SCOPED_CSS];
4626
4605
  // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
4627
4606
  const scopeToken = isScopedCss ||
4628
- (vm.shadowMode === 1 /* Synthetic */ && vm.renderMode === 1 /* Shadow */)
4607
+ (vm.shadowMode === 1 /* ShadowMode.Synthetic */ && vm.renderMode === 1 /* RenderMode.Shadow */)
4629
4608
  ? stylesheetToken
4630
4609
  : undefined;
4631
4610
  // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
4632
4611
  // native shadow DOM. Synthetic shadow DOM never uses `:host`.
4633
- const useActualHostSelector = vm.renderMode === 0 /* Light */
4612
+ const useActualHostSelector = vm.renderMode === 0 /* RenderMode.Light */
4634
4613
  ? !isScopedCss
4635
- : vm.shadowMode === 0 /* Native */;
4614
+ : vm.shadowMode === 0 /* ShadowMode.Native */;
4636
4615
  // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
4637
4616
  // we use an attribute selector on the host to simulate :dir().
4638
4617
  let useNativeDirPseudoclass;
4639
- if (vm.renderMode === 1 /* Shadow */) {
4640
- useNativeDirPseudoclass = vm.shadowMode === 0 /* Native */;
4618
+ if (vm.renderMode === 1 /* RenderMode.Shadow */) {
4619
+ useNativeDirPseudoclass = vm.shadowMode === 0 /* ShadowMode.Native */;
4641
4620
  }
4642
4621
  else {
4643
4622
  // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
@@ -4646,7 +4625,7 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
4646
4625
  // Only calculate the root once as necessary
4647
4626
  root = getNearestShadowComponent(vm);
4648
4627
  }
4649
- useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0 /* Native */;
4628
+ useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0 /* ShadowMode.Native */;
4650
4629
  }
4651
4630
  ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
4652
4631
  }
@@ -4667,7 +4646,7 @@ function getStylesheetsContent(vm, template) {
4667
4646
  function getNearestShadowComponent(vm) {
4668
4647
  let owner = vm;
4669
4648
  while (!isNull(owner)) {
4670
- if (owner.renderMode === 1 /* Shadow */) {
4649
+ if (owner.renderMode === 1 /* RenderMode.Shadow */) {
4671
4650
  return owner;
4672
4651
  }
4673
4652
  owner = owner.owner;
@@ -4676,7 +4655,7 @@ function getNearestShadowComponent(vm) {
4676
4655
  }
4677
4656
  function getNearestNativeShadowComponent(vm) {
4678
4657
  const owner = getNearestShadowComponent(vm);
4679
- if (!isNull(owner) && owner.shadowMode === 1 /* Synthetic */) {
4658
+ if (!isNull(owner) && owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
4680
4659
  // Synthetic-within-native is impossible. So if the nearest shadow component is
4681
4660
  // synthetic, we know we won't find a native component if we go any further.
4682
4661
  return null;
@@ -4685,7 +4664,7 @@ function getNearestNativeShadowComponent(vm) {
4685
4664
  }
4686
4665
  function createStylesheet(vm, stylesheets) {
4687
4666
  const { renderMode, shadowMode, renderer: { ssr, insertStylesheet }, } = vm;
4688
- if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
4667
+ if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
4689
4668
  for (let i = 0; i < stylesheets.length; i++) {
4690
4669
  insertStylesheet(stylesheets[i]);
4691
4670
  }
@@ -4810,11 +4789,11 @@ function validateSlots(vm, html) {
4810
4789
  const { cmpSlots } = vm;
4811
4790
  const { slots = EmptyArray } = html;
4812
4791
  for (const slotName in cmpSlots) {
4813
- // eslint-disable-next-line lwc-internal/no-production-assert
4792
+ // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
4814
4793
  assert.isTrue(isArray$1(cmpSlots[slotName]), `Slots can only be set to an array, instead received ${toString$1(cmpSlots[slotName])} for slot "${slotName}" in ${vm}.`);
4815
4794
  if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
4816
4795
  // TODO [#1297]: this should never really happen because the compiler should always validate
4817
- // eslint-disable-next-line lwc-internal/no-production-assert
4796
+ // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
4818
4797
  logError(`Ignoring unknown provided slot name "${slotName}" in ${vm}. Check for a typo on the slot attribute.`, vm);
4819
4798
  }
4820
4799
  }
@@ -4822,7 +4801,7 @@ function validateSlots(vm, html) {
4822
4801
  function validateLightDomTemplate(template, vm) {
4823
4802
  if (template === defaultEmptyTemplate)
4824
4803
  return;
4825
- if (vm.renderMode === 0 /* Light */) {
4804
+ if (vm.renderMode === 0 /* RenderMode.Light */) {
4826
4805
  assert.isTrue(template.renderMode === 'light', `Light DOM components can't render shadow DOM templates. Add an 'lwc:render-mode="light"' directive to the root template tag of ${getComponentTag(vm)}.`);
4827
4806
  }
4828
4807
  else {
@@ -4835,13 +4814,13 @@ function buildParseFragmentFn(createFragmentFn) {
4835
4814
  return function () {
4836
4815
  const { context: { hasScopedStyles, stylesheetToken }, shadowMode, renderer, } = getVMBeingRendered();
4837
4816
  const hasStyleToken = !isUndefined$1(stylesheetToken);
4838
- const isSyntheticShadow = shadowMode === 1 /* Synthetic */;
4817
+ const isSyntheticShadow = shadowMode === 1 /* ShadowMode.Synthetic */;
4839
4818
  let cacheKey = 0;
4840
4819
  if (hasStyleToken && hasScopedStyles) {
4841
- cacheKey |= 1 /* HAS_SCOPED_STYLE */;
4820
+ cacheKey |= 1 /* FragmentCache.HAS_SCOPED_STYLE */;
4842
4821
  }
4843
4822
  if (hasStyleToken && isSyntheticShadow) {
4844
- cacheKey |= 2 /* SHADOW_MODE_SYNTHETIC */;
4823
+ cacheKey |= 2 /* FragmentCache.SHADOW_MODE_SYNTHETIC */;
4845
4824
  }
4846
4825
  if (!isUndefined$1(cache[cacheKey])) {
4847
4826
  return cache[cacheKey];
@@ -4891,7 +4870,7 @@ function evaluateTemplate(vm, html) {
4891
4870
  runWithBoundaryProtection(vm, vm.owner, () => {
4892
4871
  // pre
4893
4872
  vmBeingRendered = vm;
4894
- logOperationStart(1 /* Render */, vm);
4873
+ logOperationStart(1 /* OperationId.Render */, vm);
4895
4874
  }, () => {
4896
4875
  // job
4897
4876
  const { component, context, cmpSlots, cmpTemplate, tro } = vm;
@@ -4949,7 +4928,7 @@ function evaluateTemplate(vm, html) {
4949
4928
  // post
4950
4929
  isUpdatingTemplate = isUpdatingTemplateInception;
4951
4930
  vmBeingRendered = vmOfTemplateBeingUpdatedInception;
4952
- logOperationEnd(1 /* Render */, vm);
4931
+ logOperationEnd(1 /* OperationId.Render */, vm);
4953
4932
  });
4954
4933
  if (process.env.NODE_ENV !== 'production') {
4955
4934
  assert.invariant(isArray$1(vnodes), `Compiler should produce html functions that always return an array.`);
@@ -4988,7 +4967,7 @@ function invokeComponentCallback(vm, fn, args) {
4988
4967
  function invokeComponentConstructor(vm, Ctor) {
4989
4968
  const vmBeingConstructedInception = vmBeingConstructed;
4990
4969
  let error;
4991
- logOperationStart(0 /* Constructor */, vm);
4970
+ logOperationStart(0 /* OperationId.Constructor */, vm);
4992
4971
  vmBeingConstructed = vm;
4993
4972
  /**
4994
4973
  * Constructors don't need to be wrapped with a boundary because for root elements
@@ -5010,7 +4989,7 @@ function invokeComponentConstructor(vm, Ctor) {
5010
4989
  error = Object(e);
5011
4990
  }
5012
4991
  finally {
5013
- logOperationEnd(0 /* Constructor */, vm);
4992
+ logOperationEnd(0 /* OperationId.Constructor */, vm);
5014
4993
  vmBeingConstructed = vmBeingConstructedInception;
5015
4994
  if (!isUndefined$1(error)) {
5016
4995
  addErrorComponentStack(vm, error);
@@ -5191,12 +5170,12 @@ function rerenderVM(vm) {
5191
5170
  function connectRootElement(elm) {
5192
5171
  const vm = getAssociatedVM(elm);
5193
5172
  logGlobalOperationStart(7
5194
- /* GlobalHydrate */
5173
+ /* OperationId.GlobalHydrate */
5195
5174
  , vm); // Usually means moving the element from one place to another, which is observable via
5196
5175
  // life-cycle hooks.
5197
5176
 
5198
5177
  if (vm.state === 1
5199
- /* connected */
5178
+ /* VMState.connected */
5200
5179
  ) {
5201
5180
  disconnectRootElement(elm);
5202
5181
  }
@@ -5204,7 +5183,7 @@ function connectRootElement(elm) {
5204
5183
  runConnectedCallback(vm);
5205
5184
  rehydrate(vm);
5206
5185
  logGlobalOperationEnd(7
5207
- /* GlobalHydrate */
5186
+ /* OperationId.GlobalHydrate */
5208
5187
  , vm);
5209
5188
  }
5210
5189
  function disconnectRootElement(elm) {
@@ -5222,7 +5201,7 @@ function resetComponentStateWhenRemoved(vm) {
5222
5201
  } = vm;
5223
5202
 
5224
5203
  if (state !== 2
5225
- /* disconnected */
5204
+ /* VMState.disconnected */
5226
5205
  ) {
5227
5206
  const {
5228
5207
  oar,
@@ -5251,9 +5230,9 @@ function resetComponentStateWhenRemoved(vm) {
5251
5230
  function removeVM(vm) {
5252
5231
  if (process.env.NODE_ENV !== 'production') {
5253
5232
  assert.isTrue(vm.state === 1
5254
- /* connected */
5233
+ /* VMState.connected */
5255
5234
  || vm.state === 2
5256
- /* disconnected */
5235
+ /* VMState.disconnected */
5257
5236
  , `${vm} must have been connected.`);
5258
5237
  }
5259
5238
 
@@ -5264,7 +5243,7 @@ function getNearestShadowAncestor(vm) {
5264
5243
  let ancestor = vm.owner;
5265
5244
 
5266
5245
  while (!isNull(ancestor) && ancestor.renderMode === 0
5267
- /* Light */
5246
+ /* RenderMode.Light */
5268
5247
  ) {
5269
5248
  ancestor = ancestor.owner;
5270
5249
  }
@@ -5285,7 +5264,7 @@ function createVM(elm, ctor, renderer, options) {
5285
5264
  def,
5286
5265
  idx: idx++,
5287
5266
  state: 0
5288
- /* created */
5267
+ /* VMState.created */
5289
5268
  ,
5290
5269
  isScheduled: false,
5291
5270
  isDirty: true,
@@ -5334,7 +5313,7 @@ function createVM(elm, ctor, renderer, options) {
5334
5313
 
5335
5314
  if (runtimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
5336
5315
  vm.shadowMode = 0
5337
- /* Native */
5316
+ /* ShadowMode.Native */
5338
5317
  ;
5339
5318
  }
5340
5319
  } // Create component instance associated to the vm and the element.
@@ -5361,57 +5340,57 @@ function computeShadowMode(vm, renderer) {
5361
5340
 
5362
5341
  if (isSyntheticShadowDefined) {
5363
5342
  if (def.renderMode === 0
5364
- /* Light */
5343
+ /* RenderMode.Light */
5365
5344
  ) {
5366
5345
  // ShadowMode.Native implies "not synthetic shadow" which is consistent with how
5367
5346
  // everything defaults to native when the synthetic shadow polyfill is unavailable.
5368
5347
  shadowMode = 0
5369
- /* Native */
5348
+ /* ShadowMode.Native */
5370
5349
  ;
5371
5350
  } else if (isNativeShadowDefined) {
5372
5351
  // Not combined with above condition because @lwc/features only supports identifiers in
5373
5352
  // the if-condition.
5374
5353
  if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
5375
5354
  if (def.shadowSupportMode === "any"
5376
- /* Any */
5355
+ /* ShadowSupportMode.Any */
5377
5356
  ) {
5378
5357
  shadowMode = 0
5379
- /* Native */
5358
+ /* ShadowMode.Native */
5380
5359
  ;
5381
5360
  } else {
5382
5361
  const shadowAncestor = getNearestShadowAncestor(vm);
5383
5362
 
5384
5363
  if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === 0
5385
- /* Native */
5364
+ /* ShadowMode.Native */
5386
5365
  ) {
5387
5366
  // Transitive support for native Shadow DOM. A component in native mode
5388
5367
  // transitively opts all of its descendants into native.
5389
5368
  shadowMode = 0
5390
- /* Native */
5369
+ /* ShadowMode.Native */
5391
5370
  ;
5392
5371
  } else {
5393
5372
  // Synthetic if neither this component nor any of its ancestors are configured
5394
5373
  // to be native.
5395
5374
  shadowMode = 1
5396
- /* Synthetic */
5375
+ /* ShadowMode.Synthetic */
5397
5376
  ;
5398
5377
  }
5399
5378
  }
5400
5379
  } else {
5401
5380
  shadowMode = 1
5402
- /* Synthetic */
5381
+ /* ShadowMode.Synthetic */
5403
5382
  ;
5404
5383
  }
5405
5384
  } else {
5406
5385
  // Synthetic if there is no native Shadow DOM support.
5407
5386
  shadowMode = 1
5408
- /* Synthetic */
5387
+ /* ShadowMode.Synthetic */
5409
5388
  ;
5410
5389
  }
5411
5390
  } else {
5412
5391
  // Native if the synthetic shadow polyfill is unavailable.
5413
5392
  shadowMode = 0
5414
- /* Native */
5393
+ /* ShadowMode.Native */
5415
5394
  ;
5416
5395
  }
5417
5396
 
@@ -5471,7 +5450,7 @@ function patchShadowRoot(vm, newCh) {
5471
5450
  runWithBoundaryProtection(vm, vm, () => {
5472
5451
  // pre
5473
5452
  logOperationStart(2
5474
- /* Patch */
5453
+ /* OperationId.Patch */
5475
5454
  , vm);
5476
5455
  }, () => {
5477
5456
  // job
@@ -5479,14 +5458,14 @@ function patchShadowRoot(vm, newCh) {
5479
5458
  }, () => {
5480
5459
  // post
5481
5460
  logOperationEnd(2
5482
- /* Patch */
5461
+ /* OperationId.Patch */
5483
5462
  , vm);
5484
5463
  });
5485
5464
  }
5486
5465
  }
5487
5466
 
5488
5467
  if (vm.state === 1
5489
- /* connected */
5468
+ /* VMState.connected */
5490
5469
  ) {
5491
5470
  // If the element is connected, that means connectedCallback was already issued, and
5492
5471
  // any successive rendering should finish with the call to renderedCallback, otherwise
@@ -5520,11 +5499,11 @@ function runRenderedCallback(vm) {
5520
5499
 
5521
5500
  if (!isUndefined$1(renderedCallback)) {
5522
5501
  logOperationStart(4
5523
- /* RenderedCallback */
5502
+ /* OperationId.RenderedCallback */
5524
5503
  , vm);
5525
5504
  invokeComponentCallback(vm, renderedCallback);
5526
5505
  logOperationEnd(4
5527
- /* RenderedCallback */
5506
+ /* OperationId.RenderedCallback */
5528
5507
  , vm);
5529
5508
  }
5530
5509
  }
@@ -5532,7 +5511,7 @@ let rehydrateQueue = [];
5532
5511
 
5533
5512
  function flushRehydrationQueue() {
5534
5513
  logGlobalOperationStart(8
5535
- /* GlobalRehydrate */
5514
+ /* OperationId.GlobalRehydrate */
5536
5515
  );
5537
5516
 
5538
5517
  if (process.env.NODE_ENV !== 'production') {
@@ -5559,7 +5538,7 @@ function flushRehydrationQueue() {
5559
5538
 
5560
5539
 
5561
5540
  logGlobalOperationEnd(8
5562
- /* GlobalRehydrate */
5541
+ /* OperationId.GlobalRehydrate */
5563
5542
  ); // re-throwing the original error will break the current tick, but since the next tick is
5564
5543
  // already scheduled, it should continue patching the rest.
5565
5544
 
@@ -5568,7 +5547,7 @@ function flushRehydrationQueue() {
5568
5547
  }
5569
5548
 
5570
5549
  logGlobalOperationEnd(8
5571
- /* GlobalRehydrate */
5550
+ /* OperationId.GlobalRehydrate */
5572
5551
  );
5573
5552
  }
5574
5553
 
@@ -5578,13 +5557,13 @@ function runConnectedCallback(vm) {
5578
5557
  } = vm;
5579
5558
 
5580
5559
  if (state === 1
5581
- /* connected */
5560
+ /* VMState.connected */
5582
5561
  ) {
5583
5562
  return; // nothing to do since it was already connected
5584
5563
  }
5585
5564
 
5586
5565
  vm.state = 1
5587
- /* connected */
5566
+ /* VMState.connected */
5588
5567
  ; // reporting connection
5589
5568
 
5590
5569
  const {
@@ -5605,11 +5584,11 @@ function runConnectedCallback(vm) {
5605
5584
 
5606
5585
  if (!isUndefined$1(connectedCallback)) {
5607
5586
  logOperationStart(3
5608
- /* ConnectedCallback */
5587
+ /* OperationId.ConnectedCallback */
5609
5588
  , vm);
5610
5589
  invokeComponentCallback(vm, connectedCallback);
5611
5590
  logOperationEnd(3
5612
- /* ConnectedCallback */
5591
+ /* OperationId.ConnectedCallback */
5613
5592
  , vm);
5614
5593
  }
5615
5594
  }
@@ -5621,7 +5600,7 @@ function hasWireAdapters(vm) {
5621
5600
  function runDisconnectedCallback(vm) {
5622
5601
  if (process.env.NODE_ENV !== 'production') {
5623
5602
  assert.isTrue(vm.state !== 2
5624
- /* disconnected */
5603
+ /* VMState.disconnected */
5625
5604
  , `${vm} must be inserted.`);
5626
5605
  }
5627
5606
 
@@ -5634,7 +5613,7 @@ function runDisconnectedCallback(vm) {
5634
5613
  }
5635
5614
 
5636
5615
  vm.state = 2
5637
- /* disconnected */
5616
+ /* VMState.disconnected */
5638
5617
  ; // reporting disconnection
5639
5618
 
5640
5619
  const {
@@ -5655,11 +5634,11 @@ function runDisconnectedCallback(vm) {
5655
5634
 
5656
5635
  if (!isUndefined$1(disconnectedCallback)) {
5657
5636
  logOperationStart(5
5658
- /* DisconnectedCallback */
5637
+ /* OperationId.DisconnectedCallback */
5659
5638
  , vm);
5660
5639
  invokeComponentCallback(vm, disconnectedCallback);
5661
5640
  logOperationEnd(5
5662
- /* DisconnectedCallback */
5641
+ /* OperationId.DisconnectedCallback */
5663
5642
  , vm);
5664
5643
  }
5665
5644
  }
@@ -5715,13 +5694,13 @@ function recursivelyDisconnectChildren(vnodes) {
5715
5694
  if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
5716
5695
  switch (vnode.type) {
5717
5696
  case 2
5718
- /* Element */
5697
+ /* VNodeType.Element */
5719
5698
  :
5720
5699
  recursivelyDisconnectChildren(vnode.children);
5721
5700
  break;
5722
5701
 
5723
5702
  case 3
5724
- /* CustomElement */
5703
+ /* VNodeType.CustomElement */
5725
5704
  :
5726
5705
  {
5727
5706
  const vm = getAssociatedVM(vnode.elm);
@@ -5812,13 +5791,13 @@ function runWithBoundaryProtection(vm, owner, pre, job, post) {
5812
5791
  resetComponentRoot(vm); // remove offenders
5813
5792
 
5814
5793
  logOperationStart(6
5815
- /* ErrorCallback */
5794
+ /* OperationId.ErrorCallback */
5816
5795
  , vm); // error boundaries must have an ErrorCallback
5817
5796
 
5818
5797
  const errorCallback = errorBoundaryVm.def.errorCallback;
5819
5798
  invokeComponentCallback(errorBoundaryVm, errorCallback, [error, error.wcStack]);
5820
5799
  logOperationEnd(6
5821
- /* ErrorCallback */
5800
+ /* OperationId.ErrorCallback */
5822
5801
  , vm);
5823
5802
  }
5824
5803
  }
@@ -5896,7 +5875,7 @@ function createConfigWatcher(component, configCallback, callbackWhenConfigIsRead
5896
5875
 
5897
5876
  const computeConfigAndUpdate = () => {
5898
5877
  let config;
5899
- ro.observe(() => config = configCallback(component)); // eslint-disable-next-line lwc-internal/no-invalid-todo
5878
+ ro.observe(() => config = configCallback(component)); // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
5900
5879
  // TODO: dev-mode validation of config based on the adapter.configSchema
5901
5880
  // @ts-ignore it is assigned in the observe() callback
5902
5881
 
@@ -5938,7 +5917,7 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
5938
5917
  // guarantee that the linkage can be forged.
5939
5918
  const contextRegistrationEvent = new WireContextRegistrationEvent(adapterContextToken, {
5940
5919
  setNewContext(newContext) {
5941
- // eslint-disable-next-line lwc-internal/no-invalid-todo
5920
+ // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
5942
5921
  // TODO: dev-mode validation of config based on the adapter.contextSchema
5943
5922
  callbackWhenContextIsReady(newContext);
5944
5923
  },
@@ -6002,7 +5981,7 @@ function createConnector(vm, name, wireDef) {
6002
5981
  // (ever), while context can have identity
6003
5982
 
6004
5983
  if (vm.state === 1
6005
- /* connected */
5984
+ /* VMState.connected */
6006
5985
  ) {
6007
5986
  computeConfigAndUpdate();
6008
5987
  }
@@ -6290,7 +6269,7 @@ function freezeTemplate(tmpl) {
6290
6269
  });
6291
6270
  }
6292
6271
  }
6293
- /* version: 2.18.0 */
6272
+ /* version: 2.20.0 */
6294
6273
 
6295
6274
  /*
6296
6275
  * Copyright (c) 2020, salesforce.com, inc.
@@ -6332,10 +6311,11 @@ function unsupportedMethod(name) {
6332
6311
  throw new TypeError(`"${name}" is not supported in this environment`);
6333
6312
  };
6334
6313
  }
6335
- function createElement(name) {
6314
+ function createElement(name, namespace) {
6336
6315
  return {
6337
6316
  type: HostNodeType.Element,
6338
6317
  name,
6318
+ namespace: namespace !== null && namespace !== void 0 ? namespace : HTML_NAMESPACE,
6339
6319
  parent: null,
6340
6320
  shadowRoot: null,
6341
6321
  children: [],
@@ -6682,15 +6662,22 @@ function serializeShadowRoot(shadowRoot) {
6682
6662
  }
6683
6663
  function serializeElement(element) {
6684
6664
  let output = '';
6685
- const { name } = element;
6665
+ const { name, namespace } = element;
6666
+ const isForeignElement = namespace !== HTML_NAMESPACE;
6667
+ const hasChildren = element.children.length > 0;
6686
6668
  const attrs = element.attributes.length ? ` ${serializeAttributes(element.attributes)}` : '';
6687
- const children = serializeChildNodes(element.children);
6688
- output += `<${name}${attrs}>`;
6669
+ output += `<${name}${attrs}`;
6670
+ // Note that foreign elements can have children but not shadow roots
6671
+ if (isForeignElement && !hasChildren) {
6672
+ output += '/>';
6673
+ return output;
6674
+ }
6675
+ output += '>';
6689
6676
  if (element.shadowRoot) {
6690
6677
  output += serializeShadowRoot(element.shadowRoot);
6691
6678
  }
6692
- output += children;
6693
- if (!isVoidElement(name)) {
6679
+ output += serializeChildNodes(element.children);
6680
+ if (!isVoidElement(name, namespace) || hasChildren) {
6694
6681
  output += `</${name}>`;
6695
6682
  }
6696
6683
  return output;
@@ -6705,6 +6692,7 @@ function serializeElement(element) {
6705
6692
  const FakeRootElement = {
6706
6693
  type: HostNodeType.Element,
6707
6694
  name: 'fake-root-element',
6695
+ namespace: HTML_NAMESPACE,
6708
6696
  parent: null,
6709
6697
  shadowRoot: null,
6710
6698
  children: [],
@@ -6743,6 +6731,6 @@ function renderComponent(tagName, Ctor, props = {}) {
6743
6731
  */
6744
6732
  freeze(LightningElement);
6745
6733
  seal(LightningElement.prototype);
6746
- /* version: 2.18.0 */
6734
+ /* version: 2.20.0 */
6747
6735
 
6748
6736
  export { LightningElement, api$1 as api, createContextProvider, freezeTemplate, getComponentDef, isComponentConstructor, parseFragment, parseFragment as parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, renderer, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };