lwc 2.38.0 → 2.39.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 (64) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +223 -129
  2. package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
  3. package/dist/engine-dom/iife/es2017/engine-dom.js +223 -129
  4. package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
  5. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  6. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +174 -47
  7. package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
  8. package/dist/engine-dom/iife/es5/engine-dom.js +371 -214
  9. package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
  10. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  11. package/dist/engine-dom/iife/es5/engine-dom_debug.js +323 -160
  12. package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
  13. package/dist/engine-dom/umd/es2017/engine-dom.js +223 -129
  14. package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
  15. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  16. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +174 -47
  17. package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
  18. package/dist/engine-dom/umd/es5/engine-dom.js +371 -214
  19. package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
  20. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  21. package/dist/engine-dom/umd/es5/engine-dom_debug.js +323 -160
  22. package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
  23. package/dist/engine-server/commonjs/es2017/engine-server.js +188 -82
  24. package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
  25. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  26. package/dist/engine-server/esm/es2017/engine-server.js +188 -82
  27. package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
  28. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  29. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
  30. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
  31. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
  32. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
  33. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
  34. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  35. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
  36. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  37. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
  38. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
  39. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
  40. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
  41. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
  42. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  43. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
  44. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  45. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
  46. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  47. package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
  48. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  49. package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
  50. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  51. package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
  52. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  53. package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
  54. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  55. package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
  56. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  57. package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
  58. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  59. package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
  60. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  61. package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
  62. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  63. package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
  64. package/package.json +7 -7
@@ -351,9 +351,9 @@
351
351
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
352
352
  */
353
353
  // Increment whenever the LWC template compiler changes
354
- var LWC_VERSION = "2.38.0";
354
+ var LWC_VERSION = "2.39.0";
355
355
  var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
356
- /** version: 2.38.0 */
356
+ /** version: 2.39.0 */
357
357
 
358
358
  /**
359
359
  * Copyright (C) 2018 salesforce.com, inc.
@@ -434,7 +434,7 @@
434
434
  setFeatureFlag(name, value);
435
435
  }
436
436
  }
437
- /** version: 2.38.0 */
437
+ /** version: 2.39.0 */
438
438
 
439
439
  /**
440
440
  * Copyright (C) 2018 salesforce.com, inc.
@@ -498,7 +498,7 @@
498
498
  }
499
499
  }
500
500
  }
501
- /** version: 2.38.0 */
501
+ /** version: 2.39.0 */
502
502
 
