@everymatrix/lottery-grid 1.52.6 → 1.53.10

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.
@@ -21,19 +21,23 @@ function _interopNamespace(e) {
21
21
  }
22
22
 
23
23
  const NAMESPACE = 'lottery-grid';
24
- const BUILD = /* lottery-grid */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false };
24
+ const BUILD = /* lottery-grid */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false };
25
25
 
26
26
  /*
27
- Stencil Client Platform v4.22.3 | MIT Licensed | https://stenciljs.com
27
+ Stencil Client Platform v4.25.1 | MIT Licensed | https://stenciljs.com
28
28
  */
29
29
  var __defProp = Object.defineProperty;
30
30
  var __export = (target, all) => {
31
31
  for (var name in all)
32
32
  __defProp(target, name, { get: all[name], enumerable: true });
33
33
  };
34
+
35
+ // src/client/client-host-ref.ts
34
36
  var hostRefs = /* @__PURE__ */ new WeakMap();
35
37
  var getHostRef = (ref) => hostRefs.get(ref);
36
- var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
38
+ var registerInstance = (lazyInstance, hostRef) => {
39
+ hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
40
+ };
37
41
  var registerHost = (hostElement, cmpMeta) => {
38
42
  const hostRef = {
39
43
  $flags$: 0,
@@ -46,7 +50,8 @@ var registerHost = (hostElement, cmpMeta) => {
46
50
  hostElement["s-p"] = [];
47
51
  hostElement["s-rc"] = [];
48
52
  }
49
- return hostRefs.set(hostElement, hostRef);
53
+ const ref = hostRefs.set(hostElement, hostRef);
54
+ return ref;
50
55
  };
51
56
  var isMemberInElement = (elm, memberName) => memberName in elm;
52
57
  var consoleError = (e, el) => (0, console.error)(e, el);
@@ -83,16 +88,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
83
88
  /* webpackExclude: /\.system\.entry\.js$/ */
84
89
  /* webpackMode: "lazy" */
85
90
  `./${bundleId}.entry.js${""}`
86
- )); }).then((importedModule) => {
87
- {
88
- cmpModules.set(bundleId, importedModule);
91
+ )); }).then(
92
+ (importedModule) => {
93
+ {
94
+ cmpModules.set(bundleId, importedModule);
95
+ }
96
+ return importedModule[exportName];
97
+ },
98
+ (e) => {
99
+ consoleError(e, hostRef.$hostElement$);
89
100
  }
90
- return importedModule[exportName];
91
- }, consoleError);
101
+ );
92
102
  };
93
103
 
94
104
  // src/client/client-style.ts
95
105
  var styles = /* @__PURE__ */ new Map();
106
+ var HYDRATED_STYLE_ID = "sty-id";
96
107
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
97
108
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
98
109
  var win = typeof window !== "undefined" ? window : {};
@@ -166,12 +177,6 @@ var flush = () => {
166
177
  };
167
178
  var nextTick = (cb) => promiseResolve().then(cb);
168
179
  var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
169
-
170
- // src/utils/constants.ts
171
- var EMPTY_OBJ = {};
172
-
173
- // src/utils/helpers.ts
174
- var isDef = (v) => v != null;
175
180
  var isComplexType = (o) => {
176
181
  o = typeof o;
177
182
  return o === "object" || o === "function";
@@ -375,7 +380,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
375
380
  }
