lwc 2.6.2 → 2.7.3

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 (41) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +1114 -1054
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +1114 -1054
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +1084 -1018
  5. package/dist/engine-dom/iife/es5/engine-dom.js +1166 -999
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +1181 -1014
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +1114 -1054
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +1084 -1018
  11. package/dist/engine-dom/umd/es5/engine-dom.js +1166 -999
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +1181 -1014
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +1286 -1227
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
  16. package/dist/engine-server/esm/es2017/engine-server.js +1286 -1227
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +74 -9
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +74 -9
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +74 -9
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +78 -9
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +78 -9
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +74 -9
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +74 -9
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +78 -9
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +78 -9
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +3 -3
  34. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  35. package/dist/wire-service/iife/es5/wire-service_debug.js +3 -3
  36. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  37. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service.js +3 -3
  39. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  40. package/dist/wire-service/umd/es5/wire-service_debug.js +3 -3
  41. package/package.json +8 -8
@@ -302,7 +302,7 @@ var LWC = (function (exports) {
302
302
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
303
303
  return attributeName;
304
304
  }
305
- /** version: 2.6.2 */
305
+ /** version: 2.7.3 */
306
306
 
307
307
  /*
308
308
  * Copyright (c) 2018, salesforce.com, inc.
@@ -416,7 +416,6 @@ var LWC = (function (exports) {
416
416
  ENABLE_NODE_LIST_PATCH: null,
417
417
  ENABLE_HTML_COLLECTIONS_PATCH: null,
418
418
  ENABLE_NODE_PATCH: null,
419
- ENABLE_MIXED_SHADOW_MODE: null,
420
419
  ENABLE_WIRE_SYNC_EMIT: null
421
420
  };
422
421
 
@@ -481,7 +480,7 @@ var LWC = (function (exports) {
481
480
  setFeatureFlag(name, value);
482
481
  }
483
482
  }
484
- /** version: 2.6.2 */
483
+ /** version: 2.7.3 */
485
484
 
486
485
  /* proxy-compat-disable */
487
486
 
@@ -555,6 +554,249 @@ var LWC = (function (exports) {
555
554
  }
556
555
 
557
556
  return styleMap;
557
+ } //
558
+ // Primitives
559
+ //
560
+
561
+
562
+ let ssr$1;
563
+
564
+ function setSsr(ssrImpl) {
565
+ ssr$1 = ssrImpl;
566
+ }
567
+
568
+ let isNativeShadowDefined$1;
569
+
570
+ function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
571
+ isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
572
+ }
573
+
574
+ let isSyntheticShadowDefined$1;
575
+
576
+ function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
577
+ isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
578
+ }
579
+
580
+ let HTMLElementExported$1;
581
+
582
+ function setHTMLElement(HTMLElementImpl) {
583
+ HTMLElementExported$1 = HTMLElementImpl;
584
+ }
585
+
586
+ let isHydrating$1;
587
+
588
+ function setIsHydrating$1(isHydratingImpl) {
589
+ isHydrating$1 = isHydratingImpl;
590
+ }
591
+
592
+ let insert$1;
593
+
594
+ function setInsert(insertImpl) {
595
+ insert$1 = insertImpl;
596
+ }
597
+
598
+ let remove$1;
599
+
600
+ function setRemove(removeImpl) {
601
+ remove$1 = removeImpl;
602
+ }
603
+
604
+ let createElement$2;
605
+
606
+ function setCreateElement(createElementImpl) {
607
+ createElement$2 = createElementImpl;
608
+ }
609
+
610
+ let createText$1;
611
+
612
+ function setCreateText(createTextImpl) {
613
+ createText$1 = createTextImpl;
614
+ }
615
+
616
+ let createComment$1;
617
+
618
+ function setCreateComment(createCommentImpl) {
619
+ createComment$1 = createCommentImpl;
620
+ }
621
+
622
+ let nextSibling$1;
623
+
624
+ function setNextSibling(nextSiblingImpl) {
625
+ nextSibling$1 = nextSiblingImpl;
626
+ }
627
+
628
+ let attachShadow$1;
629
+
630
+ function setAttachShadow(attachShadowImpl) {
631
+ attachShadow$1 = attachShadowImpl;
632
+ }
633
+
634
+ let getProperty$1;
635
+
636
+ function setGetProperty(getPropertyImpl) {
637
+ getProperty$1 = getPropertyImpl;
638
+ }
639
+
640
+ let setProperty$1;
641
+
642
+ function setSetProperty(setPropertyImpl) {
643
+ setProperty$1 = setPropertyImpl;
644
+ }
645
+
646
+ let setText$1;
647
+
648
+ function setSetText(setTextImpl) {
649
+ setText$1 = setTextImpl;
650
+ }
651
+
652
+ let getAttribute$1;
653
+
654
+ function setGetAttribute(getAttributeImpl) {
655
+ getAttribute$1 = getAttributeImpl;
656
+ }
657
+
658
+ let setAttribute$1;
659
+
660
+ function setSetAttribute(setAttributeImpl) {
661
+ setAttribute$1 = setAttributeImpl;
662
+ }
663
+
664
+ let removeAttribute$1;
665
+
666
+ function setRemoveAttribute(removeAttributeImpl) {
667
+ removeAttribute$1 = removeAttributeImpl;
668
+ }
669
+
670
+ let addEventListener$1;
671
+
672
+ function setAddEventListener(addEventListenerImpl) {
673
+ addEventListener$1 = addEventListenerImpl;
674
+ }
675
+
676
+ let removeEventListener$1;
677
+
678
+ function setRemoveEventListener(removeEventListenerImpl) {
679
+ removeEventListener$1 = removeEventListenerImpl;
680
+ }
681
+
682
+ let dispatchEvent$1;
683
+
684
+ function setDispatchEvent(dispatchEventImpl) {
685
+ dispatchEvent$1 = dispatchEventImpl;
686
+ }
687
+
688
+ let getClassList$1;
689
+
690
+ function setGetClassList(getClassListImpl) {
691
+ getClassList$1 = getClassListImpl;
692
+ }
693
+
694
+ let setCSSStyleProperty$1;
695
+
696
+ function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
697
+ setCSSStyleProperty$1 = setCSSStylePropertyImpl;
698
+ }
699
+
700
+ let getBoundingClientRect$1;
701
+
702
+ function setGetBoundingClientRect(getBoundingClientRectImpl) {
703
+ getBoundingClientRect$1 = getBoundingClientRectImpl;
704
+ }
705
+
706
+ let querySelector$1;
707
+
708
+ function setQuerySelector(querySelectorImpl) {
709
+ querySelector$1 = querySelectorImpl;
710
+ }
711
+
712
+ let querySelectorAll$1;
713
+
714
+ function setQuerySelectorAll(querySelectorAllImpl) {
715
+ querySelectorAll$1 = querySelectorAllImpl;
716
+ }
717
+
718
+ let getElementsByTagName$1;
719
+
720
+ function setGetElementsByTagName(getElementsByTagNameImpl) {
721
+ getElementsByTagName$1 = getElementsByTagNameImpl;
722
+ }
723
+
724
+ let getElementsByClassName$1;
725
+
726
+ function setGetElementsByClassName(getElementsByClassNameImpl) {
727
+ getElementsByClassName$1 = getElementsByClassNameImpl;
728
+ }
729
+
730
+ let getChildren$1;
731
+
732
+ function setGetChildren(getChildrenImpl) {
733
+ getChildren$1 = getChildrenImpl;
734
+ }
735
+
736
+ let getChildNodes$1;
737
+
738
+ function setGetChildNodes(getChildNodesImpl) {
739
+ getChildNodes$1 = getChildNodesImpl;
740
+ }
741
+
742
+ let getFirstChild$1;
743
+
744
+ function setGetFirstChild(getFirstChildImpl) {
745
+ getFirstChild$1 = getFirstChildImpl;
746
+ }
747
+
748
+ let getFirstElementChild$1;
749
+
750
+ function setGetFirstElementChild(getFirstElementChildImpl) {
751
+ getFirstElementChild$1 = getFirstElementChildImpl;
752
+ }
753
+
754
+ let getLastChild$1;
755
+
756
+ function setGetLastChild(getLastChildImpl) {
757
+ getLastChild$1 = getLastChildImpl;
758
+ }
759
+
760
+ let getLastElementChild$1;
761
+
762
+ function setGetLastElementChild(getLastElementChildImpl) {
763
+ getLastElementChild$1 = getLastElementChildImpl;
764
+ }
765
+
766
+ let isConnected$1;
767
+
768
+ function setIsConnected(isConnectedImpl) {
769
+ isConnected$1 = isConnectedImpl;
770
+ }
771
+
772
+ let insertGlobalStylesheet$1;
773
+
774
+ function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
775
+ insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
776
+ }
777
+
778
+ let insertStylesheet$1;
779
+
780
+ function setInsertStylesheet(insertStylesheetImpl) {
781
+ insertStylesheet$1 = insertStylesheetImpl;
782
+ }
783
+
784
+ let assertInstanceOfHTMLElement$1;
785
+
786
+ function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
787
+ assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
788
+ }
789
+
790
+ let defineCustomElement$1;
791
+
792
+ function setDefineCustomElement(defineCustomElementImpl) {
793
+ defineCustomElement$1 = defineCustomElementImpl;
794
+ }
795
+
796
+ let getCustomElement$1;
797
+
798
+ function setGetCustomElement(getCustomElementImpl) {
799
+ getCustomElement$1 = getCustomElementImpl;
558
800
  }