503
503
  /*
504
504
  * Copyright (c) 2018, salesforce.com, inc.
@@ -3446,6 +3446,123 @@
3446
3446
  freeze(BaseBridgeElement);
3447
3447
  seal(BaseBridgeElement.prototype);
3448
3448
 
3449
+ /*
3450
+ * Copyright (c) 2023, salesforce.com, inc.
3451
+ * All rights reserved.
3452
+ * SPDX-License-Identifier: MIT
3453
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3454
+ */
3455
+ var supportsWeakRefs = typeof WeakRef === 'function' && typeof FinalizationRegistry === 'function';
3456
+ // In browsers that doesn't support WeakRefs, the values will still leak, but at least the keys won't
3457
+ var LegacyWeakMultiMap = /*#__PURE__*/function () {
3458
+ function LegacyWeakMultiMap() {
3459
+ _classCallCheck(this, LegacyWeakMultiMap);
3460
+ this._map = new WeakMap();
3461
+ }
3462
+ _createClass(LegacyWeakMultiMap, [{
3463
+ key: "_getValues",
3464
+ value: function _getValues(key) {
3465
+ var values = this._map.get(key);
3466
+ if (isUndefined$1(values)) {
3467
+ values = new Set();
3468
+ this._map.set(key, values);
3469
+ }
3470
+ return values;
3471
+ }
3472
+ }, {
3473
+ key: "get",
3474
+ value: function get(key) {
3475
+ return this._getValues(key);
3476
+ }
3477
+ }, {
3478
+ key: "add",
3479
+ value: function add(key, vm) {
3480
+ var set = this._getValues(key);
3481
+ set.add(vm);
3482
+ }
3483
+ }, {
3484
+ key: "delete",
3485
+ value: function _delete(key) {
3486
+ this._map.delete(key);
3487
+ }
3488
+ }]);
3489
+ return LegacyWeakMultiMap;
3490
+ }(); // This implementation relies on the WeakRef/FinalizationRegistry proposal.
3491
+ // For some background, see: https://github.com/tc39/proposal-weakrefs
3492
+ var ModernWeakMultiMap = /*#__PURE__*/function () {
3493
+ function ModernWeakMultiMap() {
3494
+ _classCallCheck(this, ModernWeakMultiMap);
3495
+ this._map = new WeakMap();
3496
+ this._registry = new FinalizationRegistry(function (weakRefs) {
3497
+ // This should be considered an optional cleanup method to remove GC'ed values from their respective arrays.
3498
+ // JS VMs are not obligated to call FinalizationRegistry callbacks.
3499
+ // Work backwards, removing stale VMs
3500
+ for (var _i13 = weakRefs.length - 1; _i13 >= 0; _i13--) {
3501
+ var vm = weakRefs[_i13].deref();
3502
+ if (isUndefined$1(vm)) {
3503
+ ArraySplice.call(weakRefs, _i13, 1); // remove
3504
+ }
3505
+ }
3506
+ });
3507
+ }
3508
+ _createClass(ModernWeakMultiMap, [{
3509
+ key: "_getWeakRefs",
3510
+ value: function _getWeakRefs(key) {
3511
+ var weakRefs = this._map.get(key);
3512
+ if (isUndefined$1(weakRefs)) {
3513
+ weakRefs = [];
3514
+ this._map.set(key, weakRefs);
3515
+ }
3516
+ return weakRefs;
3517
+ }
3518
+ }, {
3519
+ key: "get",
3520
+ value: function get(key) {
3521
+ var weakRefs = this._getWeakRefs(key);
3522
+ var result = new Set();
3523
+ var _iterator5 = _createForOfIteratorHelper(weakRefs),
3524
+ _step5;
3525
+ try {
3526
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
3527
+ var weakRef = _step5.value;
3528
+ var vm = weakRef.deref();
3529
+ if (!isUndefined$1(vm)) {
3530
+ result.add(vm);
3531
+ }
3532
+ }
3533
+ } catch (err) {
3534
+ _iterator5.e(err);
3535
+ } finally {
3536
+ _iterator5.f();
3537
+ }
3538
+ return result;
3539
+ }
3540
+ }, {
3541
+ key: "add",
3542
+ value: function add(key, value) {
3543
+ var weakRefs = this._getWeakRefs(key);
3544
+ // We could check for duplicate values here, but it doesn't seem worth it.
3545
+ // We transform the output into a Set anyway
3546
+ ArrayPush$1.call(weakRefs, new WeakRef(value));
3547
+ // It's important here not to leak the second argument, which is the "held value." The FinalizationRegistry
3548
+ // effectively creates a strong reference between the first argument (the "target") and the held value. When
3549
+ // the target is GC'ed, the callback is called, and then the held value is GC'ed.
3550
+ // Putting the key here would mean the key is not GC'ed until the value is GC'ed, which defeats the purpose
3551
+ // of the WeakMap. Whereas putting the weakRefs array here is fine, because it doesn't have a strong reference
3552
+ // to anything. See also this example:
3553
+ // https://gist.github.com/nolanlawson/79a3d36e8e6cc25c5048bb17c1795aea
3554
+ this._registry.register(value, weakRefs);
3555
+ }
3556
+ }, {
3557
+ key: "delete",
3558
+ value: function _delete(key) {
3559
+ this._map.delete(key);
3560
+ }
3561
+ }]);
3562
+ return ModernWeakMultiMap;
3563
+ }();
3564
+ var WeakMultiMap = supportsWeakRefs ? ModernWeakMultiMap : LegacyWeakMultiMap;
3565
+
3449
3566
  /*
3450
3567
  * Copyright (c) 2020, salesforce.com, inc.
3451
3568
  * All rights reserved.
@@ -3455,46 +3572,65 @@
3455
3572
  var swappedTemplateMap = new WeakMap();
3456
3573
  var swappedComponentMap = new WeakMap();
3457
3574
  var swappedStyleMap = new WeakMap();
3458
- var activeTemplates = new WeakMap();
3459
- var activeComponents = new WeakMap();
3460
- var activeStyles = new WeakMap();
3575
+ // The important thing here is the weak values – VMs are transient (one per component instance) and should be GC'ed,
3576
+ // so we don't want to create strong references to them.
3577
+ // The weak keys are kind of useless, because Templates, LightningElementConstructors, and StylesheetFactories are
3578
+ // never GC'ed. But maybe they will be someday, so we may as well use weak keys too.
3579
+ var activeTemplates = new WeakMultiMap();
3580
+ var activeComponents = new WeakMultiMap();
3581
+ var activeStyles = new WeakMultiMap();
3461
3582
  function rehydrateHotTemplate(tpl) {
3462
3583
  var list = activeTemplates.get(tpl);
3463
- if (!isUndefined$1(list)) {
3464
- list.forEach(function (vm) {
3584
+ var _iterator6 = _createForOfIteratorHelper(list),
3585
+ _step6;
3586
+ try {
3587
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
3588
+ var vm = _step6.value;
3465
3589
  if (isFalse(vm.isDirty)) {
3466
3590
  // forcing the vm to rehydrate in the micro-task:
3467
3591
  markComponentAsDirty(vm);
3468
3592
  scheduleRehydration(vm);
3469
3593
  }
3470
- });
3471
- // resetting the Set to release the memory of those vm references
3472
- // since they are not longer related to this template, instead
3594
+ }
3595
+ // Resetting the Set since these VMs are no longer related to this template, instead
3473
3596
  // they will get re-associated once these instances are rehydrated.
3474
- list.clear();
3597
+ } catch (err) {
3598
+ _iterator6.e(err);
3599
+ } finally {
3600
+ _iterator6.f();
3475
3601
  }
3602
+ activeTemplates.delete(tpl);
3476
3603
  return true;
3477
3604
  }
3478
3605
  function rehydrateHotStyle(style) {
3479
3606
  var list = activeStyles.get(style);
3480
- if (!isUndefined$1(list)) {
3481
- list.forEach(function (vm) {
3607
+ var _iterator7 = _createForOfIteratorHelper(list),
3608
+ _step7;
3609
+ try {
3610
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
3611
+ var vm = _step7.value;
3482
3612
  // if a style definition is swapped, we must reset
3483
3613
  // vm's template content in the next micro-task:
3484
3614
  forceRehydration(vm);
3485
- });
3486
- // resetting the Set to release the memory of those vm references
3487
- // since they are not longer related to this style, instead
3615
+ }
3616
+ // Resetting the Set since these VMs are no longer related to this style, instead
3488
3617
  // they will get re-associated once these instances are rehydrated.
3489
- list.clear();
3618
+ } catch (err) {
3619
+ _iterator7.e(err);
3620
+ } finally {
3621
+ _iterator7.f();
3490
3622
  }
3623
+ activeStyles.delete(style);
3491
3624
  return true;
3492
3625
  }
3493
3626
  function rehydrateHotComponent(Ctor) {
3494
3627
  var list = activeComponents.get(Ctor);
3495
3628
  var canRefreshAllInstances = true;
3496
- if (!isUndefined$1(list)) {
3497
- list.forEach(function (vm) {
3629
+ var _iterator8 = _createForOfIteratorHelper(list),
3630
+ _step8;
3631
+ try {
3632
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
3633
+ var vm = _step8.value;
3498
3634
  var owner = vm.owner;
3499
3635
  if (!isNull(owner)) {
3500
3636
  // if a component class definition is swapped, we must reset
@@ -3509,12 +3645,15 @@
3509
3645
  // for example: reload the entire page.
3510
3646
  canRefreshAllInstances = false;
3511
3647
  }
3512
- });
3513
- // resetting the Set to release the memory of those vm references
3514
- // since they are not longer related to this constructor, instead
3648
+ }
3649
+ // resetting the Set since these VMs are no longer related to this constructor, instead
3515
3650
  // they will get re-associated once these instances are rehydrated.
3516
- list.clear();
3651
+ } catch (err) {
3652
+ _iterator8.e(err);
3653
+ } finally {
3654
+ _iterator8.f();
3517
3655
  }
3656
+ activeComponents.delete(Ctor);
3518
3657
  return canRefreshAllInstances;
3519
3658
  }
3520
3659
  function getTemplateOrSwappedTemplate(tpl) {
@@ -3548,72 +3687,36 @@
3548
3687
  assertNotProd(); // this method should never leak to prod
3549
3688
  // tracking active component
3550
3689
  var Ctor = vm.def.ctor;
3551
- var componentVMs = activeComponents.get(Ctor);
3552
- if (isUndefined$1(componentVMs)) {
3553
- componentVMs = new Set();
3554
- activeComponents.set(Ctor, componentVMs);
3555
- }
3556
3690
  // this will allow us to keep track of the hot components
3557
- componentVMs.add(vm);
3691
+ activeComponents.add(Ctor, vm);
3558
3692
  // tracking active template
3559
3693
  var tpl = vm.cmpTemplate;
3560
3694
  if (tpl) {
3561
- var templateVMs = activeTemplates.get(tpl);
3562
- if (isUndefined$1(templateVMs)) {
3563
- templateVMs = new Set();
3564
- activeTemplates.set(tpl, templateVMs);
3565
- }
3566
3695
  // this will allow us to keep track of the templates that are
3567
3696
  // being used by a hot component
3568
- templateVMs.add(vm);
3697
+ activeTemplates.add(tpl, vm);
3569
3698
  // tracking active styles associated to template
3570
3699
  var stylesheets = tpl.stylesheets;
3571
3700
  if (!isUndefined$1(stylesheets)) {
3572
- flattenStylesheets(stylesheets).forEach(function (stylesheet) {
3573
- // this is necessary because we don't hold the list of styles
3574
- // in the vm, we only hold the selected (already swapped template)
3575
- // but the styles attached to the template might not be the actual
3576
- // active ones, but the swapped versions of those.
3577
- stylesheet = getStyleOrSwappedStyle(stylesheet);
3578
- var stylesheetVMs = activeStyles.get(stylesheet);
3579
- if (isUndefined$1(stylesheetVMs)) {
3580
- stylesheetVMs = new Set();
3581
- activeStyles.set(stylesheet, stylesheetVMs);
3582
- }
3583
- // this will allow us to keep track of the stylesheet that are
3584
- // being used by a hot component
3585
- stylesheetVMs.add(vm);
3586
- });
3587
- }
3588
- }
3589
- }
3590
- function removeActiveVM(vm) {
3591
- assertNotProd(); // this method should never leak to prod
3592
- // tracking inactive component
3593
- var Ctor = vm.def.ctor;
3594
- var list = activeComponents.get(Ctor);
3595
- if (!isUndefined$1(list)) {
3596
- // deleting the vm from the set to avoid leaking memory
3597
- list.delete(vm);
3598
- }
3599
- // removing inactive template
3600
- var tpl = vm.cmpTemplate;
3601
- if (tpl) {
3602
- list = activeTemplates.get(tpl);
3603
- if (!isUndefined$1(list)) {
3604
- // deleting the vm from the set to avoid leaking memory
3605
- list.delete(vm);
3606
- }
3607
- // removing active styles associated to template
3608
- var styles = tpl.stylesheets;
3609
- if (!isUndefined$1(styles)) {
3610
- flattenStylesheets(styles).forEach(function (style) {
3611
- list = activeStyles.get(style);
3612
- if (!isUndefined$1(list)) {
3613
- // deleting the vm from the set to avoid leaking memory
3614
- list.delete(vm);
3701
+ var _iterator9 = _createForOfIteratorHelper(flattenStylesheets(stylesheets)),
3702
+ _step9;
3703
+ try {
3704
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
3705
+ var stylesheet = _step9.value;
3706
+ // this is necessary because we don't hold the list of styles
3707
+ // in the vm, we only hold the selected (already swapped template)
3708
+ // but the styles attached to the template might not be the actual
3709
+ // active ones, but the swapped versions of those.
3710
+ var swappedStylesheet = getStyleOrSwappedStyle(stylesheet);
3711
+ // this will allow us to keep track of the stylesheet that are
3712
+ // being used by a hot component
3713
+ activeStyles.add(swappedStylesheet, vm);
3615
3714
  }
3616
- });
3715
+ } catch (err) {
3716
+ _iterator9.e(err);
3717
+ } finally {
3718
+ _iterator9.f();
3719
+ }
3617
3720
  }
3618
3721
  }
3619
3722
  }
@@ -3933,8 +4036,8 @@
3933
4036
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
3934
4037
  var content = [];
3935
4038
  var root;
3936
- for (var _i13 = 0; _i13 < stylesheets.length; _i13++) {
3937
- var stylesheet = stylesheets[_i13];
4039
+ for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
4040
+ var stylesheet = stylesheets[_i14];
3938
4041
  if (isArray$1(stylesheet)) {
3939
4042
  ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
3940
4043
  } else {
@@ -4040,8 +4143,8 @@
4040
4143
  shadowMode = vm.shadowMode,
4041
4144
  insertStylesheet = vm.renderer.insertStylesheet;
4042
4145
  if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
4043
- for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
4044
- insertStylesheet(stylesheets[_i14]);
4146
+ for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
4147
+ insertStylesheet(stylesheets[_i15]);
4045
4148
  }
4046
4149
  } else if (vm.hydrated) {
4047
4150
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
@@ -4054,8 +4157,8 @@
4054
4157
  var root = getNearestNativeShadowComponent(vm);
4055
4158
  // null root means a global style
4056
4159
  var target = isNull(root) ? undefined : root.shadowRoot;
4057
- for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
4058
- insertStylesheet(stylesheets[_i15], target);
4160
+ for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
4161
+ insertStylesheet(stylesheets[_i16], target);
4059
4162
  }
4060
4163
  }
4061
4164
  return null;
@@ -4369,8 +4472,8 @@
4369
4472
  return;
4370
4473
  }
4371
4474
  var setCSSStyleProperty = renderer.setCSSStyleProperty;
4372
- for (var _i16 = 0; _i16 < styleDecls.length; _i16++) {
4373
- var _styleDecls$_i = _slicedToArray(styleDecls[_i16], 3),
4475
+ for (var _i17 = 0; _i17 < styleDecls.length; _i17++) {
4476
+ var _styleDecls$_i = _slicedToArray(styleDecls[_i17], 3),
4374
4477
  prop = _styleDecls$_i[0],
4375
4478
  value = _styleDecls$_i[1],
4376
4479
  important = _styleDecls$_i[2];
@@ -4397,7 +4500,12 @@
4397
4500
  return;
4398
4501
  }
4399
4502
  if (process.env.NODE_ENV !== 'production') {
4400
- if (!isSameVnode(n1, n2)) {
4503
+ if (!isSameVnode(n1, n2) &&
4504
+ // Currently the only scenario when patch does not receive the same vnodes are for
4505
+ // dynamic components. When a dynamic component's constructor changes, the value of its
4506
+ // tag name (sel) will be different. The engine will unmount the previous element
4507
+ // and mount the new one using the new constructor in patchCustomElement.
4508
+ !(isVCustomElement(n1) && isVCustomElement(n2))) {
4401
4509
  throw new Error('Expected these VNodes to be the same: ' + JSON.stringify({
4402
4510
  sel: n1.sel,
4403
4511
  key: n1.key
@@ -4598,8 +4706,9 @@
4598
4706
  }
4599
4707
  }
4600
4708
  function patchCustomElement(n1, n2, parent, renderer) {
4709
+ // TODO [#3331]: This if branch should be removed in 246 with lwc:dynamic
4601
4710
  if (n1.ctor !== n2.ctor) {
4602
- // If the constructor, unmount the current component and mount a new one using the new
4711
+ // If the constructor differs, unmount the current component and mount a new one using the new
4603
4712
  // constructor.
4604
4713
  var anchor = renderer.nextSibling(n1.elm);
4605
4714
  unmount(n1, parent, renderer, true);
@@ -4852,8 +4961,8 @@
4852
4961
  // If no VFragment is found in children, we don't need to traverse anything or mark the children dynamic and can return early.
4853
4962
  var nodeStack = [];
4854
4963
  var fragmentFound = false;
4855
- for (var _i17 = children.length - 1; _i17 > -1; _i17 -= 1) {
4856
- var child = children[_i17];
4964
+ for (var _i18 = children.length - 1; _i18 > -1; _i18 -= 1) {
4965
+ var child = children[_i18];
4857
4966
  ArrayPush$1.call(nodeStack, child);
4858
4967
  fragmentFound = fragmentFound || !!(child && isVFragment(child));
4859
4968
  }
@@ -4865,8 +4974,8 @@
4865
4974
  if (!isNull(currentNode) && isVFragment(currentNode)) {
4866
4975
  var fChildren = currentNode.children;
4867
4976
  // Ignore the start and end text node delimiters
4868
- for (var _i18 = fChildren.length - 2; _i18 > 0; _i18 -= 1) {
4869
- ArrayPush$1.call(nodeStack, fChildren[_i18]);
4977
+ for (var _i19 = fChildren.length - 2; _i19 > 0; _i19 -= 1) {
4978
+ ArrayPush$1.call(nodeStack, fChildren[_i19]);
4870
4979
  }
4871
4980
  } else {
4872
4981
  ArrayPush$1.call(flattenedChildren, currentNode);
@@ -4905,8 +5014,8 @@
4905
5014
  var oldSlotsMapping = vm.cmpSlots.slotAssignments;
4906
5015
  var cmpSlotsMapping = create(null);
4907
5016
  // Collect all slots into cmpSlotsMapping
4908
- for (var _i19 = 0, len = children.length; _i19 < len; _i19 += 1) {
4909
- var vnode = children[_i19];
5017
+ for (var _i20 = 0, len = children.length; _i20 < len; _i20 += 1) {
5018
+ var vnode = children[_i20];
4910
5019
  if (isNull(vnode)) {
4911
5020
  continue;
4912
5021
  }
@@ -4936,8 +5045,8 @@
4936
5045
  markComponentAsDirty(vm);
4937
5046
  return;
4938
5047
  }
4939
- for (var _i20 = 0, _len2 = oldKeys.length; _i20 < _len2; _i20 += 1) {
4940
- var key = oldKeys[_i20];
5048
+ for (var _i21 = 0, _len2 = oldKeys.length; _i21 < _len2; _i21 += 1) {
5049
+ var key = oldKeys[_i21];
4941
5050
  if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
4942
5051
  markComponentAsDirty(vm);
4943
5052
  return;
@@ -5060,11 +5169,11 @@
5060
5169
  if (oldStartIdx > oldEndIdx) {
5061
5170
  // There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
5062
5171
  // already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
5063
- var _i21 = newEndIdx;
5172
+ var _i22 = newEndIdx;
5064
5173
  var n;
5065
5174
  do {
5066
- n = newCh[++_i21];
5067
- } while (!isVNode(n) && _i21 < newChEnd);
5175
+ n = newCh[++_i22];
5176
+ } while (!isVNode(n) && _i22 < newChEnd);
5068
5177
  before = isVNode(n) ? n.elm : null;
5069
5178
  mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
5070
5179
  } else {
@@ -5089,15 +5198,22 @@
5089
5198
  // if the old list is not empty, the new list MUST have the same
5090
5199
  // amount of nodes, that's why we call this static children
5091
5200
  var anchor = null;
5092
- for (var _i22 = c2Length - 1; _i22 >= 0; _i22 -= 1) {
5093
- var n1 = c1[_i22];
5094
- var n2 = c2[_i22];
5201
+ for (var _i23 = c2Length - 1; _i23 >= 0; _i23 -= 1) {
5202
+ var n1 = c1[_i23];
5203
+ var n2 = c2[_i23];
5095
5204
  if (n2 !== n1) {
5096
5205
  if (isVNode(n1)) {
5097
5206
  if (isVNode(n2)) {
5098
- // both vnodes are equivalent, and we just need to patch them
5099
- patch(n1, n2, parent, renderer);
5100
- anchor = n2.elm;
5207
+ if (isSameVnode(n1, n2)) {
5208
+ // both vnodes are equivalent, and we just need to patch them
5209
+ patch(n1, n2, parent, renderer);
5210
+ anchor = n2.elm;
5211
+ } else {
5212
+ // removing the old vnode since the new one is different
5213
+ unmount(n1, parent, renderer, true);
5214
+ mount(n2, parent, renderer, anchor);
5215
+ anchor = n2.elm;
5216
+ }
5101
5217
  } else {
5102
5218
  // removing the old vnode since the new one is null
5103
5219
  unmount(n1, parent, renderer, true);
@@ -5216,8 +5332,8 @@
5216
5332
  if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
5217
5333
  var newChildren = [];
5218
5334
  var slotAssignments = slotset.slotAssignments[slotName];
5219
- for (var _i23 = 0; _i23 < slotAssignments.length; _i23++) {
5220
- var vnode = slotAssignments[_i23];
5335
+ for (var _i24 = 0; _i24 < slotAssignments.length; _i24++) {
5336
+ var vnode = slotAssignments[_i24];
5221
5337
  if (!isNull(vnode)) {
5222
5338
  var assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
5223
5339
  // The only sniff test for a scoped <slot> element is the presence of `slotData`
@@ -5494,9 +5610,11 @@
5494
5610
  return url;
5495
5611
  }
5496
5612
  /**
5497
- * create a dynamic component via `<x-foo lwc:dynamic={Ctor}>`
5613
+ * [ddc] - create a (deprecated) dynamic component via `<x-foo lwc:dynamic={Ctor}>`
5614
+ *
5615
+ * TODO [#3331]: remove usage of lwc:dynamic in 246
5498
5616
  */