376
381
  if (!appliedStyles.has(scopeId2)) {
377
382
  {
378
- styleElm = doc.createElement("style");
383
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
379
384
  styleElm.innerHTML = style;
380
385
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
381
386
  if (nonce != null) {
@@ -385,7 +390,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
385
390
  if (styleContainerNode.nodeName === "HEAD") {
386
391
  const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
387
392
  const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
388
- styleContainerNode.insertBefore(styleElm, referenceNode2);
393
+ styleContainerNode.insertBefore(
394
+ styleElm,
395
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
396
+ );
389
397
  } else if ("host" in styleContainerNode) {
390
398
  if (supportsConstructableStylesheets) {
391
399
  const stylesheet = new CSSStyleSheet();
@@ -435,16 +443,18 @@ var attachStyles = (hostRef) => {
435
443
  endAttachStyles();
436
444
  };
437
445
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
438
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
446
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
439
447
  if (oldValue !== newValue) {
440
448
  let isProp = isMemberInElement(elm, memberName);
441
449
  let ln = memberName.toLowerCase();
442
450
  if (memberName === "class") {
443
451
  const classList = elm.classList;
444
452
  const oldClasses = parseClassList(oldValue);
445
- const newClasses = parseClassList(newValue);
446
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
447
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
453
+ let newClasses = parseClassList(newValue);
454
+ {
455
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
456
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
457
+ }
448
458
  } else if (memberName === "key") ; else if (memberName === "ref") {
449
459
  if (newValue) {
450
460
  newValue(elm);
@@ -482,7 +492,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
482
492
  elm.setAttribute(memberName, n);
483
493
  }
484
494
  }
485
- } else {
495
+ } else if (elm[memberName] !== newValue) {
486
496
  elm[memberName] = newValue;
487
497
  }
488
498
  } catch (e) {
@@ -504,24 +514,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
504
514
  }
505
515
  };
506
516
  var parseClassListRegex = /\s/;
507
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
517
+ var parseClassList = (value) => {
518
+ if (typeof value === "object" && value && "baseVal" in value) {
519
+ value = value.baseVal;
520
+ }
521
+ if (!value || typeof value !== "string") {
522
+ return [];
523
+ }
524
+ return value.split(parseClassListRegex);
525
+ };
508
526
  var CAPTURE_EVENT_SUFFIX = "Capture";
509
527
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
510
528
 
511
529
  // src/runtime/vdom/update-element.ts
512
- var updateElement = (oldVnode, newVnode, isSvgMode2) => {
530
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
513
531
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
514
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
515
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
532
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
533
+ const newVnodeAttrs = newVnode.$attrs$ || {};
516
534
  {
517
535
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
518
536
  if (!(memberName in newVnodeAttrs)) {
519
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
537
+ setAccessor(
538
+ elm,
539
+ memberName,
540
+ oldVnodeAttrs[memberName],
541
+ void 0,
542
+ isSvgMode2,
543
+ newVnode.$flags$);
520
544
  }
521
545
  }
522
546
  }
523
547
  for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
524
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
548
+ setAccessor(
549
+ elm,
550
+ memberName,
551
+ oldVnodeAttrs[memberName],
552
+ newVnodeAttrs[memberName],
553
+ isSvgMode2,
554
+ newVnode.$flags$);
525
555
  }
526
556
  };
527
557
  function sortedAttrNames(attrNames) {
@@ -533,13 +563,10 @@ function sortedAttrNames(attrNames) {
533
563
  attrNames
534
564
  );
535
565
  }
536
-
537
- // src/runtime/vdom/vdom-render.ts
538
- var scopeId;
539
566
  var hostTagName;
540
567
  var useNativeShadowDom = false;
541
568
  var isSvgMode = false;
542
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
569
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
543
570
  const newVNode2 = newParentVNode.$children$[childIndex];
544
571
  let i2 = 0;
545
572
  let elm;
@@ -553,11 +580,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
553
580
  {
554
581
  updateElement(null, newVNode2, isSvgMode);
555
582
  }
556
- const rootNode = elm.getRootNode();
557
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
558
- if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
559
- elm.classList.add(elm["s-si"] = scopeId);
560
- }
561
583
  if (newVNode2.$children$) {
562
584
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
563
585
  childNode = createElm(oldParentVNode, newVNode2, i2);
@@ -687,6 +709,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
687
709
  if (!isInitialRender) {
688
710
  return leftVNode.$key$ === rightVNode.$key$;
689
711
  }
712
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
713
+ leftVNode.$key$ = rightVNode.$key$;
714
+ }
690
715
  return true;
691
716
  }
692
717
  return false;
@@ -726,8 +751,9 @@ var nullifyVNodeRefs = (vNode) => {
726
751
  }
727
752
  };
728
753
  var insertBefore = (parent, newNode, reference) => {
729
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
730
- return inserted;
754
+ {
755
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
756
+ }
731
757
  };
732
758
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
733
759
  const hostElm = hostRef.$hostElement$;
@@ -752,9 +778,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
752
778
  rootVnode.$flags$ |= 4 /* isHost */;
753
779
  hostRef.$vnode$ = rootVnode;
754
780
  rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
755
- {
756
- scopeId = hostElm["s-sc"];
757
- }
758
781
  useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
759
782
  patch(oldVNode, rootVnode, isInitialLoad);
760
783
  };
@@ -762,7 +785,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
762
785
  // src/runtime/update-component.ts
763
786
  var attachToAncestor = (hostRef, ancestorComponent) => {
764
787
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
765
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
788
+ const index = ancestorComponent["s-p"].push(
789
+ new Promise(
790
+ (r) => hostRef.$onRenderResolve$ = () => {
791
+ ancestorComponent["s-p"].splice(index - 1, 1);
792
+ r();
793
+ }
794
+ )
795
+ );
766
796
  }
767
797
  };
