@stencil/core 4.40.1 → 4.41.0-dev.1767652714.953346e

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 (45) hide show
  1. package/cli/config-flags.d.ts +2 -2
  2. package/cli/index.cjs +9 -4
  3. package/cli/index.js +9 -4
  4. package/cli/package.json +1 -1
  5. package/compiler/package.json +1 -1
  6. package/compiler/stencil.js +307 -142
  7. package/dev-server/client/index.js +12 -12
  8. package/dev-server/client/package.json +1 -1
  9. package/dev-server/connector.html +3 -3
  10. package/dev-server/index.js +2 -2
  11. package/dev-server/package.json +1 -1
  12. package/dev-server/server-process.js +18 -11
  13. package/internal/app-data/package.json +1 -1
  14. package/internal/app-globals/package.json +1 -1
  15. package/internal/client/index.js +105 -25
  16. package/internal/client/package.json +1 -1
  17. package/internal/client/patch-browser.js +1 -1
  18. package/internal/hydrate/index.js +65 -26
  19. package/internal/hydrate/package.json +1 -1
  20. package/internal/hydrate/runner.js +4262 -4210
  21. package/internal/package.json +1 -1
  22. package/internal/stencil-core/jsx-dev-runtime.cjs +7 -0
  23. package/internal/stencil-core/jsx-dev-runtime.d.ts +23 -0
  24. package/internal/stencil-core/jsx-dev-runtime.js +2 -0
  25. package/internal/stencil-core/jsx-runtime.cjs +8 -0
  26. package/internal/stencil-core/jsx-runtime.d.ts +22 -0
  27. package/internal/stencil-core/jsx-runtime.js +2 -0
  28. package/internal/stencil-private.d.ts +20 -0
  29. package/internal/stencil-public-compiler.d.ts +6 -0
  30. package/internal/stencil-public-docs.d.ts +11 -0
  31. package/internal/stencil-public-runtime.d.ts +29 -0
  32. package/internal/testing/index.js +753 -638
  33. package/internal/testing/package.json +1 -1
  34. package/mock-doc/index.cjs +192 -135
  35. package/mock-doc/index.js +193 -135
  36. package/mock-doc/package.json +1 -1
  37. package/package.json +11 -1
  38. package/screenshot/index.js +29 -8
  39. package/screenshot/package.json +1 -1
  40. package/screenshot/pixel-match.js +1 -1
  41. package/sys/node/index.js +29 -29
  42. package/sys/node/package.json +1 -1
  43. package/sys/node/worker.js +1 -1
  44. package/testing/index.js +98 -70
  45. package/testing/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Platform v4.40.1 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Platform v4.41.0-dev.1767652714.953346e | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -2339,7 +2339,8 @@ var patchPseudoShadowDom = (hostElementPrototype) => {
2339
2339
  patchSlotRemoveChild(hostElementPrototype);
2340
2340
  };