5499
- function dc(sel, Ctor, data) {
5617
+ function ddc(sel, Ctor, data) {
5500
5618
  var children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : EmptyArray;
5501
5619
  if (process.env.NODE_ENV !== 'production') {
5502
5620
  assert.isTrue(isString(sel), "dc() 1st argument sel must be a string.");
@@ -5504,7 +5622,7 @@
5504
5622
  assert.isTrue(arguments.length === 3 || isArray$1(children), "dc() 4nd argument data must be an array.");
5505
5623
  }
5506
5624
  // null or undefined values should produce a null value in the VNodes
5507
- if (Ctor == null) {
5625
+ if (isNull(Ctor) || isUndefined$1(Ctor)) {
5508
5626
  return null;
5509
5627
  }
5510
5628
  if (!isComponentConstructor(Ctor)) {
@@ -5512,6 +5630,31 @@
5512
5630
  }
5513
5631
  return c(sel, Ctor, data, children);
5514
5632
  }
5633
+ /**
5634
+ * [dc] - create a dynamic component via `<lwc:component lwc:is={Ctor}>`
5635
+ */
5636
+ function dc(Ctor, data) {
5637
+ var children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EmptyArray;
5638
+ if (process.env.NODE_ENV !== 'production') {
5639
+ assert.isTrue(isObject(data), "dc() 2nd argument data must be an object.");
5640
+ assert.isTrue(arguments.length === 3 || isArray$1(children), "dc() 3rd argument data must be an array.");
5641
+ }
5642
+ // Null or undefined values should produce a null value in the VNodes.
5643
+ // This is the only value at compile time as the constructor will not be known.
5644
+ if (isNull(Ctor) || isUndefined$1(Ctor)) {
5645
+ return null;
5646
+ }
5647
+ if (!isComponentConstructor(Ctor)) {
5648
+ throw new Error("Invalid constructor ".concat(toString$1(Ctor), " is not a LightningElement constructor."));
5649
+ }
5650
+ // Look up the dynamic component's name at runtime once the constructor is available.
5651
+ // This information is only known at runtime and is stored as part of registerComponent.
5652
+ var sel = getComponentRegisteredName(Ctor);
5653
+ if (isUndefined$1(sel) || sel === '') {
5654
+ throw new Error("Invalid LWC constructor ".concat(toString$1(Ctor), " does not have a registered name"));
5655
+ }
5656
+ return c(sel, Ctor, data, children);
5657
+ }
5515
5658
  /**
5516
5659
  * slow children collection marking mechanism. this API allows the compiler to signal
5517
5660
  * to the engine that a particular collection of children must be diffed using the slow
@@ -5573,7 +5716,8 @@
5573
5716
  gid: gid,
5574
5717
  fid: fid,
5575
5718
  shc: shc,
5576
- ssf: ssf
5719
+ ssf: ssf,
5720
+ ddc: ddc
5577
5721
  });
5578
5722
 
5579
5723
  /*
@@ -5739,23 +5883,23 @@
5739
5883
  var classAttrToken = hasScopedStyles && hasStyleToken ? " class=\"".concat(stylesheetToken, "\"") : '';
5740
5884
  var attrToken = hasStyleToken && isSyntheticShadow ? ' ' + stylesheetToken : '';
5741
5885
  var htmlFragment = '';
5742
- for (var _i24 = 0, n = keys.length; _i24 < n; _i24++) {
5743
- switch (keys[_i24]) {
5886
+ for (var _i25 = 0, n = keys.length; _i25 < n; _i25++) {
5887
+ switch (keys[_i25]) {
5744
5888
  case 0:
5745
5889
  // styleToken in existing class attr
5746
- htmlFragment += strings[_i24] + classToken;
5890
+ htmlFragment += strings[_i25] + classToken;
5747
5891
  break;
5748
5892
  case 1:
5749
5893
  // styleToken for added class attr
5750
- htmlFragment += strings[_i24] + classAttrToken;
5894
+ htmlFragment += strings[_i25] + classAttrToken;
5751
5895
  break;
5752
5896
  case 2:
5753
5897
  // styleToken as attr
5754
- htmlFragment += strings[_i24] + attrToken;
5898
+ htmlFragment += strings[_i25] + attrToken;
5755
5899
  break;
5756
5900
  case 3:
5757
5901
  // ${1}${2}
5758
- htmlFragment += strings[_i24] + classAttrToken + attrToken;
5902
+ htmlFragment += strings[_i25] + classAttrToken + attrToken;
5759
5903
  break;
5760
5904
  }
5761
5905
  }
@@ -5860,8 +6004,8 @@
5860
6004
  }
5861
6005
  function computeHasScopedStylesInStylesheets(stylesheets) {
5862
6006
  if (hasStyles(stylesheets)) {
5863
- for (var _i25 = 0; _i25 < stylesheets.length; _i25++) {
5864
- if (isTrue(stylesheets[_i25][KEY__SCOPED_CSS])) {
6007
+ for (var _i26 = 0; _i26 < stylesheets.length; _i26++) {
6008
+ if (isTrue(stylesheets[_i26][KEY__SCOPED_CSS])) {
5865
6009
  return true;
5866
6010
  }
5867
6011
  }
@@ -5974,29 +6118,34 @@
5974
6118
  * SPDX-License-Identifier: MIT
5975
6119
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5976
6120
  */
5977
- var signedTemplateMap = new Map();
6121
+ var registeredComponentMap = new Map();
5978
6122
  /**
5979
6123
  * INTERNAL: This function can only be invoked by compiled code. The compiler
5980
6124
  * will prevent this function from being imported by userland code.
5981
6125
  */
5982
6126
  function registerComponent(
5983
6127
  // We typically expect a LightningElementConstructor, but technically you can call this with anything
5984
- Ctor, _ref3) {
5985
- var tmpl = _ref3.tmpl;
6128
+ Ctor, metadata) {
5986
6129
  if (isFunction$1(Ctor)) {
5987
6130
  if (process.env.NODE_ENV !== 'production') {
5988
6131
  // There is no point in running this in production, because the version mismatch check relies
5989
6132
  // on code comments which are stripped out in production by minifiers
5990
6133
  checkVersionMismatch(Ctor, 'component');
5991
6134
  }
5992
- signedTemplateMap.set(Ctor, tmpl);
6135
+ // TODO [#3331]: add validation to check the value of metadata.sel is not an empty string.
6136
+ registeredComponentMap.set(Ctor, metadata);
5993
6137
  }
5994
6138
  // chaining this method as a way to wrap existing assignment of component constructor easily,
5995
6139
  // without too much transformation
5996
6140
  return Ctor;
5997
6141
  }
5998
6142
  function getComponentRegisteredTemplate(Ctor) {
5999
- return signedTemplateMap.get(Ctor);
6143
+ var _a;
6144
+ return (_a = registeredComponentMap.get(Ctor)) === null || _a === void 0 ? void 0 : _a.tmpl;
6145
+ }
6146
+ function getComponentRegisteredName(Ctor) {
6147
+ var _a;
6148
+ return (_a = registeredComponentMap.get(Ctor)) === null || _a === void 0 ? void 0 : _a.sel;
6000
6149
  }
6001
6150
  function getTemplateReactiveObserver(vm) {
6002
6151
  return createReactiveObserver(function () {
@@ -6059,8 +6208,8 @@
6059
6208
  if (process.env.NODE_ENV !== 'production') {
6060
6209
  assert.isTrue(isObject(service), "Invalid service declaration, ".concat(service, ": service must be an object"));
6061
6210
  }
6062
- for (var _i26 = 0; _i26 < hooks.length; ++_i26) {
6063
- var hookName = hooks[_i26];
6211
+ for (var _i27 = 0; _i27 < hooks.length; ++_i27) {
6212
+ var hookName = hooks[_i27];
6064
6213
  if (hookName in service) {
6065
6214
  var l = Services[hookName];
6066
6215
  if (isUndefined$1(l)) {
@@ -6077,8 +6226,8 @@
6077
6226
  var component = vm.component,
6078
6227
  def = vm.def,
6079
6228
  context = vm.context;
6080
- for (var _i27 = 0, len = cbs.length; _i27 < len; ++_i27) {
6081
- cbs[_i27].call(undefined, component, {}, def, context);
6229
+ for (var _i28 = 0, len = cbs.length; _i28 < len; ++_i28) {
6230
+ cbs[_i28].call(undefined, component, {}, def, context);
6082
6231
  }
6083
6232
  }
6084
6233
 
@@ -6136,9 +6285,6 @@
6136
6285
  runChildNodesDisconnectedCallback(vm);
6137
6286
  runLightChildNodesDisconnectedCallback(vm);
6138
6287
  }
6139
- if (process.env.NODE_ENV !== 'production') {
6140
- removeActiveVM(vm);
6141
- }
6142
6288
  }
6143
6289
  // this method is triggered by the diffing algo only when a vnode from the
6144
6290
  // old vnode.children is removed from the DOM.
@@ -6232,8 +6378,8 @@
6232
6378
  var valid = true;
6233
6379
  var validate = function validate(arrayOrStylesheet) {
6234
6380
  if (isArray$1(arrayOrStylesheet)) {
6235
- for (var _i28 = 0; _i28 < arrayOrStylesheet.length; _i28++) {
6236
- validate(arrayOrStylesheet[_i28]);
6381
+ for (var _i29 = 0; _i29 < arrayOrStylesheet.length; _i29++) {
6382
+ validate(arrayOrStylesheet[_i29]);
6237
6383
  }
6238
6384
  } else if (!isFunction$1(arrayOrStylesheet)) {
6239
6385
  // function assumed to be a stylesheet factory
@@ -6401,17 +6547,17 @@
6401
6547
  return a.idx - b.idx;
6402
6548
  });
6403
6549
  rehydrateQueue = []; // reset to a new queue
6404
- for (var _i29 = 0, len = vms.length; _i29 < len; _i29 += 1) {
6405
- var vm = vms[_i29];
6550
+ for (var _i30 = 0, len = vms.length; _i30 < len; _i30 += 1) {
6551
+ var vm = vms[_i30];
6406
6552
  try {
6407
6553
  rehydrate(vm);
6408
6554
  } catch (error) {
6409
- if (_i29 + 1 < len) {
6555
+ if (_i30 + 1 < len) {
6410
6556
  // pieces of the queue are still pending to be rehydrated, those should have priority
6411
6557
  if (rehydrateQueue.length === 0) {
6412
6558
  addCallbackToNextTick(flushRehydrationQueue);
6413
6559
  }
6414
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i29 + 1));
6560
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i30 + 1));
6415
6561
  }
6416
6562
  // we need to end the measure before throwing.
6417
6563
  logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
@@ -6480,8 +6626,8 @@
6480
6626
  var vCustomElementCollection = vm.velements;
6481
6627
  // Reporting disconnection for every child in inverse order since they are
6482
6628
  // inserted in reserved order.
6483
- for (var _i30 = vCustomElementCollection.length - 1; _i30 >= 0; _i30 -= 1) {
6484
- var elm = vCustomElementCollection[_i30].elm;
6629
+ for (var _i31 = vCustomElementCollection.length - 1; _i31 >= 0; _i31 -= 1) {
6630
+ var elm = vCustomElementCollection[_i31].elm;
6485
6631
  // There are two cases where the element could be undefined:
6486
6632
  // * when there is an error during the construction phase, and an error
6487
6633
  // boundary picks it, there is a possibility that the VCustomElement
@@ -6512,8 +6658,8 @@
6512
6658
  * defined on its shadow.
6513
6659
  */
6514
6660
  function recursivelyDisconnectChildren(vnodes) {
6515
- for (var _i31 = 0, len = vnodes.length; _i31 < len; _i31 += 1) {
6516
- var vnode = vnodes[_i31];
6661
+ for (var _i32 = 0, len = vnodes.length; _i32 < len; _i32 += 1) {
6662
+ var vnode = vnodes[_i32];
6517
6663
  if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
6518
6664
  switch (vnode.type) {
6519
6665
  case 2 /* VNodeType.Element */:
@@ -6534,19 +6680,30 @@
6534
6680
  // into snabbdom. Especially useful when the reset is a consequence of an error, in which case the
6535
6681
  // children VNodes might not be representing the current state of the DOM.
6536
6682
  function resetComponentRoot(vm) {
6537
- var children = vm.children,
6538
- renderRoot = vm.renderRoot,
6539
- remove = vm.renderer.remove;
6540
- for (var _i32 = 0, len = children.length; _i32 < len; _i32++) {
6541
- var child = children[_i32];
6542
- if (!isNull(child) && !isUndefined$1(child.elm)) {
6543
- remove(child.elm, renderRoot);
6544
- }
6545
- }
6683
+ recursivelyRemoveChildren(vm.children, vm);
6546
6684
  vm.children = EmptyArray;
6547
6685
  runChildNodesDisconnectedCallback(vm);
6548
6686
  vm.velements = EmptyArray;
6549
6687
  }
6688
+ // Helper function to remove all children of the root node.
6689
+ // If the set of children includes VFragment nodes, we need to remove the children of those nodes too.
6690
+ // Since VFragments can contain other VFragments, we need to traverse the entire of tree of VFragments.
6691
+ // If the set contains no VFragment nodes, no traversal is needed.
6692
+ function recursivelyRemoveChildren(vnodes, vm) {
6693
+ var renderRoot = vm.renderRoot,
6694
+ remove = vm.renderer.remove;
6695
+ for (var _i33 = 0, len = vnodes.length; _i33 < len; _i33 += 1) {
6696
+ var vnode = vnodes[_i33];
6697
+ if (!isNull(vnode)) {
6698
+ // VFragments are special; their .elm property does not point to the root element since they have no single root.
6699
+ if (isVFragment(vnode)) {
6700
+ recursivelyRemoveChildren(vnode.children, vm);
6701
+ } else if (!isUndefined$1(vnode.elm)) {
6702
+ remove(vnode.elm, renderRoot);
6703
+ }
6704
+ }
6705
+ }
6706
+ }
6550
6707
  function scheduleRehydration(vm) {
6551
6708
  if (isTrue(vm.isScheduled)) {
6552
6709
  return;
@@ -6667,17 +6824,17 @@
6667
6824
  // if our id is null or empty, nobody can reference us
6668
6825
  return;
6669
6826
  }
6670
- var _iterator5 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
6671
- _step5;
6827
+ var _iterator10 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
6828
+ _step10;
6672
6829
  try {
6673
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
6674
- var idRefAttrName = _step5.value;
6830
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
6831
+ var idRefAttrName = _step10.value;
6675
6832
  // Query all global elements with this attribute. The attribute selector syntax `~=` is for values
6676
6833
  // that reference multiple IDs, separated by whitespace.
6677
6834
  var query = "[".concat(idRefAttrName, "~=\"").concat(CSS.escape(attrValue), "\"]");
6678
6835
  var sourceElements = querySelectorAll.call(document, query);
6679
- for (var _i33 = 0; _i33 < sourceElements.length; _i33++) {
6680
- var sourceElement = sourceElements[_i33];
6836
+ for (var _i34 = 0; _i34 < sourceElements.length; _i34++) {
6837
+ var sourceElement = sourceElements[_i34];
6681
6838
  var sourceRoot = sourceElement.getRootNode();
6682
6839
  if (sourceRoot !== root) {
6683
6840
  reportViolation$1(sourceElement, elm, idRefAttrName);
@@ -6686,18 +6843,18 @@
6686
6843
  }
6687
6844
  }
6688
6845
  } catch (err) {
6689
- _iterator5.e(err);
6846
+ _iterator10.e(err);
6690
6847
  } finally {
6691
- _iterator5.f();
6848
+ _iterator10.f();
6692
6849
  }
6693
6850
  } else {
6694
6851
  // elm is the source, find the target
6695
6852
  var ids = parseIdRefAttributeValue(attrValue);
6696
- var _iterator6 = _createForOfIteratorHelper(ids),
6697
- _step6;
6853
+ var _iterator11 = _createForOfIteratorHelper(ids),
6854
+ _step11;
6698
6855
  try {
6699
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
6700
- var id = _step6.value;
6856
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
6857
+ var id = _step11.value;
6701
6858
  var target = getElementById.call(document, id);
6702
6859
  if (!isNull(target)) {
6703
6860
  var targetRoot = target.getRootNode();
@@ -6708,9 +6865,9 @@
6708
6865
  }
6709
6866
  }
6710
6867
  } catch (err) {
6711
- _iterator6.e(err);
6868
+ _iterator11.e(err);
6712
6869
  } finally {
6713
- _iterator6.f();
6870
+ _iterator11.f();
6714
6871
  }
6715
6872
  }
6716
6873
  }
@@ -6840,11 +6997,11 @@
6840
6997
  function enableDetection() {
6841
6998
  var _Element = Element,
6842
6999
  prototype = _Element.prototype;
6843
- var _iterator7 = _createForOfIteratorHelper(NON_STANDARD_ARIA_PROPS),
6844
- _step7;
7000
+ var _iterator12 = _createForOfIteratorHelper(NON_STANDARD_ARIA_PROPS),
7001
+ _step12;
6845
7002
  try {
6846
7003
  var _loop3 = function _loop3() {
6847
- var prop = _step7.value;
7004
+ var prop = _step12.value;
6848
7005
  var descriptor = getOwnPropertyDescriptor$1(prototype, prop);
6849
7006
  // The descriptor should exist because the @lwc/aria-reflection polyfill has run by now.
6850
7007
  // This happens automatically because of the ordering of imports.
@@ -6871,13 +7028,13 @@
6871
7028
  enumerable: true
6872
7029
  });
6873
7030
  };
6874
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7031
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
6875
7032
  _loop3();
6876
7033
  }
6877
7034
  } catch (err) {
6878
- _iterator7.e(err);
7035
+ _iterator12.e(err);
6879
7036
  } finally {
6880
- _iterator7.f();
7037
+ _iterator12.f();
6881
7038
  }
6882
7039
  }
6883
7040
  // No point in running this code if we're not in a browser, or if the global polyfill is not loaded
@@ -7093,8 +7250,8 @@
7093
7250
  var nextNode = node;
7094
7251
  var anchor = null;
7095
7252
  var renderer = owner.renderer;
7096
- for (var _i34 = 0; _i34 < children.length; _i34++) {
7097
- var childVnode = children[_i34];
7253
+ for (var _i35 = 0; _i35 < children.length; _i35++) {
7254
+ var childVnode = children[_i35];
7098
7255
  if (!isNull(childVnode)) {
7099
7256
  if (nextNode) {
7100
7257
  nextNode = hydrateNode(nextNode, childVnode, renderer);
@@ -7185,8 +7342,8 @@
7185
7342
  var nodesAreCompatible = true;
7186
7343
  // Validate attributes, though we could always recovery from those by running the update mods.
7187
7344
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
7188
- for (var _i35 = 0, _Object$entries = Object.entries(attrs); _i35 < _Object$entries.length; _i35++) {
7189
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i35], 2),
7345
+ for (var _i36 = 0, _Object$entries = Object.entries(attrs); _i36 < _Object$entries.length; _i36++) {
7346
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i36], 2),
7190
7347
  attrName = _Object$entries$_i[0],
7191
7348
  attrValue = _Object$entries$_i[1];
7192
7349
  var owner = vnode.owner;
@@ -7287,8 +7444,8 @@
7287
7444
  var parsedVnodeStyle = parseStyleText(elmStyle);
7288
7445
  var expectedStyle = [];
7289
7446
  // styleMap is used when style is set to static value.
7290
- for (var _i36 = 0, n = styleDecls.length; _i36 < n; _i36++) {
7291
- var _styleDecls$_i2 = _slicedToArray(styleDecls[_i36], 3),
7447
+ for (var _i37 = 0, n = styleDecls.length; _i37 < n; _i37++) {
7448
+ var _styleDecls$_i2 = _slicedToArray(styleDecls[_i37], 3),
7292
7449
  prop = _styleDecls$_i2[0],
7293
7450
  value = _styleDecls$_i2[1],
7294
7451
  important = _styleDecls$_i2[2];
@@ -7419,11 +7576,11 @@
7419
7576
  function warnOnArrayMutation(stylesheets) {
7420
7577
  // We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
7421
7578
  // we can at least warn when they use the most common mutation methods.
7422
- var _iterator8 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
7423
- _step8;
7579
+ var _iterator13 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
7580
+ _step13;
7424
7581
  try {
7425
7582
  var _loop4 = function _loop4() {
7426
- var prop = _step8.value;
7583
+ var prop = _step13.value;
7427
7584
  var originalArrayMethod = getOriginalArrayMethod(prop);
7428
7585
  stylesheets[prop] = function arrayMutationWarningWrapper() {
7429
7586
  reportTemplateViolation('stylesheets');
@@ -7431,23 +7588,23 @@
7431
7588
  return originalArrayMethod.apply(this, arguments);
7432
7589
  };
7433
7590
  };
7434
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
7591
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
7435
7592
  _loop4();
7436
7593
  }
7437
7594
  } catch (err) {
7438
- _iterator8.e(err);
7595
+ _iterator13.e(err);
7439
7596
  } finally {
7440
- _iterator8.f();
7597
+ _iterator13.f();
7441
7598
  }
7442
7599
  }
7443
7600
  // Warn if the user tries to mutate a stylesheet factory function, e.g.:
7444
7601
  // `stylesheet.$scoped$ = true`
7445
7602
  function warnOnStylesheetFunctionMutation(stylesheet) {
7446
- var _iterator9 = _createForOfIteratorHelper(STYLESHEET_PROPS),
7447
- _step9;
7603
+ var _iterator14 = _createForOfIteratorHelper(STYLESHEET_PROPS),
7604
+ _step14;
7448
7605
  try {
7449
7606
  var _loop5 = function _loop5() {
7450
- var prop = _step9.value;
7607
+ var prop = _step14.value;
7451
7608
  var value = stylesheet[prop];
7452
7609
  defineProperty(stylesheet, prop, {
7453
7610
  enumerable: true,
@@ -7461,13 +7618,13 @@
7461
7618
  }
7462
7619
  });
7463
7620
  };
7464
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
7621
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
7465
7622
  _loop5();
7466
7623
  }
7467
7624
  } catch (err) {
7468
- _iterator9.e(err);
7625
+ _iterator14.e(err);
7469
7626
  } finally {
7470
- _iterator9.f();
7627
+ _iterator14.f();
7471
7628
  }
7472
7629
  }
7473
7630
  // Warn on either array or stylesheet (function) mutation, in a deeply-nested array
@@ -7489,8 +7646,8 @@
7489
7646
  // Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
7490
7647
  function traverseStylesheets(stylesheets, callback) {
7491
7648
  callback(stylesheets);
7492
- for (var _i37 = 0; _i37 < stylesheets.length; _i37++) {
7493
- var stylesheet = stylesheets[_i37];
7649
+ for (var _i38 = 0; _i38 < stylesheets.length; _i38++) {
7650
+ var stylesheet = stylesheets[_i38];
7494
7651
  if (isArray$1(stylesheet)) {
7495
7652
  traverseStylesheets(stylesheet, callback);
7496
7653
  } else {
@@ -7502,11 +7659,11 @@
7502
7659
  if (!isUndefined$1(tmpl.stylesheets)) {
7503
7660
  trackStylesheetsMutation(tmpl.stylesheets);
7504
7661
  }
7505
- var _iterator10 = _createForOfIteratorHelper(TEMPLATE_PROPS),
7506
- _step10;
7662
+ var _iterator15 = _createForOfIteratorHelper(TEMPLATE_PROPS),
7663
+ _step15;
7507
7664
  try {
7508
7665
  var _loop6 = function _loop6() {
7509
- var prop = _step10.value;
7666
+ var prop = _step15.value;
7510
7667
  var value = tmpl[prop];
7511
7668
  defineProperty(tmpl, prop, {
7512
7669
  enumerable: true,
@@ -7522,13 +7679,13 @@
7522
7679
  }
7523
7680
  });
7524
7681
  };
7525
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
7682
+ for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
7526
7683
  _loop6();
7527
7684
  }
7528
7685
  } catch (err) {
7529
- _iterator10.e(err);
7686
+ _iterator15.e(err);
7530
7687
  } finally {
7531
- _iterator10.f();
7688
+ _iterator15.f();
7532
7689
  }
7533
7690
  var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
7534
7691
  defineProperty(tmpl, 'stylesheetTokens', {
@@ -7637,7 +7794,7 @@
7637
7794
  }
7638
7795
  return getReadOnlyProxy(obj);
7639
7796
  }
7640
- /* version: 2.38.0 */
7797
+ /* version: 2.39.0 */
7641
7798
 
7642
7799
  /*
7643
7800
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8063,7 +8220,7 @@
8063
8220
  function isNull(obj) {
8064
8221
  return obj === null;
8065
8222
  }
8066
- /** version: 2.38.0 */
8223
+ /** version: 2.39.0 */
8067
8224
 
8068
8225
  /*
8069
8226
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8074,10 +8231,10 @@
8074
8231
  var WireContextSubscriptionEvent = /*#__PURE__*/function (_CustomEvent) {
8075
8232
  _inherits(WireContextSubscriptionEvent, _CustomEvent);
8076
8233
  var _super6 = _createSuper(WireContextSubscriptionEvent);
8077
- function WireContextSubscriptionEvent(adapterToken, _ref6) {
8234
+ function WireContextSubscriptionEvent(adapterToken, _ref5) {
8078
8235
  var _this3;
8079
- var setNewContext = _ref6.setNewContext,
8080
- setDisconnectedCallback = _ref6.setDisconnectedCallback;
8236
+ var setNewContext = _ref5.setNewContext,
8237
+ setDisconnectedCallback = _ref5.setDisconnectedCallback;
8081
8238
  _classCallCheck(this, WireContextSubscriptionEvent);
8082
8239
  _this3 = _super6.call(this, adapterToken, {
8083
8240
  bubbles: true,
@@ -8161,17 +8318,17 @@
8161
8318
  exports.createFragment = function (html) {
8162
8319
  var wrapperTags = topLevelWrappingMap[getTagName(html)];
8163
8320
  if (!isUndefined(wrapperTags)) {
8164
- var _iterator11 = _createForOfIteratorHelper(wrapperTags),
8165
- _step11;
8321
+ var _iterator16 = _createForOfIteratorHelper(wrapperTags),
8322
+ _step16;
8166
8323
  try {
8167
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
8168
- var wrapperTag = _step11.value;
8324
+ for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
8325
+ var wrapperTag = _step16.value;
8169
8326
  html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
8170
8327
  }
8171
8328
  } catch (err) {
8172
- _iterator11.e(err);
8329
+ _iterator16.e(err);
8173
8330
  } finally {
8174
- _iterator11.f();
8331
+ _iterator16.f();
8175
8332
  }
8176
8333
  }
8177
8334
  // For IE11, the document title must not be undefined, but it can be an empty string
@@ -8180,7 +8337,7 @@
8180
8337
  doc.body.innerHTML = html;
8181
8338
  var content = doc.body;
8182
8339
  if (!isUndefined(wrapperTags)) {
8183
- for (var _i38 = 0; _i38 < wrapperTags.length; _i38++) {
8340
+ for (var _i39 = 0; _i39 < wrapperTags.length; _i39++) {
8184
8341
  content = content.firstChild;
8185
8342
  }
8186
8343
  }
@@ -8379,8 +8536,8 @@
8379
8536
  tagName: element.tagName.toLowerCase(),
8380
8537
  hydrated: true
8381
8538
  });
8382
- for (var _i39 = 0, _Object$entries2 = Object.entries(props); _i39 < _Object$entries2.length; _i39++) {
8383
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i39], 2),
8539
+ for (var _i40 = 0, _Object$entries2 = Object.entries(props); _i40 < _Object$entries2.length; _i40++) {
8540
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i40], 2),
8384
8541
  key = _Object$entries2$_i[0],
8385
8542
  value = _Object$entries2$_i[1];
8386
8543
  element[key] = value;
@@ -8705,7 +8862,7 @@
8705
8862
  });
8706
8863
  });
8707
8864
  }
8708
- /* version: 2.38.0 */
8865
+ /* version: 2.39.0 */
8709
8866
 
8710
8867
  exports.LightningElement = LightningElement;
8711
8868
  exports.__unstable__ProfilerControl = profilerControl;