768
798
  var scheduleUpdate = (hostRef, isInitialLoad) => {
@@ -791,7 +821,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
791
821
  {
792
822
  hostRef.$flags$ |= 256 /* isListenReady */;
793
823
  if (hostRef.$queuedListeners$) {
794
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
824
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
795
825
  hostRef.$queuedListeners$ = void 0;
796
826
  }
797
827
  }
@@ -862,7 +892,7 @@ var postUpdateComponent = (hostRef) => {
862
892
  const instance = hostRef.$lazyInstance$ ;
863
893
  const ancestorComponent = hostRef.$ancestorComponent$;
864
894
  {
865
- safeCall(instance, "componentDidRender");
895
+ safeCall(instance, "componentDidRender", void 0, elm);
866
896
  }
867
897
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
868
898
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
@@ -896,12 +926,12 @@ var appDidLoad = (who) => {
896
926
  }
897
927
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
898
928
  };
899
- var safeCall = (instance, method, arg) => {
929
+ var safeCall = (instance, method, arg, elm) => {
900
930
  if (instance && instance[method]) {
901
931
  try {
902
932
  return instance[method](arg);
903
933
  } catch (e) {
904
- consoleError(e);
934
+ consoleError(e, elm);
905
935
  }
906
936
  }
907
937
  return void 0;
@@ -944,15 +974,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
944
974
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
945
975
  members.map(([memberName, [memberFlags]]) => {
946
976
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
977
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
978
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
979
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
980
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
981
+ Object.defineProperty(prototype, memberName, {
982
+ get() {
983
+ {
984
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
985
+ return getValue(this, memberName);
986
+ }
987
+ const ref = getHostRef(this);
988
+ const instance = ref ? ref.$lazyInstance$ : prototype;
989
+ if (!instance) return;
990
+ return instance[memberName];
991
+ }
992
+ },
993
+ configurable: true,
994
+ enumerable: true
995
+ });
996
+ }
947
997
  Object.defineProperty(prototype, memberName, {
948
- get() {
949
- return getValue(this, memberName);
950
- },
951
998
  set(newValue) {
952
- setValue(this, memberName, newValue, cmpMeta);
953
- },
954
- configurable: true,
955
- enumerable: true
999
+ const ref = getHostRef(this);
1000
+ if (origSetter) {
1001
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1002
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
1003
+ newValue = ref.$instanceValues$.get(memberName);
1004
+ } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
1005
+ ref.$instanceValues$.set(memberName, currentValue);
1006
+ }
1007
+ origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
1008
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1009
+ setValue(this, memberName, newValue, cmpMeta);
1010
+ return;
1011
+ }
1012
+ {
1013
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
1014
+ setValue(this, memberName, newValue, cmpMeta);
1015
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
1016
+ ref.$onReadyPromise$.then(() => {
1017
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
1018
+ ref.$lazyInstance$[memberName] = newValue;
1019
+ }
1020
+ });
1021
+ }
1022
+ return;
1023
+ }
1024
+ const setterSetVal = () => {
1025
+ const currentValue = ref.$lazyInstance$[memberName];
1026
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
1027
+ ref.$instanceValues$.set(memberName, currentValue);
1028
+ }
1029
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
1030
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1031
+ };
1032
+ if (ref.$lazyInstance$) {
1033
+ setterSetVal();
1034
+ } else {
1035
+ ref.$onReadyPromise$.then(() => setterSetVal());
1036
+ }
1037
+ }
1038
+ }
956
1039
  });
957
1040
  }
958
1041
  });
@@ -962,7 +1045,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
962
1045
  plt.jmp(() => {
963
1046
  var _a2;
964
1047
  const propName = attrNameToPropName.get(attrName);
965
- if (this.hasOwnProperty(propName)) {
1048
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
966
1049
  newValue = this[propName];
967
1050
  delete this[propName];
968
1051
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
@@ -982,7 +1065,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
982
1065
  }
983
1066
  return;
984
1067
  }
985
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1068
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1069
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1070
+ if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
1071
+ this[propName] = newValue;
1072
+ }
986
1073
  });
987
1074
  };