559
801
  /*
560
802
  * Copyright (c) 2019, salesforce.com, inc.
@@ -677,619 +919,93 @@ var LWC = (function (exports) {
677
919
 
678
920
  }
679
921
  /*
680
- * Copyright (c) 2018, salesforce.com, inc.
681
- * All rights reserved.
682
- * SPDX-License-Identifier: MIT
683
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
684
- */
685
-
686
-
687
- function componentValueMutated(vm, key) {
688
- valueMutated(vm.component, key);
689
- }
690
-
691
- function componentValueObserved(vm, key) {
692
- valueObserved(vm.component, key);
693
- }
694
- /*
695
- * Copyright (c) 2018, salesforce.com, inc.
696
- * All rights reserved.
697
- * SPDX-License-Identifier: MIT
698
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
699
- */
700
-
701
-
702
- function getComponentTag(vm) {
703
- return `<${StringToLowerCase.call(vm.tagName)}>`;
704
- } // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
705
-
706
-
707
- function getComponentStack(vm) {
708
- const stack = [];
709
- let prefix = '';
710
-
711
- while (!isNull(vm.owner)) {
712
- ArrayPush$1.call(stack, prefix + getComponentTag(vm));
713
- vm = vm.owner;
714
- prefix += '\t';
715
- }
716
-
717
- return ArrayJoin.call(stack, '\n');
718
- }
719
-
720
- function getErrorComponentStack(vm) {
721
- const wcStack = [];
722
- let currentVm = vm;
723
-
724
- while (!isNull(currentVm)) {
725
- ArrayPush$1.call(wcStack, getComponentTag(currentVm));
726
- currentVm = currentVm.owner;
727
- }
728
-
729
- return wcStack.reverse().join('\n\t');
730
- }
731
- /*
732
- * Copyright (c) 2018, salesforce.com, inc.
733
- * All rights reserved.
734
- * SPDX-License-Identifier: MIT
735
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
736
- */
737
-
738
-
739
- function log(method, message, vm) {
740
- let msg = `[LWC ${method}]: ${message}`;
741
-
742
- if (!isUndefined$1(vm)) {
743
- msg = `${msg}\n${getComponentStack(vm)}`;
744
- }
745
-
746
- if (process.env.NODE_ENV === 'test') {
747
- /* eslint-disable-next-line no-console */
748
- console[method](msg);
749
- return;
750
- }
751
-
752
- try {
753
- throw new Error(msg);
754
- } catch (e) {
755
- /* eslint-disable-next-line no-console */
756
- console[method](e);
757
- }
758
- }
759
-
760
- function logError(message, vm) {
761
- log('error', message, vm);
762
- }
763
-
764
- function logWarn(message, vm) {
765
- log('warn', message, vm);
766
- }
767
- /*
768
- * Copyright (c) 2018, salesforce.com, inc.
769
- * All rights reserved.
770
- * SPDX-License-Identifier: MIT
771
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
772
- */
773
-
774
-
775
- function handleEvent(event, vnode) {
776
- const {
777
- type
778
- } = event;
779
- const {
780
- data: {
781
- on
782
- }
783
- } = vnode;
784
- const handler = on && on[type]; // call event handler if exists
785
-
786
- if (handler) {
787
- handler.call(undefined, event);
788
- }
789
- }
790
-
791
- function createListener() {
792
- return function handler(event) {
793
- handleEvent(event, handler.vnode);
794
- };
795
- }
796
-
797
- function updateAllEventListeners(oldVnode, vnode) {
798
- if (isUndefined$1(oldVnode.listener)) {
799
- createAllEventListeners(vnode);
800
- } else {
801
- vnode.listener = oldVnode.listener;
802
- vnode.listener.vnode = vnode;
803
- }
804
- }
805
-
806
- function createAllEventListeners(vnode) {
807
- const {
808
- elm,
809
- data: {
810
- on
811
- },
812
- owner: {
813
- renderer
814
- }
815
- } = vnode;
816
-
817
- if (isUndefined$1(on)) {
818
- return;
819
- }
820
-
821
- const listener = vnode.listener = createListener();
822
- listener.vnode = vnode;
823
- let name;
824
-
825
- for (name in on) {
826
- renderer.addEventListener(elm, name, listener);
827
- }
828
- }
829
-
830
- var modEvents = {
831
- update: updateAllEventListeners,
832
- create: createAllEventListeners
833
- };
834
- /*
835
- * Copyright (c) 2018, salesforce.com, inc.
836
- * All rights reserved.
837
- * SPDX-License-Identifier: MIT
838
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
839
- */
840
-
841
- const defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
842
-
843
- function offsetPropertyErrorMessage(name) {
844
- return `Using the \`${name}\` property is an anti-pattern because it rounds the value to an integer. Instead, use the \`getBoundingClientRect\` method to obtain fractional values for the size of an element and its position relative to the viewport.`;
845
- } // Global HTML Attributes & Properties
846
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
847
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
848
-
849
-
850
- const globalHTMLProperties = assign(create(null), {
851
- accessKey: {
852
- attribute: 'accesskey'
853
- },
854
- accessKeyLabel: {
855
- readOnly: true
856
- },
857
- className: {
858
- attribute: 'class',
859
- error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.'
860
- },
861
- contentEditable: {
862
- attribute: 'contenteditable'
863
- },
864
- dataset: {
865
- readOnly: true,
866
- error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead."
867
- },
868
- dir: {
869
- attribute: 'dir'
870
- },
871
- draggable: {
872
- attribute: 'draggable'
873
- },
874
- dropzone: {
875
- attribute: 'dropzone',
876
- readOnly: true
877
- },
878
- hidden: {
879
- attribute: 'hidden'
880
- },
881
- id: {
882
- attribute: 'id'
883
- },
884
- inputMode: {
885
- attribute: 'inputmode'
886
- },
887
- lang: {
888
- attribute: 'lang'
889
- },
890
- slot: {
891
- attribute: 'slot',
892
- error: 'Using the `slot` property is an anti-pattern.'
893
- },
894
- spellcheck: {
895
- attribute: 'spellcheck'
896
- },
897
- style: {
898
- attribute: 'style'
899
- },
900
- tabIndex: {
901
- attribute: 'tabindex'
902
- },
903
- title: {
904
- attribute: 'title'
905
- },
906
- translate: {
907
- attribute: 'translate'
908
- },
909
- // additional "global attributes" that are not present in the link above.
910
- isContentEditable: {
911
- readOnly: true
912
- },
913
- offsetHeight: {
914
- readOnly: true,
915
- error: offsetPropertyErrorMessage('offsetHeight')
916
- },
917
- offsetLeft: {
918
- readOnly: true,
919
- error: offsetPropertyErrorMessage('offsetLeft')
920
- },
921
- offsetParent: {
922
- readOnly: true
923
- },
924
- offsetTop: {
925
- readOnly: true,
926
- error: offsetPropertyErrorMessage('offsetTop')
927
- },
928
- offsetWidth: {
929
- readOnly: true,
930
- error: offsetPropertyErrorMessage('offsetWidth')
931
- },
932
- role: {
933
- attribute: 'role'
934
- }
935
- });
936
- let controlledElement = null;
937
- let controlledAttributeName;
938
-
939
- function isAttributeLocked(elm, attrName) {
940
- return elm !== controlledElement || attrName !== controlledAttributeName;
941
- }
942
-
943
- function lockAttribute(_elm, _key) {
944
- controlledElement = null;
945
- controlledAttributeName = undefined;
946
- }
947
-
948
- function unlockAttribute(elm, key) {
949
- controlledElement = elm;
950
- controlledAttributeName = key;
951
- }
952
- /*
953
- * Copyright (c) 2018, salesforce.com, inc.
954
- * All rights reserved.
955
- * SPDX-License-Identifier: MIT
956
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
957
- */
958
-
959
-
960
- const xlinkNS = 'http://www.w3.org/1999/xlink';
961
- const xmlNS = 'http://www.w3.org/XML/1998/namespace';
962
- const ColonCharCode = 58;
963
-
964
- function updateAttrs(oldVnode, vnode) {
965
- const {
966
- data: {
967
- attrs
968
- },
969
- owner: {
970
- renderer
971
- }
972
- } = vnode;
973
-
974
- if (isUndefined$1(attrs)) {
975
- return;
976
- }
977
-
978
- let {
979
- data: {
980
- attrs: oldAttrs
981
- }
982
- } = oldVnode;
983
-
984
- if (oldAttrs === attrs) {
985
- return;
986
- }
987
-
988
- if (process.env.NODE_ENV !== 'production') {
989
- assert.invariant(isUndefined$1(oldAttrs) || keys(oldAttrs).join(',') === keys(attrs).join(','), `vnode.data.attrs cannot change shape.`);
990
- }
991
-
992
- const elm = vnode.elm;
993
- const {
994
- setAttribute,
995
- removeAttribute
996
- } = renderer;
997
- let key;
998
- oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
999
- // this routine is only useful for data-* attributes in all kind of elements
1000
- // and aria-* in standard elements (custom elements will use props for these)
1001
-
1002
- for (key in attrs) {
1003
- const cur = attrs[key];
1004
- const old = oldAttrs[key];
1005
-
1006
- if (old !== cur) {
1007
- unlockAttribute(elm, key);
1008
-
1009
- if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
1010
- // Assume xml namespace
1011
- setAttribute(elm, key, cur, xmlNS);
1012
- } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
1013
- // Assume xlink namespace
1014
- setAttribute(elm, key, cur, xlinkNS);
1015
- } else if (isNull(cur)) {
1016
- removeAttribute(elm, key);
1017
- } else {
1018
- setAttribute(elm, key, cur);
1019
- }
1020
-
1021
- lockAttribute();
1022
- }
1023
- }
1024
- }
1025
-
1026
- const emptyVNode$3 = {
1027
- data: {}
1028
- };
1029
- var modAttrs = {
1030
- create: vnode => updateAttrs(emptyVNode$3, vnode),
1031
- update: updateAttrs
1032
- };
1033
- /*
1034
- * Copyright (c) 2018, salesforce.com, inc.
1035
- * All rights reserved.
1036
- * SPDX-License-Identifier: MIT
1037
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1038
- */
1039
-
1040
- function isLiveBindingProp(sel, key) {
1041
- // For properties with live bindings, we read values from the DOM element
1042
- // instead of relying on internally tracked values.
1043
- return sel === 'input' && (key === 'value' || key === 'checked');
1044
- }
1045
-
1046
- function update(oldVnode, vnode) {
1047
- const props = vnode.data.props;
1048
-
1049
- if (isUndefined$1(props)) {
1050
- return;
1051
- }
1052
-
1053
- const oldProps = oldVnode.data.props;
1054
-
1055
- if (oldProps === props) {
1056
- return;
1057
- }
1058
-
1059
- if (process.env.NODE_ENV !== 'production') {
1060
- assert.invariant(isUndefined$1(oldProps) || keys(oldProps).join(',') === keys(props).join(','), 'vnode.data.props cannot change shape.');
1061
- }
1062
-
1063
- const isFirstPatch = isUndefined$1(oldProps);
1064
- const {
1065
- elm,
1066
- sel,
1067
- owner: {
1068
- renderer
1069
- }
1070
- } = vnode;
1071
-
1072
- for (const key in props) {
1073
- const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
1074
-
1075
- if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? renderer.getProperty(elm, key) : oldProps[key])) {
1076
- renderer.setProperty(elm, key, cur);
1077
- }
1078
- }
1079
- }
1080
-
1081
- const emptyVNode$2 = {
1082
- data: {}
1083
- };
1084
- var modProps = {
1085
- create: vnode => update(emptyVNode$2, vnode),
1086
- update
1087
- };
1088
- /*
1089
- * Copyright (c) 2018, salesforce.com, inc.
1090
- * All rights reserved.
1091
- * SPDX-License-Identifier: MIT
1092
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1093
- */
1094
-
1095
- const classNameToClassMap = create(null);
1096
-
1097
- function getMapFromClassName(className) {
1098
- // Intentionally using == to match undefined and null values from computed style attribute
1099
- if (className == null) {
1100
- return EmptyObject;
1101
- } // computed class names must be string
1102
-
1103
-
1104
- className = isString(className) ? className : className + '';
1105
- let map = classNameToClassMap[className];
1106
-
1107
- if (map) {
1108
- return map;
1109
- }
1110
-
1111
- map = create(null);
1112
- let start = 0;
1113
- let o;
1114
- const len = className.length;
1115
-
1116
- for (o = 0; o < len; o++) {
1117
- if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
1118
- if (o > start) {
1119
- map[StringSlice.call(className, start, o)] = true;
1120
- }
1121
-
1122
- start = o + 1;
1123
- }
1124
- }
1125
-
1126
- if (o > start) {
1127
- map[StringSlice.call(className, start, o)] = true;
1128
- }
1129
-
1130
- classNameToClassMap[className] = map;
1131
-
1132
- if (process.env.NODE_ENV !== 'production') {
1133
- // just to make sure that this object never changes as part of the diffing algo
1134
- freeze(map);
1135
- }
1136
-
1137
- return map;
1138
- }
1139
-
1140
- function updateClassAttribute(oldVnode, vnode) {
1141
- const {
1142
- elm,
1143
- data: {
1144
- className: newClass
1145
- },
1146
- owner: {
1147
- renderer
1148
- }
1149
- } = vnode;
1150
- const {
1151
- data: {
1152
- className: oldClass
1153
- }
1154
- } = oldVnode;
1155
-
1156
- if (oldClass === newClass) {
1157
- return;
1158
- }
1159
-
1160
- const classList = renderer.getClassList(elm);
1161
- const newClassMap = getMapFromClassName(newClass);
1162
- const oldClassMap = getMapFromClassName(oldClass);
1163
- let name;
1164
-
1165
- for (name in oldClassMap) {
1166
- // remove only if it is not in the new class collection and it is not set from within the instance
1167
- if (isUndefined$1(newClassMap[name])) {
1168
- classList.remove(name);
1169
- }
1170
- }
1171
-
1172
- for (name in newClassMap) {
1173
- if (isUndefined$1(oldClassMap[name])) {
1174
- classList.add(name);
1175
- }
1176
- }
1177
- }
1178
-
1179
- const emptyVNode$1 = {
1180
- data: {}
1181
- };
1182
- var modComputedClassName = {
1183
- create: vnode => updateClassAttribute(emptyVNode$1, vnode),
1184
- update: updateClassAttribute
1185
- };
1186
- /*
1187
- * Copyright (c) 2018, salesforce.com, inc.
1188
- * All rights reserved.
1189
- * SPDX-License-Identifier: MIT
1190
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1191
- */
1192
-
1193
- function updateStyleAttribute(oldVnode, vnode) {
1194
- const {
1195
- elm,
1196
- data: {
1197
- style: newStyle
1198
- },
1199
- owner: {
1200
- renderer
1201
- }
1202
- } = vnode;
1203
- const {
1204
- setAttribute,
1205
- removeAttribute
1206
- } = renderer;
922
+ * Copyright (c) 2018, salesforce.com, inc.
923
+ * All rights reserved.
924
+ * SPDX-License-Identifier: MIT
925
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
926
+ */
1207
927
 
1208
- if (oldVnode.data.style === newStyle) {
1209
- return;
1210
- }
1211
928
 
1212
- if (!isString(newStyle) || newStyle === '') {
1213
- removeAttribute(elm, 'style');
1214
- } else {
1215
- setAttribute(elm, 'style', newStyle);
1216
- }
929
+ function componentValueMutated(vm, key) {
930
+ valueMutated(vm.component, key);
1217
931
  }
1218
932
 
1219
- const emptyVNode = {
1220
- data: {}
1221
- };
1222
- var modComputedStyle = {
1223
- create: vnode => updateStyleAttribute(emptyVNode, vnode),
1224
- update: updateStyleAttribute
1225
- };
933
+ function componentValueObserved(vm, key) {
934
+ valueObserved(vm.component, key);
935
+ }
1226
936
  /*
1227
937
  * Copyright (c) 2018, salesforce.com, inc.
1228
938
  * All rights reserved.
1229
939
  * SPDX-License-Identifier: MIT
1230
940
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1231
941
  */
1232
- // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
1233
- // different classnames properties individually instead of via a string.
1234
942
 
1235
- function createClassAttribute(vnode) {
1236
- const {
1237
- elm,
1238
- data: {
1239
- classMap
1240
- },
1241
- owner: {
1242
- renderer
1243
- }
1244
- } = vnode;
1245
943
 
1246
- if (isUndefined$1(classMap)) {
1247
- return;
1248
- }
944
+ function getComponentTag(vm) {
945
+ return `<${StringToLowerCase.call(vm.tagName)}>`;
946
+ } // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
1249
947
 
1250
- const classList = renderer.getClassList(elm);
1251
948
 
1252
- for (const name in classMap) {
1253
- classList.add(name);
949
+ function getComponentStack(vm) {
950
+ const stack = [];
951
+ let prefix = '';
952
+
953
+ while (!isNull(vm.owner)) {
954
+ ArrayPush$1.call(stack, prefix + getComponentTag(vm));
955
+ vm = vm.owner;
956
+ prefix += '\t';
1254
957
  }
958
+
959
+ return ArrayJoin.call(stack, '\n');
1255
960
  }
1256
961
 
1257
- var modStaticClassName = {
1258
- create: createClassAttribute
1259
- };
962
+ function getErrorComponentStack(vm) {
963
+ const wcStack = [];
964
+ let currentVm = vm;
965
+
966
+ while (!isNull(currentVm)) {
967
+ ArrayPush$1.call(wcStack, getComponentTag(currentVm));
968
+ currentVm = currentVm.owner;
969
+ }
970
+
971
+ return wcStack.reverse().join('\n\t');
972
+ }
1260
973
  /*
1261
974
  * Copyright (c) 2018, salesforce.com, inc.
1262
975
  * All rights reserved.
1263
976
  * SPDX-License-Identifier: MIT
1264
977
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1265
978
  */
1266
- // The compiler takes care of transforming the inline style into an object. It's faster to set the
1267
- // different style properties individually instead of via a string.
1268
979
 
1269
- function createStyleAttribute(vnode) {
1270
- const {
1271
- elm,
1272
- data: {
1273
- styleDecls
1274
- },
1275
- owner: {
1276
- renderer
1277
- }
1278
- } = vnode;
1279
980
 
1280
- if (isUndefined$1(styleDecls)) {
981
+ function log(method, message, vm) {
982
+ let msg = `[LWC ${method}]: ${message}`;
983
+
984
+ if (!isUndefined$1(vm)) {
985
+ msg = `${msg}\n${getComponentStack(vm)}`;
986
+ }
987
+
988
+ if (process.env.NODE_ENV === 'test') {
989
+ /* eslint-disable-next-line no-console */
990
+ console[method](msg);
1281
991
  return;
1282
992
  }
1283
993
 
1284
- for (let i = 0; i < styleDecls.length; i++) {
1285
- const [prop, value, important] = styleDecls[i];
1286
- renderer.setCSSStyleProperty(elm, prop, value, important);
994
+ try {
995
+ throw new Error(msg);
996
+ } catch (e) {
997
+ /* eslint-disable-next-line no-console */
998
+ console[method](e);
1287
999
  }
1288
1000
  }
1289
1001
 
1290
- var modStaticStyle = {
1291
- create: createStyleAttribute
1292
- };
1002
+ function logError(message, vm) {
1003
+ log('error', message, vm);
1004
+ }
1005
+
1006
+ function logWarn(message, vm) {
1007
+ log('warn', message, vm);
1008
+ }
1293
1009
  /*
1294
1010
  * Copyright (c) 2018, salesforce.com, inc.
1295
1011
  * All rights reserved.
@@ -1297,14 +1013,6 @@ var LWC = (function (exports) {
1297
1013
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1298
1014
  */
1299
1015
 
1300
- /**
1301
- @license
1302
- Copyright (c) 2015 Simon Friis Vindum.
1303
- This code may only be used under the MIT License found at
1304
- https://github.com/snabbdom/snabbdom/blob/master/LICENSE
1305
- Code distributed by Snabbdom as part of the Snabbdom project at
1306
- https://github.com/snabbdom/snabbdom/
1307
- */
1308
1016
 
1309
1017
  function isUndef(s) {
1310
1018
  return s === undefined;
@@ -1393,7 +1101,7 @@ var LWC = (function (exports) {
1393
1101
  } else if (sameVnode(oldStartVnode, newEndVnode)) {
1394
1102
  // Vnode moved right
1395
1103
  patchVnode(oldStartVnode, newEndVnode);
1396
- newEndVnode.hook.move(oldStartVnode, parentElm, oldEndVnode.owner.renderer.nextSibling(oldEndVnode.elm));
1104
+ newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
1397
1105
  oldStartVnode = oldCh[++oldStartIdx];
1398
1106
  newEndVnode = newCh[--newEndIdx];
1399
1107
  } else if (sameVnode(oldEndVnode, newStartVnode)) {
@@ -1513,6 +1221,125 @@ var LWC = (function (exports) {
1513
1221
  */
1514
1222
 
1515
1223
 
1224
+ const defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
1225
+
1226
+ function offsetPropertyErrorMessage(name) {
1227
+ return `Using the \`${name}\` property is an anti-pattern because it rounds the value to an integer. Instead, use the \`getBoundingClientRect\` method to obtain fractional values for the size of an element and its position relative to the viewport.`;
1228
+ } // Global HTML Attributes & Properties
1229
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
1230
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
1231
+
1232
+
1233
+ const globalHTMLProperties = assign(create(null), {
1234
+ accessKey: {
1235
+ attribute: 'accesskey'
1236
+ },
1237
+ accessKeyLabel: {
1238
+ readOnly: true
1239
+ },
1240
+ className: {
1241
+ attribute: 'class',
1242
+ error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.'
1243
+ },
1244
+ contentEditable: {
1245
+ attribute: 'contenteditable'
1246
+ },
1247
+ dataset: {
1248
+ readOnly: true,
1249
+ error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead."
1250
+ },
1251
+ dir: {
1252
+ attribute: 'dir'
1253
+ },
1254
+ draggable: {
1255
+ attribute: 'draggable'
1256
+ },
1257
+ dropzone: {
1258
+ attribute: 'dropzone',
1259
+ readOnly: true
1260
+ },
1261
+ hidden: {
1262
+ attribute: 'hidden'
1263
+ },
1264
+ id: {
1265
+ attribute: 'id'
1266
+ },
1267
+ inputMode: {
1268
+ attribute: 'inputmode'
1269
+ },
1270
+ lang: {
1271
+ attribute: 'lang'
1272
+ },
1273
+ slot: {
1274
+ attribute: 'slot',
1275
+ error: 'Using the `slot` property is an anti-pattern.'
1276
+ },
1277
+ spellcheck: {
1278
+ attribute: 'spellcheck'
1279
+ },
1280
+ style: {
1281
+ attribute: 'style'
1282
+ },
1283
+ tabIndex: {
1284
+ attribute: 'tabindex'
1285
+ },
1286
+ title: {
1287
+ attribute: 'title'
1288
+ },
1289
+ translate: {
1290
+ attribute: 'translate'
1291
+ },
1292
+ // additional "global attributes" that are not present in the link above.
1293
+ isContentEditable: {
1294
+ readOnly: true
1295
+ },
1296
+ offsetHeight: {
1297
+ readOnly: true,
1298
+ error: offsetPropertyErrorMessage('offsetHeight')
1299
+ },
1300
+ offsetLeft: {
1301
+ readOnly: true,
1302
+ error: offsetPropertyErrorMessage('offsetLeft')
1303
+ },
1304
+ offsetParent: {
1305
+ readOnly: true
1306
+ },
1307
+ offsetTop: {
1308
+ readOnly: true,
1309
+ error: offsetPropertyErrorMessage('offsetTop')
1310
+ },
1311
+ offsetWidth: {
1312
+ readOnly: true,
1313
+ error: offsetPropertyErrorMessage('offsetWidth')
1314
+ },
1315
+ role: {
1316
+ attribute: 'role'
1317
+ }
1318
+ });
1319
+ let controlledElement = null;
1320
+ let controlledAttributeName;
1321
+
1322
+ function isAttributeLocked(elm, attrName) {
1323
+ return elm !== controlledElement || attrName !== controlledAttributeName;
1324
+ }
1325
+
1326
+ function lockAttribute(_elm, _key) {
1327
+ controlledElement = null;
1328
+ controlledAttributeName = undefined;
1329
+ }
1330
+
1331
+ function unlockAttribute(elm, key) {
1332
+ controlledElement = elm;
1333
+ controlledAttributeName = key;
1334
+ }
1335
+ /*
1336
+ * Copyright (c) 2018, salesforce.com, inc.
1337
+ * All rights reserved.
1338
+ * SPDX-License-Identifier: MIT
1339
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1340
+ */
1341
+
1342
+
1516
1343
  function generateDataDescriptor(options) {
1517
1344
  return assign({
1518
1345
  configurable: true,
@@ -1875,7 +1702,7 @@ var LWC = (function (exports) {
1875
1702
  defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
1876
1703
  }
1877
1704
  /*
1878
- * Copyright (c) 2020, salesforce.com, inc.
1705
+ * Copyright (c) 2018, salesforce.com, inc.
1879
1706
  * All rights reserved.
1880
1707
  * SPDX-License-Identifier: MIT
1881
1708
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -2795,9 +2622,7 @@ var LWC = (function (exports) {
2795
2622
 
2796
2623
 
2797
2624
  const LightningElement = function () {
2798
- var _a; // This should be as performant as possible, while any initialization should be done lazily
2799
-
2800
-
2625
+ // This should be as performant as possible, while any initialization should be done lazily
2801
2626
  if (isNull(vmBeingConstructed)) {
2802
2627
  throw new ReferenceError('Illegal constructor');
2803
2628
  }
@@ -2805,15 +2630,14 @@ var LWC = (function (exports) {
2805
2630
  const vm = vmBeingConstructed;
2806
2631
  const {
2807
2632
  def,
2808
- elm,
2809
- renderer
2633
+ elm
2810
2634
  } = vm;
2811
2635
  const {
2812
2636
  bridge
2813
2637
  } = def;
2814
2638
 
2815
2639
  if (process.env.NODE_ENV !== 'production') {
2816
- (_a = renderer.assertInstanceOfHTMLElement) === null || _a === void 0 ? void 0 : _a.call(renderer, vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
2640
+ assertInstanceOfHTMLElement$1(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
2817
2641
  }
2818
2642
 
2819
2643
  const component = this;
@@ -2843,7 +2667,7 @@ var LWC = (function (exports) {
2843
2667
  if (vm.renderMode === 1
2844
2668
  /* Shadow */
2845
2669
  ) {
2846
- attachShadow(vm);
2670
+ doAttachShadow(vm);
2847
2671
  } // Adding extra guard rails in DEV mode.
2848
2672
 
2849
2673
 
@@ -2855,17 +2679,16 @@ var LWC = (function (exports) {
2855
2679
  return this;
2856
2680
  };
2857
2681
 
2858
- function attachShadow(vm) {
2682
+ function doAttachShadow(vm) {
2859
2683
  const {
2860
2684
  elm,
2861
2685
  mode,
2862
- renderer,
2863
2686
  shadowMode,
2864
2687
  def: {
2865
2688
  ctor
2866
2689
  }
2867
2690
  } = vm;
2868
- const cmpRoot = renderer.attachShadow(elm, {
2691
+ const cmpRoot = attachShadow$1(elm, {
2869
2692
  [KEY__SYNTHETIC_MODE]: shadowMode === 1
2870
2693
  /* Synthetic */
2871
2694
  ,
@@ -2892,21 +2715,15 @@ var LWC = (function (exports) {
2892
2715
 
2893
2716
  dispatchEvent(event) {
2894
2717
  const {
2895
- elm,
2896
- renderer: {
2897
- dispatchEvent
2898
- }
2718
+ elm
2899
2719
  } = getAssociatedVM(this);
2900
- return dispatchEvent(elm, event);
2720
+ return dispatchEvent$1(elm, event);
2901
2721
  },
2902
2722
 
2903
2723
  addEventListener(type, listener, options) {
2904
2724
  const vm = getAssociatedVM(this);
2905
2725
  const {
2906
- elm,
2907
- renderer: {
2908
- addEventListener
2909
- }
2726
+ elm
2910
2727
  } = vm;
2911
2728
 
2912
2729
  if (process.env.NODE_ENV !== 'production') {
@@ -2917,92 +2734,68 @@ var LWC = (function (exports) {
2917
2734
  }
2918
2735
 
2919
2736
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2920
- addEventListener(elm, type, wrappedListener, options);
2737
+ addEventListener$1(elm, type, wrappedListener, options);
2921
2738
  },
2922
2739
 
2923
2740
  removeEventListener(type, listener, options) {
2924
2741
  const vm = getAssociatedVM(this);
2925
2742
  const {
2926
- elm,
2927
- renderer: {
2928
- removeEventListener
2929
- }
2743
+ elm
2930
2744
  } = vm;
2931
2745
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2932
- removeEventListener(elm, type, wrappedListener, options);
2746
+ removeEventListener$1(elm, type, wrappedListener, options);
2933
2747
  },
2934
2748
 
2935
2749
  hasAttribute(name) {
2936
2750
  const {
2937
- elm,
2938
- renderer: {
2939
- getAttribute
2940
- }
2751
+ elm
2941
2752
  } = getAssociatedVM(this);
2942
- return !isNull(getAttribute(elm, name));
2753
+ return !isNull(getAttribute$1(elm, name));
2943
2754
  },
2944
2755
 
2945
2756
  hasAttributeNS(namespace, name) {
2946
2757
  const {
2947
- elm,
2948
- renderer: {
2949
- getAttribute
2950
- }
2758
+ elm
2951
2759
  } = getAssociatedVM(this);
2952
- return !isNull(getAttribute(elm, name, namespace));
2760
+ return !isNull(getAttribute$1(elm, name, namespace));
2953
2761
  },
2954
2762
 
2955
2763
  removeAttribute(name) {
2956
2764
  const {
2957
- elm,
2958
- renderer: {
2959
- removeAttribute
2960
- }
2765
+ elm
2961
2766
  } = getAssociatedVM(this);
2962
2767
  unlockAttribute(elm, name);
2963
- removeAttribute(elm, name);
2768
+ removeAttribute$1(elm, name);
2964
2769
  lockAttribute();
2965
2770
  },
2966
2771
 
2967
2772
  removeAttributeNS(namespace, name) {
2968
2773
  const {
2969
- elm,
2970
- renderer: {
2971
- removeAttribute
2972
- }
2774
+ elm
2973
2775
  } = getAssociatedVM(this);
2974
2776
  unlockAttribute(elm, name);
2975
- removeAttribute(elm, name, namespace);
2777
+ removeAttribute$1(elm, name, namespace);
2976
2778
  lockAttribute();
2977
2779
  },
2978
2780
 
2979
2781
  getAttribute(name) {
2980
2782
  const {
2981
- elm,
2982
- renderer: {
2983
- getAttribute
2984
- }
2783
+ elm
2985
2784
  } = getAssociatedVM(this);
2986
- return getAttribute(elm, name);
2785
+ return getAttribute$1(elm, name);
2987
2786
  },
2988
2787
 
2989
2788
  getAttributeNS(namespace, name) {
2990
2789
  const {
2991
- elm,
2992
- renderer: {
2993
- getAttribute
2994
- }
2790
+ elm
2995
2791
  } = getAssociatedVM(this);
2996
- return getAttribute(elm, name, namespace);
2792
+ return getAttribute$1(elm, name, namespace);
2997
2793
  },
2998
2794
 
2999
2795
  setAttribute(name, value) {
3000
2796
  const vm = getAssociatedVM(this);
3001
2797
  const {
3002
- elm,
3003
- renderer: {
3004
- setAttribute
3005
- }
2798
+ elm
3006
2799
  } = vm;
3007
2800
 
3008
2801
  if (process.env.NODE_ENV !== 'production') {
@@ -3010,17 +2803,14 @@ var LWC = (function (exports) {
3010
2803
  }
3011
2804
 
3012
2805
  unlockAttribute(elm, name);
3013
- setAttribute(elm, name, value);
2806
+ setAttribute$1(elm, name, value);
3014
2807
  lockAttribute();
3015
2808
  },
3016
2809
 
3017
2810
  setAttributeNS(namespace, name, value) {
3018
2811
  const vm = getAssociatedVM(this);
3019
2812
  const {
3020
- elm,
3021
- renderer: {
3022
- setAttribute
3023
- }
2813
+ elm
3024
2814
  } = vm;
3025
2815
 
3026
2816
  if (process.env.NODE_ENV !== 'production') {
@@ -3028,43 +2818,34 @@ var LWC = (function (exports) {
3028
2818
  }
3029
2819
 
3030
2820
  unlockAttribute(elm, name);
3031
- setAttribute(elm, name, value, namespace);
2821
+ setAttribute$1(elm, name, value, namespace);
3032
2822
  lockAttribute();
3033
2823
  },
3034
2824
 
3035
2825
  getBoundingClientRect() {
3036
2826
  const vm = getAssociatedVM(this);
3037
2827
  const {
3038
- elm,
3039
- renderer: {
3040
- getBoundingClientRect
3041
- }
2828
+ elm
3042
2829
  } = vm;
3043
2830
 
3044
2831
  if (process.env.NODE_ENV !== 'production') {
3045
2832
  warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
3046
2833
  }
3047
2834
 
3048
- return getBoundingClientRect(elm);
2835
+ return getBoundingClientRect$1(elm);
3049
2836
  },
3050
2837
 
3051
2838
  get isConnected() {
3052
2839
  const {
3053
- elm,
3054
- renderer: {
3055
- isConnected
3056
- }
2840
+ elm
3057
2841
  } = getAssociatedVM(this);
3058
- return isConnected(elm);
2842
+ return isConnected$1(elm);
3059
2843
  },
3060
2844
 
3061
2845
  get classList() {
3062
2846
  const vm = getAssociatedVM(this);
3063
2847
  const {
3064
- elm,
3065
- renderer: {
3066
- getClassList
3067
- }
2848
+ elm
3068
2849
  } = vm;
3069
2850
 
3070
2851
  if (process.env.NODE_ENV !== 'production') {
@@ -3073,7 +2854,7 @@ var LWC = (function (exports) {
3073
2854
  assert.isFalse(isBeingConstructed(vm), `Failed to construct ${vm}: The result must not have attributes. Adding or tampering with classname in constructor is not allowed in a web component, use connectedCallback() instead.`);
3074
2855
  }
3075
2856
 
3076
- return getClassList(elm);
2857
+ return getClassList$1(elm);
3077
2858
  },
3078
2859
 
3079
2860
  get template() {
@@ -3107,23 +2888,48 @@ var LWC = (function (exports) {
3107
2888
  }
3108
2889
 
3109
2890
  };
3110
- const queryAndChildGetterDescriptors = create(null);
3111
- const childGetters = [['children', 'getChildren'], ['childNodes', 'getChildNodes'], ['firstChild', 'getFirstChild'], ['firstElementChild', 'getFirstElementChild'], ['lastChild', 'getLastChild'], ['lastElementChild', 'getLastElementChild']]; // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
2891
+ const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
2892
+ // is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
2893
+ // object representing the renderer, with a lot of methods we don't actually need.
2894
+
2895
+ const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
2896
+
2897
+ function getChildGetter(methodName) {
2898
+ switch (methodName) {
2899
+ case 'children':
2900
+ return getChildren$1;
2901
+
2902
+ case 'childNodes':
2903
+ return getChildNodes$1;
3112
2904
 
3113
- for (const [elementProp, rendererMethod] of childGetters) {
3114
- queryAndChildGetterDescriptors[elementProp] = {
2905
+ case 'firstChild':
2906
+ return getFirstChild$1;
2907
+
2908
+ case 'firstElementChild':
2909
+ return getFirstElementChild$1;
2910
+
2911
+ case 'lastChild':
2912
+ return getLastChild$1;
2913
+
2914
+ case 'lastElementChild':
2915
+ return getLastElementChild$1;
2916
+ }
2917
+ } // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
2918
+
2919
+
2920
+ for (const childGetter of childGetters) {
2921
+ queryAndChildGetterDescriptors[childGetter] = {
3115
2922
  get() {
3116
2923
  const vm = getAssociatedVM(this);
3117
2924
  const {
3118
- elm,
3119
- renderer
2925
+ elm
3120
2926
  } = vm;
3121
2927
 
3122
2928
  if (process.env.NODE_ENV !== 'production') {
3123
- warnIfInvokedDuringConstruction(vm, elementProp);
2929
+ warnIfInvokedDuringConstruction(vm, childGetter);
3124
2930
  }
3125
2931
 
3126
- return renderer[rendererMethod](elm);
2932
+ return getChildGetter(childGetter)(elm);
3127
2933
  },
3128
2934
 
3129
2935
  configurable: true,
@@ -3131,22 +2937,38 @@ var LWC = (function (exports) {
3131
2937
  };
3132
2938
  }
3133
2939
 
3134
- const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll']; // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2940
+ const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
2941
+
2942
+ function getQueryMethod(methodName) {
2943
+ switch (methodName) {
2944
+ case 'getElementsByClassName':
2945
+ return getElementsByClassName$1;
2946
+
2947
+ case 'getElementsByTagName':
2948
+ return getElementsByTagName$1;
2949
+
2950
+ case 'querySelector':
2951
+ return querySelector$1;
2952
+
2953
+ case 'querySelectorAll':
2954
+ return querySelectorAll$1;
2955
+ }
2956
+ } // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2957
+
3135
2958
 
3136
2959
  for (const queryMethod of queryMethods) {
3137
2960
  queryAndChildGetterDescriptors[queryMethod] = {
3138
2961
  value(arg) {
3139
2962
  const vm = getAssociatedVM(this);
3140
2963
  const {
3141
- elm,
3142
- renderer
2964
+ elm
3143
2965
  } = vm;
3144
2966
 
3145
2967
  if (process.env.NODE_ENV !== 'production') {
3146
2968
  warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
3147
2969
  }
3148
2970
 
3149
- return renderer[queryMethod](elm, arg);
2971
+ return getQueryMethod(queryMethod)(elm, arg);
3150
2972
  },
3151
2973
 
3152
2974
  configurable: true,
@@ -4302,10 +4124,6 @@ var LWC = (function (exports) {
4302
4124
 
4303
4125
  assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
4304
4126
 
4305
- if (!runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
4306
- assert.isFalse('shadowSupportMode' in Ctor, `${ctorName || 'Anonymous class'} is an invalid LWC component. The shadowSupportMode static property is not available in this environment.`);
4307
- }
4308
-
4309
4127
  if (!isUndefined$1(ctorShadowSupportMode)) {
4310
4128
  assert.invariant(ctorShadowSupportMode === "any"
4311
4129
  /* Any */
@@ -4532,6 +4350,295 @@ var LWC = (function (exports) {
4532
4350
  */
4533
4351
 
4534
4352
 
4353
+ const xlinkNS = 'http://www.w3.org/1999/xlink';
4354
+ const xmlNS = 'http://www.w3.org/XML/1998/namespace';
4355
+ const ColonCharCode = 58;
4356
+
4357
+ function patchAttributes(oldVnode, vnode) {
4358
+ const {
4359
+ attrs
4360
+ } = vnode.data;
4361
+
4362
+ if (isUndefined$1(attrs)) {
4363
+ return;
4364
+ }
4365
+
4366
+ const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
4367
+
4368
+ if (oldAttrs === attrs) {
4369
+ return;
4370
+ }
4371
+
4372
+ const {
4373
+ elm
4374
+ } = vnode;
4375
+
4376
+ for (const key in attrs) {
4377
+ const cur = attrs[key];
4378
+ const old = oldAttrs[key];
4379
+
4380
+ if (old !== cur) {
4381
+ unlockAttribute(elm, key);
4382
+
4383
+ if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
4384
+ // Assume xml namespace
4385
+ setAttribute$1(elm, key, cur, xmlNS);
4386
+ } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
4387
+ // Assume xlink namespace
4388
+ setAttribute$1(elm, key, cur, xlinkNS);
4389
+ } else if (isNull(cur) || isUndefined$1(cur)) {
4390
+ removeAttribute$1(elm, key);
4391
+ } else {
4392
+ setAttribute$1(elm, key, cur);
4393
+ }
4394
+
4395
+ lockAttribute();
4396
+ }
4397
+ }
4398
+ }
4399
+ /*
4400
+ * Copyright (c) 2018, salesforce.com, inc.
4401
+ * All rights reserved.
4402
+ * SPDX-License-Identifier: MIT
4403
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4404
+ */
4405
+
4406
+
4407
+ function isLiveBindingProp(sel, key) {
4408
+ // For properties with live bindings, we read values from the DOM element
4409
+ // instead of relying on internally tracked values.
4410
+ return sel === 'input' && (key === 'value' || key === 'checked');
4411
+ }
4412
+
4413
+ function patchProps(oldVnode, vnode) {
4414
+ const {
4415
+ props
4416
+ } = vnode.data;
4417
+
4418
+ if (isUndefined$1(props)) {
4419
+ return;
4420
+ }
4421
+
4422
+ const oldProps = isNull(oldVnode) ? EmptyObject : oldVnode.data.props;
4423
+
4424
+ if (oldProps === props) {
4425
+ return;
4426
+ }
4427
+
4428
+ const isFirstPatch = isNull(oldVnode);
4429
+ const {
4430
+ elm,
4431
+ sel
4432
+ } = vnode;
4433
+
4434
+ for (const key in props) {
4435
+ const cur = props[key]; // Set the property if it's the first time is is patched or if the previous property is
4436
+ // different than the one previously set.
4437
+
4438
+ if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
4439
+ setProperty$1(elm, key, cur);
4440
+ }
4441
+ }
4442
+ }
4443
+ /*
4444
+ * Copyright (c) 2018, salesforce.com, inc.
4445
+ * All rights reserved.
4446
+ * SPDX-License-Identifier: MIT
4447
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4448
+ */
4449
+
4450
+
4451
+ const classNameToClassMap = create(null);
4452
+
4453
+ function getMapFromClassName(className) {
4454
+ // Intentionally using == to match undefined and null values from computed style attribute
4455
+ if (className == null) {
4456
+ return EmptyObject;
4457
+ } // computed class names must be string
4458
+
4459
+
4460
+ className = isString(className) ? className : className + '';
4461
+ let map = classNameToClassMap[className];
4462
+
4463
+ if (map) {
4464
+ return map;
4465
+ }
4466
+
4467
+ map = create(null);
4468
+ let start = 0;
4469
+ let o;
4470
+ const len = className.length;
4471
+
4472
+ for (o = 0; o < len; o++) {
4473
+ if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
4474
+ if (o > start) {
4475
+ map[StringSlice.call(className, start, o)] = true;
4476
+ }
4477
+
4478
+ start = o + 1;
4479
+ }
4480
+ }
4481
+
4482
+ if (o > start) {
4483
+ map[StringSlice.call(className, start, o)] = true;
4484
+ }
4485
+
4486
+ classNameToClassMap[className] = map;
4487
+
4488
+ if (process.env.NODE_ENV !== 'production') {
4489
+ // just to make sure that this object never changes as part of the diffing algo
4490
+ freeze(map);
4491
+ }
4492
+
4493
+ return map;
4494
+ }
4495
+
4496
+ function patchClassAttribute(oldVnode, vnode) {
4497
+ const {
4498
+ elm,
4499
+ data: {
4500
+ className: newClass
4501
+ }
4502
+ } = vnode;
4503
+ const oldClass = isNull(oldVnode) ? undefined : oldVnode.data.className;
4504
+
4505
+ if (oldClass === newClass) {
4506
+ return;
4507
+ }
4508
+
4509
+ const classList = getClassList$1(elm);
4510
+ const newClassMap = getMapFromClassName(newClass);
4511
+ const oldClassMap = getMapFromClassName(oldClass);
4512
+ let name;
4513
+
4514
+ for (name in oldClassMap) {
4515
+ // remove only if it is not in the new class collection and it is not set from within the instance
4516
+ if (isUndefined$1(newClassMap[name])) {
4517
+ classList.remove(name);
4518
+ }
4519
+ }
4520
+
4521
+ for (name in newClassMap) {
4522
+ if (isUndefined$1(oldClassMap[name])) {
4523
+ classList.add(name);
4524
+ }
4525
+ }
4526
+ }
4527
+ /*
4528
+ * Copyright (c) 2018, salesforce.com, inc.
4529
+ * All rights reserved.
4530
+ * SPDX-License-Identifier: MIT
4531
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4532
+ */
4533
+
4534
+
4535
+ function patchStyleAttribute(oldVnode, vnode) {
4536
+ const {
4537
+ elm,
4538
+ data: {
4539
+ style: newStyle
4540
+ }
4541
+ } = vnode;
4542
+ const oldStyle = isNull(oldVnode) ? undefined : oldVnode.data.style;
4543
+
4544
+ if (oldStyle === newStyle) {
4545
+ return;
4546
+ }
4547
+
4548
+ if (!isString(newStyle) || newStyle === '') {
4549
+ removeAttribute$1(elm, 'style');
4550
+ } else {
4551
+ setAttribute$1(elm, 'style', newStyle);
4552
+ }
4553
+ }
4554
+ /*
4555
+ * Copyright (c) 2018, salesforce.com, inc.
4556
+ * All rights reserved.
4557
+ * SPDX-License-Identifier: MIT
4558
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4559
+ */
4560
+
4561
+
4562
+ function applyEventListeners(vnode) {
4563
+ const {
4564
+ elm,
4565
+ data: {
4566
+ on
4567
+ }
4568
+ } = vnode;
4569
+
4570
+ if (isUndefined$1(on)) {
4571
+ return;
4572
+ }
4573
+
4574
+ for (const name in on) {
4575
+ const handler = on[name];
4576
+ addEventListener$1(elm, name, handler);
4577
+ }
4578
+ }
4579
+ /*
4580
+ * Copyright (c) 2018, salesforce.com, inc.
4581
+ * All rights reserved.
4582
+ * SPDX-License-Identifier: MIT
4583
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4584
+ */
4585
+ // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
4586
+ // different classnames properties individually instead of via a string.
4587
+
4588
+
4589
+ function applyStaticClassAttribute(vnode) {
4590
+ const {
4591
+ elm,
4592
+ data: {
4593
+ classMap
4594
+ }
4595
+ } = vnode;
4596
+
4597
+ if (isUndefined$1(classMap)) {
4598
+ return;
4599
+ }
4600
+
4601
+ const classList = getClassList$1(elm);
4602
+
4603
+ for (const name in classMap) {
4604
+ classList.add(name);
4605
+ }
4606
+ }
4607
+ /*
4608
+ * Copyright (c) 2018, salesforce.com, inc.
4609
+ * All rights reserved.
4610
+ * SPDX-License-Identifier: MIT
4611
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4612
+ */
4613
+ // The compiler takes care of transforming the inline style into an object. It's faster to set the
4614
+ // different style properties individually instead of via a string.
4615
+
4616
+
4617
+ function applyStaticStyleAttribute(vnode) {
4618
+ const {
4619
+ elm,
4620
+ data: {
4621
+ styleDecls
4622
+ }
4623
+ } = vnode;
4624
+
4625
+ if (isUndefined$1(styleDecls)) {
4626
+ return;
4627
+ }
4628
+
4629
+ for (let i = 0; i < styleDecls.length; i++) {
4630
+ const [prop, value, important] = styleDecls[i];
4631
+ setCSSStyleProperty$1(elm, prop, value, important);
4632
+ }
4633
+ }
4634
+ /*
4635
+ * Copyright (c) 2018, salesforce.com, inc.
4636
+ * All rights reserved.
4637
+ * SPDX-License-Identifier: MIT
4638
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4639
+ */
4640
+
4641
+
4535
4642
  function observeElementChildNodes(elm) {
4536
4643
  elm.$domManual$ = true;
4537
4644
  }
@@ -4549,17 +4656,14 @@ var LWC = (function (exports) {
4549
4656
  const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
4550
4657
 
4551
4658
  if (!isUndefined$1(token) && context.hasScopedStyles) {
4552
- owner.renderer.getClassList(elm).add(token);
4659
+ getClassList$1(elm).add(token);
4553
4660
  }
4554
4661
  }
4555
4662
 
4556
4663
  function updateNodeHook(oldVnode, vnode) {
4557
4664
  const {
4558
4665
  elm,
4559
- text,
4560
- owner: {
4561
- renderer
4562
- }
4666
+ text
4563
4667
  } = vnode;
4564
4668
 
4565
4669
  if (oldVnode.text !== text) {
@@ -4567,7 +4671,7 @@ var LWC = (function (exports) {
4567
4671
  unlockDomMutation();
4568
4672
  }
4569
4673
 
4570
- renderer.setText(elm, text);
4674
+ setText$1(elm, text);
4571
4675
 
4572
4676
  if (process.env.NODE_ENV !== 'production') {
4573
4677
  lockDomMutation();
@@ -4576,15 +4680,11 @@ var LWC = (function (exports) {
4576
4680
  }
4577
4681
 
4578
4682
  function insertNodeHook(vnode, parentNode, referenceNode) {
4579
- const {
4580
- renderer
4581
- } = vnode.owner;
4582
-
4583
4683
  if (process.env.NODE_ENV !== 'production') {
4584
4684
  unlockDomMutation();
4585
4685
  }
4586
4686
 
4587
- renderer.insert(vnode.elm, parentNode, referenceNode);
4687
+ insert$1(vnode.elm, parentNode, referenceNode);
4588
4688
 
4589
4689
  if (process.env.NODE_ENV !== 'production') {
4590
4690
  lockDomMutation();
@@ -4592,43 +4692,35 @@ var LWC = (function (exports) {
4592
4692
  }
4593
4693
 
4594
4694
  function removeNodeHook(vnode, parentNode) {
4595
- const {
4596
- renderer
4597
- } = vnode.owner;
4598
-
4599
4695
  if (process.env.NODE_ENV !== 'production') {
4600
4696
  unlockDomMutation();
4601
4697
  }
4602
4698
 
4603
- renderer.remove(vnode.elm, parentNode);
4699
+ remove$1(vnode.elm, parentNode);
4604
4700
 
4605
4701
  if (process.env.NODE_ENV !== 'production') {
4606
4702
  lockDomMutation();
4607
4703
  }
4608
4704
  }
4609
4705
 
4610
- function createElmHook(vnode) {
4611
- modEvents.create(vnode); // Attrs need to be applied to element before props
4612
- // IE11 will wipe out value on radio inputs if value
4613
- // is set before type=radio.
4706
+ function patchElementPropsAndAttrs(oldVnode, vnode) {
4707
+ if (isNull(oldVnode)) {
4708
+ applyEventListeners(vnode);
4709
+ applyStaticClassAttribute(vnode);
4710
+ applyStaticStyleAttribute(vnode);
4711
+ } // Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
4712
+ // value is set before type=radio.
4713
+
4614
4714
 
4615
- modAttrs.create(vnode);
4616
- modProps.create(vnode);
4617
- modStaticClassName.create(vnode);
4618
- modStaticStyle.create(vnode);
4619
- modComputedClassName.create(vnode);
4620
- modComputedStyle.create(vnode);
4715
+ patchClassAttribute(oldVnode, vnode);
4716
+ patchStyleAttribute(oldVnode, vnode);
4717
+ patchAttributes(oldVnode, vnode);
4718
+ patchProps(oldVnode, vnode);
4621
4719
  }
4622
4720
 
4623
4721
  function hydrateElmHook(vnode) {
4624
- modEvents.create(vnode); // Attrs are already on the element.
4625
- // modAttrs.create(vnode);
4626
-
4627
- modProps.create(vnode); // Already set.
4628
- // modStaticClassName.create(vnode);
4629
- // modStaticStyle.create(vnode);
4630
- // modComputedClassName.create(vnode);
4631
- // modComputedStyle.create(vnode);
4722
+ applyEventListeners(vnode);
4723
+ patchProps(null, vnode);
4632
4724
  }
4633
4725
 
4634
4726
  function fallbackElmHook(elm, vnode) {
@@ -4680,26 +4772,11 @@ var LWC = (function (exports) {
4680
4772
  }
4681
4773
  }
4682
4774
 
4683
- function updateElmHook(oldVnode, vnode) {
4684
- // Attrs need to be applied to element before props
4685
- // IE11 will wipe out value on radio inputs if value
4686
- // is set before type=radio.
4687
- modAttrs.update(oldVnode, vnode);
4688
- modProps.update(oldVnode, vnode);
4689
- modComputedClassName.update(oldVnode, vnode);
4690
- modComputedStyle.update(oldVnode, vnode);
4691
- }
4692
-
4693
- function updateChildrenHook(oldVnode, vnode) {
4694
- const {
4695
- elm,
4696
- children
4697
- } = vnode;
4698
-
4699
- if (hasDynamicChildren(children)) {
4700
- updateDynamicChildren(elm, oldVnode.children, children);
4775
+ function patchChildren(parent, oldCh, newCh) {
4776
+ if (hasDynamicChildren(newCh)) {
4777
+ updateDynamicChildren(parent, oldCh, newCh);
4701
4778
  } else {
4702
- updateStaticChildren(elm, oldVnode.children, children);
4779
+ updateStaticChildren(parent, oldCh, newCh);
4703
4780
  }
4704
4781
  }
4705
4782
 
@@ -4766,8 +4843,7 @@ var LWC = (function (exports) {
4766
4843
  createVM(elm, def, {
4767
4844
  mode,
4768
4845
  owner,
4769
- tagName: sel,
4770
- renderer: owner.renderer
4846
+ tagName: sel
4771
4847
  });
4772
4848
 
4773
4849
  if (process.env.NODE_ENV !== 'production') {
@@ -4775,19 +4851,6 @@ var LWC = (function (exports) {
4775
4851
  }
4776
4852
  }
4777
4853
 
4778
- function createCustomElmHook(vnode) {
4779
- modEvents.create(vnode); // Attrs need to be applied to element before props
4780
- // IE11 will wipe out value on radio inputs if value
4781
- // is set before type=radio.
4782
-
4783
- modAttrs.create(vnode);
4784
- modProps.create(vnode);
4785
- modStaticClassName.create(vnode);
4786
- modStaticStyle.create(vnode);
4787
- modComputedClassName.create(vnode);
4788
- modComputedStyle.create(vnode);
4789
- }
4790
-
4791
4854
  function createChildrenHook(vnode) {
4792
4855
  const {
4793
4856
  elm,
@@ -4813,16 +4876,13 @@ var LWC = (function (exports) {
4813
4876
  const {
4814
4877
  data: {
4815
4878
  attrs = {}
4816
- },
4817
- owner: {
4818
- renderer
4819
4879
  }
4820
4880
  } = vnode;
4821
4881
  let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
4822
4882
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
4823
4883
 
4824
4884
  for (const [attrName, attrValue] of Object.entries(attrs)) {
4825
- const elmAttrValue = renderer.getAttribute(elm, attrName);
4885
+ const elmAttrValue = getAttribute$1(elm, attrName);
4826
4886
 
4827
4887
  if (String(attrValue) !== elmAttrValue) {
4828
4888
  logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
@@ -4838,9 +4898,6 @@ var LWC = (function (exports) {
4838
4898
  data: {
4839
4899
  className,
4840
4900
  classMap
4841
- },
4842
- owner: {
4843
- renderer
4844
4901
  }
4845
4902
  } = vnode;
4846
4903
  let nodesAreCompatible = true;
@@ -4852,7 +4909,7 @@ var LWC = (function (exports) {
4852
4909
  vnodeClassName = className;
4853
4910
  } else if (!isUndefined$1(classMap)) {
4854
4911
  // classMap is used when class is set to static value.
4855
- const classList = renderer.getClassList(elm);
4912
+ const classList = getClassList$1(elm);
4856
4913
  let computedClassName = ''; // all classes from the vnode should be in the element.classList
4857
4914
 
4858
4915
  for (const name in classMap) {
@@ -4882,12 +4939,9 @@ var LWC = (function (exports) {
4882
4939
  data: {
4883
4940
  style,
4884
4941
  styleDecls
4885
- },
4886
- owner: {
4887
- renderer
4888
4942
  }
4889
4943
  } = vnode;
4890
- const elmStyle = renderer.getAttribute(elm, 'style') || '';
4944
+ const elmStyle = getAttribute$1(elm, 'style') || '';
4891
4945
  let vnodeStyle;
4892
4946
  let nodesAreCompatible = true;
4893
4947
 
@@ -4977,16 +5031,6 @@ var LWC = (function (exports) {
4977
5031
  }
4978
5032
  }
4979
5033
 
4980
- function updateCustomElmHook(oldVnode, vnode) {
4981
- // Attrs need to be applied to element before props
4982
- // IE11 will wipe out value on radio inputs if value
4983
- // is set before type=radio.
4984
- modAttrs.update(oldVnode, vnode);
4985
- modProps.update(oldVnode, vnode);
4986
- modComputedClassName.update(oldVnode, vnode);
4987
- modComputedStyle.update(oldVnode, vnode);
4988
- }
4989
-
4990
5034
  function removeElmHook(vnode) {
4991
5035
  // this method only needs to search on child vnodes from template
4992
5036
  // to trigger the remove hook just in case some of those children
@@ -5003,6 +5047,66 @@ var LWC = (function (exports) {
5003
5047
  ch.hook.remove(ch, elm);
5004
5048
  }
5005
5049
  }
5050
+ }
5051
+
5052
+ function allocateInSlot(vm, children) {
5053
+ const {
5054
+ cmpSlots: oldSlots
5055
+ } = vm;
5056
+ const cmpSlots = vm.cmpSlots = create(null);
5057
+
5058
+ for (let i = 0, len = children.length; i < len; i += 1) {
5059
+ const vnode = children[i];
5060
+
5061
+ if (isNull(vnode)) {
5062
+ continue;
5063
+ }
5064
+
5065
+ const {
5066
+ data
5067
+ } = vnode;
5068
+ const slotName = data.attrs && data.attrs.slot || '';
5069
+ const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
5070
+ // which might have similar keys. Each vnode will always have a key that
5071
+ // starts with a numeric character from compiler. In this case, we add a unique
5072
+ // notation for slotted vnodes keys, e.g.: `@foo:1:1`
5073
+
5074
+ if (!isUndefined$1(vnode.key)) {
5075
+ vnode.key = `@${slotName}:${vnode.key}`;
5076
+ }
5077
+
5078
+ ArrayPush$1.call(vnodes, vnode);
5079
+ }
5080
+
5081
+ if (isFalse(vm.isDirty)) {
5082
+ // We need to determine if the old allocation is really different from the new one
5083
+ // and mark the vm as dirty
5084
+ const oldKeys = keys(oldSlots);
5085
+
5086
+ if (oldKeys.length !== keys(cmpSlots).length) {
5087
+ markComponentAsDirty(vm);
5088
+ return;
5089
+ }
5090
+
5091
+ for (let i = 0, len = oldKeys.length; i < len; i += 1) {
5092
+ const key = oldKeys[i];
5093
+
5094
+ if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
5095
+ markComponentAsDirty(vm);
5096
+ return;
5097
+ }
5098
+
5099
+ const oldVNodes = oldSlots[key];
5100
+ const vnodes = cmpSlots[key];
5101
+
5102
+ for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
5103
+ if (oldVNodes[j] !== vnodes[j]) {
5104
+ markComponentAsDirty(vm);
5105
+ return;
5106
+ }
5107
+ }
5108
+ }
5109
+ }
5006
5110
  } // Using a WeakMap instead of a WeakSet because this one works in IE11 :(
5007
5111
 
5008
5112
 
@@ -5024,12 +5128,12 @@ var LWC = (function (exports) {
5024
5128
  */
5025
5129
 
5026
5130
 
5027
- function getUpgradableConstructor(tagName, renderer) {
5131
+ function getUpgradableConstructor(tagName) {
5028
5132
  // Should never get a tag with upper case letter at this point, the compiler should
5029
5133
  // produce only tags with lowercase letters
5030
5134
  // But, for backwards compatibility, we will lower case the tagName
5031
5135
  tagName = tagName.toLowerCase();
5032
- let CE = renderer.getCustomElement(tagName);
5136
+ let CE = getCustomElement$1(tagName);
5033
5137
 
5034
5138
  if (!isUndefined$1(CE)) {
5035
5139
  return CE;
@@ -5040,7 +5144,7 @@ var LWC = (function (exports) {
5040
5144
  */
5041
5145
 
5042
5146
 
5043
- CE = class LWCUpgradableElement extends renderer.HTMLElement {
5147
+ CE = class LWCUpgradableElement extends HTMLElementExported$1 {
5044
5148
  constructor(upgradeCallback) {
5045
5149
  super();
5046
5150
 
@@ -5050,7 +5154,7 @@ var LWC = (function (exports) {
5050
5154
  }
5051
5155
 
5052
5156
  };
5053
- renderer.defineCustomElement(tagName, CE);
5157
+ defineCustomElement$1(tagName, CE);
5054
5158
  return CE;
5055
5159
  }
5056
5160
  /*
@@ -5068,10 +5172,7 @@ var LWC = (function (exports) {
5068
5172
  const {
5069
5173
  owner
5070
5174
  } = vnode;
5071
- const {
5072
- renderer
5073
- } = owner;
5074
- const elm = renderer.createText(vnode.text);
5175
+ const elm = createText$1(vnode.text);
5075
5176
  linkNodeToShadow(elm, owner);
5076
5177
  vnode.elm = elm;
5077
5178
  },
@@ -5105,10 +5206,7 @@ var LWC = (function (exports) {
5105
5206
  owner,
5106
5207
  text
5107
5208
  } = vnode;
5108
- const {
5109
- renderer
5110
- } = owner;
5111
- const elm = renderer.createComment(text);
5209
+ const elm = createComment$1(text);
5112
5210
  linkNodeToShadow(elm, owner);
5113
5211
  vnode.elm = elm;
5114
5212
  },
@@ -5150,19 +5248,16 @@ var LWC = (function (exports) {
5150
5248
  svg
5151
5249
  }
5152
5250
  } = vnode;
5153
- const {
5154
- renderer
5155
- } = owner;
5156
5251
  const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
5157
- const elm = renderer.createElement(sel, namespace);
5252
+ const elm = createElement$2(sel, namespace);
5158
5253
  linkNodeToShadow(elm, owner);
5159
5254
  fallbackElmHook(elm, vnode);
5160
5255
  vnode.elm = elm;
5161
- createElmHook(vnode);
5256
+ patchElementPropsAndAttrs(null, vnode);
5162
5257
  },
5163
5258
  update: (oldVnode, vnode) => {
5164
- updateElmHook(oldVnode, vnode);
5165
- updateChildrenHook(oldVnode, vnode);
5259
+ patchElementPropsAndAttrs(oldVnode, vnode);
5260
+ patchChildren(vnode.elm, oldVnode.children, vnode.children);
5166
5261
  },
5167
5262
  insert: (vnode, parentNode, referenceNode) => {
5168
5263
  insertNodeHook(vnode, parentNode, referenceNode);
@@ -5214,10 +5309,7 @@ var LWC = (function (exports) {
5214
5309
  sel,
5215
5310
  owner
5216
5311
  } = vnode;
5217
- const {
5218
- renderer
5219
- } = owner;
5220
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
5312
+ const UpgradableConstructor = getUpgradableConstructor(sel);
5221
5313
  /**
5222
5314
  * Note: if the upgradable constructor does not expect, or throw when we new it
5223
5315
  * with a callback as the first argument, we could implement a more advanced
@@ -5239,10 +5331,10 @@ var LWC = (function (exports) {
5239
5331
  throw new TypeError(`Incorrect Component Constructor`);
5240
5332
  }
5241
5333
 
5242
- createCustomElmHook(vnode);
5334
+ patchElementPropsAndAttrs(null, vnode);
5243
5335
  },
5244
5336
  update: (oldVnode, vnode) => {
5245
- updateCustomElmHook(oldVnode, vnode);
5337
+ patchElementPropsAndAttrs(oldVnode, vnode);
5246
5338
  const vm = getAssociatedVMIfPresent(vnode.elm);
5247
5339
 
5248
5340
  if (vm) {
@@ -5253,7 +5345,7 @@ var LWC = (function (exports) {
5253
5345
  // will happen, but in native, it does allocate the light dom
5254
5346
 
5255
5347
 
5256
- updateChildrenHook(oldVnode, vnode);
5348
+ patchChildren(vnode.elm, oldVnode.children, vnode.children);
5257
5349
 
5258
5350
  if (vm) {
5259
5351
  if (process.env.NODE_ENV !== 'production') {
@@ -5310,8 +5402,7 @@ var LWC = (function (exports) {
5310
5402
  createVM(elm, def, {
5311
5403
  mode,
5312
5404
  owner,
5313
- tagName: sel,
5314
- renderer: owner.renderer
5405
+ tagName: sel
5315
5406
  });
5316
5407
  vnode.elm = elm;
5317
5408
  const vm = getAssociatedVM(elm);
@@ -5340,12 +5431,11 @@ var LWC = (function (exports) {
5340
5431
 
5341
5432
  function linkNodeToShadow(elm, owner) {
5342
5433
  const {
5343
- renderer,
5344
5434
  renderMode,
5345
5435
  shadowMode
5346
5436
  } = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
5347
5437
 
5348
- if (renderer.isSyntheticShadowDefined) {
5438
+ if (isSyntheticShadowDefined$1) {
5349
5439
  if (shadowMode === 1
5350
5440
  /* Synthetic */
5351
5441
  || renderMode === 0
@@ -5877,7 +5967,6 @@ var LWC = (function (exports) {
5877
5967
  const {
5878
5968
  elm,
5879
5969
  context,
5880
- renderer,
5881
5970
  renderMode,
5882
5971
  shadowMode
5883
5972
  } = vm;
@@ -5904,11 +5993,11 @@ var LWC = (function (exports) {
5904
5993
  } = context;
5905
5994
 
5906
5995
  if (oldHasTokenInClass) {
5907
- renderer.getClassList(elm).remove(makeHostToken(oldToken));
5996
+ getClassList$1(elm).remove(makeHostToken(oldToken));
5908
5997
  }
5909
5998
 
5910
5999
  if (oldHasTokenInAttribute) {
5911
- renderer.removeAttribute(elm, makeHostToken(oldToken));
6000
+ removeAttribute$1(elm, makeHostToken(oldToken));
5912
6001
  } // Apply the new template styling token to the host element, if the new template has any
5913
6002
  // associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
5914
6003
 
@@ -5920,12 +6009,12 @@ var LWC = (function (exports) {
5920
6009
 
5921
6010
  if (!isUndefined$1(newToken)) {
5922
6011
  if (hasScopedStyles) {
5923
- renderer.getClassList(elm).add(makeHostToken(newToken));
6012
+ getClassList$1(elm).add(makeHostToken(newToken));
5924
6013
  newHasTokenInClass = true;
5925
6014
  }
5926
6015
 
5927
6016
  if (isSyntheticShadow) {
5928
- renderer.setAttribute(elm, makeHostToken(newToken), '');
6017
+ setAttribute$1(elm, makeHostToken(newToken), '');
5929
6018
  newHasTokenInAttribute = true;
5930
6019
  }
5931
6020
  } // Update the styling tokens present on the context object.
@@ -6046,7 +6135,6 @@ var LWC = (function (exports) {
6046
6135
 
6047
6136
  function createStylesheet(vm, stylesheets) {
6048
6137
  const {
6049
- renderer,
6050
6138
  renderMode,
6051
6139
  shadowMode
6052
6140
  } = vm;
@@ -6057,9 +6145,9 @@ var LWC = (function (exports) {
6057
6145
  /* Synthetic */
6058
6146
  ) {
6059
6147
  for (let i = 0; i < stylesheets.length; i++) {
6060
- renderer.insertGlobalStylesheet(stylesheets[i]);
6148
+ insertGlobalStylesheet$1(stylesheets[i]);
6061
6149
  }
6062
- } else if (renderer.ssr || renderer.isHydrating()) {
6150
+ } else if (ssr$1 || isHydrating$1()) {
6063
6151
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
6064
6152
  // This works in the client, because the stylesheets are created, and cached in the VM
6065
6153
  // the first time the VM renders.
@@ -6073,10 +6161,10 @@ var LWC = (function (exports) {
6073
6161
 
6074
6162
  for (let i = 0; i < stylesheets.length; i++) {
6075
6163
  if (isGlobal) {
6076
- renderer.insertGlobalStylesheet(stylesheets[i]);
6164
+ insertGlobalStylesheet$1(stylesheets[i]);
6077
6165
  } else {
6078
6166
  // local level
6079
- renderer.insertStylesheet(stylesheets[i], root.cmpRoot);
6167
+ insertStylesheet$1(stylesheets[i], root.cmpRoot);
6080
6168
  }
6081
6169
  }
6082
6170
  }
@@ -6768,7 +6856,6 @@ var LWC = (function (exports) {
6768
6856
  const {
6769
6857
  mode,
6770
6858
  owner,
6771
- renderer,
6772
6859
  tagName
6773
6860
  } = options;
6774
6861
  const vm = {
@@ -6783,7 +6870,6 @@ var LWC = (function (exports) {
6783
6870
  tagName,
6784
6871
  mode,
6785
6872
  owner,
6786
- renderer,
6787
6873
  children: EmptyArray,
6788
6874
  aChildren: EmptyArray,
6789
6875
  velements: EmptyArray,
@@ -6838,16 +6924,11 @@ var LWC = (function (exports) {
6838
6924
 
6839
6925
  function computeShadowMode(vm) {
6840
6926
  const {
6841
- def,
6842
- renderer
6927
+ def
6843
6928
  } = vm;
6844
- const {
6845
- isNativeShadowDefined,
6846
- isSyntheticShadowDefined
6847
- } = renderer;
6848
6929
  let shadowMode;
6849
6930
 
6850
- if (isSyntheticShadowDefined) {
6931
+ if (isSyntheticShadowDefined$1) {
6851
6932
  if (def.renderMode === 0
6852
6933
  /* Light */
6853
6934
  ) {
@@ -6856,7 +6937,7 @@ var LWC = (function (exports) {
6856
6937
  shadowMode = 0
6857
6938
  /* Native */
6858
6939
  ;
6859
- } else if (isNativeShadowDefined) {
6940
+ } else if (isNativeShadowDefined$1) {
6860
6941
  if (def.shadowSupportMode === "any"
6861
6942
  /* Any */
6862
6943
  ) {
@@ -6964,7 +7045,6 @@ var LWC = (function (exports) {
6964
7045
  // patch function mutates vnodes by adding the element reference,
6965
7046
  // however, if patching fails it contains partial changes.
6966
7047
  if (oldCh !== newCh) {
6967
- const fn = hasDynamicChildren(newCh) ? updateDynamicChildren : updateStaticChildren;
6968
7048
  runWithBoundaryProtection(vm, vm, () => {
6969
7049
  // pre
6970
7050
  logOperationStart(2
@@ -6972,8 +7052,8 @@ var LWC = (function (exports) {
6972
7052
  , vm);
6973
7053
  }, () => {
6974
7054
  // job
6975
- const elementToRenderTo = getRenderRoot(vm);
6976
- fn(elementToRenderTo, oldCh, newCh);
7055
+ const renderRoot = getRenderRoot(vm);
7056
+ patchChildren(renderRoot, oldCh, newCh);
6977
7057
  }, () => {
6978
7058
  // post
6979
7059
  logOperationEnd(2
@@ -6996,13 +7076,12 @@ var LWC = (function (exports) {
6996
7076
 
6997
7077
  function runRenderedCallback(vm) {
6998
7078
  const {
6999
- renderer,
7000
7079
  def: {
7001
7080
  renderedCallback
7002
7081
  }
7003
7082
  } = vm;
7004
7083
 
7005
- if (isTrue(renderer.ssr)) {
7084
+ if (isTrue(ssr$1)) {
7006
7085
  return;
7007
7086
  }
7008
7087
 
@@ -7228,8 +7307,7 @@ var LWC = (function (exports) {
7228
7307
 
7229
7308
  function resetComponentRoot(vm) {
7230
7309
  const {
7231
- children,
7232
- renderer
7310
+ children
7233
7311
  } = vm;
7234
7312
  const rootNode = getRenderRoot(vm);
7235
7313
 
@@ -7237,7 +7315,7 @@ var LWC = (function (exports) {
7237
7315
  const child = children[i];
7238
7316
 
7239
7317
  if (!isNull(child) && !isUndefined$1(child.elm)) {
7240
- renderer.remove(child.elm, rootNode);
7318
+ remove$1(child.elm, rootNode);
7241
7319
  }
7242
7320
  }
7243
7321
 
@@ -7247,7 +7325,7 @@ var LWC = (function (exports) {
7247
7325
  }
7248
7326
 
7249
7327
  function scheduleRehydration(vm) {
7250
- if (isTrue(vm.renderer.ssr) || isTrue(vm.isScheduled)) {
7328
+ if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
7251
7329
  return;
7252
7330
  }
7253
7331
 
@@ -7270,69 +7348,6 @@ var LWC = (function (exports) {
7270
7348
 
7271
7349
  currentVm = currentVm.owner;
7272
7350
  }
7273
- } // slow path routine
7274
- // NOTE: we should probably more this routine to the synthetic shadow folder
7275
- // and get the allocation to be cached by in the elm instead of in the VM
7276
-
7277
-
7278
- function allocateInSlot(vm, children) {
7279
- const {
7280
- cmpSlots: oldSlots
7281
- } = vm;
7282
- const cmpSlots = vm.cmpSlots = create(null);
7283
-
7284
- for (let i = 0, len = children.length; i < len; i += 1) {
7285
- const vnode = children[i];
7286
-
7287
- if (isNull(vnode)) {
7288
- continue;
7289
- }
7290
-
7291
- const {
7292
- data
7293
- } = vnode;
7294
- const slotName = data.attrs && data.attrs.slot || '';
7295
- const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
7296
- // which might have similar keys. Each vnode will always have a key that
7297
- // starts with a numeric character from compiler. In this case, we add a unique
7298
- // notation for slotted vnodes keys, e.g.: `@foo:1:1`
7299
-
7300
- if (!isUndefined$1(vnode.key)) {
7301
- vnode.key = `@${slotName}:${vnode.key}`;
7302
- }
7303
-
7304
- ArrayPush$1.call(vnodes, vnode);
7305
- }
7306
-
7307
- if (isFalse(vm.isDirty)) {
7308
- // We need to determine if the old allocation is really different from the new one
7309
- // and mark the vm as dirty
7310
- const oldKeys = keys(oldSlots);
7311
-
7312
- if (oldKeys.length !== keys(cmpSlots).length) {
7313
- markComponentAsDirty(vm);
7314
- return;
7315
- }
7316
-
7317
- for (let i = 0, len = oldKeys.length; i < len; i += 1) {
7318
- const key = oldKeys[i];
7319
-
7320
- if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
7321
- markComponentAsDirty(vm);
7322
- return;
7323
- }
7324
-
7325
- const oldVNodes = oldSlots[key];
7326
- const vnodes = cmpSlots[key];
7327
-
7328
- for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
7329
- if (oldVNodes[j] !== vnodes[j]) {
7330
- markComponentAsDirty(vm);
7331
- return;
7332
- }
7333
- }
7334
- }
7335
- }
7336
7351
  }
7337
7352
 
7338
7353
  function runWithBoundaryProtection(vm, owner, pre, job, post) {
@@ -7492,7 +7507,6 @@ var LWC = (function (exports) {
7492
7507
 
7493
7508
  const {
7494
7509
  elm,
7495
- renderer,
7496
7510
  context: {
7497
7511
  wiredConnecting,
7498
7512
  wiredDisconnecting
@@ -7519,7 +7533,7 @@ var LWC = (function (exports) {
7519
7533
  }
7520
7534
 
7521
7535
  });
7522
- renderer.dispatchEvent(elm, contextRegistrationEvent);
7536
+ dispatchEvent$1(elm, contextRegistrationEvent);
7523
7537
  });
7524
7538
  }
7525
7539
 
@@ -7784,7 +7798,7 @@ var LWC = (function (exports) {
7784
7798
  hooksAreSet = true;
7785
7799
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7786
7800
  }
7787
- /* version: 2.6.2 */
7801
+ /* version: 2.7.3 */
7788
7802
 
7789
7803
  /*
7790
7804
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7813,7 +7827,9 @@ var LWC = (function (exports) {
7813
7827
  const styleElements = create(null);
7814
7828
  const styleSheets = create(null);
7815
7829
  const nodesToStyleSheets = new WeakMap();
7816
- let getCustomElement, defineCustomElement, HTMLElementConstructor;
7830
+ let getCustomElement;
7831
+ let defineCustomElement;
7832
+ let HTMLElementConstructor;
7817
7833
 
7818
7834
  function isCustomElementRegistryAvailable() {
7819
7835
  if (typeof customElements === 'undefined') {
@@ -7928,188 +7944,231 @@ var LWC = (function (exports) {
7928
7944
  HTMLElementConstructor.prototype = HTMLElement.prototype;
7929
7945
  }
7930
7946
 
7931
- let isHydrating = false;
7947
+ let hydrating = false;
7932
7948
 
7933
- function setIsHydrating(v) {
7934
- isHydrating = v;
7949
+ function setIsHydrating(value) {
7950
+ hydrating = value;
7935
7951
  }
7936
7952
 
7937
- const renderer = {
7938
- ssr: false,
7953
+ const ssr = false;
7939
7954
 
7940
- isHydrating() {
7941
- return isHydrating;
7942
- },
7955
+ function isHydrating() {
7956
+ return hydrating;
7957
+ }
7943
7958
 
7944
- isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
7945
- isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
7959
+ const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
7960
+ const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
7946
7961
 
7947
- createElement(tagName, namespace) {
7948
- return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
7949
- },
7962
+ function createElement$1(tagName, namespace) {
7963
+ return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
7964
+ }
7950
7965
 
7951
- createText(content) {
7952
- return document.createTextNode(content);
7953
- },
7966
+ function createText(content) {
7967
+ return document.createTextNode(content);
7968
+ }
7954
7969
 
7955
- createComment(content) {
7956
- return document.createComment(content);
7957
- },
7970
+ function createComment(content) {
7971
+ return document.createComment(content);
7972
+ }
7958
7973
 
7959
- insert(node, parent, anchor) {
7960
- parent.insertBefore(node, anchor);
7961
- },
7974
+ function insert(node, parent, anchor) {
7975
+ parent.insertBefore(node, anchor);
7976
+ }
7962
7977
 
7963
- remove(node, parent) {
7964
- parent.removeChild(node);
7965
- },
7978
+ function remove(node, parent) {
7979
+ parent.removeChild(node);
7980
+ }
7966
7981
 
7967
- nextSibling(node) {
7968
- return node.nextSibling;
7969
- },
7982
+ function nextSibling(node) {
7983
+ return node.nextSibling;
7984
+ }
7970
7985
 
7971
- attachShadow(element, options) {
7972
- if (isHydrating) {
7973
- return element.shadowRoot;
7974
- }
7986
+ function attachShadow(element, options) {
7987
+ if (hydrating) {
7988
+ return element.shadowRoot;
7989
+ }
7975
7990
 
7976
- return element.attachShadow(options);
7977
- },
7991
+ return element.attachShadow(options);
7992
+ }
7978
7993
 
7979
- setText(node, content) {
7980
- node.nodeValue = content;
7981
- },
7994
+ function setText(node, content) {
7995
+ node.nodeValue = content;
7996
+ }
7982
7997
 
7983
- getProperty(node, key) {
7984
- return node[key];
7985
- },
7998
+ function getProperty(node, key) {
7999
+ return node[key];
8000
+ }
7986
8001
 
7987
- setProperty(node, key, value) {
7988
- if (process.env.NODE_ENV !== 'production') {
7989
- if (node instanceof Element && !(key in node)) {
7990
- // TODO [#1297]: Move this validation to the compiler
7991
- assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
7992
- }
8002
+ function setProperty(node, key, value) {
8003
+ if (process.env.NODE_ENV !== 'production') {
8004
+ if (node instanceof Element && !(key in node)) {
8005
+ // TODO [#1297]: Move this validation to the compiler
8006
+ assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
7993
8007
  }
8008
+ }
7994
8009
 
7995
- node[key] = value;
7996
- },
8010
+ node[key] = value;
8011
+ }
7997
8012
 
7998
- getAttribute(element, name, namespace) {
7999
- return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8000
- },
8013
+ function getAttribute(element, name, namespace) {
8014
+ return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8015
+ }
8001
8016
 
8002
- setAttribute(element, name, value, namespace) {
8003
- return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8004
- },
8017
+ function setAttribute(element, name, value, namespace) {
8018
+ return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8019
+ }
8005
8020
 
8006
- removeAttribute(element, name, namespace) {
8007
- if (isUndefined$1(namespace)) {
8008
- element.removeAttribute(name);
8009
- } else {
8010
- element.removeAttributeNS(namespace, name);
8011
- }
8012
- },
8021
+ function removeAttribute(element, name, namespace) {
8022
+ if (isUndefined$1(namespace)) {
8023
+ element.removeAttribute(name);
8024
+ } else {
8025
+ element.removeAttributeNS(namespace, name);
8026
+ }
8027
+ }
8013
8028
 
8014
- addEventListener(target, type, callback, options) {
8015
- target.addEventListener(type, callback, options);
8016
- },
8029
+ function addEventListener(target, type, callback, options) {
8030
+ target.addEventListener(type, callback, options);
8031
+ }
8017
8032
 
8018
- removeEventListener(target, type, callback, options) {
8019
- target.removeEventListener(type, callback, options);
8020
- },
8033
+ function removeEventListener(target, type, callback, options) {
8034
+ target.removeEventListener(type, callback, options);
8035
+ }
8021
8036
 
8022
- dispatchEvent(target, event) {
8023
- return target.dispatchEvent(event);
8024
- },
8037
+ function dispatchEvent(target, event) {
8038
+ return target.dispatchEvent(event);
8039
+ }
8025
8040
 
8026
- getClassList(element) {
8027
- return element.classList;
8028
- },
8041
+ function getClassList(element) {
8042
+ return element.classList;
8043
+ }
8029
8044
 
8030
- setCSSStyleProperty(element, name, value, important) {
8031
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8032
- // represent elements in the engine?
8033
- element.style.setProperty(name, value, important ? 'important' : '');
8034
- },
8045
+ function setCSSStyleProperty(element, name, value, important) {
8046
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8047
+ // represent elements in the engine?
8048
+ element.style.setProperty(name, value, important ? 'important' : '');
8049
+ }
8035
8050
 
8036
- getBoundingClientRect(element) {
8037
- return element.getBoundingClientRect();
8038
- },
8051
+ function getBoundingClientRect(element) {
8052
+ return element.getBoundingClientRect();
8053
+ }
8039
8054
 
8040
- querySelector(element, selectors) {
8041
- return element.querySelector(selectors);
8042
- },
8055
+ function querySelector(element, selectors) {
8056
+ return element.querySelector(selectors);
8057
+ }
8043
8058
 
8044
- querySelectorAll(element, selectors) {
8045
- return element.querySelectorAll(selectors);
8046
- },
8059
+ function querySelectorAll(element, selectors) {
8060
+ return element.querySelectorAll(selectors);
8061
+ }
8047
8062
 
8048
- getElementsByTagName(element, tagNameOrWildCard) {
8049
- return element.getElementsByTagName(tagNameOrWildCard);
8050
- },
8063
+ function getElementsByTagName(element, tagNameOrWildCard) {
8064
+ return element.getElementsByTagName(tagNameOrWildCard);
8065
+ }
8051
8066
 
8052
- getElementsByClassName(element, names) {
8053
- return element.getElementsByClassName(names);
8054
- },
8067
+ function getElementsByClassName(element, names) {
8068
+ return element.getElementsByClassName(names);
8069
+ }
8055
8070
 
8056
- getChildren(element) {
8057
- return element.children;
8058
- },
8071
+ function getChildren(element) {
8072
+ return element.children;
8073
+ }
8059
8074
 
8060
- getChildNodes(element) {
8061
- return element.childNodes;
8062
- },
8075
+ function getChildNodes(element) {
8076
+ return element.childNodes;
8077
+ }
8063
8078
 
8064
- getFirstChild(element) {
8065
- return element.firstChild;
8066
- },
8079
+ function getFirstChild(element) {
8080
+ return element.firstChild;
8081
+ }
8067
8082
 
8068
- getFirstElementChild(element) {
8069
- return element.firstElementChild;
8070
- },
8083
+ function getFirstElementChild(element) {
8084
+ return element.firstElementChild;
8085
+ }
8071
8086
 
8072
- getLastChild(element) {
8073
- return element.lastChild;
8074
- },
8087
+ function getLastChild(element) {
8088
+ return element.lastChild;
8089
+ }
8075
8090
 
8076
- getLastElementChild(element) {
8077
- return element.lastElementChild;
8078
- },
8091
+ function getLastElementChild(element) {
8092
+ return element.lastElementChild;
8093
+ }
8079
8094
 
8080
- isConnected(node) {
8081
- return node.isConnected;
8082
- },
8095
+ function isConnected(node) {
8096
+ return node.isConnected;
8097
+ }
8083
8098
 
8084
- insertGlobalStylesheet(content) {
8085
- if (!isUndefined$1(globalStylesheets[content])) {
8086
- return;
8087
- }
8099
+ function insertGlobalStylesheet(content) {
8100
+ if (!isUndefined$1(globalStylesheets[content])) {
8101
+ return;
8102
+ }
8088
8103
 
8089
- globalStylesheets[content] = true;
8090
- const elm = document.createElement('style');
8091
- elm.type = 'text/css';
8092
- elm.textContent = content;
8093
- globalStylesheetsParentElement.appendChild(elm);
8094
- },
8104
+ globalStylesheets[content] = true;
8105
+ const elm = document.createElement('style');
8106
+ elm.type = 'text/css';
8107
+ elm.textContent = content;
8108
+ globalStylesheetsParentElement.appendChild(elm);
8109
+ }
8095
8110
 
8096
- insertStylesheet(content, target) {
8097
- if (supportsConstructableStyleSheets) {
8098
- insertConstructableStyleSheet(content, target);
8099
- } else {
8100
- // Fall back to <style> element
8101
- insertStyleElement(content, target);
8102
- }
8103
- },
8111
+ function insertStylesheet(content, target) {
8112
+ if (supportsConstructableStyleSheets) {
8113
+ insertConstructableStyleSheet(content, target);
8114
+ } else {
8115
+ // Fall back to <style> element
8116
+ insertStyleElement(content, target);
8117
+ }
8118
+ }
8104
8119
 
8105
- assertInstanceOfHTMLElement(elm, msg) {
8106
- assert.invariant(elm instanceof HTMLElement, msg);
8107
- },
8120
+ function assertInstanceOfHTMLElement(elm, msg) {
8121
+ assert.invariant(elm instanceof HTMLElement, msg);
8122
+ }
8108
8123
 
8109
- defineCustomElement,
8110
- getCustomElement,
8111
- HTMLElement: HTMLElementConstructor
8112
- };
8124
+ const HTMLElementExported = HTMLElementConstructor;
8125
+ /*
8126
+ * Copyright (c) 2020, salesforce.com, inc.
8127
+ * All rights reserved.
8128
+ * SPDX-License-Identifier: MIT
8129
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8130
+ */
8131
+
8132
+ setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
8133
+ setAttachShadow(attachShadow);
8134
+ setCreateComment(createComment);
8135
+ setCreateElement(createElement$1);
8136
+ setCreateText(createText);
8137
+ setDefineCustomElement(defineCustomElement);
8138
+ setDispatchEvent(dispatchEvent);
8139
+ setGetAttribute(getAttribute);
8140
+ setGetBoundingClientRect(getBoundingClientRect);
8141
+ setGetChildNodes(getChildNodes);
8142
+ setGetChildren(getChildren);
8143
+ setGetClassList(getClassList);
8144
+ setGetCustomElement(getCustomElement);
8145
+ setGetElementsByClassName(getElementsByClassName);
8146
+ setGetElementsByTagName(getElementsByTagName);
8147
+ setGetFirstChild(getFirstChild);
8148
+ setGetFirstElementChild(getFirstElementChild);
8149
+ setGetLastChild(getLastChild);
8150
+ setGetLastElementChild(getLastElementChild);
8151
+ setGetProperty(getProperty);
8152
+ setHTMLElement(HTMLElementExported);
8153
+ setInsert(insert);
8154
+ setInsertGlobalStylesheet(insertGlobalStylesheet);
8155
+ setInsertStylesheet(insertStylesheet);
8156
+ setIsConnected(isConnected);
8157
+ setIsHydrating$1(isHydrating);
8158
+ setIsNativeShadowDefined(isNativeShadowDefined);
8159
+ setIsSyntheticShadowDefined(isSyntheticShadowDefined);
8160
+ setNextSibling(nextSibling);
8161
+ setQuerySelector(querySelector);
8162
+ setQuerySelectorAll(querySelectorAll);
8163
+ setRemove(remove);
8164
+ setRemoveAttribute(removeAttribute);
8165
+ setRemoveEventListener(removeEventListener);
8166
+ setSetAttribute(setAttribute);
8167
+ setSetCSSStyleProperty(setCSSStyleProperty);
8168
+ setSetProperty(setProperty);
8169
+ setSetText(setText);
8170
+ setSsr(ssr);
8171
+ setAddEventListener(addEventListener);
8113
8172
  /*
8114
8173
  * Copyright (c) 2018, salesforce.com, inc.
8115
8174
  * All rights reserved.
@@ -8192,7 +8251,7 @@ var LWC = (function (exports) {
8192
8251
  throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
8193
8252
  }
8194
8253
 
8195
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
8254
+ const UpgradableConstructor = getUpgradableConstructor(sel);
8196
8255
  let wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
8197
8256
 
8198
8257
  /**
@@ -8207,8 +8266,7 @@ var LWC = (function (exports) {
8207
8266
  createVM(elm, def, {
8208
8267
  tagName: sel,
8209
8268
  mode: options.mode !== 'closed' ? 'open' : 'closed',
8210
- owner: null,
8211
- renderer
8269
+ owner: null
8212
8270
  });
8213
8271
  ConnectingSlot.set(elm, connectRootElement);
8214
8272
  DisconnectingSlot.set(elm, disconnectRootElement);
@@ -8231,6 +8289,10 @@ var LWC = (function (exports) {
8231
8289
 
8232
8290
 
8233
8291
  function hydrateComponent(element, Ctor, props = {}) {
8292
+ if (!(element instanceof Element)) {
8293
+ throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
8294
+ }
8295
+
8234
8296
  if (!isFunction$1(Ctor)) {
8235
8297
  throw new TypeError(`"hydrateComponent" expects a valid component constructor as the second parameter but instead received ${Ctor}.`);
8236
8298
  }
@@ -8248,7 +8310,6 @@ var LWC = (function (exports) {
8248
8310
  createVM(element, def, {
8249
8311
  mode: 'open',
8250
8312
  owner: null,
8251
- renderer,
8252
8313
  tagName: element.tagName.toLowerCase()
8253
8314
  });
8254
8315
 
@@ -8319,8 +8380,7 @@ var LWC = (function (exports) {
8319
8380
  createVM(this, def, {
8320
8381
  mode: 'open',
8321
8382
  owner: null,
8322
- tagName: this.tagName,
8323
- renderer
8383
+ tagName: this.tagName
8324
8384
  });
8325
8385
  }
8326
8386
 
@@ -8387,7 +8447,7 @@ var LWC = (function (exports) {
8387
8447
  return false;
8388
8448
  }
8389
8449
 
8390
- if (renderer.isSyntheticShadowDefined) {
8450
+ if (isSyntheticShadowDefined) {
8391
8451
  // TODO [#1252]: old behavior that is still used by some pieces of the platform,
8392
8452
  // specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
8393
8453
  // used, will be considered global elements.
@@ -8440,7 +8500,7 @@ var LWC = (function (exports) {
8440
8500
  });
8441
8501
  freeze(LightningElement);
8442
8502
  seal(LightningElement.prototype);
8443
- /* version: 2.6.2 */
8503
+ /* version: 2.7.3 */
8444
8504
 
8445
8505
  exports.LightningElement = LightningElement;
8446
8506
  exports.__unstable__ProfilerControl = profilerControl;