2341
2341
  var patchCloneNode = (HostElementPrototype) => {
2342
- const orgCloneNode = HostElementPrototype.cloneNode;
2342
+ if (HostElementPrototype.__cloneNode) return;
2343
+ const orgCloneNode = HostElementPrototype.__cloneNode = HostElementPrototype.cloneNode;
2343
2344
  HostElementPrototype.cloneNode = function(deep) {
2344
2345
  const srcNode = this;
2345
2346
  const isShadowDom = BUILD10.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
@@ -2384,6 +2385,7 @@ var patchCloneNode = (HostElementPrototype) => {
2384
2385
  };
2385
2386
  };
2386
2387
  var patchSlotAppendChild = (HostElementPrototype) => {
2388
+ if (HostElementPrototype.__appendChild) return;
2387
2389
  HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
2388
2390
  HostElementPrototype.appendChild = function(newChild) {
2389
2391
  const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
@@ -2401,6 +2403,7 @@ var patchSlotAppendChild = (HostElementPrototype) => {
2401
2403
  };
2402
2404
  };
2403
2405
  var patchSlotRemoveChild = (ElementPrototype) => {
2406
+ if (ElementPrototype.__removeChild) return;
2404
2407
  ElementPrototype.__removeChild = ElementPrototype.removeChild;
2405
2408
  ElementPrototype.removeChild = function(toRemove) {
2406
2409
  if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
@@ -2416,6 +2419,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
2416
2419
  };
2417
2420
  };
2418
2421
  var patchSlotPrepend = (HostElementPrototype) => {
2422
+ if (HostElementPrototype.__prepend) return;
2419
2423
  HostElementPrototype.__prepend = HostElementPrototype.prepend;
2420
2424
  HostElementPrototype.prepend = function(...newChildren) {
2421
2425
  newChildren.forEach((newChild) => {
@@ -2442,6 +2446,7 @@ var patchSlotPrepend = (HostElementPrototype) => {
2442
2446
  };
2443
2447
  };
2444
2448
  var patchSlotAppend = (HostElementPrototype) => {
2449
+ if (HostElementPrototype.__append) return;
2445
2450
  HostElementPrototype.__append = HostElementPrototype.append;
2446
2451
  HostElementPrototype.append = function(...newChildren) {
2447
2452
  newChildren.forEach((newChild) => {
@@ -2453,6 +2458,7 @@ var patchSlotAppend = (HostElementPrototype) => {
2453
2458
  };
2454
2459
  };
2455
2460
  var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
2461
+ if (HostElementPrototype.__insertAdjacentHTML) return;
2456
2462
  const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
2457
2463
  HostElementPrototype.insertAdjacentHTML = function(position, text) {
2458
2464
  if (position !== "afterbegin" && position !== "beforeend") {
@@ -2478,6 +2484,7 @@ var patchSlotInsertAdjacentText = (HostElementPrototype) => {
2478
2484
  };
2479
2485
  };
2480
2486
  var patchInsertBefore = (HostElementPrototype) => {
2487
+ if (HostElementPrototype.__insertBefore) return;
2481
2488
  const eleProto = HostElementPrototype;
2482
2489
  if (eleProto.__insertBefore) return;
2483
2490
  eleProto.__insertBefore = HostElementPrototype.insertBefore;
@@ -2512,6 +2519,7 @@ var patchInsertBefore = (HostElementPrototype) => {
2512
2519
  };
2513
2520
  };
2514
2521
  var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2522
+ if (HostElementPrototype.__insertAdjacentElement) return;
2515
2523
  const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
2516
2524
  HostElementPrototype.insertAdjacentElement = function(position, element) {
2517
2525
  if (position !== "afterbegin" && position !== "beforeend") {
@@ -4248,11 +4256,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
4248
4256
  patchSlotNode(elm);
4249
4257
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
4250
4258
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
4251
- if (BUILD20.experimentalSlotFixes) {
4252
- relocateToHostRoot(oldParentVNode.$elm$);
4253
- } else {
4254
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
4255
- }
4259
+ relocateToHostRoot(oldParentVNode.$elm$);
4256
4260
  }
4257
4261
  if (BUILD20.scoped || BUILD20.hydrateServerSide && 128 /* shadowNeedsScopedCss */) {
4258
4262
  addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
@@ -4284,7 +4288,7 @@ var relocateToHostRoot = (parentElm) => {
4284
4288
  var putBackInOriginalLocation = (parentElm, recursive) => {
4285
4289
  plt.$flags$ |= 1 /* isTmpDisconnected */;
4286
4290
  const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
4287
- if (parentElm["s-sr"] && BUILD20.experimentalSlotFixes) {
4291
+ if (parentElm["s-sr"]) {
4288
4292
  let node = parentElm;
4289
4293
  while (node = node.nextSibling) {
4290
4294
  if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
@@ -4472,7 +4476,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
4472
4476
  }
4473
4477
  if (BUILD20.vdomAttribute || BUILD20.reflect) {
4474
4478
  if (BUILD20.slot && tag === "slot" && !useNativeShadowDom) {
4475
- if (BUILD20.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
4479
+ if (oldVNode.$name$ !== newVNode2.$name$) {
4476
4480
  newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
4477
4481
  relocateToHostRoot(newVNode2.$elm$.parentElement);
4478
4482
  }
@@ -4515,7 +4519,7 @@ var markSlotContentForRelocation = (elm) => {
4515
4519
  const slotName = childNode["s-sn"];
4516
4520
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
4517
4521
  node = hostContentNodes[j];
4518
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD20.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
4522
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
4519
4523
  if (isNodeLocatedInSlot(node, slotName)) {
4520
4524
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
4521
4525
  checkSlotFallbackVisibility = true;
@@ -4559,19 +4563,19 @@ var nullifyVNodeRefs = (vNode) => {
4559
4563
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
4560
4564
  }
4561
4565
  };
4562
- var insertBefore = (parent, newNode, reference) => {
4566
+ var insertBefore = (parent, newNode, reference, isInitialLoad) => {
4563
4567
  if (BUILD20.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
4564
4568
  addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
4565
- } else if (BUILD20.experimentalSlotFixes && typeof newNode["s-sn"] === "string") {
4566
- if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
4569
+ } else if (typeof newNode["s-sn"] === "string") {
4570
+ if (BUILD20.experimentalSlotFixes && parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
4567
4571
  patchParentNode(newNode);
4568
4572
  }
4569
4573
  parent.insertBefore(newNode, reference);
4570
4574
  const { slotNode } = findSlotFromSlottedNode(newNode);
4571
- if (slotNode) dispatchSlotChangeEvent(slotNode);
4575
+ if (slotNode && !isInitialLoad) dispatchSlotChangeEvent(slotNode);
4572
4576
  return newNode;
4573
4577
  }
4574
- if (BUILD20.experimentalSlotFixes && parent.__insertBefore) {
4578
+ if (parent.__insertBefore) {
4575
4579
  return parent.__insertBefore(newNode, reference);
4576
4580
  } else {
4577
4581
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);
@@ -4659,7 +4663,12 @@ render() {
4659
4663
  if (!nodeToRelocate["s-ol"] && win.document) {
4660
4664
  const orgLocationNode = BUILD20.isDebug || BUILD20.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : win.document.createTextNode("");
4661
4665
  orgLocationNode["s-nr"] = nodeToRelocate;
4662
- insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
4666
+ insertBefore(
4667
+ nodeToRelocate.parentNode,
4668
+ nodeToRelocate["s-ol"] = orgLocationNode,
4669
+ nodeToRelocate,
4670
+ isInitialLoad
4671
+ );
4663
4672
  }
4664
4673
  }
4665
4674
  for (const relocateData of relocateNodes) {
@@ -4671,7 +4680,7 @@ render() {
4671
4680
  if (slotRefNode) {
4672
4681
  const parentNodeRef = slotRefNode.parentNode;
4673
4682
  let insertBeforeNode = slotRefNode.nextSibling;
4674
- if (!BUILD20.hydrateServerSide && (!BUILD20.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
4683
+ if (!BUILD20.hydrateServerSide && insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
4675
4684
  let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
4676
4685
  while (orgLocationNode) {
4677
4686
  let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
@@ -4692,10 +4701,18 @@ render() {
4692
4701
  const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
4693
4702
  if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
4694
4703
  if (nodeToRelocate !== insertBeforeNode) {
4695
- if (!BUILD20.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
4696
- nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
4704
+ insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode, isInitialLoad);
4705
+ if (nodeToRelocate.nodeType === 8 /* CommentNode */ && nodeToRelocate.nodeValue.startsWith("s-nt-")) {
4706
+ const textNode = win.document.createTextNode(nodeToRelocate.nodeValue.replace(/^s-nt-/, ""));
4707
+ textNode["s-hn"] = nodeToRelocate["s-hn"];
4708
+ textNode["s-sn"] = nodeToRelocate["s-sn"];
4709
+ textNode["s-sh"] = nodeToRelocate["s-sh"];
4710
+ textNode["s-sr"] = nodeToRelocate["s-sr"];
4711
+ textNode["s-ol"] = nodeToRelocate["s-ol"];
4712
+ textNode["s-ol"]["s-nr"] = textNode;
4713
+ insertBefore(nodeToRelocate.parentNode, textNode, nodeToRelocate, isInitialLoad);
4714
+ nodeToRelocate.parentNode.removeChild(nodeToRelocate);
4697
4715
  }
4698
- insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
4699
4716
  if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
4700
4717
  nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
4701
4718
  }
@@ -4713,14 +4730,21 @@ render() {
4713
4730
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
4714
4731
  relocateNodes.length = 0;
4715
4732
  }
4716
- if (BUILD20.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4733
+ if (BUILD20.slotRelocation && !useNativeShadowDom && !(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && hostElm["s-cr"]) {
4717
4734
  const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
4718
4735
  for (const childNode of children) {
4719
- if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"] && childNode.nodeType === 1 /* ElementNode */) {
4736
+ if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
4720
4737
  if (isInitialLoad && childNode["s-ih"] == null) {
4721
4738
  childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
4722
4739
  }
4723
- childNode.hidden = true;
4740
+ if (childNode.nodeType === 1 /* ElementNode */) {
4741
+ childNode.hidden = true;
4742
+ } else if (childNode.nodeType === 3 /* TextNode */ && !!childNode.nodeValue.trim()) {
4743
+ const textCommentNode = win.document.createComment("s-nt-" + childNode.nodeValue);
4744
+ textCommentNode["s-sn"] = childNode["s-sn"];
4745
+ insertBefore(childNode.parentNode, textCommentNode, childNode, isInitialLoad);
4746
+ childNode.parentNode.removeChild(childNode);
4747
+ }
4724
4748
  }
4725
4749
  }
4726
4750
  }
@@ -4782,6 +4806,10 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
4782
4806
  let maybePromise;
4783
4807
  if (isInitialLoad) {
4784
4808
  if (BUILD21.lazyLoad) {
4809
+ if (BUILD21.slotRelocation && hostRef.$deferredConnectedCallback$) {
4810
+ hostRef.$deferredConnectedCallback$ = false;
4811
+ safeCall(instance, "connectedCallback", void 0, elm);
4812
+ }
4785
4813
  if (BUILD21.hostListener) {
4786
4814
  hostRef.$flags$ |= 256 /* isListenReady */;
4787
4815
  if (hostRef.$queuedListeners$) {
@@ -5405,7 +5433,12 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
5405
5433
  hostRef.$flags$ |= 128 /* isWatchReady */;
5406
5434
  }
5407
5435
  endNewInstance();
5408
- fireConnectedCallback(hostRef.$lazyInstance$, elm);
5436
+ const needsDeferredCallback = BUILD24.slotRelocation && cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
5437
+ if (!needsDeferredCallback) {
5438
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
5439
+ } else {
5440
+ hostRef.$deferredConnectedCallback$ = true;
5441
+ }
5409
5442
  } else {
5410
5443
  Cstr = elm.constructor;
5411
5444
  const cmpTag = elm.localName;
@@ -5610,6 +5643,8 @@ var proxyCustomElement = (Cstr, compactMeta) => {
5610
5643
  patchTextContent(Cstr.prototype);
5611
5644
  }
5612
5645
  }
5646
+ } else if (BUILD27.cloneNodeFix) {
5647
+ patchCloneNode(Cstr.prototype);
5613
5648
  }
5614
5649
  if (BUILD27.hydrateClientSide && BUILD27.shadowDom) {
5615
5650
  hydrateScopedToShadow();
@@ -5762,10 +5797,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
5762
5797
  }
5763
5798
  const tagName = BUILD28.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : transformTag(cmpMeta.$tagName$);
5764
5799
  const HostElement = class extends HTMLElement {
5800
+ ["s-p"];
5801
+ ["s-rc"];
5802
+ hasRegisteredEventListeners = false;
5765
5803
  // StencilLazyHost
5766
5804
  constructor(self) {
5767
5805
  super(self);
5768
- this.hasRegisteredEventListeners = false;
5769
5806
  self = this;
5770
5807
  registerHost(self, cmpMeta);
5771
5808
  if (BUILD28.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
@@ -5842,6 +5879,8 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
5842
5879
  patchTextContent(HostElement.prototype);
5843
5880
  }
5844
5881
  }
5882
+ } else if (BUILD28.cloneNodeFix) {
5883
+ patchCloneNode(HostElement.prototype);
5845
5884
  }
5846
5885
  if (BUILD28.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
5847
5886
  HostElement.formAssociated = true;
@@ -5994,6 +6033,44 @@ function setTagTransformer(transformer) {
5994
6033
  tagTransformer = transformer;
5995
6034
  }
5996
6035
 
6036
+ // src/runtime/vdom/jsx-dev-runtime.ts
6037
+ function jsxDEV(type, props, key, _isStaticChildren, _source, _self) {
6038
+ const { children, ...rest } = props;
6039
+ const vnodeData = key !== void 0 ? { ...rest, key } : rest;
6040
+ if (Array.isArray(children)) {
6041
+ return h(type, vnodeData, ...children);
6042
+ } else if (children !== void 0) {
6043
+ return h(type, vnodeData, children);
6044
+ }
6045
+ return h(type, vnodeData);
6046
+ }
6047
+
6048
+ // src/runtime/vdom/jsx-runtime.ts
6049
+ function jsx(type, props, key) {
6050
+ const propsObj = props || {};
6051
+ const { children, ...rest } = propsObj;
6052
+ let vnodeData = rest;
6053
+ if (key !== void 0) {
6054
+ vnodeData = { ...rest, key };
6055
+ }
6056
+ if (vnodeData && Object.keys(vnodeData).length === 0) {
6057
+ vnodeData = null;
6058
+ }
6059
+ if (children !== void 0) {
6060
+ if (Array.isArray(children)) {
6061
+ return h(type, vnodeData, ...children);
6062
+ }
6063
+ if (typeof children === "object" && children !== null && "$flags$" in children) {
6064
+ return h(type, vnodeData, children);
6065
+ }
6066
+ return h(type, vnodeData, children);
6067
+ }
6068
+ return h(type, vnodeData);
6069
+ }
6070
+ function jsxs(type, props, key) {
6071
+ return jsx(type, props, key);
6072
+ }
6073
+
5997
6074
  // src/runtime/vdom/vdom-annotations.ts
5998
6075
  var insertVdomAnnotations = (doc, staticComponents) => {
5999
6076
  if (doc != null) {
@@ -6172,6 +6249,9 @@ export {
6172
6249
  h,
6173
6250
  insertVdomAnnotations,
6174
6251
  isMemberInElement,
6252
+ jsx,
6253
+ jsxDEV,
6254
+ jsxs,
6175
6255
  loadModule,
6176
6256
  modeResolutionChain,
6177
6257
  needsScopedSSR,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/client",
3
- "version": "4.40.1",
3
+ "version": "4.41.0-dev.1767652714.953346e",
4
4
  "description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "exports": "./index.js",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Browser v4.40.1 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Browser v4.41.0-dev.1767652714.953346e | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/client/client-patch-browser.ts
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Hydrate Platform v4.40.1 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.41.0-dev.1767652714.953346e | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -2098,7 +2098,8 @@ var patchPseudoShadowDom = (hostElementPrototype) => {
2098
2098
  patchSlotRemoveChild(hostElementPrototype);
2099
2099
  };
2100
2100
  var patchCloneNode = (HostElementPrototype) => {
2101
- const orgCloneNode = HostElementPrototype.cloneNode;
2101
+ if (HostElementPrototype.__cloneNode) return;
2102
+ const orgCloneNode = HostElementPrototype.__cloneNode = HostElementPrototype.cloneNode;
2102
2103
  HostElementPrototype.cloneNode = function(deep) {
2103
2104
  const srcNode = this;
2104
2105
  const isShadowDom = BUILD4.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
@@ -2143,6 +2144,7 @@ var patchCloneNode = (HostElementPrototype) => {
2143
2144
  };
2144
2145
  };
2145
2146
  var patchSlotAppendChild = (HostElementPrototype) => {
2147
+ if (HostElementPrototype.__appendChild) return;
2146
2148
  HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
2147
2149
  HostElementPrototype.appendChild = function(newChild) {
2148
2150
  const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
@@ -2160,6 +2162,7 @@ var patchSlotAppendChild = (HostElementPrototype) => {
2160
2162
  };
2161
2163
  };
2162
2164
  var patchSlotRemoveChild = (ElementPrototype) => {
2165
+ if (ElementPrototype.__removeChild) return;
2163
2166
  ElementPrototype.__removeChild = ElementPrototype.removeChild;
2164
2167
  ElementPrototype.removeChild = function(toRemove) {
2165
2168
  if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
@@ -2175,6 +2178,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
2175
2178
  };
2176
2179
  };
2177
2180
  var patchSlotPrepend = (HostElementPrototype) => {
2181
+ if (HostElementPrototype.__prepend) return;
2178
2182
  HostElementPrototype.__prepend = HostElementPrototype.prepend;
2179
2183
  HostElementPrototype.prepend = function(...newChildren) {
2180
2184
  newChildren.forEach((newChild) => {
@@ -2201,6 +2205,7 @@ var patchSlotPrepend = (HostElementPrototype) => {
2201
2205
  };
2202
2206
  };
2203
2207
  var patchSlotAppend = (HostElementPrototype) => {
2208
+ if (HostElementPrototype.__append) return;
2204
2209
  HostElementPrototype.__append = HostElementPrototype.append;
2205
2210
  HostElementPrototype.append = function(...newChildren) {
2206
2211
  newChildren.forEach((newChild) => {
@@ -2212,6 +2217,7 @@ var patchSlotAppend = (HostElementPrototype) => {
2212
2217
  };
2213
2218
  };
2214
2219
  var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
2220
+ if (HostElementPrototype.__insertAdjacentHTML) return;
2215
2221
  const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
2216
2222
  HostElementPrototype.insertAdjacentHTML = function(position, text) {
2217
2223
  if (position !== "afterbegin" && position !== "beforeend") {
@@ -2237,6 +2243,7 @@ var patchSlotInsertAdjacentText = (HostElementPrototype) => {
2237
2243
  };
2238
2244
  };
2239
2245
  var patchInsertBefore = (HostElementPrototype) => {
2246
+ if (HostElementPrototype.__insertBefore) return;
2240
2247
  const eleProto = HostElementPrototype;
2241
2248
  if (eleProto.__insertBefore) return;
2242
2249
  eleProto.__insertBefore = HostElementPrototype.insertBefore;
@@ -2271,6 +2278,7 @@ var patchInsertBefore = (HostElementPrototype) => {
2271
2278
  };
2272
2279
  };
2273
2280
  var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2281
+ if (HostElementPrototype.__insertAdjacentElement) return;
2274
2282
  const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
2275
2283
  HostElementPrototype.insertAdjacentElement = function(position, element) {
2276
2284
  if (position !== "afterbegin" && position !== "beforeend") {
@@ -4007,11 +4015,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
4007
4015
  patchSlotNode(elm);
4008
4016
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
4009
4017
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
4010
- if (BUILD14.experimentalSlotFixes) {
4011
- relocateToHostRoot(oldParentVNode.$elm$);
4012
- } else {
4013
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
4014
- }
4018
+ relocateToHostRoot(oldParentVNode.$elm$);
4015
4019
  }
4016
4020
  if (BUILD14.scoped || BUILD14.hydrateServerSide && 128 /* shadowNeedsScopedCss */) {
4017
4021
  addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
@@ -4043,7 +4047,7 @@ var relocateToHostRoot = (parentElm) => {
4043
4047
  var putBackInOriginalLocation = (parentElm, recursive) => {
4044
4048
  plt.$flags$ |= 1 /* isTmpDisconnected */;
4045
4049
  const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
4046
- if (parentElm["s-sr"] && BUILD14.experimentalSlotFixes) {
4050
+ if (parentElm["s-sr"]) {
4047
4051
  let node = parentElm;
4048
4052
  while (node = node.nextSibling) {
4049
4053
  if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
@@ -4231,7 +4235,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
4231
4235
  }
4232
4236
  if (BUILD14.vdomAttribute || BUILD14.reflect) {
4233
4237
  if (BUILD14.slot && tag === "slot" && !useNativeShadowDom) {
4234
- if (BUILD14.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
4238
+ if (oldVNode.$name$ !== newVNode2.$name$) {
4235
4239
  newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
4236
4240
  relocateToHostRoot(newVNode2.$elm$.parentElement);
4237
4241
  }
@@ -4274,7 +4278,7 @@ var markSlotContentForRelocation = (elm) => {
4274
4278
  const slotName = childNode["s-sn"];
4275
4279
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
4276
4280
  node = hostContentNodes[j];
4277
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD14.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
4281
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
4278
4282
  if (isNodeLocatedInSlot(node, slotName)) {
4279
4283
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
4280
4284
  checkSlotFallbackVisibility = true;
@@ -4318,19 +4322,19 @@ var nullifyVNodeRefs = (vNode) => {
4318
4322
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
4319
4323
  }
4320
4324
  };
4321
- var insertBefore = (parent, newNode, reference) => {
4325
+ var insertBefore = (parent, newNode, reference, isInitialLoad) => {
4322
4326
  if (BUILD14.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
4323
4327
  addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
4324
- } else if (BUILD14.experimentalSlotFixes && typeof newNode["s-sn"] === "string") {
4325
- if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
4328
+ } else if (typeof newNode["s-sn"] === "string") {
4329
+ if (BUILD14.experimentalSlotFixes && parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
4326
4330
  patchParentNode(newNode);
4327
4331
  }
4328
4332
  parent.insertBefore(newNode, reference);
4329
4333
  const { slotNode } = findSlotFromSlottedNode(newNode);
4330
- if (slotNode) dispatchSlotChangeEvent(slotNode);
4334
+ if (slotNode && !isInitialLoad) dispatchSlotChangeEvent(slotNode);
4331
4335
  return newNode;
4332
4336
  }
4333
- if (BUILD14.experimentalSlotFixes && parent.__insertBefore) {
4337
+ if (parent.__insertBefore) {
4334
4338
  return parent.__insertBefore(newNode, reference);
4335
4339
  } else {
4336
4340
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);
@@ -4418,7 +4422,12 @@ render() {
4418
4422
  if (!nodeToRelocate["s-ol"] && win.document) {
4419
4423
  const orgLocationNode = BUILD14.isDebug || BUILD14.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : win.document.createTextNode("");
4420
4424
  orgLocationNode["s-nr"] = nodeToRelocate;
4421
- insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
4425
+ insertBefore(
4426
+ nodeToRelocate.parentNode,
4427
+ nodeToRelocate["s-ol"] = orgLocationNode,
4428
+ nodeToRelocate,
4429
+ isInitialLoad
4430
+ );
4422
4431
  }
4423
4432
  }
4424
4433
  for (const relocateData of relocateNodes) {
@@ -4430,7 +4439,7 @@ render() {
4430
4439
  if (slotRefNode) {
4431
4440
  const parentNodeRef = slotRefNode.parentNode;
4432
4441
  let insertBeforeNode = slotRefNode.nextSibling;
4433
- if (!BUILD14.hydrateServerSide && (!BUILD14.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
4442
+ if (!BUILD14.hydrateServerSide && insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
4434
4443
  let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
4435
4444
  while (orgLocationNode) {
4436
4445
  let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
@@ -4451,10 +4460,18 @@ render() {
4451
4460
  const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
4452
4461
  if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
4453
4462
  if (nodeToRelocate !== insertBeforeNode) {
4454
- if (!BUILD14.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
4455
- nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
4463
+ insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode, isInitialLoad);
4464
+ if (nodeToRelocate.nodeType === 8 /* CommentNode */ && nodeToRelocate.nodeValue.startsWith("s-nt-")) {
4465
+ const textNode = win.document.createTextNode(nodeToRelocate.nodeValue.replace(/^s-nt-/, ""));
4466
+ textNode["s-hn"] = nodeToRelocate["s-hn"];
4467
+ textNode["s-sn"] = nodeToRelocate["s-sn"];
4468
+ textNode["s-sh"] = nodeToRelocate["s-sh"];
4469
+ textNode["s-sr"] = nodeToRelocate["s-sr"];
4470
+ textNode["s-ol"] = nodeToRelocate["s-ol"];
4471
+ textNode["s-ol"]["s-nr"] = textNode;
4472
+ insertBefore(nodeToRelocate.parentNode, textNode, nodeToRelocate, isInitialLoad);
4473
+ nodeToRelocate.parentNode.removeChild(nodeToRelocate);
4456
4474
  }
4457
- insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
4458
4475
  if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
4459
4476
  nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
4460
4477
  }
@@ -4472,14 +4489,21 @@ render() {
4472
4489
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
4473
4490
  relocateNodes.length = 0;
4474
4491
  }
4475
- if (BUILD14.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4492
+ if (BUILD14.slotRelocation && !useNativeShadowDom && !(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && hostElm["s-cr"]) {
4476
4493
  const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
4477
4494
  for (const childNode of children) {
4478
- if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"] && childNode.nodeType === 1 /* ElementNode */) {
4495
+ if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
4479
4496
  if (isInitialLoad && childNode["s-ih"] == null) {
4480
4497
  childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
4481
4498
  }
4482
- childNode.hidden = true;
4499
+ if (childNode.nodeType === 1 /* ElementNode */) {
4500
+ childNode.hidden = true;
4501
+ } else if (childNode.nodeType === 3 /* TextNode */ && !!childNode.nodeValue.trim()) {
4502
+ const textCommentNode = win.document.createComment("s-nt-" + childNode.nodeValue);
4503
+ textCommentNode["s-sn"] = childNode["s-sn"];
4504
+ insertBefore(childNode.parentNode, textCommentNode, childNode, isInitialLoad);
4505
+ childNode.parentNode.removeChild(childNode);
4506
+ }
4483
4507
  }
4484
4508
  }
4485
4509
  }
@@ -4541,6 +4565,10 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
4541
4565
  let maybePromise;
4542
4566
  if (isInitialLoad) {
4543
4567
  if (BUILD15.lazyLoad) {
4568
+ if (BUILD15.slotRelocation && hostRef.$deferredConnectedCallback$) {
4569
+ hostRef.$deferredConnectedCallback$ = false;
4570
+ safeCall(instance, "connectedCallback", void 0, elm);
4571
+ }
4544
4572
  if (BUILD15.hostListener) {
4545
4573
  hostRef.$flags$ |= 256 /* isListenReady */;
4546
4574
  if (hostRef.$queuedListeners$) {
@@ -5164,7 +5192,12 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
5164
5192
  hostRef.$flags$ |= 128 /* isWatchReady */;
5165
5193
  }
5166
5194
  endNewInstance();
5167
- fireConnectedCallback(hostRef.$lazyInstance$, elm);
5195
+ const needsDeferredCallback = BUILD18.slotRelocation && cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
5196
+ if (!needsDeferredCallback) {
5197
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
5198
+ } else {
5199
+ hostRef.$deferredConnectedCallback$ = true;
5200
+ }
5168
5201
  } else {
5169
5202
  Cstr = elm.constructor;
5170
5203
  const cmpTag = elm.localName;
@@ -5369,6 +5402,8 @@ var proxyCustomElement = (Cstr, compactMeta) => {
5369
5402
  patchTextContent(Cstr.prototype);
5370
5403
  }
5371
5404
  }
5405
+ } else if (BUILD21.cloneNodeFix) {
5406
+ patchCloneNode(Cstr.prototype);
5372
5407
  }
5373
5408
  if (BUILD21.hydrateClientSide && BUILD21.shadowDom) {
5374
5409
  hydrateScopedToShadow();
@@ -5521,10 +5556,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
5521
5556
  }
5522
5557
  const tagName = BUILD22.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : transformTag(cmpMeta.$tagName$);
5523
5558
  const HostElement = class extends HTMLElement {
5559
+ ["s-p"];
5560
+ ["s-rc"];
5561
+ hasRegisteredEventListeners = false;
5524
5562
  // StencilLazyHost
5525
5563
  constructor(self) {
5526
5564
  super(self);
5527
- this.hasRegisteredEventListeners = false;
5528
5565
  self = this;
5529
5566
  registerHost(self, cmpMeta);
5530
5567
  if (BUILD22.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
@@ -5601,6 +5638,8 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
5601
5638
  patchTextContent(HostElement.prototype);
5602
5639
  }
5603
5640
  }
5641
+ } else if (BUILD22.cloneNodeFix) {
5642
+ patchCloneNode(HostElement.prototype);
5604
5643
  }
5605
5644
  if (BUILD22.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
5606
5645
  HostElement.formAssociated = true;
@@ -6311,7 +6350,7 @@ var isMemberInElement = (elm, memberName) => {
6311
6350
  var registerComponents = (Cstrs) => {
6312
6351
  for (const Cstr of Cstrs) {
6313
6352
  const exportName = Cstr.cmpMeta.$tagName$;
6314
- const transformedTagName = everywhere.tagTransform(exportName);
6353
+ const transformedTagName = $stencilTagTransform.transformTag(exportName);
6315
6354
  cmpModules.set(exportName, {
6316
6355
  [exportName]: Cstr
6317
6356
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/hydrate",
3
- "version": "4.40.1",
3
+ "version": "4.41.0-dev.1767652714.953346e",
4
4
  "description": "Stencil internal hydrate platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true