988
1075
  Cstr.observedAttributes = Array.from(
@@ -1009,9 +1096,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1009
1096
  let Cstr;
1010
1097
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1011
1098
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1012
- const bundleId = cmpMeta.$lazyBundleId$;
1013
- if (bundleId) {
1014
- const CstrImport = loadModule(cmpMeta);
1099
+ {
1100
+ const CstrImport = loadModule(cmpMeta, hostRef);
1015
1101
  if (CstrImport && "then" in CstrImport) {
1016
1102
  const endLoad = uniqueTime();
1017
1103
  Cstr = await CstrImport;
@@ -1033,17 +1119,13 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1033
1119
  try {
1034
1120
  new Cstr(hostRef);
1035
1121
  } catch (e) {
1036
- consoleError(e);
1122
+ consoleError(e, elm);
1037
1123
  }
1038
1124
  {
1039
1125
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1040
1126
  }
1041
1127
  endNewInstance();
1042
- fireConnectedCallback(hostRef.$lazyInstance$);
1043
- } else {
1044
- Cstr = elm.constructor;
1045
- const cmpTag = elm.localName;
1046
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
1128
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1047
1129
  }
1048
1130
  if (Cstr && Cstr.style) {
1049
1131
  let style;
@@ -1066,9 +1148,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1066
1148
  schedule();
1067
1149
  }
1068
1150
  };
1069
- var fireConnectedCallback = (instance) => {
1151
+ var fireConnectedCallback = (instance, elm) => {
1070
1152
  {
1071
- safeCall(instance, "connectedCallback");
1153
+ safeCall(instance, "connectedCallback", void 0, elm);
1072
1154
  }
1073
1155
  };
1074
1156
 
@@ -1104,15 +1186,15 @@ var connectedCallback = (elm) => {
1104
1186
  } else {
1105
1187
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1106
1188
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1107
- fireConnectedCallback(hostRef.$lazyInstance$);
1189
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1108
1190
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1109
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
1191
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1110
1192
  }
1111
1193
  }
1112
1194
  endConnected();
1113
1195
  }
1114
1196
  };
1115
- var disconnectInstance = (instance) => {
1197
+ var disconnectInstance = (instance, elm) => {
1116
1198
  };
1117
1199
  var disconnectedCallback = async (elm) => {
1118
1200
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
@@ -1127,6 +1209,12 @@ var disconnectedCallback = async (elm) => {
1127
1209
  hostRef.$onReadyPromise$.then(() => disconnectInstance());
1128
1210
  }
1129
1211
  }
1212
+ if (rootAppliedStyles.has(elm)) {
1213
+ rootAppliedStyles.delete(elm);
1214
+ }
1215
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
1216
+ rootAppliedStyles.delete(elm.shadowRoot);
1217
+ }
1130
1218
  };
1131
1219
 
1132
1220
  // src/runtime/bootstrap-lazy.ts
@@ -1207,6 +1295,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1207
1295
  }
1208
1296
  disconnectedCallback() {
1209
1297
  plt.jmp(() => disconnectedCallback(this));
1298
+ plt.raf(() => {
1299
+ var _a3;
1300
+ const hostRef = getHostRef(this);
1301
+ if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1302
+ delete hostRef.$vnode$.$elm$;
1303
+ }
1304
+ });
1210
1305
  }
1211
1306
  componentOnReady() {
1212
1307
  return getHostRef(this).$onReadyPromise$;
@@ -1270,7 +1365,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
1270
1365
  }
1271
1366
  }
1272
1367
  } catch (e) {
1273
- consoleError(e);
1368
+ consoleError(e, hostRef.$hostElement$);
1274
1369
  }
1275
1370
  };
1276
1371
  var getHostListenerTarget = (elm, flags) => {
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8b26cfcb.js');
5
+ const index = require('./index-da5ca73b.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["lottery-bullet_2.cjs",[[1,"lottery-grid",{"ticketId":[514,"ticket-id"],"totalNumbers":[514,"total-numbers"],"gameId":[513,"game-id"],"maximumAllowed":[514,"maximum-allowed"],"minimumAllowed":[514,"minimum-allowed"],"selectable":[516],"selectedNumbers":[513,"selected-numbers"],"displaySelected":[516,"display-selected"],"language":[513],"gridIndex":[514,"grid-index"],"gridType":[513,"grid-type"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"numbers":[32],"limitStylingAppends":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[513],"selectable":[516],"isSelected":[516,"is-selected"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"limitStylingAppends":[32]}]]]], options);
11
+ return index.bootstrapLazy([["lottery-bullet_2.cjs",[[1,"lottery-grid",{"ticketId":[514,"ticket-id"],"totalNumbers":[514,"total-numbers"],"gameId":[513,"game-id"],"maximumAllowed":[514,"maximum-allowed"],"minimumAllowed":[514,"minimum-allowed"],"numberRange":[513,"number-range"],"selectable":[516],"selectedNumbers":[513,"selected-numbers"],"secondaryNumbers":[513,"secondary-numbers"],"displaySelected":[516,"display-selected"],"language":[513],"gridIndex":[514,"grid-index"],"gridType":[513,"grid-type"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"highNumber":[514,"high-number"],"lowNumber":[514,"low-number"],"selectionType":[513,"selection-type"],"partialQuickpickAvailable":[516,"partial-quickpick-available"],"numbers":[32],"bonusNumbers":[32],"limitStylingAppends":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[513],"selectable":[516],"isSelected":[516,"is-selected"],"isBonus":[516,"is-bonus"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"limitStylingAppends":[32]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;